@vectoriox/iox-ui 5.14.0 → 5.16.0
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/design-core/index.d.ts +190 -25
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +393 -62
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +38 -12
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/index.d.ts +18 -3
- package/package.json +1 -1
- package/src/design-core/design-apply.ts +116 -0
- package/src/design-core/design-settings.ts +194 -0
- package/src/design-core/empty-image.ts +14 -5
- package/src/design-core/flavor-seed.ts +39 -13
- package/src/design-core/flavor-spec.generated.ts +14 -6
- package/src/design-core/flavor.ts +6 -5
- package/src/design-core/fonts.ts +45 -8
- package/src/design-core/public-api.ts +2 -0
- package/src/design-core/token-css.ts +32 -2
- package/src/design-core/token-names.ts +21 -0
package/design-core/index.d.ts
CHANGED
|
@@ -882,7 +882,7 @@ declare const SPEC_SPRINGS: {
|
|
|
882
882
|
};
|
|
883
883
|
};
|
|
884
884
|
declare const SPEC_FONTS: {
|
|
885
|
-
readonly Inter: "Inter:wght@400;500;600;700";
|
|
885
|
+
readonly Inter: "Inter:wght@300;400;500;600;700";
|
|
886
886
|
readonly "Inter Tight": "Inter+Tight:wght@500;600;700";
|
|
887
887
|
readonly Manrope: "Manrope:wght@400;500;600;700";
|
|
888
888
|
readonly "IBM Plex Sans": "IBM+Plex+Sans:wght@400;500;600;700";
|
|
@@ -897,12 +897,21 @@ declare const SPEC_FONTS: {
|
|
|
897
897
|
readonly Figtree: "Figtree:wght@400;500;600;700;800";
|
|
898
898
|
readonly "Google Sans Flex": "Google+Sans+Flex:wght@400;500;600;700";
|
|
899
899
|
readonly "Bricolage Grotesque": "Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700";
|
|
900
|
-
readonly Nunito: "Nunito:wght@400;600;700;800";
|
|
900
|
+
readonly Nunito: "Nunito:wght@300;400;600;700;800";
|
|
901
901
|
readonly "DM Sans": "DM+Sans:wght@400;500;700";
|
|
902
902
|
readonly Archivo: "Archivo:wght@400;500;700";
|
|
903
903
|
readonly "Archivo Black": "Archivo+Black";
|
|
904
904
|
readonly Syne: "Syne:wght@600;700;800";
|
|
905
905
|
readonly "Space Mono": "Space+Mono:wght@400;700";
|
|
906
|
+
readonly Poppins: "Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400";
|
|
907
|
+
readonly Roboto: "Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400";
|
|
908
|
+
readonly Lato: "Lato:ital,wght@0,300;0,400;0,700;1,400";
|
|
909
|
+
readonly "Open Sans": "Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400";
|
|
910
|
+
readonly Montserrat: "Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400";
|
|
911
|
+
readonly Raleway: "Raleway:wght@300;400;500;600;700";
|
|
912
|
+
readonly "Playfair Display": "Playfair+Display:ital,wght@0,400;0,500;0,700;1,400";
|
|
913
|
+
readonly Oswald: "Oswald:wght@300;400;500;600;700";
|
|
914
|
+
readonly Ubuntu: "Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,400";
|
|
906
915
|
};
|
|
907
916
|
declare const SPEC_SCHEMES: {
|
|
908
917
|
readonly default: {
|
|
@@ -1178,7 +1187,7 @@ declare const SPEC_ELEMENT_STYLES: readonly [{
|
|
|
1178
1187
|
readonly fontSize: "var(--iox-size-lead)";
|
|
1179
1188
|
readonly fontWeight: "var(--iox-weight-body)";
|
|
1180
1189
|
readonly lineHeight: "var(--iox-leading-body)";
|
|
1181
|
-
readonly color: "
|
|
1190
|
+
readonly color: "inherit";
|
|
1182
1191
|
};
|
|
1183
1192
|
}, {
|
|
1184
1193
|
readonly id: "body";
|
|
@@ -1190,7 +1199,7 @@ declare const SPEC_ELEMENT_STYLES: readonly [{
|
|
|
1190
1199
|
readonly fontSize: "var(--iox-size-body)";
|
|
1191
1200
|
readonly fontWeight: "var(--iox-weight-body)";
|
|
1192
1201
|
readonly lineHeight: "var(--iox-leading-body)";
|
|
1193
|
-
readonly color: "
|
|
1202
|
+
readonly color: "inherit";
|
|
1194
1203
|
};
|
|
1195
1204
|
}, {
|
|
1196
1205
|
readonly id: "small";
|
|
@@ -1464,7 +1473,6 @@ declare const SPEC_FIELD_CLASS_BASELINE: {
|
|
|
1464
1473
|
declare const SPEC_LEGACY_ALIASES: {
|
|
1465
1474
|
readonly "radius-control": "var(--iox-button-radius)";
|
|
1466
1475
|
readonly "radius-surface": "var(--iox-card-radius)";
|
|
1467
|
-
readonly "space-control": "var(--iox-button-pad)";
|
|
1468
1476
|
readonly "space-stack": "var(--iox-space-gap)";
|
|
1469
1477
|
};
|
|
1470
1478
|
declare const SPEC_FLAVOR_PACKS: readonly [{
|
|
@@ -8174,6 +8182,11 @@ declare function styleKeyToKebab(key: string): string;
|
|
|
8174
8182
|
* 4. reduced transparency `@media (prefers-reduced-transparency: reduce)`
|
|
8175
8183
|
* 5. dark — LAST `@media (prefers-color-scheme: dark)`
|
|
8176
8184
|
*
|
|
8185
|
+
* MODE (design-system D6) is a compile choice, never a row change: `auto` is the visitor-following
|
|
8186
|
+
* order above; `light` compiles the base from light values and emits no dark block; `dark` compiles
|
|
8187
|
+
* the base from DARK values (schemes and placeholders resolved from them too) and emits no dark block —
|
|
8188
|
+
* so a Midnight site is dark for a light-OS visitor.
|
|
8189
|
+
*
|
|
8177
8190
|
* ⚠️ The appended-last contract: the dark block REDEFINES custom properties, so every consumer
|
|
8178
8191
|
* appends it AFTER all of its base rules — the engine pushes it after the page's css blocks, the
|
|
8179
8192
|
* builder registry keeps it as its last token rule (responsive A3 lesson).
|
|
@@ -8192,6 +8205,16 @@ interface DesignTokenLike {
|
|
|
8192
8205
|
interface TokenCssOptions {
|
|
8193
8206
|
/** Selector that carries the variables instead of `:root` — a preview wrapper, a specimen. */
|
|
8194
8207
|
scope?: string;
|
|
8208
|
+
/** The studio's colour mode (`settings.design.mode`). Absent = `auto`. */
|
|
8209
|
+
mode?: DesignMode;
|
|
8210
|
+
/**
|
|
8211
|
+
* Declare every SPEC token the rows lack as `initial` on the scope (the guaranteed-invalid value),
|
|
8212
|
+
* so a `var()` inside the scope cannot inherit a same-named property from an ANCESTOR. The builder
|
|
8213
|
+
* needs it: the admin's `:root` chrome tokens share names with org tokens (`accent`, `surface-2`…),
|
|
8214
|
+
* and a missing org row would silently paint the canvas in admin chrome. With it, the canvas
|
|
8215
|
+
* computes exactly what the live site computes for that row — unset.
|
|
8216
|
+
*/
|
|
8217
|
+
isolate?: boolean;
|
|
8195
8218
|
}
|
|
8196
8219
|
interface TokenCssBlocks {
|
|
8197
8220
|
/** Base, schemes and the two accessibility blocks — emitted BEFORE node rules. */
|
|
@@ -8241,8 +8264,9 @@ declare function compileTokenCss(tokens: ReadonlyArray<DesignTokenLike> | null |
|
|
|
8241
8264
|
* Flavors v1 (flavors-and-theming-plan.md, F1–F2): a pack is its TOKENS plus the accent hue
|
|
8242
8265
|
* opinion the brand derivation reads. The per-type `defaults` map and its resolvers are gone
|
|
8243
8266
|
* (design-system plan §3e, DS2): a new element is born wearing an ELEMENT STYLE
|
|
8244
|
-
* (`element-styles.ts`), which references tokens and is flavor-independent. Swiss
|
|
8245
|
-
*
|
|
8267
|
+
* (`element-styles.ts`), which references tokens and is flavor-independent. Swiss is retired (DS4
|
|
8268
|
+
* migrates `flavorId: swiss` orgs to Crisp); its pack stays as the migration's BASELINE — what F1/F2
|
|
8269
|
+
* wrote, so "untouched since seeding" stays a comparison (`design-apply.ts`).
|
|
8246
8270
|
*/
|
|
8247
8271
|
interface FlavorTokenDef {
|
|
8248
8272
|
name: string;
|
|
@@ -8268,9 +8292,9 @@ interface FlavorPack {
|
|
|
8268
8292
|
/** A pack's own sanity: every token row names itself and carries a value. Returns errors. */
|
|
8269
8293
|
declare function validateFlavorPack(pack: FlavorPack): string[];
|
|
8270
8294
|
/**
|
|
8271
|
-
* Swiss — the F1 pack: four tokens (control/surface radius, control/stack spacing) and the
|
|
8272
|
-
* opinion F2's brand step
|
|
8273
|
-
*
|
|
8295
|
+
* Swiss — the retired F1 pack: four tokens (control/surface radius, control/stack spacing) and the
|
|
8296
|
+
* hue opinion F2's brand step read. Three of its rows become the spec's `legacyAliases` on migration;
|
|
8297
|
+
* `space-control` is a v2 token in every pack and takes Crisp's value.
|
|
8274
8298
|
*/
|
|
8275
8299
|
declare const SWISS_FLAVOR: FlavorPack;
|
|
8276
8300
|
|
|
@@ -8472,9 +8496,17 @@ declare const EMPTY_IMAGE_SRC: string;
|
|
|
8472
8496
|
*/
|
|
8473
8497
|
declare function emptyImageLabelSrc(label: string): string;
|
|
8474
8498
|
/**
|
|
8475
|
-
*
|
|
8476
|
-
*
|
|
8477
|
-
*
|
|
8499
|
+
* What a node's Image shows WHENEVER its source is empty: the canvas label (when `label` is given) or
|
|
8500
|
+
* the live blank for a MARKED node; `null` — render exactly as before — for an unmarked node. It does
|
|
8501
|
+
* not look at the source, so a renderer computes it once per marker/label and the component falls
|
|
8502
|
+
* back to it the moment its source is cleared (a binding emptied, a context slot not yet filled).
|
|
8503
|
+
*/
|
|
8504
|
+
declare function emptyImagePlaceholder(node: {
|
|
8505
|
+
elementStyle?: string | null;
|
|
8506
|
+
} | null | undefined, label?: string | null): string | null;
|
|
8507
|
+
/**
|
|
8508
|
+
* The `src` a node's Image renders for a given source: its placeholder while the source is empty,
|
|
8509
|
+
* `null` once it has one (the source itself renders) or when the node is unmarked.
|
|
8478
8510
|
*/
|
|
8479
8511
|
declare function emptyImageSrc(node: {
|
|
8480
8512
|
elementStyle?: string | null;
|
|
@@ -8605,17 +8637,29 @@ declare function revertAvailable(appliedAt: number | null | undefined, now: numb
|
|
|
8605
8637
|
* to touch — a revert undoes the FLAVOR, not the author's week.
|
|
8606
8638
|
*/
|
|
8607
8639
|
declare function planFlavorRevert(current: ReadonlyArray<StoredDesignTokenRow>, snapshot: FlavorRevertSnapshot['tokens']): FlavorRevertPlan;
|
|
8640
|
+
/** What a previous seed wrote for one row — the "untouched" comparison base. */
|
|
8641
|
+
interface SeedExpectation {
|
|
8642
|
+
value: string;
|
|
8643
|
+
dark?: string;
|
|
8644
|
+
}
|
|
8645
|
+
/**
|
|
8646
|
+
* What the PREVIOUS seed wrote, per row: a map by name, or a function of the stored row (a baseline
|
|
8647
|
+
* that depends on WHICH seed stamped the row — the Swiss → Crisp migration's case).
|
|
8648
|
+
*/
|
|
8649
|
+
type SeedBaseline = ReadonlyMap<string, SeedExpectation> | ((row: StoredDesignTokenRow) => SeedExpectation | undefined);
|
|
8608
8650
|
/**
|
|
8609
8651
|
* The seeding MERGE: desired tokens vs existing rows, deciding create / update / keep. The §10 C2
|
|
8610
8652
|
* rule — "an upgrade only rewrites untouched rows" — is a comparison against what the PREVIOUS
|
|
8611
|
-
* seed wrote (`
|
|
8612
|
-
* rewritten; any drift means the author took it over, and their hand wins. A row
|
|
8613
|
-
* `flavor:` stamp
|
|
8653
|
+
* seed wrote (`baseline`): a seeded row whose value still equals it is the machine's and may be
|
|
8654
|
+
* rewritten; any drift means the author took it over, and their hand wins. A row the design did not
|
|
8655
|
+
* write is never touched: no `flavor:` stamp, unless it is a `user` row (a font the author CHOSE in
|
|
8656
|
+
* the design) whose value is exactly what the previous design wrote — that row is the design's own
|
|
8657
|
+
* choice, so a new choice may replace it. `group`/`tier` ride every write; a desired row's own
|
|
8658
|
+
* `source` (a chosen font's `user`) wins over the pack stamp.
|
|
8614
8659
|
*/
|
|
8615
|
-
declare function planFlavorSeed(desired: ReadonlyArray<FlavorTokenDef
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
}> | null): FlavorSeedPlan;
|
|
8660
|
+
declare function planFlavorSeed(desired: ReadonlyArray<FlavorTokenDef & {
|
|
8661
|
+
source?: string;
|
|
8662
|
+
}>, existing: ReadonlyArray<StoredDesignTokenRow>, stamp: string, baseline: SeedBaseline | null): FlavorSeedPlan;
|
|
8619
8663
|
|
|
8620
8664
|
interface LinearSpring {
|
|
8621
8665
|
easing: string;
|
|
@@ -8652,11 +8696,27 @@ declare function cssString(value: string): string;
|
|
|
8652
8696
|
declare function buildFontFaceCss(descriptors: ReadonlyArray<FontDescriptor> | null | undefined): string;
|
|
8653
8697
|
/** The family names in a CSS `font-family` stack, unquoted, in order. */
|
|
8654
8698
|
declare function parseFontFamilies(stack: string): string[];
|
|
8699
|
+
/** Where Google serves the stylesheets, and the origin the font FILES come from (preconnect). */
|
|
8700
|
+
declare const GOOGLE_FONTS_CSS_ORIGIN = "https://fonts.googleapis.com";
|
|
8701
|
+
declare const GOOGLE_FONTS_FILE_ORIGIN = "https://fonts.gstatic.com";
|
|
8702
|
+
/** The ONE stylesheet URL for a catalog id — both renderers link exactly this (one per family, T7). */
|
|
8703
|
+
declare function googleFontHref(id: string): string;
|
|
8704
|
+
/** The catalog id of a family name (case-insensitive), or null — a system or uploaded face has none. */
|
|
8705
|
+
declare function catalogFontId(family: string | null | undefined): string | null;
|
|
8706
|
+
interface FontsForTokensOptions {
|
|
8707
|
+
/**
|
|
8708
|
+
* The CSS that will actually render (node rules, element styles). `font-mono` is loaded only when
|
|
8709
|
+
* something READS it — here or in another token's value — because no element style does: an org
|
|
8710
|
+
* would otherwise download a monospace face for a site with no code on it.
|
|
8711
|
+
*/
|
|
8712
|
+
usedCss?: string;
|
|
8713
|
+
}
|
|
8655
8714
|
/**
|
|
8656
|
-
* The Google css2 ids to load for a token set: every catalog family named by
|
|
8657
|
-
*
|
|
8715
|
+
* The Google css2 ids to load for a token set: every catalog family named by the display / body /
|
|
8716
|
+
* label roles, plus mono when referenced (above). One id per family (T7 — one `<link>` per family, so
|
|
8717
|
+
* one bad id cannot sink the others), in role order.
|
|
8658
8718
|
*/
|
|
8659
|
-
declare function fontsForTokens(tokens: ReadonlyArray<DesignTokenLike> | null | undefined): string[];
|
|
8719
|
+
declare function fontsForTokens(tokens: ReadonlyArray<DesignTokenLike> | null | undefined, opts?: FontsForTokensOptions): string[];
|
|
8660
8720
|
|
|
8661
8721
|
/**
|
|
8662
8722
|
* Which `--iox-<name>` a piece of COMPONENT CSS may reference (design-system §3b-bis: "component CSS
|
|
@@ -8671,6 +8731,111 @@ declare function specTokenNames(): ReadonlySet<string>;
|
|
|
8671
8731
|
declare function tokenReferences(css: string): string[];
|
|
8672
8732
|
/** The referenced names that are neither spec tokens nor in `alsoAllowed`. */
|
|
8673
8733
|
declare function unknownTokenReferences(css: string, alsoAllowed?: Iterable<string>): string[];
|
|
8734
|
+
/**
|
|
8735
|
+
* Tokens read by a LEGACY rule — any rule whose selector is scoped `:not(.iox-es)` (the pre-DS2 look
|
|
8736
|
+
* of a node that wears no element style, design-system §3b-bis). Such a rule must read NO token at
|
|
8737
|
+
* all: a token it reads repaints a pre-DS2 page the moment the org's rows are seeded or a flavor is
|
|
8738
|
+
* applied (D5). Returns `selector → names` for each offending rule; comments are ignored.
|
|
8739
|
+
*/
|
|
8740
|
+
declare function legacyRuleTokenReferences(css: string): Array<{
|
|
8741
|
+
selector: string;
|
|
8742
|
+
tokens: string[];
|
|
8743
|
+
}>;
|
|
8744
|
+
|
|
8745
|
+
/**
|
|
8746
|
+
* The `settings.design` row (design-system plan §3f), read and written by ONE pair of functions so
|
|
8747
|
+
* the builder, the server's public page read (the engine's mode) and the site build agree on what a
|
|
8748
|
+
* stored row MEANS. The row is the settings collection's generic `config: [{ key, value }]`; values
|
|
8749
|
+
* are strings there (Boolean "true"/"false", Object as JSON), but a reader also accepts the typed
|
|
8750
|
+
* value a client control may have sent.
|
|
8751
|
+
*/
|
|
8752
|
+
/** The look a studio wears until it picks one (DS2's interim seed, and DS6's first-run selection). */
|
|
8753
|
+
declare const DEFAULT_FLAVOR_ID = "crisp";
|
|
8754
|
+
/** One `config` entry of a settings row. */
|
|
8755
|
+
interface DesignConfigEntry {
|
|
8756
|
+
key: string;
|
|
8757
|
+
value: unknown;
|
|
8758
|
+
}
|
|
8759
|
+
declare enum DesignConfigKey {
|
|
8760
|
+
FlavorId = "flavorId",
|
|
8761
|
+
FlavorVersion = "flavorVersion",
|
|
8762
|
+
BrandSeed = "brandSeed",
|
|
8763
|
+
PairId = "pairId",
|
|
8764
|
+
Shape = "shape",
|
|
8765
|
+
Density = "density",
|
|
8766
|
+
Motion = "motion",
|
|
8767
|
+
PillButtons = "pillButtons",
|
|
8768
|
+
Mode = "mode",
|
|
8769
|
+
Fonts = "fonts",
|
|
8770
|
+
Revert = "revert"
|
|
8771
|
+
}
|
|
8772
|
+
/** A stored design, resolved: `choices` is ALWAYS complete and valid (pack defaults fill the gaps). */
|
|
8773
|
+
interface StoredDesign {
|
|
8774
|
+
choices: DesignChoices;
|
|
8775
|
+
/** The flavor id exactly as stored — `swiss` until the DS4 migration rewrites it; null when no row. */
|
|
8776
|
+
storedFlavorId: string | null;
|
|
8777
|
+
/** The seed exactly as stored (F2 orgs carry their brand colour here); null when absent. */
|
|
8778
|
+
storedSeed: string | null;
|
|
8779
|
+
flavorVersion: string | null;
|
|
8780
|
+
revert: FlavorRevertSnapshot | null;
|
|
8781
|
+
/** False when the org has never stored a design — DS6's first run. */
|
|
8782
|
+
hasRow: boolean;
|
|
8783
|
+
}
|
|
8784
|
+
/** The pack for an id; a retired id (Swiss) resolves to the pack that `replaces` it. */
|
|
8785
|
+
declare function flavorPackById(id: string | null | undefined): FlavorPackV2 | undefined;
|
|
8786
|
+
/** True when `id` names a retired flavor that a v2 pack replaces (Swiss → Crisp). */
|
|
8787
|
+
declare function isRetiredFlavorId(id: string | null | undefined): boolean;
|
|
8788
|
+
/**
|
|
8789
|
+
* A partial set of choices completed against its pack: every missing or invalid value falls back to
|
|
8790
|
+
* the pack's own default (an unknown pair → the pack's first, a bad seed → the pack's seed).
|
|
8791
|
+
*/
|
|
8792
|
+
declare function resolveDesignChoices(partial: Partial<DesignChoices> | null | undefined): DesignChoices;
|
|
8793
|
+
/** The pack's own defaults for `flavorId` — what picking a card means before anything is tuned. */
|
|
8794
|
+
declare function packDesignChoices(flavorId: string): DesignChoices;
|
|
8795
|
+
/** A stored `settings.design` config → the resolved design. No row (or no config) → Crisp's defaults. */
|
|
8796
|
+
declare function readDesignConfig(config: ReadonlyArray<DesignConfigEntry> | null | undefined, hasRow?: boolean): StoredDesign;
|
|
8797
|
+
/** The colour mode a stored config compiles in — what the public page read hands the engine. */
|
|
8798
|
+
declare function designModeOf(config: ReadonlyArray<DesignConfigEntry> | null | undefined): DesignMode;
|
|
8799
|
+
/** Resolved choices (+ the revert snapshot) → the config array a settings row stores. */
|
|
8800
|
+
declare function designConfigEntries(choices: DesignChoices, flavorVersion: string | number, revert?: FlavorRevertSnapshot | null): DesignConfigEntry[];
|
|
8801
|
+
/** Two choice sets describe the same look (fonts compared by role). */
|
|
8802
|
+
declare function sameDesignChoices(a: DesignChoices, b: DesignChoices): boolean;
|
|
8803
|
+
|
|
8804
|
+
/** Every row a design writes — `buildFlavorTokens` for its pack. Empty for an unknown pack. */
|
|
8805
|
+
declare function designTokenRows(choices: DesignChoices): DesignTokenRow[];
|
|
8806
|
+
/**
|
|
8807
|
+
* What the PREVIOUS design wrote, as a baseline keyed by the row's own stamp: a row Swiss stamped is
|
|
8808
|
+
* judged against what Swiss wrote, every other row against `buildFlavorTokens` of the stored choices
|
|
8809
|
+
* (for an org with no design row, Crisp's defaults — exactly what DS2's interim seed wrote). In a
|
|
8810
|
+
* Swiss org the only v2 rows are that interim seed's, so they are judged against Crisp's DEFAULTS,
|
|
8811
|
+
* never against the brand-seeded Crisp the migration is about to write.
|
|
8812
|
+
*/
|
|
8813
|
+
declare function designBaseline(previous: StoredDesign): SeedBaseline;
|
|
8814
|
+
/** Apply `next` over the org's rows, judged against `previous` — the plan FlavorApplyService runs. */
|
|
8815
|
+
declare function planDesignApply(existing: ReadonlyArray<StoredDesignTokenRow>, previous: StoredDesign, next: DesignChoices): FlavorSeedPlan;
|
|
8816
|
+
/** The rows a design is missing by name — the builder-load top-up (never touches an existing row). */
|
|
8817
|
+
declare function missingDesignRows(existing: ReadonlyArray<{
|
|
8818
|
+
name: string;
|
|
8819
|
+
}>, choices: DesignChoices): DesignTokenRow[];
|
|
8820
|
+
interface SwissMigration {
|
|
8821
|
+
/** The design the org now wears: Crisp, carrying the stored brand seed when it is a colour. */
|
|
8822
|
+
choices: DesignChoices;
|
|
8823
|
+
/** The token merge, the four legacy alias rewrites included. */
|
|
8824
|
+
plan: FlavorSeedPlan;
|
|
8825
|
+
}
|
|
8826
|
+
/**
|
|
8827
|
+
* Swiss → Crisp (spec `legacyAliases`; D1). Needed when the design row says a retired flavor, or when
|
|
8828
|
+
* there is no design row but the org holds Swiss-stamped alias rows (F1 seeded those before the row
|
|
8829
|
+
* existed). Idempotent: once the row says Crisp nothing is needed, and re-running the plan writes
|
|
8830
|
+
* nothing.
|
|
8831
|
+
*
|
|
8832
|
+
* - The look: `planDesignApply` from Swiss to Crisp — Swiss-stamped rows untouched since Swiss seeded
|
|
8833
|
+
* them (incl. F2's `surface` / `line` / `accent`) become Crisp's; edited ones are kept.
|
|
8834
|
+
* - The aliases: `radius-control` / `radius-surface` / `space-control` / `space-stack` are rewritten to
|
|
8835
|
+
* their alias reference ONLY while still machine-owned and untouched, so a node saved since F1 that
|
|
8836
|
+
* reads `var(--iox-radius-control)` keeps resolving — now to Crisp's button radius.
|
|
8837
|
+
*/
|
|
8838
|
+
declare function planSwissMigration(existing: ReadonlyArray<StoredDesignTokenRow>, stored: StoredDesign): SwissMigration | null;
|
|
8674
8839
|
|
|
8675
|
-
export { ACCENT_TOKEN_NAMES, BUTTON_VARIANT_TO_STYLE, COLOR_SCHEMES, COLOR_SCHEME_TRAIT, COLOR_SCHEME_TYPES, ColorScheme, DESIGN_TOKEN_GROUPS, DESIGN_TOKEN_TIERS, DESIGN_TOKEN_TYPES, ELEMENT_STYLES, ELEMENT_STYLE_MARKER_CLASS, ELEMENT_STYLE_STATES, EMPTY_IMAGE_ATTRIBUTE, EMPTY_IMAGE_SRC, ElementStyleState, FLAVOR_SPEC_VERSION, FONT_CATALOG, FONT_FAMILY_TOKENS, OwnedTraitLink, PALETTE_PRESETS, REDUCED_MOTION_OVERRIDES, REDUCED_TRANSPARENCY_OVERRIDES, REVERT_WINDOW_MS, SPEC_A11Y, SPEC_AXES, SPEC_BUTTON_VARIANT_TO_STYLE, SPEC_CONTRAST, SPEC_DEFAULT_ELEMENT_STYLE, SPEC_ELEMENT_STYLES, SPEC_FIELD_CLASS_BASELINE, SPEC_FLAVORS, SPEC_FLAVOR_PACKS, SPEC_FONTS, SPEC_FONT_ROLES, SPEC_LEGACY_ALIASES, SPEC_PALETTE_PRESETS, SPEC_SCHEMES, SPEC_SPRINGS, SPEC_TIERS, SPEC_TIER_IDS, SPEC_TOKEN_TYPES, SWISS_FLAVOR, USER_TOKEN_SOURCE, WCAG_AA_TEXT, apcaLc, applyElementStyle, applyHeadingLevelRule, buildFlavorTokens, buildFontFaceCss, colorSchemeClass, colorSchemeOf, compileSchemeCss, compileTokenCss, compileTokenCssBlocks, cssString, defaultDesignChoices, defaultElementStyleFor, deriveAccentTokens, deriveBrandTokens, elementStyleById, elementStyleClass, elementStylesFor, emptyImageLabelSrc, emptyImageSrc, flavorSourceStamp, fontsForTokens, hasElementStyleMarker, isDesignTokenGroup, isDesignTokenTier, isDesignTokenType, nodeDesignClasses, oklabToRgb, ownedTraitStatus, parseFontFamilies, parseHexColor, planFlavorRevert, planFlavorSeed, relativeLuminance, resolveTokenReferences, resolveTokenValues, revertAvailable, rgbToOklab, specTokenNames, springToLinear, styleKeyToKebab, switchElementStyle, syncNodeDesignClasses, toHexColor, tokenReferences, tokensToDarkVarMap, tokensToVarMap, unknownTokenReferences, userFontStack, validateFlavorPack, wcagContrastRatio };
|
|
8676
|
-
export type { AccentBackgrounds, AccentTokenName, ApplyElementStyleResult, DensityId, DesignChoices, DesignClassSource, DesignMode, DesignTokenGroup, DesignTokenLike, DesignTokenRow, DesignTokenTier, DesignTokenType, ElementStyle, ElementStyleTarget, ElementStyleTraitLike, FlavorPack, FlavorPackV2, FlavorRevertPlan, FlavorRevertSnapshot, FlavorSeedPlan, FlavorSpecToken, FlavorTokenDef, FontDescriptor, FontFormat, FontPair, FontRoleToken, FontStyle, LinearSpring, MotionId, OkLab, OwnedTrait, OwnedTraitStatus, PalettePreset, ResolvedMode, Rgb, SchemeId, ShapeId, StoredDesignTokenRow, SwitchElementStyleResult, TokenCssBlocks, TokenCssOptions };
|
|
8840
|
+
export { ACCENT_TOKEN_NAMES, BUTTON_VARIANT_TO_STYLE, COLOR_SCHEMES, COLOR_SCHEME_TRAIT, COLOR_SCHEME_TYPES, ColorScheme, DEFAULT_FLAVOR_ID, DESIGN_TOKEN_GROUPS, DESIGN_TOKEN_TIERS, DESIGN_TOKEN_TYPES, DesignConfigKey, ELEMENT_STYLES, ELEMENT_STYLE_MARKER_CLASS, ELEMENT_STYLE_STATES, EMPTY_IMAGE_ATTRIBUTE, EMPTY_IMAGE_SRC, ElementStyleState, FLAVOR_SPEC_VERSION, FONT_CATALOG, FONT_FAMILY_TOKENS, GOOGLE_FONTS_CSS_ORIGIN, GOOGLE_FONTS_FILE_ORIGIN, OwnedTraitLink, PALETTE_PRESETS, REDUCED_MOTION_OVERRIDES, REDUCED_TRANSPARENCY_OVERRIDES, REVERT_WINDOW_MS, SPEC_A11Y, SPEC_AXES, SPEC_BUTTON_VARIANT_TO_STYLE, SPEC_CONTRAST, SPEC_DEFAULT_ELEMENT_STYLE, SPEC_ELEMENT_STYLES, SPEC_FIELD_CLASS_BASELINE, SPEC_FLAVORS, SPEC_FLAVOR_PACKS, SPEC_FONTS, SPEC_FONT_ROLES, SPEC_LEGACY_ALIASES, SPEC_PALETTE_PRESETS, SPEC_SCHEMES, SPEC_SPRINGS, SPEC_TIERS, SPEC_TIER_IDS, SPEC_TOKEN_TYPES, SWISS_FLAVOR, USER_TOKEN_SOURCE, WCAG_AA_TEXT, apcaLc, applyElementStyle, applyHeadingLevelRule, buildFlavorTokens, buildFontFaceCss, catalogFontId, colorSchemeClass, colorSchemeOf, compileSchemeCss, compileTokenCss, compileTokenCssBlocks, cssString, defaultDesignChoices, defaultElementStyleFor, deriveAccentTokens, deriveBrandTokens, designBaseline, designConfigEntries, designModeOf, designTokenRows, elementStyleById, elementStyleClass, elementStylesFor, emptyImageLabelSrc, emptyImagePlaceholder, emptyImageSrc, flavorPackById, flavorSourceStamp, fontsForTokens, googleFontHref, hasElementStyleMarker, isDesignTokenGroup, isDesignTokenTier, isDesignTokenType, isRetiredFlavorId, legacyRuleTokenReferences, missingDesignRows, nodeDesignClasses, oklabToRgb, ownedTraitStatus, packDesignChoices, parseFontFamilies, parseHexColor, planDesignApply, planFlavorRevert, planFlavorSeed, planSwissMigration, readDesignConfig, relativeLuminance, resolveDesignChoices, resolveTokenReferences, resolveTokenValues, revertAvailable, rgbToOklab, sameDesignChoices, specTokenNames, springToLinear, styleKeyToKebab, switchElementStyle, syncNodeDesignClasses, toHexColor, tokenReferences, tokensToDarkVarMap, tokensToVarMap, unknownTokenReferences, userFontStack, validateFlavorPack, wcagContrastRatio };
|
|
8841
|
+
export type { AccentBackgrounds, AccentTokenName, ApplyElementStyleResult, DensityId, DesignChoices, DesignClassSource, DesignConfigEntry, DesignMode, DesignTokenGroup, DesignTokenLike, DesignTokenRow, DesignTokenTier, DesignTokenType, ElementStyle, ElementStyleTarget, ElementStyleTraitLike, FlavorPack, FlavorPackV2, FlavorRevertPlan, FlavorRevertSnapshot, FlavorSeedPlan, FlavorSpecToken, FlavorTokenDef, FontDescriptor, FontFormat, FontPair, FontRoleToken, FontStyle, FontsForTokensOptions, LinearSpring, MotionId, OkLab, OwnedTrait, OwnedTraitStatus, PalettePreset, ResolvedMode, Rgb, SchemeId, SeedBaseline, SeedExpectation, ShapeId, StoredDesign, StoredDesignTokenRow, SwissMigration, SwitchElementStyleResult, TokenCssBlocks, TokenCssOptions };
|