@rockshin/tao-ui 0.0.58 → 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 (93) 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 +105 -47
  4. package/dist/components/auto-complete/auto-complete.js +9 -2
  5. package/dist/components/calendar/calendar.js +22 -18
  6. package/dist/components/carousel/carousel.js +27 -14
  7. package/dist/components/cascader/cascader.js +17 -12
  8. package/dist/components/checkbox/checkbox.d.ts +3 -1
  9. package/dist/components/checkbox/checkbox.js +65 -58
  10. package/dist/components/color-picker/color-picker.js +383 -360
  11. package/dist/components/date-picker/calendar/calendar-grid.d.ts +5 -3
  12. package/dist/components/date-picker/calendar/calendar-grid.js +9 -4
  13. package/dist/components/date-picker/calendar/month-grid.d.ts +2 -1
  14. package/dist/components/date-picker/calendar/month-grid.js +61 -45
  15. package/dist/components/date-picker/calendar/time-panel.d.ts +8 -1
  16. package/dist/components/date-picker/calendar/time-panel.js +89 -88
  17. package/dist/components/date-picker/calendar/year-grid.d.ts +2 -1
  18. package/dist/components/date-picker/calendar/year-grid.js +60 -44
  19. package/dist/components/date-picker/date-picker.css +9 -0
  20. package/dist/components/date-picker/date-picker.js +22 -13
  21. package/dist/components/date-picker/range-picker.d.ts +2 -0
  22. package/dist/components/date-picker/range-picker.js +127 -70
  23. package/dist/components/date-picker/types.js +1 -1
  24. package/dist/components/drawer/drawer.d.ts +1 -1
  25. package/dist/components/drawer/drawer.js +4 -3
  26. package/dist/components/dropdown/dropdown.js +11 -9
  27. package/dist/components/float-button/float-button.js +4 -4
  28. package/dist/components/form/form-item.d.ts +1 -1
  29. package/dist/components/form/form-item.js +160 -120
  30. package/dist/components/form-field/form-field-view.d.ts +2 -1
  31. package/dist/components/form-field/form-field-view.js +173 -108
  32. package/dist/components/input/input-shared.js +3 -2
  33. package/dist/components/input/otp.js +114 -110
  34. package/dist/components/input/password.js +55 -61
  35. package/dist/components/input/search.js +8 -4
  36. package/dist/components/mentions/mentions.js +1 -0
  37. package/dist/components/menu/menu-render.js +1 -0
  38. package/dist/components/modal/confirm-dialog.js +11 -4
  39. package/dist/components/modal/modal.js +320 -315
  40. package/dist/components/pagination/pagination.d.ts +1 -0
  41. package/dist/components/pagination/pagination.js +1 -0
  42. package/dist/components/popover/popover.js +325 -289
  43. package/dist/components/qr-code/qr-code.js +157 -150
  44. package/dist/components/radio/radio.d.ts +3 -1
  45. package/dist/components/radio/radio.js +73 -64
  46. package/dist/components/select/mobile-select.js +6 -3
  47. package/dist/components/select/select-model.js +2 -2
  48. package/dist/components/select/select.js +78 -39
  49. package/dist/components/select/use-select-selection.js +58 -58
  50. package/dist/components/slider/slider.d.ts +2 -2
  51. package/dist/components/slider/slider.js +13 -2
  52. package/dist/components/sonner/sonner.js +2 -2
  53. package/dist/components/splitter/splitter.css +1 -0
  54. package/dist/components/splitter/splitter.js +152 -126
  55. package/dist/components/switch/switch.js +45 -39
  56. package/dist/components/table/table.js +1 -0
  57. package/dist/components/table/use-table-data.js +2 -2
  58. package/dist/components/time-picker/time-picker.js +31 -1
  59. package/dist/components/tooltip/tooltip.js +237 -99
  60. package/dist/components/tree/tree.js +31 -3
  61. package/dist/components/tree-select/tree-select.js +1 -1
  62. package/dist/components/upload/upload.js +67 -40
  63. package/dist/locales/ar-EG.js +2 -0
  64. package/dist/locales/de-DE.js +2 -0
  65. package/dist/locales/en-US.js +2 -0
  66. package/dist/locales/es-ES.js +2 -0
  67. package/dist/locales/fr-FR.js +2 -0
  68. package/dist/locales/hi-IN.js +2 -0
  69. package/dist/locales/id-ID.js +2 -0
  70. package/dist/locales/it-IT.js +2 -0
  71. package/dist/locales/ja-JP.js +2 -0
  72. package/dist/locales/ko-KR.js +2 -0
  73. package/dist/locales/pt-BR.js +2 -0
  74. package/dist/locales/ru-RU.js +2 -0
  75. package/dist/locales/th-TH.js +2 -0
  76. package/dist/locales/tr-TR.js +2 -0
  77. package/dist/locales/types.d.ts +2 -0
  78. package/dist/locales/vi-VN.js +2 -0
  79. package/dist/locales/zh-CN.js +2 -0
  80. package/dist/locales/zh-TW.js +2 -0
  81. package/dist/number-input/format.js +1 -1
  82. package/dist/number-input/use-number-input.js +166 -321
  83. package/dist/number-input/validate.d.ts +1 -0
  84. package/dist/number-input/validate.js +1 -1
  85. package/dist/provider/tao-provider.d.ts +2 -2
  86. package/dist/provider/tao-provider.js +49 -49
  87. package/dist/utils/composed-parent.d.ts +1 -0
  88. package/dist/utils/composed-parent.js +7 -0
  89. package/dist/utils/portal.d.ts +5 -0
  90. package/dist/utils/portal.js +7 -1
  91. package/dist/utils/refs.d.ts +3 -1
  92. package/dist/utils/refs.js +25 -1
  93. package/package.json +1 -1
