@rockshin/tao-ui 0.0.57 → 0.0.59

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 (109) hide show
  1. package/dist/components/affix/affix.js +38 -4
  2. package/dist/components/app/app-modals.js +11 -6
  3. package/dist/components/app/app-notices.js +112 -47
  4. package/dist/components/auto-complete/auto-complete.js +9 -2
  5. package/dist/components/avatar/avatar.js +1 -1
  6. package/dist/components/badge/badge.js +2 -2
  7. package/dist/components/breadcrumb/breadcrumb.js +5 -1
  8. package/dist/components/calendar/calendar.js +24 -17
  9. package/dist/components/carousel/carousel.js +35 -16
  10. package/dist/components/cascader/cascader.js +17 -12
  11. package/dist/components/checkbox/checkbox.d.ts +3 -1
  12. package/dist/components/checkbox/checkbox.js +65 -58
  13. package/dist/components/collapse/collapse-panels.js +68 -67
  14. package/dist/components/color-picker/color-picker.js +383 -360
  15. package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
  16. package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
  17. package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
  18. package/dist/components/date-picker/calendar/month-grid.js +61 -45
  19. package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
  20. package/dist/components/date-picker/calendar/time-panel.js +89 -88
  21. package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
  22. package/dist/components/date-picker/calendar/year-grid.js +60 -44
  23. package/dist/components/date-picker/date-localization.js +12 -14
  24. package/dist/components/date-picker/date-picker.css +9 -0
  25. package/dist/components/date-picker/date-picker.js +22 -13
  26. package/dist/components/date-picker/range-picker.d.ts +2 -0
  27. package/dist/components/date-picker/range-picker.js +127 -70
  28. package/dist/components/date-picker/types.js +1 -1
  29. package/dist/components/divider/divider.js +1 -1
  30. package/dist/components/drawer/drawer.d.ts +1 -1
  31. package/dist/components/drawer/drawer.js +4 -3
  32. package/dist/components/dropdown/dropdown.js +11 -9
  33. package/dist/components/float-button/float-button.js +11 -9
  34. package/dist/components/form/form-item.d.ts +1 -1
  35. package/dist/components/form/form-item.js +160 -120
  36. package/dist/components/form-field/form-field-view.d.ts +2 -1
  37. package/dist/components/form-field/form-field-view.js +173 -108
  38. package/dist/components/image/image.js +135 -143
  39. package/dist/components/input/input-shared.js +3 -2
  40. package/dist/components/input/otp.js +120 -110
  41. package/dist/components/input/password.js +55 -61
  42. package/dist/components/input/search.js +13 -7
  43. package/dist/components/list/list.js +106 -105
  44. package/dist/components/masonry/masonry.js +1 -1
  45. package/dist/components/mentions/mentions.js +1 -0
  46. package/dist/components/menu/menu-render.js +1 -0
  47. package/dist/components/modal/confirm-dialog.js +11 -4
  48. package/dist/components/modal/modal.js +320 -315
  49. package/dist/components/pagination/pagination.d.ts +3 -0
  50. package/dist/components/pagination/pagination.js +5 -0
  51. package/dist/components/popover/popover.js +325 -289
  52. package/dist/components/qr-code/qr-code.js +157 -150
  53. package/dist/components/radio/radio.d.ts +3 -1
  54. package/dist/components/radio/radio.js +73 -64
  55. package/dist/components/rate/rate.js +83 -72
  56. package/dist/components/scroll-area/scroll-area.css +1 -1
  57. package/dist/components/scroll-area/scroll-area.js +294 -222
  58. package/dist/components/select/mobile-select.js +6 -3
  59. package/dist/components/select/select-model.js +2 -2
  60. package/dist/components/select/select.js +78 -39
  61. package/dist/components/select/use-select-selection.d.ts +1 -1
  62. package/dist/components/select/use-select-selection.js +91 -84
  63. package/dist/components/slider/slider.d.ts +2 -2
  64. package/dist/components/slider/slider.js +13 -2
  65. package/dist/components/sonner/sonner.js +2 -2
  66. package/dist/components/splitter/splitter.css +1 -0
  67. package/dist/components/splitter/splitter.js +152 -126
  68. package/dist/components/statistic/statistic.js +84 -78
  69. package/dist/components/steps/steps.js +1 -1
  70. package/dist/components/switch/switch.js +45 -39
  71. package/dist/components/table/table.js +5 -1
  72. package/dist/components/table/use-table-data.js +2 -2
  73. package/dist/components/time-picker/time-picker.js +31 -1
  74. package/dist/components/tooltip/tooltip.js +237 -99
  75. package/dist/components/tree/tree.js +31 -3
  76. package/dist/components/tree-select/tree-select.js +1 -1
  77. package/dist/components/upload/upload.js +69 -42
  78. package/dist/locales/ar-EG.js +2 -0
  79. package/dist/locales/de-DE.js +2 -0
  80. package/dist/locales/en-US.js +2 -0
  81. package/dist/locales/es-ES.js +2 -0
  82. package/dist/locales/fr-FR.js +2 -0
  83. package/dist/locales/hi-IN.js +2 -0
  84. package/dist/locales/id-ID.js +2 -0
  85. package/dist/locales/it-IT.js +2 -0
  86. package/dist/locales/ja-JP.js +2 -0
  87. package/dist/locales/ko-KR.js +2 -0
  88. package/dist/locales/pt-BR.js +2 -0
  89. package/dist/locales/ru-RU.js +2 -0
  90. package/dist/locales/th-TH.js +2 -0
  91. package/dist/locales/tr-TR.js +2 -0
  92. package/dist/locales/types.d.ts +2 -0
  93. package/dist/locales/vi-VN.js +2 -0
  94. package/dist/locales/zh-CN.js +2 -0
  95. package/dist/locales/zh-TW.js +2 -0
  96. package/dist/number-input/cursor.js +20 -8
  97. package/dist/number-input/format.js +13 -5
  98. package/dist/number-input/use-number-input.js +166 -318
  99. package/dist/number-input/validate.d.ts +1 -0
  100. package/dist/number-input/validate.js +1 -1
  101. package/dist/provider/tao-provider.d.ts +2 -2
  102. package/dist/provider/tao-provider.js +49 -49
  103. package/dist/utils/composed-parent.d.ts +1 -0
  104. package/dist/utils/composed-parent.js +7 -0
  105. package/dist/utils/portal.d.ts +5 -0
  106. package/dist/utils/portal.js +7 -1
  107. package/dist/utils/refs.d.ts +3 -1
  108. package/dist/utils/refs.js +25 -1
  109. package/package.json +1 -1
