@handijitcom/ui 1.0.0 → 1.1.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/README.md +34 -32
- package/build/calendar.cjs.map +1 -1
- package/build/calendar.js.map +1 -1
- package/build/charts.cjs +1 -1
- package/build/charts.cjs.map +1 -1
- package/build/charts.js +1 -1
- package/build/charts.js.map +1 -1
- package/build/chat.cjs +1 -1
- package/build/chat.cjs.map +1 -1
- package/build/chat.js +1 -1
- package/build/chat.js.map +1 -1
- package/build/components/MoneyInput/index.cjs.map +1 -1
- package/build/components/MoneyInput/index.d.cts +1 -1
- package/build/components/MoneyInput/index.d.ts +1 -1
- package/build/components/MoneyInput/index.js.map +1 -1
- package/build/constants/breakpoint.constants.cjs +1 -1
- package/build/constants/breakpoint.constants.cjs.map +1 -1
- package/build/constants/breakpoint.constants.d.cts +1 -1
- package/build/constants/breakpoint.constants.d.ts +1 -1
- package/build/constants/breakpoint.constants.js +1 -1
- package/build/constants/breakpoint.constants.js.map +1 -1
- package/build/constants/scale.constants.cjs.map +1 -1
- package/build/constants/scale.constants.d.cts +2 -3
- package/build/constants/scale.constants.d.ts +2 -3
- package/build/constants/scale.constants.js.map +1 -1
- package/build/design/fonts/LICENSE-archivo.txt +93 -0
- package/build/design/fonts/LICENSE-ibm-plex-mono.txt +93 -0
- package/build/design/fonts/LICENSE-inter.txt +93 -0
- package/build/design/fonts/archivo-latin-ext-wdth-normal.woff2 +0 -0
- package/build/design/fonts/archivo-latin-wdth-normal.woff2 +0 -0
- package/build/design/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/build/design/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/build/design/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/build/design/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/build/design/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/build/design/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/build/design/fonts.css +75 -0
- package/build/design/fonts.d.css.ts +1 -0
- package/build/design/index.cjs +778 -0
- package/build/design/index.cjs.map +1 -0
- package/build/design/index.d.cts +263 -0
- package/build/design/index.d.mts +263 -0
- package/build/design/index.mjs +751 -0
- package/build/design/index.mjs.map +1 -0
- package/build/design/index.umd.cjs +2 -0
- package/build/design/index.umd.cjs.map +1 -0
- package/build/design/logos/horizontal.svg +1 -0
- package/build/design/logos/mark.svg +1 -0
- package/build/design/tokens.css +477 -0
- package/build/design/tokens.d.css.ts +1 -0
- package/build/design/tokens.json +542 -0
- package/build/design/tokens.scss +616 -0
- package/build/helpers/scaled-number.helper.cjs.map +1 -1
- package/build/helpers/scaled-number.helper.d.cts +3 -4
- package/build/helpers/scaled-number.helper.d.ts +3 -4
- package/build/helpers/scaled-number.helper.js.map +1 -1
- package/build/helpers/theme.helper.cjs +1 -1
- package/build/helpers/theme.helper.cjs.map +1 -1
- package/build/helpers/theme.helper.d.cts +2 -2
- package/build/helpers/theme.helper.d.ts +2 -2
- package/build/helpers/theme.helper.js +1 -1
- package/build/helpers/theme.helper.js.map +1 -1
- package/build/hooks/useUiTheme.cjs +1 -1
- package/build/hooks/useUiTheme.cjs.map +1 -1
- package/build/hooks/useUiTheme.d.cts +1 -1
- package/build/hooks/useUiTheme.d.ts +1 -1
- package/build/hooks/useUiTheme.js +1 -1
- package/build/hooks/useUiTheme.js.map +1 -1
- package/build/hooks/useUiTokens.cjs +1 -1
- package/build/hooks/useUiTokens.cjs.map +1 -1
- package/build/hooks/useUiTokens.d.cts +2 -2
- package/build/hooks/useUiTokens.d.ts +2 -2
- package/build/hooks/useUiTokens.js +1 -1
- package/build/hooks/useUiTokens.js.map +1 -1
- package/build/index.cjs +1 -1
- package/build/index.d.cts +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/scss/_index.scss +1 -1
- package/build/scss/_variables.scss +3 -3
- package/build/theme/UiProvider.cjs.map +1 -1
- package/build/theme/UiProvider.d.cts +1 -1
- package/build/theme/UiProvider.d.ts +1 -1
- package/build/theme/UiProvider.js.map +1 -1
- package/build/theme/UiThemeScript.cjs +1 -1
- package/build/theme/UiThemeScript.cjs.map +1 -1
- package/build/theme/UiThemeScript.d.cts +1 -1
- package/build/theme/UiThemeScript.d.ts +1 -1
- package/build/theme/UiThemeScript.js +1 -1
- package/build/theme/UiThemeScript.js.map +1 -1
- package/build/types/calendar/Calendar/index.d.cts +2 -2
- package/build/types/calendar/Calendar/index.d.ts +2 -2
- package/build/types/calendar/core/time.d.cts +1 -1
- package/build/types/calendar/core/time.d.ts +1 -1
- package/build/types/calendar/core/types.d.cts +1 -1
- package/build/types/calendar/core/types.d.ts +1 -1
- package/build/types/calendar/index.d.cts +1 -1
- package/build/types/calendar/index.d.ts +1 -1
- package/build/types/charts/core/palette.d.cts +1 -1
- package/build/types/charts/core/palette.d.ts +1 -1
- package/build/types/chat/Legend/index.d.cts +1 -1
- package/build/types/chat/Legend/index.d.ts +1 -1
- package/build/types/theme.type.d.cts +2 -2
- package/build/types/theme.type.d.ts +2 -2
- package/build/types/types/theme.type.d.cts +2 -2
- package/build/types/types/theme.type.d.ts +2 -2
- package/package.json +30 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/design/helpers/srgb.helper.ts","../../src/design/modules/contrast.ts","../../src/design/tokens/css-variable-prefix.ts","../../src/design/modules/css-var-name.ts","../../src/design/modules/css-var.ts","../../src/design/helpers/oklch.helper.ts","../../src/design/modules/delta-e.ts","../../src/design/modules/hex-to-oklch.ts","../../src/design/modules/max-chroma.ts","../../src/design/modules/oklch-to-hex.ts","../../src/design/tokens/breakpoints.ts","../../src/design/tokens/font-weights.ts","../../src/design/tokens/fonts.ts","../../src/design/tokens/hues.ts","../../src/design/tokens/layers.ts","../../src/design/tokens/logos.ts","../../src/design/tokens/motion.ts","../../src/design/tokens/radii.ts","../../src/design/tokens/spacing.ts","../../src/design/tokens/theme-attribute.ts","../../src/design/tokens/theme-storage-key.ts","../../src/design/tokens/typography.ts"],"sourcesContent":["/** sRGB channels in the 0–1 range (gamma-encoded unless a function says linear). */\ntype Rgb = { r: number; g: number; b: number };\n\nconst HEX_PATTERN = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** sRGB gamma → linear light. */\nconst toLinear = (channel: number): number =>\n channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n\n/** Linear light → sRGB gamma. */\nconst toGamma = (channel: number): number =>\n channel <= 0.0031308 ? channel * 12.92 : 1.055 * channel ** (1 / 2.4) - 0.055;\n\nconst describe = (value: unknown): string =>\n typeof value === 'string' ? `\"${value}\"` : typeof value;\n\n/** `#rgb` / `#rrggbb` → gamma-encoded channels; anything else is a caller error. */\nconst parseHex = (value: unknown, caller: string): Rgb => {\n if (typeof value !== 'string' || !HEX_PATTERN.test(value)) {\n throw new TypeError(\n `${caller}: expected a hex colour like \"#2661fa\", received ${describe(value)}`,\n );\n }\n\n const digits = value.slice(1);\n const full = digits.length === 3 ? digits.replace(/./g, digit => digit + digit) : digits;\n const channel = (start: number): number => parseInt(full.slice(start, start + 2), 16) / 255;\n\n return { r: channel(0), g: channel(2), b: channel(4) };\n};\n\nconst toByte = (channel: number): string =>\n Math.round(Math.min(1, Math.max(0, channel)) * 255)\n .toString(16)\n .padStart(2, '0');\n\n/** Gamma-encoded channels → lowercase `#rrggbb`; out-of-range channels clip. */\nconst formatHex = ({ r, g, b }: Rgb): string => `#${toByte(r)}${toByte(g)}${toByte(b)}`;\n\n/** WCAG 2 relative luminance of gamma-encoded channels. */\nconst relativeLuminance = ({ r, g, b }: Rgb): number =>\n 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n\nexport type { Rgb };\nexport { formatHex, parseHex, relativeLuminance, toGamma, toLinear };\n","import { parseHex, relativeLuminance } from '../helpers/srgb.helper';\n\n/** WCAG 2 contrast ratio of two opaque hex colours, from 1 to 21. Order does not matter. */\nconst contrast = (first: string, second: string): number => {\n const one = relativeLuminance(parseHex(first, 'contrast'));\n const other = relativeLuminance(parseHex(second, 'contrast'));\n return (Math.max(one, other) + 0.05) / (Math.min(one, other) + 0.05);\n};\n\nexport default contrast;\n","/** Every custom property and Sass variable of the package starts with this. */\nconst CSS_VARIABLE_PREFIX = 'hd' as const;\n\nexport default CSS_VARIABLE_PREFIX;\n","import CSS_VARIABLE_PREFIX from '../tokens/css-variable-prefix';\nimport type { TokenName } from '../types';\n\n/** The custom property name of a token: `cssVarName(\"bg-page\")` → `--hd-bg-page`. */\nconst cssVarName = <Name extends TokenName>(\n name: Name,\n): `--${typeof CSS_VARIABLE_PREFIX}-${Name}` => `--${CSS_VARIABLE_PREFIX}-${name}`;\n\nexport default cssVarName;\n","import type { TokenName } from '../types';\nimport cssVarName from './css-var-name';\n\n/**\n * A `var()` reference to a token: `cssVar(\"bg-page\")` → `var(--hd-bg-page)`.\n * The optional fallback is emitted verbatim: `var(--hd-bg-page, #fff)`.\n */\nconst cssVar = (name: TokenName, fallback?: string): string =>\n fallback === undefined ? `var(${cssVarName(name)})` : `var(${cssVarName(name)}, ${fallback})`;\n\nexport default cssVar;\n","import type { Oklch } from '../types';\nimport type { Rgb } from './srgb.helper';\nimport { toGamma, toLinear } from './srgb.helper';\n\ntype Oklab = { l: number; a: number; b: number };\n\n// Rounding noise at the gamut edge must not count as \"out of gamut\".\nconst GAMUT_EPSILON = 0.0001;\n\n// 24 halvings of the widest chroma interval land far below one 8-bit step.\nconst BISECTION_STEPS = 24;\n\n/** OKLCH → gamma-encoded sRGB, without any gamut handling. */\nconst oklchToSrgb = ({ l, c, h }: Oklch): Rgb => {\n const radians = (h * Math.PI) / 180;\n const greenRed = c * Math.cos(radians);\n const blueYellow = c * Math.sin(radians);\n\n const long = (l + 0.3963377774 * greenRed + 0.2158037573 * blueYellow) ** 3;\n const medium = (l - 0.1055613458 * greenRed - 0.0638541728 * blueYellow) ** 3;\n const short = (l - 0.0894841775 * greenRed - 1.291485548 * blueYellow) ** 3;\n\n return {\n r: toGamma(4.0767416621 * long - 3.3077115913 * medium + 0.2309699292 * short),\n g: toGamma(-1.2684380046 * long + 2.6097574011 * medium - 0.3413193965 * short),\n b: toGamma(-0.0041960863 * long - 0.7034186147 * medium + 1.707614701 * short),\n };\n};\n\nconst isChannelInGamut = (channel: number): boolean =>\n channel >= -GAMUT_EPSILON && channel <= 1 + GAMUT_EPSILON;\n\nconst isInGamut = ({ r, g, b }: Rgb): boolean =>\n isChannelInGamut(r) && isChannelInGamut(g) && isChannelInGamut(b);\n\n/** The highest chroma up to `ceiling` that still fits sRGB at this lightness and hue. */\nconst fitChroma = (l: number, h: number, ceiling: number): number => {\n let low = 0;\n let high = ceiling;\n\n for (let step = 0; step < BISECTION_STEPS; step += 1) {\n const middle = (low + high) / 2;\n if (isInGamut(oklchToSrgb({ l, c: middle, h }))) low = middle;\n else high = middle;\n }\n\n return low;\n};\n\n/** Gamma-encoded sRGB → OKLab. */\nconst srgbToOklab = (rgb: Rgb): Oklab => {\n const r = toLinear(rgb.r);\n const g = toLinear(rgb.g);\n const b = toLinear(rgb.b);\n\n const long = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n const medium = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n const short = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n\n return {\n l: 0.2104542553 * long + 0.793617785 * medium - 0.0040720468 * short,\n a: 1.9779984951 * long - 2.428592205 * medium + 0.4505937099 * short,\n b: 0.0259040371 * long + 0.7827717662 * medium - 0.808675766 * short,\n };\n};\n\n/** Rejects `NaN`, `±Infinity` and non-numbers: no colour can be computed from them. */\nconst assertFinite = (value: unknown, name: string, caller: string): void => {\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n throw new TypeError(`${caller}: ${name} must be a finite number, received ${String(value)}`);\n }\n};\n\nexport type { Oklab };\nexport { assertFinite, fitChroma, isInGamut, oklchToSrgb, srgbToOklab };\n","import { srgbToOklab } from '../helpers/oklch.helper';\nimport { parseHex } from '../helpers/srgb.helper';\n\n/**\n * Perceptual distance between two hex colours: Euclidean OKLab distance × 100.\n * Around 2 is a just-noticeable difference; the palette keeps chart colours 10 apart.\n */\nconst deltaE = (first: string, second: string): number => {\n const from = srgbToOklab(parseHex(first, 'deltaE'));\n const to = srgbToOklab(parseHex(second, 'deltaE'));\n return Math.hypot(from.l - to.l, from.a - to.a, from.b - to.b) * 100;\n};\n\nexport default deltaE;\n","import { srgbToOklab } from '../helpers/oklch.helper';\nimport { parseHex } from '../helpers/srgb.helper';\nimport type { Oklch } from '../types';\n\n// Below this chroma the hue angle is rounding noise, not information.\nconst ACHROMATIC_CHROMA = 0.0001;\n\n/** Converts `#rgb` / `#rrggbb` to OKLCH. Greys report chroma 0 and hue 0. */\nconst hexToOklch = (hex: string): Oklch => {\n const { l, a, b } = srgbToOklab(parseHex(hex, 'hexToOklch'));\n const c = Math.hypot(a, b);\n if (c < ACHROMATIC_CHROMA) return { l, c: 0, h: 0 };\n\n return { l, c, h: ((Math.atan2(b, a) * 180) / Math.PI + 360) % 360 };\n};\n\nexport default hexToOklch;\n","import { assertFinite, fitChroma } from '../helpers/oklch.helper';\n\n// No sRGB colour reaches this chroma, so the search always starts outside the gamut.\nconst CHROMA_CEILING = 0.4;\n\n/** The highest chroma sRGB can show at the given OKLCH lightness and hue. */\nconst maxChroma = (l: number, h: number): number => {\n assertFinite(l, 'l', 'maxChroma');\n assertFinite(h, 'h', 'maxChroma');\n return fitChroma(l, h, CHROMA_CEILING);\n};\n\nexport default maxChroma;\n","import { assertFinite, fitChroma, isInGamut, oklchToSrgb } from '../helpers/oklch.helper';\nimport { formatHex } from '../helpers/srgb.helper';\nimport type { Oklch } from '../types';\n\n/**\n * Converts an OKLCH colour to `#rrggbb`. A colour outside sRGB keeps its lightness and hue\n * and gives up chroma until it fits; channels are never clipped individually.\n */\nconst oklchToHex = (color: Oklch): string => {\n // Destructuring a missing argument would throw an unhelpful engine error instead.\n const { l, c, h } = (color ?? {}) as Partial<Oklch>;\n assertFinite(l, 'l', 'oklchToHex');\n assertFinite(c, 'c', 'oklchToHex');\n assertFinite(h, 'h', 'oklchToHex');\n\n // Negative chroma is the same colour mirrored through grey; read it as \"no chroma\".\n const chroma = Math.max(0, c as number);\n const requested = { l: l as number, c: chroma, h: h as number };\n const direct = oklchToSrgb(requested);\n if (isInGamut(direct)) return formatHex(direct);\n\n return formatHex(\n oklchToSrgb({\n ...requested,\n c: fitChroma(requested.l, requested.h, chroma),\n }),\n );\n};\n\nexport default oklchToHex;\n","import type { Breakpoints } from '../types';\n\n/** Viewport breakpoints in CSS pixels; each is the lower bound of its range. */\nconst breakpoints: Breakpoints = {\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n};\n\nexport default breakpoints;\n","import type { FontWeights } from '../types';\n\n/** Named font weights. IBM Plex Mono ships only `regular` and `medium`. */\nconst fontWeights: FontWeights = {\n regular: 400,\n medium: 500,\n semibold: 600,\n bold: 700,\n};\n\nexport default fontWeights;\n","import type { Fonts } from '../types';\n\n/**\n * Font family stacks. The first family of each stack ships in `fonts.css`; the rest are\n * system fonts that hold the layout while the web font loads or when it is missing.\n */\nconst fonts: Fonts = {\n display: 'Archivo, system-ui, -apple-system, \"Segoe UI\", \"Helvetica Neue\", Arial, sans-serif',\n body: 'Inter, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n mono: '\"IBM Plex Mono\", ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace',\n};\n\nexport default fonts;\n","import type { HueName } from '../types';\n\n/** OKLCH hue angle of every chromatic family. Neutrals lean to the cobalt hue. */\nconst hues: Readonly<Record<HueName, number>> = {\n cobalt: 264,\n coral: 33,\n turquoise: 192,\n success: 156,\n warning: 78,\n danger: 14,\n violet: 310,\n magenta: 348,\n};\n\nexport default hues;\n","import type { Layers } from '../types';\n\n/** `z-index` layers, lowest to highest. The gaps leave room for local stacking. */\nconst layers: Layers = {\n base: 0,\n raised: 1,\n sticky: 100,\n dropdown: 1000,\n overlay: 1100,\n modal: 1200,\n popover: 1300,\n toast: 1400,\n tooltip: 1500,\n};\n\nexport default layers;\n","import type { Logos } from '../types';\n\n/**\n * The Han Dijit logos as path data, so React and Electron code can draw them inline.\n * `body` takes `currentColor`; `dot` is the square dot of the mark and takes the accent.\n */\n// prettier-ignore\nconst logos: Logos = {\n mark: {\n viewBox: \"0 0 618.034 1000\",\n width: 618.034,\n height: 1000,\n body: \"M40.325 1000 L130.495 1000 L170.82 959.675 L170.82 554.175 L447.214 554.175 L447.214 959.675 L487.539 1000 L577.709 1000 L618.034 959.675 L618.034 439.083 L577.709 398.758 L170.82 398.758 L170.82 40.325 L130.495 0 L40.325 0 L0 40.325 L0 959.675 Z\",\n dot: \"M487.539 0 L577.709 0 L618.034 40.325 L618.034 130.495 L577.709 170.82 L487.539 170.82 L447.214 130.495 L447.214 40.325 Z\",\n },\n horizontal: {\n viewBox: \"0 0 6004.732 1109.971\",\n width: 6004.732,\n height: 1109.971,\n body: \"M44.76 1109.971 L144.846 1109.971 L189.605 1065.212 L189.605 615.118 L496.395 615.118 L496.395 1065.212 L541.154 1109.971 L641.24 1109.971 L686 1065.212 L686 487.37 L641.24 442.61 L189.605 442.61 L189.605 44.76 L144.846 0 L44.76 0 L0 44.76 L0 1065.212 Z M949.732 1109.971 1216.732 423.971H1380.732L1648.732 1109.971H1507.732L1452.732 963.971H1138.732L1083.732 1109.971ZM1179.732 853.971H1410.732L1341.732 667.971Q1337.732 657.971 1332.232 642.471Q1326.732 626.971 1320.732 608.471Q1314.732 589.971 1308.732 570.971Q1302.732 551.971 1297.732 536.971H1292.732Q1286.732 556.971 1278.232 582.971Q1269.732 608.971 1261.732 631.971Q1253.732 654.971 1248.732 667.971Z M1859.732 1109.971V423.971H1983.732L2276.732 828.971Q2281.732 834.971 2288.732 845.471Q2295.732 855.971 2301.732 865.971Q2307.732 875.971 2309.732 881.971H2314.732Q2314.732 867.971 2314.732 854.971Q2314.732 841.971 2314.732 828.971V423.971H2439.732V1109.971H2316.732L2022.732 701.971Q2014.732 689.971 2004.232 672.471Q1993.732 654.971 1989.732 647.971H1984.732Q1984.732 660.971 1984.732 674.471Q1984.732 687.971 1984.732 701.971V1109.971Z M3125.732 1109.971V423.971H3390.732Q3496.732 423.971 3571.732 460.471Q3646.732 496.971 3687.232 572.471Q3727.732 647.971 3727.732 766.971Q3727.732 884.971 3687.232 960.971Q3646.732 1036.971 3571.732 1073.471Q3496.732 1109.971 3390.732 1109.971ZM3237.732 1013.971H3389.732Q3442.732 1013.971 3484.232 999.971Q3525.732 985.971 3554.232 956.971Q3582.732 927.971 3597.232 883.471Q3611.732 838.971 3611.732 777.971V756.971Q3611.732 694.971 3597.232 650.471Q3582.732 605.971 3554.232 576.971Q3525.732 547.971 3484.232 533.971Q3442.732 519.971 3389.732 519.971H3237.732Z M3986.732 1109.971V423.971H4098.732V1109.971Z M4013.172 231.971 H4072.292 L4098.732 258.411 V317.532 L4072.292 343.971 H4013.172 L3986.732 317.532 V258.411 Z M4573.732 1121.971Q4500.732 1121.971 4449.732 1098.971Q4398.732 1075.971 4371.732 1031.971Q4344.732 987.971 4344.732 921.971V888.971H4455.732V924.971Q4455.732 973.971 4485.732 1000.471Q4515.732 1026.971 4573.732 1026.971Q4630.732 1026.971 4660.732 988.971Q4690.732 950.971 4690.732 879.971V423.971H4802.732V877.971Q4802.732 958.971 4775.732 1013.471Q4748.732 1067.971 4697.732 1094.971Q4646.732 1121.971 4573.732 1121.971Z M5091.732 1109.971V423.971H5203.732V1109.971Z M5118.172 231.971 H5177.292 L5203.732 258.411 V317.532 L5177.292 343.971 H5118.172 L5091.732 317.532 V258.411 Z M5663.732 1109.971V519.971H5436.732V423.971H6004.732V519.971H5775.732V1109.971Z\",\n dot: \"M541.154 0 L641.24 0 L686 44.76 L686 144.846 L641.24 189.605 L541.154 189.605 L496.395 144.846 L496.395 44.76 Z\",\n },\n};\n\nexport default logos;\n","import type { Motion } from '../types';\n\n/**\n * Durations (ms) and easings. `tokens.css` collapses the durations under\n * `prefers-reduced-motion: reduce`; code that animates from JavaScript has to check the\n * media query itself.\n */\nconst motion: Motion = {\n duration: { fast: 120, base: 200, slow: 320 },\n easing: {\n standard: 'cubic-bezier(0.2, 0, 0, 1)',\n enter: 'cubic-bezier(0, 0, 0, 1)',\n exit: 'cubic-bezier(0.3, 0, 1, 1)',\n },\n};\n\nexport default motion;\n","import type { Radii } from '../types';\n\n/** Corner radii in CSS pixels. `pill` is large enough to round any control fully. */\nconst radii: Radii = {\n xs: 6,\n sm: 10,\n md: 14,\n lg: 20,\n pill: 999,\n};\n\nexport default radii;\n","import type { Spacing } from '../types';\n\n/** The spacing scale in CSS pixels: every step is its name × 4px. */\nconst spacing: Spacing = {\n 0: 0,\n 1: 4,\n 2: 8,\n 3: 12,\n 4: 16,\n 5: 20,\n 6: 24,\n 8: 32,\n 10: 40,\n 12: 48,\n 16: 64,\n 20: 80,\n 24: 96,\n};\n\nexport default spacing;\n","/** The attribute that selects a theme: `<html data-theme=\"dark\">`. */\nconst THEME_ATTRIBUTE = 'data-theme' as const;\n\nexport default THEME_ATTRIBUTE;\n","/**\n * The `localStorage` key holding the user's choice: `\"light\"`, `\"dark\"`, or anything else\n * (including no entry) for \"follow the system\".\n */\nconst THEME_STORAGE_KEY = 'hd-theme' as const;\n\nexport default THEME_STORAGE_KEY;\n","import type { Typography } from '../types';\n\n/**\n * The type scale. Sizes are CSS pixels at a 16px root (body is 15px); headings are set in\n * the display family, slightly wide (`stretch` above 100) and tight.\n */\nconst typography: Typography = {\n display: {\n font: 'display',\n size: 56,\n lineHeight: 1.05,\n weight: 700,\n letterSpacing: -0.03,\n stretch: 112,\n },\n h1: {\n font: 'display',\n size: 40,\n lineHeight: 1.1,\n weight: 700,\n letterSpacing: -0.025,\n stretch: 110,\n },\n h2: {\n font: 'display',\n size: 30,\n lineHeight: 1.15,\n weight: 700,\n letterSpacing: -0.02,\n stretch: 110,\n },\n h3: {\n font: 'display',\n size: 22,\n lineHeight: 1.2,\n weight: 650,\n letterSpacing: -0.015,\n stretch: 108,\n },\n h4: {\n font: 'display',\n size: 18,\n lineHeight: 1.3,\n weight: 650,\n letterSpacing: -0.01,\n stretch: 108,\n },\n lead: {\n font: 'body',\n size: 17,\n lineHeight: 1.55,\n weight: 400,\n letterSpacing: 0,\n stretch: 100,\n },\n body: {\n font: 'body',\n size: 15,\n lineHeight: 1.55,\n weight: 400,\n letterSpacing: 0,\n stretch: 100,\n },\n small: {\n font: 'body',\n size: 13,\n lineHeight: 1.5,\n weight: 400,\n letterSpacing: 0,\n stretch: 100,\n },\n caption: {\n font: 'body',\n size: 12,\n lineHeight: 1.4,\n weight: 500,\n letterSpacing: 0.01,\n stretch: 100,\n },\n code: {\n font: 'mono',\n size: 13,\n lineHeight: 1.5,\n weight: 400,\n letterSpacing: 0,\n stretch: 100,\n },\n};\n\nexport default typography;\n"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAAG,iCAAiC;AAErD;AACA,MAAM,QAAQ,GAAG,CAAC,OAAe,KAC/B,OAAO,IAAI,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,GAAG;AAE3E;AACA,MAAM,OAAO,GAAG,CAAC,OAAe,KAC9B,OAAO,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,KAAK,CAAC,GAAG,GAAG,CAAC,GAAG,KAAK;AAE/E,MAAM,QAAQ,GAAG,CAAC,KAAc,KAC9B,OAAO,KAAK,KAAK,QAAQ,GAAG,IAAI,KAAK,CAAA,CAAA,CAAG,GAAG,OAAO,KAAK;AAEzD;AACA,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,MAAc,KAAS;AACvD,IAAA,IAAI,OAAO,KAAK,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** WCAG 2 contrast ratio of two opaque hex colours, from 1 to 21. Order does not matter. */
|
|
2
|
+
declare const contrast: (first: string, second: string) => number;
|
|
3
|
+
|
|
4
|
+
/** A colour in OKLCH: lightness 0–1, chroma 0–~0.4, hue in degrees. */
|
|
5
|
+
type Oklch = {
|
|
6
|
+
/** Perceptual lightness, 0 (black) to 1 (white). */
|
|
7
|
+
l: number;
|
|
8
|
+
/** Chroma; sRGB tops out near 0.32 depending on hue and lightness. */
|
|
9
|
+
c: number;
|
|
10
|
+
/** Hue angle in degrees. */
|
|
11
|
+
h: number;
|
|
12
|
+
};
|
|
13
|
+
type ThemeName = 'light' | 'dark';
|
|
14
|
+
/** What the user picked; `system` follows the operating system. */
|
|
15
|
+
type ThemePreference = ThemeName | 'system';
|
|
16
|
+
type ChromaticScaleName = 'cobalt' | 'coral' | 'turquoise' | 'success' | 'warning' | 'danger' | 'violet' | 'magenta';
|
|
17
|
+
type ScaleName = ChromaticScaleName | 'slate';
|
|
18
|
+
type ChromaticStep = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
|
|
19
|
+
type NeutralStep = 0 | 25 | ChromaticStep;
|
|
20
|
+
type ChromaticScale = Readonly<Record<ChromaticStep, string>>;
|
|
21
|
+
type NeutralScale = Readonly<Record<NeutralStep, string>>;
|
|
22
|
+
type Scales = Readonly<Record<ChromaticScaleName, ChromaticScale>> & {
|
|
23
|
+
readonly slate: NeutralScale;
|
|
24
|
+
};
|
|
25
|
+
type HueName = ChromaticScaleName;
|
|
26
|
+
type StatusName = 'success' | 'warning' | 'danger' | 'info';
|
|
27
|
+
type ChartIndex = 1 | 2 | 3 | 4 | 5 | 6;
|
|
28
|
+
/** Every theme-dependent colour. Values are always opaque `#rrggbb`. */
|
|
29
|
+
type ColorToken = 'bg-page' | 'bg-surface' | 'bg-raised' | 'bg-inset' | 'bg-overlay' | 'bg-disabled' | 'border' | 'border-strong' | 'border-control' | 'text' | 'text-2' | 'text-3' | 'text-disabled' | 'primary' | 'primary-hover' | 'primary-active' | 'on-primary' | 'primary-soft' | 'primary-soft-hover' | 'primary-line' | 'primary-text' | 'accent' | 'accent-hover' | 'accent-active' | 'on-accent' | 'accent-soft' | 'accent-text' | 'highlight' | 'on-highlight' | 'highlight-soft' | 'highlight-text' | 'focus' | 'selection-bg' | `${StatusName}-${'bg' | 'fg' | 'line' | 'solid' | 'on-solid'}` | `chart-${ChartIndex}` | 'band-bg' | 'band-deep' | 'band-line' | 'band-line-strong' | 'band-text' | 'band-text-2';
|
|
30
|
+
type Theme = Readonly<Record<ColorToken, string>>;
|
|
31
|
+
type Themes = Readonly<Record<ThemeName, Theme>>;
|
|
32
|
+
type FontRole = 'display' | 'body' | 'mono';
|
|
33
|
+
type Fonts = Readonly<Record<FontRole, string>>;
|
|
34
|
+
type FontWeightName = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
35
|
+
type FontWeights = Readonly<Record<FontWeightName, number>>;
|
|
36
|
+
type TypeRole = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'lead' | 'body' | 'small' | 'caption' | 'code';
|
|
37
|
+
type TypeStyle = {
|
|
38
|
+
/** Which family stack the role is set in. */
|
|
39
|
+
readonly font: FontRole;
|
|
40
|
+
/** Font size in CSS pixels at a 16px root; the CSS output is in rem. */
|
|
41
|
+
readonly size: number;
|
|
42
|
+
/** Unitless line height. */
|
|
43
|
+
readonly lineHeight: number;
|
|
44
|
+
/** Font weight on the variable axis. */
|
|
45
|
+
readonly weight: number;
|
|
46
|
+
/** Letter spacing in em. */
|
|
47
|
+
readonly letterSpacing: number;
|
|
48
|
+
/** Font width in percent (`font-stretch`); 100 is the normal width. */
|
|
49
|
+
readonly stretch: number;
|
|
50
|
+
};
|
|
51
|
+
type Typography = Readonly<Record<TypeRole, TypeStyle>>;
|
|
52
|
+
type SpaceStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
|
|
53
|
+
type Spacing = Readonly<Record<SpaceStep, number>>;
|
|
54
|
+
type RadiusName = 'xs' | 'sm' | 'md' | 'lg' | 'pill';
|
|
55
|
+
type Radii = Readonly<Record<RadiusName, number>>;
|
|
56
|
+
type ShadowLevel = 1 | 2 | 3;
|
|
57
|
+
type ThemeEffects = {
|
|
58
|
+
/** Shadow colour as space-separated sRGB channels, for `rgb(<color> / <alpha>)`. */
|
|
59
|
+
readonly 'shadow-color': string;
|
|
60
|
+
/** Base shadow opacity of the theme, as a CSS number. */
|
|
61
|
+
readonly 'shadow-alpha': string;
|
|
62
|
+
/** Resting elevation: cards and segmented controls. */
|
|
63
|
+
readonly 'shadow-1': string;
|
|
64
|
+
/** Raised elevation: menus, popovers, floating cards. */
|
|
65
|
+
readonly 'shadow-2': string;
|
|
66
|
+
/** Top elevation: dialogs and drawers. */
|
|
67
|
+
readonly 'shadow-3': string;
|
|
68
|
+
/** Translucent backdrop behind dialogs. */
|
|
69
|
+
readonly scrim: string;
|
|
70
|
+
};
|
|
71
|
+
type EffectToken = keyof ThemeEffects;
|
|
72
|
+
type Effects = Readonly<Record<ThemeName, ThemeEffects>>;
|
|
73
|
+
/** A colour with its opacity: what `rgb(r g b / a)` says in CSS, as plain values. */
|
|
74
|
+
type EffectTone = {
|
|
75
|
+
/** The colour as an opaque `#rrggbb`. */
|
|
76
|
+
readonly color: string;
|
|
77
|
+
/** Opacity, 0 (transparent) to 1 (solid). */
|
|
78
|
+
readonly alpha: number;
|
|
79
|
+
};
|
|
80
|
+
/** One layer of an elevation shadow; lengths are CSS pixels. */
|
|
81
|
+
type ShadowLayer = {
|
|
82
|
+
/** Horizontal offset. */
|
|
83
|
+
readonly x: number;
|
|
84
|
+
/** Vertical offset. */
|
|
85
|
+
readonly y: number;
|
|
86
|
+
/** Blur radius. */
|
|
87
|
+
readonly blur: number;
|
|
88
|
+
/** Spread radius; negative pulls the shadow in under its box. */
|
|
89
|
+
readonly spread: number;
|
|
90
|
+
/** Opacity of this layer, painted in the theme's shadow colour. */
|
|
91
|
+
readonly alpha: number;
|
|
92
|
+
};
|
|
93
|
+
/** The effects of one theme as numbers and hex, for anything that cannot read CSS. */
|
|
94
|
+
type ThemeEffectValues = {
|
|
95
|
+
/** Shadow colour and base shadow opacity of the theme. */
|
|
96
|
+
readonly shadow: EffectTone;
|
|
97
|
+
/** The layers of each elevation shadow, outermost paint first as in CSS. */
|
|
98
|
+
readonly shadows: Readonly<Record<ShadowLevel, readonly ShadowLayer[]>>;
|
|
99
|
+
/** Translucent backdrop behind dialogs. */
|
|
100
|
+
readonly scrim: EffectTone;
|
|
101
|
+
};
|
|
102
|
+
type EffectValues = Readonly<Record<ThemeName, ThemeEffectValues>>;
|
|
103
|
+
type DurationName = 'fast' | 'base' | 'slow';
|
|
104
|
+
type EasingName = 'standard' | 'enter' | 'exit';
|
|
105
|
+
type Motion = {
|
|
106
|
+
/** Durations in milliseconds. */
|
|
107
|
+
readonly duration: Readonly<Record<DurationName, number>>;
|
|
108
|
+
/** CSS timing functions. */
|
|
109
|
+
readonly easing: Readonly<Record<EasingName, string>>;
|
|
110
|
+
};
|
|
111
|
+
type LayerName = 'base' | 'raised' | 'sticky' | 'dropdown' | 'overlay' | 'modal' | 'popover' | 'toast' | 'tooltip';
|
|
112
|
+
type Layers = Readonly<Record<LayerName, number>>;
|
|
113
|
+
type BreakpointName = 'sm' | 'md' | 'lg' | 'xl';
|
|
114
|
+
type Breakpoints = Readonly<Record<BreakpointName, number>>;
|
|
115
|
+
type ScaleToken = `${ChromaticScaleName}-${ChromaticStep}` | `slate-${NeutralStep}`;
|
|
116
|
+
type TypeProperty = 'size' | 'line-height' | 'weight' | 'letter-spacing' | 'stretch';
|
|
117
|
+
/** Tokens that keep one value in every theme. */
|
|
118
|
+
type StaticToken = ScaleToken | `font-${FontRole}` | `font-weight-${FontWeightName}` | `type-${TypeRole}-${TypeProperty}` | `space-${SpaceStep}` | `radius-${RadiusName}` | `duration-${DurationName}` | `ease-${EasingName}` | `z-${LayerName}`;
|
|
119
|
+
/** Tokens whose value follows the active theme. */
|
|
120
|
+
type ThemedToken = ColorToken | EffectToken;
|
|
121
|
+
/** Every custom property in `tokens.css`, without the `--hd-` prefix. */
|
|
122
|
+
type TokenName = StaticToken | ThemedToken;
|
|
123
|
+
type LogoName = 'mark' | 'horizontal';
|
|
124
|
+
type Logo = {
|
|
125
|
+
/** The SVG `viewBox`. */
|
|
126
|
+
readonly viewBox: string;
|
|
127
|
+
/** Intrinsic width in viewBox units. */
|
|
128
|
+
readonly width: number;
|
|
129
|
+
/** Intrinsic height in viewBox units. */
|
|
130
|
+
readonly height: number;
|
|
131
|
+
/** Path data of everything except the dot; painted with `currentColor`. */
|
|
132
|
+
readonly body: string;
|
|
133
|
+
/** Path data of the square dot of the mark; painted with the accent. */
|
|
134
|
+
readonly dot: string;
|
|
135
|
+
};
|
|
136
|
+
type Logos = Readonly<Record<LogoName, Logo>>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A `var()` reference to a token: `cssVar("bg-page")` → `var(--hd-bg-page)`.
|
|
140
|
+
* The optional fallback is emitted verbatim: `var(--hd-bg-page, #fff)`.
|
|
141
|
+
*/
|
|
142
|
+
declare const cssVar: (name: TokenName, fallback?: string) => string;
|
|
143
|
+
|
|
144
|
+
/** Every custom property and Sass variable of the package starts with this. */
|
|
145
|
+
declare const CSS_VARIABLE_PREFIX: "hd";
|
|
146
|
+
|
|
147
|
+
/** The custom property name of a token: `cssVarName("bg-page")` → `--hd-bg-page`. */
|
|
148
|
+
declare const cssVarName: <Name extends TokenName>(name: Name) => `--${typeof CSS_VARIABLE_PREFIX}-${Name}`;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Perceptual distance between two hex colours: Euclidean OKLab distance × 100.
|
|
152
|
+
* Around 2 is a just-noticeable difference; the palette keeps chart colours 10 apart.
|
|
153
|
+
*/
|
|
154
|
+
declare const deltaE: (first: string, second: string) => number;
|
|
155
|
+
|
|
156
|
+
/** Converts `#rgb` / `#rrggbb` to OKLCH. Greys report chroma 0 and hue 0. */
|
|
157
|
+
declare const hexToOklch: (hex: string) => Oklch;
|
|
158
|
+
|
|
159
|
+
/** The highest chroma sRGB can show at the given OKLCH lightness and hue. */
|
|
160
|
+
declare const maxChroma: (l: number, h: number) => number;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Converts an OKLCH colour to `#rrggbb`. A colour outside sRGB keeps its lightness and hue
|
|
164
|
+
* and gives up chroma until it fits; channels are never clipped individually.
|
|
165
|
+
*/
|
|
166
|
+
declare const oklchToHex: (color: Oklch) => string;
|
|
167
|
+
|
|
168
|
+
/** Viewport breakpoints in CSS pixels; each is the lower bound of its range. */
|
|
169
|
+
declare const breakpoints: Breakpoints;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The shadows and the scrim as hex and numbers, for anything that cannot read a custom
|
|
173
|
+
* property: an Electron main process, an Open Graph image, a PDF. This is the single source;
|
|
174
|
+
* the CSS strings in `effects` are rendered from it.
|
|
175
|
+
*/
|
|
176
|
+
declare const effectValues: EffectValues;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Theme-dependent values that are not plain colours: the three elevation shadows, the raw
|
|
180
|
+
* shadow colour and opacity for custom shadows, and the dialog scrim. These are the CSS
|
|
181
|
+
* strings of `effectValues`, which holds the same data as hex and numbers.
|
|
182
|
+
*/
|
|
183
|
+
declare const effects: Effects;
|
|
184
|
+
|
|
185
|
+
/** Named font weights. IBM Plex Mono ships only `regular` and `medium`. */
|
|
186
|
+
declare const fontWeights: FontWeights;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Font family stacks. The first family of each stack ships in `fonts.css`; the rest are
|
|
190
|
+
* system fonts that hold the layout while the web font loads or when it is missing.
|
|
191
|
+
*/
|
|
192
|
+
declare const fonts: Fonts;
|
|
193
|
+
|
|
194
|
+
/** OKLCH hue angle of every chromatic family. Neutrals lean to the cobalt hue. */
|
|
195
|
+
declare const hues: Readonly<Record<HueName, number>>;
|
|
196
|
+
|
|
197
|
+
/** `z-index` layers, lowest to highest. The gaps leave room for local stacking. */
|
|
198
|
+
declare const layers: Layers;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The Han Dijit logos as path data, so React and Electron code can draw them inline.
|
|
202
|
+
* `body` takes `currentColor`; `dot` is the square dot of the mark and takes the accent.
|
|
203
|
+
*/
|
|
204
|
+
declare const logos: Logos;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Durations (ms) and easings. `tokens.css` collapses the durations under
|
|
208
|
+
* `prefers-reduced-motion: reduce`; code that animates from JavaScript has to check the
|
|
209
|
+
* media query itself.
|
|
210
|
+
*/
|
|
211
|
+
declare const motion: Motion;
|
|
212
|
+
|
|
213
|
+
/** Corner radii in CSS pixels. `pill` is large enough to round any control fully. */
|
|
214
|
+
declare const radii: Radii;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The raw colour scales. They are the same in every theme; components should reach for
|
|
218
|
+
* the semantic colours in `themes` first.
|
|
219
|
+
*/
|
|
220
|
+
declare const scales: Scales;
|
|
221
|
+
|
|
222
|
+
/** The spacing scale in CSS pixels: every step is its name × 4px. */
|
|
223
|
+
declare const spacing: Spacing;
|
|
224
|
+
|
|
225
|
+
/** The attribute that selects a theme: `<html data-theme="dark">`. */
|
|
226
|
+
declare const THEME_ATTRIBUTE: "data-theme";
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Source of an inline `<script>` for `<head>`. It runs before first paint, sets the theme
|
|
230
|
+
* attribute on `<html>` from the stored choice (or the system theme) and keeps following
|
|
231
|
+
* the system while no explicit choice is stored. Written in ES5 by hand: it is shipped as
|
|
232
|
+
* text, so no compiler ever sees it. Reading storage can throw (sandboxed frames, blocked
|
|
233
|
+
* site data); that counts as "no choice".
|
|
234
|
+
*/
|
|
235
|
+
declare const THEME_BOOT_SCRIPT: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* CSP source expression for `THEME_BOOT_SCRIPT`: put it, in single quotes, in `script-src`.
|
|
239
|
+
* The published build carries the digest as a literal; it is computed when the package is
|
|
240
|
+
* built, not when it is imported.
|
|
241
|
+
*/
|
|
242
|
+
declare const THEME_BOOT_SCRIPT_HASH: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The `localStorage` key holding the user's choice: `"light"`, `"dark"`, or anything else
|
|
246
|
+
* (including no entry) for "follow the system".
|
|
247
|
+
*/
|
|
248
|
+
declare const THEME_STORAGE_KEY: "hd-theme";
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Semantic colours per theme. Every value is an opaque `#rrggbb`, so it can be handed to
|
|
252
|
+
* anything that takes a colour (an Electron window background, a canvas, a chart library).
|
|
253
|
+
*/
|
|
254
|
+
declare const themes: Themes;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The type scale. Sizes are CSS pixels at a 16px root (body is 15px); headings are set in
|
|
258
|
+
* the display family, slightly wide (`stretch` above 100) and tight.
|
|
259
|
+
*/
|
|
260
|
+
declare const typography: Typography;
|
|
261
|
+
|
|
262
|
+
export { CSS_VARIABLE_PREFIX, THEME_ATTRIBUTE, THEME_BOOT_SCRIPT, THEME_BOOT_SCRIPT_HASH, THEME_STORAGE_KEY, breakpoints, contrast, cssVar, cssVarName, deltaE, effectValues, effects, fontWeights, fonts, hexToOklch, hues, layers, logos, maxChroma, motion, oklchToHex, radii, scales, spacing, themes, typography };
|
|
263
|
+
export type { BreakpointName, Breakpoints, ChartIndex, ChromaticScale, ChromaticScaleName, ChromaticStep, ColorToken, DurationName, EasingName, EffectToken, EffectTone, EffectValues, Effects, FontRole, FontWeightName, FontWeights, Fonts, HueName, LayerName, Layers, Logo, LogoName, Logos, Motion, NeutralScale, NeutralStep, Oklch, Radii, RadiusName, ScaleName, ScaleToken, Scales, ShadowLayer, ShadowLevel, SpaceStep, Spacing, StaticToken, StatusName, Theme, ThemeEffectValues, ThemeEffects, ThemeName, ThemePreference, ThemedToken, Themes, TokenName, TypeProperty, TypeRole, TypeStyle, Typography };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/** WCAG 2 contrast ratio of two opaque hex colours, from 1 to 21. Order does not matter. */
|
|
2
|
+
declare const contrast: (first: string, second: string) => number;
|
|
3
|
+
|
|
4
|
+
/** A colour in OKLCH: lightness 0–1, chroma 0–~0.4, hue in degrees. */
|
|
5
|
+
type Oklch = {
|
|
6
|
+
/** Perceptual lightness, 0 (black) to 1 (white). */
|
|
7
|
+
l: number;
|
|
8
|
+
/** Chroma; sRGB tops out near 0.32 depending on hue and lightness. */
|
|
9
|
+
c: number;
|
|
10
|
+
/** Hue angle in degrees. */
|
|
11
|
+
h: number;
|
|
12
|
+
};
|
|
13
|
+
type ThemeName = 'light' | 'dark';
|
|
14
|
+
/** What the user picked; `system` follows the operating system. */
|
|
15
|
+
type ThemePreference = ThemeName | 'system';
|
|
16
|
+
type ChromaticScaleName = 'cobalt' | 'coral' | 'turquoise' | 'success' | 'warning' | 'danger' | 'violet' | 'magenta';
|
|
17
|
+
type ScaleName = ChromaticScaleName | 'slate';
|
|
18
|
+
type ChromaticStep = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 950;
|
|
19
|
+
type NeutralStep = 0 | 25 | ChromaticStep;
|
|
20
|
+
type ChromaticScale = Readonly<Record<ChromaticStep, string>>;
|
|
21
|
+
type NeutralScale = Readonly<Record<NeutralStep, string>>;
|
|
22
|
+
type Scales = Readonly<Record<ChromaticScaleName, ChromaticScale>> & {
|
|
23
|
+
readonly slate: NeutralScale;
|
|
24
|
+
};
|
|
25
|
+
type HueName = ChromaticScaleName;
|
|
26
|
+
type StatusName = 'success' | 'warning' | 'danger' | 'info';
|
|
27
|
+
type ChartIndex = 1 | 2 | 3 | 4 | 5 | 6;
|
|
28
|
+
/** Every theme-dependent colour. Values are always opaque `#rrggbb`. */
|
|
29
|
+
type ColorToken = 'bg-page' | 'bg-surface' | 'bg-raised' | 'bg-inset' | 'bg-overlay' | 'bg-disabled' | 'border' | 'border-strong' | 'border-control' | 'text' | 'text-2' | 'text-3' | 'text-disabled' | 'primary' | 'primary-hover' | 'primary-active' | 'on-primary' | 'primary-soft' | 'primary-soft-hover' | 'primary-line' | 'primary-text' | 'accent' | 'accent-hover' | 'accent-active' | 'on-accent' | 'accent-soft' | 'accent-text' | 'highlight' | 'on-highlight' | 'highlight-soft' | 'highlight-text' | 'focus' | 'selection-bg' | `${StatusName}-${'bg' | 'fg' | 'line' | 'solid' | 'on-solid'}` | `chart-${ChartIndex}` | 'band-bg' | 'band-deep' | 'band-line' | 'band-line-strong' | 'band-text' | 'band-text-2';
|
|
30
|
+
type Theme = Readonly<Record<ColorToken, string>>;
|
|
31
|
+
type Themes = Readonly<Record<ThemeName, Theme>>;
|
|
32
|
+
type FontRole = 'display' | 'body' | 'mono';
|
|
33
|
+
type Fonts = Readonly<Record<FontRole, string>>;
|
|
34
|
+
type FontWeightName = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
35
|
+
type FontWeights = Readonly<Record<FontWeightName, number>>;
|
|
36
|
+
type TypeRole = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'lead' | 'body' | 'small' | 'caption' | 'code';
|
|
37
|
+
type TypeStyle = {
|
|
38
|
+
/** Which family stack the role is set in. */
|
|
39
|
+
readonly font: FontRole;
|
|
40
|
+
/** Font size in CSS pixels at a 16px root; the CSS output is in rem. */
|
|
41
|
+
readonly size: number;
|
|
42
|
+
/** Unitless line height. */
|
|
43
|
+
readonly lineHeight: number;
|
|
44
|
+
/** Font weight on the variable axis. */
|
|
45
|
+
readonly weight: number;
|
|
46
|
+
/** Letter spacing in em. */
|
|
47
|
+
readonly letterSpacing: number;
|
|
48
|
+
/** Font width in percent (`font-stretch`); 100 is the normal width. */
|
|
49
|
+
readonly stretch: number;
|
|
50
|
+
};
|
|
51
|
+
type Typography = Readonly<Record<TypeRole, TypeStyle>>;
|
|
52
|
+
type SpaceStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
|
|
53
|
+
type Spacing = Readonly<Record<SpaceStep, number>>;
|
|
54
|
+
type RadiusName = 'xs' | 'sm' | 'md' | 'lg' | 'pill';
|
|
55
|
+
type Radii = Readonly<Record<RadiusName, number>>;
|
|
56
|
+
type ShadowLevel = 1 | 2 | 3;
|
|
57
|
+
type ThemeEffects = {
|
|
58
|
+
/** Shadow colour as space-separated sRGB channels, for `rgb(<color> / <alpha>)`. */
|
|
59
|
+
readonly 'shadow-color': string;
|
|
60
|
+
/** Base shadow opacity of the theme, as a CSS number. */
|
|
61
|
+
readonly 'shadow-alpha': string;
|
|
62
|
+
/** Resting elevation: cards and segmented controls. */
|
|
63
|
+
readonly 'shadow-1': string;
|
|
64
|
+
/** Raised elevation: menus, popovers, floating cards. */
|
|
65
|
+
readonly 'shadow-2': string;
|
|
66
|
+
/** Top elevation: dialogs and drawers. */
|
|
67
|
+
readonly 'shadow-3': string;
|
|
68
|
+
/** Translucent backdrop behind dialogs. */
|
|
69
|
+
readonly scrim: string;
|
|
70
|
+
};
|
|
71
|
+
type EffectToken = keyof ThemeEffects;
|
|
72
|
+
type Effects = Readonly<Record<ThemeName, ThemeEffects>>;
|
|
73
|
+
/** A colour with its opacity: what `rgb(r g b / a)` says in CSS, as plain values. */
|
|
74
|
+
type EffectTone = {
|
|
75
|
+
/** The colour as an opaque `#rrggbb`. */
|
|
76
|
+
readonly color: string;
|
|
77
|
+
/** Opacity, 0 (transparent) to 1 (solid). */
|
|
78
|
+
readonly alpha: number;
|
|
79
|
+
};
|
|
80
|
+
/** One layer of an elevation shadow; lengths are CSS pixels. */
|
|
81
|
+
type ShadowLayer = {
|
|
82
|
+
/** Horizontal offset. */
|
|
83
|
+
readonly x: number;
|
|
84
|
+
/** Vertical offset. */
|
|
85
|
+
readonly y: number;
|
|
86
|
+
/** Blur radius. */
|
|
87
|
+
readonly blur: number;
|
|
88
|
+
/** Spread radius; negative pulls the shadow in under its box. */
|
|
89
|
+
readonly spread: number;
|
|
90
|
+
/** Opacity of this layer, painted in the theme's shadow colour. */
|
|
91
|
+
readonly alpha: number;
|
|
92
|
+
};
|
|
93
|
+
/** The effects of one theme as numbers and hex, for anything that cannot read CSS. */
|
|
94
|
+
type ThemeEffectValues = {
|
|
95
|
+
/** Shadow colour and base shadow opacity of the theme. */
|
|
96
|
+
readonly shadow: EffectTone;
|
|
97
|
+
/** The layers of each elevation shadow, outermost paint first as in CSS. */
|
|
98
|
+
readonly shadows: Readonly<Record<ShadowLevel, readonly ShadowLayer[]>>;
|
|
99
|
+
/** Translucent backdrop behind dialogs. */
|
|
100
|
+
readonly scrim: EffectTone;
|
|
101
|
+
};
|
|
102
|
+
type EffectValues = Readonly<Record<ThemeName, ThemeEffectValues>>;
|
|
103
|
+
type DurationName = 'fast' | 'base' | 'slow';
|
|
104
|
+
type EasingName = 'standard' | 'enter' | 'exit';
|
|
105
|
+
type Motion = {
|
|
106
|
+
/** Durations in milliseconds. */
|
|
107
|
+
readonly duration: Readonly<Record<DurationName, number>>;
|
|
108
|
+
/** CSS timing functions. */
|
|
109
|
+
readonly easing: Readonly<Record<EasingName, string>>;
|
|
110
|
+
};
|
|
111
|
+
type LayerName = 'base' | 'raised' | 'sticky' | 'dropdown' | 'overlay' | 'modal' | 'popover' | 'toast' | 'tooltip';
|
|
112
|
+
type Layers = Readonly<Record<LayerName, number>>;
|
|
113
|
+
type BreakpointName = 'sm' | 'md' | 'lg' | 'xl';
|
|
114
|
+
type Breakpoints = Readonly<Record<BreakpointName, number>>;
|
|
115
|
+
type ScaleToken = `${ChromaticScaleName}-${ChromaticStep}` | `slate-${NeutralStep}`;
|
|
116
|
+
type TypeProperty = 'size' | 'line-height' | 'weight' | 'letter-spacing' | 'stretch';
|
|
117
|
+
/** Tokens that keep one value in every theme. */
|
|
118
|
+
type StaticToken = ScaleToken | `font-${FontRole}` | `font-weight-${FontWeightName}` | `type-${TypeRole}-${TypeProperty}` | `space-${SpaceStep}` | `radius-${RadiusName}` | `duration-${DurationName}` | `ease-${EasingName}` | `z-${LayerName}`;
|
|
119
|
+
/** Tokens whose value follows the active theme. */
|
|
120
|
+
type ThemedToken = ColorToken | EffectToken;
|
|
121
|
+
/** Every custom property in `tokens.css`, without the `--hd-` prefix. */
|
|
122
|
+
type TokenName = StaticToken | ThemedToken;
|
|
123
|
+
type LogoName = 'mark' | 'horizontal';
|
|
124
|
+
type Logo = {
|
|
125
|
+
/** The SVG `viewBox`. */
|
|
126
|
+
readonly viewBox: string;
|
|
127
|
+
/** Intrinsic width in viewBox units. */
|
|
128
|
+
readonly width: number;
|
|
129
|
+
/** Intrinsic height in viewBox units. */
|
|
130
|
+
readonly height: number;
|
|
131
|
+
/** Path data of everything except the dot; painted with `currentColor`. */
|
|
132
|
+
readonly body: string;
|
|
133
|
+
/** Path data of the square dot of the mark; painted with the accent. */
|
|
134
|
+
readonly dot: string;
|
|
135
|
+
};
|
|
136
|
+
type Logos = Readonly<Record<LogoName, Logo>>;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A `var()` reference to a token: `cssVar("bg-page")` → `var(--hd-bg-page)`.
|
|
140
|
+
* The optional fallback is emitted verbatim: `var(--hd-bg-page, #fff)`.
|
|
141
|
+
*/
|
|
142
|
+
declare const cssVar: (name: TokenName, fallback?: string) => string;
|
|
143
|
+
|
|
144
|
+
/** Every custom property and Sass variable of the package starts with this. */
|
|
145
|
+
declare const CSS_VARIABLE_PREFIX: "hd";
|
|
146
|
+
|
|
147
|
+
/** The custom property name of a token: `cssVarName("bg-page")` → `--hd-bg-page`. */
|
|
148
|
+
declare const cssVarName: <Name extends TokenName>(name: Name) => `--${typeof CSS_VARIABLE_PREFIX}-${Name}`;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Perceptual distance between two hex colours: Euclidean OKLab distance × 100.
|
|
152
|
+
* Around 2 is a just-noticeable difference; the palette keeps chart colours 10 apart.
|
|
153
|
+
*/
|
|
154
|
+
declare const deltaE: (first: string, second: string) => number;
|
|
155
|
+
|
|
156
|
+
/** Converts `#rgb` / `#rrggbb` to OKLCH. Greys report chroma 0 and hue 0. */
|
|
157
|
+
declare const hexToOklch: (hex: string) => Oklch;
|
|
158
|
+
|
|
159
|
+
/** The highest chroma sRGB can show at the given OKLCH lightness and hue. */
|
|
160
|
+
declare const maxChroma: (l: number, h: number) => number;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Converts an OKLCH colour to `#rrggbb`. A colour outside sRGB keeps its lightness and hue
|
|
164
|
+
* and gives up chroma until it fits; channels are never clipped individually.
|
|
165
|
+
*/
|
|
166
|
+
declare const oklchToHex: (color: Oklch) => string;
|
|
167
|
+
|
|
168
|
+
/** Viewport breakpoints in CSS pixels; each is the lower bound of its range. */
|
|
169
|
+
declare const breakpoints: Breakpoints;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The shadows and the scrim as hex and numbers, for anything that cannot read a custom
|
|
173
|
+
* property: an Electron main process, an Open Graph image, a PDF. This is the single source;
|
|
174
|
+
* the CSS strings in `effects` are rendered from it.
|
|
175
|
+
*/
|
|
176
|
+
declare const effectValues: EffectValues;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Theme-dependent values that are not plain colours: the three elevation shadows, the raw
|
|
180
|
+
* shadow colour and opacity for custom shadows, and the dialog scrim. These are the CSS
|
|
181
|
+
* strings of `effectValues`, which holds the same data as hex and numbers.
|
|
182
|
+
*/
|
|
183
|
+
declare const effects: Effects;
|
|
184
|
+
|
|
185
|
+
/** Named font weights. IBM Plex Mono ships only `regular` and `medium`. */
|
|
186
|
+
declare const fontWeights: FontWeights;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Font family stacks. The first family of each stack ships in `fonts.css`; the rest are
|
|
190
|
+
* system fonts that hold the layout while the web font loads or when it is missing.
|
|
191
|
+
*/
|
|
192
|
+
declare const fonts: Fonts;
|
|
193
|
+
|
|
194
|
+
/** OKLCH hue angle of every chromatic family. Neutrals lean to the cobalt hue. */
|
|
195
|
+
declare const hues: Readonly<Record<HueName, number>>;
|
|
196
|
+
|
|
197
|
+
/** `z-index` layers, lowest to highest. The gaps leave room for local stacking. */
|
|
198
|
+
declare const layers: Layers;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The Han Dijit logos as path data, so React and Electron code can draw them inline.
|
|
202
|
+
* `body` takes `currentColor`; `dot` is the square dot of the mark and takes the accent.
|
|
203
|
+
*/
|
|
204
|
+
declare const logos: Logos;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Durations (ms) and easings. `tokens.css` collapses the durations under
|
|
208
|
+
* `prefers-reduced-motion: reduce`; code that animates from JavaScript has to check the
|
|
209
|
+
* media query itself.
|
|
210
|
+
*/
|
|
211
|
+
declare const motion: Motion;
|
|
212
|
+
|
|
213
|
+
/** Corner radii in CSS pixels. `pill` is large enough to round any control fully. */
|
|
214
|
+
declare const radii: Radii;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The raw colour scales. They are the same in every theme; components should reach for
|
|
218
|
+
* the semantic colours in `themes` first.
|
|
219
|
+
*/
|
|
220
|
+
declare const scales: Scales;
|
|
221
|
+
|
|
222
|
+
/** The spacing scale in CSS pixels: every step is its name × 4px. */
|
|
223
|
+
declare const spacing: Spacing;
|
|
224
|
+
|
|
225
|
+
/** The attribute that selects a theme: `<html data-theme="dark">`. */
|
|
226
|
+
declare const THEME_ATTRIBUTE: "data-theme";
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Source of an inline `<script>` for `<head>`. It runs before first paint, sets the theme
|
|
230
|
+
* attribute on `<html>` from the stored choice (or the system theme) and keeps following
|
|
231
|
+
* the system while no explicit choice is stored. Written in ES5 by hand: it is shipped as
|
|
232
|
+
* text, so no compiler ever sees it. Reading storage can throw (sandboxed frames, blocked
|
|
233
|
+
* site data); that counts as "no choice".
|
|
234
|
+
*/
|
|
235
|
+
declare const THEME_BOOT_SCRIPT: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* CSP source expression for `THEME_BOOT_SCRIPT`: put it, in single quotes, in `script-src`.
|
|
239
|
+
* The published build carries the digest as a literal; it is computed when the package is
|
|
240
|
+
* built, not when it is imported.
|
|
241
|
+
*/
|
|
242
|
+
declare const THEME_BOOT_SCRIPT_HASH: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The `localStorage` key holding the user's choice: `"light"`, `"dark"`, or anything else
|
|
246
|
+
* (including no entry) for "follow the system".
|
|
247
|
+
*/
|
|
248
|
+
declare const THEME_STORAGE_KEY: "hd-theme";
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Semantic colours per theme. Every value is an opaque `#rrggbb`, so it can be handed to
|
|
252
|
+
* anything that takes a colour (an Electron window background, a canvas, a chart library).
|
|
253
|
+
*/
|
|
254
|
+
declare const themes: Themes;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The type scale. Sizes are CSS pixels at a 16px root (body is 15px); headings are set in
|
|
258
|
+
* the display family, slightly wide (`stretch` above 100) and tight.
|
|
259
|
+
*/
|
|
260
|
+
declare const typography: Typography;
|
|
261
|
+
|
|
262
|
+
export { CSS_VARIABLE_PREFIX, THEME_ATTRIBUTE, THEME_BOOT_SCRIPT, THEME_BOOT_SCRIPT_HASH, THEME_STORAGE_KEY, breakpoints, contrast, cssVar, cssVarName, deltaE, effectValues, effects, fontWeights, fonts, hexToOklch, hues, layers, logos, maxChroma, motion, oklchToHex, radii, scales, spacing, themes, typography };
|
|
263
|
+
export type { BreakpointName, Breakpoints, ChartIndex, ChromaticScale, ChromaticScaleName, ChromaticStep, ColorToken, DurationName, EasingName, EffectToken, EffectTone, EffectValues, Effects, FontRole, FontWeightName, FontWeights, Fonts, HueName, LayerName, Layers, Logo, LogoName, Logos, Motion, NeutralScale, NeutralStep, Oklch, Radii, RadiusName, ScaleName, ScaleToken, Scales, ShadowLayer, ShadowLevel, SpaceStep, Spacing, StaticToken, StatusName, Theme, ThemeEffectValues, ThemeEffects, ThemeName, ThemePreference, ThemedToken, Themes, TokenName, TypeProperty, TypeRole, TypeStyle, Typography };
|