@wix/site-ui 1.30.0 → 1.32.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 (173) hide show
  1. package/dist/1268.js +99 -0
  2. package/dist/1279.js +7 -0
  3. package/dist/1457.js +10 -0
  4. package/dist/1477.js +106 -0
  5. package/dist/1500.js +111 -0
  6. package/dist/167.js +6 -0
  7. package/dist/2274.js +34 -0
  8. package/dist/2287.js +17 -0
  9. package/dist/2418.js +31 -0
  10. package/dist/2801.js +20 -0
  11. package/dist/285.js +86 -0
  12. package/dist/2861.js +6 -0
  13. package/dist/3020.js +7 -0
  14. package/dist/3021.js +72 -0
  15. package/dist/3056.js +229 -0
  16. package/dist/3140.js +4 -0
  17. package/dist/3248.js +307 -0
  18. package/dist/3296.js +4 -0
  19. package/dist/3319.js +400 -0
  20. package/dist/3395.js +4 -0
  21. package/dist/3485.js +854 -0
  22. package/dist/353.js +14 -0
  23. package/dist/3670.js +418 -0
  24. package/dist/3829.js +113 -0
  25. package/dist/4026.js +12 -0
  26. package/dist/4143.js +46 -0
  27. package/dist/42.js +32 -0
  28. package/dist/4281.js +30 -0
  29. package/dist/4346.js +2 -0
  30. package/dist/4388.js +418 -0
  31. package/dist/4490.js +32 -0
  32. package/dist/4495.js +9 -0
  33. package/dist/4549.js +24 -0
  34. package/dist/4586.js +41 -0
  35. package/dist/4586.js.LICENSE.txt +19 -0
  36. package/dist/4707.js +19 -0
  37. package/dist/4723.js +7 -0
  38. package/dist/4745.js +7 -0
  39. package/dist/4768.js +35 -0
  40. package/dist/4922.js +15 -0
  41. package/dist/5036.js +17 -0
  42. package/dist/5085.js +20 -0
  43. package/dist/5299.js +597 -0
  44. package/dist/5659.js +4 -0
  45. package/dist/5778.js +10 -0
  46. package/dist/5864.js +86 -0
  47. package/dist/5992.js +913 -0
  48. package/dist/5992.js.LICENSE.txt +19 -0
  49. package/dist/6003.js +10 -0
  50. package/dist/6046.js +29 -0
  51. package/dist/6089.js +2355 -0
  52. package/dist/6107.js +10 -0
  53. package/dist/6247.js +20 -0
  54. package/dist/6270.js +487 -0
  55. package/dist/6329.js +32 -0
  56. package/dist/6330.js +30 -0
  57. package/dist/6499.js +7 -0
  58. package/dist/6535.js +71 -0
  59. package/dist/6588.js +382 -0
  60. package/dist/6706.js +16 -0
  61. package/dist/6825.js +7 -0
  62. package/dist/6882.js +1562 -0
  63. package/dist/6914.js +30 -0
  64. package/dist/7021.js +13 -0
  65. package/dist/7366.js +83 -0
  66. package/dist/7373.js +25 -0
  67. package/dist/7541.js +25 -0
  68. package/dist/7564.js +10 -0
  69. package/dist/7642.js +20 -0
  70. package/dist/7725.js +10 -0
  71. package/dist/7871.js +38 -0
  72. package/dist/8052.js +352 -0
  73. package/dist/8106.js +238 -0
  74. package/dist/8171.js +346 -0
  75. package/dist/8225.js +21 -0
  76. package/dist/8272.js +333 -0
  77. package/dist/8527.js +58 -0
  78. package/dist/8724.js +10 -0
  79. package/dist/8750.js +1920 -0
  80. package/dist/8758.js +43 -0
  81. package/dist/880.js +149 -0
  82. package/dist/8935.js +8 -0
  83. package/dist/8960.js +22 -0
  84. package/dist/8971.js +40 -0
  85. package/dist/8979.js +10 -0
  86. package/dist/8996.js +71 -0
  87. package/dist/904.js +121 -0
  88. package/dist/9048.js +52 -0
  89. package/dist/9087.js +256 -0
  90. package/dist/9189.js +158 -0
  91. package/dist/9255.js +136 -0
  92. package/dist/9352.js +148 -0
  93. package/dist/951.js +22 -0
  94. package/dist/9635.js +22 -0
  95. package/dist/9829.js +4 -0
  96. package/dist/9863.js +8 -0
  97. package/dist/Accordion/index.d.ts +569 -12
  98. package/dist/Accordion/index.js +423 -8
  99. package/dist/AlertDialog/index.d.ts +1417 -18
  100. package/dist/AlertDialog/index.js +34 -14
  101. package/dist/Autocomplete/index.d.ts +1861 -38
  102. package/dist/Autocomplete/index.js +98 -24
  103. package/dist/Avatar/index.d.ts +129 -7
  104. package/dist/Avatar/index.js +149 -6
  105. package/dist/Breadcrumbs/index.d.ts +960 -7
  106. package/dist/Breadcrumbs/index.js +5 -5
  107. package/dist/Button/index.d.ts +88 -6
  108. package/dist/Button/index.js +27 -3
  109. package/dist/Checkbox/index.d.ts +425 -5
  110. package/dist/Checkbox/index.js +45 -5
  111. package/dist/CheckboxGroup/index.d.ts +318 -3
  112. package/dist/CheckboxGroup/index.js +166 -3
  113. package/dist/Collapsible/index.d.ts +377 -7
  114. package/dist/Collapsible/index.js +160 -6
  115. package/dist/Combobox/index.d.ts +1984 -48
  116. package/dist/Combobox/index.js +352 -29
  117. package/dist/ContextMenu/index.d.ts +2340 -36
  118. package/dist/ContextMenu/index.js +197 -22
  119. package/dist/Dialog/index.d.ts +1355 -18
  120. package/dist/Dialog/index.js +16 -14
  121. package/dist/Drawer/index.d.ts +1653 -18
  122. package/dist/Drawer/index.js +2797 -20
  123. package/dist/Field/index.d.ts +655 -15
  124. package/dist/Field/index.js +677 -10
  125. package/dist/Fieldset/index.d.ts +94 -5
  126. package/dist/Fieldset/index.js +68 -5
  127. package/dist/Form/index.d.ts +331 -2
  128. package/dist/Form/index.js +106 -3
  129. package/dist/Input/index.d.ts +692 -3
  130. package/dist/Input/index.js +10 -3
  131. package/dist/Menu/index.d.ts +2301 -36
  132. package/dist/Menu/index.js +365 -26
  133. package/dist/Menubar/index.d.ts +2301 -3
  134. package/dist/Menubar/index.js +105 -3
  135. package/dist/Meter/index.d.ts +175 -11
  136. package/dist/Meter/index.js +129 -9
  137. package/dist/NavigationMenu/index.d.ts +978 -28
  138. package/dist/NavigationMenu/index.js +1034 -17
  139. package/dist/NumberField/index.d.ts +612 -15
  140. package/dist/NumberField/index.js +1409 -11
  141. package/dist/Popover/index.d.ts +1655 -20
  142. package/dist/Popover/index.js +792 -17
  143. package/dist/PreviewCard/index.d.ts +1523 -14
  144. package/dist/PreviewCard/index.js +679 -14
  145. package/dist/Progress/index.d.ts +183 -11
  146. package/dist/Progress/index.js +181 -9
  147. package/dist/Radio/index.d.ts +185 -6
  148. package/dist/Radio/index.js +253 -6
  149. package/dist/RadioGroup/index.d.ts +341 -2
  150. package/dist/RadioGroup/index.js +154 -3
  151. package/dist/ScrollArea/index.d.ts +265 -13
  152. package/dist/ScrollArea/index.js +892 -10
  153. package/dist/Select/index.d.ts +1493 -38
  154. package/dist/Select/index.js +1824 -23
  155. package/dist/Separator/index.d.ts +80 -6
  156. package/dist/Separator/index.js +3 -3
  157. package/dist/Slider/index.d.ts +678 -16
  158. package/dist/Slider/index.js +1199 -11
  159. package/dist/Switch/index.d.ts +393 -5
  160. package/dist/Switch/index.js +208 -6
  161. package/dist/Tabs/index.d.ts +523 -12
  162. package/dist/Tabs/index.js +685 -9
  163. package/dist/Toggle/index.d.ts +305 -2
  164. package/dist/Toggle/index.js +76 -3
  165. package/dist/ToggleGroup/index.d.ts +316 -2
  166. package/dist/ToggleGroup/index.js +102 -3
  167. package/dist/Toolbar/index.d.ts +282 -13
  168. package/dist/Toolbar/index.js +230 -9
  169. package/dist/Tooltip/index.d.ts +1572 -14
  170. package/dist/Tooltip/index.js +965 -14
  171. package/dist/index.d.ts +12749 -652
  172. package/dist/rslib-runtime.js +18 -0
  173. package/package.json +3 -3
