@misoto22/design 0.3.1
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/dist/components/Accordion/Accordion.d.ts +34 -0
- package/dist/components/Accordion/Accordion.js +37 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Alert/Alert.d.ts +32 -0
- package/dist/components/Alert/Alert.js +49 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/AppShell/AppShell.d.ts +38 -0
- package/dist/components/AppShell/AppShell.js +92 -0
- package/dist/components/AppShell/AppShell.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +29 -0
- package/dist/components/Avatar/Avatar.js +39 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +30 -0
- package/dist/components/Badge/Badge.js +29 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +31 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +31 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Button/Button.d.ts +70 -0
- package/dist/components/Button/Button.js +81 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Calendar/Calendar.d.ts +28 -0
- package/dist/components/Calendar/Calendar.js +87 -0
- package/dist/components/Calendar/Calendar.js.map +1 -0
- package/dist/components/Card/Card.d.ts +49 -0
- package/dist/components/Card/Card.js +64 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Checkbox/Checkbox.js +24 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Collapsible/Collapsible.d.ts +31 -0
- package/dist/components/Collapsible/Collapsible.js +35 -0
- package/dist/components/Collapsible/Collapsible.js.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +63 -0
- package/dist/components/Combobox/Combobox.js +151 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Command/Command.d.ts +98 -0
- package/dist/components/Command/Command.js +166 -0
- package/dist/components/Command/Command.js.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +38 -0
- package/dist/components/ContextMenu/ContextMenu.js +79 -0
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +98 -0
- package/dist/components/DatePicker/DatePicker.js +214 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +48 -0
- package/dist/components/Dialog/Dialog.js +72 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +49 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +89 -0
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.d.ts +31 -0
- package/dist/components/EmptyState/EmptyState.js +30 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/ErrorState/ErrorState.d.ts +34 -0
- package/dist/components/ErrorState/ErrorState.js +32 -0
- package/dist/components/ErrorState/ErrorState.js.map +1 -0
- package/dist/components/Field/Field.d.ts +44 -0
- package/dist/components/Field/Field.js +54 -0
- package/dist/components/Field/Field.js.map +1 -0
- package/dist/components/FigureBand/FigureBand.d.ts +51 -0
- package/dist/components/FigureBand/FigureBand.js +52 -0
- package/dist/components/FigureBand/FigureBand.js.map +1 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.d.ts +29 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.js +32 -0
- package/dist/components/FloatingIconButton/FloatingIconButton.js.map +1 -0
- package/dist/components/Input/Input.d.ts +22 -0
- package/dist/components/Input/Input.js +21 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Kbd/Kbd.d.ts +20 -0
- package/dist/components/Kbd/Kbd.js +21 -0
- package/dist/components/Kbd/Kbd.js.map +1 -0
- package/dist/components/LinkArrow/LinkArrow.d.ts +24 -0
- package/dist/components/LinkArrow/LinkArrow.js +24 -0
- package/dist/components/LinkArrow/LinkArrow.js.map +1 -0
- package/dist/components/NativeSelect/NativeSelect.d.ts +27 -0
- package/dist/components/NativeSelect/NativeSelect.js +46 -0
- package/dist/components/NativeSelect/NativeSelect.js.map +1 -0
- package/dist/components/NavItem/NavItem.d.ts +39 -0
- package/dist/components/NavItem/NavItem.js +31 -0
- package/dist/components/NavItem/NavItem.js.map +1 -0
- package/dist/components/Pagination/Pagination.d.ts +44 -0
- package/dist/components/Pagination/Pagination.js +109 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +39 -0
- package/dist/components/Popover/Popover.js +57 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Progress/Progress.d.ts +31 -0
- package/dist/components/Progress/Progress.js +45 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +43 -0
- package/dist/components/RadioGroup/RadioGroup.js +43 -0
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +31 -0
- package/dist/components/ScrollArea/ScrollArea.js +54 -0
- package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/SearchableMenu/SearchableMenu.d.ts +59 -0
- package/dist/components/SearchableMenu/SearchableMenu.js +79 -0
- package/dist/components/SearchableMenu/SearchableMenu.js.map +1 -0
- package/dist/components/Select/Select.d.ts +71 -0
- package/dist/components/Select/Select.js +114 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Separator/Separator.d.ts +30 -0
- package/dist/components/Separator/Separator.js +35 -0
- package/dist/components/Separator/Separator.js.map +1 -0
- package/dist/components/Sheet/Sheet.d.ts +38 -0
- package/dist/components/Sheet/Sheet.js +68 -0
- package/dist/components/Sheet/Sheet.js.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +63 -0
- package/dist/components/Skeleton/Skeleton.js +44 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +35 -0
- package/dist/components/Slider/Slider.js +52 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +50 -0
- package/dist/components/Spinner/Spinner.js +48 -0
- package/dist/components/Spinner/Spinner.js.map +1 -0
- package/dist/components/StatusDot/StatusDot.d.ts +29 -0
- package/dist/components/StatusDot/StatusDot.js +44 -0
- package/dist/components/StatusDot/StatusDot.js.map +1 -0
- package/dist/components/StatusPill/StatusPill.d.ts +25 -0
- package/dist/components/StatusPill/StatusPill.js +31 -0
- package/dist/components/StatusPill/StatusPill.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +23 -0
- package/dist/components/Switch/Switch.js +23 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Table/Table.d.ts +96 -0
- package/dist/components/Table/Table.js +136 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +35 -0
- package/dist/components/Tabs/Tabs.js +48 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tag/Tag.d.ts +28 -0
- package/dist/components/Tag/Tag.js +22 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +20 -0
- package/dist/components/Textarea/Textarea.js +32 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Toast/Toast.d.ts +24 -0
- package/dist/components/Toast/Toast.js +41 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +41 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +78 -0
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +43 -0
- package/dist/components/Tooltip/Tooltip.js +40 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/fonts/hanken-grotesk-300.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-400.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-500.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-600.woff2 +0 -0
- package/dist/fonts/hanken-grotesk-700.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-500.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-600.woff2 +0 -0
- package/dist/fonts/newsreader-300.woff2 +0 -0
- package/dist/fonts/newsreader-400.woff2 +0 -0
- package/dist/fonts/newsreader-500.woff2 +0 -0
- package/dist/fonts/newsreader-600.woff2 +0 -0
- package/dist/fonts.css +96 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/keyframes.css +212 -0
- package/dist/lib/cn.d.ts +21 -0
- package/dist/lib/cn.js +9 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/lib/control.d.ts +31 -0
- package/dist/lib/control.js +14 -0
- package/dist/lib/control.js.map +1 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/overlay-container.d.ts +38 -0
- package/dist/lib/overlay-container.js +15 -0
- package/dist/lib/overlay-container.js.map +1 -0
- package/dist/lib/useSelectionIndicator.d.ts +29 -0
- package/dist/lib/useSelectionIndicator.js +45 -0
- package/dist/lib/useSelectionIndicator.js.map +1 -0
- package/dist/semantic.css +127 -0
- package/dist/styles.css +98 -0
- package/dist/themes.css +115 -0
- package/dist/tokens/brand.d.ts +47 -0
- package/dist/tokens/brand.js +38 -0
- package/dist/tokens/brand.js.map +1 -0
- package/dist/tokens.css +323 -0
- package/dist/tokens.d.ts +153 -0
- package/dist/tokens.js +766 -0
- package/dist/tokens.json +765 -0
- package/package.json +130 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand colour mirrors for surfaces that cannot read CSS custom properties —
|
|
3
|
+
* OpenGraph/Satori cards, build-time scripts, `theme-color` in a web manifest,
|
|
4
|
+
* a canvas.
|
|
5
|
+
*
|
|
6
|
+
* The RUNTIME theme lives in `styles/tokens.css` (`:root` + `[data-mode="dark"]`)
|
|
7
|
+
* and that is the single place to recolour the system. These literals mirror
|
|
8
|
+
* specific tokens; `brand.test.ts` parses the CSS and fails if the two drift,
|
|
9
|
+
* so this file cannot quietly fall behind the thing it mirrors.
|
|
10
|
+
*/
|
|
11
|
+
declare const BRAND: {
|
|
12
|
+
/** = light --paper. The page ground. */
|
|
13
|
+
readonly paper: "#ffffff";
|
|
14
|
+
/** = dark --paper. The dark viewport's `theme-color`. */
|
|
15
|
+
readonly paperDark: "#0d0d0d";
|
|
16
|
+
/** = light --paper-2. One step off the ground. */
|
|
17
|
+
readonly paperElevated: "#f7f7f5";
|
|
18
|
+
/** = light --ink. The mark. */
|
|
19
|
+
readonly ink: "#101010";
|
|
20
|
+
/** = dark --ink. */
|
|
21
|
+
readonly inkDark: "#f4f4f2";
|
|
22
|
+
/** = light --ink-2. Body copy that is not the mark. */
|
|
23
|
+
readonly body: "#4a4a4a";
|
|
24
|
+
/** = light --ink-3-aa. The lightest text step that still clears AA on paper. */
|
|
25
|
+
readonly muted: "#5c5c5c";
|
|
26
|
+
/** = light --stone. The fill under a skeleton, a bar, a quiet plate. */
|
|
27
|
+
readonly stone: "#f2f1ee";
|
|
28
|
+
/** = light --rule. Hairline. */
|
|
29
|
+
readonly rule: "#edebe6";
|
|
30
|
+
/** = light --rule-2. Edge. */
|
|
31
|
+
readonly ruleStrong: "#dbdbd6";
|
|
32
|
+
/** = --feature-surface. The one reversed plate. */
|
|
33
|
+
readonly feature: "#262626";
|
|
34
|
+
/** = --on-dark. Type over a photograph — a dark ground in BOTH themes. */
|
|
35
|
+
readonly onDark: "#fbfbfa";
|
|
36
|
+
/** Byline weight over a photograph. */
|
|
37
|
+
readonly onDarkMuted: "rgba(251,251,250,0.82)";
|
|
38
|
+
/** = --photo-scrim, as an "r, g, b" tuple for a gradient. */
|
|
39
|
+
readonly scrimRgb: "16, 16, 16";
|
|
40
|
+
/** = light --ok / --warn / --danger. The only chroma in the system. */
|
|
41
|
+
readonly success: "#3d6b34";
|
|
42
|
+
readonly warning: "#8a5a00";
|
|
43
|
+
readonly danger: "#a83214";
|
|
44
|
+
};
|
|
45
|
+
type BrandColor = keyof typeof BRAND;
|
|
46
|
+
|
|
47
|
+
export { BRAND, type BrandColor };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const BRAND = {
|
|
2
|
+
/** = light --paper. The page ground. */
|
|
3
|
+
paper: "#ffffff",
|
|
4
|
+
/** = dark --paper. The dark viewport's `theme-color`. */
|
|
5
|
+
paperDark: "#0d0d0d",
|
|
6
|
+
/** = light --paper-2. One step off the ground. */
|
|
7
|
+
paperElevated: "#f7f7f5",
|
|
8
|
+
/** = light --ink. The mark. */
|
|
9
|
+
ink: "#101010",
|
|
10
|
+
/** = dark --ink. */
|
|
11
|
+
inkDark: "#f4f4f2",
|
|
12
|
+
/** = light --ink-2. Body copy that is not the mark. */
|
|
13
|
+
body: "#4a4a4a",
|
|
14
|
+
/** = light --ink-3-aa. The lightest text step that still clears AA on paper. */
|
|
15
|
+
muted: "#5c5c5c",
|
|
16
|
+
/** = light --stone. The fill under a skeleton, a bar, a quiet plate. */
|
|
17
|
+
stone: "#f2f1ee",
|
|
18
|
+
/** = light --rule. Hairline. */
|
|
19
|
+
rule: "#edebe6",
|
|
20
|
+
/** = light --rule-2. Edge. */
|
|
21
|
+
ruleStrong: "#dbdbd6",
|
|
22
|
+
/** = --feature-surface. The one reversed plate. */
|
|
23
|
+
feature: "#262626",
|
|
24
|
+
/** = --on-dark. Type over a photograph — a dark ground in BOTH themes. */
|
|
25
|
+
onDark: "#fbfbfa",
|
|
26
|
+
/** Byline weight over a photograph. */
|
|
27
|
+
onDarkMuted: "rgba(251,251,250,0.82)",
|
|
28
|
+
/** = --photo-scrim, as an "r, g, b" tuple for a gradient. */
|
|
29
|
+
scrimRgb: "16, 16, 16",
|
|
30
|
+
/** = light --ok / --warn / --danger. The only chroma in the system. */
|
|
31
|
+
success: "#3d6b34",
|
|
32
|
+
warning: "#8a5a00",
|
|
33
|
+
danger: "#a83214"
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
BRAND
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=brand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/tokens/brand.ts"],"sourcesContent":["/**\n * Brand colour mirrors for surfaces that cannot read CSS custom properties —\n * OpenGraph/Satori cards, build-time scripts, `theme-color` in a web manifest,\n * a canvas.\n *\n * The RUNTIME theme lives in `styles/tokens.css` (`:root` + `[data-mode=\"dark\"]`)\n * and that is the single place to recolour the system. These literals mirror\n * specific tokens; `brand.test.ts` parses the CSS and fails if the two drift,\n * so this file cannot quietly fall behind the thing it mirrors.\n */\nexport const BRAND = {\n /** = light --paper. The page ground. */\n paper: '#ffffff',\n /** = dark --paper. The dark viewport's `theme-color`. */\n paperDark: '#0d0d0d',\n /** = light --paper-2. One step off the ground. */\n paperElevated: '#f7f7f5',\n /** = light --ink. The mark. */\n ink: '#101010',\n /** = dark --ink. */\n inkDark: '#f4f4f2',\n /** = light --ink-2. Body copy that is not the mark. */\n body: '#4a4a4a',\n /** = light --ink-3-aa. The lightest text step that still clears AA on paper. */\n muted: '#5c5c5c',\n /** = light --stone. The fill under a skeleton, a bar, a quiet plate. */\n stone: '#f2f1ee',\n /** = light --rule. Hairline. */\n rule: '#edebe6',\n /** = light --rule-2. Edge. */\n ruleStrong: '#dbdbd6',\n /** = --feature-surface. The one reversed plate. */\n feature: '#262626',\n /** = --on-dark. Type over a photograph — a dark ground in BOTH themes. */\n onDark: '#fbfbfa',\n /** Byline weight over a photograph. */\n onDarkMuted: 'rgba(251,251,250,0.82)',\n /** = --photo-scrim, as an \"r, g, b\" tuple for a gradient. */\n scrimRgb: '16, 16, 16',\n /** = light --ok / --warn / --danger. The only chroma in the system. */\n success: '#3d6b34',\n warning: '#8a5a00',\n danger: '#a83214',\n} as const\n\nexport type BrandColor = keyof typeof BRAND\n"],"mappings":"AAUO,MAAM,QAAQ;AAAA;AAAA,EAEnB,OAAO;AAAA;AAAA,EAEP,WAAW;AAAA;AAAA,EAEX,eAAe;AAAA;AAAA,EAEf,KAAK;AAAA;AAAA,EAEL,SAAS;AAAA;AAAA,EAET,MAAM;AAAA;AAAA,EAEN,OAAO;AAAA;AAAA,EAEP,OAAO;AAAA;AAAA,EAEP,MAAM;AAAA;AAAA,EAEN,YAAY;AAAA;AAAA,EAEZ,SAAS;AAAA;AAAA,EAET,QAAQ;AAAA;AAAA,EAER,aAAa;AAAA;AAAA,EAEb,UAAU;AAAA;AAAA,EAEV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;","names":[]}
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
WHITE RESET — design tokens
|
|
3
|
+
--------------------------------------------------------------------------
|
|
4
|
+
The portable layer of @misoto22/design: plain CSS custom properties, no
|
|
5
|
+
Tailwind dependency. Import this alone and any consumer — a Tailwind app, a
|
|
6
|
+
plain-CSS app, a preview sandbox — gets the same look.
|
|
7
|
+
|
|
8
|
+
A pure-white monochrome system for software, writing, and photography. The
|
|
9
|
+
ground is paper-white, the mark is near-black, and the only chroma left in
|
|
10
|
+
the file is status, which is bound to state and never to brand.
|
|
11
|
+
|
|
12
|
+
Two blocks, and only two: the primitives below, and the semantic aliases in
|
|
13
|
+
`semantic.css` that name what a primitive is FOR. A component never reads a
|
|
14
|
+
primitive directly — it reads the alias — so recolouring the system is one
|
|
15
|
+
edit here rather than a sweep through every component.
|
|
16
|
+
|
|
17
|
+
Hex mirrors for surfaces that cannot read CSS custom properties (OpenGraph
|
|
18
|
+
cards, build scripts, `theme-color`) live in `tokens/brand.ts`, and a test
|
|
19
|
+
holds the two in sync.
|
|
20
|
+
========================================================================== */
|
|
21
|
+
|
|
22
|
+
:root,
|
|
23
|
+
[data-mode='light'] {
|
|
24
|
+
--paper: #ffffff;
|
|
25
|
+
--paper-2: #f7f7f5;
|
|
26
|
+
--bar: var(--stone);
|
|
27
|
+
--bar-2: var(--stone);
|
|
28
|
+
|
|
29
|
+
/* Two text steps and nothing lighter. --ink-3-aa is the floor — it clears
|
|
30
|
+
AA on white at 6.7:1, and every step above it is darker. --ink-3 is the
|
|
31
|
+
same weight expressed as alpha, for rules and washes that must sit over a
|
|
32
|
+
photograph as well as over paper. */
|
|
33
|
+
--ink: #101010;
|
|
34
|
+
--ink-2: #4a4a4a;
|
|
35
|
+
--ink-3: rgba(16, 16, 16, 0.55);
|
|
36
|
+
--ink-3-aa: #5c5c5c;
|
|
37
|
+
|
|
38
|
+
/* The second editorial voice is not a hue — it is one more neutral step,
|
|
39
|
+
sitting between --ink and --ink-2, so a byline separates from body copy
|
|
40
|
+
without introducing colour. */
|
|
41
|
+
--forest: #3a3a3a;
|
|
42
|
+
--mist: var(--stone);
|
|
43
|
+
--stone: #f2f1ee;
|
|
44
|
+
|
|
45
|
+
/* Monochrome collapses the pointer onto the mark: the accent IS ink. What
|
|
46
|
+
used to be carried by hue is now carried by weight, rule and reversal —
|
|
47
|
+
an ink pill, an ink underline, an ink-filled plate. */
|
|
48
|
+
--clay: var(--ink);
|
|
49
|
+
--clay-ink: var(--clay);
|
|
50
|
+
|
|
51
|
+
/* The one reversed plate, and the one place the ramp needs a tenth step.
|
|
52
|
+
Set to var(--ink) it was the page's darkest possible mark used as a field,
|
|
53
|
+
which on a white page reads as a hole punched through it rather than as a
|
|
54
|
+
panel. Two steps lighter keeps the reversal — 15.1:1 for paper-white type
|
|
55
|
+
on it — and matches the dark side. */
|
|
56
|
+
--feature-surface: #262626;
|
|
57
|
+
--on-feature: var(--paper);
|
|
58
|
+
--focus-on-feature: var(--on-feature);
|
|
59
|
+
--on-photo: var(--paper);
|
|
60
|
+
--photo-caption-surface: var(--ink);
|
|
61
|
+
--photo-shadow: 0 1px 6px rgb(0 0 0 / 0.72);
|
|
62
|
+
|
|
63
|
+
/* Three rule weights, because a monochrome page has no colour left to
|
|
64
|
+
separate one band from the next: hairline, edge, and hard. */
|
|
65
|
+
--rule: #edebe6;
|
|
66
|
+
--rule-2: #dbdbd6;
|
|
67
|
+
--rule-hard: var(--ink);
|
|
68
|
+
|
|
69
|
+
/* Historic role names, kept so a consumer written against the previous
|
|
70
|
+
palette keeps resolving. Their hue is now ink; the role remains "the
|
|
71
|
+
single editorial pointer". */
|
|
72
|
+
--red: var(--clay);
|
|
73
|
+
--red-ink: var(--clay);
|
|
74
|
+
--red-soft: rgba(16, 16, 16, 0.07);
|
|
75
|
+
--on-red: var(--paper);
|
|
76
|
+
|
|
77
|
+
--shadow-offset: var(--clay);
|
|
78
|
+
|
|
79
|
+
color-scheme: light;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-mode='dark'] {
|
|
83
|
+
--paper: #0d0d0d;
|
|
84
|
+
--paper-2: #161616;
|
|
85
|
+
--bar: var(--stone);
|
|
86
|
+
--bar-2: var(--stone);
|
|
87
|
+
|
|
88
|
+
--ink: #f4f4f2;
|
|
89
|
+
--ink-2: #b4b4b0;
|
|
90
|
+
--ink-3: rgba(244, 244, 242, 0.55);
|
|
91
|
+
--ink-3-aa: #9a9a96;
|
|
92
|
+
|
|
93
|
+
--forest: #c9c9c5;
|
|
94
|
+
--mist: var(--stone);
|
|
95
|
+
--stone: #1f1f1f;
|
|
96
|
+
--clay: var(--ink);
|
|
97
|
+
--clay-ink: var(--clay);
|
|
98
|
+
--feature-surface: #1a1a1a;
|
|
99
|
+
--on-feature: var(--ink);
|
|
100
|
+
--focus-on-feature: var(--on-feature);
|
|
101
|
+
|
|
102
|
+
/* A photograph is a dark ground in both themes, so this one does not swap
|
|
103
|
+
with --paper. It sits a shade off pure white because the light side has
|
|
104
|
+
already spent pure white on the page ground, and one hex serves one role. */
|
|
105
|
+
--on-photo: #fbfbfa;
|
|
106
|
+
--photo-caption-surface: var(--paper);
|
|
107
|
+
--photo-shadow: 0 1px 6px rgb(0 0 0 / 0.72);
|
|
108
|
+
|
|
109
|
+
--rule: rgba(244, 244, 242, 0.14);
|
|
110
|
+
--rule-2: rgba(244, 244, 242, 0.26);
|
|
111
|
+
--rule-hard: var(--ink);
|
|
112
|
+
|
|
113
|
+
--red: var(--clay);
|
|
114
|
+
--red-ink: var(--clay);
|
|
115
|
+
--red-soft: rgba(244, 244, 242, 0.12);
|
|
116
|
+
--on-red: var(--paper);
|
|
117
|
+
|
|
118
|
+
--shadow-offset: var(--clay);
|
|
119
|
+
|
|
120
|
+
color-scheme: dark;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
:root {
|
|
124
|
+
/* ─── Type ───────────────────────────────────────────────────────────────
|
|
125
|
+
Three faces and their CJK companions.
|
|
126
|
+
|
|
127
|
+
EVERY `var()` here carries a fallback, and that is load-bearing rather than
|
|
128
|
+
tidy. A `var(--font-hanken)` with no fallback, in a host that does not
|
|
129
|
+
define `--font-hanken`, is invalid at computed-value time — and IACVT does
|
|
130
|
+
not skip the one term, it discards the WHOLE declaration. So the entire
|
|
131
|
+
stack collapsed to nothing and every surface rendered in the platform's
|
|
132
|
+
system font. It worked inside the site, where next/font defines those
|
|
133
|
+
names, and failed everywhere else: for a package whose whole purpose is to
|
|
134
|
+
render the same on both sides, that is the worst possible bug.
|
|
135
|
+
|
|
136
|
+
With the fallback, a host that loads the faces itself (next/font, a CDN)
|
|
137
|
+
sets `--font-*` and wins; a host that does not falls through to the literal
|
|
138
|
+
family name, which is exactly the name `fonts.css` declares its vendored
|
|
139
|
+
@font-face rules under.
|
|
140
|
+
|
|
141
|
+
The CJK stacks deliberately end WITHOUT a generic family. They are spliced
|
|
142
|
+
into the middle of the three stacks above, and a generic in the middle
|
|
143
|
+
terminates a font stack — everything listed after it is unreachable. */
|
|
144
|
+
--sans: var(--font-hanken, 'Hanken Grotesk'), var(--cjk-sans), 'Helvetica Neue', Arial, sans-serif;
|
|
145
|
+
--serif: var(--font-newsreader, 'Newsreader'), var(--cjk-serif), Georgia, serif;
|
|
146
|
+
--mono: var(--font-plex-mono, 'IBM Plex Mono'), var(--cjk-sans), ui-monospace, SFMono-Regular, Menlo,
|
|
147
|
+
monospace;
|
|
148
|
+
|
|
149
|
+
--cjk-serif: var(--font-noto-serif-sc, 'Noto Serif SC'), 'Source Han Serif SC', 'Songti SC', STSong,
|
|
150
|
+
SimSun;
|
|
151
|
+
--cjk-sans: var(--font-noto-sans-sc, 'Noto Sans SC'), 'PingFang SC', 'Hiragino Sans GB',
|
|
152
|
+
'Microsoft YaHei';
|
|
153
|
+
|
|
154
|
+
--lh-cjk: 1.8;
|
|
155
|
+
--ls-cjk: 0;
|
|
156
|
+
|
|
157
|
+
/* Heading scale — the single ladder every surface climbs. Five steps, each
|
|
158
|
+
fluid between a phone and the 1288px page, and nothing sits above
|
|
159
|
+
--fs-title: a page has exactly one thing larger than its own records.
|
|
160
|
+
|
|
161
|
+
Steps sit close together by design — the ladder separates records of the
|
|
162
|
+
same kind, not a heading from its own sub-heading. Two headings that nest
|
|
163
|
+
must skip a step: --fs-lead over --fs-sub reads as a hierarchy (1.33),
|
|
164
|
+
--fs-lead over --fs-heading does not (1.14). */
|
|
165
|
+
/* ─── The fluid base ──────────────────────────────────────────────────────
|
|
166
|
+
Every fluid step below is one percent of THIS, not of the viewport.
|
|
167
|
+
|
|
168
|
+
The default is `1vw`, which is what a page wants. A bounded frame — a
|
|
169
|
+
device preview, a documentation canvas, an embedded console — overrides it
|
|
170
|
+
to `1cqi` and declares itself a `container`, and the whole ramp re-bases
|
|
171
|
+
onto the frame's width. Without the seam a 390px preview inside a 1440px
|
|
172
|
+
window renders 54px headings and 64px gutters, which is not what a 390px
|
|
173
|
+
screen looks like and is exactly the bug this replaces.
|
|
174
|
+
|
|
175
|
+
The ramp itself is declared once, below, for BOTH `:root` and a frame —
|
|
176
|
+
rather than composed here and inherited. A custom property substitutes
|
|
177
|
+
`var()` where it is DECLARED, so a ramp written only on `:root` bakes in
|
|
178
|
+
`1vw` and a deeper `--fluid` never reaches it. */
|
|
179
|
+
--fluid: 1vw;
|
|
180
|
+
|
|
181
|
+
--maxw: 1288px;
|
|
182
|
+
--col: 8.3333%;
|
|
183
|
+
--row: 52px;
|
|
184
|
+
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* The fluid ramp, computed wherever `--fluid` is set.
|
|
188
|
+
`[data-fluid-frame]` must sit INSIDE the element carrying `container-type`:
|
|
189
|
+
a container query unit resolves against an ANCESTOR container, never against
|
|
190
|
+
the element that declares the container itself. */
|
|
191
|
+
:root,
|
|
192
|
+
[data-fluid-frame] {
|
|
193
|
+
--fs-title: clamp(2.5rem, calc(4.6 * var(--fluid)), 3.375rem); /* page h1 40 → 54px */
|
|
194
|
+
--fs-lead: clamp(1.875rem, calc(3 * var(--fluid)), 2.625rem); /* band heading 30 → 42px */
|
|
195
|
+
--fs-heading: clamp(1.5rem, calc(2.1 * var(--fluid)), 1.8125rem); /* record title 24 → 29px */
|
|
196
|
+
--fs-sub: clamp(1.3125rem, calc(1.7 * var(--fluid)), 1.5625rem); /* card sub-head 21 → 25px */
|
|
197
|
+
--fs-item: clamp(1.125rem, calc(1.35 * var(--fluid)), 1.25rem); /* in-card title 18 → 20px */
|
|
198
|
+
|
|
199
|
+
--pad: clamp(18px, calc(4.4 * var(--fluid)), 64px);
|
|
200
|
+
--sec: clamp(54px, calc(7 * var(--fluid)), 96px);
|
|
201
|
+
--sec-tight: clamp(40px, calc(5 * var(--fluid)), 68px);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:root {
|
|
205
|
+
/* ─── Radius ─────────────────────────────────────────────────────────────
|
|
206
|
+
Four steps, and there is no fifth. The old law was "0 everywhere"; the
|
|
207
|
+
White Reset replaces that with a scale small enough to stay quiet on a
|
|
208
|
+
white page. A 50% circle is geometry rather than a corner and is not a
|
|
209
|
+
step here. */
|
|
210
|
+
--radius-sm: 6px; /* images, thumbnails, media frames */
|
|
211
|
+
--radius: 8px; /* inputs, buttons, small plates */
|
|
212
|
+
--radius-lg: 14px; /* feature panels, dark plates */
|
|
213
|
+
--radius-pill: 999px; /* tabs, chips, counters, circular controls */
|
|
214
|
+
|
|
215
|
+
/* ─── Density ────────────────────────────────────────────────────────────
|
|
216
|
+
The second theming axis, and the only other one. Light/dark swaps colour;
|
|
217
|
+
density swaps the size of anything a finger or a pointer has to hit.
|
|
218
|
+
|
|
219
|
+
`comfortable` is the default, and 44px is not an arbitrary number: it is
|
|
220
|
+
the pointer-target size WCAG 2.5.5 (AAA) asks for.
|
|
221
|
+
|
|
222
|
+
`compact` is for a dense desktop tool driven by a mouse — a data grid, an
|
|
223
|
+
admin console — and it is a real trade, stated rather than hidden. At 36px
|
|
224
|
+
it still clears WCAG 2.5.8 (AA, 24px) with room to spare, and no longer
|
|
225
|
+
meets 2.5.5. Do not put it on a page a phone will open.
|
|
226
|
+
|
|
227
|
+
Set it on any container: `<div data-density="compact">`. Controls read
|
|
228
|
+
these tokens, so the whole subtree changes together and nothing has to be
|
|
229
|
+
told twice. */
|
|
230
|
+
--control-h-sm: 2.25rem; /* 36px */
|
|
231
|
+
--control-h-md: 2.75rem; /* 44px — WCAG 2.5.5 */
|
|
232
|
+
--control-h-lg: 3rem; /* 48px */
|
|
233
|
+
--control-px-sm: 1rem;
|
|
234
|
+
--control-px-md: 1.5rem;
|
|
235
|
+
--control-px-lg: 1.75rem;
|
|
236
|
+
/* The vertical padding is part of the axis too, and has to be: a control
|
|
237
|
+
whose padding alone exceeds the compact height never shrinks, because
|
|
238
|
+
`min-height` is a floor and not a ceiling. */
|
|
239
|
+
--control-py-sm: 0.5rem;
|
|
240
|
+
--control-py-md: 0.75rem;
|
|
241
|
+
--control-py-lg: 0.75rem;
|
|
242
|
+
--control-gap: 0.625rem;
|
|
243
|
+
/* Text inputs are measured separately: they are read as much as they are
|
|
244
|
+
hit, so their padding tracks the type rather than the target. */
|
|
245
|
+
--field-px: 0.875rem;
|
|
246
|
+
--field-py: 0.625rem;
|
|
247
|
+
|
|
248
|
+
/* A table's own row padding. Separate from the control scale because a table
|
|
249
|
+
row is neither a control nor a field — it is a line of text with a rule
|
|
250
|
+
under it, and it tightens on its own axis. */
|
|
251
|
+
--table-pad-y: 0.875rem;
|
|
252
|
+
/* `0px`, not `0`. The cell rule adds to this inside a calc, and a unitless
|
|
253
|
+
zero makes `calc(0 + 1.5rem)` invalid at computed-value time — the whole
|
|
254
|
+
declaration is dropped and every column loses its gutter in silence. */
|
|
255
|
+
--table-pad-x: 0px;
|
|
256
|
+
|
|
257
|
+
/* ─── Motion ─── */
|
|
258
|
+
--ease: cubic-bezier(0.2, 0.7, 0.3, 1);
|
|
259
|
+
--fast: 0.13s;
|
|
260
|
+
--mid: 0.22s;
|
|
261
|
+
--slow: 0.34s;
|
|
262
|
+
|
|
263
|
+
/* ─── Stacking ─── seven ranks, named for what sits at each. */
|
|
264
|
+
--z-rule: 1;
|
|
265
|
+
--z-sticky: 10;
|
|
266
|
+
--z-drawer: 100;
|
|
267
|
+
--z-scrim: 200;
|
|
268
|
+
--z-modal: 210;
|
|
269
|
+
--z-palette: 220;
|
|
270
|
+
--z-toast: 300;
|
|
271
|
+
|
|
272
|
+
/* ─── Focus ─── */
|
|
273
|
+
--focus: var(--red);
|
|
274
|
+
--focus-w: 2px;
|
|
275
|
+
--focus-off: 3px;
|
|
276
|
+
|
|
277
|
+
/* ─── Icons ─── one stroke weight, three sizes. */
|
|
278
|
+
--ico-s: 14px;
|
|
279
|
+
--ico-m: 16px;
|
|
280
|
+
--ico-l: 20px;
|
|
281
|
+
--ico-stroke: 1.5;
|
|
282
|
+
|
|
283
|
+
/* ─── Status ─── the only chroma in the system, and it is bound to state. */
|
|
284
|
+
--ok: #3d6b34;
|
|
285
|
+
--ok-soft: rgba(61, 107, 52, 0.13);
|
|
286
|
+
--warn: #8a5a00;
|
|
287
|
+
--warn-soft: rgba(138, 90, 0, 0.13);
|
|
288
|
+
--danger: #a83214;
|
|
289
|
+
--danger-soft: rgba(168, 50, 20, 0.14);
|
|
290
|
+
--scrim: color-mix(in srgb, var(--ink) 62%, transparent);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
[data-mode='dark'] {
|
|
294
|
+
--ok: #84b47b;
|
|
295
|
+
--ok-soft: rgba(132, 180, 123, 0.16);
|
|
296
|
+
--warn: #d9a55d;
|
|
297
|
+
--warn-soft: rgba(217, 165, 93, 0.16);
|
|
298
|
+
--danger: #ee8b68;
|
|
299
|
+
--danger-soft: rgba(238, 139, 104, 0.16);
|
|
300
|
+
--scrim: color-mix(in srgb, #000 72%, transparent);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
[data-density='compact'] {
|
|
304
|
+
--control-h-sm: 1.875rem; /* 30px */
|
|
305
|
+
--control-h-md: 2.25rem; /* 36px — clears WCAG 2.5.8, not 2.5.5 */
|
|
306
|
+
--control-h-lg: 2.5rem; /* 40px */
|
|
307
|
+
--control-px-sm: 0.75rem;
|
|
308
|
+
--control-px-md: 1rem;
|
|
309
|
+
--control-px-lg: 1.25rem;
|
|
310
|
+
--control-py-sm: 0.25rem;
|
|
311
|
+
--control-py-md: 0.375rem;
|
|
312
|
+
--control-py-lg: 0.5rem;
|
|
313
|
+
--control-gap: 0.5rem;
|
|
314
|
+
--field-px: 0.625rem;
|
|
315
|
+
--field-py: 0.375rem;
|
|
316
|
+
--table-pad-y: 0.5rem;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* A table can be tightened on its own, without the whole subtree going
|
|
320
|
+
compact — a dashboard often wants a dense grid inside comfortable chrome. */
|
|
321
|
+
[data-table-density='compact'] {
|
|
322
|
+
--table-pad-y: 0.5rem;
|
|
323
|
+
}
|
package/dist/tokens.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/* GENERATED by scripts/emit-tokens.mjs — do not edit. */
|
|
2
|
+
export interface TokenRecord {
|
|
3
|
+
/** Which CSS layer declared it: a primitive, or the role that names it. */
|
|
4
|
+
layer: 'tokens' | 'semantic'
|
|
5
|
+
/** Foundations grouping — colour, type, space, radius, motion, density… */
|
|
6
|
+
category: string
|
|
7
|
+
light: string
|
|
8
|
+
/** Present only when the token swaps; absent means it holds in both themes. */
|
|
9
|
+
dark?: string
|
|
10
|
+
/** The comment above the declaration, which is usually the only place the reason is written. */
|
|
11
|
+
comment?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TokenName =
|
|
15
|
+
| 'accent'
|
|
16
|
+
| 'accent-foreground'
|
|
17
|
+
| 'accent-hover'
|
|
18
|
+
| 'accent-muted'
|
|
19
|
+
| 'accent-on-dark'
|
|
20
|
+
| 'accent-on-muted'
|
|
21
|
+
| 'accent-wash'
|
|
22
|
+
| 'background'
|
|
23
|
+
| 'background-elevated'
|
|
24
|
+
| 'bar'
|
|
25
|
+
| 'bar-2'
|
|
26
|
+
| 'border-color'
|
|
27
|
+
| 'border-subtle'
|
|
28
|
+
| 'brand-plate'
|
|
29
|
+
| 'card-background'
|
|
30
|
+
| 'cjk-sans'
|
|
31
|
+
| 'cjk-serif'
|
|
32
|
+
| 'clay'
|
|
33
|
+
| 'clay-ink'
|
|
34
|
+
| 'code-background'
|
|
35
|
+
| 'col'
|
|
36
|
+
| 'control-gap'
|
|
37
|
+
| 'control-h-lg'
|
|
38
|
+
| 'control-h-md'
|
|
39
|
+
| 'control-h-sm'
|
|
40
|
+
| 'control-px-lg'
|
|
41
|
+
| 'control-px-md'
|
|
42
|
+
| 'control-px-sm'
|
|
43
|
+
| 'control-py-lg'
|
|
44
|
+
| 'control-py-md'
|
|
45
|
+
| 'control-py-sm'
|
|
46
|
+
| 'danger'
|
|
47
|
+
| 'danger-soft'
|
|
48
|
+
| 'danger-wash'
|
|
49
|
+
| 'disabled-opacity'
|
|
50
|
+
| 'duration-base'
|
|
51
|
+
| 'duration-fast'
|
|
52
|
+
| 'duration-slow'
|
|
53
|
+
| 'ease'
|
|
54
|
+
| 'ease-out-expo'
|
|
55
|
+
| 'fast'
|
|
56
|
+
| 'feature-surface'
|
|
57
|
+
| 'field-px'
|
|
58
|
+
| 'field-py'
|
|
59
|
+
| 'fluid'
|
|
60
|
+
| 'focus'
|
|
61
|
+
| 'focus-off'
|
|
62
|
+
| 'focus-on-feature'
|
|
63
|
+
| 'focus-w'
|
|
64
|
+
| 'foreground'
|
|
65
|
+
| 'foreground-muted'
|
|
66
|
+
| 'forest'
|
|
67
|
+
| 'fs-heading'
|
|
68
|
+
| 'fs-item'
|
|
69
|
+
| 'fs-lead'
|
|
70
|
+
| 'fs-sub'
|
|
71
|
+
| 'fs-title'
|
|
72
|
+
| 'ico-l'
|
|
73
|
+
| 'ico-m'
|
|
74
|
+
| 'ico-s'
|
|
75
|
+
| 'ico-stroke'
|
|
76
|
+
| 'info'
|
|
77
|
+
| 'info-wash'
|
|
78
|
+
| 'ink'
|
|
79
|
+
| 'ink-2'
|
|
80
|
+
| 'ink-3'
|
|
81
|
+
| 'ink-3-aa'
|
|
82
|
+
| 'lh-cjk'
|
|
83
|
+
| 'lift'
|
|
84
|
+
| 'lift-sm'
|
|
85
|
+
| 'ls-cjk'
|
|
86
|
+
| 'maxw'
|
|
87
|
+
| 'measure-record'
|
|
88
|
+
| 'mid'
|
|
89
|
+
| 'mist'
|
|
90
|
+
| 'mono'
|
|
91
|
+
| 'nav-background'
|
|
92
|
+
| 'ok'
|
|
93
|
+
| 'ok-soft'
|
|
94
|
+
| 'on-dark'
|
|
95
|
+
| 'on-feature'
|
|
96
|
+
| 'on-photo'
|
|
97
|
+
| 'on-red'
|
|
98
|
+
| 'overlay'
|
|
99
|
+
| 'pad'
|
|
100
|
+
| 'page-pad'
|
|
101
|
+
| 'paper'
|
|
102
|
+
| 'paper-2'
|
|
103
|
+
| 'photo-caption-surface'
|
|
104
|
+
| 'photo-scrim'
|
|
105
|
+
| 'photo-shadow'
|
|
106
|
+
| 'radius'
|
|
107
|
+
| 'radius-lg'
|
|
108
|
+
| 'radius-pill'
|
|
109
|
+
| 'radius-sm'
|
|
110
|
+
| 'red'
|
|
111
|
+
| 'red-ink'
|
|
112
|
+
| 'red-soft'
|
|
113
|
+
| 'ring'
|
|
114
|
+
| 'ring-offset'
|
|
115
|
+
| 'row'
|
|
116
|
+
| 'rule'
|
|
117
|
+
| 'rule-2'
|
|
118
|
+
| 'rule-hard'
|
|
119
|
+
| 'sans'
|
|
120
|
+
| 'scrim'
|
|
121
|
+
| 'scroll-offset'
|
|
122
|
+
| 'sec'
|
|
123
|
+
| 'sec-tight'
|
|
124
|
+
| 'secondary-text'
|
|
125
|
+
| 'serif'
|
|
126
|
+
| 'shadow'
|
|
127
|
+
| 'shadow-color'
|
|
128
|
+
| 'shadow-lg'
|
|
129
|
+
| 'shadow-offset'
|
|
130
|
+
| 'shadow-sm'
|
|
131
|
+
| 'slow'
|
|
132
|
+
| 'stone'
|
|
133
|
+
| 'success'
|
|
134
|
+
| 'success-wash'
|
|
135
|
+
| 'table-pad-x'
|
|
136
|
+
| 'table-pad-y'
|
|
137
|
+
| 'w-page'
|
|
138
|
+
| 'w-reading'
|
|
139
|
+
| 'warn'
|
|
140
|
+
| 'warn-soft'
|
|
141
|
+
| 'warning'
|
|
142
|
+
| 'warning-wash'
|
|
143
|
+
| 'z-drawer'
|
|
144
|
+
| 'z-dropdown'
|
|
145
|
+
| 'z-modal'
|
|
146
|
+
| 'z-overlay'
|
|
147
|
+
| 'z-palette'
|
|
148
|
+
| 'z-rule'
|
|
149
|
+
| 'z-scrim'
|
|
150
|
+
| 'z-sticky'
|
|
151
|
+
| 'z-toast'
|
|
152
|
+
|
|
153
|
+
export declare const TOKENS: Record<TokenName, TokenRecord>
|