@tangible/ui 0.2.15 → 0.2.17

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.
@@ -11,6 +11,7 @@
11
11
  --tui-segmented-item-fg
12
12
  --tui-segmented-item-bg-active
13
13
  --tui-segmented-item-fg-active
14
+ --tui-segmented-item-border-active
14
15
  --tui-segmented-indicator
15
16
  --tui-segmented-indicator-size
16
17
  */
@@ -31,6 +32,7 @@
31
32
  // --tui-segmented-item-fg Item foreground (inactive)
32
33
  // --tui-segmented-item-bg-active Item background (active)
33
34
  // --tui-segmented-item-fg-active Item foreground (active)
35
+ // --tui-segmented-item-border-active Item border (active, outline variant)
34
36
  // --tui-segmented-indicator Underline indicator color
35
37
  // --tui-segmented-indicator-size Underline indicator thickness
36
38
  //
@@ -188,16 +190,56 @@
188
190
  --_item-border: var(--#{sys.$prefix}segmented-border, var(--#{sys.$prefix}color-border));
189
191
  --_item-bg-active: var(--#{sys.$prefix}segmented-item-bg-active, var(--#{sys.$prefix}theme-primary-subtlest));
190
192
  --_item-fg-active: var(--#{sys.$prefix}segmented-item-fg-active, var(--#{sys.$prefix}theme-primary-strong));
193
+ // The selected border is this variant's whole selection indicator, so it
194
+ // needs its own API token like the fill and text already have. Reading the
195
+ // theme token directly meant a consumer recolouring one item by value could
196
+ // move the fill and the text but not the border it sits in — and the rule
197
+ // below is (0,5,0), so overriding it needed a border-color declaration
198
+ // heavier than anything the token layer offers.
199
+ --_item-border-active: var(--#{sys.$prefix}segmented-item-border-active, var(--#{sys.$prefix}theme-primary-base));
191
200
 
192
201
  border: var(--#{sys.$prefix}border-width) solid var(--_item-border);
193
202
 
194
203
  &[aria-checked="true"] {
195
- border-color: var(--#{sys.$prefix}theme-primary-base);
204
+ border-color: var(--_item-border-active);
196
205
  background: var(--_item-bg-active);
197
206
  color: var(--_item-fg-active);
198
207
  }
199
208
  }
200
209
 
210
+ // ---------------------------------------------------------------------------
211
+ // Outline variant — dark mode contrast correction
212
+ // ---------------------------------------------------------------------------
213
+ // The light defaults are fine (text 7.81:1, border 7.52:1). In dark mode the
214
+ // ladder lightens and the same two rungs fall under threshold against the
215
+ // dark page: the selected text reads 4.45:1 on the -subtlest fill (AA wants
216
+ // 4.5) and the selected border 2.64:1 against the page (SC 1.4.11 wants 3.0
217
+ // for a non-text indicator — and here the border IS the indicator). Stepping
218
+ // each one rung fixes both: text 6.50:1, border 3.60:1.
219
+ //
220
+ // Only the FALLBACKS move, so any consumer token still wins. Scoped exactly
221
+ // as Avatar scopes its own dark correction, including the nested-interface
222
+ // arm, so a nested .tui-interface without its own data-theme inherits it.
223
+
224
+ // Written out twice rather than shared through a mixin: this whole file is
225
+ // already inside `@mixin styles()`, and Sass forbids a mixin declaration
226
+ // inside a mixin. Avatar's dark correction duplicates for the same reason.
227
+
228
+ .#{sys.$prefix}interface[data-theme="dark"] .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item,
229
+ .#{sys.$prefix}interface[data-theme="dark"] :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item {
230
+ --_item-fg-active: var(--#{sys.$prefix}segmented-item-fg-active, var(--#{sys.$prefix}theme-primary-stronger));
231
+ --_item-border-active: var(--#{sys.$prefix}segmented-item-border-active, var(--#{sys.$prefix}theme-primary-strong));
232
+ }
233
+
234
+ @media (prefers-color-scheme: dark) {
235
+ .#{sys.$prefix}interface[data-theme="auto"] .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item,
236
+ .#{sys.$prefix}interface[data-theme="auto"] :where(.#{sys.$prefix}interface) .#{sys.$prefix}segmented.is-variant-outline .#{sys.$prefix}segmented__item {
237
+ --_item-fg-active: var(--#{sys.$prefix}segmented-item-fg-active, var(--#{sys.$prefix}theme-primary-stronger));
238
+ --_item-border-active: var(--#{sys.$prefix}segmented-item-border-active, var(--#{sys.$prefix}theme-primary-strong));
239
+ }
240
+ }
241
+
242
+
201
243
  // ---------------------------------------------------------------------------
202
244
  // Variant: Underline — Item Overrides
203
245
  // ---------------------------------------------------------------------------
package/tui-manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.2.15",
3
- "generated": "2026-08-25T23:43:50.070Z",
2
+ "version": "0.2.17",
3
+ "generated": "2026-08-28T00:48:22.210Z",
4
4
  "components": {
5
5
  "Accordion": {
6
6
  "props": {
@@ -2490,6 +2490,30 @@
2490
2490
  "className": {
2491
2491
  "type": "string",
2492
2492
  "required": false
2493
+ },
2494
+ "style": {
2495
+ "type": "CSSProperties",
2496
+ "required": false
2497
+ },
2498
+ "title": {
2499
+ "type": "string",
2500
+ "required": false
2501
+ },
2502
+ "id": {
2503
+ "type": "string",
2504
+ "required": false
2505
+ },
2506
+ "rel": {
2507
+ "type": "string",
2508
+ "required": false
2509
+ },
2510
+ "onChange": {
2511
+ "type": "FormEventHandler<HTMLDivElement>",
2512
+ "required": false
2513
+ },
2514
+ "onClick": {
2515
+ "type": "MouseEventHandler<HTMLDivElement>",
2516
+ "required": false
2493
2517
  }
2494
2518
  },
2495
2519
  "cssTokens": [
@@ -2938,6 +2962,7 @@
2938
2962
  "--tui-segmented-item-fg",
2939
2963
  "--tui-segmented-item-bg-active",
2940
2964
  "--tui-segmented-item-fg-active",
2965
+ "--tui-segmented-item-border-active",
2941
2966
  "--tui-segmented-indicator",
2942
2967
  "--tui-segmented-indicator-size"
2943
2968
  ],