@tangible/ui 0.2.41 → 0.2.43
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/components/CommandPalette/CommandPalette.d.ts +30 -0
- package/components/CommandPalette/CommandPalette.js +409 -0
- package/components/CommandPalette/CommandPaletteContext.d.ts +31 -0
- package/components/CommandPalette/CommandPaletteContext.js +8 -0
- package/components/CommandPalette/index.d.ts +3 -0
- package/components/CommandPalette/index.js +2 -0
- package/components/CommandPalette/shortcut.d.ts +15 -0
- package/components/CommandPalette/shortcut.js +83 -0
- package/components/CommandPalette/types.d.ts +152 -0
- package/components/CommandPalette/types.js +16 -0
- package/components/IconButton/IconButton.js +5 -2
- package/components/IconButton/IconButtonCore.js +16 -4
- package/components/IconButton/badge.d.ts +20 -0
- package/components/IconButton/badge.js +22 -0
- package/components/IconButton/types.d.ts +54 -2
- package/components/IconButton/types.js +2 -0
- package/components/IconTile/IconTile.d.ts +16 -0
- package/components/IconTile/IconTile.js +17 -0
- package/components/IconTile/index.d.ts +2 -0
- package/components/IconTile/index.js +1 -0
- package/components/IconTile/types.d.ts +29 -0
- package/components/IconTile/types.js +1 -0
- package/components/SegmentedControl/SegmentedControl.js +2 -2
- package/components/SegmentedControl/types.d.ts +10 -0
- package/components/Table/DataTable.js +1 -1
- package/components/Table/types.d.ts +6 -0
- package/components/Table/types.js +3 -0
- package/components/index.d.ts +4 -0
- package/components/index.js +2 -0
- package/figma-tokens.json +101 -3
- package/icons/icons.svg +1 -1
- package/icons/sprite-version.js +1 -1
- package/icons/sprite.php +1 -1
- package/package.json +13 -1
- package/skills/building-with-tui/SKILL.md +33 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +563 -67
- package/styles/all.expanded.unlayered.css +563 -67
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +8 -0
- package/styles/components/avatar.scss +6 -23
- package/styles/components/button.scss +15 -15
- package/styles/components/chip.scss +35 -11
- package/styles/components/command-palette.scss +314 -0
- package/styles/components/content-indicator.scss +6 -1
- package/styles/components/date-picker.scss +1 -1
- package/styles/components/icon-button.scss +82 -11
- package/styles/components/icon-tile.scss +89 -0
- package/styles/components/input/index.scss +4 -0
- package/styles/components/multi-select.scss +1 -1
- package/styles/components/progress.scss +23 -0
- package/styles/components/segmented-control.scss +11 -1
- package/styles/components/step-indicator.scss +1 -1
- package/styles/components/tabs.scss +1 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_constants.scss +5 -0
- package/styles/system/_palettes.scss +1 -0
- package/styles/system/_tokens.scss +40 -1
- package/tui-manifest.json +189 -5
- package/utils/color/theme.d.ts +66 -0
- package/utils/color/theme.js +232 -0
- package/vanilla/styles.css +1 -1
- package/vanilla/styles.unlayered.css +1 -1
package/figma-tokens.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.43",
|
|
3
3
|
"source": "publish/styles/all.expanded.css",
|
|
4
4
|
"prefix": "tui-",
|
|
5
5
|
"note": "Layer 1 primitives only. Component API tokens (--tui-{component}-*) are never defined in CSS — they exist only as fallback reads — so they have no Figma representation. CONTRACT: consumers read TUI defaults from this file at build time (variables[].cssVar, the \"Light\"/\"Dark\" mode names, and alias chains into TUI/Primitives). Renaming a cssVar or a mode is a breaking change to those consumers even when the CSS value is unchanged — a rename silently becomes an undefined default downstream — so treat it as at least a minor bump and call it out in the CHANGELOG.",
|
|
@@ -326,6 +326,18 @@
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
},
|
|
329
|
+
{
|
|
330
|
+
"name": "palette/gray/550",
|
|
331
|
+
"type": "COLOR",
|
|
332
|
+
"values": {
|
|
333
|
+
"Default": {
|
|
334
|
+
"r": 0.3764705882352941,
|
|
335
|
+
"g": 0.40784313725490196,
|
|
336
|
+
"b": 0.4627450980392157,
|
|
337
|
+
"a": 1
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
329
341
|
{
|
|
330
342
|
"name": "palette/gray/600",
|
|
331
343
|
"type": "COLOR",
|
|
@@ -1462,9 +1474,9 @@
|
|
|
1462
1474
|
"type": "COLOR",
|
|
1463
1475
|
"values": {
|
|
1464
1476
|
"Light": {
|
|
1465
|
-
"alias": "palette/gray/
|
|
1477
|
+
"alias": "palette/gray/550",
|
|
1466
1478
|
"collection": "TUI/Primitives",
|
|
1467
|
-
"hex": "#
|
|
1479
|
+
"hex": "#606876"
|
|
1468
1480
|
},
|
|
1469
1481
|
"Dark": {
|
|
1470
1482
|
"alias": "palette/gray/400",
|
|
@@ -2894,6 +2906,21 @@
|
|
|
2894
2906
|
}
|
|
2895
2907
|
}
|
|
2896
2908
|
},
|
|
2909
|
+
{
|
|
2910
|
+
"name": "theme/danger/on-base",
|
|
2911
|
+
"cssVar": "--tui-theme-danger-on-base",
|
|
2912
|
+
"type": "COLOR",
|
|
2913
|
+
"values": {
|
|
2914
|
+
"Light": {
|
|
2915
|
+
"alias": "color/fg/on-accent"
|
|
2916
|
+
},
|
|
2917
|
+
"Dark": {
|
|
2918
|
+
"alias": "palette/gray/950",
|
|
2919
|
+
"collection": "TUI/Primitives",
|
|
2920
|
+
"hex": "#0c121f"
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2897
2924
|
{
|
|
2898
2925
|
"name": "theme/danger/soft",
|
|
2899
2926
|
"cssVar": "--tui-theme-danger-soft",
|
|
@@ -3013,6 +3040,19 @@
|
|
|
3013
3040
|
}
|
|
3014
3041
|
}
|
|
3015
3042
|
},
|
|
3043
|
+
{
|
|
3044
|
+
"name": "theme/info/on-base",
|
|
3045
|
+
"cssVar": "--tui-theme-info-on-base",
|
|
3046
|
+
"type": "COLOR",
|
|
3047
|
+
"values": {
|
|
3048
|
+
"Light": {
|
|
3049
|
+
"alias": "color/fg/on-accent"
|
|
3050
|
+
},
|
|
3051
|
+
"Dark": {
|
|
3052
|
+
"alias": "color/fg/on-accent"
|
|
3053
|
+
}
|
|
3054
|
+
}
|
|
3055
|
+
},
|
|
3016
3056
|
{
|
|
3017
3057
|
"name": "theme/info/soft",
|
|
3018
3058
|
"cssVar": "--tui-theme-info-soft",
|
|
@@ -3132,6 +3172,19 @@
|
|
|
3132
3172
|
}
|
|
3133
3173
|
}
|
|
3134
3174
|
},
|
|
3175
|
+
{
|
|
3176
|
+
"name": "theme/primary/on-base",
|
|
3177
|
+
"cssVar": "--tui-theme-primary-on-base",
|
|
3178
|
+
"type": "COLOR",
|
|
3179
|
+
"values": {
|
|
3180
|
+
"Light": {
|
|
3181
|
+
"alias": "color/fg/on-accent"
|
|
3182
|
+
},
|
|
3183
|
+
"Dark": {
|
|
3184
|
+
"alias": "color/fg/on-accent"
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
},
|
|
3135
3188
|
{
|
|
3136
3189
|
"name": "theme/primary/soft",
|
|
3137
3190
|
"cssVar": "--tui-theme-primary-soft",
|
|
@@ -3251,6 +3304,21 @@
|
|
|
3251
3304
|
}
|
|
3252
3305
|
}
|
|
3253
3306
|
},
|
|
3307
|
+
{
|
|
3308
|
+
"name": "theme/secondary/on-base",
|
|
3309
|
+
"cssVar": "--tui-theme-secondary-on-base",
|
|
3310
|
+
"type": "COLOR",
|
|
3311
|
+
"values": {
|
|
3312
|
+
"Light": {
|
|
3313
|
+
"alias": "color/fg/on-accent"
|
|
3314
|
+
},
|
|
3315
|
+
"Dark": {
|
|
3316
|
+
"alias": "palette/gray/950",
|
|
3317
|
+
"collection": "TUI/Primitives",
|
|
3318
|
+
"hex": "#0c121f"
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
},
|
|
3254
3322
|
{
|
|
3255
3323
|
"name": "theme/secondary/soft",
|
|
3256
3324
|
"cssVar": "--tui-theme-secondary-soft",
|
|
@@ -3370,6 +3438,21 @@
|
|
|
3370
3438
|
}
|
|
3371
3439
|
}
|
|
3372
3440
|
},
|
|
3441
|
+
{
|
|
3442
|
+
"name": "theme/success/on-base",
|
|
3443
|
+
"cssVar": "--tui-theme-success-on-base",
|
|
3444
|
+
"type": "COLOR",
|
|
3445
|
+
"values": {
|
|
3446
|
+
"Light": {
|
|
3447
|
+
"alias": "color/fg/on-accent"
|
|
3448
|
+
},
|
|
3449
|
+
"Dark": {
|
|
3450
|
+
"alias": "palette/gray/950",
|
|
3451
|
+
"collection": "TUI/Primitives",
|
|
3452
|
+
"hex": "#0c121f"
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
},
|
|
3373
3456
|
{
|
|
3374
3457
|
"name": "theme/success/soft",
|
|
3375
3458
|
"cssVar": "--tui-theme-success-soft",
|
|
@@ -3489,6 +3572,21 @@
|
|
|
3489
3572
|
}
|
|
3490
3573
|
}
|
|
3491
3574
|
},
|
|
3575
|
+
{
|
|
3576
|
+
"name": "theme/warning/on-base",
|
|
3577
|
+
"cssVar": "--tui-theme-warning-on-base",
|
|
3578
|
+
"type": "COLOR",
|
|
3579
|
+
"values": {
|
|
3580
|
+
"Light": {
|
|
3581
|
+
"alias": "color/fg/on-accent"
|
|
3582
|
+
},
|
|
3583
|
+
"Dark": {
|
|
3584
|
+
"alias": "palette/gray/950",
|
|
3585
|
+
"collection": "TUI/Primitives",
|
|
3586
|
+
"hex": "#0c121f"
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
},
|
|
3492
3590
|
{
|
|
3493
3591
|
"name": "theme/warning/soft",
|
|
3494
3592
|
"cssVar": "--tui-theme-warning-soft",
|
package/icons/icons.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" data-tui-icon-sprite="all" data-tui-icon-sprite-version="0.2.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" data-tui-icon-sprite="all" data-tui-icon-sprite-version="0.2.43" aria-hidden="true" focusable="false" style="position:absolute;width:0;height:0;overflow:hidden">
|
|
2
2
|
<symbol id="tui-cred-badge-check" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M10.893 4.558a1.377 1.377 0 0 1 2.214 0c.381.515 1.068.7 1.656.444a1.377 1.377 0 0 1 1.917 1.106c.072.637.575 1.14 1.212 1.213a1.377 1.377 0 0 1 1.106 1.916 1.38 1.38 0 0 0 .444 1.656c.744.55.744 1.663 0 2.214a1.38 1.38 0 0 0-.444 1.656 1.377 1.377 0 0 1-1.106 1.917 1.38 1.38 0 0 0-1.212 1.212 1.377 1.377 0 0 1-1.917 1.106 1.38 1.38 0 0 0-1.656.444 1.377 1.377 0 0 1-2.214 0 1.38 1.38 0 0 0-1.656-.444 1.377 1.377 0 0 1-1.916-1.106 1.38 1.38 0 0 0-1.213-1.212 1.377 1.377 0 0 1-1.106-1.917 1.38 1.38 0 0 0-.444-1.656 1.377 1.377 0 0 1 0-2.214c.515-.381.7-1.068.444-1.656a1.377 1.377 0 0 1 1.106-1.916 1.38 1.38 0 0 0 1.213-1.213 1.377 1.377 0 0 1 1.916-1.106 1.38 1.38 0 0 0 1.656-.444m5.193 5.91a.75.75 0 0 0-1.172-.936l-3.531 4.414-1.914-1.532a.75.75 0 1 0-.937 1.172l3.085 2.468z" clip-rule="evenodd"/></symbol>
|
|
3
3
|
<symbol id="tui-cred-badge-ribbon" viewBox="0 0 24 24"><path d="M11.032 3.488a1.205 1.205 0 0 1 1.936 0c.334.451.935.612 1.45.388a1.205 1.205 0 0 1 1.677.969c.063.557.503.997 1.06 1.06.805.092 1.291.935.969 1.678a1.204 1.204 0 0 0 .388 1.449c.65.481.65 1.455 0 1.936a1.205 1.205 0 0 0-.388 1.45 1.205 1.205 0 0 1-.969 1.677 1.204 1.204 0 0 0-1.06 1.06 1.205 1.205 0 0 1-1.678.969 1.205 1.205 0 0 0-1.449.388c-.481.65-1.455.65-1.936 0a1.204 1.204 0 0 0-1.45-.388 1.205 1.205 0 0 1-1.677-.969 1.205 1.205 0 0 0-1.06-1.06 1.205 1.205 0 0 1-.969-1.678 1.205 1.205 0 0 0-.388-1.449 1.205 1.205 0 0 1 0-1.936c.451-.334.612-.935.388-1.45a1.205 1.205 0 0 1 .969-1.677 1.205 1.205 0 0 0 1.06-1.06 1.205 1.205 0 0 1 1.678-.969 1.205 1.205 0 0 0 1.449-.388M8 17.482c.442.175.953.185 1.437-.025a.88.88 0 0 1 1.054.282 1.877 1.877 0 0 0 3.018 0 .88.88 0 0 1 1.054-.282c.484.21.995.2 1.437.025V21l-4-2.286L8 21z"/></symbol>
|
|
4
4
|
<symbol id="tui-cred-badge" viewBox="0 0 24 24"><path d="M13.107 4.558a1.377 1.377 0 0 0-2.214 0c-.381.515-1.068.7-1.656.444a1.377 1.377 0 0 0-1.916 1.106 1.38 1.38 0 0 1-1.213 1.213 1.377 1.377 0 0 0-1.106 1.916 1.38 1.38 0 0 1-.444 1.656 1.377 1.377 0 0 0 0 2.214c.515.381.7 1.068.444 1.656a1.377 1.377 0 0 0 1.106 1.917c.637.072 1.14.575 1.213 1.212a1.377 1.377 0 0 0 1.916 1.106 1.38 1.38 0 0 1 1.656.444c.55.744 1.663.744 2.214 0a1.38 1.38 0 0 1 1.656-.444 1.377 1.377 0 0 0 1.917-1.106 1.38 1.38 0 0 1 1.212-1.212 1.377 1.377 0 0 0 1.106-1.917 1.38 1.38 0 0 1 .444-1.656 1.377 1.377 0 0 0 0-2.214 1.38 1.38 0 0 1-.444-1.656 1.377 1.377 0 0 0-1.106-1.916 1.38 1.38 0 0 1-1.212-1.213 1.377 1.377 0 0 0-1.917-1.106 1.38 1.38 0 0 1-1.656-.444"/></symbol>
|
package/icons/sprite-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SPRITE_VERSION = '0.2.
|
|
1
|
+
export const SPRITE_VERSION = '0.2.43';
|
package/icons/sprite.php
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
// Replaced with the package version at build time.
|
|
24
|
-
$GLOBALS['tangible_ui_icon_sprite_copies'][__DIR__] = '0.2.
|
|
24
|
+
$GLOBALS['tangible_ui_icon_sprite_copies'][__DIR__] = '0.2.43';
|
|
25
25
|
|
|
26
26
|
if (!function_exists('tangible_ui_print_icon_sprite')) {
|
|
27
27
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangible/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
4
4
|
"description": "React design system for Tangible's products: standalone React apps and WordPress plugins. Components, CSS custom property tokens, cascade layers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./components/index.js",
|
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
"import": "./utils/color/gradient.js",
|
|
51
51
|
"types": "./utils/color/gradient.d.ts"
|
|
52
52
|
},
|
|
53
|
+
"./utils/color/theme": {
|
|
54
|
+
"import": "./utils/color/theme.js",
|
|
55
|
+
"types": "./utils/color/theme.d.ts"
|
|
56
|
+
},
|
|
53
57
|
"./utils/color-scheme": {
|
|
54
58
|
"import": "./utils/color-scheme.js",
|
|
55
59
|
"types": "./utils/color-scheme.d.ts"
|
|
@@ -116,6 +120,10 @@
|
|
|
116
120
|
"import": "./components/Combobox/index.js",
|
|
117
121
|
"types": "./components/Combobox/index.d.ts"
|
|
118
122
|
},
|
|
123
|
+
"./components/CommandPalette": {
|
|
124
|
+
"import": "./components/CommandPalette/index.js",
|
|
125
|
+
"types": "./components/CommandPalette/index.d.ts"
|
|
126
|
+
},
|
|
119
127
|
"./components/ContentIndicator": {
|
|
120
128
|
"import": "./components/ContentIndicator/index.js",
|
|
121
129
|
"types": "./components/ContentIndicator/index.d.ts"
|
|
@@ -144,6 +152,10 @@
|
|
|
144
152
|
"import": "./components/IconButton/index.js",
|
|
145
153
|
"types": "./components/IconButton/index.d.ts"
|
|
146
154
|
},
|
|
155
|
+
"./components/IconTile": {
|
|
156
|
+
"import": "./components/IconTile/index.js",
|
|
157
|
+
"types": "./components/IconTile/index.d.ts"
|
|
158
|
+
},
|
|
147
159
|
"./components/Modal": {
|
|
148
160
|
"import": "./components/Modal/index.js",
|
|
149
161
|
"types": "./components/Modal/index.d.ts"
|
|
@@ -398,7 +398,7 @@ Oct 24 2026.
|
|
|
398
398
|
| ColorField | `trigger`, `dynamic`, `modes`, `solidTab`, `gradientTab` (its popover takes ColorPicker's) |
|
|
399
399
|
| ColorPicker | `group`, `area`, `hue`, `alpha`, `format`, `value`, `copy`, `copied`, `variable`, `formats`, `channels`, channel names, value texts |
|
|
400
400
|
| Combobox | `clear` |
|
|
401
|
-
| DataTable / BulkActionsBar | `selectAll`, `selectRow`, `pageStatus`, `sortBy`, `sorted` / `selected`, `actions` |
|
|
401
|
+
| DataTable / BulkActionsBar | `selectAll`, `selectRow`, `pageStatus`, `sortBy`, `sorted`, `bulkSelected`, `bulkActions`, `bulkClear` (the built-in bulk bar, 0.2.42+) / `selected`, `actions` |
|
|
402
402
|
| DatePicker | `title`, `titleWithTime`, `now`, `close`, `placeholder`, `timeSection`, `dateSection`, `month`, `dayOfMonth`, `year`, `hour`, `minute`, `am`, `pm`, `meridiem`, `trigger`, `triggerEmpty` |
|
|
403
403
|
| DateRangePicker | `from`, `to`, `apply`, `cancel`, `placeholder`, `presets`, `trigger`, `triggerEmpty`, `openEnd` |
|
|
404
404
|
| Field | `required` (the visually hidden "required" after the label) |
|
|
@@ -469,12 +469,26 @@ Colour maths ships as public utils: `@tangible/ui/utils/color` (`parseColor`, `f
|
|
|
469
469
|
`>= 4.5` check fails closed). Use them for user-selected colours and theme tooling (deriving or
|
|
470
470
|
validating a ladder), not to pick a component's own theming at runtime.
|
|
471
471
|
|
|
472
|
+
To theme from a brand colour, `@tangible/ui/utils/color/theme` derives every colour token, in
|
|
473
|
+
both modes, from a primary or from `{ primary, secondary, neutral }` (secondary chrome gets its own
|
|
474
|
+
ladder; neutral sets the temperature of the greys, and `vibrance` from 0 to 1 lets it colour the page outright): `deriveThemeCss(source)` returns a stylesheet (light on `.tui-interface`, dark
|
|
475
|
+
and `auto` one specificity step above TUI's own dark block, nested interfaces included), and
|
|
476
|
+
`deriveThemeTokens(source, 'light' | 'dark')` returns the `--tui-*` map as hex. Each step is solved
|
|
477
|
+
for its WCAG contrast, so text, primary fills and control borders clear AA on every surface
|
|
478
|
+
(`bg`, `-surface`, `-muted`, `-elevated`) for any hue. Only each colour's hue and chroma are used.
|
|
479
|
+
In dark mode the accent fills are light, so they pair with dark text through
|
|
480
|
+
`--tui-theme-{primary,secondary}-on-base`.
|
|
481
|
+
|
|
472
482
|
Useful primitives:
|
|
473
483
|
|
|
474
484
|
- Surfaces / text: `--tui-color-bg`, `-bg-surface`, `-bg-elevated`, `-bg-muted`, `-bg-inverted`,
|
|
475
485
|
`--tui-color-fg`, `-fg-secondary`, `-fg-muted`, `-fg-on-accent`, `--tui-color-border`,
|
|
476
486
|
`--tui-color-border-control` (form-control boundaries, 3:1; `--tui-color-border` is decorative), `--tui-color-divider`, `--tui-color-fill{,-subtle,-strong}`, `--tui-color-focus-ring`.
|
|
477
487
|
- Themes: `--tui-theme-{primary,secondary,success,warning,danger,info}-{subtlest,subtle,soft,base,strong,stronger,strongest}`.
|
|
488
|
+
Text on a theme's `base` fill: `--tui-theme-{name}-on-base` (white in light; dark text on
|
|
489
|
+
secondary/success/warning/danger in dark, where white fails AA). Prefer it to `-fg-on-accent`.
|
|
490
|
+
If you re-point a theme's `-base` fill, re-point its `-on-base` with it: the dark values are
|
|
491
|
+
fixed, so overriding `--tui-color-fg-on-accent` only moves primary and info.
|
|
478
492
|
The ladder is **contrast-based** — "stronger" always means more contrast against the current
|
|
479
493
|
background, so a single choice reads correctly in both light and dark mode.
|
|
480
494
|
- Control heights, shared by every form control *and* Button / IconButton / SegmentedControl /
|
|
@@ -523,6 +537,24 @@ up descender space unless it's `display: flex`. `decorative` ignores `tooltip` a
|
|
|
523
537
|
`className` is for layout integration (margin, grid placement), not appearance. Beyond the token
|
|
524
538
|
API the sanctioned escape hatch is to **swizzle** — copy the component source and own the fork.
|
|
525
539
|
|
|
540
|
+
### A badged icon button in a header
|
|
541
|
+
|
|
542
|
+
`<IconButton icon="system/bell" label="Notifications" badge={unread} />` is named "Notifications,
|
|
543
|
+
5 new": the count lives in the name, so don't add your own `aria-label` (it drops the count; a dev
|
|
544
|
+
warning fires) and translate through `labels.badgeCount(count, label)`. The header that holds it
|
|
545
|
+
sets the badge's cut-out ring to its own background, once, and its colour if not primary:
|
|
546
|
+
|
|
547
|
+
```css
|
|
548
|
+
.app-header {
|
|
549
|
+
--tui-icon-button-badge-ring: var(--tui-color-bg-elevated); /* the header's surface */
|
|
550
|
+
--tui-icon-button-badge-bg: var(--tui-theme-danger-base); /* optional: red badges */
|
|
551
|
+
--tui-icon-button-badge-fg: var(--tui-theme-danger-on-base);
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
Leave a gap after a badged button: a "99+" overhangs its end edge by about 10px at `sm`. A changing
|
|
556
|
+
count is not announced; if an arrival matters right away, say so with a Toast.
|
|
557
|
+
|
|
526
558
|
### Card spacing, container and links
|
|
527
559
|
|
|
528
560
|
- **Padding vs gap.** `--tui-card-padding` is the card's *outer* edge: inline on every slot, and
|