@wix/site-ui 1.347.0 → 1.349.0

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 (226) hide show
  1. package/dist/{6706.js → 1093.js} +3 -3
  2. package/dist/{8724.js → 1219.js} +2 -2
  3. package/dist/{7373.js → 1288.js} +8 -2
  4. package/dist/{5299.js → 1381.js} +98 -127
  5. package/dist/{3056.js → 1607.js} +32 -34
  6. package/dist/1629.js +2 -0
  7. package/dist/1669.js +75 -0
  8. package/dist/1718.js +26 -0
  9. package/dist/{1477.js → 201.js} +17 -26
  10. package/dist/2221.js +9 -0
  11. package/dist/{2445.js → 226.js} +12 -48
  12. package/dist/2387.js +7 -0
  13. package/dist/2580.js +6 -0
  14. package/dist/{1500.js → 2859.js} +10 -34
  15. package/dist/3014.js +178 -0
  16. package/dist/{6247.js → 3054.js} +3 -3
  17. package/dist/{7642.js → 3093.js} +1 -1
  18. package/dist/3189.js +5 -0
  19. package/dist/{7564.js → 331.js} +2 -2
  20. package/dist/3357.js +7 -0
  21. package/dist/{487.js → 3398.js} +38 -39
  22. package/dist/3502.js +224 -0
  23. package/dist/3695.js +50 -0
  24. package/dist/3829.js +1 -1
  25. package/dist/{6588.js → 3859.js} +115 -92
  26. package/dist/{3670.js → 3910.js} +28 -21
  27. package/dist/392.js +7 -0
  28. package/dist/{4549.js → 4155.js} +11 -3
  29. package/dist/4226.js +7 -0
  30. package/dist/{6329.js → 4229.js} +1 -1
  31. package/dist/4293.js +3 -0
  32. package/dist/4346.js +853 -2
  33. package/dist/{285.js → 4472.js} +3 -3
  34. package/dist/4605.js +207 -0
  35. package/dist/{7366.js → 488.js} +60 -7
  36. package/dist/{8750.js → 497.js} +190 -375
  37. package/dist/4989.js +35 -0
  38. package/dist/{6270.js → 510.js} +157 -196
  39. package/dist/5258.js +26 -0
  40. package/dist/{5036.js → 5275.js} +0 -3
  41. package/dist/{8171.js → 5298.js} +90 -102
  42. package/dist/5473.js +11 -0
  43. package/dist/{4745.js → 5490.js} +3 -1
  44. package/dist/{6089.js → 5561.js} +869 -786
  45. package/dist/{8996.js → 5595.js} +4 -3
  46. package/dist/5890.js +25 -0
  47. package/dist/{6046.js → 5969.js} +1 -1
  48. package/dist/5984.js +38 -0
  49. package/dist/{8527.js → 6006.js} +3 -3
  50. package/dist/6040.js +97 -0
  51. package/dist/{8758.js → 6137.js} +10 -8
  52. package/dist/{4281.js → 6140.js} +18 -10
  53. package/dist/{8960.js → 6191.js} +2 -2
  54. package/dist/6240.js +121 -0
  55. package/dist/{4490.js → 6373.js} +7 -5
  56. package/dist/{904.js → 6487.js} +19 -17
  57. package/dist/{9635.js → 6498.js} +1 -1
  58. package/dist/6499.js +4 -7
  59. package/dist/6508.js +7 -0
  60. package/dist/{8225.js → 6540.js} +1 -0
  61. package/dist/6551.js +46 -0
  62. package/dist/{9369.js → 6620.js} +35 -34
  63. package/dist/{4143.js → 6838.js} +19 -10
  64. package/dist/6902.js +48 -0
  65. package/dist/6904.js +51 -0
  66. package/dist/70.js +24 -0
  67. package/dist/7024.js +39 -0
  68. package/dist/{6882.js → 721.js} +737 -362
  69. package/dist/{951.js → 7270.js} +4 -4
  70. package/dist/{3485.js → 7323.js} +143 -111
  71. package/dist/{7541.js → 7488.js} +2 -2
  72. package/dist/{4863.js → 7542.js} +7 -6
  73. package/dist/7551.js +28 -0
  74. package/dist/{7021.js → 7640.js} +1 -1
  75. package/dist/{353.js → 7692.js} +3 -7
  76. package/dist/{4707.js → 7930.js} +2 -2
  77. package/dist/{8052.js → 8.js} +80 -64
  78. package/dist/{6914.js → 8129.js} +3 -15
  79. package/dist/{3319.js → 8358.js} +62 -63
  80. package/dist/{5864.js → 8407.js} +13 -13
  81. package/dist/8488.js +15 -0
  82. package/dist/{4768.js → 8495.js} +1 -1
  83. package/dist/8734.js +171 -0
  84. package/dist/{1763.js → 9018.js} +205 -331
  85. package/dist/9053.js +29 -0
  86. package/dist/9067.js +41 -0
  87. package/dist/{2861.js → 9120.js} +2 -2
  88. package/dist/{42.js → 9197.js} +2 -2
  89. package/dist/{9189.js → 9248.js} +36 -17
  90. package/dist/{2801.js → 9252.js} +4 -9
  91. package/dist/9295.js +7 -0
  92. package/dist/9303.js +8 -0
  93. package/dist/{167.js → 9374.js} +1 -1
  94. package/dist/{9352.js → 9540.js} +17 -47
  95. package/dist/9576.js +51 -0
  96. package/dist/{8272.js → 9591.js} +36 -46
  97. package/dist/{6107.js → 9770.js} +2 -2
  98. package/dist/{5085.js → 9880.js} +6 -3
  99. package/dist/Accordion/index.d.ts +207 -41
  100. package/dist/Accordion/index.js +75 -177
  101. package/dist/AlertDialog/index.d.ts +440 -140
  102. package/dist/AlertDialog/index.js +3 -13
  103. package/dist/Autocomplete/index.d.ts +722 -150
  104. package/dist/Autocomplete/index.js +16 -29
  105. package/dist/Avatar/index.d.ts +38 -3
  106. package/dist/Avatar/index.js +82 -28
  107. package/dist/Breadcrumbs/index.d.ts +63 -91
  108. package/dist/Breadcrumbs/index.js +1 -1
  109. package/dist/Button/index.d.ts +11 -0
  110. package/dist/Button/index.js +2 -2
  111. package/dist/Checkbox/index.d.ts +206 -36
  112. package/dist/Checkbox/index.js +293 -8
  113. package/dist/CheckboxField/index.css +1 -1
  114. package/dist/CheckboxField/index.d.ts +40 -36
  115. package/dist/CheckboxGroup/index.d.ts +50 -36
  116. package/dist/CheckboxGroup/index.js +87 -58
  117. package/dist/CheckboxGroupField/index.css +1 -1
  118. package/dist/Collapsible/index.d.ts +128 -36
  119. package/dist/Collapsible/index.js +21 -25
  120. package/dist/Combobox/index.d.ts +801 -158
  121. package/dist/Combobox/index.js +70 -114
  122. package/dist/ContextMenu/index.d.ts +1162 -195
  123. package/dist/ContextMenu/index.js +46 -36
  124. package/dist/Dialog/index.d.ts +425 -133
  125. package/dist/Dialog/index.js +8 -4
  126. package/dist/Drawer/index.d.ts +589 -144
  127. package/dist/Drawer/index.js +482 -562
  128. package/dist/Field/index.css +1 -1
  129. package/dist/Field/index.d.ts +341 -42
  130. package/dist/Field/index.js +123 -273
  131. package/dist/Fieldset/index.d.ts +11 -0
  132. package/dist/Fieldset/index.js +10 -17
  133. package/dist/Form/index.d.ts +43 -39
  134. package/dist/Form/index.js +58 -50
  135. package/dist/Input/index.css +1 -1
  136. package/dist/Input/index.d.ts +94 -42
  137. package/dist/Input/index.js +1 -1
  138. package/dist/Menu/index.d.ts +1140 -175
  139. package/dist/Menu/index.js +51 -67
  140. package/dist/Menubar/index.d.ts +651 -173
  141. package/dist/Menubar/index.js +12 -16
  142. package/dist/Meter/index.js +21 -18
  143. package/dist/NavigationMenu/index.d.ts +370 -86
  144. package/dist/NavigationMenu/index.js +144 -178
  145. package/dist/NumberField/index.css +1 -1
  146. package/dist/NumberField/index.d.ts +507 -47
  147. package/dist/NumberField/index.js +434 -718
  148. package/dist/Popover/index.d.ts +561 -142
  149. package/dist/Popover/index.js +181 -252
  150. package/dist/PreviewCard/index.d.ts +507 -143
  151. package/dist/PreviewCard/index.js +97 -151
  152. package/dist/Progress/index.d.ts +117 -3
  153. package/dist/Progress/index.js +37 -36
  154. package/dist/Radio/index.d.ts +177 -7
  155. package/dist/Radio/index.js +54 -70
  156. package/dist/RadioField/index.css +1 -1
  157. package/dist/RadioField/index.d.ts +23 -7
  158. package/dist/RadioGroup/index.d.ts +51 -37
  159. package/dist/RadioGroup/index.js +60 -51
  160. package/dist/RadioGroupField/index.css +1 -1
  161. package/dist/RadioGroupField/index.d.ts +40 -37
  162. package/dist/ScrollArea/index.d.ts +295 -1
  163. package/dist/ScrollArea/index.js +256 -324
  164. package/dist/Select/index.d.ts +516 -123
  165. package/dist/Select/index.js +513 -635
  166. package/dist/SelectField/index.css +1 -1
  167. package/dist/SelectField/index.d.ts +109 -134
  168. package/dist/SelectField/index.js +5 -1
  169. package/dist/Separator/index.d.ts +12 -0
  170. package/dist/Separator/index.js +1 -1
  171. package/dist/Slider/index.d.ts +383 -64
  172. package/dist/Slider/index.js +298 -374
  173. package/dist/Switch/index.d.ts +184 -37
  174. package/dist/Switch/index.js +44 -58
  175. package/dist/Tabs/index.d.ts +220 -35
  176. package/dist/Tabs/index.js +199 -193
  177. package/dist/Toast/index.d.ts +280 -64
  178. package/dist/Toast/index.js +299 -374
  179. package/dist/Toggle/index.d.ts +55 -35
  180. package/dist/Toggle/index.js +19 -13
  181. package/dist/ToggleGroup/index.d.ts +62 -35
  182. package/dist/ToggleGroup/index.js +13 -31
  183. package/dist/Toolbar/index.d.ts +117 -2
  184. package/dist/Toolbar/index.js +31 -43
  185. package/dist/Tooltip/index.d.ts +507 -150
  186. package/dist/Tooltip/index.js +163 -213
  187. package/dist/index.d.ts +12912 -5382
  188. package/package.json +3 -3
  189. package/dist/2205.js +0 -26
  190. package/dist/2274.js +0 -34
  191. package/dist/2287.js +0 -17
  192. package/dist/3020.js +0 -7
  193. package/dist/3021.js +0 -72
  194. package/dist/3140.js +0 -4
  195. package/dist/3248.js +0 -307
  196. package/dist/4026.js +0 -12
  197. package/dist/4922.js +0 -15
  198. package/dist/5659.js +0 -4
  199. package/dist/5992.js +0 -447
  200. package/dist/6330.js +0 -30
  201. package/dist/6535.js +0 -72
  202. package/dist/6917.js +0 -55
  203. package/dist/7725.js +0 -10
  204. package/dist/7871.js +0 -38
  205. package/dist/8106.js +0 -239
  206. package/dist/8685.js +0 -102
  207. package/dist/8935.js +0 -8
  208. package/dist/8971.js +0 -40
  209. package/dist/8979.js +0 -10
  210. package/dist/9048.js +0 -52
  211. package/dist/9087.js +0 -256
  212. package/dist/9255.js +0 -136
  213. /package/dist/{1457.js → 1068.js} +0 -0
  214. /package/dist/{6003.js → 1234.js} +0 -0
  215. /package/dist/{4723.js → 1282.js} +0 -0
  216. /package/dist/{6825.js → 1876.js} +0 -0
  217. /package/dist/{5778.js → 1885.js} +0 -0
  218. /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
  219. /package/dist/{1279.js → 3278.js} +0 -0
  220. /package/dist/{3296.js → 5568.js} +0 -0
  221. /package/dist/{8685.css → 6240.css} +0 -0
  222. /package/dist/{9829.js → 6488.js} +0 -0
  223. /package/dist/{9863.js → 6534.js} +0 -0
  224. /package/dist/{4495.js → 7718.js} +0 -0
  225. /package/dist/{3395.js → 8866.js} +0 -0
  226. /package/dist/{2418.js → 9837.js} +0 -0