@@ -1,30 +1,160 @@
1
- import { ProgressIndicatorProps } from '@base-ui/react/progress';
2
- import { ProgressLabelProps } from '@base-ui/react/progress';
3
- import { ProgressRootProps } from '@base-ui/react/progress';
4
- import { ProgressTrackProps } from '@base-ui/react/progress';
5
- import { ProgressValueProps } from '@base-ui/react/progress';
1
+ import { ProgressIndicatorProps as ProgressIndicatorProps_2 } from '@base-ui/react/progress';
2
+ import { ProgressLabelProps as ProgressLabelProps_2 } from '@base-ui/react/progress';
3
+ import { ProgressRootProps as ProgressRootProps_2 } from '@base-ui/react/progress';
4
+ import { ProgressTrackProps as ProgressTrackProps_2 } from '@base-ui/react/progress';
5
+ import { ProgressValueProps as ProgressValueProps_2 } from '@base-ui/react/progress';
6
6
  import * as React_2 from 'react';
7
7
 
8
+ /**
9
+ * Props shared by all Base UI components.
10
+ * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
11
+ */
12
+ declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
13
+ /**
14
+ * CSS class applied to the element, or a function that
15
+ * returns a class based on the component's state.
16
+ */
17
+ className?: string | ((state: State) => string | undefined) | undefined;
18
+ /**
19
+ * Allows you to replace the component's HTML element
20
+ * with a different tag, or compose it with another component.
21
+ *
22
+ * Accepts a `ReactElement` or a function that returns the element to render.
23
+ */
24
+ render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
25
+ /**
26
+ * Style applied to the element, or a function that
27
+ * returns a style object based on the component's state.
28
+ */
29
+ style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
30
+ };
31
+
32
+ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
33
+ preventBaseUIHandler: () => void;
34
+ readonly baseUIHandlerPrevented?: boolean | undefined;
35
+ };
36
+
37
+ /**
38
+ * 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.
39
+ *
40
+ * @template Props Props to be spread on the rendered element.
41
+ * @template State Component's internal state.
42
+ */
43
+ declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
44
+
45
+ declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
46
+ ref?: React_2.Ref<T> | undefined;
47
+ };
48
+
8
49
  export declare const Progress: {
9
- Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
50
+ Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
10
51
  className?: string | undefined;
11
52
  } & {
12
53
  size?: number | undefined;
13
54
  } & React_2.RefAttributes<HTMLDivElement>>;
