Skip to content

Commit a0cb9c2

Browse files
committed
feat(storybook): custom properties panel
1 parent 72f21e6 commit a0cb9c2

File tree

201 files changed

+42947
-9109
lines changed

Some content is hidden

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

201 files changed

+42947
-9109
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: 2 additions & 6 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
*
@@ -31,7 +29,7 @@ body {
3129
.spectrum {
3230
color: var(--spectrum-neutral-content-color-default);
3331
background-color: var(--spectrum-background-base-color);
34-
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
32+
-webkit-tap-highlight-color: rgb(0, 0, 0, 0%);
3533
}
3634

3735
.spectrum .spectrum-examples-static-black {
@@ -61,7 +59,7 @@ svg:has(symbol):not(:has(use)) {
6159
line-height: normal;
6260
letter-spacing: normal;
6361
text-transform: none;
64-
border-block-end: 1px solid hsla(203deg, 50%, 30%, 15%);
62+
border-block-end: 1px solid hsl(203deg, 50%, 30%, 15%);
6563
}
6664

6765
/* Force the modal wrapper to be contained by the frame not the viewport */
@@ -76,5 +74,3 @@ svg:has(symbol):not(:has(use)) {
7674
story view), due to Storybook's inline style that sets overflow: auto */
7775
overflow: visible !important;
7876
}
79-
80-
/* 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
@@ -68,6 +68,8 @@ export default {
6868
name: "@storybook/addon-actions",
6969
options: {},
7070
},
71+
// https://github.com/ljcl/storybook-addon-cssprops
72+
"@ljcl/storybook-addon-cssprops",
7173
// https://www.npmjs.com/package/@whitespace/storybook-addon-html
7274
"@whitespace/storybook-addon-html",
7375
// 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
@@ -48,6 +48,7 @@
4848
"@babel/core": "^7.28.0",
4949
"@chromatic-com/storybook": "^3.2.7",
5050
"@etchteam/storybook-addon-status": "^5.0.0",
51+
"@ljcl/storybook-addon-cssprops": "4.0.0",
5152
"@storybook/addon-a11y": "8.4.7",
5253
"@storybook/addon-actions": "8.4.7",
5354
"@storybook/addon-designs": "^8.2.1",

0 commit comments

Comments
 (0)