Skip to content

Commit 4ef5a4a

Browse files
committed
feat(storybook): custom properties panel
1 parent 4b146e3 commit 4ef5a4a

File tree

200 files changed

+43125
-9249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+43125
-9249
lines changed

.changeset/eleven-plants-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spectrum-css/generator": patch
3+
---
4+
5+
Update story templates to include the cssprops imports

.changeset/new-bulldogs-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@spectrum-css/preview": minor
3+
---
4+
5+
New feature: Custom properties panel added to the development preview showing a list of modifiable custom properties as loaded from the metadata/metadata.json resource in each component.

.eslintrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"parserOptions": {
99
"sourceType": "module"
1010
},
11+
"settings": {
12+
"react": {
13+
"version": "detect"
14+
}
15+
},
1116
"extends": "eslint:recommended",
1217
"rules": {
1318
"brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
@@ -17,7 +22,8 @@
1722
"no-console": ["warn", { "allow": ["warn", "error"] }],
1823
"quotes": ["warn", "double"],
1924
"semi": ["warn", "always"],
20-
"space-before-blocks": ["warn", "always"]
25+
"space-before-blocks": ["warn", "always"],
26+
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
2127
},
2228
"overrides": [
2329
{
@@ -174,6 +180,7 @@
174180
".storybook/*.js",
175181
".storybook/**/*.js"
176182
],
183+
"extends": ["plugin:react/recommended", "plugin:react/jsx-runtime"],
177184
"parserOptions": {
178185
"ecmaVersion": "latest",
179186
"sourceType": "module",

.storybook/assets/base.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* stylelint-disable selector-class-pattern -- Targeting pre-defined Storybook classes */
2-
31
/*!
42
* Copyright 2024 Adobe. All rights reserved.
53
*
@@ -88,5 +86,3 @@ svg:has(symbol):not(:has(use)) {
8886
story view), due to Storybook's inline style that sets overflow: auto */
8987
overflow: visible !important;
9088
}
91-
92-
/* stylelint-enable selector-class-pattern */

.storybook/decorators/utilities.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,12 +556,12 @@ export const renderContent = (content = [], {
556556
if (content.length === 0) return nothing;
557557

558558
return html`
559-
${content.map((c) => {
559+
${content.map((c, idx) => {
560560
if (typeof c === "undefined") return nothing;
561561
562562
/* If the content is an object (but not a lit object), we need to merge the object with the template */
563563
if (typeof c !== "string" && (typeof c === "object" && !c._$litType$)) {
564-
return callback({ ...args, ...c }, context);
564+
return callback({ ...args, ...c, idx }, context);
565565
}
566566
567567
if (typeof c === "function") {

.storybook/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default {
6363
name: "@storybook/addon-actions",
6464
options: {},
6565
},
66+
// https://github.com/ljcl/storybook-addon-cssprops
67+
"@ljcl/storybook-addon-cssprops",
6668
// https://www.npmjs.com/package/@whitespace/storybook-addon-html
6769
"@whitespace/storybook-addon-html",
6870
// https://github.com/storybookjs/storybook/tree/next/code/addons/a11y

.storybook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@babel/core": "^7.28.0",
5050
"@chromatic-com/storybook": "^3.2.7",
5151
"@etchteam/storybook-addon-status": "^5.0.0",
52+
"@ljcl/storybook-addon-cssprops": "4.0.0",
5253
"@storybook/addon-a11y": "8.4.7",
5354
"@storybook/addon-actions": "8.4.7",
5455
"@storybook/addon-designs": "^8.2.1",

0 commit comments

Comments
 (0)