@rockshin/tao-ui 0.0.1

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.
Files changed (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -0
  3. package/dist/components/button/button.css +1055 -0
  4. package/dist/components/button/button.d.ts +15 -0
  5. package/dist/components/button/button.js +93 -0
  6. package/dist/components/checkbox/checkbox.css +1035 -0
  7. package/dist/components/checkbox/checkbox.d.ts +33 -0
  8. package/dist/components/checkbox/checkbox.js +312 -0
  9. package/dist/components/date-picker/calendar/calendar-grid.d.ts +18 -0
  10. package/dist/components/date-picker/calendar/calendar-grid.js +173 -0
  11. package/dist/components/date-picker/calendar/calendar-header.d.ts +10 -0
  12. package/dist/components/date-picker/calendar/calendar-header.js +336 -0
  13. package/dist/components/date-picker/calendar/month-grid.d.ts +9 -0
  14. package/dist/components/date-picker/calendar/month-grid.js +61 -0
  15. package/dist/components/date-picker/calendar/time-panel.d.ts +12 -0
  16. package/dist/components/date-picker/calendar/time-panel.js +233 -0
  17. package/dist/components/date-picker/calendar/use-calendar.d.ts +15 -0
  18. package/dist/components/date-picker/calendar/use-calendar.js +24 -0
  19. package/dist/components/date-picker/calendar/year-grid.d.ts +9 -0
  20. package/dist/components/date-picker/calendar/year-grid.js +60 -0
  21. package/dist/components/date-picker/date-picker.css +1799 -0
  22. package/dist/components/date-picker/date-picker.d.ts +29 -0
  23. package/dist/components/date-picker/date-picker.js +663 -0
  24. package/dist/components/date-picker/presets.d.ts +9 -0
  25. package/dist/components/date-picker/presets.js +36 -0
  26. package/dist/components/date-picker/range-picker.d.ts +30 -0
  27. package/dist/components/date-picker/range-picker.js +432 -0
  28. package/dist/components/date-picker/types.d.ts +39 -0
  29. package/dist/components/date-picker/types.js +7 -0
  30. package/dist/components/drawer/drawer.css +1112 -0
  31. package/dist/components/drawer/drawer.d.ts +17 -0
  32. package/dist/components/drawer/drawer.js +184 -0
  33. package/dist/components/form-actions/form-actions.d.ts +12 -0
  34. package/dist/components/form-actions/form-actions.js +42 -0
  35. package/dist/components/form-field/form-field.d.ts +17 -0
  36. package/dist/components/form-field/form-field.js +101 -0
  37. package/dist/components/form-field/form.css +1036 -0
  38. package/dist/components/form-section/form-section.d.ts +14 -0
  39. package/dist/components/form-section/form-section.js +92 -0
  40. package/dist/components/input/input.css +1185 -0
  41. package/dist/components/input/input.d.ts +15 -0
  42. package/dist/components/input/input.js +143 -0
  43. package/dist/components/pagination/pagination.css +1099 -0
  44. package/dist/components/pagination/pagination.d.ts +22 -0
  45. package/dist/components/pagination/pagination.js +310 -0
  46. package/dist/components/radio/radio.css +1045 -0
  47. package/dist/components/radio/radio.d.ts +34 -0
  48. package/dist/components/radio/radio.js +215 -0
  49. package/dist/components/scroll-area/scroll-area.css +1099 -0
  50. package/dist/components/scroll-area/scroll-area.d.ts +33 -0
  51. package/dist/components/scroll-area/scroll-area.js +375 -0
  52. package/dist/components/select/mobile-select.css +1044 -0
  53. package/dist/components/select/mobile-select.d.ts +19 -0
  54. package/dist/components/select/mobile-select.js +224 -0
  55. package/dist/components/select/select.css +1327 -0
  56. package/dist/components/select/select.d.ts +32 -0
  57. package/dist/components/select/select.js +532 -0
  58. package/dist/components/select/use-is-mobile.d.ts +1 -0
  59. package/dist/components/select/use-is-mobile.js +30 -0
  60. package/dist/components/splitter/splitter.css +1104 -0
  61. package/dist/components/splitter/splitter.d.ts +33 -0
  62. package/dist/components/splitter/splitter.js +451 -0
  63. package/dist/components/switch/switch.css +1170 -0
  64. package/dist/components/switch/switch.d.ts +19 -0
  65. package/dist/components/switch/switch.js +143 -0
  66. package/dist/components/table/table.css +1255 -0
  67. package/dist/components/table/table.d.ts +73 -0
  68. package/dist/components/table/table.js +1022 -0
  69. package/dist/components/tabs/tabs.css +1076 -0
  70. package/dist/components/tabs/tabs.d.ts +24 -0
  71. package/dist/components/tabs/tabs.js +256 -0
  72. package/dist/components/tag/tag.css +1124 -0
  73. package/dist/components/tag/tag.d.ts +33 -0
  74. package/dist/components/tag/tag.js +237 -0
  75. package/dist/index.d.ts +23 -0
  76. package/dist/index.js +23 -0
  77. package/dist/layouts/form-layout/form-layout.d.ts +6 -0
  78. package/dist/layouts/form-layout/form-layout.js +18 -0
  79. package/dist/layouts/stack/layout.css +1003 -0
  80. package/dist/layouts/stack/stack.d.ts +9 -0
  81. package/dist/layouts/stack/stack.js +27 -0
  82. package/dist/number-input/cursor.d.ts +9 -0
  83. package/dist/number-input/cursor.js +44 -0
  84. package/dist/number-input/format.d.ts +5 -0
  85. package/dist/number-input/format.js +50 -0
  86. package/dist/number-input/index.d.ts +5 -0
  87. package/dist/number-input/index.js +2 -0
  88. package/dist/number-input/number-input.d.ts +9 -0
  89. package/dist/number-input/number-input.js +101 -0
  90. package/dist/number-input/percentage.d.ts +3 -0
  91. package/dist/number-input/percentage.js +28 -0
  92. package/dist/number-input/types.d.ts +5 -0
  93. package/dist/number-input/types.js +0 -0
  94. package/dist/number-input/use-number-input.d.ts +30 -0
  95. package/dist/number-input/use-number-input.js +211 -0
  96. package/dist/number-input/validate.d.ts +3 -0
  97. package/dist/number-input/validate.js +17 -0
  98. package/dist/provider/tao-provider.d.ts +42 -0
  99. package/dist/provider/tao-provider.js +67 -0
  100. package/dist/theme/control.css +1061 -0
  101. package/dist/theme/theme.css +957 -0
  102. package/dist/utils/semantic.d.ts +10 -0
  103. package/dist/utils/semantic.js +5 -0
  104. package/llms.txt +67 -0
  105. package/package.json +97 -0
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
3
+ import './drawer.css';
4
+ export type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left';
5
+ export type DrawerSemanticPart = 'root' | 'header' | 'title' | 'body' | 'overlay';
6
+ export interface DrawerProps {
7
+ open: boolean;
8
+ onClose?: () => void;
9
+ title?: ReactNode;
10
+ placement?: DrawerPlacement;
11
+ width?: number | string;
12
+ height?: number | string;
13
+ children?: ReactNode;
14
+ classNames?: SemanticClassNames<DrawerSemanticPart>;
15
+ styles?: SemanticStyles<DrawerSemanticPart>;
16
+ }
17
+ export declare function Drawer({ open, onClose, title, placement, width, height, children, classNames, styles: stylesProp, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,184 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { cx } from "../../utils/semantic.js";
4
+ import "./drawer.css";
5
+ import * as __rspack_external__radix_ui_react_dialog_6b867f3d from "@radix-ui/react-dialog";
6
+ function Drawer(t0) {
7
+ const $ = c(42);
8
+ const { open, onClose, title, placement: t1, width, height, children, classNames, styles: stylesProp } = t0;
9
+ const placement = void 0 === t1 ? "right" : t1;
10
+ const isHorizontal = "left" === placement || "right" === placement;
11
+ let contentStyle;
12
+ if ($[0] !== height || $[1] !== isHorizontal || $[2] !== width) {
13
+ contentStyle = {};
14
+ if (isHorizontal && null != width) contentStyle.width = "number" == typeof width ? `${width}px` : width;
15
+ if (!isHorizontal && null != height) contentStyle.height = "number" == typeof height ? `${height}px` : height;
16
+ $[0] = height;
17
+ $[1] = isHorizontal;
18
+ $[2] = width;
19
+ $[3] = contentStyle;
20
+ } else contentStyle = $[3];
21
+ let t2;
22
+ if ($[4] !== onClose) {
23
+ t2 = (v)=>{
24
+ if (!v) onClose?.();
25
+ };
26
+ $[4] = onClose;
27
+ $[5] = t2;
28
+ } else t2 = $[5];
29
+ const t3 = classNames?.overlay;
30
+ let t4;
31
+ if ($[6] !== t3) {
32
+ t4 = cx(t3);
33
+ $[6] = t3;
34
+ $[7] = t4;
35
+ } else t4 = $[7];
36
+ const t5 = stylesProp?.overlay;
37
+ let t6;
38
+ if ($[8] !== t4 || $[9] !== t5) {
39
+ t6 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_6b867f3d.Overlay, {
40
+ "data-tao-drawer-overlay": "",
41
+ className: t4,
42
+ style: t5
43
+ });
44
+ $[8] = t4;
45
+ $[9] = t5;
46
+ $[10] = t6;
47
+ } else t6 = $[10];
48
+ const t7 = stylesProp?.root;
49
+ let t8;
50
+ if ($[11] !== contentStyle || $[12] !== t7) {
51
+ t8 = {
52
+ ...contentStyle,
53
+ ...t7
54
+ };
55
+ $[11] = contentStyle;
56
+ $[12] = t7;
57
+ $[13] = t8;
58
+ } else t8 = $[13];
59
+ const t9 = classNames?.root;
60
+ let t10;
61
+ if ($[14] !== t9) {
62
+ t10 = cx(t9);
63
+ $[14] = t9;
64
+ $[15] = t10;
65
+ } else t10 = $[15];
66
+ let t11;
67
+ if ($[16] !== classNames?.header || $[17] !== classNames?.title || $[18] !== onClose || $[19] !== stylesProp?.header || $[20] !== stylesProp?.title || $[21] !== title) {
68
+ t11 = (null != title || null != onClose) && /*#__PURE__*/ jsxs("div", {
69
+ "data-tao-drawer-header": "",
70
+ className: cx(classNames?.header),
71
+ style: stylesProp?.header,
72
+ children: [
73
+ null != title && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_6b867f3d.Title, {
74
+ "data-tao-drawer-title": "",
75
+ className: cx(classNames?.title),
76
+ style: stylesProp?.title,
77
+ children: title
78
+ }),
79
+ null != onClose && /*#__PURE__*/ jsx("button", {
80
+ type: "button",
81
+ "data-tao-drawer-close": "",
82
+ onClick: onClose,
83
+ "aria-label": "Close",
84
+ children: /*#__PURE__*/ jsx(CloseIcon, {})
85
+ })
86
+ ]
87
+ });
88
+ $[16] = classNames?.header;
89
+ $[17] = classNames?.title;
90
+ $[18] = onClose;
91
+ $[19] = stylesProp?.header;
92
+ $[20] = stylesProp?.title;
93
+ $[21] = title;
94
+ $[22] = t11;
95
+ } else t11 = $[22];
96
+ const t12 = classNames?.body;
97
+ let t13;
98
+ if ($[23] !== t12) {
99
+ t13 = cx(t12);
100
+ $[23] = t12;
101
+ $[24] = t13;
102
+ } else t13 = $[24];
103
+ const t14 = stylesProp?.body;
104
+ let t15;
105
+ if ($[25] !== children || $[26] !== t13 || $[27] !== t14) {
106
+ t15 = /*#__PURE__*/ jsx("div", {
107
+ "data-tao-drawer-body": "",
108
+ className: t13,
109
+ style: t14,
110
+ children: children
111
+ });
112
+ $[25] = children;
113
+ $[26] = t13;
114
+ $[27] = t14;
115
+ $[28] = t15;
116
+ } else t15 = $[28];
117
+ let t16;
118
+ if ($[29] !== placement || $[30] !== t10 || $[31] !== t11 || $[32] !== t15 || $[33] !== t8) {
119
+ t16 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dialog_6b867f3d.Content, {
120
+ "data-tao-drawer": "",
121
+ "data-tao-placement": placement,
122
+ style: t8,
123
+ className: t10,
124
+ "aria-describedby": void 0,
125
+ children: [
126
+ t11,
127
+ t15
128
+ ]
129
+ });
130
+ $[29] = placement;
131
+ $[30] = t10;
132
+ $[31] = t11;
133
+ $[32] = t15;
134
+ $[33] = t8;
135
+ $[34] = t16;
136
+ } else t16 = $[34];
137
+ let t17;
138
+ if ($[35] !== t16 || $[36] !== t6) {
139
+ t17 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dialog_6b867f3d.Portal, {
140
+ children: [
141
+ t6,
142
+ t16
143
+ ]
144
+ });
145
+ $[35] = t16;
146
+ $[36] = t6;
147
+ $[37] = t17;
148
+ } else t17 = $[37];
149
+ let t18;
150
+ if ($[38] !== open || $[39] !== t17 || $[40] !== t2) {
151
+ t18 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_6b867f3d.Root, {
152
+ open: open,
153
+ onOpenChange: t2,
154
+ children: t17
155
+ });
156
+ $[38] = open;
157
+ $[39] = t17;
158
+ $[40] = t2;
159
+ $[41] = t18;
160
+ } else t18 = $[41];
161
+ return t18;
162
+ }
163
+ function CloseIcon() {
164
+ const $ = c(1);
165
+ let t0;
166
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
167
+ t0 = /*#__PURE__*/ jsx("svg", {
168
+ width: "16",
169
+ height: "16",
170
+ viewBox: "0 0 24 24",
171
+ fill: "none",
172
+ stroke: "currentColor",
173
+ strokeWidth: "2",
174
+ strokeLinecap: "round",
175
+ strokeLinejoin: "round",
176
+ children: /*#__PURE__*/ jsx("path", {
177
+ d: "M18 6 6 18M6 6l12 12"
178
+ })
179
+ });
180
+ $[0] = t0;
181
+ } else t0 = $[0];
182
+ return t0;
183
+ }
184
+ export { Drawer };
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
3
+ import '../form-field/form.css';
4
+ export type FormActionsSemanticPart = 'root';
5
+ export interface FormActionsProps {
6
+ children: ReactNode;
7
+ className?: string;
8
+ style?: CSSProperties;
9
+ classNames?: SemanticClassNames<FormActionsSemanticPart>;
10
+ styles?: SemanticStyles<FormActionsSemanticPart>;
11
+ }
12
+ export declare function FormActions({ children, className, style, classNames, styles, }: FormActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { cx } from "../../utils/semantic.js";
4
+ import "../form-field/form.css";
5
+ function FormActions(t0) {
6
+ const $ = c(10);
7
+ const { children, className, style, classNames, styles } = t0;
8
+ const t1 = classNames?.root;
9
+ let t2;
10
+ if ($[0] !== className || $[1] !== t1) {
11
+ t2 = cx(t1, className);
12
+ $[0] = className;
13
+ $[1] = t1;
14
+ $[2] = t2;
15
+ } else t2 = $[2];
16
+ const t3 = styles?.root;
17
+ let t4;
18
+ if ($[3] !== style || $[4] !== t3) {
19
+ t4 = {
20
+ ...t3,
21
+ ...style
22
+ };
23
+ $[3] = style;
24
+ $[4] = t3;
25
+ $[5] = t4;
26
+ } else t4 = $[5];
27
+ let t5;
28
+ if ($[6] !== children || $[7] !== t2 || $[8] !== t4) {
29
+ t5 = /*#__PURE__*/ jsx("div", {
30
+ className: t2,
31
+ style: t4,
32
+ "data-tao-form-actions": "",
33
+ children: children
34
+ });
35
+ $[6] = children;
36
+ $[7] = t2;
37
+ $[8] = t4;
38
+ $[9] = t5;
39
+ } else t5 = $[9];
40
+ return t5;
41
+ }
42
+ export { FormActions };
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
3
+ import './form.css';
4
+ export type FormFieldSemanticPart = 'root' | 'label' | 'error' | 'description';
5
+ export interface FormFieldProps {
6
+ label: string;
7
+ htmlFor?: string;
8
+ required?: boolean;
9
+ error?: string;
10
+ description?: string;
11
+ children: ReactNode;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ classNames?: SemanticClassNames<FormFieldSemanticPart>;
15
+ styles?: SemanticStyles<FormFieldSemanticPart>;
16
+ }
17
+ export declare function FormField({ label, htmlFor, required, error, description, children, className, style, classNames, styles, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,101 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { cx } from "../../utils/semantic.js";
4
+ import "./form.css";
5
+ function FormField(t0) {
6
+ const $ = c(27);
7
+ const { label, htmlFor, required, error, description, children, className, style, classNames, styles } = t0;
8
+ const t1 = classNames?.root;
9
+ let t2;
10
+ if ($[0] !== className || $[1] !== t1) {
11
+ t2 = cx(t1, className);
12
+ $[0] = className;
13
+ $[1] = t1;
14
+ $[2] = t2;
15
+ } else t2 = $[2];
16
+ const t3 = styles?.root;
17
+ let t4;
18
+ if ($[3] !== style || $[4] !== t3) {
19
+ t4 = {
20
+ ...t3,
21
+ ...style
22
+ };
23
+ $[3] = style;
24
+ $[4] = t3;
25
+ $[5] = t4;
26
+ } else t4 = $[5];
27
+ const t5 = classNames?.label;
28
+ const t6 = styles?.label;
29
+ let t7;
30
+ if ($[6] !== required) {
31
+ t7 = required && /*#__PURE__*/ jsx("span", {
32
+ "data-tao-required": "",
33
+ "aria-hidden": "true",
34
+ children: "*"
35
+ });
36
+ $[6] = required;
37
+ $[7] = t7;
38
+ } else t7 = $[7];
39
+ let t8;
40
+ if ($[8] !== htmlFor || $[9] !== label || $[10] !== t5 || $[11] !== t6 || $[12] !== t7) {
41
+ t8 = /*#__PURE__*/ jsxs("label", {
42
+ htmlFor: htmlFor,
43
+ className: t5,
44
+ style: t6,
45
+ "data-tao-form-label": "",
46
+ children: [
47
+ label,
48
+ t7
49
+ ]
50
+ });
51
+ $[8] = htmlFor;
52
+ $[9] = label;
53
+ $[10] = t5;
54
+ $[11] = t6;
55
+ $[12] = t7;
56
+ $[13] = t8;
57
+ } else t8 = $[13];
58
+ let t9;
59
+ if ($[14] !== classNames?.description || $[15] !== classNames?.error || $[16] !== description || $[17] !== error || $[18] !== styles?.description || $[19] !== styles?.error) {
60
+ t9 = error ? /*#__PURE__*/ jsx("p", {
61
+ className: classNames?.error,
62
+ style: styles?.error,
63
+ "data-tao-form-error": "",
64
+ role: "alert",
65
+ children: error
66
+ }) : description ? /*#__PURE__*/ jsx("p", {
67
+ className: classNames?.description,
68
+ style: styles?.description,
69
+ "data-tao-form-description": "",
70
+ children: description
71
+ }) : null;
72
+ $[14] = classNames?.description;
73
+ $[15] = classNames?.error;
74
+ $[16] = description;
75
+ $[17] = error;
76
+ $[18] = styles?.description;
77
+ $[19] = styles?.error;
78
+ $[20] = t9;
79
+ } else t9 = $[20];
80
+ let t10;
81
+ if ($[21] !== children || $[22] !== t2 || $[23] !== t4 || $[24] !== t8 || $[25] !== t9) {
82
+ t10 = /*#__PURE__*/ jsxs("div", {
83
+ className: t2,
84
+ style: t4,
85
+ "data-tao-form-field": "",
86
+ children: [
87
+ t8,
88
+ children,
89
+ t9
90
+ ]
91
+ });
92
+ $[21] = children;
93
+ $[22] = t2;
94
+ $[23] = t4;
95
+ $[24] = t8;
96
+ $[25] = t9;
97
+ $[26] = t10;
98
+ } else t10 = $[26];
99
+ return t10;
100
+ }
101
+ export { FormField };