@@ -1,49 +1,54 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useRenderElement, esm_formatErrorMessage } from "../8272.js";
3
- import { useValueAsRef } from "../4707.js";
4
- import { formatNumberValue } from "../6914.js";
5
- import { visuallyHidden } from "../8225.js";
6
- import { valueToPercent } from "../3395.js";
7
- import { useRegisteredLabelId } from "../6706.js";
2
+ import { utils_formatErrorMessage } from "../5473.js";
3
+ import { valueToPercent } from "../8866.js";
4
+ import { clamp } from "../5568.js";
5
+ import { formatNumber } from "../8129.js";
6
+ import { visuallyHidden } from "../6540.js";
7
+ import { useRenderElement } from "../9591.js";
8
+ import { useRegisteredLabelId } from "../1093.js";
8
9
  import * as __rspack_external_react from "react";
9
10
  const ProgressRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
10
11
  if ("production" !== process.env.NODE_ENV) ProgressRootContext.displayName = "ProgressRootContext";
11
12
  function useProgressRootContext() {
12
13
  const context = __rspack_external_react.useContext(ProgressRootContext);
13
- if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.' : esm_formatErrorMessage(51));
14
+ if (void 0 === context) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.' : utils_formatErrorMessage(51));
14
15
  return context;
15
16
  }