@@ -17,14 +17,15 @@ function useTextControlRef(ref, nodeRef, rootRef) {
17
17
  if ($[2] !== nodeRef || $[3] !== rootRef) {
18
18
  t1 = ()=>{
19
19
  const node = nodeRef.current;
20
- const nativeFocus = Object.getPrototypeOf(node).focus ?? HTMLElement.prototype.focus;
20
+ const nativeFocus = Object.getPrototypeOf(node).focus;
21
+ if (!nativeFocus) return node;
21
22
  return Object.assign(node, {
22
23
  input: node,
23
24
  textArea: node,
24
25
  nativeElement: rootRef.current,
25
26
  focus (options) {
26
27
  nativeFocus.call(node, options);
27
- if (options?.cursor && (node instanceof HTMLTextAreaElement || [
28
+ if (options?.cursor && ("textarea" === node.localName || [
28
29
  "text",
29
30
  "search",
30
31
  "password",
@@ -6,7 +6,8 @@ import { cx } from "../../utils/semantic.js";
6
6
  import { FormFieldChangeContext } from "../form/form-context.js";
7
7
  import { BaseInput } from "./base-input.js";
8
8
  const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
9
- const $ = c(61);
9
+ const $ = c(62);
10
+ let ariaRequired;
10
11
  let autoComplete;
11
12
  let autoFocus;
12
13
  let className;
@@ -29,51 +30,53 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
29
30
  let value;
30
31
  let variant;
31
32
  if ($[0] !== props) {
32
- ({ 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);
33
+ ({ 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, "aria-required": ariaRequired, ...rest } = props);
33
34
  $[0] = props;
34
- $[1] = autoComplete;
35
- $[2] = autoFocus;
36
- $[3] = className;
37
- $[4] = customClassNames;
38
- $[5] = customStyles;
39
- $[6] = disabled;
40
- $[7] = formatter;
41
- $[8] = inputMode;
42
- $[9] = onChange;
43
- $[10] = onInput;
44
- $[11] = rest;
45
- $[12] = separator;
46
- $[13] = size;
47
- $[14] = status;
48
- $[15] = style;
49
- $[16] = t0;
50
- $[17] = t1;
51
- $[18] = t2;
52
- $[19] = t3;
53
- $[20] = value;
54
- $[21] = variant;
35
+ $[1] = ariaRequired;
36
+ $[2] = autoComplete;
37
+ $[3] = autoFocus;
38
+ $[4] = className;
39
+ $[5] = customClassNames;
40
+ $[6] = customStyles;
41
+ $[7] = disabled;
42
+ $[8] = formatter;
43
+ $[9] = inputMode;
44
+ $[10] = onChange;
45
+ $[11] = onInput;
46
+ $[12] = rest;
47
+ $[13] = separator;
48
+ $[14] = size;
49
+ $[15] = status;
50
+ $[16] = style;
51
+ $[17] = t0;
52
+ $[18] = t1;
53
+ $[19] = t2;
54
+ $[20] = t3;
55
+ $[21] = value;
56
+ $[22] = variant;
55
57
  } else {
56
- autoComplete = $[1];
57
- autoFocus = $[2];
58
- className = $[3];
59
- customClassNames = $[4];
60
- customStyles = $[5];
61
- disabled = $[6];
62
- formatter = $[7];
63
- inputMode = $[8];
64
- onChange = $[9];
65
- onInput = $[10];
66
- rest = $[11];
67
- separator = $[12];
68
- size = $[13];
69
- status = $[14];
70
- style = $[15];
71
- t0 = $[16];
72
- t1 = $[17];
73
- t2 = $[18];
74
- t3 = $[19];
75
- value = $[20];
76
- variant = $[21];
58
+ ariaRequired = $[1];
59
+ autoComplete = $[2];
60
+ autoFocus = $[3];
61
+ className = $[4];
62
+ customClassNames = $[5];
63
+ customStyles = $[6];
64
+ disabled = $[7];
65
+ formatter = $[8];
66
+ inputMode = $[9];
67
+ onChange = $[10];
68
+ onInput = $[11];
69
+ rest = $[12];
70
+ separator = $[13];
71
+ size = $[14];
72
+ status = $[15];
73
+ style = $[16];
74
+ t0 = $[17];
75
+ t1 = $[18];
76
+ t2 = $[19];
77
+ t3 = $[20];
78
+ value = $[21];
79
+ variant = $[22];
77
80
  }
78
81
  const defaultValue = void 0 === t0 ? "" : t0;
79
82
  const length = void 0 === t1 ? 6 : t1;
@@ -83,42 +86,42 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
83
86
  const ctx = useTaoConfig();
84
87
  const fieldChange = useContext(FormFieldChangeContext);
85
88
  let t4;
86
- if ($[22] !== formatter || $[23] !== length) {
89
+ if ($[23] !== formatter || $[24] !== length) {
87
90
  t4 = (text)=>Array.from(formatter ? formatter(text) : text).slice(0, length);
88
- $[22] = formatter;
89
- $[23] = length;
90
- $[24] = t4;
91
- } else t4 = $[24];
91
+ $[23] = formatter;
92
+ $[24] = length;
93
+ $[25] = t4;
94
+ } else t4 = $[25];
92
95
  const format = t4;
93
96
  let t5;
94
- if ($[25] !== format || $[26] !== props || $[27] !== value) {
97
+ if ($[26] !== format || $[27] !== props || $[28] !== value) {
95
98
  t5 = "value" in props ? format(value ?? "").join("") : void 0;
96
- $[25] = format;
97
- $[26] = props;
98
- $[27] = value;
99
- $[28] = t5;
100
- } else t5 = $[28];
99
+ $[26] = format;
100
+ $[27] = props;
101
+ $[28] = value;
102
+ $[29] = t5;
103
+ } else t5 = $[29];
101
104
  const formattedValue = t5;
102
105
  let t6;
103
- if ($[29] !== defaultValue || $[30] !== format || $[31] !== props || $[32] !== value) {
106
+ if ($[30] !== defaultValue || $[31] !== format || $[32] !== props || $[33] !== value) {
104
107
  t6 = ()=>format("value" in props ? value ?? "" : defaultValue);
105
- $[29] = defaultValue;
106
- $[30] = format;
107
- $[31] = props;
108
- $[32] = value;
109
- $[33] = t6;
110
- } else t6 = $[33];
108
+ $[30] = defaultValue;
109
+ $[31] = format;
110
+ $[32] = props;
111
+ $[33] = value;
112
+ $[34] = t6;
113
+ } else t6 = $[34];
111
114
  const [innerValue, setInnerValue] = useState(t6);
112
115
  let t7;
113
- if ($[34] !== formattedValue || $[35] !== value) {
116
+ if ($[35] !== formattedValue || $[36] !== value) {
114
117
  t7 = {
115
118
  value,
116
119
  formattedValue
117
120
  };
118
- $[34] = formattedValue;
119
- $[35] = value;
120
- $[36] = t7;
121
- } else t7 = $[36];
121
+ $[35] = formattedValue;
122
+ $[36] = value;
123
+ $[37] = t7;
124
+ } else t7 = $[37];
122
125
  const [previousValue, setPreviousValue] = useState(t7);
123
126
  const [draft, setDraft] = useState(null);
124
127
  if (previousValue.value !== value || previousValue.formattedValue !== formattedValue) {
@@ -131,16 +134,16 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
131
134
  }
132
135
  const cells = innerValue.slice(0, length);
133
136
  let t8;
134
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
137
+ if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
135
138
  t8 = [];
136
- $[37] = t8;
137
- } else t8 = $[37];
139
+ $[38] = t8;
140
+ } else t8 = $[38];
138
141
  const inputs = useRef(t8);
139
142
  const root = useRef(null);
140
143
  const composing = useRef(null);
141
144
  let t10;
142
145
  let t9;
143
- if ($[38] !== length) {
146
+ if ($[39] !== length) {
144
147
  t9 = ()=>{
145
148
  if (null !== composing.current && composing.current >= length) {
146
149
  composing.current = null;
@@ -150,52 +153,52 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
150
153
  t10 = [
151
154
  length
152
155
  ];
153
- $[38] = length;
154
- $[39] = t10;
155
- $[40] = t9;
156
+ $[39] = length;
157
+ $[40] = t10;
158
+ $[41] = t9;
156
159
  } else {
157
- t10 = $[39];
158
- t9 = $[40];
160
+ t10 = $[40];
161
+ t9 = $[41];
159
162
  }
160
163
  useEffect(t9, t10);
161
164
  let t11;
162
- if ($[41] !== customClassNames || $[42] !== props) {
165
+ if ($[42] !== customClassNames || $[43] !== props) {
163
166
  t11 = "function" == typeof customClassNames ? customClassNames({
164
167
  props
165
168
  }) : customClassNames;
166
- $[41] = customClassNames;
167
- $[42] = props;
168
- $[43] = t11;
169
- } else t11 = $[43];
169
+ $[42] = customClassNames;
170
+ $[43] = props;
171
+ $[44] = t11;
172
+ } else t11 = $[44];
170
173
  const classNames = t11;
171
174
  let t12;
172
- if ($[44] !== customStyles || $[45] !== props) {
175
+ if ($[45] !== customStyles || $[46] !== props) {
173
176
  t12 = "function" == typeof customStyles ? customStyles({
174
177
  props
175
178
  }) : customStyles;
176
- $[44] = customStyles;
177
- $[45] = props;
178
- $[46] = t12;
179
- } else t12 = $[46];
179
+ $[45] = customStyles;
180
+ $[46] = props;
181
+ $[47] = t12;
182
+ } else t12 = $[47];
180
183
  const styles = t12;
181
184
  let t13;
182
- if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
185
+ if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
183
186
  t13 = (index)=>{
184
187
  inputs.current[index]?.focus();
185
188
  inputs.current[index]?.select();
186
189
  };
187
- $[47] = t13;
188
- } else t13 = $[47];
190
+ $[48] = t13;
191
+ } else t13 = $[48];
189
192
  const focus = t13;
190
193
  let t14;
191
- if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
194
+ if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
192
195
  t14 = ()=>({
193
196
  focus: ()=>focus(0),
194
197
  blur: ()=>inputs.current.forEach(_temp),
195
198
  nativeElement: root.current
196
199
  });
197
- $[48] = t14;
198
- } else t14 = $[48];
200
+ $[49] = t14;
201
+ } else t14 = $[49];
199
202
  useImperativeHandle(ref, t14);
200
203
  const update = (index_0, text_0)=>{
201
204
  const chars = format(text_0);
@@ -227,23 +230,23 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
227
230
  const t16 = "";
228
231
  const t17 = classNames?.root;
229
232
  let t18;
230
- if ($[49] !== className || $[50] !== t17) {
233
+ if ($[50] !== className || $[51] !== t17) {
231
234
  t18 = cx(t17, className);
232
- $[49] = className;
233
- $[50] = t17;
234
- $[51] = t18;
235
- } else t18 = $[51];
235
+ $[50] = className;
236
+ $[51] = t17;
237
+ $[52] = t18;
238
+ } else t18 = $[52];
236
239
  const t19 = styles?.root;
237
240
  let t20;
238
- if ($[52] !== style || $[53] !== t19) {
241
+ if ($[53] !== style || $[54] !== t19) {
239
242
  t20 = {
240
243
  ...t19,
241
244
  ...style
242
245
  };
243
- $[52] = style;
244
- $[53] = t19;
245
- $[54] = t20;
246
- } else t20 = $[54];
246
+ $[53] = style;
247
+ $[54] = t19;
248
+ $[55] = t20;
249
+ } else t20 = $[55];
247
250
  const t21 = Array.from({
248
251
  length
249
252
  }, (__0, index_1)=>/*#__PURE__*/ jsxs(Fragment, {
@@ -268,6 +271,7 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
268
271
  "aria-label": ctx.locale.otpLabel?.(index_1 + 1, length) ?? `Character ${index_1 + 1} of ${length}`,
269
272
  "aria-describedby": rest["aria-describedby"],
270
273
  "aria-invalid": rest["aria-invalid"],
274
+ "aria-required": ariaRequired,
271
275
  classNames: {
272
276
  input: classNames?.input
273
277
  },
@@ -275,6 +279,12 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
275
279
  input: styles?.input
276
280
  },
277
281
  onFocus: _temp2,
282
+ onBlur: ()=>{
283
+ if (composing.current === index_1) {
284
+ composing.current = null;
285
+ setDraft(null);
286
+ }
287
+ },
278
288
  onChange: (event_0)=>{
279
289
  if (composing.current === index_1) setDraft({
280
290
  index: index_1,
@@ -326,7 +336,7 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
326
336
  ]
327
337
  }, `otp-${index_1}`));
328
338
  let t22;
329
- if ($[55] !== rest || $[56] !== t15 || $[57] !== t18 || $[58] !== t20 || $[59] !== t21) {
339
+ if ($[56] !== rest || $[57] !== t15 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21) {
330
340
  t22 = /*#__PURE__*/ jsx("div", {
331
341
  ...rest,
332
342
  ref: root,
@@ -336,13 +346,13 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
336
346
  style: t20,
337
347
  children: t21
338
348
  });
339
- $[55] = rest;
340
- $[56] = t15;
341
- $[57] = t18;
342
- $[58] = t20;
343
- $[59] = t21;
344
- $[60] = t22;
345
- } else t22 = $[60];
349
+ $[56] = rest;
350
+ $[57] = t15;
351
+ $[58] = t18;
352
+ $[59] = t20;
353
+ $[60] = t21;
354
+ $[61] = t22;
355
+ } else t22 = $[61];
346
356
  return t22;
347
357
  });
348
358
  function _temp(input) {
@@ -4,7 +4,7 @@ import { forwardRef, useState } from "react";
4
4
  import { useTaoConfig } from "../../provider/tao-provider.js";
5
5
  import { BaseInput } from "./base-input.js";
6
6
  const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
7
- const $ = c(24);
7
+ const $ = c(22);
8
8
  let disabled;
9
9
  let iconRender;
10
10
  let props;
@@ -40,77 +40,71 @@ const password_Password = /*#__PURE__*/ forwardRef(function(t0, ref) {
40
40
  const resolvedDisabled = disabled ?? ctx.disabled;
41
41
  const t3 = visible ? "text" : "password";
42
42
  let t4;
43
- if ($[8] !== config || $[9] !== ctx || $[10] !== iconRender || $[11] !== resolvedDisabled || $[12] !== visibilityToggle || $[13] !== visible) {
44
- t4 = visibilityToggle && /*#__PURE__*/ jsx("button", {
45
- type: "button",
46
- "data-tao-input-action": "",
47
- "aria-label": visible ? ctx.locale.hidePassword ?? "Hide password" : ctx.locale.showPassword ?? "Show password",
48
- "aria-pressed": visible,
49
- tabIndex: config.tabIndex,
50
- disabled: resolvedDisabled,
51
- onMouseDown: _temp,
52
- onClick: ()=>{
53
- if (void 0 === config.visible) setVisible(!visible);
54
- config.onVisibleChange?.(!visible);
55
- },
56
- children: iconRender ? iconRender(visible) : /*#__PURE__*/ jsxs("svg", {
57
- viewBox: "0 0 24 24",
58
- fill: "none",
59
- stroke: "currentColor",
60
- strokeWidth: "1.8",
61
- "aria-hidden": "true",
62
- children: [
63
- /*#__PURE__*/ jsx("path", {
64
- d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z"
65
- }),
66
- /*#__PURE__*/ jsx("circle", {
67
- cx: "12",
68
- cy: "12",
69
- r: "3"
70
- }),
71
- !visible && /*#__PURE__*/ jsx("path", {
72
- d: "m3 3 18 18"
43
+ if ($[8] !== config || $[9] !== ctx || $[10] !== iconRender || $[11] !== resolvedDisabled || $[12] !== suffix || $[13] !== visibilityToggle || $[14] !== visible) {
44
+ t4 = visibilityToggle ? /*#__PURE__*/ jsxs(Fragment, {
45
+ children: [
46
+ suffix,
47
+ /*#__PURE__*/ jsx("button", {
48
+ type: "button",
49
+ "data-tao-input-action": "",
50
+ "aria-label": visible ? ctx.locale.hidePassword ?? "Hide password" : ctx.locale.showPassword ?? "Show password",
51
+ "aria-pressed": visible,
52
+ tabIndex: config.tabIndex,
53
+ disabled: resolvedDisabled,
54
+ onMouseDown: _temp,
55
+ onClick: ()=>{
56
+ if (void 0 === config.visible) setVisible(!visible);
57
+ config.onVisibleChange?.(!visible);
58
+ },
59
+ children: iconRender ? iconRender(visible) : /*#__PURE__*/ jsxs("svg", {
60
+ viewBox: "0 0 24 24",
61
+ fill: "none",
62
+ stroke: "currentColor",
63
+ strokeWidth: "1.8",
64
+ "aria-hidden": "true",
65
+ children: [
66
+ /*#__PURE__*/ jsx("path", {
67
+ d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7S2 12 2 12Z"
68
+ }),
69
+ /*#__PURE__*/ jsx("circle", {
70
+ cx: "12",
71
+ cy: "12",
72
+ r: "3"
73
+ }),
74
+ !visible && /*#__PURE__*/ jsx("path", {
75
+ d: "m3 3 18 18"
76
+ })
77
+ ]
73
78
  })
74
- ]
75
- })
76
- });
79
+ })
80
+ ]
81
+ }) : suffix;
77
82
  $[8] = config;
78
83
  $[9] = ctx;
79
84
  $[10] = iconRender;
80
85
  $[11] = resolvedDisabled;
81
- $[12] = visibilityToggle;
82
- $[13] = visible;
83
- $[14] = t4;
84
- } else t4 = $[14];
86
+ $[12] = suffix;
87
+ $[13] = visibilityToggle;
88
+ $[14] = visible;
89
+ $[15] = t4;
90
+ } else t4 = $[15];
85
91
  let t5;
86
- if ($[15] !== suffix || $[16] !== t4) {
87
- t5 = /*#__PURE__*/ jsxs(Fragment, {
88
- children: [
89
- suffix,
90
- t4
91
- ]
92
- });
93
- $[15] = suffix;
94
- $[16] = t4;
95
- $[17] = t5;
96
- } else t5 = $[17];
97
- let t6;
98
- if ($[18] !== props || $[19] !== ref || $[20] !== resolvedDisabled || $[21] !== t3 || $[22] !== t5) {
99
- t6 = /*#__PURE__*/ jsx(BaseInput, {
92
+ if ($[16] !== props || $[17] !== ref || $[18] !== resolvedDisabled || $[19] !== t3 || $[20] !== t4) {
93
+ t5 = /*#__PURE__*/ jsx(BaseInput, {
100
94
  ...props,
101
95
  disabled: resolvedDisabled,
102
96
  ref: ref,
103
97
  type: t3,
104
- suffix: t5
98
+ suffix: t4
105
99
  });
106
- $[18] = props;
107
- $[19] = ref;
108
- $[20] = resolvedDisabled;
109
- $[21] = t3;
110
- $[22] = t5;
111
- $[23] = t6;
112
- } else t6 = $[23];
113
- return t6;
100
+ $[16] = props;
101
+ $[17] = ref;
102
+ $[18] = resolvedDisabled;
103
+ $[19] = t3;
104
+ $[20] = t4;
105
+ $[21] = t5;
106
+ } else t5 = $[21];
107
+ return t5;
114
108
  });
115
109
  function _temp(event) {
116
110
  return event.preventDefault();
@@ -19,16 +19,22 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
19
19
  }) : customStyles;
20
20
  const customButton = /*#__PURE__*/ isValidElement(enterButton) && ('button' === enterButton.type || enterButton.type === Button);
21
21
  const isLoading = loading || customButton && enterButton.type === Button && enterButton.props.loading;
22
+ const submitDisabled = disabled || isLoading || customButton && enterButton.props.disabled;
22
23
  const search = (event)=>{
23
- if (!disabled && !isLoading && !event.defaultPrevented) onSearch?.(inputRef.current.value, event, {
24
+ const input = inputRef.current;
25
+ if (input && !submitDisabled && !event.defaultPrevented) onSearch?.(input.value, event, {
24
26
  source: 'input'
25
27
  });
26
28
  };
29
+ const searchLabel = ctx.locale.search ?? 'Search';
30
+ const hasButtonContent = 0 === enterButton || Boolean(enterButton);
31
+ const iconOnly = true === enterButton || !hasButtonContent;
27
32
  const buttonProps = {
28
33
  type: 'button',
29
- disabled: disabled || isLoading,
34
+ disabled: submitDisabled,
30
35
  'aria-busy': isLoading || void 0,
31
- 'aria-label': ctx.locale.search ?? 'Search',
36
+ 'aria-label': iconOnly ? searchLabel : void 0,
37
+ title: iconOnly ? void 0 : searchLabel,
32
38
  className: classNames?.button,
33
39
  style: styles?.button,
34
40
  onMouseDown: (event_0)=>event_0.preventDefault(),
@@ -41,8 +47,8 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
41
47
  ...enterButton.props.style,
42
48
  ...styles?.button
43
49
  },
44
- 'aria-label': enterButton.props['aria-label'] ?? buttonProps['aria-label'],
45
- disabled: buttonProps.disabled || enterButton.props.disabled,
50
+ 'aria-label': enterButton.props['aria-label'],
51
+ title: enterButton.props.title ?? searchLabel,
46
52
  ...enterButton.type === Button ? {
47
53
  loading: isLoading,
48
54
  size: props.size ?? enterButton.props.size
@@ -59,8 +65,8 @@ const search_Search = /*#__PURE__*/ forwardRef(function(props, ref) {
59
65
  ...buttonProps,
60
66
  loading: isLoading,
61
67
  size: props.size,
62
- variant: enterButton ? 'primary' : 'secondary',
63
- children: true !== enterButton && enterButton ? enterButton : searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {})
68
+ variant: hasButtonContent ? 'primary' : 'secondary',
69
+ children: iconOnly ? searchIcon ?? /*#__PURE__*/ jsx(SearchIcon, {}) : enterButton
64
70
  });
65
71
  return /*#__PURE__*/ jsxs("div", {
66
72
  "data-tao-input-search": "",