Skip to content

Commit f4f855a

Browse files
committed
feat(storybook): display custom properties
1 parent 1e8d49b commit f4f855a

File tree

216 files changed

+45472
-9242
lines changed

Some content is hidden

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

216 files changed

+45472
-9242
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",

.github/workflows/development.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ jobs:
112112
- '*.md'
113113
- .storybook/*.md
114114
- .storybook/*/*.md
115-
- .storybook/*/*.mdx
116115
- components/*/*.md
117-
- components/*/stories/*.mdx
118116
- plugins/*/*.md
119117
- tokens/*.md
120118
- tools/*/*.md

.github/workflows/lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ jobs:
116116
reporter: github-pr-review
117117
filter_mode: diff_context
118118
# eslint_flags: "components/*/stories/*.js"
119-
eslint_flags: "${{ inputs.eslint_added_files }} ${{ inputs.eslint_modified_files }}"
119+
eslint_flags: "--config ${{ github.workspace }}/.eslintrc ${{ inputs.eslint_added_files }} ${{ inputs.eslint_modified_files }}"
120120

121121
- name: Run markdownlint on documentation
122122
uses: reviewdog/[email protected]
123+
if: ${{ inputs.mdlint_added_files != '' || inputs.mdlint_modified_files != '' }}
123124
with:
124125
reporter: github-pr-review
125126
filter_mode: diff_context

.storybook/assets/base.css

Lines changed: 13 additions & 5 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 */
@@ -77,4 +75,14 @@ svg:has(symbol):not(:has(use)) {
7775
overflow: visible !important;
7876
}
7977

80-
/* stylelint-enable selector-class-pattern */
78+
#panel-tab-content tr th:nth-child(1),
79+
#panel-tab-content tr th:nth-child(3),
80+
#panel-tab-content tr td:nth-child(1),
81+
#panel-tab-content tr td:nth-child(3) {
82+
min-inline-size: 100px !important;
83+
}
84+
85+
#panel-tab-content tr th:nth-child(2),
86+
#panel-tab-content tr td:nth-child(2) {
87+
max-inline-size: 500px !important;
88+
}

.storybook/assets/index.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
*
@@ -125,5 +123,3 @@ div.sb-bar {
125123
color: var(--spectrum-neutral-content-color-default) !important;
126124
background-color: var(--spectrum-background-layer-2-color) !important;
127125
}
128-
129-
/* 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: 2 additions & 1 deletion
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",
@@ -60,7 +61,7 @@
6061
"@storybook/core-events": "8.4.7",
6162
"@storybook/manager-api": "8.4.7",
6263
"@storybook/preview-api": "8.4.7",
63-
"@storybook/test-runner": "^0.22.0",
64+
"@storybook/test-runner": "^0.23.0",
6465
"@storybook/theming": "8.4.7",
6566
"@storybook/web-components-vite": "8.4.7",
6667
"@whitespace/storybook-addon-html": "^7.0.0",

0 commit comments

Comments
 (0)