@tangible/ui 0.2.48 → 0.2.49

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.
@@ -22,7 +22,13 @@
22
22
  --tui-nav-menu-item-fg-ancestor
23
23
  --tui-nav-menu-item-weight-ancestor
24
24
  --tui-nav-menu-item-fg-disabled
25
+ --tui-nav-menu-item-icon-fg
26
+ --tui-nav-menu-item-icon-fg-hover
27
+ --tui-nav-menu-item-icon-fg-active
28
+ --tui-nav-menu-item-icon-fg-current
29
+ --tui-nav-menu-item-icon-fg-ancestor
25
30
  --tui-nav-menu-icon-size
31
+ --tui-nav-menu-icon-gap
26
32
  --tui-nav-menu-indicator-width
27
33
  --tui-nav-menu-indicator-color
28
34
  --tui-nav-menu-sub-indent
@@ -48,6 +54,11 @@
48
54
  --tui-nav-menu-sub-item-fg-ancestor
49
55
  --tui-nav-menu-sub-item-weight-ancestor
50
56
  --tui-nav-menu-sub-item-fg-disabled
57
+ --tui-nav-menu-sub-item-icon-fg
58
+ --tui-nav-menu-sub-item-icon-fg-hover
59
+ --tui-nav-menu-sub-item-icon-fg-active
60
+ --tui-nav-menu-sub-item-icon-fg-current
61
+ --tui-nav-menu-sub-item-icon-fg-ancestor
51
62
  --tui-nav-menu-bar-item-bg
52
63
  --tui-nav-menu-bar-item-fg
53
64
  --tui-nav-menu-bar-item-weight
@@ -62,6 +73,11 @@
62
73
  --tui-nav-menu-bar-item-fg-ancestor
63
74
  --tui-nav-menu-bar-item-weight-ancestor
64
75
  --tui-nav-menu-bar-item-fg-disabled
76
+ --tui-nav-menu-bar-item-icon-fg
77
+ --tui-nav-menu-bar-item-icon-fg-hover
78
+ --tui-nav-menu-bar-item-icon-fg-active
79
+ --tui-nav-menu-bar-item-icon-fg-current
80
+ --tui-nav-menu-bar-item-icon-fg-ancestor
65
81
  --tui-nav-menu-flyout-item-bg
66
82
  --tui-nav-menu-flyout-item-fg
67
83
  --tui-nav-menu-flyout-item-weight
@@ -76,6 +92,11 @@
76
92
  --tui-nav-menu-flyout-item-fg-ancestor
77
93
  --tui-nav-menu-flyout-item-weight-ancestor
78
94
  --tui-nav-menu-flyout-item-fg-disabled
95
+ --tui-nav-menu-flyout-item-icon-fg
96
+ --tui-nav-menu-flyout-item-icon-fg-hover
97
+ --tui-nav-menu-flyout-item-icon-fg-active
98
+ --tui-nav-menu-flyout-item-icon-fg-current
99
+ --tui-nav-menu-flyout-item-icon-fg-ancestor
79
100
  */
80
101
 
81
102
  // Row state knobs, resolved per level. Each level (sub, bar, flyout) reads
@@ -103,6 +124,16 @@ $_knob-defaults: (
103
124
  fg-ancestor: "var(--_k-fg)",
104
125
  weight-ancestor: "var(--#{$_p}typography-weight-semibold, 600)",
105
126
  fg-disabled: "var(--#{$_p}color-fg-muted)",
127
+ // The leading icon. currentColor follows the row's text for its state;
128
+ // hover (and pressed) default to the resting icon, as fg-hover does, so a
129
+ // muted resting icon stays muted on the hover fill unless icon-fg-hover is
130
+ // set. Current and ancestor rows follow their own emphasised text, so a
131
+ // muted resting icon still lights up there.
132
+ icon-fg: "currentColor",
133
+ icon-fg-hover: "var(--_k-icon-fg)",
134
+ icon-fg-active: "var(--_k-icon-fg-hover)",
135
+ icon-fg-current: "currentColor",
136
+ icon-fg-ancestor: "currentColor",
106
137
  );
107
138
 
