@rockshin/tao-ui 0.0.42 → 0.0.43

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 (97) hide show
  1. package/README.md +7 -1
  2. package/component-manifest.json +34 -17
  3. package/dist/components/alert/alert.css +1 -0
  4. package/dist/components/avatar/avatar.js +1 -1
  5. package/dist/components/calendar/calendar.css +10 -60
  6. package/dist/components/calendar/calendar.js +46 -43
  7. package/dist/components/card/card.css +1 -1
  8. package/dist/components/carousel/carousel.css +1 -0
  9. package/dist/components/carousel/carousel.js +62 -7
  10. package/dist/components/collapse/collapse-panels.d.ts +4 -0
  11. package/dist/components/collapse/collapse-panels.js +413 -0
  12. package/dist/components/collapse/collapse.css +199 -0
  13. package/dist/components/collapse/collapse.d.ts +77 -0
  14. package/dist/components/{collapsible/collapsible.js → collapse/collapse.js} +26 -10
  15. package/dist/components/color-picker/color-picker.css +8 -42
  16. package/dist/components/color-picker/color-picker.js +220 -145
  17. package/dist/components/date-picker/date-picker.css +18 -56
  18. package/dist/components/date-picker/date-picker.d.ts +2 -0
  19. package/dist/components/date-picker/date-picker.js +11 -6
  20. package/dist/components/date-picker/presets.js +5 -2
  21. package/dist/components/date-picker/range-picker.d.ts +2 -0
  22. package/dist/components/date-picker/range-picker.js +3 -1
  23. package/dist/components/form/form-item.js +1 -0
  24. package/dist/components/form/form.css +15 -0
  25. package/dist/components/form/form.js +1 -0
  26. package/dist/components/form-field/form-field-view.d.ts +3 -1
  27. package/dist/components/form-field/form-field-view.js +109 -84
  28. package/dist/components/input/base-input.d.ts +25 -0
  29. package/dist/components/input/base-input.js +104 -0
  30. package/dist/components/input/input-shared.css +75 -0
  31. package/dist/components/input/input-shared.d.ts +59 -0
  32. package/dist/components/input/input-shared.js +152 -0
  33. package/dist/components/input/input.css +99 -4
  34. package/dist/components/input/input.d.ts +12 -16
  35. package/dist/components/input/input.js +11 -154
  36. package/dist/components/input/otp.d.ts +29 -0
  37. package/dist/components/input/otp.js +335 -0
  38. package/dist/components/input/password.d.ts +12 -0
  39. package/dist/components/input/password.js +117 -0
  40. package/dist/components/input/search.d.ts +16 -0
  41. package/dist/components/input/search.js +99 -0
  42. package/dist/components/input-number/input-number.d.ts +2 -2
  43. package/dist/components/input-number/input-number.js +2 -2
  44. package/dist/components/list/list-pagination.css +5 -5
  45. package/dist/components/list/list-pagination.js +1 -0
  46. package/dist/components/mentions/mentions.css +7 -0
  47. package/dist/components/modal/modal.css +1 -0
  48. package/dist/components/radio/radio.d.ts +1 -1
  49. package/dist/components/radio/radio.js +78 -73
  50. package/dist/components/select/mobile-select.css +1 -16
  51. package/dist/components/select/mobile-select.d.ts +2 -1
  52. package/dist/components/select/mobile-select.js +68 -63
  53. package/dist/components/select/select-types.d.ts +2 -0
  54. package/dist/components/select/select.css +19 -0
  55. package/dist/components/select/select.js +31 -17
  56. package/dist/components/spinner/spinner.css +1 -1
  57. package/dist/components/steps/steps.css +53 -3
  58. package/dist/components/table/table.css +0 -5
  59. package/dist/components/table/table.js +21 -22
  60. package/dist/components/textarea/textarea.css +20 -0
  61. package/dist/components/textarea/textarea.d.ts +12 -6
  62. package/dist/components/textarea/textarea.js +120 -219
  63. package/dist/components/time-picker/time-picker.css +7 -0
  64. package/dist/components/tree/tree-check.d.ts +1 -0
  65. package/dist/components/tree/tree-check.js +36 -0
  66. package/dist/components/tree/tree.css +13 -18
  67. package/dist/components/tree/tree.js +2 -3
  68. package/dist/components/tree-select/select-engine.css +7 -0
  69. package/dist/components/tree-select/tree-select.js +2 -3
  70. package/dist/components/upload/upload.css +0 -11
  71. package/dist/components/upload/upload.js +13 -3
  72. package/dist/docs/component-docs.js +2 -2
  73. package/dist/docs/components/{collapsible.doc.d.ts → collapse.doc.d.ts} +1 -1
  74. package/dist/docs/components/collapse.doc.js +47 -0
  75. package/dist/docs/components/input.doc.js +11 -4
  76. package/dist/docs/components/textarea.doc.js +4 -2
  77. package/dist/entries/collapse.d.ts +3 -0
  78. package/dist/entries/{collapsible.js → collapse.js} +1 -1
  79. package/dist/entries/input.d.ts +1 -1
  80. package/dist/entries/textarea.d.ts +1 -1
  81. package/dist/index.d.ts +3 -3
  82. package/dist/index.js +1 -1
  83. package/dist/provider/locale.d.ts +6 -0
  84. package/dist/provider/locale.js +10 -0
  85. package/dist/provider/tao-provider.js +1 -0
  86. package/dist/theme/control.css +2 -2
  87. package/dist/theme/theme.css +3 -1
  88. package/dist/theme/tokens.d.ts +2 -2
  89. package/dist/theme/tokens.js +1 -0
  90. package/dist/utils/field-label.d.ts +4 -0
  91. package/dist/utils/field-label.js +7 -0
  92. package/llms.txt +18 -15
  93. package/package.json +7 -4
  94. package/dist/components/collapsible/collapsible.css +0 -49
  95. package/dist/components/collapsible/collapsible.d.ts +0 -39
  96. package/dist/docs/components/collapsible.doc.js +0 -39
  97. package/dist/entries/collapsible.d.ts +0 -3
