@rockshin/tao-ui 0.0.31 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +14 -3
  2. package/dist/components/alert/alert.js +1 -1
  3. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  4. package/dist/components/button/button.d.ts +2 -2
  5. package/dist/components/button/button.js +48 -50
  6. package/dist/components/checkbox/checkbox.css +5 -1
  7. package/dist/components/checkbox/checkbox.d.ts +2 -2
  8. package/dist/components/checkbox/checkbox.js +135 -120
  9. package/dist/components/collapsible/collapsible.js +1 -1
  10. package/dist/components/context-menu/context-menu.js +1 -1
  11. package/dist/components/date-picker/calendar/calendar-header.js +1 -1
  12. package/dist/components/date-picker/calendar/month-grid.d.ts +3 -1
  13. package/dist/components/date-picker/calendar/month-grid.js +19 -17
  14. package/dist/components/date-picker/calendar/time-panel.js +1 -1
  15. package/dist/components/date-picker/calendar/year-grid.d.ts +3 -1
  16. package/dist/components/date-picker/calendar/year-grid.js +28 -24
  17. package/dist/components/date-picker/date-picker.d.ts +1 -1
  18. package/dist/components/date-picker/date-picker.js +37 -24
  19. package/dist/components/date-picker/presets.js +1 -1
  20. package/dist/components/date-picker/range-picker.d.ts +1 -1
  21. package/dist/components/date-picker/range-picker.js +104 -56
  22. package/dist/components/drawer/drawer.d.ts +1 -1
  23. package/dist/components/drawer/drawer.js +98 -91
  24. package/dist/components/dropdown/dropdown.js +84 -84
  25. package/dist/components/form/form-item.js +8 -4
  26. package/dist/components/form/form.js +1 -1
  27. package/dist/components/form-actions/form-actions.js +1 -1
  28. package/dist/components/form-field/form-field-view.js +58 -51
  29. package/dist/components/form-field/form-field.js +1 -1
  30. package/dist/components/form-section/form-section.js +1 -1
  31. package/dist/components/input/input.js +42 -39
  32. package/dist/components/input-number/input-number.d.ts +2 -2
  33. package/dist/components/input-number/input-number.js +57 -59
  34. package/dist/components/menu/menu-render.js +1 -1
  35. package/dist/components/modal/confirm-dialog.d.ts +2 -1
  36. package/dist/components/modal/confirm-dialog.js +25 -5
  37. package/dist/components/modal/confirm.js +15 -3
  38. package/dist/components/modal/modal.d.ts +1 -1
  39. package/dist/components/modal/modal.js +131 -132
  40. package/dist/components/modal/use-modal.js +48 -35
  41. package/dist/components/pagination/pagination.js +3 -1
  42. package/dist/components/popconfirm/popconfirm.js +1 -1
  43. package/dist/components/popover/popover.js +253 -228
  44. package/dist/components/radio/radio.css +2 -2
  45. package/dist/components/radio/radio.d.ts +1 -1
  46. package/dist/components/radio/radio.js +7 -7
  47. package/dist/components/scroll-area/scroll-area.css +2 -2
  48. package/dist/components/scroll-area/scroll-area.js +187 -165
  49. package/dist/components/select/mobile-select.d.ts +2 -1
  50. package/dist/components/select/mobile-select.js +12 -6
  51. package/dist/components/select/select-icons.js +1 -1
  52. package/dist/components/select/select-searchable-list.d.ts +1 -1
  53. package/dist/components/select/select-searchable-list.js +35 -21
  54. package/dist/components/select/select-tags.js +1 -1
  55. package/dist/components/select/select-types.d.ts +2 -2
  56. package/dist/components/select/select.css +4 -0
  57. package/dist/components/select/select.d.ts +2 -2
  58. package/dist/components/select/select.js +127 -73
  59. package/dist/components/sonner/sonner.js +6 -5
  60. package/dist/components/spinner/spinner.js +1 -1
  61. package/dist/components/splitter/splitter.js +187 -194
  62. package/dist/components/status-icon/status-icon.js +1 -1
  63. package/dist/components/switch/switch.d.ts +1 -1
  64. package/dist/components/switch/switch.js +6 -6
  65. package/dist/components/table/table-filter.js +1 -1
  66. package/dist/components/table/table-icons.js +1 -1
  67. package/dist/components/table/table.js +483 -599
  68. package/dist/components/tabs/tabs.js +179 -161
  69. package/dist/components/tag/tag.js +1 -1
  70. package/dist/components/textarea/textarea.d.ts +1 -1
  71. package/dist/components/textarea/textarea.js +142 -108
  72. package/dist/components/tooltip/tooltip.js +88 -72
  73. package/dist/entries/alert.d.ts +3 -0
  74. package/dist/entries/alert.js +4 -0
  75. package/dist/entries/breadcrumb.d.ts +3 -0
  76. package/dist/entries/breadcrumb.js +4 -0
  77. package/dist/entries/button.d.ts +3 -0
  78. package/dist/entries/button.js +4 -0
  79. package/dist/entries/checkbox.d.ts +3 -0
  80. package/dist/entries/checkbox.js +4 -0
  81. package/dist/entries/collapsible.d.ts +3 -0
  82. package/dist/entries/collapsible.js +4 -0
  83. package/dist/entries/context-menu.d.ts +3 -0
  84. package/dist/entries/context-menu.js +4 -0
  85. package/dist/entries/date-picker.d.ts +3 -0
  86. package/dist/entries/date-picker.js +4 -0
  87. package/dist/entries/drawer.d.ts +3 -0
  88. package/dist/entries/drawer.js +4 -0
  89. package/dist/entries/dropdown.d.ts +3 -0
  90. package/dist/entries/dropdown.js +4 -0
  91. package/dist/entries/form-actions.d.ts +3 -0
  92. package/dist/entries/form-actions.js +4 -0
  93. package/dist/entries/form-field.d.ts +3 -0
  94. package/dist/entries/form-field.js +4 -0
  95. package/dist/entries/form-layout.d.ts +3 -0
  96. package/dist/entries/form-layout.js +4 -0
  97. package/dist/entries/form-section.d.ts +3 -0
  98. package/dist/entries/form-section.js +4 -0
  99. package/dist/entries/form.d.ts +4 -0
  100. package/dist/entries/form.js +4 -0
  101. package/dist/entries/input-number.d.ts +3 -0
  102. package/dist/entries/input-number.js +4 -0
  103. package/dist/entries/input.d.ts +3 -0
  104. package/dist/entries/input.js +4 -0
  105. package/dist/entries/modal.d.ts +3 -0
  106. package/dist/entries/modal.js +4 -0
  107. package/dist/entries/number-input.d.ts +3 -0
  108. package/dist/entries/number-input.js +4 -0
  109. package/dist/entries/pagination.d.ts +3 -0
  110. package/dist/entries/pagination.js +4 -0
  111. package/dist/entries/popconfirm.d.ts +3 -0
  112. package/dist/entries/popconfirm.js +4 -0
  113. package/dist/entries/popover.d.ts +3 -0
  114. package/dist/entries/popover.js +4 -0
  115. package/dist/entries/provider.d.ts +3 -0
  116. package/dist/entries/provider.js +4 -0
  117. package/dist/entries/radio.d.ts +3 -0
  118. package/dist/entries/radio.js +4 -0
  119. package/dist/entries/range-picker.d.ts +3 -0
  120. package/dist/entries/range-picker.js +4 -0
  121. package/dist/entries/scroll-area.d.ts +3 -0
  122. package/dist/entries/scroll-area.js +4 -0
  123. package/dist/entries/select.d.ts +3 -0
  124. package/dist/entries/select.js +4 -0
  125. package/dist/entries/sonner.d.ts +3 -0
  126. package/dist/entries/sonner.js +4 -0
  127. package/dist/entries/spinner.d.ts +3 -0
  128. package/dist/entries/spinner.js +4 -0
  129. package/dist/entries/splitter.d.ts +3 -0
  130. package/dist/entries/splitter.js +4 -0
  131. package/dist/entries/stack.d.ts +3 -0
  132. package/dist/entries/stack.js +4 -0
  133. package/dist/entries/switch.d.ts +3 -0
  134. package/dist/entries/switch.js +4 -0
  135. package/dist/entries/table.d.ts +3 -0
  136. package/dist/entries/table.js +4 -0
  137. package/dist/entries/tabs.d.ts +3 -0
  138. package/dist/entries/tabs.js +4 -0
  139. package/dist/entries/tag.d.ts +3 -0
  140. package/dist/entries/tag.js +4 -0
  141. package/dist/entries/textarea.d.ts +3 -0
  142. package/dist/entries/textarea.js +4 -0
  143. package/dist/entries/tooltip.d.ts +3 -0
  144. package/dist/entries/tooltip.js +4 -0
  145. package/dist/layouts/form-layout/form-layout.js +1 -1
  146. package/dist/layouts/stack/stack.js +1 -1
  147. package/dist/number-input/number-input.js +1 -1
  148. package/dist/number-input/use-number-input.d.ts +2 -2
  149. package/dist/number-input/use-number-input.js +224 -131
  150. package/dist/number-input/validate.js +7 -2
  151. package/dist/provider/tao-provider.js +1 -1
  152. package/dist/utils/dialog-content.d.ts +10 -0
  153. package/dist/utils/dialog-content.js +222 -0
  154. package/dist/utils/overlay.d.ts +2 -2
  155. package/dist/utils/overlay.js +8 -3
  156. package/dist/utils/refs.js +17 -2
  157. package/llms.txt +5 -3
  158. package/package.json +21 -8
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { isValidElement, useRef, useState } from "react";
2
+ import { c } from "react-compiler-runtime";
3
+ import { useRef, useState } from "react";
4
4
  import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { asTriggerChild } from "../../utils/overlay.js";
