@rockshin/tao-ui 0.0.47 → 0.0.49

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 (144) hide show
  1. package/dist/components/affix/affix.js +20 -16
  2. package/dist/components/alert/alert.js +114 -99
  3. package/dist/components/app/app-modals.js +134 -96
  4. package/dist/components/app/app-notices.js +39 -23
  5. package/dist/components/auto-complete/auto-complete.js +21 -7
  6. package/dist/components/avatar/avatar.js +31 -11
  7. package/dist/components/badge/badge.css +1 -1
  8. package/dist/components/badge/badge.js +72 -257
  9. package/dist/components/border-beam/border-beam.js +21 -17
  10. package/dist/components/breadcrumb/breadcrumb.js +178 -159
  11. package/dist/components/button/button.js +61 -53
  12. package/dist/components/calendar/calendar.js +6 -4
  13. package/dist/components/card/card.js +24 -8
  14. package/dist/components/carousel/carousel.d.ts +1 -1
  15. package/dist/components/carousel/carousel.js +105 -68
  16. package/dist/components/cascader/cascader.js +54 -19
  17. package/dist/components/checkbox/checkbox.css +13 -2
  18. package/dist/components/checkbox/checkbox.d.ts +2 -0
  19. package/dist/components/checkbox/checkbox.js +320 -229
  20. package/dist/components/collapse/collapse-panels.d.ts +1 -1
  21. package/dist/components/collapse/collapse-panels.js +122 -113
  22. package/dist/components/collapse/collapse.js +98 -63
  23. package/dist/components/color-picker/color-picker.js +539 -441
  24. package/dist/components/color-picker/color.js +1 -1
  25. package/dist/components/context-menu/context-menu.d.ts +1 -1
  26. package/dist/components/context-menu/context-menu.js +108 -68
  27. package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
  28. package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
  29. package/dist/components/date-picker/calendar/month-grid.js +79 -37
  30. package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
  31. package/dist/components/date-picker/calendar/time-panel.js +94 -89
  32. package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
  33. package/dist/components/date-picker/calendar/year-grid.js +66 -35
  34. package/dist/components/date-picker/date-picker.css +24 -1
  35. package/dist/components/date-picker/date-picker.js +99 -53
  36. package/dist/components/date-picker/presets.d.ts +2 -1
  37. package/dist/components/date-picker/presets.js +27 -24
  38. package/dist/components/date-picker/range-picker.js +308 -153
  39. package/dist/components/descriptions/descriptions.js +7 -3
  40. package/dist/components/divider/divider.css +1 -1
  41. package/dist/components/divider/divider.js +1 -1
  42. package/dist/components/drawer/drawer.js +201 -369
  43. package/dist/components/dropdown/dropdown.d.ts +1 -1
  44. package/dist/components/dropdown/dropdown.js +183 -279
  45. package/dist/components/empty/empty.js +57 -78
  46. package/dist/components/float-button/float-button.d.ts +1 -0
  47. package/dist/components/float-button/float-button.js +47 -30
  48. package/dist/components/form/field-control.d.ts +4 -2
  49. package/dist/components/form/field-control.js +17 -9
  50. package/dist/components/form/form-context.d.ts +8 -2
  51. package/dist/components/form/form-context.js +2 -1
  52. package/dist/components/form/form-item.js +85 -63
  53. package/dist/components/form/form.css +3 -2
  54. package/dist/components/form/use-form.d.ts +2 -1
  55. package/dist/components/form/use-form.js +2 -1
  56. package/dist/components/form-field/form-field-view.d.ts +3 -1
  57. package/dist/components/form-field/form-field-view.js +194 -141
  58. package/dist/components/form-section/form-section.d.ts +1 -1
  59. package/dist/components/form-section/form-section.js +52 -45
  60. package/dist/components/image/image.js +585 -477
  61. package/dist/components/input/base-input.js +8 -9
  62. package/dist/components/input/input-shared.d.ts +5 -2
  63. package/dist/components/input/input-shared.js +42 -18
  64. package/dist/components/input/otp.js +236 -217
  65. package/dist/components/input/password.js +2 -1
  66. package/dist/components/input/search.js +8 -7
  67. package/dist/components/list/list-pagination.js +41 -36
  68. package/dist/components/list/list.js +141 -125
  69. package/dist/components/listy/listy.js +175 -106
  70. package/dist/components/masonry/masonry.js +108 -85
  71. package/dist/components/mentions/mentions.js +12 -3
  72. package/dist/components/menu/menu-render.d.ts +9 -3
  73. package/dist/components/menu/menu-render.js +99 -36
  74. package/dist/components/modal/confirm-dialog.js +10 -4
  75. package/dist/components/modal/confirm.js +3 -7
  76. package/dist/components/modal/index.js +9 -3
  77. package/dist/components/modal/modal.js +390 -365
  78. package/dist/components/pagination/pagination.js +105 -96
  79. package/dist/components/popconfirm/popconfirm.d.ts +1 -1
  80. package/dist/components/popconfirm/popconfirm.js +219 -168
  81. package/dist/components/popover/popover.js +330 -243
  82. package/dist/components/progress/progress.css +2 -2
  83. package/dist/components/progress/progress.js +232 -458
  84. package/dist/components/qr-code/qr-code.js +72 -66
  85. package/dist/components/radio/radio.css +15 -4
  86. package/dist/components/radio/radio.d.ts +2 -1
  87. package/dist/components/radio/radio.js +260 -198
  88. package/dist/components/rate/rate.js +173 -113
  89. package/dist/components/scroll-area/scroll-area.js +241 -211
  90. package/dist/components/segmented/segmented.js +73 -41
  91. package/dist/components/select/mobile-select.d.ts +2 -1
  92. package/dist/components/select/mobile-select.js +24 -13
  93. package/dist/components/select/select-searchable-list.d.ts +2 -1
  94. package/dist/components/select/select-searchable-list.js +2 -3
  95. package/dist/components/select/select.js +49 -25
  96. package/dist/components/select/use-select-selection.d.ts +1 -1
  97. package/dist/components/select/use-select-selection.js +7 -4
  98. package/dist/components/skeleton/skeleton.js +56 -48
  99. package/dist/components/slider/slider.js +87 -212
  100. package/dist/components/sonner/sonner.js +109 -93
  101. package/dist/components/spinner/spinner.js +147 -138
  102. package/dist/components/splitter/splitter.js +222 -159
  103. package/dist/components/statistic/statistic.js +7 -6
  104. package/dist/components/steps/steps.js +88 -81
  105. package/dist/components/steps/use-display-steps.js +1 -1
  106. package/dist/components/switch/switch.js +89 -89
  107. package/dist/components/table/table-filter.js +66 -56
  108. package/dist/components/table/table-icons.d.ts +2 -1
  109. package/dist/components/table/table-icons.js +11 -9
  110. package/dist/components/table/table-model.js +1 -1
  111. package/dist/components/table/table.js +107 -83
  112. package/dist/components/table/use-table-data.d.ts +6 -3
  113. package/dist/components/table/use-table-data.js +166 -130
  114. package/dist/components/tabs/tabs.css +1 -1
  115. package/dist/components/tabs/tabs.js +236 -179
  116. package/dist/components/tag/tag.d.ts +2 -2
  117. package/dist/components/tag/tag.js +111 -108
  118. package/dist/components/textarea/textarea.js +22 -17
  119. package/dist/components/time-picker/time-picker.js +5 -3
  120. package/dist/components/timeline/timeline.css +6 -1
  121. package/dist/components/timeline/timeline.js +21 -11
  122. package/dist/components/tooltip/tooltip.d.ts +2 -2
  123. package/dist/components/tooltip/tooltip.js +123 -233
  124. package/dist/components/tour/tour.css +4 -0
  125. package/dist/components/tour/tour.js +400 -331
  126. package/dist/components/transfer/transfer-list.js +29 -11
  127. package/dist/components/transfer/transfer-parts.js +1 -1
  128. package/dist/components/transfer/transfer-types.d.ts +1 -0
  129. package/dist/components/transfer/transfer.js +29 -14
  130. package/dist/components/tree/tree-keyboard.d.ts +1 -1
  131. package/dist/components/tree/tree-keyboard.js +5 -3
  132. package/dist/components/tree/tree.js +74 -59
  133. package/dist/components/tree-select/select-engine.d.ts +3 -2
  134. package/dist/components/tree-select/select-engine.js +18 -16
  135. package/dist/components/tree-select/tree-select.js +21 -5
  136. package/dist/components/upload/upload.css +8 -0
  137. package/dist/components/upload/upload.js +160 -72
  138. package/dist/components/watermark/watermark.js +36 -29
  139. package/dist/number-input/use-number-input.js +129 -90
  140. package/dist/number-input/validate.js +32 -5
  141. package/dist/provider/merge-locale.js +12 -9
  142. package/dist/provider/tao-provider.d.ts +3 -1
  143. package/dist/provider/tao-provider.js +123 -86
  144. package/package.json +1 -1
