@vectoriox/iox-ui 5.141.0 → 5.143.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.
Files changed (60) hide show
  1. package/composite-core/index.d.ts +40 -1
  2. package/design-core/index.d.ts +262 -28
  3. package/fesm2022/vectoriox-iox-ui-composite-core.mjs +155 -90
  4. package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
  5. package/fesm2022/vectoriox-iox-ui-design-core.mjs +539 -268
  6. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  7. package/fesm2022/vectoriox-iox-ui-forms-core.mjs +61 -4
  8. package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
  9. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +1547 -742
  10. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  11. package/fesm2022/vectoriox-iox-ui-harness-core.mjs +510 -20
  12. package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
  13. package/fesm2022/vectoriox-iox-ui.mjs +170 -22
  14. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  15. package/forms-core/index.d.ts +17 -3
  16. package/generation-core/index.d.ts +638 -148
  17. package/harness-core/index.d.ts +359 -20
  18. package/index.d.ts +94 -10
  19. package/package.json +1 -1
  20. package/src/composite-core/accordion.ts +16 -1
  21. package/src/composite-core/card.ts +22 -2
  22. package/src/composite-core/consent.ts +2 -2
  23. package/src/composite-core/recipe-parts.ts +7 -0
  24. package/src/composite-core/segmented.ts +17 -2
  25. package/src/composite-core/slider.ts +19 -3
  26. package/src/composite-core/tabs.ts +16 -1
  27. package/src/design-core/contrast-audit.ts +18 -0
  28. package/src/design-core/flavor-spec.generated.ts +212 -25
  29. package/src/design-core/ink-on-ground.ts +36 -0
  30. package/src/design-core/list-classes.ts +37 -0
  31. package/src/design-core/locale-direction.ts +24 -0
  32. package/src/design-core/menu-look.ts +2 -1
  33. package/src/design-core/node-classes.ts +3 -2
  34. package/src/design-core/public-api.ts +3 -0
  35. package/src/forms-core/form-presets.ts +72 -3
  36. package/src/generation-core/check-layout.ts +4 -1
  37. package/src/generation-core/check-list.ts +144 -5
  38. package/src/generation-core/compose-layout.ts +165 -20
  39. package/src/generation-core/compose-site.ts +58 -21
  40. package/src/generation-core/footer-mix.ts +8 -0
  41. package/src/generation-core/layout-fingerprint.ts +5 -1
  42. package/src/generation-core/layout-language.ts +5 -0
  43. package/src/generation-core/layout-wire.ts +64 -24
  44. package/src/generation-core/list-panel.ts +122 -0
  45. package/src/generation-core/list-space.ts +54 -1
  46. package/src/generation-core/list-table.ts +101 -0
  47. package/src/generation-core/nav-shape.ts +3 -2
  48. package/src/generation-core/node-baselines.generated.ts +3 -1
  49. package/src/generation-core/patterns.ts +4 -0
  50. package/src/generation-core/public-api.ts +1 -0
  51. package/src/generation-core/serialized-node.ts +2 -0
  52. package/src/generation-core/site-plan.model.ts +16 -2
  53. package/src/generation-core/site-spec.generated.ts +469 -201
  54. package/src/generation-core/validate-site-plan.ts +8 -4
  55. package/src/harness-core/business-types.ts +11 -0
  56. package/src/harness-core/film-idea.ts +178 -0
  57. package/src/harness-core/harness-spec.generated.ts +380 -18
  58. package/src/harness-core/intake.ts +8 -1
  59. package/src/harness-core/public-api.ts +1 -0
  60. package/styles/iox-design.css +420 -45
@@ -804,6 +804,21 @@ export const SPEC_TIERS = {
804
804
  "type": "size",
805
805
  "default": "-10px"
806
806
  },
