- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--legacy */
-
-@import "./spectrum-two.css";
-
-@container style(--system: legacy) {
- .spectrum-Accordion {
- --spectrum-accordion-divider-color: var(--spectrum-gray-300);
- --spectrum-accordion-item-content-disabled-color: var(--spectrum-gray-400);
- --spectrum-accordion-item-content-color: var(--spectrum-gray-800);
- }
-}
diff --git a/components/actionbar/CHANGELOG.md b/components/actionbar/CHANGELOG.md
index 110b9315bcc..4aa1e2e4c58 100644
--- a/components/actionbar/CHANGELOG.md
+++ b/components/actionbar/CHANGELOG.md
@@ -1,5 +1,63 @@
# Change log
+## 11.0.0-next.3
+
+### Major Changes
+
+📝 [#4249](https://github.com/adobe/spectrum-css/pull/4249) [`9629fe3`](https://github.com/adobe/spectrum-css/commit/9629fe37cad996d47c827a3eabcdf39092a27b0d) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+This update removes `--mod-*` custom property hooks per SWC-1264, see also the RFC for extensible styling.
+
+- Remove all `--mod-*` custom property hooks.
+- Keep existing class selectors and variants unchanged.
+- Update stories to reflect the removal of the `--mod-*` override layer.
+
+Breaking change: the `--mod-*` override layer is removed. Consumers should set `--spectrum-*` variables directly where customization is needed.
+
+## 11.0.0-next.2
+
+### Major Changes
+
+- [#3657](https://github.com/adobe/spectrum-css/pull/3657) [`c06e995`](https://github.com/adobe/spectrum-css/commit/c06e9953caaaafa3c3f1841057e26c6212754ae5) Thanks [@aramos-adobe](https://github.com/aramos-adobe)!
+
+#### Action bar S2 migration
+
+Action bar now has some updated colors, corner radius, and icons. There's a new look to the default and emphasized variants.
+
+The emphasized has changed from an `accent` background color to a `neutral` background color. In light mode, the clear button and action buttons are `staticWhite` and in dark mode they are `staticBlack`.
+
+##### New tokens
+
+`--spectrum-actionbar-emphasized-actionbutton-label-color`
+`--spectrum-actionbar-emphasized-icon-color`
+`--spectrum-actionbar-minimum-width`
+`--spectrum-actionbar-spacing-label-to-action-group`
+`--spectrum-actionbar-spacing-action-group-edge`
+`--spectrum-actionbar-close-button-to-counter`
+
+##### New modifiers
+
+`--mod-actionbar-minimum-width`
+`--mod-actionbar-spacing-action-group-edge`
+`--mod-actionbar-spacing-label-to-action-group`
+
+## 11.0.0-next.1
+
+### Patch Changes
+
+- Updated dependencies [[`60a156d`](https://github.com/adobe/spectrum-css/commit/60a156d7c0efcc999bc440274bbbbf586beb274b)]:
+ - @spectrum-css/tokens@16.1.0-next.0
+
+## 11.0.0-next.0
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @spectrum-css/closebutton@7.0.0-next.0
+ - @spectrum-css/fieldlabel@11.0.0-next.0
+ - @spectrum-css/actiongroup@7.0.0-next.0
+ - @spectrum-css/popover@9.0.0-next.0
+
## 10.2.0
### Minor Changes
diff --git a/components/actionbar/dist/metadata.json b/components/actionbar/dist/metadata.json
index 3632db90bf7..b0d9b4df5f2 100644
--- a/components/actionbar/dist/metadata.json
+++ b/components/actionbar/dist/metadata.json
@@ -2,96 +2,44 @@
"sourceFile": "index.css",
"selectors": [
".spectrum-ActionBar",
- ".spectrum-ActionBar .spectrum-ActionBar-popover",
".spectrum-ActionBar .spectrum-ActionGroup",
- ".spectrum-ActionBar .spectrum-CloseButton",
".spectrum-ActionBar .spectrum-FieldLabel",
".spectrum-ActionBar .spectrum-FieldLabel:lang(ja)",
".spectrum-ActionBar .spectrum-FieldLabel:lang(ko)",
".spectrum-ActionBar .spectrum-FieldLabel:lang(zh)",
- ".spectrum-ActionBar--emphasized .spectrum-ActionBar-popover",
+ ".spectrum-ActionBar .spectrum-Popover",
".spectrum-ActionBar--emphasized .spectrum-FieldLabel",
+ ".spectrum-ActionBar--emphasized .spectrum-Popover",
".spectrum-ActionBar--fixed",
".spectrum-ActionBar--flexible .spectrum-ActionBar-popover",
".spectrum-ActionBar--sticky",
- ".spectrum-ActionBar.is-open",
- ".spectrum-ActionBar:lang(ja)",
- ".spectrum-ActionBar:lang(ko)",
- ".spectrum-ActionBar:lang(zh)"
- ],
- "modifiers": [
- "--mod-actionbar-corner-radius",
- "--mod-actionbar-emphasized-background-color",
- "--mod-actionbar-emphasized-item-counter-color",
- "--mod-actionbar-height",
- "--mod-actionbar-item-counter-color",
- "--mod-actionbar-item-counter-font-size",
- "--mod-actionbar-item-counter-line-height",
- "--mod-actionbar-item-counter-line-height-cjk",
- "--mod-actionbar-popover-background-color",
- "--mod-actionbar-popover-border-color",
- "--mod-actionbar-shadow-blur",
- "--mod-actionbar-shadow-color",
- "--mod-actionbar-shadow-horizontal",
- "--mod-actionbar-shadow-vertical",
- "--mod-actionbar-spacing-action-group-end",
- "--mod-actionbar-spacing-action-group-top",
- "--mod-actionbar-spacing-close-button-end",
- "--mod-actionbar-spacing-close-button-start",
- "--mod-actionbar-spacing-close-button-top",
- "--mod-actionbar-spacing-item-counter-end",
- "--mod-actionbar-spacing-item-counter-top",
- "--mod-actionbar-spacing-outer-edge"
+ ".spectrum-ActionBar.is-open"
],
+ "modifiers": [],
"component": [
+ "--spectrum-action-bar-border-color",
+ "--spectrum-action-bar-bottom-to-content-area",
+ "--spectrum-action-bar-close-button-to-counter",
+ "--spectrum-action-bar-counter-font-size",
+ "--spectrum-action-bar-edge-to-content-area",
"--spectrum-action-bar-height",
- "--spectrum-action-bar-top-to-item-counter",
- "--spectrum-actionbar-corner-radius",
- "--spectrum-actionbar-emphasized-background-color",
- "--spectrum-actionbar-emphasized-item-counter-color",
- "--spectrum-actionbar-height",
- "--spectrum-actionbar-item-counter-color",
- "--spectrum-actionbar-item-counter-font-size",
- "--spectrum-actionbar-item-counter-line-height",
- "--spectrum-actionbar-item-counter-line-height-cjk",
- "--spectrum-actionbar-popover-background-color",
- "--spectrum-actionbar-popover-border-color",
- "--spectrum-actionbar-shadow-blur",
- "--spectrum-actionbar-shadow-color",
- "--spectrum-actionbar-shadow-horizontal",
- "--spectrum-actionbar-shadow-vertical",
- "--spectrum-actionbar-spacing-action-group-end",
- "--spectrum-actionbar-spacing-action-group-top",
- "--spectrum-actionbar-spacing-close-button-end",
- "--spectrum-actionbar-spacing-close-button-start",
- "--spectrum-actionbar-spacing-close-button-top",
- "--spectrum-actionbar-spacing-item-counter-end",
- "--spectrum-actionbar-spacing-item-counter-top",
- "--spectrum-actionbar-spacing-outer-edge"
+ "--spectrum-action-bar-label-to-action-group-area",
+ "--spectrum-action-bar-minimum-width",
+ "--spectrum-action-bar-top-to-content-area"
],
"global": [
+ "--spectrum-background-elevated-color",
"--spectrum-cjk-line-height-100",
- "--spectrum-corner-radius-100",
- "--spectrum-drop-shadow-blur",
- "--spectrum-drop-shadow-color",
- "--spectrum-drop-shadow-x",
- "--spectrum-drop-shadow-y",
- "--spectrum-font-size-100",
+ "--spectrum-corner-radius-medium-size-extra-large",
+ "--spectrum-drop-shadow-elevated-blur",
+ "--spectrum-drop-shadow-elevated-color",
+ "--spectrum-drop-shadow-elevated-x",
+ "--spectrum-drop-shadow-elevated-y",
"--spectrum-gray-25",
- "--spectrum-gray-400",
- "--spectrum-informative-background-color-default",
"--spectrum-line-height-100",
"--spectrum-neutral-content-color-default",
- "--spectrum-spacing-100",
- "--spectrum-spacing-300",
- "--spectrum-spacing-400",
- "--spectrum-spacing-75",
- "--spectrum-white"
- ],
- "system-theme": [
- "--system-action-bar-popover-background-color",
- "--system-action-bar-popover-border-color"
+ "--spectrum-spacing-300"
],
"passthroughs": [],
- "high-contrast": ["--highcontrast-actionbar-popover-border-color"]
+ "high-contrast": []
}
diff --git a/components/actionbar/index.css b/components/actionbar/index.css
index 474499e462f..fcb1554fcd3 100644
--- a/components/actionbar/index.css
+++ b/components/actionbar/index.css
@@ -11,66 +11,10 @@
* governing permissions and limitations under the License.
*/
-@import "./themes/spectrum-two.css";
-
-.spectrum-ActionBar {
- --spectrum-actionbar-height: var(--spectrum-action-bar-height);
- --spectrum-actionbar-corner-radius: var(--spectrum-corner-radius-100);
-
- /* item counter field label */
- --spectrum-actionbar-item-counter-font-size: var(--spectrum-font-size-100);
- --spectrum-actionbar-item-counter-line-height: var(--spectrum-line-height-100);
- --spectrum-actionbar-item-counter-color: var(--spectrum-neutral-content-color-default);
-
- /* emphasized variation colors */
- --spectrum-actionbar-emphasized-background-color: var(--spectrum-informative-background-color-default);
- --spectrum-actionbar-emphasized-item-counter-color: var(--spectrum-white);
-
- /* spacing of action bar bottom and horizontal outer edge */
- --spectrum-actionbar-spacing-outer-edge: var(--spectrum-spacing-300);
-
- /* spacing of close button */
- --spectrum-actionbar-spacing-close-button-top: var(--spectrum-spacing-100);
- --spectrum-actionbar-spacing-close-button-start: var(--spectrum-spacing-100);
- --spectrum-actionbar-spacing-close-button-end: var(--spectrum-spacing-75);
-
- /* spacing of item counter field label */
- --spectrum-actionbar-spacing-item-counter-top: var(--spectrum-action-bar-top-to-item-counter);
- --spectrum-actionbar-spacing-item-counter-end: var(--spectrum-spacing-400);
-
- /* spacing of action group */
- --spectrum-actionbar-spacing-action-group-top: var(--spectrum-spacing-100);
- --spectrum-actionbar-spacing-action-group-end: var(--spectrum-spacing-100);
-
- /* drop shadow */
- --spectrum-actionbar-shadow-horizontal: var(--spectrum-drop-shadow-x);
- --spectrum-actionbar-shadow-vertical: var(--spectrum-drop-shadow-y);
- --spectrum-actionbar-shadow-blur: var(--spectrum-drop-shadow-blur);
- --spectrum-actionbar-shadow-color: var(--spectrum-drop-shadow-color);
-
- /* cjk language support for item counter */
- &:lang(ja),
- &:lang(zh),
- &:lang(ko) {
- --spectrum-actionbar-item-counter-line-height-cjk: var(--spectrum-cjk-line-height-100);
- }
-}
-
-/* windows high contrast mode */
-@media (forced-colors: active) {
- .spectrum-ActionBar {
- --highcontrast-actionbar-popover-border-color: CanvasText;
- }
-
- .spectrum-ActionBar--emphasized .spectrum-ActionBar-popover {
- --highcontrast-actionbar-popover-border-color: CanvasText;
- }
-}
-
/* ActionBar is outer wrapper with nested popover component within */
.spectrum-ActionBar {
/* creates horizontal spacing to edge */
- padding: 0 var(--mod-actionbar-spacing-outer-edge, var(--spectrum-actionbar-spacing-outer-edge));
+ padding: 0 var(--spectrum-spacing-300);
inset-block-end: 0;
z-index: 1;
@@ -86,27 +30,28 @@
&.is-open {
/* add ActionBar bottom margin to height for correct spacing even when sticky */
- block-size: calc(var(--mod-actionbar-spacing-outer-edge, var(--spectrum-actionbar-spacing-outer-edge)) + var(--mod-actionbar-height, var(--spectrum-actionbar-height)));
+ block-size: calc(var(--spectrum-spacing-300) + var(--spectrum-action-bar-height));
opacity: 1;
}
- .spectrum-ActionBar-popover {
+ .spectrum-Popover {
/* popover is ActionBar height */
- block-size: var(--mod-actionbar-height, var(--spectrum-actionbar-height));
+ block-size: var(--spectrum-action-bar-height);
+ min-inline-size: var(--spectrum-action-bar-minimum-width);
box-sizing: border-box;
inline-size: 100%;
margin: auto;
- padding-block-start: 0;
- padding-block-end: 0;
+ padding-inline: var(--spectrum-action-bar-edge-to-content-area);
+ padding-block: var(--spectrum-action-bar-top-to-content-area) var(--spectrum-action-bar-bottom-to-content-area);
/* Be relative so our width can be restricted */
position: relative;
- border-radius: var(--mod-actionbar-corner-radius, var(--spectrum-actionbar-corner-radius));
- border-color: var(--highcontrast-actionbar-popover-border-color, var(--mod-actionbar-popover-border-color, var(--spectrum-actionbar-popover-border-color)));
- background-color: var(--mod-actionbar-popover-background-color, var(--spectrum-actionbar-popover-background-color));
+ border-radius: var(--spectrum-corner-radius-medium-size-extra-large);
+ border-color: var(--spectrum-action-bar-border-color);
+ background-color: var(--spectrum-background-elevated-color);
- filter: drop-shadow(var(--mod-actionbar-shadow-horizontal, var(--spectrum-actionbar-shadow-horizontal)) var(--mod-actionbar-shadow-vertical, var(--spectrum-actionbar-shadow-vertical)) var(--mod-actionbar-shadow-blur, var(--spectrum-actionbar-shadow-blur)) var(--mod-actionbar-shadow-color, var(--spectrum-actionbar-shadow-color)));
+ filter: drop-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));
/* Let clicks do their thing */
pointer-events: auto;
@@ -114,58 +59,40 @@
/* inner layout of content items */
display: flex;
flex-direction: row;
- }
-
- /* close button */
- .spectrum-CloseButton {
- margin-inline-start: var(--mod-actionbar-spacing-close-button-start, var(--spectrum-actionbar-spacing-close-button-start));
- margin-inline-end: var(--mod-actionbar-spacing-close-button-end, var(--spectrum-actionbar-spacing-close-button-end));
- margin-block-start: var(--mod-actionbar-spacing-close-button-top, var(--spectrum-actionbar-spacing-close-button-top));
- flex-shrink: 0;
+ align-items: center;
}
/* item counter */
.spectrum-FieldLabel {
- margin-inline-end: var(--mod-actionbar-spacing-item-counter-end, var(--spectrum-actionbar-spacing-item-counter-end));
- margin-block-start: var(--mod-actionbar-spacing-item-counter-top, var(--spectrum-actionbar-spacing-item-counter-top));
-
- /* neutralize padding for correct spacing within ActionBar */
- padding: 0;
+ font-size: var(--spectrum-action-bar-counter-font-size);
+ line-height: var(--spectrum-line-height-100);
- font-size: var(--mod-actionbar-item-counter-font-size, var(--spectrum-actionbar-item-counter-font-size));
- color: var(--mod-actionbar-item-counter-color, var(--spectrum-actionbar-item-counter-color));
- line-height: var(--mod-actionbar-item-counter-line-height, var(--spectrum-actionbar-item-counter-line-height));
+ color: var(--spectrum-neutral-content-color-default);
+ padding-inline-start: var(--spectrum-action-bar-close-button-to-counter);
/* cjk language support */
&:lang(ja),
&:lang(zh),
&:lang(ko) {
- line-height: var(--mod-actionbar-item-counter-line-height-cjk, var(--spectrum-actionbar-item-counter-line-height-cjk));
+ line-height: var(--spectrum-cjk-line-height-100);
}
}
/* action group */
.spectrum-ActionGroup {
- margin-inline-end: var(--mod-actionbar-spacing-action-group-end, var(--spectrum-actionbar-spacing-action-group-end));
- margin-block-start: var(--mod-actionbar-spacing-action-group-top, var(--spectrum-actionbar-spacing-action-group-top));
-
/* align to end by default */
margin-inline-start: auto;
+ padding-inline-start: var(--spectrum-action-bar-label-to-action-group-area);
}
}
.spectrum-ActionBar--emphasized {
- .spectrum-ActionBar-popover {
- filter: none;
- background-color: var(--mod-actionbar-emphasized-background-color, var(--spectrum-actionbar-emphasized-background-color));
-
- /* border transparent instead of none so WHCM will have visible border */
- border-color: transparent;
+ .spectrum-FieldLabel {
+ color: var(--spectrum-gray-25);
}
- /* ensure text is legible on emphasized background */
- .spectrum-FieldLabel {
- color: var(--mod-actionbar-emphasized-item-counter-color, var(--spectrum-actionbar-emphasized-item-counter-color));
+ .spectrum-Popover {
+ background-color: var(--spectrum-neutral-content-color-default);
}
}
diff --git a/components/actionbar/package.json b/components/actionbar/package.json
index 8ea6fdde28d..639f40ab571 100644
--- a/components/actionbar/package.json
+++ b/components/actionbar/package.json
@@ -1,6 +1,6 @@
{
"name": "@spectrum-css/actionbar",
- "version": "10.2.0",
+ "version": "11.0.0-next.3",
"description": "The Spectrum CSS actionbar component",
"license": "Apache-2.0",
"author": "Adobe",
@@ -19,18 +19,16 @@
"./package.json": "./package.json",
"./dist/*": "./dist/*",
"./index.css": "./dist/index.css",
- "./index-*.css": "./dist/index-*.css",
"./metadata.json": "./dist/metadata.json",
- "./themes/*": "./dist/themes/*",
"./stories/*": "./stories/*"
},
"main": "dist/index.css",
"peerDependencies": {
- "@spectrum-css/actiongroup": ">=6.0.0 <7.0.0",
- "@spectrum-css/closebutton": ">=6.0.0 <7.0.0",
- "@spectrum-css/fieldlabel": ">=10.0.0 <11.0.0",
- "@spectrum-css/popover": ">=8.0.0 <9.0.0",
- "@spectrum-css/tokens": ">=16.0.0 <17.0.0"
+ "@spectrum-css/actiongroup": ">=7.0.0-next.0",
+ "@spectrum-css/closebutton": ">=7.0.0-next.0",
+ "@spectrum-css/fieldlabel": ">=11.0.0-next.0",
+ "@spectrum-css/popover": ">=9.0.0-next.0",
+ "@spectrum-css/tokens": ">=16.1.0-next.0"
},
"peerDependenciesMeta": {
"@spectrum-css/actiongroup": {
@@ -50,11 +48,11 @@
}
},
"devDependencies": {
- "@spectrum-css/actiongroup": "6.2.0",
- "@spectrum-css/closebutton": "6.2.0",
- "@spectrum-css/fieldlabel": "10.2.0",
- "@spectrum-css/popover": "8.3.0",
- "@spectrum-css/tokens": "16.0.2"
+ "@spectrum-css/actiongroup": "7.0.0-next.3",
+ "@spectrum-css/closebutton": "7.0.0-next.1",
+ "@spectrum-css/fieldlabel": "11.0.0-next.2",
+ "@spectrum-css/popover": "9.0.0-next.5",
+ "@spectrum-css/tokens": "16.1.0-next.10"
},
"keywords": [
"design-system",
diff --git a/components/actionbar/stories/actionbar.stories.js b/components/actionbar/stories/actionbar.stories.js
index aa2e867ea09..e3410ba3953 100644
--- a/components/actionbar/stories/actionbar.stories.js
+++ b/components/actionbar/stories/actionbar.stories.js
@@ -12,7 +12,7 @@ import { BehavioralTemplate } from "./template.js";
* The action bar component is a floating full width bar that appears upon selection. Action bars are used for single and bulk selection patterns, when a user needs to perform actions on either a single or multiple items at the same time.
*
* ## Popover dependency
- * Action bar requires popover, which is nested within the action bar. Action bar background, border, and corner radius are applied to the nested popover component and can be overridden by using action bar's `--mod-*` prefixed custom properties. A [list of the properties](#modifiable-properties) can be found below.
+ * Action bar requires popover, which is nested within the action bar. Action bar background, border, and corner radius are applied to the nested popover component.
*/
export default {
title: "Action bar",
@@ -72,7 +72,11 @@ export default {
},
packageJson,
metadata,
+ status: {
+ type: "migrated",
+ },
},
+ tags: ["migrated"],
};
export const Default = ActionBarGroup.bind({});
@@ -92,7 +96,7 @@ WithForcedColors.parameters = {
// ********* DOCS ONLY ********* //
/**
- * The emphasized action bar has a blue background that adds visual emphasis on the actions and selection. Use this for when the bar should call attention (e.g., floating in a table).
+ * The emphasized action bar has a neutral background that adds visual emphasis on the actions and selection. Use this for when the bar should call attention (e.g., floating in a table).
*/
export const Emphasized = BehavioralTemplate.bind({});
Emphasized.tags = ["!dev"];
diff --git a/components/actionbar/stories/template.js b/components/actionbar/stories/template.js
index 8b134157bd2..865aee288c4 100644
--- a/components/actionbar/stories/template.js
+++ b/components/actionbar/stories/template.js
@@ -1,20 +1,16 @@
-import { Container } from "@spectrum-css/preview/decorators";
import { Template as ActionGroup } from "@spectrum-css/actiongroup/stories/template.js";
import { Template as CloseButton } from "@spectrum-css/closebutton/stories/template.js";
import { Template as FieldLabel } from "@spectrum-css/fieldlabel/stories/template.js";
import { Template as Popover } from "@spectrum-css/popover/stories/template.js";
+import { Container } from "@spectrum-css/preview/decorators";
import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";
import { styleMap } from "lit/directives/style-map.js";
import "../index.css";
-import "../themes/spectrum.css";
-/* Must be imported last */
-import "../themes/express.css";
export const Template = ({
rootClass = "spectrum-ActionBar",
- size = "m",
isOpen = true,
isEmphasized = false,
isSticky = false,
@@ -28,7 +24,6 @@ export const Template = ({
`;
diff --git a/components/actionbar/themes/express.css b/components/actionbar/themes/express.css
deleted file mode 100644
index 9fd550418f2..00000000000
--- a/components/actionbar/themes/express.css
+++ /dev/null
@@ -1,16 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--express */
-
-@import "./spectrum.css";
diff --git a/components/actionbar/themes/spectrum-two.css b/components/actionbar/themes/spectrum-two.css
deleted file mode 100644
index 157c2dc9294..00000000000
--- a/components/actionbar/themes/spectrum-two.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-@container style(--system: spectrum) {
- .spectrum-ActionBar {
- /* colors - applied to popover */
- --spectrum-actionbar-popover-background-color: var(--spectrum-gray-25);
- --spectrum-actionbar-popover-border-color: var(--spectrum-gray-400);
- }
-}
diff --git a/components/actionbar/themes/spectrum.css b/components/actionbar/themes/spectrum.css
deleted file mode 100644
index 27971810d3d..00000000000
--- a/components/actionbar/themes/spectrum.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--legacy */
-
-@import "./spectrum-two.css";
-
-@container style(--system: legacy) {
- .spectrum-ActionBar {
- --spectrum-actionbar-popover-background-color: var(--spectrum-gray-50);
- --spectrum-actionbar-popover-border-color: var(--spectrum-gray-400);
- }
-}
diff --git a/components/actionbutton/CHANGELOG.md b/components/actionbutton/CHANGELOG.md
index 63d6a7a16c5..ef41b956272 100644
--- a/components/actionbutton/CHANGELOG.md
+++ b/components/actionbutton/CHANGELOG.md
@@ -1,5 +1,118 @@
# Change log
+## 8.0.0-next.4
+
+### Minor Changes
+
+📝 [#4085](https://github.com/adobe/spectrum-css/pull/4085) [`082862e`](https://github.com/adobe/spectrum-css/commit/082862eb80c6e0ac1c801b1d538e4d2f2bb919b4) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+### Action menu component (now with custom styles!)
+
+Introduces `@spectrum-css/actionmenu`, a composition of `ActionButton`, `Popover`, and `Menu` to present action lists from a trigger. Now with custom styles!
+
+- Adds wrapper classes: `spectrum-ActionMenu`, `spectrum-ActionMenu-trigger`, `spectrum-ActionMenu-popover`, and `spectrum-ActionMenu-menu`.
+- Supports long press triggers and four placements (start/end, top/bottom) via the underlying popover API.
+- Design reference: [Figma S2 token specs](https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-token-specs?node-id=20959-21513&node-type=frame&t=jbePQKK1yLdrHG2M-11).
+
+#### Migration notes
+
+- If you previously composed an action menu manually (action button + popover + menu), you can adopt the new wrapper classes without changing the underlying markup semantics. Ensure the trigger has `aria-haspopup="menu"` and manages `aria-expanded` according to your application logic.
+- For spacing customizations previously done with ad‑hoc margins, switch to the new `--spectrum-actionmenu-button-to-menu-gap` custom property.
+
+Example markup:
+
+```html
+
+```
+
+### Menu refinements
+
+Updates `@spectrum-css/menu` styles to align with latest Spectrum 2 design specifications and improve accessibility.
+
+- Updated `.is-selectableMultiple .spectrum-Menu-itemCheckbox` to `.is-selectableMultiple:not(:has(.is-selectable)) .spectrum-Menu-itemCheckbox` to prevent clash with the `.is-selectable` placement.
+- Non-breaking; no class or DOM changes required.
+
+### Action button refinements
+
+- Selection styling now applies when components use ARIA pressed/expanded semantics, not just `.is-selected`.
+- Implemented with `:where()` to keep selector specificity low and prevent downstream specificity battles.
+- Non-breaking; no class changes required.
+
+### Action group refinements
+
+Aligns selection behavior of grouped items with action button updates.
+
+- Adds `:where([aria-pressed="true"], [aria-expanded="true"])` alongside `.is-selected` on items to cover more accessibility use-cases while keeping specificity low.
+- Non-breaking; no class changes required.
+
+## 8.0.0-next.3
+
+### Major Changes
+
+📝 [#4014](https://github.com/adobe/spectrum-css/pull/4014) [`35c066b`](https://github.com/adobe/spectrum-css/commit/35c066b29c311b1bfcf4507075f13b41222ffc84) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+This update removes the `dir` attribute polyfill (served via a PostCSS transform to compiled assets) as the fallback is no longer necessary. The`dir` attribute support is available in all supported browsers and has been tested to correctly inherit inside web component shadow DOMs. This is a breaking change **only** to those relying on the `dir` attribute being present for styling, however, the `:dir` pseudo will correctly inherit values from their containers. To correctly determine the `dir` value of a node using JavaScript, you can use `getComputedStyle(node).direction`.
+
+## 8.0.0-next.2
+
+### Patch Changes
+
+- Updated dependencies [[`60a156d`](https://github.com/adobe/spectrum-css/commit/60a156d7c0efcc999bc440274bbbbf586beb274b)]:
+ - @spectrum-css/tokens@16.1.0-next.0
+
+## 8.0.0-next.1
+
+### Major Changes
+
+📝 [#2669](https://github.com/adobe/spectrum-css/pull/2669) [`b2c6357`](https://github.com/adobe/spectrum-css/commit/b2c6357c542737fb996cf8378354f525adde1fc2) Thanks [@mdt2](https://github.com/mdt2)!
+
+Action button now uses Spectrum 2 tokens and design specifications. A few notable changes:
+
+- Medium is now the default size and `.spectrum-ActionButton--sizeM` has been removed.
+- Includes the Spectrum 2 down state transform.
+- The component border was not removed and its color was changed to `transparent` in order to continue support for Windows High Contrast / forced colors, which still shows a border. The mod custom properties for border were removed to avoid interference with Windows High Contrast / forced colors accessibility.
+- Some selectors to target the icon + text button and the icon-only button have been simplified using `:has`. This removes some overly complex `calc()` functions used for inline spacing, uses the design tokens more directly, and removes the previously documented need for the component's child elements to use a specific source order.
+- Background and content colors were updated.
+- Mod custom properties have been adjusted:
+ - Renamed:
+ - `--mod-line-height-100` renamed to `--mod-actionbutton-line-height`.
+ - `--mod-sans-font-family-stack` renamed to `--mod-button-font-family`.
+ - `--mod-animation-duration-100` renamed to `--mod-button-animation-duration`.
+ - Removed:
+ - `--mod-actionbutton-border-color-default`
+ - `--mod-actionbutton-border-color-disabled`
+ - `--mod-actionbutton-border-color-down`
+ - `--mod-actionbutton-border-color-focus`
+ - `--mod-actionbutton-border-color-hover`
+ - `--mod-actionbutton-border-width`
+ - `--mod-actionbutton-static-content-color`
+ - New:
+ - `--mod-actionbutton-font-weight`
+ - `--mod-actionbutton-font-style`
+
+## 8.0.0-next.0
+
+### Patch Changes
+
+- Updated dependencies [[`a25e0a9`](https://github.com/adobe/spectrum-css/commit/a25e0a99e5a4736ab4e607e00739343101a2633b)]:
+ - @spectrum-css/icon@10.0.0-next.0
+
## 7.2.0
### Minor Changes
@@ -20,7 +133,9 @@ Minor linting fix of replacing `rgba` to the `rgb` shorthand syntax.
### Patch Changes
-- [#3644](https://github.com/adobe/spectrum-css/pull/3644) [`5adef1d`](https://github.com/adobe/spectrum-css/commit/5adef1d15d07516dc9c1aac7bbcf9ac5bdeb9e97) Thanks [@marissahuysentruyt](https://github.com/marissahuysentruyt)! - Fix support for `--mod-actionbutton-border-radius` to make sure it is surfaced to consumers, and properly overwrites the default border radius setting.
+📝 [#3644](https://github.com/adobe/spectrum-css/pull/3644) [`5adef1d`](https://github.com/adobe/spectrum-css/commit/5adef1d15d07516dc9c1aac7bbcf9ac5bdeb9e97) Thanks [@marissahuysentruyt](https://github.com/marissahuysentruyt)!
+
+Fix support for `--mod-actionbutton-border-radius` to make sure it is surfaced to consumers, and properly overwrites the default border radius setting.
## 7.1.2
diff --git a/components/actionbutton/dist/metadata.json b/components/actionbutton/dist/metadata.json
index 08d99aab279..8a5fd1c4424 100644
--- a/components/actionbutton/dist/metadata.json
+++ b/components/actionbutton/dist/metadata.json
@@ -2,33 +2,28 @@
"sourceFile": "index.css",
"selectors": [
".spectrum-ActionButton",
+ ".spectrum-ActionButton .spectrum-ActionButton-hold",
+ ".spectrum-ActionButton .spectrum-ActionButton-icon",
+ ".spectrum-ActionButton .spectrum-ActionButton-label",
".spectrum-ActionButton--sizeL",
- ".spectrum-ActionButton--sizeM",
".spectrum-ActionButton--sizeS",
".spectrum-ActionButton--sizeXL",
".spectrum-ActionButton--sizeXS",
".spectrum-ActionButton-hold",
- ".spectrum-ActionButton-hold + .spectrum-ActionButton-icon",
".spectrum-ActionButton-icon",
- ".spectrum-ActionButton-icon:only-child",
".spectrum-ActionButton-label",
".spectrum-ActionButton-label:empty",
".spectrum-ActionButton.is-disabled",
- ".spectrum-ActionButton.is-selected",
- ".spectrum-ActionButton.is-selected .spectrum-ActionButton-hold",
- ".spectrum-ActionButton.is-selected .spectrum-ActionButton-icon",
- ".spectrum-ActionButton.is-selected .spectrum-ActionButton-label",
- ".spectrum-ActionButton.spectrum-ActionButton--emphasized:not(.spectrum-ActionButton--staticBlack, .spectrum-ActionButton--staticWhite)",
+ ".spectrum-ActionButton.spectrum-ActionButton--emphasized:is(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
".spectrum-ActionButton.spectrum-ActionButton--quiet",
- ".spectrum-ActionButton.spectrum-ActionButton--sizeL",
- ".spectrum-ActionButton.spectrum-ActionButton--sizeM",
- ".spectrum-ActionButton.spectrum-ActionButton--sizeS",
- ".spectrum-ActionButton.spectrum-ActionButton--sizeXL",
- ".spectrum-ActionButton.spectrum-ActionButton--sizeXS",
+ ".spectrum-ActionButton.spectrum-ActionButton--quiet:is(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
+ ".spectrum-ActionButton.spectrum-ActionButton--quiet:is(:disabled, .is-disabled, [aria-disabled=\"true\"]):not(:where(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"]))",
".spectrum-ActionButton.spectrum-ActionButton--staticBlack",
".spectrum-ActionButton.spectrum-ActionButton--staticBlack.spectrum-ActionButton--quiet",
+ ".spectrum-ActionButton.spectrum-ActionButton--staticBlack:is(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
".spectrum-ActionButton.spectrum-ActionButton--staticWhite",
".spectrum-ActionButton.spectrum-ActionButton--staticWhite.spectrum-ActionButton--quiet",
+ ".spectrum-ActionButton.spectrum-ActionButton--staticWhite:is(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
".spectrum-ActionButton::-moz-focus-inner",
".spectrum-ActionButton:active",
".spectrum-ActionButton:after",
@@ -37,12 +32,14 @@
".spectrum-ActionButton:focus",
".spectrum-ActionButton:focus-visible",
".spectrum-ActionButton:focus-visible:after",
+ ".spectrum-ActionButton:has(.spectrum-ActionButton-icon)",
".spectrum-ActionButton:hover",
- "[dir=\"rtl\"] .spectrum-ActionButton",
+ ".spectrum-ActionButton:is(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
+ ".spectrum-ActionButton:is(:disabled, .is-disabled, [aria-disabled=\"true\"])",
+ ".spectrum-ActionButton:not(:has(.spectrum-ActionButton-label))",
"a.spectrum-ActionButton"
],
"modifiers": [
- "--mod-actionbutton-animation-duration",
"--mod-actionbutton-background-color-default",
"--mod-actionbutton-background-color-default-selected",
"--mod-actionbutton-background-color-default-selected-emphasized",
@@ -56,13 +53,7 @@
"--mod-actionbutton-background-color-hover",
"--mod-actionbutton-background-color-hover-selected",
"--mod-actionbutton-background-color-hover-selected-emphasized",
- "--mod-actionbutton-border-color-default",
- "--mod-actionbutton-border-color-disabled",
- "--mod-actionbutton-border-color-down",
- "--mod-actionbutton-border-color-focus",
- "--mod-actionbutton-border-color-hover",
"--mod-actionbutton-border-radius",
- "--mod-actionbutton-border-width",
"--mod-actionbutton-content-color-default",
"--mod-actionbutton-content-color-default-selected",
"--mod-actionbutton-content-color-default-selected-emphasized",
@@ -80,20 +71,15 @@
"--mod-actionbutton-edge-to-text",
"--mod-actionbutton-edge-to-visual",
"--mod-actionbutton-edge-to-visual-only",
- "--mod-actionbutton-focus-indicator-border-radius",
- "--mod-actionbutton-focus-indicator-color",
- "--mod-actionbutton-focus-indicator-gap",
- "--mod-actionbutton-focus-indicator-thickness",
"--mod-actionbutton-font-size",
+ "--mod-actionbutton-font-style",
+ "--mod-actionbutton-font-weight",
"--mod-actionbutton-height",
"--mod-actionbutton-icon-size",
"--mod-actionbutton-label-color",
+ "--mod-actionbutton-line-height",
"--mod-actionbutton-min-width",
- "--mod-actionbutton-static-content-color",
- "--mod-actionbutton-text-to-visual",
- "--mod-animation-duration-100",
- "--mod-line-height-100",
- "--mod-sans-font-family-stack"
+ "--mod-actionbutton-text-to-visual"
],
"component": [
"--spectrum-action-button-edge-to-hold-icon-extra-large",
@@ -101,46 +87,36 @@
"--spectrum-action-button-edge-to-hold-icon-large",
"--spectrum-action-button-edge-to-hold-icon-medium",
"--spectrum-action-button-edge-to-hold-icon-small",
- "--spectrum-actionbutton-background-color",
+ "--spectrum-actionbutton-animation-duration",
"--spectrum-actionbutton-background-color-default",
"--spectrum-actionbutton-background-color-disabled",
"--spectrum-actionbutton-background-color-down",
"--spectrum-actionbutton-background-color-focus",
"--spectrum-actionbutton-background-color-hover",
- "--spectrum-actionbutton-background-color-selected",
- "--spectrum-actionbutton-background-color-selected-disabled",
- "--spectrum-actionbutton-background-color-selected-down",
- "--spectrum-actionbutton-background-color-selected-focus",
- "--spectrum-actionbutton-background-color-selected-hover",
"--spectrum-actionbutton-border-color",
- "--spectrum-actionbutton-border-color-default",
- "--spectrum-actionbutton-border-color-disabled",
- "--spectrum-actionbutton-border-color-down",
- "--spectrum-actionbutton-border-color-focus",
- "--spectrum-actionbutton-border-color-hover",
"--spectrum-actionbutton-border-radius",
- "--spectrum-actionbutton-border-radius-default",
"--spectrum-actionbutton-border-width",
- "--spectrum-actionbutton-content-color",
- "--spectrum-actionbutton-content-color-selected",
+ "--spectrum-actionbutton-content-color-default",
+ "--spectrum-actionbutton-content-color-disabled",
+ "--spectrum-actionbutton-content-color-down",
+ "--spectrum-actionbutton-content-color-focus",
+ "--spectrum-actionbutton-content-color-hover",
+ "--spectrum-actionbutton-downstate-perspective",
"--spectrum-actionbutton-edge-to-hold-icon",
"--spectrum-actionbutton-edge-to-text",
"--spectrum-actionbutton-edge-to-visual",
"--spectrum-actionbutton-edge-to-visual-only",
+ "--spectrum-actionbutton-focus-indicator-border-radius",
"--spectrum-actionbutton-focus-indicator-color",
"--spectrum-actionbutton-focus-indicator-gap",
"--spectrum-actionbutton-focus-indicator-thickness",
"--spectrum-actionbutton-font-size",
+ "--spectrum-actionbutton-font-style",
+ "--spectrum-actionbutton-font-weight",
"--spectrum-actionbutton-height",
"--spectrum-actionbutton-icon-size",
- "--spectrum-actionbutton-sized-edge-to-hold-icon",
- "--spectrum-actionbutton-sized-edge-to-text",
- "--spectrum-actionbutton-sized-edge-to-visual",
- "--spectrum-actionbutton-sized-edge-to-visual-only",
- "--spectrum-actionbutton-sized-font-size",
- "--spectrum-actionbutton-sized-height",
- "--spectrum-actionbutton-sized-icon-size",
- "--spectrum-actionbutton-sized-text-to-visual",
+ "--spectrum-actionbutton-line-height",
+ "--spectrum-actionbutton-min-width",
"--spectrum-actionbutton-text-to-visual"
],
"global": [
@@ -171,17 +147,23 @@
"--spectrum-component-height-300",
"--spectrum-component-height-50",
"--spectrum-component-height-75",
+ "--spectrum-component-size-difference-down",
+ "--spectrum-component-size-minimum-perspective-down",
+ "--spectrum-component-size-width-ratio-down",
"--spectrum-corner-radius-medium-size-extra-large",
"--spectrum-corner-radius-medium-size-extra-small",
"--spectrum-corner-radius-medium-size-large",
"--spectrum-corner-radius-medium-size-medium",
"--spectrum-corner-radius-medium-size-small",
+ "--spectrum-default-font-style",
"--spectrum-disabled-background-color",
"--spectrum-disabled-content-color",
"--spectrum-disabled-static-black-background-color",
"--spectrum-disabled-static-black-content-color",
"--spectrum-disabled-static-white-background-color",
"--spectrum-disabled-static-white-content-color",
+ "--spectrum-downstate-height",
+ "--spectrum-downstate-width",
"--spectrum-focus-indicator-color",
"--spectrum-focus-indicator-gap",
"--spectrum-focus-indicator-thickness",
@@ -192,9 +174,9 @@
"--spectrum-font-size-75",
"--spectrum-gray-100",
"--spectrum-gray-200",
- "--spectrum-gray-50",
- "--spectrum-line-height-100",
+ "--spectrum-gray-25",
"--spectrum-logical-rotation",
+ "--spectrum-medium-font-weight",
"--spectrum-neutral-background-color-selected-default",
"--spectrum-neutral-background-color-selected-down",
"--spectrum-neutral-background-color-selected-hover",
@@ -213,10 +195,12 @@
"--spectrum-text-to-visual-75",
"--spectrum-transparent-black-100",
"--spectrum-transparent-black-200",
+ "--spectrum-transparent-black-25",
"--spectrum-transparent-black-800",
"--spectrum-transparent-black-900",
"--spectrum-transparent-white-100",
"--spectrum-transparent-white-200",
+ "--spectrum-transparent-white-25",
"--spectrum-transparent-white-800",
"--spectrum-transparent-white-900",
"--spectrum-white",
@@ -226,75 +210,17 @@
"--spectrum-workflow-icon-size-50",
"--spectrum-workflow-icon-size-75"
],
- "system-theme": [
- "--system-action-button-background-color-default",
- "--system-action-button-background-color-disabled",
- "--system-action-button-background-color-down",
- "--system-action-button-background-color-focus",
- "--system-action-button-background-color-hover",
- "--system-action-button-background-color-selected",
- "--system-action-button-background-color-selected-down",
- "--system-action-button-background-color-selected-focus",
- "--system-action-button-background-color-selected-hover",
- "--system-action-button-border-color-default",
- "--system-action-button-border-color-disabled",
- "--system-action-button-border-color-down",
- "--system-action-button-border-color-focus",
- "--system-action-button-border-color-hover",
- "--system-action-button-content-color-selected",
- "--system-action-button-quiet-background-color-default",
- "--system-action-button-quiet-background-color-disabled",
- "--system-action-button-quiet-background-color-down",
- "--system-action-button-quiet-background-color-focus",
- "--system-action-button-quiet-background-color-hover",
- "--system-action-button-quiet-background-color-selected-disabled",
- "--system-action-button-size-l-border-radius-default",
- "--system-action-button-size-m-border-radius-default",
- "--system-action-button-size-s-border-radius-default",
- "--system-action-button-size-xl-border-radius-default",
- "--system-action-button-size-xs-border-radius-default",
- "--system-action-button-static-black-background-color-default",
- "--system-action-button-static-black-background-color-disabled",
- "--system-action-button-static-black-background-color-down",
- "--system-action-button-static-black-background-color-focus",
- "--system-action-button-static-black-background-color-hover",
- "--system-action-button-static-black-background-color-selected-disabled",
- "--system-action-button-static-black-border-color-default",
- "--system-action-button-static-black-border-color-disabled",
- "--system-action-button-static-black-border-color-down",
- "--system-action-button-static-black-border-color-focus",
- "--system-action-button-static-black-border-color-hover",
- "--system-action-button-static-black-quiet-background-color-default",
- "--system-action-button-static-black-quiet-background-color-disabled",
- "--system-action-button-static-black-quiet-background-color-down",
- "--system-action-button-static-black-quiet-background-color-focus",
- "--system-action-button-static-black-quiet-background-color-hover",
- "--system-action-button-static-white-background-color-default",
- "--system-action-button-static-white-background-color-disabled",
- "--system-action-button-static-white-background-color-down",
- "--system-action-button-static-white-background-color-focus",
- "--system-action-button-static-white-background-color-hover",
- "--system-action-button-static-white-background-color-selected-disabled",
- "--system-action-button-static-white-border-color-default",
- "--system-action-button-static-white-border-color-disabled",
- "--system-action-button-static-white-border-color-down",
- "--system-action-button-static-white-border-color-focus",
- "--system-action-button-static-white-border-color-hover",
- "--system-action-button-static-white-quiet-background-color-default",
- "--system-action-button-static-white-quiet-background-color-disabled",
- "--system-action-button-static-white-quiet-background-color-down",
- "--system-action-button-static-white-quiet-background-color-focus",
- "--system-action-button-static-white-quiet-background-color-hover"
- ],
"passthroughs": [
"--mod-button-animation-duration",
- "--mod-button-font-family",
- "--mod-button-line-height"
+ "--mod-button-font-family"
],
"high-contrast": [
- "--highcontrast-actionbutton-background-color",
+ "--highcontrast-actionbutton-animation-duration",
+ "--highcontrast-actionbutton-background-color-default",
+ "--highcontrast-actionbutton-background-color-disabled",
"--highcontrast-actionbutton-border-color",
- "--highcontrast-actionbutton-content-color",
+ "--highcontrast-actionbutton-content-color-default",
+ "--highcontrast-actionbutton-content-color-disabled",
"--highcontrast-actionbutton-focus-indicator-color"
]
}
diff --git a/components/actionbutton/index.css b/components/actionbutton/index.css
index ac4f410471e..c9f7c7899a2 100644
--- a/components/actionbutton/index.css
+++ b/components/actionbutton/index.css
@@ -1,329 +1,478 @@
/*!
- * 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
- *
- * 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.
- */
-
-@import "@spectrum-css/commons/basebutton.css";
-@import "./themes/spectrum-two.css";
+Copyright 2025 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
-@media (forced-colors: active) {
- .spectrum-ActionButton {
- /* force a more visible focus indicator color */
- --highcontrast-actionbutton-focus-indicator-color: ButtonText;
- --highcontrast-actionbutton-content-color: ButtonText;
-
- &::after {
- /* make sure focus indicator renders */
- forced-color-adjust: none;
- }
-
- &.is-selected {
- --highcontrast-actionbutton-background-color: Highlight;
- --highcontrast-actionbutton-border-color: HighlightText;
- --highcontrast-actionbutton-content-color: HighlightText;
-
- .spectrum-ActionButton-icon,
- .spectrum-ActionButton-hold,
- .spectrum-ActionButton-label {
- /* ensure custom text colors from above get applied */
- /* it seems like this shouldn't have to be done, but colors are wrong without it */
- forced-color-adjust: none;
- }
- }
-
- &:disabled,
- &.is-disabled {
- --highcontrast-actionbutton-content-color: GrayText;
- --highcontrast-actionbutton-border-color: GrayText;
- --highcontrast-actionbutton-background-color: ButtonFace;
- }
- }
-}
+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-ActionButton {
- --spectrum-actionbutton-background-color: var(--highcontrast-actionbutton-background-color, var(--mod-actionbutton-background-color-default, var(--spectrum-actionbutton-background-color-default)));
- --spectrum-actionbutton-border-color: var(--highcontrast-actionbutton-border-color, var(--mod-actionbutton-border-color-default, var(--spectrum-actionbutton-border-color-default)));
- --spectrum-actionbutton-content-color: var(--highcontrast-actionbutton-content-color, var(--mod-actionbutton-content-color-default, var(--spectrum-neutral-content-color-default)));
-
- --spectrum-actionbutton-border-radius: var(--mod-actionbutton-border-radius, var(--spectrum-actionbutton-border-radius-default));
- --spectrum-actionbutton-border-width: var(--mod-actionbutton-border-width, var(--spectrum-border-width-100));
-
- --spectrum-actionbutton-focus-indicator-gap: var(--mod-actionbutton-focus-indicator-gap, var(--spectrum-focus-indicator-gap));
- --spectrum-actionbutton-focus-indicator-thickness: var(--mod-actionbutton-focus-indicator-thickness, var(--spectrum-focus-indicator-thickness));
- --spectrum-actionbutton-focus-indicator-color: var(--highcontrast-actionbutton-focus-indicator-color, var(--mod-actionbutton-focus-indicator-color, var(--spectrum-focus-indicator-color)));
+ --spectrum-actionbutton-animation-duration: var(--spectrum-animation-duration-100);
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-medium);
+ --spectrum-actionbutton-border-width: var(--spectrum-border-width-100);
+ --spectrum-actionbutton-border-color: transparent;
+
+ --spectrum-actionbutton-content-color-default: var(--spectrum-neutral-content-color-default);
+ --spectrum-actionbutton-content-color-hover: var(--spectrum-neutral-content-color-hover);
+ --spectrum-actionbutton-content-color-down: var(--spectrum-neutral-content-color-down);
+ --spectrum-actionbutton-content-color-focus: var(--spectrum-neutral-content-color-key-focus);
+ --spectrum-actionbutton-content-color-disabled: var(--spectrum-disabled-content-color);
+
+ --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-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-background-color);
+
+ --spectrum-actionbutton-focus-indicator-gap: var(--spectrum-focus-indicator-gap);
+ --spectrum-actionbutton-focus-indicator-thickness: var(--spectrum-focus-indicator-thickness);
+ --spectrum-actionbutton-focus-indicator-color: var(--spectrum-focus-indicator-color);
+ --spectrum-actionbutton-focus-indicator-border-radius: calc(var(--spectrum-actionbutton-border-radius) + var(--spectrum-actionbutton-focus-indicator-gap));
+
+ --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);
+
+ --spectrum-actionbutton-icon-size: var(--spectrum-workflow-icon-size-100);
+ --spectrum-actionbutton-font-size: var(--spectrum-font-size-100);
+ --spectrum-actionbutton-font-weight: var(--spectrum-medium-font-weight);
+ --spectrum-actionbutton-font-style: var(--spectrum-default-font-style);
+
+ /* Take up full component height for line-height, in order to help prevent characters from being cut off in some languages (e.g. Thai). */
+ --spectrum-actionbutton-line-height: var(--spectrum-actionbutton-height);
+
+ --spectrum-actionbutton-text-to-visual: var(--spectrum-text-to-visual-100);
+ --spectrum-actionbutton-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-medium);
+ --spectrum-actionbutton-edge-to-visual: var(--spectrum-component-edge-to-visual-100);
+ --spectrum-actionbutton-edge-to-text: var(--spectrum-component-edge-to-text-100);
+ --spectrum-actionbutton-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-100);
+
+ --spectrum-actionbutton-downstate-perspective: max(var(--spectrum-downstate-height), var(--spectrum-downstate-width) * var(--spectrum-component-size-width-ratio-down));
&:dir(rtl) {
--spectrum-logical-rotation: matrix(-1, 0, 0, 1, 0, 0);
}
&.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-border-color: transparent;
- }
-
- /* Emphasized styles are only applied to the "selected" state of the button and are not applied in static color modes */
- &.spectrum-ActionButton--emphasized:not(.spectrum-ActionButton--staticBlack, .spectrum-ActionButton--staticWhite) {
- --mod-actionbutton-background-color-default-selected: var(--mod-actionbutton-background-color-default-selected-emphasized, var(--spectrum-accent-background-color-default));
- --mod-actionbutton-background-color-hover-selected: var(--mod-actionbutton-background-color-hover-selected-emphasized, var(--spectrum-accent-background-color-hover));
- --mod-actionbutton-background-color-down-selected: var(--mod-actionbutton-background-color-down-selected-emphasized, var(--spectrum-accent-background-color-down));
- --mod-actionbutton-background-color-focus-selected: var(--mod-actionbutton-background-color-focus-selected-emphasized, var(--spectrum-accent-background-color-key-focus));
-
- --mod-actionbutton-content-color-default-selected: var(--mod-actionbutton-content-color-default-selected-emphasized, var(--spectrum-white));
- --mod-actionbutton-content-color-hover-selected: var(--mod-actionbutton-content-color-hover-selected-emphasized, var(--spectrum-white));
- --mod-actionbutton-content-color-down-selected: var(--mod-actionbutton-content-color-down-selected-emphasized, var(--spectrum-white));
- --mod-actionbutton-content-color-focus-selected: var(--mod-actionbutton-content-color-focus-selected-emphasized, var(--spectrum-white));
+ --spectrum-actionbutton-background-color-default: transparent;
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
+ --spectrum-actionbutton-background-color-disabled: transparent;
+
+ &:is(.is-selected, [aria-pressed="true"], [aria-expanded="true"]) {
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-background-color);
+ }
}
&.spectrum-ActionButton--staticBlack {
- --mod-actionbutton-background-color-default-selected: var(--spectrum-transparent-black-800);
- --mod-actionbutton-background-color-hover-selected: var(--spectrum-transparent-black-900);
- --mod-actionbutton-background-color-down-selected: var(--spectrum-transparent-black-900);
- --mod-actionbutton-background-color-focus-selected: var(--spectrum-transparent-black-900);
-
- --mod-actionbutton-content-color-default: var(--spectrum-black);
- --mod-actionbutton-content-color-hover: var(--spectrum-black);
- --mod-actionbutton-content-color-down: var(--spectrum-black);
- --mod-actionbutton-content-color-focus: var(--spectrum-black);
- --mod-actionbutton-content-color-disabled: var(--spectrum-disabled-static-black-content-color);
-
- --mod-actionbutton-content-color-default-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-white));
- --mod-actionbutton-content-color-hover-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-white));
- --mod-actionbutton-content-color-down-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-white));
- --mod-actionbutton-content-color-focus-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-white));
-
- --mod-actionbutton-focus-indicator-color: var(--spectrum-static-black-focus-indicator-color);
+ --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-black-100);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-black-background-color);
+
+ --spectrum-actionbutton-content-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-actionbutton-content-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-content-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-content-color-focus: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-content-color-disabled: var(--spectrum-disabled-static-black-content-color);
+
+ --spectrum-actionbutton-focus-indicator-color: var(--spectrum-static-black-focus-indicator-color);
+
+ &.spectrum-ActionButton--quiet {
+ --spectrum-actionbutton-background-color-default: transparent;
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-200);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-transparent-black-25);
+ }
}
&.spectrum-ActionButton--staticWhite {
- /* background color _not_ selected is coming from the system theme layer */
- --mod-actionbutton-background-color-default-selected: var(--spectrum-transparent-white-800);
- --mod-actionbutton-background-color-hover-selected: var(--spectrum-transparent-white-900);
- --mod-actionbutton-background-color-down-selected: var(--spectrum-transparent-white-900);
- --mod-actionbutton-background-color-focus-selected: var(--spectrum-transparent-white-900);
-
- --mod-actionbutton-content-color-default: var(--spectrum-white);
- --mod-actionbutton-content-color-hover: var(--spectrum-white);
- --mod-actionbutton-content-color-down: var(--spectrum-white);
- --mod-actionbutton-content-color-focus: var(--spectrum-white);
- --mod-actionbutton-content-color-disabled: var(--spectrum-disabled-static-white-content-color);
-
- --mod-actionbutton-content-color-default-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-black));
- --mod-actionbutton-content-color-hover-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-black));
- --mod-actionbutton-content-color-down-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-black));
- --mod-actionbutton-content-color-focus-selected: var(--mod-actionbutton-static-content-color, var(--spectrum-black));
-
- --mod-actionbutton-focus-indicator-color: var(--spectrum-static-white-focus-indicator-color);
+ --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-white-100);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-white-background-color);
+
+ --spectrum-actionbutton-content-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-actionbutton-content-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-content-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-content-color-focus: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-content-color-disabled: var(--spectrum-disabled-static-white-content-color);
+
+ --spectrum-actionbutton-focus-indicator-color: var(--spectrum-static-white-focus-indicator-color);
+
+ &.spectrum-ActionButton--quiet {
+ --spectrum-actionbutton-background-color-default: transparent;
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-200);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-transparent-white-25);
+ }
}
- &.is-selected {
- --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected, var(--spectrum-actionbutton-background-color-selected));
- --mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected, var(--spectrum-actionbutton-background-color-selected-hover));
- --mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected, var(--spectrum-actionbutton-background-color-selected-down));
- --mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected, var(--spectrum-actionbutton-background-color-selected-focus));
- --mod-actionbutton-background-color-disabled: var(--spectrum-actionbutton-background-color-selected-disabled);
-
- --mod-actionbutton-border-color-default: transparent;
- --mod-actionbutton-border-color-hover: transparent;
- --mod-actionbutton-border-color-down: transparent;
- --mod-actionbutton-border-color-focus: transparent;
- --mod-actionbutton-border-color-disabled: transparent;
-
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected, var(--spectrum-actionbutton-content-color-selected));
- --mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected, var(--spectrum-actionbutton-content-color-selected));
- --mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected, var(--spectrum-actionbutton-content-color-selected));
- --mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected, var(--spectrum-actionbutton-content-color-selected));
- }
+ /* expanded is specific to action menu when the menu is open */
+ &:is(.is-selected, [aria-pressed="true"], [aria-expanded="true"]) {
+ --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-default-selected, var(--spectrum-neutral-background-color-selected-default));
+ --mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected, var(--spectrum-neutral-background-color-selected-hover));
+ --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-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));
+ --mod-actionbutton-background-color-hover: var(--mod-actionbutton-background-color-hover-selected-emphasized, var(--spectrum-accent-background-color-hover));
+ --mod-actionbutton-background-color-down: var(--mod-actionbutton-background-color-down-selected-emphasized, var(--spectrum-accent-background-color-down));
+ --mod-actionbutton-background-color-focus: var(--mod-actionbutton-background-color-focus-selected-emphasized, var(--spectrum-accent-background-color-key-focus));
+
+ --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-default-selected-emphasized, var(--spectrum-white));
+ --mod-actionbutton-content-color-hover: var(--mod-actionbutton-content-color-hover-selected-emphasized, var(--spectrum-white));
+ --mod-actionbutton-content-color-down: var(--mod-actionbutton-content-color-down-selected-emphasized, var(--spectrum-white));
+ --mod-actionbutton-content-color-focus: var(--mod-actionbutton-content-color-focus-selected-emphasized, var(--spectrum-white));
+ }
- &:hover {
- --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-hover, var(--spectrum-actionbutton-background-color-hover));
- --mod-actionbutton-border-color-default: var(--mod-actionbutton-border-color-hover, var(--spectrum-actionbutton-border-color-hover));
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-hover, var(--spectrum-neutral-content-color-hover));
- }
+ &.spectrum-ActionButton--staticWhite {
+ --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-white-800);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-900);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-white-background-color);
+
+ --spectrum-actionbutton-content-color-default: var(--spectrum-black);
+ --spectrum-actionbutton-content-color-hover: var(--spectrum-black);
+ --spectrum-actionbutton-content-color-down: var(--spectrum-black);
+ --spectrum-actionbutton-content-color-focus: var(--spectrum-black);
+ }
- &:focus-visible {
- --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-focus, var(--spectrum-actionbutton-background-color-focus));
- --mod-actionbutton-border-color-default: var(--mod-actionbutton-border-color-focus, var(--spectrum-actionbutton-border-color-focus));
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-focus, var(--spectrum-neutral-content-color-key-focus));
+ &.spectrum-ActionButton--staticBlack {
+ --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-black-800);
+ --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-900);
+ --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-black-background-color);
+
+ --spectrum-actionbutton-content-color-default: var(--spectrum-white);
+ --spectrum-actionbutton-content-color-hover: var(--spectrum-white);
+ --spectrum-actionbutton-content-color-down: var(--spectrum-white);
+ --spectrum-actionbutton-content-color-focus: var(--spectrum-white);
+ }
}
+}
- &:active {
- --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-down, var(--spectrum-actionbutton-background-color-down));
- --mod-actionbutton-border-color-default: var(--mod-actionbutton-border-color-down, var(--spectrum-actionbutton-border-color-down));
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-down, var(--spectrum-neutral-content-color-down));
- }
+.spectrum-ActionButton--sizeXS {
+ --spectrum-actionbutton-border-radius: var(--spectrum-corner-radius-medium-size-extra-small);
- &:disabled,
- &.is-disabled {
- --mod-actionbutton-background-color-default: var(--mod-actionbutton-background-color-disabled, var(--spectrum-actionbutton-background-color-disabled));
- --mod-actionbutton-border-color-default: var(--mod-actionbutton-border-color-disabled, var(--spectrum-actionbutton-border-color-disabled));
- --mod-actionbutton-content-color-default: var(--mod-actionbutton-content-color-disabled, var(--spectrum-disabled-content-color));
- }
-}
+ --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);
-.spectrum-ActionButton,
-.spectrum-ActionButton--sizeM {
- --spectrum-actionbutton-sized-height: var(--spectrum-component-height-100);
- --spectrum-actionbutton-sized-icon-size: var(--spectrum-workflow-icon-size-100);
- --spectrum-actionbutton-sized-font-size: var(--spectrum-font-size-100);
- --spectrum-actionbutton-sized-text-to-visual: var(--spectrum-text-to-visual-100);
- --spectrum-actionbutton-sized-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-medium);
- --spectrum-actionbutton-sized-edge-to-visual: var(--spectrum-component-edge-to-visual-100);
- --spectrum-actionbutton-sized-edge-to-text: var(--spectrum-component-edge-to-text-100);
- --spectrum-actionbutton-sized-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-100);
-}
+ --spectrum-actionbutton-icon-size: var(--spectrum-workflow-icon-size-50);
+ --spectrum-actionbutton-font-size: var(--spectrum-font-size-50);
+ --spectrum-actionbutton-text-to-visual: var(--spectrum-text-to-visual-50);
+ --spectrum-actionbutton-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-extra-small);
+ --spectrum-actionbutton-edge-to-visual: var(--spectrum-component-edge-to-visual-50);
+ --spectrum-actionbutton-edge-to-text: var(--spectrum-component-edge-to-text-50);
+ --spectrum-actionbutton-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-50);
-.spectrum-ActionButton--sizeXS {
- --spectrum-actionbutton-sized-height: var(--spectrum-component-height-50);
- --spectrum-actionbutton-sized-icon-size: var(--spectrum-workflow-icon-size-50);
- --spectrum-actionbutton-sized-font-size: var(--spectrum-font-size-50);
- --spectrum-actionbutton-sized-text-to-visual: var(--spectrum-text-to-visual-50);
- --spectrum-actionbutton-sized-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-extra-small);
- --spectrum-actionbutton-sized-edge-to-visual: var(--spectrum-component-edge-to-visual-50);
- --spectrum-actionbutton-sized-edge-to-text: var(--spectrum-component-edge-to-text-50);
- --spectrum-actionbutton-sized-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-50);
+ --spectrum-actionbutton-downstate-perspective: var(--spectrum-component-size-minimum-perspective-down);
}
.spectrum-ActionButton--sizeS {
- --spectrum-actionbutton-sized-height: var(--spectrum-component-height-75);
- --spectrum-actionbutton-sized-icon-size: var(--spectrum-workflow-icon-size-75);
- --spectrum-actionbutton-sized-font-size: var(--spectrum-font-size-75);
- --spectrum-actionbutton-sized-text-to-visual: var(--spectrum-text-to-visual-75);
- --spectrum-actionbutton-sized-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-small);
- --spectrum-actionbutton-sized-edge-to-visual: var(--spectrum-component-edge-to-visual-75);
- --spectrum-actionbutton-sized-edge-to-text: var(--spectrum-component-edge-to-text-75);
- --spectrum-actionbutton-sized-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-75);
+ --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);
+
+ --spectrum-actionbutton-icon-size: var(--spectrum-workflow-icon-size-75);
+ --spectrum-actionbutton-font-size: var(--spectrum-font-size-75);
+ --spectrum-actionbutton-text-to-visual: var(--spectrum-text-to-visual-75);
+ --spectrum-actionbutton-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-small);
+ --spectrum-actionbutton-edge-to-visual: var(--spectrum-component-edge-to-visual-75);
+ --spectrum-actionbutton-edge-to-text: var(--spectrum-component-edge-to-text-75);
+ --spectrum-actionbutton-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-75);
+
+ --spectrum-actionbutton-downstate-perspective: var(--spectrum-component-size-minimum-perspective-down);
}
.spectrum-ActionButton--sizeL {
- --spectrum-actionbutton-sized-height: var(--spectrum-component-height-200);
- --spectrum-actionbutton-sized-icon-size: var(--spectrum-workflow-icon-size-200);
- --spectrum-actionbutton-sized-font-size: var(--spectrum-font-size-200);
- --spectrum-actionbutton-sized-text-to-visual: var(--spectrum-text-to-visual-200);
- --spectrum-actionbutton-sized-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-large);
- --spectrum-actionbutton-sized-edge-to-visual: var(--spectrum-component-edge-to-visual-200);
- --spectrum-actionbutton-sized-edge-to-text: var(--spectrum-component-edge-to-text-200);
- --spectrum-actionbutton-sized-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-200);
+ --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);
+
+ --spectrum-actionbutton-icon-size: var(--spectrum-workflow-icon-size-200);
+ --spectrum-actionbutton-font-size: var(--spectrum-font-size-200);
+ --spectrum-actionbutton-text-to-visual: var(--spectrum-text-to-visual-200);
+ --spectrum-actionbutton-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-large);
+ --spectrum-actionbutton-edge-to-visual: var(--spectrum-component-edge-to-visual-200);
+ --spectrum-actionbutton-edge-to-text: var(--spectrum-component-edge-to-text-200);
+ --spectrum-actionbutton-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-200);
}
.spectrum-ActionButton--sizeXL {
- --spectrum-actionbutton-sized-height: var(--spectrum-component-height-300);
- --spectrum-actionbutton-sized-icon-size: var(--spectrum-workflow-icon-size-300);
- --spectrum-actionbutton-sized-font-size: var(--spectrum-font-size-300);
- --spectrum-actionbutton-sized-text-to-visual: var(--spectrum-text-to-visual-300);
- --spectrum-actionbutton-sized-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-extra-large);
- --spectrum-actionbutton-sized-edge-to-visual: var(--spectrum-component-edge-to-visual-300);
- --spectrum-actionbutton-sized-edge-to-text: var(--spectrum-component-edge-to-text-300);
- --spectrum-actionbutton-sized-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-300);
+ --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);
+
+ --spectrum-actionbutton-icon-size: var(--spectrum-workflow-icon-size-300);
+ --spectrum-actionbutton-font-size: var(--spectrum-font-size-300);
+ --spectrum-actionbutton-text-to-visual: var(--spectrum-text-to-visual-300);
+ --spectrum-actionbutton-edge-to-hold-icon: var(--spectrum-action-button-edge-to-hold-icon-extra-large);
+ --spectrum-actionbutton-edge-to-visual: var(--spectrum-component-edge-to-visual-300);
+ --spectrum-actionbutton-edge-to-text: var(--spectrum-component-edge-to-text-300);
+ --spectrum-actionbutton-edge-to-visual-only: var(--spectrum-component-edge-to-visual-only-300);
}
.spectrum-ActionButton {
- /* Variables leveraging t-shirt sizing */
- --spectrum-actionbutton-height: var(--mod-actionbutton-height, var(--spectrum-actionbutton-sized-height));
- --spectrum-actionbutton-icon-size: var(--mod-actionbutton-icon-size, var(--spectrum-actionbutton-sized-icon-size));
- --spectrum-actionbutton-font-size: var(--mod-actionbutton-font-size, var(--spectrum-actionbutton-sized-font-size));
- --spectrum-actionbutton-text-to-visual: var(--mod-actionbutton-text-to-visual, var(--spectrum-actionbutton-sized-text-to-visual));
- --spectrum-actionbutton-edge-to-hold-icon: var(--mod-actionbutton-edge-to-hold-icon, var(--spectrum-actionbutton-sized-edge-to-hold-icon));
+ cursor: pointer;
+ user-select: none;
- --spectrum-actionbutton-edge-to-visual: var(--mod-actionbutton-edge-to-visual, calc(var(--spectrum-actionbutton-sized-edge-to-visual) - var(--spectrum-actionbutton-border-width)));
- --spectrum-actionbutton-edge-to-text: var(--mod-actionbutton-edge-to-text, calc(var(--spectrum-actionbutton-sized-edge-to-text) - var(--spectrum-actionbutton-border-width)));
- --spectrum-actionbutton-edge-to-visual-only: var(--mod-actionbutton-edge-to-visual-only, calc(var(--spectrum-actionbutton-sized-edge-to-visual-only) - var(--spectrum-actionbutton-border-width)));
+ /* Contain halo */
+ position: relative;
- @extend %spectrum-BaseButton;
+ /* Show the button overflow in Edge. */
+ overflow: visible;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
- position: relative;
+ box-sizing: border-box;
+
+ /* Remove button the margin in Firefox and Safari. */
+ margin: 0;
+
+ font-family: var(--mod-button-font-family, var(--spectrum-sans-font-family-stack));
+
+ /* Adjacent buttons should be aligned correctly */
+ vertical-align: top;
- min-inline-size: var(--mod-actionbutton-min-width, calc(var(--mod-actionbutton-edge-to-visual-only, var(--spectrum-actionbutton-sized-edge-to-visual-only)) * 2 + var(--spectrum-actionbutton-icon-size)));
- block-size: var(--spectrum-actionbutton-height);
+ -webkit-font-smoothing: antialiased;
- border-radius: var(--spectrum-actionbutton-border-radius);
+ /* Font smoothing for Firefox */
+ -moz-osx-font-smoothing: grayscale;
+ text-decoration: none;
+
+ /* Remove the inheritance of text transform on button in Edge, Firefox, and IE. */
+ text-transform: none;
+
+ /* stylelint-disable-next-line property-no-vendor-prefix -- Correct the inability to style clickable types in iOS and Safari (normalize). */
+ -webkit-appearance: button;
+
+ transition:
+ background var(--mod-button-animation-duration, var(--spectrum-animation-duration-100)) ease-out,
+ border-color var(--mod-button-animation-duration, var(--spectrum-animation-duration-100)) ease-out,
+ color var(--mod-button-animation-duration, var(--spectrum-animation-duration-100)) ease-out,
+ box-shadow var(--mod-button-animation-duration, var(--spectrum-animation-duration-100)) ease-out;
+
+ min-inline-size: var(--mod-actionbutton-min-width, var(--spectrum-actionbutton-min-width));
+ block-size: var(--mod-actionbutton-height, var(--spectrum-actionbutton-height));
+ line-height: var(--mod-actionbutton-line-height, var(--spectrum-actionbutton-line-height));
+
+ border-radius: var(--mod-actionbutton-border-radius, var(--spectrum-actionbutton-border-radius));
border-width: var(--spectrum-actionbutton-border-width);
+ border-color: var(--highcontrast-actionbutton-border-color, var(--spectrum-actionbutton-border-color));
+ border-style: solid;
- gap: calc(var(--spectrum-actionbutton-text-to-visual) + var(--spectrum-actionbutton-edge-to-text) - var(--spectrum-actionbutton-edge-to-visual-only));
+ gap: var(--mod-actionbutton-text-to-visual, var(--spectrum-actionbutton-text-to-visual));
+ padding-inline: calc(var(--mod-actionbutton-edge-to-text, var(--spectrum-actionbutton-edge-to-text)) - var(--spectrum-actionbutton-border-width));
- /* Start with text-only padding */
- padding-inline: var(--spectrum-actionbutton-edge-to-text);
+ background-color: var(--highcontrast-actionbutton-background-color-default, var(--mod-actionbutton-background-color-default, var(--spectrum-actionbutton-background-color-default)));
+ color: var(--highcontrast-actionbutton-content-color-default, var(--mod-actionbutton-content-color-default, var(--spectrum-actionbutton-content-color-default)));
- background-color: var(--spectrum-actionbutton-background-color);
- border-color: var(--spectrum-actionbutton-border-color);
- color: var(--spectrum-actionbutton-content-color);
+ /* Fix Firefox */
+ &::-moz-focus-inner {
+ margin-block-start: -2px;
+ margin-block-end: -2px;
+ padding: 0;
+ border: 0;
- transition: border-color var(--mod-actionbutton-animation-duration, var(--spectrum-animation-duration-100)) ease-in-out;
+ /* Remove the inner border and padding for button in Firefox. */
+ border-style: none;
+ }
&::after {
position: absolute;
inset: 0;
-
margin: calc((var(--spectrum-actionbutton-focus-indicator-gap) + var(--spectrum-actionbutton-border-width)) * -1);
+ border-radius: var(--spectrum-actionbutton-focus-indicator-border-radius);
+ transition: box-shadow var(--highcontrast-actionbutton-animation-duration, var(--spectrum-actionbutton-animation-duration)) ease-in-out;
+ pointer-events: none;
+ content: "";
+ }
- border-radius: var(--mod-actionbutton-focus-indicator-border-radius, calc(var(--spectrum-actionbutton-border-radius) + var(--spectrum-actionbutton-focus-indicator-gap)));
+ &:focus {
+ outline: none;
+ }
- transition: box-shadow var(--mod-actionbutton-animation-duration, var(--spectrum-animation-duration-100)) ease-in-out;
+ &:disabled,
+ &.is-disabled {
+ cursor: default;
+ }
- pointer-events: none;
- content: "";
+ &:hover {
+ background-color: var(--highcontrast-actionbutton-background-color-default, var(--mod-actionbutton-background-color-hover, var(--spectrum-actionbutton-background-color-hover)));
+ color: var(--highcontrast-actionbutton-content-color-default, var(--mod-actionbutton-content-color-hover, var(--spectrum-actionbutton-content-color-hover)));
}
&:focus-visible {
- /* kill the default ring */
+ background-color: var(--highcontrast-actionbutton-background-color-default, var(--mod-actionbutton-background-color-focus, var(--spectrum-actionbutton-background-color-focus)));
+ color: var(--highcontrast-actionbutton-content-color-default, var(--mod-actionbutton-content-color-focus, var(--spectrum-actionbutton-content-color-focus)));
+
box-shadow: none;
outline: none;
&::after {
- box-shadow: 0 0 0 var(--spectrum-actionbutton-focus-indicator-thickness) var(--spectrum-actionbutton-focus-indicator-color);
+ box-shadow: 0 0 0 var(--spectrum-actionbutton-focus-indicator-thickness) var(--highcontrast-actionbutton-focus-indicator-color, var(--spectrum-actionbutton-focus-indicator-color));
}
}
+
+ &:active {
+ background-color: var(--highcontrast-actionbutton-background-color-default, var(--mod-actionbutton-background-color-down, var(--spectrum-actionbutton-background-color-down)));
+ color: var(--highcontrast-actionbutton-content-color-default, var(--mod-actionbutton-content-color-down, var(--spectrum-actionbutton-content-color-down)));
+ transform: perspective(var(--spectrum-actionbutton-downstate-perspective)) translateZ(var(--spectrum-component-size-difference-down));
+ }
+
+ /* ideal when we want to disable the button but still allow its content to be focused */
+ &:is(:disabled, .is-disabled, [aria-disabled="true"]) {
+ background-color: var(--highcontrast-actionbutton-background-color-disabled, var(--mod-actionbutton-background-color-disabled, var(--spectrum-actionbutton-background-color-disabled)));
+ color: var(--highcontrast-actionbutton-content-color-disabled, var(--mod-actionbutton-content-color-disabled, var(--spectrum-actionbutton-content-color-disabled)));
+ }
}
a.spectrum-ActionButton {
- @extend %spectrum-AnchorButton;
+ /* Make link text not selectable */
+ user-select: none;
+
+ /* stylelint-disable-next-line property-no-vendor-prefix -- Remove appearance for clickable types in iOS and Safari. */
+ -webkit-appearance: none;
}
-/* Nested sub-component: Icon */
.spectrum-ActionButton-icon {
- @extend %spectrum-ButtonIcon;
-
- inline-size: var(--spectrum-actionbutton-icon-size);
- block-size: var(--spectrum-actionbutton-icon-size);
-
- /* adjust icon positioning to match UI kit */
- margin-inline-start: calc(var(--spectrum-actionbutton-edge-to-visual) - var(--spectrum-actionbutton-edge-to-text));
- margin-inline-end: calc(var(--spectrum-actionbutton-edge-to-visual-only) - var(--spectrum-actionbutton-edge-to-text));
+ flex-shrink: 0;
+ max-block-size: 100%;
+ inline-size: var(--mod-actionbutton-icon-size, var(--spectrum-actionbutton-icon-size));
+ block-size: var(--mod-actionbutton-icon-size, var(--spectrum-actionbutton-icon-size));
color: inherit;
+}
- /* Augment the margin correction for the icon only scenario */
- .spectrum-ActionButton-hold + &,
- &:only-child {
- margin-inline-start: calc(var(--spectrum-actionbutton-edge-to-visual-only) - var(--spectrum-actionbutton-edge-to-text));
- }
+/* Icon and label text */
+.spectrum-ActionButton:has(.spectrum-ActionButton-icon) {
+ padding-inline-start: calc(var(--mod-actionbutton-edge-to-visual, var(--spectrum-actionbutton-edge-to-visual)) - var(--spectrum-actionbutton-border-width));
+}
+
+/* Icon only */
+.spectrum-ActionButton:not(:has(.spectrum-ActionButton-label)) {
+ padding-inline: calc(var(--mod-actionbutton-edge-to-visual-only, var(--spectrum-actionbutton-edge-to-visual-only)) - var(--spectrum-actionbutton-border-width));
}
.spectrum-ActionButton-label {
- @extend %spectrum-ButtonLabel;
+ align-self: center;
+ justify-self: center;
+
+ /* Fixes horizontal alignment of text in anchor buttons */
+ text-align: center;
+
pointer-events: none;
- line-height: var(--spectrum-actionbutton-height);
- font-size: var(--spectrum-actionbutton-font-size);
+ font-size: var(--mod-actionbutton-font-size, var(--spectrum-actionbutton-font-size));
+ font-weight: var(--mod-actionbutton-font-weight, var(--spectrum-actionbutton-font-weight));
+ font-style: var(--mod-actionbutton-font-style, var(--spectrum-actionbutton-font-style));
white-space: nowrap;
color: var(--mod-actionbutton-label-color, inherit);
text-overflow: ellipsis;
overflow: hidden;
+
+ &:empty {
+ display: none;
+ }
}
.spectrum-ActionButton-hold {
position: absolute;
- inset-inline-end: calc(var(--spectrum-actionbutton-edge-to-hold-icon) - var(--spectrum-actionbutton-border-width));
- inset-block-end: calc(var(--spectrum-actionbutton-edge-to-hold-icon) - var(--spectrum-actionbutton-border-width));
-
+ inset-inline-end: calc(var(--mod-actionbutton-edge-to-hold-icon, var(--spectrum-actionbutton-edge-to-hold-icon)) - var(--spectrum-actionbutton-border-width));
+ inset-block-end: calc(var(--mod-actionbutton-edge-to-hold-icon, var(--spectrum-actionbutton-edge-to-hold-icon)) - var(--spectrum-actionbutton-border-width));
+ display: block;
color: inherit;
+ transform: var(--spectrum-logical-rotation);
+}
- transform: var(--spectrum-logical-rotation,);
+@media (forced-colors: active) {
+ .spectrum-ActionButton {
+ /**
+ * Default
+ * - Uses "Button*" system color pairings.
+ * - Focus indicator is outside the element and should contrast with its background (default of Canvas).
+ */
+ --highcontrast-actionbutton-border-color: ButtonBorder;
+ --highcontrast-actionbutton-background-color-default: ButtonFace;
+ --highcontrast-actionbutton-content-color-default: ButtonText;
+
+ --highcontrast-actionbutton-background-color-disabled: ButtonFace;
+ --highcontrast-actionbutton-content-color-disabled: GrayText;
+
+ --highcontrast-actionbutton-focus-indicator-color: CanvasText;
+
+ /**
+ * Avoid performance and rendering issues with transitions between system colors.
+ * Fixes bug in Windows High Contrast where border flashes the wrong color after hover (quiet).
+ */
+ --highcontrast-actionbutton-animation-duration: 0;
+
+ &::after {
+ /* Make sure the box-shadow for the focus indicator renders. */
+ forced-color-adjust: none;
+ }
+
+ .spectrum-ActionButton-icon,
+ .spectrum-ActionButton-hold,
+ .spectrum-ActionButton-label {
+ /* Removes the extra unwanted background on label ("readability backplate") that can cause text to be unreadable. */
+ forced-color-adjust: none;
+ }
+
+ /**
+ * Quiet
+ * - Default blends in with background and has no border.
+ * - Quiet + disabled does not show border unless selected.
+ */
+ &.spectrum-ActionButton--quiet {
+ --highcontrast-actionbutton-border-color: Canvas;
+ --highcontrast-actionbutton-background-color-default: Canvas;
+ --highcontrast-actionbutton-background-color-disabled: Canvas;
+ --highcontrast-actionbutton-content-color-default: CanvasText;
+
+ &:is(:disabled, .is-disabled, [aria-disabled="true"]):not(:where(.is-selected, [aria-pressed="true"], [aria-expanded="true"])) {
+ --highcontrast-actionbutton-border-color: Canvas;
+ }
+ }
+
+ /* Interaction shows a change in border color. */
+ &:hover,
+ &:active,
+ &:focus-visible {
+ --highcontrast-actionbutton-border-color: Highlight;
+ }
+
+ &:is(.is-selected, [aria-pressed="true"], [aria-expanded="true"]) {
+ --highcontrast-actionbutton-border-color: Highlight;
+ --highcontrast-actionbutton-background-color-default: Highlight;
+ --highcontrast-actionbutton-content-color-default: HighlightText;
+ }
+
+ /* Disabled has a GrayText border and content color. */
+ &:disabled {
+ --highcontrast-actionbutton-border-color: GrayText;
+ }
+ }
}
diff --git a/components/actionbutton/package.json b/components/actionbutton/package.json
index 400dfbfcaa8..09f5a7dfafd 100644
--- a/components/actionbutton/package.json
+++ b/components/actionbutton/package.json
@@ -1,6 +1,6 @@
{
"name": "@spectrum-css/actionbutton",
- "version": "7.2.0",
+ "version": "8.0.0-next.4",
"description": "The Spectrum CSS action button component",
"license": "Apache-2.0",
"author": "Adobe",
@@ -19,15 +19,13 @@
"./package.json": "./package.json",
"./dist/*": "./dist/*",
"./index.css": "./dist/index.css",
- "./index-*.css": "./dist/index-*.css",
"./metadata.json": "./dist/metadata.json",
- "./themes/*": "./dist/themes/*",
"./stories/*": "./stories/*"
},
"main": "dist/index.css",
"peerDependencies": {
- "@spectrum-css/icon": ">=9.0.0 <10.0.0",
- "@spectrum-css/tokens": ">=16.0.0 <17.0.0"
+ "@spectrum-css/icon": ">=10.0.0-next.0",
+ "@spectrum-css/tokens": ">=16.1.0-next.0"
},
"peerDependenciesMeta": {
"@spectrum-css/icon": {
@@ -38,9 +36,8 @@
}
},
"devDependencies": {
- "@spectrum-css/commons": "11.1.0",
- "@spectrum-css/icon": "9.2.0",
- "@spectrum-css/tokens": "16.0.2"
+ "@spectrum-css/icon": "10.0.0-next.3",
+ "@spectrum-css/tokens": "16.1.0-next.10"
},
"keywords": [
"design-system",
diff --git a/components/actionbutton/stories/actionbutton.stories.js b/components/actionbutton/stories/actionbutton.stories.js
index a08f0f7bbfc..fb5fc92084b 100644
--- a/components/actionbutton/stories/actionbutton.stories.js
+++ b/components/actionbutton/stories/actionbutton.stories.js
@@ -1,22 +1,20 @@
import { default as IconStories } from "@spectrum-css/icon/stories/icon.stories.js";
-import { Sizes } from "@spectrum-css/preview/decorators";
+import { Sizes, withDownStateDimensionCapture } from "@spectrum-css/preview/decorators";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
-import { isActive, isDisabled, isEmphasized, isFocused, isHovered, isQuiet, isSelected, size, staticColor } from "@spectrum-css/preview/types";
+import { isActive, isDisabled, isEmphasized, isFocused, isHovered, isOpen, isQuiet, isSelected, size, staticColor } from "@spectrum-css/preview/types";
+import { ActionButtonGroup } from "./actionbutton.test.js";
+import { ActionButtonsWithIconOptions, IconOnlyOption, Template, TreatmentTemplate } from "./template.js";
+
+// Local assets to render the component styles and structure
import metadata from "../dist/metadata.json";
import packageJson from "../package.json";
-import { ActionButtonGroup } from "./actionbutton.test.js";
-import { ActionButtonsWithIconOptions, IconOnlyOption, TreatmentTemplate } from "./template.js";
/**
* The action button component represents an action a user can take.
*
* ## Usage notes
*
- * For action buttons that only contain an icon with no label, do not include the element with the `.spectrum-ActionButton-label` class in the markup. If an icon and a label are both used, ensure that the element with the `.spectrum-ActionButton-label` class comes after the `.spectrum-Icon` element.
- *
- * If the hold icon is used, ensure that the element with the `.spectrum-ActionButton-hold` class comes before the `.spectrum-Icon` element.
- *
- * When using `.spectrum-ActionButton--staticWhite` or `.spectrum-ActionButton--staticBlack`, use the `--mod-actionbutton-content-color-default` custom property to set the text color when selected.
+ * For action buttons that only contain an icon with no label, do not include the element with the `.spectrum-ActionButton-label` class in the markup.
*/
export default {
title: "Action button",
@@ -25,6 +23,7 @@ export default {
size: size(["xs", "s", "m", "l", "xl"]),
iconName: {
...(IconStories?.argTypes?.iconName ?? {}),
+ name: "Workflow icon",
if: false,
},
label: {
@@ -37,9 +36,15 @@ export default {
control: { type: "text" },
},
isQuiet,
- isEmphasized,
+ isEmphasized: {
+ ...isEmphasized,
+ if: { arg: "staticColor", truthy: false },
+ },
isDisabled,
- isSelected,
+ isSelected: {
+ ...isSelected,
+ description: "An optional state used when treating the action button as a toggle.",
+ },
isHovered,
isFocused,
isActive,
@@ -53,8 +58,8 @@ export default {
control: "boolean",
},
hasPopup: {
- name: "Has popup",
- description: "If the button triggers a popup action, this should be set to reflect the type of element that pops-up.",
+ name: "Has pop-up",
+ description: "If the button triggers a popover element to open, this should be set to reflect the semantic type of that element.",
type: { name: "string" },
table: {
type: { summary: "string" },
@@ -63,7 +68,26 @@ export default {
control: "select",
options: ["true", "menu", "listbox", "tree", "grid", "dialog", "false"],
},
- staticColor,
+ hasLongPress: {
+ name: "Long press",
+ description: "If the trigger supports a long-press action which triggers the menu, this should be set to true.",
+ type: { name: "boolean" },
+ table: {
+ type: { summary: "boolean" },
+ category: "Accessibility",
+ },
+ control: "boolean",
+ },
+ isOpen: {
+ ...isOpen,
+ name: "Popover open",
+ description: "This should be true when the popover element is open.",
+ if: { arg: "hasPopup", truthy: true },
+ },
+ staticColor: {
+ ...staticColor,
+ if: { arg: "isEmphasized", truthy: false },
+ },
},
args: {
rootClass: "spectrum-ActionButton",
@@ -71,6 +95,7 @@ export default {
isQuiet: false,
isEmphasized: false,
hasPopup: "false",
+ hasLongPress: false,
isActive: false,
isFocused: false,
isHovered: false,
@@ -82,20 +107,30 @@ export default {
},
parameters: {
actions: {
- handles: ["click .spectrum-ActionButton:not([disabled])"],
+ handles: ["click .spectrum-ActionButton:not([disabled])", "mousedown .spectrum-ActionButton:not([disabled])", "mouseup .spectrum-ActionButton:not([disabled])", "touchstart .spectrum-ActionButton:not([disabled])", "touchend .spectrum-ActionButton:not([disabled])"],
},
design: {
type: "figma",
url: "https://www.figma.com/design/Mngz9H7WZLbrCvGQf3GnsY/S2-%2F-Desktop?node-id=702-2877",
},
+ downState: {
+ selectors: [".spectrum-ActionButton:not(:disabled)"],
+ },
packageJson,
metadata,
docs: {
story: {
height: "auto",
},
- }
+ },
+ status: {
+ type: "migrated",
+ },
},
+ decorators: [
+ withDownStateDimensionCapture,
+ ],
+ tags: ["migrated"],
};
export const Default = ActionButtonGroup.bind({});
@@ -106,7 +141,9 @@ Default.tags = ["!autodocs"];
/**
* Action buttons should always have a label, unless they are only using an icon that is universally understood and accessible. They can have an optional icon, but it should not be used for decoration. Use an icon only when necessary and when it has a strong association with the label text.
*
- * The label can be hidden to create an icon-only action button. If the label is hidden, an icon is required, and the label will appear in a tooltip on hover.
+ * The label can be hidden to create an icon-only action button. If the label is hidden, an icon is required, and the implementation should show the label with a tooltip on hover.
+ *
+ * Action buttons can be used as toggles instead of for taking direct action. The optional "selected" state displayed below is used for when the action button is toggleable.
*/
export const Standard = TreatmentTemplate.bind({});
Standard.args = Default.args;
@@ -117,7 +154,9 @@ Standard.parameters = {
Standard.storyName = "Default";
/**
- * The emphasized action button has a blue background for its selected state in order to provide a visual prominence. This is optimal for when the selection should call attention, such as within a tool bar.
+ * The emphasized action button has a blue background for its selected state in order to provide a visual prominence.
+ * This is optimal for when the selection should call attention, such as within a tool bar.
+ * For this variant, the `.spectrum-ActionButton--emphasized` class is applied to `.spectrum-ActionButton`.
*/
export const Emphasized = TreatmentTemplate.bind({});
Emphasized.tags = ["!dev"];
@@ -130,9 +169,6 @@ Emphasized.parameters = {
},
};
-/**
- * Adding the `.spectrum-ActionButton--emphasized` class to a quiet action button can be effective in calling attention.
- */
export const EmphasizedQuiet = TreatmentTemplate.bind({});
EmphasizedQuiet.tags = ["!dev"];
EmphasizedQuiet.args = {
@@ -144,7 +180,7 @@ EmphasizedQuiet.parameters = {
disableSnapshot: true,
},
};
-EmphasizedQuiet.storyName = "Emphasized (quiet)";
+EmphasizedQuiet.storyName = "Quiet, emphasized";
/**
* Quiet action buttons have no visible background until they’re interacted with. This style works best when a clear layout (vertical stack, table, grid) makes it easy to parse the buttons. Too many quiet components in a small space can be hard to read.
@@ -161,7 +197,10 @@ Quiet.parameters = {
};
/**
- * An action button can have a hold icon (a small corner triangle). This icon indicates that holding down the action button for a short amount of time can reveal a popover menu, which can be used, for example, to switch between related actions. Because of the way padding is calculated, the hold icon must be placed before the workflow icon in the markup.
+ * An action button can have a hold icon (a small corner triangle). This icon indicates that holding down the action button for a
+ * short amount of time (currently the standard is 300ms) can reveal a [popover](/docs/components-popover--docs) menu, which can be used, for example, to switch
+ * between related actions. Note that this popover menu is not demonstrated here; this would be handled by the implementation.
+ * Because of the way padding is calculated, the hold icon must be placed before the workflow icon in the markup.
*/
export const HoldIcon = IconOnlyOption.bind({});
HoldIcon.tags = ["!dev"];
@@ -190,6 +229,14 @@ StaticWhiteQuiet.parameters = {
chromatic: { disableSnapshot: true }
};
+/**
+ * When an action button needs to be placed on top of a color background or a visual, use the static color
+ * option. Use static black on light color or image backgrounds, and static white on dark color or image
+ * backgrounds, regardless of the color theme. For more info, see the
+ * [design guidelines](https://spectrum.adobe.com/page/action-button/#Static-color).
+ *
+ * Emphasized is not supported for the static black and static white variants.
+ */
export const StaticBlackDocs = TreatmentTemplate.bind({});
StaticBlackDocs.tags = ["!dev"];
StaticBlackDocs.args = {
@@ -226,6 +273,28 @@ Sizing.parameters = {
chromatic: { disableSnapshot: true },
};
+/**
+ * When the action button text is too long for the available horizontal space, it truncates at the end.
+ * To demonstrate what this looks like, this example sets a maximum width on the button.
+ *
+ * Implementations should also reveal the full text on hover, per this component's
+ * [design guidelines on text overflow](https://spectrum.adobe.com/page/action-button/#Text-overflow).
+ * This is not demonstrated here.
+ */
+export const TextOverflowBehavior = Template.bind({});
+TextOverflowBehavior.tags = ["!dev"];
+TextOverflowBehavior.args = {
+ label: "This is extra long text that will cause text truncation",
+ customStyles: {
+ "max-inline-size": "120px",
+ },
+};
+TextOverflowBehavior.parameters = {
+ chromatic: {
+ disableSnapshot: true,
+ },
+};
+
// ********* VRT ONLY ********* //
export const WithForcedColors = ActionButtonGroup.bind({});
WithForcedColors.args = Default.args;
diff --git a/components/actionbutton/stories/actionbutton.test.js b/components/actionbutton/stories/actionbutton.test.js
index fb37fdc910f..7e65e449655 100644
--- a/components/actionbutton/stories/actionbutton.test.js
+++ b/components/actionbutton/stories/actionbutton.test.js
@@ -17,12 +17,14 @@ export const ActionButtons = (args, context) => {
${Template({
...args,
hasPopup: "true",
+ hasLongPress: true,
hideLabel: true,
}, context)}
${Template({
...args,
iconName: undefined,
hasPopup: "true",
+ hasLongPress: true,
}, context)}
`;
@@ -62,11 +64,6 @@ export const ActionButtonGroup = Variants({
testHeading: "Static black",
staticColor: "black",
},
- {
- testHeading: "Static black - emphasized",
- staticColor: "black",
- isEmphasized: true,
- },
{
testHeading: "Static black - quiet",
staticColor: "black",
@@ -76,11 +73,6 @@ export const ActionButtonGroup = Variants({
testHeading: "Static white",
staticColor: "white",
},
- {
- testHeading: "Static white - emphasized",
- staticColor: "white",
- isEmphasized: true,
- },
{
testHeading: "Static white - quiet",
staticColor: "white",
diff --git a/components/actionbutton/stories/template.js b/components/actionbutton/stories/template.js
index 425b7e4115c..a45b497b476 100644
--- a/components/actionbutton/stories/template.js
+++ b/components/actionbutton/stories/template.js
@@ -7,9 +7,6 @@ import { when } from "lit/directives/when.js";
import { capitalize } from "lodash-es";
import "../index.css";
-import "../themes/spectrum.css";
-/* Must be imported last */
-import "../themes/express.css";
/**
* @todo load order should not influence the icon size but it is; fix this
@@ -57,7 +54,9 @@ export const Template = ({
isFocused = false,
isActive = false,
isDisabled = false,
+ isOpen = false,
hasPopup = "false",
+ hasLongPress = false,
popupId,
hideLabel = false,
staticColor,
@@ -76,7 +75,8 @@ export const Template = ({
aria-label=${ifDefined(hideLabel ? label : undefined)}
aria-haspopup=${ifDefined(hasPopup && hasPopup !== "false" ? hasPopup : undefined)}
aria-controls=${hasPopup && hasPopup !== "false" ? popupId : undefined}
- aria-pressed=${isSelected ? "true" : "false"}
+ aria-pressed=${ifDefined(isSelected ? "true" : undefined)}
+ aria-expanded=${ifDefined(hasPopup && hasPopup !== "false" ? isOpen ? "true" : "false" : undefined)}
class=${classMap({
[rootClass]: true,
[`${rootClass}--size${size?.toUpperCase()}`]:
@@ -86,7 +86,6 @@ export const Template = ({
[`${rootClass}--static${capitalize(staticColor)}`]:
typeof staticColor !== "undefined",
["is-disabled"]: isDisabled,
- ["is-selected"]: isSelected,
["is-hover"]: isHovered,
["is-focus-visible"]: isFocused,
["is-active"]: isActive,
@@ -94,25 +93,37 @@ export const Template = ({
})}
id=${id}
data-testid=${testId ?? id}
+ popovertarget=${ifDefined(hasPopup && hasPopup !== "false" ? popupId : undefined)}
role=${ifDefined(role)}
style=${styleMap(customStyles)}
?disabled=${isDisabled}
- @click=${onclick ?? function() {
- updateArgs({
- isSelected: !isSelected
- });
+ @click=${function () {
+ if (isDisabled) return;
+ if (typeof onclick === "function") onclick();
+ else {
+ updateArgs({
+ isSelected: !isSelected,
+ isOpen: !isOpen,
+ });
+ }
}}
- @focusin=${function() {
+ @focusin=${function () {
updateArgs({ isFocused: true });
}}
@focusout=${function() {
updateArgs({ isFocused: false });
}}
>
- ${when(hasPopup && hasPopup !== "false", () =>
+ ${when(hasLongPress && hasPopup && hasPopup !== "false", () =>
Icon({
size,
- iconName: "CornerTriangle",
+ iconName: "CornerTriangle" + ({
+ xs: "75",
+ s: "75",
+ m: "100",
+ l: "200",
+ xl: "300",
+ }[size] || "100"),
setName: "ui",
customClasses: [`${rootClass}-hold`],
}, context)
@@ -134,64 +145,78 @@ export const Template = ({
`;
};
+/**
+ * Displays multiple action buttons in a row, with different combinations of
+ * label, icon, and hold button (has pop-up).
+ */
export const ActionButtonsWithIconOptions = (args, context) => Container({
withBorder: false,
direction: "row",
wrapperStyles: {
columnGap: "12px",
},
- content: html`
- ${Template({
+ content: [
+ Template({
...args,
iconName: undefined,
- }, context)}
- ${Template({
+ }, context),
+ Template({
...args,
- }, context)}
- ${Template({
+ }, context),
+ Template({
...args,
hideLabel: true,
- }, context)}
- ${Template({
+ }, context),
+ Template({
...args,
hideLabel: true,
hasPopup: "true",
- }, context)}
- ${Template({
+ hasLongPress: true,
+ }, context),
+ Template({
...args,
iconName: undefined,
hasPopup: "true",
- }, context)}
- `
+ hasLongPress: true,
+ }, context)
+ ],
}, context);
+/**
+ * Displays two action buttons in a row:
+ * - icon only action button
+ * - icon only action button with hold button (has pop-up)
+ */
export const IconOnlyOption = (args, context) => Container({
withBorder: false,
direction: "row",
wrapperStyles: {
columnGap: "12px",
},
- content: html`
- ${Template({
+ content: [
+ Template({
...args,
hideLabel: true,
hasPopup: "true",
- }, context)}
- ${Template({
+ hasLongPress: true,
+ }, context),
+ Template({
...args,
hideLabel: true,
isQuiet: true,
hasPopup: "true",
- }, context)}
- `
+ hasLongPress: true,
+ }, context),
+ ],
}, context);
+/**
+ * Displays multiple groups of action buttons for:
+ * default, selected, disabled, and selected + disabled
+ */
export const TreatmentTemplate = (args, context) => Container({
withBorder: false,
direction: "row",
- wrapperStyles: {
- rowGap: "12px",
- },
content: html`${[
{ isSelected: false, isDisabled: false, heading: "Default" },
{ isSelected: true, isDisabled: false, heading: "Selected" },
@@ -200,10 +225,13 @@ export const TreatmentTemplate = (args, context) => Container({
].map(({ isSelected, isDisabled, heading }) => Container({
withBorder: false,
heading: heading,
+ containerStyles: {
+ rowGap: "8px",
+ },
content: ActionButtonsWithIconOptions({
...args,
isSelected,
isDisabled,
- })
+ }, context)
}, context))}`,
}, context);
diff --git a/components/actionbutton/themes/express.css b/components/actionbutton/themes/express.css
deleted file mode 100644
index be6353eb9cd..00000000000
--- a/components/actionbutton/themes/express.css
+++ /dev/null
@@ -1,77 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--express */
-
-@import "./spectrum.css";
-
-@container style(--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-down: var(--spectrum-gray-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-300);
- --spectrum-actionbutton-background-color-disabled: var(--spectrum-gray-200);
-
- --spectrum-actionbutton-border-color-default: transparent;
- --spectrum-actionbutton-border-color-hover: transparent;
- --spectrum-actionbutton-border-color-down: transparent;
- --spectrum-actionbutton-border-color-focus: transparent;
- --spectrum-actionbutton-border-color-disabled: transparent;
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-gray-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-gray-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-300);
- }
-
- &.spectrum-ActionButton--staticBlack,
- &.spectrum-ActionButton--staticWhite {
- --spectrum-actionbutton-border-color-default: transparent;
- --spectrum-actionbutton-border-color-hover: transparent;
- --spectrum-actionbutton-border-color-down: transparent;
- --spectrum-actionbutton-border-color-focus: transparent;
- }
-
- &.spectrum-ActionButton--staticBlack {
- --spectrum-actionbutton-background-color-disabled: transparent;
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-300);
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-300);
- }
- }
-
- &.spectrum-ActionButton--staticWhite {
- --spectrum-actionbutton-background-color-disabled: transparent;
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-300);
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-300);
- }
- }
- }
-}
diff --git a/components/actionbutton/themes/spectrum-two.css b/components/actionbutton/themes/spectrum-two.css
deleted file mode 100644
index b436e9a77b5..00000000000
--- a/components/actionbutton/themes/spectrum-two.css
+++ /dev/null
@@ -1,112 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-@container style(--system: spectrum) {
- .spectrum-ActionButton {
- --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-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
- --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-background-color);
-
- --spectrum-actionbutton-background-color-selected: var(--spectrum-neutral-background-color-selected-default);
- --spectrum-actionbutton-background-color-selected-hover: var(--spectrum-neutral-background-color-selected-hover);
- --spectrum-actionbutton-background-color-selected-down: var(--spectrum-neutral-background-color-selected-down);
- --spectrum-actionbutton-background-color-selected-focus: var(--spectrum-neutral-background-color-selected-key-focus);
-
- --spectrum-actionbutton-border-color-default: transparent;
- --spectrum-actionbutton-border-color-hover: transparent;
- --spectrum-actionbutton-border-color-down: transparent;
- --spectrum-actionbutton-border-color-focus: transparent;
- --spectrum-actionbutton-border-color-disabled: transparent;
-
- --spectrum-actionbutton-content-color-selected: var(--spectrum-gray-50);
-
- &.spectrum-ActionButton--sizeM {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-medium-size-medium);
- }
-
- &.spectrum-ActionButton--sizeXS {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-medium-size-extra-small);
- }
-
- &.spectrum-ActionButton--sizeS {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-medium-size-small);
- }
-
- &.spectrum-ActionButton--sizeL {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-medium-size-large);
- }
-
- &.spectrum-ActionButton--sizeXL {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-medium-size-extra-large);
- }
-
- &.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-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-gray-200);
- --spectrum-actionbutton-background-color-disabled: transparent;
- --spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-disabled-background-color);
- }
-
- &.spectrum-ActionButton--staticBlack {
- --spectrum-actionbutton-border-color-default: transparent;
- --spectrum-actionbutton-border-color-hover: transparent;
- --spectrum-actionbutton-border-color-down: transparent;
- --spectrum-actionbutton-border-color-focus: transparent;
- --spectrum-actionbutton-border-color-disabled: transparent;
-
- --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-black-background-color);
- --spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-disabled-static-black-background-color);
-
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-black-100);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-200);
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-200);
- --spectrum-actionbutton-background-color-disabled: transparent;
- }
- }
-
- &.spectrum-ActionButton--staticWhite {
- --spectrum-actionbutton-border-color-default: transparent;
- --spectrum-actionbutton-border-color-hover: transparent;
- --spectrum-actionbutton-border-color-down: transparent;
- --spectrum-actionbutton-border-color-focus: transparent;
- --spectrum-actionbutton-border-color-disabled: transparent;
-
- --spectrum-actionbutton-background-color-disabled: var(--spectrum-disabled-static-white-background-color);
- --spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-disabled-static-white-background-color);
-
- --spectrum-actionbutton-background-color-default: var(--spectrum-transparent-white-100);
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-200);
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-200);
- --spectrum-actionbutton-background-color-disabled: transparent;
- }
- }
- }
-}
diff --git a/components/actionbutton/themes/spectrum.css b/components/actionbutton/themes/spectrum.css
deleted file mode 100644
index 0c07028cf58..00000000000
--- a/components/actionbutton/themes/spectrum.css
+++ /dev/null
@@ -1,93 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--legacy */
-
-@import "./spectrum-two.css";
-
-@container style(--system: legacy) {
- .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-disabled: transparent;
- --spectrum-actionbutton-background-color-selected-disabled: var(--spectrum-disabled-background-color);
-
- --spectrum-actionbutton-border-color-default: var(--spectrum-gray-400);
- --spectrum-actionbutton-border-color-hover: var(--spectrum-gray-500);
- --spectrum-actionbutton-border-color-down: var(--spectrum-gray-600);
- --spectrum-actionbutton-border-color-focus: var(--spectrum-gray-500);
- --spectrum-actionbutton-border-color-disabled: var(--spectrum-disabled-border-color);
-
- --spectrum-actionbutton-content-color-selected: var(--spectrum-gray-75);
-
- &.spectrum-ActionButton--sizeXS,
- &.spectrum-ActionButton--sizeS,
- &.spectrum-ActionButton--sizeM,
- &.spectrum-ActionButton--sizeL,
- &.spectrum-ActionButton--sizeXL {
- --spectrum-actionbutton-border-radius-default: var(--spectrum-corner-radius-100);
- }
-
- &.spectrum-ActionButton--quiet {
- --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--staticBlack {
- --spectrum-actionbutton-border-color-default: var(--spectrum-transparent-black-400);
- --spectrum-actionbutton-border-color-hover: var(--spectrum-transparent-black-500);
- --spectrum-actionbutton-border-color-down: var(--spectrum-transparent-black-600);
- --spectrum-actionbutton-border-color-focus: var(--spectrum-transparent-black-500);
- --spectrum-actionbutton-border-color-disabled: var(--spectrum-disabled-static-black-border-color);
-
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-disabled: transparent;
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-black-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-black-300);
- --spectrum-actionbutton-background-color-disabled: transparent;
- }
- }
-
- &.spectrum-ActionButton--staticWhite {
- --spectrum-actionbutton-border-color-default: var(--spectrum-transparent-white-400);
- --spectrum-actionbutton-border-color-hover: var(--spectrum-transparent-white-500);
- --spectrum-actionbutton-border-color-down: var(--spectrum-transparent-white-600);
- --spectrum-actionbutton-border-color-focus: var(--spectrum-transparent-white-500);
- --spectrum-actionbutton-border-color-disabled: var(--spectrum-disabled-static-white-border-color);
-
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-disabled: transparent;
-
- &.spectrum-ActionButton--quiet {
- --spectrum-actionbutton-background-color-default: transparent;
- --spectrum-actionbutton-background-color-hover: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-down: var(--spectrum-transparent-white-400);
- --spectrum-actionbutton-background-color-focus: var(--spectrum-transparent-white-300);
- --spectrum-actionbutton-background-color-disabled: transparent;
- }
- }
- }
-}
diff --git a/components/actiongroup/CHANGELOG.md b/components/actiongroup/CHANGELOG.md
index a4b3acd322f..fee0ec2c2c5 100644
--- a/components/actiongroup/CHANGELOG.md
+++ b/components/actiongroup/CHANGELOG.md
@@ -1,12 +1,93 @@
# Change log
-## 6.2.0
+## 7.0.0-next.3
-### Minor Changes
+### Patch Changes
+
+📝 [#4085](https://github.com/adobe/spectrum-css/pull/4085) [`082862e`](https://github.com/adobe/spectrum-css/commit/082862eb80c6e0ac1c801b1d538e4d2f2bb919b4) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+### Action menu component (now with custom styles!)
+
+Introduces `@spectrum-css/actionmenu`, a composition of `ActionButton`, `Popover`, and `Menu` to present action lists from a trigger. Now with custom styles!
+
+- Adds wrapper classes: `spectrum-ActionMenu`, `spectrum-ActionMenu-trigger`, `spectrum-ActionMenu-popover`, and `spectrum-ActionMenu-menu`.
+- Supports long press triggers and four placements (start/end, top/bottom) via the underlying popover API.
+- Design reference: [Figma S2 token specs](https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-token-specs?node-id=20959-21513&node-type=frame&t=jbePQKK1yLdrHG2M-11).
+
+#### Migration notes
+
+- If you previously composed an action menu manually (action button + popover + menu), you can adopt the new wrapper classes without changing the underlying markup semantics. Ensure the trigger has `aria-haspopup="menu"` and manages `aria-expanded` according to your application logic.
+- For spacing customizations previously done with ad‑hoc margins, switch to the new `--spectrum-actionmenu-button-to-menu-gap` custom property.
+
+Example markup:
+
+```html
+
+```
+
+### Menu refinements
+
+Updates `@spectrum-css/menu` styles to align with latest Spectrum 2 design specifications and improve accessibility.
+
+- Updated `.is-selectableMultiple .spectrum-Menu-itemCheckbox` to `.is-selectableMultiple:not(:has(.is-selectable)) .spectrum-Menu-itemCheckbox` to prevent clash with the `.is-selectable` placement.
+- Non-breaking; no class or DOM changes required.
-📝 [#4218](https://github.com/adobe/spectrum-css/pull/4218) [`2df53f8`](https://github.com/adobe/spectrum-css/commit/2df53f8b9ef6d6a031ca99726aa7f0475443ca03) Thanks [@castastrophe](https://github.com/castastrophe)!
+### Action button refinements
+
+- Selection styling now applies when components use ARIA pressed/expanded semantics, not just `.is-selected`.
+- Implemented with `:where()` to keep selector specificity low and prevent downstream specificity battles.
+- Non-breaking; no class changes required.
+
+### Action group refinements
+
+Aligns selection behavior of grouped items with action button updates.
+
+- Adds `:where([aria-pressed="true"], [aria-expanded="true"])` alongside `.is-selected` on items to cover more accessibility use-cases while keeping specificity low.
+- Non-breaking; no class changes required.
+
+## 7.0.0-next.2
+
+### Major Changes
-Ensure accurate exports are present for each component. Specifically, adding `themes/*` assets where present and removing`index-*.css` exports where those assets do not exist.
+📝 [#4249](https://github.com/adobe/spectrum-css/pull/4249) [`9629fe3`](https://github.com/adobe/spectrum-css/commit/9629fe37cad996d47c827a3eabcdf39092a27b0d) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+This update removes `--mod-*` custom property hooks per SWC-1264, see also the RFC for extensible styling.
+
+- Remove all `--mod-*` custom property hooks.
+- Keep existing class selectors and variants unchanged.
+- Update stories to reflect the removal of the `--mod-*` override layer.
+
+Breaking change: the `--mod-*` override layer is removed. Consumers should set `--spectrum-*` variables directly where customization is needed.
+
+## 7.0.0-next.1
+
+### Patch Changes
+
+- Updated dependencies [[`60a156d`](https://github.com/adobe/spectrum-css/commit/60a156d7c0efcc999bc440274bbbbf586beb274b)]:
+ - @spectrum-css/tokens@16.1.0-next.0
+
+## 7.0.0-next.0
+
+### Patch Changes
+
+- Updated dependencies []:
+ - @spectrum-css/actionbutton@8.0.0-next.0
## 7.0.0
@@ -226,7 +307,7 @@ Output for all component CSS files is now being run through a lightweight optimi
## 4.1.10
-📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@4.1.9...@spectrum-css/actiongroup@4.1.10)
+🗓 2024-01-16 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@4.1.9...@spectrum-css/actiongroup@4.1.10)
**Note:** Version bump only for package @spectrum-css/actiongroup
@@ -342,7 +423,7 @@ Output for all component CSS files is now being run through a lightweight optimi
- refactor(actiongroup)!: replace focus-ring with focus-visible([d792847](https://github.com/adobe/spectrum-css/commit/d792847))
-### 🛑 BREAKING CHANGE
+### 🛑 BREAKING CHANGES
- use native focus-visible pseudo class for focus styling
@@ -378,7 +459,7 @@ Output for all component CSS files is now being run through a lightweight optimi
## 3.0.56
-📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@3.0.55...@spectrum-css/actiongroup@3.0.56)
+🗓 2023-07-14 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@3.0.55...@spectrum-css/actiongroup@3.0.56)
**Note:** Version bump only for package @spectrum-css/actiongroup
@@ -431,6 +512,7 @@ Output for all component CSS files is now being run through a lightweight optimi
## 3.0.48
🗓 2023-06-01 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/actiongroup@3.0.47...@spectrum-css/actiongroup@3.0.48)
+
**Note:** Version bump only for package @spectrum-css/actiongroup
## 3.0.47
diff --git a/components/actiongroup/dist/metadata.json b/components/actiongroup/dist/metadata.json
index c78e7d30965..aee1c9d6b00 100644
--- a/components/actiongroup/dist/metadata.json
+++ b/components/actiongroup/dist/metadata.json
@@ -2,62 +2,36 @@
"sourceFile": "index.css",
"selectors": [
".spectrum-ActionGroup",
- ".spectrum-ActionGroup .spectrum-ActionGroup-item",
- ".spectrum-ActionGroup .spectrum-ActionGroup-item:focus-visible",
- ".spectrum-ActionGroup--compact",
- ".spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet)",
".spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item",
".spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item + .spectrum-ActionGroup-item",
".spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child",
".spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child",
- ".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet)",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item + .spectrum-ActionGroup-item",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item .spectrum-ActionButton-label",
- ".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item.is-selected",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:first-child",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:focus-visible",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:hover",
".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:last-child",
+ ".spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) .spectrum-ActionGroup-item:where(.is-selected, [aria-pressed=\"true\"], [aria-expanded=\"true\"])",
".spectrum-ActionGroup--justified .spectrum-ActionGroup-item",
- ".spectrum-ActionGroup--sizeL",
- ".spectrum-ActionGroup--sizeM",
- ".spectrum-ActionGroup--sizeS",
- ".spectrum-ActionGroup--sizeXL",
- ".spectrum-ActionGroup--sizeXS",
- ".spectrum-ActionGroup--vertical",
+ ".spectrum-ActionGroup-item",
+ ".spectrum-ActionGroup-item:focus-visible",
+ ".spectrum-ActionGroup.spectrum-ActionGroup--compact",
+ ".spectrum-ActionGroup.spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet)",
+ ".spectrum-ActionGroup.spectrum-ActionGroup--sizeS",
+ ".spectrum-ActionGroup.spectrum-ActionGroup--sizeXS",
+ ".spectrum-ActionGroup.spectrum-ActionGroup--vertical",
".spectrum-ActionGroup:not(.spectrum-ActionGroup--vertical, .spectrum-ActionGroup--compact) .spectrum-ActionGroup-item"
],
- "modifiers": [
- "--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"
- ],
- "component": [
- "--spectrum-actiongroup-border-radius",
- "--spectrum-actiongroup-border-radius-reset",
- "--spectrum-actiongroup-button-spacing-reset",
- "--spectrum-actiongroup-gap-size-compact",
- "--spectrum-actiongroup-horizontal-spacing-compact",
- "--spectrum-actiongroup-horizontal-spacing-regular",
- "--spectrum-actiongroup-vertical-spacing-compact",
- "--spectrum-actiongroup-vertical-spacing-regular"
- ],
+ "modifiers": [],
+ "component": ["--spectrum-actiongroup-spacing"],
"global": [
+ "--spectrum-actionbutton-focus-indicator-border-radius",
"--spectrum-corner-radius-100",
"--spectrum-spacing-100",
"--spectrum-spacing-75"
],
- "system-theme": [
- "--system-action-group-gap-size-compact",
- "--system-action-group-horizontal-spacing-compact",
- "--system-action-group-vertical-spacing-compact"
- ],
- "passthroughs": ["--mod-actionbutton-focus-indicator-border-radius"],
+ "passthroughs": [],
"high-contrast": []
}
diff --git a/components/actiongroup/index.css b/components/actiongroup/index.css
index bbd26cb0f65..56a619c4c23 100644
--- a/components/actiongroup/index.css
+++ b/components/actiongroup/index.css
@@ -11,94 +11,82 @@
* governing permissions and limitations under the License.
*/
-@import "./themes/spectrum-two.css";
-
.spectrum-ActionGroup {
- --spectrum-actiongroup-button-spacing-reset: 0;
- --spectrum-actiongroup-border-radius-reset: 0;
- --spectrum-actiongroup-border-radius: var(--spectrum-corner-radius-100);
-}
+ --spectrum-actiongroup-spacing: var(--spectrum-spacing-100);
-.spectrum-ActionGroup--sizeXS,
-.spectrum-ActionGroup--sizeS {
- --spectrum-actiongroup-horizontal-spacing-regular: var(--spectrum-spacing-75);
- --spectrum-actiongroup-vertical-spacing-regular: var(--spectrum-spacing-75);
-}
+ &.spectrum-ActionGroup--sizeXS,
+ &.spectrum-ActionGroup--sizeS {
+ --spectrum-actiongroup-spacing: var(--spectrum-spacing-75);
+ }
-.spectrum-ActionGroup--sizeM,
-.spectrum-ActionGroup--sizeL,
-.spectrum-ActionGroup--sizeXL {
- --spectrum-actiongroup-horizontal-spacing-regular: var(--spectrum-spacing-100);
- --spectrum-actiongroup-vertical-spacing-regular: var(--spectrum-spacing-100);
-}
+ &.spectrum-ActionGroup--compact {
+ /* account for button border */
+ --spectrum-actiongroup-spacing: -1px;
+ }
-.spectrum-ActionGroup {
display: flex;
flex-wrap: wrap;
- gap: var(--mod-actiongroup-horizontal-spacing-regular, var(--spectrum-actiongroup-horizontal-spacing-regular));
-
- .spectrum-ActionGroup-item {
- flex-shrink: 0;
+ gap: var(--spectrum-actiongroup-spacing);
- /* Focus indicator should appear above hovered and selected borders */
- &:focus-visible {
- z-index: 3;
- }
+ &.spectrum-ActionGroup--vertical {
+ display: inline-flex;
+ flex-direction: column;
}
- &:not(.spectrum-ActionGroup--vertical, .spectrum-ActionGroup--compact) {
- .spectrum-ActionGroup-item {
- flex-shrink: 0;
+ &.spectrum-ActionGroup--compact {
+ gap: 0;
+
+ &:not(.spectrum-ActionGroup--quiet) {
+ flex-wrap: nowrap;
}
}
}
-.spectrum-ActionGroup--vertical {
- gap: var(--mod-actiongroup-vertical-spacing-regular, var(--spectrum-actiongroup-vertical-spacing-regular));
- display: inline-flex;
- flex-direction: column;
-}
+.spectrum-ActionGroup-item {
+ flex-shrink: 0;
-.spectrum-ActionGroup--compact {
- gap: var(--mod-actiongroup-gap-size-compact, var(--spectrum-actiongroup-gap-size-compact));
-}
+ /* Focus indicator should appear above hovered and selected borders */
+ &:focus-visible {
+ z-index: 3;
+ }
-.spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) {
- flex-wrap: nowrap;
+ .spectrum-ActionGroup:not(.spectrum-ActionGroup--vertical, .spectrum-ActionGroup--compact) & {
+ flex-shrink: 0;
+ }
- .spectrum-ActionGroup-item {
+ .spectrum-ActionGroup--compact:not(.spectrum-ActionGroup--quiet) & {
position: relative;
- border-radius: var(--mod-actiongroup-border-radius-reset, var(--spectrum-actiongroup-border-radius-reset));
+ border-radius: 0;
z-index: 0;
&:first-child {
/* @passthrough -- Action button styling */
- --mod-actionbutton-focus-indicator-border-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) 0px 0px var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
+ --spectrum-actionbutton-focus-indicator-border-radius: var(--spectrum-corner-radius-100) 0px 0px var(--spectrum-corner-radius-100);
- 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));
+ border-start-start-radius: var(--spectrum-corner-radius-100);
+ border-end-start-radius: var(--spectrum-corner-radius-100);
+ margin-inline-start: 0;
}
& + .spectrum-ActionGroup-item {
/* @passthrough -- Action button styling */
- --mod-actionbutton-focus-indicator-border-radius: 0px;
+ --spectrum-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));
+ margin-inline-start: var(--spectrum-actiongroup-spacing);
+ margin-inline-end: var(--spectrum-actiongroup-spacing);
}
&:last-child {
/* @passthrough -- Action button styling */
- --mod-actionbutton-focus-indicator-border-radius: 0px var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) 0px;
+ --spectrum-actionbutton-focus-indicator-border-radius: 0px var(--spectrum-corner-radius-100) var(--spectrum-corner-radius-100) 0px;
- 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));
+ border-start-end-radius: var(--spectrum-corner-radius-100);
+ border-end-end-radius: var(--spectrum-corner-radius-100);
+ margin-inline-start: var(--spectrum-actiongroup-spacing);
+ margin-inline-end: 0;
}
- &.is-selected {
+ &:where(.is-selected, [aria-pressed="true"], [aria-expanded="true"]) {
z-index: 1;
}
@@ -115,44 +103,40 @@
inline-size: auto;
}
}
-}
-
-.spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) {
- gap: var(--mod-actiongroup-gap-size-compact, var(--spectrum-actiongroup-gap-size-compact));
- .spectrum-ActionGroup-item {
- border-radius: var(--mod-actiongroup-border-radius-reset, var(--spectrum-actiongroup-border-radius-reset));
+ .spectrum-ActionGroup--compact.spectrum-ActionGroup--vertical:not(.spectrum-ActionGroup--quiet) & {
+ border-radius: 0;
&:first-child {
/* @passthrough -- Action button styling */
- --mod-actionbutton-focus-indicator-border-radius: var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) 0px 0px;
+ --spectrum-actionbutton-focus-indicator-border-radius: var(--spectrum-corner-radius-100) var(--spectrum-corner-radius-100) 0px 0px;
- 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));
+ border-start-start-radius: var(--spectrum-corner-radius-100);
+ border-start-end-radius: var(--spectrum-corner-radius-100);
+ margin-inline-end: 0;
+ margin-block-start: var(--spectrum-actiongroup-spacing);
+ margin-block-end: var(--spectrum-actiongroup-spacing);
}
& + .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));
+ margin-inline-start: 0;
+ margin-inline-end: 0;
+ margin-block-start: 0;
+ margin-block-end: var(--spectrum-actiongroup-spacing);
}
&:last-child {
/* @passthrough -- Action button styling */
- --mod-actionbutton-focus-indicator-border-radius: 0px 0px var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius)) var(--mod-actiongroup-border-radius, var(--spectrum-actiongroup-border-radius));
+ --spectrum-actionbutton-focus-indicator-border-radius: 0px 0px var(--spectrum-corner-radius-100) var(--spectrum-corner-radius-100);
- 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));
+ border-end-start-radius: var(--spectrum-corner-radius-100);
+ border-end-end-radius: var(--spectrum-corner-radius-100);
+ margin-block-start: var(--spectrum-actiongroup-spacing);
+ margin-block-end: 0;
}
}
-}
-.spectrum-ActionGroup--justified .spectrum-ActionGroup-item {
- flex-grow: 1;
+ .spectrum-ActionGroup--justified & {
+ flex-grow: 1;
+ }
}
diff --git a/components/actiongroup/package.json b/components/actiongroup/package.json
index f4e5f9ef555..4ac00486f74 100644
--- a/components/actiongroup/package.json
+++ b/components/actiongroup/package.json
@@ -1,6 +1,6 @@
{
"name": "@spectrum-css/actiongroup",
- "version": "6.2.0",
+ "version": "7.0.0-next.3",
"description": "The Spectrum CSS actiongroup component",
"license": "Apache-2.0",
"author": "Adobe",
@@ -19,15 +19,13 @@
"./package.json": "./package.json",
"./dist/*": "./dist/*",
"./index.css": "./dist/index.css",
- "./index-*.css": "./dist/index-*.css",
"./metadata.json": "./dist/metadata.json",
- "./themes/*": "./dist/themes/*",
"./stories/*": "./stories/*"
},
"main": "dist/index.css",
"peerDependencies": {
- "@spectrum-css/actionbutton": ">=7.0.0 <8.0.0",
- "@spectrum-css/tokens": ">=16.0.0 <17.0.0"
+ "@spectrum-css/actionbutton": ">=8.0.0-next.0",
+ "@spectrum-css/tokens": ">=16.1.0-next.0"
},
"peerDependenciesMeta": {
"@spectrum-css/actionbutton": {
@@ -38,8 +36,8 @@
}
},
"devDependencies": {
- "@spectrum-css/actionbutton": "7.2.0",
- "@spectrum-css/tokens": "16.0.2"
+ "@spectrum-css/actionbutton": "8.0.0-next.4",
+ "@spectrum-css/tokens": "16.1.0-next.10"
},
"keywords": [
"design-system",
diff --git a/components/actiongroup/stories/actiongroup.stories.js b/components/actiongroup/stories/actiongroup.stories.js
index a83857b9e54..0fd9731f55b 100644
--- a/components/actiongroup/stories/actiongroup.stories.js
+++ b/components/actiongroup/stories/actiongroup.stories.js
@@ -5,7 +5,7 @@ import { size } from "@spectrum-css/preview/types";
import metadata from "../dist/metadata.json";
import packageJson from "../package.json";
import { ActionGroups } from "./actiongroup.test.js";
-import { OverflowOption, TreatmentTemplate } from "./template.js";
+import { OverflowOption, Template, TreatmentTemplate } from "./template.js";
/**
* An action group is a grouping of [action buttons](/docs/components-action-button--docs) that are related to each other.
@@ -99,7 +99,11 @@ export default {
},
packageJson,
metadata,
+ status: {
+ type: "migrated",
+ },
},
+ tags: ["migrated"],
};
export const Default = ActionGroups.bind({});
@@ -279,6 +283,15 @@ JustifiedIconOnlyCompact.parameters = {
chromatic: { disableSnapshot: true },
};
+export const Quiet = Template.bind({});
+Quiet.tags = ["!dev"];
+Quiet.args = {
+ areQuiet: true,
+};
+Quiet.parameters = {
+ chromatic: { disableSnapshot: true },
+};
+
/**
* When space is limited in an action group, there are 2 options for the group's overflow behavior: wrap or collapse. By default, an action group is set to wrap, meaning that the action buttons inside the group wrap to form another line. Alternatively, an action group can be set to collapse inside a **More (...)** action button.
*/
diff --git a/components/actiongroup/stories/template.js b/components/actiongroup/stories/template.js
index d13cdac64aa..25d8f25f4e0 100644
--- a/components/actiongroup/stories/template.js
+++ b/components/actiongroup/stories/template.js
@@ -6,9 +6,6 @@ import { styleMap } from "lit/directives/style-map.js";
import { capitalize } from "lodash-es";
import "../index.css";
-import "../themes/spectrum.css";
-/* Must be imported last */
-import "../themes/express.css";
export const Template = ({
rootClass = "spectrum-ActionGroup",
diff --git a/components/actiongroup/themes/express.css b/components/actiongroup/themes/express.css
deleted file mode 100644
index 3fd8de9cdbb..00000000000
--- a/components/actiongroup/themes/express.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--express */
-
-@import "./spectrum.css";
-
-@container style(--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-two.css b/components/actiongroup/themes/spectrum-two.css
deleted file mode 100644
index b25c0f945b2..00000000000
--- a/components/actiongroup/themes/spectrum-two.css
+++ /dev/null
@@ -1,22 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-@container style(--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/actiongroup/themes/spectrum.css b/components/actiongroup/themes/spectrum.css
deleted file mode 100644
index 3d81bc564b5..00000000000
--- a/components/actiongroup/themes/spectrum.css
+++ /dev/null
@@ -1,16 +0,0 @@
-/*!
- * 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
- *
- * 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.
- */
-
-/* @combine .spectrum.spectrum--legacy */
-
-@import "./spectrum-two.css";
diff --git a/components/actionmenu/CHANGELOG.md b/components/actionmenu/CHANGELOG.md
index be9a81e3903..275ba440829 100644
--- a/components/actionmenu/CHANGELOG.md
+++ b/components/actionmenu/CHANGELOG.md
@@ -1,5 +1,83 @@
# Change log
+## 8.0.0-next.2
+
+### Major Changes
+
+📝 [#4085](https://github.com/adobe/spectrum-css/pull/4085) [`082862e`](https://github.com/adobe/spectrum-css/commit/082862eb80c6e0ac1c801b1d538e4d2f2bb919b4) Thanks [@castastrophe](https://github.com/castastrophe)!
+
+### Action menu component (now with custom styles!)
+
+Introduces `@spectrum-css/actionmenu`, a composition of `ActionButton`, `Popover`, and `Menu` to present action lists from a trigger. Now with custom styles!
+
+- Adds wrapper classes: `spectrum-ActionMenu`, `spectrum-ActionMenu-trigger`, `spectrum-ActionMenu-popover`, and `spectrum-ActionMenu-menu`.
+- Supports long press triggers and four placements (start/end, top/bottom) via the underlying popover API.
+- Design reference: [Figma S2 token specs](https://www.figma.com/design/eoZHKJH9a3LJkHYCGt60Vb/S2-token-specs?node-id=20959-21513&node-type=frame&t=jbePQKK1yLdrHG2M-11).
+
+#### Migration notes
+
+- If you previously composed an action menu manually (action button + popover + menu), you can adopt the new wrapper classes without changing the underlying markup semantics. Ensure the trigger has `aria-haspopup="menu"` and manages `aria-expanded` according to your application logic.
+- For spacing customizations previously done with ad‑hoc margins, switch to the new `--spectrum-actionmenu-button-to-menu-gap` custom property.
+
+Example markup:
+
+```html
+
+```
+
+### Menu refinements
+
+Updates `@spectrum-css/menu` styles to align with latest Spectrum 2 design specifications and improve accessibility.
+
+- Updated `.is-selectableMultiple .spectrum-Menu-itemCheckbox` to `.is-selectableMultiple:not(:has(.is-selectable)) .spectrum-Menu-itemCheckbox` to prevent clash with the `.is-selectable` placement.
+- Non-breaking; no class or DOM changes required.
+
+### Action button refinements
+
+- Selection styling now applies when components use ARIA pressed/expanded semantics, not just `.is-selected`.
+- Implemented with `:where()` to keep selector specificity low and prevent downstream specificity battles.
+- Non-breaking; no class changes required.
+
+### Action group refinements
+
+Aligns selection behavior of grouped items with action button updates.
+
+- Adds `:where([aria-pressed="true"], [aria-expanded="true"])` alongside `.is-selected` on items to cover more accessibility use-cases while keeping specificity low.
+- Non-breaking; no class changes required.
+
+## 8.0.0-next.1
+
+### Patch Changes
+
+- Updated dependencies [[`60a156d`](https://github.com/adobe/spectrum-css/commit/60a156d7c0efcc999bc440274bbbbf586beb274b)]:
+ - @spectrum-css/tokens@16.1.0-next.0
+
+## 8.0.0-next.0
+
+### Patch Changes
+
+- Updated dependencies [[`a25e0a9`](https://github.com/adobe/spectrum-css/commit/a25e0a99e5a4736ab4e607e00739343101a2633b)]:
+ - @spectrum-css/icon@10.0.0-next.0
+ - @spectrum-css/actionbutton@8.0.0-next.0
+ - @spectrum-css/menu@10.0.0-next.0
+ - @spectrum-css/popover@9.0.0-next.0
+
## 7.2.0
### Minor Changes
@@ -174,6 +252,7 @@ Output for all component CSS files is now being run through a lightweight optimi
### 🛑 BREAKING CHANGE
- Removes component-builder & component-builder-simple for script leveraging postcss
+
- Imports added to index.css and themes/express.css
## 5.1.3
diff --git a/components/actionmenu/dist/metadata.json b/components/actionmenu/dist/metadata.json
new file mode 100644
index 00000000000..530a08aae34
--- /dev/null
+++ b/components/actionmenu/dist/metadata.json
@@ -0,0 +1,9 @@
+{
+ "sourceFile": "index.css",
+ "selectors": [".spectrum-ActionMenu", ".spectrum-ActionMenu-popover"],
+ "modifiers": [],
+ "component": ["--spectrum-actionmenu-button-to-menu-gap"],
+ "global": ["--spectrum-popover-animation-distance", "--spectrum-spacing-100"],
+ "passthroughs": [],
+ "high-contrast": []
+}
diff --git a/components/actionmenu/index.css b/components/actionmenu/index.css
new file mode 100644
index 00000000000..3d7598380aa
--- /dev/null
+++ b/components/actionmenu/index.css
@@ -0,0 +1,32 @@
+/*!
+ * Copyright 2025 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
+ *
+ * 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-css/actionmenu
+ * This component is a combination of a menu, popover, and action button.
+ * It is used to display a list of actions in a popover menu when the user clicks on an action button.
+ * The markup has the following structure:
+ *