Skip to content
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

feat!: spectrum 2 #2352

Draft
wants to merge 90 commits into
base: s2-foundations-redux
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c85d6cf
feat: migration of tokens to spectrum 2
castastrophe Nov 18, 2024
e3e37b4
feat: bug fixes for reducing theming variables
castastrophe Nov 22, 2024
6082064
feat: s2 foundations non-gray-800 colors update (#3413)
pfulton Nov 22, 2024
6615348
chore: release (s2-foundations) (#3421)
github-actions[bot] Dec 3, 2024
aef4ea3
fix(combobox): update border color in spectrum-two
castastrophe Dec 3, 2024
8b98218
fix(picker): update background and border color
castastrophe Dec 3, 2024
e0a8aa1
chore: release (s2-foundations) (#3425)
github-actions[bot] Dec 3, 2024
7ea067c
fix(combobox): retain border values for S1
castastrophe Dec 3, 2024
e29ecda
chore: release (s2-foundations) (#3426)
github-actions[bot] Dec 3, 2024
8ee5445
chore: minor tooling and infra updates
castastrophe Dec 4, 2024
76881ca
chore: update dependency versions ava and postcss
castastrophe Dec 4, 2024
9abd757
chore(contextualhelp,datepicker,fieldgroup): remove MDX files (#3422)
marissahuysentruyt Dec 16, 2024
69bfb16
chore(accordion,actionbar,asset): remove mdx files (#3407)
marissahuysentruyt Dec 18, 2024
f05c804
chore(colorarea,colorhandle,colorloupe,colorslider,colorwheel): remov…
marissahuysentruyt Dec 19, 2024
4c9c980
chore(assetcard,avatar,badge): remove mdx files (#3408)
marissahuysentruyt Dec 19, 2024
82800d1
chore(calendar,card,coachmark): remove MDX files (#3443)
marissahuysentruyt Dec 19, 2024
f4c117f
chore: include storybook assets in shipped results
castastrophe Dec 29, 2024
79eb129
chore: align peerDependencies to local versions
castastrophe Dec 29, 2024
d8a3f18
chore: update browser caniuse db
castastrophe Dec 29, 2024
2c5242f
feat(tokens): use 13.0.0-beta.5
pfulton Dec 11, 2023
ca1ddd2
feat(tokens): use 13.0.0-beta.8
pfulton Jan 8, 2024
7218c66
feat(tokens): use 13.0.0-beta.9
pfulton Jan 11, 2024
58d7841
feat(actiongroup)!: migrate to S2 (#2453)
mdt2 Feb 2, 2024
90275f5
feat(buttongroup)!: migrate to S2 (#2457)
jenndiaz Feb 2, 2024
f3072dd
feat(tokens)!: use 13.0.0-beta.13
pfulton Feb 2, 2024
f5e95d8
chore(release): release
pfulton Feb 6, 2024
f8e34af
feat(tokens)!: use spectrum-tokens 13.0.0-beta.16
pfulton Feb 22, 2024
9f77970
chore(actiongroup,buttongroup): specify s2 tokens for peerdeps
pfulton Feb 26, 2024
92fbbed
feat(closebutton)!: migrate to S2 (#2564)
mdt2 Mar 7, 2024
04de820
chore: s2 grays component-level migration (#2583)
pfulton Mar 7, 2024
cc3b7d7
fix(commons): remove renamed mods marked for deprecation (#2580)
jawinn Mar 8, 2024
c184290
feat(fieldlabel)!: s2 migration (#2569)
jawinn Mar 11, 2024
afafe0c
chore(tokens): use spectrum-tokens v13.0.0-beta.19
pfulton Mar 11, 2024
91f08d7
chore(tokens): manual version bump for 14.0.0-next.1
pfulton Mar 12, 2024
5f52b52
chore(release): release
pfulton Mar 12, 2024
a117833
feat(downstate): docs + implementation for example components (#2520)
mdt2 Mar 19, 2024
2c98493
feat(tokens): use spectrum-tokens 13.0.0-beta.21 (#2597)
pfulton Mar 19, 2024
f91706d
chore(release): release
pfulton Mar 21, 2024
5e37eac
chore: rebase against main and update components to use prerelease to…
pfulton Mar 28, 2024
8ec9008
feat(cornerrounding): add custom token and foundations documentation …
jenndiaz Mar 28, 2024
7233e93
fix(storybook): body classes for story and docs pages (#2617)
mdt2 Apr 1, 2024
3b0c098
feat(opacitycheckerboard): S2, small t-shirt size squares (#2610)
mdt2 Apr 8, 2024
2a5fbbc
feat(tokens): use spectrum-tokens at v13.0.0-beta.24 (#2650)
mdt2 Apr 9, 2024
f89e44d
chore(tokens): manual version bump for prerelease
pfulton Apr 9, 2024
5ec02a4
feat: add example gradients for static black and white (#2637)
jawinn Apr 11, 2024
c499b66
chore(tokens): use spectrum-tokens@13.0.0-beta.27
pfulton Apr 12, 2024
927ff86
chore(release): release
pfulton Apr 12, 2024
3fbbd33
feat(switch): s2 migration (#2651)
mdt2 Apr 15, 2024
a5b8329
chore: prerelease mode for changesets
pfulton Apr 19, 2024
16169a3
chore(tokens): use @adobe/spectrum-tokens@13.0.0-beta.30 (#2678)
pfulton Apr 19, 2024
c2dfbda
chore: release (next) (#2680)
github-actions[bot] Apr 19, 2024
b682b9e
chore: run branch through format; update pathing and fix errors (#2700)
castastrophe Apr 26, 2024
e33dc74
chore: release (next) (#2706)
github-actions[bot] Apr 26, 2024
54677d2
feat(button): migrate to Spectrum 2 (#2600)
jawinn May 1, 2024
3c654b1
chore: release s2 button (next) (#2722)
github-actions[bot] May 1, 2024
4b69e3c
feat(progressbar): s2 migration (#2659)
mdt2 May 8, 2024
ec752f2
chore: release (next) (#2739)
github-actions[bot] May 9, 2024
b5e7f34
chore(tokens): use spectrum-tokens@13.0.0-beta.35 (#2797)
pfulton May 30, 2024
c86645f
chore: release (next) (#2798)
github-actions[bot] May 30, 2024
30706e7
refactor(button): remove spectrum-ButtonWithFocusRing extend (#2725)
jawinn May 30, 2024
d9e72ec
chore: release (next) (#2801)
github-actions[bot] Jun 4, 2024
1ec6510
docs(dropshadow): add stories and docs for dropshadow (#2674)
rise-erpelding Jun 4, 2024
19dde86
feat(picker)!: migrate to spectrum 2 (#2697)
jawinn Jun 18, 2024
fd4da4e
feat(statuslight): s2 migration (#2818)
marissahuysentruyt Jun 28, 2024
d39a150
feat(tooltip): s2 migration (#2743)
mdt2 Jul 19, 2024
5665900
chore: release (next) (#2852)
github-actions[bot] Aug 12, 2024
d92b6fa
chore(tokens): use spectrum-tokens@13.0.0-beta.52 (#3351)
cdransf Oct 30, 2024
8613f4e
chore: release (next) (#3353)
github-actions[bot] Nov 1, 2024
ad8796f
feat(avatar): migrate s2 avatar (#3355)
cdransf Nov 8, 2024
e7e758f
feat(colorloupe): migrate to s2 drop-shadow tokens (#3301)
rise-erpelding Nov 12, 2024
1d8872e
feat(thumbnail): S2 migration (#3367)
cdransf Nov 12, 2024
da793ee
feat(colorarea): S2 migration (#3388)
cdransf Nov 15, 2024
e2cfa3f
feat(thumbnail-opacity-checkboard): S2 migration (#3394)
cdransf Nov 19, 2024
61996d7
build: align tooling with s2-foundations branch
castastrophe Dec 4, 2024
c992003
fix(pagination): deprecate legacy features to align with foundations
castastrophe Dec 4, 2024
c1a9f4f
feat(dialog): s2 standard dialog migration (#2860)
marissahuysentruyt Dec 9, 2024
b968966
chore: release (next) (#3379)
github-actions[bot] Dec 16, 2024
2c43c65
fix(icon): fix for icons not loading (#3454)
jawinn Dec 18, 2024
4e7b1fb
feat(alertbanner): migrate to spectrum 2 (#2652)
jawinn Dec 19, 2024
529733e
chore(tokens): use spectrum-tokens@13.0.0-beta.55 (#3456)
cdransf Dec 19, 2024
6e299d4
chore: release (next) (#3457)
github-actions[bot] Dec 19, 2024
1415f76
chore(storybook): standardize down-state decorator
castastrophe Dec 24, 2024
828fec1
build: remove theme processing, site package; add reporter
castastrophe Dec 24, 2024
9444cdb
build: add story exports; remove context from storybook
castastrophe Dec 27, 2024
9d7f088
chore: align peerDependencies to local versions
castastrophe Dec 29, 2024
616f2a7
fix: use new tag to hide storybook foundations stories (#3474)
jawinn Jan 3, 2025
52e773e
fix: restore undefined custom properties [part 5] (#3475)
5t3ph Jan 6, 2025
ab2028a
fix: restore undefined custom properties [part 4] (#3473)
jawinn Jan 6, 2025
24c6ad3
fix(textfield,menu,tag,toast,tabs,well,popover): define custom props …
rise-erpelding Jan 6, 2025
dd96363
docs(avatar): update sizing documentation (#3483)
marissahuysentruyt Jan 8, 2025
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
Prev Previous commit
Next Next commit
docs(dropshadow): add stories and docs for dropshadow (#2674)
  • Loading branch information
rise-erpelding authored and castastrophe committed Dec 29, 2024
commit 1ec651023f0aebc8afc243e03f7782288ca3006d
86 changes: 86 additions & 0 deletions .storybook/foundations/drop-shadow/drop-shadow.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Meta, Title, Story, Description } from '@storybook/blocks';
import * as DropShadowStories from './drop-shadow.stories.js';


<Meta of={DropShadowStories} />

<Title />
<Description of={DropShadowStories} />

Drop shadow tokens may be used for box shadows or drop shadows in CSS. Using `box-shadow` is often preferable to using `filter: drop-shadow()`, but in situations where the shadow must be applied to the alpha channel of the content rather than the border box, or if `box-shadow` is already being used for a different purpose, such as a focus outline, `filter: drop-shadow()` may be used. Note that in cases where `filter: drop-shadow()` is used, the shadow may be more blurred than the design spec due to a difference in how the blur parameter is calculated, and an adjustment by half may be needed.

The opacity values in dark shadow colors are 3x the light values.

These single-layer shadows are an interim solution for shadows until complex tokens (additional design data for the Spectrum Tokens system) are available to support multi-layer shadows.

## Emphasized Default
This shadow is used to provide emphasis to containers within a page.

### `box-shadow`
<Story of={DropShadowStories.BoxShadowEmphasizedDefault} />
```
box-shadow:
var(--spectrum-drop-shadow-emphasized-default-x)
var(--spectrum-drop-shadow-emphasized-default-y)
var(--spectrum-drop-shadow-emphasized-default-blur)
var(--spectrum-drop-shadow-emphasized-default-color);
```

### `filter: drop-shadow()`
<Story of={DropShadowStories.DropShadowEmphasizedDefault} />
```
filter: drop-shadow(
var(--spectrum-drop-shadow-emphasized-default-x)
var(--spectrum-drop-shadow-emphasized-default-y)
calc(var(--spectrum-drop-shadow-emphasized-default-blur) / 2)
var(--spectrum-drop-shadow-emphasized-default-color)
);
```

## Emphasized Hover
If the whole container is interactive, such as in a select box, the shadow becomes elevated on hover.

### `box-shadow`
<Story of={DropShadowStories.BoxShadowEmphasizedHover} />
```
box-shadow:
var(--spectrum-drop-shadow-emphasized-hover-x)
var(--spectrum-drop-shadow-emphasized-hover-y)
var(--spectrum-drop-shadow-emphasized-hover-blur)
var(--spectrum-drop-shadow-emphasized-hover-color);
```

### `filter: drop-shadow()`
<Story of={DropShadowStories.DropShadowEmphasizedHover} />
```
filter: drop-shadow(
var(--spectrum-drop-shadow-emphasized-hover-x)
var(--spectrum-drop-shadow-emphasized-hover-y)
calc(var(--spectrum-drop-shadow-emphasized-hover-blur) / 2)
var(--spectrum-drop-shadow-emphasized-hover-color)
);
```

## Elevated
Elevated shadows can be used on containers that appear on top of content, such as menus, coach marks, popovers, and floating bar panels.

### `box-shadow`
<Story of={DropShadowStories.BoxShadowElevated} />
```
box-shadow:
var(--spectrum-drop-shadow-elevated-x)
var(--spectrum-drop-shadow-elevated-y)
var(--spectrum-drop-shadow-elevated-blur)
var(--spectrum-drop-shadow-elevated-color);
```

### `filter: drop-shadow()`
<Story of={DropShadowStories.DropShadowElevated} />
```
filter: drop-shadow(
var(--spectrum-drop-shadow-elevated-x)
var(--spectrum-drop-shadow-elevated-y)
calc(var(--spectrum-drop-shadow-elevated-blur) / 2)
var(--spectrum-drop-shadow-elevated-color)
);
```
74 changes: 74 additions & 0 deletions .storybook/foundations/drop-shadow/drop-shadow.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";
import "./index.css";

export default {
title: "Foundations/Drop shadow",
description: "Drop shadows draw attention and give the appearance of depth. By default, this style is used to show elevation, when content appears on top of other content.",
component: "Drop shadow",
tags: ['foundation'],
}

const DropShadowSwatch = ({rootClass = "spectrum-Foundations-Example-DropShadow-swatch", variant, ...args}) => {
const { isDropShadow } = args;
return html`
<div class=${classMap({
[rootClass]: true,
[`${rootClass}--${variant}-drop-shadow`]: typeof variant !== undefined && !!isDropShadow,
[`${rootClass}--${variant}-box-shadow`]: typeof variant !== undefined && !isDropShadow,
})}></div>
`;}

const DropShadowBackground = ({rootClass = "spectrum-Foundations-Example-swatch-container", color, ...args}) => html`
<div class=${classMap({
[rootClass]: true,
"spectrum--light": color === "light",
"spectrum--dark": color === "dark",
})}>
${DropShadowSwatch(args)}
</div>
`;

const DropShadowVariant = ({...args}) => html`
<div class="spectrum-Foundations-Example-variant-container">
${DropShadowBackground({...args, color: "light"})}
${DropShadowBackground({...args, color: "dark"})}
</div>
`;


export const DropShadowEmphasizedDefault = DropShadowVariant.bind({});
DropShadowEmphasizedDefault.args = {
variant: "emphasized-default",
isDropShadow: true,
};

export const DropShadowEmphasizedHover = DropShadowVariant.bind({});
DropShadowEmphasizedHover.args = {
variant: "emphasized-hover",
isDropShadow: true,
};

export const DropShadowElevated = DropShadowVariant.bind({});
DropShadowElevated.args = {
variant: "elevated",
isDropShadow: true,
};

export const BoxShadowEmphasizedDefault = DropShadowVariant.bind({});
BoxShadowEmphasizedDefault.args = {
variant: "emphasized-default",
isDropShadow: false,
};

export const BoxShadowEmphasizedHover = DropShadowVariant.bind({});
BoxShadowEmphasizedHover.args = {
variant: "emphasized-hover",
isDropShadow: false,
};

export const BoxShadowElevated = DropShadowVariant.bind({});
BoxShadowElevated.args = {
variant: "elevated",
isDropShadow: false,
};
115 changes: 115 additions & 0 deletions .storybook/foundations/drop-shadow/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*!
Copyright 2024 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

/* stylelint-disable spectrum-tools/no-unknown-custom-properties */

.spectrum-Foundations-Example-DropShadow-swatch {
block-size: 150px;
inline-size: 150px;
background-color: var(--spectrum-gray-25);
border-radius: var(--spectrum-corner-radius-large-default);
border: transparent;
}

.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch {
background-color: var(--spectrum-gray-75); /* matches dark mode design spec rgb(34, 34, 34) */
}

.spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow {
box-shadow:
var(--spectrum-drop-shadow-emphasized-default-x)
var(--spectrum-drop-shadow-emphasized-default-y)
var(--spectrum-drop-shadow-emphasized-default-blur)
var(--mod-drop-shadow-emphasized-default-color, var(--spectrum-drop-shadow-emphasized-default-color));
}

.spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow {
filter: drop-shadow(
var(--spectrum-drop-shadow-emphasized-default-x)
var(--spectrum-drop-shadow-emphasized-default-y)
calc(var(--spectrum-drop-shadow-emphasized-default-blur) / 2) /* adjust blur by half of box-shadow */
var(--mod-drop-shadow-emphasized-default-color, var(--spectrum-drop-shadow-emphasized-default-color))
);
}

.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-box-shadow,
.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-default-drop-shadow {
/* adjustment because color tokens do not work properly on foundations pages */
--mod-drop-shadow-emphasized-default-color: var(--spectrum-drop-shadow-color-100);
}

.spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow {
box-shadow:
var(--spectrum-drop-shadow-emphasized-hover-x)
var(--spectrum-drop-shadow-emphasized-hover-y)
var(--spectrum-drop-shadow-emphasized-hover-blur)
var(--mod-drop-shadow-emphasized-hover-color, var(--spectrum-drop-shadow-emphasized-hover-color));
}

.spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow {
filter: drop-shadow(
var(--spectrum-drop-shadow-emphasized-hover-x)
var(--spectrum-drop-shadow-emphasized-hover-y)
calc(var(--spectrum-drop-shadow-emphasized-hover-blur) / 2) /* adjust blur by half of box-shadow */
var(--mod-drop-shadow-emphasized-hover-color, var(--spectrum-drop-shadow-emphasized-hover-color))
);
}

.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-drop-shadow,
.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--emphasized-hover-box-shadow {
/* adjustment because color tokens do not work properly on foundations pages */
--mod-drop-shadow-emphasized-hover-color: var(--spectrum-drop-shadow-color-200);
}

.spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow {
box-shadow:
var(--spectrum-drop-shadow-elevated-x)
var(--spectrum-drop-shadow-elevated-y)
var(--spectrum-drop-shadow-elevated-blur)
var(--mod-drop-shadow-elevated-color, var(--spectrum-drop-shadow-elevated-color));
}

.spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow {
filter: drop-shadow(
var(--spectrum-drop-shadow-elevated-x)
var(--spectrum-drop-shadow-elevated-y)
calc(var(--spectrum-drop-shadow-elevated-blur) / 2) /* adjust blur by half of box-shadow */
var(--mod-drop-shadow-elevated-color, var(--spectrum-drop-shadow-elevated-color))
);
}

.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--elevated-drop-shadow,
.spectrum--light .spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow,
.spectrum--dark .spectrum-Foundations-Example-DropShadow-swatch--elevated-box-shadow {
/* adjustment because color tokens do not work properly on foundations pages */
--mod-drop-shadow-elevated-color: var(--spectrum-drop-shadow-color-200);
}

.spectrum-Foundations-Example-swatch-container {
background-color: var(--spectrum-gray-25);
block-size: 200px;
inline-size: 300px;
display: flex;
align-items: center;
justify-content: center;
}

.spectrum-Foundations-Example-variant-container {
background-color: var(--spectrum-gray-25);
display: flex;
flex-direction: row;
}