@tangible/ui 0.2.35 → 0.2.36
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/index.d.ts +1 -0
- package/components/index.js +3 -0
- package/figma-tokens.json +15 -3
- package/icons/icons.svg +1 -1
- package/icons/sprite-version.js +1 -1
- package/icons/sprite.php +1 -1
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +28 -0
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +23 -10
- package/styles/all.expanded.unlayered.css +23 -10
- package/styles/all.unlayered.css +1 -1
- package/styles/components/accordion.scss +22 -4
- package/styles/components/chip.scss +11 -10
- package/styles/components/table.scss +3 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/index.scss +13 -0
- package/styles/system/_palettes.scss +1 -0
- package/styles/system/_tokens.scss +1 -1
- package/tui-manifest.json +2 -2
- package/utils/color-scheme.d.ts +61 -10
- package/utils/color-scheme.js +101 -12
- package/utils/index.d.ts +1 -2
- package/utils/index.js +1 -1
- package/vanilla/styles.css +1 -1
- package/vanilla/styles.unlayered.css +1 -1
package/components/index.d.ts
CHANGED
|
@@ -94,3 +94,4 @@ export type { ToolbarProps, ToolbarGroupProps, ToolbarItemProps, ToolbarOrientat
|
|
|
94
94
|
export type { TooltipProps, TooltipProviderProps, TooltipTriggerProps, TooltipContentProps, TooltipType } from './Tooltip';
|
|
95
95
|
export { GENERATIVE_COLORS, stringToGenerativeColor } from '../utils/generative';
|
|
96
96
|
export type { GenerativeColor } from '../utils/generative';
|
|
97
|
+
export * from '../utils/color-scheme';
|
package/components/index.js
CHANGED
|
@@ -47,3 +47,6 @@ export { Toolbar } from './Toolbar/index.js';
|
|
|
47
47
|
export { Tooltip, TooltipProvider, TooltipTrigger, TooltipContent } from './Tooltip/index.js';
|
|
48
48
|
// Generative colors (The Jellybean Bag) — deterministic identity colors
|
|
49
49
|
export { GENERATIVE_COLORS, stringToGenerativeColor } from '../utils/generative.js';
|
|
50
|
+
// Color scheme switching (instant: no controls fading into the new theme)
|
|
51
|
+
// (the module's whole surface: one list, kept in color-scheme.ts)
|
|
52
|
+
export * from '../utils/color-scheme.js';
|
package/figma-tokens.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
2
|
+
"version": "0.2.36",
|
|
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.",
|
|
@@ -230,6 +230,18 @@
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
|
+
{
|
|
234
|
+
"name": "palette/gray/150",
|
|
235
|
+
"type": "COLOR",
|
|
236
|
+
"values": {
|
|
237
|
+
"Default": {
|
|
238
|
+
"r": 0.9254901960784314,
|
|
239
|
+
"g": 0.9333333333333333,
|
|
240
|
+
"b": 0.9450980392156862,
|
|
241
|
+
"a": 1
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
233
245
|
{
|
|
234
246
|
"name": "palette/gray/200",
|
|
235
247
|
"type": "COLOR",
|
|
@@ -3330,9 +3342,9 @@
|
|
|
3330
3342
|
"type": "COLOR",
|
|
3331
3343
|
"values": {
|
|
3332
3344
|
"Light": {
|
|
3333
|
-
"alias": "palette/gray/
|
|
3345
|
+
"alias": "palette/gray/150",
|
|
3334
3346
|
"collection": "TUI/Primitives",
|
|
3335
|
-
"hex": "#
|
|
3347
|
+
"hex": "#eceef1"
|
|
3336
3348
|
},
|
|
3337
3349
|
"Dark": {
|
|
3338
3350
|
"alias": "palette/gray/800",
|
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.36" 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.36';
|
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.36';
|
|
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.36",
|
|
4
4
|
"description": "Tangible Design System",
|
|
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-scheme": {
|
|
54
|
+
"import": "./utils/color-scheme.js",
|
|
55
|
+
"types": "./utils/color-scheme.d.ts"
|
|
56
|
+
},
|
|
53
57
|
"./icons": {
|
|
54
58
|
"import": "./icons/registry.js",
|
|
55
59
|
"types": "./icons/registry.d.ts"
|
|
@@ -145,6 +145,27 @@ is actually applied to the document — a `MutationObserver` on `<html>`'s `clas
|
|
|
145
145
|
explicit toggles and OS changes alike — and mirror it onto your wrapper. Resolve to explicit
|
|
146
146
|
`light`/`dark` rather than TUI's `auto`, or an explicit light choice on a dark OS will be wrong.
|
|
147
147
|
|
|
148
|
+
**Switch themes instantly.** Controls transition their colours for hover, so a bare `data-theme`
|
|
149
|
+
change makes every button and field fade into the new theme while the page behind snaps. All of
|
|
150
|
+
these come from `@tangible/ui`:
|
|
151
|
+
|
|
152
|
+
- **React renders `data-theme`** (the usual app shape): call `markThemeSwitch()` in the handler,
|
|
153
|
+
before the state change — `onCheckedChange={(dark) => { markThemeSwitch(); setDark(dark); }}`.
|
|
154
|
+
It puts `data-tui-theme-switching` on `<html>` until two frames later, which zeroes
|
|
155
|
+
`--tui-motion-duration` while React commits.
|
|
156
|
+
- **Nothing else owns the attribute**: `setColorScheme(scheme, root)` / `toggleColorScheme(root)`
|
|
157
|
+
write `data-theme` on `root` and mark the switch for you.
|
|
158
|
+
- **A mirror** (the Tailwind `MutationObserver` above) calls `markThemeSwitch()` before it writes.
|
|
159
|
+
Setting the marker by hand: put it on `<html>` or `<body>`, never the interface, which misses the
|
|
160
|
+
body-level portal root.
|
|
161
|
+
|
|
162
|
+
An OS change under `auto` still fades: measured in Chromium, a `matchMedia` listener fires after
|
|
163
|
+
the restyle. Spinners keep spinning; looping animations deliberately ignore the marker.
|
|
164
|
+
|
|
165
|
+
The toggle itself: a `Switch` with a stable name ("Dark mode"), not a button whose label flips and
|
|
166
|
+
also carries `aria-pressed` (it announces twice). Light / dark / system is a `SegmentedControl`,
|
|
167
|
+
not a cycling button. Keep focus on the control, and don't toast "Theme changed".
|
|
168
|
+
|
|
148
169
|
**4. Pick the stylesheet by host.**
|
|
149
170
|
|
|
150
171
|
- Host with **its own CSS layers** (Tailwind v4, or any `@layer` author): `@tangible/ui/styles/unlayered`.
|
|
@@ -684,6 +705,13 @@ One live trap there: **memoize `data`, or pass `autoResetPageIndex={false}`.** A
|
|
|
684
705
|
a new identity every render, TanStack queues a page-0 reset on every `data` identity change, and
|
|
685
706
|
with a controlled `pageIndex` that races your parent back to page 0 permanently.
|
|
686
707
|
|
|
708
|
+
And one in layout: **a DataTable inside a wrapper that can't shrink never scrolls.** A grid or
|
|
709
|
+
flex item that is not itself a scroll container (a Card, a `<section>`) keeps `min-width: auto`,
|
|
710
|
+
so it can't shrink below the table's width, and the page widens instead. That holds for an `auto`
|
|
711
|
+
track and a bare `1fr` track alike. Use `grid-template-columns: minmax(0, 1fr)`, or put
|
|
712
|
+
`min-width: 0` on the item. A DataTable placed directly in the track is fine: its root is the
|
|
713
|
+
scroll container.
|
|
714
|
+
|
|
687
715
|
## Vanilla modal (no React)
|
|
688
716
|
|
|
689
717
|
For templates and plugin PHP with no React build (Tangible Blocks, L&L): `@tangible/ui` ships a framework-free modal on the native `<dialog>`. It replaces MicroModal; there is no compat layer, so the markup differs.
|