@c2n/theme 0.0.6
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/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/base.css +567 -0
- package/dist/report.json +3310 -0
- package/dist/theme.css +662 -0
- package/dist/tokens.css +94 -0
- package/dist/tokens.d.ts +27 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +62 -0
- package/dist/tokens.js.map +1 -0
- package/dist/tokens.json +597 -0
- package/package.json +106 -0
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* GENERATED by @c2n/theme scripts/theme-generator. Do not edit by hand. */
|
|
2
|
+
/*
|
|
3
|
+
* Design tokens of @c2n/theme. Light values on the root, dark values under [data-theme='dark'] / .c2-dark and
|
|
4
|
+
* as the OS preference fallback. Override any token on :root (or on a subtree) to theme every component.
|
|
5
|
+
*/
|
|
6
|
+
:root,
|
|
7
|
+
:host,
|
|
8
|
+
[data-theme='light'],
|
|
9
|
+
.c2-light {
|
|
10
|
+
color-scheme: light;
|
|
11
|
+
--c2-theme--color-primary: #0265dc;
|
|
12
|
+
--c2-theme--color-primary-hover: #0154b8;
|
|
13
|
+
--c2-theme--color-primary-active: #01469a;
|
|
14
|
+
--c2-theme--color-on-primary: #ffffff;
|
|
15
|
+
--c2-theme--color-primary-container: #edf1fe;
|
|
16
|
+
--c2-theme--color-surface: #ffffff;
|
|
17
|
+
--c2-theme--color-surface-container-low: #fafafa;
|
|
18
|
+
--c2-theme--color-surface-container: #f4f4f5;
|
|
19
|
+
--c2-theme--color-on-surface: #18181b;
|
|
20
|
+
--c2-theme--color-on-surface-variant: #71717a;
|
|
21
|
+
--c2-theme--color-outline: #d4d4d8;
|
|
22
|
+
--c2-theme--color-outline-variant: #e4e4e7;
|
|
23
|
+
--c2-theme--color-outline-strong: #a1a1aa;
|
|
24
|
+
--c2-theme--color-error: #dc2626;
|
|
25
|
+
--c2-theme--color-scrim: rgba(9, 9, 11, 0.45);
|
|
26
|
+
--c2-theme--color-inverse-surface: #18181b;
|
|
27
|
+
--c2-theme--color-on-inverse-surface: #fafafa;
|
|
28
|
+
--c2-theme--font-size-sm: 12px;
|
|
29
|
+
--c2-theme--font-size-md: 14px;
|
|
30
|
+
--c2-theme--font-weight-medium: 500;
|
|
31
|
+
--c2-theme--font-weight-semibold: 600;
|
|
32
|
+
--c2-theme--radius-sm: 4px;
|
|
33
|
+
--c2-theme--radius-md: 6px;
|
|
34
|
+
--c2-theme--radius-lg: 8px;
|
|
35
|
+
--c2-theme--radius-xl: 14px;
|
|
36
|
+
--c2-theme--radius-full: 999px;
|
|
37
|
+
--c2-theme--border-width: 1px;
|
|
38
|
+
--c2-theme--focus-ring: 2px solid rgba(2, 101, 220, 0.4);
|
|
39
|
+
--c2-theme--disabled-opacity: 0.38;
|
|
40
|
+
--c2-theme--motion-scale: 1;
|
|
41
|
+
--c2-theme--shadow-md: 0 8px 24px rgba(24, 24, 27, 0.08);
|
|
42
|
+
--c2-theme--shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.25);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
[data-theme='dark'],
|
|
46
|
+
.c2-dark {
|
|
47
|
+
color-scheme: dark;
|
|
48
|
+
--c2-theme--color-primary: #5aa3ff;
|
|
49
|
+
--c2-theme--color-primary-hover: #7bb6ff;
|
|
50
|
+
--c2-theme--color-primary-active: #9cc9ff;
|
|
51
|
+
--c2-theme--color-on-primary: #032a5c;
|
|
52
|
+
--c2-theme--color-primary-container: #0f2d5c;
|
|
53
|
+
--c2-theme--color-surface: #18181b;
|
|
54
|
+
--c2-theme--color-surface-container-low: #1f1f23;
|
|
55
|
+
--c2-theme--color-surface-container: #27272a;
|
|
56
|
+
--c2-theme--color-on-surface: #f4f4f5;
|
|
57
|
+
--c2-theme--color-on-surface-variant: #a1a1aa;
|
|
58
|
+
--c2-theme--color-outline: #3f3f46;
|
|
59
|
+
--c2-theme--color-outline-variant: #27272a;
|
|
60
|
+
--c2-theme--color-outline-strong: #52525b;
|
|
61
|
+
--c2-theme--color-error: #f87171;
|
|
62
|
+
--c2-theme--color-scrim: rgba(0, 0, 0, 0.6);
|
|
63
|
+
--c2-theme--color-inverse-surface: #f4f4f5;
|
|
64
|
+
--c2-theme--color-on-inverse-surface: #18181b;
|
|
65
|
+
--c2-theme--focus-ring: 2px solid rgba(90, 163, 255, 0.5);
|
|
66
|
+
--c2-theme--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
|
|
67
|
+
--c2-theme--shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (prefers-color-scheme: dark) {
|
|
71
|
+
:root:not([data-theme='light']):not(.c2-light) {
|
|
72
|
+
color-scheme: dark;
|
|
73
|
+
--c2-theme--color-primary: #5aa3ff;
|
|
74
|
+
--c2-theme--color-primary-hover: #7bb6ff;
|
|
75
|
+
--c2-theme--color-primary-active: #9cc9ff;
|
|
76
|
+
--c2-theme--color-on-primary: #032a5c;
|
|
77
|
+
--c2-theme--color-primary-container: #0f2d5c;
|
|
78
|
+
--c2-theme--color-surface: #18181b;
|
|
79
|
+
--c2-theme--color-surface-container-low: #1f1f23;
|
|
80
|
+
--c2-theme--color-surface-container: #27272a;
|
|
81
|
+
--c2-theme--color-on-surface: #f4f4f5;
|
|
82
|
+
--c2-theme--color-on-surface-variant: #a1a1aa;
|
|
83
|
+
--c2-theme--color-outline: #3f3f46;
|
|
84
|
+
--c2-theme--color-outline-variant: #27272a;
|
|
85
|
+
--c2-theme--color-outline-strong: #52525b;
|
|
86
|
+
--c2-theme--color-error: #f87171;
|
|
87
|
+
--c2-theme--color-scrim: rgba(0, 0, 0, 0.6);
|
|
88
|
+
--c2-theme--color-inverse-surface: #f4f4f5;
|
|
89
|
+
--c2-theme--color-on-inverse-surface: #18181b;
|
|
90
|
+
--c2-theme--focus-ring: 2px solid rgba(90, 163, 255, 0.5);
|
|
91
|
+
--c2-theme--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
|
|
92
|
+
--c2-theme--shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
|
|
93
|
+
}
|
|
94
|
+
}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@c2n/theme` design tokens.
|
|
3
|
+
*
|
|
4
|
+
* Tokens follow the component variable grammar with the pseudo-component prefix `c2-theme` and no part
|
|
5
|
+
* segment: `--c2-theme--<name>`. The generated `base.css` maps every `@c2n/*` component variable onto one
|
|
6
|
+
* of them, keeping the component's own default as the innermost fallback, e.g.
|
|
7
|
+
* `--c2-list--border-top: var(--c2-theme--border, var(--c2-theme--border-width, 1px) solid var(--c2-theme--color-outline, #e4e4e7))`.
|
|
8
|
+
*
|
|
9
|
+
* Keep this file to erasable TypeScript syntax: the theme generator imports it directly under Node.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TOKEN_PREFIX = "--c2-theme--";
|
|
12
|
+
export type TokenCategory = 'color' | 'font' | 'radius' | 'border' | 'focus' | 'disabled' | 'motion' | 'shadow';
|
|
13
|
+
export interface TokenDef {
|
|
14
|
+
/** Full custom property name, e.g. `--c2-theme--color-primary`. */
|
|
15
|
+
name: string;
|
|
16
|
+
category: TokenCategory;
|
|
17
|
+
/** Light value. `null` means "not set by default" (the component fallback applies). */
|
|
18
|
+
light: string | null;
|
|
19
|
+
/** Dark value; omitted when the token is theme-invariant. */
|
|
20
|
+
dark?: string;
|
|
21
|
+
description: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const tokens: TokenDef[];
|
|
24
|
+
export declare const tokenNames: string[];
|
|
25
|
+
/** Look up a token by its full name. */
|
|
26
|
+
export declare function getToken(name: string): TokenDef | undefined;
|
|
27
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,eAAO,MAAM,YAAY,iBAAiB,CAAA;AAE1C,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE/G,MAAM,WAAW,QAAQ;IACvB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,aAAa,CAAA;IACvB,uFAAuF;IACvF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB;AAMD,eAAO,MAAM,MAAM,EAAE,QAAQ,EAyC5B,CAAA;AAED,eAAO,MAAM,UAAU,UAA4B,CAAA;AAEnD,wCAAwC;AACxC,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE3D"}
|
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@c2n/theme` design tokens.
|
|
3
|
+
*
|
|
4
|
+
* Tokens follow the component variable grammar with the pseudo-component prefix `c2-theme` and no part
|
|
5
|
+
* segment: `--c2-theme--<name>`. The generated `base.css` maps every `@c2n/*` component variable onto one
|
|
6
|
+
* of them, keeping the component's own default as the innermost fallback, e.g.
|
|
7
|
+
* `--c2-list--border-top: var(--c2-theme--border, var(--c2-theme--border-width, 1px) solid var(--c2-theme--color-outline, #e4e4e7))`.
|
|
8
|
+
*
|
|
9
|
+
* Keep this file to erasable TypeScript syntax: the theme generator imports it directly under Node.
|
|
10
|
+
*/
|
|
11
|
+
export const TOKEN_PREFIX = '--c2-theme--';
|
|
12
|
+
function token(name, category, light, description, dark) {
|
|
13
|
+
return { name: `${TOKEN_PREFIX}${name}`, category, light, dark, description };
|
|
14
|
+
}
|
|
15
|
+
export const tokens = [
|
|
16
|
+
// Colour roles
|
|
17
|
+
token('color-primary', 'color', '#0265dc', 'Accent colour: filled buttons, selected states, focused borders, links.', '#5aa3ff'),
|
|
18
|
+
token('color-primary-hover', 'color', '#0154b8', 'Accent colour on hover.', '#7bb6ff'),
|
|
19
|
+
token('color-primary-active', 'color', '#01469a', 'Accent colour while pressed.', '#9cc9ff'),
|
|
20
|
+
token('color-on-primary', 'color', '#ffffff', 'Text and icons drawn on the accent colour.', '#032a5c'),
|
|
21
|
+
token('color-primary-container', 'color', '#edf1fe', 'Soft accent surface, e.g. a selected list item.', '#0f2d5c'),
|
|
22
|
+
token('color-surface', 'color', '#ffffff', 'Default surface of inputs, lists, cards, dialogs.', '#18181b'),
|
|
23
|
+
token('color-surface-container-low', 'color', '#fafafa', 'Slightly raised surface: side navigation, read-only fields, subtle hover.', '#1f1f23'),
|
|
24
|
+
token('color-surface-container', 'color', '#f4f4f5', 'Hover surface for rows and icon buttons.', '#27272a'),
|
|
25
|
+
token('color-on-surface', 'color', '#18181b', 'Primary text colour.', '#f4f4f5'),
|
|
26
|
+
token('color-on-surface-variant', 'color', '#71717a', 'Secondary text, placeholders, icons, supporting text.', '#a1a1aa'),
|
|
27
|
+
token('color-outline', 'color', '#d4d4d8', 'Resting border colour of inputs, cards and lists.', '#3f3f46'),
|
|
28
|
+
token('color-outline-variant', 'color', '#e4e4e7', 'Hairline dividers and light borders.', '#27272a'),
|
|
29
|
+
token('color-outline-strong', 'color', '#a1a1aa', 'Border colour on hover.', '#52525b'),
|
|
30
|
+
token('color-error', 'color', '#dc2626', 'Error borders, error text, required indicators.', '#f87171'),
|
|
31
|
+
token('color-scrim', 'color', 'rgba(9, 9, 11, 0.45)', 'Backdrop behind dialogs and drawers.', 'rgba(0, 0, 0, 0.6)'),
|
|
32
|
+
token('color-inverse-surface', 'color', '#18181b', 'High-contrast surface, e.g. tooltips.', '#f4f4f5'),
|
|
33
|
+
token('color-on-inverse-surface', 'color', '#fafafa', 'Text drawn on the inverse surface.', '#18181b'),
|
|
34
|
+
// Typography
|
|
35
|
+
token('font-family', 'font', null, 'Font family of every component. Unset by default so components inherit the page font.'),
|
|
36
|
+
token('font-size-sm', 'font', '12px', 'Small text: supporting text, tooltips, descriptions, timestamps.'),
|
|
37
|
+
token('font-size-md', 'font', '14px', 'Body text: buttons, inputs, list items, dialog content.'),
|
|
38
|
+
token('font-weight-medium', 'font', '500', 'Medium weight: buttons, headers, tooltips.'),
|
|
39
|
+
token('font-weight-semibold', 'font', '600', 'Semibold weight: dialog titles, list headings, avatars.'),
|
|
40
|
+
// Shape
|
|
41
|
+
token('radius-sm', 'radius', '4px', 'Small radius: checkboxes, link buttons, inline controls.'),
|
|
42
|
+
token('radius-md', 'radius', '6px', 'Default radius: buttons, inputs, list items, tooltips.'),
|
|
43
|
+
token('radius-lg', 'radius', '8px', 'Large radius: cards, panels, popovers.'),
|
|
44
|
+
token('radius-xl', 'radius', '14px', 'Extra large radius: dialogs.'),
|
|
45
|
+
token('radius-full', 'radius', '999px', 'Pill / circle radius: avatars, icon buttons.'),
|
|
46
|
+
// Borders
|
|
47
|
+
token('border-width', 'border', '1px', 'Width of every themed border.'),
|
|
48
|
+
token('border', 'border', null, 'Complete resting border shorthand. Unset by default: it falls back to `border-width solid color-outline`.'),
|
|
49
|
+
// Interaction
|
|
50
|
+
token('focus-ring', 'focus', '2px solid rgba(2, 101, 220, 0.4)', 'Focus-visible outline of every component.', '2px solid rgba(90, 163, 255, 0.5)'),
|
|
51
|
+
token('disabled-opacity', 'disabled', '0.38', 'Opacity of disabled components.'),
|
|
52
|
+
token('motion-scale', 'motion', '1', 'Multiplier applied to every transition and animation duration (0 disables motion).'),
|
|
53
|
+
// Elevation
|
|
54
|
+
token('shadow-md', 'shadow', '0 8px 24px rgba(24, 24, 27, 0.08)', 'Shadow of popovers, menus and tooltips.', '0 8px 24px rgba(0, 0, 0, 0.45)'),
|
|
55
|
+
token('shadow-lg', 'shadow', '0 24px 60px rgba(0, 0, 0, 0.25)', 'Shadow of dialogs and drawers.', '0 24px 60px rgba(0, 0, 0, 0.6)'),
|
|
56
|
+
];
|
|
57
|
+
export const tokenNames = tokens.map((t) => t.name);
|
|
58
|
+
/** Look up a token by its full name. */
|
|
59
|
+
export function getToken(name) {
|
|
60
|
+
return tokens.find((t) => t.name === name);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAA;AAe1C,SAAS,KAAK,CAAC,IAAY,EAAE,QAAuB,EAAE,KAAoB,EAAE,WAAmB,EAAE,IAAa;IAC5G,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,GAAG,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA;AAC/E,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAe;IAChC,eAAe;IACf,KAAK,CAAC,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,yEAAyE,EAAE,SAAS,CAAC;IAChI,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,SAAS,CAAC;IACtF,KAAK,CAAC,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAE,8BAA8B,EAAE,SAAS,CAAC;IAC5F,KAAK,CAAC,kBAAkB,EAAE,OAAO,EAAE,SAAS,EAAE,4CAA4C,EAAE,SAAS,CAAC;IACtG,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,SAAS,EAAE,iDAAiD,EAAE,SAAS,CAAC;IAClH,KAAK,CAAC,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,mDAAmD,EAAE,SAAS,CAAC;IAC1G,K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C,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;AAC5C,CAAC","sourcesContent":["/**\n * The `@c2n/theme` design tokens.\n *\n * Tokens follow the component variable grammar with the pseudo-component prefix `c2-theme` and no part\n * segment: `--c2-theme--<name>`. The generated `base.css` maps every `@c2n/*` component variable onto one\n * of them, keeping the component's own default as the innermost fallback, e.g.\n * `--c2-list--border-top: var(--c2-theme--border, var(--c2-theme--border-width, 1px) solid var(--c2-theme--color-outline, #e4e4e7))`.\n *\n * Keep this file to erasable TypeScript syntax: the theme generator imports it directly under Node.\n */\n\nexport const TOKEN_PREFIX = '--c2-theme--'\n\nexport type TokenCategory = 'color' | 'font' | 'radius' | 'border' | 'focus' | 'disabled' | 'motion' | 'shadow'\n\nexport interface TokenDef {\n /** Full custom property name, e.g. `--c2-theme--color-primary`. */\n name: string\n category: TokenCategory\n /** Light value. `null` means \"not set by default\" (the component fallback applies). */\n light: string | null\n /** Dark value; omitted when the token is theme-invariant. */\n dark?: string\n description: string\n}\n\nfunction token(name: string, category: TokenCategory, light: string | null, description: string, dark?: string): TokenDef {\n return { name: `${TOKEN_PREFIX}${name}`, category, light, dark, description }\n}\n\nexport const tokens: TokenDef[] = [\n // Colour roles\n token('color-primary', 'color', '#0265dc', 'Accent colour: filled buttons, selected states, focused borders, links.', '#5aa3ff'),\n token('color-primary-hover', 'color', '#0154b8', 'Accent colour on hover.', '#7bb6ff'),\n token('color-primary-active', 'color', '#01469a', 'Accent colour while pressed.', '#9cc9ff'),\n token('color-on-primary', 'color', '#ffffff', 'Text and icons drawn on the accent colour.', '#032a5c'),\n token('color-primary-container', 'color', '#edf1fe', 'Soft accent surface, e.g. a selected list item.', '#0f2d5c'),\n token('color-surface', 'color', '#ffffff', 'Default surface of inputs, lists, cards, dialogs.', '#18181b'),\n token('color-surface-container-low', 'color', '#fafafa', 'Slightly raised surface: side navigation, read-only fields, subtle hover.', '#1f1f23'),\n token('color-surface-container', 'color', '#f4f4f5', 'Hover surface for rows and icon buttons.', '#27272a'),\n token('color-on-surface', 'color', '#18181b', 'Primary text colour.', '#f4f4f5'),\n token('color-on-surface-variant', 'color', '#71717a', 'Secondary text, placeholders, icons, supporting text.', '#a1a1aa'),\n token('color-outline', 'color', '#d4d4d8', 'Resting border colour of inputs, cards and lists.', '#3f3f46'),\n token('color-outline-variant', 'color', '#e4e4e7', 'Hairline dividers and light borders.', '#27272a'),\n token('color-outline-strong', 'color', '#a1a1aa', 'Border colour on hover.', '#52525b'),\n token('color-error', 'color', '#dc2626', 'Error borders, error text, required indicators.', '#f87171'),\n token('color-scrim', 'color', 'rgba(9, 9, 11, 0.45)', 'Backdrop behind dialogs and drawers.', 'rgba(0, 0, 0, 0.6)'),\n token('color-inverse-surface', 'color', '#18181b', 'High-contrast surface, e.g. tooltips.', '#f4f4f5'),\n token('color-on-inverse-surface', 'color', '#fafafa', 'Text drawn on the inverse surface.', '#18181b'),\n // Typography\n token('font-family', 'font', null, 'Font family of every component. Unset by default so components inherit the page font.'),\n token('font-size-sm', 'font', '12px', 'Small text: supporting text, tooltips, descriptions, timestamps.'),\n token('font-size-md', 'font', '14px', 'Body text: buttons, inputs, list items, dialog content.'),\n token('font-weight-medium', 'font', '500', 'Medium weight: buttons, headers, tooltips.'),\n token('font-weight-semibold', 'font', '600', 'Semibold weight: dialog titles, list headings, avatars.'),\n // Shape\n token('radius-sm', 'radius', '4px', 'Small radius: checkboxes, link buttons, inline controls.'),\n token('radius-md', 'radius', '6px', 'Default radius: buttons, inputs, list items, tooltips.'),\n token('radius-lg', 'radius', '8px', 'Large radius: cards, panels, popovers.'),\n token('radius-xl', 'radius', '14px', 'Extra large radius: dialogs.'),\n token('radius-full', 'radius', '999px', 'Pill / circle radius: avatars, icon buttons.'),\n // Borders\n token('border-width', 'border', '1px', 'Width of every themed border.'),\n token('border', 'border', null, 'Complete resting border shorthand. Unset by default: it falls back to `border-width solid color-outline`.'),\n // Interaction\n token('focus-ring', 'focus', '2px solid rgba(2, 101, 220, 0.4)', 'Focus-visible outline of every component.', '2px solid rgba(90, 163, 255, 0.5)'),\n token('disabled-opacity', 'disabled', '0.38', 'Opacity of disabled components.'),\n token('motion-scale', 'motion', '1', 'Multiplier applied to every transition and animation duration (0 disables motion).'),\n // Elevation\n token('shadow-md', 'shadow', '0 8px 24px rgba(24, 24, 27, 0.08)', 'Shadow of popovers, menus and tooltips.', '0 8px 24px rgba(0, 0, 0, 0.45)'),\n token('shadow-lg', 'shadow', '0 24px 60px rgba(0, 0, 0, 0.25)', 'Shadow of dialogs and drawers.', '0 24px 60px rgba(0, 0, 0, 0.6)'),\n]\n\nexport const tokenNames = tokens.map((t) => t.name)\n\n/** Look up a token by its full name. */\nexport function getToken(name: string): TokenDef | undefined {\n return tokens.find((t) => t.name === name)\n}\n"]}
|