5
6
  import { cx } from "../../utils/semantic.js";
6
7
  import { Button } from "../button/button.js";
7
8
  import { ContextMenu } from "../context-menu/context-menu.js";
@@ -64,7 +65,7 @@ function EllipsisIcon() {
64
65
  return t0;
65
66
  }
66
67
  function Dropdown(props) {
67
- const $ = c(61);
68
+ const $ = c(62);
68
69
  const { menu, children, trigger: t0, placement: t1, open, defaultOpen, onOpenChange, disabled, arrow: t2, className, style, classNames, styles } = props;
69
70
  let t3;
70
71
  if ($[0] !== t0) {
@@ -110,47 +111,46 @@ function Dropdown(props) {
110
111
  const setOpen = t6;
111
112
  const closeTimer = useRef(void 0);
112
113
  let t7;
113
- if ($[10] !== setOpen) {
114
+ if ($[10] !== resolvedDisabled || $[11] !== setOpen) {
114
115
  t7 = ()=>{
115
116
  clearTimeout(closeTimer.current);
116
- setOpen(true);
117
+ if (!resolvedDisabled) setOpen(true);
117
118
  };
118
- $[10] = setOpen;
119
- $[11] = t7;
120
- } else t7 = $[11];
119
+ $[10] = resolvedDisabled;
120
+ $[11] = setOpen;
121
+ $[12] = t7;
122
+ } else t7 = $[12];
121
123
  const openOnHover = t7;
122
124
  let t8;
123
- if ($[12] !== setOpen) {
125
+ if ($[13] !== setOpen) {
124
126
  t8 = ()=>{
125
127
  closeTimer.current = setTimeout(()=>setOpen(false), 120);
126
128
  };
127
- $[12] = setOpen;
128
- $[13] = t8;
129
- } else t8 = $[13];
129
+ $[13] = setOpen;
130
+ $[14] = t8;
131
+ } else t8 = $[14];
130
132
  const closeOnHover = t8;
131
133
  let t9;
132
- if ($[14] !== classNames || $[15] !== styles) {
134
+ if ($[15] !== classNames || $[16] !== styles) {
133
135
  t9 = {
134
136
  classNames,
135
137
  styles
136
138
  };
137
- $[14] = classNames;
138
- $[15] = styles;
139
- $[16] = t9;
140
- } else t9 = $[16];
139
+ $[15] = classNames;
140
+ $[16] = styles;
141
+ $[17] = t9;
142
+ } else t9 = $[17];
141
143
  const content = useMenuController(menu, DD, t9);
142
144
  let t10;
143
- if ($[17] !== children) {
144
- t10 = /*#__PURE__*/ isValidElement(children) ? children : /*#__PURE__*/ jsx("span", {
145
- children: children
146
- });
147
- $[17] = children;
148
- $[18] = t10;
149
- } else t10 = $[18];
145
+ if ($[18] !== children) {
146
+ t10 = asTriggerChild(children);
147
+ $[18] = children;
148
+ $[19] = t10;
149
+ } else t10 = $[19];
150
150
  const triggerChild = t10;
151
151
  if (isContext) {
152
152
  let t11;
153
- if ($[19] !== children || $[20] !== className || $[21] !== classNames || $[22] !== disabled || $[23] !== menu || $[24] !== onOpenChange || $[25] !== open || $[26] !== style || $[27] !== styles) {
153
+ if ($[20] !== children || $[21] !== className || $[22] !== classNames || $[23] !== disabled || $[24] !== menu || $[25] !== onOpenChange || $[26] !== open || $[27] !== style || $[28] !== styles) {
154
154
  t11 = /*#__PURE__*/ jsx(ContextMenu, {
155
155
  menu: menu,
156
156
  open: open,
@@ -162,40 +162,40 @@ function Dropdown(props) {
162
162
  styles: styles,
163
163
  children: children
164
164
  });
165
- $[19] = children;
166
- $[20] = className;
167
- $[21] = classNames;
168
- $[22] = disabled;
169
- $[23] = menu;
170
- $[24] = onOpenChange;
171
- $[25] = open;
172
- $[26] = style;
173
- $[27] = styles;
174
- $[28] = t11;
175
- } else t11 = $[28];
165
+ $[20] = children;
166
+ $[21] = className;
167
+ $[22] = classNames;
168
+ $[23] = disabled;
169
+ $[24] = menu;
170
+ $[25] = onOpenChange;
171
+ $[26] = open;
172
+ $[27] = style;
173
+ $[28] = styles;
174
+ $[29] = t11;
175
+ } else t11 = $[29];
176
176
  return t11;
177
177
  }
178
178
  let t11;
179
- if ($[29] !== placement) {
179
+ if ($[30] !== placement) {
180
180
  t11 = parsePlacement(placement);
181
- $[29] = placement;
182
- $[30] = t11;
183
- } else t11 = $[30];
181
+ $[30] = placement;
182
+ $[31] = t11;
183
+ } else t11 = $[31];
184
184
  const { side, align } = t11;
185
185
  let t12;
186
- if ($[31] !== closeOnHover || $[32] !== hoverMode || $[33] !== openOnHover) {
186
+ if ($[32] !== closeOnHover || $[33] !== hoverMode || $[34] !== openOnHover) {
187
187
  t12 = hoverMode ? {
188
188
  onPointerEnter: openOnHover,
189
189
  onPointerLeave: closeOnHover
190
190
  } : void 0;
191
- $[31] = closeOnHover;
192
- $[32] = hoverMode;
193
- $[33] = openOnHover;
194
- $[34] = t12;
195
- } else t12 = $[34];
191
+ $[32] = closeOnHover;
192
+ $[33] = hoverMode;
193
+ $[34] = openOnHover;
194
+ $[35] = t12;
195
+ } else t12 = $[35];
196
196
  const hoverProps = t12;
197
197
  let t13;
198
- if ($[35] !== hoverProps || $[36] !== resolvedDisabled || $[37] !== triggerChild) {
198
+ if ($[36] !== hoverProps || $[37] !== resolvedDisabled || $[38] !== triggerChild) {
199
199
  t13 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Trigger, {
200
200
  asChild: true,
201
201
  disabled: resolvedDisabled,
@@ -203,43 +203,43 @@ function Dropdown(props) {
203
203
  ...hoverProps,
204
204
  children: triggerChild
205
205
  });
206
- $[35] = hoverProps;
207
- $[36] = resolvedDisabled;
208
- $[37] = triggerChild;
209
- $[38] = t13;
210
- } else t13 = $[38];
206
+ $[36] = hoverProps;
207
+ $[37] = resolvedDisabled;
208
+ $[38] = triggerChild;
209
+ $[39] = t13;
210
+ } else t13 = $[39];
211
211
  const t14 = classNames?.content;
212
212
  let t15;
213
- if ($[39] !== className || $[40] !== t14) {
213
+ if ($[40] !== className || $[41] !== t14) {
214
214
  t15 = cx(t14, className);
215
- $[39] = className;
216
- $[40] = t14;
217
- $[41] = t15;
218
- } else t15 = $[41];
215
+ $[40] = className;
216
+ $[41] = t14;
217
+ $[42] = t15;
218
+ } else t15 = $[42];
219
219
  const t16 = styles?.content;
220
220
  let t17;
221
- if ($[42] !== style || $[43] !== t16) {
221
+ if ($[43] !== style || $[44] !== t16) {
222
222
  t17 = {
223
223
  ...t16,
224
224
  ...style
225
225
  };
226
- $[42] = style;
227
- $[43] = t16;
228
- $[44] = t17;
229
- } else t17 = $[44];
226
+ $[43] = style;
227
+ $[44] = t16;
228
+ $[45] = t17;
229
+ } else t17 = $[45];
230
230
  let t18;
231
- if ($[45] !== arrow) {
231
+ if ($[46] !== arrow) {
232
232
  t18 = arrow && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Arrow, {
233
233
  asChild: true,
234
234
  children: /*#__PURE__*/ jsx("span", {
235
235
  "data-tao-dropdown-arrow": ""
236
236
  })
237
237
  });
238
- $[45] = arrow;
239
- $[46] = t18;
240
- } else t18 = $[46];
238
+ $[46] = arrow;
239
+ $[47] = t18;
240
+ } else t18 = $[47];
241
241
  let t19;
242
- if ($[47] !== align || $[48] !== content || $[49] !== hoverProps || $[50] !== side || $[51] !== size || $[52] !== t15 || $[53] !== t17 || $[54] !== t18) {
242
+ if ($[48] !== align || $[49] !== content || $[50] !== hoverProps || $[51] !== side || $[52] !== size || $[53] !== t15 || $[54] !== t17 || $[55] !== t18) {
243
243
  t19 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Portal, {
244
244
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
245
245
  asChild: true,
@@ -260,18 +260,18 @@ function Dropdown(props) {
260
260
  })
261
261
  })
262
262
  });
263
- $[47] = align;
264
- $[48] = content;
265
- $[49] = hoverProps;
266
- $[50] = side;
267
- $[51] = size;
268
- $[52] = t15;
269
- $[53] = t17;
270
- $[54] = t18;
271
- $[55] = t19;
272
- } else t19 = $[55];
263
+ $[48] = align;
264
+ $[49] = content;
265
+ $[50] = hoverProps;
266
+ $[51] = side;
267
+ $[52] = size;
268
+ $[53] = t15;
269
+ $[54] = t17;
270
+ $[55] = t18;
271
+ $[56] = t19;
272
+ } else t19 = $[56];
273
273
  let t20;
