Skip to content

feat(menu): s2 migration #2802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3080d1b
feat(tokens): use 13.0.0-beta.5
pfulton Dec 11, 2023
d3e370e
feat(tokens): use 13.0.0-beta.8
pfulton Jan 8, 2024
eb54ca3
feat(tokens): use 13.0.0-beta.9
pfulton Jan 11, 2024
dc1d295
feat(actiongroup)!: migrate to S2 (#2453)
Feb 2, 2024
40f91fc
feat(buttongroup)!: migrate to S2 (#2457)
jenndiaz Feb 2, 2024
e8ba1f8
feat(tokens)!: use 13.0.0-beta.13
pfulton Feb 2, 2024
e73bf11
chore(release): release
pfulton Feb 6, 2024
2b525c0
feat(tokens)!: use spectrum-tokens 13.0.0-beta.16
pfulton Feb 22, 2024
c943daa
chore(actiongroup,buttongroup): specify s2 tokens for peerdeps
pfulton Feb 26, 2024
14e2104
feat(closebutton)!: migrate to S2 (#2564)
Mar 7, 2024
06f09a2
chore: s2 grays component-level migration (#2583)
pfulton Mar 7, 2024
47ee37b
fix(closebutton): use correct casing for class names
pfulton Mar 8, 2024
50a9f66
fix(commons): remove renamed mods marked for deprecation (#2580)
jawinn Mar 8, 2024
1a77eef
feat(fieldlabel)!: s2 migration (#2569)
jawinn Mar 11, 2024
caddb37
chore(tokens): use spectrum-tokens v13.0.0-beta.19
pfulton Mar 11, 2024
63f14d5
chore(tokens): manual version bump for 14.0.0-next.1
pfulton Mar 12, 2024
4a4d171
chore(release): release
pfulton Mar 12, 2024
8e99452
feat(downstate): docs + implementation for example components (#2520)
Mar 19, 2024
c9449fe
fix(button): resolve merge issue
pfulton Mar 19, 2024
755671a
feat(tokens): use spectrum-tokens 13.0.0-beta.21 (#2597)
pfulton Mar 19, 2024
5b420b4
chore(release): release
pfulton Mar 21, 2024
9ff7c7b
chore: rebase against main and update components to use prerelease to…
pfulton Mar 28, 2024
3fe22a3
feat(cornerrounding): add custom token and foundations documentation …
jenndiaz Mar 28, 2024
4f9e784
fix(storybook): body classes for story and docs pages (#2617)
Apr 1, 2024
33757b2
docs: update migration guide headings (#2638)
jawinn Apr 4, 2024
816686b
feat(opacitycheckerboard): S2, small t-shirt size squares (#2610)
Apr 8, 2024
37c98d3
feat(tokens): use spectrum-tokens at v13.0.0-beta.24 (#2650)
Apr 9, 2024
43e47f6
chore(tokens): manual version bump for prerelease
pfulton Apr 9, 2024
9eca7bd
feat: add example gradients for static black and white (#2637)
jawinn Apr 11, 2024
7e3e703
chore(tokens): use [email protected]
pfulton Apr 12, 2024
251e4dd
chore(release): release
pfulton Apr 12, 2024
a925bba
feat(switch): s2 migration (#2651)
Apr 15, 2024
9be7b22
chore: prerelease mode for changesets
pfulton Apr 19, 2024
b145f81
chore(tokens): use @adobe/[email protected] (#2678)
pfulton Apr 19, 2024
c6e1836
chore: remove darkest as SB option (#2679)
pfulton Apr 19, 2024
94dbddc
chore: release (next) (#2680)
github-actions[bot] Apr 19, 2024
8e36ef0
chore: run branch through format; update pathing and fix errors (#2700)
castastrophe Apr 26, 2024
96b23bd
chore: release (next) (#2706)
github-actions[bot] Apr 26, 2024
eb466e4
feat(button): migrate to Spectrum 2 (#2600)
jawinn May 1, 2024
c41975c
chore: release s2 button (next) (#2722)
github-actions[bot] May 1, 2024
64f8c1b
feat(progressbar): s2 migration (#2659)
May 8, 2024
051071f
chore: release (next) (#2739)
github-actions[bot] May 9, 2024
e62d1ca
chore(tokens): use [email protected] (#2797)
pfulton May 30, 2024
e73a897
chore: release (next) (#2798)
github-actions[bot] May 30, 2024
81edcde
refactor(button): remove spectrum-ButtonWithFocusRing extend (#2725)
jawinn May 30, 2024
2381f1a
chore: release (next) (#2801)
github-actions[bot] Jun 4, 2024
f2db83c
docs(dropshadow): add stories and docs for dropshadow (#2674)
rise-erpelding Jun 4, 2024
e4adce4
build: keep selector list in dist output of not pseudo-class (#2740)
jawinn May 10, 2024
c816d1d
refactor(menu): improve chromatic coverage
rise-erpelding May 7, 2024
8ed57a3
chore(menu): remove custom menu item color tokens
rise-erpelding May 28, 2024
d311682
docs(menu): scale checkmark in implementation
rise-erpelding May 24, 2024
09a7936
feat(menu): migrate styles and tokens to s2
rise-erpelding May 15, 2024
5b13c28
feat(menu): add thumbnail
rise-erpelding May 17, 2024
49c68de
feat(menu): add section description
rise-erpelding May 21, 2024
86805e5
feat(menu): add external link
rise-erpelding May 23, 2024
b07414c
feat(menu): add corner-rounding
rise-erpelding May 28, 2024
c9276c3
feat(menu): update focus indicator
rise-erpelding May 29, 2024
89c661d
feat(menu): add down state
rise-erpelding May 29, 2024
9f818c5
refactor(menu): move forced-colors to the end
rise-erpelding May 29, 2024
bfdf5f2
docs(menu): update changeset, yml docs
rise-erpelding May 31, 2024
3b95acb
fix(menu): focus text color
rise-erpelding May 31, 2024
0890d50
fix(menu): revert menu item margin
rise-erpelding Jun 3, 2024
7a77ce5
feat(popover,tray): add horizontal padding
rise-erpelding Jun 4, 2024
ad5c3fa
fix: pr fixes
rise-erpelding Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/eight-spiders-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@spectrum-css/calendar": patch
"@spectrum-css/combobox": patch
"@spectrum-css/datepicker": patch
"@spectrum-css/menu": patch
"@spectrum-css/picker": patch
"@spectrum-css/slider": patch
"@spectrum-css/stepper": patch
---

Build change to remove the `postcss-preset-env` polyfill for the dist output of `:not` selectors containing multiple selectors, to avoid an unintended increase in specificity, which caused some visual regressions.
5 changes: 5 additions & 0 deletions .changeset/eleven-cooks-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/tokens": patch
---

Uses the latest release from Spectrum Tokens (13.0.0-beta.35)
8 changes: 8 additions & 0 deletions .changeset/fresh-seahorses-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@spectrum-css/button": patch
---

#### refactor: remove spectrum-ButtonWithFocusRing placeholder class extend

Removes the need for the extend from this placeholder class, as the styles it provides have diverged slightly from what is in button and it was causing some unnecessary CSS to override.
This should not result in any changed visuals or behavior, as the same CSS has been integrated.
44 changes: 44 additions & 0 deletions .changeset/friendly-brooms-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
"@spectrum-css/menu": major
"@spectrum-css/popover": minor
"@spectrum-css/tray": minor
"@spectrum-css/tokens": patch
---

Removes custom menu item background color tokens: Since `@adobe/spectrum-tokens` has been updated to include many tokens relating to the menu component, including some that replace custom tokens that had previously been added. As such, these custom menu item color tokens that are now available from `@adobe/spectrum-tokens` have been removed.

Spectrum 2 Menu migration:

In addition to small token and minor style changes, there were several new features that were added to this version of menu, including:

- A thumbnail can now be added to the menu item label
- A section description can now be added below the menu section heading
- The actions area previously held value text, action switches for multi-select, and the drill-in for a submenu--in this version, an external link action can now be added
- Menu items now receive corner rounding, which is visible on hover/focus/active states
- The focus indicator has been updated--instead of a blue line on the left (start side) of the menu item, the whole element now receives an outline
- Menu items now have the S2 down state transform

In order to accommodate menu item focus outlines, horizontal padding has been added to popover and tray.

The following mods have been added:

- `--mod-menu-item-corner-rounding`
- `--mod-menu-item-description-font-weight`
- `--mod-menu-item-label-font-weight`
- `--mod-menu-item-thumbnail-height`
- `--mod-menu-item-thumbnail-opacity-disabled`
- `--mod-menu-item-thumbnail-to-label`
- `--mod-menu-item-thumbnail-width`
- `--mod-menu-item-top-to-drillin`
- `--mod-menu-item-top-to-icon`
- `--mod-menu-item-top-to-thumbnail`
- `--mod-menu-linkout-icon-height`
- `--mod-menu-linkout-icon-width`
- `--mod-menu-section-description-color`
- `--mod-menu-section-description-font-size`
- `--mod-menu-section-description-font-weight`
- `--mod-menu-section-description-line-height`
- `--mod-menu-section-description-line-height-cjk`
- `--mod-menu-section-header-to-description`
- `--mod-popover-content-area-spacing-horizontal`
- `--mod-tray-edge-to-content-area`
15 changes: 15 additions & 0 deletions .changeset/nine-kings-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@spectrum-css/button": major
---

#### Spectrum 2 migration
Button now uses Spectrum 2 tokens and specifications, which includes many color changes to all variants. A few other notable changes:
- Outline buttons are no longer available in accent and negative options — use the filled variant instead.
- Medium size is now the default. The class `.spectrum-Button--sizeM` is now unnecessary for this size, and has been removed.
- The `.spectrum-Button--fill` class is no longer needed and has been removed.

The following `--mod` custom properties have been renamed:
- `--mod-line-height-100` has been renamed to `--mod-button-line-height`
- `--mod-sans-font-family-stack` has been renamed to `--mod-button-font-family`
- `--mod-animation-duration-100` has been renamed to `--mod-button-animation-duration`
- `--mod-bold-font-weight` has been renamed to `--mod-button-font-weight`
5 changes: 5 additions & 0 deletions .changeset/perfect-dogs-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/button": patch
---

chore: run branch through formatter
110 changes: 110 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@spectrum-tools/gh-action-file-diff": "2.0.5",
"@spectrum-css/preview": "8.1.0-next.1",
"@spectrum-css/accordion": "4.2.7-next.2",
"@spectrum-css/actionbar": "7.2.5-next.2",
"@spectrum-css/actionbutton": "5.2.7-next.2",
"@spectrum-css/actiongroup": "5.0.0-next.3",
"@spectrum-css/actionmenu": "5.1.4-next.2",
"@spectrum-css/alertbanner": "1.1.42-next.2",
"@spectrum-css/alertdialog": "1.2.5-next.2",
"@spectrum-css/asset": "4.0.1-next.2",
"@spectrum-css/assetcard": "3.1.5-next.2",
"@spectrum-css/assetlist": "5.2.5-next.2",
"@spectrum-css/avatar": "6.1.6-next.2",
"@spectrum-css/badge": "3.2.6-next.2",
"@spectrum-css/breadcrumb": "8.2.6-next.2",
"@spectrum-css/button": "14.0.0-next.4",
"@spectrum-css/buttongroup": "7.0.0-next.3",
"@spectrum-css/calendar": "4.2.6-next.2",
"@spectrum-css/card": "7.0.3-next.2",
"@spectrum-css/checkbox": "14.0.0-next.4",
"@spectrum-css/clearbutton": "5.1.5-next.2",
"@spectrum-css/closebutton": "5.0.0-next.2",
"@spectrum-css/coachindicator": "1.1.6-next.2",
"@spectrum-css/coachmark": "6.1.6-next.2",
"@spectrum-css/colorarea": "4.1.6-next.2",
"@spectrum-css/colorhandle": "7.1.5-next.2",
"@spectrum-css/colorloupe": "4.2.5-next.2",
"@spectrum-css/colorslider": "5.1.6-next.2",
"@spectrum-css/colorwheel": "3.1.6-next.2",
"@spectrum-css/combobox": "2.1.7-next.2",
"@spectrum-css/commons": "9.1.4-next.1",
"@spectrum-css/contextualhelp": "2.1.6-next.2",
"@spectrum-css/datepicker": "2.1.5-next.2",
"@spectrum-css/dial": "2.2.5-next.2",
"@spectrum-css/dialog": "9.2.5-next.2",
"@spectrum-css/divider": "2.2.6-next.2",
"@spectrum-css/dropindicator": "4.1.5-next.2",
"@spectrum-css/dropzone": "5.2.6-next.2",
"@spectrum-css/fieldgroup": "4.2.5-next.2",
"@spectrum-css/fieldlabel": "8.0.0-next.2",
"@spectrum-css/floatingactionbutton": "1.2.6-next.2",
"@spectrum-css/helptext": "4.1.6-next.2",
"@spectrum-css/icon": "6.0.6-next.2",
"@spectrum-css/illustratedmessage": "6.1.6-next.2",
"@spectrum-css/infieldbutton": "4.2.5-next.2",
"@spectrum-css/inlinealert": "7.1.7-next.2",
"@spectrum-css/link": "4.2.6-next.2",
"@spectrum-css/logicbutton": "3.3.5-next.2",
"@spectrum-css/menu": "6.1.6-next.2",
"@spectrum-css/miller": "5.1.5-next.2",
"@spectrum-css/modal": "4.2.7-next.2",
"@spectrum-css/opacitycheckerboard": "1.1.6-next.2",
"@spectrum-css/page": "7.1.5-next.2",
"@spectrum-css/pagination": "7.1.7-next.2",
"@spectrum-css/picker": "7.2.8-next.2",
"@spectrum-css/pickerbutton": "4.1.6-next.2",
"@spectrum-css/popover": "6.2.6-next.2",
"@spectrum-css/progressbar": "3.1.6-next.2",
"@spectrum-css/progresscircle": "2.2.4-next.2",
"@spectrum-css/radio": "8.1.6-next.2",
"@spectrum-css/rating": "4.2.5-next.2",
"@spectrum-css/search": "6.2.5-next.2",
"@spectrum-css/sidenav": "4.2.5-next.2",
"@spectrum-css/site": "4.2.5-next.2",
"@spectrum-css/slider": "4.3.6-next.2",
"@spectrum-css/splitview": "4.2.5-next.2",
"@spectrum-css/statuslight": "6.1.7-next.2",
"@spectrum-css/steplist": "4.1.5-next.2",
"@spectrum-css/stepper": "5.1.6-next.2",
"@spectrum-css/swatch": "5.1.6-next.2",
"@spectrum-css/swatchgroup": "2.1.6-next.2",
"@spectrum-css/switch": "4.2.6-next.2",
"@spectrum-css/table": "5.2.6-next.2",
"@spectrum-css/tabs": "4.1.5-next.2",
"@spectrum-css/tag": "8.1.6-next.2",
"@spectrum-css/taggroup": "4.1.6-next.2",
"@spectrum-css/textfield": "6.1.7-next.2",
"@spectrum-css/thumbnail": "5.2.5-next.2",
"@spectrum-css/toast": "9.1.26-next.2",
"@spectrum-css/tooltip": "5.3.6-next.2",
"@spectrum-css/tray": "2.2.8-next.2",
"@spectrum-css/treeview": "9.2.7-next.2",
"@spectrum-css/typography": "5.1.6-next.2",
"@spectrum-css/underlay": "3.2.5-next.2",
"@spectrum-css/well": "4.1.5-next.2",
"@spectrum-css/generator": "3.0.0",
"conventional-changelog-spectrum": "1.0.2",
"postcss-combininator": "2.0.0",
"postcss-custom-properties-mapping": "2.0.0",
"postcss-splitinator": "2.0.0",
"@spectrum-tools/stylelint-no-missing-var": "1.3.1",
"@spectrum-tools/stylelint-no-unknown-custom-properties": "1.3.2",
"@spectrum-tools/stylelint-no-unused-custom-properties": "1.3.1",
"@spectrum-tools/documentation": "1.0.0",
"@spectrum-css/tokens": "14.0.0-next.6",
"@spectrum-css/ui-icons": "1.1.2"
},
"changesets": [
"eleven-cooks-destroy",
"fresh-seahorses-join",
"nine-kings-repair",
"perfect-dogs-smash",
"pretty-parents-drum",
"proud-jokes-rule"
]
}
5 changes: 5 additions & 0 deletions .changeset/pretty-parents-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/tokens": patch
---

use [email protected]
7 changes: 7 additions & 0 deletions .changeset/proud-jokes-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@spectrum-css/progressbar": major
---

feat(progressbar): S2 migration

Progress bar now uses Spectrum 2 tokens and specifications. This migration includes updated colors, font sizes, and spacing. No mods were harmed in the migration of this component (all `--mod` properties remain the same).
7 changes: 7 additions & 0 deletions .changeset/silly-ties-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@spectrum-css/menu": patch
---

Prevents overlap of checkbox and icon if both are used in a menu item.

Also reduces a significant number of variants by consolidating menus, includes a refactor to enhance menu item understanding, and expands Chromatic testing coverage.
5 changes: 5 additions & 0 deletions .storybook/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@ This component has been deprecated. Use an action bar to allow users to perform
##7.4.2
🗓
2024-02-06
<a name="7.4.2-next.0"></a>
##7.4.2-next.0
🗓
2024-02-06 • 📝 [Commits](https://github.com/adobe/spectrum-css/compare/@spectrum-css/[email protected]...@spectrum-css/[email protected])

**Note:** Spectrum 2 next version
**Note:** Version bump only for package @spectrum-css/preview

<a name="7.4.1"></a>
Expand Down
15 changes: 15 additions & 0 deletions .storybook/assets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,28 @@ body {
}

.spectrum {
/* ---- Storybook only custom properties ---- */
/* Gradient that changes with the color theme. */
--spectrum-examples-gradient: linear-gradient(45deg, var(--spectrum-magenta-1500), var(--spectrum-blue-1500));
/* Gradients that do not change with the color theme, for use in static color backgrounds. */
--spectrum-examples-gradient-static-black: linear-gradient(45deg, rgb(255, 241, 246), rgb(238, 245, 255));
--spectrum-examples-gradient-static-white: linear-gradient(45deg, rgb(64, 0, 22), rgb(14, 24, 67));

background-color: var(--spectrum-background-layer-1-color);

/* @todo: add back the text color and update VRTs */
/* color: var(--spectrum-neutral-content-color-default); */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%);
}

.spectrum .spectrum-examples-static-black {
background: var(--spectrum-examples-gradient-static-black);
}

.spectrum .spectrum-examples-static-white {
background: var(--spectrum-examples-gradient-static-white)
}

/* Hide the SVG elements that only include references */
svg:has(symbol):not(:has(use)) {
display: none;
Expand Down
22 changes: 11 additions & 11 deletions .storybook/decorators/contextsWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const withContextWrapper = makeDecorator({
/** @type string */
const scale = args.scale ? args.scale : getDefaultValue(argTypes.scale) ?? "medium";

const colors = ["light", "dark", "darkest"];
const colors = ["light", "dark"];
const scales = ["medium", "large"];

useEffect(() => {
Expand All @@ -54,18 +54,18 @@ export const withContextWrapper = makeDecorator({
container.classList.toggle(`spectrum--${s}`, s === scale);
}


container.style.removeProperty("background");
const hasStaticElement = container.querySelector(`.${args.rootClass}--staticWhite, .${args.rootClass}--staticBlack, .${args.rootClass}--overBackground`);
if (hasStaticElement) {
if (container.querySelector(`.${args.rootClass}--staticBlack`)) {
container.style.background = "rgb(181, 209, 211)";
} else if (container.querySelector(`.${args.rootClass}--staticWhite, .${args.rootClass}--overBackground`)) {
container.style.background = "rgb(15, 121, 125)";
}
// Change background color when demonstrating static color options.
if (args.staticColor === "black") {
container.style.background = "var(--spectrum-examples-gradient-static-black)";
}
else if (args.staticColor === "white" || args.isStaticWhite === true) {
container.style.background = "var(--spectrum-examples-gradient-static-white)";
}
else {
container.style.removeProperty("background");
}
}
}, [color, scale, isExpress, args.staticColor]);
}, [color, scale, isExpress, args.staticColor, args.isStaticWhite]);

return StoryFn(context);
},
Expand Down
1 change: 1 addition & 0 deletions .storybook/decorators/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { makeDecorator, useEffect } from "@storybook/preview-api";
import { html } from "lit";

export { withContextWrapper } from "./contextsWrapper.js";
export { withDownStateDimensionCapture } from "./withDownStateDimensionCapture.js";
export { withTestingPreviewWrapper } from "./withTestingPreviewWrapper.js";

/**
Expand Down
19 changes: 19 additions & 0 deletions .storybook/decorators/withDownStateDimensionCapture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export const withDownStateDimensionCapture = (selector) => (Story, context) => {
const captureDownStateDimensions = () => {
const components = document.querySelectorAll(selector);
components.forEach((component) => {
const { width, height } = component.getBoundingClientRect();
component.style.setProperty('--spectrum-downstate-width', `${width}px`);
component.style.setProperty('--spectrum-downstate-height', `${height}px`);
});
};

document.addEventListener("DOMContentLoaded", () => {
// Wait to make sure the story is fully rendered (otherwise width/height can be wrong)
setTimeout(() => {
captureDownStateDimensions();
}, 100);
});

return Story(context);
};
Loading
Loading