@@ -0,0 +1,335 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react-compiler-runtime";
3
+ import { Fragment, forwardRef, useImperativeHandle, useRef, useState } from "react";
4
+ import { useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { cx } from "../../utils/semantic.js";
6
+ import { BaseInput } from "./base-input.js";
7
+ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
8
+ const $ = c(81);
9
+ let autoComplete;
10
+ let autoFocus;
11
+ let className;
12
+ let customClassNames;
13
+ let customStyles;
14
+ let disabled;
15
+ let formatter;
16
+ let inputMode;
17
+ let onChange;
18
+ let onInput;
19
+ let rest;
20
+ let separator;
21
+ let size;
22
+ let status;
23
+ let style;
24
+ let t0;
25
+ let t1;
26
+ let t2;
27
+ let t3;
28
+ let value;
29
+ let variant;
30
+ if ($[0] !== props) {
31
+ ({ value, defaultValue: t0, length: t1, formatter, separator, mask: t2, type: t3, autoComplete, disabled, status, size, variant, onChange, onInput, classNames: customClassNames, styles: customStyles, className, style, autoFocus, inputMode, ...rest } = props);
32
+ $[0] = props;
33
+ $[1] = autoComplete;
34
+ $[2] = autoFocus;
35
+ $[3] = className;
36
+ $[4] = customClassNames;
37
+ $[5] = customStyles;
38
+ $[6] = disabled;
39
+ $[7] = formatter;
40
+ $[8] = inputMode;
41
+ $[9] = onChange;
42
+ $[10] = onInput;
43
+ $[11] = rest;
44
+ $[12] = separator;
45
+ $[13] = size;
46
+ $[14] = status;
47
+ $[15] = style;
48
+ $[16] = t0;
49
+ $[17] = t1;
50
+ $[18] = t2;
51
+ $[19] = t3;
52
+ $[20] = value;
53
+ $[21] = variant;
54
+ } else {
55
+ autoComplete = $[1];
56
+ autoFocus = $[2];
57
+ className = $[3];
58
+ customClassNames = $[4];
59
+ customStyles = $[5];
60
+ disabled = $[6];
61
+ formatter = $[7];
62
+ inputMode = $[8];
63
+ onChange = $[9];
64
+ onInput = $[10];
65
+ rest = $[11];
66
+ separator = $[12];
67
+ size = $[13];
68
+ status = $[14];
69
+ style = $[15];
70
+ t0 = $[16];
71
+ t1 = $[17];
72
+ t2 = $[18];
73
+ t3 = $[19];
74
+ value = $[20];
75
+ variant = $[21];
76
+ }
77
+ const defaultValue = void 0 === t0 ? "" : t0;
78
+ const length = void 0 === t1 ? 6 : t1;
79
+ const mask = void 0 === t2 ? false : t2;
80
+ const type = void 0 === t3 ? "text" : t3;
81
+ if (!Number.isInteger(length) || length < 1) throw new RangeError("Input.OTP length must be a positive integer");
82
+ const ctx = useTaoConfig();
83
+ let t4;
84
+ if ($[22] !== formatter || $[23] !== length) {
85
+ t4 = (text)=>Array.from(formatter ? formatter(text) : text).slice(0, length);
86
+ $[22] = formatter;
87
+ $[23] = length;
88
+ $[24] = t4;
89
+ } else t4 = $[24];
90
+ const format = t4;
91
+ let t5;
92
+ if ($[25] !== defaultValue || $[26] !== format) {
93
+ t5 = ()=>format(defaultValue);
94
+ $[25] = defaultValue;
95
+ $[26] = format;
96
+ $[27] = t5;
97
+ } else t5 = $[27];
98
+ const [innerValue, setInnerValue] = useState(t5);
99
+ const [draft, setDraft] = useState(null);
100
+ let t6;
101
+ if ($[28] !== format || $[29] !== innerValue || $[30] !== value) {
102
+ t6 = void 0 !== value ? format(value) : innerValue;
103
+ $[28] = format;
104
+ $[29] = innerValue;
105
+ $[30] = value;
106
+ $[31] = t6;
107
+ } else t6 = $[31];
108
+ const cells = t6;
109
+ let t7;
110
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
111
+ t7 = [];
112
+ $[32] = t7;
113
+ } else t7 = $[32];
114
+ const inputs = useRef(t7);
115
+ const root = useRef(null);
116
+ const composing = useRef(false);
117
+ let t8;
118
+ if ($[33] !== customClassNames || $[34] !== props) {
119
+ t8 = "function" == typeof customClassNames ? customClassNames({
120
+ props
121
+ }) : customClassNames;
122
+ $[33] = customClassNames;
123
+ $[34] = props;
124
+ $[35] = t8;
125
+ } else t8 = $[35];
126
+ const classNames = t8;
127
+ let t9;
128
+ if ($[36] !== customStyles || $[37] !== props) {
129
+ t9 = "function" == typeof customStyles ? customStyles({
130
+ props
131
+ }) : customStyles;
132
+ $[36] = customStyles;
133
+ $[37] = props;
134
+ $[38] = t9;
135
+ } else t9 = $[38];
136
+ const styles = t9;
137
+ let t10;
138
+ if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
139
+ t10 = (index)=>{
140
+ inputs.current[index]?.focus();
141
+ inputs.current[index]?.select();
142
+ };
143
+ $[39] = t10;
144
+ } else t10 = $[39];
145
+ const focus = t10;
146
+ let t11;
147
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
148
+ t11 = ()=>({
149
+ focus: ()=>focus(0),
150
+ blur: ()=>inputs.current.forEach(_temp),
151
+ nativeElement: root.current
152
+ });
153
+ $[40] = t11;
154
+ } else t11 = $[40];
155
+ useImperativeHandle(ref, t11);
156
+ let t12;
157
+ if ($[41] !== cells || $[42] !== format || $[43] !== length || $[44] !== onChange || $[45] !== onInput || $[46] !== value) {
158
+ t12 = (index_0, text_0)=>{
159
+ const chars = format(text_0);
160
+ const next = Array.from({
161
+ length
162
+ }, (_, i)=>cells[i] ?? "");
163
+ if (chars.length) chars.forEach((char, offset)=>{
164
+ if (index_0 + offset < length) next[index_0 + offset] = char;
165
+ });
166
+ else next[index_0] = "";
167
+ while(next.length && !next[next.length - 1])next.pop();
168
+ if (next.length !== cells.length || next.some((char_0, i_0)=>char_0 !== cells[i_0])) {
169
+ if (void 0 === value) setInnerValue(next);
170
+ onInput?.(next);
171
+ if (next.length === length && next.every(Boolean)) onChange?.(next.join(""));
172
+ }
173
+ if (chars.length) focus(Math.min(index_0 + chars.length, length - 1));
174
+ };
175
+ $[41] = cells;
176
+ $[42] = format;
177
+ $[43] = length;
178
+ $[44] = onChange;
179
+ $[45] = onInput;
180
+ $[46] = value;
181
+ $[47] = t12;
182
+ } else t12 = $[47];
183
+ const update = t12;
184
+ const t13 = rest.role ?? "group";
185
+ const t14 = classNames?.root;
186
+ let t15;
187
+ if ($[48] !== className || $[49] !== t14) {
188
+ t15 = cx(t14, className);
189
+ $[48] = className;
190
+ $[49] = t14;
191
+ $[50] = t15;
192
+ } else t15 = $[50];
193
+ const t16 = styles?.root;
194
+ let t17;
195
+ if ($[51] !== style || $[52] !== t16) {
196
+ t17 = {
197
+ ...t16,
198
+ ...style
199
+ };
200
+ $[51] = style;
201
+ $[52] = t16;
202
+ $[53] = t17;
203
+ } else t17 = $[53];
204
+ let t18;
205
+ if ($[54] !== autoComplete || $[55] !== autoFocus || $[56] !== cells || $[57] !== classNames?.input || $[58] !== classNames?.separator || $[59] !== ctx || $[60] !== disabled || $[61] !== draft || $[62] !== inputMode || $[63] !== length || $[64] !== mask || $[65] !== rest || $[66] !== separator || $[67] !== size || $[68] !== status || $[69] !== styles?.input || $[70] !== styles?.separator || $[71] !== type || $[72] !== update || $[73] !== variant) {
206
+ t18 = Array.from({
207
+ length
208
+ }, (__0, index_1)=>/*#__PURE__*/ jsxs(Fragment, {
209
+ children: [
210
+ /*#__PURE__*/ jsxs("div", {
211
+ "data-tao-otp-cell": "",
212
+ "data-tao-otp-masked": "string" == typeof mask && cells[index_1] ? "" : void 0,
213
+ children: [
214
+ /*#__PURE__*/ jsx(BaseInput, {
215
+ ref: (node)=>{
216
+ inputs.current[index_1] = node;
217
+ },
218
+ value: draft?.index === index_1 ? draft.value : cells[index_1] ?? "",
219
+ autoFocus: autoFocus && 0 === index_1,
220
+ type: true === mask ? "password" : type,
221
+ inputMode: inputMode,
222
+ autoComplete: autoComplete,
223
+ disabled: disabled,
224
+ status: status,
225
+ size: size,
226
+ variant: variant,
227
+ "aria-label": ctx.locale.otpLabel?.(index_1 + 1, length) ?? `Character ${index_1 + 1} of ${length}`,
228
+ "aria-describedby": rest["aria-describedby"],
229
+ "aria-invalid": rest["aria-invalid"],
230
+ classNames: {
231
+ input: classNames?.input
232
+ },
233
+ styles: {
234
+ input: styles?.input
235
+ },
236
+ onFocus: _temp2,
237
+ onChange: (event_0)=>{
238
+ if (composing.current) setDraft({
239
+ index: index_1,
240
+ value: event_0.target.value
241
+ });
242
+ else update(index_1, event_0.target.value);
243
+ },
244
+ onCompositionStart: ()=>{
245
+ composing.current = true;
246
+ },
247
+ onCompositionEnd: (event_1)=>{
248
+ composing.current = false;
249
+ setDraft(null);
250
+ update(index_1, event_1.currentTarget.value);
251
+ },
252
+ onPaste: (event_2)=>{
253
+ event_2.preventDefault();
254
+ update(index_1, event_2.clipboardData.getData("text"));
255
+ },
256
+ onKeyDown: (event_3)=>{
257
+ if (composing.current || event_3.nativeEvent.isComposing) return;
258
+ if ("ArrowLeft" === event_3.key || "ArrowRight" === event_3.key) {
259
+ event_3.preventDefault();
260
+ const direction = "rtl" === getComputedStyle(root.current).direction ? -1 : 1;
261
+ focus(Math.min(length - 1, Math.max(0, index_1 + ("ArrowRight" === event_3.key ? direction : -direction))));
262
+ } else if ("Backspace" === event_3.key && !cells[index_1] && index_1 > 0) {
263
+ event_3.preventDefault();
264
+ update(index_1 - 1, "");
265
+ focus(index_1 - 1);
266
+ } else if ("Delete" === event_3.key) {
267
+ event_3.preventDefault();
268
+ update(index_1, "");
269
+ }
270
+ }
271
+ }),
272
+ "string" == typeof mask && cells[index_1] && /*#__PURE__*/ jsx("span", {
273
+ "data-tao-otp-mask": "",
274
+ "aria-hidden": "true",
275
+ children: mask
276
+ })
277
+ ]
278
+ }),
279
+ index_1 < length - 1 && null != separator && /*#__PURE__*/ jsx("span", {
280
+ "data-tao-otp-separator": "",
281
+ className: classNames?.separator,
282
+ style: styles?.separator,
283
+ children: "function" == typeof separator ? separator(index_1) : separator
284
+ })
285
+ ]
286
+ }, `otp-${index_1}`));
287
+ $[54] = autoComplete;
288
+ $[55] = autoFocus;
289
+ $[56] = cells;
290
+ $[57] = classNames?.input;
291
+ $[58] = classNames?.separator;
292
+ $[59] = ctx;
293
+ $[60] = disabled;
294
+ $[61] = draft;
295
+ $[62] = inputMode;
296
+ $[63] = length;
297
+ $[64] = mask;
298
+ $[65] = rest;
299
+ $[66] = separator;
300
+ $[67] = size;
301
+ $[68] = status;
302
+ $[69] = styles?.input;
303
+ $[70] = styles?.separator;
304
+ $[71] = type;
305
+ $[72] = update;
306
+ $[73] = variant;
307
+ $[74] = t18;
308
+ } else t18 = $[74];
309
+ let t19;
310
+ if ($[75] !== rest || $[76] !== t13 || $[77] !== t15 || $[78] !== t17 || $[79] !== t18) {
311
+ t19 = /*#__PURE__*/ jsx("div", {
312
+ ...rest,
313
+ ref: root,
314
+ role: t13,
315
+ "data-tao-input-otp": "",
316
+ className: t15,
317
+ style: t17,
318
+ children: t18
319
+ });
320
+ $[75] = rest;
321
+ $[76] = t13;
322
+ $[77] = t15;
323
+ $[78] = t17;
324
+ $[79] = t18;
325
+ $[80] = t19;
326
+ } else t19 = $[80];
327
+ return t19;
328
+ });
329
+ function _temp(input) {
330
+ input?.blur();
331
+ }
332
+ function _temp2(event) {
333
+ return event.currentTarget.select();
334
+ }
335
+ export { otp_OTP as OTP };
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type InputProps } from './base-input.js';
3
+ export interface VisibilityToggle {
4
+ visible?: boolean;
5
+ onVisibleChange?: (visible: boolean) => void;
6
+ tabIndex?: number;
7
+ }
8
+ export interface PasswordProps extends InputProps {
9
+ visibilityToggle?: boolean | VisibilityToggle;
10
+ iconRender?: (visible: boolean) => ReactNode;
11
+ }
12
+ export declare const Password: import("react").ForwardRefExoticComponent<PasswordProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,117 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react-compiler-runtime";
3
+ import { forwardRef, useState } from "react";
4
+ import { useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { BaseInput } from "./base-input.js";
6
+ const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
7
+ const $ = c(24);
8
+ let disabled;
9
+ let iconRender;
10
+ let props;
11
+ let suffix;
12
+ let t1;
13
+ if ($[0] !== t0) {
14
+ ({ visibilityToggle: t1, iconRender, suffix, disabled, ...props } = t0);
15
+ $[0] = t0;
16
+ $[1] = disabled;
17
+ $[2] = iconRender;
18
+ $[3] = props;
19
+ $[4] = suffix;
20
+ $[5] = t1;
21
+ } else {
22
+ disabled = $[1];
23
+ iconRender = $[2];
24
+ props = $[3];
25
+ suffix = $[4];
26
+ t1 = $[5];
27
+ }
28
+ const visibilityToggle = void 0 === t1 ? true : t1;
29
+ const ctx = useTaoConfig();
30
+ const [innerVisible, setVisible] = useState(false);
31
+ let t2;
32
+ if ($[6] !== visibilityToggle) {
33
+ t2 = "object" == typeof visibilityToggle ? visibilityToggle : {};
34
+ $[6] = visibilityToggle;
35
+ $[7] = t2;
36
+ } else t2 = $[7];
37
+ const config = t2;
38
+ const visible = config.visible ?? innerVisible;
39
+ const resolvedDisabled = disabled ?? ctx.disabled;
40
+ const t3 = visible ? "text" : "password";
41
+ let t4;
42
+ if ($[8] !== config || $[9] !== ctx || $[10] !== iconRender || $[11] !== resolvedDisabled || $[12] !== visibilityToggle || $[13] !== visible) {
43
+ t4 = visibilityToggle && /*#__PURE__*/ jsx("button", {
44
+ type: "button",
45
+ "data-tao-input-action": "",
46
+ "aria-label": visible ? ctx.locale.hidePassword ?? "Hide password" : ctx.locale.showPassword ?? "Show password",
47
+ "aria-pressed": visible,
48
+ tabIndex: config.tabIndex,
49
+ disabled: resolvedDisabled,
50
+ onMouseDown: _temp,
51
+ onClick: ()=>{
52
+ if (void 0 === config.visible) setVisible(!visible);
53
+ config.onVisibleChange?.(!visible);
54
+ },
55
+ children: iconRender ? iconRender(visible) : /*#__PURE__*/ jsxs("svg", {
56
+ viewBox: "0 0 24 24",
57
+ fill: "none",
58
+ stroke: "currentColor",
59
+ strokeWidth: "1.8",
60
+ "aria-hidden": "true",
61
+ children: [
62
+ /*#__PURE__*/ jsx("path", {
63
+ d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z"
64
+ }),
65
+ /*#__PURE__*/ jsx("circle", {
66
+ cx: "12",
67
+ cy: "12",
68
+ r: "3"
69
+ }),
70
+ !visible && /*#__PURE__*/ jsx("path", {
71
+ d: "m3 3 18 18"
72
+ })
73
+ ]
74
+ })
75
+ });
76
+ $[8] = config;
77
+ $[9] = ctx;
78
+ $[10] = iconRender;
79
+ $[11] = resolvedDisabled;
80
+ $[12] = visibilityToggle;
81
+ $[13] = visible;
82
+ $[14] = t4;
83
+ } else t4 = $[14];
84
+ let t5;
85
+ if ($[15] !== suffix || $[16] !== t4) {
86
+ t5 = /*#__PURE__*/ jsxs(Fragment, {
87
+ children: [
88
+ suffix,
89
+ t4
90
+ ]
91
+ });
92
+ $[15] = suffix;
93
+ $[16] = t4;
94
+ $[17] = t5;
95
+ } else t5 = $[17];
96
+ let t6;
97
+ if ($[18] !== props || $[19] !== ref || $[20] !== resolvedDisabled || $[21] !== t3 || $[22] !== t5) {
98
+ t6 = /*#__PURE__*/ jsx(BaseInput, {
99
+ ...props,
100
+ disabled: resolvedDisabled,
101
+ ref: ref,
102
+ type: t3,
103
+ suffix: t5
104
+ });
105
+ $[18] = props;
106
+ $[19] = ref;
107
+ $[20] = resolvedDisabled;
108
+ $[21] = t3;
109
+ $[22] = t5;
110
+ $[23] = t6;
111
+ } else t6 = $[23];
112
+ return t6;
113
+ });
114
+ function _temp(event) {
115
+ return event.preventDefault();
116
+ }
117
+ export { password_Password as Password };
@@ -0,0 +1,16 @@
1
+ import { type ChangeEvent, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
2
+ import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
3
+ import { type InputProps, type InputSemanticPart } from './base-input.js';
4
+ import type { InputSemanticValue } from './input-shared.js';
5
+ export type SearchSemanticPart = InputSemanticPart | 'button';
6
+ export interface SearchProps extends Omit<InputProps, 'onSearch' | 'classNames' | 'styles'> {
7
+ enterButton?: ReactNode;
8
+ loading?: boolean;
9
+ searchIcon?: ReactNode;
10
+ onSearch?: (value: string, event?: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLElement> | KeyboardEvent<HTMLInputElement>, info?: {
11
+ source: 'input' | 'clear';
12
+ }) => void;
13
+ classNames?: InputSemanticValue<SemanticClassNames<SearchSemanticPart>, SearchProps>;
14
+ styles?: InputSemanticValue<SemanticStyles<SearchSemanticPart>, SearchProps>;
15
+ }
16
+ export declare const Search: import("react").ForwardRefExoticComponent<SearchProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,99 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cloneElement, forwardRef, isValidElement, useRef } from "react";
3
+ import { useTaoConfig } from "../../provider/tao-provider.js";
4
+ import { mergeRefs } from "../../utils/refs.js";
5
+ import { cx } from "../../utils/semantic.js";
6
+ import { Button } from "../button/button.js";
7
+ import { SearchIcon } from "../select/select-icons.js";
8
+ import { BaseInput } from "./base-input.js";
9
+ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
10
+ const { enterButton = false, loading, searchIcon, onSearch, onChange, onPressEnter, classNames: customClassNames, styles: customStyles, className, style, addonAfter, ...rest } = props;
11
+ const ctx = useTaoConfig();
12
+ const disabled = props.disabled ?? ctx.disabled;
13
+ const inputRef = useRef(null);
14
+ const classNames = 'function' == typeof customClassNames ? customClassNames({
15
+ props
16
+ }) : customClassNames;
17
+ const styles = 'function' == typeof customStyles ? customStyles({
18
+ props
19
+ }) : customStyles;
20
+ const search = (event)=>{
21
+ if (!disabled && !loading && !event.defaultPrevented) onSearch?.(inputRef.current.value, event, {
22
+ source: 'input'
23
+ });
24
+ };
25
+ const buttonProps = {
26
+ type: 'button',
27
+ disabled: disabled || loading,
28
+ 'aria-busy': loading || void 0,
29
+ 'aria-label': ctx.locale.search ?? 'Search',
30
+ className: classNames?.button,
31
+ style: styles?.button,
32
+ onMouseDown: (event_0)=>event_0.preventDefault(),
33
+ onClick: search
34
+ };
35
+ const customButton = /*#__PURE__*/ isValidElement(enterButton) && ('button' === enterButton.type || enterButton.type === Button);
36
+ const button = customButton ? /*#__PURE__*/ cloneElement(enterButton, {
37
+ ...buttonProps,
38
+ className: cx(enterButton.props.className, classNames?.button),
39
+ style: {
40
+ ...enterButton.props.style,
41
+ ...styles?.button
42
+ },
43
+ 'aria-label': enterButton.props['aria-label'] ?? buttonProps['aria-label'],
44
+ disabled: buttonProps.disabled || enterButton.props.disabled,
45
+ ...enterButton.type === Button ? {
46
+ loading,
47
+ size: props.size ?? enterButton.props.size
48
+ } : {},
49
+ onMouseDown: (event_1)=>{
50
+ enterButton.props.onMouseDown?.(event_1);
51
+ event_1.preventDefault();
52
+ },
53
+ onClick: (event_2)=>{
54
+ enterButton.props.onClick?.(event_2);
55
+ search(event_2);
56
+ }
57
+ }) : /*#__PURE__*/ jsx(Button, {
58
+ ...buttonProps,
59
+ loading: loading,
60
+ size: props.size,
61
+ variant: enterButton ? 'primary' : 'secondary',
62
+ children: true !== enterButton && enterButton ? enterButton : searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {})
63
+ });
64
+ return /*#__PURE__*/ jsxs("div", {
65
+ "data-tao-input-search": "",
66
+ className: cx(classNames?.root, className),
67
+ style: {
68
+ ...styles?.root,
69
+ ...style
70
+ },
71
+ children: [
72
+ /*#__PURE__*/ jsx(BaseInput, {
73
+ ...rest,
74
+ ref: mergeRefs(inputRef, ref),
75
+ classNames: {
76
+ ...classNames,
77
+ root: void 0
78
+ },
79
+ styles: {
80
+ ...styles,
81
+ root: void 0
82
+ },
83
+ onChange: (event_3)=>{
84
+ onChange?.(event_3);
85
+ if ('click' === event_3.type && !disabled && !loading) onSearch?.('', event_3, {
86
+ source: 'clear'
87
+ });
88
+ },
89
+ onPressEnter: (event_4)=>{
90
+ onPressEnter?.(event_4);
91
+ search(event_4);
92
+ }
93
+ }),
94
+ button,
95
+ addonAfter
96
+ ]
97
+ });
98
+ });
99
+ export { search_Search as Search };
@@ -2,8 +2,8 @@ import { type AriaAttributes, type ReactNode, type Ref } from 'react';
2
2
  import { type UseNumberInputOptions } from '../../number-input/use-number-input.js';
