@g9tm/lynxcontrols-foundation 2.5.2 → 2.5.4
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/catalog/catalog.json +74 -10
- package/catalog/index.md +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/theme/__tests__/sine-curve.vectors.js +5 -0
- package/dist/theme/__tests__/sine-gamut.vectors.js +6 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/oklch.d.ts +36 -6
- package/dist/theme/oklch.d.ts.map +1 -1
- package/dist/theme/oklch.js +133 -6
- package/dist/theme/oklch.js.map +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/shape.d.ts +40 -2
- package/dist/tokens/shape.d.ts.map +1 -1
- package/dist/tokens/shape.js +53 -6
- package/dist/tokens/shape.js.map +1 -1
- package/docs/api.md +10 -2
- package/package.json +1 -1
package/dist/tokens/shape.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens/shape.js","sources":["../../src/tokens/shape.ts"],"sourcesContent":["// The shape of a theme: corner radii, the type roles and the three control heights. With the palette this is the whole\n// look of a template (ShopManager's ShapeSet + CONTROL_HEIGHTS, SAC's radii, G9Hub's rounded-* scale): a recipe or an\n// app swaps shapes, every control reads them through CSS variables (`var(--g9-radius-card)`), so a shape change repaints\n// without a React render.\nimport { toKebabCase } from './css-vars';\n\n/** Corner radii by role, in dp. */\nexport interface G9ShapeRadii {\n readonly control: number;\n readonly field: number;\n readonly chip: number;\n readonly card: number;\n readonly sheet: number;\n readonly dialog: number;\n readonly toast: number;\n /** A pill: half the height (a large value). */\n readonly pill: number;\n}\n\n/** A type role: size and line height in dp, a weight 400…800. */\nexport interface G9TypeRole {\n readonly size: number;\n readonly lineHeight: number;\n readonly weight: 400 | 500 | 600 | 700 | 800;\n}\n\n/** A role of the type scale (display, title, section, body, label, caption, price, mono). */\nexport type G9TypeRoleName = 'display' | 'title' | 'section' | 'body' | 'label' | 'caption' | 'price' | 'mono';\n\n/** The three heights every control family shares (button, field, segmented, stepper, chip in its large size). */\nexport interface G9ControlHeights {\n readonly sm: number;\n readonly md: number;\n readonly lg: number;\n}\n\n/**\n * Font families of a theme, per script (LC-07). Unset: the platform's own (the stock look). Every G9 text reads\n * `var(--g9-font-text)`, which a right-to-left root takes from `arabic` and a left-to-right one from `latin`; no letter\n * spacing is ever added to Arabic script (`.g9-dir-rtl` sets it to 0).\n */\nexport interface G9ThemeFonts {\n /** Latin and the other left-to-right scripts. */\n readonly latin?: string;\n /** Arabic script (Persian, Arabic, Urdu): the font of a right-to-left culture. */\n readonly arabic?: string;\n /** Numbers and code (`--g9-font-mono`, for the app's own styles). */\n readonly mono?: string;\n}\n\n/** A named density step (LC-07): the three control heights move together. */\nexport type G9Density = 'compact' | 'regular' | 'comfortable';\n\n/** What each density step adds to every control height, in dp (`regular` is the stock look). */\nexport const g9DensitySteps: Readonly<Record<G9Density, number>> = Object.freeze({\n compact: -4,\n regular: 0,\n comfortable: 8,\n});\n\n/** The platform's minimum touch target in dp: no density or override takes `touchTarget` under it. */\nexport const g9MinTouchTarget = 44;\n\n/** A theme's shape: corner radii per role, the type scale and the three control heights. */\nexport interface G9ShapeSet {\n readonly radii: G9ShapeRadii;\n readonly type: { readonly [K in G9TypeRoleName]: G9TypeRole };\n readonly heights: G9ControlHeights;\n /** Minimum touch target (oracles flag smaller interactive elements). Default 44, never under {@link g9MinTouchTarget}. */\n readonly touchTarget: number;\n /** Font families per script; unset: the platform's own. */\n readonly fonts?: G9ThemeFonts;\n /** The density step the heights stand at. Default `regular`. */\n readonly density?: G9Density;\n}\n\n/** The default shape: 12 px controls and fields, 16 px cards, 24 px sheets, the type scale and heights 36 / 44 / 52. */\nexport const g9DefaultShape: G9ShapeSet = Object.freeze({\n radii: Object.freeze({ control: 12, field: 12, chip: 999, card: 16, sheet: 24, dialog: 20, toast: 14, pill: 999 }),\n type: Object.freeze({\n display: { size: 28, lineHeight: 40, weight: 800 },\n title: { size: 20, lineHeight: 30, weight: 700 },\n section: { size: 16, lineHeight: 26, weight: 700 },\n body: { size: 14, lineHeight: 24, weight: 400 },\n label: { size: 14, lineHeight: 20, weight: 600 },\n caption: { size: 12, lineHeight: 18, weight: 400 },\n price: { size: 16, lineHeight: 24, weight: 700 },\n mono: { size: 13, lineHeight: 20, weight: 500 },\n }),\n heights: Object.freeze({ sm: 40, md: 44, lg: 52 }),\n touchTarget: 44,\n}) as G9ShapeSet;\n\n/**\n * A shape with some parts replaced (deep for radii, type roles, heights and fonts). A `density` moves the base's three\n * heights together by the step's difference from the base's own step (explicit `heights` still win, part by part);\n * `touchTarget` never goes under {@link g9MinTouchTarget}.\n */\nexport function resolveShape(over: Partial<G9ShapeSet> | undefined, base: G9ShapeSet = g9DefaultShape): G9ShapeSet {\n if (!over) return base;\n const density = over.density ?? base.density;\n const shift = g9DensitySteps[density ?? 'regular'] - g9DensitySteps[base.density ?? 'regular'];\n const moved = shift\n ? { sm: base.heights.sm + shift, md: base.heights.md + shift, lg: base.heights.lg + shift }\n : base.heights;\n const fonts = over.fonts || base.fonts ? Object.freeze({ ...base.fonts, ...over.fonts }) : undefined;\n return Object.freeze({\n radii: Object.freeze({ ...base.radii, ...over.radii }),\n type: Object.freeze({ ...base.type, ...over.type }),\n heights: Object.freeze({ ...moved, ...over.heights }),\n touchTarget: Math.max(g9MinTouchTarget, over.touchTarget ?? base.touchTarget),\n ...(fonts ? { fonts } : {}),\n ...(density ? { density } : {}),\n });\n}\n\n/**\n * CSS variables of a shape: `--g9-radius-<role>`, `--g9-type-<role>-size|line|weight`, `--g9-height-sm|md|lg`,\n * `--g9-touch-target` (all px), and `--g9-font-latin|arabic|mono` for the families a theme names. With a `direction`,\n * also `--g9-font-text`: the family of that direction's script (what every G9 text style reads).\n */\nexport function toShapeCssVariables(shape: G9ShapeSet, direction?: 'ltr' | 'rtl'): Readonly<Record<string, string>> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(shape.radii)) out[`--g9-radius-${toKebabCase(k)}`] = `${v}px`;\n for (const [k, v] of Object.entries(shape.type)) {\n out[`--g9-type-${k}-size`] = `${v.size}px`;\n out[`--g9-type-${k}-line`] = `${v.lineHeight}px`;\n out[`--g9-type-${k}-weight`] = String(v.weight);\n }\n for (const [k, v] of Object.entries(shape.heights)) out[`--g9-height-${k}`] = `${v}px`;\n out['--g9-touch-target'] = `${shape.touchTarget}px`;\n // only the families a theme names: unset, a text keeps the platform's font (the stock look is untouched)\n for (const [script, family] of Object.entries(shape.fonts ?? {}))\n if (typeof family === 'string' && family) out[`--g9-font-${script}`] = family;\n // the font every G9 text reads, as a literal: native Lynx does not resolve a variable a stylesheet rule defines from\n // another one (`--a: var(--b)` stayed unresolved on the A21s), so the provider writes it for its root's direction\n const text = direction === 'rtl' ? shape.fonts?.arabic : direction === 'ltr' ? shape.fonts?.latin : undefined;\n if (text) out['--g9-font-text'] = text;\n return out;\n}\n"],"names":["g9DensitySteps","Object","g9MinTouchTarget","g9DefaultShape","resolveShape","over","base","_over_density","_base_density","_over_touchTarget","density","shift","moved","fonts","undefined","Math","toShapeCssVariables","shape","direction","_shape_fonts","_shape_fonts1","_shape_fonts2","out","k","v","toKebabCase","String","script","family","text"],"mappings":";AAsDO,MAAMA,iBAAsDC,OAAO,MAAM,CAAC;IAC/E,SAAS;IACT,SAAS;IACT,aAAa;AACf;AAGO,MAAMC,mBAAmB;AAgBzB,MAAMC,iBAA6BF,OAAO,MAAM,CAAC;IACtD,OAAOA,OAAO,MAAM,CAAC;QAAE,SAAS;QAAI,OAAO;QAAI,MAAM;QAAK,MAAM;QAAI,OAAO;QAAI,QAAQ;QAAI,OAAO;QAAI,MAAM;IAAI;IAChH,MAAMA,OAAO,MAAM,CAAC;QAClB,SAAS;YAAE,MAAM;YAAI,YAAY;YAAI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AG,GAAGC,EAAE,EAAE,CAAC;IACtFF,GAAG,CAAC,oBAAoB,GAAG,GAAGL,MAAM,WAAW,CAAC,EAAE,CAAC;IAEnD,KAAK,MAAM,CAACU,QAAQC,OAAO,IAAI3B,OAAO,OAAO,CAAC,QAAAkB,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAe,CAAC,GAC5D,IAAI,AAAkB,YAAlB,OAAOS,UAAuBA,QAAQN,GAAG,CAAC,CAAC,UAAU,EAAEK,QAAQ,CAAC,GAAGC;IAGzE,MAAMC,OAAOX,AAAc,UAAdA,YAAsB,QAAAE,CAAAA,gBAAAA,MAAM,KAAK,AAAD,IAAVA,KAAAA,IAAAA,cAAa,MAAM,GAAGF,AAAc,UAAdA,YAAsB,QAAAG,CAAAA,gBAAAA,MAAM,KAAK,AAAD,IAAVA,KAAAA,IAAAA,cAAa,KAAK,GAAGP;IACpG,IAAIe,MAAMP,GAAG,CAAC,iBAAiB,GAAGO;IAClC,OAAOP;AACT"}
|
|
1
|
+
{"version":3,"file":"tokens/shape.js","sources":["../../src/tokens/shape.ts"],"sourcesContent":["// The shape of a theme: corner radii, the type roles and the three control heights. With the palette this is the whole\n// look of a template (ShopManager's ShapeSet + CONTROL_HEIGHTS, SAC's radii, G9Hub's rounded-* scale): a recipe or an\n// app swaps shapes, every control reads them through CSS variables (`var(--g9-radius-card)`), so a shape change repaints\n// without a React render.\nimport { toKebabCase } from './css-vars';\n\n/** Corner radii by role, in dp. */\nexport interface G9ShapeRadii {\n readonly control: number;\n readonly field: number;\n readonly chip: number;\n readonly card: number;\n readonly sheet: number;\n readonly dialog: number;\n readonly toast: number;\n /** A pill: half the height (a large value). */\n readonly pill: number;\n}\n\n/** A type role: size and line height in dp, a weight 400…800. */\nexport interface G9TypeRole {\n readonly size: number;\n readonly lineHeight: number;\n readonly weight: 400 | 500 | 600 | 700 | 800;\n}\n\n/** A role of the type scale (display, title, section, body, label, caption, price, mono). */\nexport type G9TypeRoleName = 'display' | 'title' | 'section' | 'body' | 'label' | 'caption' | 'price' | 'mono';\n\n/** The three heights every control family shares (button, field, segmented, stepper, chip in its large size). */\nexport interface G9ControlHeights {\n readonly sm: number;\n readonly md: number;\n readonly lg: number;\n}\n\n/**\n * Font families of a theme, per script (LC-07). Unset: the platform's own (the stock look). Every G9 text reads\n * `var(--g9-font-text)`, which a right-to-left root takes from `arabic` and a left-to-right one from `latin`; no letter\n * spacing is ever added to Arabic script (`.g9-dir-rtl` sets it to 0).\n */\nexport interface G9ThemeFonts {\n /** Latin and the other left-to-right scripts. */\n readonly latin?: string;\n /** Arabic script (Persian, Arabic, Urdu): the font of a right-to-left culture. */\n readonly arabic?: string;\n /** Numbers and code (`--g9-font-mono`, for the app's own styles). */\n readonly mono?: string;\n /**\n * One family per weight for `latin` (`{ 500: 'InterMedium', 700: 'InterBold' }`): Lynx on Android ignores an\n * `@font-face` weight, so a family that has only its regular file draws 600 and 700 as a synthesised bold. Each G9 text\n * of weight 500, 600, 700 or 800 then reads `--g9-font-text-<weight>`. A weight left out takes the nearest heavier one\n * given, else the nearest lighter, else `latin` itself.\n */\n readonly latinByWeight?: G9FontWeights;\n /** As {@link G9ThemeFonts.latinByWeight}, for `arabic` (Riskara: `{ 500: 'RkSansMd', 700: 'RkSansBd' }`). */\n readonly arabicByWeight?: G9FontWeights;\n /** As {@link G9ThemeFonts.latinByWeight}, for `mono` (`--g9-font-mono-<weight>`). */\n readonly monoByWeight?: G9FontWeights;\n}\n\n/** The weights a theme can give a family of its own (400 is the script's base family). */\nexport type G9FontWeight = 500 | 600 | 700 | 800;\n\n/** A family per weight (see {@link G9ThemeFonts.latinByWeight}). */\nexport type G9FontWeights = { readonly [W in G9FontWeight]?: string };\n\n/** The weights every G9 text style can ask a family for. */\nexport const g9FontWeights: readonly G9FontWeight[] = [500, 600, 700, 800];\n\n/** The variable each weight's family is written to, spelled out (the stylesheets read these names). */\nconst FONT_TEXT_VAR: Readonly<Record<G9FontWeight, string>> = {\n 500: '--g9-font-text-500',\n 600: '--g9-font-text-600',\n 700: '--g9-font-text-700',\n 800: '--g9-font-text-800',\n};\n\n/**\n * The family for `weight` from a base family and its per-weight families: the exact one, else the nearest heavier\n * given, else the nearest lighter, else the base. Undefined when there is no family at all (the platform's font).\n */\nexport function familyForWeight(\n weight: 400 | G9FontWeight,\n base: string | undefined,\n byWeight: G9FontWeights | undefined,\n): string | undefined {\n if (weight === 400 || !byWeight) return base || undefined;\n const given = g9FontWeights.filter((w) => typeof byWeight[w] === 'string' && byWeight[w]);\n const pick =\n given.find((w) => w === weight) ?? given.find((w) => w > weight) ?? [...given].reverse().find((w) => w < weight);\n return (pick ? byWeight[pick] : base) || undefined;\n}\n\n/**\n * The `font-family` value for a G9 text of `weight` in a style written in code (an inline style): the provider's\n * per-weight variable (`var(--g9-font-text-700)`), or the base one for 400 and lighter.\n */\nexport function g9FontFamilyFor(weight: number | 'bold' | 'normal'): string {\n const w = weight === 'bold' ? 700 : weight === 'normal' ? 400 : weight;\n if (w < 500) return 'var(--g9-font-text)';\n return `var(${FONT_TEXT_VAR[w >= 800 ? 800 : w >= 700 ? 700 : w >= 600 ? 600 : 500]})`;\n}\n\n/** A named density step (LC-07): the three control heights move together. */\nexport type G9Density = 'compact' | 'regular' | 'comfortable';\n\n/** What each density step adds to every control height, in dp (`regular` is the stock look). */\nexport const g9DensitySteps: Readonly<Record<G9Density, number>> = Object.freeze({\n compact: -4,\n regular: 0,\n comfortable: 8,\n});\n\n/** The platform's minimum touch target in dp: no density or override takes `touchTarget` under it. */\nexport const g9MinTouchTarget = 44;\n\n/** A theme's shape: corner radii per role, the type scale and the three control heights. */\nexport interface G9ShapeSet {\n readonly radii: G9ShapeRadii;\n readonly type: { readonly [K in G9TypeRoleName]: G9TypeRole };\n readonly heights: G9ControlHeights;\n /**\n * `'shared'`: the controls take their sizes from {@link G9ShapeSet.heights} (a design system that sizes every control\n * from three heights: ShopManager's 40/48/56 and, for gloves, 44/56/64). G9Button small/medium/large = sm/md/lg (its\n * label at `type.label`'s size, small 2 smaller); G9IconButton sm/md/lg = sm/md/lg; G9TextEntry = md; G9Chip = sm\n * (lg: md); G9Segmented = sm items in a 4 dp tray; G9Stepper = an md tray (lg: lg) with sm buttons. Default `'own'`:\n * each control keeps its own table (the stock look).\n */\n readonly sizing?: 'own' | 'shared';\n /** Minimum touch target (oracles flag smaller interactive elements). Default 44, never under {@link g9MinTouchTarget}. */\n readonly touchTarget: number;\n /** Font families per script; unset: the platform's own. */\n readonly fonts?: G9ThemeFonts;\n /** The density step the heights stand at. Default `regular`. */\n readonly density?: G9Density;\n}\n\n/** The default shape: 12 px controls and fields, 16 px cards, 24 px sheets, the type scale and heights 36 / 44 / 52. */\nexport const g9DefaultShape: G9ShapeSet = Object.freeze({\n radii: Object.freeze({ control: 12, field: 12, chip: 999, card: 16, sheet: 24, dialog: 20, toast: 14, pill: 999 }),\n type: Object.freeze({\n display: { size: 28, lineHeight: 40, weight: 800 },\n title: { size: 20, lineHeight: 30, weight: 700 },\n section: { size: 16, lineHeight: 26, weight: 700 },\n body: { size: 14, lineHeight: 24, weight: 400 },\n label: { size: 14, lineHeight: 20, weight: 600 },\n caption: { size: 12, lineHeight: 18, weight: 400 },\n price: { size: 16, lineHeight: 24, weight: 700 },\n mono: { size: 13, lineHeight: 20, weight: 500 },\n }),\n heights: Object.freeze({ sm: 40, md: 44, lg: 52 }),\n touchTarget: 44,\n}) as G9ShapeSet;\n\n/**\n * A shape with some parts replaced (deep for radii, type roles, heights and fonts). A `density` moves the base's three\n * heights together by the step's difference from the base's own step (explicit `heights` still win, part by part);\n * `touchTarget` never goes under {@link g9MinTouchTarget}.\n */\nexport function resolveShape(over: Partial<G9ShapeSet> | undefined, base: G9ShapeSet = g9DefaultShape): G9ShapeSet {\n if (!over) return base;\n const density = over.density ?? base.density;\n const shift = g9DensitySteps[density ?? 'regular'] - g9DensitySteps[base.density ?? 'regular'];\n const moved = shift\n ? { sm: base.heights.sm + shift, md: base.heights.md + shift, lg: base.heights.lg + shift }\n : base.heights;\n const fonts = over.fonts || base.fonts ? Object.freeze({ ...base.fonts, ...over.fonts }) : undefined;\n return Object.freeze({\n radii: Object.freeze({ ...base.radii, ...over.radii }),\n type: Object.freeze({ ...base.type, ...over.type }),\n heights: Object.freeze({ ...moved, ...over.heights }),\n touchTarget: Math.max(g9MinTouchTarget, over.touchTarget ?? base.touchTarget),\n ...(fonts ? { fonts } : {}),\n ...(density ? { density } : {}),\n ...((over.sizing ?? base.sizing) ? { sizing: over.sizing ?? base.sizing } : {}),\n });\n}\n\n/**\n * CSS variables of a shape: `--g9-radius-<role>`, `--g9-type-<role>-size|line|weight`, `--g9-height-sm|md|lg`,\n * `--g9-touch-target` (all px), and `--g9-font-latin|arabic|mono` (plus `-500|600|700|800`) for the families a theme\n * names. With a `direction`, also `--g9-font-text` and `--g9-font-text-500|600|700|800`: the families of that direction's\n * script (what every G9 text style reads, by its weight).\n */\nexport function toShapeCssVariables(shape: G9ShapeSet, direction?: 'ltr' | 'rtl'): Readonly<Record<string, string>> {\n const out: Record<string, string> = {};\n for (const [k, v] of Object.entries(shape.radii)) out[`--g9-radius-${toKebabCase(k)}`] = `${v}px`;\n for (const [k, v] of Object.entries(shape.type)) {\n out[`--g9-type-${k}-size`] = `${v.size}px`;\n out[`--g9-type-${k}-line`] = `${v.lineHeight}px`;\n out[`--g9-type-${k}-weight`] = String(v.weight);\n }\n for (const [k, v] of Object.entries(shape.heights)) out[`--g9-height-${k}`] = `${v}px`;\n out['--g9-touch-target'] = `${shape.touchTarget}px`;\n // only the families a theme names: unset, a text keeps the platform's font (the stock look is untouched)\n const fonts = shape.fonts ?? {};\n for (const script of ['latin', 'arabic', 'mono'] as const) {\n const family = fonts[script];\n if (typeof family === 'string' && family) out[`--g9-font-${script}`] = family;\n for (const w of g9FontWeights) {\n const f = familyForWeight(w, family, fonts[`${script}ByWeight`]);\n if (f) out[`--g9-font-${script}-${w}`] = f;\n }\n }\n // the font every G9 text reads, as a literal: native Lynx does not resolve a variable a stylesheet rule defines from\n // another one (`--a: var(--b)` stayed unresolved on the A21s), so the provider writes it for its root's direction\n const script = direction === 'rtl' ? 'arabic' : direction === 'ltr' ? 'latin' : undefined;\n if (script) {\n const text = fonts[script];\n if (text) out['--g9-font-text'] = text;\n // one literal per weight as well (a G9 text of weight 500 to 800 reads its own; see G9ThemeFonts.latinByWeight)\n for (const w of g9FontWeights) {\n const f = familyForWeight(w, text, fonts[`${script}ByWeight`]);\n if (f) out[FONT_TEXT_VAR[w]] = f;\n }\n }\n return out;\n}\n"],"names":["g9FontWeights","FONT_TEXT_VAR","familyForWeight","weight","base","byWeight","_ref","undefined","given","w","pick","g9FontFamilyFor","g9DensitySteps","Object","g9MinTouchTarget","g9DefaultShape","resolveShape","over","_over_density","_base_density","_over_touchTarget","_over_sizing","_over_sizing1","density","shift","moved","fonts","Math","toShapeCssVariables","shape","direction","_shape_fonts","out","k","v","toKebabCase","String","script","family","f","text"],"mappings":";AAoEO,MAAMA,gBAAyC;IAAC;IAAK;IAAK;IAAK;CAAI;AAG1E,MAAMC,gBAAwD;IAC5D,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;AACP;AAMO,SAASC,gBACdC,MAA0B,EAC1BC,IAAwB,EACxBC,QAAmC;QAKjCC,MAAAA;IAHF,IAAIH,AAAW,QAAXA,UAAkB,CAACE,UAAU,OAAOD,QAAQG;IAChD,MAAMC,QAAQR,cAAc,MAAM,CAAC,CAACS,IAAM,AAAuB,YAAvB,OAAOJ,QAAQ,CAACI,EAAE,IAAiBJ,QAAQ,CAACI,EAAE;IACxF,MAAMC,OAAAA,QACJJ,CAAAA,OAAAA,QAAAA,CAAAA,cAAAA,MAAM,IAAI,CAAC,CAACG,IAAMA,MAAMN,OAAM,IAA9BG,cAAmCE,MAAM,IAAI,CAAC,CAACC,IAAMA,IAAIN,OAAM,IAA/DG,OAAoE;WAAIE;KAAM,CAAC,OAAO,GAAG,IAAI,CAAC,CAACC,IAAMA,IAAIN;IAC3G,OAAQO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N,GAAG,CAAC,CAAC,UAAU,EAAEK,QAAQ,CAAC,GAAGC;QACvE,KAAK,MAAM7B,KAAKT,cAAe;YAC7B,MAAMuC,IAAIrC,gBAAgBO,GAAG6B,QAAQZ,KAAK,CAAC,GAAGW,OAAO,QAAQ,CAAC,CAAC;YAC/D,IAAIE,GAAGP,GAAG,CAAC,CAAC,UAAU,EAAEK,OAAO,CAAC,EAAE5B,GAAG,CAAC,GAAG8B;QAC3C;IACF;IAGA,MAAMF,SAASP,AAAc,UAAdA,YAAsB,WAAWA,AAAc,UAAdA,YAAsB,UAAUvB;IAChF,IAAI8B,QAAQ;QACV,MAAMG,OAAOd,KAAK,CAACW,OAAO;QAC1B,IAAIG,MAAMR,GAAG,CAAC,iBAAiB,GAAGQ;QAElC,KAAK,MAAM/B,KAAKT,cAAe;YAC7B,MAAMuC,IAAIrC,gBAAgBO,GAAG+B,MAAMd,KAAK,CAAC,GAAGW,OAAO,QAAQ,CAAC,CAAC;YAC7D,IAAIE,GAAGP,GAAG,CAAC/B,aAAa,CAACQ,EAAE,CAAC,GAAG8B;QACjC;IACF;IACA,OAAOP;AACT"}
|
package/docs/api.md
CHANGED
|
@@ -10,6 +10,8 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
10
10
|
| --- | --- | --- |
|
|
11
11
|
| `cssVariableName` | function | CSS variable of a colour token: `Primary` → `--g9-primary` (plan/specs/01-Architecture.md §6). |
|
|
12
12
|
| `cssVariablesToText` | function | Renders variables as CSS declarations inside `selector`, one per line (e.g. for a generated stylesheet). |
|
|
13
|
+
| `familyForWeight` | function | The family for `weight` from a base family and its per-weight families: the exact one, else the nearest heavier given, else the nearest lighter, else the base. Undefined when there is no family at all (the platform's font). |
|
|
14
|
+
| `g9FontFamilyFor` | function | The `font-family` value for a G9 text of `weight` in a style written in code (an inline style): the provider's per-weight variable (`var(--g9-font-text-700)`), or the base one for 400 and lighter. |
|
|
13
15
|
| `g9Token` | function | A colour usable in any G9 colour prop or stylesheet that follows the active theme: `g9Token('Primary')` is `var(--g9-primary)`. Replaces the MAUI `{G9Color Primary}` markup extension. |
|
|
14
16
|
| `layoutCssVariableName` | function | CSS variable of a layout metric: `EdgeSpacing` → `--g9-layout-edge-spacing`. Insets and corner radii are emitted per side/corner, e.g. `--g9-layout-body-padding-start`, `--g9-layout-map-chrome-corner-radius-top-end`. |
|
|
15
17
|
| `metricCssVariableName` | function | CSS variable of a `G9Metrics` value: `RadiusMd` → `--g9-metric-radius-md`. |
|
|
@@ -23,13 +25,14 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
23
25
|
| `toLayoutCssVariables` | function | The layout metrics as CSS variables (the counterpart of MAUI `G9LayoutMetrics.InstallDefaults`, which seeded the resource keys XAML bound to). Lengths get `px`, `DeferredContentLoadDelayMs` gets `ms`, counts and ratios none. |
|
|
24
26
|
| `toMetricCssVariables` | function | One `--g9-metric-<name>` variable per `G9Metrics` value, with its unit (`px`, `ms` or none). |
|
|
25
27
|
| `toRootCssVariables` | function | Every CSS variable a `G9Provider` root carries for a theme, a shape and a direction: the metrics (`--g9-metric-*`), the layout metrics (`--g9-layout-*`), the shape (`--g9-radius-*`, `--g9-type-*`, `--g9-height-*`, `--g9-touch-target`, the fonts), the colour tokens and the derived colours. What the provider writes at mount (less a theme's token aliases), so a page outside Lynx — the static-render contract of `@g9tm/lynxcontrols-web/static` — reads the same values the app does. |
|
|
26
|
-
| `toShapeCssVariables` | function | CSS variables of a shape: `--g9-radius-<role>`, `--g9-type-<role>-size\|line\|weight`, `--g9-height-sm\|md\|lg`, `--g9-touch-target` (all px), and `--g9-font-latin\|arabic\|mono` for the families a theme names. With a `direction`, also `--g9-font-text`: the
|
|
28
|
+
| `toShapeCssVariables` | function | CSS variables of a shape: `--g9-radius-<role>`, `--g9-type-<role>-size\|line\|weight`, `--g9-height-sm\|md\|lg`, `--g9-touch-target` (all px), and `--g9-font-latin\|arabic\|mono` (plus `-500\|600\|700\|800`) for the families a theme names. With a `direction`, also `--g9-font-text` and `--g9-font-text-500\|600\|700\|800`: the families of that direction's script (what every G9 text style reads, by its weight). |
|
|
27
29
|
| `G9ColorToken` | enum | The colour tokens of the G9 theme in MAUI declaration order (MAUI `G9ColorToken`). Values keep the MAUI names so `G9ColorToken.Primary === 'Primary'`; the CSS variable is `--g9-primary` (see `cssVariableName`). |
|
|
28
30
|
| `g9ColorTokens` | constant | Every token, in declaration order. |
|
|
29
31
|
| `g9DarkPalette` | constant | The stock dark palette (MAUI `G9Theme.Dark.xaml`). |
|
|
30
32
|
| `g9DefaultShape` | constant | The default shape: 12 px controls and fields, 16 px cards, 24 px sheets, the type scale and heights 36 / 44 / 52. |
|
|
31
33
|
| `g9DensitySteps` | constant | What each density step adds to every control height, in dp (`regular` is the stock look). |
|
|
32
34
|
| `g9Derived` | constant | The derived variables, as `var(...)` references (what controls write into their styles). |
|
|
35
|
+
| `g9FontWeights` | constant | The weights every G9 text style can ask a family for. |
|
|
33
36
|
| `g9GradientTokens` | constant | The tokens a solid button paints as a soft vertical gradient (MAUI `BuildSolidOrGradient`). |
|
|
34
37
|
| `g9LayoutMetricConstants` | constant | Compile-time constants of MAUI `G9LayoutMetrics`: never read from resources, so not overridable. |
|
|
35
38
|
| `g9LayoutMetricDefaults` | constant | The layout metrics an app may retune (MAUI read these from `Application.Resources` with the literal fallbacks below; the census card `Core.Theming` lists them as `=> D(nameof(X), n)`, `Th(…)` and `Cr(…)`). |
|
|
@@ -49,6 +52,8 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
49
52
|
| `G9CornerRadius` | type | A corner radius: one value for all four corners, or one per corner. |
|
|
50
53
|
| `G9CssVariables` | type | A set of CSS custom properties: name (`--g9-…`) to value. Feed it to a root element's style or `setProperty`. |
|
|
51
54
|
| `G9Density` | type | A named density step (LC-07): the three control heights move together. |
|
|
55
|
+
| `G9FontWeight` | type | The weights a theme can give a family of its own (400 is the script's base family). |
|
|
56
|
+
| `G9FontWeights` | type | A family per weight (see `G9ThemeFonts.latinByWeight`). |
|
|
52
57
|
| `G9GradientToken` | type | A colour token that has gradient stops (`--g9-<token>-grad-top` / `-grad-bottom`). |
|
|
53
58
|
| `G9LayoutMetricOverrides` | type | Values an app may override; `MapBottomBarMargin` is derived from `MapChromeEdgeSpacing` unless overridden. |
|
|
54
59
|
| `G9LayoutMetrics` | type | Every layout metric, resolved (MAUI `G9LayoutMetrics`). |
|
|
@@ -99,6 +104,7 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
99
104
|
| `ensureContrast` | function | `fg` moved in lightness (hue and chroma kept) until its WCAG contrast with `bg` is at least `min`. Goes darker on a light background and lighter on a dark one; returns `fg` unchanged when it already passes. If no lightness of this hue reaches `min`, returns black or white, whichever contrasts more. |
|
|
100
105
|
| `exportTheme` | function | A theme as portable JSON (personal themes, sharing, backup). |
|
|
101
106
|
| `fillToCss` | function | A fill as a CSS `background` value: the colour, or `linear-gradient(to bottom, …)`. |
|
|
107
|
+
| `fixedNeutralScale` | function | Neutrals of a fixed hue and chroma, whatever the brand (warm paper, cool steel), on the sine curve's lightness steps (ShopManager's `fixedNeutralScale`). |
|
|
102
108
|
| `formatColor` | function | Formats a colour as CSS: `#RRGGBB` when opaque, otherwise `rgba(R, G, B, A)`. Channels are rounded to the nearest byte; the alpha is printed with the fewest digits that parse back to the same float32 value, so `parseColor(formatColor(c))` reproduces the alpha exactly. |
|
|
103
109
|
| `fromOklch` | function | OKLCH → sRGB (`G9Rgba`, channels 0..1). Out-of-gamut colours keep L and H and lose chroma until they fit (binary search, 18 steps ≈ 1e-6 chroma), so a vivid brand never shifts hue when it is darkened or lightened. |
|
|
104
110
|
| `getContrastingTextColor` | function | Black on light backgrounds (luminance above 0.5), white otherwise. MAUI `GetContrastingTextColor`. |
|
|
@@ -119,7 +125,7 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
119
125
|
| `mixOklch` | function | Linear interpolation in OKLCH (shorter hue arc). `t` 0..1. |
|
|
120
126
|
| `nearestTonalStep` | function | The step whose lightness is nearest to `color`'s. |
|
|
121
127
|
| `neutralScale` | function | A neutral scale tinted by `color`: the brand's hue at a whisper of chroma (`tint` 0 = pure grey, 1 = 0.02 C, the strongest tint that still reads as grey), so surfaces and text belong to the brand without looking coloured. |
|
|
122
|
-
| `oklchToHex` | function | OKLCH → `#RRGGBB` (or `#RRGGBBAA` with alpha < 1). |
|
|
128
|
+
| `oklchToHex` | function | OKLCH → `#RRGGBB` (or `#RRGGBBAA` with alpha < 1). `gamut: 'steps'` maps an out-of-sRGB colour by cutting chroma 10 % at a time (ShopManager's `@g9/tokens`, to the hex; opaque) instead of the default binary search. |
|
|
123
129
|
| `overriddenTokens` | function | Tokens a theme overrides (for a "what is changed" list in a theme editor). |
|
|
124
130
|
| `parseColor` | function | Parses a CSS colour: `#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa` (CSS order, alpha last), `rgb(r, g, b)`, `rgba(r, g, b, a)` (channels 0–255 or percentages, alpha 0–1 or a percentage) and `transparent`. Named colours other than `transparent` are not accepted: the palette tokens are the names. |
|
|
125
131
|
| `parseCssColor` | function | Parses any colour Lynx might be handed by a design tool or a web theme: hex, rgb/rgba, hsl/hsla, oklch, oklab, color-mix (in srgb, oklch or oklab, with percentages), a few named colours. Returns channels, or `undefined`. |
|
|
@@ -169,10 +175,12 @@ folder) explain how the pieces fit; the migration tables map every MAUI member.
|
|
|
169
175
|
| `G9DesignRegistry` | interface | Pilot's `DesignRegistry`. |
|
|
170
176
|
| `G9DesignRegistryOptions` | interface | What `createDesignRegistry` edits live: the theme store and, when the app allows it, the shape. |
|
|
171
177
|
| `G9DesignToken` | interface | One token as Pilot reads it. |
|
|
178
|
+
| `G9EnsureContrastOptions` | interface | Options of `ensureContrast`. |
|
|
172
179
|
| `G9GradientStop` | interface | A gradient stop: colour at `offset` (`0..1`). |
|
|
173
180
|
| `G9Oklch` | interface | A colour in OKLCH. `alpha` 0..1 (default 1). |
|
|
174
181
|
| `G9ResolvedTheme` | interface | A resolved theme: what is painted and why. Frozen. |
|
|
175
182
|
| `G9Rgba` | interface | A colour as four channels in `0..1`, stored at float32 precision exactly like MAUI `Color`. Colour arithmetic (darken, mix, contrast) runs on this shape so its results match the original helpers bit for bit; format with `formatColor` to get a CSS string back. |
|
|
183
|
+
| `G9ScaleOptions` | interface | Options of `tonalScale` and `neutralScale`. |
|
|
176
184
|
| `G9ThemeDefinition` | interface | One selectable theme. |
|
|
177
185
|
| `G9ThemeOptions` | interface | Inputs of theme resolution. |
|
|
178
186
|
| `G9ThemeRecipe` | interface | A named recipe. |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols-foundation",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Pure TypeScript core: design tokens, theme model, culture (strings, digits, calendars, relative time, durations), icon model, safe execution, diagnostics, preference and capability contracts. No React, no UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|