16
- let ProgressRootDataAttributes_ProgressRootDataAttributes = /*#__PURE__*/ function(ProgressRootDataAttributes) {
17
- ProgressRootDataAttributes["complete"] = "data-complete";
18
- ProgressRootDataAttributes["indeterminate"] = "data-indeterminate";
19
- ProgressRootDataAttributes["progressing"] = "data-progressing";
20
- return ProgressRootDataAttributes;
21
- }({});
17
+ const complete = 'data-complete';
18
+ const ProgressRootDataAttributes_indeterminate = 'data-indeterminate';
19
+ const progressing = 'data-progressing';
22
20
  const progressStateAttributesMapping = {
23
21
  status (value) {
24
22
  if ('progressing' === value) return {
25
- [ProgressRootDataAttributes_ProgressRootDataAttributes.progressing]: ''
23
+ [progressing]: ''
26
24
  };
27
25
  if ('complete' === value) return {
28
- [ProgressRootDataAttributes_ProgressRootDataAttributes.complete]: ''
26
+ [complete]: ''
29
27
  };
30
28
  if ('indeterminate' === value) return {
31
- [ProgressRootDataAttributes_ProgressRootDataAttributes.indeterminate]: ''
29
+ [ProgressRootDataAttributes_indeterminate]: ''
32
30
  };
33
31
  return null;
34
32
  }
35
33
  };
36
- function getDefaultAriaValueText(formattedValue, value) {
37
- if (null == value) return 'indeterminate progress';
38
- return formattedValue || `${value}%`;
39
- }
40
34
  const ProgressRoot_ProgressRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
41
- const { format, getAriaValueText = getDefaultAriaValueText, locale, max = 100, min = 0, value, render, className, children, style, ...elementProps } = componentProps;
35
+ const { format, getAriaValueText, locale, max = 100, min = 0, value, render, className, children, style, ...elementProps } = componentProps;
42
36
  const [labelId, setLabelId] = __rspack_external_react.useState();
43
- const formatOptionsRef = useValueAsRef(format);
44
37
  let status = 'indeterminate';
