Skip to content

Commit

Permalink
feat: fork into custom local add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe committed Dec 17, 2024
1 parent a185f1c commit ff03881
Show file tree
Hide file tree
Showing 110 changed files with 5,930 additions and 1,065 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"no-console": ["warn", { "allow": ["warn", "error"] }],
"quotes": ["warn", "double"],
"semi": ["warn", "always"],
"space-before-blocks": ["warn", "always"]
"space-before-blocks": ["warn", "always"],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
},
"overrides": [
{
Expand Down
8 changes: 4 additions & 4 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ export default {
},
},
},
// Local: plugins/storybook-addon-custom-properties
"@spectrum-tools/storybook-addon-custom-properties",
// https://github.com/storybookjs/storybook/tree/next/code/addons/a11y
"@storybook/addon-a11y",
// https://www.npmjs.com/package/@whitespace/storybook-addon-html
"@whitespace/storybook-addon-html",
// https://storybook.js.org/addons/@etchteam/storybook-addon-status
"@storybook/addon-a11y",
// https://www.npmjs.com/package/@whitespace/storybook-addon-html
"@etchteam/storybook-addon-status",
// https://github.com/storybookjs/storybook/tree/next/code/addons/interactions
"@storybook/addon-interactions",
// https://www.chromatic.com/docs/visual-testing-addon/
"@chromaui/addon-visual-tests",
// https://storybook.js.org/addons/@storybook/addon-designs/
"@storybook/addon-designs",
// https://github.com/ljcl/storybook-addon-cssprops
"@ljcl/storybook-addon-cssprops",
],
core: {
disableTelemetry: true,
Expand Down
1 change: 1 addition & 0 deletions .storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@babel/core": "^7.26.0",
"@chromaui/addon-visual-tests": "^1.0.0",
"@etchteam/storybook-addon-status": "^5.0.0",
"@spectrum-tools/storybook-addon-custom-properties": "workspace:^",
"@storybook/addon-a11y": "^8.4.7",
"@storybook/addon-actions": "^8.4.7",
"@storybook/addon-console": "^3.0.0",
Expand Down
1 change: 1 addition & 0 deletions components/accordion/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
&:lang(ja),
&:lang(zh),
&:lang(ko) {
/* @description When the language is CJK, update line-height values to prevent cut off diacritics */
--spectrum-accordion-item-header-line-height: var(--spectrum-cjk-line-height-100);
--spectrum-accordion-item-content-line-height: var(--spectrum-cjk-line-height-100);
}
Expand Down
14 changes: 2 additions & 12 deletions components/accordion/stories/accordion.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Template as Link } from "@spectrum-css/link/stories/template.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { size } from "@spectrum-css/preview/types";
import { Template as Typography } from "@spectrum-css/typography/stories/template.js";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AccordionGroup } from "./accordion.test.js";
import { Template } from "./template.js";

/**
* The accordion element contains a list of items that can be expanded or collapsed to reveal additional content or information associated with each item. There can be zero expanded items, exactly one expanded item, or more than one item expanded at a time, depending on the configuration. This list of items is defined by child accordion item elements.
*/
Expand Down Expand Up @@ -63,17 +63,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/actionbar/stories/actionbar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { default as CloseButton } from "@spectrum-css/closebutton/stories/closeb
import { default as Popover } from "@spectrum-css/popover/stories/popover.stories.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isEmphasized, isOpen } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { ActionBarGroup } from "./actionbar.test.js";
Expand Down Expand Up @@ -69,17 +70,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/actionbutton/stories/actionbutton.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { default as IconStories } from "@spectrum-css/icon/stories/icon.stories.
import { Sizes } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isActive, isDisabled, isEmphasized, isFocused, isHovered, isQuiet, isSelected, size, staticColor } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { ActionButtonGroup } from "./actionbutton.test.js";
Expand Down Expand Up @@ -90,17 +91,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
docs: {
story: {
height: "auto",
Expand Down
13 changes: 2 additions & 11 deletions components/actiongroup/stories/actiongroup.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { default as ActionButton } from "@spectrum-css/actionbutton/stories/acti
import { Sizes } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { size } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { ActionGroups } from "./actiongroup.test.js";
Expand Down Expand Up @@ -99,17 +100,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
};

Expand Down
6 changes: 1 addition & 5 deletions components/actionmenu/stories/actionmenu.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ export default {
],
},
packageJson,
cssprops: {
...(Popover?.parameters?.cssprops ?? {}),
...(ActionButton?.parameters?.cssprops ?? {}),
...(Menu.parameters?.cssprops ?? {}),
},
cssprops: false,
docs: {
story: {
height: "200px",
Expand Down
13 changes: 2 additions & 11 deletions components/alertbanner/stories/alertbanner.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isOpen } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AlertBannerGroup } from "./alertbanner.test.js";
Expand Down Expand Up @@ -75,17 +76,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
};

Expand Down
13 changes: 2 additions & 11 deletions components/alertdialog/stories/alertdialog.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { withUnderlayWrapper } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isOpen } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AlertDialogGroup } from "./alertdialog.test.js";
Expand Down Expand Up @@ -56,17 +57,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
decorators: [
withUnderlayWrapper,
Expand Down
13 changes: 2 additions & 11 deletions components/asset/stories/asset.stories.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AssetGroup } from "./asset.test.js";
Expand Down Expand Up @@ -38,17 +39,7 @@ export default {
parameters: {
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/assetcard/stories/assetcard.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { default as Checkbox } from "@spectrum-css/checkbox/stories/checkbox.stories.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isFocused, isSelected } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AssetCardGroup } from "./assetcard.test.js";
Expand Down Expand Up @@ -88,17 +89,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/assetlist/stories/assetlist.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { default as Checkbox } from "@spectrum-css/checkbox/stories/checkbox.stories.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AssetListGroup } from "./assetlist.test.js";
Expand All @@ -22,17 +23,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
};

Expand Down
13 changes: 2 additions & 11 deletions components/avatar/stories/avatar.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Sizes } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isDisabled, size } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { AvatarGroup } from "./avatar.test.js";
Expand Down Expand Up @@ -64,17 +65,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/badge/stories/badge.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { default as IconStories } from "@spectrum-css/icon/stories/icon.stories.
import { ArgGrid } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { size } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { BadgeGroup } from "./badge.test.js";
Expand Down Expand Up @@ -68,17 +69,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
tags: ["!autodocs"],
};
Expand Down
13 changes: 2 additions & 11 deletions components/breadcrumb/stories/breadcrumb.stories.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isDragged } from "@spectrum-css/preview/types";
import styles from "../index.css?inline";
import metadata from "../metadata/metadata.json";
import packageJson from "../package.json";
import { BreadcrumbGroup } from "./breadcrumb.test.js";
Expand Down Expand Up @@ -47,17 +48,7 @@ export default {
},
packageJson,
metadata,
cssprops: {
...metadata.modifiers.reduce((collection, item) => {
const key = item.replace(/^--/, "");
collection[key] = {
category: "Modifiers",
control: key.includes("color") ? "color" : "text",
value: key.includes("color") ? undefined : " ",
};
return collection;
}, {})
},
cssprops: { styles },
},
};

Expand Down
Loading

0 comments on commit ff03881

Please sign in to comment.