274
- if ($[56] !== realOpen || $[57] !== setOpen || $[58] !== t13 || $[59] !== t19) {
274
+ if ($[57] !== realOpen || $[58] !== setOpen || $[59] !== t13 || $[60] !== t19) {
275
275
  t20 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Root, {
276
276
  open: realOpen,
277
277
  onOpenChange: setOpen,
@@ -281,12 +281,12 @@ function Dropdown(props) {
281
281
  t19
282
282
  ]
283
283
  });
284
- $[56] = realOpen;
285
- $[57] = setOpen;
286
- $[58] = t13;
287
- $[59] = t19;
288
- $[60] = t20;
289
- } else t20 = $[60];
284
+ $[57] = realOpen;
285
+ $[58] = setOpen;
286
+ $[59] = t13;
287
+ $[60] = t19;
288
+ $[61] = t20;
289
+ } else t20 = $[61];
290
290
  return t20;
291
291
  }
292
292
  function DropdownButton(t0) {
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { Field } from "@rc-component/form";
4
4
  import { cloneElement, isValidElement } from "react";
5
5
  import { FormFieldView } from "../form-field/form-field-view.js";
@@ -19,8 +19,8 @@ function FormItem(t0) {
19
19
  let t2;
20
20
  if ($[3] !== className || $[4] !== classNames || $[5] !== extra || $[6] !== help || $[7] !== htmlFor || $[8] !== label || $[9] !== layout || $[10] !== noStyle || $[11] !== requiredMark || $[12] !== style || $[13] !== styles || $[14] !== validateStatus || $[15] !== valuePropName) {
21
21
  t2 = (content, meta, control)=>{
22
- const status = validateStatus ?? (meta?.errors.length ? "error" : void 0);
23
- const message = help ?? meta?.errors[0];
22
+ const status = validateStatus ?? (meta?.errors.length ? "error" : meta?.warnings.length ? "warning" : void 0);
23
+ const message = help ?? meta?.errors[0] ?? meta?.warnings[0];
24
24
  const showAsStatus = null != message && null != status;
25
25
  const errorSlot = showAsStatus ? message : void 0;
26
26
  const descriptionSlot = extra ?? (showAsStatus ? void 0 : message);
@@ -29,7 +29,11 @@ function FormItem(t0) {
29
29
  ...controlProps,
30
30
  status
31
31
  };
32
- if (controlProps && null == valuePropName && void 0 === controlProps.value) controlProps = {
32
+ if (controlProps && "checked" === valuePropName && "checked" in controlProps && void 0 === controlProps.checked) controlProps = {
33
+ ...controlProps,
34
+ checked: false
35
+ };
36
+ if (controlProps && /*#__PURE__*/ isValidElement(content) && ("input" === content.type || "textarea" === content.type) && null == valuePropName && void 0 === controlProps.value) controlProps = {
33
37
  ...controlProps,
34
38
  value: ""
35
39
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import _rc_component_form, { FieldContext, FormProvider, List, useForm, useWatch } from "@rc-component/form";
4
4
  import { forwardRef, useContext } from "react";
5
5
  import { TaoProvider } from "../../provider/tao-provider.js";
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { cx } from "../../utils/semantic.js";
4
4
  import "../form-field/form.css";
5
5
  function FormActions(t0) {
@@ -1,15 +1,16 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { cloneElement, isValidElement, useId } from "react";
4
4
  import { cx } from "../../utils/semantic.js";
5
5
  function FormFieldView(t0) {
6
- const $ = c(43);
6
+ const $ = c(47);
7
7
  const { label, htmlFor, required, error, warning, description, layout: t1, controlProps, children, className, style, classNames, styles } = t0;
8
8
  const layout = void 0 === t1 ? "vertical" : t1;
9
9
  const generatedId = useId();
10
10
  const child = /*#__PURE__*/ isValidElement(children) ? children : null;
11
11
  const childId = "string" == typeof child?.props.id ? child.props.id : void 0;
12
12
  const controlId = htmlFor ?? childId ?? `${generatedId}-control`;
13
+ const labelId = `${generatedId}-label`;
13
14
  const descriptionId = `${generatedId}-description`;
14
15
  const errorId = `${generatedId}-error`;
15
16
  const childDescribedBy = "string" == typeof child?.props["aria-describedby"] ? child.props["aria-describedby"] : void 0;
@@ -26,13 +27,14 @@ function FormFieldView(t0) {
26
27
  } else t3 = $[2];
27
28
  const describedBy = t3.join(" ");
28
29
  let t4;
29
- if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== controlProps || $[7] !== describedBy || $[8] !== error || $[9] !== errorId || $[10] !== required) {
30
+ if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== controlProps || $[7] !== describedBy || $[8] !== error || $[9] !== errorId || $[10] !== label || $[11] !== labelId || $[12] !== required || $[13] !== warning) {
30
31
  t4 = child ? /*#__PURE__*/ cloneElement(child, {
31
32
  ...controlProps,
32
33
  id: controlId,
34
+ "aria-labelledby": child.props["aria-labelledby"] ?? (null == label || child.props["aria-label"] ? void 0 : labelId),
33
35
  "aria-describedby": describedBy || void 0,
34
- "aria-errormessage": error ? errorId : void 0,
35
- "aria-invalid": error ? true : child.props["aria-invalid"],
36
+ "aria-errormessage": error && !warning ? errorId : child.props["aria-errormessage"],
37
+ "aria-invalid": error && !warning ? true : child.props["aria-invalid"],
36
38
  "aria-required": required ? true : child.props["aria-required"]
37
39
  }) : children;
38
40
  $[3] = child;
@@ -42,33 +44,37 @@ function FormFieldView(t0) {
42
44
  $[7] = describedBy;
43
45
  $[8] = error;
44
46
  $[9] = errorId;
45
- $[10] = required;
46
- $[11] = t4;
47
- } else t4 = $[11];
47
+ $[10] = label;
48
+ $[11] = labelId;
49
+ $[12] = required;
50
+ $[13] = warning;
51
+ $[14] = t4;
52
+ } else t4 = $[14];
48
53
  const control = t4;
49
54
  const t5 = classNames?.root;
50
55
  let t6;
51
- if ($[12] !== className || $[13] !== t5) {
56
+ if ($[15] !== className || $[16] !== t5) {
52
57
  t6 = cx(t5, className);
53
- $[12] = className;
54
- $[13] = t5;
55
- $[14] = t6;
56
- } else t6 = $[14];
58
+ $[15] = className;
59
+ $[16] = t5;
60
+ $[17] = t6;
61
+ } else t6 = $[17];
57
62
  const t7 = styles?.root;
58
63
  let t8;
59
- if ($[15] !== style || $[16] !== t7) {
64
+ if ($[18] !== style || $[19] !== t7) {
60
65
  t8 = {
61
66
  ...t7,
62
67
  ...style
63
68
  };
64
- $[15] = style;
65
- $[16] = t7;
66
- $[17] = t8;
67
- } else t8 = $[17];
69
+ $[18] = style;
70
+ $[19] = t7;
71
+ $[20] = t8;
72
+ } else t8 = $[20];
68
73
  const t9 = "horizontal" === layout ? "horizontal" : void 0;
69
74
  let t10;
70
- if ($[18] !== classNames?.label || $[19] !== controlId || $[20] !== label || $[21] !== required || $[22] !== styles?.label) {
75
+ if ($[21] !== classNames?.label || $[22] !== controlId || $[23] !== label || $[24] !== labelId || $[25] !== required || $[26] !== styles?.label) {
71
76
  t10 = null != label && /*#__PURE__*/ jsxs("label", {
77
+ id: labelId,
72
78
  htmlFor: controlId,
73
79
  className: classNames?.label,
74
80
  style: styles?.label,
@@ -82,15 +88,16 @@ function FormFieldView(t0) {
82
88
  })
83
89
  ]
84
90
  });
85
- $[18] = classNames?.label;
86
- $[19] = controlId;
87
- $[20] = label;
88
- $[21] = required;
89
- $[22] = styles?.label;
90
- $[23] = t10;
91
- } else t10 = $[23];
91
+ $[21] = classNames?.label;
92
+ $[22] = controlId;
93
+ $[23] = label;
94
+ $[24] = labelId;
95
+ $[25] = required;
96
+ $[26] = styles?.label;
97
+ $[27] = t10;
98
+ } else t10 = $[27];
92
99
  let t11;
93
- if ($[24] !== classNames?.description || $[25] !== classNames?.error || $[26] !== description || $[27] !== descriptionId || $[28] !== error || $[29] !== errorId || $[30] !== styles?.description || $[31] !== styles?.error || $[32] !== warning) {
100
+ if ($[28] !== classNames?.description || $[29] !== classNames?.error || $[30] !== description || $[31] !== descriptionId || $[32] !== error || $[33] !== errorId || $[34] !== styles?.description || $[35] !== styles?.error || $[36] !== warning) {
94
101
  t11 = error ? /*#__PURE__*/ jsx("p", {
95
102
  className: classNames?.error,
96
103
  style: styles?.error,
@@ -106,19 +113,19 @@ function FormFieldView(t0) {
106
113
  id: descriptionId,
107
114
  children: description
108
115
  }) : null;
109
- $[24] = classNames?.description;
110
- $[25] = classNames?.error;
111
- $[26] = description;
112
- $[27] = descriptionId;
113
- $[28] = error;
114
- $[29] = errorId;
115
- $[30] = styles?.description;
116
- $[31] = styles?.error;
117
- $[32] = warning;
118
- $[33] = t11;
119
- } else t11 = $[33];
116
+ $[28] = classNames?.description;
117
+ $[29] = classNames?.error;
118
+ $[30] = description;
119
+ $[31] = descriptionId;
120
+ $[32] = error;
121
+ $[33] = errorId;
122
+ $[34] = styles?.description;
123
+ $[35] = styles?.error;
124
+ $[36] = warning;
125
+ $[37] = t11;
126
+ } else t11 = $[37];
120
127
  let t12;
121
- if ($[34] !== control || $[35] !== t11) {
128
+ if ($[38] !== control || $[39] !== t11) {
122
129
  t12 = /*#__PURE__*/ jsxs("div", {
123
130
  "data-tao-form-control": "",
124
131
  children: [
@@ -126,12 +133,12 @@ function FormFieldView(t0) {
126
133
  t11
127
134
  ]
128
135
  });
129
- $[34] = control;
130
- $[35] = t11;
131
- $[36] = t12;
132
- } else t12 = $[36];
136
+ $[38] = control;
137
+ $[39] = t11;
138
+ $[40] = t12;
139
+ } else t12 = $[40];
133
140
  let t13;
134
- if ($[37] !== t10 || $[38] !== t12 || $[39] !== t6 || $[40] !== t8 || $[41] !== t9) {
141
+ if ($[41] !== t10 || $[42] !== t12 || $[43] !== t6 || $[44] !== t8 || $[45] !== t9) {
135
142
  t13 = /*#__PURE__*/ jsxs("div", {
136
143
  className: t6,
137
144
  style: t8,
@@ -142,13 +149,13 @@ function FormFieldView(t0) {
142
149
  t12
143
150
  ]
144
151
  });
145
- $[37] = t10;
146
- $[38] = t12;
147
- $[39] = t6;
148
- $[40] = t8;
149
- $[41] = t9;
150
- $[42] = t13;
151
- } else t13 = $[42];
152
+ $[41] = t10;
153
+ $[42] = t12;
154
+ $[43] = t6;
155
+ $[44] = t8;
156
+ $[45] = t9;
157
+ $[46] = t13;
158
+ } else t13 = $[46];
152
159
  return t13;
153
160
  }
154
161
  export { FormFieldView };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { FormFieldView } from "./form-field-view.js";
4
4
  import "./form.css";
5
5
  function FormField(t0) {
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { cx } from "../../utils/semantic.js";
4
4
  import "../form-field/form.css";
5
5
  function FormSection(t0) {
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
2
+ import { c } from "react-compiler-runtime";
3
3
  import { forwardRef } from "react";
4
4
  import { useTaoConfig } from "../../provider/tao-provider.js";
5
5
  import { cx } from "../../utils/semantic.js";
6
6
  import "./input.css";
7
7
  const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
8
- const $ = c(44);
8
+ const $ = c(45);
9
9
  let className;
10
10
  let classNames;
11
11
  let disabled;
@@ -85,43 +85,46 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
85
85
  $[21] = styles?.prefix;
86
86
  $[22] = t7;
87
87
  } else t7 = $[22];
88
- const t8 = classNames?.input;
89
- const t9 = styles?.input;
90
- const t10 = "error" === status || error || void 0;
91
- let t11;
92
- if ($[23] !== ref || $[24] !== resolvedDisabled || $[25] !== rest || $[26] !== t10 || $[27] !== t8 || $[28] !== t9) {
93
- t11 = /*#__PURE__*/ jsx("input", {
88
+ const t8 = "value" in rest ? rest.value ?? "" : void 0;
89
+ const t9 = classNames?.input;
90
+ const t10 = styles?.input;
91
+ const t11 = "error" === status || error || void 0;
92
+ let t12;
93
+ if ($[23] !== ref || $[24] !== resolvedDisabled || $[25] !== rest || $[26] !== t10 || $[27] !== t11 || $[28] !== t8 || $[29] !== t9) {
94
+ t12 = /*#__PURE__*/ jsx("input", {
94
95
  ...rest,
96
+ value: t8,
95
97
  ref: ref,
96
- className: t8,
97
- style: t9,
98
+ className: t9,
99
+ style: t10,
98
100
  disabled: resolvedDisabled,
99
- "aria-invalid": t10
101
+ "aria-invalid": t11
100
102
  });
101
103
  $[23] = ref;
102
104
  $[24] = resolvedDisabled;
103
105
  $[25] = rest;
104
106
  $[26] = t10;
105
- $[27] = t8;
106
- $[28] = t9;
107
- $[29] = t11;
108
- } else t11 = $[29];
109
- let t12;
110
- if ($[30] !== classNames?.suffix || $[31] !== styles?.suffix || $[32] !== suffix) {
111
- t12 = null != suffix && /*#__PURE__*/ jsx("span", {
107
+ $[27] = t11;
108
+ $[28] = t8;
109
+ $[29] = t9;
110
+ $[30] = t12;
111
+ } else t12 = $[30];
112
+ let t13;
113
+ if ($[31] !== classNames?.suffix || $[32] !== styles?.suffix || $[33] !== suffix) {
114
+ t13 = null != suffix && /*#__PURE__*/ jsx("span", {
112
115
  className: classNames?.suffix,
113
116
  style: styles?.suffix,
114
117
  "data-tao-suffix": "",
115
118
  children: suffix
116
119
  });
117
- $[30] = classNames?.suffix;
118
- $[31] = styles?.suffix;
119
- $[32] = suffix;
120
- $[33] = t12;
121
- } else t12 = $[33];
122
- let t13;
123
- if ($[34] !== resolvedSize || $[35] !== resolvedVariant || $[36] !== t11 || $[37] !== t12 || $[38] !== t2 || $[39] !== t4 || $[40] !== t5 || $[41] !== t6 || $[42] !== t7) {
124
- t13 = /*#__PURE__*/ jsxs("div", {
120
+ $[31] = classNames?.suffix;
121
+ $[32] = styles?.suffix;
122
+ $[33] = suffix;
123
+ $[34] = t13;
124
+ } else t13 = $[34];
125
+ let t14;
126
+ if ($[35] !== resolvedSize || $[36] !== resolvedVariant || $[37] !== t12 || $[38] !== t13 || $[39] !== t2 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7) {
127
+ t14 = /*#__PURE__*/ jsxs("div", {
125
128
  className: t2,
126
129
  style: t4,
127
130
  "data-tao-control": "",
@@ -132,21 +135,21 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
132
135
  "data-tao-warning": t6,
133
136
  children: [
134
137
  t7,
135
- t11,
136
- t12
138
+ t12,
139
+ t13
137
140
  ]
138
141
  });
139
- $[34] = resolvedSize;
140
- $[35] = resolvedVariant;
141
- $[36] = t11;
142
+ $[35] = resolvedSize;
143
+ $[36] = resolvedVariant;
142
144
  $[37] = t12;
143
- $[38] = t2;
144
- $[39] = t4;
145
- $[40] = t5;
146
- $[41] = t6;
147
- $[42] = t7;
148
- $[43] = t13;
149
- } else t13 = $[43];
150
- return t13;
145
+ $[38] = t13;
146
+ $[39] = t2;
147
+ $[40] = t4;
148
+ $[41] = t5;
149
+ $[42] = t6;
150
+ $[43] = t7;
151
+ $[44] = t14;
152
+ } else t14 = $[44];
153
+ return t14;
151
154
  });
152
155
  export { input_Input as Input };
@@ -1,4 +1,4 @@
1
- import type { ReactNode, Ref } from 'react';
1
+ import { type ReactNode, type Ref } from 'react';
2
2
  import { type UseNumberInputOptions } from '../../number-input/use-number-input';
3
3
  import type { TaoSize, TaoStatus, TaoVariant } from '../../provider/tao-provider';
4
4
  import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic';
@@ -21,4 +21,4 @@ export interface InputNumberProps extends UseNumberInputOptions {
21
21
  classNames?: SemanticClassNames<InputNumberSemanticPart>;
22
22
  styles?: SemanticStyles<InputNumberSemanticPart>;
23
23
  }
24
- export declare function InputNumber({ prefix, suffix, size, variant, error, status, disabled, placeholder, id, name, 'aria-label': ariaLabel, className, classNames, styles, ref: forwardedRef, ...hookOptions }: InputNumberProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<InputNumberProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;