@@ -6,8 +6,8 @@ import { cx } from "../../utils/semantic.js";
6
6
  import "./form.css";
7
7
  const hasContent = (value)=>null != value && '' !== value && 'boolean' != typeof value;
8
8
  function FormFieldView(t0) {
9
- const $ = c(78);
10
- const { formItem, reserveMessage, label, htmlFor, required, error, invalid, warning, description, extra, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = t0;
9
+ const $ = c(108);
10
+ const { formItem, reserveMessage, label, htmlFor, required, error, nestedErrors, invalid, warning, description, extra, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = t0;
11
11
  const layout = void 0 === t1 ? "vertical" : t1;
12
12
  const generatedId = useId();
13
13
  const child = /*#__PURE__*/ isValidElement(children) && children.type !== Fragment ? children : null;
@@ -125,127 +125,192 @@ function FormFieldView(t0) {
125
125
  $[38] = t11;
126
126
  } else t11 = $[38];
127
127
  const message = t11;
128
- const hasMessage = formItem && (reserveMessage || null !== message || hasExtra);
129
- const t12 = classNames?.root;
128
+ let t12;
130
129
  let t13;
131
- if ($[39] !== className || $[40] !== t12) {
132
- t13 = cx(t12, className);
133
- $[39] = className;
134
- $[40] = t12;
135
- $[41] = t13;
136
- } else t13 = $[41];
137
- const t14 = styles?.root;
130
+ let t14;
138
131
  let t15;
139
- if ($[42] !== style || $[43] !== t14) {
140
- t15 = {
141
- ...t14,
142
- ...style
143
- };
144
- $[42] = style;
145
- $[43] = t14;
146
- $[44] = t15;
147
- } else t15 = $[44];
148
- const t16 = formItem ? "" : void 0;
149
- const t17 = hasMessage ? "" : void 0;
150
- const t18 = "horizontal" === layout ? "horizontal" : void 0;
132
+ let t16;
133
+ let t17;
134
+ let t18;
151
135
  let t19;
152
- if ($[45] !== classNames?.label || $[46] !== controlId || $[47] !== hasLabel || $[48] !== label || $[49] !== labelId || $[50] !== required || $[51] !== styles?.label) {
153
- t19 = hasLabel && /*#__PURE__*/ jsxs("label", {
154
- id: labelId,
155
- htmlFor: controlId,
156
- className: classNames?.label,
157
- style: styles?.label,
158
- "data-tao-form-label": "",
159
- children: [
160
- label,
161
- required && /*#__PURE__*/ jsx("span", {
162
- "data-tao-required": "",
163
- "aria-hidden": "true",
164
- children: "*"
165
- })
166
- ]
167
- });
168
- $[45] = classNames?.label;
169
- $[46] = controlId;
170
- $[47] = hasLabel;
171
- $[48] = label;
172
- $[49] = labelId;
173
- $[50] = required;
174
- $[51] = styles?.label;
175
- $[52] = t19;
176
- } else t19 = $[52];
177
- const t20 = hasLabel ? label : void 0;
136
+ let t20;
178
137
  let t21;
179
- if ($[53] !== child || $[54] !== control || $[55] !== renderControl) {
180
- t21 = renderControl && child && /*#__PURE__*/ isValidElement(control) ? renderControl(control) : control;
181
- $[53] = child;
182
- $[54] = control;
183
- $[55] = renderControl;
184
- $[56] = t21;
185
- } else t21 = $[56];
186
- let t22;
187
- if ($[57] !== t20 || $[58] !== t21) {
188
- t22 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
189
- value: t20,
190
- children: t21
191
- });
192
- $[57] = t20;
193
- $[58] = t21;
194
- $[59] = t22;
195
- } else t22 = $[59];
196
- let t23;
197
- if ($[60] !== descriptionMessage || $[61] !== extra || $[62] !== extraId || $[63] !== hasExtra || $[64] !== hasMessage || $[65] !== message) {
198
- t23 = hasMessage ? /*#__PURE__*/ jsxs("div", {
138
+ if ($[39] !== child || $[40] !== className || $[41] !== classNames?.error || $[42] !== classNames?.label || $[43] !== classNames?.root || $[44] !== control || $[45] !== controlId || $[46] !== descriptionMessage || $[47] !== extra || $[48] !== extraId || $[49] !== formItem || $[50] !== hasExtra || $[51] !== hasLabel || $[52] !== label || $[53] !== labelId || $[54] !== layout || $[55] !== message || $[56] !== nestedErrors || $[57] !== renderControl || $[58] !== required || $[59] !== reserveMessage || $[60] !== style || $[61] !== styles?.error || $[62] !== styles?.label || $[63] !== styles?.root) {
139
+ const childErrors = Object.entries(nestedErrors ?? {});
140
+ const hasMessage = formItem && (reserveMessage || null !== message || hasExtra || childErrors.length > 0);
141
+ const t22 = classNames?.root;
142
+ if ($[74] !== className || $[75] !== t22) {
143
+ t15 = cx(t22, className);
144
+ $[74] = className;
145
+ $[75] = t22;
146
+ $[76] = t15;
147
+ } else t15 = $[76];
148
+ const t23 = styles?.root;
149
+ if ($[77] !== style || $[78] !== t23) {
150
+ t16 = {
151
+ ...t23,
152
+ ...style
153
+ };
154
+ $[77] = style;
155
+ $[78] = t23;
156
+ $[79] = t16;
157
+ } else t16 = $[79];
158
+ t17 = "";
159
+ t18 = formItem ? "" : void 0;
160
+ t19 = hasMessage ? "" : void 0;
161
+ t20 = "horizontal" === layout ? "horizontal" : void 0;
162
+ if ($[80] !== classNames?.label || $[81] !== controlId || $[82] !== hasLabel || $[83] !== label || $[84] !== labelId || $[85] !== required || $[86] !== styles?.label) {
163
+ t21 = hasLabel && /*#__PURE__*/ jsxs("label", {
164
+ id: labelId,
165
+ htmlFor: controlId,
166
+ className: classNames?.label,
167
+ style: styles?.label,
168
+ "data-tao-form-label": "",
169
+ children: [
170
+ label,
171
+ required && /*#__PURE__*/ jsx("span", {
172
+ "data-tao-required": "",
173
+ "aria-hidden": "true",
174
+ children: "*"
175
+ })
176
+ ]
177
+ });
178
+ $[80] = classNames?.label;
179
+ $[81] = controlId;
180
+ $[82] = hasLabel;
181
+ $[83] = label;
182
+ $[84] = labelId;
183
+ $[85] = required;
184
+ $[86] = styles?.label;
185
+ $[87] = t21;
186
+ } else t21 = $[87];
187
+ t12 = "";
188
+ const t24 = hasLabel ? label : void 0;
189
+ let t25;
190
+ if ($[88] !== child || $[89] !== control || $[90] !== renderControl) {
191
+ t25 = renderControl && child && /*#__PURE__*/ isValidElement(control) ? renderControl(control) : control;
192
+ $[88] = child;
193
+ $[89] = control;
194
+ $[90] = renderControl;
195
+ $[91] = t25;
196
+ } else t25 = $[91];
197
+ if ($[92] !== t24 || $[93] !== t25) {
198
+ t13 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
199
+ value: t24,
200
+ children: t25
201
+ });
202
+ $[92] = t24;
203
+ $[93] = t25;
204
+ $[94] = t13;
205
+ } else t13 = $[94];
206
+ t14 = hasMessage ? /*#__PURE__*/ jsxs("div", {
199
207
  "data-tao-form-message": "",
200
208
  children: [
201
209
  message,
210
+ childErrors.map((t26)=>{
211
+ const [id_0, errors] = t26;
212
+ return /*#__PURE__*/ jsx("div", {
213
+ id: id_0,
214
+ role: "alert",
215
+ className: classNames?.error,
216
+ style: styles?.error,
217
+ "data-tao-form-error": "",
218
+ children: errors.map(_temp)
219
+ }, id_0);
220
+ }),
202
221
  hasExtra && descriptionMessage(extraId, extra)
203
222
  ]
204
223
  }) : message;
205
- $[60] = descriptionMessage;
206
- $[61] = extra;
207
- $[62] = extraId;
208
- $[63] = hasExtra;
209
- $[64] = hasMessage;
210
- $[65] = message;
211
- $[66] = t23;
212
- } else t23 = $[66];
213
- let t24;
214
- if ($[67] !== t22 || $[68] !== t23) {
215
- t24 = /*#__PURE__*/ jsxs("div", {
216
- "data-tao-form-control": "",
224
+ $[39] = child;
225
+ $[40] = className;
226
+ $[41] = classNames?.error;
227
+ $[42] = classNames?.label;
228
+ $[43] = classNames?.root;
229
+ $[44] = control;
230
+ $[45] = controlId;
231
+ $[46] = descriptionMessage;
232
+ $[47] = extra;
233
+ $[48] = extraId;
234
+ $[49] = formItem;
235
+ $[50] = hasExtra;
236
+ $[51] = hasLabel;
237
+ $[52] = label;
238
+ $[53] = labelId;
239
+ $[54] = layout;
240
+ $[55] = message;
241
+ $[56] = nestedErrors;
242
+ $[57] = renderControl;
243
+ $[58] = required;
244
+ $[59] = reserveMessage;
245
+ $[60] = style;
246
+ $[61] = styles?.error;
247
+ $[62] = styles?.label;
248
+ $[63] = styles?.root;
249
+ $[64] = t12;
250
+ $[65] = t13;
251
+ $[66] = t14;
252
+ $[67] = t15;
253
+ $[68] = t16;
254
+ $[69] = t17;
255
+ $[70] = t18;
256
+ $[71] = t19;
257
+ $[72] = t20;
258
+ $[73] = t21;
259
+ } else {
260
+ t12 = $[64];
261
+ t13 = $[65];
262
+ t14 = $[66];
263
+ t15 = $[67];
264
+ t16 = $[68];
265
+ t17 = $[69];
266
+ t18 = $[70];
267
+ t19 = $[71];
268
+ t20 = $[72];
269
+ t21 = $[73];
270
+ }
271
+ let t22;
272
+ if ($[95] !== t12 || $[96] !== t13 || $[97] !== t14) {
273
+ t22 = /*#__PURE__*/ jsxs("div", {
274
+ "data-tao-form-control": t12,
217
275
  children: [
218
- t22,
219
- t23
276
+ t13,
277
+ t14
220
278
  ]
221
279
  });
222
- $[67] = t22;
223
- $[68] = t23;
224
- $[69] = t24;
225
- } else t24 = $[69];
226
- let t25;
227
- if ($[70] !== t13 || $[71] !== t15 || $[72] !== t16 || $[73] !== t17 || $[74] !== t18 || $[75] !== t19 || $[76] !== t24) {
228
- t25 = /*#__PURE__*/ jsxs("div", {
229
- className: t13,
230
- style: t15,
231
- "data-tao-form-field": "",
232
- "data-tao-form-item": t16,
233
- "data-tao-form-feedback": t17,
234
- "data-tao-layout": t18,
280
+ $[95] = t12;
281
+ $[96] = t13;
282
+ $[97] = t14;
283
+ $[98] = t22;
284
+ } else t22 = $[98];
285
+ let t23;
286
+ if ($[99] !== t15 || $[100] !== t16 || $[101] !== t17 || $[102] !== t18 || $[103] !== t19 || $[104] !== t20 || $[105] !== t21 || $[106] !== t22) {
287
+ t23 = /*#__PURE__*/ jsxs("div", {
288
+ className: t15,
289
+ style: t16,
290
+ "data-tao-form-field": t17,
291
+ "data-tao-form-item": t18,
292
+ "data-tao-form-feedback": t19,
293
+ "data-tao-layout": t20,
235
294
  children: [
236
- t19,
237
- t24
295
+ t21,
296
+ t22
238
297
  ]
239
298
  });
240
- $[70] = t13;
241
- $[71] = t15;
242
- $[72] = t16;
243
- $[73] = t17;
244
- $[74] = t18;
245
- $[75] = t19;
246
- $[76] = t24;
247
- $[77] = t25;
248
- } else t25 = $[77];
249
- return t25;
299
+ $[99] = t15;
300
+ $[100] = t16;
301
+ $[101] = t17;
302
+ $[102] = t18;
303
+ $[103] = t19;
304
+ $[104] = t20;
305
+ $[105] = t21;
306
+ $[106] = t22;
307
+ $[107] = t23;
308
+ } else t23 = $[107];
309
+ return t23;
310
+ }
311
+ function _temp(error_0) {
312
+ return /*#__PURE__*/ jsx("div", {
313
+ children: error_0
314
+ }, error_0);
250
315
  }
251
316
  export { FormFieldView };
@@ -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
  },
@@ -332,7 +336,7 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
332
336
  ]
333
337
  }, `otp-${index_1}`));
334
338
  let t22;
335
- if ($[55] !== rest || $[56] !== t15 || $[57] !== t18 || $[58] !== t20 || $[59] !== t21) {
339
+ if ($[56] !== rest || $[57] !== t15 || $[58] !== t18 || $[59] !== t20 || $[60] !== t21) {
336
340
  t22 = /*#__PURE__*/ jsx("div", {
337
341
  ...rest,
338
342
  ref: root,
@@ -342,13 +346,13 @@ const otp_OTP = /*#__PURE__*/ forwardRef(function(props, ref) {
342
346
  style: t20,
343
347
  children: t21
344
348
  });
345
- $[55] = rest;
346
- $[56] = t15;
347
- $[57] = t18;
348
- $[58] = t20;
349
- $[59] = t21;
350
- $[60] = t22;
351
- } 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];
352
356
  return t22;
353
357
  });
354
358
  function _temp(input) {