@rockshin/tao-ui 0.0.31 → 0.0.33
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 +14 -3
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +48 -50
- package/dist/components/checkbox/checkbox.css +5 -1
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +135 -120
- package/dist/components/collapsible/collapsible.js +1 -1
- package/dist/components/context-menu/context-menu.js +1 -1
- package/dist/components/date-picker/calendar/calendar-header.js +1 -1
- package/dist/components/date-picker/calendar/month-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/month-grid.js +19 -17
- package/dist/components/date-picker/calendar/time-panel.js +1 -1
- package/dist/components/date-picker/calendar/year-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/year-grid.js +28 -24
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +37 -24
- package/dist/components/date-picker/presets.js +1 -1
- package/dist/components/date-picker/range-picker.d.ts +1 -1
- package/dist/components/date-picker/range-picker.js +104 -56
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +98 -91
- package/dist/components/dropdown/dropdown.js +84 -84
- package/dist/components/form/form-item.js +8 -4
- package/dist/components/form/form.js +1 -1
- package/dist/components/form-actions/form-actions.js +1 -1
- package/dist/components/form-field/form-field-view.js +58 -51
- package/dist/components/form-field/form-field.js +1 -1
- package/dist/components/form-section/form-section.js +1 -1
- package/dist/components/input/input.js +42 -39
- package/dist/components/input-number/input-number.d.ts +2 -2
- package/dist/components/input-number/input-number.js +57 -59
- package/dist/components/menu/menu-render.js +1 -1
- package/dist/components/modal/confirm-dialog.d.ts +2 -1
- package/dist/components/modal/confirm-dialog.js +25 -5
- package/dist/components/modal/confirm.js +15 -3
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/modal.js +131 -132
- package/dist/components/modal/use-modal.js +48 -35
- package/dist/components/pagination/pagination.js +3 -1
- package/dist/components/popconfirm/popconfirm.js +1 -1
- package/dist/components/popover/popover.js +253 -228
- package/dist/components/radio/radio.css +2 -2
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +7 -7
- package/dist/components/scroll-area/scroll-area.css +2 -2
- package/dist/components/scroll-area/scroll-area.js +187 -165
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +12 -6
- package/dist/components/select/select-icons.js +1 -1
- package/dist/components/select/select-searchable-list.d.ts +1 -1
- package/dist/components/select/select-searchable-list.js +35 -21
- package/dist/components/select/select-tags.js +1 -1
- package/dist/components/select/select-types.d.ts +2 -2
- package/dist/components/select/select.css +4 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +127 -73
- package/dist/components/sonner/sonner.js +6 -5
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.js +187 -194
- package/dist/components/status-icon/status-icon.js +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +6 -6
- package/dist/components/table/table-filter.js +1 -1
- package/dist/components/table/table-icons.js +1 -1
- package/dist/components/table/table.js +483 -599
- package/dist/components/tabs/tabs.js +179 -161
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +142 -108
- package/dist/components/tooltip/tooltip.js +88 -72
- package/dist/entries/alert.d.ts +3 -0
- package/dist/entries/alert.js +4 -0
- package/dist/entries/breadcrumb.d.ts +3 -0
- package/dist/entries/breadcrumb.js +4 -0
- package/dist/entries/button.d.ts +3 -0
- package/dist/entries/button.js +4 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.js +4 -0
- package/dist/entries/collapsible.d.ts +3 -0
- package/dist/entries/collapsible.js +4 -0
- package/dist/entries/context-menu.d.ts +3 -0
- package/dist/entries/context-menu.js +4 -0
- package/dist/entries/date-picker.d.ts +3 -0
- package/dist/entries/date-picker.js +4 -0
- package/dist/entries/drawer.d.ts +3 -0
- package/dist/entries/drawer.js +4 -0
- package/dist/entries/dropdown.d.ts +3 -0
- package/dist/entries/dropdown.js +4 -0
- package/dist/entries/form-actions.d.ts +3 -0
- package/dist/entries/form-actions.js +4 -0
- package/dist/entries/form-field.d.ts +3 -0
- package/dist/entries/form-field.js +4 -0
- package/dist/entries/form-layout.d.ts +3 -0
- package/dist/entries/form-layout.js +4 -0
- package/dist/entries/form-section.d.ts +3 -0
- package/dist/entries/form-section.js +4 -0
- package/dist/entries/form.d.ts +4 -0
- package/dist/entries/form.js +4 -0
- package/dist/entries/input-number.d.ts +3 -0
- package/dist/entries/input-number.js +4 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.js +4 -0
- package/dist/entries/modal.d.ts +3 -0
- package/dist/entries/modal.js +4 -0
- package/dist/entries/number-input.d.ts +3 -0
- package/dist/entries/number-input.js +4 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +4 -0
- package/dist/entries/popconfirm.d.ts +3 -0
- package/dist/entries/popconfirm.js +4 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.js +4 -0
- package/dist/entries/provider.d.ts +3 -0
- package/dist/entries/provider.js +4 -0
- package/dist/entries/radio.d.ts +3 -0
- package/dist/entries/radio.js +4 -0
- package/dist/entries/range-picker.d.ts +3 -0
- package/dist/entries/range-picker.js +4 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.js +4 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.js +4 -0
- package/dist/entries/sonner.d.ts +3 -0
- package/dist/entries/sonner.js +4 -0
- package/dist/entries/spinner.d.ts +3 -0
- package/dist/entries/spinner.js +4 -0
- package/dist/entries/splitter.d.ts +3 -0
- package/dist/entries/splitter.js +4 -0
- package/dist/entries/stack.d.ts +3 -0
- package/dist/entries/stack.js +4 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.js +4 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.js +4 -0
- package/dist/entries/tabs.d.ts +3 -0
- package/dist/entries/tabs.js +4 -0
- package/dist/entries/tag.d.ts +3 -0
- package/dist/entries/tag.js +4 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.js +4 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.js +4 -0
- package/dist/layouts/form-layout/form-layout.js +1 -1
- package/dist/layouts/stack/stack.js +1 -1
- package/dist/number-input/number-input.js +1 -1
- package/dist/number-input/use-number-input.d.ts +2 -2
- package/dist/number-input/use-number-input.js +224 -131
- package/dist/number-input/validate.js +7 -2
- package/dist/provider/tao-provider.js +1 -1
- package/dist/utils/dialog-content.d.ts +10 -0
- package/dist/utils/dialog-content.js +222 -0
- package/dist/utils/overlay.d.ts +2 -2
- package/dist/utils/overlay.js +8 -3
- package/dist/utils/refs.js +17 -2
- package/llms.txt +5 -3
- package/package.json +21 -8
package/dist/utils/overlay.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare function useControlledOpen({ open, defaultOpen, onOpenChange, can
|
|
|
13
13
|
canOpen?: boolean;
|
|
14
14
|
}): [boolean, (next: boolean) => void];
|
|
15
15
|
/**
|
|
16
|
-
* Radix
|
|
17
|
-
*
|
|
16
|
+
* Radix triggers need a DOM-capable element. Unwrap single-child fragments so
|
|
17
|
+
* focus returns to the real trigger; wrap text or multiple nodes in a span.
|
|
18
18
|
*/
|
|
19
19
|
export declare function asTriggerChild(children: ReactNode): ReactElement;
|
package/dist/utils/overlay.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
3
|
-
import { isValidElement, useState } from "react";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { Children, Fragment, isValidElement, useState } from "react";
|
|
4
4
|
function useControlledOpen(t0) {
|
|
5
5
|
const $ = c(7);
|
|
6
6
|
const { open, defaultOpen, onOpenChange, canOpen: t1 } = t0;
|
|
@@ -34,7 +34,12 @@ function useControlledOpen(t0) {
|
|
|
34
34
|
return t3;
|
|
35
35
|
}
|
|
36
36
|
function asTriggerChild(children) {
|
|
37
|
-
|
|
37
|
+
if (!/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ jsx("span", {
|
|
38
|
+
children: children
|
|
39
|
+
});
|
|
40
|
+
if (children.type !== Fragment) return children;
|
|
41
|
+
const items = Children.toArray(children.props.children);
|
|
42
|
+
return 1 === items.length ? asTriggerChild(items[0]) : /*#__PURE__*/ jsx("span", {
|
|
38
43
|
children: children
|
|
39
44
|
});
|
|
40
45
|
}
|
package/dist/utils/refs.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
function mergeRefs(...refs) {
|
|
2
|
+
let cleanups = [];
|
|
2
3
|
return (value)=>{
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
if (null === value) {
|
|
5
|
+
const pending = cleanups;
|
|
6
|
+
cleanups = [];
|
|
7
|
+
for (const cleanup of pending)cleanup();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
for (const ref of refs)if ('function' == typeof ref) {
|
|
11
|
+
const cleanup = ref(value);
|
|
12
|
+
cleanups.push('function' == typeof cleanup ? ()=>cleanup() : ()=>ref(null));
|
|
13
|
+
} else if (ref) {
|
|
14
|
+
const objectRef = ref;
|
|
15
|
+
objectRef.current = value;
|
|
16
|
+
cleanups.push(()=>{
|
|
17
|
+
objectRef.current = null;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
5
20
|
};
|
|
6
21
|
}
|
|
7
22
|
export { mergeRefs };
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rockshin/tao-ui
|
|
2
2
|
|
|
3
|
-
> A
|
|
3
|
+
> A component library for React 18.2 and 19 with semantic DOM customization and OKLCH-based theming.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
npm install @rockshin/tao-ui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Peer dependencies: `react
|
|
12
|
-
|
|
11
|
+
Peer dependencies: `react ^18.2.0 || ^19.0.0`, `react-dom ^18.2.0 || ^19.0.0`. Minimum version: React and React DOM 18.2; React 19 is also supported.
|
|
12
|
+
`dayjs` is a regular dependency and is installed automatically.
|
|
13
|
+
Import components from subpaths such as `@rockshin/tao-ui/button` and `TaoProvider` from `@rockshin/tao-ui/provider` to load only their component dependencies and shared theme styles. No separate CSS import is needed.
|
|
14
|
+
The package root remains available and includes all component styles.
|
|
13
15
|
|
|
14
16
|
## Core Concepts
|
|
15
17
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rockshin/tao-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "A modern React
|
|
6
|
+
"description": "A modern React component library with semantic DOM customization and OKLCH-based theming.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"react",
|
|
9
9
|
"react19",
|
|
10
|
+
"react18",
|
|
10
11
|
"component-library",
|
|
11
12
|
"ui",
|
|
12
13
|
"design-system",
|
|
@@ -24,7 +25,9 @@
|
|
|
24
25
|
"sideEffects": [
|
|
25
26
|
"**/*.css",
|
|
26
27
|
"./dist/index.js",
|
|
27
|
-
"./src/index.tsx"
|
|
28
|
+
"./src/index.tsx",
|
|
29
|
+
"./dist/entries/*.js",
|
|
30
|
+
"./src/entries/*.ts"
|
|
28
31
|
],
|
|
29
32
|
"exports": {
|
|
30
33
|
".": {
|
|
@@ -38,6 +41,10 @@
|
|
|
38
41
|
"./tokens": {
|
|
39
42
|
"types": "./dist/theme/tokens.d.ts",
|
|
40
43
|
"import": "./dist/theme/tokens.js"
|
|
44
|
+
},
|
|
45
|
+
"./*": {
|
|
46
|
+
"types": "./dist/entries/*.d.ts",
|
|
47
|
+
"import": "./dist/entries/*.js"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
50
|
"types": "./dist/index.d.ts",
|
|
@@ -62,9 +69,10 @@
|
|
|
62
69
|
"release": "bun scripts/release.mjs",
|
|
63
70
|
"storybook": "storybook dev",
|
|
64
71
|
"test": "rstest",
|
|
65
|
-
"test:types": "tsc --noEmit --project tsconfig.type-tests.json",
|
|
72
|
+
"test:types": "tsc --noEmit --project tsconfig.type-tests.json && tsc --noEmit --project tsconfig.type-tests.react18.json",
|
|
66
73
|
"test:watch": "rstest --watch",
|
|
67
|
-
"typecheck": "tsc --noEmit --project tsconfig.json"
|
|
74
|
+
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
75
|
+
"test:package": "bun scripts/check-package-exports.mjs"
|
|
68
76
|
},
|
|
69
77
|
"devDependencies": {
|
|
70
78
|
"@biomejs/biome": "2.4.14",
|
|
@@ -88,10 +96,14 @@
|
|
|
88
96
|
"@types/node": "^24.12.4",
|
|
89
97
|
"@types/react": "^19.2.14",
|
|
90
98
|
"@types/react-dom": "^19",
|
|
99
|
+
"@types/react-dom18": "npm:@types/react-dom@18",
|
|
100
|
+
"@types/react18": "npm:@types/react@18",
|
|
91
101
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
92
102
|
"happy-dom": "^20.9.0",
|
|
93
103
|
"react": "^19.2.6",
|
|
94
104
|
"react-dom": "^19.2.6",
|
|
105
|
+
"react-dom18": "npm:react-dom@18.2.0",
|
|
106
|
+
"react18": "npm:react@18.2.0",
|
|
95
107
|
"rsbuild-plugin-workspace-dev": "^1.0.0",
|
|
96
108
|
"storybook": "^10.5.3",
|
|
97
109
|
"storybook-addon-rslib": "^3.3.4",
|
|
@@ -99,8 +111,8 @@
|
|
|
99
111
|
"typescript": "^6.0.3"
|
|
100
112
|
},
|
|
101
113
|
"peerDependencies": {
|
|
102
|
-
"react": "
|
|
103
|
-
"react-dom": "
|
|
114
|
+
"react": "^18.2.0 || ^19.0.0",
|
|
115
|
+
"react-dom": "^18.2.0 || ^19.0.0"
|
|
104
116
|
},
|
|
105
117
|
"publishConfig": {
|
|
106
118
|
"access": "public",
|
|
@@ -116,6 +128,7 @@
|
|
|
116
128
|
"@radix-ui/react-slot": "^1.2.3",
|
|
117
129
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
118
130
|
"@rc-component/form": "~1.8.5",
|
|
119
|
-
"dayjs": "^1.11.21"
|
|
131
|
+
"dayjs": "^1.11.21",
|
|
132
|
+
"react-compiler-runtime": "^1.0.0"
|
|
120
133
|
}
|
|
121
134
|
}
|