From fe75eaadf79a9d8622dccbd5da7b028ad4fd7abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20De=20Fr=C3=A8ne?= Date: Sun, 15 Nov 2026 21:32:01 +0100 Subject: [PATCH 01/15] feat: use EDS CSS colour variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace colours from the @equinor/eds-tokens JavaScript `tokens` object and hard-coded colour literals with EDS colour-scheme-aware CSS custom properties (`var(--eds-color-…)`, `var(--eds-elevation-low)`), without literal fallbacks. - Components: ag-grid-utils, errorboundary, filter, hanging-garden, side-sheet, stepper and tabs. - fusion-web-theme maps legacy colour and typography tokens to EDS variables (`colorSchemeVariables`). - The side-sheet Indicator accepts `var(--…)` (`IndicatorColor`) and defaults to an EDS danger colour. - Storybook's preview body uses the EDS neutral surface background (`--eds-color-bg-neutral-surface`) and text colour variables. - Docs and changesets describe the convention. Ref: equinor/fusion-core-tasks#2755 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .changeset/dark-mode-component-colours.md | 12 +++ .changeset/dark-mode-web-theme.md | 7 ++ .changeset/side-sheet-indicator-colour.md | 9 ++ CONTRIBUTING.md | 9 +- .../src/changeHandlerUtils/StatusIcon.tsx | 10 +-- .../errorboundary/src/legacy/Fallback.tsx | 7 +- .../components/filter/FilterOptionHeader.tsx | 4 +- .../filter/checkbox/CheckboxFilter.style.ts | 2 +- .../checkbox/CheckboxFilterOption.style.ts | 4 +- .../src/components/panel/FilterPanel.tsx | 4 +- .../src/components/PopoverContainer/Arrow.tsx | 8 +- .../src/components/PopoverContainer/index.tsx | 4 +- packages/side-sheet/README.md | 14 +-- .../side-sheet/src/components/Indicator.tsx | 12 ++- .../side-sheet/src/components/SideSheet.tsx | 7 +- packages/side-sheet/src/index.ts | 2 +- packages/stepper/src/Step.tsx | 22 ++--- packages/stepper/src/StepBadge.tsx | 14 +-- packages/stepper/src/StepperContent.tsx | 2 +- packages/tabs/src/components/Tabs.tsx | 3 +- packages/theme/README.md | 19 ++++ packages/theme/src/styles/colors.ts | 75 +++++++++++++++- packages/theme/src/styles/typography.ts | 19 +++- .../tests/__snapshots__/colors.test.ts.snap | 88 +++++++++---------- packages/theme/tests/colors.test.ts | 57 +++++++++--- storybook/.storybook/preview-head.html | 7 ++ .../stories/sidesheet/side-sheet.stories.tsx | 6 +- 27 files changed, 301 insertions(+), 126 deletions(-) create mode 100644 .changeset/dark-mode-component-colours.md create mode 100644 .changeset/dark-mode-web-theme.md create mode 100644 .changeset/side-sheet-indicator-colour.md diff --git a/.changeset/dark-mode-component-colours.md b/.changeset/dark-mode-component-colours.md new file mode 100644 index 000000000..df1e0e21b --- /dev/null +++ b/.changeset/dark-mode-component-colours.md @@ -0,0 +1,12 @@ +--- +"@equinor/fusion-react-tabs": patch +"@equinor/fusion-react-stepper": patch +"@equinor/fusion-react-errorboundary": patch +"@equinor/fusion-react-ag-grid-utils": patch +"@equinor/fusion-react-filter": patch +"@equinor/fusion-react-hanging-garden": patch +--- + +Use EDS colour-scheme-aware CSS variables (`var(--eds-color-…)`, and `var(--eds-elevation-low)` for the hanging-garden popover shadow) instead of static colours from the `@equinor/eds-tokens` JavaScript `tokens` object or hard-coded values. No literal colour fallbacks are kept, so the host must load the EDS colour variables. Components now follow `data-color-scheme` (light/dark). Spacing and typography sizes still come from `tokens`. The hanging-garden canvas (PIXI) colours remain static. + +Ref: equinor/fusion-core-tasks#2755 diff --git a/.changeset/dark-mode-web-theme.md b/.changeset/dark-mode-web-theme.md new file mode 100644 index 000000000..268424472 --- /dev/null +++ b/.changeset/dark-mode-web-theme.md @@ -0,0 +1,7 @@ +--- +"@equinor/fusion-web-theme": minor +--- + +Most colour properties now resolve to an EDS 2.x `--eds-color-*` CSS variable (from `@equinor/eds-tokens/css/variables`) without a literal fallback, so the host must load the EDS colour variables. Infographic, logo and overlay colours stay static. Typography colours resolve to EDS 2.x text variables in the same way. The new `colorSchemeVariables` export documents the colour mapping. + +Ref: equinor/fusion-core-tasks#2755 diff --git a/.changeset/side-sheet-indicator-colour.md b/.changeset/side-sheet-indicator-colour.md new file mode 100644 index 000000000..37a61e7a4 --- /dev/null +++ b/.changeset/side-sheet-indicator-colour.md @@ -0,0 +1,9 @@ +--- +"@equinor/fusion-react-side-sheet": minor +--- + +Use EDS colour-scheme-aware CSS variables instead of static `tokens` colours, so the side sheet follows `data-color-scheme` (light/dark). The host must load the EDS colour variables. + +The `Indicator` now also accepts a CSS variable (`var(--…)`) as `color`, through the new exported `IndicatorColor` and `CSSVariableString` types, and defaults to `var(--eds-color-bg-danger-fill-emphasis-default)`. + +Ref: equinor/fusion-core-tasks#2755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20f0cb9c9..efd801b0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,7 +52,8 @@ which the HTML parser merges onto the preview document's root element before any styles load. EDS then resolves its light CSS variables and applies `color-scheme: light`, so EDS colours and native controls stay light on initial load and when the OS/browser preference changes, including docs canvases and -content portaled to `body`. +content portaled to `body`. The body uses the EDS neutral surface background +and text colours from `preview-head.html`. Only the preview, where components use EDS CSS variables, is affected; the Storybook manager UI is left unchanged. @@ -80,6 +81,12 @@ content. The preview root must keep `data-color-scheme="light"`, EDS colors must remain light, and preview native controls must resolve to `color-scheme: light`. +### Colours + +Style components with EDS CSS custom properties (`var(--eds-color-…)`), not the JavaScript +`tokens` object from `@equinor/eds-tokens`, whose colours are static light values. Do not +hard-code colours or add literal fallbacks inside `var()`. + ## Development While Storybook is running open a new terminal and compile the project diff --git a/packages/ag-grid-utils/src/changeHandlerUtils/StatusIcon.tsx b/packages/ag-grid-utils/src/changeHandlerUtils/StatusIcon.tsx index 91cb91565..fc9a5a9dc 100644 --- a/packages/ag-grid-utils/src/changeHandlerUtils/StatusIcon.tsx +++ b/packages/ag-grid-utils/src/changeHandlerUtils/StatusIcon.tsx @@ -2,8 +2,6 @@ import type { FC } from 'react'; import { AGGridDataStatus } from './constants'; -import { tokens } from '@equinor/eds-tokens'; - import { Icon } from '@equinor/eds-core-react'; import { check, check_circle_outlined, new_label } from '@equinor/eds-icons'; Icon.add({ check, check_circle_outlined, new_label }); @@ -18,13 +16,11 @@ type StatusIconProps = { readonly status?: AGGridDataStatus }; export const StatusIcon: FC = ({ status }) => { switch (status) { case AGGridDataStatus.NEW: - return ; + return ; case AGGridDataStatus.PATCHED: - return ( - - ); + return ; case AGGridDataStatus.FETCHED: - return ; + return ; } return null; }; diff --git a/packages/errorboundary/src/legacy/Fallback.tsx b/packages/errorboundary/src/legacy/Fallback.tsx index 9997d7436..c23ac906f 100644 --- a/packages/errorboundary/src/legacy/Fallback.tsx +++ b/packages/errorboundary/src/legacy/Fallback.tsx @@ -19,7 +19,7 @@ const Styled = { stacktrace: styled.pre` overflow: auto; max-width: 100%; - color: ${tokens.colors.interactive.danger__resting.hex}; + color: var(--eds-color-text-danger-subtle); font-size: 0.8em; line-height: 1em; margin: 0; @@ -68,10 +68,7 @@ export const Fallback = (props: FallbackProps): ReactElement => {
{props.icon ?? } {title ?? generateTitle(errorType, resourceName)} - + {message ?? error.message} diff --git a/packages/filter/src/components/filter/FilterOptionHeader.tsx b/packages/filter/src/components/filter/FilterOptionHeader.tsx index 3e9178209..4528533d6 100644 --- a/packages/filter/src/components/filter/FilterOptionHeader.tsx +++ b/packages/filter/src/components/filter/FilterOptionHeader.tsx @@ -22,7 +22,7 @@ const Styled = { align-items: center; `, Header: styled.header<{ $showSearch?: boolean }>` - color: ${tokens.typography.table.cell_header.color}; + color: var(--eds-color-text-neutral-strong); font-family: ${tokens.typography.table.cell_header.fontFamily}; font-size: ${tokens.typography.table.cell_header.fontSize}; font-weight: ${tokens.typography.table.cell_header.fontWeight}; @@ -33,7 +33,7 @@ const Styled = { Counter: styled.span<{ $noCount?: boolean }>` display: ${({ $noCount }) => ($noCount ? 'none' : 'inline-flex')}; gap: 1px; - color: ${tokens.typography.input.helper.color}; + color: var(--eds-color-text-neutral-strong); font-family: ${tokens.typography.input.helper.fontFamily}; font-size: ${tokens.typography.input.helper.fontSize}; font-weight: ${tokens.typography.input.helper.fontWeight}; diff --git a/packages/filter/src/components/filter/checkbox/CheckboxFilter.style.ts b/packages/filter/src/components/filter/checkbox/CheckboxFilter.style.ts index e677e05ed..0c29bea16 100644 --- a/packages/filter/src/components/filter/checkbox/CheckboxFilter.style.ts +++ b/packages/filter/src/components/filter/checkbox/CheckboxFilter.style.ts @@ -13,7 +13,7 @@ export const Styled = { overflow-y: auto; `, Title: styled.span` - color: ${tokens.typography.heading.h3.color}; + color: var(--eds-color-text-neutral-strong); font-family: ${tokens.typography.heading.h3.fontFamily}; font-size: ${tokens.typography.heading.h3.fontSize}; font-weight: ${tokens.typography.heading.h3.fontWeight}; diff --git a/packages/filter/src/components/filter/checkbox/CheckboxFilterOption.style.ts b/packages/filter/src/components/filter/checkbox/CheckboxFilterOption.style.ts index b55263d06..e0eaa10ae 100644 --- a/packages/filter/src/components/filter/checkbox/CheckboxFilterOption.style.ts +++ b/packages/filter/src/components/filter/checkbox/CheckboxFilterOption.style.ts @@ -12,7 +12,7 @@ export const Styled = { transition: 125ms background-color ease-out; &:hover { - background-color: ${tokens.colors.interactive.primary__hover_alt.rgba}; + background-color: var(--eds-color-bg-accent-fill-muted-default); } ${({ $inactive }) => @@ -29,7 +29,7 @@ export const Styled = { `} `, Counter: styled.span` - color: ${tokens.typography.input.label.color}; + color: var(--eds-color-text-neutral-strong); font-family: ${tokens.typography.input.label.fontFamily}; font-size: ${tokens.typography.input.label.fontSize}; font-weight: ${tokens.typography.input.label.fontWeight}; diff --git a/packages/filter/src/components/panel/FilterPanel.tsx b/packages/filter/src/components/panel/FilterPanel.tsx index ebb5e6aef..e088f6b6a 100644 --- a/packages/filter/src/components/panel/FilterPanel.tsx +++ b/packages/filter/src/components/panel/FilterPanel.tsx @@ -20,7 +20,7 @@ const Styled = { flex-flow: column; gap: var(--filter-panel-spacing); padding: var(--filter-panel-spacing); - border: 1px solid ${tokens.colors.interactive.disabled__border.rgba}; + border: 1px solid var(--eds-color-border-disabled); border-radius: 0.5rem; & > * { padding: 0 var(--filter-panel-spacing); @@ -32,7 +32,7 @@ const Styled = { overflow-y: hidden; padding-bottom: calc(var(--filter-panel-spacing)); margin-bottom: calc(var(--filter-panel-spacing) * -1); - background-color: ${tokens.colors.ui.background__light.rgba}; + background-color: var(--eds-color-bg-neutral-canvas); `, }; diff --git a/packages/hanging-garden/src/components/PopoverContainer/Arrow.tsx b/packages/hanging-garden/src/components/PopoverContainer/Arrow.tsx index b259b2477..4f7eab63c 100644 --- a/packages/hanging-garden/src/components/PopoverContainer/Arrow.tsx +++ b/packages/hanging-garden/src/components/PopoverContainer/Arrow.tsx @@ -27,12 +27,14 @@ const Arrow = (): ReactElement => { > ); diff --git a/packages/hanging-garden/src/components/PopoverContainer/index.tsx b/packages/hanging-garden/src/components/PopoverContainer/index.tsx index df1b1778e..93f1ea73e 100644 --- a/packages/hanging-garden/src/components/PopoverContainer/index.tsx +++ b/packages/hanging-garden/src/components/PopoverContainer/index.tsx @@ -9,10 +9,10 @@ const useStyles = makeStyles(() => createStyles({ root: { padding: '16px', - backgroundColor: 'white', + backgroundColor: 'var(--eds-color-bg-neutral-surface)', borderRadius: '4px', position: 'absolute', - boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.2), 0px 2px 2px rgba(0, 0, 0, 0.12), 0px 0px 2px rgba(0, 0, 0, 0.14)', + boxShadow: 'var(--eds-elevation-low)', transform: 'translateX(-50%)', marginTop: '8px', }, diff --git a/packages/side-sheet/README.md b/packages/side-sheet/README.md index ab2700ff7..a7c63ed5a 100644 --- a/packages/side-sheet/README.md +++ b/packages/side-sheet/README.md @@ -15,13 +15,13 @@ npm install @equinor/fusion-react-side-sheet ## Children -| Name | Props | Description | -| ----------- | ------------------ | ----------------------------------------------- | -| `Title` | title | Required child for displaying side sheet title. | -| `SubTile` | subTitle | ... | -| `Actions` | sideSheetRef | ... | -| `Indicator` | color | ... | -| `Content` | ReactChildElements | ... | +| Name | Props | Description | +| ----------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Title` | title | Required child for displaying side sheet title. | +| `SubTile` | subTitle | ... | +| `Actions` | sideSheetRef | ... | +| `Indicator` | color | Colour bar next to the title. Accepts an EDS CSS custom property such as `var(--eds-color-bg-accent-fill-emphasis-default)` (preferred, follows the colour scheme) or a hex string. | +| `Content` | ReactChildElements | ... | ## Properties/Attributes diff --git a/packages/side-sheet/src/components/Indicator.tsx b/packages/side-sheet/src/components/Indicator.tsx index d59fb0c76..d04700597 100644 --- a/packages/side-sheet/src/components/Indicator.tsx +++ b/packages/side-sheet/src/components/Indicator.tsx @@ -1,15 +1,21 @@ import styled from 'styled-components'; -const StyledIndicator = styled.span<{ color?: HEXString }>` - background-color: ${({ color }) => color || 'red'}; +const StyledIndicator = styled.span<{ color?: IndicatorColor }>` + background-color: ${({ color }) => color || 'var(--eds-color-bg-danger-fill-emphasis-default)'}; height: 3rem; width: 8px; margin-right: 1rem; border-radius: 2px; `; -export const Indicator = ({ color }: { readonly color?: HEXString }) => { +/** + * Indicator colour. Prefer an EDS CSS custom property such as + * `var(--eds-color-bg-accent-fill-emphasis-default)` so the colour follows the colour scheme. + */ +export const Indicator = ({ color }: { readonly color?: IndicatorColor }) => { return ; }; export type HEXString = `#${string}`; +export type CSSVariableString = `var(--${string})`; +export type IndicatorColor = HEXString | CSSVariableString; diff --git a/packages/side-sheet/src/components/SideSheet.tsx b/packages/side-sheet/src/components/SideSheet.tsx index 4917c3f25..dad9e102b 100644 --- a/packages/side-sheet/src/components/SideSheet.tsx +++ b/packages/side-sheet/src/components/SideSheet.tsx @@ -8,12 +8,11 @@ import { import { Button, Icon, Tooltip } from '@equinor/eds-core-react'; import { close as closeIcon } from '@equinor/eds-icons'; -import { tokens } from '@equinor/eds-tokens'; import { type PropsWithChildren, useRef } from 'react'; import { Actions } from './Actions'; import { Content } from './Content'; import { FullscreenIcon } from './icon/FullscreenIcon'; -import { type HEXString, Indicator } from './Indicator'; +import { type IndicatorColor, Indicator } from './Indicator'; import { SubTitle } from './SubTitle'; import { Title } from './Title'; @@ -31,7 +30,7 @@ const StyledFlexColumn = styled(StyledFlexBox)` `; const StyledContainerWrapper = styled(StyledFlexColumn)` - background: ${tokens.colors.ui.background__default.hex}; + background: var(--eds-color-bg-neutral-surface); height: 100%; `; @@ -55,7 +54,7 @@ type PortalSideSheet = SideSheetProps & { }; type SideSheetComponents = { - indicator?: ReactElement>; + indicator?: ReactElement>; title?: ReactElement>; subTitle?: ReactElement>; actions?: ReactElement>>; diff --git a/packages/side-sheet/src/index.ts b/packages/side-sheet/src/index.ts index 6f9d29112..9e43117ac 100644 --- a/packages/side-sheet/src/index.ts +++ b/packages/side-sheet/src/index.ts @@ -1,2 +1,2 @@ export { SideSheet, default } from './components/SideSheet'; -export type { HEXString } from './components/Indicator'; +export type { CSSVariableString, HEXString, IndicatorColor } from './components/Indicator'; diff --git a/packages/stepper/src/Step.tsx b/packages/stepper/src/Step.tsx index e541793c3..e332cb7ff 100644 --- a/packages/stepper/src/Step.tsx +++ b/packages/stepper/src/Step.tsx @@ -42,11 +42,11 @@ const Styled = { width: calc(100% - var(--badge-size) - calc(var(--spacing) * 2)); left: 50%; height: 1px; - background-color: ${tokens.colors.interactive.disabled__border.hex}; + background-color: var(--eds-color-border-disabled); order: -1; } &:focus-visible { - outline: 2px dashed ${tokens.colors.interactive.primary__resting.hex}; + outline: 2px dashed var(--eds-color-border-accent-strong); outline-offset: 2px; } ${({ $vertical, $horizontalTitle }) => @@ -83,15 +83,15 @@ const Styled = { $done && css` &:not(:last-child):after { - background-color: ${tokens.colors.interactive.primary__resting.hex}; + background-color: var(--eds-color-bg-accent-fill-emphasis-default); } `} ${({ $disabled }) => $disabled && css` pointer-events: none; - color: ${tokens.colors.interactive.disabled__text.hex}; - --line-color: ${tokens.colors.interactive.disabled__border.hex}; + color: var(--eds-color-text-disabled); + --line-color: var(--eds-color-border-disabled); `} `, Content: styled.div` @@ -181,11 +181,7 @@ export const Step = ({ group="paragraph" variant="body_short" color={ - isCurrent - ? 'primary' - : disabled - ? 'disabled' - : tokens.colors.text.static_icons__default.hex + isCurrent ? 'primary' : disabled ? 'disabled' : 'var(--eds-color-text-neutral-strong)' } > {title} @@ -194,11 +190,7 @@ export const Step = ({ group="paragraph" variant="caption" color={ - isCurrent - ? 'primary' - : disabled - ? 'disabled' - : tokens.colors.text.static_icons__tertiary.hex + isCurrent ? 'primary' : disabled ? 'disabled' : 'var(--eds-color-text-neutral-subtle)' } > {description} diff --git a/packages/stepper/src/StepBadge.tsx b/packages/stepper/src/StepBadge.tsx index df10500e5..b57791687 100644 --- a/packages/stepper/src/StepBadge.tsx +++ b/packages/stepper/src/StepBadge.tsx @@ -15,19 +15,19 @@ const Styled = { switch (true) { case $active: return css` - border: 1px solid ${tokens.colors.interactive.primary__resting.hex}; - background-color: ${tokens.colors.interactive.primary__resting.hex}; - color: ${tokens.colors.text.static_icons__primary_white.hex}; + border: 1px solid var(--eds-color-bg-accent-fill-emphasis-default); + background-color: var(--eds-color-bg-accent-fill-emphasis-default); + color: var(--eds-color-text-accent-strong-on-emphasis); `; case $done: return css` - border: 1px solid ${tokens.colors.interactive.primary__resting.hex}; - color: ${tokens.colors.interactive.primary__resting.hex}; + border: 1px solid var(--eds-color-border-accent-strong); + color: var(--eds-color-text-accent-subtle); `; default: return css` - border: 1px solid ${tokens.colors.interactive.disabled__border.hex}; - color: ${tokens.colors.text.static_icons__default.hex}; + border: 1px solid var(--eds-color-border-disabled); + color: var(--eds-color-text-neutral-strong); `; } }} diff --git a/packages/stepper/src/StepperContent.tsx b/packages/stepper/src/StepperContent.tsx index acab02bb0..ef83befd3 100644 --- a/packages/stepper/src/StepperContent.tsx +++ b/packages/stepper/src/StepperContent.tsx @@ -14,7 +14,7 @@ const Styled = { --spacing-vertical: 5px; --spacing-between-vartical-steps: ${tokens.spacings.comfortable.x_large}; --spacing-between-horizontal-steps: ${tokens.spacings.comfortable.medium}; - --stepper-divider: 1px solid ${tokens.colors.interactive.disabled__border.hex}; + --stepper-divider: 1px solid var(--eds-color-border-disabled); display: flex; flex-direction: ${(props) => (props.$vertical ? 'row' : 'column')}; height: 100%; diff --git a/packages/tabs/src/components/Tabs.tsx b/packages/tabs/src/components/Tabs.tsx index 4ea41a860..7cba79ddf 100644 --- a/packages/tabs/src/components/Tabs.tsx +++ b/packages/tabs/src/components/Tabs.tsx @@ -1,6 +1,5 @@ import type { PropsWithChildren, ReactElement } from 'react'; import { Tabs as EdsTabs } from '@equinor/eds-core-react'; -import { tokens } from '@equinor/eds-tokens'; import { useCallback } from 'react'; import { styled } from 'styled-components'; import { useActiveTab } from '../hooks/use-active-tab'; @@ -26,7 +25,7 @@ const Line = styled.div` width: 100%; height: 2px; margin-top: -2px; - background-color: ${tokens.colors.ui.background__medium.rgba}; + background-color: var(--eds-color-bg-neutral-fill-muted-default); `; export type TabsProps = { diff --git a/packages/theme/README.md b/packages/theme/README.md index 44d9ef092..e7cad7c53 100644 --- a/packages/theme/README.md +++ b/packages/theme/README.md @@ -35,6 +35,25 @@ that media query. Consumers using modern EDS must explicitly set `data-color-scheme="light"` on `html` to select its light palette. This package does not set that attribute or choose a modern EDS palette. +## EDS colour variables + +Most colour properties resolve to an EDS 2.x colour-scheme-aware CSS custom property, +without a literal colour fallback, for example: + +```css +var(--fusion-color__interactive-primary__resting, var(--eds-color-bg-accent-fill-emphasis-default)) +``` + +- The `--eds-color-*` variables come from `@equinor/eds-tokens/css/variables` (2.x). + Load that stylesheet (for example through `ThemeProvider` from + `@equinor/fusion-react-styles`); the host must load it, because mapped colours have no literal fallback. +- `colorSchemeVariables` in `src/styles/colors.ts` is a Fusion-owned approximation: + EDS publishes no official legacy-to-2.x mapping. Infographic, logo, snackbar link and + overlay/scrim colours are intentionally unmapped and stay static. +- Typography colours resolve to `--eds-color-text-neutral-strong` (paragraph links: + `--eds-color-text-accent-subtle`), including `--fusion-typography__base-color`. +- `hex` and `hsla` values remain the static legacy light values. + ## Development From the repository root: diff --git a/packages/theme/src/styles/colors.ts b/packages/theme/src/styles/colors.ts index cad38938e..2edba358d 100644 --- a/packages/theme/src/styles/colors.ts +++ b/packages/theme/src/styles/colors.ts @@ -28,12 +28,85 @@ export class ColorStyleProperty extends StyleProperty> = { + interactive: { + primary__selected_highlight: '--eds-color-bg-accent-fill-muted-default', + primary__selected_hover: '--eds-color-bg-accent-fill-muted-hover', + primary__resting: '--eds-color-bg-accent-fill-emphasis-default', + primary__hover: '--eds-color-bg-accent-fill-emphasis-hover', + primary__hover_alt: '--eds-color-bg-accent-fill-muted-default', + secondary__highlight: '--eds-color-bg-info-fill-muted-default', + secondary__resting: '--eds-color-bg-neutral-fill-emphasis-default', + secondary__link_hover: '--eds-color-bg-neutral-fill-emphasis-hover', + danger__highlight: '--eds-color-bg-danger-fill-muted-default', + danger__resting: '--eds-color-bg-danger-fill-emphasis-default', + danger__hover: '--eds-color-bg-danger-fill-emphasis-hover', + danger__text: '--eds-color-text-danger-subtle', + warning__highlight: '--eds-color-bg-warning-fill-muted-default', + warning__resting: '--eds-color-bg-warning-fill-emphasis-default', + warning__hover: '--eds-color-bg-warning-fill-emphasis-hover', + warning__text: '--eds-color-text-warning-subtle', + success__highlight: '--eds-color-bg-success-fill-muted-default', + success__resting: '--eds-color-bg-success-fill-emphasis-default', + success__hover: '--eds-color-bg-success-fill-emphasis-hover', + success__text: '--eds-color-text-success-subtle', + table__cell__fill_resting: '--eds-color-bg-neutral-surface', + table__cell__fill_hover: '--eds-color-bg-neutral-fill-muted-default', + table__cell__fill_activated: '--eds-color-bg-accent-fill-muted-default', + table__header__fill_activated: '--eds-color-bg-neutral-fill-muted-default', + table__header__fill_hover: '--eds-color-bg-neutral-fill-muted-hover', + table__header__fill_resting: '--eds-color-bg-neutral-canvas', + disabled__text: '--eds-color-text-disabled', + text_highlight: '--eds-color-bg-info-fill-muted-default', + focus: '--eds-color-border-focus', + disabled__border: '--eds-color-border-disabled', + disabled__fill: '--eds-color-bg-disabled', + link_on_interactive_colors: '--eds-color-text-accent-strong-on-emphasis', + icon_on_interactive_colors: '--eds-color-text-accent-strong-on-emphasis', + }, + text: { + static_icons__default: '--eds-color-text-neutral-strong', + static_icons__secondary: '--eds-color-text-neutral-subtle', + static_icons__tertiary: '--eds-color-text-neutral-subtle', + static_icons__primary_white: '--eds-color-text-accent-strong-on-emphasis', + }, + ui: { + background__default: '--eds-color-bg-neutral-surface', + background__light: '--eds-color-bg-neutral-canvas', + background__medium: '--eds-color-bg-neutral-fill-muted-default', + background__info: '--eds-color-bg-info-fill-muted-default', + background__warning: '--eds-color-bg-warning-fill-muted-default', + background__danger: '--eds-color-bg-danger-fill-muted-default', + }, +}; + +/** + * Replace the legacy `var(--eds_*, rgba(...))` value with the mapped EDS 2.x variable. + * No literal fallback is kept: the legacy `--eds_*` variables and literal values are static + * light colours, and the host provides the EDS colour variables. + */ +const withColorScheme = (color: Color, variable?: string): Color => + variable ? { ...color, rgba: `var(${variable})` } : color; + const createStyleProperty = , Tkey extends keyof T>( obj: T, name: string, ): Record => Object.keys(obj).reduce( - (cur, key) => Object.assign(cur, { [key]: new ColorStyleProperty(`${name}-${key}`, obj[key]) }), + (cur, key) => + Object.assign(cur, { + [key]: new ColorStyleProperty( + `${name}-${key}`, + withColorScheme(obj[key], colorSchemeVariables[name]?.[key]), + ), + }), {} as Record, ); diff --git a/packages/theme/src/styles/typography.ts b/packages/theme/src/styles/typography.ts index 208476031..14788488c 100644 --- a/packages/theme/src/styles/typography.ts +++ b/packages/theme/src/styles/typography.ts @@ -2,6 +2,21 @@ import { tokens, type Typography } from '@equinor/eds-tokens'; import { StyleProperty, type StyleAttribute } from '../style-property'; type TypographyAttribute = keyof Typography; + +const legacyColorPattern = /^var\(--eds_[a-z0-9_]+, (rgba?\([^)]+\))\)$/; + +/** + * Resolves a legacy EDS typography colour to an EDS 2.x colour-scheme-aware variable, + * without a literal fallback. Link variants use the accent text colour. + */ +export const withTypographyColorScheme = (name: string, color?: string): string | undefined => { + if (!color || !legacyColorPattern.test(color)) return color; + const variable = + name.endsWith('_link') && !name.startsWith('table-') + ? '--eds-color-text-accent-subtle' + : '--eds-color-text-neutral-strong'; + return `var(${variable})`; +}; export class TypographyStyleProperty extends StyleProperty { get attributes() { const { name, value } = this; @@ -10,7 +25,7 @@ export class TypographyStyleProperty extends StyleProperty { +describe('color scheme', () => { test('includes one standalone light-only declaration before the color variables', () => { expect(colorVariables[0]).toBe(nativeColorScheme); - expect(colorVariables.filter((value) => value.startsWith('color-scheme:'))).toEqual([ + expect(attributes.filter((value) => value.startsWith('color-scheme:'))).toEqual([ nativeColorScheme, ]); }); - test('preserves the previous color variable values and order', () => { + test('keeps the color variable names and order', () => { expect(colorVariables.slice(1)).toHaveLength(75); expect(colorVariables.slice(1)).toMatchSnapshot(); }); - test('inherits the declaration exactly once in aggregate attributes', () => { - expect(attributes.filter((value) => value.startsWith('color-scheme:'))).toEqual([ - nativeColorScheme, - ]); + test('maps colours to EDS 2.x variables without a literal fallback', () => { + for (const [group, mapping] of Object.entries(colorSchemeVariables)) { + const legacy = tokens.colors[group as keyof typeof tokens.colors] as Record; + const properties = colors[group as keyof typeof colors] as Record; + for (const [key, variable] of Object.entries(mapping)) { + expect(legacy).toHaveProperty(key); + expect(properties[key].getVariable('color')).toMatch( + new RegExp(`^var\\(--fusion-color__${group}-${key},var\\(${variable}\\)\\)$`), + ); + } + } + }); + + test('keeps static brand colours', () => { + expect(colors.infographic.primary__moss_green_100.getVariable('color')).toContain( + '--eds_infographic_primary__moss_green_100', + ); + expect(colors.logo.fill_positive.getVariable('color')).toContain('--eds_logo__fill_positive'); + }); + + test('maps typography colours to EDS 2.x text variables', () => { + expect(typography.heading.h1.getVariable('color')).toContain( + 'var(--eds-color-text-neutral-strong)', + ); + expect(typography.paragraph.body_long_link.getVariable('color')).toContain( + 'var(--eds-color-text-accent-subtle)', + ); + expect(typographyVariables.at(-1)).toBe( + '--fusion-typography__base-color:var(--eds-color-text-neutral-strong)', + ); + }); + + test('aggregates the attributes from each style group', () => { expect(attributes).toEqual([ ...colorVariables, ...elevationVariables, @@ -47,8 +82,8 @@ describe('native control color scheme', () => { const { attributes } = await import(${JSON.stringify( new URL('../dist/index.js', import.meta.url).href, )}); - if (!attributes.includes(${JSON.stringify(nativeColorScheme)})) { - throw new Error('Missing native color scheme declaration'); + if (!attributes.length) { + throw new Error('Missing theme attributes'); } `, ], diff --git a/storybook/.storybook/preview-head.html b/storybook/.storybook/preview-head.html index 2e4f18872..e67d4a786 100644 --- a/storybook/.storybook/preview-head.html +++ b/storybook/.storybook/preview-head.html @@ -2,3 +2,10 @@ https://eds.equinor.com/docs/foundation/colour/getting_started#colour-scheme-detection The HTML parser merges these attributes onto the document's root element. --> + + diff --git a/storybook/src/stories/sidesheet/side-sheet.stories.tsx b/storybook/src/stories/sidesheet/side-sheet.stories.tsx index 5a1444a6c..a891d2e4e 100644 --- a/storybook/src/stories/sidesheet/side-sheet.stories.tsx +++ b/storybook/src/stories/sidesheet/side-sheet.stories.tsx @@ -50,7 +50,7 @@ export const basic: Story = { <> , , - , + , ` + + `
` + + '', + ); + return await page.evaluate(() => { + const context = document.createElement('canvas').getContext('2d', { + willReadFrequently: true, + }) as CanvasRenderingContext2D; + // Composites the colours over each other and returns the resulting relative luminance. + const luminance = (...colours: string[]) => { + context.clearRect(0, 0, 1, 1); + for (const colour of colours) { + context.fillStyle = colour; + context.fillRect(0, 0, 1, 1); + } + const [r, g, b] = [...context.getImageData(0, 0, 1, 1).data].map((value) => { + const channel = value / 255; + return channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4; + }); + return 0.2126 * r + 0.7152 * g + 0.0722 * b; + }; + const page = getComputedStyle(document.body).backgroundColor; + return Object.fromEntries( + ['tooltip', 'snackbar', 'button', 'nested'].map((id) => { + const style = getComputedStyle(document.getElementById(id) as HTMLElement); + const background = luminance(page, style.backgroundColor); + const text = luminance(page, style.backgroundColor, style.color); + const [high, low] = text > background ? [text, background] : [background, text]; + return [id, { contrast: (high + 0.05) / (low + 0.05), lightText: text > background }]; + }), + ); + }); + } finally { + await page.close(); + } + }; + + test.each(['light', 'dark'] as const)('%s', async (scheme) => { + const result = await contrasts(scheme); + for (const { contrast } of Object.values(result)) expect(contrast).toBeGreaterThanOrEqual(4.5); + // Tooltips and snackbars are dark surfaces with light text in both schemes. + expect(result.tooltip.lightText).toBe(true); + expect(result.snackbar.lightText).toBe(true); + expect(result.nested.lightText).toBe(true); + }); +}); diff --git a/storybook/.storybook/color-scheme.ts b/storybook/.storybook/color-scheme.ts new file mode 100644 index 000000000..0fee1fbc6 --- /dev/null +++ b/storybook/.storybook/color-scheme.ts @@ -0,0 +1,36 @@ +/** Colour scheme options offered in the Storybook toolbar. */ +export type StorybookColorScheme = 'light' | 'dark' | 'system'; + +const DARK_QUERY = '(prefers-color-scheme: dark)'; + +/** + * Value for `data-color-scheme` on ``. + * + * The Fusion portal always passes an explicit `data-color-scheme`, so `system` is resolved from + * `prefers-color-scheme` instead of removing the attribute, as the portal does. + */ +export const resolveColorScheme = ( + scheme: StorybookColorScheme, + prefersDark: boolean, +): 'light' | 'dark' => (scheme === 'system' ? (prefersDark ? 'dark' : 'light') : scheme); + +/** + * Writes the resolved scheme to `root` and, while `system` is selected, follows OS changes. + * + * Setting it on the document root mirrors how the Fusion portal passes the scheme down, so + * stories exercise inheritance, including content portaled to `document.body`. + * + * @returns cleanup that stops following OS changes + */ +export const applyColorScheme = ( + root: HTMLElement, + scheme: StorybookColorScheme, + matchMedia: (query: string) => MediaQueryList = window.matchMedia.bind(window), +): (() => void) => { + const query = matchMedia(DARK_QUERY); + const update = () => root.setAttribute('data-color-scheme', resolveColorScheme(scheme, query.matches)); + update(); + if (scheme !== 'system') return () => {}; + query.addEventListener('change', update); + return () => query.removeEventListener('change', update); +}; diff --git a/storybook/.storybook/light-mode.test.ts b/storybook/.storybook/light-mode.test.ts deleted file mode 100644 index 87e6ca554..000000000 --- a/storybook/.storybook/light-mode.test.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { readFileSync } from 'node:fs'; -import { createRequire } from 'node:module'; -import { pathToFileURL } from 'node:url'; -import { type Browser, chromium } from 'playwright'; -import { expect, test } from 'vitest'; - -const require = createRequire(import.meta.url); -const previewHead = readFileSync(new URL('./preview-head.html', import.meta.url), 'utf8'); -const markup = previewHead.replace(//g, ''); -const edsVariablesPath = require.resolve('@equinor/eds-tokens/css/variables'); -const edsVariables = readFileSync(edsVariablesPath, 'utf8'); -// The token JSON files are not reachable through the package's export map from Node. -const readEdsTokens = (scheme: 'light' | 'dark'): Record => - JSON.parse( - readFileSync( - new URL(`../json/color/color-scheme/flat/${scheme}-semantic.json`, pathToFileURL(edsVariablesPath)), - 'utf8', - ), - ); -const lightTokens = readEdsTokens('light'); -const darkTokens = readEdsTokens('dark'); - -test('preview does not force a colour scheme', () => { - expect(markup).not.toMatch(/ { - const page = await browser.newPage({ colorScheme: 'dark' }); - try { - // Keep the test offline; only the inlined EDS variables matter for colours. - await page.route('**/*', (route) => route.abort()); - await page.setContent( - `${head}` + - `
`, - ); - return await page.$eval('#probe', (el) => getComputedStyle(el).backgroundColor); - } finally { - await page.close(); - } -}; - -const toRgb = (hex: string) => { - const [r, g, b] = (hex.match(/[0-9a-f]{2}/gi) ?? []).map((part) => Number.parseInt(part, 16)); - return `rgb(${r}, ${g}, ${b})`; -}; - -test('EDS CSS variables follow the colour scheme set on ', async () => { - const light = toRgb(lightTokens['bg-neutral-canvas']); - const dark = toRgb(darkTokens['bg-neutral-canvas']); - expect(light).not.toBe(dark); - - const browser = await chromium.launch(); - try { - expect(await renderEdsColor(browser, previewHead, '--eds-color-bg-canvas')).toBe(dark); - expect( - await renderEdsColor(browser, previewHead, '--eds-color-bg-canvas', 'data-color-scheme="light"'), - ).toBe(light); - } finally { - await browser.close(); - } -}); diff --git a/storybook/.storybook/preview-head.html b/storybook/.storybook/preview-head.html index 14483cc19..7e95aaf04 100644 --- a/storybook/.storybook/preview-head.html +++ b/storybook/.storybook/preview-head.html @@ -1,4 +1,4 @@ - + + + + + + + + `, + ); + await page.addScriptTag({ path: themeBundle, type: 'module' }); + await page.evaluate(() => customElements.whenDefined('fwc-theme').then(() => undefined)); + await expect.poll(() => page.getAttribute('#dark', 'data-color-scheme')).toBe('dark'); + await expect.poll(() => page.getAttribute('#light', 'data-color-scheme')).toBe('light'); + const readSurfaces = () => + page.evaluate(() => { + const surfaces = (root: Element) => { + const swatch = document.createElement('div'); + root.append(swatch); + const colours = ['bg-neutral-canvas', 'bg-neutral-surface', 'bg-floating'].map( + (role) => { + swatch.style.backgroundColor = `var(--eds-color-${role})`; + return getComputedStyle(swatch).backgroundColor; + }, + ); + swatch.remove(); + return colours; + }; + return { + root: surfaces(document.documentElement), + system: surfaces(document.querySelector('#system')!), + light: surfaces(document.querySelector('#light')!), + dark: surfaces(document.querySelector('#dark')!), + inherited: surfaces(document.querySelector('#inherited')!), + }; + }); + const dark = await readSurfaces(); + expect(new Set(dark.system).size).toBe(3); + expect(dark.system).toEqual(dark.root); + expect(dark.inherited).toEqual(dark.dark); + expect(dark.dark).toEqual(dark.root); + expect(dark.light).not.toEqual(dark.dark); + await page.emulateMedia({ colorScheme: 'light' }); + const light = await readSurfaces(); + expect(light.system).toEqual(dark.light); + expect(light.light).toEqual(dark.light); + expect(light.dark).toEqual(dark.dark); + expect(light.inherited).toEqual(dark.dark); + } finally { + await page.close(); + } + }); }); describe('classic white text stays readable on its background', () => { @@ -166,6 +232,11 @@ describe('classic white text stays readable on its background', () => { `` + `` + `
` + + '
' + + '
' + + '
' + + '' + + '
' + '', ); return await page.evaluate(() => { @@ -186,13 +257,20 @@ describe('classic white text stays readable on its background', () => { return 0.2126 * r + 0.7152 * g + 0.0722 * b; }; const page = getComputedStyle(document.body).backgroundColor; + const ratio = (a: number, b: number) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05); + const link = luminance(getComputedStyle(document.getElementById('link')!).color); + const focus = luminance(getComputedStyle(document.getElementById('focus')!).color); return Object.fromEntries( - ['tooltip', 'snackbar', 'button', 'nested'].map((id) => { + ['tooltip', 'snackbar', 'button', 'nested', 'canvas', 'panel', 'raised'].map((id) => { const style = getComputedStyle(document.getElementById(id) as HTMLElement); const background = luminance(page, style.backgroundColor); const text = luminance(page, style.backgroundColor, style.color); - const [high, low] = text > background ? [text, background] : [background, text]; - return [id, { contrast: (high + 0.05) / (low + 0.05), lightText: text > background }]; + return [id, { + contrast: ratio(text, background), + lightText: text > background, + linkContrast: ratio(link, background), + focusContrast: ratio(focus, background), + }]; }), ); }); @@ -208,5 +286,11 @@ describe('classic white text stays readable on its background', () => { expect(result.tooltip.lightText).toBe(true); expect(result.snackbar.lightText).toBe(true); expect(result.nested.lightText).toBe(true); + if (scheme === 'dark') { + for (const role of ['canvas', 'panel', 'raised']) { + expect(result[role].linkContrast).toBeGreaterThanOrEqual(4.5); + expect(result[role].focusContrast).toBeGreaterThanOrEqual(3); + } + } }); }); From f7feb430b504ad2acb0632d88abda3fceaec7934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20De=20Fr=C3=A8ne?= Date: Tue, 1 Dec 2026 09:31:58 +0100 Subject: [PATCH 13/15] fix(styles): restore dark Snackbar text contrast Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../src/__tests__/classic-colours.test.tsx | 2 +- packages/styles/src/classic-colours.ts | 8 +++---- storybook/.storybook/color-scheme.test.ts | 21 +++++++++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/styles/src/__tests__/classic-colours.test.tsx b/packages/styles/src/__tests__/classic-colours.test.tsx index 1b01b6e20..bd2b59cca 100644 --- a/packages/styles/src/__tests__/classic-colours.test.tsx +++ b/packages/styles/src/__tests__/classic-colours.test.tsx @@ -78,7 +78,7 @@ describe('classic EDS colour mapping', () => { it('gives overlay components light text from a dark-only property', () => { const css = classicOverlayTextStyles.replace(/\s/g, ''); expect(css).toBe( - '[role="tooltip"],[role="alert"][popover]{--eds_text__static_icons__primary_white:var(--eds_text__static_icons__default);}', + '[role="tooltip"],[role="alert"][popover],[popover]>[role="alert"]{--eds_text__static_icons__primary_white:var(--eds_text__static_icons__default);}', ); // The referenced property is mapped in dark mode only, so light mode keeps the classic white. expect(classicColourVariables['--eds_text__static_icons__default']).toBe( diff --git a/packages/styles/src/classic-colours.ts b/packages/styles/src/classic-colours.ts index 94800d99a..735782fd8 100644 --- a/packages/styles/src/classic-colours.ts +++ b/packages/styles/src/classic-colours.ts @@ -134,12 +134,12 @@ export const classicOverlayColours: Readonly> = { * * `--eds_text__static_icons__primary_white` maps to the on-emphasis text colour, which is dark in * dark mode because contained buttons and `SideBar` use it on light emphasis fills. Inside the - * overlay components it points at the mapped `--eds_text__static_icons__default` instead. That - * property is only defined in dark mode, so in light mode the reference is invalid and the - * components keep their classic white fallback. + * overlay components, including the alert inside the Snackbar's popover, it points at + * `--eds_text__static_icons__default` instead. That property is only defined in dark mode, + * so in light mode the reference is invalid and components keep their classic white fallback. */ export const classicOverlayTextStyles = ` -[role="tooltip"], [role="alert"][popover] { +[role="tooltip"], [role="alert"][popover], [popover] > [role="alert"] { --eds_text__static_icons__primary_white: var(--eds_text__static_icons__default); } `; diff --git a/storybook/.storybook/color-scheme.test.ts b/storybook/.storybook/color-scheme.test.ts index bfecee835..05a05bb31 100644 --- a/storybook/.storybook/color-scheme.test.ts +++ b/storybook/.storybook/color-scheme.test.ts @@ -1,7 +1,11 @@ import { readFileSync } from 'node:fs'; import { createRequire } from 'node:module'; import { resolve } from 'node:path'; +import { Snackbar } from '@equinor/eds-core-react'; import { type Browser, chromium } from 'playwright'; +import { createElement } from 'react'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { ServerStyleSheet } from 'styled-components'; import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest'; import { tokens } from '@equinor/eds-tokens'; import { classicColourSchemeStyles } from '../../packages/styles/src/classic-colours'; @@ -216,20 +220,24 @@ describe('classic white text stays readable on its background', () => { await browser?.close(); }); - // Same colour declarations as the classic Tooltip, Snackbar and contained Button. + // Same colour declarations as the classic Tooltip and contained Button. const overlay = `background-color: ${classicOverlay}; color: ${classicWhite}`; const button = `background-color: ${classicPrimary}; color: ${classicWhite}`; /** Returns the WCAG contrast of each element's text against its background over the page. */ const contrasts = async (scheme: 'light' | 'dark') => { + const sheet = new ServerStyleSheet(); const page = await browser.newPage(); try { + const snackbar = renderToStaticMarkup( + sheet.collectStyles(createElement(Snackbar, { open: true }, 'Snackbar')), + ); await page.route('**/*', (route) => route.abort()); await page.setContent( `` + - `${previewHead}` + + `${sheet.getStyleTags()}${previewHead}` + `` + - `` + + snackbar + `` + `
` + '
' + @@ -239,6 +247,7 @@ describe('classic white text stays readable on its background', () => { '
' + '', ); + await page.locator('[popover]').evaluate((popover: HTMLElement) => popover.showPopover()); return await page.evaluate(() => { const context = document.createElement('canvas').getContext('2d', { willReadFrequently: true, @@ -260,9 +269,12 @@ describe('classic white text stays readable on its background', () => { const ratio = (a: number, b: number) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05); const link = luminance(getComputedStyle(document.getElementById('link')!).color); const focus = luminance(getComputedStyle(document.getElementById('focus')!).color); + const snackbarAlert = document.querySelector('[role="alert"]'); + if (!snackbarAlert) throw new Error('EDS Snackbar did not render an alert'); return Object.fromEntries( ['tooltip', 'snackbar', 'button', 'nested', 'canvas', 'panel', 'raised'].map((id) => { - const style = getComputedStyle(document.getElementById(id) as HTMLElement); + const element = id === 'snackbar' ? snackbarAlert : document.getElementById(id)!; + const style = getComputedStyle(element); const background = luminance(page, style.backgroundColor); const text = luminance(page, style.backgroundColor, style.color); return [id, { @@ -275,6 +287,7 @@ describe('classic white text stays readable on its background', () => { ); }); } finally { + sheet.seal(); await page.close(); } }; From 608dbaba5fbe95db07bd4d87bcd01f729f90c9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20De=20Fr=C3=A8ne?= Date: Tue, 1 Dec 2026 12:52:44 +0100 Subject: [PATCH 14/15] chore(deps): lock published Web Components releases Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- bun.lock | 102 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/bun.lock b/bun.lock index 80e630881..e1600a270 100644 --- a/bun.lock +++ b/bun.lock @@ -81,7 +81,7 @@ "@equinor/fusion-react-styles": "workspace:*", "@equinor/fusion-react-utils": "workspace:*", "@equinor/fusion-wc-icon": "^2.4.4", - "@equinor/fusion-wc-searchable-dropdown": "^4.1.5", + "@equinor/fusion-wc-searchable-dropdown": "^5.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -137,7 +137,7 @@ "dependencies": { "@equinor/eds-tokens": "^2.3.2", "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-chip": "^1.3.5", + "@equinor/fusion-wc-chip": "^2.0.0", "rxjs": "^7.8.1", "styled-components": "^6.6.0", "typesafe-actions": "^5.1.0", @@ -186,7 +186,7 @@ "dependencies": { "@equinor/fusion-react-utils": "workspace:*", "@equinor/fusion-wc-layout": "^0.2.1", - "@equinor/fusion-wc-page": "^0.2.1", + "@equinor/fusion-wc-page": "^1.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -201,7 +201,7 @@ "version": "1.0.8", "dependencies": { "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-list": "^1.2.5", + "@equinor/fusion-wc-list": "^2.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -216,7 +216,7 @@ "version": "1.0.9", "dependencies": { "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-markdown": "^1.6.5", + "@equinor/fusion-wc-markdown": "^2.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -231,8 +231,8 @@ "version": "2.0.17", "dependencies": { "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-people": "^2.2.6", - "@equinor/fusion-wc-person": "^3.5.7", + "@equinor/fusion-wc-people": "^3.0.0", + "@equinor/fusion-wc-person": "^4.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -263,7 +263,7 @@ "dependencies": { "@equinor/fusion-react-utils": "workspace:*", "@equinor/fusion-wc-icon": "^2.4.4", - "@equinor/fusion-wc-searchable-dropdown": "^4.1.5", + "@equinor/fusion-wc-searchable-dropdown": "^5.0.0", "@equinor/fusion-web-theme": "workspace:*", }, "devDependencies": { @@ -305,7 +305,7 @@ "version": "1.0.8", "dependencies": { "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-skeleton": "^2.2.5", + "@equinor/fusion-wc-skeleton": "^3.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -340,7 +340,7 @@ "version": "2.1.11", "dependencies": { "@equinor/eds-tokens": "^2.3.2", - "@equinor/fusion-wc-theme": "^1.2.6", + "@equinor/fusion-wc-theme": "^2.0.0", "@equinor/fusion-web-theme": "workspace:^", "clsx": "^2.1.0", "hoist-non-react-statics": "^3.3.2", @@ -399,7 +399,7 @@ "version": "1.0.7", "dependencies": { "@equinor/fusion-react-utils": "workspace:*", - "@equinor/fusion-wc-textarea": "^1.2.4", + "@equinor/fusion-wc-textarea": "^2.0.0", }, "devDependencies": { "@types/react": "^19.3.0", @@ -484,7 +484,7 @@ "@babel/preset-react": "^8.0.1", "@babel/preset-typescript": "^8.0.7", "@equinor/fusion-observable": "^9.2.6", - "@equinor/fusion-wc-avatar": "^3.3.5", + "@equinor/fusion-wc-avatar": "^4.0.0", "@equinor/fusion-wc-icon": "^2.4.4", "@faker-js/faker": "^10.6.0", "@storybook/builder-vite": "^10.6.7", @@ -883,19 +883,19 @@ "@equinor/fusion-react-utils": ["@equinor/fusion-react-utils@workspace:packages/utils"], - "@equinor/fusion-wc-avatar": ["@equinor/fusion-wc-avatar@3.3.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-picture": "^3.2.4", "@equinor/fusion-wc-ripple": "^1.2.4", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-CWaryF+ljLeRvqcq0AOe8Iv4HI23rC7lZ8ikkKYkebhgxW1g19CQ6DBw/xze0prMIlol0/IWiI4Wl8NobhKN6A=="], + "@equinor/fusion-wc-avatar": ["@equinor/fusion-wc-avatar@4.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-picture": "^4.0.0", "@equinor/fusion-wc-ripple": "^1.2.5", "lit": "3.3.3" } }, "sha512-Dt+e8j3FHo10YuX0UxAcigfmrePQRWvCNMpIwaKkdXMOeeKetaJFYHOLEQ2daIjKcSfKlbREL4xXV8GFM/rVAQ=="], - "@equinor/fusion-wc-button": ["@equinor/fusion-wc-button@2.5.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-button": "^0.27.0", "@material/mwc-icon-button": "^0.27.0", "@material/mwc-icon-button-toggle": "^0.27.0", "lit": "3.3.3" } }, "sha512-g9IWPo/FVxlndMm2alVbJlQeMehVDTATPi0HfNVy5dDdJZO7PY2a2jilPs/yNOf3TEmzyTObTmEFz9b3ZhvlVQ=="], + "@equinor/fusion-wc-button": ["@equinor/fusion-wc-button@3.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-button": "^0.27.0", "@material/mwc-icon-button": "^0.27.0", "@material/mwc-icon-button-toggle": "^0.27.0", "lit": "3.3.3" } }, "sha512-8oLE4L2SR5WqvVZVJKg0EoA5rC5HkU4MPN22XuFJmqt/YxXG5WRLCpFrpy6eXsEkk0GI6foOXOguaGInlr7ERg=="], - "@equinor/fusion-wc-checkbox": ["@equinor/fusion-wc-checkbox@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-checkbox": "^0.27.0", "lit": "3.3.3" } }, "sha512-ArFMIiyLIT8CoIeTZHiPqJqdyz51MFo8Gh7OpaICJxNAC+EzN70YGMmlPDZ79BEWCiN0bazljKA2JmVHMka9Ug=="], + "@equinor/fusion-wc-checkbox": ["@equinor/fusion-wc-checkbox@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@material/mwc-checkbox": "^0.27.0", "lit": "3.3.3" } }, "sha512-wVZ7DylDzanax9Gm0Rn9sYzKwo5aRNlBAZv4PmDWd6CTBZQWv7VjD3cWN8rpeDog8apJq05UfDBkEbMMkhEtfQ=="], - "@equinor/fusion-wc-chip": ["@equinor/fusion-wc-chip@1.3.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-ripple": "^1.2.4", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-1lS3Nha+lxw17Z5NhkysgvIOI6Gy8vqG6TpkPKS8BgcH8O2OTN0vjzWxq9u7itRD1t8jeScIGu9GN29dBLG2TA=="], + "@equinor/fusion-wc-chip": ["@equinor/fusion-wc-chip@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-ripple": "^1.2.5", "lit": "3.3.3" } }, "sha512-EiLmExhK2WiPLr62j0vUkjPHymDCdFeEjfDl69Y/5cSYEAL8sBjZ3FRyQblcvsl0CSzmH0B/ErpoGCnOgYkJIA=="], "@equinor/fusion-wc-core": ["@equinor/fusion-wc-core@2.0.3", "", {}, "sha512-o52mbfI8ck1bJMfC+y3Hf4eyS7dJv1i/8C/bSv9cMRDRz6CgiKxrTzQhXSAFCDwm8tSQ3zQyB8EPKivyTx4KFA=="], "@equinor/fusion-wc-date": ["@equinor/fusion-wc-date@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "date-fns": "^4.4.0", "lit": "3.3.3" } }, "sha512-zzcvKwYgT19BRUXAJ/UvRObanElsb00amtPaKjSwiv4NEDPo4HtAmvnyOqlol5OlqtoXAeXaEjzJnio2o4xo6w=="], - "@equinor/fusion-wc-divider": ["@equinor/fusion-wc-divider@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-i6IUeFW5aK0PH/UHb4Eyg9HhUMGaF9bX12BWMakf1hUPzXiK/ghgTwmS5bk+sWhf7kWogTgWZCQsRYni3HRuWw=="], + "@equinor/fusion-wc-divider": ["@equinor/fusion-wc-divider@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-WsLtJ1echJTfbArBjgQ0o692ytLapG0FA22ec7iqybpGhjHALNPhlLQFIkdGKyXB9WJyW7oRrerUWt2qDftxog=="], "@equinor/fusion-wc-formfield": ["@equinor/fusion-wc-formfield@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-formfield": "^0.27.0", "lit": "3.3.3" } }, "sha512-lcgxxLqq0z28/ecRxQwmwOMzgOKSGcRsg16zyS4nRP6ET6e57yfGxo0Asr9BBybKVuH2iKvOu7CcybN26dvjng=="], @@ -903,33 +903,33 @@ "@equinor/fusion-wc-layout": ["@equinor/fusion-wc-layout@0.2.1", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-Pb0HI3j0K4X6OiA7wRi6umbctL43scdOb7wpaSxjE/vIVX5H0GiH3Gsn8jo/DsNbAe/u8DhwqCKLac8M74mCcQ=="], - "@equinor/fusion-wc-list": ["@equinor/fusion-wc-list@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-checkbox": "^1.2.5", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-divider": "^1.2.5", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-radio": "^1.2.5", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-list": "^0.27.0", "lit": "3.3.3" } }, "sha512-sqV9F76KUl4nOAez5q1vT0kZ1l/YT6vPJor4Ln7AZBuyhUnFin6BoALQJtKq864cF/nyG0hmThTCX5M/Cju6cA=="], + "@equinor/fusion-wc-list": ["@equinor/fusion-wc-list@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-checkbox": "^2.0.0", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-divider": "^2.0.0", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-radio": "^2.0.0", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-list": "^0.27.0", "lit": "3.3.3" } }, "sha512-Xz7bTe0hmlzMULkZRysI24jHL3aSPaD3vqDO/6RKgGV37fpphiWh/AyZyxrEFGKgrNQckPeRKESoWpsnsYi7FA=="], - "@equinor/fusion-wc-markdown": ["@equinor/fusion-wc-markdown@1.6.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3", "marked": "^18.1.1", "prismjs": "^1.29.0", "prosemirror-commands": "^1.7.2", "prosemirror-history": "^1.5.1", "prosemirror-inputrules": "^1.5.1", "prosemirror-keymap": "^1.2.3", "prosemirror-markdown": "^1.13.8", "prosemirror-model": "^1.25.12", "prosemirror-schema-basic": "^1.2.5", "prosemirror-schema-list": "^1.5.1", "prosemirror-state": "^1.4.4", "prosemirror-transform": "^1.12.2", "prosemirror-view": "^1.42.6" } }, "sha512-H7G2Ds9zvE7jj8FMb0amGfUrsvfjyWX3lqFwxw1+AWN5rrZHxAXU3D6cgsryohY3yETWUFoQzxqu4mRC9uGFJw=="], + "@equinor/fusion-wc-markdown": ["@equinor/fusion-wc-markdown@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "lit": "3.3.3", "marked": "^18.2.0", "prismjs": "^1.29.0", "prosemirror-commands": "^1.7.2", "prosemirror-history": "^1.5.1", "prosemirror-inputrules": "^1.5.1", "prosemirror-keymap": "^1.2.3", "prosemirror-markdown": "^1.13.9", "prosemirror-model": "^1.25.13", "prosemirror-schema-basic": "^1.2.5", "prosemirror-schema-list": "^1.6.0", "prosemirror-state": "^1.4.4", "prosemirror-transform": "^1.12.5", "prosemirror-view": "^1.42.9" } }, "sha512-3lwLM1g7OLpyFLh4nNCUp1MBoqDY/ENTCq1xrLRoIlssXF4cCMlA6FMuADs7XgpvxKemoY2jIU/iKNqz1XJiQA=="], - "@equinor/fusion-wc-page": ["@equinor/fusion-wc-page@0.2.1", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-KQkhQ9DPF56mjOcjgz1Td5Yx9lDeZvB+Dl5DXDBUBsEgDs9hNklAvtZuIDS3fi0HXIo6sT+8zTKeOLk/Pczr7g=="], + "@equinor/fusion-wc-page": ["@equinor/fusion-wc-page@1.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-njK5Nb9d/Iur9J7JYH5mUqs1xK1yj2W+ns+aZRz6HjXmUfTJfZq2SSQlT1KJzSJpEAHRgWc2msLZZ/PLg7n5Zw=="], - "@equinor/fusion-wc-people": ["@equinor/fusion-wc-people@2.2.6", "", { "dependencies": { "@equinor/fusion-wc-button": "^2.5.5", "@equinor/fusion-wc-checkbox": "^1.2.5", "@equinor/fusion-wc-chip": "^1.3.5", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-formfield": "^1.2.5", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-person": "^3.5.7", "@equinor/fusion-wc-progress-indicator": "^1.2.5", "@equinor/fusion-wc-skeleton": "^2.2.5", "@equinor/fusion-web-theme": "^0.1.12", "@lit/context": "^1.1.6", "@lit/task": "^1.0.3", "lit": "3.3.3" } }, "sha512-OuI1Wj+lv4lThDmpOShDRlMEN7HzFFkjXOjA71UK9ihSKRE/r/YUfTJGIHHQndFk78M/GJa/cu6nG3rEbig41w=="], + "@equinor/fusion-wc-people": ["@equinor/fusion-wc-people@3.0.0", "", { "dependencies": { "@equinor/fusion-wc-button": "^3.0.0", "@equinor/fusion-wc-checkbox": "^2.0.0", "@equinor/fusion-wc-chip": "^2.0.0", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-formfield": "^1.2.5", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-person": "^4.0.0", "@equinor/fusion-wc-progress-indicator": "^2.0.0", "@equinor/fusion-wc-skeleton": "^3.0.0", "@equinor/fusion-web-theme": "^0.1.12", "@lit/context": "^1.1.6", "@lit/task": "^1.0.3", "lit": "3.3.3" } }, "sha512-1RIpPUVPuoyiTFPHeylA8NxKlk6JUcUdfj1aDufUWMrSW6h7y567GZePm3zkNGx9cLvZkWCMLmoU6GQw1o2f7A=="], - "@equinor/fusion-wc-person": ["@equinor/fusion-wc-person@3.5.7", "", { "dependencies": { "@equinor/fusion-wc-button": "^2.5.5", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-list": "^1.2.5", "@equinor/fusion-wc-searchable-dropdown": "^4.1.5", "@equinor/fusion-wc-skeleton": "^2.2.5", "@equinor/fusion-wc-textinput": "^1.2.5", "@equinor/fusion-web-theme": "^0.1.12", "@floating-ui/dom": "^1.8.0", "@lit-labs/observers": "^2.1.0", "@lit/task": "^1.0.3", "lit": "3.3.3" } }, "sha512-CXaT92bXYUHpyd4GaRKTnFoHEmIsBJDzw4a9nFRcJtgGARH5lV6uxz4Fhjhu+u9sVLb5ofPiN82xpwEmS1ow/A=="], + "@equinor/fusion-wc-person": ["@equinor/fusion-wc-person@4.0.0", "", { "dependencies": { "@equinor/fusion-wc-button": "^3.0.0", "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-list": "^2.0.0", "@equinor/fusion-wc-searchable-dropdown": "^5.0.0", "@equinor/fusion-wc-skeleton": "^3.0.0", "@equinor/fusion-wc-textinput": "^2.0.0", "@equinor/fusion-web-theme": "^0.1.12", "@floating-ui/dom": "^1.8.0", "@lit-labs/observers": "^2.1.0", "@lit/task": "^1.0.3", "lit": "3.3.3" } }, "sha512-8XK4jmcWu0iufLwcBHIdb2t7jOH7bu9TPTL49D/OLcqthsSkR/zUSYIW6LcTOac728xn5Wju3mKMrN6ZGD5awA=="], - "@equinor/fusion-wc-picture": ["@equinor/fusion-wc-picture@3.2.4", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "lit": "3.3.3" } }, "sha512-JCxoDS31ZMHbL88PDJKZ/HGNl4ZLhgy5vvwJ7ed8ZnzBF0nwCws8LCSNzW3PCH/rAddiXBk3amio4xuvor019A=="], + "@equinor/fusion-wc-picture": ["@equinor/fusion-wc-picture@4.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "lit": "3.3.3" } }, "sha512-7AGTrYogZsqb55FGbHqJjDEZG12sdWGjghqn2DoO9y1+qpoBBSDgohOojzriKPmnTFDS19fFN+TDcZBP3NvgDQ=="], - "@equinor/fusion-wc-progress-indicator": ["@equinor/fusion-wc-progress-indicator@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-ryxIg36jDadWJV0Hc+yOoYxZNNZttg7DVGY6AYr0+B2KLT8loihX0pIzxRIwnVzDJoWhc1pPDXygkQvLF70aIg=="], + "@equinor/fusion-wc-progress-indicator": ["@equinor/fusion-wc-progress-indicator@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-OrWVnkBoZD4bsf6vytD0ZweKTP/KYkQxgf6iglTNCAynph7gRfNgX9BNuWAJid2VrNjwGBzuebKLhdAuN5yM5A=="], - "@equinor/fusion-wc-radio": ["@equinor/fusion-wc-radio@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-radio": "^0.27.0", "lit": "3.3.3" } }, "sha512-op7CXHE4fXi8VAvKlIejmIBWWjuGRgiSRrwjdFqVwitj4HHgovmPclZbbv8gFBMdXtgsvBisOjDxAB8MDwH2mw=="], + "@equinor/fusion-wc-radio": ["@equinor/fusion-wc-radio@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@material/mwc-radio": "^0.27.0", "lit": "3.3.3" } }, "sha512-05R9k9cBX61WdQsuONq8YDbkeQydQQRWym60Sr4P6lPPWUV7UgWoXwgpGoAqAUDxc1hzhq1BjLxxBWMIe7caPA=="], "@equinor/fusion-wc-ripple": ["@equinor/fusion-wc-ripple@1.2.4", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@material/mwc-ripple": "^0.27.0", "lit": "3.3.3" } }, "sha512-Ie3SG5MmmkHO8RcgQ39cfCtLDqsNBeNHTqJwi8yfiNZJqU9kq2IzXp+tqxbQJaM4fz08xI1okfMX7IUlzWo6Hg=="], - "@equinor/fusion-wc-searchable-dropdown": ["@equinor/fusion-wc-searchable-dropdown@4.1.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-divider": "^1.2.5", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-list": "^1.2.5", "@equinor/fusion-wc-textinput": "^1.2.5", "@equinor/fusion-web-theme": "^0.1.12", "@lit-labs/task": "^3.1.0", "@types/uuid": "^11.0.0", "lit": "3.3.3", "uuid": "^14.0.3" } }, "sha512-OZ5GTJd9U5qNbBloOoE3i1EiERV0K3bgAcm9CFG/yPWfMBg3+YuOLdb2FDACpJn+dmdDZlR0fEuGBh1MqYY8vQ=="], + "@equinor/fusion-wc-searchable-dropdown": ["@equinor/fusion-wc-searchable-dropdown@5.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-divider": "^2.0.0", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-wc-list": "^2.0.0", "@equinor/fusion-wc-textinput": "^2.0.0", "@lit-labs/task": "^3.1.0", "@types/uuid": "^11.0.0", "lit": "3.3.3", "uuid": "^14.0.3" } }, "sha512-6qZXuodC059ct+t6M0gdd5YBL6Vab6guXf/7fjsd8rClq9LKAepbfayX9/OO/k80JYbhZeQni9IQNtx/C+1EpA=="], - "@equinor/fusion-wc-skeleton": ["@equinor/fusion-wc-skeleton@2.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "lit": "3.3.3" } }, "sha512-qJKwXBh8QMVmLChx6E9NgrndOr8Rk7OvSh3PjVKR7GKC+ndiqVXVLTYvl4vdFAzGvnEVdamcEFiGcn+GNeOomg=="], + "@equinor/fusion-wc-skeleton": ["@equinor/fusion-wc-skeleton@3.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "lit": "3.3.3" } }, "sha512-O49pRXlh9rFyF2xxAKG/LiomxNjge5vbvpyTc8ycXr0FadgGTL3Ih5x77VXLTSK9xPnT4lKuw95TfGKGYErNWA=="], - "@equinor/fusion-wc-textarea": ["@equinor/fusion-wc-textarea@1.2.4", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-textinput": "^1.2.4", "@material/mwc-textarea": "^0.27.0", "lit": "3.3.3" } }, "sha512-wEsWBwlvGxxEGXBkHVkvHM1OcW0JuFaZjixX3FrHMVYKHjZeM3iyNb7UUJi0CxHZgFqCh2mUyKWVETS/qWjeyw=="], + "@equinor/fusion-wc-textarea": ["@equinor/fusion-wc-textarea@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-textinput": "^2.0.0", "@material/mwc-textarea": "^0.27.0", "lit": "3.3.3" } }, "sha512-T1OxF+25f6y/87wexSWntpzOpHM/GVxEQKDTEg3vjTxUcF1XN+05YWWBJJFTyMEVkXVqhqyX2AQtT4m+xx371A=="], - "@equinor/fusion-wc-textinput": ["@equinor/fusion-wc-textinput@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-web-theme": "^0.1.12", "@material/mwc-textfield": "^0.27.0", "lit": "3.3.3" } }, "sha512-r/0Fn+4j+fn/XV5x+np6xK9J7xEyf00BAZRs5q4gtyOzWVU/Qa3wMWiMW6hAnMuYcm5H6/agOU1BjetUrTLBQw=="], + "@equinor/fusion-wc-textinput": ["@equinor/fusion-wc-textinput@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@material/mwc-textfield": "^0.27.0", "lit": "3.3.3" } }, "sha512-vCIAoRJ9O157VPjbRUBgi/fIRhI1/i8U7fDxw5DGQC7iiZK7rfaj3HlWHgvYRrGHC4AKd7X+OzgvKl4mHHIUPw=="], - "@equinor/fusion-wc-theme": ["@equinor/fusion-wc-theme@1.2.6", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "@material/theme": "^14.0.0", "lit": "3.3.3" } }, "sha512-MIem4+ct3EF/TwwukG0ZirYmuJyaLn4J8fZpnz8FSSJtPAlj8vH+zdk+AAAheZh03AOmypuD6x01hdfkc36qcQ=="], + "@equinor/fusion-wc-theme": ["@equinor/fusion-wc-theme@2.0.0", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-web-theme": "^0.1.12", "@material/theme": "^14.0.0", "lit": "3.3.3" } }, "sha512-ElKSCF5gRjWKOcZ099F4LJB48e4LEXX/lw71v1XjxKdb0QJaFBM8971CntSVnDHA7J6712Fqr3plwY2prmkMJw=="], "@equinor/fusion-web-theme": ["@equinor/fusion-web-theme@workspace:packages/theme"], @@ -1935,7 +1935,7 @@ "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], - "marked": ["marked@18.1.1", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-zEGgrtUG8crk+TrMacJSVABU4DYDDkS8uqgU3ohrn/2fW9C2AEfUrO3m6IhpIpQpl7YcVpiXXC9cSMWDANT3dg=="], + "marked": ["marked@18.4.0", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-evbvoaiBPFO2lk2kSkIbrwjPMuX/HjKyefPdZbtwccsJWY91xlLF/SzB5hRsAOwStztmKC09i+IGsUcTYMt//A=="], "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], @@ -2117,17 +2117,17 @@ "prosemirror-markdown": ["prosemirror-markdown@1.13.9", "", { "dependencies": { "@types/markdown-it": "^14.0.0", "markdown-it": "^14.0.0", "prosemirror-model": "^1.25.0" } }, "sha512-qAI3I9YdtjWHjTCBErc08ivr24KSrUjcTh5dYncCxFM+JS02kT0iHeWYjO35xeTPwt5t8rhFrelewXhXz16WZQ=="], - "prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + "prosemirror-model": ["prosemirror-model@1.25.13", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-MlDMWGjYXaYOeCiO17jcybntCOzPnN+97U0809ke2QsgPtxW3n5/sD6ZKyJONUgMw1iP93ohZTjeKjnRJ7L6kQ=="], "prosemirror-schema-basic": ["prosemirror-schema-basic@1.2.5", "", { "dependencies": { "prosemirror-model": "^1.25.0" } }, "sha512-McBWhfgOfThyu3Nltbs8SOUbM4t/h0pxteibaaHd1QR4S+F1t0u7M1ETaCE6/cveFoF+2fowTIBNkJOyeZQjNg=="], - "prosemirror-schema-list": ["prosemirror-schema-list@1.5.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.7.3" } }, "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q=="], + "prosemirror-schema-list": ["prosemirror-schema-list@1.6.1", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.7.3" } }, "sha512-QiL/QjgCWr+3Mhukm48E5d3XCC8lVEIanixGkXbWKUyxCUGy4ntVffFapmMwQ4vxhZw+8i7117W2N6FSyqyWfA=="], "prosemirror-state": ["prosemirror-state@1.4.4", "", { "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0", "prosemirror-view": "^1.27.0" } }, "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw=="], - "prosemirror-transform": ["prosemirror-transform@1.12.3", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-EsN+GKYjw8KZ1UpQWkbsGIyzG51nYloEFwqiZ2h/yNL+ni8rRV6Ch0W25GcunalidW1eLHEvGvsWvWn4sINNAA=="], + "prosemirror-transform": ["prosemirror-transform@1.12.7", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-/e87cbxcM5WJOJrL1IrM9gJqO3EK8LdQoPvs+r4ss1lRO5t5QeqkU0SlmDvcitCSDUbm8s/MxbBB6ds4pY6Xlg=="], - "prosemirror-view": ["prosemirror-view@1.42.7", "", { "dependencies": { "prosemirror-model": "^1.25.12", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-aTIAUN4zdD+VS7gsv9Po9Sty81B6yl6D3HggCosry9DLYTmVo4omjcqICDIOPnPJmskRUsqLInxBjaH7I+BQ4Q=="], + "prosemirror-view": ["prosemirror-view@1.44.0", "", { "dependencies": { "prosemirror-model": "^1.25.12", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-Ga7889C0DYI1AI0zzgXBNVElPRLh6B2+K87XLjza90Bm/02XyEGXUr0gnla+Oefv7krvo3VIUDwM+YHKU9xGxg=="], "psl": ["psl@1.15.0", "", { "dependencies": { "punycode": "^2.3.1" } }, "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w=="], @@ -2471,9 +2471,11 @@ "@equinor/fusion/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="], - "@equinor/fusion-wc-icon/@equinor/eds-icons": ["@equinor/eds-icons@1.5.1", "", {}, "sha512-5/pi0vsXHKVDIFG+BOufOqtAS8wD5J0qTqcucUvnIvo4vpUHWJbMpP80fyAQ9S8ZAu+9auBEq4NY1ZBcqjZq8w=="], + "@equinor/fusion-wc-avatar/@equinor/fusion-wc-ripple": ["@equinor/fusion-wc-ripple@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@material/mwc-ripple": "^0.27.0", "lit": "3.3.3" } }, "sha512-h/3DpSvEmcQJpisSF980/5D8waAbPxe5YNRRBZXefWcAdYcfjK6e/o1n172mguC/jf7orcSw20xZ8quTvXRWYw=="], + + "@equinor/fusion-wc-chip/@equinor/fusion-wc-ripple": ["@equinor/fusion-wc-ripple@1.2.5", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@material/mwc-ripple": "^0.27.0", "lit": "3.3.3" } }, "sha512-h/3DpSvEmcQJpisSF980/5D8waAbPxe5YNRRBZXefWcAdYcfjK6e/o1n172mguC/jf7orcSw20xZ8quTvXRWYw=="], - "@equinor/fusion-wc-textarea/@equinor/fusion-wc-textinput": ["@equinor/fusion-wc-textinput@1.2.4", "", { "dependencies": { "@equinor/fusion-wc-core": "^2.0.3", "@equinor/fusion-wc-icon": "^2.4.4", "@equinor/fusion-web-theme": "^0.1.10", "@material/mwc-textfield": "^0.27.0", "lit": "3.3.3" } }, "sha512-jPry3+5vg9QzR+xTJC52xtyWYRUK0qv/eddU3KKOiYBAqu1mb2xfcDbFChpdsZkVqsd9Twa8PPGrtfuYdThFKg=="], + "@equinor/fusion-wc-icon/@equinor/eds-icons": ["@equinor/eds-icons@1.5.1", "", {}, "sha512-5/pi0vsXHKVDIFG+BOufOqtAS8wD5J0qTqcucUvnIvo4vpUHWJbMpP80fyAQ9S8ZAu+9auBEq4NY1ZBcqjZq8w=="], "@equinor/fusion-web-theme/@equinor/eds-tokens": ["@equinor/eds-tokens@0.9.2", "", {}, "sha512-pDIFei0vsfN3GN12NKWqxskAkYBQd6+Dzjga2liuY81LfnlJs5g9NblamU9WY5w5YdVE5Z8FNjsMKDLs2JIWcw=="], @@ -2675,11 +2677,19 @@ "prosemirror-commands/prosemirror-transform": ["prosemirror-transform@1.12.0", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w=="], + "prosemirror-history/prosemirror-transform": ["prosemirror-transform@1.12.3", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-EsN+GKYjw8KZ1UpQWkbsGIyzG51nYloEFwqiZ2h/yNL+ni8rRV6Ch0W25GcunalidW1eLHEvGvsWvWn4sINNAA=="], + + "prosemirror-history/prosemirror-view": ["prosemirror-view@1.42.7", "", { "dependencies": { "prosemirror-model": "^1.25.12", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-aTIAUN4zdD+VS7gsv9Po9Sty81B6yl6D3HggCosry9DLYTmVo4omjcqICDIOPnPJmskRUsqLInxBjaH7I+BQ4Q=="], + "prosemirror-inputrules/prosemirror-transform": ["prosemirror-transform@1.12.0", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w=="], - "prosemirror-schema-list/prosemirror-model": ["prosemirror-model@1.25.11", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-QWg9RhnpLlogAmp3p96uEFrE5txQpFynd4vhBAELkwgOCWQs/X0yCzB3/hrHqiPwf91RG5KyWq6553zs9JqIOQ=="], + "prosemirror-markdown/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + + "prosemirror-schema-basic/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + + "prosemirror-schema-list/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], - "prosemirror-schema-list/prosemirror-transform": ["prosemirror-transform@1.12.0", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w=="], + "prosemirror-schema-list/prosemirror-transform": ["prosemirror-transform@1.12.3", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-EsN+GKYjw8KZ1UpQWkbsGIyzG51nYloEFwqiZ2h/yNL+ni8rRV6Ch0W25GcunalidW1eLHEvGvsWvWn4sINNAA=="], "prosemirror-state/prosemirror-model": ["prosemirror-model@1.25.11", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-QWg9RhnpLlogAmp3p96uEFrE5txQpFynd4vhBAELkwgOCWQs/X0yCzB3/hrHqiPwf91RG5KyWq6553zs9JqIOQ=="], @@ -2687,6 +2697,12 @@ "prosemirror-state/prosemirror-view": ["prosemirror-view@1.42.3", "", { "dependencies": { "prosemirror-model": "^1.25.8", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-oTN7EtH+CpwxU9NrwEYWd0UZ4JUx7l048l5A2Xppm4p/60isZYLnth9QVQmC3VRIvdrIWCxwZSd+Uz791G31/w=="], + "prosemirror-transform/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + + "prosemirror-view/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + + "prosemirror-view/prosemirror-transform": ["prosemirror-transform@1.12.3", "", { "dependencies": { "prosemirror-model": "^1.21.0" } }, "sha512-EsN+GKYjw8KZ1UpQWkbsGIyzG51nYloEFwqiZ2h/yNL+ni8rRV6Ch0W25GcunalidW1eLHEvGvsWvWn4sINNAA=="], + "react-aria/@react-types/shared": ["@react-types/shared@3.37.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-VNlZuifu4tHdxWPfHvoMfKsHA9kVTCGkduv5vKVTdinm8wHFJNhyVB5RzIMiRFj0q3RKoCbP68u2zaoBSiFueg=="], "react-aria/react-stately": ["react-stately@3.51.0", "", { "dependencies": { "@internationalized/date": "^3.12.4", "@internationalized/number": "^3.6.9", "@internationalized/string": "^3.2.10", "@react-types/shared": "^3.37.0", "@swc/helpers": "^0.5.0", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" } }, "sha512-YJcmkAXu2XOQP97hO/qz/cC3qv9kni3oVhwBlxWr358BHePJUpY15XwL3YSRMKxYt4EkslPqAz11JRirMfANGw=="], @@ -2907,8 +2923,6 @@ "@emotion/babel-plugin/@babel/helper-module-imports/@babel/types": ["@babel/types@7.29.7", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA=="], - "@equinor/fusion-wc-textarea/@equinor/fusion-wc-textinput/@equinor/fusion-web-theme": ["@equinor/fusion-web-theme@0.1.10", "", { "dependencies": { "@equinor/eds-tokens": "0.9.2", "csstype": "^3.1.3" } }, "sha512-/Yzfie73UvMoBMo35gmeHO+5nTty5EyemomcB5ZbEDyHFNIodgCL1JGm2KfrIwqez9w9CTneHjnJWvwhu9TM+w=="], - "@jridgewell/remapping/@jridgewell/gen-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], "@material/mwc-base/lit/@lit/reactive-element": ["@lit/reactive-element@1.6.3", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.0.0" } }, "sha512-QuTgnG52Poic7uM1AN5yJ09QMe0O28e10XzSvWDz02TJiiKee4stsiownEIadWm8nYzyDAyT+gKzUoZmiWQtsQ=="], @@ -3059,6 +3073,10 @@ "parse-json/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + "prosemirror-history/prosemirror-transform/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + + "prosemirror-history/prosemirror-view/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], + "prosemirror-inputrules/prosemirror-transform/prosemirror-model": ["prosemirror-model@1.25.11", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-QWg9RhnpLlogAmp3p96uEFrE5txQpFynd4vhBAELkwgOCWQs/X0yCzB3/hrHqiPwf91RG5KyWq6553zs9JqIOQ=="], "prosemirror-state/prosemirror-view/prosemirror-model": ["prosemirror-model@1.25.12", "", { "dependencies": { "orderedmap": "^2.0.0" } }, "sha512-Ue2gTmXMa7EhpLNhC7J+h4+ykD8ha12K6rrZFFKKJHBForfIStw5gJ6Zrf1mqqAa9NmpmEB4wp9bKmA4eUVjWg=="], @@ -3183,8 +3201,6 @@ "@emotion/babel-plugin/@babel/helper-module-imports/@babel/types/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], - "@equinor/fusion-wc-textarea/@equinor/fusion-wc-textinput/@equinor/fusion-web-theme/@equinor/eds-tokens": ["@equinor/eds-tokens@0.9.2", "", {}, "sha512-pDIFei0vsfN3GN12NKWqxskAkYBQd6+Dzjga2liuY81LfnlJs5g9NblamU9WY5w5YdVE5Z8FNjsMKDLs2JIWcw=="], - "react-docgen/@babel/core/@babel/code-frame/@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="], "react-docgen/@babel/core/@babel/code-frame/js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], From a0a76e4570ad24c864c5d0439b717477b6982fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20De=20Fr=C3=A8ne?= Date: Wed, 2 Dec 2026 21:24:13 +0100 Subject: [PATCH 15/15] fix(styles): address dark mode release review Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CONTRIBUTING.md | 42 +- packages/styles/README.md | 22 +- .../src/__tests__/classic-colours.test.tsx | 2 +- .../__tests__/color-scheme-aliases.test.tsx | 5 + packages/styles/src/classic-colours.ts | 3 + packages/styles/src/color-scheme-aliases.ts | 5 +- scripts/dark-mode-preview.js | 441 ------------------ storybook/.storybook/color-scheme.test.ts | 25 +- storybook/.storybook/preview-head.html | 2 +- 9 files changed, 44 insertions(+), 503 deletions(-) delete mode 100644 scripts/dark-mode-preview.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00d0c05ee..20e55fd96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,46 +34,6 @@ curl -fsSL https://bun.sh/install | bash bun install ``` -### Local dark-mode preview - -On the dark-mode PR branch, use the shared Verdaccio instance at `http://127.0.0.1:4873`. -Start it and publish a commit-qualified Web Components snapshot first (see -[equinor/fusion-web-components#2551](https://github.com/equinor/fusion-web-components/pull/2551)). -Keep its verified `web-.json` and the registry's private `npmrc` in -`~/.config/fusion-dark-mode/`. - -```sh -bun scripts/dark-mode-preview.js check 090f40d9 ec11c849421411f069ed73335271041128dd1ed5 -bun scripts/dark-mode-preview.js publish 090f40d9 ec11c849421411f069ed73335271041128dd1ed5 -``` - -These commands use Web commit `090f40d9` and React source `ec11c849`, which includes the -theme inheritance fix. Omit the full React commit to use `HEAD` for a new snapshot. -`check` installs exact upstream versions in a disposable checkout, verifies the registry URLs -and integrity hashes, then lints, builds, tests and packs without publishing. `publish` verifies -an existing matching manifest with a clean consumer install and reuses it. For a new snapshot, -it runs the same build checks, publishes under `dark-mode--`, -verifies a clean install and writes a private `react--.json`. -It does not replace existing versions, manifests, `dark-mode` or `latest`. - -In a disposable Bun consumer checkout, with no existing `.npmrc`, point Bun at the same -registry. Use exact `packages[name].version` values from `react-ec11c849-090f40d9.json` -and `web-090f40d9.json` for direct preview dependencies. React snapshot tarballs already -pin their Web snapshot dependencies. Do not globally override incompatible transitive ranges. - -```sh -ln -s "$HOME/.config/fusion-dark-mode/npmrc" .npmrc -bun install --registry=http://127.0.0.1:4873/ -unlink .npmrc -``` - -Confirm the preview entries in the scratch lockfile match the manifests' versions and -integrities and use the loopback registry. -Keep the web components' published `@equinor/fusion-web-theme` `^0.1.12` dependency; use the -React preview's `0.2.0` only where the consumer's range admits it. -Do not commit the npmrc, preview overrides or lockfile changes. The normal install, CI and -public release still use the public registry. - ## Start Storybook StoryBook is not handling too well composite libraries, so a clean build is needed @@ -91,7 +51,7 @@ The decorator in `storybook/.storybook/preview.tsx` always sets an explicit `lig For System it resolves `prefers-color-scheme` with `matchMedia` and updates the attribute when the OS setting changes, as the portal does. `ThemeProvider` inherits it, and content portaled to `body` follows it too. The body uses the EDS -neutral surface background and text colours from `preview-head.html`. +neutral canvas background and text colours from `preview-head.html`. Follow the EDS [colour scheme detection](https://eds.equinor.com/docs/foundation/colour/getting_started#colour-scheme-detection) guidance. diff --git a/packages/styles/README.md b/packages/styles/README.md index bcb00e827..129664dea 100644 --- a/packages/styles/README.md +++ b/packages/styles/README.md @@ -350,7 +350,16 @@ The mapping applies only where the tokens select dark: `[data-color-scheme="dark without `data-color-scheme="light"` when the system prefers dark. Light mode keeps the classic colours, and a nested `[data-color-scheme="light"]` resets the mapping. -Hosts that render their own global styles can use the same mapping: +Hosts that render their own global styles should use `classicColourSchemeStyles()` after the EDS +stylesheet. It handles the OS preference, native controls, and resets for nested light scopes: + +```ts +import { classicColourSchemeStyles } from '@equinor/fusion-react-styles'; + +const globalCss = classicColourSchemeStyles(); +``` + +For hosts that need to compose their own rules, the individual exports are: - `classicColourVariables`: legacy property name → EDS colour variable name. - `classicScrimColour`: the EDS backdrop colour at 60% opacity. @@ -361,15 +370,8 @@ Hosts that render their own global styles can use the same mapping: The shared white-text property is dark in dark mode because contained buttons use it on light fills. Render these rules globally, not under a dark selector; light mode is unaffected. - `classicColourDeclarations()`: the shared dark surface roles and legacy mappings. Put - these declarations after the EDS variables under your dark selector only. -- `classicColourSchemeStyles()`: the complete dark-scoped rules that `EdsTokens` renders. - -```ts -import { classicColourDeclarations, classicOverlayTextStyles } from '@equinor/fusion-react-styles'; - -const globalCss = `[data-color-scheme="dark"] { ${classicColourDeclarations()} } -${classicOverlayTextStyles}`; -``` + these declarations after the EDS variables under your dark selector only. If you support nested + light scopes, reset the legacy mappings at those boundaries. ### `useTheme()` diff --git a/packages/styles/src/__tests__/classic-colours.test.tsx b/packages/styles/src/__tests__/classic-colours.test.tsx index bd2b59cca..9bcec37ec 100644 --- a/packages/styles/src/__tests__/classic-colours.test.tsx +++ b/packages/styles/src/__tests__/classic-colours.test.tsx @@ -92,7 +92,7 @@ describe('classic EDS colour mapping', () => { const declarations = classicColourDeclarations().replace(/\s/g, ''); expect(css).toContain(`[data-color-scheme="dark"]{${declarations}}`); expect(css).toContain( - `@media(prefers-color-scheme:dark){:root:not([data-color-scheme="light"]){${declarations}}}`, + `@media(prefers-color-scheme:dark){:root:not([data-color-scheme="light"]){color-scheme:dark;${declarations}}}`, ); expect(css).toContain('[data-color-scheme="light"]{--eds_text__static_icons__default:initial;'); expect(css).not.toMatch(/(^|})(:root|html)[,{]/); diff --git a/packages/styles/src/__tests__/color-scheme-aliases.test.tsx b/packages/styles/src/__tests__/color-scheme-aliases.test.tsx index 01c60ec11..183d283a3 100644 --- a/packages/styles/src/__tests__/color-scheme-aliases.test.tsx +++ b/packages/styles/src/__tests__/color-scheme-aliases.test.tsx @@ -7,6 +7,11 @@ import { colourSchemeAliasDeclarations } from '../color-scheme-aliases'; import { ThemeProvider } from '../ThemeProvider'; describe('colourSchemeAliasDeclarations', () => { + it('accepts test runners that stub the raw CSS import', () => { + expect(colourSchemeAliasDeclarations({})).toEqual([]); + expect(colourSchemeAliasDeclarations(undefined)).toEqual([]); + }); + it('extracts the EDS semantic aliases declared at the light root', () => { const aliases = colourSchemeAliasDeclarations(edsVariables); expect(aliases).toContain('--eds-color-bg-neutral-surface: var(--eds-color-neutral-2)'); diff --git a/packages/styles/src/classic-colours.ts b/packages/styles/src/classic-colours.ts index 735782fd8..20208e1d2 100644 --- a/packages/styles/src/classic-colours.ts +++ b/packages/styles/src/classic-colours.ts @@ -137,6 +137,8 @@ export const classicOverlayColours: Readonly> = { * overlay components, including the alert inside the Snackbar's popover, it points at * `--eds_text__static_icons__default` instead. That property is only defined in dark mode, * so in light mode the reference is invalid and components keep their classic white fallback. + * The popover selector matches the classic Snackbar's markup, but also matches custom alerts with + * the same structure; contained buttons inside those alerts inherit the overlay text override. */ export const classicOverlayTextStyles = ` [role="tooltip"], [role="alert"][popover], [popover] > [role="alert"] { @@ -187,6 +189,7 @@ ${declarations} } @media (prefers-color-scheme: dark) { :root:not([data-color-scheme="light"]) { +color-scheme: dark; ${declarations} } } diff --git a/packages/styles/src/color-scheme-aliases.ts b/packages/styles/src/color-scheme-aliases.ts index 8691890c6..cbcbda12f 100644 --- a/packages/styles/src/color-scheme-aliases.ts +++ b/packages/styles/src/color-scheme-aliases.ts @@ -13,9 +13,10 @@ const ALIAS = /^(--eds-color-[\w-]+)\s*:\s*(var\(--eds-color-[\w-]+\))$/; * resolved to light values. * * @param source - The raw `@equinor/eds-tokens/css/variables.css` text, formatted or minified. - * @returns The alias declarations, without trailing semicolons. + * @returns The alias declarations, without trailing semicolons, or an empty list for a stubbed import. */ -export const colourSchemeAliasDeclarations = (source: string): string[] => { +export const colourSchemeAliasDeclarations = (source: unknown): string[] => { + if (typeof source !== 'string') return []; const declarations: string[] = []; for (const [, selector, body] of source.matchAll(RULE)) { if (selector.replace(/\s|["']/g, '') !== LIGHT_ROOT) continue; diff --git a/scripts/dark-mode-preview.js b/scripts/dark-mode-preview.js deleted file mode 100644 index 4304bb232..000000000 --- a/scripts/dark-mode-preview.js +++ /dev/null @@ -1,441 +0,0 @@ -import { spawnSync } from 'node:child_process'; -import { createHash } from 'node:crypto'; -import { - existsSync, - mkdirSync, - mkdtempSync, - readFileSync, - readdirSync, - realpathSync, - rmSync, - symlinkSync, - unlinkSync, - writeFileSync, -} from 'node:fs'; -import { homedir, tmpdir } from 'node:os'; -import { dirname, join } from 'node:path'; - -const registry = 'http://127.0.0.1:4873'; -const config = join(homedir(), '.config/fusion-dark-mode'); -const npmrc = join(config, 'npmrc'); -const repository = 'equinor/fusion-react-components'; -const dependencyFields = ['dependencies', 'optionalDependencies', 'peerDependencies']; -const readJson = (file) => JSON.parse(readFileSync(file, 'utf8')); -const writeJson = (file, value) => writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`); -const sri = /^sha512-[A-Za-z0-9+/]{86}==$/; -const fullSha = /^[a-f0-9]{40}$/; -const stableVersion = /^\d+\.\d+\.\d+$/; - -function isSnapshot(artifact, suffix) { - return ( - stableVersion.test(artifact?.stableVersion) && - artifact.version === `${artifact.stableVersion}-${suffix}` && - sri.test(artifact.integrity) - ); -} - -function satisfies(artifact, range) { - return range === artifact.version || Bun.semver.satisfies(artifact.stableVersion, range); -} - -function run(command, args, cwd, capture = false) { - const result = spawnSync(command, args, { - cwd, - encoding: 'utf8', - stdio: capture ? ['ignore', 'pipe', 'pipe'] : 'inherit', - }); - if (result.error) throw result.error; - if (result.status !== 0) { - const code = /\bnpm error code (\w+)\b/.exec(result.stderr ?? '')?.[1]; - throw new Error(`${command} ${args[0]} failed (${code ?? result.status ?? result.signal})`, { - cause: code, - }); - } - return capture ? result.stdout.trim() : undefined; -} - -function npm(temp, ...args) { - return run( - 'npm', - [ - ...args, - `--registry=${registry}`, - `--userconfig=${npmrc}`, - '--globalconfig=/dev/null', - '--noproxy=127.0.0.1', - '--prefer-online', - '--fetch-retries=0', - ], - temp, - true, - ); -} - -function dist(temp, spec, allowMissing = false) { - try { - return JSON.parse(npm(temp, 'view', spec, 'dist', '--json')); - } catch (error) { - if (allowMissing && error.cause === 'E404') return undefined; - throw error; - } -} - -function verifyDist(temp, spec, integrity) { - const artifact = dist(temp, spec); - if (new URL(artifact.tarball).origin !== registry || artifact.integrity !== integrity) { - throw new Error(`${spec} does not match the loopback preview artifact`); - } -} - -function readTags(temp, name) { - try { - return JSON.parse(npm(temp, 'view', name, 'dist-tags', '--json')); - } catch (error) { - if (error.cause === 'E404') return {}; - throw error; - } -} - -function verifyArtifact(temp, name, artifact, tag) { - const { version, integrity } = artifact; - verifyDist(temp, `${name}@${version}`, integrity); - const tags = readTags(temp, name); - if (tags[tag] !== version || tags.latest === version || tags['dark-mode'] === version) { - throw new Error(`${name}@${version} must have ${tag} without a moving tag`); - } -} - -function verifyLock(root, cwd, artifacts, tag, checkRanges = true) { - const { packages } = Bun.JSONC.parse(readFileSync(join(cwd, 'bun.lock'), 'utf8')); - const used = new Set(); - for (const [key, [resolution, tarball, metadata, integrity]] of Object.entries(packages)) { - for (const field of dependencyFields) { - for (const [name, range] of Object.entries(metadata?.[field] ?? {})) { - const candidate = artifacts[name]; - if (checkRanges && candidate && !satisfies(candidate, range)) { - throw new Error( - `${resolution} requires ${name}@${range}, incompatible with ${candidate.version}`, - ); - } - } - } - const at = resolution.lastIndexOf('@'); - const name = resolution.slice(0, at); - const artifact = artifacts[name]; - if (!artifact) continue; - const spec = `${name}@${artifact.version}`; - if ( - !checkRanges && - key !== name && - name === '@equinor/fusion-web-theme' && - Bun.semver.satisfies(resolution.slice(at + 1), '^0.1.12') - ) { - continue; - } - if ( - spec !== resolution || - integrity !== artifact.integrity || - !tarball?.startsWith(`${registry}/`) - ) { - throw new Error(`Bun selected ${resolution} instead of the verified ${spec}`); - } - if (!used.has(name)) verifyArtifact(root, name, artifact, tag); - used.add(name); - } - return used; -} - -function verifyConsumer(temp, packages) { - const consumer = join(temp, 'consumer'); - mkdirSync(consumer); - writeJson(join(consumer, 'package.json'), { - private: true, - dependencies: Object.fromEntries( - Object.entries(packages).map(([name, artifact]) => [name, artifact.version]), - ), - }); - install(temp, consumer, 'consumer-cache'); - // Older Web packages keep their own compatible theme; the consumer has no overrides. - const react = verifyLock(temp, consumer, packages, tag, false); - const web = verifyLock(temp, consumer, upstream, webTag); - if (react.size !== Object.keys(packages).length || !web.has('@equinor/fusion-wc-theme')) { - throw new Error('Clean consumer install is missing expected React or Web packages'); - } - console.log( - `Verified ${react.size} React snapshots and ${web.size} Web snapshots in a clean consumer`, - ); -} - -function install(temp, cwd, cache = 'cache') { - const projectNpmrc = join(cwd, '.npmrc'); - symlinkSync(npmrc, projectNpmrc); - try { - run('bun', ['install', `--registry=${registry}`, `--cache-dir=${join(temp, cache)}`], cwd); - } finally { - unlinkSync(projectNpmrc); - } -} - -function workspaces(cwd) { - const dirs = [ - 'components', - 'storybook', - ...readdirSync(join(cwd, 'packages')).map((p) => `packages/${p}`), - ]; - return new Map( - dirs.flatMap((dir) => { - const file = join(cwd, dir, 'package.json'); - if (!existsSync(file)) return []; - return [[readJson(file).name, file]]; - }), - ); -} - -function packReleases(temp, artifacts, workspaces, releases) { - const packed = new Map(); - function pack(name, dependency = false) { - if (packed.has(name)) return; - const file = workspaces.get(name); - const pkg = readJson(file); - if (pkg.private) throw new Error(`Cannot publish private workspace ${name}`); - const spec = `${name}@${pkg.version}`; - if (dependency && !releases.has(name)) { - if (dist(temp, spec, true)) return; - throw new Error(`${spec} is not available and has no planned snapshot release`); - } - packed.set(name, null); - for (const field of [...dependencyFields, 'devDependencies']) { - for (const [dep, range] of Object.entries(pkg[field] ?? {})) { - const sibling = workspaces.get(dep); - if (range.startsWith('workspace:') && sibling) { - if (field !== 'devDependencies') pack(dep, true); - pkg[field][dep] = readJson(sibling).version; - } else if (artifacts[dep]) { - const version = artifacts[dep].version; - if (!satisfies(artifacts[dep], range)) { - throw new Error(`${dep}@${version} does not satisfy ${name}'s ${range}`); - } - pkg[field][dep] = version; - } else if (/^(workspace:|file:|link:|portal:|\.{1,2}\/|\/)/.test(range)) { - throw new Error(`${spec} has a nonportable dependency on ${dep}`); - } - } - } - delete pkg.publishConfig; - writeJson(file, pkg); - const [tarball] = JSON.parse( - npm(temp, 'pack', '--ignore-scripts', '--json', `--pack-destination=${temp}`, dirname(file)), - ); - if (tarball.id !== spec || !tarball.files.some(({ path }) => path.startsWith('dist/'))) { - throw new Error(`Incomplete tarball for ${spec}`); - } - packed.delete(name); - packed.set(name, tarball); - } - for (const name of releases.keys()) pack(name); - return packed; -} - -const [action, webSha, source, ...extra] = process.argv.slice(2); -if ( - !['check', 'publish'].includes(action) || - !/^[a-f0-9]{8}$/.test(webSha) || - (source !== undefined && !fullSha.test(source)) || - extra.length -) { - throw new Error( - 'Usage: bun scripts/dark-mode-preview.js check|publish [react-full-sha]', - ); -} -if (!existsSync(npmrc)) throw new Error(`Set up the private Verdaccio npmrc at ${npmrc} first`); -const webFilename = `web-${webSha}.json`; -const webManifest = join(config, webFilename); -if (!existsSync(webManifest)) - throw new Error(`Publish the web preview and create ${webManifest} first`); -const { repository: webRepository, commit: webCommit, tag: webTag, packages: upstream } = - readJson(webManifest); -if ( - webRepository !== 'equinor/fusion-web-components' || - !fullSha.test(webCommit) || - !webCommit.startsWith(webSha) || - webTag !== `dark-mode-${webSha}` || - !upstream?.['@equinor/fusion-wc-theme'] || - !Object.entries(upstream).every( - ([name, artifact]) => - /^@equinor\/fusion-(wc-[a-z0-9-]+|web-components)$/.test(name) && - isSnapshot(artifact, webTag), - ) -) { - throw new Error('Invalid web-components preview manifest'); -} - -const commit = run( - 'git', - ['rev-parse', '--verify', `${source ?? 'HEAD'}^{commit}`], - process.cwd(), - true, -); -const short = commit.slice(0, 8); -const tag = `dark-mode-${short}-${webSha}`; -const suffix = `dark-mode.g${short}.g${webSha}`; -const manifest = join(config, `react-${short}-${webSha}.json`); -const upstreamSource = { - repository: webRepository, - commit: webCommit, - tag: webTag, - manifest: webFilename, -}; - -function reuseSnapshot(temp) { - const previous = readJson(manifest); - if ( - previous.repository !== repository || - previous.commit !== commit || - previous.tag !== tag || - Object.entries(upstreamSource).some(([key, value]) => previous.upstream?.[key] !== value) || - !sri.test(previous.upstream?.lockIntegrity) || - !previous.packages?.['@equinor/fusion-react-styles'] || - !Object.entries(previous.packages).every( - ([name, artifact]) => - /^@equinor\/fusion-(react-[a-z0-9-]+|web-theme)$/.test(name) && - isSnapshot(artifact, suffix), - ) - ) { - throw new Error(`Cannot reuse invalid React snapshot manifest: ${manifest}`); - } - verifyConsumer(temp, previous.packages); - console.log(`Reused ${manifest}`); -} - -const temp = mkdtempSync(join(realpathSync(tmpdir()), 'fusion-react-preview-')); -const cwd = join(temp, 'worktree'); -function buildSnapshot() { - run('git', ['worktree', 'add', '--detach', cwd, commit]); - - const workspaceFiles = workspaces(cwd); - const direct = new Set(); - for (const file of workspaceFiles.values()) { - const pkg = readJson(file); - for (const field of [...dependencyFields, 'devDependencies']) { - for (const [name, range] of Object.entries(pkg[field] ?? {})) { - if (!upstream[name]) continue; - direct.add(name); - if (!satisfies(upstream[name], range)) { - throw new Error( - `${name}@${upstream[name].stableVersion} does not satisfy ${pkg.name}'s ${range}`, - ); - } - } - } - } - const rootFile = join(cwd, 'package.json'); - const pkg = readJson(rootFile); - pkg.overrides ??= {}; - for (const [name, { version }] of Object.entries(upstream)) pkg.overrides[name] = version; - writeJson(rootFile, pkg); - install(temp, cwd); - const used = verifyLock(temp, cwd, upstream, webTag); - for (const name of direct) { - if (!used.has(name)) throw new Error(`Bun did not install preview ${name}`); - } - const lockHash = createHash('sha512').update(readFileSync(join(cwd, 'bun.lock'))).digest('base64'); - - const planFile = join(temp, 'releases.json'); - run('bun', ['run', 'changeset', 'status', `--output=${planFile}`], cwd); - const releases = new Map( - readJson(planFile) - .releases.filter( - ({ type, name }) => type !== 'none' && !readJson(workspaceFiles.get(name)).private, - ) - .map(({ name, newVersion }) => [name, newVersion]), - ); - if (releases.size === 0) throw new Error('No public React releases in the Changesets plan'); - const changesetsFile = join(cwd, '.changeset/config.json'); - const changesets = readJson(changesetsFile); - changesets.snapshot = { ...changesets.snapshot, useCalculatedVersion: true }; - writeJson(changesetsFile, changesets); - run( - 'bun', - ['run', 'changeset', 'version', '--snapshot', suffix, '--snapshot-prerelease-template', '{tag}'], - cwd, - ); - for (const [name, version] of releases) { - if (readJson(workspaceFiles.get(name)).version !== `${version}-${suffix}`) { - throw new Error(`Unexpected Changesets snapshot version for ${name}`); - } - } - run('bun', ['run', 'check'], cwd); - run('bun', ['run', 'build'], cwd); - run('bun', ['run', 'test'], cwd); - - const packed = packReleases(temp, upstream, workspaceFiles, releases); - const existing = new Set(); - const previousTags = new Map(); - if (action === 'publish') { - for (const artifact of packed.values()) { - const tags = readTags(temp, artifact.name); - if (tags[tag] && tags[tag] !== artifact.version) { - throw new Error(`Refusing to move ${artifact.name}'s existing ${tag} tag`); - } - previousTags.set(artifact.name, tags); - if (!dist(temp, artifact.id, true)) continue; - verifyArtifact(temp, artifact.name, artifact, tag); - existing.add(artifact.name); - } - } - const packages = {}; - for (const artifact of packed.values()) { - if (action === 'publish' && !existing.has(artifact.name)) { - npm( - temp, - 'publish', - join(temp, artifact.filename), - `--tag=${tag}`, - '--access=public', - '--provenance=false', - '--ignore-scripts', - ); - verifyArtifact(temp, artifact.name, artifact, tag); - } - if (action === 'publish') { - const current = readTags(temp, artifact.name); - const previous = previousTags.get(artifact.name); - if (current.latest !== previous.latest || current['dark-mode'] !== previous['dark-mode']) { - throw new Error(`Existing tags changed for ${artifact.name}`); - } - } - packages[artifact.name] = { - version: artifact.version, - stableVersion: releases.get(artifact.name), - integrity: artifact.integrity, - }; - console.log(`${action === 'check' ? 'Packed' : 'Verified'} ${artifact.id}`); - } - if (action === 'publish') { - verifyConsumer(temp, packages); - const upstreamDetails = { ...upstreamSource, lockIntegrity: `sha512-${lockHash}` }; - writeFileSync( - manifest, - `${JSON.stringify({ repository, commit, tag, upstream: upstreamDetails, packages }, null, 2)}\n`, - { flag: 'wx', mode: 0o600 }, - ); - console.log(`Wrote ${manifest}`); - } -} - -try { - const scope = npm(temp, 'config', 'get', '@equinor:registry'); - if (scope !== 'undefined' && scope !== registry && scope !== `${registry}/`) { - throw new Error('The preview npmrc must not direct @equinor to another registry'); - } - npm(temp, 'ping'); - if (action === 'publish' && existsSync(manifest)) { - reuseSnapshot(temp); - } else { - if (action === 'publish') npm(temp, 'whoami'); - buildSnapshot(); - } -} finally { - if (existsSync(cwd)) run('git', ['worktree', 'remove', '--force', cwd]); - rmSync(temp, { recursive: true }); -} diff --git a/storybook/.storybook/color-scheme.test.ts b/storybook/.storybook/color-scheme.test.ts index 05a05bb31..d554c934c 100644 --- a/storybook/.storybook/color-scheme.test.ts +++ b/storybook/.storybook/color-scheme.test.ts @@ -97,15 +97,18 @@ describe('EDS colours and classic components follow the toolbar colour scheme', }); /** Renders the preview body and a nested subtree the way the decorator and ThemeProvider do. */ - const render = async (scheme: StorybookColorScheme, prefers: 'light' | 'dark') => { + const render = async (scheme: StorybookColorScheme | undefined, prefers: 'light' | 'dark') => { const page = await browser.newPage({ colorScheme: prefers }); try { await page.route('**/*', (route) => route.abort()); + const schemeAttribute = scheme + ? ` data-color-scheme="${resolveColorScheme(scheme, prefers === 'dark')}"` + : ''; await page.setContent( - `` + + `` + `${previewHead}` + '' + - '
' + + '
' + `
` + `
` + `
` + @@ -117,7 +120,8 @@ describe('EDS colours and classic components follow the toolbar colour scheme', page.$eval(selector, (el) => getComputedStyle(el).backgroundColor); return { body: await background('body'), - classic: await background('#classic'), + canvas: await background('#canvas'), + nativeScheme: await page.$eval('body', (el) => getComputedStyle(el).colorScheme), mapped: await background('#mapped'), scrim: await background('#scrim'), lightScrim: await background('#light-scrim'), @@ -137,7 +141,7 @@ describe('EDS colours and classic components follow the toolbar colour scheme', ] as const)('%s with prefers-color-scheme: %s renders %s', async (scheme, prefers, result) => { const light = await render('light', 'light'); const dark = await render('dark', 'dark'); - expect(light.classic).not.toBe(dark.classic); + expect(light.canvas).not.toBe(dark.canvas); // Classic components keep their light values in light mode and follow the mapping in dark. expect(light.mapped).toBe(light.surface); expect(dark.mapped).toBe(dark.surface); @@ -145,12 +149,19 @@ describe('EDS colours and classic components follow the toolbar colour scheme', expect(light.scrim).toBe(light.lightScrim); expect(dark.lightScrim).toBe(light.lightScrim); expect(dark.scrim).toMatch(/\/ 0\.6\)$/); - expect(light.body).toBe(light.surface); - expect(dark.body).toBe(dark.surface); + expect(light.body).toBe(light.canvas); + expect(dark.body).toBe(dark.canvas); + expect(dark.body).not.toBe(dark.surface); expect(light.body).not.toBe(dark.body); expect(await render(scheme, prefers)).toEqual(result === 'light' ? light : dark); }); + test.each(['light', 'dark'] as const)('uses the %s native scheme without an explicit setting', async (scheme) => { + const system = await render(undefined, scheme); + expect(system.nativeScheme).toBe(scheme); + expect(system).toEqual(await render(scheme, scheme)); + }); + test('keeps canvas, panel and raised surfaces through real nested fwc-theme hosts', async () => { const styleRequire = createRequire(new URL('../../packages/styles/package.json', import.meta.url)); const themeBundle = resolve(styleRequire.resolve('@equinor/fusion-wc-theme'), '../../dist/index.js'); diff --git a/storybook/.storybook/preview-head.html b/storybook/.storybook/preview-head.html index 7e95aaf04..081d95580 100644 --- a/storybook/.storybook/preview-head.html +++ b/storybook/.storybook/preview-head.html @@ -1,7 +1,7 @@