diff --git a/.changeset/eight-spiders-help.md b/.changeset/eight-spiders-help.md
new file mode 100644
index 00000000000..c916b2e375c
--- /dev/null
+++ b/.changeset/eight-spiders-help.md
@@ -0,0 +1,11 @@
+---
+"@spectrum-css/calendar": patch
+"@spectrum-css/combobox": patch
+"@spectrum-css/datepicker": patch
+"@spectrum-css/menu": patch
+"@spectrum-css/picker": patch
+"@spectrum-css/slider": patch
+"@spectrum-css/stepper": patch
+---
+
+Build change to remove the `postcss-preset-env` polyfill for the dist output of `:not` selectors containing multiple selectors, to avoid an unintended increase in specificity, which caused some visual regressions.
diff --git a/.changeset/eleven-cooks-destroy.md b/.changeset/eleven-cooks-destroy.md
new file mode 100644
index 00000000000..97ffb79d9b3
--- /dev/null
+++ b/.changeset/eleven-cooks-destroy.md
@@ -0,0 +1,5 @@
+---
+"@spectrum-css/tokens": patch
+---
+
+Uses the latest release from Spectrum Tokens (13.0.0-beta.35)
diff --git a/.changeset/fresh-seahorses-join.md b/.changeset/fresh-seahorses-join.md
new file mode 100644
index 00000000000..34f9fb60e01
--- /dev/null
+++ b/.changeset/fresh-seahorses-join.md
@@ -0,0 +1,8 @@
+---
+"@spectrum-css/button": patch
+---
+
+#### refactor: remove spectrum-ButtonWithFocusRing placeholder class extend
+
+Removes the need for the extend from this placeholder class, as the styles it provides have diverged slightly from what is in button and it was causing some unnecessary CSS to override.
+This should not result in any changed visuals or behavior, as the same CSS has been integrated.
\ No newline at end of file
diff --git a/.changeset/friendly-brooms-itch.md b/.changeset/friendly-brooms-itch.md
new file mode 100644
index 00000000000..71affa08881
--- /dev/null
+++ b/.changeset/friendly-brooms-itch.md
@@ -0,0 +1,44 @@
+---
+"@spectrum-css/menu": major
+"@spectrum-css/popover": minor
+"@spectrum-css/tray": minor
+"@spectrum-css/tokens": patch
+---
+
+Removes custom menu item background color tokens: Since `@adobe/spectrum-tokens` has been updated to include many tokens relating to the menu component, including some that replace custom tokens that had previously been added. As such, these custom menu item color tokens that are now available from `@adobe/spectrum-tokens` have been removed.
+
+Spectrum 2 Menu migration:
+
+In addition to small token and minor style changes, there were several new features that were added to this version of menu, including:
+
+- A thumbnail can now be added to the menu item label
+- A section description can now be added below the menu section heading
+- The actions area previously held value text, action switches for multi-select, and the drill-in for a submenu--in this version, an external link action can now be added
+- Menu items now receive corner rounding, which is visible on hover/focus/active states
+- The focus indicator has been updated--instead of a blue line on the left (start side) of the menu item, the whole element now receives an outline
+- Menu items now have the S2 down state transform
+
+In order to accommodate menu item focus outlines, horizontal padding has been added to popover and tray.
+
+The following mods have been added:
+
+- `--mod-menu-item-corner-rounding`
+- `--mod-menu-item-description-font-weight`
+- `--mod-menu-item-label-font-weight`
+- `--mod-menu-item-thumbnail-height`
+- `--mod-menu-item-thumbnail-opacity-disabled`
+- `--mod-menu-item-thumbnail-to-label`
+- `--mod-menu-item-thumbnail-width`
+- `--mod-menu-item-top-to-drillin`
+- `--mod-menu-item-top-to-icon`
+- `--mod-menu-item-top-to-thumbnail`
+- `--mod-menu-linkout-icon-height`
+- `--mod-menu-linkout-icon-width`
+- `--mod-menu-section-description-color`
+- `--mod-menu-section-description-font-size`
+- `--mod-menu-section-description-font-weight`
+- `--mod-menu-section-description-line-height`
+- `--mod-menu-section-description-line-height-cjk`
+- `--mod-menu-section-header-to-description`
+- `--mod-popover-content-area-spacing-horizontal`
+- `--mod-tray-edge-to-content-area`
diff --git a/.changeset/nine-kings-repair.md b/.changeset/nine-kings-repair.md
new file mode 100644
index 00000000000..0714bbb8274
--- /dev/null
+++ b/.changeset/nine-kings-repair.md
@@ -0,0 +1,15 @@
+---
+"@spectrum-css/button": major
+---
+
+#### Spectrum 2 migration
+Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+- Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+- Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+- The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+The following `--mod` custom properties have been renamed:
+- `--mod-line-height-100` has been renamed to `--mod-button-line-height`
+- `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`
+- `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`
+- `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`
diff --git a/.changeset/perfect-dogs-smash.md b/.changeset/perfect-dogs-smash.md
new file mode 100644
index 00000000000..11a91efdd47
--- /dev/null
+++ b/.changeset/perfect-dogs-smash.md
@@ -0,0 +1,5 @@
+---
+"@spectrum-css/button": patch
+---
+
+chore: run branch through formatter
diff --git a/.changeset/pre.json b/.changeset/pre.json
new file mode 100644
index 00000000000..936fb10795d
--- /dev/null
+++ b/.changeset/pre.json
@@ -0,0 +1,110 @@
+{
+ "mode": "pre",
+ "tag": "next",
+ "initialVersions": {
+ "@spectrum-tools/gh-action-file-diff": "2.0.5",
+ "@spectrum-css/preview": "8.1.0-next.1",
+ "@spectrum-css/accordion": "4.2.7-next.2",
+ "@spectrum-css/actionbar": "7.2.5-next.2",
+ "@spectrum-css/actionbutton": "5.2.7-next.2",
+ "@spectrum-css/actiongroup": "5.0.0-next.3",
+ "@spectrum-css/actionmenu": "5.1.4-next.2",
+ "@spectrum-css/alertbanner": "1.1.42-next.2",
+ "@spectrum-css/alertdialog": "1.2.5-next.2",
+ "@spectrum-css/asset": "4.0.1-next.2",
+ "@spectrum-css/assetcard": "3.1.5-next.2",
+ "@spectrum-css/assetlist": "5.2.5-next.2",
+ "@spectrum-css/avatar": "6.1.6-next.2",
+ "@spectrum-css/badge": "3.2.6-next.2",
+ "@spectrum-css/breadcrumb": "8.2.6-next.2",
+ "@spectrum-css/button": "14.0.0-next.4",
+ "@spectrum-css/buttongroup": "7.0.0-next.3",
+ "@spectrum-css/calendar": "4.2.6-next.2",
+ "@spectrum-css/card": "7.0.3-next.2",
+ "@spectrum-css/checkbox": "14.0.0-next.4",
+ "@spectrum-css/clearbutton": "5.1.5-next.2",
+ "@spectrum-css/closebutton": "5.0.0-next.2",
+ "@spectrum-css/coachindicator": "1.1.6-next.2",
+ "@spectrum-css/coachmark": "6.1.6-next.2",
+ "@spectrum-css/colorarea": "4.1.6-next.2",
+ "@spectrum-css/colorhandle": "7.1.5-next.2",
+ "@spectrum-css/colorloupe": "4.2.5-next.2",
+ "@spectrum-css/colorslider": "5.1.6-next.2",
+ "@spectrum-css/colorwheel": "3.1.6-next.2",
+ "@spectrum-css/combobox": "2.1.7-next.2",
+ "@spectrum-css/commons": "9.1.4-next.1",
+ "@spectrum-css/contextualhelp": "2.1.6-next.2",
+ "@spectrum-css/datepicker": "2.1.5-next.2",
+ "@spectrum-css/dial": "2.2.5-next.2",
+ "@spectrum-css/dialog": "9.2.5-next.2",
+ "@spectrum-css/divider": "2.2.6-next.2",
+ "@spectrum-css/dropindicator": "4.1.5-next.2",
+ "@spectrum-css/dropzone": "5.2.6-next.2",
+ "@spectrum-css/fieldgroup": "4.2.5-next.2",
+ "@spectrum-css/fieldlabel": "8.0.0-next.2",
+ "@spectrum-css/floatingactionbutton": "1.2.6-next.2",
+ "@spectrum-css/helptext": "4.1.6-next.2",
+ "@spectrum-css/icon": "6.0.6-next.2",
+ "@spectrum-css/illustratedmessage": "6.1.6-next.2",
+ "@spectrum-css/infieldbutton": "4.2.5-next.2",
+ "@spectrum-css/inlinealert": "7.1.7-next.2",
+ "@spectrum-css/link": "4.2.6-next.2",
+ "@spectrum-css/logicbutton": "3.3.5-next.2",
+ "@spectrum-css/menu": "6.1.6-next.2",
+ "@spectrum-css/miller": "5.1.5-next.2",
+ "@spectrum-css/modal": "4.2.7-next.2",
+ "@spectrum-css/opacitycheckerboard": "1.1.6-next.2",
+ "@spectrum-css/page": "7.1.5-next.2",
+ "@spectrum-css/pagination": "7.1.7-next.2",
+ "@spectrum-css/picker": "7.2.8-next.2",
+ "@spectrum-css/pickerbutton": "4.1.6-next.2",
+ "@spectrum-css/popover": "6.2.6-next.2",
+ "@spectrum-css/progressbar": "3.1.6-next.2",
+ "@spectrum-css/progresscircle": "2.2.4-next.2",
+ "@spectrum-css/radio": "8.1.6-next.2",
+ "@spectrum-css/rating": "4.2.5-next.2",
+ "@spectrum-css/search": "6.2.5-next.2",
+ "@spectrum-css/sidenav": "4.2.5-next.2",
+ "@spectrum-css/site": "4.2.5-next.2",
+ "@spectrum-css/slider": "4.3.6-next.2",
+ "@spectrum-css/splitview": "4.2.5-next.2",
+ "@spectrum-css/statuslight": "6.1.7-next.2",
+ "@spectrum-css/steplist": "4.1.5-next.2",
+ "@spectrum-css/stepper": "5.1.6-next.2",
+ "@spectrum-css/swatch": "5.1.6-next.2",
+ "@spectrum-css/swatchgroup": "2.1.6-next.2",
+ "@spectrum-css/switch": "4.2.6-next.2",
+ "@spectrum-css/table": "5.2.6-next.2",
+ "@spectrum-css/tabs": "4.1.5-next.2",
+ "@spectrum-css/tag": "8.1.6-next.2",
+ "@spectrum-css/taggroup": "4.1.6-next.2",
+ "@spectrum-css/textfield": "6.1.7-next.2",
+ "@spectrum-css/thumbnail": "5.2.5-next.2",
+ "@spectrum-css/toast": "9.1.26-next.2",
+ "@spectrum-css/tooltip": "5.3.6-next.2",
+ "@spectrum-css/tray": "2.2.8-next.2",
+ "@spectrum-css/treeview": "9.2.7-next.2",
+ "@spectrum-css/typography": "5.1.6-next.2",
+ "@spectrum-css/underlay": "3.2.5-next.2",
+ "@spectrum-css/well": "4.1.5-next.2",
+ "@spectrum-css/generator": "3.0.0",
+ "conventional-changelog-spectrum": "1.0.2",
+ "postcss-combininator": "2.0.0",
+ "postcss-custom-properties-mapping": "2.0.0",
+ "postcss-splitinator": "2.0.0",
+ "@spectrum-tools/stylelint-no-missing-var": "1.3.1",
+ "@spectrum-tools/stylelint-no-unknown-custom-properties": "1.3.2",
+ "@spectrum-tools/stylelint-no-unused-custom-properties": "1.3.1",
+ "@spectrum-tools/documentation": "1.0.0",
+ "@spectrum-css/tokens": "14.0.0-next.6",
+ "@spectrum-css/ui-icons": "1.1.2"
+ },
+ "changesets": [
+ "eleven-cooks-destroy",
+ "fresh-seahorses-join",
+ "nine-kings-repair",
+ "perfect-dogs-smash",
+ "pretty-parents-drum",
+ "proud-jokes-rule"
+ ]
+}
diff --git a/.changeset/pretty-parents-drum.md b/.changeset/pretty-parents-drum.md
new file mode 100644
index 00000000000..1ff4c501e45
--- /dev/null
+++ b/.changeset/pretty-parents-drum.md
@@ -0,0 +1,5 @@
+---
+"@spectrum-css/tokens": patch
+---
+
+use spectrum-tokens@13.0.0-beta.30
diff --git a/.changeset/proud-jokes-rule.md b/.changeset/proud-jokes-rule.md
new file mode 100644
index 00000000000..15c300f61ef
--- /dev/null
+++ b/.changeset/proud-jokes-rule.md
@@ -0,0 +1,7 @@
+---
+"@spectrum-css/progressbar": major
+---
+
+feat(progressbar): S2 migration
+
+Progress bar now uses Spectrum 2 tokens and specifications. This migration includes updated colors, font sizes, and spacing. No mods were harmed in the migration of this component (all `--mod` properties remain the same).
diff --git a/.changeset/silly-ties-attend.md b/.changeset/silly-ties-attend.md
new file mode 100644
index 00000000000..46a75814ae6
--- /dev/null
+++ b/.changeset/silly-ties-attend.md
@@ -0,0 +1,7 @@
+---
+"@spectrum-css/menu": patch
+---
+
+Prevents overlap of checkbox and icon if both are used in a menu item.
+
+Also reduces a significant number of variants by consolidating menus, includes a refactor to enhance menu item understanding, and expands Chromatic testing coverage.
diff --git a/.storybook/CHANGELOG.md b/.storybook/CHANGELOG.md
index 59ef90235d9..97e89c8854f 100644
--- a/.storybook/CHANGELOG.md
+++ b/.storybook/CHANGELOG.md
@@ -86,7 +86,12 @@ This component has been deprecated. Use an action bar to allow users to perform
##7.4.2
🗓
2024-02-06
+
+##7.4.2-next.0
+🗓
+2024-02-06 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/preview@7.4.1...@spectrum-css/preview@7.4.2-next.0)
+**Note:** Spectrum 2 next version
**Note:** Version bump only for package @spectrum-css/preview
diff --git a/.storybook/assets/base.css b/.storybook/assets/base.css
index 1ffc8c47d93..2f123142985 100644
--- a/.storybook/assets/base.css
+++ b/.storybook/assets/base.css
@@ -22,6 +22,13 @@ body {
}
.spectrum {
+ /* ---- Storybook only custom properties ---- */
+ /* Gradient that changes with the color theme. */
+ --spectrum-examples-gradient: linear-gradient(45deg, var(--spectrum-magenta-1500), var(--spectrum-blue-1500));
+ /* Gradients that do not change with the color theme, for use in static color backgrounds. */
+ --spectrum-examples-gradient-static-black: linear-gradient(45deg, rgb(255, 241, 246), rgb(238, 245, 255));
+ --spectrum-examples-gradient-static-white: linear-gradient(45deg, rgb(64, 0, 22), rgb(14, 24, 67));
+
background-color: var(--spectrum-background-layer-1-color);
/* @todo: add back the text color and update VRTs */
@@ -29,6 +36,14 @@ body {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
}
+.spectrum .spectrum-examples-static-black {
+ background: var(--spectrum-examples-gradient-static-black);
+}
+
+.spectrum .spectrum-examples-static-white {
+ background: var(--spectrum-examples-gradient-static-white)
+}
+
/* Hide the SVG elements that only include references */
svg:has(symbol):not(:has(use)) {
display: none;
diff --git a/.storybook/decorators/contextsWrapper.js b/.storybook/decorators/contextsWrapper.js
index 2dc017460da..dccf8a1ef4a 100644
--- a/.storybook/decorators/contextsWrapper.js
+++ b/.storybook/decorators/contextsWrapper.js
@@ -27,7 +27,7 @@ export const withContextWrapper = makeDecorator({
/** @type string */
const scale = args.scale ? args.scale : getDefaultValue(argTypes.scale) ?? "medium";
- const colors = ["light", "dark", "darkest"];
+ const colors = ["light", "dark"];
const scales = ["medium", "large"];
useEffect(() => {
@@ -54,18 +54,18 @@ export const withContextWrapper = makeDecorator({
container.classList.toggle(`spectrum--${s}`, s === scale);
}
-
- container.style.removeProperty("background");
- const hasStaticElement = container.querySelector(`.${args.rootClass}--staticWhite, .${args.rootClass}--staticBlack, .${args.rootClass}--overBackground`);
- if (hasStaticElement) {
- if (container.querySelector(`.${args.rootClass}--staticBlack`)) {
- container.style.background = "rgb(181, 209, 211)";
- } else if (container.querySelector(`.${args.rootClass}--staticWhite, .${args.rootClass}--overBackground`)) {
- container.style.background = "rgb(15, 121, 125)";
- }
+ // Change background color when demonstrating static color options.
+ if (args.staticColor === "black") {
+ container.style.background = "var(--spectrum-examples-gradient-static-black)";
+ }
+ else if (args.staticColor === "white" || args.isStaticWhite === true) {
+ container.style.background = "var(--spectrum-examples-gradient-static-white)";
+ }
+ else {
+ container.style.removeProperty("background");
}
}
- }, [color, scale, isExpress, args.staticColor]);
+ }, [color, scale, isExpress, args.staticColor, args.isStaticWhite]);
return StoryFn(context);
},
diff --git a/.storybook/decorators/index.js b/.storybook/decorators/index.js
index 9ca62537dc3..6fa9a859f73 100644
--- a/.storybook/decorators/index.js
+++ b/.storybook/decorators/index.js
@@ -2,6 +2,7 @@ import { makeDecorator, useEffect } from "@storybook/preview-api";
import { html } from "lit";
export { withContextWrapper } from "./contextsWrapper.js";
+export { withDownStateDimensionCapture } from "./withDownStateDimensionCapture.js";
export { withTestingPreviewWrapper } from "./withTestingPreviewWrapper.js";
/**
diff --git a/.storybook/decorators/withDownStateDimensionCapture.js b/.storybook/decorators/withDownStateDimensionCapture.js
new file mode 100644
index 00000000000..616852d34ce
--- /dev/null
+++ b/.storybook/decorators/withDownStateDimensionCapture.js
@@ -0,0 +1,19 @@
+export const withDownStateDimensionCapture = (selector) => (Story, context) => {
+ const captureDownStateDimensions = () => {
+ const components = document.querySelectorAll(selector);
+ components.forEach((component) => {
+ const { width, height } = component.getBoundingClientRect();
+ component.style.setProperty('--spectrum-downstate-width', `${width}px`);
+ component.style.setProperty('--spectrum-downstate-height', `${height}px`);
+ });
+ };
+
+ document.addEventListener("DOMContentLoaded", () => {
+ // Wait to make sure the story is fully rendered (otherwise width/height can be wrong)
+ setTimeout(() => {
+ captureDownStateDimensions();
+ }, 100);
+ });
+
+ return Story(context);
+};
diff --git a/.storybook/foundations/corner-rounding/action-button-corner-rounding.stories.js b/.storybook/foundations/corner-rounding/action-button-corner-rounding.stories.js
new file mode 100644
index 00000000000..372879350f5
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/action-button-corner-rounding.stories.js
@@ -0,0 +1,105 @@
+import { html } from "lit";
+import { Template } from "../../../components/actionbutton/stories/template";
+
+export default {
+ title: "Foundations/Corner rounding",
+ description:
+ "The action button component represents an action a user can take.",
+ component: "ActionButton",
+ args: {
+ rootClass: "spectrum-ActionButton",
+ },
+ parameters: {
+ actions: {
+ handles: ["click .spectrum-ActionButton:not([disabled])"],
+ },
+ },
+ tags: ['foundation'],
+};
+
+const ActionButton = ({
+ ...args
+}) => {
+ return html`
+
+ ${Template({
+ ...args,
+ iconName: undefined,
+ })}
+
+ `;
+};
+
+const ActionButtonTable = ({ ...args }) => {
+ return html`
+
+
+
+ Token
+ Value
+ Medium example
+
+
+
+
+ --spectrum-corner-radius-medium-size-extra-small
+ 6px
+
+ ${ActionButton({
+ ...args,
+ label: "Extra Small",
+ size: "xs"
+ })}
+
+
+
+ --spectrum-corner-radius-medium-size-small
+ 7px
+
+ ${ActionButton({
+ ...args,
+ label: "Small",
+ size: "s"
+ })}
+
+
+
+ --spectrum-corner-radius-medium-size-medium
+ 8px
+
+ ${ActionButton({
+ ...args,
+ label: "Medium",
+ size: "m"
+ })}
+
+
+
+ --spectrum-corner-radius-medium-size-large
+ 9px
+
+ ${ActionButton({
+ ...args,
+ label: "Large",
+ size: "l"
+ })}
+
+
+
+ --spectrum-corner-radius-medium-size-extra-large
+ 10px
+
+ ${ActionButton({
+ ...args,
+ label: "Extra Large",
+ size: "xl"
+ })}
+
+
+
+
+ `;
+};
+
+export const ActionButtonExamples = ActionButtonTable.bind({});
+ActionButtonExamples.args = {};
diff --git a/.storybook/foundations/corner-rounding/checkbox-corner-rounding.stories.js b/.storybook/foundations/corner-rounding/checkbox-corner-rounding.stories.js
new file mode 100644
index 00000000000..3dad56fd49f
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/checkbox-corner-rounding.stories.js
@@ -0,0 +1,97 @@
+// Import the component markup template
+import { html } from "lit";
+import { Template } from "../../../components/checkbox/stories/template";
+
+export default {
+ title: "Foundations/Corner rounding",
+ description:
+ "Checkboxes allow users to select multiple items from a list of individual items, or mark one individual item as selected.",
+ component: "Checkbox",
+ args: {
+ rootClass: "spectrum-Checkbox",
+ },
+ parameters: {
+ actions: {
+ handles: ['click input[type="checkbox"]'],
+ },
+ },
+ tags: ['foundation'],
+};
+
+const Checkbox = ({
+ customStyles = {},
+ isChecked = false,
+ ...args
+}) => {
+ return html`
+
+ ${Template({
+ ...args,
+ iconName: undefined,
+ })}
+
+ `;
+};
+
+const CheckboxTable = ({...args}) => {
+ return html`
+
+
+
+ Token
+ Value
+ Small example
+
+
+
+
+ --spectrum-corner-radius-small-size-small
+ 3px
+
+ ${Checkbox({
+ ...args,
+ label: "Small",
+ size: "s"
+ })}
+
+
+
+ --spectrum-corner-radius-small-size-medium
+ 4px
+
+ ${Checkbox({
+ ...args,
+ label: "Medium",
+ size: "m"
+ })}
+
+
+
+ --spectrum-corner-radius-small-size-large
+ 5px
+
+ ${Checkbox({
+ ...args,
+ label: "Large",
+ size: "l"
+ })}
+
+
+
+ --spectrum-corner-radius-small-size-extra-large
+ 6px
+
+ ${Checkbox({
+ ...args,
+ label: "Extra Large",
+ size: "xl"
+ })}
+
+
+
+
+ `;
+}
+
+export const CheckboxExamples = CheckboxTable.bind({});
+CheckboxExamples.args = {};
diff --git a/.storybook/foundations/corner-rounding/component-size-tokens-medium.md b/.storybook/foundations/corner-rounding/component-size-tokens-medium.md
new file mode 100644
index 00000000000..2f01b1ba44d
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/component-size-tokens-medium.md
@@ -0,0 +1,7 @@
+| Component size token | Alias token (if available) | Global token | Value |
+|---------------------------------------------------|-------------------------------|------------------------------|-------|
+| --spectrum-corner-radius-medium-size-extra-small | | --spectrum-corner-radius-300 | 6px |
+| --spectrum-corner-radius-medium-size-small | | --spectrum-corner-radius-400 | 7px |
+| --spectrum-corner-radius-medium-size-medium | --spectrum-corner-radius-medium-default | --spectrum-corner-radius-500 | 8px |
+| --spectrum-corner-radius-medium-size-large | | --spectrum-corner-radius-600 | 9px |
+| --spectrum-corner-radius-medium-size-extra-large | --spectrum-corner-radius-large-default | --spectrum-corner-radius-700 | 10px |
diff --git a/.storybook/foundations/corner-rounding/component-size-tokens-small.md b/.storybook/foundations/corner-rounding/component-size-tokens-small.md
new file mode 100644
index 00000000000..1fdcae6ad6d
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/component-size-tokens-small.md
@@ -0,0 +1,6 @@
+| Component size token | Alias token (if available) | Global token | Value |
+|---------------------------------------------------|-------------------------------|------------------------------|-------|
+| --spectrum-corner-radius-small-size-small | | --spectrum-corner-radius-75 | 3px |
+| --spectrum-corner-radius-small-size-medium | --spectrum-corner-radius-small-default | --spectrum-corner-radius-100 | 4px |
+| --spectrum-corner-radius-small-size-large | | --spectrum-corner-radius-200 | 5px |
+| --spectrum-corner-radius-small-size-extra-large | | --spectrum-corner-radius-300 | 6px |
diff --git a/.storybook/foundations/corner-rounding/corner-rounding.mdx b/.storybook/foundations/corner-rounding/corner-rounding.mdx
new file mode 100644
index 00000000000..0af56f6e446
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/corner-rounding.mdx
@@ -0,0 +1,26 @@
+import { Meta, Canvas, Story, Title, Unstyled } from '@storybook/blocks';
+import * as CornerRoundingStories from './corner-rounding.stories.js';
+import * as CheckboxStories from './checkbox-corner-rounding.stories.js';
+import * as ActionButtonStories from './action-button-corner-rounding.stories.js';
+
+
+
+
+
+## Default values
+
+
+
+## Component examples
+
+### Small tokens
+
+Checkbox includes small component size tokens to scale corner rounding.
+
+
+
+### Medium tokens
+
+Action button includes medium component size tokens to scale corner rounding.
+
+
diff --git a/.storybook/foundations/corner-rounding/corner-rounding.stories.js b/.storybook/foundations/corner-rounding/corner-rounding.stories.js
new file mode 100644
index 00000000000..21da965f948
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/corner-rounding.stories.js
@@ -0,0 +1,75 @@
+// Import the component markup template
+import { html } from "lit";
+import { Template } from './template';
+
+export default {
+ title: "Foundations/Corner rounding",
+ description:
+ "Corner rounding is a foundation that shows the different border-radius tokens that can be applied to a component.",
+ component: "Corner rounding",
+ args: {
+ rootClass: "spectrum-Foundations-Example-CornerRounding",
+ },
+ tags: ['foundation'],
+};
+
+const CornerRadiusGroup = ({
+ customStyles = {},
+ ...args
+}) => {
+ return html`
+
+
+
+
+ Token
+ Value
+ Example (No Border)
+ Example (Border)
+
+
+
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-none',
+ size: 'none',
+ value: '0px',
+ })}
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-small-default',
+ size: 's',
+ value: '4px',
+ })}
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-medium-default',
+ size: 'm',
+ value: '8px',
+ })}
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-large-default',
+ size: 'l',
+ value: '10px',
+ })}
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-extra-large-default',
+ size: 'xl',
+ value: '16px',
+ })}
+ ${Template({
+ ...args,
+ label: '--spectrum-corner-radius-full',
+ size: 'full',
+ value: '9999px',
+ })}
+
+
+
+ `;
+};
+
+export const CornerRounding = CornerRadiusGroup.bind({});
+CornerRounding.args = {};
diff --git a/.storybook/foundations/corner-rounding/index.css b/.storybook/foundations/corner-rounding/index.css
new file mode 100644
index 00000000000..ebdd50f180f
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/index.css
@@ -0,0 +1,56 @@
+/*!
+Copyright 2024 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
+of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under
+the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+OF ANY KIND, either express or implied. See the License for the specific language
+governing permissions and limitations under the License.
+*/
+
+.spectrum-Foundations-Example-CornerRounding-table {
+ border-spacing: 1rem 0;
+ margin-inline-start: -1rem;
+}
+
+.spectrum-Foundations-Example-CornerRounding-table th {
+ text-align: start;
+}
+
+.spectrum-Foundations-Example-CornerRounding {
+ inline-size: 3rem;
+ block-size: 3rem;
+ margin: 0.5rem;
+ background-color: var(--spectrum-gray-500);
+}
+
+.spectrum-Foundations-Example-CornerRounding--border {
+ background-color: var(--spectrum-gray-25);
+ border: var(--spectrum-border-width-200) solid var(--spectrum-gray-700);
+}
+
+.spectrum-Foundations-Example-CornerRounding--none {
+ border-radius: var(--spectrum-corner-radius-none);
+}
+
+.spectrum-Foundations-Example-CornerRounding--sizeS {
+ border-radius: var(--spectrum-corner-radius-small-default);
+}
+
+.spectrum-Foundations-Example-CornerRounding--sizeM {
+ border-radius: var(--spectrum-corner-radius-medium-default);
+}
+
+.spectrum-Foundations-Example-CornerRounding--sizeL {
+ border-radius: var(--spectrum-corner-radius-large-default);
+}
+
+.spectrum-Foundations-Example-CornerRounding--sizeXL {
+ border-radius: var(--spectrum-corner-radius-extra-large-default);
+}
+
+.spectrum-Foundations-Example-CornerRounding--full {
+ border-radius: var(--spectrum-corner-radius-full);
+}
diff --git a/.storybook/foundations/corner-rounding/template.js b/.storybook/foundations/corner-rounding/template.js
new file mode 100644
index 00000000000..4d24cc43dbe
--- /dev/null
+++ b/.storybook/foundations/corner-rounding/template.js
@@ -0,0 +1,42 @@
+import { html } from "lit";
+import { classMap } from "lit/directives/class-map.js";
+import './index.css';
+
+const getSizeModifier = (size) => {
+ if (size === 'none' || size === 'full') {
+ return size;
+ } else {
+ return `size${size.toUpperCase()}`;
+ }
+};
+
+export const Template = ({
+ rootClass = "spectrum-Foundations-Example-CornerRounding",
+ size = "none",
+ label,
+ value,
+}) => html`
+
+ ${label}
+ ${value}
+
+
+
+
+
+
+
+
+
+ `;
diff --git a/.storybook/foundations/down-state/button-down-state.stories.js b/.storybook/foundations/down-state/button-down-state.stories.js
new file mode 100644
index 00000000000..603fa500c9a
--- /dev/null
+++ b/.storybook/foundations/down-state/button-down-state.stories.js
@@ -0,0 +1,27 @@
+import { Template } from "../../../components/button/stories/template";
+
+export default {
+ title: "Foundations/Down state",
+ description:
+ "Buttons allow users to perform an action or to navigate to another page. They have multiple styles for various needs, and are ideal for calling attention to where a user needs to do something in order to move forward in a flow.",
+ component: "Button",
+ args: {
+ rootClass: "spectrum-Button",
+ },
+ parameters: {
+ actions: {
+ handles: ["click .spectrum-Button"],
+ },
+ },
+ tags: ["foundation"],
+};
+
+export const ButtonDownState = Template.bind({});
+ButtonDownState.args = {
+ label: "Edit",
+ variant: "accent",
+ customStyles: {
+ "--spectrum-downstate-width": "72px",
+ "--spectrum-downstate-height": "32px"
+ }
+};
diff --git a/.storybook/foundations/down-state/checkbox-down-state.stories.js b/.storybook/foundations/down-state/checkbox-down-state.stories.js
new file mode 100644
index 00000000000..fcc43a4ee1a
--- /dev/null
+++ b/.storybook/foundations/down-state/checkbox-down-state.stories.js
@@ -0,0 +1,22 @@
+import { Template } from "../../../components/checkbox/stories/template";
+
+export default {
+ title: "Foundations/Down state",
+ description:
+ "Checkboxes allow users to select multiple items from a list of individual items, or mark one individual item as selected.",
+ component: "Checkbox",
+ args: {
+ rootClass: "spectrum-Checkbox",
+ },
+ parameters: {
+ actions: {
+ handles: ["click input[type=\"checkbox\"]"],
+ },
+ },
+ tags: ["foundation"],
+};
+
+export const CheckboxDownState = Template.bind({});
+CheckboxDownState.args = {
+ label: "Checkbox",
+};
diff --git a/.storybook/foundations/down-state/down-state.mdx b/.storybook/foundations/down-state/down-state.mdx
new file mode 100644
index 00000000000..f07e65d2f8d
--- /dev/null
+++ b/.storybook/foundations/down-state/down-state.mdx
@@ -0,0 +1,44 @@
+import { Meta, Story } from '@storybook/blocks';
+import * as Checkbox from './checkbox-down-state.stories.js';
+import * as Button from './button-down-state.stories.js';
+
+
+
+# Down state
+
+Down state is a Spectrum 2 feature that creates the illusion of components being pressed-in when active. This functionality is already included in Spectrum 2 components that require down state in this project. It is implemented with a CSS transform. The implementation depends on the size of the interactable element, as shown in the examples below.
+
+## Examples
+
+### Minimum perspective
+
+For elements that have a width of 24px or less, the minimum perspective token is used to apply the down state. One example of a component that uses this token is the checkbox:
+
+
+
+In this case, we use the minimum perspective token:
+
+```
+transform:
+ perspective(var(--spectrum-component-size-minimum-perspective-down))
+ translateZ(var(--spectrum-component-size-difference-down));
+```
+
+### Calculated perspective
+
+For elements that have a width of greater than 24px, we need to use the component's width and height to apply the down state. One example of a component that uses this logic is the button:
+
+
+
+In this case, we use a max formula to calculate the perspective based on component width and height (this helps us account for components that may be very wide):
+
+```
+transform:
+ perspective(max(
+ var(--spectrum-downstate-height),
+ var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down)
+ ))
+ translateZ(var(--spectrum-component-size-difference-down));
+```
+
+*Note that in this case, users are required to develop an implementation to determine the width and height of the component. Assign these values to the `--spectrum-downstate-width` and `--spectrum-downstate-height` custom properties in a `style` attribute on the HTML element to expose them for use in the CSS.*
diff --git a/.storybook/foundations/drop-shadow/drop-shadow.mdx b/.storybook/foundations/drop-shadow/drop-shadow.mdx
new file mode 100644
index 00000000000..a8d6f298632
--- /dev/null
+++ b/.storybook/foundations/drop-shadow/drop-shadow.mdx
@@ -0,0 +1,86 @@
+import { Meta, Title, Story, Description } from '@storybook/blocks';
+import * as DropShadowStories from './drop-shadow.stories.js';
+
+
+
+
+
+
+
+Drop shadow tokens may be used for box shadows or drop shadows in CSS. Using `box-shadow` is often preferable to using `filter: drop-shadow()`, but in situations where the shadow must be applied to the alpha channel of the content rather than the border box, or if `box-shadow` is already being used for a different purpose, such as a focus outline, `filter: drop-shadow()` may be used. Note that in cases where `filter: drop-shadow()` is used, the shadow may be more blurred than the design spec due to a difference in how the blur parameter is calculated, and an adjustment by half may be needed.
+
+The opacity values in dark shadow colors are 3x the light values.
+
+These single-layer shadows are an interim solution for shadows until complex tokens (additional design data for the Spectrum Tokens system) are available to support multi-layer shadows.
+
+## Emphasized Default
+This shadow is used to provide emphasis to containers within a page.
+
+### `box-shadow`
+
+```
+box-shadow:
+ var(--spectrum-drop-shadow-emphasized-default-x)
+ var(--spectrum-drop-shadow-emphasized-default-y)
+ var(--spectrum-drop-shadow-emphasized-default-blur)
+ var(--spectrum-drop-shadow-emphasized-default-color);
+```
+
+### `filter: drop-shadow()`
+
+```
+filter: drop-shadow(
+ var(--spectrum-drop-shadow-emphasized-default-x)
+ var(--spectrum-drop-shadow-emphasized-default-y)
+ calc(var(--spectrum-drop-shadow-emphasized-default-blur) / 2)
+ var(--spectrum-drop-shadow-emphasized-default-color)
+);
+```
+
+## Emphasized Hover
+If the whole container is interactive, such as in a select box, the shadow becomes elevated on hover.
+
+### `box-shadow`
+
+```
+box-shadow:
+ var(--spectrum-drop-shadow-emphasized-hover-x)
+ var(--spectrum-drop-shadow-emphasized-hover-y)
+ var(--spectrum-drop-shadow-emphasized-hover-blur)
+ var(--spectrum-drop-shadow-emphasized-hover-color);
+```
+
+### `filter: drop-shadow()`
+
+```
+filter: drop-shadow(
+ var(--spectrum-drop-shadow-emphasized-hover-x)
+ var(--spectrum-drop-shadow-emphasized-hover-y)
+ calc(var(--spectrum-drop-shadow-emphasized-hover-blur) / 2)
+ var(--spectrum-drop-shadow-emphasized-hover-color)
+);
+```
+
+## Elevated
+Elevated shadows can be used on containers that appear on top of content, such as menus, coach marks, popovers, and floating bar panels.
+
+### `box-shadow`
+
+```
+box-shadow:
+ var(--spectrum-drop-shadow-elevated-x)
+ var(--spectrum-drop-shadow-elevated-y)
+ var(--spectrum-drop-shadow-elevated-blur)
+ var(--spectrum-drop-shadow-elevated-color);
+```
+
+### `filter: drop-shadow()`
+
+```
+filter: drop-shadow(
+ var(--spectrum-drop-shadow-elevated-x)
+ var(--spectrum-drop-shadow-elevated-y)
+ calc(var(--spectrum-drop-shadow-elevated-blur) / 2)
+ var(--spectrum-drop-shadow-elevated-color)
+);
+```
diff --git a/.storybook/foundations/drop-shadow/drop-shadow.stories.js b/.storybook/foundations/drop-shadow/drop-shadow.stories.js
new file mode 100644
index 00000000000..b61c7661f4c
--- /dev/null
+++ b/.storybook/foundations/drop-shadow/drop-shadow.stories.js
@@ -0,0 +1,74 @@
+import { html } from "lit";
+import { classMap } from "lit/directives/class-map.js";
+import "./index.css";
+
+export default {
+ title: "Foundations/Drop shadow",
+ description: "Drop shadows draw attention and give the appearance of depth. By default, this style is used to show elevation, when content appears on top of other content.",
+ component: "Drop shadow",
+ tags: ['foundation'],
+}
+
+const DropShadowSwatch = ({rootClass = "spectrum-Foundations-Example-DropShadow-swatch", variant, ...args}) => {
+ const { isDropShadow } = args;
+ return html`
+
+`;}
+
+const DropShadowBackground = ({rootClass = "spectrum-Foundations-Example-swatch-container", color, ...args}) => html`
+
+ ${DropShadowSwatch(args)}
+
+ `;
+
+const DropShadowVariant = ({...args}) => html`
+
+ ${DropShadowBackground({...args, color: "light"})}
+ ${DropShadowBackground({...args, color: "dark"})}
+
+`;
+
+
+export const DropShadowEmphasizedDefault = DropShadowVariant.bind({});
+DropShadowEmphasizedDefault.args = {
+ variant: "emphasized-default",
+ isDropShadow: true,
+};
+
+export const DropShadowEmphasizedHover = DropShadowVariant.bind({});
+DropShadowEmphasizedHover.args = {
+ variant: "emphasized-hover",
+ isDropShadow: true,
+};
+
+export const DropShadowElevated = DropShadowVariant.bind({});
+DropShadowElevated.args = {
+ variant: "elevated",
+ isDropShadow: true,
+};
+
+export const BoxShadowEmphasizedDefault = DropShadowVariant.bind({});
+BoxShadowEmphasizedDefault.args = {
+ variant: "emphasized-default",
+ isDropShadow: false,
+};
+
+export const BoxShadowEmphasizedHover = DropShadowVariant.bind({});
+BoxShadowEmphasizedHover.args = {
+ variant: "emphasized-hover",
+ isDropShadow: false,
+};
+
+export const BoxShadowElevated = DropShadowVariant.bind({});
+BoxShadowElevated.args = {
+ variant: "elevated",
+ isDropShadow: false,
+};
diff --git a/.storybook/foundations/drop-shadow/index.css b/.storybook/foundations/drop-shadow/index.css
new file mode 100644
index 00000000000..bf54a5ddce9
--- /dev/null
+++ b/.storybook/foundations/drop-shadow/index.css
@@ -0,0 +1,115 @@
+/*!
+Copyright 2024 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
+of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under
+the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+OF ANY KIND, either express or implied. See the License for the specific language
+governing permissions and limitations under the License.
+*/
+
+/* stylelint-disable spectrum-tools/no-unknown-custom-properties */
+
+.spectrum-Foundations-Example-DropShadow-swatch {
+ block-size: 150px;
+ inline-size: 150px;
+ background-color: var(--spectrum-gray-25);
+ border-radius: var(--spectrum-corner-radius-large-default);
+ border: transparent;
+}
+
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch {
+ background-color: var(--spectrum-gray-75); /* matches dark mode design spec rgb(34, 34, 34) */
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow {
+ box-shadow:
+ var(--spectrum-drop-shadow-emphasized-default-x)
+ var(--spectrum-drop-shadow-emphasized-default-y)
+ var(--spectrum-drop-shadow-emphasized-default-blur)
+ var(--mod-drop-shadow-emphasized-default-color, var(--spectrum-drop-shadow-emphasized-default-color));
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow {
+ filter: drop-shadow(
+ var(--spectrum-drop-shadow-emphasized-default-x)
+ var(--spectrum-drop-shadow-emphasized-default-y)
+ calc(var(--spectrum-drop-shadow-emphasized-default-blur) / 2) /* adjust blur by half of box-shadow */
+ var(--mod-drop-shadow-emphasized-default-color, var(--spectrum-drop-shadow-emphasized-default-color))
+ );
+}
+
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow,
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow {
+/* adjustment because color tokens do not work properly on foundations pages */
+ --mod-drop-shadow-emphasized-default-color: var(--spectrum-drop-shadow-color-100);
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow {
+ box-shadow:
+ var(--spectrum-drop-shadow-emphasized-hover-x)
+ var(--spectrum-drop-shadow-emphasized-hover-y)
+ var(--spectrum-drop-shadow-emphasized-hover-blur)
+ var(--mod-drop-shadow-emphasized-hover-color, var(--spectrum-drop-shadow-emphasized-hover-color));
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow {
+ filter: drop-shadow(
+ var(--spectrum-drop-shadow-emphasized-hover-x)
+ var(--spectrum-drop-shadow-emphasized-hover-y)
+ calc(var(--spectrum-drop-shadow-emphasized-hover-blur) / 2) /* adjust blur by half of box-shadow */
+ var(--mod-drop-shadow-emphasized-hover-color, var(--spectrum-drop-shadow-emphasized-hover-color))
+ );
+}
+
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow,
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow {
+/* adjustment because color tokens do not work properly on foundations pages */
+ --mod-drop-shadow-emphasized-hover-color: var(--spectrum-drop-shadow-color-200);
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow {
+ box-shadow:
+ var(--spectrum-drop-shadow-elevated-x)
+ var(--spectrum-drop-shadow-elevated-y)
+ var(--spectrum-drop-shadow-elevated-blur)
+ var(--mod-drop-shadow-elevated-color, var(--spectrum-drop-shadow-elevated-color));
+}
+
+.spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow {
+ filter: drop-shadow(
+ var(--spectrum-drop-shadow-elevated-x)
+ var(--spectrum-drop-shadow-elevated-y)
+ calc(var(--spectrum-drop-shadow-elevated-blur) / 2) /* adjust blur by half of box-shadow */
+ var(--mod-drop-shadow-elevated-color, var(--spectrum-drop-shadow-elevated-color))
+ );
+}
+
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow,
+.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow,
+.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow {
+/* adjustment because color tokens do not work properly on foundations pages */
+ --mod-drop-shadow-elevated-color: var(--spectrum-drop-shadow-color-200);
+}
+
+.spectrum-Foundations-Example-swatch-container {
+ background-color: var(--spectrum-gray-25);
+ block-size: 200px;
+ inline-size: 300px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.spectrum-Foundations-Example-variant-container {
+ background-color: var(--spectrum-gray-25);
+ display: flex;
+ flex-direction: row;
+}
diff --git a/.storybook/main.js b/.storybook/main.js
index 6cf75847d91..3acd5ee51dd 100644
--- a/.storybook/main.js
+++ b/.storybook/main.js
@@ -10,9 +10,12 @@ const componentPkgs = readdirSync(componentsPath, {
module.exports = {
stories: [
+ "../components/*/stories/*.mdx",
"../components/*/stories/*.stories.js",
"../components/*/stories/*.mdx",
"./guides/*.mdx",
+ "./foundations/*/*.mdx",
+ "./foundations/*/*.stories.js",
"./deprecated/*/*.stories.js",
"./deprecated/*/*.mdx",
],
diff --git a/.storybook/manager.js b/.storybook/manager.js
index ceacc56a50d..791ceaca79f 100644
--- a/.storybook/manager.js
+++ b/.storybook/manager.js
@@ -50,7 +50,7 @@ addons.setConfig({
sidebar: {
showRoots: false,
filters: {
- patterns: (item) => !item.id.includes('forced-colors'),
+ patterns: (item) => !item.id.includes('forced-colors') && ['foundation','is-hidden-story'].every((tag) => !item.tags.includes(tag)),
}
},
});
diff --git a/.storybook/package.json b/.storybook/package.json
index 8a3462a4f58..8592648a58d 100644
--- a/.storybook/package.json
+++ b/.storybook/package.json
@@ -11,7 +11,7 @@
},
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.5.4",
- "@spectrum-css/tokens": "^14.0.0",
+ "@spectrum-css/tokens": "^14.0.0-next.7",
"@spectrum-css/ui-icons": "^1.1.2"
},
"devDependencies": {
@@ -50,5 +50,12 @@
"storybook": "^8.0.10",
"style-loader": "4.0.0",
"webpack": "^5.91.0"
- }
+ },
+ "keywords": [
+ "adobe",
+ "css",
+ "design system",
+ "spectrum",
+ "storybook"
+ ]
}
diff --git a/.storybook/preview.js b/.storybook/preview.js
index 020815bff7b..d5166ad9488 100644
--- a/.storybook/preview.js
+++ b/.storybook/preview.js
@@ -1,13 +1,13 @@
-import DocumentationTemplate from './DocumentationTemplate.mdx';
+import DocumentationTemplate from "./DocumentationTemplate.mdx";
import { withActions } from "@storybook/addon-actions/decorator";
import {
- withContextWrapper,
- withLanguageWrapper,
- withReducedMotionWrapper,
- withTestingPreviewWrapper,
- withTextDirectionWrapper,
+ withContextWrapper,
+ withLanguageWrapper,
+ withReducedMotionWrapper,
+ withTestingPreviewWrapper,
+ withTextDirectionWrapper,
} from "./decorators/index.js";
// https://github.com/storybookjs/storybook-addon-console
@@ -81,17 +81,16 @@ export const argTypes = {
description: "Controls the color context of the component.",
type: { required: true },
table: {
- type: { summary: "light | dark | darkest" },
+ type: { summary: "light | dark" },
defaultValue: { summary: "light" },
category: "Global",
},
- options: ["light", "dark", "darkest"],
+ options: ["light", "dark"],
control: {
type: "select",
labels: {
light: "Light (default)",
dark: "Dark",
- darkest: "Darkest",
},
},
},
@@ -187,11 +186,11 @@ export const parameters = {
panelPosition: "bottom",
showToolbar: true,
isFullscreen: false,
- actions: { argTypesRegex: '^on.*' },
+ actions: { argTypesRegex: "^on.*" },
options: {
storySort: {
method: "alphabetical",
- order: ["Guides", ["Contributing", "*", "Adobe Code of Conduct", "Changelog"], "Components", ["*", ["Docs", "Default", "*"]], "*"],
+ order: ["Guides", ["Contributing", "*", "Adobe Code of Conduct", "Changelog"], "Foundations", "Components", ["Docs", "Default", "*"], "*"],
includeNames: true,
},
},
@@ -216,7 +215,7 @@ export const parameters = {
},
docs: {
autodocs: true,
- page: DocumentationTemplate,
+ page: DocumentationTemplate,
story: {
inline: true,
iframeHeight: "200px",
diff --git a/components/README.md b/components/README.md
index 66c02f39375..8fe781ba601 100644
--- a/components/README.md
+++ b/components/README.md
@@ -57,7 +57,7 @@ For example, `actionbar` gets its tokens from `vars`, and requires `button`, `ch
"@spectrum-css/checkbox": ">=8",
"@spectrum-css/icon": ">=6",
"@spectrum-css/popover": ">=6",
- "@spectrum-css/tokens": ">=13"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
}
}
```
diff --git a/components/accordion/index.css b/components/accordion/index.css
index 643a33ed5dc..4ff270c953f 100644
--- a/components/accordion/index.css
+++ b/components/accordion/index.css
@@ -120,7 +120,7 @@ governing permissions and limitations under the License.
);
/* Divider */
- --spectrum-accordion-divider-color: var(--spectrum-gray-300);
+ --spectrum-accordion-divider-color: var(--spectrum-gray-200);
--spectrum-accordion-min-block-size: max(
var(--mod-accordion-item-height, var(--spectrum-accordion-item-height)),
calc(
diff --git a/components/accordion/package.json b/components/accordion/package.json
index 157d9f6c8e8..05007e4f556 100644
--- a/components/accordion/package.json
+++ b/components/accordion/package.json
@@ -23,7 +23,7 @@
],
"peerDependencies": {
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/actionbar/index.css b/components/actionbar/index.css
index 0c306f02923..bbe279eb0a4 100644
--- a/components/actionbar/index.css
+++ b/components/actionbar/index.css
@@ -26,7 +26,7 @@ governing permissions and limitations under the License.
}
/* colors - applied to popover */
- --spectrum-actionbar-popover-background-color: var(--spectrum-gray-50);
+ --spectrum-actionbar-popover-background-color: var(--spectrum-gray-25);
--spectrum-actionbar-popover-border-color: var(--spectrum-gray-400);
/* emphasized variation colors */
diff --git a/components/actionbar/package.json b/components/actionbar/package.json
index 7c191ac27e1..1e31ab9d056 100644
--- a/components/actionbar/package.json
+++ b/components/actionbar/package.json
@@ -26,7 +26,7 @@
"@spectrum-css/closebutton": ">=5",
"@spectrum-css/fieldlabel": ">=8",
"@spectrum-css/popover": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/actionbutton/index.css b/components/actionbutton/index.css
index f833caed867..c1131df5d88 100644
--- a/components/actionbutton/index.css
+++ b/components/actionbutton/index.css
@@ -15,7 +15,7 @@ governing permissions and limitations under the License.
.spectrum-ActionButton {
--spectrum-actionbutton-animation-duration: var(--spectrum-animation-duration-100);
- --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-100);
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-medium);
--spectrum-actionbutton-border-width: var(--spectrum-border-width-100);
--spectrum-actionbutton-content-color-default: var(--spectrum-neutral-content-color-default);
@@ -38,10 +38,10 @@ governing permissions and limitations under the License.
--mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-neutral-background-color-selected-down));
--mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-neutral-background-color-selected-key-focus));
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-gray-50));
- --mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected, var(--spectrum-gray-50));
- --mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected, var(--spectrum-gray-50));
- --mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected, var(--spectrum-gray-50));
+ --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-gray-25));
+ --mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected, var(--spectrum-gray-25));
+ --mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected, var(--spectrum-gray-25));
+ --mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected, var(--spectrum-gray-25));
&.spectrum-ActionButton--emphasized {
--mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected-emphasized, var(--spectrum-accent-background-color-default));
@@ -58,6 +58,8 @@ governing permissions and limitations under the License.
}
.spectrum-ActionButton--sizeXS {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-extra-small);
+
--spectrum-actionbutton-min-width: calc((var(--spectrum-component-edge-to-visual-only-50) * 2) + var(--spectrum-workflow-icon-size-50));
--spectrum-actionbutton-height: var(--spectrum-component-height-50);
@@ -71,6 +73,8 @@ governing permissions and limitations under the License.
}
.spectrum-ActionButton--sizeS {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-small);
+
--spectrum-actionbutton-min-width: calc((var(--spectrum-component-edge-to-visual-only-75) * 2) + var(--spectrum-workflow-icon-size-75));
--spectrum-actionbutton-height: var(--spectrum-component-height-75);
@@ -84,6 +88,8 @@ governing permissions and limitations under the License.
}
.spectrum-ActionButton--sizeM {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-medium);
+
--spectrum-actionbutton-min-width: calc((var(--spectrum-component-edge-to-visual-only-100) * 2) + var(--spectrum-workflow-icon-size-100));
--spectrum-actionbutton-height: var(--spectrum-component-height-100);
@@ -97,6 +103,8 @@ governing permissions and limitations under the License.
}
.spectrum-ActionButton--sizeL {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-large);
+
--spectrum-actionbutton-min-width: calc((var(--spectrum-component-edge-to-visual-only-200) * 2) + var(--spectrum-workflow-icon-size-200));
--spectrum-actionbutton-height: var(--spectrum-component-height-200);
@@ -110,6 +118,8 @@ governing permissions and limitations under the License.
}
.spectrum-ActionButton--sizeXL {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-extra-large);
+
--spectrum-actionbutton-min-width: calc((var(--spectrum-component-edge-to-visual-only-300) * 2) + var(--spectrum-workflow-icon-size-300));
--spectrum-actionbutton-height: var(--spectrum-component-height-300);
diff --git a/components/actionbutton/metadata/actionbutton.yml b/components/actionbutton/metadata/actionbutton.yml
index acc03b5be7c..cb55c9cdb44 100644
--- a/components/actionbutton/metadata/actionbutton.yml
+++ b/components/actionbutton/metadata/actionbutton.yml
@@ -12,16 +12,24 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Action Button now requires a class on its icon
+ ### Version 6.0.0
+ #### Spectrum 2 release
+ Action button now uses Spectrum 2 tokens and specifications. A few notable changes:
+ - The mod custom property `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - The mod custom property `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - The mod custom property `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+
+ ### Versions prior to 6.0.0
+ #### Action Button now requires a class on its icon
The `.spectrum-ActionButton-icon` class is now required on the icon.
- ### T-shirt sizing
+ #### T-shirt sizing
Action Button now supports t-shirt sizing and requires that you specify the size by adding a `.spectrum-ActionButton--size*` class.
- ### Action Button is now a separate component
+ #### Action Button is now a separate component
Action Button has been moved to the [Action Button](actionbutton.html) component.
- ### Change workflow icon size
+ #### Change workflow icon size
Previously, all Action Buttons used `.spectrum-Icon--sizeS`. This has changed:
@@ -33,7 +41,7 @@ sections:
| `.spectrum-ActionButton--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-ActionButton--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Change hold icon classnames
+ #### Change hold icon classnames
Hold icon classnames must be set as follows:
@@ -45,10 +53,10 @@ sections:
| `.spectrum-ActionButton--sizeL` | `.spectrum-UIIcon-CornerTriangle200` |
| `.spectrum-ActionButton--sizeXL` | `.spectrum-UIIcon-CornerTriangle300` |
- ### Include markup for hold icon before workflow icon
+ #### Include markup for hold icon before workflow icon
Because of the way padding is calculated, the hold icon must be placed before the workflow icon.
- ### Remove focus-ring class
+ #### Remove focus-ring class
We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
examples:
- id: actionbutton-sizing
diff --git a/components/actionbutton/package.json b/components/actionbutton/package.json
index b3beaa02063..56135ccead8 100644
--- a/components/actionbutton/package.json
+++ b/components/actionbutton/package.json
@@ -23,7 +23,7 @@
],
"peerDependencies": {
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/icon": {
diff --git a/components/actionbutton/themes/express.css b/components/actionbutton/themes/express.css
index f56b4e5081b..70f3a177ba1 100644
--- a/components/actionbutton/themes/express.css
+++ b/components/actionbutton/themes/express.css
@@ -14,10 +14,10 @@ governing permissions and limitations under the License.
@container (--system: express) {
.spectrum-ActionButton {
- --spectrum-actionbutton-background-color-default: var(--spectrum-gray-200);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-300);
+ --spectrum-actionbutton-background-color-default: var(--spectrum-gray-100);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-200);
--spectrum-actionbutton-background-color-down: var(--spectrum-gray-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-300);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
--spectrum-actionbutton-border-color-default: transparent;
--spectrum-actionbutton-border-color-hover: transparent;
@@ -29,9 +29,9 @@ governing permissions and limitations under the License.
&.spectrum-ActionButton--quiet {
--spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-300);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-200);
--spectrum-actionbutton-background-color-down: var(--spectrum-gray-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-300);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
}
&.spectrum-ActionButton--staticBlack,
diff --git a/components/actionbutton/themes/spectrum.css b/components/actionbutton/themes/spectrum.css
index 30de8aaf3a6..23a64b906b8 100644
--- a/components/actionbutton/themes/spectrum.css
+++ b/components/actionbutton/themes/spectrum.css
@@ -12,10 +12,10 @@ governing permissions and limitations under the License.
@container (--system: spectrum) {
.spectrum-ActionButton {
- --spectrum-actionbutton-background-color-default: var(--spectrum-gray-75);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-gray-300);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-default: var(--spectrum-gray-50);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-100);
--spectrum-actionbutton-border-color-default: var(--spectrum-gray-400);
--spectrum-actionbutton-border-color-hover: var(--spectrum-gray-500);
@@ -28,9 +28,9 @@ governing permissions and limitations under the License.
&.spectrum-ActionButton--quiet {
--spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-gray-300);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-100);
--spectrum-actionbutton-border-color-default: transparent;
--spectrum-actionbutton-border-color-hover: transparent;
diff --git a/components/actiongroup/CHANGELOG.md b/components/actiongroup/CHANGELOG.md
index a6044a70cd4..cfa612e52bd 100644
--- a/components/actiongroup/CHANGELOG.md
+++ b/components/actiongroup/CHANGELOG.md
@@ -24,15 +24,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
🗓
2024-04-18 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@4.2.5...@spectrum-css/actiongroup@5.0.0)
-\*feat!: postcss config build and script; remove gulp (#2466)([b0f337b](https://github.com/adobe/spectrum-css/commit/b0f337b)), closes[#2466](https://github.com/adobe/spectrum-css/issues/2466)
+- feat!: postcss config build and script; remove gulp (#2466)([b0f337b](https://github.com/adobe/spectrum-css/commit/b0f337b)), closes[#2466](https://github.com/adobe/spectrum-css/issues/2466)
- ###
- 🛑 BREAKING CHANGES
+ ###
- *
- - Removes component-builder & component-builder-simple for script leveraging postcss
+ 🛑 BREAKING CHANGES
+
+ -
+
+ * Removes component-builder & component-builder-simple for script leveraging postcss
-- Imports added to index.css and themes/express.css
+* Imports added to index.css and themes/express.css
##4.2.5
diff --git a/components/actiongroup/index.css b/components/actiongroup/index.css
index 7f78b2945f1..492f0be14f5 100644
--- a/components/actiongroup/index.css
+++ b/components/actiongroup/index.css
@@ -16,6 +16,7 @@ governing permissions and limitations under the License.
--spectrum-actiongroup-button-spacing-reset: 0;
--spectrum-actiongroup-border-radius-reset: 0;
--spectrum-actiongroup-border-radius: var(--spectrum-corner-radius-100);
+ --spectrum-actiongroup-gap-size-compact: var(--spectrum-spacing-50);
}
.spectrum-ActionGroup--sizeXS,
@@ -76,15 +77,6 @@ governing permissions and limitations under the License.
border-start-start-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
border-end-start-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
- margin-inline-start: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
- }
-
- & + .spectrum-ActionGroup-item {
- /* Action button passthrough styling */
- --mod-actionbutton-focus-indicator-border-radius: 0px;
-
- margin-inline-start: var(--mod-actiongroup-horizontal-spacing-compact, var(--spectrum-actiongroup-horizontal-spacing-compact));
- margin-inline-end: var(--mod-actiongroup-horizontal-spacing-compact, var(--spectrum-actiongroup-horizontal-spacing-compact));
}
&:last-child {
@@ -93,8 +85,6 @@ governing permissions and limitations under the License.
border-start-end-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
border-end-end-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
- margin-inline-start: var(--mod-actiongroup-horizontal-spacing-compact, var(--spectrum-actiongroup-horizontal-spacing-compact));
- margin-inline-end: var(--mod-actiongroup-border-radius-reset, var(--spectrum-actiongroup-border-radius-reset));
}
&.is-selected {
@@ -128,16 +118,6 @@ governing permissions and limitations under the License.
border-start-start-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
border-start-end-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
- margin-inline-end: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
- margin-block-start: var(--mod-actiongroup-vertical-spacing-compact, var(--spectrum-actiongroup-vertical-spacing-compact));
- margin-block-end: var(--mod-actiongroup-vertical-spacing-compact, var(--spectrum-actiongroup-vertical-spacing-compact));
- }
-
- & + .spectrum-ActionGroup-item {
- margin-inline-start: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
- margin-inline-end: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
- margin-block-start: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
- margin-block-end: var(--mod-actiongroup-vertical-spacing-compact, var(--spectrum-actiongroup-vertical-spacing-compact));
}
&:last-child {
@@ -146,8 +126,6 @@ governing permissions and limitations under the License.
border-end-start-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
border-end-end-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
- margin-block-start: var(--mod-actiongroup-vertical-spacing-compact, var(--spectrum-actiongroup-vertical-spacing-compact));
- margin-block-end: var(--mod-actiongroup-button-spacing-reset, var(--spectrum-actiongroup-button-spacing-reset));
}
}
}
diff --git a/components/actiongroup/metadata/mods.md b/components/actiongroup/metadata/mods.md
index 2fcc384c89f..50e28461152 100644
--- a/components/actiongroup/metadata/mods.md
+++ b/components/actiongroup/metadata/mods.md
@@ -2,9 +2,6 @@
| ---------------------------------------------- |
| `--mod-actiongroup-border-radius` |
| `--mod-actiongroup-border-radius-reset` |
-| `--mod-actiongroup-button-spacing-reset` |
| `--mod-actiongroup-gap-size-compact` |
-| `--mod-actiongroup-horizontal-spacing-compact` |
| `--mod-actiongroup-horizontal-spacing-regular` |
-| `--mod-actiongroup-vertical-spacing-compact` |
| `--mod-actiongroup-vertical-spacing-regular` |
diff --git a/components/actiongroup/package.json b/components/actiongroup/package.json
index 56934579a76..227368d423a 100644
--- a/components/actiongroup/package.json
+++ b/components/actiongroup/package.json
@@ -1,6 +1,6 @@
{
"name": "@spectrum-css/actiongroup",
- "version": "5.1.0",
+ "version": "5.0.0-next.3",
"description": "The Spectrum CSS actiongroup component",
"license": "Apache-2.0",
"author": "Adobe",
@@ -23,7 +23,7 @@
],
"peerDependencies": {
"@spectrum-css/actionbutton": ">=6",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/actionbutton": {
diff --git a/components/actiongroup/stories/actiongroup.stories.js b/components/actiongroup/stories/actiongroup.stories.js
index 2684942d29d..8e7adbbc011 100644
--- a/components/actiongroup/stories/actiongroup.stories.js
+++ b/components/actiongroup/stories/actiongroup.stories.js
@@ -118,8 +118,22 @@ Justified.args = {
content: items
};
+export const JustifiedCompact = Template.bind({});
+JustifiedCompact.args = {
+ justified: true,
+ compact: true,
+ content: items,
+};
+
export const Quiet = Template.bind({});
Quiet.args = {
areQuiet: true,
content: items
};
+
+export const QuietCompact = Template.bind({});
+QuietCompact.args = {
+ areQuiet: true,
+ compact: true,
+ content: items,
+};
diff --git a/components/actiongroup/themes/express.css b/components/actiongroup/themes/express.css
index 73630a7c0b2..48de489f60a 100644
--- a/components/actiongroup/themes/express.css
+++ b/components/actiongroup/themes/express.css
@@ -13,11 +13,4 @@ governing permissions and limitations under the License.
@import "./spectrum.css";
@container (--system: express) {
- .spectrum-ActionGroup {
- --spectrum-actiongroup-gap-size-compact: var(--spectrum-spacing-50);
-
- /* account for button border */
- --spectrum-actiongroup-horizontal-spacing-compact: calc(-1px * var(--spectrum-spacing-50));
- --spectrum-actiongroup-vertical-spacing-compact: calc(-1px * var(--spectrum-spacing-50));
- }
}
diff --git a/components/actiongroup/themes/spectrum.css b/components/actiongroup/themes/spectrum.css
index 0b606f3f6b3..7507c3c1e64 100644
--- a/components/actiongroup/themes/spectrum.css
+++ b/components/actiongroup/themes/spectrum.css
@@ -11,11 +11,4 @@ governing permissions and limitations under the License.
*/
@container (--system: spectrum) {
- .spectrum-ActionGroup {
- --spectrum-actiongroup-gap-size-compact: 0;
-
- /* account for button border */
- --spectrum-actiongroup-horizontal-spacing-compact: -1px;
- --spectrum-actiongroup-vertical-spacing-compact: -1px;
- }
}
diff --git a/components/actionmenu/package.json b/components/actionmenu/package.json
index 6229808b1ad..c782781b8d2 100644
--- a/components/actionmenu/package.json
+++ b/components/actionmenu/package.json
@@ -32,7 +32,7 @@
"@spectrum-css/icon": ">=7",
"@spectrum-css/menu": ">=7",
"@spectrum-css/popover": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"publishConfig": {
"access": "public"
diff --git a/components/alertbanner/package.json b/components/alertbanner/package.json
index fa9d3c005e1..1076e033627 100644
--- a/components/alertbanner/package.json
+++ b/components/alertbanner/package.json
@@ -26,7 +26,7 @@
"@spectrum-css/closebutton": ">=5",
"@spectrum-css/divider": ">=3",
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/icon": {
diff --git a/components/alertdialog/package.json b/components/alertdialog/package.json
index ff23c49b2e0..c199feb6673 100644
--- a/components/alertdialog/package.json
+++ b/components/alertdialog/package.json
@@ -26,7 +26,7 @@
"@spectrum-css/divider": ">=3",
"@spectrum-css/icon": ">=7",
"@spectrum-css/modal": ">=5",
- "@spectrum-css/tokens": ">=14",
+ "@spectrum-css/tokens": ">=14.0.0-next.3",
"@spectrum-css/underlay": ">=4"
},
"peerDependenciesMeta": {
diff --git a/components/asset/index.css b/components/asset/index.css
index 29fdf09c0fd..8c83901a8de 100644
--- a/components/asset/index.css
+++ b/components/asset/index.css
@@ -42,7 +42,7 @@ governing permissions and limitations under the License.
--highcontrast-asset-folder-background-color,
var(
--mod-asset-folder-background-color,
- var(--spectrum-gray-300)
+ var(--spectrum-gray-200)
)
);
}
@@ -52,7 +52,7 @@ governing permissions and limitations under the License.
--highcontrast-asset-file-background-color,
var(
--mod-asset-file-background-color,
- var(--spectrum-gray-50)
+ var(--spectrum-gray-25)
)
);
}
diff --git a/components/asset/package.json b/components/asset/package.json
index 847cd8e04fe..d10db557e58 100644
--- a/components/asset/package.json
+++ b/components/asset/package.json
@@ -22,7 +22,7 @@
"metadata/mods.md"
],
"peerDependencies": {
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/assetcard/index.css b/components/assetcard/index.css
index 418275e4019..ab9ca3238c3 100644
--- a/components/assetcard/index.css
+++ b/components/assetcard/index.css
@@ -16,7 +16,7 @@ governing permissions and limitations under the License.
.spectrum-AssetCard {
/* todo: this isn't quite the size from the XD file as 232px is not a size token, so we use 224px */
--spectrum-assetcard-asset-size: 224px;
- --spectrum-assetcard-background-color: var(--spectrum-gray-200);
+ --spectrum-assetcard-background-color: var(--spectrum-gray-100);
--spectrum-assetcard-asset-animation-duration: var(--spectrum-animation-duration-100);
--spectrum-assetcard-asset-container-border-size: 1px;
--spectrum-assetcard-header-margin-block-start: var(--spectrum-spacing-300);
diff --git a/components/assetcard/package.json b/components/assetcard/package.json
index 956896fc685..6fe740054be 100644
--- a/components/assetcard/package.json
+++ b/components/assetcard/package.json
@@ -23,7 +23,7 @@
],
"peerDependencies": {
"@spectrum-css/checkbox": ">=9",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/checkbox": {
diff --git a/components/assetlist/index.css b/components/assetlist/index.css
index ccb9ba09be3..73b035f3fa5 100644
--- a/components/assetlist/index.css
+++ b/components/assetlist/index.css
@@ -23,8 +23,8 @@ governing permissions and limitations under the License.
--spectrum-assetlist-item-animation: var(--spectrum-animation-duration-100);
--spectrum-assetlist-item-font-size: var(--spectrum-font-size-100);
--spectrum-assetlist-item-font-weight: var(--spectrum-regular-font-weight);
- --spectrum-assetlist-item-background-color-down: var(--spectrum-gray-300);
- --spectrum-assetlist-item-background-color-hover: var(--spectrum-gray-200);
+ --spectrum-assetlist-item-background-color-down: var(--spectrum-gray-200);
+ --spectrum-assetlist-item-background-color-hover: var(--spectrum-gray-100);
/* thumbnail */
--spectrum-assetlist-thumbnail-width: var(--spectrum-spacing-400);
diff --git a/components/assetlist/package.json b/components/assetlist/package.json
index 5ea8a45f374..c8f16e662ef 100644
--- a/components/assetlist/package.json
+++ b/components/assetlist/package.json
@@ -24,7 +24,7 @@
"peerDependencies": {
"@spectrum-css/checkbox": ">=9",
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/checkbox": {
diff --git a/components/avatar/package.json b/components/avatar/package.json
index 0e8f712656a..c728c835450 100644
--- a/components/avatar/package.json
+++ b/components/avatar/package.json
@@ -22,7 +22,7 @@
"metadata/mods.md"
],
"peerDependencies": {
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/badge/package.json b/components/badge/package.json
index 3c8bde6e482..2f1357610dc 100644
--- a/components/badge/package.json
+++ b/components/badge/package.json
@@ -23,7 +23,7 @@
],
"peerDependencies": {
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/icon": {
diff --git a/components/breadcrumb/package.json b/components/breadcrumb/package.json
index 0b2a572fc61..47f76b2768a 100644
--- a/components/breadcrumb/package.json
+++ b/components/breadcrumb/package.json
@@ -24,7 +24,7 @@
"peerDependencies": {
"@spectrum-css/actionbutton": ">=6",
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/actionbutton": {
diff --git a/components/button/CHANGELOG.md b/components/button/CHANGELOG.md
index 47846b36151..f3061769e86 100644
--- a/components/button/CHANGELOG.md
+++ b/components/button/CHANGELOG.md
@@ -1,14 +1,36 @@
# Change Log
-## 13.1.0
+## 14.0.0-next.7
-### Minor Changes
+### Patch Changes
-- [#2616](https://github.com/adobe/spectrum-css/pull/2616) [`7f45ea9`](https://github.com/adobe/spectrum-css/commit/7f45ea95d3d31addf29b0720de8623b0f3f0431d) Thanks [@castastrophe](https://github.com/castastrophe)!
+- [#2725](https://github.com/adobe/spectrum-css/pull/2725) [`81edcde`](https://github.com/adobe/spectrum-css/commit/81edcde7fc606acd86b2bdb4379e0d2f96a5e211) Thanks [@jawinn](https://github.com/jawinn)! - #### refactor: remove spectrum-ButtonWithFocusRing placeholder class extend
-#### Build optmizations to support minification
+ Removes the need for the extend from this placeholder class, as the styles it provides have diverged slightly from what is in button and it was causing some unnecessary CSS to override.
+ This should not result in any changed visuals or behavior, as the same CSS has been integrated.
-Output for all component CSS files is now being run through a lightweight optimizer (cssnano) which significantly reduces unnecessary whitespace. These changes reduce file size but should not have any impact on the rendering of the component. By removing unnecessary whitespace from var functions, we are making it easier to effectively minify our provided CSS assets.
+## 14.0.0-next.6
+
+### Major Changes
+
+- [#2600](https://github.com/adobe/spectrum-css/pull/2600) [`3559678`](https://github.com/adobe/spectrum-css/commit/35596780a1309dd145fa565461d330ddfaf50e68) Thanks [@jawinn](https://github.com/jawinn)!
+
+#### Spectrum 2 migration
+
+Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+
+- Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+- Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+- The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+The following `--mod` custom properties have been renamed:
+
+- `--mod-line-height-100` has been renamed to `--mod-button-line-height`
+- `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`
+- `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`
+- `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`
+
+## 14.0.0-next.5
### Patch Changes
@@ -20,8 +42,20 @@ Output for all component CSS files is now being run through a lightweight optimi
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+## 13.1.0
+
+### Minor Changes
+
+- [#2616](https://github.com/adobe/spectrum-css/pull/2616) [`7f45ea9`](https://github.com/adobe/spectrum-css/commit/7f45ea95d3d31addf29b0720de8623b0f3f0431d) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+#### Build optmizations to support minification
+
+Output for all component CSS files is now being run through a lightweight optimizer (cssnano) which significantly reduces unnecessary whitespace. These changes reduce file size but should not have any impact on the rendering of the component. By removing unnecessary whitespace from var functions, we are making it easier to effectively minify our provided CSS assets.
+
-#13.0.0
+
+# 13.0.0
+
🗓
2024-04-18 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/button@12.0.2...@spectrum-css/button@13.0.0)
diff --git a/components/button/index.css b/components/button/index.css
index 748097bbc91..c731b153922 100644
--- a/components/button/index.css
+++ b/components/button/index.css
@@ -10,72 +10,73 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/
-@import "./themes/express.css";
@import "@spectrum-css/commons/basebutton.css";
-/* default for all buttons */
.spectrum-Button {
--spectrum-button-animation-duration: var(--spectrum-animation-duration-100);
- --spectrum-button-border-radius: var(--spectrum-corner-radius-100);
- --spectrum-button-border-width: var(--spectrum-border-width-200);
- --spectrum-button-line-height: 1.2; /* Hack to keep buttons at 32px */
--spectrum-button-focus-ring-gap: var(--spectrum-focus-indicator-gap);
- --spectrum-button-focus-ring-border-radius: calc(var(--spectrum-button-border-radius) + var(--spectrum-button-focus-ring-gap));
--spectrum-button-focus-ring-thickness: var(--spectrum-focus-indicator-thickness);
--spectrum-button-focus-indicator-color: var(--spectrum-focus-indicator-color);
- --spectrum-button-intended-icon-size: var(--spectrum-workflow-icon-size-50);
+
+ --spectrum-button-min-width: calc(var(--spectrum-component-height-100) * var(--spectrum-button-minimum-width-multiplier));
+ --spectrum-button-height: var(--spectrum-component-height-100);
+
+ --spectrum-button-border-radius: calc(var(--spectrum-button-height) / 2);
+ --spectrum-button-border-width: var(--spectrum-border-width-200);
+
+ /* @todo set line-height using font size specific line-height tokens when they are finalized along with the new variable font. */
+ --spectrum-button-line-height: 1.2;
+ --spectrum-button-font-weight: var(--spectrum-bold-font-weight);
+ --spectrum-button-font-size: var(--spectrum-font-size-100);
+
+ --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-100) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-visual-only: calc(var(--spectrum-component-pill-edge-to-visual-only-100) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-100) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-padding-label-to-icon: var(--spectrum-text-to-visual-100);
+ --spectrum-button-top-to-text: var(--spectrum-button-top-to-text-medium);
+ --spectrum-button-bottom-to-text: var(--spectrum-button-bottom-to-text-medium);
+ --spectrum-button-top-to-icon: var(--spectrum-component-top-to-workflow-icon-100);
+ --spectrum-button-intended-icon-size: var(--spectrum-workflow-icon-size-100);
--mod-progress-circle-position: absolute;
+ /* stylelint-disable-next-line spectrum-tools/no-unknown-custom-properties -- height and width are set by implementations */
+ --spectrum-downstate-perspective: max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down));
+
+ &.spectrum-Button--iconOnly {
+ --spectrum-button-border-radius: var(--spectrum-corner-radius-full);
+ }
}
.spectrum-Button--sizeS {
--spectrum-button-min-width: calc(var(--spectrum-component-height-75) * var(--spectrum-button-minimum-width-multiplier));
-
- --spectrum-button-border-radius: var(--spectrum-component-pill-edge-to-text-75);
--spectrum-button-height: var(--spectrum-component-height-75);
--spectrum-button-font-size: var(--spectrum-font-size-75);
- --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-75) - var(--spectrum-button-border-width));
- --spectrum-button-edge-to-visual-only: var(--spectrum-component-pill-edge-to-visual-only-75);
- --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-75) - var(--spectrum-button-border-width));
+ --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-75) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-visual-only: calc(var(--spectrum-component-pill-edge-to-visual-only-75) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-75) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
--spectrum-button-padding-label-to-icon: var(--spectrum-text-to-visual-75);
--spectrum-button-top-to-text: var(--spectrum-button-top-to-text-small);
--spectrum-button-bottom-to-text: var(--spectrum-button-bottom-to-text-small);
--spectrum-button-top-to-icon: var(--spectrum-component-top-to-workflow-icon-75);
--spectrum-button-intended-icon-size: var(--spectrum-workflow-icon-size-75);
-}
-
-.spectrum-Button--sizeM {
- --spectrum-button-min-width: calc(var(--spectrum-component-height-100) * var(--spectrum-button-minimum-width-multiplier));
-
- --spectrum-button-border-radius: var(--spectrum-component-pill-edge-to-text-100);
- --spectrum-button-height: var(--spectrum-component-height-100);
- --spectrum-button-font-size: var(--spectrum-font-size-100);
-
- --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-100) - var(--spectrum-button-border-width));
- --spectrum-button-edge-to-visual-only: var(--spectrum-component-pill-edge-to-visual-only-100);
- --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-100) - var(--spectrum-button-border-width));
- --spectrum-button-padding-label-to-icon: var(--spectrum-text-to-visual-100);
- --spectrum-button-top-to-text: var(--spectrum-button-top-to-text-medium);
- --spectrum-button-bottom-to-text: var(--spectrum-button-bottom-to-text-medium);
- --spectrum-button-top-to-icon: var(--spectrum-component-top-to-workflow-icon-100);
- --spectrum-button-intended-icon-size: var(--spectrum-workflow-icon-size-100);
+ &.spectrum-Button--iconOnly {
+ --spectrum-downstate-perspective: var(--spectrum-component-size-minimum-perspective-down);
+ }
}
.spectrum-Button--sizeL {
--spectrum-button-min-width: calc(var(--spectrum-component-height-200) * var(--spectrum-button-minimum-width-multiplier));
-
- --spectrum-button-border-radius: var(--spectrum-component-pill-edge-to-text-200);
--spectrum-button-height: var(--spectrum-component-height-200);
--spectrum-button-font-size: var(--spectrum-font-size-200);
- --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-200) - var(--spectrum-button-border-width));
- --spectrum-button-edge-to-visual-only: var(--spectrum-component-pill-edge-to-visual-only-200);
- --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-200) - var(--spectrum-button-border-width));
+ --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-200) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-visual-only: calc(var(--spectrum-component-pill-edge-to-visual-only-200) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-200) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
--spectrum-button-padding-label-to-icon: var(--spectrum-text-to-visual-200);
--spectrum-button-top-to-text: var(--spectrum-button-top-to-text-large);
--spectrum-button-bottom-to-text: var(--spectrum-button-bottom-to-text-large);
@@ -85,15 +86,13 @@ governing permissions and limitations under the License.
.spectrum-Button--sizeXL {
--spectrum-button-min-width: calc(var(--spectrum-component-height-300) * var(--spectrum-button-minimum-width-multiplier));
-
- --spectrum-button-border-radius: var(--spectrum-component-pill-edge-to-text-300);
--spectrum-button-height: var(--spectrum-component-height-300);
--spectrum-button-font-size: var(--spectrum-font-size-300);
- --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-300) - var(--spectrum-button-border-width));
- --spectrum-button-edge-to-visual-only: var(--spectrum-component-pill-edge-to-visual-only-300);
- --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-300) - var(--spectrum-button-border-width));
+ --spectrum-button-edge-to-visual: calc(var(--spectrum-component-pill-edge-to-visual-300) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-visual-only: calc(var(--spectrum-component-pill-edge-to-visual-only-300) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ --spectrum-button-edge-to-text: calc(var(--spectrum-component-pill-edge-to-text-300) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
--spectrum-button-padding-label-to-icon: var(--spectrum-text-to-visual-300);
--spectrum-button-top-to-text: var(--spectrum-button-top-to-text-extra-large);
--spectrum-button-bottom-to-text: var(--spectrum-button-bottom-to-text-extra-large);
@@ -101,40 +100,266 @@ governing permissions and limitations under the License.
--spectrum-button-intended-icon-size: var(--spectrum-workflow-icon-size-300);
}
+/* Variants and colors */
+.spectrum-Button {
+ --spectrum-button-content-color-default: var(--spectrum-white);
+ --spectrum-button-content-color-hover: var(--spectrum-white);
+ --spectrum-button-content-color-down: var(--spectrum-white);
+ --spectrum-button-content-color-focus: var(--spectrum-white);
+
+ --spectrum-button-border-color-default: transparent;
+ --spectrum-button-border-color-hover: transparent;
+ --spectrum-button-border-color-down: transparent;
+ --spectrum-button-border-color-focus: transparent;
+
+ --spectrum-button-background-color-disabled: var(--spectrum-disabled-background-color);
+ --spectrum-button-border-color-disabled: transparent;
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-content-color);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-disabled: transparent;
+ --spectrum-button-border-color-disabled: var(--spectrum-disabled-border-color);
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-content-color);
+ }
+
+ /* ---- Accent ---- */
+ /* Also shows as the default when a variant class is not used. */
+ &.spectrum-Button--accent,
+ & {
+ --spectrum-button-background-color-default: var(--spectrum-accent-background-color-default);
+ --spectrum-button-background-color-hover: var(--spectrum-accent-background-color-hover);
+ --spectrum-button-background-color-down: var(--spectrum-accent-background-color-down);
+ --spectrum-button-background-color-focus: var(--spectrum-accent-background-color-key-focus);
+ }
+
+ /* ---- Negative ---- */
+ &.spectrum-Button--negative {
+ --spectrum-button-background-color-default: var(--spectrum-negative-background-color-default);
+ --spectrum-button-background-color-hover: var(--spectrum-negative-background-color-hover);
+ --spectrum-button-background-color-down: var(--spectrum-negative-background-color-down);
+ --spectrum-button-background-color-focus: var(--spectrum-negative-background-color-key-focus);
+ }
+
+ /* ---- Primary ---- */
+ &.spectrum-Button--primary {
+ --spectrum-button-background-color-default: var(--spectrum-neutral-background-color-default);
+ --spectrum-button-background-color-hover: var(--spectrum-neutral-background-color-hover);
+ --spectrum-button-background-color-down: var(--spectrum-neutral-background-color-down);
+ --spectrum-button-background-color-focus: var(--spectrum-neutral-background-color-key-focus);
+
+ --spectrum-button-content-color-default: var(--spectrum-gray-25);
+ --spectrum-button-content-color-hover: var(--spectrum-gray-25);
+ --spectrum-button-content-color-down: var(--spectrum-gray-25);
+ --spectrum-button-content-color-focus: var(--spectrum-gray-25);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: transparent;
+ --spectrum-button-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-button-background-color-down: var(--spectrum-gray-100);
+ --spectrum-button-background-color-focus: var(--spectrum-gray-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-gray-800);
+ --spectrum-button-border-color-hover: var(--spectrum-gray-900);
+ --spectrum-button-border-color-down: var(--spectrum-gray-900);
+ --spectrum-button-border-color-focus: var(--spectrum-gray-900);
+
+ --spectrum-button-content-color-default: var(--spectrum-neutral-content-color-default);
+ --spectrum-button-content-color-hover: var(--spectrum-neutral-content-color-hover);
+ --spectrum-button-content-color-down: var(--spectrum-neutral-content-color-down);
+ --spectrum-button-content-color-focus: var(--spectrum-neutral-content-color-key-focus);
+ }
+ }
+
+ /* ---- Secondary ---- */
+ &.spectrum-Button--secondary {
+ --spectrum-button-background-color-default: var(--spectrum-gray-100);
+ --spectrum-button-background-color-hover: var(--spectrum-gray-200);
+ --spectrum-button-background-color-down: var(--spectrum-gray-200);
+ --spectrum-button-background-color-focus: var(--spectrum-gray-200);
+
+ --spectrum-button-content-color-default: var(--spectrum-neutral-content-color-default);
+ --spectrum-button-content-color-hover: var(--spectrum-neutral-content-color-hover);
+ --spectrum-button-content-color-down: var(--spectrum-neutral-content-color-down);
+ --spectrum-button-content-color-focus: var(--spectrum-neutral-content-color-key-focus);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: transparent;
+ --spectrum-button-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-button-background-color-down: var(--spectrum-gray-100);
+ --spectrum-button-background-color-focus: var(--spectrum-gray-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-gray-300);
+ --spectrum-button-border-color-hover: var(--spectrum-gray-400);
+ --spectrum-button-border-color-down: var(--spectrum-gray-400);
+ --spectrum-button-border-color-focus: var(--spectrum-gray-400);
+
+ --spectrum-button-content-color-default: var(--spectrum-neutral-content-color-default);
+ --spectrum-button-content-color-hover: var(--spectrum-neutral-content-color-hover);
+ --spectrum-button-content-color-down: var(--spectrum-neutral-content-color-down);
+ --spectrum-button-content-color-focus: var(--spectrum-neutral-content-color-key-focus);
+ }
+ }
+
+ /* ---- Static White ---- */
+ &.spectrum-Button--staticWhite {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-white-900);
+
+ --spectrum-button-content-color-default: var(--spectrum-black);
+ --spectrum-button-content-color-hover: var(--spectrum-black);
+ --spectrum-button-content-color-down: var(--spectrum-black);
+ --spectrum-button-content-color-focus: var(--spectrum-black);
+
+ --spectrum-button-focus-indicator-color: var(--spectrum-static-white-focus-indicator-color);
+
+ --spectrum-button-background-color-disabled: var(--spectrum-disabled-static-white-background-color);
+ --spectrum-button-border-color-disabled: transparent;
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-static-white-content-color);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-white-25);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-white-100);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-white-100);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-white-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-button-border-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-button-border-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-button-border-color-focus: var(--spectrum-transparent-white-900);
+
+ --spectrum-button-content-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-button-content-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-button-content-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-button-content-color-focus: var(--spectrum-transparent-white-900);
+
+ --spectrum-button-background-color-disabled: var(--spectrum-transparent-white-25);
+ --spectrum-button-border-color-disabled: var(--spectrum-disabled-static-white-border-color);
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-static-white-content-color);
+ }
+
+ &.spectrum-Button--secondary {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-white-100);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-white-200);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-white-200);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-white-200);
+
+ --spectrum-button-content-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-button-content-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-button-content-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-button-content-color-focus: var(--spectrum-transparent-white-900);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-white-25);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-white-100);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-white-100);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-white-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-transparent-white-300);
+ --spectrum-button-border-color-hover: var(--spectrum-transparent-white-400);
+ --spectrum-button-border-color-down: var(--spectrum-transparent-white-400);
+ --spectrum-button-border-color-focus: var(--spectrum-transparent-white-400);
+ }
+ }
+ }
+
+ /* ---- Static Black ---- */
+ &.spectrum-Button--staticBlack {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-black-900);
+
+ --spectrum-button-content-color-default: var(--spectrum-white);
+ --spectrum-button-content-color-hover: var(--spectrum-white);
+ --spectrum-button-content-color-down: var(--spectrum-white);
+ --spectrum-button-content-color-focus: var(--spectrum-white);
+
+ --spectrum-button-focus-indicator-color: var(--spectrum-static-black-focus-indicator-color);
+
+ --spectrum-button-background-color-disabled: var(--spectrum-disabled-static-black-background-color);
+ --spectrum-button-border-color-disabled: transparent;
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-static-black-content-color);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-black-25);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-black-100);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-black-100);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-black-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-button-border-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-button-border-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-button-border-color-focus: var(--spectrum-transparent-black-900);
+
+ --spectrum-button-content-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-button-content-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-button-content-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-button-content-color-focus: var(--spectrum-transparent-black-900);
+
+ --spectrum-button-background-color-disabled: transparent;
+ --spectrum-button-border-color-disabled: var(--spectrum-disabled-static-black-border-color);
+ --spectrum-button-content-color-disabled: var(--spectrum-disabled-static-black-content-color);
+ }
+
+ &.spectrum-Button--secondary {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-black-100);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-black-200);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-black-200);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-black-200);
+
+ --spectrum-button-content-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-button-content-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-button-content-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-button-content-color-focus: var(--spectrum-transparent-black-900);
+
+ &.spectrum-Button--outline {
+ --spectrum-button-background-color-default: var(--spectrum-transparent-black-25);
+ --spectrum-button-background-color-hover: var(--spectrum-transparent-black-100);
+ --spectrum-button-background-color-down: var(--spectrum-transparent-black-100);
+ --spectrum-button-background-color-focus: var(--spectrum-transparent-black-100);
+
+ --spectrum-button-border-color-default: var(--spectrum-transparent-black-300);
+ --spectrum-button-border-color-hover: var(--spectrum-transparent-black-400);
+ --spectrum-button-border-color-down: var(--spectrum-transparent-black-400);
+ --spectrum-button-border-color-focus: var(--spectrum-transparent-black-400);
+ }
+ }
+ }
+}
+
.spectrum-Button {
@extend %spectrum-BaseButton;
- @extend %spectrum-ButtonWithFocusRing;
border-radius: var(--mod-button-border-radius, var(--spectrum-button-border-radius));
border-width: var(--mod-button-border-width, var(--spectrum-button-border-width));
border-style: solid;
font-size: var(--mod-button-font-size, var(--spectrum-button-font-size));
- font-weight: var(--mod-bold-font-weight, var(--spectrum-bold-font-weight));
+ font-weight: var(--mod-button-font-weight, var(--spectrum-button-font-weight));
gap: var(--mod-button-padding-label-to-icon, var(--spectrum-button-padding-label-to-icon));
min-inline-size: var(--mod-button-min-width, var(--spectrum-button-min-width));
min-block-size: var(--mod-button-height, var(--spectrum-button-height));
- /* Start with text-only padding */
padding-block: 0;
padding-inline: var(--mod-button-edge-to-text, var(--spectrum-button-edge-to-text));
position: relative;
- /* let staticColor variants inherit their color */
- color: inherit;
+ background-color: var(--highcontrast-button-background-color-default, var(--mod-button-background-color-default, var(--spectrum-button-background-color-default)));
+ border-color: var(--highcontrast-button-border-color-default, var(--mod-button-border-color-default, var(--spectrum-button-border-color-default)));
+ color: var(--highcontrast-button-content-color-default, var(--mod-button-content-color-default, var(--spectrum-button-content-color-default)));
+ transition: border var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear,
+ color var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear,
+ background-color var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear;
margin-block: var(--mod-button-margin-block);
margin-inline-end: var(--mod-button-margin-right);
margin-inline-start: var(--mod-button-margin-left);
- &:hover,
- &:active {
- box-shadow: none;
- }
-
.spectrum-Icon {
/* Any block-size difference between the intended workflow icon size and actual icon used.
Helps support any existing use of smaller UI icons instead of intended Workflow icons. */
- --_icon-size-difference: max(0px,
+ --spectrum-button-icon-size-difference: max(0px,
var(--spectrum-button-intended-icon-size) -
var(--spectrum-icon-block-size, var(--spectrum-button-intended-icon-size))
);
@@ -143,7 +368,7 @@ governing permissions and limitations under the License.
max(0px,
var(--mod-button-top-to-icon, var(--spectrum-button-top-to-icon)) -
var(--mod-button-border-width, var(--spectrum-button-border-width)) +
- (var(--_icon-size-difference, 0px) / 2)
+ (var(--spectrum-button-icon-size-difference, 0px) / 2)
)
);
@@ -156,91 +381,42 @@ governing permissions and limitations under the License.
align-self: flex-start;
}
- /* correct focus indicator radius for t-shirt sizing */
- &::after {
- border-radius: calc(var(--mod-button-border-radius, var(--spectrum-button-border-radius)) + var(--mod-focus-indicator-gap, var(--spectrum-focus-indicator-gap)));
- }
-
- &.spectrum-Button--iconOnly {
- min-inline-size: unset;
- padding: calc(var(--mod-button-edge-to-visual-only, var(--spectrum-button-edge-to-visual-only)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
- border-radius: 50%;
-
- .spectrum-Icon {
- align-self: center;
- margin-inline-start: 0;
- margin-block-start: 0;
- }
-
- &::after {
- border-radius: 50%;
- }
- }
-}
-
-a.spectrum-Button {
- @extend %spectrum-AnchorButton;
-}
-
-.spectrum-Button-label {
- @extend %spectrum-ButtonLabel;
- padding-block-start: calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
- padding-block-end: calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
- line-height: var(--mod-button-line-height, var(--spectrum-button-line-height));
- align-self: start;
- text-align: var(--mod-button-text-align, center);
-}
-
-.spectrum-Button .spectrum-Icon + .spectrum-Button-label {
- text-align: var(--mod-button-text-align-with-icon, start);
-}
-
-.spectrum-Button {
- &:focus-visible,
- &.is-focused {
- &::after {
- box-shadow: 0 0 0 var(--mod-button-focus-ring-thickness, var(--spectrum-button-focus-ring-thickness)) var(--mod-button-focus-ring-color, var(--spectrum-button-focus-indicator-color));
- }
- }
-}
-
-/* Special cases for focus indicator */
-.spectrum-Button {
- transition: border-color var(--mod-button-animation-duration, var(--spectrum-button-animation-duration)) ease-in-out;
-
+ /* Focus indicator */
&::after {
+ content: "";
+ display: block;
position: absolute;
inset: 0;
- margin: calc((var(--mod-button-focus-ring-gap, var(--spectrum-button-focus-ring-gap)) + var(--mod-button-border-width, var(--spectrum-button-border-width))) * -1);
- border-radius: var(--mod-button-focus-ring-border-radius, var(--spectrum-button-focus-ring-border-radius));
+ margin: calc((
+ var(--mod-button-focus-ring-gap, var(--spectrum-button-focus-ring-gap)) +
+ var(--mod-button-border-width, var(--spectrum-button-border-width))
+ ) * -1
+ );
+ border-radius: var(--mod-button-focus-ring-border-radius, calc(
+ var(--mod-button-border-radius, var(--spectrum-button-border-radius)) +
+ var(--mod-button-focus-ring-gap, var(--spectrum-button-focus-ring-gap))
+ ));
transition: box-shadow var(--mod-button-animation-duration, var(--spectrum-button-animation-duration)) ease-in-out;
pointer-events: none;
- content: '';
}
- &:focus-visible {
- /* Remove the default focus outline */
+ &:focus-visible,
+ &.is-focused {
box-shadow: none;
outline: none;
&::after {
- box-shadow: 0 0 0 var(--mod-button-focus-ring-thickness, var(--spectrum-button-focus-ring-thickness)) var(--highcontrast-button-focus-ring-color, var(--mod-button-focus-ring-color,
- var(--mod-button-focus-ring-color, var(--spectrum-button-focus-indicator-color))));
+ box-shadow: 0 0 0
+ var(--mod-button-focus-ring-thickness, var(--spectrum-button-focus-ring-thickness))
+ var(--highcontrast-button-focus-ring-color, var(--mod-button-focus-ring-color, var(--spectrum-button-focus-indicator-color)));
}
}
-}
-/* Core Token Theming */
-/* former skin.css, applied / copied from actionbutton/index.css */
-.spectrum-Button {
- @extend %spectrum-BaseButton;
-
- background-color: var(--highcontrast-button-background-color-default, var(--mod-button-background-color-default, var(--spectrum-button-background-color-default)));
- border-color: var(--highcontrast-button-border-color-default, var(--mod-button-border-color-default, var(--spectrum-button-border-color-default)));
- color: var(--highcontrast-button-content-color-default, var(--mod-button-content-color-default, var(--spectrum-button-content-color-default)));
- transition: border var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear,
- color var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear,
- background-color var(--mod-button-animation-duration, var(--spectrum-button-animation-duration, 130ms)) linear;
+ /* States and interaction */
+ &:hover,
+ &:active {
+ box-shadow: none;
+ }
&:hover {
background-color: var(--highcontrast-button-background-color-hover, var(--mod-button-background-color-hover, var(--spectrum-button-background-color-hover)));
@@ -258,6 +434,7 @@ a.spectrum-Button {
background-color: var(--highcontrast-button-background-color-down, var(--mod-button-background-color-down, var(--spectrum-button-background-color-down)));
border-color: var(--highcontrast-button-border-color-down, var(--mod-button-border-color-down, var(--spectrum-button-border-color-down)));
color: var(--highcontrast-button-content-color-down, var(--mod-button-content-color-down, var(--spectrum-button-content-color-down)));
+ transform: perspective(var(--spectrum-downstate-perspective)) translateZ(var(--spectrum-component-size-difference-down));
}
&:disabled,
@@ -303,42 +480,75 @@ a.spectrum-Button {
}
}
-/* Static color variants */
-.spectrum-Button--staticWhite {
- --spectrum-button-focus-indicator-color: var(--mod-static-black-focus-indicator-color, var(--spectrum-static-black-focus-indicator-color));
+a.spectrum-Button {
+ @extend %spectrum-AnchorButton;
+}
+
+.spectrum-Button-label {
+ @extend %spectrum-ButtonLabel;
+ padding-block-start: calc(var(--mod-button-top-to-text, var(--spectrum-button-top-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ padding-block-end: calc(var(--mod-button-bottom-to-text, var(--spectrum-button-bottom-to-text)) - var(--mod-button-border-width, var(--spectrum-button-border-width)));
+ line-height: var(--mod-button-line-height, var(--spectrum-button-line-height));
+ align-self: start;
+ text-align: var(--mod-button-text-align, center);
+}
+
+.spectrum-Button .spectrum-Icon + .spectrum-Button-label {
+ text-align: var(--mod-button-text-align-with-icon, start);
}
-.spectrum-Button--staticBlack {
- --spectrum-button-focus-indicator-color: var(--mod-static-black-focus-indicator-color, var(--spectrum-static-black-focus-indicator-color));
+/* Icon only variant */
+.spectrum-Button.spectrum-Button--iconOnly {
+ min-inline-size: unset;
+ padding: var(--mod-button-edge-to-visual-only, var(--spectrum-button-edge-to-visual-only));
+
+ .spectrum-Icon {
+ align-self: center;
+ margin-inline-start: 0;
+ margin-block-start: 0;
+ }
}
-/* Windows High Contrast Mode */
+/* Forced colors / high contrast mode */
@media (forced-colors: active) {
.spectrum-Button {
--highcontrast-button-content-color-disabled: GrayText;
--highcontrast-button-border-color-disabled: GrayText;
+ --highcontrast-button-background-color-disabled: ButtonFace;
+
--mod-progress-circle-track-border-color: ButtonText;
--mod-progress-circle-track-border-color-over-background: ButtonText;
--mod-progress-circle-thickness: var(--spectrum-progress-circle-thickness-medium);
+ --highcontrast-button-focus-ring-color: ButtonText;
+
&:focus-visible {
&::after {
+ /* Make sure the box-shadow used for the focus indicator is displayed. */
forced-color-adjust: none;
- box-shadow: 0 0 0 var(--mod-button-focus-ring-thickness, var(--spectrum-button-focus-ring-thickness)) ButtonText;
}
}
- &.spectrum-Button--accent.spectrum-Button--fill {
+ &.spectrum-Button--accent,
+ &:not(
+ .spectrum-Button--primary,
+ .spectrum-Button--negative,
+ .spectrum-Button--secondary,
+ .spectrum-Button--staticBlack,
+ .spectrum-Button--staticWhite
+ ){
+ /* The accent fill variant looks different than the other buttons.
+ It inverts the background and content colors. */
--highcontrast-button-background-color-default: ButtonText;
--highcontrast-button-content-color-default: ButtonFace;
- --highcontrast-button-background-color-disabled: ButtonFace;
--highcontrast-button-background-color-hover: Highlight;
--highcontrast-button-background-color-down: Highlight;
--highcontrast-button-background-color-focus: Highlight;
- --highcontrast-button-content-color-hover: ButtonFace;
- --highcontrast-button-content-color-down: ButtonFace;
- --highcontrast-button-content-color-focus: ButtonFace;
+
+ --highcontrast-button-content-color-hover: HighlightText;
+ --highcontrast-button-content-color-down: HighlightText;
+ --highcontrast-button-content-color-focus: HighlightText;
.spectrum-Button-label {
forced-color-adjust: none;
diff --git a/components/button/metadata/button-accent.yml b/components/button/metadata/button-accent.yml
index 8d3be60b926..234a4f5e360 100644
--- a/components/button/metadata/button-accent.yml
+++ b/components/button/metadata/button-accent.yml
@@ -8,21 +8,29 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Fill or Outline class required
- All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
-
- ### CTA replaced by Accent with Fill
- Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+ ### Version 13.0.0
+ #### Spectrum 2 release
+ Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+ - Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+ - Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+ - The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+ The following `--mod` custom properties have been renamed:
+ - `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+ - `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`.
+
+ ### Version 11.0.0
+ #### Remove focus-ring class
+ We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
- ### Icon Only
+ ### Version 10.0.0
+ #### Icon Only
Add the `.spectrum-Button--iconOnly` class to apply the correct styling when an icon is used without a label.
Provide an `aria-label` on the button itself when using this variant for accessibility.
- ### T-shirt sizing
- Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
-
- ### Change workflow icon size
-
+ #### Change workflow icon size
Previously, all Buttons used `.spectrum-Icon--sizeS`. This has changed:
| Button classname | Workflow icon classname |
@@ -32,8 +40,17 @@ sections:
| `.spectrum-Button--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-Button--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Remove focus-ring class
- We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
+ ### Version 6.0.0
+ #### Fill or Outline class required
+ All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
+
+ #### CTA replaced by Accent with Fill
+ Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+
+ ### Version 3.0.0
+ #### T-shirt sizing
+ Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
+
examples:
- id: button-accent
name: Sizing
@@ -42,18 +59,18 @@ examples:
S
-
+
Edit
-
+
Edit
-
+
@@ -62,18 +79,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -83,18 +100,18 @@ examples:
L
-
+
Edit
-
+
Edit
-
+
@@ -104,18 +121,18 @@ examples:
XL
-
+
Edit
-
+
Edit
-
+
@@ -128,18 +145,18 @@ examples:
markup: |
-
+
Button
-
+
Edit
-
+
@@ -174,18 +191,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -240,18 +257,18 @@ examples:
markup: |
-
+
Button
-
+
Edit
-
+
diff --git a/components/button/metadata/button-negative.yml b/components/button/metadata/button-negative.yml
index 9acb42c7e1f..9cdce8eb913 100644
--- a/components/button/metadata/button-negative.yml
+++ b/components/button/metadata/button-negative.yml
@@ -8,24 +8,29 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Fill or Outline class required
- All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
-
- ### Negative replaced by Negative with Outline
- Replace all `.spectrum-Button--negative` with `.spectrum-Button--negative .spectrum-Button--outline`.
-
- ### Negative Quiet replaced by Negative with Outline
- Replace all `.spectrum-Button--negative .spectrum-Button--quiet` with `.spectrum-Button--negative .spectrum-Button--outline`.
+ ### Version 13.0.0
+ #### Spectrum 2 release
+ Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+ - Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+ - Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+ - The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+ The following `--mod` custom properties have been renamed:
+ - `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+ - `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`.
+
+ ### Version 11.0.0
+ #### Remove focus-ring class
+ We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
- ### Icon Only
+ ### Version 10.0.0
+ #### Icon Only
Add the `.spectrum-Button--iconOnly` class to apply the correct styling when an icon is used without a label.
Provide an `aria-label` on the button itself when using this variant for accessibility.
- ### T-shirt sizing
- Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
-
- ### Change workflow icon size
-
+ #### Change workflow icon size
Previously, all Buttons used `.spectrum-Icon--sizeS`. This has changed:
| Button classname | Workflow icon classname |
@@ -35,8 +40,17 @@ sections:
| `.spectrum-Button--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-Button--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Remove focus-ring class
- We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
+ ### Version 6.0.0
+ #### Fill or Outline class required
+ All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
+
+ #### CTA replaced by Accent with Fill
+ Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+
+ ### Version 3.0.0
+ #### T-shirt sizing
+ Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
+
examples:
- id: button-negative
name: Sizing
@@ -45,18 +59,18 @@ examples:
S
-
+
Delete
-
+
Delete
-
+
@@ -65,18 +79,18 @@ examples:
M (default)
-
+
Delete
-
+
Delete
-
+
@@ -86,18 +100,18 @@ examples:
L
-
+
Delete
-
+
Delete
-
+
@@ -107,18 +121,18 @@ examples:
XL
-
+
Delete
-
+
Delete
-
+
@@ -129,18 +143,18 @@ examples:
- id: button-negative-disabled
name: Disabled
markup: |
-
+
Delete
-
+
Delete
-
+
@@ -173,18 +187,18 @@ examples:
M (default)
-
+
Delete
-
+
Delete
-
+
@@ -237,18 +251,18 @@ examples:
- id: button-negative-outline-disabled
name: Outline - Disabled
markup: |
-
+
Delete
-
+
Delete
-
+
diff --git a/components/button/metadata/button-pending.yml b/components/button/metadata/button-pending.yml
index 1c9fd32a4ec..0e714e0f176 100644
--- a/components/button/metadata/button-pending.yml
+++ b/components/button/metadata/button-pending.yml
@@ -74,7 +74,7 @@ examples:
M (default)
-
+
Edit
@@ -93,7 +93,7 @@ examples:
-
+
@@ -115,7 +115,7 @@ examples:
-
+
@@ -338,7 +338,7 @@ examples:
M (default)
-
+
Edit
@@ -357,7 +357,7 @@ examples:
-
+
@@ -379,7 +379,7 @@ examples:
-
+
@@ -604,7 +604,7 @@ examples:
M (default)
-
+
Edit
@@ -623,7 +623,7 @@ examples:
-
+
@@ -645,7 +645,7 @@ examples:
-
+
@@ -871,7 +871,7 @@ examples:
M (default)
-
+
Edit
@@ -890,7 +890,7 @@ examples:
-
+
@@ -912,7 +912,7 @@ examples:
-
+
diff --git a/components/button/metadata/button-primary.yml b/components/button/metadata/button-primary.yml
index e7bb7f449ec..11bad5f3061 100644
--- a/components/button/metadata/button-primary.yml
+++ b/components/button/metadata/button-primary.yml
@@ -8,24 +8,29 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Fill or Outline class required
- All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
-
- ### Primary replaced by Primary with Outline
- Replace all `.spectrum-Button--primary` with `.spectrum-Button--primary .spectrum-Button--outline`.
-
- ### Primary Quiet replaced by Secondary with Outline
- Replace all `.spectrum-Button--primary .spectrum-Button--quiet` with `.spectrum-Button--secondary .spectrum-Button--outline`.
+ ### Version 13.0.0
+ #### Spectrum 2 release
+ Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+ - Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+ - Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+ - The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+ The following `--mod` custom properties have been renamed:
+ - `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+ - `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`.
+
+ ### Version 11.0.0
+ #### Remove focus-ring class
+ We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
- ### Icon Only
+ ### Version 10.0.0
+ #### Icon Only
Add the `.spectrum-Button--iconOnly` class to apply the correct styling when an icon is used without a label.
Provide an `aria-label` on the button itself when using this variant for accessibility.
- ### T-shirt sizing
- Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
-
- ### Change workflow icon size
-
+ #### Change workflow icon size
Previously, all Buttons used `.spectrum-Icon--sizeS`. This has changed:
| Button classname | Workflow icon classname |
@@ -35,8 +40,17 @@ sections:
| `.spectrum-Button--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-Button--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Remove focus-ring class
- We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
+ ### Version 6.0.0
+ #### Fill or Outline class required
+ All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
+
+ #### CTA replaced by Accent with Fill
+ Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+
+ ### Version 3.0.0
+ #### T-shirt sizing
+ Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
+
examples:
- id: button-primary
name: Sizing
@@ -45,18 +59,18 @@ examples:
S
-
+
Edit
-
+
Edit
-
+
@@ -65,18 +79,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -86,18 +100,18 @@ examples:
L
-
+
Edit
-
+
Edit
-
+
@@ -107,18 +121,18 @@ examples:
XL
-
+
Edit
-
+
Edit
-
+
@@ -129,18 +143,18 @@ examples:
- id: button-primary-disabled
name: Disabled
markup: |
-
+
Edit
-
+
Edit
-
+
@@ -173,18 +187,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -237,18 +251,18 @@ examples:
- id: button-primary-outline-disabled
name: Outline - Disabled
markup: |
-
+
Edit
-
+
Edit
-
+
diff --git a/components/button/metadata/button-secondary.yml b/components/button/metadata/button-secondary.yml
index 7b86a380ffc..56c71893e5a 100644
--- a/components/button/metadata/button-secondary.yml
+++ b/components/button/metadata/button-secondary.yml
@@ -8,24 +8,29 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Fill or Outline class required
- All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
-
- ### Secondary replaced by Secondary with Outline
- Replace all `.spectrum-Button--secondary` with `.spectrum-Button--secondary .spectrum-Button--outline`.
-
- ### Secondary Quiet replaced by Secondary with Outline
- Replace all `.spectrum-Button--secondary .spectrum-Button--quiet` with `.spectrum-Button--secondary .spectrum-Button--outline`.
+ ### Version 13.0.0
+ #### Spectrum 2 release
+ Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+ - Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+ - Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+ - The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+ The following `--mod` custom properties have been renamed:
+ - `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+ - `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`.
+
+ ### Version 11.0.0
+ #### Remove focus-ring class
+ We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
- ### Icon Only
+ ### Version 10.0.0
+ #### Icon Only
Add the `.spectrum-Button--iconOnly` class to apply the correct styling when an icon is used without a label.
Provide an `aria-label` on the button itself when using this variant for accessibility.
- ### T-shirt sizing
- Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
-
- ### Change workflow icon size
-
+ #### Change workflow icon size
Previously, all Buttons used `.spectrum-Icon--sizeS`. This has changed:
| Button classname | Workflow icon classname |
@@ -35,8 +40,17 @@ sections:
| `.spectrum-Button--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-Button--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Remove focus-ring class
- We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
+ ### Version 6.0.0
+ #### Fill or Outline class required
+ All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
+
+ #### CTA replaced by Accent with Fill
+ Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+
+ ### Version 3.0.0
+ #### T-shirt sizing
+ Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
+
examples:
- id: button-secondary
name: Sizing
@@ -45,18 +59,18 @@ examples:
S
-
+
Edit
-
+
Edit
-
+
@@ -65,18 +79,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -86,18 +100,18 @@ examples:
L
-
+
Edit
-
+
Edit
-
+
@@ -107,18 +121,18 @@ examples:
XL
-
+
Edit
-
+
Edit
-
+
@@ -129,18 +143,18 @@ examples:
- id: button-secondary
name: Disabled
markup: |
-
+
Edit
-
+
Edit
-
+
@@ -173,18 +187,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -237,18 +251,18 @@ examples:
- id: button-secondary-outline-disabled
name: Outline - Disabled
markup: |
-
+
Edit
-
+
Edit
-
+
diff --git a/components/button/metadata/button-staticcolor.yml b/components/button/metadata/button-staticcolor.yml
index ae8792424af..a797d01ee33 100644
--- a/components/button/metadata/button-staticcolor.yml
+++ b/components/button/metadata/button-staticcolor.yml
@@ -8,24 +8,29 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Fill or Outline class required
- All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
-
- ### Over background replaced by StaticWhite with Outline
- Replace all `.spectrum-Button--overBackground` with `.spectrum-Button--staticWhite .spectrum-Button--outline`.
-
- ### Over background Quiet replaced by StaticWhite with Outline
- Replace all `.spectrum-Button--overBackground .spectrum-Button--quiet` with `.spectrum-Button--staticWhite .spectrum-Button--outline`.
+ ### Version 13.0.0
+ #### Spectrum 2 release
+ Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
+ - Outline buttons are no longer available in accent and negative options — use the filled variant instead.
+ - Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
+ - The `.spectrum-Button--fill` class is no longer needed and has been removed.
+
+ The following `--mod` custom properties have been renamed:
+ - `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+ - `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`.
+
+ ### Version 11.0.0
+ #### Remove focus-ring class
+ We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
- ### Icon Only
+ ### Version 10.0.0
+ #### Icon Only
Add the `.spectrum-Button--iconOnly` class to apply the correct styling when an icon is used without a label.
Provide an `aria-label` on the button itself when using this variant for accessibility.
- ### T-shirt sizing
- Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
-
- ### Change workflow icon size
-
+ #### Change workflow icon size
Previously, all Buttons used `.spectrum-Icon--sizeS`. This has changed:
| Button classname | Workflow icon classname |
@@ -35,29 +40,38 @@ sections:
| `.spectrum-Button--sizeL` | `.spectrum-Icon--sizeL` |
| `.spectrum-Button--sizeXL` | `.spectrum-Icon--sizeXL` |
- ### Remove focus-ring class
- We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
+ ### Version 6.0.0
+ #### Fill or Outline class required
+ All buttons now require either the `.spectrum-Button--fill` or `.spectrum-Button--outline` class.
+
+ #### CTA replaced by Accent with Fill
+ Replace all `.spectrum-Button--cta` with `.spectrum-Button--accent .spectrum-Button--fill`.
+
+ ### Version 3.0.0
+ #### T-shirt sizing
+ Button now supports t-shirt sizing and requires that you specify the size of button by adding a `.spectrum-Button--size*` class.
+
examples:
- id: button-staticcolor
name: Static White
markup: |
-
+
S
-
+
Edit
-
+
Edit
-
+
@@ -66,18 +80,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -87,18 +101,18 @@ examples:
L
-
+
Edit
-
+
Edit
-
+
@@ -108,18 +122,18 @@ examples:
XL
-
+
Edit
-
+
Edit
-
+
@@ -131,19 +145,19 @@ examples:
- id: button-staticcolor
name: Static White - Disabled
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -153,19 +167,19 @@ examples:
- id: button-staticcolor
name: Static White - Secondary
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -175,23 +189,23 @@ examples:
- id: button-staticcolor
name: Static Black
markup: |
-
+
S
-
+
Edit
-
+
Edit
-
+
@@ -200,18 +214,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -221,18 +235,18 @@ examples:
L
-
+
Edit
-
+
Edit
-
+
@@ -242,18 +256,18 @@ examples:
XL
-
+
Edit
-
+
Edit
-
+
@@ -265,19 +279,19 @@ examples:
- id: button-staticcolor
name: Static Black - Disabled
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -288,18 +302,18 @@ examples:
name: Static Black - Secondary
markup: |
-
+
Edit
-
+
Edit
-
+
@@ -309,7 +323,7 @@ examples:
- id: button-staticcolor
name: Static White - Outline
markup: |
-
+
S
@@ -334,18 +348,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -399,19 +413,19 @@ examples:
- id: button-staticcolor
name: Static White - Outline, Disabled
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -421,19 +435,19 @@ examples:
- id: button-staticcolor
name: Static White - Outline, Secondary
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -443,7 +457,7 @@ examples:
- id: button-staticcolor
name: Static Black - Outline
markup: |
-
+
S
@@ -468,18 +482,18 @@ examples:
M (default)
-
+
Edit
-
+
Edit
-
+
@@ -533,19 +547,19 @@ examples:
- id: button-staticcolor
name: Static Black - Outline, Disabled
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
@@ -555,19 +569,19 @@ examples:
- id: button-staticcolor
name: Static Black - Outline, Secondary
markup: |
-
-
+
+
Edit
-
+
Edit
-
+
diff --git a/components/button/metadata/mods.md b/components/button/metadata/mods.md
index c8fa31d2674..02df883c62d 100644
--- a/components/button/metadata/mods.md
+++ b/components/button/metadata/mods.md
@@ -1,50 +1,43 @@
-| Modifiable custom properties |
-| ------------------------------------------ |
-| `--mod-animation-duration-100` |
-| `--mod-bold-font-weight` |
-| `--mod-button-animation-duration` |
-| `--mod-button-background-color-default` |
-| `--mod-button-background-color-disabled` |
-| `--mod-button-background-color-down` |
-| `--mod-button-background-color-focus` |
-| `--mod-button-background-color-hover` |
-| `--mod-button-border-color-default` |
-| `--mod-button-border-color-disabled` |
-| `--mod-button-border-color-down` |
-| `--mod-button-border-color-focus` |
-| `--mod-button-border-color-hover` |
-| `--mod-button-border-radius` |
-| `--mod-button-border-width` |
-| `--mod-button-bottom-to-text` |
-| `--mod-button-content-color-default` |
-| `--mod-button-content-color-disabled` |
-| `--mod-button-content-color-down` |
-| `--mod-button-content-color-focus` |
-| `--mod-button-content-color-hover` |
-| `--mod-button-edge-to-text` |
-| `--mod-button-edge-to-visual` |
-| `--mod-button-edge-to-visual-only` |
-| `--mod-button-focus-indicator-gap` |
-| `--mod-button-focus-ring-border-radius` |
-| `--mod-button-focus-ring-color` |
-| `--mod-button-focus-ring-gap` |
-| `--mod-button-focus-ring-thickness` |
-| `--mod-button-font-family` |
-| `--mod-button-font-size` |
-| `--mod-button-height` |
-| `--mod-button-icon-margin-block-start` |
-| `--mod-button-line-height` |
-| `--mod-button-margin-block` |
-| `--mod-button-margin-left` |
-| `--mod-button-margin-right` |
-| `--mod-button-min-width` |
-| `--mod-button-padding-label-to-icon` |
-| `--mod-button-static-content-color` |
-| `--mod-button-text-align` |
-| `--mod-button-text-align-with-icon` |
-| `--mod-button-top-to-icon` |
-| `--mod-button-top-to-text` |
-| `--mod-focus-indicator-gap` |
-| `--mod-line-height-100` |
-| `--mod-sans-font-family-stack` |
-| `--mod-static-black-focus-indicator-color` |
+| Modifiable custom properties |
+| ---------------------------------------- |
+| `--mod-button-animation-duration` |
+| `--mod-button-background-color-default` |
+| `--mod-button-background-color-disabled` |
+| `--mod-button-background-color-down` |
+| `--mod-button-background-color-focus` |
+| `--mod-button-background-color-hover` |
+| `--mod-button-border-color-default` |
+| `--mod-button-border-color-disabled` |
+| `--mod-button-border-color-down` |
+| `--mod-button-border-color-focus` |
+| `--mod-button-border-color-hover` |
+| `--mod-button-border-radius` |
+| `--mod-button-border-width` |
+| `--mod-button-bottom-to-text` |
+| `--mod-button-content-color-default` |
+| `--mod-button-content-color-disabled` |
+| `--mod-button-content-color-down` |
+| `--mod-button-content-color-focus` |
+| `--mod-button-content-color-hover` |
+| `--mod-button-edge-to-text` |
+| `--mod-button-edge-to-visual` |
+| `--mod-button-edge-to-visual-only` |
+| `--mod-button-focus-ring-border-radius` |
+| `--mod-button-focus-ring-color` |
+| `--mod-button-focus-ring-gap` |
+| `--mod-button-focus-ring-thickness` |
+| `--mod-button-font-family` |
+| `--mod-button-font-size` |
+| `--mod-button-font-weight` |
+| `--mod-button-height` |
+| `--mod-button-icon-margin-block-start` |
+| `--mod-button-line-height` |
+| `--mod-button-margin-block` |
+| `--mod-button-margin-left` |
+| `--mod-button-margin-right` |
+| `--mod-button-min-width` |
+| `--mod-button-padding-label-to-icon` |
+| `--mod-button-text-align` |
+| `--mod-button-text-align-with-icon` |
+| `--mod-button-top-to-icon` |
+| `--mod-button-top-to-text` |
diff --git a/components/button/package.json b/components/button/package.json
index 84458bd2361..8aecf46579a 100644
--- a/components/button/package.json
+++ b/components/button/package.json
@@ -1,49 +1,47 @@
{
- "name": "@spectrum-css/button",
- "version": "13.1.0",
- "description": "The Spectrum CSS button component",
- "license": "Apache-2.0",
- "author": "Adobe",
- "homepage": "https://opensource.adobe.com/spectrum-css/button-accent",
- "repository": {
- "type": "git",
- "url": "https://github.com/adobe/spectrum-css.git",
- "directory": "components/button"
- },
- "bugs": {
- "url": "https://github.com/adobe/spectrum-css/issues"
- },
- "main": "dist/index.css",
- "files": [
- "dist/*",
- "CHANGELOG.md",
- "package.json",
- "stories/template.js",
- "metadata/mods.md"
- ],
- "peerDependencies": {
- "@spectrum-css/icon": ">=7",
- "@spectrum-css/progresscircle": ">=3",
- "@spectrum-css/tokens": ">=14"
- },
- "peerDependenciesMeta": {
- "@spectrum-css/icon": {
- "optional": true
- },
- "@spectrum-css/progresscircle": {
- "optional": true
- }
- },
- "devDependencies": {
- "@spectrum-css/commons": "^10.0.0"
- },
- "keywords": [
- "spectrum",
- "css",
- "design system",
- "adobe"
- ],
- "publishConfig": {
- "access": "public"
- }
+ "name": "@spectrum-css/button",
+ "version": "14.0.0-next.7",
+ "description": "The Spectrum CSS button component",
+ "license": "Apache-2.0",
+ "author": "Adobe",
+ "homepage": "https://opensource.adobe.com/spectrum-css/button-accent",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/adobe/spectrum-css.git",
+ "directory": "components/button"
+ },
+ "bugs": {
+ "url": "https://github.com/adobe/spectrum-css/issues"
+ },
+ "main": "dist/index.css",
+ "files": [
+ "dist/*",
+ "metadata/mods.md",
+ "stories/template.js"
+ ],
+ "peerDependencies": {
+ "@spectrum-css/icon": ">=7",
+ "@spectrum-css/progresscircle": ">=3",
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
+ },
+ "peerDependenciesMeta": {
+ "@spectrum-css/icon": {
+ "optional": true
+ },
+ "@spectrum-css/progresscircle": {
+ "optional": true
+ }
+ },
+ "devDependencies": {
+ "@spectrum-css/commons": "^9.1.4-next.1"
+ },
+ "keywords": [
+ "adobe",
+ "css",
+ "design system",
+ "spectrum"
+ ],
+ "publishConfig": {
+ "access": "public"
+ }
}
diff --git a/components/button/stories/button.mdx b/components/button/stories/button.mdx
new file mode 100644
index 00000000000..a20869868f5
--- /dev/null
+++ b/components/button/stories/button.mdx
@@ -0,0 +1,101 @@
+import { Canvas, Meta, Description } from '@storybook/blocks';
+
+import * as ButtonStories from './button.stories';
+
+
+
+# Button
+
+
+
+## Variants
+
+There are four available variants that are used for different levels of emphasis and different
+types of actions. By default, a button uses the fill style with a solid background. The primary
+and secondary variants also have an outline option.
+
+### Accent
+
+The call to action button communicates strong emphasis and is reserved for encouraging critical
+actions. In general, only use the emphasized option for the most important action on the page.
+
+
+
+### Primary
+
+The primary button is for medium emphasis. Use it in place of a call to action button when the
+action requires less prominence, or if there are multiple primary actions of the same importance
+in the same view. Both the fill (default) and outline styles are demonstrated below:
+
+
+
+### Secondary
+
+The secondary button is for low emphasis. It’s paired with other button types to surface less
+prominent actions, and should never be the only button in a group. Both the fill (default) and
+outline styles are demonstrated below:
+
+
+
+### Negative
+
+The negative button is for emphasizing actions that can be destructive or have negative
+consequences if taken. Use it sparingly.
+
+
+
+## Static color
+
+When a button needs to be placed on top of a color background or a visual, use the static color
+option. Static color buttons do not change shades or values depending upon the color theme.
+
+### Static white - primary
+
+
+
+### Static white - secondary
+
+
+
+### Static black - primary
+
+
+
+### Static black - secondary
+
+
+
+## Sizing
+
+Buttons come in four different sizes: small, medium, large, and extra large. The medium size is
+the default and most frequently used option. Use the other sizes sparingly; they should be used
+to create a hierarchy of importance within the page.
+
+
+
+## Pending state
+
+The pending button is for indicating that a quick progress action is taking place. In this case, the
+label and optional icon disappear and a progress circle appears. The progress circle always shows an
+indeterminate progress. We recommend the use of the `.is-pending` class on the component’s parent
+container, but there is also an option to use an attribute of `pending` instead. Buttons should have
+the disabled attribute when the pending state is applied.
+
+
+
+## Disabled state
+
+A button in a disabled state shows that an action exists, but is not available in that circumstance.
+This state can be used to maintain layout continuity and to communicate that an action may become
+available later.
+
+
+
+## Text overflow behavior
+
+When the button text is too long for the horizontal space available, it wraps to form another line.
+When there is no icon present, the text is aligned center. When there is an icon present, the text is
+aligned `start` (left with a writing direction of left-to-right) and the icon remains vertically aligned
+at the top.
+
+
\ No newline at end of file
diff --git a/components/button/stories/button.stories.js b/components/button/stories/button.stories.js
index 508cb2762e7..de200d168c7 100644
--- a/components/button/stories/button.stories.js
+++ b/components/button/stories/button.stories.js
@@ -1,5 +1,8 @@
+import { withDownStateDimensionCapture } from "@spectrum-css/preview/decorators";
+
import { html } from "lit";
import { styleMap } from "lit/directives/style-map.js";
+import { when } from "lit/directives/when.js";
import { default as IconStories } from "@spectrum-css/icon/stories/icon.stories.js";
import { Template as Typography } from "@spectrum-css/typography/stories/template.js";
@@ -112,7 +115,7 @@ export default {
type: { name: "string" },
table: {
type: { summary: "string" },
- category: "Advanced",
+ category: "Component",
},
options: ["white", "black"],
@@ -143,6 +146,7 @@ export default {
}
},
decorators: [
+ withDownStateDimensionCapture(".spectrum-Button:not(:disabled)"),
(Story, context) => html`
+
+ ${Story(context)}
+
+ `;
+ },
],
};
-export const Truncate = Template.bind({});
-Truncate.args = {
- items: [
- { label: "Deselect", },
- { label: "Select inverse" },
- { label: "Feather" },
- { label: "Select and mask" },
- { type: "divider" },
- { label: "Save selection" },
- { label: "Make work path", isDisabled: true },
- ],
- shouldTruncate: true,
- maxInlineSize: "100px",
-};
-
-export const MenuWithSections = Template.bind({});
-MenuWithSections.args = {
- items: [
+const ChromaticMenuWithVariants = (args) => {
+ const menuData = [
{
- heading: "Section heading",
- items: [
- { label: "Action 1" },
- { label: "Action 2" },
- { label: "Action 3" },
- ],
+ stateTitle: "No selection",
+ args: { ...args, selectionMode: "none" },
},
- { type: "divider" },
{
- heading: "Section heading",
- items: [
- { label: "Edit", iconName: "Edit" },
- { label: "Copy", iconName: "Copy", isDisabled: true },
- ],
+ stateTitle: "With dividers",
+ args: { ...args, selectionMode: "none", hasDividers: true },
},
- ],
-};
-
-export const MenuWithCheckmark = Template.bind({});
-MenuWithCheckmark.args = {
- role: "listbox",
- subrole: "option",
- selectionMode: "single",
- items: [
{
- idx: 1,
- heading: "San Francisco",
- id: "menu-heading-sf",
- items: [
- { label: "Financial District" },
- { label: "South of Market" },
- { label: "North Beach" },
- ],
+ stateTitle: "Single selection",
+ args: { ...args, selectionMode: "single" },
},
- { type: "divider" },
{
- idx: 2,
- heading: "Oakland",
- id: "menu-heading-oak",
- items: [
- { label: "City Center" },
- { label: "Jack London Square", isDisabled: true },
- {
- label: "My best friend's mom's house in the burbs just off Silverado street",
- isSelected: true,
- isChecked: true,
- },
- ],
- },
- ],
+ stateTitle: "Multi selection",
+ args: { ...args, selectionMode: "multiple" },
+ },
+ ];
+ return menuData.map((item) => html`
+
+
+ ${Typography({
+ semantics: "detail",
+ size: "l",
+ content: [ item.stateTitle ],
+ })}
+
+ ${Template({...args, ...item.args})}
+
+
+
+`);
};
-/**
- * A few different variants and states are demonstrated in this story. Menu items are shown with icons, with short descriptions, and with both. A selected item and a disabled item are shown for each. A max-width is set for the story, to test the text wrapping.
- */
-export const IconsAndDescriptions = Template.bind({});
-IconsAndDescriptions.args = {
+export const MenuWithVariants = (args) => window.isChromatic() ?
+ ChromaticMenuWithVariants(args) : Template(args);
+MenuWithVariants.argTypes = {
+ hasDividers: {
+ name: "Has dividers",
+ description: "Shows dividers between sections",
+ table: {
+ type: { summary: "boolean" },
+ category: "Component",
+ },
+ control: "boolean",
+ },
+};
+MenuWithVariants.args = {
role: "listbox",
subrole: "option",
customStyles: { maxWidth: "400px" },
+ selectionMode: "none",
+ hasDividers: false,
items: [
{
idx: 1,
- heading: "With Icons",
+ heading: "Menu header - Menu",
id: "menu-heading-with-icons",
items: [
{
- label: "Default Menu Item",
+ label: "Default menu item",
iconName: "Export"
},
{
- label: "Focused Menu Item",
+ label: "Focused menu item",
iconName: "FolderOpen",
isFocused: true
},
{
- label: "A Menu Item With a Longer Label That Causes The Text to Wrap to The Next Line",
- iconName: "Share",
+ label: "A menu item with a longer label that causes the text to wrap to the next line",
+ thumbnailUrl: "thumbnail.png",
},
{
- label: "Disabled Menu Item",
+ label: "Menu item with no icon",
+ },
+ {
+ label: "Disabled menu item",
iconName: "Share",
isDisabled: true,
},
],
},
+ { type: "divider" },
{
idx: 2,
- heading: "With Short Descriptions",
+ heading: "Menu header - With descriptions",
+ sectionDescription: "This menu header also has a description",
id: "menu-heading-short-desc",
items: [
{
- label: "Default Menu Item",
+ label: "Menu item with description",
description: "Short description",
},
{
- label: "Focused Menu Item",
- description: "Another short description",
- isFocused: true,
- },
- {
- label: "A Menu Item With a Longer Label That Causes The Text to Wrap to The Next Line",
- description: "A description that is longer than average and is forced to wrap with an example max width.",
+ label: "Selected item",
+ description: "This item is checked if single-select or multi-select mode is turned on",
+ isSelected: true,
+ thumbnailUrl: "thumbnail.png",
},
{
- label: "Disabled Menu Item",
- description: "Menu item description.",
- isDisabled: true,
+ label: "Selected item with icon",
+ iconName: "Cloud",
+ description: "This item is checked if single-select or multi-select mode is turned on",
+ isSelected: true,
},
],
},
+ { type: "divider" },
{
idx: 3,
- heading: "With Icons and Short Descriptions",
- id: "menu-heading-desc-and-icon",
+ heading: "Menu header - With actions, icons, thumbnails, short descriptions, and values and longer header text that wraps",
+ sectionDescription: "This menu header also has a description that is long enough to hopefully just maybe wrap if it's long enough",
+ id: "menu-heading-desc-icon-value",
+ hasSwitches: true,
items: [
{
- label: "Default Menu Item",
- iconName: "Export",
- description: "Short description",
+ label: "Menu item with action and a longer label that truncates if it is long enough to truncate",
+ iconName: "Cut",
+ description: "This item has a switch if multi-select mode is turned on.",
},
{
- label: "Focused Menu Item",
- iconName: "FolderOpen",
- description: "Another short description",
- isFocused: true,
+ label: "Menu item with action",
+ iconName: "Copy",
+ description: "In multi-select mode, this item will be switched on. In single-select mode, this item will be checked.",
+ isSelected: true,
},
{
- label: "A Menu Item With a Longer Label That Causes The Text to Wrap to The Next Line",
- iconName: "Share",
- description: "A description that is longer than average and is forced to wrap with an example max width.",
+ label: "Menu item with action and value",
+ iconName: "Paste",
+ description: "This item has a value. If multi-select mode is turned on, it also has a switch and the value can be used to label the switch.",
+ value: "⌘ C",
},
{
- label: "Disabled Menu Item",
- iconName: "Share",
- description: "Menu item description.",
+ label: "Disabled menu item with action",
+ description: "Disabled menu item with description and icon",
+ isDisabled: true,
+ thumbnailUrl: "thumbnail.png",
+ },
+ {
+ label: "Menu item with external link action",
+ description: "Menu item with external link action (does not work in multi-select mode)",
+ hasExternalLink: true,
+ },
+ {
+ label: "Disabled menu item with external link action",
+ description: "Menu item with external link action (does not work in multi-select mode)",
+ hasExternalLink: true,
isDisabled: true,
},
],
},
- ],
-};
-
-/**
- * For single selection menu sections, menu items show a single checkmark to indicate the selected item.
- */
-export const SingleSelection = Template.bind({});
-SingleSelection.args = {
- selectionMode: "single",
- customStyles: { maxWidth: "1000px" },
- items: [
- {
- label: "Marquee. Extra long menu item text to demonstrate wrapping text and alignment of icon in this situation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- isSelected: true,
- isChecked: true,
- },
- { label: "Add" },
- { label: "Subtract" },
- ],
-};
-
-export const SingleSelectionWithIcons = Template.bind({});
-SingleSelectionWithIcons.args = {
- selectionMode: "single",
- customStyles: { maxWidth: "1000px" },
- items: [
- {
- label: "Marquee. Extra long menu item text to demonstrate wrapping text and alignment of icon in this situation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- iconName: "Selection",
- isSelected: true,
- isChecked: true,
- },
- {
- label: "Add",
- iconName: "SelectAdd",
- },
- {
- label: "Subtract",
- iconName: "SelectSubtract",
- },
- ],
-};
-
-export const MultipleSelection = Template.bind({});
-MultipleSelection.args = {
- selectionMode: "multiple",
- customStyles: {maxWidth: "1000px"},
- items: [
- {
- label: "Marquee. Extra long menu item text to demonstrate wrapping text and alignment of icon in this situation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- isSelected: true,
- isChecked: true,
- },
- {
- label: "Add",
- },
- {
- label: "Subtract",
- },
- ],
-};
-
-export const WithActions = Template.bind({});
-WithActions.args = {
- hasActions: true,
- customStyles: {maxWidth: "1000px"},
- items: [
- {
- label: "Marquee. Extra long menu item text to demonstrate wrapping text and alignment of icon in this situation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- },
- {
- label: "Add",
- },
- {
- label: "Subtract",
- },
- {
- label: "Example of a disabled menu item",
- isDisabled: true,
- },
- ],
-};
-
-export const WithValueAndActions = Template.bind({});
-WithValueAndActions.args = {
- hasActions: true,
- customStyles: { maxWidth: "1000px" },
- items: [
- {
- label: "Marquee. Extra long menu item text to demonstrate wrapping text and alignment of icon in this situation. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
- value: "Value"
- },
- {
- label: "Add",
- value: "Value"
- },
- {
- label: "Subtract",
- value: "Value"
- },
- {
- label: "Example of a disabled menu item",
- value: "Value",
- isDisabled: true,
- },
- ],
-};
-
-/**
- * When a menu item contains a submenu, a drill-in chevron will appear at the end of the menu item to show that a submenu is available.
- */
-export const DrillInSubmenu = Template.bind({});
-DrillInSubmenu.storyName = "Drill-in for Submenu";
-DrillInSubmenu.args = {
- items: [
- { label: "Deselect" },
- { label: "Select Inverse" },
{
- label: "Feather really long item",
- isDrillIn: true,
- isOpen: true,
- },
- {
- label: "Select and Mask",
- isDrillIn: true,
- isDisabled: true,
- isOpen: true,
+ idx: 4,
+ heading: "Menu header - These menu items have drill-ins for a submenu",
+ id: "menu-heading-drillin",
+ items: [
+ {
+ label: "Menu item with drill-in",
+ isDrillIn: true,
+ },
+ {
+ label: "Menu item with drill-in and open submenu (not rendered)",
+ isDrillIn: true,
+ isOpen: true,
+ },
+ {
+ label: "Menu item with drill-in and value",
+ isDrillIn: true,
+ value: "Value",
+ },
+ {
+ label: "Disabled menu item with drill-in",
+ isDrillIn: true,
+ isDisabled: true,
+ }
+ ],
},
- { label: "Save Selection" },
],
};
export const Collapsible = Template.bind({});
+Collapsible.argTypes = {
+ selectionMode: { table: { disable: true } },
+};
Collapsible.args = {
shouldTruncate: true,
items: [
@@ -446,6 +367,18 @@ Collapsible.args = {
};
export const TraySubmenu = Template.bind({});
+TraySubmenu.argTypes = {
+ selectionMode: { table: { disable: true } },
+ isTraySubmenu: {
+ name: "Is tray submenu",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Component",
+ },
+ control: "boolean",
+ }
+};
TraySubmenu.args = {
selectionMode: "multiple",
customStyles: {
@@ -459,7 +392,6 @@ TraySubmenu.args = {
{
label: "Guides",
isSelected: true,
- isChecked: true,
},
{
label: "Grid",
@@ -471,3 +403,352 @@ TraySubmenu.args = {
}
],
};
+
+const Sizes = (args) => ["s", "m", "l", "xl"].map((size) => html`
+
+ ${Typography({
+ semantics: "detail",
+ size: "s",
+ content: [
+ {
+ s: "Small",
+ m: "Medium",
+ l: "Large",
+ xl: "Extra-large",
+ }[size]
+ ]
+ })}
+
+ ${Template({...args, size})}
+
+
+`);
+
+const States = (args) => {
+ const { titlePrefix, firstAndLast } = args;
+ let stateData = [
+ {
+ stateTitle: "Default",
+ args: {},
+ },
+ {
+ stateTitle: "Hover",
+ args: { ...args, isItemHovered: true },
+ },
+ {
+ stateTitle: "Active (Down)",
+ args: { ...args, isItemActive: true },
+ },
+ {
+ stateTitle: "Focused",
+ args: { ...args, isItemFocused: true },
+ },
+ {
+ stateTitle: "Disabled",
+ args: { ...args, isDisabled: true },
+ }
+ ];
+
+ // if testing hover/active/focus feels too heavy handed, we can remove those states
+ if (firstAndLast) {
+ stateData = [stateData[0], stateData[stateData.length - 1]];
+ }
+
+ return stateData.map((stateItem) => html`
+
+ ${Typography({
+ semantics: "detail",
+ size: "s",
+ content: [`${titlePrefix ? titlePrefix + ", ": ""}${stateItem.stateTitle}`],
+ })}
+
+ ${Template({...args, ...stateItem.args})}
+
+
+ `);
+};
+
+const SingleItemSelectedStates = (args) => {
+ return html`
+ ${States({
+ ...args,
+ items: [{ label: "Not selected", isSelected: false, ...args.items[0] }],
+ titlePrefix: "Not selected",
+ firstAndLast: true,
+ })}
+ ${States({
+ ...args,
+ items: [{ label: "Selected item", isSelected: true, ...args.items[0] }],
+ titlePrefix: "Selected",
+ firstAndLast: true,
+ })}
+ `;
+};
+
+const MultiCheckboxSelectedStates = (args) => {
+ return html`
+ ${States({
+ ...args,
+ items: [{ label: "Not selected", isSelected: false, ...args.items[0]}],
+ titlePrefix: "Not Selected",
+ firstAndLast: true,
+ })}
+ ${States({
+ ...args,
+ items: [{ label: "Selected item", isSelected: true, ...args.items[0]}],
+ titlePrefix: "Selected",
+ firstAndLast: true,
+ })}
+ `;
+};
+
+const WithValueStates = (args) => {
+ const baseValueArgs = {...args, hasValue: true, singleItemValue: "Value"};
+ const valueData = [
+ {
+ stateTitle: "With value",
+ args: { ...baseValueArgs },
+ },
+ {
+ stateTitle: "With value, disabled",
+ args: { ...baseValueArgs, isDisabled: true },
+ },
+ {
+ stateTitle: "With value and switch",
+ args: { ...baseValueArgs, hasSwitches: true },
+ },
+ {
+ stateTitle: "With value, truncated label",
+ args: { ...baseValueArgs, shouldTruncate: true, maxInlineSize: "195px", items: [{ label: "Truncated label on menu item" }] },
+ },
+ ];
+
+ return valueData.map((valueItem) => html`
+
+ ${Typography({
+ semantics: "detail",
+ size: "s",
+ content: [ valueItem.stateTitle ],
+ })}
+
+ ${Template({ ...args, ...valueItem.args })}
+
+
+ `);
+};
+
+const ChromaticMenuItem = (args) => {
+ const sectionData = [
+ {
+ sectionTitle: "No selection",
+ sectionMarkup: States(args),
+ },
+ {
+ sectionTitle: "With item description and truncation",
+ sectionMarkup: States({...args, shouldTruncate: true, maxInlineSize: "150px", items: [{ label: "This is a longer menu item that will truncate", description: "This is a description of the menu item"}]}),
+ },
+ {
+ sectionTitle: "Single selection",
+ sectionMarkup: SingleItemSelectedStates({...args, selectionMode: "single" }),
+ },
+ {
+ sectionTitle: "Single selection with icon",
+ sectionMarkup: SingleItemSelectedStates({...args, selectionMode: "single", items: [{ label: "With icon", iconName: "Share" }] }),
+ },
+ {
+ sectionTitle: "Multi-selection with checkboxes",
+ sectionMarkup: MultiCheckboxSelectedStates({...args, selectionMode: "multiple"}),
+ },
+ {
+ sectionTitle: "Multi-selection with checkboxes and icon",
+ sectionMarkup: MultiCheckboxSelectedStates({...args, selectionMode: "multiple", items: [{ label: "With icon", iconName: "Share" }]}),
+ },
+ {
+ sectionTitle: "Multi-selection with switches",
+ sectionMarkup: MultiCheckboxSelectedStates({...args, selectionMode: "multiple", hasSwitches: true}),
+ },
+ {
+ sectionTitle: "Multi-selection with switches and switch label",
+ sectionMarkup: MultiCheckboxSelectedStates({...args, selectionMode: "multiple", hasSwitches: true, items: [{ label: "Menu item", value: "switch label"}]}),
+ },
+ {
+ sectionTitle: "With values",
+ sectionMarkup: WithValueStates(args),
+ },
+ {
+ sectionTitle: "Sizes",
+ sectionMarkup: Sizes({ ...args, selectionMode: "single", items: [{ label: "With sizing", isSelected: true, iconName: "Share" }] }),
+ },
+ ];
+ return sectionData.map((sectionItem) => html`
+
+ ${Typography({
+ semantics: "detail",
+ size: "l",
+ content: [sectionItem.sectionTitle],
+ })}
+
+ ${sectionItem.sectionMarkup}
+
+
+ `);
+};
+
+export const MenuItemOnly = (args) => window.isChromatic() ?
+ ChromaticMenuItem(args) : Template(args);
+MenuItemOnly.args = {
+ items: [
+ {
+ label: "Hello menu item",
+ },
+ ],
+ hasExternalLink: false,
+ hasSwitches: false,
+ hasValue: false,
+ hasItemDescription: false,
+ hasIcon: false,
+ hasThumbnail: false,
+ isDisabled: false,
+ isItemActive: false,
+ isItemFocused: false,
+ isItemHovered: false,
+ isItemSelected: false,
+ singleItemDescription: "Menu item description",
+ singleItemValue: "Value",
+};
+MenuItemOnly.argTypes = {
+ isItemActive: { table: { disable: true } },
+ isItemFocused: { table: { disable: true } },
+ isItemHovered: { table: { disable: true } },
+ isDisabled: {
+ name: "Menu item is disabled",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "State",
+ },
+ control: "boolean",
+ },
+ itemIcon: {
+ ...(IconStories?.argTypes?.iconName ?? {}),
+ if: { arg: "hasIcon", truthy: true },
+ },
+ isItemSelected: {
+ name: "Menu item is selected",
+ description: "Selected state when single or multi-select mode is turned on",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Selection",
+ control: "boolean"
+ },
+ if: { arg: "selectionMode", not: { eq: "none" } },
+ },
+ hasItemDescription: {
+ name: "Has menu item description",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Content",
+ control: "boolean",
+ },
+ },
+ hasExternalLink: {
+ name: "Has external link",
+ description: "Has external link action",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Content",
+ },
+ control: "boolean",
+ },
+ hasSwitches: {
+ name: "Has switches",
+ description: "If multiple selection is enabled, show switches instead of checkboxes to show which items have been selected",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Selection",
+ },
+ control: "boolean",
+ if: { arg: "selectionMode", eq: "multiple" },
+ },
+ hasIcon: {
+ name: "Has icon",
+ description: "Displays an icon in the label",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Content",
+ },
+ control: "boolean",
+ if: { arg: "hasThumbnail", truthy: false },
+ },
+ hasThumbnail: {
+ name: "Has thumbnail",
+ description: "Displays a thumbnail in the label",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Content",
+ },
+ control: "boolean",
+ if: { arg: "hasIcon", truthy: false },
+ },
+ singleItemDescription: {
+ name: "Menu item description for single menu item",
+ type: { name: "text", required: true },
+ table: {
+ type: { summary: "text" },
+ category: "Content",
+ },
+ control: "text",
+ if: { arg: "hasItemDescription", truthy: true },
+ },
+ hasValue: {
+ name: "Has value text",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Content",
+ control: "boolean",
+ },
+ },
+ singleItemValue: {
+ name: "Menu item value for single menu item",
+ type: { name: "text", required: true },
+ table: {
+ type: { summary: "text" },
+ category: "Content",
+ },
+ control: "text",
+ if: { arg: "hasValue", truthy: true },
+ },
+};
+
+// story used in Picker component
+export const Default = Template.bind({});
+Default.storyName = "Standard with Dividers";
+Default.tags = ["docs-only"];
+Default.parameters = {
+ chromatic: { disableSnapshot: true },
+};
+Default.args = {
+ items: [
+ { label: "Deselect" },
+ { label: "Select inverse" },
+ { label: "Feather" },
+ { label: "Select and mask" },
+ { type: "divider" },
+ { label: "Save selection" },
+ { label: "Make work path", isDisabled: true },
+ ],
+ hasDividers: true,
+};
diff --git a/components/menu/stories/template.js b/components/menu/stories/template.js
index fc65979b83e..84795f2c8c1 100644
--- a/components/menu/stories/template.js
+++ b/components/menu/stories/template.js
@@ -8,32 +8,223 @@ import { Template as Checkbox } from "@spectrum-css/checkbox/stories/template.js
import { Template as Divider } from "@spectrum-css/divider/stories/template.js";
import { Template as Icon } from "@spectrum-css/icon/stories/template.js";
import { Template as Switch } from "@spectrum-css/switch/stories/template.js";
+import { Template as Thumbnail } from "@spectrum-css/thumbnail/stories/template.js";
import { Template as Tray } from "@spectrum-css/tray/stories/template.js";
import "../index.css";
-export const MenuItem = ({
- rootClass,
+const getUIIconWithScale = (size = "m", iconName = "ArrowLeft") => {
+ const scales = {
+ ArrowLeft: { s: 200, l: 400, xl: 500, default: 300 },
+ Checkmark: { s: 75, l: 200, xl: 300, default: 100 },
+ };
+
+ const selectedScale = scales[iconName];
+
+ switch (size) {
+ case "s":
+ return `${iconName}${selectedScale.s}`;
+ case "l":
+ return `${iconName}${selectedScale.l}`;
+ case "xl":
+ return `${iconName}${selectedScale.xl}`;
+ default:
+ return `${iconName}${selectedScale.default}`;
+ }
+};
+
+const Label = ({
+ hasSwitches,
+ isCollapsible,
label,
+ rootClass,
+ shouldTruncate,
+}) => {
+ if (isCollapsible) {
+ return html``;
+ }
+ else {
+ return html`
+ ${label}
+ `;
+ }
+};
+
+const Visual = ({
+ iconName,
+ rootClass,
+ size,
+ thumbnailUrl,
+ ...globals
+}) => {
+ if (thumbnailUrl) {
+ return html`
+ ${Thumbnail({
+ ...globals,
+ imageURL: thumbnailUrl,
+ altText: "Thumbnail alt text",
+ size,
+ customClasses: [`${rootClass}Thumbnail`],
+ })}
+ `;
+ }
+ else if (iconName) {
+ return html`
+ ${Icon({
+ ...globals,
+ iconName,
+ size,
+ customClasses: [
+ `${rootClass}Icon`,
+ `${rootClass}Icon--workflowIcon`
+ ]
+ })}
+ `;
+ }
+ return;
+};
+
+const StartAction = ({
+ hasSwitches,
+ idx,
+ isCollapsible,
+ isDisabled,
+ isSelected,
+ rootClass,
+ selectionMode,
+ size,
+ ...globals
+}) => {
+ if (isCollapsible) {
+ return html`
+ ${Icon({
+ ...globals,
+ iconName: "ChevronRight100",
+ size,
+ customClasses: [
+ `${rootClass}Icon`,
+ "spectrum-Menu-chevron",
+ ],
+ })}
+ `;
+ }
+ else if (selectionMode == "single" && isSelected) {
+ return html`
+ ${Icon({
+ ...globals,
+ iconName: getUIIconWithScale(size, "Checkmark"),
+ size,
+ customClasses: [
+ `${rootClass}Icon`,
+ "spectrum-Menu-checkmark",
+ ],
+ })}`;
+ }
+ else if (selectionMode == "multiple" && !hasSwitches) {
+ return html`
+ ${Checkbox({
+ ...globals,
+ size,
+ isEmphasized: true,
+ isChecked: isSelected,
+ isDisabled,
+ id: `menu-checkbox-${idx}`,
+ customClasses: [
+ `${rootClass}Checkbox`,
+ ],
+ })}`;
+ }
+ return null;
+};
+
+const EndAction = ({
+ hasExternalLink,
+ hasSwitches,
+ idx,
+ isDisabled,
+ isDrillIn,
+ isSelected,
+ rootClass,
+ selectionMode,
+ size,
+ value,
+ ...globals
+}) => html`
+ ${when(value, () => html`${value} `)}
+ ${when(
+ hasSwitches && selectionMode == "multiple",
+ () => html`
+ ${Switch({
+ ...globals,
+ size,
+ isChecked: isSelected,
+ isDisabled,
+ label: null,
+ id: `menu-switch-${idx}`,
+ customClasses: [
+ `${rootClass}Switch`,
+ ],
+ })}
+
`
+ )}
+ ${when(
+ hasExternalLink && !(hasSwitches && selectionMode === "multiple"),
+ () => html`
+ ${Icon({
+ ...globals,
+ iconName: "LinkOut",
+ size,
+ customClasses: [
+ `${rootClass}Icon`,
+ "spectrum-Menu-linkout",
+ ],
+ })}
+
`
+ )}
+ ${when(isDrillIn, () => html`${Icon({
+ ...globals,
+ iconName: "ChevronRight100",
+ size,
+ customClasses: [
+ `${rootClass}Icon`,
+ "spectrum-Menu-chevron",
+ ],
+ })}`)}
+`;
+
+const Description = ({
+ description,
+ rootClass
+}) => html`${description} `;
+
+export const MenuItem = ({
description,
iconName,
- isHighlighted = false,
+ hasExternalLink,
+ hasSwitches,
+ id,
+ idx = 0,
isActive = false,
- isSelected = false,
+ isCollapsible = false,
isDisabled = false,
- isChecked = false,
- isFocused = false,
isDrillIn = false,
- isCollapsible = false,
+ isFocused = false,
+ isHighlighted = false,
+ isHovered = false,
isOpen = false,
- shouldTruncate,
- role = "menuitem",
+ isSelected = false,
items = [],
+ label,
+ role = "menuitem",
+ rootClass,
+ shouldTruncate,
size,
- id,
- idx = 0,
- hasActions,
selectionMode,
+ thumbnailUrl = "",
value,
...globals
}) => html`
@@ -42,9 +233,10 @@ export const MenuItem = ({
[`${rootClass}`]: true,
"is-highlighted": isHighlighted,
"is-active": isActive,
- "is-focused": isFocused,
+ "is-focus-visible": isFocused,
"is-selected": isSelected,
"is-disabled": isDisabled,
+ "is-hover": isHovered,
[`${rootClass}--drillIn`]: isDrillIn,
[`${rootClass}--collapsible`]: isCollapsible,
"is-open": isOpen,
@@ -54,116 +246,15 @@ export const MenuItem = ({
aria-selected=${isSelected ? "true" : "false"}
aria-disabled=${isDisabled ? "true" : "false"}
tabindex=${ifDefined(!isDisabled ? "0" : undefined)}>
- ${isCollapsible
- ? Icon({
- ...globals,
- iconName: "ChevronRight100",
- size,
- customClasses: [
- `${rootClass}Icon`,
- "spectrum-Menu-chevron",
- ],
- }) : ""}
- ${iconName
- ? Icon({
- ...globals,
- iconName,
- size,
- customClasses: [
- `${rootClass}Icon`,
- `${rootClass}Icon--workflowIcon`
- ]
- }) : ""}
- ${isCollapsible
- ? html``
- : ""
- }
- ${selectionMode != "multiple" && !isCollapsible
- ? html`
- ${label}
- `
- : ""}
- ${typeof description != "undefined"
- ? html`${description} `
- : ""}
- ${isDrillIn
- ? Icon({
- ...globals,
- iconName: "ChevronRight100",
- size,
- customClasses: [
- `${rootClass}Icon`,
- "spectrum-Menu-chevron",
- ],
- })
- : ""}
- ${when(selectionMode == "multiple", () => html`
- ${Checkbox({
- ...globals,
- size,
- isEmphasized: true,
- isChecked: isSelected,
- isDisabled,
- id: `menu-checkbox-${idx}`,
- customClasses: [
- `${rootClass}Checkbox`,
- ],
- })}
-
- `)}
- ${isChecked && selectionMode == "single"
- ? Icon({
- ...globals,
- iconName: "Checkmark100",
- size,
- customClasses: [
- `${rootClass}Icon`,
- "spectrum-Menu-checkmark",
- ],
- })
- : ""}
- ${value
- ? html`${value} `
- : ""}
- ${hasActions
- ? html`
- ${Switch({
- ...globals,
- size,
- isChecked: isSelected,
- isDisabled,
- label: null,
- id: `menu-switch-${idx}`,
- customClasses: [
- `${rootClass}Switch`,
- ],
- })}
-
`
- : ""}
- ${isCollapsible && items.length > 0 ? Template({ ...globals, items, isOpen, size, shouldTruncate }) : ""}
+ ${StartAction({ hasSwitches, idx, isCollapsible, isDisabled, isSelected, rootClass, selectionMode, size, ...globals })}
+ ${Visual({ iconName, rootClass, size, thumbnailUrl, ...globals })}
+ ${Label({ hasSwitches, isCollapsible, label, rootClass, shouldTruncate })}
+ ${when(description, () => Description({ description, rootClass }))}
+ ${EndAction({ hasExternalLink, hasSwitches, idx, isDisabled, isDrillIn, isSelected, rootClass, selectionMode, size, value, ...globals })}
+ ${isCollapsible && items.length > 0 ? Template({ ...globals, items, isOpen, size, shouldTruncate }) : ""}
`;
-/**
- * Get the tray submenu back arrow name with scale number (defined in design spec).
- */
-const backArrowWithScale = (size = "m", iconName = "ArrowLeft") => {
- switch (size) {
- case "s":
- return `${iconName}200`;
- case "l":
- return `${iconName}400`;
- case "xl":
- return `${iconName}500`;
- default:
- return `${iconName}300`;
- }
-};
-
export const MenuGroup = ({
heading,
id,
@@ -172,6 +263,7 @@ export const MenuGroup = ({
isDisabled = false,
isSelectable = false,
isTraySubmenu = false,
+ sectionDescription,
shouldTruncate,
maxInlineSize,
subrole,
@@ -187,12 +279,15 @@ export const MenuGroup = ({
class="spectrum-Menu-sectionHeading ${shouldTruncate ? "spectrum-Menu-itemLabel--truncate" : "" }"
id=${id ?? `menu-heading-category-${idx}`}
aria-hidden="true"
- >${heading}`
+ >
+ ${heading}
+
+ `
: html``
}
@@ -225,22 +322,32 @@ export const MenuGroup = ({
export const Template = ({
- rootClass = "spectrum-Menu",
- labelledby,
customClasses = [],
customStyles = {},
- size,
+ hasExternalLink,
+ hasSwitches,
+ hasDividers = false,
+ hasThumbnail = false,
+ id,
isDisabled = false,
- maxInlineSize,
- shouldTruncate,
- selectionMode = "none",
+ isItemActive = false,
+ isItemFocused = false,
+ isItemHovered = false,
+ isItemSelected = false,
isOpen = false,
- hasActions = false,
isTraySubmenu = false,
+ itemIcon,
items = [],
+ labelledby,
+ maxInlineSize,
role = "menu",
+ rootClass = "spectrum-Menu",
+ selectionMode = "none",
+ singleItemDescription,
+ singleItemValue,
+ shouldTruncate,
+ size,
subrole = "menuitem",
- id,
...globals
}) => {
const menuMarkup = html`
@@ -261,12 +368,12 @@ export const Template = ({
>
${items.map((i, idx) => {
if (i.type === "divider")
- return Divider({
+ return html`${hasDividers ? Divider({
...globals,
tag: "li",
size: "s",
customClasses: [`${rootClass}-divider`],
- });
+ }) : ""}`;
else if (i.heading || i.isTraySubmenu)
return MenuGroup({
...i,
@@ -281,13 +388,23 @@ export const Template = ({
return MenuItem({
...globals,
...i,
+ description: singleItemDescription || i.description,
+ hasExternalLink: hasExternalLink || i.hasExternalLink,
+ hasSwitches,
+ iconName: itemIcon || i.iconName,
idx,
- rootClass: `${rootClass}-item`,
+ isActive: isItemActive,
+ isDisabled: isDisabled || i.isDisabled,
+ isFocused: isItemFocused || i.isFocused,
+ isHovered: isItemHovered,
+ isSelected: isItemSelected || i.isSelected,
role: subrole,
- size,
+ rootClass: `${rootClass}-item`,
selectionMode,
shouldTruncate,
- hasActions,
+ size,
+ thumbnailUrl: i.thumbnailUrl || (hasThumbnail && "thumbnail.png"),
+ value: singleItemValue || i.value,
});
})}
diff --git a/components/miller/package.json b/components/miller/package.json
index ed49efbd1e0..b4bf3f80f86 100644
--- a/components/miller/package.json
+++ b/components/miller/package.json
@@ -25,7 +25,7 @@
"@spectrum-css/assetlist": ">=6",
"@spectrum-css/checkbox": ">=9",
"@spectrum-css/icon": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/modal/index.css b/components/modal/index.css
index ada06633931..8f272e8da6f 100644
--- a/components/modal/index.css
+++ b/components/modal/index.css
@@ -21,7 +21,7 @@ governing permissions and limitations under the License.
--spectrum-modal-max-height: 90vh;
--spectrum-modal-max-width: 90%;
- --spectrum-modal-background-color: var(--spectrum-gray-100);
+ --spectrum-modal-background-color: var(--spectrum-gray-75);
--spectrum-modal-confirm-border-radius: var(--spectrum-corner-radius-100);
--spectrum-modal-confirm-exit-animation-duration: var(--spectrum-animation-duration-100);
--spectrum-modal-confirm-entry-animation-duration: var(--spectrum-animation-duration-500);
diff --git a/components/modal/package.json b/components/modal/package.json
index 0ab719dd285..ee52dc2d41e 100644
--- a/components/modal/package.json
+++ b/components/modal/package.json
@@ -22,7 +22,7 @@
"metadata/mods.md"
],
"peerDependencies": {
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"devDependencies": {
"@spectrum-css/commons": "^10.0.0"
diff --git a/components/opacitycheckerboard/index.css b/components/opacitycheckerboard/index.css
index 5d9e7c78b04..379a4534e6f 100644
--- a/components/opacitycheckerboard/index.css
+++ b/components/opacitycheckerboard/index.css
@@ -15,11 +15,17 @@ permissions and limitations under the License. */
--spectrum-opacity-checkerboard-square-light
);
--spectrum-opacity-checkerboard-size: var(
- --spectrum-opacity-checkerboard-square-size
+ --spectrum-opacity-checkerboard-square-size-medium
);
--spectrum-opacity-checkerboard-position: left top;
}
+.spectrum-OpacityCheckerboard--sizeS {
+ --spectrum-opacity-checkerboard-size: var(
+ --spectrum-opacity-checkerboard-square-size-small
+ );
+}
+
.spectrum-OpacityCheckerboard {
background: repeating-conic-gradient(
var(
diff --git a/components/opacitycheckerboard/package.json b/components/opacitycheckerboard/package.json
index 05154b7b82b..1208ebdeff4 100644
--- a/components/opacitycheckerboard/package.json
+++ b/components/opacitycheckerboard/package.json
@@ -22,7 +22,7 @@
"metadata/mods.md"
],
"peerDependencies": {
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/opacitycheckerboard/stories/opacitycheckerboard.stories.js b/components/opacitycheckerboard/stories/opacitycheckerboard.stories.js
index 00f52f1ea97..15aba9f3134 100644
--- a/components/opacitycheckerboard/stories/opacitycheckerboard.stories.js
+++ b/components/opacitycheckerboard/stories/opacitycheckerboard.stories.js
@@ -19,6 +19,16 @@ export default {
control: "text",
description: "Value for --mod-opacity-checkerboard-position
. Accepts any valid CSS background-position property value.",
},
+ size: {
+ name: "Size",
+ type: { name: "string", required: true },
+ table: {
+ type: { summary: "string" },
+ category: "Component",
+ },
+ options: ["s", "m"],
+ control: "select",
+ },
},
args: {
rootClass: "spectrum-OpacityCheckerboard",
@@ -37,21 +47,40 @@ export default {
],
};
-export const Default = Template.bind({});
-Default.args = {
- customStyles: {
- "inline-size": "100%",
- "block-size": "100%"
- }
-};
+const CheckerboardDefault = (args) => html`
+ ${window.isChromatic() ? html`
+ ${Template({
+ ...args,
+ customStyles: {
+ "inline-size": "100%",
+ "block-size": "100%"
+ }
+ })}
+
+ ${Template({
+ ...args,
+ customStyles: {
+ "inline-size": "100%",
+ "block-size": "100%"
+ },
+ size: "s",
+ })}
+ ` : Template({
+ ...args,
+ customStyles: {
+ "inline-size": "100%",
+ "block-size": "100%"
+ }
+ })}
+`;
+
+
+export const Default = CheckerboardDefault.bind({});
+Default.args = {};
-export const CheckerboardPosition = Template.bind({});
+export const CheckerboardPosition = CheckerboardDefault.bind({});
CheckerboardPosition.args = {
backgroundPosition: "center center",
- customStyles: {
- "inline-size": "100%",
- "block-size": "100%"
- }
};
CheckerboardPosition.parameters = {
docs: {
diff --git a/components/opacitycheckerboard/stories/template.js b/components/opacitycheckerboard/stories/template.js
index 0d6692e9da6..ce551ec5ee6 100644
--- a/components/opacitycheckerboard/stories/template.js
+++ b/components/opacitycheckerboard/stories/template.js
@@ -12,19 +12,23 @@ export const Template = ({
customStyles = {},
id,
content = [],
+ size,
role,
-}) => html`
- ({ ...a, [c]: true }), {}),
- })}
- style=${ifDefined(styleMap({
- "--mod-opacity-checkerboard-position": backgroundPosition,
- ...customStyles,
- }))}
- role=${ifDefined(role)}
- id=${ifDefined(id)}
- >
- ${content}
-
`;
+}) => {
+ return html`
+ ({ ...a, [c]: true }), {}),
+ })}
+ style=${ifDefined(styleMap({
+ "--mod-opacity-checkerboard-position": backgroundPosition,
+ ...customStyles,
+ }))}
+ role=${ifDefined(role)}
+ id=${ifDefined(id)}
+ >
+ ${content}
+
`;
+};
diff --git a/components/page/index.css b/components/page/index.css
index 513b114a586..f8a78b775cd 100644
--- a/components/page/index.css
+++ b/components/page/index.css
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
*/
:root {
- background-color: var(--spectrum-gray-100);
+ background-color: var(--spectrum-gray-75);
/* Prevent tap highlights */
-webkit-tap-highlight-color: var(--spectrum-transparent-black-100);
diff --git a/components/page/package.json b/components/page/package.json
index afa2d7066b2..014ca484a91 100644
--- a/components/page/package.json
+++ b/components/page/package.json
@@ -22,7 +22,7 @@
"metadata/mods.md"
],
"peerDependencies": {
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/pagination/package.json b/components/pagination/package.json
index 6cf5946bf1c..909cd28ebee 100644
--- a/components/pagination/package.json
+++ b/components/pagination/package.json
@@ -27,7 +27,7 @@
"@spectrum-css/icon": ">=7",
"@spectrum-css/splitbutton": ">=8",
"@spectrum-css/textfield": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/picker/metadata/picker.yml b/components/picker/metadata/picker.yml
index 5339feeca39..7226b36801a 100644
--- a/components/picker/metadata/picker.yml
+++ b/components/picker/metadata/picker.yml
@@ -7,17 +7,25 @@ sections:
This component can be modified via its `--mod-*` prefixed custom properties. A list of those prefixed custom properties can be found here .
- name: Migration Guide
description: |
- ### Component renamed
+ ### Version 8.0.0
+ #### Spectrum 2 release
+ Picker now uses Spectrum 2 tokens and specifications. A few notable changes:
+ - The mod custom property `--mod-line-height-100` has been renamed to `--mod-button-line-height`.
+ - The mod custom property `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`.
+ - The mod custom property `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`.
+
+ ### Versions prior to 8.0
+ #### Component renamed
Dropdown is now known as Picker. Replace all `.spectrum-Dropdown*` classnames with `.spectrum-Picker*`.
- ### Markup change
+ #### Markup change
The outer `` is now gone and `.spectrum-FieldButton` is no longer used. Instead, the outer tag is now `
` with the `.spectrum-Picker` classname.
Additionally, `.spectrum-Picker` should not contain the `.spectrum-Popover` that it opens.
In order to use a side label with a Picker, add the `spectrum-Picker--sideLabel` class to the Picker.
- ### Icon classname changes
+ #### Icon classname changes
Each of the 3 possible icons now has its own specific classname:
@@ -27,13 +35,13 @@ sections:
| `.spectrum-Icon` (workflow) | `.spectrum-Picker-icon` |
| `.spectrum-Icon` (validation) | `.spectrum-Picker-validationIcon` |
- ### `.is-selected` is now `.is-open`
+ #### `.is-selected` is now `.is-open`
In order to more accurately reflect what's going on, you should add `.is-open` to `.spectrum-Picker` when the menu is shown.
- ### Change workflow icon size to medium
+ #### Change workflow icon size to medium
If you use a `.spectrum-Picker-icon` in your markup, please replace `.spectrum-Icon--sizeS` with `.spectrum-Icon--sizeM`.
- ### T-shirt sizing
+ #### T-shirt sizing
Picker now supports t-shirt sizing and requires that you specify the size by adding a `.spectrum-Picker--size*` class.
Using the classes `.spectrum-Picker .spectrum-Picker--sizeM` will get result in the previous default picker size.
@@ -46,7 +54,7 @@ sections:
| `spectrum-Picker--sizeL` | `spectrum-css-icon-Chevron200` |
| `spectrum-Picker--sizeXL` | `spectrum-css-icon-Chevron300` |
- ### Remove focus-ring class
+ #### Remove focus-ring class
We've migrated away from the focus-ring class in favor of the native `:focus-visible` pseudo-class due to changes in browser support.
examples:
- id: picker-standard
diff --git a/components/picker/package.json b/components/picker/package.json
index 4027aab33ff..84a9f0e98b4 100644
--- a/components/picker/package.json
+++ b/components/picker/package.json
@@ -27,7 +27,7 @@
"@spectrum-css/menu": ">=7",
"@spectrum-css/popover": ">=7",
"@spectrum-css/progresscircle": ">=3",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/helptext": {
diff --git a/components/picker/themes/express.css b/components/picker/themes/express.css
index 4b305b4846f..ac253f63db9 100644
--- a/components/picker/themes/express.css
+++ b/components/picker/themes/express.css
@@ -13,12 +13,12 @@ governing permissions and limitations under the License.
@container (--system: express) {
.spectrum-Picker {
- --spectrum-picker-background-color-default: var(--spectrum-gray-200);
- --spectrum-picker-background-color-default-open: var(--spectrum-gray-300);
- --spectrum-picker-background-color-hover: var(--spectrum-gray-300);
- --spectrum-picker-background-color-hover-open: var(--spectrum-gray-300);
+ --spectrum-picker-background-color-default: var(--spectrum-gray-100);
+ --spectrum-picker-background-color-default-open: var(--spectrum-gray-200);
+ --spectrum-picker-background-color-hover: var(--spectrum-gray-200);
+ --spectrum-picker-background-color-hover-open: var(--spectrum-gray-200);
--spectrum-picker-background-color-active: var(--spectrum-gray-400);
- --spectrum-picker-background-color-key-focus: var(--spectrum-gray-300);
+ --spectrum-picker-background-color-key-focus: var(--spectrum-gray-200);
--spectrum-picker-border-color-default: transparent;
--spectrum-picker-border-color-default-open: transparent;
diff --git a/components/picker/themes/spectrum.css b/components/picker/themes/spectrum.css
index c9452754589..d6ed20d735a 100644
--- a/components/picker/themes/spectrum.css
+++ b/components/picker/themes/spectrum.css
@@ -11,12 +11,12 @@ governing permissions and limitations under the License.
@container (--system: spectrum) {
.spectrum-Picker {
- --spectrum-picker-background-color-default: var(--spectrum-gray-75);
- --spectrum-picker-background-color-default-open: var(--spectrum-gray-200);
- --spectrum-picker-background-color-active: var(--spectrum-gray-300);
- --spectrum-picker-background-color-hover: var(--spectrum-gray-200);
- --spectrum-picker-background-color-hover-open: var(--spectrum-gray-200);
- --spectrum-picker-background-color-key-focus: var(--spectrum-gray-200);
+ --spectrum-picker-background-color-default: var(--spectrum-gray-50);
+ --spectrum-picker-background-color-default-open: var(--spectrum-gray-100);
+ --spectrum-picker-background-color-active: var(--spectrum-gray-200);
+ --spectrum-picker-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-picker-background-color-hover-open: var(--spectrum-gray-100);
+ --spectrum-picker-background-color-key-focus: var(--spectrum-gray-100);
--spectrum-picker-border-color-default: var(--spectrum-gray-500);
--spectrum-picker-border-color-default-open: var(--spectrum-gray-500);
diff --git a/components/pickerbutton/package.json b/components/pickerbutton/package.json
index 624da28beb6..6e37ba083a2 100644
--- a/components/pickerbutton/package.json
+++ b/components/pickerbutton/package.json
@@ -25,7 +25,7 @@
"@spectrum-css/icon": ">=7",
"@spectrum-css/menu": ">=7",
"@spectrum-css/popover": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"keywords": [
"spectrum",
diff --git a/components/pickerbutton/themes/express.css b/components/pickerbutton/themes/express.css
index 76d7a370cfa..6556bd62e9a 100644
--- a/components/pickerbutton/themes/express.css
+++ b/components/pickerbutton/themes/express.css
@@ -14,10 +14,10 @@ governing permissions and limitations under the License.
@container (--system: express) {
.spectrum-PickerButton {
- --spectrum-picker-button-background-color: var(--spectrum-gray-200);
- --spectrum-picker-button-background-color-hover: var(--spectrum-gray-300);
+ --spectrum-picker-button-background-color: var(--spectrum-gray-100);
+ --spectrum-picker-button-background-color-hover: var(--spectrum-gray-200);
--spectrum-picker-button-background-color-down: var(--spectrum-gray-400);
- --spectrum-picker-button-background-color-key-focus: var(--spectrum-gray-300);
+ --spectrum-picker-button-background-color-key-focus: var(--spectrum-gray-200);
--spectrum-picker-button-border-color: none;
--spectrum-picker-button-border-radius: var(--spectrum-corner-radius-75);
diff --git a/components/pickerbutton/themes/spectrum.css b/components/pickerbutton/themes/spectrum.css
index 5250be4186e..c1ade89850c 100644
--- a/components/pickerbutton/themes/spectrum.css
+++ b/components/pickerbutton/themes/spectrum.css
@@ -12,10 +12,10 @@ governing permissions and limitations under the License.
@container (--system: spectrum) {
.spectrum-PickerButton {
- --spectrum-picker-button-background-color: var(--spectrum-gray-75);
- --spectrum-picker-button-background-color-hover: var(--spectrum-gray-200);
- --spectrum-picker-button-background-color-down: var(--spectrum-gray-300);
- --spectrum-picker-button-background-color-key-focus: var(--spectrum-gray-200);
+ --spectrum-picker-button-background-color: var(--spectrum-gray-50);
+ --spectrum-picker-button-background-color-hover: var(--spectrum-gray-100);
+ --spectrum-picker-button-background-color-down: var(--spectrum-gray-200);
+ --spectrum-picker-button-background-color-key-focus: var(--spectrum-gray-100);
--spectrum-picker-button-border-color: inherit;
--spectrum-picker-button-border-radius: var(--spectrum-corner-radius-100);
diff --git a/components/popover/index.css b/components/popover/index.css
index 3e6ad5e71ca..24be21df2b9 100644
--- a/components/popover/index.css
+++ b/components/popover/index.css
@@ -14,94 +14,95 @@ governing permissions and limitations under the License.
@import "@spectrum-css/commons/overlay.css";
.spectrum-Popover {
- /* Used in positioning popover for storybook */
- --flow-direction: 1;
+ /* Used in positioning popover for storybook */
+ --flow-direction: 1;
- &:dir(rtl) {
- --flow-direction: -1;
- }
+ &:dir(rtl) {
+ --flow-direction: -1;
+ }
- /* animation distance is equal to and responsible for popover offset */
- --spectrum-popover-animation-distance: var(--spectrum-spacing-100);
+ /* animation distance is equal to and responsible for popover offset */
+ --spectrum-popover-animation-distance: var(--spectrum-spacing-100);
- --spectrum-popover-background-color: var(--spectrum-background-layer-2-color);
- --spectrum-popover-border-color: var(--spectrum-gray-400);
+ --spectrum-popover-background-color: var(--spectrum-background-layer-2-color);
+ --spectrum-popover-border-color: var(--spectrum-gray-400);
- /* popover inner padding */
- --spectrum-popover-content-area-spacing-vertical: var(--spectrum-popover-top-to-content-area);
+ /* popover inner padding */
+ --spectrum-popover-content-area-spacing-vertical: var(--spectrum-popover-edge-to-content-area);
+ --spectrum-popover-content-area-spacing-horizontal: var(--spectrum-popover-edge-to-content-area);
- /* popover drop shadow */
- --spectrum-popover-shadow-horizontal: var(--spectrum-drop-shadow-x);
- --spectrum-popover-shadow-vertical: var(--spectrum-drop-shadow-y);
- --spectrum-popover-shadow-blur: var(--spectrum-drop-shadow-blur);
- --spectrum-popover-shadow-color: var(--spectrum-drop-shadow-color);
+ /* popover drop shadow */
+ --spectrum-popover-shadow-horizontal: var(--spectrum-drop-shadow-x);
+ --spectrum-popover-shadow-vertical: var(--spectrum-drop-shadow-y);
+ --spectrum-popover-shadow-blur: var(--spectrum-drop-shadow-blur);
+ --spectrum-popover-shadow-color: var(--spectrum-drop-shadow-color);
- /* popover corner radius */
- --spectrum-popover-corner-radius: var(--spectrum-corner-radius-100);
+ /* popover corner radius */
+ --spectrum-popover-corner-radius: var(--spectrum-corner-radius-100);
- /* pointer tip dimensions */
- --spectrum-popover-pointer-width: var(--spectrum-popover-tip-width);
- --spectrum-popover-pointer-height: var(--spectrum-popover-tip-height);
+ /* pointer tip dimensions */
+ --spectrum-popover-pointer-width: var(--spectrum-popover-tip-width);
+ --spectrum-popover-pointer-height: var(--spectrum-popover-tip-height);
- /* pointer tip - default spacing to edge - corner radius plus half of tip width to neutralize override */
- --spectrum-popover-pointer-edge-offset: calc(var(--spectrum-corner-radius-100) + (var(--spectrum-popover-tip-width) / 2));
+ /* pointer tip - default spacing to edge - corner radius plus half of tip width to neutralize override */
+ --spectrum-popover-pointer-edge-offset: calc(var(--spectrum-corner-radius-100) + (var(--spectrum-popover-tip-width) / 2));
- /* pointer tip - spacing to edge will center pointer to source - apply in markup by setting '--spectrum-popover-pointer-edge-offset' value == half of source */
- --spectrum-popover-pointer-edge-spacing: calc(var(--spectrum-popover-pointer-edge-offset) - (var(--spectrum-popover-tip-width) / 2));
+ /* pointer tip - spacing to edge will center pointer to source - apply in markup by setting '--spectrum-popover-pointer-edge-offset' value == half of source */
+ --spectrum-popover-pointer-edge-spacing: calc(var(--spectrum-popover-pointer-edge-offset) - (var(--spectrum-popover-tip-width) / 2));
}
/* windows high contrast mode */
@media (forced-colors: active) {
- .spectrum-Popover {
- --highcontrast-popover-border-color: CanvasText;
- }
+ .spectrum-Popover {
+ --highcontrast-popover-border-color: CanvasText;
+ }
}
.spectrum-Popover {
- --spectrum-popover-filter: drop-shadow(var(--mod-popover-shadow-horizontal, var(--spectrum-popover-shadow-horizontal)) var(--mod-popover-shadow-vertical, var(--spectrum-popover-shadow-vertical)) var(--mod-popover-shadow-blur, var(--spectrum-popover-shadow-blur)) var(--mod-popover-shadow-color, var(--spectrum-popover-shadow-color)));
- @extend %spectrum-overlay;
-
- box-sizing: border-box;
- position: absolute;
-
- outline: none; /* Hide focus outline */
-
- padding: var(--mod-popover-content-area-spacing-vertical, var(--spectrum-popover-content-area-spacing-vertical)) 0;
-
- display: inline-flex;
- flex-direction: column;
-
- border-style: solid;
- border-radius: var(--mod-popover-corner-radius, var(--spectrum-popover-corner-radius));
- border-color: var(--highcontrast-popover-border-color, var(--mod-popover-border-color, var(--spectrum-popover-border-color)));
- border-width: var(--mod-popover-border-width, var(--spectrum-popover-border-width));
-
- background-color: var(--mod-popover-background-color, var(--spectrum-popover-background-color));
- filter: var(--mod-popover-filter, var(--spectrum-popover-filter));
-
- /* has tip triangle */
- &.spectrum-Popover--withTip {
- .spectrum-Popover-tip {
- /* triangle polygon */
- .spectrum-Popover-tip-triangle {
- stroke-linecap: square;
- stroke-linejoin: miter;
- fill: var(--highcontrast-popover-background-color, var(--mod-popover-background-color, var(--spectrum-popover-background-color)));
- stroke: var(--highcontrast-popover-border-color, var(--mod-popover-border-color, var(--spectrum-popover-border-color)));
- stroke-width: var(--mod-popover-border-width, var(--spectrum-popover-border-width));
- }
- }
- }
+ --spectrum-popover-filter: drop-shadow(var(--mod-popover-shadow-horizontal, var(--spectrum-popover-shadow-horizontal)) var(--mod-popover-shadow-vertical, var(--spectrum-popover-shadow-vertical)) var(--mod-popover-shadow-blur, var(--spectrum-popover-shadow-blur)) var(--mod-popover-shadow-color, var(--spectrum-popover-shadow-color)));
+ @extend %spectrum-overlay;
+
+ box-sizing: border-box;
+ position: absolute;
+
+ outline: none; /* Hide focus outline */
+
+ padding: var(--mod-popover-content-area-spacing-vertical, var(--spectrum-popover-content-area-spacing-vertical)) var(--mod-popover-content-area-spacing-horizontal, var(--spectrum-popover-content-area-spacing-horizontal));
+
+ display: inline-flex;
+ flex-direction: column;
+
+ border-style: solid;
+ border-radius: var(--mod-popover-corner-radius, var(--spectrum-popover-corner-radius));
+ border-color: var(--highcontrast-popover-border-color, var(--mod-popover-border-color, var(--spectrum-popover-border-color)));
+ border-width: var(--mod-popover-border-width, var(--spectrum-popover-border-width));
+
+ background-color: var(--mod-popover-background-color, var(--spectrum-popover-background-color));
+ filter: var(--mod-popover-filter, var(--spectrum-popover-filter));
+
+ /* has tip triangle */
+ &.spectrum-Popover--withTip {
+ .spectrum-Popover-tip {
+ /* triangle polygon */
+ .spectrum-Popover-tip-triangle {
+ stroke-linecap: square;
+ stroke-linejoin: miter;
+ fill: var(--highcontrast-popover-background-color, var(--mod-popover-background-color, var(--spectrum-popover-background-color)));
+ stroke: var(--highcontrast-popover-border-color, var(--mod-popover-border-color, var(--spectrum-popover-border-color)));
+ stroke-width: var(--mod-popover-border-width, var(--spectrum-popover-border-width));
+ }
+ }
+ }
}
/* default opens and animates upward */
.spectrum-Popover.is-open {
- @extend %spectrum-overlay--open;
+ @extend %spectrum-overlay--open;
}
/* prevent nested popovers from affecting each others drop shadow filters */
.spectrum-Popover * {
- --mod-popover-filter: none;
+ --mod-popover-filter: none;
}
/* position naming - first position term is popover position, second term is source position */
@@ -113,16 +114,16 @@ governing permissions and limitations under the License.
.spectrum-Popover--top-right,
.spectrum-Popover--top-start,
.spectrum-Popover--top-end {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-block-end: calc(var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* popover animates upward ⬆ */
- &.is-open {
- transform: translateY(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-block-end: calc(var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* popover animates upward ⬆ */
+ &.is-open {
+ transform: translateY(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
+ }
}
/* popover position is at bottom of source */
@@ -131,285 +132,284 @@ governing permissions and limitations under the License.
.spectrum-Popover--bottom-right,
.spectrum-Popover--bottom-start,
.spectrum-Popover--bottom-end {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-block-start: calc(var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* popover animates downward ⬇ */
- &.is-open {
- transform: translateY(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-block-start: calc(var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* popover animates downward ⬇ */
+ &.is-open {
+ transform: translateY(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
+ }
}
/* popover position is right of source */
.spectrum-Popover--right,
.spectrum-Popover--right-bottom,
.spectrum-Popover--right-top {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-inline-start: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* popover animates towards right ⮕ */
- &.is-open {
- transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-inline-start: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* popover animates towards right ⮕ */
+ &.is-open {
+ transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
+ }
}
/* popover position is left of source */
.spectrum-Popover--left,
.spectrum-Popover--left-bottom,
.spectrum-Popover--left-top {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-inline-end: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* popover animates towards left ⬅ */
- &.is-open {
- transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-inline-end: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* popover animates towards left ⬅ */
+ &.is-open {
+ transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
+ }
}
/* logical property - popover is horizontally at start */
.spectrum-Popover--start,
.spectrum-Popover--start-top,
.spectrum-Popover--start-bottom {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-inline-end: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* LTR read, popover animates towards left ⬅ */
- &.is-open {
- transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
- }
-
- /* RTL read, popover animates towards right ⮕ */
- &.is-open:dir(rtl) {
- transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-inline-end: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* LTR read, popover animates towards left ⬅ */
+ &.is-open {
+ transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
+ }
+
+ /* RTL read, popover animates towards right ⮕ */
+ &.is-open:dir(rtl) {
+ transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
+ }
}
/* logical property - popover is horizontally at end */
.spectrum-Popover--end,
.spectrum-Popover--end-top,
.spectrum-Popover--end-bottom {
- /* spacing to include tip in calculation of offset from source */
- &.spectrum-Popover--withTip {
- /* tip size minus where it overlaps with popover border */
- margin-inline-start: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
- }
-
- /* LTR read, popover animates towards right ⮕ */
- &.is-open {
- transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
- }
-
- /* RTL read, popover animates towards left ⬅ */
- &:dir(rtl) {
- &.is-open {
- transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
- }
- }
+ /* spacing to include tip in calculation of offset from source */
+ &.spectrum-Popover--withTip {
+ /* tip size minus where it overlaps with popover border */
+ margin-inline-start: calc(var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width)) - var(--mod-popover-border-width, var(--spectrum-popover-border-width)));
+ }
+
+ /* LTR read, popover animates towards right ⮕ */
+ &.is-open {
+ transform: translateX(var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance)));
+ }
+
+ /* RTL read, popover animates towards left ⬅ */
+ &:dir(rtl) {
+ &.is-open {
+ transform: translateX(calc(-1 * var(--mod-popover-animation-distance, var(--spectrum-popover-animation-distance))));
+ }
+ }
}
/* HAS TIP - popover with triangle pointer */
/* default, top, and bottom position tip - tip defaults to pointing down ▽ */
.spectrum-Popover--withTip {
- &.spectrum-Popover,
- &.spectrum-Popover--top,
- &.spectrum-Popover--top-left,
- &.spectrum-Popover--top-right,
- &.spectrum-Popover--top-start,
- &.spectrum-Popover--top-end,
- &.spectrum-Popover--bottom,
- &.spectrum-Popover--bottom-left,
- &.spectrum-Popover--bottom-right,
- &.spectrum-Popover--bottom-start,
- &.spectrum-Popover--bottom-end {
- .spectrum-Popover-tip {
- inline-size: var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width));
- block-size: var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height));
- position: absolute;
- inset-block-start: 100%;
- inset-inline: 0;
- margin: auto;
-
- /* https://stackoverflow.com/questions/44170229/how-to-prevent-half-pixel-svg-shift-on-high-pixel-ratio-devices-retina */
- transform: translate(0, 0);
- }
- }
-
- /* popover is at top of source, tip left and pointing down ▽ */
- &.spectrum-Popover--top-left {
- .spectrum-Popover-tip {
- inset-inline: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
- }
- }
-
- /* popover is at top of source, tip right and pointing down ▽ */
- &.spectrum-Popover--top-right {
- .spectrum-Popover-tip {
- inset-inline: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* logical property - popover is above, source and tip are at start, tip pointing down ▽ */
- &.spectrum-Popover--top-start {
- .spectrum-Popover-tip {
- margin-inline-start: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* logical property - popover is above, source and tip are at end, tip pointing down ▽ */
- &.spectrum-Popover--top-end {
- .spectrum-Popover-tip {
- margin-inline-end: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* popover position is bottom of source with tip pointing up △ */
- &.spectrum-Popover--bottom,
- &.spectrum-Popover--bottom-left,
- &.spectrum-Popover--bottom-right,
- &.spectrum-Popover--bottom-start,
- &.spectrum-Popover--bottom-end {
- .spectrum-Popover-tip {
- inset-block: auto 100%;
-
- /* flip triangle to face up */
- transform: scaleY(-1);
- }
- }
-
- /* popover position is bottom, source is at left, tip pointing up △ */
- &.spectrum-Popover--bottom-left {
- .spectrum-Popover-tip {
- inset-inline: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
- }
- }
-
- /* popover position is bottom, source is at right, tip pointing up △ */
- &.spectrum-Popover--bottom-right {
- .spectrum-Popover-tip {
- inset-inline: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* logical property - popover is below, source is at start, tip pointing up △ */
- &.spectrum-Popover--bottom-start {
- .spectrum-Popover-tip {
- margin-inline-start: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* logical property - popover is below, source is at end, tip pointing up △ */
- &.spectrum-Popover--bottom-end {
- .spectrum-Popover-tip {
- margin-inline-end: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
-
- /* right, left, start, end popover position with tip default to pointing right ▷ */
- &.spectrum-Popover--left,
- &.spectrum-Popover--left-bottom,
- &.spectrum-Popover--left-top,
- &.spectrum-Popover--right,
- &.spectrum-Popover--right-bottom,
- &.spectrum-Popover--right-top,
- &.spectrum-Popover--start,
- &.spectrum-Popover--start-top,
- &.spectrum-Popover--start-bottom,
- &.spectrum-Popover--end,
- &.spectrum-Popover--end-top,
- &.spectrum-Popover--end-bottom {
- .spectrum-Popover-tip {
- /* swap height and width for vertical triangle */
- inline-size: var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height));
- block-size: var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width));
- inset-block: 0;
- }
-
- /* left popover with tip pointing right ▷ */
- &.spectrum-Popover--left,
- &.spectrum-Popover--left-bottom,
- &.spectrum-Popover--left-top {
- .spectrum-Popover-tip {
- inset-inline: 100% auto;
- }
- }
-
- /* right popover with tip pointing left ◁ */
- &.spectrum-Popover--right,
- &.spectrum-Popover--right-bottom,
- &.spectrum-Popover--right-top {
- .spectrum-Popover-tip {
- inset-inline: auto 100%;
-
- /* flip tip to point left ◁ */
- transform: scaleX(-1);
- }
- }
-
-
- /* popover with tip at top */
- &.spectrum-Popover--right-top,
- &.spectrum-Popover--left-top,
- &.spectrum-Popover--start-top,
- &.spectrum-Popover--end-top {
- .spectrum-Popover-tip {
- inset-block: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
- }
- }
-
- /* popover with tip at bottom */
- &.spectrum-Popover--right-bottom,
- &.spectrum-Popover--left-bottom,
- &.spectrum-Popover--start-bottom,
- &.spectrum-Popover--end-bottom {
- .spectrum-Popover-tip {
- inset-block: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
- }
- }
- }
-
- /* logical property - start popover position with tip pointing toward end - LTR default is ▷ */
- &.spectrum-Popover--start,
- &.spectrum-Popover--start-top,
- &.spectrum-Popover--start-bottom {
- .spectrum-Popover-tip {
- margin-inline-start: 100%;
-
- &:dir(rtl) {
- transform: none;
-
- /* flip tip to point left ◁ */
- transform: scaleX(-1);
- }
- }
- }
-
- /* logical property - end popover position with tip pointing toward start - LTR default is ◁ **/
- &.spectrum-Popover--end,
- &.spectrum-Popover--end-top,
- &.spectrum-Popover--end-bottom {
- /* tip triangle */
- .spectrum-Popover-tip {
- margin-inline-end: 100%;
-
- /* flip tip to point right ▷ */
- transform: scaleX(-1);
-
- &:dir(rtl) {
- /* flip tip to point left ◁ */
- transform: scaleX(1);
- }
- }
- }
+ &.spectrum-Popover,
+ &.spectrum-Popover--top,
+ &.spectrum-Popover--top-left,
+ &.spectrum-Popover--top-right,
+ &.spectrum-Popover--top-start,
+ &.spectrum-Popover--top-end,
+ &.spectrum-Popover--bottom,
+ &.spectrum-Popover--bottom-left,
+ &.spectrum-Popover--bottom-right,
+ &.spectrum-Popover--bottom-start,
+ &.spectrum-Popover--bottom-end {
+ .spectrum-Popover-tip {
+ inline-size: var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width));
+ block-size: var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height));
+ position: absolute;
+ inset-block-start: 100%;
+ inset-inline: 0;
+ margin: auto;
+
+ /* https://stackoverflow.com/questions/44170229/how-to-prevent-half-pixel-svg-shift-on-high-pixel-ratio-devices-retina */
+ transform: translate(0, 0);
+ }
+ }
+
+ /* popover is at top of source, tip left and pointing down ▽ */
+ &.spectrum-Popover--top-left {
+ .spectrum-Popover-tip {
+ inset-inline: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
+ }
+ }
+
+ /* popover is at top of source, tip right and pointing down ▽ */
+ &.spectrum-Popover--top-right {
+ .spectrum-Popover-tip {
+ inset-inline: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* logical property - popover is above, source and tip are at start, tip pointing down ▽ */
+ &.spectrum-Popover--top-start {
+ .spectrum-Popover-tip {
+ margin-inline-start: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* logical property - popover is above, source and tip are at end, tip pointing down ▽ */
+ &.spectrum-Popover--top-end {
+ .spectrum-Popover-tip {
+ margin-inline-end: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* popover position is bottom of source with tip pointing up △ */
+ &.spectrum-Popover--bottom,
+ &.spectrum-Popover--bottom-left,
+ &.spectrum-Popover--bottom-right,
+ &.spectrum-Popover--bottom-start,
+ &.spectrum-Popover--bottom-end {
+ .spectrum-Popover-tip {
+ inset-block: auto 100%;
+
+ /* flip triangle to face up */
+ transform: scaleY(-1);
+ }
+ }
+
+ /* popover position is bottom, source is at left, tip pointing up △ */
+ &.spectrum-Popover--bottom-left {
+ .spectrum-Popover-tip {
+ inset-inline: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
+ }
+ }
+
+ /* popover position is bottom, source is at right, tip pointing up △ */
+ &.spectrum-Popover--bottom-right {
+ .spectrum-Popover-tip {
+ inset-inline: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* logical property - popover is below, source is at start, tip pointing up △ */
+ &.spectrum-Popover--bottom-start {
+ .spectrum-Popover-tip {
+ margin-inline-start: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* logical property - popover is below, source is at end, tip pointing up △ */
+ &.spectrum-Popover--bottom-end {
+ .spectrum-Popover-tip {
+ margin-inline-end: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+
+ /* right, left, start, end popover position with tip default to pointing right ▷ */
+ &.spectrum-Popover--left,
+ &.spectrum-Popover--left-bottom,
+ &.spectrum-Popover--left-top,
+ &.spectrum-Popover--right,
+ &.spectrum-Popover--right-bottom,
+ &.spectrum-Popover--right-top,
+ &.spectrum-Popover--start,
+ &.spectrum-Popover--start-top,
+ &.spectrum-Popover--start-bottom,
+ &.spectrum-Popover--end,
+ &.spectrum-Popover--end-top,
+ &.spectrum-Popover--end-bottom {
+ .spectrum-Popover-tip {
+ /* swap height and width for vertical triangle */
+ inline-size: var(--mod-popover-pointer-height, var(--spectrum-popover-pointer-height));
+ block-size: var(--mod-popover-pointer-width, var(--spectrum-popover-pointer-width));
+ inset-block: 0;
+ }
+
+ /* left popover with tip pointing right ▷ */
+ &.spectrum-Popover--left,
+ &.spectrum-Popover--left-bottom,
+ &.spectrum-Popover--left-top {
+ .spectrum-Popover-tip {
+ inset-inline: 100% auto;
+ }
+ }
+
+ /* right popover with tip pointing left ◁ */
+ &.spectrum-Popover--right,
+ &.spectrum-Popover--right-bottom,
+ &.spectrum-Popover--right-top {
+ .spectrum-Popover-tip {
+ inset-inline: auto 100%;
+
+ /* flip tip to point left ◁ */
+ transform: scaleX(-1);
+ }
+ }
+
+ /* popover with tip at top */
+ &.spectrum-Popover--right-top,
+ &.spectrum-Popover--left-top,
+ &.spectrum-Popover--start-top,
+ &.spectrum-Popover--end-top {
+ .spectrum-Popover-tip {
+ inset-block: var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing)) auto;
+ }
+ }
+
+ /* popover with tip at bottom */
+ &.spectrum-Popover--right-bottom,
+ &.spectrum-Popover--left-bottom,
+ &.spectrum-Popover--start-bottom,
+ &.spectrum-Popover--end-bottom {
+ .spectrum-Popover-tip {
+ inset-block: auto var(--mod-popover-pointer-edge-spacing, var(--spectrum-popover-pointer-edge-spacing));
+ }
+ }
+ }
+
+ /* logical property - start popover position with tip pointing toward end - LTR default is ▷ */
+ &.spectrum-Popover--start,
+ &.spectrum-Popover--start-top,
+ &.spectrum-Popover--start-bottom {
+ .spectrum-Popover-tip {
+ margin-inline-start: 100%;
+
+ &:dir(rtl) {
+ transform: none;
+
+ /* flip tip to point left ◁ */
+ transform: scaleX(-1);
+ }
+ }
+ }
+
+ /* logical property - end popover position with tip pointing toward start - LTR default is ◁ **/
+ &.spectrum-Popover--end,
+ &.spectrum-Popover--end-top,
+ &.spectrum-Popover--end-bottom {
+ /* tip triangle */
+ .spectrum-Popover-tip {
+ margin-inline-end: 100%;
+
+ /* flip tip to point right ▷ */
+ transform: scaleX(-1);
+
+ &:dir(rtl) {
+ /* flip tip to point left ◁ */
+ transform: scaleX(1);
+ }
+ }
+ }
}
diff --git a/components/popover/metadata/mods.md b/components/popover/metadata/mods.md
index 25cb283e785..dfcda5b2b06 100644
--- a/components/popover/metadata/mods.md
+++ b/components/popover/metadata/mods.md
@@ -1,18 +1,19 @@
-| Modifiable custom properties |
-| --------------------------------------------- |
-| `--mod-overlay-animation-duration` |
-| `--mod-overlay-animation-duration-opened` |
-| `--mod-popover-animation-distance` |
-| `--mod-popover-background-color` |
-| `--mod-popover-border-color` |
-| `--mod-popover-border-width` |
-| `--mod-popover-content-area-spacing-vertical` |
-| `--mod-popover-corner-radius` |
-| `--mod-popover-filter` |
-| `--mod-popover-pointer-edge-spacing` |
-| `--mod-popover-pointer-height` |
-| `--mod-popover-pointer-width` |
-| `--mod-popover-shadow-blur` |
-| `--mod-popover-shadow-color` |
-| `--mod-popover-shadow-horizontal` |
-| `--mod-popover-shadow-vertical` |
+| Modifiable custom properties |
+| ----------------------------------------------- |
+| `--mod-overlay-animation-duration` |
+| `--mod-overlay-animation-duration-opened` |
+| `--mod-popover-animation-distance` |
+| `--mod-popover-background-color` |
+| `--mod-popover-border-color` |
+| `--mod-popover-border-width` |
+| `--mod-popover-content-area-spacing-horizontal` |
+| `--mod-popover-content-area-spacing-vertical` |
+| `--mod-popover-corner-radius` |
+| `--mod-popover-filter` |
+| `--mod-popover-pointer-edge-spacing` |
+| `--mod-popover-pointer-height` |
+| `--mod-popover-pointer-width` |
+| `--mod-popover-shadow-blur` |
+| `--mod-popover-shadow-color` |
+| `--mod-popover-shadow-horizontal` |
+| `--mod-popover-shadow-vertical` |
diff --git a/components/popover/metadata/popover.yml b/components/popover/metadata/popover.yml
index 6bcff1652b6..a9350ca91ac 100644
--- a/components/popover/metadata/popover.yml
+++ b/components/popover/metadata/popover.yml
@@ -26,6 +26,10 @@ sections:
- Tip SVG should be updated in the markup
- Popover tip SVG polygon can retain the same markup and points for top and bottom (it is flipped in the CSS)
- Popover tip SVG polygon can retain the same markup and points for left/right/start/end (it is flipped in the CSS)
+ ### Version 7.2.0
+ #### Additional padding added for Spectrum 2 components
+ This partial migration adds spacing to the sides of the popover to accommodate the menu and adds the mod:
+ - `--mod-popover-content-area-spacing-horizontal`
examples:
- id: popover
diff --git a/components/popover/package.json b/components/popover/package.json
index 77bc7d79bff..2ab84bbffff 100644
--- a/components/popover/package.json
+++ b/components/popover/package.json
@@ -26,7 +26,7 @@
"@spectrum-css/dialog": ">=10",
"@spectrum-css/divider": ">=3",
"@spectrum-css/menu": ">=7",
- "@spectrum-css/tokens": ">=14"
+ "@spectrum-css/tokens": ">=14.0.0-next.3"
},
"peerDependenciesMeta": {
"@spectrum-css/divider": {
diff --git a/components/progressbar/CHANGELOG.md b/components/progressbar/CHANGELOG.md
index 04ce0846ec1..8fd2330fffd 100644
--- a/components/progressbar/CHANGELOG.md
+++ b/components/progressbar/CHANGELOG.md
@@ -1,5 +1,16 @@
# Change Log
+## 5.0.0-next.0
+
+### Major Changes
+
+- [#2659](https://github.com/adobe/spectrum-css/pull/2659) [`bd38eaa`](https://github.com/adobe/spectrum-css/commit/bd38eaa8c8597c066f1fe61d70130a7f310bcca4) Thanks [@mdt2](https://github.com/mdt2)! - feat(progressbar): S2 migration
+
+ Progress bar now uses Spectrum 2 tokens and specifications. This migration includes updated colors, font sizes, and spacing. No mods were harmed in the migration of this component (all `--mod` properties remain the same).
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
## 4.1.0
### Minor Changes
@@ -16,54 +27,61 @@ Output for all component CSS files is now being run through a lightweight optimi
- @spectrum-css/fieldlabel@>=8
- @spectrum-css/tokens@>=14
-All notable changes to this project will be documented in this file.
-See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-