diff --git a/.github/actions/file-diff/index.js b/.github/actions/file-diff/index.js index 6aa42bdba8c..c8f13dd6254 100644 --- a/.github/actions/file-diff/index.js +++ b/.github/actions/file-diff/index.js @@ -1,5 +1,5 @@ /*! - * Copyright 2024 Adobe. All rights reserved. + * Copyright 2023 Adobe. All rights reserved. * * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy diff --git a/.github/actions/file-diff/utilities.js b/.github/actions/file-diff/utilities.js index e7b4e4bed91..a4aa91331f6 100644 --- a/.github/actions/file-diff/utilities.js +++ b/.github/actions/file-diff/utilities.js @@ -1,5 +1,5 @@ /*! - * Copyright 2024 Adobe. All rights reserved. + * Copyright 2023 Adobe. All rights reserved. * * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy diff --git a/.prettierrc b/.prettierrc index 5eb90a7979f..202b6470b07 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,11 +2,11 @@ "tabWidth": 2, "useTabs": true, "overrides": [ - { - "files": "*.css", - "options": { - "printWidth": 500 - } - } - ] + { + "files": "*.css", + "options": { + "printWidth": 500 + } + } + ] } diff --git a/.storybook/assets/index.css b/.storybook/assets/index.css index 60af6d6d954..a267316166b 100644 --- a/.storybook/assets/index.css +++ b/.storybook/assets/index.css @@ -1,5 +1,5 @@ /*! - * Copyright 2024 Adobe. All rights reserved. + * Copyright 2023 Adobe. All rights reserved. * * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy diff --git a/.storybook/decorators/context.js b/.storybook/decorators/context.js index 894d00f5fa1..dbc0bb740fe 100644 --- a/.storybook/decorators/context.js +++ b/.storybook/decorators/context.js @@ -40,11 +40,13 @@ export const withContextWrapper = makeDecorator({ }; useEffect(() => { + const isRaw = Boolean(context === "raw"); + const isDefault = Boolean(context === "spectrum"); const isExpress = Boolean(context === "express"); - const isLegacy = Boolean(context !== "spectrum"); + const isLegacy = Boolean(context === "legacy"); // viewMode is either "docs" or "story" - if (viewMode === "docs") { + if (viewMode === "docs" && !isRaw) { // add the default classes to the body to ensure labels, headings, and borders are styled correctly document.body.classList.add("spectrum", "spectrum--light", "spectrum--medium"); } @@ -70,19 +72,18 @@ export const withContextWrapper = makeDecorator({ } // Every container gets the spectrum class - container.classList.toggle("spectrum", true); + container.classList.toggle("spectrum", !isRaw); // S1 and S1 Express get the legacy class - container.classList.toggle("spectrum--legacy", isLegacy); + container.classList.toggle("spectrum--legacy", isLegacy || isExpress); // Express only gets the express class container.classList.toggle("spectrum--express", isExpress); // Add/remove the base styles for the global, spectrum, and express contexts - toggleStyles(globalContainer, "vars-base", !isLegacy ? tokens?.base : legacy?.global?.base, true); - if (isLegacy) { - toggleStyles(contextContainer, "vars-base-spectrum", legacy?.spectrum?.base, true); // @todo this probably becomes "legacy" in the updated system - toggleStyles(contextContainer, "vars-base-express", legacy?.express?.base, isExpress); - } + toggleStyles(globalContainer, "vars-shared", tokens?.base, isDefault); + toggleStyles(globalContainer, "vars-shared-legacy-express", legacy?.global?.base, isLegacy || isExpress); + toggleStyles(contextContainer, "vars-shared-legacy", legacy?.spectrum?.base, isLegacy); + toggleStyles(contextContainer, "vars-shared-express", legacy?.express?.base, isExpress); // Darkest is deprecated in Spectrum 2 if (!isLegacy && color === "darkest") color = "dark"; @@ -91,23 +92,22 @@ export const withContextWrapper = makeDecorator({ // Force light or dark mode if the static color is set const isColor = c === staticColorSettings[staticKey]?.color || !staticKey && c === color; - container.classList.toggle(`spectrum--${c}`, isColor); + container.classList.toggle(`spectrum--${c}`, isColor && !isRaw); - toggleStyles(colorsContainer, `vars-${c}`, !isLegacy ? tokens?.[c] : legacy?.global?.[c], isColor); - if (isLegacy) { - toggleStyles(colorsContainer, `vars-${c}-spectrum`, legacy?.spectrum?.[c], isColor); - toggleStyles(colorsContainer, `vars-${c}-express`, legacy?.express?.[c], isExpress && isColor); - } + toggleStyles(colorsContainer, `vars-${c}`, tokens?.[c], isColor && isDefault); + toggleStyles(colorsContainer, `vars-${c}-legacy-express`, legacy?.global?.[c], isColor && (isLegacy || isExpress)); + toggleStyles(colorsContainer, `vars-${c}-legacy`, legacy?.spectrum?.[c], isColor && isLegacy); + toggleStyles(colorsContainer, `vars-${c}-express`, legacy?.express?.[c], isColor && isExpress); } for (const s of ["medium", "large"]) { - container.classList.toggle(`spectrum--${s}`, s === scale); + const isScale = s === scale; + container.classList.toggle(`spectrum--${s}`, isScale && !isRaw); - toggleStyles(scalesContainer, `vars-${s}`, !isLegacy ? tokens?.[s] : legacy?.global?.[s], s === scale); - if (isLegacy) { - toggleStyles(scalesContainer, `vars-${s}-spectrum`, legacy?.spectrum?.[s], s === scale); - toggleStyles(scalesContainer, `vars-${s}-express`, legacy?.express?.[s], isExpress && s === scale); - } + toggleStyles(scalesContainer, `vars-${s}`, tokens?.[s], isScale && isDefault); + toggleStyles(scalesContainer, `vars-${s}-legacy-express`, legacy?.global?.[s], isScale && (isLegacy || isExpress)); + toggleStyles(scalesContainer, `vars-${s}-legacy`, legacy?.spectrum?.[s], isScale && isLegacy); + toggleStyles(scalesContainer, `vars-${s}-express`, legacy?.express?.[s], isScale && isExpress); } // Start by removing the background color from the container and then add it back if needed diff --git a/.storybook/types/global.js b/.storybook/types/global.js index 2ea063d9497..92689f1c7a6 100644 --- a/.storybook/types/global.js +++ b/.storybook/types/global.js @@ -10,9 +10,10 @@ export default { showName: true, toolbar: { items: [ - { value: "express", title: "Express" }, - { value: "legacy", title: "Spectrum 1", right: "legacy" }, { value: "spectrum", title: "Spectrum 2", right: "default" }, + { value: "legacy", title: "Spectrum 1", right: "legacy" }, + { value: "express", title: "Express" }, + { value: "raw", title: "Token-free", right: "raw" }, ], dynamicTitle: true, }, diff --git a/components/accordion/stories/accordion.mdx b/components/accordion/stories/accordion.mdx index 19ac7e9f5f2..5064fc1d626 100644 --- a/components/accordion/stories/accordion.mdx +++ b/components/accordion/stories/accordion.mdx @@ -1,10 +1,10 @@ import { - Canvas, - ArgTypes, - Meta, - Description, - Title, - Subtitle, + Canvas, + ArgTypes, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as AccordionStories from "./accordion.stories"; diff --git a/components/actionbar/stories/actionbar.mdx b/components/actionbar/stories/actionbar.mdx index 1eb508dd88a..fbe7550faab 100644 --- a/components/actionbar/stories/actionbar.mdx +++ b/components/actionbar/stories/actionbar.mdx @@ -1,10 +1,10 @@ import { - Canvas, - ArgTypes, - Meta, - Description, - Title, - Subtitle, + Canvas, + ArgTypes, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as ActionBarStories from "./actionbar.stories"; diff --git a/components/asset/stories/asset.mdx b/components/asset/stories/asset.mdx index 7d14333aee3..2bb93e04fc3 100644 --- a/components/asset/stories/asset.mdx +++ b/components/asset/stories/asset.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as AssetStories from "./asset.stories"; diff --git a/components/assetcard/stories/assetcard.mdx b/components/assetcard/stories/assetcard.mdx index 827a0fcae87..2af770c7be6 100644 --- a/components/assetcard/stories/assetcard.mdx +++ b/components/assetcard/stories/assetcard.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as AssetCardStories from "./assetcard.stories"; diff --git a/components/avatar/stories/avatar.mdx b/components/avatar/stories/avatar.mdx index 86ec89bded7..f127502cdda 100644 --- a/components/avatar/stories/avatar.mdx +++ b/components/avatar/stories/avatar.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as AvatarStories from "./avatar.stories"; diff --git a/components/badge/stories/badge.mdx b/components/badge/stories/badge.mdx index 75cc601c197..5f1d511cd5e 100644 --- a/components/badge/stories/badge.mdx +++ b/components/badge/stories/badge.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/calendar/stories/calendar.mdx b/components/calendar/stories/calendar.mdx index b9453aeb689..d9b2407d0cd 100644 --- a/components/calendar/stories/calendar.mdx +++ b/components/calendar/stories/calendar.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/card/stories/card.mdx b/components/card/stories/card.mdx index 43f76e8342b..7124b607cfd 100644 --- a/components/card/stories/card.mdx +++ b/components/card/stories/card.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/coachmark/stories/coachmark.mdx b/components/coachmark/stories/coachmark.mdx index aa6c638de97..2e5cefc4119 100644 --- a/components/coachmark/stories/coachmark.mdx +++ b/components/coachmark/stories/coachmark.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/colorarea/stories/colorarea.mdx b/components/colorarea/stories/colorarea.mdx index f92e2e19d44..03a94857da7 100644 --- a/components/colorarea/stories/colorarea.mdx +++ b/components/colorarea/stories/colorarea.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/colorhandle/stories/colorhandle.mdx b/components/colorhandle/stories/colorhandle.mdx index 71cc8eaaeb2..c40a7151319 100644 --- a/components/colorhandle/stories/colorhandle.mdx +++ b/components/colorhandle/stories/colorhandle.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/colorloupe/stories/colorloupe.mdx b/components/colorloupe/stories/colorloupe.mdx index a13943578b4..4d21e93a089 100644 --- a/components/colorloupe/stories/colorloupe.mdx +++ b/components/colorloupe/stories/colorloupe.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/colorslider/stories/colorslider.mdx b/components/colorslider/stories/colorslider.mdx index 23b764cebbd..2ba78a2aa5a 100644 --- a/components/colorslider/stories/colorslider.mdx +++ b/components/colorslider/stories/colorslider.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/colorwheel/stories/colorwheel.mdx b/components/colorwheel/stories/colorwheel.mdx index 5ceb8c2c81b..cc71a43392c 100644 --- a/components/colorwheel/stories/colorwheel.mdx +++ b/components/colorwheel/stories/colorwheel.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/combobox/stories/combobox.mdx b/components/combobox/stories/combobox.mdx index 5c0500778b4..9f10a1f38d1 100644 --- a/components/combobox/stories/combobox.mdx +++ b/components/combobox/stories/combobox.mdx @@ -1,10 +1,10 @@ import { - Canvas, - ArgTypes, - Meta, - Description, - Title, - Subtitle, + Canvas, + ArgTypes, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; import * as ComboboxStories from "./combobox.stories"; diff --git a/components/fieldgroup/stories/fieldgroup.mdx b/components/fieldgroup/stories/fieldgroup.mdx index 68ed28712f8..acfe5354b70 100644 --- a/components/fieldgroup/stories/fieldgroup.mdx +++ b/components/fieldgroup/stories/fieldgroup.mdx @@ -1,10 +1,10 @@ import { - ArgTypes, - Canvas, - Meta, - Description, - Title, - Subtitle, + ArgTypes, + Canvas, + Meta, + Description, + Title, + Subtitle, } from "@storybook/blocks"; import { ComponentDetails } from "@spectrum-css/preview/blocks"; diff --git a/components/icon/stories/icon.stories.js b/components/icon/stories/icon.stories.js index 087dd13fac8..552369fd6d2 100644 --- a/components/icon/stories/icon.stories.js +++ b/components/icon/stories/icon.stories.js @@ -1,5 +1,5 @@ -import { TestTemplate, UIArrowsTemplate, UIDefaultTemplate, WorkflowDefaultTemplate, WorkflowSizingTemplate } from "./template"; import { version } from "../package.json"; +import { TestTemplate, UIArrowsTemplate, UIDefaultTemplate, WorkflowDefaultTemplate, WorkflowSizingTemplate } from "./template"; import { uiIconSizes, uiIconsWithDirections, workflowIcons } from "./utilities.js"; /** diff --git a/components/picker/stories/picker.stories.js b/components/picker/stories/picker.stories.js index cac4c46626a..9f807e7d470 100644 --- a/components/picker/stories/picker.stories.js +++ b/components/picker/stories/picker.stories.js @@ -1,8 +1,7 @@ +import { WithDividers as MenuStories } from "@spectrum-css/menu/stories/menu.stories.js"; import { html } from "lit"; import { styleMap } from "lit/directives/style-map.js"; import { version } from "../package.json"; - -import { WithDividers as MenuStories } from "@spectrum-css/menu/stories/menu.stories.js"; import { Template } from "./template"; /** diff --git a/tokens/dist/index.css b/tokens/dist/index.css index 8e0cfd40361..40e10dd0503 100644 --- a/tokens/dist/index.css +++ b/tokens/dist/index.css @@ -3477,3 +3477,5 @@ --spectrum-ui-icon-medium-display:block; --spectrum-ui-icon-large-display:none; } + +/*# sourceMappingURL=index.css.map */ \ No newline at end of file