@tangible/ui 0.2.20 → 0.2.22
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/ColorPicker/ColorField.d.ts +25 -1
- package/components/ColorPicker/ColorField.js +9 -3
- package/components/ColorPicker/index.d.ts +1 -1
- package/components/Toast/Toast.d.ts +14 -0
- package/components/Toast/Toast.js +85 -19
- package/components/index.d.ts +1 -1
- package/figma-tokens.json +237 -21
- package/icons/icons.svg +15 -0
- package/icons/manifest.json +120 -0
- package/icons/registry.d.ts +30 -0
- package/icons/registry.js +15 -0
- package/icons/system/index.d.ts +30 -0
- package/icons/system/index.js +165 -0
- package/package.json +9 -1
- package/skills/building-with-tui/SKILL.md +13 -0
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +65 -24
- package/styles/all.expanded.unlayered.css +65 -24
- package/styles/all.unlayered.css +1 -1
- package/styles/components/color-picker.scss +58 -4
- package/styles/components/content-indicator.scss +1 -1
- package/styles/components/date-picker.scss +14 -0
- package/styles/components/toast.scss +16 -0
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/index.scss +7 -1
- package/styles/system/_palettes.scss +19 -1
- package/styles/system/_tokens.scss +7 -7
- package/tui-manifest.json +9 -4
- package/utils/color/contrast.d.ts +17 -0
- package/utils/color/contrast.js +26 -0
|
@@ -9,21 +9,27 @@ $palette: (
|
|
|
9
9
|
500: #6B7280,
|
|
10
10
|
600: #4B5563,
|
|
11
11
|
700: #374151,
|
|
12
|
+
750: #2b3443,
|
|
12
13
|
800: #202836,
|
|
13
14
|
900: #111928,
|
|
15
|
+
950: #0c121f,
|
|
16
|
+
975: #080d17,
|
|
14
17
|
),
|
|
15
18
|
"blue": (
|
|
16
19
|
25: #e2e9ff,
|
|
17
20
|
50: #c7d6ff,
|
|
18
21
|
100: #a0b5fe,
|
|
19
22
|
200: #7b93ff,
|
|
20
|
-
300: #
|
|
23
|
+
300: #5879f9,
|
|
21
24
|
400: #3858e9,
|
|
22
25
|
500: #2942d1,
|
|
23
26
|
600: #1d35b4,
|
|
24
27
|
700: #1b2398,
|
|
28
|
+
750: #151b86,
|
|
25
29
|
800: #101375,
|
|
26
30
|
900: #090949,
|
|
31
|
+
950: #060639,
|
|
32
|
+
975: #04042d,
|
|
27
33
|
),
|
|
28
34
|
"green": (
|
|
29
35
|
25: #d8f3dc,
|
|
@@ -35,8 +41,11 @@ $palette: (
|
|
|
35
41
|
500: #008a20,
|
|
36
42
|
600: #007017,
|
|
37
43
|
700: #005c12,
|
|
44
|
+
750: #00500f,
|
|
38
45
|
800: #00450c,
|
|
39
46
|
900: #003008,
|
|
47
|
+
950: #002706,
|
|
48
|
+
975: #002104,
|
|
40
49
|
),
|
|
41
50
|
"purple": (
|
|
42
51
|
25: #f9e6ff,
|
|
@@ -48,8 +57,11 @@ $palette: (
|
|
|
48
57
|
500: #9143a0,
|
|
49
58
|
600: #7a2f88,
|
|
50
59
|
700: #652071,
|
|
60
|
+
750: #5a1b65,
|
|
51
61
|
800: #4f1659,
|
|
52
62
|
900: #25082a,
|
|
63
|
+
950: #1c0520,
|
|
64
|
+
975: #140318,
|
|
53
65
|
),
|
|
54
66
|
"red": (
|
|
55
67
|
25: #fce3e5,
|
|
@@ -61,8 +73,11 @@ $palette: (
|
|
|
61
73
|
500: #d63638,
|
|
62
74
|
600: #b32d2e,
|
|
63
75
|
700: #8a2424,
|
|
76
|
+
750: #792020,
|
|
64
77
|
800: #691c1c,
|
|
65
78
|
900: #451313,
|
|
79
|
+
950: #3a0e0e,
|
|
80
|
+
975: #300b0b,
|
|
66
81
|
),
|
|
67
82
|
"yellow": (
|
|
68
83
|
25: #f9f1d2,
|
|
@@ -74,7 +89,10 @@ $palette: (
|
|
|
74
89
|
500: #996800,
|
|
75
90
|
600: #755100,
|
|
76
91
|
700: #614200,
|
|
92
|
+
750: #553a00,
|
|
77
93
|
800: #4a3200,
|
|
78
94
|
900: #362400,
|
|
95
|
+
950: #2d1d00,
|
|
96
|
+
975: #251800,
|
|
79
97
|
),
|
|
80
98
|
) !default;
|
|
@@ -243,10 +243,10 @@ $generative-interact-shift: 0.05 !default; // hover/active darkens by this
|
|
|
243
243
|
and elevated sit a step above it, mirroring light (white faces on an
|
|
244
244
|
off-white surface). Previously bg/surface were inverted, so faces read
|
|
245
245
|
darker than the page behind them. */
|
|
246
|
-
--#{$prefix}color-bg: #{pf.tone($neutral,
|
|
247
|
-
--#{$prefix}color-bg-surface: #{pf.tone($neutral,
|
|
248
|
-
--#{$prefix}color-bg-muted: #{pf.tone($neutral,
|
|
249
|
-
--#{$prefix}color-bg-elevated: #{pf.tone($neutral,
|
|
246
|
+
--#{$prefix}color-bg: #{pf.tone($neutral, 950)};
|
|
247
|
+
--#{$prefix}color-bg-surface: #{pf.tone($neutral, 975)};
|
|
248
|
+
--#{$prefix}color-bg-muted: #{pf.tone($neutral, 900)};
|
|
249
|
+
--#{$prefix}color-bg-elevated: #{pf.tone($neutral, 900)};
|
|
250
250
|
--#{$prefix}color-bg-inverted: #{pf.tone($neutral, 50)};
|
|
251
251
|
--#{$prefix}color-bg-overlay: rgba(0, 0, 0, 0.7);
|
|
252
252
|
|
|
@@ -258,12 +258,12 @@ $generative-interact-shift: 0.05 !default; // hover/active darkens by this
|
|
|
258
258
|
--#{$prefix}color-fg-inverted: #{pf.tone($neutral, 900)};
|
|
259
259
|
|
|
260
260
|
/* Borders */
|
|
261
|
-
--#{$prefix}color-border: #{pf.tone($neutral,
|
|
261
|
+
--#{$prefix}color-border: #{pf.tone($neutral, 750)};
|
|
262
262
|
--#{$prefix}color-divider: #{pf.tone($neutral, 800)};
|
|
263
263
|
|
|
264
264
|
/* Control fills */
|
|
265
|
-
--#{$prefix}color-fill-subtle: #{pf.tone($neutral,
|
|
266
|
-
--#{$prefix}color-fill: #{pf.tone($neutral,
|
|
265
|
+
--#{$prefix}color-fill-subtle: #{pf.tone($neutral, 900)};
|
|
266
|
+
--#{$prefix}color-fill: #{pf.tone($neutral, 800)};
|
|
267
267
|
--#{$prefix}color-fill-strong: #{pf.tone($neutral, 600)};
|
|
268
268
|
|
|
269
269
|
/* Input chrome */
|
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"generated": "2026-
|
|
2
|
+
"version": "0.2.22",
|
|
3
|
+
"generated": "2026-10-01T03:28:54.494Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -3816,6 +3816,11 @@
|
|
|
3816
3816
|
"defaultValue": "true",
|
|
3817
3817
|
"description": "Renders a dismiss (×) button. Default true."
|
|
3818
3818
|
},
|
|
3819
|
+
"focusable": {
|
|
3820
|
+
"type": "boolean",
|
|
3821
|
+
"required": false,
|
|
3822
|
+
"description": "Makes the toast root programmatically focusable (tabIndex -1, with a\nfocus ring) — Notice's `focusable`, forwarded. ToastProvider sets it on\nevery queued toast: the root is the focus target when a same-id\nreplacement unmounts an instance that held focus."
|
|
3823
|
+
},
|
|
3819
3824
|
"onDismiss": {
|
|
3820
3825
|
"type": "() => void",
|
|
3821
3826
|
"required": false,
|
|
@@ -4135,9 +4140,9 @@
|
|
|
4135
4140
|
"membersync": 22,
|
|
4136
4141
|
"player": 24,
|
|
4137
4142
|
"reaction": 36,
|
|
4138
|
-
"system":
|
|
4143
|
+
"system": 116
|
|
4139
4144
|
},
|
|
4140
|
-
"total":
|
|
4145
|
+
"total": 255,
|
|
4141
4146
|
"manifest": "./icons/manifest.json"
|
|
4142
4147
|
}
|
|
4143
4148
|
}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export type ContrastTone = 'light' | 'dark';
|
|
2
|
+
/**
|
|
3
|
+
* WCAG 2.x contrast ratio between two colours, 1 (identical) to 21
|
|
4
|
+
* (black on white). Order-independent — the lighter colour is always the
|
|
5
|
+
* numerator. Compare against 4.5 (AA text), 3 (AA large text / SC 1.4.11
|
|
6
|
+
* non-text), 7 (AAA text).
|
|
7
|
+
*
|
|
8
|
+
* @param hexA - Either colour in #rgb/#rrggbb (alpha digits ignored)
|
|
9
|
+
* @param hexB - The other colour
|
|
10
|
+
* @returns The ratio, or `NaN` when either input is not a hex colour — so a
|
|
11
|
+
* `>= 4.5` check on bad input fails rather than passes. No runtime throws,
|
|
12
|
+
* matching `getContrastTone`.
|
|
13
|
+
*
|
|
14
|
+
* Same scope rules as `getContrastTone`: for user-selected colours and
|
|
15
|
+
* consumer-side theme tooling (e.g. validating a generated ladder against a
|
|
16
|
+
* page background), not for choosing a component's own theming at runtime.
|
|
17
|
+
*/
|
|
18
|
+
export declare function contrastRatio(hexA: string, hexB: string): number;
|
|
2
19
|
/**
|
|
3
20
|
* Determine whether light or dark foreground provides better contrast.
|
|
4
21
|
* Uses WCAG relative luminance with 0.179 threshold.
|
package/utils/color/contrast.js
CHANGED
|
@@ -46,6 +46,32 @@ function getRelativeLuminance(r, g, b) {
|
|
|
46
46
|
0.7152 * gammaCorrect(g) +
|
|
47
47
|
0.0722 * gammaCorrect(b));
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* WCAG 2.x contrast ratio between two colours, 1 (identical) to 21
|
|
51
|
+
* (black on white). Order-independent — the lighter colour is always the
|
|
52
|
+
* numerator. Compare against 4.5 (AA text), 3 (AA large text / SC 1.4.11
|
|
53
|
+
* non-text), 7 (AAA text).
|
|
54
|
+
*
|
|
55
|
+
* @param hexA - Either colour in #rgb/#rrggbb (alpha digits ignored)
|
|
56
|
+
* @param hexB - The other colour
|
|
57
|
+
* @returns The ratio, or `NaN` when either input is not a hex colour — so a
|
|
58
|
+
* `>= 4.5` check on bad input fails rather than passes. No runtime throws,
|
|
59
|
+
* matching `getContrastTone`.
|
|
60
|
+
*
|
|
61
|
+
* Same scope rules as `getContrastTone`: for user-selected colours and
|
|
62
|
+
* consumer-side theme tooling (e.g. validating a generated ladder against a
|
|
63
|
+
* page background), not for choosing a component's own theming at runtime.
|
|
64
|
+
*/
|
|
65
|
+
export function contrastRatio(hexA, hexB) {
|
|
66
|
+
const a = parseHex(hexA);
|
|
67
|
+
const b = parseHex(hexB);
|
|
68
|
+
if (!a || !b)
|
|
69
|
+
return NaN;
|
|
70
|
+
const la = getRelativeLuminance(...a);
|
|
71
|
+
const lb = getRelativeLuminance(...b);
|
|
72
|
+
const [lighter, darker] = la >= lb ? [la, lb] : [lb, la];
|
|
73
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
74
|
+
}
|
|
49
75
|
/**
|
|
50
76
|
* Determine whether light or dark foreground provides better contrast.
|
|
51
77
|
* Uses WCAG relative luminance with 0.179 threshold.
|