@rowkit/tokens 1.0.0-beta.0 → 1.0.0-beta.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes-B0J8E0xq.js","names":[],"sources":["../src/color.ts","../src/radius.ts","../src/shadow.ts","../src/size.ts","../src/style.ts","../src/typography.ts","../src/themes/modern.ts","../src/themes/index.ts"],"sourcesContent":["/**\n * Colour primitives and semantic mappings — the Windows 98 palette.\n *\n * ## Where the values come from\n *\n * The primitives are the sixteen-colour VGA palette Windows 98 was drawn in,\n * plus the handful of system colours the default \"Windows Standard\" scheme\n * added on top of it: the light bevel grey, the title-bar gradient ends and\n * the tooltip yellow. They are written as the exact sRGB hex values, not\n * converted to another space: these colours are defined by their eight-bit\n * channels, and a round trip through OKLCH would only add rounding to values\n * that are already exact.\n *\n * The names and values mirror the Figma file's `primitives` collection, and\n * the semantic map mirrors its `semantic` collection token for token, so a\n * colour picked in the design is the colour the component paints.\n *\n * Contrast for every semantic pair a component produces is asserted in\n * `contrast.test.ts` — the ratios are a build gate, not a claim in a comment.\n */\n\n/** The sixteen-colour VGA palette, as Windows 98 used it. Only the twelve the design uses are listed. */\nexport const vga = {\n black: '#000000',\n white: '#ffffff',\n /** The face of every window, button and dialog. */\n silver: '#c0c0c0',\n /** Bevel shadows, disabled text, the borders of a field. */\n gray: '#808080',\n /** Selection, the active title bar, the default primary. */\n navy: '#000080',\n /** Hyperlinks. */\n blue: '#0000ff',\n /** The desktop. */\n teal: '#008080',\n green: '#008000',\n olive: '#808000',\n yellow: '#ffff00',\n maroon: '#800000',\n red: '#ff0000',\n} as const\n\n/** The system colours Windows 98 added on top of VGA. */\nexport const win98 = {\n /** The inner light edge of a raised bevel (`3D Light`). */\n light: '#dfdfdf',\n /** Secondary text a step lighter than black. */\n 'dark-gray': '#404040',\n /** The light end of the active title-bar gradient. */\n 'title-blue': '#1084d0',\n /** The light end of the inactive title-bar gradient. */\n 'title-gray': '#b5b5b5',\n /** Tooltip background (`Info`). */\n info: '#ffffe1',\n} as const\n\n/**\n * Every primitive colour, keyed by the CSS custom property it becomes:\n * `--color-vga-silver`, `--color-win98-info`.\n *\n * These are the only place a literal colour value appears in rowkit. Everything\n * else — semantic tokens, component variants — references one of these.\n */\nexport const colorPrimitives = {\n ...prefixKeys('vga', vga),\n ...prefixKeys('win98', win98),\n} as const\n\n/** Prefixes every key of a palette with its family name. */\nfunction prefixKeys<N extends string, S extends Record<string, string>>(\n name: N,\n scale: S\n): { [K in keyof S & string as `${N}-${K}`]: S[K] } {\n const out: Record<string, string> = {}\n for (const [key, value] of Object.entries(scale)) out[`${name}-${key}`] = value\n return out as { [K in keyof S & string as `${N}-${K}`]: S[K] }\n}\n\n/** A reference to a primitive colour, as a CSS `var()` expression. */\nexport type ColorRef = `var(--color-${string})`\n\nconst ref = (token: keyof typeof colorPrimitives): ColorRef => `var(--color-${token})`\n\n/**\n * Semantic colours.\n *\n * Semantic tokens never hold a literal colour — each one points at a primitive\n * through `var()`, so re-theming means repointing references rather than\n * hunting down hex codes. `color.test.ts` enforces this.\n *\n * Windows 98 is a grey world: most surfaces are the same silver, and depth\n * comes from bevels rather than from a lighter or darker fill. So several\n * surface tokens below share a value. They stay separate tokens because they\n * are separate override points — a theme that wants a hovered row to change\n * colour repoints `accent` without touching `muted`.\n */\nexport const semanticColor = {\n // Surfaces\n\n /** The face of a window: the page behind the content. */\n background: ref('vga-silver'),\n /** The desktop a window sits on. Docs and demo backdrops. */\n desktop: ref('vga-teal'),\n /** Panels and dialogs. Same face as the window; the bevel separates them. */\n card: ref('vga-silver'),\n /** Toolbars and table headers. */\n muted: ref('vga-silver'),\n /** Row hover. Windows 98 has none — the token is here to be repointed. */\n accent: ref('vga-silver'),\n /** A pressed row or toggle. The pressed bevel carries the state, not the fill. */\n 'surface-active': ref('vga-silver'),\n /** A selected row or list item: navy, with `on-selected` text. */\n 'surface-selected': ref('vga-navy'),\n /** A disabled control keeps the face colour; its text goes grey and embossed. */\n 'surface-disabled': ref('vga-silver'),\n /**\n * Loading placeholder fill.\n *\n * Exempt from contrast rules: skeletons are `aria-hidden` decoration standing\n * in for content that has not arrived, so WCAG 1.4.11 does not apply.\n */\n skeleton: ref('vga-gray'),\n /** The inside of a text field, list or table body: white inside a sunken bevel. */\n input: ref('vga-white'),\n /** Tooltip bubble. */\n 'tooltip-bg': ref('win98-info'),\n\n // Text\n\n /** Body and heading text. */\n foreground: ref('vga-black'),\n /**\n * Secondary text. Black, like body text: Windows 98 never greys out text\n * that can still be read and acted on — grey means disabled.\n */\n 'muted-foreground': ref('vga-black'),\n /** Placeholders and de-emphasised metadata. */\n 'text-subtle': ref('win98-dark-gray'),\n /** Disabled text, always drawn with {@link semanticColor['text-disabled-emboss']} under it. */\n 'text-disabled': ref('vga-gray'),\n /** The white copy, one pixel right and down, that embosses disabled text. */\n 'text-disabled-emboss': ref('vga-white'),\n /** Text on a selected row. */\n 'on-selected': ref('vga-white'),\n /** Hyperlinks. */\n link: ref('vga-blue'),\n\n // Borders and bevels\n\n /** Separators and the frame of a group. Decorative, below 3:1 on purpose. */\n border: ref('vga-gray'),\n /** A frame that has to read as an edge: the outline of a default button. */\n 'border-strong': ref('vga-black'),\n /** The faintest rule, inside a dense group. */\n 'border-subtle': ref('win98-light'),\n /**\n * Focus. Drawn as a 1px dotted ring inside the control, around its label.\n * Black, so it clears 3:1 on every surface rowkit paints.\n */\n ring: ref('vga-black'),\n /** Base colour for shadows. */\n shadow: ref('vga-black'),\n\n /** Outer light edge of a raised bevel, inner one of a sunken bevel. */\n 'bevel-highlight': ref('vga-white'),\n /** Inner light edge of a raised bevel. */\n 'bevel-light': ref('win98-light'),\n /** Inner dark edge of a raised bevel. */\n 'bevel-shadow': ref('vga-gray'),\n /**\n * Outer dark edge of a raised bevel. Being black, it is what gives every\n * control a boundary of well over 3:1 against the face (WCAG 1.4.11).\n */\n 'bevel-dark': ref('vga-black'),\n\n // Window title bar\n\n /** Active title bar, left end of the gradient. The title text sits on this end. */\n 'titlebar-from': ref('vga-navy'),\n /** Active title bar, right end of the gradient. */\n 'titlebar-to': ref('win98-title-blue'),\n /** Inactive title bar, left end of the gradient. */\n 'titlebar-inactive-from': ref('vga-gray'),\n /** Inactive title bar, right end of the gradient. */\n 'titlebar-inactive-to': ref('win98-title-gray'),\n /** Active title text. */\n 'titlebar-foreground': ref('vga-white'),\n /**\n * Inactive title text. Black, not Windows 98's silver: silver on the grey\n * gradient is about 2:1 and fails 4.5:1; black is 5.3:1 on `#808080` and\n * 11:1 on `#b5b5b5`.\n */\n 'titlebar-inactive-foreground': ref('vga-black'),\n\n // Status families. A solid is a filled badge or a button; a subtle is a\n // white chip with coloured text. No status colour is ever used without an\n // icon or a word that says the same thing.\n //\n // `neutral` completes the family so a component's variant matrix has no\n // special case: a neutral Badge reads the same token names as a danger one.\n /** Neutral fill: a solid neutral badge, and anything filled in the neutral colour. */\n 'neutral-solid': ref('vga-black'),\n /** Neutral fill under the pointer. */\n 'neutral-solid-hover': ref('vga-black'),\n /** Text and icons on the neutral fill. */\n 'neutral-on-solid': ref('vga-white'),\n /** Neutral tint: the face of a subtle neutral badge or callout. */\n 'neutral-subtle': ref('vga-white'),\n /** Neutral text and icons, on its tint and on the page. */\n 'neutral-on-subtle': ref('vga-black'),\n /** The edge of a subtle or outlined neutral badge. */\n 'neutral-border': ref('vga-gray'),\n\n /** Primary fill — the accent: a solid primary badge, a selected item, the default action in a theme that colours it. */\n 'primary-solid': ref('vga-navy'),\n /** Primary fill under the pointer. */\n 'primary-solid-hover': ref('vga-navy'),\n /** Text and icons on the primary fill. */\n 'primary-on-solid': ref('vga-white'),\n /** Primary tint: the face of a subtle primary badge or callout. */\n 'primary-subtle': ref('vga-white'),\n /** Primary text and icons, on its tint and on the page. */\n 'primary-on-subtle': ref('vga-navy'),\n /** The edge of a subtle or outlined primary badge. */\n 'primary-border': ref('vga-navy'),\n\n /** Success fill: a solid success badge, and anything filled in the success colour. */\n 'success-solid': ref('vga-green'),\n /** Success fill under the pointer. */\n 'success-solid-hover': ref('vga-green'),\n /** Text and icons on the success fill. */\n 'success-on-solid': ref('vga-white'),\n /** Success tint: the face of a subtle success badge or callout. */\n 'success-subtle': ref('vga-white'),\n /** Success text and icons, on its tint and on the page. */\n 'success-on-subtle': ref('vga-green'),\n /** The edge of a subtle or outlined success badge. */\n 'success-border': ref('vga-green'),\n\n /**\n * Warning fill: a solid warning badge, and anything filled in the warning colour. Yellow carries black, never white: white on `#ffff00` is 1.07:1;\n * its edge is olive, because yellow on silver has almost no edge of its own.\n */\n 'warning-solid': ref('vga-yellow'),\n /** Warning fill under the pointer. */\n 'warning-solid-hover': ref('vga-yellow'),\n /** Text and icons on the warning fill. */\n 'warning-on-solid': ref('vga-black'),\n /** Warning tint: the face of a subtle warning badge or callout. */\n 'warning-subtle': ref('vga-white'),\n /** Warning text and icons, on its tint and on the page. */\n 'warning-on-subtle': ref('vga-black'),\n /** The edge of a subtle or outlined warning badge. */\n 'warning-border': ref('vga-olive'),\n\n /** Danger fill: a solid danger badge, and anything filled in the danger colour. */\n 'danger-solid': ref('vga-maroon'),\n /** Danger fill under the pointer. */\n 'danger-solid-hover': ref('vga-maroon'),\n /** Text and icons on the danger fill. */\n 'danger-on-solid': ref('vga-white'),\n /** Danger tint: the face of a subtle danger badge or callout. */\n 'danger-subtle': ref('vga-white'),\n /** Danger text and icons, on its tint and on the page. */\n 'danger-on-subtle': ref('vga-maroon'),\n /** The edge of a subtle or outlined danger badge. */\n 'danger-border': ref('vga-maroon'),\n\n // Roles. Each names what a component paints rather than how Windows 98\n // paints it, so a theme can give it its own fill. In Windows 98 most of them\n // are the silver face: the bevel says pressed or default, not the colour.\n\n /** A plain button, a spin or drop button, a table's sort header. */\n control: ref('vga-silver'),\n /** Text and icons on a plain button. */\n 'control-foreground': ref('vga-black'),\n /** A plain button under the pointer. */\n 'control-hover': ref('vga-silver'),\n /** A plain button while it is held. */\n 'control-active': ref('vga-silver'),\n /** The default button of a form or dialog — Enter's target. */\n 'control-primary': ref('vga-silver'),\n /** Text and icons on the default button. */\n 'control-primary-foreground': ref('vga-black'),\n /** The default button under the pointer. */\n 'control-primary-hover': ref('vga-silver'),\n /** The default button while it is held. */\n 'control-primary-active': ref('vga-silver'),\n /** A flat toolbar button while hovered and while held. */\n 'control-ghost-hover': ref('vga-silver'),\n 'control-ghost-active': ref('vga-silver'),\n /** The face of a latched toggle, under its pattern. */\n 'control-latched': ref('vga-silver'),\n /** A latched default button. A toggle is never the default, but if one latches it keeps its colour. */\n 'control-primary-latched': ref('vga-silver'),\n /** The box of a checked checkbox or radio, and the mark inside it. */\n checked: ref('vga-white'),\n 'on-checked': ref('vga-black'),\n /** A list that drops from a trigger: a select's options. */\n popover: ref('vga-white'),\n 'popover-border': ref('vga-black'),\n /** The ring a theme draws around a focused control, outside its edge. */\n 'focus-ring': ref('vga-black'),\n /** A window's caption buttons; one fill per button, for themes that colour them. */\n caption: ref('vga-silver'),\n 'caption-foreground': ref('vga-black'),\n 'caption-close': ref('vga-silver'),\n 'caption-minimize': ref('vga-silver'),\n 'caption-maximize': ref('vga-silver'),\n 'caption-inactive': ref('vga-silver'),\n /** A data table's column headers. */\n 'table-header': ref('vga-silver'),\n 'table-header-foreground': ref('vga-black'),\n /** Every other row of a data table. Windows 98 does not stripe. */\n 'table-stripe': ref('vga-white'),\n /** A data table row under the pointer. Windows 98 does not highlight it. */\n 'table-row-hover': ref('vga-white'),\n /** The channel a progress bar or a scroll thumb runs in, and what fills it. */\n track: ref('vga-silver'),\n progress: ref('vga-navy'),\n 'scroll-thumb': ref('vga-silver'),\n /** The channel a scroll bar's thumb runs in, under its pattern. */\n 'scroll-track': ref('vga-silver'),\n /** The frame of a tooltip. */\n 'tooltip-border': ref('vga-black'),\n /**\n * The inside of a group box's frame, and the face around it — behind the\n * legend and the frame's edge. Both the window's silver in Windows 98.\n */\n groupbox: ref('vga-silver'),\n 'groupbox-face': ref('vga-silver'),\n /** A toast's ✕: the caption button's silver in Windows 98, a soft grey disc elsewhere. */\n 'toast-close': ref('vga-silver'),\n 'toast-close-foreground': ref('vga-black'),\n /** «Loading…» in a dropped list: plain text in Windows 98, the subtle grey elsewhere. */\n 'loading-foreground': ref('vga-black'),\n /** The strip that holds a searchable list's search box: the window face in Windows 98, nothing elsewhere. */\n 'select-search': ref('vga-silver'),\n /** A pager's buttons: raised command buttons in Windows 98, flat elsewhere. */\n pager: ref('vga-silver'),\n 'pager-hover': ref('vga-silver'),\n 'pager-active': ref('vga-silver'),\n /** The strip a filter bar sits on. */\n 'filter-bar': ref('vga-silver'),\n /** A filter chip: its face, its edge and its text. */\n chip: ref('vga-white'),\n 'chip-border': ref('vga-gray'),\n 'chip-foreground': ref('vga-black'),\n /** The face of a chip's ✕ at rest: the chip's own white in Windows 98. */\n 'chip-remove': ref('vga-white'),\n /**\n * The value of a read-only field that holds focus — a drop-down list's —\n * highlighted the way Windows 98 marks it, and the text on it.\n */\n 'field-highlight': ref('vga-navy'),\n 'on-field-highlight': ref('vga-white'),\n /** The text caret in a field. */\n 'field-caret': ref('vga-black'),\n /** The buttons inside a field: a select's drop button, a number's spin buttons. */\n 'field-button': ref('vga-silver'),\n} as const\n\n/** Names of every semantic colour token. */\nexport type SemanticColorName = keyof typeof semanticColor\n","/**\n * Corner radii, derived from one variable.\n *\n * Every step is a multiple of `--radius`, following the reference scale. One\n * declaration retunes every corner in the library:\n *\n * ```css\n * :root { --radius: 0.25rem; }\n * ```\n *\n * The factors are the source of truth, not the resulting lengths. Two things\n * are generated from them and cannot drift: {@link radius}, which resolves to\n * real `rem` values so a TypeScript consumer gets a number it can use, and\n * {@link radiusCss}, which keeps the `calc()` so a consumer's override of\n * `--radius` still cascades through the whole scale.\n */\n\n/**\n * The single length the scale multiplies.\n *\n * Zero: Windows 98 has no rounded corners, and every `radius/*` token in the\n * design is 0. The scale is kept rather than deleted so that corners stay one\n * decision away — set `--radius` in a consumer and every control follows,\n * without touching a component.\n */\nexport const radiusBase = '0rem'\n\n/**\n * Multiples of `--radius`. All of them compute to 0 with the default base;\n * the factors decide how a consumer's own `--radius` spreads across controls.\n */\nexport const radiusFactor = {\n /** Always square, whatever `--radius` is: table cells, anything that tiles. */\n none: 0,\n /** Checkboxes and tags inside a cell. */\n xs: 0.4,\n /** Badges and small controls. */\n sm: 0.6,\n /** Buttons, inputs and panels. */\n md: 0.8,\n /** Windows, dialogs and popovers. */\n lg: 1,\n /** Large empty-state panels. */\n xl: 1.4,\n} as const\n\n/** A radius that is not a multiple of the base. */\nconst PILL = '9999px'\n\n/**\n * Resolved lengths, for TypeScript consumers and for the contrast of reading\n * an actual size in the docs table.\n */\nexport const radius = {\n ...(Object.fromEntries(\n Object.entries(radiusFactor).map(([name, factor]) => [name, resolve(factor)])\n ) as { [K in keyof typeof radiusFactor]: string }),\n /** Circle. The only rounded shape Windows 98 draws: radio buttons, and a round skeleton. */\n full: PILL,\n /**\n * A capsule, where the theme draws one: a chip, a progress bar, a caption\n * button. Square in Windows 98, whatever `--radius` is.\n */\n pill: '0rem',\n} as const\n\n/**\n * The same scale as CSS expressions, for the emitted `@theme` block.\n *\n * `lg` is bare `var(--radius)` rather than `calc(var(--radius) * 1)` because\n * the multiplication is noise at a factor of one.\n */\nexport const radiusCss = {\n ...(Object.fromEntries(\n Object.entries(radiusFactor).map(([name, factor]) => [name, expression(factor)])\n ) as { [K in keyof typeof radiusFactor]: string }),\n full: PILL,\n pill: '0rem',\n} as const\n\n/** Names of every radius token. */\nexport type RadiusName = keyof typeof radius\n\nfunction resolve(factor: number): string {\n if (factor === 0) return '0rem'\n const base = Number.parseFloat(radiusBase)\n // Six places, then trailing zeros stripped: 0.5 * 1.4 is clean in decimal\n // but floating point still needs the round-trip so docs stay readable.\n return `${Number((base * factor).toFixed(6))}rem`\n}\n\nfunction expression(factor: number): string {\n if (factor === 0) return '0rem'\n if (factor === 1) return 'var(--radius)'\n return `calc(var(--radius) * ${factor})`\n}\n","/**\n * Bevels, and the two structural shadows a data table needs.\n *\n * Windows 98 has no elevation. Depth is drawn with bevels: two 1px lines on\n * each side of a box, light on the top-left and dark on the bottom-right for a\n * raised surface, the other way round for a sunken one. Each bevel here is a\n * stack of hard inset shadows — no blur, no spread — built from the four\n * `bevel-*` colours, so the frame lives inside the box and never changes its\n * size.\n *\n * The first shadow in the list paints on top, so the 1px outer edge is listed\n * before the 2px inner one it overlaps. The values match the effect styles in\n * the Figma file one for one.\n */\n\nconst hl = 'var(--color-bevel-highlight)'\nconst light = 'var(--color-bevel-light)'\nconst sh = 'var(--color-bevel-shadow)'\nconst dark = 'var(--color-bevel-dark)'\n\n/** Builds an inset bevel from its outer and inner edge colours. */\nfunction bevel(outer: [string, string], inner?: [string, string]): string {\n const [outerTopLeft, outerBottomRight] = outer\n const layers = [`inset -1px -1px ${outerBottomRight}`, `inset 1px 1px ${outerTopLeft}`]\n if (inner) {\n const [innerTopLeft, innerBottomRight] = inner\n layers.push(`inset -2px -2px ${innerBottomRight}`, `inset 2px 2px ${innerTopLeft}`)\n }\n return layers.join(', ')\n}\n\nexport const shadow = {\n /** No bevel. */\n none: 'none',\n /** Buttons and raised panels. */\n raised: bevel([hl, dark], [light, sh]),\n /** A window's frame: like `raised`, with the bright white on the inner edge. */\n window: bevel([light, dark], [hl, sh]),\n /**\n * The default button of a dialog: a 1px black frame around a raised bevel,\n * so Enter's target is visible before anyone presses it.\n */\n 'raised-default': [\n `inset -1px -1px ${dark}`,\n `inset 1px 1px ${dark}`,\n `inset -2px -2px ${dark}`,\n `inset 2px 2px ${hl}`,\n `inset -3px -3px ${sh}`,\n `inset 3px 3px ${light}`,\n ].join(', '),\n /** A button held down, or a toggle that is on. */\n pressed: bevel([dark, hl], [sh, light]),\n /** Text fields, lists and table bodies: the white well a value sits in. */\n sunken: bevel([sh, hl], [dark, light]),\n /** A thin sunken edge: status-bar sections, counters, Badge. */\n status: bevel([sh, hl]),\n /** An etched groove: group boxes and separators. */\n etched: bevel([sh, hl], [hl, sh]),\n /** A thin raised edge: a flat toolbar button while hovered. */\n 'raised-thin': bevel([hl, sh]),\n\n // Roles. In Windows 98 each is one of the bevels above, or nothing; they are\n // separate tokens so a theme without bevels can draw each part its own way.\n\n /** A list dropped from a trigger. Windows 98 frames it with a border, not a shadow. */\n popover: 'none',\n /** A data table's frame: the sunken well its rows sit in. */\n table: bevel([sh, hl], [dark, light]),\n /** A data table's column header: a raised button. */\n header: bevel([hl, dark], [light, sh]),\n /** A window's caption button. */\n caption: bevel([hl, dark], [light, sh]),\n /** The strip of a status bar, behind its sections. */\n statusbar: 'none',\n /** The edge between a title bar and the window under it. */\n titlebar: 'none',\n /** A checked check box: the same sunken well as an unchecked one, in Windows 98. */\n checked: bevel([sh, hl], [dark, light]),\n /** A button inside a field while held, or while its list is open: pressed in, in Windows 98. */\n 'field-button-pressed': bevel([dark, hl], [sh, light]),\n /** A flat toolbar button that is latched on: pressed in, in Windows 98. */\n 'latched-ghost': bevel([dark, hl], [sh, light]),\n /** A checked check box in a selected table row: its usual well, in Windows 98. */\n 'checked-selected': bevel([sh, hl], [dark, light]),\n /** A toast's ✕: a caption button, raised, in Windows 98. */\n 'toast-close': bevel([hl, dark], [light, sh]),\n /**\n * A pager's buttons: a raised command button, its focused frame, and pressed\n * in while held or while it is the current page. Flat in a theme that draws\n * the pager as a row of plain numbers.\n */\n pager: bevel([hl, dark], [light, sh]),\n 'pager-focus': [\n `inset -1px -1px ${dark}`,\n `inset 1px 1px ${dark}`,\n `inset -2px -2px ${dark}`,\n `inset 2px 2px ${hl}`,\n `inset -3px -3px ${sh}`,\n `inset 3px 3px ${light}`,\n ].join(', '),\n 'pager-pressed': bevel([dark, hl], [sh, light]),\n /** A button inside a field: raised, in Windows 98. */\n 'field-button': bevel([hl, dark], [light, sh]),\n /** A scroll bar's thumb. */\n 'scroll-thumb': bevel([hl, dark], [light, sh]),\n\n /** The edge of a sticky table column while rows scroll under it. */\n 'scroll-x': `inset -1px 0 ${sh}`,\n /**\n * The rule under a sticky table header, drawn as a shadow rather than a\n * border.\n *\n * Under `border-collapse` a border belongs to the table's grid, not to any\n * cell, so a `position: sticky` header leaves its border behind and scrolls\n * away from it — the rows then slide under a header with nothing between\n * them, which is the one thing a sticky header exists to prevent. A shadow\n * belongs to the element and travels with it.\n */\n 'sticky-header': 'inset 0 -1px 0 var(--color-border)',\n} as const\n\n/** Names of every shadow token. */\nexport type ShadowName = keyof typeof shadow\n\n/**\n * Text shadows. One: the emboss that makes disabled text read as disabled\n * rather than as faint — grey text with a white copy one pixel right and\n * down. Windows 98 never fades a disabled control with opacity.\n */\nexport const textShadow = {\n disabled: '1px 1px 0 var(--color-text-disabled-emboss)',\n} as const\n\n/** Names of every text shadow token. */\nexport type TextShadowName = keyof typeof textShadow\n","/**\n * Component sizes: the heights, widths and insets a theme sets.\n *\n * Emitted into Tailwind's spacing namespace (`--spacing-control-md`), so every\n * sizing utility reads them by name — `h-control-md`, `min-w-button-md`,\n * `size-check`, `p-frame` — and a theme that changes a value changes every\n * control drawn with it.\n *\n * The values here are Windows 98's, in CSS pixels: the sizes the Figma file\n * draws at Large Fonts. They are pixels rather than rems on purpose. A bevel is\n * drawn in whole pixels, and a control whose height scaled with the root font\n * size would land on fractional pixels and blur its edges.\n */\nexport const size = {\n /** Control heights: buttons, fields, selects. Also the side of a square icon button's row. */\n 'control-xs': '21px',\n 'control-sm': '26px',\n 'control-md': '28px',\n 'control-lg': '33px',\n\n /** Square icon buttons. A touch wider than the row they sit in, as Windows 98 drew them. */\n 'icon-xs': '25px',\n 'icon-sm': '27px',\n 'icon-md': '30px',\n 'icon-lg': '34px',\n\n /** A button's minimum width, so a short label still makes a button worth aiming at. */\n 'button-min-xs': '3rem',\n 'button-min-sm': '4rem',\n 'button-min-md': '92px',\n 'button-min-lg': '108px',\n\n /** A button's side padding. */\n 'button-px-xs': '0.375rem',\n 'button-px-sm': '0.5rem',\n 'button-px-md': '0.75rem',\n 'button-px-lg': '1rem',\n\n /** A field's side padding, inside its edge. */\n 'field-px': '0.25rem',\n 'field-px-lg': '0.375rem',\n\n /**\n * A field's spacing: between label, control and message at each size, between\n * a label and the control beside it, and between the error icon and its text.\n */\n 'field-gap-sm': '0.25rem',\n 'field-gap-md': '0.375rem',\n 'field-gap-lg': '0.5rem',\n 'field-left-gap': '0.5rem',\n 'field-error-gap': '0.25rem',\n\n /** The side of a checkbox's box, and of an option button. */\n check: '13px',\n radio: '12px',\n /** Between a check box or option button and its label, and the label's own inset (where the dotted ring sits). */\n 'check-gap': '4px',\n 'check-label-px': '1px',\n\n /** A window's or a dialog's title bar. */\n titlebar: '22px',\n /** A caption button: minimise, maximise, close. */\n 'caption-w': '20px',\n 'caption-h': '18px',\n /** The gap between caption buttons, and the extra space before the close button. */\n 'caption-gap': '0px',\n 'caption-close-gap': '2px',\n /** A title bar's side padding. */\n 'titlebar-px': '2px',\n /**\n * Where a dialog's title starts and ends in its title bar, clear of the\n * close button. Equal values centre it.\n */\n 'title-inset-start': '4px',\n 'title-inset-end': '28px',\n\n /**\n * The frame between a window's edge and its content: the width of the bevel.\n * A theme whose windows have no bevel sets it to zero.\n */\n frame: '2px',\n\n /**\n * A dialog's insets: the side padding of its header, body and footer, the\n * room above the first line, and above and below the footer's buttons.\n */\n 'dialog-px': '0.75rem',\n 'dialog-pt': '0.75rem',\n 'dialog-footer-pt': '0.5rem',\n 'dialog-footer-pb': '0.75rem',\n\n /** One option in a list: a select's, a menu's. */\n item: '22px',\n /** An option's padding either side, the column its check mark sits in, the gap after it, and the mark. */\n 'item-pl': '2px',\n 'item-pr': '0.25rem',\n 'item-check': '12px',\n 'item-gap': '2px',\n 'item-check-glyph': '7px',\n /** The inset around a dropped list's options, inside its border: 1px in Windows 98, as Figma draws it. */\n 'popover-inset': '1px',\n\n /**\n * A data table's side padding: a header cell's, around the 1px its label's\n * focus ring takes, and a body cell's.\n */\n 'table-header-px': '0.25rem',\n 'table-cell-px': '0.375rem',\n /** Data table rows, and the header that matches them. */\n 'row-sm': '22px',\n 'row-md': '27px',\n\n /** A select's drop arrows, and how far the down arrow tucks under an up arrow above it. */\n 'select-arrow': '8px',\n 'select-arrow-overlap': '0px',\n /** «Loading…» and «No results found» in a dropped list: padding, and the gap after the busy glyph. */\n 'select-message-px': '6px',\n 'select-message-py': '6px',\n 'select-message-gap': '6px',\n /** The strip around a searchable list's search box, and the space under it. */\n 'select-search-p': '2px',\n 'select-search-gap': '0px',\n /**\n * The buttons inside a number, date or select field: their height at each\n * size, centred in the field as Figma draws them; how far they sit from the\n * field's right edge; and the date field's glyph. A select's arrows sit\n * `select-pr` in.\n */\n 'field-button-h-sm': '17px',\n 'field-button-h': '19px',\n 'field-button-h-lg': '23px',\n 'field-button-pr': '2px',\n 'field-drop-icon': '8px',\n 'select-pr': '2px',\n /** A filter bar's padding and the space between its items. */\n 'filter-bar-p': '0.25rem',\n 'filter-bar-gap': '0.25rem',\n /** A filter chip's side padding, and its right padding beside the ✕. */\n 'chip-px': '0.375rem',\n 'chip-pr-remove': '0.125rem',\n /** A toast's padding, the gap between its icon, text and ✕, and between its lines. */\n 'toast-py': '0.5rem',\n 'toast-pl': '0.5rem',\n 'toast-pr': '0.25rem',\n 'toast-gap': '0.5rem',\n 'toast-body-gap': '0.25rem',\n /** A toast's status icon, and its ✕. */\n 'toast-icon': '16px',\n 'toast-close-w': '20px',\n 'toast-close-h': '18px',\n /** A page number's side padding. */\n 'pager-px': '0.25rem',\n /**\n * A pager's arrows, the inset of the dotted focus ring round a page label,\n * and how narrow a small page button may get (Windows 98 lets it hug its\n * number; a theme can keep it square).\n */\n 'pager-arrow': '8px',\n 'pager-focus-px': '1px',\n 'pager-min-sm': '0px',\n /** A filter chip. */\n 'chip-sm': '23px',\n 'chip-md': '26px',\n\n /** A badge's side padding. */\n 'badge-px-sm': '0.25rem',\n 'badge-px-md': '0.375rem',\n /** The side of a badge's status dot. */\n 'badge-dot': '5px',\n\n /** An empty view's padding at each size, and the gap between its icon and its text at `md` and `lg`. */\n 'empty-p-sm': '0.75rem',\n 'empty-p-md': '1.5rem',\n 'empty-p-lg': '1.5rem',\n 'empty-gap': '1rem',\n\n /** A tooltip's padding. */\n 'tooltip-px': '0.25rem',\n 'tooltip-py': '1px',\n\n /** A status bar. */\n statusbar: '27px',\n /** A status bar's padding and the space between its sections; a section's side padding and the space inside it. */\n 'statusbar-px': '2px',\n 'statusbar-py': '2px',\n 'statusbar-gap': '2px',\n 'statusbar-section-px': '0.25rem',\n 'statusbar-section-gap': '0.25rem',\n\n /** A progress bar: its height, the inset around the fill, and the fill. */\n progress: '18px',\n 'progress-inset': '2px',\n 'progress-fill': '12px',\n /** One block of the fill, and the block plus the gap after it. Equal values draw a solid bar. */\n 'progress-block': '8px',\n 'progress-period': '10px',\n /** The segment an indeterminate bar moves along the track: four blocks in Windows 98. */\n 'progress-segment': '38px',\n\n /** A scroll bar's thickness, and the side of its arrow buttons (zero hides them). */\n scrollbar: '16px',\n 'scroll-button': '16px',\n /** The space between the thumb and the edge of its track. */\n 'scroll-inset': '0px',\n\n /** A group box: where its frame starts, the room above its content, and its legend's offset. */\n 'groupbox-top': '6px',\n 'groupbox-pt': '1rem',\n 'groupbox-legend-x': '0.5rem',\n 'groupbox-legend-px': '2px',\n} as const\n\n/** Names of every size token. */\nexport type SizeName = keyof typeof size\n","/**\n * Style switches: how a theme draws a state, beyond its colours and sizes.\n *\n * Windows 98 and a modern theme differ in more than values. One marks focus\n * with a dotted rectangle around a button's label, the other with a ring\n * around the whole button; one shifts a held button's label a pixel, the other\n * darkens its face; one fills a latched toggle with a checker pattern. Each of\n * those differences is a variable here, emitted as `--rk-<name>`, and the\n * components are written against the variables. A theme sets them; no\n * component knows which theme it is drawn in.\n *\n * They are not Tailwind theme tokens — nothing generates a utility from them —\n * so they are declared on `:root` and read with arbitrary values\n * (`pr-(--rk-press-shift)`) or by the utilities in `rowkit/styles`.\n *\n * The values here are Windows 98's.\n */\n\n/** The Windows 98 checker: white and silver, one pixel each, white in the top-left. */\nconst dither = [\n 'conic-gradient(',\n 'var(--color-card) 0 25%, var(--color-bevel-highlight) 0 50%, ',\n 'var(--color-card) 0 75%, var(--color-bevel-highlight) 0)',\n].join('')\n\nexport const style = {\n // Focus. Three rings, for three places a ring can go; a theme turns each on\n // or off by its width. The colours are `--color-ring` and `--color-focus-ring`.\n\n /** The ring drawn around a control's label, inside it. Windows 98's dotted rectangle. */\n 'focus-label-width': '1px',\n /** The ring drawn on the focused element itself — a row, a scrolling region, a toast. */\n 'focus-ring-width': '1px',\n 'focus-ring-style': 'dotted',\n /** The ring drawn around a control's edge, outside it. Windows 98 has none. */\n 'focus-outer-width': '0px',\n 'focus-outer-offset': '0px',\n\n // Pressing.\n\n /** How far a held button's label moves down and right. */\n 'press-shift': '1px',\n /** A brightness filter on a held caption button. `1` leaves it alone. */\n 'press-brightness': '1',\n\n // Patterns and motion.\n\n /** The pattern over a latched toggle and a scroll track. */\n 'dither-image': dither,\n /** The pattern of a loading placeholder, and how it moves. */\n 'loading-image': dither,\n 'animate-loading': 'rk-dither 800ms steps(1) infinite',\n /**\n * The busy mark in a loading button: Windows 98's hourglass stands still; a\n * theme with a spinner glyph turns it.\n */\n 'animate-busy': 'none',\n /**\n * An indeterminate progress bar's segment travelling across the track.\n * Windows 98 moves its four blocks one block every 100ms and starts again\n * at the left; `ProgressBar` sets `--rk-progress-steps` to the number of\n * steps that fit the track it measures.\n */\n 'animate-progress':\n 'rk-progress-march calc(var(--rk-progress-steps, 18) * 100ms) steps(var(--rk-progress-steps, 18)) infinite',\n /** How long a control takes to change state. Windows 98 changes instantly. */\n 'duration-control': '0ms',\n /** How a dialog, a list or a toast arrives. */\n 'animate-overlay-in': 'none',\n\n // Edges.\n\n /** The light second line of an etched separator. Zero leaves a single line. */\n 'etch-width': '1px',\n\n // Windows.\n\n /** Where the caption buttons sit in the title bar: `0` after the title, `-1` before it. */\n 'caption-order': '0',\n /** Where the close button sits among them: `0` last, `-1` first. */\n 'close-order': '0',\n /** Whether a window shows its icon in the title bar: `flex`, or `none`. */\n 'titlebar-icon': 'flex',\n /** Where the title sits: `start`, or `center`. */\n 'titlebar-align': 'start',\n /** Space kept clear opposite the caption buttons, so a centred title is centred on the bar. */\n 'titlebar-balance': '0px',\n /** The opacity of a caption button's glyph at rest; hovering the title bar shows it. */\n 'caption-glyph-opacity': '1',\n\n // Group boxes.\n\n /** The weight of a group box's legend. */\n 'legend-weight': '400',\n\n // Links.\n\n /** The line under a link-styled button: `underline`, or `none`. */\n 'link-decoration': 'underline',\n\n // Fields.\n\n /** The red frame inside an invalid field. Windows 98 marks it with the error icon only. */\n 'invalid-width': '0px',\n /** Where a field's error icon sits beside a message that wraps: `center`, or `start`. */\n 'field-error-align': 'center',\n\n /** Whether a select's drop button shows an up arrow over its down arrow: `block`, or `none`. */\n 'select-up': 'none',\n\n // Dialogs and empty views.\n\n /**\n * The order of a dialog footer's buttons, written primary first: `row` keeps\n * it, as Windows 98 does; `row-reverse` puts the primary button last.\n */\n 'footer-direction': 'row',\n /**\n * How an empty view lays out its icon and text: `row` puts the icon beside\n * the text, `column` above it; `start` or `center` aligns the text.\n */\n 'empty-direction': 'row',\n 'empty-align': 'start',\n\n // Lists and scroll bars.\n\n /** What a modal dialog lays over the page behind it. */\n 'overlay-bg': 'transparent',\n\n /** A backdrop filter behind a dropped list. */\n 'popover-backdrop': 'none',\n /**\n * A dropped list's border. Windows 98 draws a black line; a theme that\n * rings the list in its shadow (`--rk-shadow-popover`) sets it to zero.\n */\n 'popover-border-width': '1px',\n /** Whether a scroll bar has arrow buttons: `block`, or `none`. */\n 'scrollbar-buttons': 'block',\n\n // Check boxes and option buttons.\n\n /** A multiplier on small glyphs — a check mark, a caption glyph — for a theme whose glyphs are not pixel art. */\n 'glyph-scale': '1',\n /**\n * An option button drawn by CSS rather than by its pixels: how much of the\n * well and the dot to paint (`0%` paints neither), the dot's radius and the\n * edge's width.\n */\n 'radio-fill': '0%',\n 'radio-dot-r': '0px',\n 'radio-edge': '0px',\n\n // Icons. A theme can draw its own icon set over rowkit's pixel icons: it\n // hides the pixels, fills the icon's box and masks it with its own glyph.\n\n /** `display` of a pixel icon's pixels. */\n 'icon-pixels': 'inline',\n /**\n * Whether the glyphs mask the icons at all. `initial` makes every glyph mask\n * invalid, so a Windows 98 icon has no mask and nothing of it is clipped;\n * an empty value lets them through. It is prepended to each mask image.\n */\n 'icon-glyphs': 'initial',\n /** The fill a theme's own glyph is painted in; transparent draws nothing. */\n 'icon-fill': 'transparent',\n /**\n * The fills of the glyphs that keep a colour: status icons and folders.\n * Transparent in Windows 98, whose pixel icons carry their own colours.\n */\n 'icon-tone-danger': 'transparent',\n 'icon-tone-warning': 'transparent',\n 'icon-tone-info': 'transparent',\n 'icon-tone-success': 'transparent',\n 'icon-tone-folder': 'transparent',\n} as const\n\n/** Names of every style switch. */\nexport type StyleName = keyof typeof style\n","/**\n * Typography.\n *\n * Two registers, as in the design: the interface, and long text for\n * documentation. The interface is set at 13px — Windows 98's 8pt in its\n * \"Large Fonts\" mode (120 DPI), which the system offered for exactly this\n * reason: at 96 DPI 8pt is 11px, and on today's screens, whose pixels are far\n * smaller than a 1998 monitor's, 11px is too small to read for long. The sizes\n * are named after the Figma text styles (`ui/body` is `text-ui`, `doc/h1` is\n * `text-doc-h1`), so a style picked in the design maps to one utility.\n *\n * Sizes are in `rem`, so a reader who raised their browser's base size gets\n * larger text; at the default 16px base they land on the design's pixels.\n */\n\n/**\n * Font families.\n *\n * The interface face is **PT Sans** (ParaType, OFL): the closest open match\n * to Tahoma, which succeeded MS Sans Serif, and compact enough for dense\n * tables. It covers Latin and Cyrillic in regular and bold. The fixed-width\n * face is **VT323** (OFL), drawn after the Fixedsys terminal font.\n *\n * rowkit does not ship either font file: the app loads them, one import each\n * from `@fontsource/pt-sans` and `@fontsource/vt323`. Without them the stacks\n * fall through to Tahoma and the faces operating systems already ship.\n */\nexport const fontFamily = {\n /** UI and body text. */\n sans: [\n '\"PT Sans\"',\n 'Tahoma',\n '\"Microsoft Sans Serif\"',\n '\"MS Sans Serif\"',\n 'Verdana',\n 'Arial',\n 'sans-serif',\n ].join(', '),\n /** Code, IDs and numbers that must align in a column. */\n mono: ['VT323', '\"Lucida Console\"', '\"Courier New\"', 'ui-monospace', 'monospace'].join(', '),\n} as const\n\n/**\n * Font sizes, each paired with the line height the design sets it in.\n *\n * Pairing them prevents the most common typographic bug in a dense table:\n * changing the size without the leading, so rows stay tall and the density\n * the size was meant to buy evaporates.\n */\nexport const fontSize = {\n /** 13/16 — every control, label, menu and table cell. Bold for titles and the default button. */\n ui: { size: '0.8125rem', lineHeight: '1rem' },\n /** 16/20, bold — the heading of an empty state or a group. */\n heading: { size: '1rem', lineHeight: '1.25rem' },\n /**\n * 16/16 — the fixed-width face beside interface text. VT323's x-height is\n * 0.4em to PT Sans's 0.5em, so 16px VT323 stands exactly as tall as 13px\n * PT Sans.\n */\n mono: { size: '1rem', lineHeight: '1rem' },\n /** 16/26 — documentation paragraphs, about seventy characters to a line. */\n doc: { size: '1rem', lineHeight: '1.625rem' },\n /** 20/20 — code beside documentation text: as tall as 16px PT Sans, for the same reason as `mono`. */\n 'doc-mono': { size: '1.25rem', lineHeight: '1.25rem' },\n /** 26/30, bold — a documentation page title. */\n 'doc-h1': { size: '1.625rem', lineHeight: '1.875rem' },\n /** 19/24, bold — a documentation section. */\n 'doc-h2': { size: '1.1875rem', lineHeight: '1.5rem' },\n /** 15/20, bold — a documentation subsection. */\n 'doc-h3': { size: '0.9375rem', lineHeight: '1.25rem' },\n} as const\n\n/**\n * Font weights. Two, because PT Sans has two: anything in between would be\n * synthesised by the browser, and a faked weight is blurrier than either real\n * one.\n */\nexport const fontWeight = {\n /** Body text. */\n normal: '400',\n /** Window titles, headings, the default button. */\n bold: '700',\n /**\n * The weight a theme gives emphasis: titles, headings, a table's totals.\n * Components use this rather than `bold`, so a theme can make emphasis\n * semibold without changing what `font-bold` means in the app around it.\n */\n strong: '700',\n} as const\n\n/** Letter spacing. Windows 98 sets every size at the face's own spacing. */\nexport const letterSpacing = {\n normal: '0em',\n} as const\n\n/** Standalone line heights, for when text is not using a paired {@link fontSize}. */\nexport const lineHeight = {\n none: '1',\n tight: '1.25',\n snug: '1.375',\n normal: '1.5',\n relaxed: '1.625',\n} as const\n\n/** Names of every font size token. */\nexport type FontSizeName = keyof typeof fontSize\n","import type { SemanticColorName } from '../color'\nimport type { RadiusName } from '../radius'\nimport type { ShadowName } from '../shadow'\nimport type { SizeName } from '../size'\nimport type { StyleName } from '../style'\n\n/**\n * The modern theme: the look of a current desktop operating system. White and\n * light-grey surfaces, a blue accent, rounded corners, soft shadows, a ring\n * around the focused control and short transitions. Light and dark.\n *\n * Switched on with `data-theme=\"modern\"` on any element, `<html>` included.\n * The colour scheme follows the system unless `data-color-scheme=\"light\"` or\n * `\"dark\"` on the same element fixes it.\n *\n * The values follow the designer's Figma file, mode for mode.\n */\n\n/** The modern palette. Eight-digit values carry alpha. */\nexport const modernPalette = {\n white: '#ffffff',\n black: '#000000',\n transparent: '#00000000',\n\n 'gray-50': '#f9f9fb',\n 'gray-100': '#f5f5f7',\n 'gray-150': '#efeff2',\n 'gray-200': '#e8e8ed',\n 'gray-250': '#e0e0e5',\n 'gray-300': '#d2d2d7',\n 'gray-400': '#aeaeb2',\n 'gray-500': '#86868b',\n 'gray-600': '#6e6e73',\n 'gray-700': '#515154',\n 'gray-750': '#48484a',\n 'gray-800': '#3a3a3c',\n 'gray-850': '#2c2c2e',\n 'gray-900': '#1d1d1f',\n 'gray-925': '#1c1c1e',\n 'gray-950': '#161617',\n\n blue: '#0071e3',\n 'blue-hover': '#0068d6',\n 'blue-active': '#0062c4',\n 'blue-link': '#0066cc',\n 'blue-link-dark': '#2997ff',\n 'blue-subtle': '#e8f1fc',\n 'blue-subtle-dark': '#0f2a47',\n 'blue-text': '#0058b0',\n 'blue-text-dark': '#6cb4ff',\n 'blue-border': '#b3d1f5',\n 'blue-border-dark': '#1f4b7a',\n 'blue-ring': '#0071e3cc',\n 'blue-ring-dark': '#2997ffcc',\n\n green: '#1f7a35',\n 'green-hover': '#1a6a2e',\n 'green-subtle': '#e7f6eb',\n 'green-subtle-dark': '#12301b',\n 'green-text': '#1b6e31',\n 'green-text-dark': '#5fd47e',\n 'green-border': '#b4e2c0',\n 'green-border-dark': '#245c33',\n\n orange: '#ff9f0a',\n 'orange-hover': '#f59300',\n 'orange-subtle': '#fff4e0',\n 'orange-subtle-dark': '#3a2a0c',\n 'orange-text': '#8a4b00',\n 'orange-text-dark': '#ffbe5c',\n 'orange-border': '#ffd59a',\n 'orange-border-dark': '#6b4a12',\n\n red: '#d70015',\n 'red-hover': '#c00013',\n 'red-subtle': '#fdeaea',\n 'red-subtle-dark': '#3d1416',\n 'red-text': '#b0000f',\n 'red-text-dark': '#ffa0a4',\n 'red-border': '#f5b5b9',\n 'red-border-dark': '#7a2329',\n\n 'traffic-red': '#ff5f57',\n 'traffic-yellow': '#febc2e',\n 'traffic-green': '#28c840',\n\n 'ink-4': '#0000000a',\n 'ink-6': '#0000000f',\n 'ink-8': '#00000014',\n 'ink-10': '#0000001a',\n 'ink-12': '#0000001f',\n 'ink-15': '#00000026',\n 'ink-25': '#00000040',\n 'ink-50': '#00000080',\n 'light-4': '#ffffff0a',\n 'light-8': '#ffffff14',\n 'light-12': '#ffffff1f',\n 'light-16': '#ffffff29',\n 'light-25': '#ffffff40',\n 'light-50': '#ffffff80',\n\n 'glass-light': '#ffffffd9',\n 'glass-dark': '#323234e0',\n 'desktop-light': '#c7d3e6',\n 'desktop-dark': '#101014',\n} as const\n\nexport type ModernPaletteName = keyof typeof modernPalette\n\nconst p = (name: ModernPaletteName) => `var(--color-modern-${name})` as const\n\n/** Semantic colours, light. Every semantic token is listed: the theme leaves nothing to Windows 98. */\nexport const modernLightColor: Record<SemanticColorName, string> = {\n background: p('gray-100'),\n desktop: p('desktop-light'),\n card: p('white'),\n muted: p('gray-100'),\n accent: p('ink-4'),\n 'surface-active': p('gray-200'),\n 'surface-selected': p('blue'),\n 'surface-disabled': p('gray-100'),\n skeleton: p('gray-200'),\n input: p('white'),\n 'tooltip-bg': p('gray-100'),\n\n foreground: p('gray-900'),\n 'muted-foreground': p('gray-700'),\n 'text-subtle': p('gray-600'),\n 'text-disabled': p('gray-400'),\n 'text-disabled-emboss': p('transparent'),\n 'on-selected': p('white'),\n link: p('blue-link'),\n\n border: p('gray-300'),\n 'border-strong': p('gray-500'),\n 'border-subtle': p('gray-200'),\n ring: p('blue'),\n shadow: p('black'),\n 'bevel-highlight': p('transparent'),\n 'bevel-light': p('gray-300'),\n 'bevel-shadow': p('gray-300'),\n 'bevel-dark': p('gray-500'),\n\n 'titlebar-from': p('gray-50'),\n 'titlebar-to': p('gray-50'),\n 'titlebar-inactive-from': p('gray-100'),\n 'titlebar-inactive-to': p('gray-100'),\n 'titlebar-foreground': p('gray-900'),\n 'titlebar-inactive-foreground': p('gray-600'),\n\n 'neutral-solid': p('gray-600'),\n 'neutral-solid-hover': p('gray-700'),\n 'neutral-on-solid': p('white'),\n 'neutral-subtle': p('gray-100'),\n 'neutral-on-subtle': p('gray-800'),\n 'neutral-border': p('gray-300'),\n\n 'primary-solid': p('blue'),\n 'primary-solid-hover': p('blue-active'),\n 'primary-on-solid': p('white'),\n 'primary-subtle': p('blue-subtle'),\n 'primary-on-subtle': p('blue-text'),\n 'primary-border': p('blue-border'),\n\n 'success-solid': p('green'),\n 'success-solid-hover': p('green-hover'),\n 'success-on-solid': p('white'),\n 'success-subtle': p('green-subtle'),\n 'success-on-subtle': p('green-text'),\n 'success-border': p('green-border'),\n\n 'warning-solid': p('orange'),\n 'warning-solid-hover': p('orange-hover'),\n 'warning-on-solid': p('gray-900'),\n 'warning-subtle': p('orange-subtle'),\n 'warning-on-subtle': p('orange-text'),\n 'warning-border': p('orange-border'),\n\n 'danger-solid': p('red'),\n 'danger-solid-hover': p('red-hover'),\n 'danger-on-solid': p('white'),\n 'danger-subtle': p('red-subtle'),\n 'danger-on-subtle': p('red-text'),\n 'danger-border': p('red-border'),\n\n control: p('white'),\n 'control-foreground': p('gray-900'),\n 'control-hover': p('gray-50'),\n 'control-active': p('gray-200'),\n 'control-primary': p('blue'),\n 'control-primary-foreground': p('white'),\n 'control-primary-hover': p('blue-hover'),\n 'control-primary-active': p('blue-active'),\n 'control-ghost-hover': p('ink-6'),\n 'control-ghost-active': p('ink-10'),\n 'control-latched': p('gray-200'),\n 'control-primary-latched': p('blue-active'),\n checked: p('blue'),\n 'on-checked': p('white'),\n popover: p('glass-light'),\n 'popover-border': p('ink-10'),\n 'focus-ring': p('blue-ring'),\n caption: p('gray-300'),\n 'caption-foreground': p('ink-50'),\n 'caption-close': p('traffic-red'),\n 'caption-minimize': p('traffic-yellow'),\n 'caption-maximize': p('traffic-green'),\n 'caption-inactive': p('gray-300'),\n 'table-header': p('white'),\n 'table-header-foreground': p('gray-600'),\n 'table-stripe': p('gray-50'),\n 'table-row-hover': p('ink-4'),\n track: p('gray-200'),\n progress: p('blue'),\n 'scroll-thumb': p('ink-25'),\n 'scroll-track': p('transparent'),\n 'tooltip-border': p('ink-15'),\n groupbox: p('ink-4'),\n 'groupbox-face': p('transparent'),\n 'field-button': p('transparent'),\n 'field-caret': p('blue'),\n 'field-highlight': p('transparent'),\n 'on-field-highlight': p('gray-900'),\n pager: p('transparent'),\n 'toast-close': p('ink-6'),\n 'toast-close-foreground': p('gray-700'),\n 'loading-foreground': p('gray-600'),\n 'select-search': p('transparent'),\n 'pager-hover': p('ink-6'),\n 'pager-active': p('ink-10'),\n 'filter-bar': p('transparent'),\n chip: p('blue-subtle'),\n 'chip-border': p('blue-border'),\n 'chip-foreground': p('blue-text'),\n 'chip-remove': p('ink-6'),\n}\n\n/** Semantic colours, dark. */\nexport const modernDarkColor: Record<SemanticColorName, string> = {\n ...modernLightColor,\n background: p('gray-925'),\n desktop: p('desktop-dark'),\n card: p('gray-850'),\n muted: p('gray-850'),\n accent: p('light-4'),\n 'surface-active': p('gray-800'),\n 'surface-disabled': p('gray-850'),\n skeleton: p('gray-800'),\n input: p('gray-925'),\n 'tooltip-bg': p('gray-800'),\n\n foreground: p('gray-100'),\n 'muted-foreground': p('gray-250'),\n 'text-subtle': p('gray-400'),\n 'text-disabled': p('gray-500'),\n link: p('blue-link-dark'),\n\n border: p('gray-750'),\n 'border-strong': p('gray-500'),\n 'border-subtle': p('gray-850'),\n ring: p('blue-link-dark'),\n 'bevel-light': p('gray-750'),\n 'bevel-shadow': p('gray-750'),\n 'bevel-dark': p('gray-600'),\n\n 'titlebar-from': p('gray-850'),\n 'titlebar-to': p('gray-850'),\n 'titlebar-inactive-from': p('gray-925'),\n 'titlebar-inactive-to': p('gray-925'),\n 'titlebar-foreground': p('gray-100'),\n 'titlebar-inactive-foreground': p('gray-500'),\n\n 'neutral-solid': p('gray-600'),\n 'neutral-solid-hover': p('gray-700'),\n 'neutral-subtle': p('gray-800'),\n 'neutral-on-subtle': p('gray-150'),\n 'neutral-border': p('gray-750'),\n\n 'primary-subtle': p('blue-subtle-dark'),\n 'primary-on-subtle': p('blue-text-dark'),\n 'primary-border': p('blue-border-dark'),\n chip: p('blue-subtle-dark'),\n 'chip-border': p('blue-border-dark'),\n 'chip-foreground': p('blue-text-dark'),\n 'chip-remove': p('light-8'),\n 'pager-hover': p('light-8'),\n 'toast-close': p('light-8'),\n 'toast-close-foreground': p('gray-250'),\n 'loading-foreground': p('gray-400'),\n 'select-search': p('transparent'),\n 'on-field-highlight': p('gray-100'),\n 'pager-active': p('light-12'),\n 'success-subtle': p('green-subtle-dark'),\n 'success-on-subtle': p('green-text-dark'),\n 'success-border': p('green-border-dark'),\n 'warning-subtle': p('orange-subtle-dark'),\n 'warning-on-subtle': p('orange-text-dark'),\n 'warning-border': p('orange-border-dark'),\n 'danger-subtle': p('red-subtle-dark'),\n 'danger-on-subtle': p('red-text-dark'),\n 'danger-border': p('red-border-dark'),\n\n control: p('gray-750'),\n 'control-foreground': p('gray-100'),\n 'control-hover': p('gray-700'),\n 'control-active': p('gray-600'),\n 'control-ghost-hover': p('light-8'),\n 'control-ghost-active': p('light-12'),\n 'control-latched': p('gray-700'),\n 'control-primary-latched': p('blue-active'),\n popover: p('glass-dark'),\n 'popover-border': p('light-12'),\n 'focus-ring': p('blue-ring-dark'),\n caption: p('gray-700'),\n 'caption-inactive': p('gray-700'),\n 'table-header': p('gray-925'),\n 'table-header-foreground': p('gray-500'),\n 'table-stripe': p('light-4'),\n 'table-row-hover': p('light-4'),\n track: p('gray-800'),\n progress: p('blue-link-dark'),\n 'scroll-thumb': p('light-25'),\n 'tooltip-border': p('light-12'),\n groupbox: p('light-4'),\n}\n\n/** Shadows, light. Soft and outside the box, where Windows 98's bevels are hard and inside it. */\nexport const modernLightShadow: Record<ShadowName, string> = {\n none: 'none',\n raised: `0 0 0 1px ${p('ink-12')}, 0 1px 2px ${p('ink-10')}`,\n window: `0 0 0 1px ${p('ink-12')}, 0 2px 6px ${p('ink-10')}, 0 16px 40px ${p('ink-25')}`,\n 'raised-default': `0 0 0 1px ${p('ink-10')}, 0 1px 2px ${p('ink-15')}`,\n pressed: `0 0 0 1px ${p('ink-15')}`,\n sunken: `inset 0 0 0 1px ${p('gray-500')}, inset 0 1px 1px ${p('ink-4')}`,\n status: 'none',\n etched: `inset 0 0 0 1px ${p('ink-8')}`,\n 'raised-thin': 'none',\n popover: `0 0 0 1px ${p('ink-10')}, 0 10px 30px ${p('ink-15')}`,\n table: `inset 0 0 0 1px ${p('gray-300')}`,\n header: `inset 0 -1px 0 ${p('gray-300')}`,\n caption: `inset 0 0 0 0.5px ${p('ink-15')}`,\n statusbar: `inset 0 1px 0 ${p('gray-300')}`,\n titlebar: `inset 0 -1px 0 ${p('gray-250')}`,\n 'scroll-thumb': 'none',\n 'field-button': 'none',\n 'latched-ghost': 'none',\n 'field-button-pressed': 'none',\n pager: 'none',\n 'toast-close': 'none',\n 'checked-selected': `inset 0 0 0 1.5px ${p('white')}`,\n 'pager-focus': 'none',\n 'pager-pressed': 'none',\n checked: `inset 0 0 0 1px ${p('ink-10')}`,\n 'scroll-x': `inset -1px 0 ${p('gray-300')}`,\n 'sticky-header': `inset 0 -1px 0 ${p('gray-300')}`,\n}\n\n/** Shadows, dark: edges drawn in light ink, because a dark shadow on a dark page shows nothing. */\nexport const modernDarkShadow: Record<ShadowName, string> = {\n ...modernLightShadow,\n raised: `0 0 0 1px ${p('ink-50')}, inset 0 1px 0 ${p('light-12')}`,\n window: `0 0 0 1px ${p('light-12')}, 0 16px 40px ${p('ink-50')}`,\n 'raised-default': `0 0 0 1px ${p('ink-50')}, inset 0 1px 0 ${p('light-16')}`,\n pressed: `0 0 0 1px ${p('ink-50')}`,\n sunken: `inset 0 0 0 1px ${p('gray-500')}`,\n etched: `inset 0 0 0 1px ${p('light-8')}`,\n popover: `0 0 0 1px ${p('light-12')}, 0 10px 30px ${p('ink-50')}`,\n table: `inset 0 0 0 1px ${p('gray-750')}`,\n header: `inset 0 -1px 0 ${p('gray-750')}`,\n caption: `inset 0 0 0 0.5px ${p('ink-25')}`,\n statusbar: `inset 0 1px 0 ${p('gray-750')}`,\n titlebar: `inset 0 -1px 0 ${p('ink-50')}`,\n 'scroll-x': `inset -1px 0 ${p('gray-750')}`,\n 'sticky-header': `inset 0 -1px 0 ${p('gray-750')}`,\n}\n\n/** Sizes. Roomier than Windows 98's, for a pointer and a finger alike. */\nexport const modernSize: Record<SizeName, string> = {\n 'control-xs': '24px',\n 'control-sm': '28px',\n 'control-md': '32px',\n 'control-lg': '40px',\n 'icon-xs': '24px',\n 'icon-sm': '28px',\n 'icon-md': '32px',\n 'icon-lg': '40px',\n 'button-min-xs': '0px',\n 'button-min-sm': '0px',\n 'button-min-md': '72px',\n 'button-min-lg': '88px',\n 'button-px-xs': '0.5rem',\n 'button-px-sm': '0.625rem',\n 'button-px-md': '0.875rem',\n 'button-px-lg': '1.125rem',\n 'field-px': '0.5rem',\n 'field-px-lg': '0.75rem',\n 'field-gap-sm': '6px',\n 'field-gap-md': '6px',\n 'field-gap-lg': '6px',\n 'field-left-gap': '12px',\n 'field-error-gap': '6px',\n check: '16px',\n radio: '16px',\n 'check-gap': '8px',\n 'check-label-px': '0px',\n titlebar: '38px',\n 'caption-w': '12px',\n 'caption-h': '12px',\n 'caption-gap': '8px',\n 'caption-close-gap': '0px',\n 'titlebar-px': '12px',\n 'title-inset-start': '72px',\n 'title-inset-end': '72px',\n frame: '0px',\n 'dialog-px': '20px',\n 'dialog-pt': '16px',\n 'dialog-footer-pt': '14px',\n 'dialog-footer-pb': '20px',\n item: '28px',\n 'item-pl': '6px',\n 'item-pr': '8px',\n 'item-check': '16px',\n 'item-gap': '4px',\n 'item-check-glyph': '12px',\n 'popover-inset': '5px',\n 'table-header-px': '7px',\n 'table-cell-px': '8px',\n 'row-sm': '30px',\n 'row-md': '36px',\n 'select-arrow': '9px',\n 'select-arrow-overlap': '2px',\n 'select-message-px': '8px',\n 'select-message-py': '5px',\n 'select-message-gap': '8px',\n 'select-search-p': '3px 3px 2px',\n 'select-search-gap': '4px',\n 'field-button-h-sm': '17px',\n 'field-button-h': '19px',\n 'field-button-h-lg': '23px',\n 'field-button-pr': '4px',\n 'select-pr': '6px',\n 'field-drop-icon': '16px',\n 'filter-bar-p': '0px',\n 'filter-bar-gap': '8px',\n 'chip-px': '10px',\n 'chip-pr-remove': '4px',\n 'pager-px': '6px',\n 'pager-arrow': '10px',\n 'pager-focus-px': '0px',\n 'pager-min-sm': '24px',\n 'toast-py': '12px',\n 'toast-pl': '12px',\n 'toast-pr': '10px',\n 'toast-gap': '10px',\n 'toast-body-gap': '2px',\n 'toast-icon': '18px',\n 'toast-close-w': '18px',\n 'toast-close-h': '18px',\n 'chip-sm': '24px',\n 'chip-md': '28px',\n 'badge-px-sm': '7px',\n 'badge-px-md': '8px',\n 'badge-dot': '6px',\n 'empty-p-sm': '16px',\n 'empty-p-md': '32px',\n 'empty-p-lg': '48px',\n 'empty-gap': '12px',\n 'tooltip-px': '0.5rem',\n 'tooltip-py': '3px',\n statusbar: '28px',\n 'statusbar-px': '12px',\n 'statusbar-py': '3px',\n 'statusbar-gap': '16px',\n 'statusbar-section-px': '0px',\n 'statusbar-section-gap': '6px',\n progress: '6px',\n 'progress-inset': '0px',\n 'progress-fill': '6px',\n 'progress-block': '1px',\n 'progress-period': '1px',\n 'progress-segment': '30%',\n scrollbar: '10px',\n 'scroll-button': '0px',\n 'scroll-inset': '2px',\n 'groupbox-top': '22px',\n 'groupbox-pt': '2.25rem',\n 'groupbox-legend-x': '0px',\n 'groupbox-legend-px': '0px',\n}\n\n/** Corner radii, set directly: each is a length here, not a multiple of `--radius`. */\nexport const modernRadius: Record<Exclude<RadiusName, 'full'>, string> = {\n none: '0px',\n xs: '4px',\n sm: '5px',\n md: '7px',\n lg: '10px',\n xl: '12px',\n pill: '9999px',\n}\n\n/** Style switches. */\nexport const modernStyle: Record<StyleName, string> = {\n 'focus-label-width': '0px',\n 'focus-ring-width': '2px',\n 'focus-ring-style': 'solid',\n 'focus-outer-width': '3px',\n 'focus-outer-offset': '0px',\n 'press-shift': '0px',\n 'press-brightness': '0.85',\n 'dither-image': 'none',\n 'loading-image': 'none',\n 'animate-loading': 'rk-pulse 1.6s ease-in-out infinite',\n 'animate-busy': 'rk-spin 0.8s linear infinite',\n 'animate-progress': 'rk-progress-slide 1.2s ease-in-out infinite',\n 'duration-control': '120ms',\n 'animate-overlay-in': 'rk-overlay-in 160ms cubic-bezier(0, 0, 0.2, 1)',\n 'etch-width': '0px',\n 'caption-order': '-1',\n 'close-order': '-1',\n 'overlay-bg': 'var(--color-modern-ink-15)',\n 'legend-weight': '600',\n 'link-decoration': 'none',\n 'invalid-width': '1px',\n 'field-error-align': 'start',\n 'select-up': 'block',\n 'footer-direction': 'row-reverse',\n 'empty-direction': 'column',\n 'empty-align': 'center',\n 'titlebar-icon': 'none',\n 'titlebar-align': 'center',\n 'titlebar-balance': '60px',\n 'caption-glyph-opacity': '0',\n 'popover-backdrop': 'blur(24px) saturate(180%)',\n 'popover-border-width': '0px',\n 'scrollbar-buttons': 'none',\n 'glyph-scale': '1.4',\n 'radio-fill': '100%',\n 'radio-dot-r': '3px',\n 'radio-edge': '1px',\n 'icon-pixels': 'none',\n 'icon-glyphs': ' ',\n 'icon-fill': 'currentColor',\n 'icon-tone-danger': 'var(--color-danger-solid)',\n 'icon-tone-warning': 'var(--color-warning-solid)',\n 'icon-tone-info': 'var(--color-primary-solid)',\n 'icon-tone-success': 'var(--color-success-solid)',\n 'icon-tone-folder': 'var(--color-primary-solid)',\n}\n\n/** Typefaces: the platform's own. Nothing to load. */\nexport const modernFont = {\n sans: [\n '-apple-system',\n 'BlinkMacSystemFont',\n '\"SF Pro Text\"',\n '\"Inter\"',\n '\"Segoe UI\"',\n 'system-ui',\n 'sans-serif',\n ].join(', '),\n mono: ['ui-monospace', '\"SF Mono\"', 'Menlo', 'Consolas', 'monospace'].join(', '),\n} as const\n\n/** Type sizes that differ from Windows 98's. Size and line height, as in `fontSize`. */\nexport const modernFontSize = {\n ui: { size: '0.8125rem', lineHeight: '1.125rem' },\n heading: { size: '0.9375rem', lineHeight: '1.25rem' },\n mono: { size: '0.75rem', lineHeight: '1.125rem' },\n 'doc-mono': { size: '0.875rem', lineHeight: '1.375rem' },\n} as const\n\n/** Font weights that differ: emphasis is semibold. */\nexport const modernFontWeight = {\n strong: '600',\n} as const\n","import { semanticColor, type SemanticColorName } from '../color'\nimport { radiusCss, type RadiusName } from '../radius'\nimport { shadow, type ShadowName } from '../shadow'\nimport { size, type SizeName } from '../size'\nimport { style, type StyleName } from '../style'\nimport { fontFamily, fontSize, fontWeight } from '../typography'\nimport {\n modernDarkColor,\n modernDarkShadow,\n modernFont,\n modernFontSize,\n modernFontWeight,\n modernLightColor,\n modernLightShadow,\n modernRadius,\n modernSize,\n modernStyle,\n} from './modern'\n\nexport {\n modernDarkColor,\n modernDarkShadow,\n modernFont,\n modernFontSize,\n modernFontWeight,\n modernLightColor,\n modernLightShadow,\n modernPalette,\n modernRadius,\n modernSize,\n modernStyle,\n} from './modern'\nexport type { ModernPaletteName } from './modern'\n\n/** The themes rowkit ships. `win98` is the default: what `:root` carries. */\nexport const themeNames = ['win98', 'modern'] as const\nexport type ThemeName = (typeof themeNames)[number]\n\n/** A theme as the stylesheet declares it: custom property name → value. */\nexport type ThemeVars = Record<`--${string}`, string>\n\n/**\n * The name of every variable a theme may set: the keys of {@link win98Vars},\n * spelled out so an editor completes them and a typo fails the type check.\n */\nexport type ThemeTokenName =\n | `--color-${SemanticColorName}`\n | `--rk-shadow-${ShadowName}`\n | `--spacing-${SizeName}`\n | `--radius-${Exclude<RadiusName, 'full'>}`\n | `--rk-${StyleName}`\n | '--font-sans'\n | '--font-mono'\n | `--text-${keyof typeof modernFontSize}`\n | `--text-${keyof typeof modernFontSize}--line-height`\n | '--font-weight-strong'\n\n/** Values for some of a theme's variables, by name: what {@link defineTheme} takes. */\nexport type ThemeValues = Partial<Record<ThemeTokenName, string>>\n\n/** Prefixes every key of a scale, turning it into custom property names. */\nfunction vars(scale: Record<string, string>, prefix: `--${string}`): ThemeVars {\n const out: ThemeVars = {}\n for (const [key, value] of Object.entries(scale)) out[`${prefix}${key}`] = value\n return out\n}\n\nfunction fontSizeVars(scale: Record<string, { size: string; lineHeight: string }>): ThemeVars {\n const out: ThemeVars = {}\n for (const [key, value] of Object.entries(scale)) {\n out[`--text-${key}`] = value.size\n out[`--text-${key}--line-height`] = value.lineHeight\n }\n return out\n}\n\nconst { full: _full, ...win98Radius } = radiusCss\n\n/**\n * Windows 98, as variables: every value a theme may change, at its Windows 98\n * value. Declared on `[data-theme=\"win98\"]` as well as being the default, so a\n * Windows 98 region inside a page in another theme is drawn in Windows 98.\n */\nexport const win98Vars: ThemeVars = {\n ...vars(semanticColor, '--color-'),\n ...vars(shadow, '--rk-shadow-'),\n ...vars(size, '--spacing-'),\n ...vars(win98Radius, '--radius-'),\n ...vars(style, '--rk-'),\n '--font-sans': fontFamily.sans,\n '--font-mono': fontFamily.mono,\n ...fontSizeVars(\n Object.fromEntries(\n Object.keys(modernFontSize).map((k) => [k, fontSize[k as keyof typeof fontSize]])\n )\n ),\n '--font-weight-strong': fontWeight.strong,\n}\n\n/** The modern theme in its light scheme. */\nexport const modernLightVars: ThemeVars = {\n ...vars(modernLightColor, '--color-'),\n ...vars(modernLightShadow, '--rk-shadow-'),\n ...vars(modernSize, '--spacing-'),\n ...vars(modernRadius, '--radius-'),\n ...vars(modernStyle, '--rk-'),\n '--font-sans': modernFont.sans,\n '--font-mono': modernFont.mono,\n ...fontSizeVars(modernFontSize),\n '--font-weight-strong': modernFontWeight.strong,\n}\n\n/** What the dark scheme changes on top of the light one. */\nexport const modernDarkVars: ThemeVars = Object.fromEntries(\n Object.entries({\n ...vars(modernDarkColor, '--color-'),\n ...vars(modernDarkShadow, '--rk-shadow-'),\n }).filter(([name, value]) => modernLightVars[name as `--${string}`] !== value)\n)\n\n/** A theme of your own, for {@link defineTheme}. */\nexport interface ThemeDefinition {\n /** Its name: the page switches to it with `data-theme=\"<name>\"`. Lowercase, digits and dashes. */\n name: string\n /**\n * The theme it starts from. Every value it does not set comes from there,\n * so a theme is as small as what it changes. Default `modern`.\n */\n extends?: ThemeName\n /** Values for the light scheme — for a theme without a dark one, its only scheme. */\n light?: ThemeValues\n /**\n * Values for the dark scheme, on top of the light ones. A theme built on\n * `modern` inherits its dark scheme; set `dark: false` to have none.\n */\n dark?: ThemeValues | false\n}\n\n/** A rule declaring a theme's values and its colour scheme. */\nexport function themeRule(selector: string, scheme: 'light' | 'dark', values: ThemeVars): string {\n return [\n `${selector} {`,\n ` color-scheme: ${scheme};`,\n ...Object.entries(values).map(([name, value]) => ` ${name}: ${value};`),\n '}',\n ].join('\\n')\n}\n\n/**\n * The stylesheet for a theme of your own.\n *\n * Every value is declared on the theme's element — the base theme's as well\n * as yours — because a variable that uses `var()` is resolved where it is\n * declared; that is also what lets themes nest. The dark scheme follows the\n * system unless `data-color-scheme` on the same element fixes it, exactly as\n * the modern theme's does.\n *\n * @example\n * ```ts\n * import { defineTheme } from '@rowkit/tokens'\n *\n * const css = defineTheme({\n * name: 'acme',\n * light: { '--color-control-primary': '#5b3df5', '--radius-md': '10px' },\n * })\n * ```\n */\nexport function defineTheme(theme: ThemeDefinition): string {\n if (!/^[a-z][a-z0-9-]*$/.test(theme.name)) {\n throw new Error(`defineTheme: \"${theme.name}\" is not a theme name (lowercase, digits, dashes)`)\n }\n const base = theme.extends ?? 'modern'\n const unknown = [...Object.keys(theme.light ?? {}), ...Object.keys(theme.dark || {})].filter(\n (name) => !(name in win98Vars)\n )\n if (unknown.length > 0) {\n throw new Error(`defineTheme: no rowkit token is called ${unknown.join(', ')}`)\n }\n\n const selector = `[data-theme=\"${theme.name}\"]`\n const light: ThemeVars = { ...(base === 'modern' ? modernLightVars : win98Vars), ...theme.light }\n const rules = [themeRule(selector, 'light', light)]\n\n if (theme.dark !== false && (base === 'modern' || theme.dark !== undefined)) {\n const dark: ThemeVars = { ...(base === 'modern' ? modernDarkVars : {}), ...theme.dark }\n rules.push(\n [\n '@media (prefers-color-scheme: dark) {',\n themeRule(`${selector}:not([data-color-scheme=\"light\"])`, 'dark', dark)\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n'),\n '}',\n ].join('\\n'),\n themeRule(`${selector}[data-color-scheme=\"dark\"]`, 'dark', dark)\n )\n }\n return `${rules.join('\\n\\n')}\\n`\n}\n"],"mappings":";AAsBA,IAAa,IAAM;CACjB,OAAO;CACP,OAAO;CAEP,QAAQ;CAER,MAAM;CAEN,MAAM;CAEN,MAAM;CAEN,MAAM;CACN,OAAO;CACP,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,KAAK;AACP,GAGa,IAAQ;CAEnB,OAAO;CAEP,aAAa;CAEb,cAAc;CAEd,cAAc;CAEd,MAAM;AACR,GASa,IAAkB;CAC7B,GAAG,EAAW,OAAO,CAAG;CACxB,GAAG,EAAW,SAAS,CAAK;AAC9B;AAGA,SAAS,EACP,GACA,GACkD;CAClD,IAAM,IAA8B,CAAC;CACrC,KAAK,IAAM,CAAC,GAAK,MAAU,OAAO,QAAQ,CAAK,GAAG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