3
3
  import type { TaoSize, TaoStatus, TaoVariant } from '../../provider/tao-provider.js';
4
4
  import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic.js';
5
- import { type InputSemanticPart } from '../input/input.js';
6
- export type InputNumberSemanticPart = InputSemanticPart;
5
+ import { type InputSemanticPart } from '../input/base-input.js';
6
+ export type InputNumberSemanticPart = Extract<InputSemanticPart, 'root' | 'input' | 'prefix' | 'suffix'>;
7
7
  export interface InputNumberProps extends UseNumberInputOptions, Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-required'> {
8
8
  prefix?: ReactNode;
9
9
  suffix?: ReactNode;
@@ -3,7 +3,7 @@ import { c } from "react-compiler-runtime";
3
3
  import { forwardRef } from "react";
4
4
  import { useNumberInput } from "../../number-input/use-number-input.js";
5
5
  import { mergeRefs } from "../../utils/refs.js";
6
- import { Input } from "../input/input.js";
6
+ import { BaseInput } from "../input/base-input.js";
7
7
  const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwardedRef) {
8
8
  const $ = c(49);
9
9
  let ariaDescribedBy;
@@ -93,7 +93,7 @@ const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwarded
93
93
  const t2 = "error" === status || error ? true : ariaInvalid;
94
94
  let t3;
95
95
  if ($[27] !== ariaDescribedBy || $[28] !== ariaErrorMessage || $[29] !== ariaLabel || $[30] !== ariaLabelledBy || $[31] !== ariaRequired || $[32] !== className || $[33] !== classNames || $[34] !== disabled || $[35] !== error || $[36] !== id || $[37] !== inputRest || $[38] !== name || $[39] !== placeholder || $[40] !== prefix || $[41] !== size || $[42] !== status || $[43] !== styles || $[44] !== suffix || $[45] !== t1 || $[46] !== t2 || $[47] !== variant) {
96
- t3 = /*#__PURE__*/ jsx(Input, {
96
+ t3 = /*#__PURE__*/ jsx(BaseInput, {
97
97
  ref: t1,
98
98
  prefix: prefix,
99
99
  suffix: suffix,
@@ -51,7 +51,7 @@
51
51
  cursor: not-allowed;
52
52
  }
53
53
 
54
- [data-tao-list-pages] button {
54
+ :is([data-tao-list-page-button], [data-tao-list-pages] [class$="-quick-jumper-button"], [data-tao-list-pages] [class$="-simple-pager"] > button) {
55
55
  font: inherit;
56
56
  color: inherit;
57
57
  border-radius: inherit;
@@ -62,11 +62,11 @@
62
62
  padding: 0 8px;
63
63
  }
64
64
 
65
- [data-tao-list-pages] button:disabled {
65
+ :is([data-tao-list-page-button], [data-tao-list-pages] [class$="-quick-jumper-button"], [data-tao-list-pages] [class$="-simple-pager"] > button):disabled {
66
66
  cursor: not-allowed;
67
67
  }
68
68
 
69
- [data-tao-list-pages] input {
69
+ [data-tao-list-pages] :is([class$="-quick-jumper"], [class$="-simple-pager"]) > input {
70
70
  width: 48px;
71
71
  min-width: 0;
72
72
  height: var(--tao-control-height);
@@ -81,7 +81,7 @@
81
81
  padding-inline: 4px;
82
82
  }
83
83
 
84
- [data-tao-list-pages] input:focus-visible {
84
+ [data-tao-list-pages] :is([class$="-quick-jumper"], [class$="-simple-pager"]) > input:focus-visible {
85
85
  outline: 2px solid var(--tao-color-primary);
86
86
  outline-offset: 2px;
87
87
  }
@@ -109,7 +109,7 @@
109
109
  gap: 4px;
110
110
  }
111
111
 
112
- [data-tao-list-pages][data-tao-size="small"] input {
112
+ [data-tao-list-pages][data-tao-size="small"] :is([class$="-quick-jumper"], [class$="-simple-pager"]) > input {
113
113
  width: 32px;
114
114
  height: var(--tao-control-height-sm);
115
115
  margin-inline: 4px;
@@ -218,6 +218,7 @@ function ListPaginationControl(props) {
218
218
  let t27;
219
219
  if ($[51] !== contextLocale.next || $[52] !== contextLocale.previous || $[53] !== current || $[54] !== disabled || $[55] !== itemRender || $[56] !== props.disabled || $[57] !== totalPages) {
220
220
  t27 = itemRender ?? ((page, type)=>/*#__PURE__*/ jsx("button", {
221
+ "data-tao-list-page-button": "",
221
222
  type: "button",
222
223
  "aria-label": "page" === type ? `Page ${page}` : "prev" === type ? contextLocale.previous : "next" === type ? contextLocale.next : "jump-prev" === type ? "Previous pages" : "Next pages",
223
224
  "aria-current": "page" === type && page === current ? "page" : void 0,
@@ -120,6 +120,13 @@
120
120
  color: var(--tao-color-text);
121
121
  }
122
122
 
123
+ @media (hover: hover) and (pointer: fine) {
124
+ [data-tao-mentions]:not(:hover) [class*="-clear-icon"]:not(:focus-visible) {
125
+ opacity: 0;
126
+ pointer-events: none;
127
+ }
128
+ }
129
+
123
130
  [data-tao-mentions] [class*="-clear-icon"]:focus-visible {
124
131
  outline: 2px solid var(--tao-primary);
125
132
  outline-offset: 1px;