@tangible/ui 0.2.10 → 0.2.12
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/README.md +35 -22
- package/components/Accordion/Accordion.js +2 -2
- package/components/Combobox/Combobox.js +37 -5
- package/components/Combobox/types.d.ts +6 -0
- package/components/DatePicker/DatePicker.d.ts +3 -0
- package/components/DatePicker/DatePicker.js +8 -2
- package/components/DatePicker/DateRangePicker.d.ts +3 -0
- package/components/DatePicker/DateRangePicker.js +8 -2
- package/components/DatePicker/types.d.ts +36 -0
- package/components/Dropdown/Dropdown.js +2 -1
- package/components/MultiCombobox/MultiCombobox.js +1 -1
- package/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/components/MultiSelect/MultiSelect.js +29 -5
- package/components/MultiSelect/types.d.ts +13 -0
- package/components/Pager/Pager.d.ts +65 -1
- package/components/Pager/Pager.js +83 -10
- package/components/Pager/index.d.ts +1 -1
- package/components/Pager/types.d.ts +39 -0
- package/components/Pager/types.js +6 -0
- package/components/Popover/Popover.js +2 -1
- package/components/SearchSelect/SearchSelect.d.ts +1 -1
- package/components/SearchSelect/SearchSelect.js +3 -5
- package/components/SearchSelect/types.d.ts +0 -2
- package/components/Select/Select.d.ts +1 -1
- package/components/Select/Select.js +29 -5
- package/components/Select/types.d.ts +13 -0
- package/components/Table/DataTable.d.ts +49 -3
- package/components/Table/DataTable.js +83 -4
- package/components/Textarea/Textarea.js +7 -0
- package/components/Tooltip/Tooltip.js +2 -1
- package/components/index.d.ts +2 -2
- package/components/index.js +1 -1
- package/figma-tokens.json +4018 -0
- package/icons/icons.svg +12 -2
- package/icons/lms/index.d.ts +12 -0
- package/icons/lms/index.js +83 -17
- package/icons/manifest.json +80 -0
- package/icons/membersync/index.js +9 -9
- package/icons/player/index.js +4 -4
- package/icons/reaction/index.js +4 -4
- package/icons/registry.d.ts +20 -0
- package/icons/registry.js +10 -0
- package/icons/system/index.d.ts +8 -0
- package/icons/system/index.js +65 -21
- package/package.json +5 -1
- package/skills/building-with-tui/SKILL.md +328 -0
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +160 -269
- package/styles/all.expanded.unlayered.css +160 -269
- package/styles/all.unlayered.css +1 -1
- package/styles/components/color-picker.scss +16 -3
- package/styles/components/combobox.scss +33 -58
- package/styles/components/date-picker.scss +18 -10
- package/styles/components/dropdown.scss +12 -7
- package/styles/components/gradient-picker.scss +4 -4
- package/styles/components/multi-combobox.scss +17 -37
- package/styles/components/multi-select.scss +14 -50
- package/styles/components/pager.scss +155 -17
- package/styles/components/progress.scss +1 -1
- package/styles/components/radio.scss +37 -0
- package/styles/components/search-select.scss +16 -38
- package/styles/components/segmented-control.scss +1 -1
- package/styles/components/select.scss +22 -51
- package/styles/components/sidebar.scss +8 -3
- package/styles/components/slider.scss +1 -1
- package/styles/components/table.scss +3 -1
- package/styles/components/tabs.scss +1 -1
- package/styles/components/text-input.scss +79 -21
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_constants.scss +7 -1
- package/styles/system/_tokens.scss +2 -2
- package/tui-manifest.json +144 -6
- package/utils/compose-refs.d.ts +29 -3
- package/utils/compose-refs.js +51 -12
package/tui-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.2.
|
|
3
|
-
"generated": "2026-08-
|
|
2
|
+
"version": "0.2.12",
|
|
3
|
+
"generated": "2026-08-22T18:18:05.387Z",
|
|
4
4
|
"components": {
|
|
5
5
|
"Accordion": {
|
|
6
6
|
"props": {
|
|
@@ -1068,6 +1068,114 @@
|
|
|
1068
1068
|
"use": null,
|
|
1069
1069
|
"notFor": null
|
|
1070
1070
|
},
|
|
1071
|
+
"DataTable": {
|
|
1072
|
+
"props": {
|
|
1073
|
+
"data": {
|
|
1074
|
+
"type": "T[]",
|
|
1075
|
+
"required": true,
|
|
1076
|
+
"description": "Row data. Memoize it, or pass `autoResetPageIndex={false}` — see below."
|
|
1077
|
+
},
|
|
1078
|
+
"columns": {
|
|
1079
|
+
"type": "ColumnDef<T, unknown>[]",
|
|
1080
|
+
"required": true,
|
|
1081
|
+
"description": "TanStack column definitions. The selection column is injected, not declared."
|
|
1082
|
+
},
|
|
1083
|
+
"className": {
|
|
1084
|
+
"type": "string",
|
|
1085
|
+
"required": false
|
|
1086
|
+
},
|
|
1087
|
+
"defaultSorting": {
|
|
1088
|
+
"type": "SortingState",
|
|
1089
|
+
"required": false,
|
|
1090
|
+
"defaultValue": "[]",
|
|
1091
|
+
"description": "Initial sort state. Sorting stays internal — this only seeds it."
|
|
1092
|
+
},
|
|
1093
|
+
"loading": {
|
|
1094
|
+
"type": "boolean",
|
|
1095
|
+
"required": false,
|
|
1096
|
+
"defaultValue": "false",
|
|
1097
|
+
"description": "Replaces the body with a loading row while true."
|
|
1098
|
+
},
|
|
1099
|
+
"loadingMessage": {
|
|
1100
|
+
"type": "ReactNode",
|
|
1101
|
+
"required": false,
|
|
1102
|
+
"defaultValue": "Loading...",
|
|
1103
|
+
"description": "Shown in place of rows while `loading`."
|
|
1104
|
+
},
|
|
1105
|
+
"emptyMessage": {
|
|
1106
|
+
"type": "ReactNode",
|
|
1107
|
+
"required": false,
|
|
1108
|
+
"defaultValue": "No results",
|
|
1109
|
+
"description": "Shown in place of rows when `data` is empty."
|
|
1110
|
+
},
|
|
1111
|
+
"labels": {
|
|
1112
|
+
"type": "DataTableLabels",
|
|
1113
|
+
"required": false,
|
|
1114
|
+
"description": "Override hardcoded English strings for i18n. Unset keys use English defaults."
|
|
1115
|
+
},
|
|
1116
|
+
"getRowProps": {
|
|
1117
|
+
"type": "(row: Row<T>) => Omit<DetailedHTMLProps<HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, \"children\" | ... 1 more ... | \"key\">",
|
|
1118
|
+
"required": false,
|
|
1119
|
+
"description": "Extra props for each body `<tr>` — the escape hatch for row-level\ninteraction: keyboard cursors, row click shortcuts, `data-*` hooks,\ncontext menus. Consumer `className` is merged after the built-in row\nclasses; `data-selected` and the `is-selected` class always reflect\nactual selection state and cannot be overridden. `role`/`aria-*` are NOT\nguarded — overriding `role` on a `<tr>` removes it from the table's\naccessibility tree, so only do that as part of a deliberate pattern\n(e.g. rows in a `role=\"grid\"` table keep `role=\"row\"`). Loading/empty\nplaceholder rows are not affected."
|
|
1120
|
+
},
|
|
1121
|
+
"pageIndex": {
|
|
1122
|
+
"type": "number",
|
|
1123
|
+
"required": false,
|
|
1124
|
+
"description": "Controlled page index (0-based, matching TanStack). When set, the parent\nowns paging: the built-in pager requests changes via `onPageIndexChange`,\nbut the page only moves when this prop updates. Page size stays internal\neither way. Controlled/uncontrolled is locked at mount."
|
|
1125
|
+
},
|
|
1126
|
+
"autoResetPageIndex": {
|
|
1127
|
+
"type": "boolean",
|
|
1128
|
+
"required": false,
|
|
1129
|
+
"description": "TanStack's automatic page-0 reset when sorting or data identity change.\nDefaults to `true` when `pageIndex` is uncontrolled, `false` when\ncontrolled — a controlled parent owns the index, and the auto-reset\nwould race it back to 0 on every re-render that recreates `data`\n(parent re-renders on page change → new array identity → reset).\nUncontrolled consumers who `setState` inside `onPageIndexChange` while\npassing a derived (unmemoized) `data` array hit the same loop: pass\n`false` here or memoize `data`."
|
|
1130
|
+
},
|
|
1131
|
+
"style": {
|
|
1132
|
+
"type": "CSSProperties",
|
|
1133
|
+
"required": false
|
|
1134
|
+
},
|
|
1135
|
+
"title": {
|
|
1136
|
+
"type": "string",
|
|
1137
|
+
"required": false
|
|
1138
|
+
},
|
|
1139
|
+
"role": {
|
|
1140
|
+
"type": "AriaRole",
|
|
1141
|
+
"required": false
|
|
1142
|
+
},
|
|
1143
|
+
"rel": {
|
|
1144
|
+
"type": "string",
|
|
1145
|
+
"required": false
|
|
1146
|
+
},
|
|
1147
|
+
"onChange": {
|
|
1148
|
+
"type": "FormEventHandler<HTMLTableElement>",
|
|
1149
|
+
"required": false
|
|
1150
|
+
},
|
|
1151
|
+
"onClick": {
|
|
1152
|
+
"type": "MouseEventHandler<HTMLTableElement>",
|
|
1153
|
+
"required": false
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
"cssTokens": [
|
|
1157
|
+
"--tui-table-border",
|
|
1158
|
+
"--tui-table-bg",
|
|
1159
|
+
"--tui-table-bg-head",
|
|
1160
|
+
"--tui-table-fg",
|
|
1161
|
+
"--tui-table-padding",
|
|
1162
|
+
"--tui-table-selected-bg"
|
|
1163
|
+
],
|
|
1164
|
+
"story": {
|
|
1165
|
+
"title": "Components/DataTable",
|
|
1166
|
+
"tags": [
|
|
1167
|
+
"autodocs",
|
|
1168
|
+
"stable"
|
|
1169
|
+
]
|
|
1170
|
+
},
|
|
1171
|
+
"subcomponents": null,
|
|
1172
|
+
"description": null,
|
|
1173
|
+
"gotchas": null,
|
|
1174
|
+
"examples": null,
|
|
1175
|
+
"related": null,
|
|
1176
|
+
"use": null,
|
|
1177
|
+
"notFor": null
|
|
1178
|
+
},
|
|
1071
1179
|
"DatePicker": {
|
|
1072
1180
|
"props": {
|
|
1073
1181
|
"min": {
|
|
@@ -2149,6 +2257,30 @@
|
|
|
2149
2257
|
"defaultValue": "text",
|
|
2150
2258
|
"description": "Style for prev/next: 'text' shows labels, 'icon' shows chevrons"
|
|
2151
2259
|
},
|
|
2260
|
+
"variant": {
|
|
2261
|
+
"type": "\"flush\" | \"detached\"",
|
|
2262
|
+
"required": false,
|
|
2263
|
+
"defaultValue": "flush",
|
|
2264
|
+
"description": "Whether nav segments are joined into one group or spaced apart."
|
|
2265
|
+
},
|
|
2266
|
+
"showInfo": {
|
|
2267
|
+
"type": "boolean",
|
|
2268
|
+
"required": false,
|
|
2269
|
+
"defaultValue": "true",
|
|
2270
|
+
"description": "Show the \"Page X of Y\" region. The page size selector has its own\ncondition (`pageSizeOptions` + `onPageSizeChange`), so this governs the\nregion, not the select.\n\nDefaults to `true` in every mode — including `simple`, where the status\nline is arguably redundant. Auto-hiding there is what most consumers\nprobably want, but it would silently change layout for existing `simple`\nusers, so it stays opt-out."
|
|
2271
|
+
},
|
|
2272
|
+
"showFirstLast": {
|
|
2273
|
+
"type": "boolean",
|
|
2274
|
+
"required": false,
|
|
2275
|
+
"defaultValue": "false",
|
|
2276
|
+
"description": "Add dedicated first-page / last-page buttons outside prev/next.\n\nMost valuable in `simple` mode and at high page counts — in `smart`,\n`ends` and `full` the numbered group already carries a \"1\" and a last\npage, so these mainly save the user having to find them. Opt-in for that\nreason: four nav buttons is a lot of chrome to add by default.\n\nIn `flush` they join the connected group at the ends, which means prev and\nnext stop being the end segments — the border-collapse rules key off\nactual position rather than kind, so this needs no special casing."
|
|
2277
|
+
},
|
|
2278
|
+
"showJump": {
|
|
2279
|
+
"type": "boolean",
|
|
2280
|
+
"required": false,
|
|
2281
|
+
"defaultValue": "false",
|
|
2282
|
+
"description": "Add a \"Go to page\" field.\n\nFor hundreds of pages, where the numbered buttons and even first/last are\nstill slow. Commits on Enter or via its own submit button — deliberately\nnot on blur, which would move the page out from under a user who tabbed\naway mid-edit. Out-of-range entries clamp to the nearest valid page rather\nthan erroring, and the existing `role=\"status\"` region announces where the\njump actually landed.\n\nIt renders outside the `<nav>` landmark, which is the connected button\ngroup itself — so someone arriving by landmark finds prev/next and the\nnumbers, not this field. It follows immediately in tab order. Moving it\ninside would mean wrapping the group rather than being it, and the field\nwould then have to sit beside the buttons instead of at the trailing edge."
|
|
2283
|
+
},
|
|
2152
2284
|
"className": {
|
|
2153
2285
|
"type": "string",
|
|
2154
2286
|
"required": false,
|
|
@@ -2161,7 +2293,11 @@
|
|
|
2161
2293
|
}
|
|
2162
2294
|
},
|
|
2163
2295
|
"cssTokens": [
|
|
2164
|
-
"--tui-pager-gap"
|
|
2296
|
+
"--tui-pager-gap",
|
|
2297
|
+
"--tui-pager-nav-gap",
|
|
2298
|
+
"--tui-pager-item-border",
|
|
2299
|
+
"--tui-pager-item-radius",
|
|
2300
|
+
"--tui-pager-jump-width"
|
|
2165
2301
|
],
|
|
2166
2302
|
"story": {
|
|
2167
2303
|
"title": "Primitives/Pager",
|
|
@@ -2355,6 +2491,7 @@
|
|
|
2355
2491
|
"--tui-radio-accent",
|
|
2356
2492
|
"--tui-radio-size",
|
|
2357
2493
|
"--tui-radio-border",
|
|
2494
|
+
"--tui-radio-border-invalid",
|
|
2358
2495
|
"--tui-radio-bg",
|
|
2359
2496
|
"--tui-radio-gap",
|
|
2360
2497
|
"--tui-radio-font-size",
|
|
@@ -2882,6 +3019,7 @@
|
|
|
2882
3019
|
"--tui-sidebar-width",
|
|
2883
3020
|
"--tui-sidebar-bg",
|
|
2884
3021
|
"--tui-sidebar-border",
|
|
3022
|
+
"--tui-sidebar-divider",
|
|
2885
3023
|
"--tui-sidebar-padding",
|
|
2886
3024
|
"--tui-sidebar-z"
|
|
2887
3025
|
],
|
|
@@ -3696,13 +3834,13 @@
|
|
|
3696
3834
|
"icons": {
|
|
3697
3835
|
"sets": {
|
|
3698
3836
|
"cred": 12,
|
|
3699
|
-
"lms":
|
|
3837
|
+
"lms": 44,
|
|
3700
3838
|
"membersync": 22,
|
|
3701
3839
|
"player": 24,
|
|
3702
3840
|
"reaction": 36,
|
|
3703
|
-
"system":
|
|
3841
|
+
"system": 99
|
|
3704
3842
|
},
|
|
3705
|
-
"total":
|
|
3843
|
+
"total": 237,
|
|
3706
3844
|
"manifest": "./icons/manifest.json"
|
|
3707
3845
|
}
|
|
3708
3846
|
}
|
package/utils/compose-refs.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactElement, Ref } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A ref callback that may return a React 19 cleanup function.
|
|
4
|
+
*
|
|
5
|
+
* Spelled out rather than reusing React's own `RefCallback`, because that type
|
|
6
|
+
* changed shape between versions: React 18's returns plain `void`, React 19's
|
|
7
|
+
* returns `void | (() => void)`. Typing the return ourselves means a caller sees
|
|
8
|
+
* the cleanup regardless of which `@types/react` is installed — and this repo
|
|
9
|
+
* pins 18 while running React 19 at runtime, so the two genuinely diverge.
|
|
10
|
+
*
|
|
11
|
+
* Still assignable wherever a `Ref<T>` is expected under both versions: a
|
|
12
|
+
* function that returns something is assignable to a `void`-returning type.
|
|
13
|
+
*/
|
|
14
|
+
export type ComposedRef<T> = (node: T | null) => void | (() => void);
|
|
2
15
|
/**
|
|
3
16
|
* Combines multiple refs into a single ref callback.
|
|
4
17
|
* Useful for components that need to forward refs while also maintaining
|
|
@@ -10,8 +23,21 @@ import type { Ref, RefCallback } from 'react';
|
|
|
10
23
|
* return <div ref={composeRefs(forwardedRef, internalRef)} />;
|
|
11
24
|
* });
|
|
12
25
|
*/
|
|
13
|
-
export declare function composeRefs<T>(...refs: (Ref<T> | undefined | null)[]):
|
|
26
|
+
export declare function composeRefs<T>(...refs: (Ref<T> | undefined | null)[]): ComposedRef<T>;
|
|
14
27
|
/**
|
|
15
28
|
* Sets a single ref value. Handles both callback refs and ref objects.
|
|
29
|
+
*
|
|
30
|
+
* Returns whatever a callback ref returned, so `composeRefs` can honour a React
|
|
31
|
+
* 19 cleanup function. Ref objects return undefined.
|
|
32
|
+
*/
|
|
33
|
+
export declare function setRef<T>(ref: Ref<T> | undefined | null, value: T | null): void | (() => void);
|
|
34
|
+
/**
|
|
35
|
+
* Reads the ref of a React element across React versions.
|
|
36
|
+
*
|
|
37
|
+
* React 19 moved `ref` into props and warns when `element.ref` is read;
|
|
38
|
+
* React 18 warns when `element.props.ref` is read. Both mark the deprecated
|
|
39
|
+
* accessor with `isReactWarning`, so the safe side can be detected.
|
|
40
|
+
*
|
|
41
|
+
* @see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref
|
|
16
42
|
*/
|
|
17
|
-
export declare function
|
|
43
|
+
export declare function getElementRef(element: ReactElement): Ref<unknown> | undefined;
|
package/utils/compose-refs.js
CHANGED
|
@@ -11,28 +11,67 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export function composeRefs(...refs) {
|
|
13
13
|
return (node) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
// React 19 lets a callback ref return a cleanup function, and when one does,
|
|
15
|
+
// React calls that cleanup on detach INSTEAD of calling the ref with null.
|
|
16
|
+
// Composition has to preserve that: swallowing the cleanup and calling the
|
|
17
|
+
// ref with null runs neither the caller's teardown nor anything it expects
|
|
18
|
+
// — a consumer doing `ref={n => { obs.observe(n); return () => obs.disconnect() }}`
|
|
19
|
+
// leaks the observer and then gets handed a null it never asked for.
|
|
20
|
+
//
|
|
21
|
+
// So: only return a cleanup if at least one composed ref gave us one, which
|
|
22
|
+
// keeps the legacy null-on-detach behaviour intact for every ref that did
|
|
23
|
+
// not. Mirrors @radix-ui/react-compose-refs.
|
|
24
|
+
let hasCleanup = false;
|
|
25
|
+
const cleanups = refs.map((ref) => {
|
|
26
|
+
const cleanup = setRef(ref, node);
|
|
27
|
+
if (!hasCleanup && typeof cleanup === 'function')
|
|
28
|
+
hasCleanup = true;
|
|
29
|
+
return cleanup;
|
|
23
30
|
});
|
|
31
|
+
if (hasCleanup) {
|
|
32
|
+
return () => {
|
|
33
|
+
cleanups.forEach((cleanup, i) => {
|
|
34
|
+
if (typeof cleanup === 'function')
|
|
35
|
+
cleanup();
|
|
36
|
+
else
|
|
37
|
+
setRef(refs[i], null);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
24
41
|
};
|
|
25
42
|
}
|
|
26
43
|
/**
|
|
27
44
|
* Sets a single ref value. Handles both callback refs and ref objects.
|
|
45
|
+
*
|
|
46
|
+
* Returns whatever a callback ref returned, so `composeRefs` can honour a React
|
|
47
|
+
* 19 cleanup function. Ref objects return undefined.
|
|
28
48
|
*/
|
|
29
49
|
export function setRef(ref, value) {
|
|
30
50
|
if (!ref)
|
|
31
51
|
return;
|
|
32
52
|
if (typeof ref === 'function') {
|
|
33
|
-
ref(value);
|
|
53
|
+
return ref(value);
|
|
54
|
+
}
|
|
55
|
+
ref.current = value;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Reads the ref of a React element across React versions.
|
|
59
|
+
*
|
|
60
|
+
* React 19 moved `ref` into props and warns when `element.ref` is read;
|
|
61
|
+
* React 18 warns when `element.props.ref` is read. Both mark the deprecated
|
|
62
|
+
* accessor with `isReactWarning`, so the safe side can be detected.
|
|
63
|
+
*
|
|
64
|
+
* @see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref
|
|
65
|
+
*/
|
|
66
|
+
export function getElementRef(element) {
|
|
67
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;
|
|
68
|
+
if (getter && 'isReactWarning' in getter) {
|
|
69
|
+
return element.ref;
|
|
34
70
|
}
|
|
35
|
-
|
|
36
|
-
|
|
71
|
+
getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;
|
|
72
|
+
if (getter && 'isReactWarning' in getter) {
|
|
73
|
+
return element.props.ref;
|
|
37
74
|
}
|
|
75
|
+
return (element.props.ref ??
|
|
76
|
+
element.ref);
|
|
38
77
|
}
|