108
139
  @mixin _item-knobs($level: null, $overrides: ()) {
@@ -143,6 +174,13 @@ $_knob-defaults: (
143
174
  // An ancestor of it (any other
144
175
  // aria-current). Hover still applies.
145
176
  // --tui-nav-menu-item-fg-disabled Inert items
177
+ // --tui-nav-menu-item-icon-fg / -icon-fg-hover / -icon-fg-active /
178
+ // -icon-fg-current / -icon-fg-ancestor
179
+ // The leading icon (default: the row's
180
+ // text colour; hover and pressed
181
+ // default to the resting icon). Inert rows always use
182
+ // their text colour. Not the prefix
183
+ // slot: its content is the consumer's.
146
184
  //
147
185
  // Per-level overrides of every row knob above, each falling back to the
148
186
  // general one: --tui-nav-menu-sub-item-* (rows in a nested Sub)
@@ -154,13 +192,20 @@ $_knob-defaults: (
154
192
  // ratio: 20px on a 16px row. The glyphs
155
193
  // fill the middle 16 of a 24 box, so
156
194
  // 16px drew them at ~10.7px)
195
+ // --tui-nav-menu-icon-gap Space between the icon (or prefix)
196
+ // and the label (default: spacing-xs).
197
+ // Size and gap are general; icon
198
+ // colour is per level (item-icon-fg*).
157
199
  // --tui-nav-menu-indicator-width Current-item indicator. Opt-in: 0 by
158
200
  // default. Vertical: a leading bar on
159
201
  // the page (try 3px). Horizontal: an
160
202
  // underline on the page or its
161
203
  // ancestor (try 2px).
162
204
  // --tui-nav-menu-indicator-color That bar's colour
163
- // --tui-nav-menu-sub-indent / -border Nested list indent and guide line
205
+ // --tui-nav-menu-sub-indent / -border Nested list indent and guide line.
206
+ // Under a parent with an icon, the
207
+ // default indent lines the nested
208
+ // labels up with the parent's label.
164
209
  //
165
210
  // Horizontal (orientation="horizontal"):
166
211
  // --tui-nav-menu-bar-gap Space between bar items and clusters
@@ -217,6 +262,7 @@ $_knob-defaults: (
217
262
  --_fg: var(--_rest-fg);
218
263
  --_weight: var(--_k-weight);
219
264
  --_bg: var(--_k-bg);
265
+ --_icon-fg: var(--_k-icon-fg);
220
266
  --_indicator: var(--#{sys.$prefix}nav-menu-indicator-width, 0px);
221
267
 
222
268
  position: relative;
@@ -251,17 +297,20 @@ $_knob-defaults: (
251
297
  --_bg: var(--_k-bg-ancestor);
252
298
  --_fg: var(--_rest-fg);
253
299
  --_weight: var(--_k-weight-ancestor);
300
+ --_icon-fg: var(--_k-icon-fg-ancestor);
254
301
  }
255
302
 
256
303
  &:hover {
257
304
  --_bg: var(--_k-bg-hover);
258
305
  --_fg: var(--_k-fg-hover);
306
+ --_icon-fg: var(--_k-icon-fg-hover);
259
307
  }
260
308
 
261
309
  // Pressed. Defaults to the hover values (no change), the Button precedent.
262
310
  &:active {
263
311
  --_bg: var(--_k-bg-active);
264
312
  --_fg: var(--_k-fg-active);
313
+ --_icon-fg: var(--_k-icon-fg-active);
265
314
  }
266
315
 
267
316
  // Inset, so adjacent rows and the sidebar edge don't clip it.
@@ -276,6 +325,7 @@ $_knob-defaults: (
276
325
  --_bg: var(--_k-bg-current);
277
326
  --_fg: var(--_k-fg-current);
278
327
  --_weight: var(--_k-weight-current);
328
+ --_icon-fg: var(--_k-icon-fg-current);
279
329
 
280
330
  // Opt-in leading bar. Zero-width (invisible) unless the token is set.
281
331
  &::before {
@@ -293,6 +343,7 @@ $_knob-defaults: (
293
343
  &[aria-disabled="true"] {
294
344
  --_fg: var(--_k-fg-disabled);
295
345
  --_bg: var(--_k-bg);
346
+ --_icon-fg: currentColor;
296
347
  cursor: default;
297
348
  }
298
349
  }
@@ -301,6 +352,14 @@ $_knob-defaults: (
301
352
  display: inline-flex;
302
353
  flex: none;
303
354
  font-size: var(--#{sys.$prefix}nav-menu-icon-size, 1.25em);
355
+ color: var(--_icon-fg, currentColor);
356
+ }
357
+
358
+ // The icon gap is a margin on the leading slot on top of the row's gap,
359
+ // so the label-to-suffix and label-to-chevron spacing stays put.
360
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__icon,
361
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__prefix {
362
+ margin-inline-end: calc(var(--#{sys.$prefix}nav-menu-icon-gap, var(--#{sys.$prefix}spacing-xs)) - var(--#{sys.$prefix}spacing-xs));
304
363
  }
305
364
 
306
365
  :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__label {
@@ -344,6 +403,24 @@ $_knob-defaults: (
344
403
  border-inline-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}nav-menu-sub-border, var(--#{sys.$prefix}color-border));
345
404
  }
346
405
 
406
+ // Under a parent with an icon, nested labels line up with the parent's
407
+ // label: icon + gap, less the guide line and the list's own padding (the
408
+ // row padding is on both sides and cancels). The list takes the row's
409
+ // font size so an em icon size resolves as it does in the row. Prefix
410
+ // parents keep the plain indent: their width is the consumer's content.
411
+ :where(.#{sys.$prefix}interface) .#{sys.$prefix}nav-menu__entry.has-icon > .#{sys.$prefix}nav-menu__sub {
412
+ font-size: var(--#{sys.$prefix}nav-menu-item-font-size, var(--#{sys.$prefix}typography-size-md));
413
+ margin-inline-start: var(
414
+ --#{sys.$prefix}nav-menu-sub-indent,
415
+ calc(
416
+ var(--#{sys.$prefix}nav-menu-icon-size, 1.25em)
417
+ + var(--#{sys.$prefix}nav-menu-icon-gap, var(--#{sys.$prefix}spacing-xs))
418
+ - var(--#{sys.$prefix}border-width)
419
+ - var(--#{sys.$prefix}spacing-xs)
420
+ )
421
+ );
422
+ }
423
+
347
424
  // ==========================================================================
348
425
  // Horizontal bar
349
426
  // ==========================================================================
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.2.48",
3
- "generated": "2026-11-23T00:22:02.038Z",
2
+ "version": "0.2.49",
3
+ "generated": "2026-11-23T01:50:38.472Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -2360,7 +2360,13 @@
2360
2360
  "--tui-nav-menu-item-fg-ancestor",
2361
2361
  "--tui-nav-menu-item-weight-ancestor",
2362
2362
  "--tui-nav-menu-item-fg-disabled",
2363
+ "--tui-nav-menu-item-icon-fg",
2364
+ "--tui-nav-menu-item-icon-fg-hover",
2365
+ "--tui-nav-menu-item-icon-fg-active",
2366
+ "--tui-nav-menu-item-icon-fg-current",
2367
+ "--tui-nav-menu-item-icon-fg-ancestor",
2363
2368
  "--tui-nav-menu-icon-size",
2369
+ "--tui-nav-menu-icon-gap",
2364
2370
  "--tui-nav-menu-indicator-width",
2365
2371
  "--tui-nav-menu-indicator-color",
2366
2372
  "--tui-nav-menu-sub-indent",
@@ -2386,6 +2392,11 @@
2386
2392
  "--tui-nav-menu-sub-item-fg-ancestor",
2387
2393
  "--tui-nav-menu-sub-item-weight-ancestor",
2388
2394
  "--tui-nav-menu-sub-item-fg-disabled",
2395
+ "--tui-nav-menu-sub-item-icon-fg",
2396
+ "--tui-nav-menu-sub-item-icon-fg-hover",
2397
+ "--tui-nav-menu-sub-item-icon-fg-active",
2398
+ "--tui-nav-menu-sub-item-icon-fg-current",
2399
+ "--tui-nav-menu-sub-item-icon-fg-ancestor",
2389
2400
  "--tui-nav-menu-bar-item-bg",
2390
2401
  "--tui-nav-menu-bar-item-fg",
2391
2402
  "--tui-nav-menu-bar-item-weight",
@@ -2400,6 +2411,11 @@
2400
2411
  "--tui-nav-menu-bar-item-fg-ancestor",
2401
2412
  "--tui-nav-menu-bar-item-weight-ancestor",
2402
2413
  "--tui-nav-menu-bar-item-fg-disabled",
2414
+ "--tui-nav-menu-bar-item-icon-fg",
2415
+ "--tui-nav-menu-bar-item-icon-fg-hover",
2416
+ "--tui-nav-menu-bar-item-icon-fg-active",
2417
+ "--tui-nav-menu-bar-item-icon-fg-current",
2418
+ "--tui-nav-menu-bar-item-icon-fg-ancestor",
2403
2419
  "--tui-nav-menu-flyout-item-bg",
2404
2420
  "--tui-nav-menu-flyout-item-fg",
2405
2421
  "--tui-nav-menu-flyout-item-weight",
@@ -2413,7 +2429,12 @@
2413
2429
  "--tui-nav-menu-flyout-item-bg-ancestor",
2414
2430
  "--tui-nav-menu-flyout-item-fg-ancestor",
2415
2431
  "--tui-nav-menu-flyout-item-weight-ancestor",
2416
- "--tui-nav-menu-flyout-item-fg-disabled"
2432
+ "--tui-nav-menu-flyout-item-fg-disabled",
2433
+ "--tui-nav-menu-flyout-item-icon-fg",
2434
+ "--tui-nav-menu-flyout-item-icon-fg-hover",
2435
+ "--tui-nav-menu-flyout-item-icon-fg-active",
2436
+ "--tui-nav-menu-flyout-item-icon-fg-current",
2437
+ "--tui-nav-menu-flyout-item-icon-fg-ancestor"
2417
2438
  ],
2418
2439
  "story": {
2419
2440
  "title": "Components/NavMenu",