@wordpress/theme 0.5.1-next.v.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -1
- package/build/prebuilt/js/design-tokens.cjs +9 -9
- package/build/prebuilt/js/design-tokens.cjs.map +1 -1
- package/build/prebuilt/ts/token-types.cjs.map +1 -1
- package/build/theme-provider.cjs +6 -7
- package/build/theme-provider.cjs.map +2 -2
- package/build-module/prebuilt/js/design-tokens.mjs +9 -9
- package/build-module/prebuilt/js/design-tokens.mjs.map +1 -1
- package/build-module/theme-provider.mjs +6 -7
- package/build-module/theme-provider.mjs.map +2 -2
- package/build-types/color-ramps/stories/index.story.d.ts +1 -1
- package/build-types/color-ramps/stories/index.story.d.ts.map +1 -1
- package/build-types/prebuilt/ts/token-types.d.ts +1 -1
- package/build-types/prebuilt/ts/token-types.d.ts.map +1 -1
- package/build-types/stories/index.story.d.ts +1 -1
- package/build-types/stories/index.story.d.ts.map +1 -1
- package/package.json +9 -6
- package/src/color-ramps/stories/index.story.tsx +1 -1
- package/src/prebuilt/css/design-tokens.css +10 -10
- package/src/prebuilt/js/design-tokens.mjs +9 -9
- package/src/prebuilt/ts/token-types.ts +1 -1
- package/src/stories/index.story.tsx +1 -1
- package/src/stories/introduction.mdx +1 -1
- package/src/style.scss +6 -0
- package/src/stylelint-plugins/test/fixtures/no-unknown-ds-tokens-valid.css +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.6.0 (2026-01-29)
|
|
6
|
+
|
|
7
|
+
## 0.5.0 (2026-01-16)
|
|
6
8
|
|
|
7
9
|
### Breaking changes
|
|
8
10
|
|
|
11
|
+
- Renamed border tokens to remove the `surface` segment from token names ([#74617](https://github.com/WordPress/gutenberg/pull/74617)):
|
|
12
|
+
- `--wpds-border-radius-surface-xs`: use `--wpds-border-radius-xs` instead.
|
|
13
|
+
- `--wpds-border-radius-surface-sm`: use `--wpds-border-radius-sm` instead.
|
|
14
|
+
- `--wpds-border-radius-surface-md`: use `--wpds-border-radius-md` instead.
|
|
15
|
+
- `--wpds-border-radius-surface-lg`: use `--wpds-border-radius-lg` instead.
|
|
16
|
+
- `--wpds-border-width-surface-xs`: use `--wpds-border-width-xs` instead.
|
|
17
|
+
- `--wpds-border-width-surface-sm`: use `--wpds-border-width-sm` instead.
|
|
18
|
+
- `--wpds-border-width-surface-md`: use `--wpds-border-width-md` instead.
|
|
19
|
+
- `--wpds-border-width-surface-lg`: use `--wpds-border-width-lg` instead.
|
|
20
|
+
- `--wpds-border-width-interactive-focus`: use `--wpds-border-width-focus` instead.
|
|
21
|
+
|
|
9
22
|
- Removed the following tokens ([#74470](https://github.com/WordPress/gutenberg/pull/74470)):
|
|
10
23
|
- `--wpds-color-bg-interactive-neutral`: use `--wpds-color-bg-interactive-neutral-weak` instead.
|
|
11
24
|
- `--wpds-color-bg-interactive-neutral-active`: use `--wpds-color-bg-interactive-neutral-weak-active` instead.
|
|
@@ -23,15 +23,15 @@ __export(design_tokens_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(design_tokens_exports);
|
|
25
25
|
var design_tokens_default = [
|
|
26
|
-
"--wpds-border-radius-
|
|
27
|
-
"--wpds-border-radius-
|
|
28
|
-
"--wpds-border-radius-
|
|
29
|
-
"--wpds-border-radius-
|
|
30
|
-
"--wpds-border-width-
|
|
31
|
-
"--wpds-border-width-
|
|
32
|
-
"--wpds-border-width-
|
|
33
|
-
"--wpds-border-width-
|
|
34
|
-
"--wpds-border-width-
|
|
26
|
+
"--wpds-border-radius-xs",
|
|
27
|
+
"--wpds-border-radius-sm",
|
|
28
|
+
"--wpds-border-radius-md",
|
|
29
|
+
"--wpds-border-radius-lg",
|
|
30
|
+
"--wpds-border-width-xs",
|
|
31
|
+
"--wpds-border-width-sm",
|
|
32
|
+
"--wpds-border-width-md",
|
|
33
|
+
"--wpds-border-width-lg",
|
|
34
|
+
"--wpds-border-width-focus",
|
|
35
35
|
"--wpds-color-bg-surface-neutral",
|
|
36
36
|
"--wpds-color-bg-surface-neutral-strong",
|
|
37
37
|
"--wpds-color-bg-surface-neutral-weak",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/prebuilt/js/design-tokens.mjs"],
|
|
4
|
-
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-known-wpds-css-variables plugin.\n * Do not edit this file directly.\n */\n\nexport default [\n\t'--wpds-border-radius-
|
|
4
|
+
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-known-wpds-css-variables plugin.\n * Do not edit this file directly.\n */\n\nexport default [\n\t'--wpds-border-radius-xs',\n\t'--wpds-border-radius-sm',\n\t'--wpds-border-radius-md',\n\t'--wpds-border-radius-lg',\n\t'--wpds-border-width-xs',\n\t'--wpds-border-width-sm',\n\t'--wpds-border-width-md',\n\t'--wpds-border-width-lg',\n\t'--wpds-border-width-focus',\n\t'--wpds-color-bg-surface-neutral',\n\t'--wpds-color-bg-surface-neutral-strong',\n\t'--wpds-color-bg-surface-neutral-weak',\n\t'--wpds-color-bg-surface-brand',\n\t'--wpds-color-bg-surface-success',\n\t'--wpds-color-bg-surface-success-weak',\n\t'--wpds-color-bg-surface-info',\n\t'--wpds-color-bg-surface-info-weak',\n\t'--wpds-color-bg-surface-warning',\n\t'--wpds-color-bg-surface-warning-weak',\n\t'--wpds-color-bg-surface-caution',\n\t'--wpds-color-bg-surface-caution-weak',\n\t'--wpds-color-bg-surface-error',\n\t'--wpds-color-bg-surface-error-weak',\n\t'--wpds-color-bg-interactive-neutral-strong',\n\t'--wpds-color-bg-interactive-neutral-strong-active',\n\t'--wpds-color-bg-interactive-neutral-strong-disabled',\n\t'--wpds-color-bg-interactive-neutral-weak',\n\t'--wpds-color-bg-interactive-neutral-weak-active',\n\t'--wpds-color-bg-interactive-neutral-weak-disabled',\n\t'--wpds-color-bg-interactive-brand-strong',\n\t'--wpds-color-bg-interactive-brand-strong-active',\n\t'--wpds-color-bg-interactive-brand-weak',\n\t'--wpds-color-bg-interactive-brand-weak-active',\n\t'--wpds-color-bg-interactive-error',\n\t'--wpds-color-bg-interactive-error-active',\n\t'--wpds-color-bg-interactive-error-strong',\n\t'--wpds-color-bg-interactive-error-strong-active',\n\t'--wpds-color-bg-interactive-error-weak',\n\t'--wpds-color-bg-interactive-error-weak-active',\n\t'--wpds-color-bg-track-neutral-weak',\n\t'--wpds-color-bg-track-neutral',\n\t'--wpds-color-bg-thumb-neutral-weak',\n\t'--wpds-color-bg-thumb-neutral-weak-active',\n\t'--wpds-color-bg-thumb-brand',\n\t'--wpds-color-bg-thumb-brand-active',\n\t'--wpds-color-bg-thumb-neutral-disabled',\n\t'--wpds-color-fg-content-neutral',\n\t'--wpds-color-fg-content-neutral-weak',\n\t'--wpds-color-fg-content-success',\n\t'--wpds-color-fg-content-success-weak',\n\t'--wpds-color-fg-content-info',\n\t'--wpds-color-fg-content-info-weak',\n\t'--wpds-color-fg-content-warning',\n\t'--wpds-color-fg-content-warning-weak',\n\t'--wpds-color-fg-content-caution',\n\t'--wpds-color-fg-content-caution-weak',\n\t'--wpds-color-fg-content-error',\n\t'--wpds-color-fg-content-error-weak',\n\t'--wpds-color-fg-interactive-neutral',\n\t'--wpds-color-fg-interactive-neutral-active',\n\t'--wpds-color-fg-interactive-neutral-disabled',\n\t'--wpds-color-fg-interactive-neutral-strong',\n\t'--wpds-color-fg-interactive-neutral-strong-active',\n\t'--wpds-color-fg-interactive-neutral-strong-disabled',\n\t'--wpds-color-fg-interactive-neutral-weak',\n\t'--wpds-color-fg-interactive-neutral-weak-disabled',\n\t'--wpds-color-fg-interactive-brand',\n\t'--wpds-color-fg-interactive-brand-active',\n\t'--wpds-color-fg-interactive-brand-strong',\n\t'--wpds-color-fg-interactive-brand-strong-active',\n\t'--wpds-color-fg-interactive-error',\n\t'--wpds-color-fg-interactive-error-active',\n\t'--wpds-color-fg-interactive-error-strong',\n\t'--wpds-color-fg-interactive-error-strong-active',\n\t'--wpds-color-stroke-surface-neutral',\n\t'--wpds-color-stroke-surface-neutral-weak',\n\t'--wpds-color-stroke-surface-neutral-strong',\n\t'--wpds-color-stroke-surface-brand',\n\t'--wpds-color-stroke-surface-brand-strong',\n\t'--wpds-color-stroke-surface-success',\n\t'--wpds-color-stroke-surface-success-strong',\n\t'--wpds-color-stroke-surface-info',\n\t'--wpds-color-stroke-surface-info-strong',\n\t'--wpds-color-stroke-surface-warning',\n\t'--wpds-color-stroke-surface-warning-strong',\n\t'--wpds-color-stroke-surface-error',\n\t'--wpds-color-stroke-surface-error-strong',\n\t'--wpds-color-stroke-interactive-neutral',\n\t'--wpds-color-stroke-interactive-neutral-active',\n\t'--wpds-color-stroke-interactive-neutral-disabled',\n\t'--wpds-color-stroke-interactive-neutral-strong',\n\t'--wpds-color-stroke-interactive-brand',\n\t'--wpds-color-stroke-interactive-brand-active',\n\t'--wpds-color-stroke-interactive-error',\n\t'--wpds-color-stroke-interactive-error-active',\n\t'--wpds-color-stroke-interactive-error-strong',\n\t'--wpds-color-stroke-focus-brand',\n\t'--wpds-dimension-base',\n\t'--wpds-dimension-padding-surface-2xs',\n\t'--wpds-dimension-padding-surface-xs',\n\t'--wpds-dimension-padding-surface-sm',\n\t'--wpds-dimension-padding-surface-md',\n\t'--wpds-dimension-padding-surface-lg',\n\t'--wpds-dimension-gap-2xs',\n\t'--wpds-dimension-gap-xs',\n\t'--wpds-dimension-gap-sm',\n\t'--wpds-dimension-gap-md',\n\t'--wpds-dimension-gap-lg',\n\t'--wpds-dimension-gap-xl',\n\t'--wpds-elevation-x-small',\n\t'--wpds-elevation-small',\n\t'--wpds-elevation-medium',\n\t'--wpds-elevation-large',\n\t'--wpds-font-family-heading',\n\t'--wpds-font-family-body',\n\t'--wpds-font-family-mono',\n\t'--wpds-font-size-xs',\n\t'--wpds-font-size-sm',\n\t'--wpds-font-size-md',\n\t'--wpds-font-size-lg',\n\t'--wpds-font-size-xl',\n\t'--wpds-font-size-2xl',\n\t'--wpds-font-line-height-xs',\n\t'--wpds-font-line-height-sm',\n\t'--wpds-font-line-height-md',\n\t'--wpds-font-line-height-lg',\n\t'--wpds-font-line-height-xl',\n\t'--wpds-font-line-height-2xl',\n\t'--wpds-font-weight-regular',\n\t'--wpds-font-weight-medium',\n];\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAO,wBAAQ;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/prebuilt/ts/token-types.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-typescript-types plugin.\n * Do not edit this file directly.\n */\n\n/**\n * Size scale for padding tokens.\n */\nexport type PaddingSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for gap tokens.\n */\nexport type GapSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Size scale for border radius tokens.\n */\nexport type BorderRadiusSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for border width tokens.\n */\nexport type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Target elements that tokens can be applied to.\n */\nexport type Target =\n\t| 'surface'\n\t| 'interactive'\n\t| 'track'\n\t| 'thumb'\n\t| 'content'\n\t| 'focus';\n\n/**\n * Background color variants for surface elements.\n */\nexport type SurfaceBackgroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Background color variants for interactive elements.\n */\nexport type InteractiveBackgroundColor =\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand-strong'\n\t| 'brand-weak'\n\t| 'error'\n\t| 'error-strong'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for content text and icons.\n */\nexport type ContentForegroundColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for interactive element text and icons.\n */\nexport type InteractiveForegroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for surface borders.\n */\nexport type SurfaceStrokeColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'success'\n\t| 'success-strong'\n\t| 'info'\n\t| 'info-strong'\n\t| 'warning'\n\t| 'warning-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for interactive element borders.\n */\nexport type InteractiveStrokeColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Foreground color variants for text elements.\n */\nexport type ForegroundColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak'\n\t| 'neutral-active'\n\t| 'neutral-disabled'\n\t| 'neutral-strong'\n\t| 'neutral-strong-active'\n\t| 'neutral-strong-disabled'\n\t| 'neutral-weak-disabled'\n\t| 'brand'\n\t| 'brand-active'\n\t| 'brand-strong'\n\t| 'brand-strong-active'\n\t| 'error-active'\n\t| 'error-strong'\n\t| 'error-strong-active';\n\n/**\n * Font family variants.\n */\nexport type FontFamily = 'heading' | 'body' | 'mono';\n\n/**\n * Font size scale.\n */\nexport type FontSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n/**\n * Font weight variants.\n */\nexport type FontWeight = 'regular' | 'medium';\n\n/**\n * Line height scale.\n */\nexport type LineHeight = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n"],
|
|
4
|
+
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-typescript-types plugin.\n * Do not edit this file directly.\n */\n\n/**\n * Size scale for padding tokens.\n */\nexport type PaddingSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for gap tokens.\n */\nexport type GapSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Size scale for border radius tokens.\n */\nexport type BorderRadiusSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/**\n * Size scale for border width tokens.\n */\nexport type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'focus';\n\n/**\n * Target elements that tokens can be applied to.\n */\nexport type Target =\n\t| 'surface'\n\t| 'interactive'\n\t| 'track'\n\t| 'thumb'\n\t| 'content'\n\t| 'focus';\n\n/**\n * Background color variants for surface elements.\n */\nexport type SurfaceBackgroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Background color variants for interactive elements.\n */\nexport type InteractiveBackgroundColor =\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand-strong'\n\t| 'brand-weak'\n\t| 'error'\n\t| 'error-strong'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for content text and icons.\n */\nexport type ContentForegroundColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak';\n\n/**\n * Foreground color variants for interactive element text and icons.\n */\nexport type InteractiveForegroundColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'neutral-weak'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for surface borders.\n */\nexport type SurfaceStrokeColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'brand-strong'\n\t| 'success'\n\t| 'success-strong'\n\t| 'info'\n\t| 'info-strong'\n\t| 'warning'\n\t| 'warning-strong'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Stroke color variants for interactive element borders.\n */\nexport type InteractiveStrokeColor =\n\t| 'neutral'\n\t| 'neutral-strong'\n\t| 'brand'\n\t| 'error'\n\t| 'error-strong';\n\n/**\n * Foreground color variants for text elements.\n */\nexport type ForegroundColor =\n\t| 'neutral'\n\t| 'neutral-weak'\n\t| 'success'\n\t| 'success-weak'\n\t| 'info'\n\t| 'info-weak'\n\t| 'warning'\n\t| 'warning-weak'\n\t| 'caution'\n\t| 'caution-weak'\n\t| 'error'\n\t| 'error-weak'\n\t| 'neutral-active'\n\t| 'neutral-disabled'\n\t| 'neutral-strong'\n\t| 'neutral-strong-active'\n\t| 'neutral-strong-disabled'\n\t| 'neutral-weak-disabled'\n\t| 'brand'\n\t| 'brand-active'\n\t| 'brand-strong'\n\t| 'brand-strong-active'\n\t| 'error-active'\n\t| 'error-strong'\n\t| 'error-strong-active';\n\n/**\n * Font family variants.\n */\nexport type FontFamily = 'heading' | 'body' | 'mono';\n\n/**\n * Font size scale.\n */\nexport type FontSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n/**\n * Font weight variants.\n */\nexport type FontWeight = 'regular' | 'medium';\n\n/**\n * Line height scale.\n */\nexport type LineHeight = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build/theme-provider.cjs
CHANGED
|
@@ -27,14 +27,13 @@ var import_context = require("./context.cjs");
|
|
|
27
27
|
var import_use_theme_provider_styles = require("./use-theme-provider-styles.cjs");
|
|
28
28
|
|
|
29
29
|
// packages/theme/src/style.module.css
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='662a5161a8']")) {
|
|
31
|
+
const style = document.createElement("style");
|
|
32
|
+
style.setAttribute("data-wp-hash", "662a5161a8");
|
|
33
|
+
style.appendChild(document.createTextNode(".dba930ea7a9438fd__root{display:contents}"));
|
|
34
|
+
document.head.appendChild(style);
|
|
32
35
|
}
|
|
33
|
-
|
|
34
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
35
|
-
var style_default = {
|
|
36
|
-
"root": "style-module__root__26kw6"
|
|
37
|
-
};
|
|
36
|
+
var style_default = { "root": "dba930ea7a9438fd__root" };
|
|
38
37
|
|
|
39
38
|
// packages/theme/src/theme-provider.tsx
|
|
40
39
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/theme-provider.tsx", "../src/style.module.css"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useId } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ThemeContext } from './context';\nimport { useThemeProviderStyles } from './use-theme-provider-styles';\nimport { type ThemeProviderProps } from './types';\nimport styles from './style.module.css';\n\nfunction cssObjectToText( values: CSSProperties ) {\n\treturn Object.entries( values )\n\t\t.map( ( [ key, value ] ) => `${ key }: ${ value };` )\n\t\t.join( '' );\n}\n\nfunction generateCSSSelector( {\n\tinstanceId,\n\tisRoot,\n}: {\n\tinstanceId: string;\n\tisRoot: boolean;\n} ) {\n\tconst rootSel = `[data-wpds-root-provider=\"true\"]`;\n\tconst instanceIdSel = `[data-wpds-theme-provider-id=\"${ instanceId }\"]`;\n\n\tconst selectors = [];\n\n\tif ( isRoot ) {\n\t\tselectors.push(\n\t\t\t`:root:has(.${ styles.root }${ rootSel }${ instanceIdSel })`\n\t\t);\n\t}\n\n\tselectors.push( `.${ styles.root }.${ styles.root }${ instanceIdSel }` );\n\n\treturn selectors.join( ',' );\n}\n\nexport const ThemeProvider = ( {\n\tchildren,\n\tcolor = {},\n\tisRoot = false,\n\tdensity,\n}: ThemeProviderProps ) => {\n\tconst instanceId = useId();\n\n\tconst { themeProviderStyles, resolvedSettings } = useThemeProviderStyles( {\n\t\tcolor,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tresolvedSettings,\n\t\t} ),\n\t\t[ resolvedSettings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ themeProviderStyles ? (\n\t\t\t\t<style>\n\t\t\t\t\t{ `${ generateCSSSelector( {\n\t\t\t\t\t\tinstanceId,\n\t\t\t\t\t\tisRoot,\n\t\t\t\t\t} ) } {${ cssObjectToText( themeProviderStyles ) }}` }\n\t\t\t\t</style>\n\t\t\t) : null }\n\t\t\t<div\n\t\t\t\tdata-wpds-theme-provider-id={ instanceId }\n\t\t\t\tdata-wpds-root-provider={ isRoot }\n\t\t\t\tdata-wpds-density={ density }\n\t\t\t\tclassName={ styles.root }\n\t\t\t>\n\t\t\t\t<ThemeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</ThemeContext.Provider>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n", "
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,qBAA+B;AAK/B,qBAA6B;AAC7B,uCAAuC;;;ACdvC,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useId } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ThemeContext } from './context';\nimport { useThemeProviderStyles } from './use-theme-provider-styles';\nimport { type ThemeProviderProps } from './types';\nimport styles from './style.module.css';\n\nfunction cssObjectToText( values: CSSProperties ) {\n\treturn Object.entries( values )\n\t\t.map( ( [ key, value ] ) => `${ key }: ${ value };` )\n\t\t.join( '' );\n}\n\nfunction generateCSSSelector( {\n\tinstanceId,\n\tisRoot,\n}: {\n\tinstanceId: string;\n\tisRoot: boolean;\n} ) {\n\tconst rootSel = `[data-wpds-root-provider=\"true\"]`;\n\tconst instanceIdSel = `[data-wpds-theme-provider-id=\"${ instanceId }\"]`;\n\n\tconst selectors = [];\n\n\tif ( isRoot ) {\n\t\tselectors.push(\n\t\t\t`:root:has(.${ styles.root }${ rootSel }${ instanceIdSel })`\n\t\t);\n\t}\n\n\tselectors.push( `.${ styles.root }.${ styles.root }${ instanceIdSel }` );\n\n\treturn selectors.join( ',' );\n}\n\nexport const ThemeProvider = ( {\n\tchildren,\n\tcolor = {},\n\tisRoot = false,\n\tdensity,\n}: ThemeProviderProps ) => {\n\tconst instanceId = useId();\n\n\tconst { themeProviderStyles, resolvedSettings } = useThemeProviderStyles( {\n\t\tcolor,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tresolvedSettings,\n\t\t} ),\n\t\t[ resolvedSettings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ themeProviderStyles ? (\n\t\t\t\t<style>\n\t\t\t\t\t{ `${ generateCSSSelector( {\n\t\t\t\t\t\tinstanceId,\n\t\t\t\t\t\tisRoot,\n\t\t\t\t\t} ) } {${ cssObjectToText( themeProviderStyles ) }}` }\n\t\t\t\t</style>\n\t\t\t) : null }\n\t\t\t<div\n\t\t\t\tdata-wpds-theme-provider-id={ instanceId }\n\t\t\t\tdata-wpds-root-provider={ isRoot }\n\t\t\t\tdata-wpds-density={ density }\n\t\t\t\tclassName={ styles.root }\n\t\t\t>\n\t\t\t\t<ThemeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</ThemeContext.Provider>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='662a5161a8']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"662a5161a8\");\n\tstyle.appendChild(document.createTextNode(\".dba930ea7a9438fd__root{display:contents}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"root\":\"dba930ea7a9438fd__root\"};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,qBAA+B;AAK/B,qBAA6B;AAC7B,uCAAuC;;;ACdvC,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,2CAA2C,CAAC;AACtF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,QAAO,yBAAwB;;;AD6D7C;AAjDF,SAAS,gBAAiB,QAAwB;AACjD,SAAO,OAAO,QAAS,MAAO,EAC5B,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO,GAAI,GAAI,KAAM,KAAM,GAAI,EACnD,KAAM,EAAG;AACZ;AAEA,SAAS,oBAAqB;AAAA,EAC7B;AAAA,EACA;AACD,GAGI;AACH,QAAM,UAAU;AAChB,QAAM,gBAAgB,iCAAkC,UAAW;AAEnE,QAAM,YAAY,CAAC;AAEnB,MAAK,QAAS;AACb,cAAU;AAAA,MACT,cAAe,cAAO,IAAK,GAAI,OAAQ,GAAI,aAAc;AAAA,IAC1D;AAAA,EACD;AAEA,YAAU,KAAM,IAAK,cAAO,IAAK,IAAK,cAAO,IAAK,GAAI,aAAc,EAAG;AAEvE,SAAO,UAAU,KAAM,GAAI;AAC5B;AAEO,IAAM,gBAAgB,CAAE;AAAA,EAC9B;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,SAAS;AAAA,EACT;AACD,MAA2B;AAC1B,QAAM,iBAAa,sBAAM;AAEzB,QAAM,EAAE,qBAAqB,iBAAiB,QAAI,yDAAwB;AAAA,IACzE;AAAA,EACD,CAAE;AAEF,QAAM,mBAAe;AAAA,IACpB,OAAQ;AAAA,MACP;AAAA,IACD;AAAA,IACA,CAAE,gBAAiB;AAAA,EACpB;AAEA,SACC,4EACG;AAAA,0BACD,4CAAC,WACE,aAAI,oBAAqB;AAAA,MAC1B;AAAA,MACA;AAAA,IACD,CAAE,CAAE,KAAM,gBAAiB,mBAAoB,CAAE,KAClD,IACG;AAAA,IACJ;AAAA,MAAC;AAAA;AAAA,QACA,+BAA8B;AAAA,QAC9B,2BAA0B;AAAA,QAC1B,qBAAoB;AAAA,QACpB,WAAY,cAAO;AAAA,QAEnB,sDAAC,4BAAa,UAAb,EAAsB,OAAQ,cAC5B,UACH;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// packages/theme/src/prebuilt/js/design-tokens.mjs
|
|
2
2
|
var design_tokens_default = [
|
|
3
|
-
"--wpds-border-radius-
|
|
4
|
-
"--wpds-border-radius-
|
|
5
|
-
"--wpds-border-radius-
|
|
6
|
-
"--wpds-border-radius-
|
|
7
|
-
"--wpds-border-width-
|
|
8
|
-
"--wpds-border-width-
|
|
9
|
-
"--wpds-border-width-
|
|
10
|
-
"--wpds-border-width-
|
|
11
|
-
"--wpds-border-width-
|
|
3
|
+
"--wpds-border-radius-xs",
|
|
4
|
+
"--wpds-border-radius-sm",
|
|
5
|
+
"--wpds-border-radius-md",
|
|
6
|
+
"--wpds-border-radius-lg",
|
|
7
|
+
"--wpds-border-width-xs",
|
|
8
|
+
"--wpds-border-width-sm",
|
|
9
|
+
"--wpds-border-width-md",
|
|
10
|
+
"--wpds-border-width-lg",
|
|
11
|
+
"--wpds-border-width-focus",
|
|
12
12
|
"--wpds-color-bg-surface-neutral",
|
|
13
13
|
"--wpds-color-bg-surface-neutral-strong",
|
|
14
14
|
"--wpds-color-bg-surface-neutral-weak",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/prebuilt/js/design-tokens.mjs"],
|
|
4
|
-
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-known-wpds-css-variables plugin.\n * Do not edit this file directly.\n */\n\nexport default [\n\t'--wpds-border-radius-
|
|
4
|
+
"sourcesContent": ["/*\n * This file is generated by the @wordpress/terrazzo-plugin-known-wpds-css-variables plugin.\n * Do not edit this file directly.\n */\n\nexport default [\n\t'--wpds-border-radius-xs',\n\t'--wpds-border-radius-sm',\n\t'--wpds-border-radius-md',\n\t'--wpds-border-radius-lg',\n\t'--wpds-border-width-xs',\n\t'--wpds-border-width-sm',\n\t'--wpds-border-width-md',\n\t'--wpds-border-width-lg',\n\t'--wpds-border-width-focus',\n\t'--wpds-color-bg-surface-neutral',\n\t'--wpds-color-bg-surface-neutral-strong',\n\t'--wpds-color-bg-surface-neutral-weak',\n\t'--wpds-color-bg-surface-brand',\n\t'--wpds-color-bg-surface-success',\n\t'--wpds-color-bg-surface-success-weak',\n\t'--wpds-color-bg-surface-info',\n\t'--wpds-color-bg-surface-info-weak',\n\t'--wpds-color-bg-surface-warning',\n\t'--wpds-color-bg-surface-warning-weak',\n\t'--wpds-color-bg-surface-caution',\n\t'--wpds-color-bg-surface-caution-weak',\n\t'--wpds-color-bg-surface-error',\n\t'--wpds-color-bg-surface-error-weak',\n\t'--wpds-color-bg-interactive-neutral-strong',\n\t'--wpds-color-bg-interactive-neutral-strong-active',\n\t'--wpds-color-bg-interactive-neutral-strong-disabled',\n\t'--wpds-color-bg-interactive-neutral-weak',\n\t'--wpds-color-bg-interactive-neutral-weak-active',\n\t'--wpds-color-bg-interactive-neutral-weak-disabled',\n\t'--wpds-color-bg-interactive-brand-strong',\n\t'--wpds-color-bg-interactive-brand-strong-active',\n\t'--wpds-color-bg-interactive-brand-weak',\n\t'--wpds-color-bg-interactive-brand-weak-active',\n\t'--wpds-color-bg-interactive-error',\n\t'--wpds-color-bg-interactive-error-active',\n\t'--wpds-color-bg-interactive-error-strong',\n\t'--wpds-color-bg-interactive-error-strong-active',\n\t'--wpds-color-bg-interactive-error-weak',\n\t'--wpds-color-bg-interactive-error-weak-active',\n\t'--wpds-color-bg-track-neutral-weak',\n\t'--wpds-color-bg-track-neutral',\n\t'--wpds-color-bg-thumb-neutral-weak',\n\t'--wpds-color-bg-thumb-neutral-weak-active',\n\t'--wpds-color-bg-thumb-brand',\n\t'--wpds-color-bg-thumb-brand-active',\n\t'--wpds-color-bg-thumb-neutral-disabled',\n\t'--wpds-color-fg-content-neutral',\n\t'--wpds-color-fg-content-neutral-weak',\n\t'--wpds-color-fg-content-success',\n\t'--wpds-color-fg-content-success-weak',\n\t'--wpds-color-fg-content-info',\n\t'--wpds-color-fg-content-info-weak',\n\t'--wpds-color-fg-content-warning',\n\t'--wpds-color-fg-content-warning-weak',\n\t'--wpds-color-fg-content-caution',\n\t'--wpds-color-fg-content-caution-weak',\n\t'--wpds-color-fg-content-error',\n\t'--wpds-color-fg-content-error-weak',\n\t'--wpds-color-fg-interactive-neutral',\n\t'--wpds-color-fg-interactive-neutral-active',\n\t'--wpds-color-fg-interactive-neutral-disabled',\n\t'--wpds-color-fg-interactive-neutral-strong',\n\t'--wpds-color-fg-interactive-neutral-strong-active',\n\t'--wpds-color-fg-interactive-neutral-strong-disabled',\n\t'--wpds-color-fg-interactive-neutral-weak',\n\t'--wpds-color-fg-interactive-neutral-weak-disabled',\n\t'--wpds-color-fg-interactive-brand',\n\t'--wpds-color-fg-interactive-brand-active',\n\t'--wpds-color-fg-interactive-brand-strong',\n\t'--wpds-color-fg-interactive-brand-strong-active',\n\t'--wpds-color-fg-interactive-error',\n\t'--wpds-color-fg-interactive-error-active',\n\t'--wpds-color-fg-interactive-error-strong',\n\t'--wpds-color-fg-interactive-error-strong-active',\n\t'--wpds-color-stroke-surface-neutral',\n\t'--wpds-color-stroke-surface-neutral-weak',\n\t'--wpds-color-stroke-surface-neutral-strong',\n\t'--wpds-color-stroke-surface-brand',\n\t'--wpds-color-stroke-surface-brand-strong',\n\t'--wpds-color-stroke-surface-success',\n\t'--wpds-color-stroke-surface-success-strong',\n\t'--wpds-color-stroke-surface-info',\n\t'--wpds-color-stroke-surface-info-strong',\n\t'--wpds-color-stroke-surface-warning',\n\t'--wpds-color-stroke-surface-warning-strong',\n\t'--wpds-color-stroke-surface-error',\n\t'--wpds-color-stroke-surface-error-strong',\n\t'--wpds-color-stroke-interactive-neutral',\n\t'--wpds-color-stroke-interactive-neutral-active',\n\t'--wpds-color-stroke-interactive-neutral-disabled',\n\t'--wpds-color-stroke-interactive-neutral-strong',\n\t'--wpds-color-stroke-interactive-brand',\n\t'--wpds-color-stroke-interactive-brand-active',\n\t'--wpds-color-stroke-interactive-error',\n\t'--wpds-color-stroke-interactive-error-active',\n\t'--wpds-color-stroke-interactive-error-strong',\n\t'--wpds-color-stroke-focus-brand',\n\t'--wpds-dimension-base',\n\t'--wpds-dimension-padding-surface-2xs',\n\t'--wpds-dimension-padding-surface-xs',\n\t'--wpds-dimension-padding-surface-sm',\n\t'--wpds-dimension-padding-surface-md',\n\t'--wpds-dimension-padding-surface-lg',\n\t'--wpds-dimension-gap-2xs',\n\t'--wpds-dimension-gap-xs',\n\t'--wpds-dimension-gap-sm',\n\t'--wpds-dimension-gap-md',\n\t'--wpds-dimension-gap-lg',\n\t'--wpds-dimension-gap-xl',\n\t'--wpds-elevation-x-small',\n\t'--wpds-elevation-small',\n\t'--wpds-elevation-medium',\n\t'--wpds-elevation-large',\n\t'--wpds-font-family-heading',\n\t'--wpds-font-family-body',\n\t'--wpds-font-family-mono',\n\t'--wpds-font-size-xs',\n\t'--wpds-font-size-sm',\n\t'--wpds-font-size-md',\n\t'--wpds-font-size-lg',\n\t'--wpds-font-size-xl',\n\t'--wpds-font-size-2xl',\n\t'--wpds-font-line-height-xs',\n\t'--wpds-font-line-height-sm',\n\t'--wpds-font-line-height-md',\n\t'--wpds-font-line-height-lg',\n\t'--wpds-font-line-height-xl',\n\t'--wpds-font-line-height-2xl',\n\t'--wpds-font-weight-regular',\n\t'--wpds-font-weight-medium',\n];\n"],
|
|
5
5
|
"mappings": ";AAKA,IAAO,wBAAQ;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -4,14 +4,13 @@ import { ThemeContext } from "./context.mjs";
|
|
|
4
4
|
import { useThemeProviderStyles } from "./use-theme-provider-styles.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/theme/src/style.module.css
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='662a5161a8']")) {
|
|
8
|
+
const style = document.createElement("style");
|
|
9
|
+
style.setAttribute("data-wp-hash", "662a5161a8");
|
|
10
|
+
style.appendChild(document.createTextNode(".dba930ea7a9438fd__root{display:contents}"));
|
|
11
|
+
document.head.appendChild(style);
|
|
9
12
|
}
|
|
10
|
-
|
|
11
|
-
document.head.appendChild(document.createElement("style")).appendChild(document.createTextNode(css));
|
|
12
|
-
var style_default = {
|
|
13
|
-
"root": "style-module__root__26kw6"
|
|
14
|
-
};
|
|
13
|
+
var style_default = { "root": "dba930ea7a9438fd__root" };
|
|
15
14
|
|
|
16
15
|
// packages/theme/src/theme-provider.tsx
|
|
17
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/theme-provider.tsx", "../src/style.module.css"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useId } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ThemeContext } from './context';\nimport { useThemeProviderStyles } from './use-theme-provider-styles';\nimport { type ThemeProviderProps } from './types';\nimport styles from './style.module.css';\n\nfunction cssObjectToText( values: CSSProperties ) {\n\treturn Object.entries( values )\n\t\t.map( ( [ key, value ] ) => `${ key }: ${ value };` )\n\t\t.join( '' );\n}\n\nfunction generateCSSSelector( {\n\tinstanceId,\n\tisRoot,\n}: {\n\tinstanceId: string;\n\tisRoot: boolean;\n} ) {\n\tconst rootSel = `[data-wpds-root-provider=\"true\"]`;\n\tconst instanceIdSel = `[data-wpds-theme-provider-id=\"${ instanceId }\"]`;\n\n\tconst selectors = [];\n\n\tif ( isRoot ) {\n\t\tselectors.push(\n\t\t\t`:root:has(.${ styles.root }${ rootSel }${ instanceIdSel })`\n\t\t);\n\t}\n\n\tselectors.push( `.${ styles.root }.${ styles.root }${ instanceIdSel }` );\n\n\treturn selectors.join( ',' );\n}\n\nexport const ThemeProvider = ( {\n\tchildren,\n\tcolor = {},\n\tisRoot = false,\n\tdensity,\n}: ThemeProviderProps ) => {\n\tconst instanceId = useId();\n\n\tconst { themeProviderStyles, resolvedSettings } = useThemeProviderStyles( {\n\t\tcolor,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tresolvedSettings,\n\t\t} ),\n\t\t[ resolvedSettings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ themeProviderStyles ? (\n\t\t\t\t<style>\n\t\t\t\t\t{ `${ generateCSSSelector( {\n\t\t\t\t\t\tinstanceId,\n\t\t\t\t\t\tisRoot,\n\t\t\t\t\t} ) } {${ cssObjectToText( themeProviderStyles ) }}` }\n\t\t\t\t</style>\n\t\t\t) : null }\n\t\t\t<div\n\t\t\t\tdata-wpds-theme-provider-id={ instanceId }\n\t\t\t\tdata-wpds-root-provider={ isRoot }\n\t\t\t\tdata-wpds-density={ density }\n\t\t\t\tclassName={ styles.root }\n\t\t\t>\n\t\t\t\t<ThemeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</ThemeContext.Provider>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n", "
|
|
5
|
-
"mappings": ";AAQA,SAAS,SAAS,aAAa;AAK/B,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;;;ACdvC,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useId } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { ThemeContext } from './context';\nimport { useThemeProviderStyles } from './use-theme-provider-styles';\nimport { type ThemeProviderProps } from './types';\nimport styles from './style.module.css';\n\nfunction cssObjectToText( values: CSSProperties ) {\n\treturn Object.entries( values )\n\t\t.map( ( [ key, value ] ) => `${ key }: ${ value };` )\n\t\t.join( '' );\n}\n\nfunction generateCSSSelector( {\n\tinstanceId,\n\tisRoot,\n}: {\n\tinstanceId: string;\n\tisRoot: boolean;\n} ) {\n\tconst rootSel = `[data-wpds-root-provider=\"true\"]`;\n\tconst instanceIdSel = `[data-wpds-theme-provider-id=\"${ instanceId }\"]`;\n\n\tconst selectors = [];\n\n\tif ( isRoot ) {\n\t\tselectors.push(\n\t\t\t`:root:has(.${ styles.root }${ rootSel }${ instanceIdSel })`\n\t\t);\n\t}\n\n\tselectors.push( `.${ styles.root }.${ styles.root }${ instanceIdSel }` );\n\n\treturn selectors.join( ',' );\n}\n\nexport const ThemeProvider = ( {\n\tchildren,\n\tcolor = {},\n\tisRoot = false,\n\tdensity,\n}: ThemeProviderProps ) => {\n\tconst instanceId = useId();\n\n\tconst { themeProviderStyles, resolvedSettings } = useThemeProviderStyles( {\n\t\tcolor,\n\t} );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tresolvedSettings,\n\t\t} ),\n\t\t[ resolvedSettings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ themeProviderStyles ? (\n\t\t\t\t<style>\n\t\t\t\t\t{ `${ generateCSSSelector( {\n\t\t\t\t\t\tinstanceId,\n\t\t\t\t\t\tisRoot,\n\t\t\t\t\t} ) } {${ cssObjectToText( themeProviderStyles ) }}` }\n\t\t\t\t</style>\n\t\t\t) : null }\n\t\t\t<div\n\t\t\t\tdata-wpds-theme-provider-id={ instanceId }\n\t\t\t\tdata-wpds-root-provider={ isRoot }\n\t\t\t\tdata-wpds-density={ density }\n\t\t\t\tclassName={ styles.root }\n\t\t\t>\n\t\t\t\t<ThemeContext.Provider value={ contextValue }>\n\t\t\t\t\t{ children }\n\t\t\t\t</ThemeContext.Provider>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n", "if (typeof document !== 'undefined' && !document.head.querySelector(\"style[data-wp-hash='662a5161a8']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"662a5161a8\");\n\tstyle.appendChild(document.createTextNode(\".dba930ea7a9438fd__root{display:contents}\"));\n\tdocument.head.appendChild(style);\n}\nexport default {\"root\":\"dba930ea7a9438fd__root\"};\n"],
|
|
5
|
+
"mappings": ";AAQA,SAAS,SAAS,aAAa;AAK/B,SAAS,oBAAoB;AAC7B,SAAS,8BAA8B;;;ACdvC,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AACxG,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,2CAA2C,CAAC;AACtF,WAAS,KAAK,YAAY,KAAK;AAChC;AACA,IAAO,gBAAQ,EAAC,QAAO,yBAAwB;;;AD6D7C,mBAEE,KAFF;AAjDF,SAAS,gBAAiB,QAAwB;AACjD,SAAO,OAAO,QAAS,MAAO,EAC5B,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO,GAAI,GAAI,KAAM,KAAM,GAAI,EACnD,KAAM,EAAG;AACZ;AAEA,SAAS,oBAAqB;AAAA,EAC7B;AAAA,EACA;AACD,GAGI;AACH,QAAM,UAAU;AAChB,QAAM,gBAAgB,iCAAkC,UAAW;AAEnE,QAAM,YAAY,CAAC;AAEnB,MAAK,QAAS;AACb,cAAU;AAAA,MACT,cAAe,cAAO,IAAK,GAAI,OAAQ,GAAI,aAAc;AAAA,IAC1D;AAAA,EACD;AAEA,YAAU,KAAM,IAAK,cAAO,IAAK,IAAK,cAAO,IAAK,GAAI,aAAc,EAAG;AAEvE,SAAO,UAAU,KAAM,GAAI;AAC5B;AAEO,IAAM,gBAAgB,CAAE;AAAA,EAC9B;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,SAAS;AAAA,EACT;AACD,MAA2B;AAC1B,QAAM,aAAa,MAAM;AAEzB,QAAM,EAAE,qBAAqB,iBAAiB,IAAI,uBAAwB;AAAA,IACzE;AAAA,EACD,CAAE;AAEF,QAAM,eAAe;AAAA,IACpB,OAAQ;AAAA,MACP;AAAA,IACD;AAAA,IACA,CAAE,gBAAiB;AAAA,EACpB;AAEA,SACC,iCACG;AAAA,0BACD,oBAAC,WACE,aAAI,oBAAqB;AAAA,MAC1B;AAAA,MACA;AAAA,IACD,CAAE,CAAE,KAAM,gBAAiB,mBAAoB,CAAE,KAClD,IACG;AAAA,IACJ;AAAA,MAAC;AAAA;AAAA,QACA,+BAA8B;AAAA,QAC9B,2BAA0B;AAAA,QAC1B,qBAAoB;AAAA,QACpB,WAAY,cAAO;AAAA,QAEnB,8BAAC,aAAa,UAAb,EAAsB,OAAQ,cAC5B,UACH;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/color-ramps/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/color-ramps/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAS5D,QAAA,MAAM,QAAQ,GAAK,OAAO;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,gCAEA,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,QAAQ,CAmBhC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,QAAQ,CA+H9C,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAE,OAAO,QAAQ,CA4FzD,CAAC"}
|
|
@@ -13,7 +13,7 @@ export type BorderRadiusSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
13
13
|
/**
|
|
14
14
|
* Size scale for border width tokens.
|
|
15
15
|
*/
|
|
16
|
-
export type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
16
|
+
export type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'focus';
|
|
17
17
|
/**
|
|
18
18
|
* Target elements that tokens can be applied to.
|
|
19
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-types.d.ts","sourceRoot":"","sources":["../../../src/prebuilt/ts/token-types.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"token-types.d.ts","sourceRoot":"","sources":["../../../src/prebuilt/ts/token-types.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,MAAM,GACf,SAAS,GACT,aAAa,GACb,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC/B,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,OAAO,GACP,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,OAAO,GACP,YAAY,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,0BAA0B,GACnC,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,YAAY,GACZ,OAAO,GACP,cAAc,GACd,YAAY,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC/B,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,OAAO,GACP,YAAY,CAAC;AAEhB;;GAEG;AACH,MAAM,MAAM,0BAA0B,GACnC,SAAS,GACT,gBAAgB,GAChB,cAAc,GACd,OAAO,GACP,cAAc,GACd,OAAO,GACP,cAAc,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC3B,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,OAAO,GACP,cAAc,GACd,SAAS,GACT,gBAAgB,GAChB,MAAM,GACN,aAAa,GACb,SAAS,GACT,gBAAgB,GAChB,OAAO,GACP,cAAc,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAC/B,SAAS,GACT,gBAAgB,GAChB,OAAO,GACP,OAAO,GACP,cAAc,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,eAAe,GACxB,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,GACT,cAAc,GACd,SAAS,GACT,cAAc,GACd,OAAO,GACP,YAAY,GACZ,gBAAgB,GAChB,kBAAkB,GAClB,gBAAgB,GAChB,uBAAuB,GACvB,yBAAyB,GACzB,uBAAuB,GACvB,OAAO,GACP,cAAc,GACd,cAAc,GACd,qBAAqB,GACrB,cAAc,GACd,cAAc,GACd,qBAAqB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../src/stories/index.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAa5D;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,mCAAmC,CAAC;AAE3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,aAAa,CAgBrC,CAAC;AACF,eAAe,IAAI,CAAC;AA2GpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAE,OAAO,aAAa,CAInD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAE,OAAO,aAAa,CA+CtD,CAAC;AA6CF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAE,OAAO,aAAa,CA8DhE,CAAC;AA0EF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAE,OAAO,aAAa,CA6CzD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Theme and context provider for the WordPress Design System.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -64,20 +64,22 @@
|
|
|
64
64
|
"build-module/color-ramps/lib/register-color-spaces.mjs"
|
|
65
65
|
],
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@wordpress/element": "^6.
|
|
68
|
-
"@wordpress/private-apis": "^1.
|
|
67
|
+
"@wordpress/element": "^6.39.0",
|
|
68
|
+
"@wordpress/private-apis": "^1.39.0",
|
|
69
69
|
"colorjs.io": "^0.6.0",
|
|
70
70
|
"memize": "^2.1.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
+
"@storybook/react-vite": "^10.1.11",
|
|
73
74
|
"@terrazzo/cli": "^0.10.2",
|
|
74
75
|
"@terrazzo/plugin-css": "^0.10.2",
|
|
75
76
|
"@terrazzo/token-tools": "^0.10.2",
|
|
76
77
|
"@testing-library/jest-dom": "^6.6.3",
|
|
77
78
|
"@types/jest": "^29.5.14",
|
|
78
79
|
"@types/node": "^20.17.10",
|
|
80
|
+
"esbuild": "^0.27.2",
|
|
79
81
|
"esbuild-esm-loader": "^0.3.3",
|
|
80
|
-
"storybook": "^
|
|
82
|
+
"storybook": "^10.1.11"
|
|
81
83
|
},
|
|
82
84
|
"peerDependencies": {
|
|
83
85
|
"react": "^18.0.0",
|
|
@@ -93,10 +95,11 @@
|
|
|
93
95
|
"access": "public"
|
|
94
96
|
},
|
|
95
97
|
"scripts": {
|
|
98
|
+
"prelint:js": "npx esbuild src/prebuilt/js/design-tokens.mjs --format=cjs --outfile=build/prebuilt/js/design-tokens.cjs && node -e \"\"",
|
|
96
99
|
"build:default-ramps": "node --import=esbuild-esm-loader/register bin/generate-default-ramps/index.ts",
|
|
97
100
|
"build:tokens": "node --import=esbuild-esm-loader/register bin/generate-primitive-tokens/index.ts && cross-env NODE_OPTIONS=--import=esbuild-esm-loader/register tz build --config terrazzo.config.ts",
|
|
98
|
-
"build": "npm run build:tokens && npm run build:default-ramps",
|
|
101
|
+
"build": "npm run build:tokens && npm run build:default-ramps && npm run prelint:js",
|
|
99
102
|
"postbuild": "prettier --write tokens/color.json tokens/modes src/prebuilt src/color-ramps/lib/default-ramps.ts docs"
|
|
100
103
|
},
|
|
101
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "eee1cfb1472f11183e40fb77465a5f13145df7ad"
|
|
102
105
|
}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* ------------------------------------------- */
|
|
4
4
|
|
|
5
5
|
:root {
|
|
6
|
-
--wpds-border-radius-
|
|
7
|
-
--wpds-border-radius-
|
|
8
|
-
--wpds-border-radius-
|
|
9
|
-
--wpds-border-radius-
|
|
10
|
-
--wpds-border-width-
|
|
11
|
-
--wpds-border-width-
|
|
12
|
-
--wpds-border-width-
|
|
13
|
-
--wpds-border-width-
|
|
14
|
-
--wpds-border-width-
|
|
6
|
+
--wpds-border-radius-lg: 8px; /* Large radius */
|
|
7
|
+
--wpds-border-radius-md: 4px; /* Medium radius */
|
|
8
|
+
--wpds-border-radius-sm: 2px; /* Small radius */
|
|
9
|
+
--wpds-border-radius-xs: 1px; /* Extra small radius */
|
|
10
|
+
--wpds-border-width-focus: 2px; /* Border width for focus ring */
|
|
11
|
+
--wpds-border-width-lg: 8px; /* Large width */
|
|
12
|
+
--wpds-border-width-md: 4px; /* Medium width */
|
|
13
|
+
--wpds-border-width-sm: 2px; /* Small width */
|
|
14
|
+
--wpds-border-width-xs: 1px; /* Extra small width */
|
|
15
15
|
--wpds-color-bg-interactive-brand-strong: #3858e9; /* Background color for interactive elements with brand tone and strong emphasis. */
|
|
16
16
|
--wpds-color-bg-interactive-brand-strong-active: #2e49d9; /* Background color for interactive elements with brand tone and strong emphasis that are hovered, focused, or active. */
|
|
17
17
|
--wpds-color-bg-interactive-brand-weak: #00000000; /* Background color for interactive elements with brand tone and weak emphasis. */
|
|
@@ -186,6 +186,6 @@
|
|
|
186
186
|
|
|
187
187
|
@media ( -webkit-min-device-pixel-ratio: 2 ), ( min-resolution: 192dpi ) {
|
|
188
188
|
:root {
|
|
189
|
-
--wpds-border-width-
|
|
189
|
+
--wpds-border-width-focus: 1.5px; /* Border width for focus ring */
|
|
190
190
|
}
|
|
191
191
|
}
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export default [
|
|
7
|
-
'--wpds-border-radius-
|
|
8
|
-
'--wpds-border-radius-
|
|
9
|
-
'--wpds-border-radius-
|
|
10
|
-
'--wpds-border-radius-
|
|
11
|
-
'--wpds-border-width-
|
|
12
|
-
'--wpds-border-width-
|
|
13
|
-
'--wpds-border-width-
|
|
14
|
-
'--wpds-border-width-
|
|
15
|
-
'--wpds-border-width-
|
|
7
|
+
'--wpds-border-radius-xs',
|
|
8
|
+
'--wpds-border-radius-sm',
|
|
9
|
+
'--wpds-border-radius-md',
|
|
10
|
+
'--wpds-border-radius-lg',
|
|
11
|
+
'--wpds-border-width-xs',
|
|
12
|
+
'--wpds-border-width-sm',
|
|
13
|
+
'--wpds-border-width-md',
|
|
14
|
+
'--wpds-border-width-lg',
|
|
15
|
+
'--wpds-border-width-focus',
|
|
16
16
|
'--wpds-color-bg-surface-neutral',
|
|
17
17
|
'--wpds-color-bg-surface-neutral-strong',
|
|
18
18
|
'--wpds-color-bg-surface-neutral-weak',
|
|
@@ -21,7 +21,7 @@ export type BorderRadiusSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
|
21
21
|
/**
|
|
22
22
|
* Size scale for border width tokens.
|
|
23
23
|
*/
|
|
24
|
-
export type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
24
|
+
export type BorderWidthSize = 'xs' | 'sm' | 'md' | 'lg' | 'focus';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Target elements that tokens can be applied to.
|
package/src/style.scss
ADDED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.example {
|
|
3
3
|
background-color: var(--wpds-color-bg-surface-neutral);
|
|
4
4
|
color: var(--wpds-color-fg-content-neutral);
|
|
5
|
-
border-radius: var(--wpds-border-radius-
|
|
5
|
+
border-radius: var(--wpds-border-radius-sm);
|
|
6
6
|
padding: var(--wpds-dimension-padding-surface-md);
|
|
7
7
|
}
|
|
8
8
|
|