807
+ {
808
+ "name": "list-fan-step",
809
+ "type": "number",
810
+ "default": "9"
811
+ },
812
+ {
813
+ "name": "list-tilt",
814
+ "type": "number",
815
+ "default": "3"
816
+ },
817
+ {
818
+ "name": "list-tile",
819
+ "type": "color",
820
+ "default": "var(--iox-surface-2)"
821
+ },
807
822
  {
808
823
  "name": "panel-bg",
809
824
  "type": "color",
@@ -1112,7 +1127,12 @@ export const SPEC_TIERS = {
1112
1127
  {
1113
1128
  "name": "link-decoration",
1114
1129
  "type": "keyword",
1115
- "default": "underline"
1130
+ "default": "none"
1131
+ },
1132
+ {
1133
+ "name": "link-weight",
1134
+ "type": "number",
1135
+ "default": "var(--iox-weight-strong)"
1116
1136
  },
1117
1137
  {
1118
1138
  "name": "link-current-color",
@@ -1122,12 +1142,12 @@ export const SPEC_TIERS = {
1122
1142
  {
1123
1143
  "name": "link-current-decoration",
1124
1144
  "type": "keyword",
1125
- "default": "underline 2px var(--iox-accent-text)"
1145
+ "default": "none"
1126
1146
  },
1127
1147
  {
1128
1148
  "name": "link-underline-rest",
1129
1149
  "type": "number",
1130
- "default": "1"
1150
+ "default": "0"
1131
1151
  },
1132
1152
  {
1133
1153
  "name": "link-underline-thickness",
@@ -4295,6 +4315,7 @@ export const SPEC_ELEMENT_STYLES = [
4295
4315
  ],
4296
4316
  "base": {
4297
4317
  "fontFamily": "var(--iox-font-body)",
4318
+ "fontWeight": "var(--iox-link-weight)",
4298
4319
  "color": "var(--iox-link-color)",
4299
4320
  "textDecoration": "var(--iox-link-decoration)",
4300
4321
  "transitionDuration": "var(--iox-dur-fast)",
@@ -7182,6 +7203,27 @@ export const SPEC_FLAVOR_PACKS = [
7182
7203
  "group": "components",
7183
7204
  "value": "-10px"
7184
7205
  },
7206
+ {
7207
+ "name": "list-fan-step",
7208
+ "tier": "component",
7209
+ "type": "number",
7210
+ "group": "components",
7211
+ "value": "9"
7212
+ },
7213
+ {
7214
+ "name": "list-tilt",
7215
+ "tier": "component",
7216
+ "type": "number",
7217
+ "group": "components",
7218
+ "value": "3"
7219
+ },
7220
+ {
7221
+ "name": "list-tile",
7222
+ "tier": "component",
7223
+ "type": "color",
7224
+ "group": "components",
7225
+ "value": "var(--iox-surface-2)"
7226
+ },
7185
7227
  {
7186
7228
  "name": "panel-bg",
7187
7229
  "tier": "component",
@@ -7614,7 +7656,14 @@ export const SPEC_FLAVOR_PACKS = [
7614
7656
  "tier": "component",
7615
7657
  "type": "keyword",
7616
7658
  "group": "components",
7617
- "value": "underline"
7659
+ "value": "none"
7660
+ },
7661
+ {
7662
+ "name": "link-weight",
7663
+ "tier": "component",
7664
+ "type": "number",
7665
+ "group": "components",
7666
+ "value": "var(--iox-weight-strong)"
7618
7667
  },
7619
7668
  {
7620
7669
  "name": "link-current-color",
@@ -7628,14 +7677,14 @@ export const SPEC_FLAVOR_PACKS = [
7628
7677
  "tier": "component",
7629
7678
  "type": "keyword",
7630
7679
  "group": "components",
7631
- "value": "underline 2px var(--iox-accent-text)"
7680
+ "value": "none"
7632
7681
  },
7633
7682
  {
7634
7683
  "name": "link-underline-rest",
7635
7684
  "tier": "component",
7636
7685
  "type": "number",
7637
7686
  "group": "components",
7638
- "value": "1"
7687
+ "value": "0"
7639
7688
  },
7640
7689
  {
7641
7690
  "name": "link-underline-thickness",
@@ -9418,16 +9467,14 @@ export const SPEC_FLAVOR_PACKS = [
9418
9467
  "tier": "component",
9419
9468
  "type": "color",
9420
9469
  "group": "components",
9421
- "value": "transparent",
9422
- "overridden": true
9470
+ "value": "var(--iox-surface-2)"
9423
9471
  },
9424
9472
  {
9425
9473
  "name": "button-ghost-decoration",
9426
9474
  "tier": "component",
9427
9475
  "type": "keyword",
9428
9476
  "group": "components",
9429
- "value": "underline",
9430
- "overridden": true
9477
+ "value": "none"
9431
9478
  },
9432
9479
  {
9433
9480
  "name": "card-bg",
@@ -9544,6 +9591,27 @@ export const SPEC_FLAVOR_PACKS = [
9544
9591
  "group": "components",
9545
9592
  "value": "-10px"
9546
9593
  },
9594
+ {
9595
+ "name": "list-fan-step",
9596
+ "tier": "component",
9597
+ "type": "number",
9598
+ "group": "components",
9599
+ "value": "9"
9600
+ },
9601
+ {
9602
+ "name": "list-tilt",
9603
+ "tier": "component",
9604
+ "type": "number",
9605
+ "group": "components",
9606
+ "value": "3"
9607
+ },
9608
+ {
9609
+ "name": "list-tile",
9610
+ "tier": "component",
9611
+ "type": "color",
9612
+ "group": "components",
9613
+ "value": "var(--iox-surface-2)"
9614
+ },
9547
9615
  {
9548
9616
  "name": "panel-bg",
9549
9617
  "tier": "component",
@@ -9982,7 +10050,14 @@ export const SPEC_FLAVOR_PACKS = [
9982
10050
  "tier": "component",
9983
10051
  "type": "keyword",
9984
10052
  "group": "components",
9985
- "value": "underline"
10053
+ "value": "none"
10054
+ },
10055
+ {
10056
+ "name": "link-weight",
10057
+ "tier": "component",
10058
+ "type": "number",
10059
+ "group": "components",
10060
+ "value": "var(--iox-weight-strong)"
9986
10061
  },
9987
10062
  {
9988
10063
  "name": "link-current-color",
@@ -9996,14 +10071,14 @@ export const SPEC_FLAVOR_PACKS = [
9996
10071
  "tier": "component",
9997
10072
  "type": "keyword",
9998
10073
  "group": "components",
9999
- "value": "underline 2px var(--iox-accent-text)"
10074
+ "value": "none"
10000
10075
  },
10001
10076
  {
10002
10077
  "name": "link-underline-rest",
10003
10078
  "tier": "component",
10004
10079
  "type": "number",
10005
10080
  "group": "components",
10006
- "value": "1"
10081
+ "value": "0"
10007
10082
  },
10008
10083
  {
10009
10084
  "name": "link-underline-thickness",
@@ -11914,6 +11989,27 @@ export const SPEC_FLAVOR_PACKS = [
11914
11989
  "group": "components",
11915
11990
  "value": "-10px"
11916
11991
  },
11992
+ {
11993
+ "name": "list-fan-step",
11994
+ "tier": "component",
11995
+ "type": "number",
11996
+ "group": "components",
11997
+ "value": "9"
11998
+ },
11999
+ {
12000
+ "name": "list-tilt",
12001
+ "tier": "component",
12002
+ "type": "number",
12003
+ "group": "components",
12004
+ "value": "3"
12005
+ },
12006
+ {
12007
+ "name": "list-tile",
12008
+ "tier": "component",
12009
+ "type": "color",
12010
+ "group": "components",
12011
+ "value": "var(--iox-surface-2)"
12012
+ },
11917
12013
  {
11918
12014
  "name": "panel-bg",
11919
12015
  "tier": "component",
@@ -12348,7 +12444,14 @@ export const SPEC_FLAVOR_PACKS = [
12348
12444
  "tier": "component",
12349
12445
  "type": "keyword",
12350
12446
  "group": "components",
12351
- "value": "underline"
12447
+ "value": "none"
12448
+ },
12449
+ {
12450
+ "name": "link-weight",
12451
+ "tier": "component",
12452
+ "type": "number",
12453
+ "group": "components",
12454
+ "value": "var(--iox-weight-strong)"
12352
12455
  },
12353
12456
  {
12354
12457
  "name": "link-current-color",
@@ -12362,14 +12465,14 @@ export const SPEC_FLAVOR_PACKS = [
12362
12465
  "tier": "component",
12363
12466
  "type": "keyword",
12364
12467
  "group": "components",
12365
- "value": "underline 2px var(--iox-accent-text)"
12468
+ "value": "none"
12366
12469
  },
12367
12470
  {
12368
12471
  "name": "link-underline-rest",
12369
12472
  "tier": "component",
12370
12473
  "type": "number",
12371
12474
  "group": "components",
12372
- "value": "1"
12475
+ "value": "0"
12373
12476
  },
12374
12477
  {
12375
12478
  "name": "link-underline-thickness",
@@ -14296,6 +14399,27 @@ export const SPEC_FLAVOR_PACKS = [
14296
14399
  "group": "components",
14297
14400
  "value": "-10px"
14298
14401
  },
14402
+ {
14403
+ "name": "list-fan-step",
14404
+ "tier": "component",
14405
+ "type": "number",
14406
+ "group": "components",
14407
+ "value": "9"
14408
+ },
14409
+ {
14410
+ "name": "list-tilt",
14411
+ "tier": "component",
14412
+ "type": "number",
14413
+ "group": "components",
14414
+ "value": "3"
14415
+ },
14416
+ {
14417
+ "name": "list-tile",
14418
+ "tier": "component",
14419
+ "type": "color",
14420
+ "group": "components",
14421
+ "value": "var(--iox-surface-2)"
14422
+ },
14299
14423
  {
14300
14424
  "name": "panel-bg",
14301
14425
  "tier": "component",
@@ -14741,7 +14865,14 @@ export const SPEC_FLAVOR_PACKS = [
14741
14865
  "tier": "component",
14742
14866
  "type": "keyword",
14743
14867
  "group": "components",
14744
- "value": "underline"
14868
+ "value": "none"
14869
+ },
14870
+ {
14871
+ "name": "link-weight",
14872
+ "tier": "component",
14873
+ "type": "number",
14874
+ "group": "components",
14875
+ "value": "var(--iox-weight-strong)"
14745
14876
  },
14746
14877
  {
14747
14878
  "name": "link-current-color",
@@ -14755,14 +14886,14 @@ export const SPEC_FLAVOR_PACKS = [
14755
14886
  "tier": "component",
14756
14887
  "type": "keyword",
14757
14888
  "group": "components",
14758
- "value": "underline 2px var(--iox-accent-text)"
14889
+ "value": "none"
14759
14890
  },
14760
14891
  {
14761
14892
  "name": "link-underline-rest",
14762
14893
  "tier": "component",
14763
14894
  "type": "number",
14764
14895
  "group": "components",
14765
- "value": "1"
14896
+ "value": "0"
14766
14897
  },
14767
14898
  {
14768
14899
  "name": "link-underline-thickness",
@@ -16681,6 +16812,27 @@ export const SPEC_FLAVOR_PACKS = [
16681
16812
  "group": "components",
16682
16813
  "value": "-10px"
16683
16814
  },
16815
+ {
16816
+ "name": "list-fan-step",
16817
+ "tier": "component",
16818
+ "type": "number",
16819
+ "group": "components",
16820
+ "value": "9"
16821
+ },
16822
+ {
16823
+ "name": "list-tilt",
16824
+ "tier": "component",
16825
+ "type": "number",
16826
+ "group": "components",
16827
+ "value": "3"
16828
+ },
16829
+ {
16830
+ "name": "list-tile",
16831
+ "tier": "component",
16832
+ "type": "color",
16833
+ "group": "components",
16834
+ "value": "var(--iox-surface-2)"
16835
+ },
16684
16836
  {
16685
16837
  "name": "panel-bg",
16686
16838
  "tier": "component",
@@ -17115,7 +17267,14 @@ export const SPEC_FLAVOR_PACKS = [
17115
17267
  "tier": "component",
17116
17268
  "type": "keyword",
17117
17269
  "group": "components",
17118
- "value": "underline"
17270
+ "value": "none"
17271
+ },
17272
+ {
17273
+ "name": "link-weight",
17274
+ "tier": "component",
17275
+ "type": "number",
17276
+ "group": "components",
17277
+ "value": "var(--iox-weight-strong)"
17119
17278
  },
17120
17279
  {
17121
17280
  "name": "link-current-color",
@@ -17129,14 +17288,14 @@ export const SPEC_FLAVOR_PACKS = [
17129
17288
  "tier": "component",
17130
17289
  "type": "keyword",
17131
17290
  "group": "components",
17132
- "value": "underline 2px var(--iox-accent-text)"
17291
+ "value": "none"
17133
17292
  },
17134
17293
  {
17135
17294
  "name": "link-underline-rest",
17136
17295
  "tier": "component",
17137
17296
  "type": "number",
17138
17297
  "group": "components",
17139
- "value": "1"
17298
+ "value": "0"
17140
17299
  },
17141
17300
  {
17142
17301
  "name": "link-underline-thickness",
@@ -19047,6 +19206,27 @@ export const SPEC_FLAVOR_PACKS = [
19047
19206
  "group": "components",
19048
19207
  "value": "-10px"
19049
19208
  },
19209
+ {
19210
+ "name": "list-fan-step",
19211
+ "tier": "component",
19212
+ "type": "number",
19213
+ "group": "components",
19214
+ "value": "9"
19215
+ },
19216
+ {
19217
+ "name": "list-tilt",
19218
+ "tier": "component",
19219
+ "type": "number",
19220
+ "group": "components",
19221
+ "value": "3"
19222
+ },
19223
+ {
19224
+ "name": "list-tile",
19225
+ "tier": "component",
19226
+ "type": "color",
19227
+ "group": "components",
19228
+ "value": "var(--iox-surface-2)"
19229
+ },
19050
19230
  {
19051
19231
  "name": "panel-bg",
19052
19232
  "tier": "component",
@@ -19487,7 +19667,14 @@ export const SPEC_FLAVOR_PACKS = [
19487
19667
  "tier": "component",
19488
19668
  "type": "keyword",
19489
19669
  "group": "components",
19490
- "value": "underline"
19670
+ "value": "none"
19671
+ },
19672
+ {
19673
+ "name": "link-weight",
19674
+ "tier": "component",
19675
+ "type": "number",
19676
+ "group": "components",
19677
+ "value": "var(--iox-weight-strong)"
19491
19678
  },
19492
19679
  {
19493
19680
  "name": "link-current-color",
@@ -19501,14 +19688,14 @@ export const SPEC_FLAVOR_PACKS = [
19501
19688
  "tier": "component",
19502
19689
  "type": "keyword",
19503
19690
  "group": "components",
19504
- "value": "underline 2px var(--iox-accent-text)"
19691
+ "value": "none"
19505
19692
  },
19506
19693
  {
19507
19694
  "name": "link-underline-rest",
19508
19695
  "tier": "component",
19509
19696
  "type": "number",
19510
19697
  "group": "components",
19511
- "value": "1"
19698
+ "value": "0"
19512
19699
  },
19513
19700
  {
19514
19701
  "name": "link-underline-thickness",
@@ -0,0 +1,36 @@
1
+ import { parseHexColor, toHexColor, wcagContrastRatio } from './brand';
2
+ import { ensureContrast } from './brand-neutrals';
3
+
4
+ /**
5
+ * THE INK ON AN ITEM'S OWN GROUND (award-ingredients-plan §7.1f, AW11-D10, R-H-AW11-6): a colour block's ground is the
6
+ * item's own colour (its `colour` field) — chosen by its owner, not the look — so the words on it are chosen when the
7
+ * page is drawn, item by item, in both renderers: the ink that reads best, and when neither reaches AA, the ground moved
8
+ * in lightness (its own hue and chroma) until it does. An owner's new item is checked like the samples. Pure.
9
+ */
10
+
11
+ /** The two inks a block may wear: the look's dark text and its light one (defaults: near-black and white). */
12
+ export interface GroundInks { readonly dark: string; readonly light: string }
13
+
14
+ export const DEFAULT_GROUND_INKS: GroundInks = Object.freeze({ dark: '#111111', light: '#ffffff' });
15
+ /** WCAG 2 AA for body text. */
16
+ export const GROUND_INK_MIN = 4.5;
17
+
18
+ export interface InkedGround {
19
+ /** The ground drawn — the given one, or moved in lightness until the ink reads (AA). */
20
+ readonly ground: string;
21
+ readonly ink: string;
22
+ /** True when the ground had to move. */
23
+ readonly moved: boolean;
24
+ }
25
+
26
+ /** The ink for a ground (and the ground, moved only when no ink reaches `min`); null when the ground is no hex colour. */
27
+ export function inkOnGround(ground: string, inks: GroundInks = DEFAULT_GROUND_INKS, min = GROUND_INK_MIN): InkedGround | null {
28
+ const g = parseHexColor(String(ground ?? ''));
29
+ if (!g || !parseHexColor(inks.dark) || !parseHexColor(inks.light)) return null;
30
+ const dark = wcagContrastRatio(inks.dark, g);
31
+ const light = wcagContrastRatio(inks.light, g);
32
+ const ink = dark >= light ? inks.dark : inks.light;
33
+ if (Math.max(dark, light) >= min) return { ground: toHexColor(g), ink, moved: false };
34
+ return { ground: ensureContrast(toHexColor(g), [ink], min), ink, moved: true };
35
+ }
36
+
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A COMPOSED LIST'S MIX ON ITS FRAME (award-ingredients-plan §7.1f AW11, board award-lists): the words a list section was
3
+ * composed as ride on its frame as ONE prop, `listMix` (`item:packshot arrange:grid hover:swap …`, the wire's words), and
4
+ * become marker classes — `iox-list-item-packshot`, `iox-list-hover-swap` — that the shared iox-design.css draws. The
5
+ * same decision in all three render paths (`nodeDesignClasses`), so a word is drawn by CSS alone and the canvas, both
6
+ * engine paths and the raw SSR agree. Bindings ▸ List reads and writes the same prop. Pure.
7
+ */
8
+
9
+ /** The prop (a Container's trait) the mix is stored under. */
10
+ export const LIST_MIX_PROP = 'listMix';
11
+ /** Every class a mix writes starts with this — what a live re-sync removes. */
12
+ export const LIST_CLASS_PREFIX = 'iox-list-';
13
+
14
+ const WORD = /^[a-z]+:[a-z0-9-]+$/;
15
+
16
+ interface ListMixSource {
17
+ props?: Readonly<Record<string, unknown>> | null;
18
+ traits?: ReadonlyArray<{ name?: string; default?: unknown }> | null;
19
+ }
20
+
21
+ /** The stored mix's words (`item:packshot`), from `props` (saved) or the trait (builder); [] for none. */
22
+ export function listMixWordsOf(node: ListMixSource | null | undefined): string[] {
23
+ if (!node) return [];
24
+ const raw = node.props?.[LIST_MIX_PROP] ?? node.traits?.find(t => t?.name === LIST_MIX_PROP)?.default;
25
+ const words = Array.isArray(raw) ? raw : typeof raw === 'string' ? raw.split(/\s+/) : [];
26
+ return words.filter((w): w is string => typeof w === 'string' && WORD.test(w));
27
+ }
28
+
29
+ /** The marker classes a list frame renders (`iox-list-arrange-hang iox-list-hover-swap`), or '' for none. */
30
+ export function listMixClasses(node: ListMixSource | null | undefined): string {
31
+ return [...new Set(listMixWordsOf(node))].map(w => `${LIST_CLASS_PREFIX}${w.replace(':', '-')}`).join(' ');
32
+ }
33
+
34
+ /** True for a class this module writes. */
35
+ export function isListMixClass(c: string): boolean {
36
+ return c.startsWith(LIST_CLASS_PREFIX);
37
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Which way a language reads — ONE answer for the live document (`<html dir>`, vectoriox/iox-client-engine#17), the
3
+ * builder and the composer (generation-core `isRtlLocale`). A locale is read by its language subtag (`he-IL` → `he`),
4
+ * case-insensitively; anything else reads left to right. Framework-free, pure.
5
+ */
6
+
7
+ /** The direction a page's document is written in. */
8
+ export enum LocaleDirection {
9
+ Ltr = 'ltr',
10
+ Rtl = 'rtl',
11
+ }
12
+
13
+ /** The languages written right to left (their BCP 47 language subtags). */
14
+ export const RTL_LANGUAGES: ReadonlySet<string> = new Set(['ar', 'ckb', 'dv', 'fa', 'he', 'iw', 'ps', 'sd', 'ug', 'ur', 'yi']);
15
+
16
+ /** The language subtag of a locale (`he-IL` → `he`, `pt_BR` → `pt`), lower-cased; '' when there is none. */
17
+ export function languageOf(locale: string | null | undefined): string {
18
+ return String(locale ?? '').trim().split(/[-_]/)[0].toLowerCase();
19
+ }
20
+
21
+ /** The direction `locale` reads in — `rtl` for a right-to-left language, else `ltr` (an unknown or absent locale too). */
22
+ export function localeDirection(locale: string | null | undefined): LocaleDirection {
23
+ return RTL_LANGUAGES.has(languageOf(locale)) ? LocaleDirection.Rtl : LocaleDirection.Ltr;
24
+ }
@@ -44,7 +44,8 @@ export enum MenuButtonKind {
44
44
  }
45
45
 
46
46
  export enum MenuHover {
47
- /** A line draws under the page name (today's: the drawn underline of a navigation's links). */
47
+ /** The page name changes colour (the link style's own hover). It drew a line until 2026-11-22 — no link draws one now
48
+ * (Doron); the stored word stays. */
48
49
  Line = 'line',
49
50
  /** The other page names dim. */
50
51
  Dim = 'dim',
@@ -1,5 +1,6 @@
1
1
  import { ELEMENT_STYLE_MARKER_CLASS, elementStyleClass } from './element-styles';
2
2
  import { SPEC_SCHEME_INK, SPEC_SCHEMES } from './flavor-spec.generated';
3
+ import { isListMixClass, listMixClasses } from './list-classes';
3
4
  import { isSectionDesignClass, sectionDesignClasses } from './section-edge';
4
5
 
5
6
  /**
@@ -192,13 +193,13 @@ export function hasElementStyleMarker(node: { elementStyle?: string | null } | n
192
193
  export function nodeDesignClasses(node: DesignClassSource | null | undefined): string {
193
194
  const marker = elementStyleClass(node?.elementStyle);
194
195
  return [marker ? `${ELEMENT_STYLE_MARKER_CLASS} ${marker}` : '', colorSchemeClass(colorSchemeOf(node)) ?? '', roleClass(node?.role) ?? '', barReserveClass(node) ?? '',
195
- sectionDesignClasses(node)]
196
+ sectionDesignClasses(node), listMixClasses(node)]
196
197
  .filter(Boolean).join(' ');
197
198
  }
198
199
 
199
200
  const isDesignClass = (c: string) =>
200
201
  c === ELEMENT_STYLE_MARKER_CLASS || c.startsWith(MARKER_PREFIX) || c.startsWith(SCHEME_PREFIX) || c.startsWith(ROLE_PREFIX) || c.startsWith(BAR_RESERVE_CLASS)
201
- || isSectionDesignClass(c);
202
+ || isSectionDesignClass(c) || isListMixClass(c);
202
203
 
203
204
  /** Make an element's design classes match the node — the live switch on the canvas and the
204
205
  * component path's one-time stamp. Removes stale ones; touches no other class. */
@@ -20,6 +20,8 @@ export * from './element-styles';
20
20
  export * from './adopt';
21
21
  export * from './node-classes';
22
22
  export * from './section-edge';
23
+ export * from './list-classes';
24
+ export * from './ink-on-ground';
23
25
  export * from './field-classes';
24
26
  export * from './empty-image';
25
27
  export * from './node-links';
@@ -42,3 +44,4 @@ export * from './graphemes';
42
44
  export * from './preloader';
43
45
  export * from './preloader-of';
44
46
  export * from './scrub';
47
+ export * from './locale-direction';
@@ -160,9 +160,78 @@ export const FORM_PRESETS: readonly FormPresetDef[] = /* @__PURE__ */ Object.fre
160
160
  },
161
161
  ]);
162
162
 
163
- /** The preset with this id, or undefined. */
164
- export function formPresetById(id: string | null | undefined): FormPresetDef | undefined {
165
- return FORM_PRESETS.find(p => p.id === id);
163
+ /** The preset with this id, or undefined — in English, or in `lang` when it is Hebrew (iox-ui#112: a form on a Hebrew
164
+ * site asks, answers and fails in Hebrew). */
165
+ export function formPresetById(id: string | null | undefined, lang?: string | null): FormPresetDef | undefined {
166
+ const def = FORM_PRESETS.find(p => p.id === id);
167
+ return def ? formPresetIn(def, lang) : undefined;
168
+ }
169
+
170
+ /** A preset's words on a Hebrew site: per field (by order) its label, help, placeholder and choices; the submit, the
171
+ * messages, the channel's label, the inbox name. A choice's words ARE its value (`optionsText`). */
172
+ interface FormPresetWords {
173
+ formName: string;
174
+ fields: ReadonlyArray<Partial<Pick<FormPresetField, 'label' | 'help' | 'placeholder' | 'optionsText'>>>;
175
+ submitLabel: string;
176
+ successText: string;
177
+ errorText: string;
178
+ channel?: string;
179
+ }
180
+
181
+ export const FORM_PRESET_WORDS_HE: Readonly<Record<`${FormPresetId}`, FormPresetWords>> = /* @__PURE__ */ Object.freeze({
182
+ contact: {
183
+ formName: 'טופס יצירת קשר',
184
+ fields: [{ label: 'שם מלא' }, { label: 'אימייל' }, { label: 'הודעה' }],
185
+ submitLabel: 'שליחת הודעה',
186
+ successText: 'תודה — נחזור אליכם בקרוב.',
187
+ errorText: 'לא הצלחנו לשלוח את ההודעה. נסו שוב — התשובות שלכם עדיין כאן.',
188
+ },
189
+ newsletter: {
190
+ formName: 'הרשמה לניוזלטר',
191
+ fields: [{ label: 'אימייל', placeholder: 'you@company.com' }, { label: 'שלחו לי עדכונים מדי פעם' }],
192
+ submitLabel: 'הרשמה',
193
+ successText: 'נרשמתם לרשימה.',
194
+ errorText: 'לא הצלחנו לרשום אתכם. נסו שוב.',
195
+ },
196
+ application: {
197
+ formName: 'מועמדות',
198
+ fields: [{ label: 'שם מלא' }, { label: 'אימייל' }, { label: 'טלפון' }, { label: 'תפקיד', optionsText: 'עיצוב\nפיתוח\nאחר' },
199
+ { label: 'קורות חיים', help: 'PDF או Word, עד 5MB' }, { label: 'עוד משהו' }],
200
+ submitLabel: 'הגשת מועמדות',
201
+ successText: 'המועמדות התקבלה — נקרא אותה בעיון ונחזור אליכם.',
202
+ errorText: 'לא הצלחנו להגיש את המועמדות. נסו שוב.',
203
+ },
204
+ booking: {
205
+ formName: 'בקשת הזמנה',
206
+ fields: [{ label: 'שם' }, { label: 'אימייל' }, { label: 'תאריך' }, { label: 'מספר אנשים' },
207
+ { label: 'הערות', help: 'אלרגיות, צורכי נגישות, כל דבר שיעזור' }],
208
+ submitLabel: 'בקשת הזמנה',
209
+ successText: 'הבקשה התקבלה — נאשר באימייל.',
210
+ errorText: 'לא הצלחנו לשלוח את הבקשה. נסו שוב.',
211
+ },
212
+ lead: {
213
+ formName: 'טופס פנייה',
214
+ fields: [{ label: 'שם' }, { label: 'טלפון / וואטסאפ' }, { label: 'מה העסק שלכם?' },
215
+ { label: 'מה אתם צריכים?', optionsText: 'אתר\nמיתוג\nצילום ווידאו\nעוד לא בטוחים' },
216
+ { label: 'תקציב משוער', optionsText: 'פרויקט קטן\nבינוני\nגדול\nעוד לא בטוחים' }],
217
+ submitLabel: 'שליחה',
218
+ successText: 'תודה — נחזור אליכם בקרוב.',
219
+ errorText: 'לא הצלחנו לשלוח את הפרטים. נסו שוב — התשובות שלכם עדיין כאן.',
220
+ channel: 'שלחו לנו הודעה בוואטסאפ',
221
+ },
222
+ });
223
+
224
+ /** A preset in a language: Hebrew when `lang` is, else the preset as it is. Fresh objects; the shape never changes. */
225
+ export function formPresetIn(def: FormPresetDef, lang?: string | null): FormPresetDef {
226
+ const he = (lang ?? '').toLowerCase().startsWith('he') ? FORM_PRESET_WORDS_HE[def.id] : undefined;
227
+ if (!he) return def;
228
+ return {
229
+ ...def,
230
+ formName: he.formName,
231
+ fields: def.fields.map((f, i) => ({ ...f, ...(he.fields[i] ?? {}) })),
232
+ submitLabel: he.submitLabel, successText: he.successText, errorText: he.errorText,
233
+ ...(def.channel ? { channel: { ...def.channel, label: he.channel ?? def.channel.label } } : {}),
234
+ };
166
235
  }
167
236
 
168
237
  /** The config key of an email step that goes to the studio owner's account address (iox-cms#84). */