@@ -1,61 +1,109 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import { cloneElement, isValidElement, useId } from "react";
3
+ import { Fragment, cloneElement, isValidElement, useId } from "react";
4
4
  import { FieldLabelContext } from "../../utils/field-label.js";
5
5
  import { cx } from "../../utils/semantic.js";
6
6
  import "./form.css";
7
+ const hasContent = (value)=>null != value && '' !== value && 'boolean' != typeof value;
7
8
  function FormFieldView(t0) {
8
- const $ = c(58);
9
- const { formItem, reserveMessage, label, htmlFor, required, error, warning, description, layout: t1, controlProps, renderControl, children, className, style, classNames, styles } = 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;
10
11
  const layout = void 0 === t1 ? "vertical" : t1;
11
12
  const generatedId = useId();
12
- const child = /*#__PURE__*/ isValidElement(children) ? children : null;
13
+ const child = /*#__PURE__*/ isValidElement(children) && children.type !== Fragment ? children : null;
13
14
  const childId = "string" == typeof child?.props.id ? child.props.id : void 0;
14
15
  const controlId = htmlFor ?? childId ?? `${generatedId}-control`;
15
16
  const labelId = `${generatedId}-label`;
16
17
  const descriptionId = `${generatedId}-description`;
17
18
  const errorId = `${generatedId}-error`;
18
- const childDescribedBy = "string" == typeof child?.props["aria-describedby"] ? child.props["aria-describedby"] : void 0;
19
- const t2 = error ? errorId : description ? descriptionId : void 0;
19
+ const extraId = `${generatedId}-extra`;
20
+ let t2;
21
+ if ($[0] !== label) {
22
+ t2 = hasContent(label);
23
+ $[0] = label;
24
+ $[1] = t2;
25
+ } else t2 = $[1];
26
+ const hasLabel = t2;
20
27
  let t3;
21
- if ($[0] !== childDescribedBy || $[1] !== t2) {
22
- t3 = [
28
+ if ($[2] !== error) {
29
+ t3 = hasContent(error);
30
+ $[2] = error;
31
+ $[3] = t3;
32
+ } else t3 = $[3];
33
+ const hasError = t3;
34
+ let t4;
35
+ if ($[4] !== description) {
36
+ t4 = hasContent(description);
37
+ $[4] = description;
38
+ $[5] = t4;
39
+ } else t4 = $[5];
40
+ const hasDescription = t4;
41
+ let t5;
42
+ if ($[6] !== extra) {
43
+ t5 = hasContent(extra);
44
+ $[6] = extra;
45
+ $[7] = t5;
46
+ } else t5 = $[7];
47
+ const hasExtra = t5;
48
+ const childDescribedBy = "string" == typeof child?.props["aria-describedby"] ? child.props["aria-describedby"] : void 0;
49
+ const t6 = hasError ? errorId : hasDescription ? descriptionId : void 0;
50
+ const t7 = hasExtra ? extraId : void 0;
51
+ let t8;
52
+ if ($[8] !== childDescribedBy || $[9] !== t6 || $[10] !== t7) {
53
+ t8 = [
23
54
  childDescribedBy,
24
- t2
55
+ t6,
56
+ t7
25
57
  ].filter(Boolean);
26
- $[0] = childDescribedBy;
27
- $[1] = t2;
28
- $[2] = t3;
29
- } else t3 = $[2];
30
- const describedBy = t3.join(" ");
31
- let t4;
32
- if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== controlProps || $[7] !== describedBy || $[8] !== error || $[9] !== errorId || $[10] !== label || $[11] !== labelId || $[12] !== required || $[13] !== warning) {
33
- t4 = child ? /*#__PURE__*/ cloneElement(child, {
58
+ $[8] = childDescribedBy;
59
+ $[9] = t6;
60
+ $[10] = t7;
61
+ $[11] = t8;
62
+ } else t8 = $[11];
63
+ const describedBy = t8.join(" ");
64
+ let t9;
65
+ if ($[12] !== child || $[13] !== children || $[14] !== controlId || $[15] !== controlProps || $[16] !== describedBy || $[17] !== errorId || $[18] !== hasError || $[19] !== hasLabel || $[20] !== invalid || $[21] !== labelId || $[22] !== required || $[23] !== warning) {
66
+ t9 = child ? /*#__PURE__*/ cloneElement(child, {
34
67
  ...controlProps,
35
68
  id: controlId,
36
- "aria-labelledby": child.props["aria-labelledby"] ?? (null == label || child.props["aria-label"] ? void 0 : labelId),
69
+ "aria-labelledby": child.props["aria-labelledby"] ?? (hasLabel && !child.props["aria-label"] ? labelId : void 0),
37
70
  "aria-describedby": describedBy || void 0,
38
- "aria-errormessage": error && !warning ? errorId : child.props["aria-errormessage"],
39
- "aria-invalid": error && !warning ? true : child.props["aria-invalid"],
71
+ "aria-errormessage": hasError && !warning ? errorId : child.props["aria-errormessage"],
72
+ "aria-invalid": invalid || hasError && !warning ? true : child.props["aria-invalid"],
40
73
  "aria-required": required ? true : child.props["aria-required"]
41
74
  }) : children;
42
- $[3] = child;
43
- $[4] = children;
44
- $[5] = controlId;
45
- $[6] = controlProps;
46
- $[7] = describedBy;
47
- $[8] = error;
48
- $[9] = errorId;
49
- $[10] = label;
50
- $[11] = labelId;
51
- $[12] = required;
52
- $[13] = warning;
53
- $[14] = t4;
54
- } else t4 = $[14];
55
- const control = t4;
56
- let t5;
57
- if ($[15] !== classNames?.description || $[16] !== classNames?.error || $[17] !== description || $[18] !== descriptionId || $[19] !== error || $[20] !== errorId || $[21] !== styles?.description || $[22] !== styles?.error || $[23] !== warning) {
58
- t5 = error ? /*#__PURE__*/ jsx("p", {
75
+ $[12] = child;
76
+ $[13] = children;
77
+ $[14] = controlId;
78
+ $[15] = controlProps;
79
+ $[16] = describedBy;
80
+ $[17] = errorId;
81
+ $[18] = hasError;
82
+ $[19] = hasLabel;
83
+ $[20] = invalid;
84
+ $[21] = labelId;
85
+ $[22] = required;
86
+ $[23] = warning;
87
+ $[24] = t9;
88
+ } else t9 = $[24];
89
+ const control = t9;
90
+ let t10;
91
+ if ($[25] !== classNames?.description || $[26] !== styles?.description) {
92
+ t10 = (id, content)=>/*#__PURE__*/ jsx("p", {
93
+ className: classNames?.description,
94
+ style: styles?.description,
95
+ "data-tao-form-description": "",
96
+ id: id,
97
+ children: content
98
+ });
99
+ $[25] = classNames?.description;
100
+ $[26] = styles?.description;
101
+ $[27] = t10;
102
+ } else t10 = $[27];
103
+ const descriptionMessage = t10;
104
+ let t11;
105
+ if ($[28] !== classNames?.error || $[29] !== description || $[30] !== descriptionId || $[31] !== descriptionMessage || $[32] !== error || $[33] !== errorId || $[34] !== hasDescription || $[35] !== hasError || $[36] !== styles?.error || $[37] !== warning) {
106
+ t11 = hasError ? /*#__PURE__*/ jsx("p", {
59
107
  className: classNames?.error,
60
108
  style: styles?.error,
61
109
  "data-tao-form-error": "",
@@ -63,51 +111,46 @@ function FormFieldView(t0) {
63
111
  id: errorId,
64
112
  role: "alert",
65
113
  children: error
66
- }) : description ? /*#__PURE__*/ jsx("p", {
67
- className: classNames?.description,
68
- style: styles?.description,
69
- "data-tao-form-description": "",
70
- id: descriptionId,
71
- children: description
72
- }) : null;
73
- $[15] = classNames?.description;
74
- $[16] = classNames?.error;
75
- $[17] = description;
76
- $[18] = descriptionId;
77
- $[19] = error;
78
- $[20] = errorId;
79
- $[21] = styles?.description;
80
- $[22] = styles?.error;
81
- $[23] = warning;
82
- $[24] = t5;
83
- } else t5 = $[24];
84
- const message = t5;
85
- const hasMessage = formItem && (reserveMessage || null !== message);
86
- const t6 = classNames?.root;
87
- let t7;
88
- if ($[25] !== className || $[26] !== t6) {
89
- t7 = cx(t6, className);
90
- $[25] = className;
91
- $[26] = t6;
92
- $[27] = t7;
93
- } else t7 = $[27];
94
- const t8 = styles?.root;
95
- let t9;
96
- if ($[28] !== style || $[29] !== t8) {
97
- t9 = {
98
- ...t8,
114
+ }) : hasDescription ? descriptionMessage(descriptionId, description) : null;
115
+ $[28] = classNames?.error;
116
+ $[29] = description;
117
+ $[30] = descriptionId;
118
+ $[31] = descriptionMessage;
119
+ $[32] = error;
120
+ $[33] = errorId;
121
+ $[34] = hasDescription;
122
+ $[35] = hasError;
123
+ $[36] = styles?.error;
124
+ $[37] = warning;
125
+ $[38] = t11;
126
+ } else t11 = $[38];
127
+ const message = t11;
128
+ const hasMessage = formItem && (reserveMessage || null !== message || hasExtra);
129
+ const t12 = classNames?.root;
130
+ 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;
138
+ let t15;
139
+ if ($[42] !== style || $[43] !== t14) {
140
+ t15 = {
141
+ ...t14,
99
142
  ...style
100
143
  };
101
- $[28] = style;
102
- $[29] = t8;
103
- $[30] = t9;
104
- } else t9 = $[30];
105
- const t10 = formItem ? "" : void 0;
106
- const t11 = hasMessage ? "" : void 0;
107
- const t12 = "horizontal" === layout ? "horizontal" : void 0;
108
- let t13;
109
- if ($[31] !== classNames?.label || $[32] !== controlId || $[33] !== label || $[34] !== labelId || $[35] !== required || $[36] !== styles?.label) {
110
- t13 = null != label && /*#__PURE__*/ jsxs("label", {
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;
151
+ 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", {
111
154
  id: labelId,
112
155
  htmlFor: controlId,
113
156
  className: classNames?.label,
@@ -122,77 +165,87 @@ function FormFieldView(t0) {
122
165
  })
123
166
  ]
124
167
  });
125
- $[31] = classNames?.label;
126
- $[32] = controlId;
127
- $[33] = label;
128
- $[34] = labelId;
129
- $[35] = required;
130
- $[36] = styles?.label;
131
- $[37] = t13;
132
- } else t13 = $[37];
133
- let t14;
134
- if ($[38] !== control || $[39] !== renderControl) {
135
- t14 = renderControl && /*#__PURE__*/ isValidElement(control) ? renderControl(control) : control;
136
- $[38] = control;
137
- $[39] = renderControl;
138
- $[40] = t14;
139
- } else t14 = $[40];
140
- let t15;
141
- if ($[41] !== label || $[42] !== t14) {
142
- t15 = /*#__PURE__*/ jsx(FieldLabelContext.Provider, {
143
- value: label,
144
- children: t14
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;
178
+ 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
145
191
  });
146
- $[41] = label;
147
- $[42] = t14;
148
- $[43] = t15;
149
- } else t15 = $[43];
150
- let t16;
151
- if ($[44] !== hasMessage || $[45] !== message) {
152
- t16 = hasMessage ? /*#__PURE__*/ jsx("div", {
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", {
153
199
  "data-tao-form-message": "",
154
- children: message
200
+ children: [
201
+ message,
202
+ hasExtra && descriptionMessage(extraId, extra)
203
+ ]
155
204
  }) : message;
156
- $[44] = hasMessage;
157
- $[45] = message;
158
- $[46] = t16;
159
- } else t16 = $[46];
160
- let t17;
161
- if ($[47] !== t15 || $[48] !== t16) {
162
- t17 = /*#__PURE__*/ jsxs("div", {
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", {
163
216
  "data-tao-form-control": "",
164
217
  children: [
165
- t15,
166
- t16
218
+ t22,
219
+ t23
167
220
  ]
168
221
  });
169
- $[47] = t15;
170
- $[48] = t16;
171
- $[49] = t17;
172
- } else t17 = $[49];
173
- let t18;
174
- if ($[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t13 || $[54] !== t17 || $[55] !== t7 || $[56] !== t9) {
175
- t18 = /*#__PURE__*/ jsxs("div", {
176
- className: t7,
177
- style: t9,
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,
178
231
  "data-tao-form-field": "",
179
- "data-tao-form-item": t10,
180
- "data-tao-form-feedback": t11,
181
- "data-tao-layout": t12,
232
+ "data-tao-form-item": t16,
233
+ "data-tao-form-feedback": t17,
234
+ "data-tao-layout": t18,
182
235
  children: [
183
- t13,
184
- t17
236
+ t19,
237
+ t24
185
238
  ]
186
239
  });
187
- $[50] = t10;
188
- $[51] = t11;
189
- $[52] = t12;
190
- $[53] = t13;
191
- $[54] = t17;
192
- $[55] = t7;
193
- $[56] = t9;
194
- $[57] = t18;
195
- } else t18 = $[57];
196
- return t18;
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;
197
250
  }
198
251
  export { FormFieldView };
@@ -1,4 +1,4 @@
1
- import type { CSSProperties, ReactNode } from 'react';
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
2
  import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
3
3
  import '../form-field/form.css';
4
4
  export type FormSectionSemanticPart = 'root' | 'header' | 'title' | 'description' | 'body';
@@ -1,37 +1,41 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
+ import { useId } from "react";
3
4
  import { cx } from "../../utils/semantic.js";
4
5
  import "../form-field/form.css";
5
6
  function FormSection(t0) {
6
- const $ = c(24);
7
+ const $ = c(26);
7
8
  const { title, description, children, className, style, classNames, styles } = t0;
8
- const t1 = classNames?.root;
9
- let t2;
10
- if ($[0] !== className || $[1] !== t1) {
11
- t2 = cx(t1, className);
9
+ const titleId = useId();
10
+ const t1 = title ? titleId : void 0;
11
+ const t2 = classNames?.root;
12
+ let t3;
13
+ if ($[0] !== className || $[1] !== t2) {
14
+ t3 = cx(t2, className);
12
15
  $[0] = className;
13
- $[1] = t1;
14
- $[2] = t2;
15
- } else t2 = $[2];
16
- const t3 = styles?.root;
17
- let t4;
18
- if ($[3] !== style || $[4] !== t3) {
19
- t4 = {
20
- ...t3,
16
+ $[1] = t2;
17
+ $[2] = t3;
18
+ } else t3 = $[2];
19
+ const t4 = styles?.root;
20
+ let t5;
21
+ if ($[3] !== style || $[4] !== t4) {
22
+ t5 = {
23
+ ...t4,
21
24
  ...style
22
25
  };
23
26
  $[3] = style;
24
- $[4] = t3;
25
- $[5] = t4;
26
- } else t4 = $[5];
27
- let t5;
28
- if ($[6] !== classNames?.description || $[7] !== classNames?.header || $[8] !== classNames?.title || $[9] !== description || $[10] !== styles?.description || $[11] !== styles?.header || $[12] !== styles?.title || $[13] !== title) {
29
- t5 = (title || description) && /*#__PURE__*/ jsxs("div", {
27
+ $[4] = t4;
28
+ $[5] = t5;
29
+ } else t5 = $[5];
30
+ let t6;
31
+ if ($[6] !== classNames?.description || $[7] !== classNames?.header || $[8] !== classNames?.title || $[9] !== description || $[10] !== styles?.description || $[11] !== styles?.header || $[12] !== styles?.title || $[13] !== title || $[14] !== titleId) {
32
+ t6 = (title || description) && /*#__PURE__*/ jsxs("div", {
30
33
  className: classNames?.header,
31
34
  style: styles?.header,
32
35
  "data-tao-form-section-header": "",
33
36
  children: [
34
37
  title && /*#__PURE__*/ jsx("div", {
38
+ id: titleId,
35
39
  className: classNames?.title,
36
40
  style: styles?.title,
37
41
  "data-tao-form-section-title": "",
@@ -53,40 +57,43 @@ function FormSection(t0) {
53
57
  $[11] = styles?.header;
54
58
  $[12] = styles?.title;
55
59
  $[13] = title;
56
- $[14] = t5;
57
- } else t5 = $[14];
58
- const t6 = classNames?.body;
59
- const t7 = styles?.body;
60
- let t8;
61
- if ($[15] !== children || $[16] !== t6 || $[17] !== t7) {
62
- t8 = /*#__PURE__*/ jsx("div", {
63
- className: t6,
64
- style: t7,
60
+ $[14] = titleId;
61
+ $[15] = t6;
62
+ } else t6 = $[15];
63
+ const t7 = classNames?.body;
64
+ const t8 = styles?.body;
65
+ let t9;
66
+ if ($[16] !== children || $[17] !== t7 || $[18] !== t8) {
67
+ t9 = /*#__PURE__*/ jsx("div", {
68
+ className: t7,
69
+ style: t8,
65
70
  "data-tao-form-section-body": "",
66
71
  children: children
67
72
  });
68
- $[15] = children;
69
- $[16] = t6;
73
+ $[16] = children;
70
74
  $[17] = t7;
71
75
  $[18] = t8;
72
- } else t8 = $[18];
73
- let t9;
74
- if ($[19] !== t2 || $[20] !== t4 || $[21] !== t5 || $[22] !== t8) {
75
- t9 = /*#__PURE__*/ jsxs("section", {
76
- className: t2,
77
- style: t4,
76
+ $[19] = t9;
77
+ } else t9 = $[19];
78
+ let t10;
79
+ if ($[20] !== t1 || $[21] !== t3 || $[22] !== t5 || $[23] !== t6 || $[24] !== t9) {
80
+ t10 = /*#__PURE__*/ jsxs("section", {
81
+ "aria-labelledby": t1,
82
+ className: t3,
83
+ style: t5,
78
84
  "data-tao-form-section": "",
79
85
  children: [
80
- t5,
81
- t8
86
+ t6,
87
+ t9
82
88
  ]
83
89
  });
84
- $[19] = t2;
85
- $[20] = t4;
86
- $[21] = t5;
87
- $[22] = t8;
88
- $[23] = t9;
89
- } else t9 = $[23];
90
- return t9;
90
+ $[20] = t1;
91
+ $[21] = t3;
92
+ $[22] = t5;
93
+ $[23] = t6;
94
+ $[24] = t9;
95
+ $[25] = t10;
96
+ } else t10 = $[25];
97
+ return t10;
91
98
  }
92
99
  export { FormSection };