14
- Track: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressTrackProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
55
+ Track: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressTrackProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
15
56
  className?: string | undefined;
16
57
  } & React_2.RefAttributes<HTMLDivElement>>;
17
- Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressIndicatorProps, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
58
+ Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
18
59
  className?: string | undefined;
19
60
  } & React_2.RefAttributes<HTMLDivElement>>;
20
- Value: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressValueProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
61
+ Value: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressValueProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
21
62
  className?: string | undefined;
22
63
  } & React_2.RefAttributes<HTMLSpanElement>>;
23
- Label: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressLabelProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
64
+ Label: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ProgressLabelProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
24
65
  className?: string | undefined;
25
66
  } & React_2.RefAttributes<HTMLSpanElement>>;
26
67
  };
27
68
 
69
+ /**
70
+ * Visualizes the completion status of the task.
71
+ * Renders a `<div>` element.
72
+ *
73
+ * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
74
+ */
75
+ export declare const ProgressIndicator: React_2.ForwardRefExoticComponent<Omit<ProgressIndicatorProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
76
+
77
+ export declare namespace ProgressIndicator {
78
+ export type State = ProgressIndicatorState;
79
+ export type Props = ProgressIndicatorProps;
80
+ }
81
+
82
+ export declare interface ProgressIndicatorProps extends BaseUIComponentProps<'div', ProgressIndicatorState> {}
83
+
84
+ export declare interface ProgressIndicatorState extends ProgressRootState {}
85
+
86
+ /**
87
+ * An accessible label for the progress bar.
88
+ * Renders a `<span>` element.
89
+ *
90
+ * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
91
+ */
92
+ export declare const ProgressLabel: React_2.ForwardRefExoticComponent<Omit<ProgressLabelProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
93
+
94
+ export declare namespace ProgressLabel {
95
+ export type State = ProgressLabelState;
96
+ export type Props = ProgressLabelProps;
97
+ }
98
+
99
+ export declare interface ProgressLabelProps extends BaseUIComponentProps<'span', ProgressLabelState> {}
100
+
101
+ export declare interface ProgressLabelState extends ProgressRootState {}
102
+
103
+ /**
104
+ * Groups all parts of the progress bar and provides the task completion status to screen readers.
105
+ * Renders a `<div>` element.
106
+ *
107
+ * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
108
+ */
109
+ export declare const ProgressRoot: React_2.ForwardRefExoticComponent<Omit<ProgressRootProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
110
+
111
+ export declare namespace ProgressRoot {
112
+ export type State = ProgressRootState;
113
+ export type Props = ProgressRootProps;
114
+ }
115
+
116
+ export declare interface ProgressRootProps extends BaseUIComponentProps<'div', ProgressRootState> {
117
+ /**
118
+ * A string value that provides a user-friendly name for `aria-valuenow`, the current value of the progress bar.
119
+ */
120
+ 'aria-valuetext'?: React_2.AriaAttributes['aria-valuetext'] | undefined;
121
+ /**
122
+ * Options to format the value.
123
+ */
124
+ format?: Intl.NumberFormatOptions | undefined;
125
+ /**
126
+ * Accepts a function which returns a string value that provides a human-readable text alternative for the current value of the progress bar.
127
+ */
128
+ getAriaValueText?: ((formattedValue: string | null, value: number | null) => string) | undefined;
129
+ /**
130
+ * The locale used by `Intl.NumberFormat` when formatting the value.
131
+ * Defaults to the user's runtime locale.
132
+ */
133
+ locale?: Intl.LocalesArgument | undefined;
134
+ /**
135
+ * The maximum value.
136
+ * @default 100
137
+ */
138
+ max?: number | undefined;
139
+ /**
140
+ * The minimum value.
141
+ * @default 0
142
+ */
143
+ min?: number | undefined;
144
+ /**
145
+ * The current value. The component is indeterminate when value is `null`.
146
+ * @default null
147
+ */
148
+ value: number | null;
149
+ }
150
+
151
+ export declare interface ProgressRootState {
152
+ /**
153
+ * The current status.
154
+ */
155
+ status: ProgressStatus;
156
+ }
157
+
28
158
  export declare const ProgressSize: {
29
159
  readonly thin: 4;
30
160
  readonly small: 6;
@@ -32,7 +162,49 @@ export declare const ProgressSize: {
32
162
  readonly large: 12;
33
163
  };
34
164
 
165
+ export declare type ProgressStatus = 'indeterminate' | 'progressing' | 'complete';
166
+
167
+ /**
168
+ * Contains the progress bar indicator.
169
+ * Renders a `<div>` element.
170
+ *
171
+ * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
172
+ */
173
+ export declare const ProgressTrack: React_2.ForwardRefExoticComponent<Omit<ProgressTrackProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
174
+
175
+ export declare namespace ProgressTrack {
176
+ export type State = ProgressTrackState;
177
+ export type Props = ProgressTrackProps;
178
+ }
179
+
180
+ export declare interface ProgressTrackProps extends BaseUIComponentProps<'div', ProgressTrackState> {}
181
+
182
+ export declare interface ProgressTrackState extends ProgressRootState {}
183
+
184
+ /**
185
+ * A text label displaying the current value.
186
+ * Renders a `<span>` element.
187
+ *
188
+ * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)
189
+ */
190
+ export declare const ProgressValue: React_2.ForwardRefExoticComponent<Omit<ProgressValueProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
191
+
192
+ export declare namespace ProgressValue {
193
+ export type State = ProgressValueState;
194
+ export type Props = ProgressValueProps;
195
+ }
196
+
197
+ export declare interface ProgressValueProps extends Omit<BaseUIComponentProps<'span', ProgressValueState>, 'children'> {
198
+ children?: null | ((formattedValue: string | null, value: number | null) => React_2.ReactNode) | undefined;
199
+ }
200
+
201
+ export declare interface ProgressValueState extends ProgressRootState {}
202
+
203
+ /**
204
+ * Adds a `preventBaseUIHandler` method to all event handlers.
205
+ */
206
+ declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
35
207
 
36
- export * from "@base-ui/react/progress";
208
+ declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
37
209
 
38
210
  export { }
@@ -1,7 +1,179 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Progress } from "@base-ui/react/progress";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import clsx from "clsx";
3
+ import { useRenderElement, esm_formatErrorMessage } from "../8272.js";
4
+ import { useValueAsRef } from "../4707.js";
5
+ import { formatNumberValue } from "../6914.js";
6
+ import { visuallyHidden } from "../8225.js";
7
+ import { valueToPercent } from "../3395.js";
8
+ import { useRegisteredLabelId } from "../6706.js";
4
9
  import * as __rspack_external_react from "react";