45
- if (Number.isFinite(value)) status = value === max ? 'complete' : 'progressing';
46
- const formattedValue = formatNumberValue(value, locale, formatOptionsRef.current);
38
+ let percentageValue = null;
39
+ let clampedValue = null;
40
+ let formattedValue = '';
41
+ let defaultAriaValueText = 'indeterminate progress';
42
+ if (null != value && Number.isFinite(value)) {
43
+ const rawPercentage = valueToPercent(value, min, max);
44
+ percentageValue = clamp(Number.isNaN(rawPercentage) ? 0 : rawPercentage, 0, 100);
45
+ clampedValue = clamp(value, min, max);
46
+ status = clampedValue === max ? 'complete' : 'progressing';
47
+ formattedValue = format ? formatNumber(clampedValue, locale, format) : formatNumber(percentageValue / 100, locale, {
48
+ style: 'percent'
49
+ });
50
+ defaultAriaValueText = formattedValue;
51
+ }
47
52
  const state = __rspack_external_react.useMemo(()=>({
48
53
  status
49
54
  }), [
@@ -53,8 +58,8 @@ const ProgressRoot_ProgressRoot = /*#__PURE__*/ __rspack_external_react.forwardR
53
58
  'aria-labelledby': labelId,
54
59
  'aria-valuemax': max,
55
60
  'aria-valuemin': min,
56
- 'aria-valuenow': value ?? void 0,
57
- 'aria-valuetext': getAriaValueText(formattedValue, value),
61
+ 'aria-valuenow': clampedValue ?? void 0,
62
+ 'aria-valuetext': getAriaValueText ? getAriaValueText(formattedValue, value) : defaultAriaValueText,
58
63
  role: 'progressbar',
59
64
  children: /*#__PURE__*/ jsxs(__rspack_external_react.Fragment, {
60
65
  children: [
@@ -69,19 +74,15 @@ const ProgressRoot_ProgressRoot = /*#__PURE__*/ __rspack_external_react.forwardR
69
74
  };
70
75
  const contextValue = __rspack_external_react.useMemo(()=>({
71
76
  formattedValue,
72
- max,
73
- min,
77
+ percentageValue,
74
78
  setLabelId,
75
79
  state,
76
- status,
77
80
  value
78
81
  }), [
79
82
  formattedValue,
80
- max,
81
- min,
83
+ percentageValue,
82
84
  setLabelId,
83
85
  state,
84
- status,
85
86
  value
86
87
  ]);
87
88
  const element = useRenderElement('div', componentProps, {
@@ -113,8 +114,7 @@ const ProgressTrack_ProgressTrack = /*#__PURE__*/ __rspack_external_react.forwar
113
114
  if ("production" !== process.env.NODE_ENV) ProgressTrack_ProgressTrack.displayName = "ProgressTrack";
114
115
  const ProgressIndicator_ProgressIndicator = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
115
116
  const { render, className, style, ...elementProps } = componentProps;
116
- const { max, min, value, state } = useProgressRootContext();
117
- const percentageValue = Number.isFinite(value) && null !== value ? valueToPercent(value, min, max) : null;
117
+ const { percentageValue, state } = useProgressRootContext();
118
118
  const indicatorStyle = null == percentageValue ? {} : {
119
119
  insetInlineStart: 0,
120
120
  height: 'inherit',
@@ -137,8 +137,9 @@ if ("production" !== process.env.NODE_ENV) ProgressIndicator_ProgressIndicator.d
137
137
  const ProgressValue_ProgressValue = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
138
138
  const { className, render, children, style, ...elementProps } = componentProps;
139
139
  const { value, formattedValue, state } = useProgressRootContext();
140
- const formattedValueArg = null == value ? 'indeterminate' : formattedValue;
141
- const formattedValueDisplay = null == value ? null : formattedValue;
140
+ const indeterminate = 'indeterminate' === state.status;
141
+ const formattedValueArg = indeterminate ? 'indeterminate' : formattedValue;
142
+ const formattedValueDisplay = indeterminate ? null : formattedValue;
142
143
  const element = useRenderElement('span', componentProps, {
143
144
  state,
144
145
  ref: forwardedRef,
@@ -31,6 +31,16 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
31
31
  readonly baseUIHandlerPrevented?: boolean | undefined;
32
32
  };
33
33
 
34
+ /**
35
+ * Present when the radio is checked.
36
+ */
37
+ declare const checked = "data-checked";
38
+
39
+ /**
40
+ * Present when the radio is checked.
41
+ */
42
+ declare const checked_2 = "data-checked";
43
+
34
44
  /**
35
45
  * Shape of the render prop: a function that takes props to be spread on the element and component's state and returns a React element.
36
46
  *
@@ -39,6 +49,31 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
39
49
  */
40
50
  declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
41
51
 
52
+ /**
53
+ * Present when the radio's value has changed (when wrapped in Field.Root).
54
+ */
55
+ declare const dirty = "data-dirty";
56
+
57
+ /**
58
+ * Present when the radio's value has changed (when wrapped in Field.Root).
59
+ */
60
+ declare const dirty_2 = "data-dirty";
61
+
62
+ /**
63
+ * Present when the radio is disabled.
64
+ */
65
+ declare const disabled = "data-disabled";
66
+
67
+ /**
68
+ * Present when the radio is disabled.
69
+ */
70
+ declare const disabled_2 = "data-disabled";
71
+
72
+ /**
73
+ * Present when the radio indicator is animating out.
74
+ */
75
+ declare const endingStyle = "data-ending-style";
76
+
42
77
  declare interface FieldRootState {
43
78
  /**
44
79
  * Whether the component should ignore user interaction.
@@ -66,10 +101,40 @@ declare interface FieldRootState {
66
101
  focused: boolean;
67
102
  }
68
103
 
104
+ /**
105
+ * Present when the radio is checked (when wrapped in Field.Root).
106
+ */
107
+ declare const filled = "data-filled";
108
+
109
+ /**
110
+ * Present when the radio is checked (when wrapped in Field.Root).
111
+ */
112
+ declare const filled_2 = "data-filled";
113
+
114
+ /**
115
+ * Present when the radio is focused (when wrapped in Field.Root).
116
+ */
117
+ declare const focused = "data-focused";
118
+
119
+ /**
120
+ * Present when the radio is focused (when wrapped in Field.Root).
121
+ */
122
+ declare const focused_2 = "data-focused";
123
+
69
124
  declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
70
125
  ref?: React_2.Ref<T> | undefined;
71
126
  };
72
127
 
128
+ /**
129
+ * Present when the radio is in an invalid state (when wrapped in Field.Root).
130
+ */
131
+ declare const invalid = "data-invalid";
132
+
133
+ /**
134
+ * Present when the radio is in an invalid state (when wrapped in Field.Root).
135
+ */
136
+ declare const invalid_2 = "data-invalid";
137
+
73
138
  declare interface NonNativeButtonProps {
74
139
  /**
75
140
  * Whether the component renders a native `<button>` element when replacing it
@@ -98,7 +163,7 @@ export declare namespace Radio_2 {
98
163
  * Indicates whether the radio button is selected.
99
164
  * Renders a `<span>` element.
100
165
  *
101
- * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
166
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio-group)
102
167
  */
103
168
  export declare const RadioIndicator: React_2.ForwardRefExoticComponent<Omit<RadioIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
104
169
 
@@ -107,6 +172,24 @@ export declare namespace RadioIndicator {
107
172
  export type State = RadioIndicatorState;
108
173
  }
109
174
 
175
+ export declare namespace RadioIndicatorDataAttributes {
176
+ export {
177
+ checked_2 as checked,
178
+ unchecked_2 as unchecked,
179
+ disabled_2 as disabled,
180
+ readonly_2 as readonly,
181
+ required_2 as required,
182
+ startingStyle,
183
+ endingStyle,
184
+ valid_2 as valid,
185
+ invalid_2 as invalid,
186
+ touched_2 as touched,
187
+ dirty_2 as dirty,
188
+ filled_2 as filled,
189
+ focused_2 as focused
190
+ }
191
+ }
192
+
110
193
  export declare interface RadioIndicatorProps extends BaseUIComponentProps<'span', RadioIndicatorState> {
111
194
  /**
112
195
  * Whether to keep the HTML element in the DOM when the radio button is inactive.
@@ -115,11 +198,7 @@ export declare interface RadioIndicatorProps extends BaseUIComponentProps<'span'
115
198
  keepMounted?: boolean | undefined;
116
199
  }
117
200
 
118
- export declare interface RadioIndicatorState {
119
- /**
120
- * Whether the radio button is currently selected.
121
- */
122
- checked: boolean;
201
+ export declare interface RadioIndicatorState extends RadioRootState {
123
202
  /**
124
203
  * The transition status of the component.
125
204
  */
@@ -130,7 +209,7 @@ export declare interface RadioIndicatorState {
130
209
  * Represents the radio button itself.
131
210
  * Renders a `<span>` element and a hidden `<input>` beside.
132
211
  *
133
- * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
212
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio-group)
134
213
  */
135
214
  export declare const RadioRoot: {
136
215
  <Value>(props: RadioRoot.Props<Value>): React_2.JSX.Element;
@@ -141,6 +220,22 @@ export declare namespace RadioRoot {
141
220
  export type Props<TValue = any> = RadioRootProps<TValue>;
142
221
  }
143
222
 
223
+ export declare namespace RadioRootDataAttributes {
224
+ export {
225
+ checked,
226
+ unchecked,
227
+ disabled,
228
+ readonly,
229
+ required,
230
+ valid,
231
+ invalid,
232
+ touched,
233
+ dirty,
234
+ filled,
235
+ focused
236
+ }
237
+ }
238
+
144
239
  export declare interface RadioRootProps<Value = any> extends NonNativeButtonProps, Omit<BaseUIComponentProps<'span', RadioRootState>, 'value'> {
145
240
  /**
146
241
  * The unique identifying value of the radio in a group.
@@ -181,6 +276,26 @@ export declare interface RadioRootState extends FieldRootState {
181
276
  * Whether the user must choose a value before submitting a form.
182
277
  */
183
278
  required: boolean;
279
+ /**
280
+ * Whether the radio button has been touched (when wrapped in Field.Root).
281
+ */
282
+ touched: boolean;
283
+ /**
284
+ * Whether the radio button's value has changed from its initial value (when wrapped in Field.Root).
285
+ */
286
+ dirty: boolean;
287
+ /**
288
+ * Whether the radio button is in a valid state (when wrapped in Field.Root).
289
+ */
290
+ valid: boolean | null;
291
+ /**
292
+ * Whether the radio button has a value (when wrapped in Field.Root).
293
+ */
294
+ filled: boolean;
295
+ /**
296
+ * Whether the radio button is focused (when wrapped in Field.Root).
297
+ */
298
+ focused: boolean;
184
299
  }
185
300
 
186
301
  export declare const RadioSize: {
@@ -189,14 +304,69 @@ export declare const RadioSize: {
189
304
  readonly large: 20;
190
305
  };
191
306
 
307
+ /**
308
+ * Present when the radio is readonly.
309
+ */
310
+ declare const readonly = "data-readonly";
311
+
312
+ /**
313
+ * Present when the radio is readonly.
314
+ */
315
+ declare const readonly_2 = "data-readonly";
316
+
317
+ /**
318
+ * Present when the radio is required.
319
+ */
320
+ declare const required = "data-required";
321
+
322
+ /**
323
+ * Present when the radio is required.
324
+ */
325
+ declare const required_2 = "data-required";
326
+
192
327
  declare function Root<Value>({ className, size, style, ...props }: RootProps<Value>): JSX_2.Element;
193
328
 
194
329
  declare type RootProps<Value> = WithStringClassName<Radio_2.Root.Props<Value>> & {
195
330
  size?: number;
196
331
  };
197
332
 
333
+ /**
334
+ * Present when the radio indicator begins animating in.
335
+ */
336
+ declare const startingStyle = "data-starting-style";
337
+
338
+ /**
339
+ * Present when the radio has been touched (when wrapped in Field.Root).
340
+ */
341
+ declare const touched = "data-touched";
342
+
343
+ /**
344
+ * Present when the radio has been touched (when wrapped in Field.Root).
345
+ */
346
+ declare const touched_2 = "data-touched";
347
+
198
348
  declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
199
349
 
350
+ /**
351
+ * Present when the radio is not checked.
352
+ */
353
+ declare const unchecked = "data-unchecked";
354
+
355
+ /**
356
+ * Present when the radio is not checked.
357
+ */
358
+ declare const unchecked_2 = "data-unchecked";
359
+
360
+ /**
361
+ * Present when the radio is in a valid state (when wrapped in Field.Root).
362
+ */
363
+ declare const valid = "data-valid";
364
+
365
+ /**
366
+ * Present when the radio is in a valid state (when wrapped in Field.Root).
367
+ */
368
+ declare const valid_2 = "data-valid";
369
+
200
370
  /**
201
371
  * Adds a `preventBaseUIHandler` method to all event handlers.
202
372
  */
@@ -1,45 +1,34 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
- import { transitionStatusMapping, useOpenChangeComplete } from "../9369.js";
4
- import { useLabelableContext, fieldValidityMapping, useFieldRootContext } from "../1477.js";
5
- import { esm_formatErrorMessage, EMPTY_OBJECT, useMergedRefs, useRenderElement, NOOP } from "../8272.js";
6
- import { useRadioGroupContext } from "../1279.js";
7
- import { useFieldItemContext } from "../1457.js";
8
- import { useStableCallback } from "../7541.js";
9
- import { useIsoLayoutEffect } from "../6499.js";
10
- import { useBaseUiId } from "../6046.js";
11
- import { useLabelableId } from "../9048.js";
12
- import { useAriaLabelledBy } from "../4490.js";
13
- import { ACTIVE_COMPOSITE_ITEM } from "../4346.js";
14
- import { getWindow } from "../3829.js";
15
- import { useButton } from "../9189.js";
16
- import { visuallyHiddenInput, visuallyHidden } from "../8225.js";
17
- import { serializeValue } from "../5778.js";
18
- import { createChangeEventDetails } from "../4768.js";
19
- import { CompositeItem } from "../951.js";
20
- import { useTransitionStatus } from "../4863.js";
3
+ import { transitionStatusMapping } from "../8488.js";
4
+ import { useLabelableContext, fieldValidityMapping, useFieldRootContext } from "../201.js";
5
+ import { utils_formatErrorMessage } from "../5473.js";
6
+ import { useRadioGroupContext } from "../3278.js";
7
+ import { EMPTY_OBJECT, useMergedRefs, useRenderElement, NOOP } from "../9591.js";
8
+ import { useFieldItemContext } from "../1068.js";
9
+ import { useSetFieldFocused } from "../5890.js";
10
+ import { useIsoLayoutEffect } from "../3357.js";
11
+ import { useBaseUiId } from "../5969.js";
12
+ import { useLabelableId } from "../6551.js";
13
+ import { useAriaLabelledBy } from "../6373.js";
14
+ import { ACTIVE_COMPOSITE_ITEM } from "../1629.js";
15
+ import { dispatchClickWithModifiers, useButton } from "../9248.js";
16
+ import { visuallyHiddenInput, visuallyHidden } from "../6540.js";
17
+ import { serializeValue } from "../1885.js";
18
+ import { createChangeEventDetails } from "../8495.js";
19
+ import { CompositeItem } from "../7270.js";
20
+ import { useTransitionStatus } from "../7542.js";
21
+ import { useOpenChangeComplete } from "../6620.js";
21
22
  import * as __rspack_external_react from "react";
22
- let RadioRootDataAttributes_RadioRootDataAttributes = /*#__PURE__*/ function(RadioRootDataAttributes) {
23
- RadioRootDataAttributes["checked"] = "data-checked";
24
- RadioRootDataAttributes["unchecked"] = "data-unchecked";
25
- RadioRootDataAttributes["disabled"] = "data-disabled";
26
- RadioRootDataAttributes["readonly"] = "data-readonly";
27
- RadioRootDataAttributes["required"] = "data-required";
28
- RadioRootDataAttributes["valid"] = "data-valid";
29
- RadioRootDataAttributes["invalid"] = "data-invalid";
30
- RadioRootDataAttributes["touched"] = "data-touched";
31
- RadioRootDataAttributes["dirty"] = "data-dirty";
32
- RadioRootDataAttributes["filled"] = "data-filled";
33
- RadioRootDataAttributes["focused"] = "data-focused";
34
- return RadioRootDataAttributes;
35
- }({});
23
+ const RadioRootDataAttributes_checked = 'data-checked';
24
+ const unchecked = 'data-unchecked';
36
25
  const stateAttributesMapping = {
37
26
  checked (value) {
38
27
  if (value) return {
39
- [RadioRootDataAttributes_RadioRootDataAttributes.checked]: ''
28
+ [RadioRootDataAttributes_checked]: ''
40
29
  };
41
30
  return {
42
- [RadioRootDataAttributes_RadioRootDataAttributes.unchecked]: ''
31
+ [unchecked]: ''
43
32
  };
44
33
  },
45
34
  ...transitionStatusMapping,
@@ -49,18 +38,14 @@ const RadioRootContext = /*#__PURE__*/ __rspack_external_react.createContext(voi
49
38
  if ("production" !== process.env.NODE_ENV) RadioRootContext.displayName = "RadioRootContext";
50
39
  function useRadioRootContext() {
51
40
  const value = __rspack_external_react.useContext(RadioRootContext);
52
- if (void 0 === value) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>.' : esm_formatErrorMessage(52));
41
+ if (void 0 === value) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>.' : utils_formatErrorMessage(52));
53
42
  return value;
54
43
  }
55
44
  const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
56
45
  const { render, className, disabled: disabledProp = false, readOnly: readOnlyProp = false, required: requiredProp = false, 'aria-labelledby': ariaLabelledByProp, value, inputRef: inputRefProp, nativeButton = false, id: idProp, style, ...elementProps } = componentProps;
57
46
  const groupContext = useRadioGroupContext();
58
- const { disabled: disabledGroup, readOnly: readOnlyGroup, required: requiredGroup, form: formGroup, checkedValue, touched = false, validation, name } = groupContext ?? {};
59
- const setCheckedValue = groupContext?.setCheckedValue ?? NOOP;
60
- const setTouched = groupContext?.setTouched ?? NOOP;
61
- const registerControlRef = groupContext?.registerControlRef ?? NOOP;
62
- const registerInputRef = groupContext?.registerInputRef ?? NOOP;
63
- const { setDirty, validityData, setTouched: setFieldTouched, setFilled, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
47
+ const { disabled: disabledGroup, readOnly: readOnlyGroup, required: requiredGroup, form: formGroup, checkedValue, touched = false, validation, name, setCheckedValue = NOOP, setTouched = NOOP, registerInputRef = NOOP } = groupContext ?? {};
48
+ const { setTouched: setFieldTouched, setFilled, state: fieldState, disabled: fieldDisabled } = useFieldRootContext();
64
49
  const fieldItemContext = useFieldItemContext();
65
50
  const { labelId, getDescriptionProps } = useLabelableContext();
66
51
  const disabled = fieldDisabled || fieldItemContext.disabled || disabledGroup || disabledProp;
@@ -69,12 +54,16 @@ const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(fun
69
54
  const form = formGroup;
70
55
  const checked = groupContext ? checkedValue === value : '' === value;
71
56
  const radioRef = __rspack_external_react.useRef(null);
57
+ const setFieldFocused = useSetFieldFocused(disabled, radioRef);
72
58
  const inputRef = __rspack_external_react.useRef(null);
73
- const handleControlRef = useStableCallback((element)=>{
74
- if (!element) return;
75
- registerControlRef(element, disabled);
76
- });
77
- const mergedInputRef = useMergedRefs(inputRefProp, inputRef, registerInputRef);
59
+ const registerFieldInput = validation?.registerInput;
60
+ const registerInput = __rspack_external_react.useCallback((element)=>registerFieldInput?.(element, {
61
+ controlRef: radioRef,
62
+ value: void 0
63
+ }), [
64
+ registerFieldInput
65
+ ]);
66
+ const mergedInputRef = useMergedRefs(inputRefProp, inputRef, registerInputRef, registerInput);
78
67
  useIsoLayoutEffect(()=>{
79
68
  if (inputRef.current?.checked) setFilled(true);
80
69
  }, [
@@ -83,27 +72,21 @@ const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(fun
83
72
  useIsoLayoutEffect(()=>{
84
73
  if (!inputRef.current) return;
85
74
  if (disabled && checked) return void registerInputRef(null);
86
- if (radioRef.current) registerControlRef(radioRef.current, disabled);
87
75
  registerInputRef(inputRef.current);
88
76
  }, [
89
77
  checked,
90
78
  disabled,
91
- registerControlRef,
92
79
  registerInputRef
93
80
  ]);
94
81
  const id = useBaseUiId();
95
82
  const inputId = useLabelableId({
96
- id: idProp,
97
- implicit: false,
98
- controlRef: radioRef
83
+ id: idProp
99
84
  });
100
85
  const hiddenInputId = nativeButton ? void 0 : inputId;
101
- const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);
86
+ const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId, elementProps['aria-label']);
102
87
  const rootProps = {
103
88
  role: 'radio',
104
89
  'aria-checked': checked,
105
- 'aria-required': required || void 0,
106
- 'aria-readonly': readOnly || void 0,
107
90
  'aria-labelledby': ariaLabelledBy,
108
91
  [ACTIVE_COMPOSITE_ITEM]: checked ? '' : void 0,
109
92
  id: nativeButton ? inputId : id,
@@ -115,23 +98,22 @@ const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(fun
115
98
  event.preventDefault();
116
99
  const input = inputRef.current;
117
100
  if (!input) return;
118
- input.dispatchEvent(new (getWindow(input)).PointerEvent('click', {
119
- bubbles: true,
120
- shiftKey: event.shiftKey,
121
- ctrlKey: event.ctrlKey,
122
- altKey: event.altKey,
123
- metaKey: event.metaKey
124
- }));
101
+ dispatchClickWithModifiers(input, event);
125
102
  },
126
103
  onFocus (event) {
104
+ setFieldFocused(true);
127
105
  if (event.defaultPrevented || disabled || readOnly || !touched) return;
128
106
  inputRef.current?.click();
129
107
  setTouched(false);
108
+ },
109
+ onBlur () {
110
+ if (!groupContext) setFieldFocused(false);
130
111
  }
131
112
  };
132
113
  const { getButtonProps, buttonRef } = useButton({
133
114
  disabled,
134
- native: nativeButton
115
+ native: nativeButton,
116
+ composite: false
135
117
  });
136
118
  const inputProps = {
137
119
  type: 'radio',
@@ -153,11 +135,12 @@ const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(fun
153
135
  if (event.nativeEvent.defaultPrevented) return;
154
136
  if (disabled || readOnly || void 0 === value) return;
155
137
  const details = createChangeEventDetails("none", event.nativeEvent);
138
+ setCheckedValue(value, details);
156
139
  if (details.isCanceled) return;
157
140
  setFieldTouched(true);
158
- setDirty(value !== validityData.initialValue);
159
- setFilled(true);
160
- setCheckedValue(value, details);
141
+ },
142
+ onClick (event) {
143
+ event.stopPropagation();
161
144
  },
162
145
  onFocus () {
163
146
  radioRef.current?.focus();
@@ -181,15 +164,14 @@ const RadioRoot_RadioRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(fun
181
164
  const refs = [
182
165
  forwardedRef,
183
166
  radioRef,
184
- buttonRef,
185
- handleControlRef
167
+ buttonRef
186
168
  ];
187
169
  const props = [
188
170
  rootProps,
189
- getDescriptionProps,
190
- validation?.getValidationProps ?? EMPTY_OBJECT,
191
171
  elementProps,
192
- getButtonProps
172
+ getButtonProps,
173
+ getDescriptionProps,
174
+ validation ? (validationProps)=>validation.getValidationProps(disabled, validationProps) : EMPTY_OBJECT
193
175
  ];
194
176
  const element = useRenderElement('span', componentProps, {
195
177
  enabled: !isRadioGroup,
@@ -240,6 +222,8 @@ const RadioIndicator_RadioIndicator = /*#__PURE__*/ __rspack_external_react.forw
240
222
  stateAttributesMapping: stateAttributesMapping
241
223
  });
242
224
  useOpenChangeComplete({
225
+ batch: true,
226
+ enabled: !rendered,
243
227
  open: rendered,
244
228
  ref: indicatorRef,
245
229
  onComplete () {
@@ -1,4 +1,4 @@
1
- @import "../8685.css";
1
+ @import "../6240.css";
2
2
  @import "../Field/index.css";
3
3
  @import "../Radio/index.css";
4
4
  .fieldItem-RyE1Xd {
@@ -237,7 +237,7 @@ export declare type RadioFieldVariant = 'default' | 'box';
237
237
  * Indicates whether the radio button is selected.
238
238
  * Renders a `<span>` element.
239
239
  *
240
- * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
240
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio-group)
241
241
  */
242
242
  declare const RadioIndicator: React_2.ForwardRefExoticComponent<Omit<RadioIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
243
243
 
@@ -254,11 +254,7 @@ declare interface RadioIndicatorProps extends BaseUIComponentProps<'span', Radio
254
254
  keepMounted?: boolean | undefined;
255
255
  }
256
256
 
257
- declare interface RadioIndicatorState {
258
- /**
259
- * Whether the radio button is currently selected.
260
- */
261
- checked: boolean;
257
+ declare interface RadioIndicatorState extends RadioRootState {
262
258
  /**
263
259
  * The transition status of the component.
264
260
  */
@@ -269,7 +265,7 @@ declare interface RadioIndicatorState {
269
265
  * Represents the radio button itself.
270
266
  * Renders a `<span>` element and a hidden `<input>` beside.
271
267
  *
272
- * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
268
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio-group)
273
269
  */
274
270
  declare const RadioRoot: {
275
271
  <Value>(props: RadioRoot.Props<Value>): React_2.JSX.Element;
@@ -324,6 +320,26 @@ declare interface RadioRootState extends FieldRootState {
324
320
  * Whether the user must choose a value before submitting a form.
325
321
  */
326
322
  required: boolean;
323
+ /**
324
+ * Whether the radio button has been touched (when wrapped in Field.Root).
325
+ */
326
+ touched: boolean;
327
+ /**
328
+ * Whether the radio button's value has changed from its initial value (when wrapped in Field.Root).
329
+ */
330
+ dirty: boolean;
331
+ /**
332
+ * Whether the radio button is in a valid state (when wrapped in Field.Root).
333
+ */
334
+ valid: boolean | null;
335
+ /**
336
+ * Whether the radio button has a value (when wrapped in Field.Root).
337
+ */
338
+ filled: boolean;
339
+ /**
340
+ * Whether the radio button is focused (when wrapped in Field.Root).
341
+ */
342
+ focused: boolean;
327
343
  }
328
344
 
329
345
  declare function Root<Value>({ className, size, style, ...props }: RootProps<Value>): JSX_2.Element;