10
+ const ProgressRootContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
11
+ if ("production" !== process.env.NODE_ENV) ProgressRootContext.displayName = "ProgressRootContext";
12
+ function useProgressRootContext() {
13
+ const context = __rspack_external_react.useContext(ProgressRootContext);
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>.' : esm_formatErrorMessage(51));
15
+ return context;
16
+ }
17
+ let ProgressRootDataAttributes_ProgressRootDataAttributes = /*#__PURE__*/ function(ProgressRootDataAttributes) {
18
+ ProgressRootDataAttributes["complete"] = "data-complete";
19
+ ProgressRootDataAttributes["indeterminate"] = "data-indeterminate";
20
+ ProgressRootDataAttributes["progressing"] = "data-progressing";
21
+ return ProgressRootDataAttributes;
22
+ }({});
23
+ const progressStateAttributesMapping = {
24
+ status (value) {
25
+ if ('progressing' === value) return {
26
+ [ProgressRootDataAttributes_ProgressRootDataAttributes.progressing]: ''
27
+ };
28
+ if ('complete' === value) return {
29
+ [ProgressRootDataAttributes_ProgressRootDataAttributes.complete]: ''
30
+ };
31
+ if ('indeterminate' === value) return {
32
+ [ProgressRootDataAttributes_ProgressRootDataAttributes.indeterminate]: ''
33
+ };
34
+ return null;
35
+ }
36
+ };
37
+ function getDefaultAriaValueText(formattedValue, value) {
38
+ if (null == value) return 'indeterminate progress';
39
+ return formattedValue || `${value}%`;
40
+ }
41
+ const ProgressRoot_ProgressRoot = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
42
+ const { format, getAriaValueText = getDefaultAriaValueText, locale, max = 100, min = 0, value, render, className, children, style, ...elementProps } = componentProps;
43
+ const [labelId, setLabelId] = __rspack_external_react.useState();
44
+ const formatOptionsRef = useValueAsRef(format);
45
+ let status = 'indeterminate';
46
+ if (Number.isFinite(value)) status = value === max ? 'complete' : 'progressing';
47
+ const formattedValue = formatNumberValue(value, locale, formatOptionsRef.current);
48
+ const state = __rspack_external_react.useMemo(()=>({
49
+ status
50
+ }), [
51
+ status
52
+ ]);
53
+ const defaultProps = {
54
+ 'aria-labelledby': labelId,
55
+ 'aria-valuemax': max,
56
+ 'aria-valuemin': min,
57
+ 'aria-valuenow': value ?? void 0,
58
+ 'aria-valuetext': getAriaValueText(formattedValue, value),
59
+ role: 'progressbar',
60
+ children: /*#__PURE__*/ jsxs(__rspack_external_react.Fragment, {
61
+ children: [
62
+ children,
63
+ /*#__PURE__*/ jsx("span", {
64
+ role: "presentation",
65
+ style: visuallyHidden,
66
+ children: "x"
67
+ })
68
+ ]
69
+ })
70
+ };
71
+ const contextValue = __rspack_external_react.useMemo(()=>({
72
+ formattedValue,
73
+ max,
74
+ min,
75
+ setLabelId,
76
+ state,
77
+ status,
78
+ value
79
+ }), [
80
+ formattedValue,
81
+ max,
82
+ min,
83
+ setLabelId,
84
+ state,
85
+ status,
86
+ value
87
+ ]);
88
+ const element = useRenderElement('div', componentProps, {
89
+ state,
90
+ ref: forwardedRef,
91
+ props: [
92
+ defaultProps,
93
+ elementProps
94
+ ],
95
+ stateAttributesMapping: progressStateAttributesMapping
96
+ });
97
+ return /*#__PURE__*/ jsx(ProgressRootContext.Provider, {
98
+ value: contextValue,
99
+ children: element
100
+ });
101
+ });
102
+ if ("production" !== process.env.NODE_ENV) ProgressRoot_ProgressRoot.displayName = "ProgressRoot";
103
+ const ProgressTrack_ProgressTrack = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
104
+ const { render, className, style, ...elementProps } = componentProps;
105
+ const { state } = useProgressRootContext();
106
+ const element = useRenderElement('div', componentProps, {
107
+ state,
108
+ ref: forwardedRef,
109
+ props: elementProps,
110
+ stateAttributesMapping: progressStateAttributesMapping
111
+ });
112
+ return element;
113
+ });
114
+ if ("production" !== process.env.NODE_ENV) ProgressTrack_ProgressTrack.displayName = "ProgressTrack";
115
+ const ProgressIndicator_ProgressIndicator = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
116
+ const { render, className, style, ...elementProps } = componentProps;
117
+ const { max, min, value, state } = useProgressRootContext();
118
+ const percentageValue = Number.isFinite(value) && null !== value ? valueToPercent(value, min, max) : null;
119
+ const indicatorStyle = null == percentageValue ? {} : {
120
+ insetInlineStart: 0,
121
+ height: 'inherit',
122
+ width: `${percentageValue}%`
123
+ };
124
+ const element = useRenderElement('div', componentProps, {
125
+ state,
126
+ ref: forwardedRef,
127
+ props: [
128
+ {
129
+ style: indicatorStyle
130
+ },
131
+ elementProps
132
+ ],
133
+ stateAttributesMapping: progressStateAttributesMapping
134
+ });
135
+ return element;
136
+ });
137
+ if ("production" !== process.env.NODE_ENV) ProgressIndicator_ProgressIndicator.displayName = "ProgressIndicator";
138
+ const ProgressValue_ProgressValue = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
139
+ const { className, render, children, style, ...elementProps } = componentProps;
140
+ const { value, formattedValue, state } = useProgressRootContext();
141
+ const formattedValueArg = null == value ? 'indeterminate' : formattedValue;
142
+ const formattedValueDisplay = null == value ? null : formattedValue;
143
+ const element = useRenderElement('span', componentProps, {
144
+ state,
145
+ ref: forwardedRef,
146
+ props: [
147
+ {
148
+ 'aria-hidden': true,
149
+ children: 'function' == typeof children ? children(formattedValueArg, value) : formattedValueDisplay
150
+ },
151
+ elementProps
152
+ ],
153
+ stateAttributesMapping: progressStateAttributesMapping
154
+ });
155
+ return element;
156
+ });
157
+ if ("production" !== process.env.NODE_ENV) ProgressValue_ProgressValue.displayName = "ProgressValue";
158
+ const ProgressLabel_ProgressLabel = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
159
+ const { render, className, style, id: idProp, ...elementProps } = componentProps;
160
+ const { setLabelId, state } = useProgressRootContext();
161
+ const id = useRegisteredLabelId(idProp, setLabelId);
162
+ const element = useRenderElement('span', componentProps, {
163
+ state,
164
+ ref: forwardedRef,
165
+ props: [
166
+ {
167
+ id,
168
+ role: 'presentation'
169
+ },
170
+ elementProps
171
+ ],
172
+ stateAttributesMapping: progressStateAttributesMapping
173
+ });
174
+ return element;
175
+ });
176
+ if ("production" !== process.env.NODE_ENV) ProgressLabel_ProgressLabel.displayName = "ProgressLabel";
5
177
  const Progress_module = {
6
178
  root: "root-VDHmKD",
7
179
  track: "track-_XqaKn",
@@ -15,7 +187,7 @@ const ProgressSize = {
15
187
  medium: 8,
16
188
  large: 12
17
189
  };
18
- const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, size = ProgressSize.small, style, ...props }, ref)=>/*#__PURE__*/ jsx(Progress.Root, {
190
+ const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, size = ProgressSize.small, style, ...props }, ref)=>/*#__PURE__*/ jsx(ProgressRoot_ProgressRoot, {
19
191
  ref: ref,
20
192
  className: clsx(Progress_module.root, className),
21
193
  style: {
@@ -24,31 +196,31 @@ const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, size
24
196
  },
25
197
  ...props
26
198
  }));
27
- const Track = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Progress.Track, {
199
+ const Track = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ProgressTrack_ProgressTrack, {
28
200
  ref: ref,
29
201
  className: clsx(Progress_module.track, className),
30
202
  ...props
31
203
  }));
32
- const Indicator = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Progress.Indicator, {
204
+ const Indicator = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ProgressIndicator_ProgressIndicator, {
33
205
  ref: ref,
34
206
  className: clsx(Progress_module.indicator, className),
35
207
  ...props
36
208
  }));
37
- const Value = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Progress.Value, {
209
+ const Value = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ProgressValue_ProgressValue, {
38
210
  ref: ref,
39
211
  className: clsx(Progress_module.value, className),
40
212
  ...props
41
213
  }));
42
- const Label = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Progress.Label, {
214
+ const Label = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ProgressLabel_ProgressLabel, {
43
215
  ref: ref,
44
216
  className: clsx(Progress_module.label, className),
45
217
  ...props
46
218
  }));
47
- const Progress_Progress = {
219
+ const Progress = {
48
220
  Root: Root,
49
221
  Track: Track,
50
222
  Indicator: Indicator,
51
223
  Value: Value,
52
224
  Label: Label
53
225
  };
54
- export { ProgressSize, Progress_Progress as Progress };
226
+ export { Progress, ProgressSize };
@@ -1,15 +1,188 @@
1
1
  import { JSX as JSX_2 } from 'react/jsx-runtime';
2
- import { Radio as Radio_2 } from '@base-ui/react/radio';
3
- import { RadioIndicatorProps } from '@base-ui/react/radio';
2
+ import { RadioIndicatorProps as RadioIndicatorProps_2 } from '@base-ui/react/radio';
4
3
  import * as React_2 from 'react';
5
4
 
5
+ /**
6
+ * Props shared by all Base UI components.
7
+ * Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
8
+ */
9
+ declare type BaseUIComponentProps<ElementType extends React_2.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React_2.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
10
+ /**
11
+ * CSS class applied to the element, or a function that
12
+ * returns a class based on the component's state.
13
+ */
14
+ className?: string | ((state: State) => string | undefined) | undefined;
15
+ /**
16
+ * Allows you to replace the component's HTML element
17
+ * with a different tag, or compose it with another component.
18
+ *
19
+ * Accepts a `ReactElement` or a function that returns the element to render.
20
+ */
21
+ render?: React_2.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
22
+ /**
23
+ * Style applied to the element, or a function that
24
+ * returns a style object based on the component's state.
25
+ */
26
+ style?: React_2.CSSProperties | ((state: State) => React_2.CSSProperties | undefined) | undefined;
27
+ };
28
+
29
+ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E & {
30
+ preventBaseUIHandler: () => void;
31
+ readonly baseUIHandlerPrevented?: boolean | undefined;
32
+ };
33
+
34
+ /**
35
+ * 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
+ *
37
+ * @template Props Props to be spread on the rendered element.
38
+ * @template State Component's internal state.
39
+ */
40
+ declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
41
+
42
+ declare interface FieldRootState {
43
+ /**
44
+ * Whether the component should ignore user interaction.
45
+ */
46
+ disabled: boolean;
47
+ /**
48
+ * Whether the field has been touched.
49
+ */
50
+ touched: boolean;
51
+ /**
52
+ * Whether the field value has changed from its initial value.
53
+ */
54
+ dirty: boolean;
55
+ /**
56
+ * Whether the field is valid.
57
+ */
58
+ valid: boolean | null;
59
+ /**
60
+ * Whether the field has a value.
61
+ */
62
+ filled: boolean;
63
+ /**
64
+ * Whether the field is focused.
65
+ */
66
+ focused: boolean;
67
+ }
68
+
69
+ declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
70
+ ref?: React_2.Ref<T> | undefined;
71
+ };
72
+
73
+ declare interface NonNativeButtonProps {
74
+ /**
75
+ * Whether the component renders a native `<button>` element when replacing it
76
+ * via the `render` prop.
77
+ * Set to `true` if the rendered element is a native button.
78
+ * @default false
79
+ */
80
+ nativeButton?: boolean | undefined;
81
+ }
82
+
6
83
  export declare const Radio: {
7
- Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<RadioIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
84
+ Indicator: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<RadioIndicatorProps_2, "ref"> & React_2.RefAttributes<HTMLSpanElement>, "ref">, "className"> & {
8
85
  className?: string | undefined;
9
86
  } & React_2.RefAttributes<HTMLSpanElement>>;
10
87
  Root: typeof Root;
11
88
  };
12
89
 
90
+ export declare namespace Radio_2 {
91
+ export {
92
+ RadioRoot as Root,
93
+ RadioIndicator as Indicator
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Indicates whether the radio button is selected.
99
+ * Renders a `<span>` element.
100
+ *
101
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
102
+ */
103
+ export declare const RadioIndicator: React_2.ForwardRefExoticComponent<Omit<RadioIndicatorProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
104
+
105
+ export declare namespace RadioIndicator {
106
+ export type Props = RadioIndicatorProps;
107
+ export type State = RadioIndicatorState;
108
+ }
109
+
110
+ export declare interface RadioIndicatorProps extends BaseUIComponentProps<'span', RadioIndicatorState> {
111
+ /**
112
+ * Whether to keep the HTML element in the DOM when the radio button is inactive.
113
+ * @default false
114
+ */
115
+ keepMounted?: boolean | undefined;
116
+ }
117
+
118
+ export declare interface RadioIndicatorState {
119
+ /**
120
+ * Whether the radio button is currently selected.
121
+ */
122
+ checked: boolean;
123
+ /**
124
+ * The transition status of the component.
125
+ */
126
+ transitionStatus: TransitionStatus;
127
+ }
128
+
129
+ /**
130
+ * Represents the radio button itself.
131
+ * Renders a `<span>` element and a hidden `<input>` beside.
132
+ *
133
+ * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)
134
+ */
135
+ export declare const RadioRoot: {
136
+ <Value>(props: RadioRoot.Props<Value>): React_2.JSX.Element;
137
+ };
138
+
139
+ export declare namespace RadioRoot {
140
+ export type State = RadioRootState;
141
+ export type Props<TValue = any> = RadioRootProps<TValue>;
142
+ }
143
+
144
+ export declare interface RadioRootProps<Value = any> extends NonNativeButtonProps, Omit<BaseUIComponentProps<'span', RadioRootState>, 'value'> {
145
+ /**
146
+ * The unique identifying value of the radio in a group.
147
+ */
148
+ value: Value;
149
+ /**
150
+ * Whether the component should ignore user interaction.
151
+ */
152
+ disabled?: boolean | undefined;
153
+ /**
154
+ * Whether the user must choose a value before submitting a form.
155
+ */
156
+ required?: boolean | undefined;
157
+ /**
158
+ * Whether the user should be unable to select the radio button.
159
+ */
160
+ readOnly?: boolean | undefined;
161
+ /**
162
+ * A ref to access the hidden input element.
163
+ */
164
+ inputRef?: React_2.Ref<HTMLInputElement> | undefined;
165
+ }
166
+
167
+ export declare interface RadioRootState extends FieldRootState {
168
+ /**
169
+ * Whether the radio button is currently selected.
170
+ */
171
+ checked: boolean;
172
+ /**
173
+ * Whether the component should ignore user interaction.
174
+ */
175
+ disabled: boolean;
176
+ /**
177
+ * Whether the user should be unable to select the radio button.
178
+ */
179
+ readOnly: boolean;
180
+ /**
181
+ * Whether the user must choose a value before submitting a form.
182
+ */
183
+ required: boolean;
184
+ }
185
+
13
186
  export declare const RadioSize: {
14
187
  readonly small: 12;
15
188
  readonly medium: 16;
@@ -22,11 +195,17 @@ declare type RootProps<Value> = WithStringClassName<Radio_2.Root.Props<Value>> &
22
195
  size?: number;
23
196
  };
24
197
 
198
+ declare type TransitionStatus = 'starting' | 'ending' | 'idle' | undefined;
199
+
200
+ /**
201
+ * Adds a `preventBaseUIHandler` method to all event handlers.
202
+ */
203
+ declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]> };
204
+
205
+ declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
206
+
25
207
  declare type WithStringClassName<P> = Omit<P, 'className'> & {
26
208
  className?: string;
27
209
  };
28
210
 
29
-
30
- export * from "@base-ui/react/radio";
31
-
32
211
  export { }