@wix/site-ui 1.346.0 → 1.348.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.
- package/dist/{6706.js → 1093.js} +3 -3
- package/dist/{8724.js → 1219.js} +2 -2
- package/dist/{7373.js → 1288.js} +8 -2
- package/dist/{5299.js → 1381.js} +98 -127
- package/dist/{3056.js → 1607.js} +32 -34
- package/dist/1629.js +2 -0
- package/dist/1669.js +75 -0
- package/dist/1718.js +26 -0
- package/dist/{1477.js → 201.js} +17 -26
- package/dist/2221.js +9 -0
- package/dist/{2445.js → 226.js} +12 -48
- package/dist/2387.js +7 -0
- package/dist/2580.js +6 -0
- package/dist/{1500.js → 2859.js} +10 -34
- package/dist/3014.js +178 -0
- package/dist/{6247.js → 3054.js} +3 -3
- package/dist/{7642.js → 3093.js} +1 -1
- package/dist/3189.js +5 -0
- package/dist/{7564.js → 331.js} +2 -2
- package/dist/3357.js +7 -0
- package/dist/{487.js → 3398.js} +38 -39
- package/dist/3502.js +224 -0
- package/dist/3695.js +50 -0
- package/dist/3829.js +1 -1
- package/dist/{6588.js → 3859.js} +115 -92
- package/dist/{3670.js → 3910.js} +28 -21
- package/dist/392.js +7 -0
- package/dist/{4549.js → 4155.js} +11 -3
- package/dist/4226.js +7 -0
- package/dist/{6329.js → 4229.js} +1 -1
- package/dist/4293.js +3 -0
- package/dist/4346.js +853 -2
- package/dist/{285.js → 4472.js} +3 -3
- package/dist/4605.js +207 -0
- package/dist/{7366.js → 488.js} +60 -7
- package/dist/{8750.js → 497.js} +190 -375
- package/dist/4989.js +35 -0
- package/dist/{6270.js → 510.js} +157 -196
- package/dist/5258.js +26 -0
- package/dist/{5036.js → 5275.js} +0 -3
- package/dist/{8171.js → 5298.js} +90 -102
- package/dist/5473.js +11 -0
- package/dist/{4745.js → 5490.js} +3 -1
- package/dist/{6089.js → 5561.js} +869 -786
- package/dist/{8996.js → 5595.js} +4 -3
- package/dist/5890.js +25 -0
- package/dist/{6046.js → 5969.js} +1 -1
- package/dist/5984.js +38 -0
- package/dist/{8527.js → 6006.js} +3 -3
- package/dist/6040.js +97 -0
- package/dist/{8758.js → 6137.js} +10 -8
- package/dist/{4281.js → 6140.js} +18 -10
- package/dist/{8960.js → 6191.js} +2 -2
- package/dist/6240.js +121 -0
- package/dist/{4490.js → 6373.js} +7 -5
- package/dist/{904.js → 6487.js} +19 -17
- package/dist/{9635.js → 6498.js} +1 -1
- package/dist/6499.js +4 -7
- package/dist/6508.js +7 -0
- package/dist/{8225.js → 6540.js} +1 -0
- package/dist/6551.js +46 -0
- package/dist/{9369.js → 6620.js} +35 -34
- package/dist/{4143.js → 6838.js} +19 -10
- package/dist/6902.js +48 -0
- package/dist/6904.js +51 -0
- package/dist/70.js +24 -0
- package/dist/7024.js +39 -0
- package/dist/{6882.js → 721.js} +737 -362
- package/dist/{951.js → 7270.js} +4 -4
- package/dist/{3485.js → 7323.js} +143 -111
- package/dist/{7541.js → 7488.js} +2 -2
- package/dist/{4863.js → 7542.js} +7 -6
- package/dist/7551.js +28 -0
- package/dist/{7021.js → 7640.js} +1 -1
- package/dist/{353.js → 7692.js} +3 -7
- package/dist/{4707.js → 7930.js} +2 -2
- package/dist/{8052.js → 8.js} +80 -64
- package/dist/{6914.js → 8129.js} +3 -15
- package/dist/{3319.js → 8358.js} +62 -63
- package/dist/{5864.js → 8407.js} +13 -13
- package/dist/8488.js +15 -0
- package/dist/{4768.js → 8495.js} +1 -1
- package/dist/8734.js +171 -0
- package/dist/{1763.js → 9018.js} +205 -331
- package/dist/9053.js +29 -0
- package/dist/9067.js +41 -0
- package/dist/{2861.js → 9120.js} +2 -2
- package/dist/{42.js → 9197.js} +2 -2
- package/dist/{9189.js → 9248.js} +36 -17
- package/dist/{2801.js → 9252.js} +4 -9
- package/dist/9295.js +7 -0
- package/dist/9303.js +8 -0
- package/dist/{167.js → 9374.js} +1 -1
- package/dist/{9352.js → 9540.js} +17 -47
- package/dist/9576.js +51 -0
- package/dist/{8272.js → 9591.js} +36 -46
- package/dist/{6107.js → 9770.js} +2 -2
- package/dist/{5085.js → 9880.js} +6 -3
- package/dist/Accordion/index.d.ts +207 -41
- package/dist/Accordion/index.js +75 -177
- package/dist/AlertDialog/index.d.ts +440 -140
- package/dist/AlertDialog/index.js +3 -13
- package/dist/Autocomplete/index.d.ts +722 -150
- package/dist/Autocomplete/index.js +16 -29
- package/dist/Avatar/index.d.ts +38 -3
- package/dist/Avatar/index.js +82 -28
- package/dist/Breadcrumbs/index.d.ts +63 -91
- package/dist/Breadcrumbs/index.js +1 -1
- package/dist/Button/index.d.ts +11 -0
- package/dist/Button/index.js +2 -2
- package/dist/Checkbox/index.d.ts +206 -36
- package/dist/Checkbox/index.js +293 -8
- package/dist/CheckboxField/index.css +1 -1
- package/dist/CheckboxField/index.d.ts +40 -36
- package/dist/CheckboxGroup/index.d.ts +50 -36
- package/dist/CheckboxGroup/index.js +87 -58
- package/dist/CheckboxGroupField/index.css +1 -1
- package/dist/Collapsible/index.d.ts +128 -36
- package/dist/Collapsible/index.js +21 -25
- package/dist/Combobox/index.d.ts +801 -158
- package/dist/Combobox/index.js +70 -114
- package/dist/ContextMenu/index.d.ts +1162 -195
- package/dist/ContextMenu/index.js +46 -36
- package/dist/Dialog/index.d.ts +425 -133
- package/dist/Dialog/index.js +8 -4
- package/dist/Drawer/index.d.ts +589 -144
- package/dist/Drawer/index.js +482 -562
- package/dist/Field/index.css +1 -1
- package/dist/Field/index.d.ts +341 -42
- package/dist/Field/index.js +123 -273
- package/dist/Fieldset/index.d.ts +11 -0
- package/dist/Fieldset/index.js +10 -17
- package/dist/Form/index.d.ts +43 -39
- package/dist/Form/index.js +58 -50
- package/dist/Input/index.css +1 -1
- package/dist/Input/index.d.ts +94 -42
- package/dist/Input/index.js +1 -1
- package/dist/Menu/index.d.ts +1140 -175
- package/dist/Menu/index.js +51 -67
- package/dist/Menubar/index.d.ts +651 -173
- package/dist/Menubar/index.js +12 -16
- package/dist/Meter/index.js +21 -18
- package/dist/NavigationMenu/index.d.ts +370 -86
- package/dist/NavigationMenu/index.js +144 -178
- package/dist/NumberField/index.css +1 -1
- package/dist/NumberField/index.d.ts +507 -47
- package/dist/NumberField/index.js +434 -718
- package/dist/Popover/index.d.ts +561 -142
- package/dist/Popover/index.js +181 -252
- package/dist/PreviewCard/index.d.ts +507 -143
- package/dist/PreviewCard/index.js +97 -151
- package/dist/Progress/index.d.ts +117 -3
- package/dist/Progress/index.js +37 -36
- package/dist/Radio/index.d.ts +177 -7
- package/dist/Radio/index.js +54 -70
- package/dist/RadioField/index.css +1 -1
- package/dist/RadioField/index.d.ts +23 -7
- package/dist/RadioGroup/index.d.ts +51 -37
- package/dist/RadioGroup/index.js +60 -51
- package/dist/RadioGroupField/index.css +1 -1
- package/dist/RadioGroupField/index.d.ts +40 -37
- package/dist/ScrollArea/index.d.ts +295 -1
- package/dist/ScrollArea/index.js +256 -324
- package/dist/Select/index.d.ts +516 -123
- package/dist/Select/index.js +513 -635
- package/dist/SelectField/index.css +1 -1
- package/dist/SelectField/index.d.ts +109 -134
- package/dist/SelectField/index.js +5 -1
- package/dist/Separator/index.d.ts +12 -0
- package/dist/Separator/index.js +1 -1
- package/dist/Slider/index.d.ts +383 -64
- package/dist/Slider/index.js +298 -374
- package/dist/Switch/index.d.ts +184 -37
- package/dist/Switch/index.js +44 -58
- package/dist/Tabs/index.d.ts +220 -35
- package/dist/Tabs/index.js +199 -193
- package/dist/Toast/index.d.ts +280 -64
- package/dist/Toast/index.js +299 -374
- package/dist/Toggle/index.d.ts +55 -35
- package/dist/Toggle/index.js +19 -13
- package/dist/ToggleGroup/index.d.ts +62 -35
- package/dist/ToggleGroup/index.js +13 -31
- package/dist/Toolbar/index.d.ts +117 -2
- package/dist/Toolbar/index.js +31 -43
- package/dist/Tooltip/index.d.ts +507 -150
- package/dist/Tooltip/index.js +163 -213
- package/dist/index.d.ts +12912 -5382
- package/package.json +3 -3
- package/dist/2205.js +0 -26
- package/dist/2274.js +0 -34
- package/dist/2287.js +0 -17
- package/dist/3020.js +0 -7
- package/dist/3021.js +0 -72
- package/dist/3140.js +0 -4
- package/dist/3248.js +0 -307
- package/dist/4026.js +0 -12
- package/dist/4922.js +0 -15
- package/dist/5659.js +0 -4
- package/dist/5992.js +0 -447
- package/dist/6330.js +0 -30
- package/dist/6535.js +0 -72
- package/dist/6917.js +0 -55
- package/dist/7725.js +0 -10
- package/dist/7871.js +0 -38
- package/dist/8106.js +0 -239
- package/dist/8685.js +0 -102
- package/dist/8935.js +0 -8
- package/dist/8971.js +0 -40
- package/dist/8979.js +0 -10
- package/dist/9048.js +0 -52
- package/dist/9087.js +0 -256
- package/dist/9255.js +0 -136
- /package/dist/{1457.js → 1068.js} +0 -0
- /package/dist/{6003.js → 1234.js} +0 -0
- /package/dist/{4723.js → 1282.js} +0 -0
- /package/dist/{6825.js → 1876.js} +0 -0
- /package/dist/{5778.js → 1885.js} +0 -0
- /package/dist/{2445.js.LICENSE.txt → 226.js.LICENSE.txt} +0 -0
- /package/dist/{1279.js → 3278.js} +0 -0
- /package/dist/{3296.js → 5568.js} +0 -0
- /package/dist/{8685.css → 6240.css} +0 -0
- /package/dist/{9829.js → 6488.js} +0 -0
- /package/dist/{9863.js → 6534.js} +0 -0
- /package/dist/{4495.js → 7718.js} +0 -0
- /package/dist/{3395.js → 8866.js} +0 -0
- /package/dist/{2418.js → 9837.js} +0 -0
|
@@ -65,15 +65,15 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
|
|
|
65
65
|
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
declare const cancelOpen:
|
|
68
|
+
declare const cancelOpen: 'cancel-open';
|
|
69
69
|
|
|
70
|
-
declare const chipRemovePress:
|
|
70
|
+
declare const chipRemovePress: 'chip-remove-press';
|
|
71
71
|
|
|
72
|
-
declare const clearPress:
|
|
72
|
+
declare const clearPress: 'clear-press';
|
|
73
73
|
|
|
74
|
-
declare const closePress:
|
|
74
|
+
declare const closePress: 'close-press';
|
|
75
75
|
|
|
76
|
-
declare const closeWatcher:
|
|
76
|
+
declare const closeWatcher: 'close-watcher';
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* 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.
|
|
@@ -83,13 +83,18 @@ declare const closeWatcher: "close-watcher";
|
|
|
83
83
|
*/
|
|
84
84
|
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
85
85
|
|
|
86
|
-
declare const decrementPress:
|
|
86
|
+
declare const decrementPress: 'decrement-press';
|
|
87
87
|
|
|
88
|
-
declare const disabled:
|
|
88
|
+
declare const disabled: 'disabled';
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Present when the radio group is disabled.
|
|
92
|
+
*/
|
|
93
|
+
declare const disabled_2 = "data-disabled";
|
|
91
94
|
|
|
92
|
-
declare const
|
|
95
|
+
declare const drag: 'drag';
|
|
96
|
+
|
|
97
|
+
declare const escapeKey: 'escape-key';
|
|
93
98
|
|
|
94
99
|
declare interface FieldRootState {
|
|
95
100
|
/**
|
|
@@ -118,43 +123,45 @@ declare interface FieldRootState {
|
|
|
118
123
|
focused: boolean;
|
|
119
124
|
}
|
|
120
125
|
|
|
121
|
-
declare const focusOut:
|
|
126
|
+
declare const focusOut: 'focus-out';
|
|
122
127
|
|
|
123
128
|
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
124
129
|
ref?: React_2.Ref<T> | undefined;
|
|
125
130
|
};
|
|
126
131
|
|
|
127
|
-
declare const imperativeAction:
|
|
132
|
+
declare const imperativeAction: 'imperative-action';
|
|
133
|
+
|
|
134
|
+
declare const incrementPress: 'increment-press';
|
|
128
135
|
|
|
129
|
-
declare const
|
|
136
|
+
declare const initial: 'initial';
|
|
130
137
|
|
|
131
|
-
declare const
|
|
138
|
+
declare const inputBlur: 'input-blur';
|
|
132
139
|
|
|
133
|
-
declare const
|
|
140
|
+
declare const inputChange: 'input-change';
|
|
134
141
|
|
|
135
|
-
declare const
|
|
142
|
+
declare const inputClear: 'input-clear';
|
|
136
143
|
|
|
137
|
-
declare const
|
|
144
|
+
declare const inputPaste: 'input-paste';
|
|
138
145
|
|
|
139
|
-
declare const
|
|
146
|
+
declare const inputPress: 'input-press';
|
|
140
147
|
|
|
141
|
-
declare const
|
|
148
|
+
declare const itemPress: 'item-press';
|
|
142
149
|
|
|
143
|
-
declare const
|
|
150
|
+
declare const keyboard: 'keyboard';
|
|
144
151
|
|
|
145
|
-
declare const
|
|
152
|
+
declare const linkPress: 'link-press';
|
|
146
153
|
|
|
147
|
-
declare const
|
|
154
|
+
declare const listNavigation: 'list-navigation';
|
|
148
155
|
|
|
149
|
-
declare const
|
|
156
|
+
declare const missing: 'missing';
|
|
150
157
|
|
|
151
|
-
declare const
|
|
158
|
+
declare const none: 'none';
|
|
152
159
|
|
|
153
|
-
declare const
|
|
160
|
+
declare const outsidePress: 'outside-press';
|
|
154
161
|
|
|
155
|
-
declare const
|
|
162
|
+
declare const pointer: 'pointer';
|
|
156
163
|
|
|
157
|
-
declare const
|
|
164
|
+
declare const popupClose: 'popup-close';
|
|
158
165
|
|
|
159
166
|
export declare const RadioGroup: React_2.ForwardRefExoticComponent<Omit<Omit<RadioGroup_2.Props<unknown>, "ref">, "className"> & {
|
|
160
167
|
className?: string;
|
|
@@ -163,10 +170,10 @@ export declare const RadioGroup: React_2.ForwardRefExoticComponent<Omit<Omit<Rad
|
|
|
163
170
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
164
171
|
|
|
165
172
|
/**
|
|
166
|
-
* Provides
|
|
173
|
+
* Provides shared state to a series of radio buttons.
|
|
167
174
|
* Renders a `<div>` element.
|
|
168
175
|
*
|
|
169
|
-
* Documentation: [Base UI Radio Group](https://base-ui.com/react/components/radio)
|
|
176
|
+
* Documentation: [Base UI Radio Group](https://base-ui.com/react/components/radio-group)
|
|
170
177
|
*/
|
|
171
178
|
declare const RadioGroup_2: {
|
|
172
179
|
<Value>(props: RadioGroup_2.Props<Value>): React_2.JSX.Element;
|
|
@@ -183,6 +190,12 @@ export declare type RadioGroupChangeEventDetails = BaseUIChangeEventDetails<Radi
|
|
|
183
190
|
|
|
184
191
|
export declare type RadioGroupChangeEventReason = typeof REASONS.none;
|
|
185
192
|
|
|
193
|
+
export declare namespace RadioGroupDataAttributes {
|
|
194
|
+
export {
|
|
195
|
+
disabled_2 as disabled
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
186
199
|
declare type RadioGroupOrientation = 'vertical' | 'horizontal';
|
|
187
200
|
|
|
188
201
|
export declare interface RadioGroupProps<Value = any> extends Omit<BaseUIComponentProps<'div', RadioGroupState>, 'value'> {
|
|
@@ -272,6 +285,7 @@ declare namespace REASONS {
|
|
|
272
285
|
drag,
|
|
273
286
|
wheel,
|
|
274
287
|
scrub,
|
|
288
|
+
popupClose,
|
|
275
289
|
cancelOpen,
|
|
276
290
|
siblingOpen,
|
|
277
291
|
disabled,
|
|
@@ -326,23 +340,23 @@ declare interface ReasonToEventMap {
|
|
|
326
340
|
[REASONS.windowResize]: UIEvent;
|
|
327
341
|
}
|
|
328
342
|
|
|
329
|
-
declare const scrub:
|
|
343
|
+
declare const scrub: 'scrub';
|
|
330
344
|
|
|
331
|
-
declare const siblingOpen:
|
|
345
|
+
declare const siblingOpen: 'sibling-open';
|
|
332
346
|
|
|
333
|
-
declare const swipe:
|
|
347
|
+
declare const swipe: 'swipe';
|
|
334
348
|
|
|
335
|
-
declare const trackPress:
|
|
349
|
+
declare const trackPress: 'track-press';
|
|
336
350
|
|
|
337
|
-
declare const triggerFocus:
|
|
351
|
+
declare const triggerFocus: 'trigger-focus';
|
|
338
352
|
|
|
339
|
-
declare const triggerHover:
|
|
353
|
+
declare const triggerHover: 'trigger-hover';
|
|
340
354
|
|
|
341
|
-
declare const triggerPress:
|
|
355
|
+
declare const triggerPress: 'trigger-press';
|
|
342
356
|
|
|
343
|
-
declare const wheel:
|
|
357
|
+
declare const wheel: 'wheel';
|
|
344
358
|
|
|
345
|
-
declare const windowResize:
|
|
359
|
+
declare const windowResize: 'window-resize';
|
|
346
360
|
|
|
347
361
|
/**
|
|
348
362
|
* Adds a `preventBaseUIHandler` method to all event handlers.
|
package/dist/RadioGroup/index.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "../
|
|
4
|
-
import { useFormContext } from "../
|
|
5
|
-
import { useFieldsetRootContext } from "../
|
|
6
|
-
import { useBaseUiId } from "../
|
|
7
|
-
import { useControlled } from "../
|
|
8
|
-
import { useStableCallback } from "../
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
3
|
+
import { useLabelableContext, useFieldRootContext, fieldValidityMapping } from "../201.js";
|
|
4
|
+
import { useFormContext } from "../9880.js";
|
|
5
|
+
import { useFieldsetRootContext } from "../7692.js";
|
|
6
|
+
import { useBaseUiId } from "../5969.js";
|
|
7
|
+
import { useControlled } from "../6006.js";
|
|
8
|
+
import { useStableCallback } from "../7488.js";
|
|
9
|
+
import { useMergedRefs } from "../9591.js";
|
|
10
|
+
import { useIsoLayoutEffect } from "../3357.js";
|
|
11
|
+
import { isEligibleInput } from "../4605.js";
|
|
12
|
+
import { useRegisterFieldControl } from "../6140.js";
|
|
13
|
+
import { useValueChanged } from "../9252.js";
|
|
14
|
+
import { contains } from "../4155.js";
|
|
15
|
+
import { RadioGroupContext } from "../3278.js";
|
|
16
|
+
import { CompositeRoot } from "../3502.js";
|
|
14
17
|
import * as __rspack_external_react from "react";
|
|
15
18
|
const MODIFIER_KEYS = [
|
|
16
19
|
"Shift"
|
|
17
20
|
];
|
|
18
21
|
const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(function(componentProps, forwardedRef) {
|
|
19
22
|
const { render, className, disabled: disabledProp, readOnly, required, onValueChange: onValueChangeProp, value: externalValue, defaultValue, form, name: nameProp, inputRef: inputRefProp, id: idProp, style, ...elementProps } = componentProps;
|
|
20
|
-
const { setTouched: setFieldTouched, setFocused,
|
|
23
|
+
const { setTouched: setFieldTouched, setFocused, validationMode, name: fieldName, disabled: fieldDisabled, state: fieldState, validation, setDirty, setFilled, validityData } = useFieldRootContext();
|
|
21
24
|
const { labelId } = useLabelableContext();
|
|
22
|
-
const { clearErrors } = useFormContext();
|
|
25
|
+
const { clearErrors, elementRef } = useFormContext();
|
|
23
26
|
const fieldsetContext = useFieldsetRootContext(true);
|
|
24
27
|
const disabled = fieldDisabled || disabledProp;
|
|
25
28
|
const name = fieldName ?? nameProp;
|
|
@@ -36,42 +39,57 @@ const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(f
|
|
|
36
39
|
if (eventDetails.isCanceled) return;
|
|
37
40
|
setCheckedValueUnwrapped(value);
|
|
38
41
|
});
|
|
39
|
-
const
|
|
42
|
+
const getInputControl = validation.getInputControl;
|
|
43
|
+
const controlRef = __rspack_external_react.useMemo(()=>({
|
|
44
|
+
get current () {
|
|
45
|
+
return getInputControl();
|
|
46
|
+
}
|
|
47
|
+
}), [
|
|
48
|
+
getInputControl
|
|
49
|
+
]);
|
|
40
50
|
const groupInputRef = __rspack_external_react.useRef(null);
|
|
41
51
|
const firstEnabledInputRef = __rspack_external_react.useRef(null);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return cleanup;
|
|
49
|
-
}
|
|
50
|
-
const registerControlRef = useStableCallback((element, isDisabled = false)=>{
|
|
51
|
-
if (!element) return;
|
|
52
|
-
if (isDisabled) {
|
|
53
|
-
if (controlRef.current === element) controlRef.current = null;
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (null == controlRef.current) controlRef.current = element;
|
|
52
|
+
const mergedInputRef = useMergedRefs(groupInputRef, inputRefProp);
|
|
53
|
+
const lastAppliedInputRef = __rspack_external_react.useRef(mergedInputRef);
|
|
54
|
+
const setInputRef = useStableCallback((hiddenInput)=>{
|
|
55
|
+
if (groupInputRef.current === hiddenInput && lastAppliedInputRef.current === mergedInputRef) return;
|
|
56
|
+
lastAppliedInputRef.current = mergedInputRef;
|
|
57
|
+
mergedInputRef?.(hiddenInput);
|
|
57
58
|
});
|
|
59
|
+
useIsoLayoutEffect(()=>{
|
|
60
|
+
setInputRef(groupInputRef.current);
|
|
61
|
+
}, [
|
|
62
|
+
mergedInputRef,
|
|
63
|
+
setInputRef
|
|
64
|
+
]);
|
|
58
65
|
const registerInputRef = useStableCallback((input)=>{
|
|
59
|
-
if (!input
|
|
60
|
-
if (!
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
if (!input) return;
|
|
67
|
+
if (!input.disabled) {
|
|
68
|
+
if (!firstEnabledInputRef.current) firstEnabledInputRef.current = input;
|
|
69
|
+
const currentInput = groupInputRef.current;
|
|
70
|
+
if (input.checked || null == currentInput || currentInput.disabled) setInputRef(input);
|
|
71
|
+
}
|
|
72
|
+
return ()=>{
|
|
73
|
+
if (firstEnabledInputRef.current === input) firstEnabledInputRef.current = null;
|
|
74
|
+
if (groupInputRef.current === input) setInputRef(null);
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
const getFormValue = useStableCallback(()=>{
|
|
78
|
+
const formElement = elementRef.current;
|
|
79
|
+
if (!formElement) return checkedValue ?? null;
|
|
80
|
+
for (const input of validation.registeredInputs.keys())if (input.checked && isEligibleInput(input, formElement)) return checkedValue ?? null;
|
|
81
|
+
return null;
|
|
63
82
|
});
|
|
64
|
-
useRegisterFieldControl(controlRef, id, checkedValue ?? null);
|
|
83
|
+
useRegisterFieldControl(controlRef, id, checkedValue ?? null, getFormValue, !disabled, nameProp);
|
|
65
84
|
useValueChanged(checkedValue, ()=>{
|
|
66
85
|
clearErrors(name);
|
|
67
86
|
setDirty(checkedValue !== validityData.initialValue);
|
|
68
87
|
setFilled(null != checkedValue);
|
|
69
|
-
|
|
70
|
-
else validation.commit(checkedValue, true);
|
|
88
|
+
validation.change(checkedValue);
|
|
71
89
|
const fallbackInput = firstEnabledInputRef.current;
|
|
72
90
|
if (null == checkedValue && fallbackInput && !fallbackInput.disabled) setInputRef(fallbackInput);
|
|
73
91
|
});
|
|
74
|
-
const ariaLabelledby =
|
|
92
|
+
const ariaLabelledby = labelId ?? fieldsetContext?.legendId;
|
|
75
93
|
const state = {
|
|
76
94
|
...fieldState,
|
|
77
95
|
disabled: disabled ?? false,
|
|
@@ -79,14 +97,12 @@ const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(f
|
|
|
79
97
|
readOnly: readOnly ?? false
|
|
80
98
|
};
|
|
81
99
|
const contextValue = __rspack_external_react.useMemo(()=>({
|
|
82
|
-
...fieldState,
|
|
83
100
|
checkedValue,
|
|
84
101
|
disabled,
|
|
85
102
|
form,
|
|
86
103
|
validation,
|
|
87
104
|
name,
|
|
88
105
|
readOnly,
|
|
89
|
-
registerControlRef,
|
|
90
106
|
registerInputRef,
|
|
91
107
|
required,
|
|
92
108
|
setCheckedValue,
|
|
@@ -97,10 +113,8 @@ const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(f
|
|
|
97
113
|
disabled,
|
|
98
114
|
form,
|
|
99
115
|
validation,
|
|
100
|
-
fieldState,
|
|
101
116
|
name,
|
|
102
117
|
readOnly,
|
|
103
|
-
registerControlRef,
|
|
104
118
|
registerInputRef,
|
|
105
119
|
required,
|
|
106
120
|
setCheckedValue,
|
|
@@ -108,27 +122,22 @@ const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(f
|
|
|
108
122
|
touched
|
|
109
123
|
]);
|
|
110
124
|
const defaultProps = {
|
|
125
|
+
id: idProp,
|
|
111
126
|
role: 'radiogroup',
|
|
112
127
|
'aria-required': required || void 0,
|
|
113
128
|
'aria-disabled': disabled || void 0,
|
|
114
129
|
'aria-readonly': readOnly || void 0,
|
|
115
130
|
'aria-labelledby': ariaLabelledby,
|
|
116
|
-
onFocus () {
|
|
117
|
-
setFocused(true);
|
|
118
|
-
},
|
|
119
131
|
onBlur (event) {
|
|
120
132
|
if (!contains(event.currentTarget, event.relatedTarget)) {
|
|
133
|
+
setTouched(false);
|
|
121
134
|
setFieldTouched(true);
|
|
122
135
|
setFocused(false);
|
|
123
136
|
if ('onBlur' === validationMode) validation.commit(checkedValue);
|
|
124
137
|
}
|
|
125
138
|
},
|
|
126
139
|
onKeyDownCapture (event) {
|
|
127
|
-
if (event.key.startsWith('Arrow'))
|
|
128
|
-
setFieldTouched(true);
|
|
129
|
-
setTouched(true);
|
|
130
|
-
setFocused(true);
|
|
131
|
-
}
|
|
140
|
+
if (event.key.startsWith('Arrow')) setTouched(true);
|
|
132
141
|
}
|
|
133
142
|
};
|
|
134
143
|
return /*#__PURE__*/ jsx(RadioGroupContext.Provider, {
|
|
@@ -140,8 +149,8 @@ const RadioGroup_RadioGroup = /*#__PURE__*/ __rspack_external_react.forwardRef(f
|
|
|
140
149
|
state: state,
|
|
141
150
|
props: [
|
|
142
151
|
defaultProps,
|
|
143
|
-
|
|
144
|
-
|
|
152
|
+
elementProps,
|
|
153
|
+
(props)=>validation.getValidationProps(disabled ?? false, props)
|
|
145
154
|
],
|
|
146
155
|
refs: [
|
|
147
156
|
forwardedRef
|
|
@@ -67,15 +67,15 @@ declare type BaseUIEvent<E extends React_2.SyntheticEvent<Element, Event>> = E &
|
|
|
67
67
|
readonly baseUIHandlerPrevented?: boolean | undefined;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
declare const cancelOpen:
|
|
70
|
+
declare const cancelOpen: 'cancel-open';
|
|
71
71
|
|
|
72
|
-
declare const chipRemovePress:
|
|
72
|
+
declare const chipRemovePress: 'chip-remove-press';
|
|
73
73
|
|
|
74
|
-
declare const clearPress:
|
|
74
|
+
declare const clearPress: 'clear-press';
|
|
75
75
|
|
|
76
|
-
declare const closePress:
|
|
76
|
+
declare const closePress: 'close-press';
|
|
77
77
|
|
|
78
|
-
declare const closeWatcher:
|
|
78
|
+
declare const closeWatcher: 'close-watcher';
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* 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.
|
|
@@ -85,13 +85,13 @@ declare const closeWatcher: "close-watcher";
|
|
|
85
85
|
*/
|
|
86
86
|
declare type ComponentRenderFn<Props, State> = (props: Props, state: State) => React_2.ReactElement<unknown>;
|
|
87
87
|
|
|
88
|
-
declare const decrementPress:
|
|
88
|
+
declare const decrementPress: 'decrement-press';
|
|
89
89
|
|
|
90
|
-
declare const disabled:
|
|
90
|
+
declare const disabled: 'disabled';
|
|
91
91
|
|
|
92
|
-
declare const drag:
|
|
92
|
+
declare const drag: 'drag';
|
|
93
93
|
|
|
94
|
-
declare const escapeKey:
|
|
94
|
+
declare const escapeKey: 'escape-key';
|
|
95
95
|
|
|
96
96
|
declare interface FieldRootState {
|
|
97
97
|
/**
|
|
@@ -120,43 +120,45 @@ declare interface FieldRootState {
|
|
|
120
120
|
focused: boolean;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
declare const focusOut:
|
|
123
|
+
declare const focusOut: 'focus-out';
|
|
124
124
|
|
|
125
125
|
declare type HTMLProps<T = any> = React_2.HTMLAttributes<T> & {
|
|
126
126
|
ref?: React_2.Ref<T> | undefined;
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
declare const imperativeAction:
|
|
129
|
+
declare const imperativeAction: 'imperative-action';
|
|
130
130
|
|
|
131
|
-
declare const incrementPress:
|
|
131
|
+
declare const incrementPress: 'increment-press';
|
|
132
132
|
|
|
133
|
-
declare const initial:
|
|
133
|
+
declare const initial: 'initial';
|
|
134
134
|
|
|
135
|
-
declare const inputBlur:
|
|
135
|
+
declare const inputBlur: 'input-blur';
|
|
136
136
|
|
|
137
|
-
declare const inputChange:
|
|
137
|
+
declare const inputChange: 'input-change';
|
|
138
138
|
|
|
139
|
-
declare const inputClear:
|
|
139
|
+
declare const inputClear: 'input-clear';
|
|
140
140
|
|
|
141
|
-
declare const inputPaste:
|
|
141
|
+
declare const inputPaste: 'input-paste';
|
|
142
142
|
|
|
143
|
-
declare const inputPress:
|
|
143
|
+
declare const inputPress: 'input-press';
|
|
144
144
|
|
|
145
|
-
declare const itemPress:
|
|
145
|
+
declare const itemPress: 'item-press';
|
|
146
146
|
|
|
147
|
-
declare const keyboard:
|
|
147
|
+
declare const keyboard: 'keyboard';
|
|
148
148
|
|
|
149
|
-
declare const linkPress:
|
|
149
|
+
declare const linkPress: 'link-press';
|
|
150
150
|
|
|
151
|
-
declare const listNavigation:
|
|
151
|
+
declare const listNavigation: 'list-navigation';
|
|
152
152
|
|
|
153
|
-
declare const missing:
|
|
153
|
+
declare const missing: 'missing';
|
|
154
154
|
|
|
155
|
-
declare const none:
|
|
155
|
+
declare const none: 'none';
|
|
156
156
|
|
|
157
|
-
declare const outsidePress:
|
|
157
|
+
declare const outsidePress: 'outside-press';
|
|
158
158
|
|
|
159
|
-
declare const pointer:
|
|
159
|
+
declare const pointer: 'pointer';
|
|
160
|
+
|
|
161
|
+
declare const popupClose: 'popup-close';
|
|
160
162
|
|
|
161
163
|
declare const RadioGroup_2: React_2.ForwardRefExoticComponent<Omit<Omit<RadioGroup_3.Props<unknown>, "ref">, "className"> & {
|
|
162
164
|
className?: string;
|
|
@@ -165,10 +167,10 @@ declare const RadioGroup_2: React_2.ForwardRefExoticComponent<Omit<Omit<RadioGro
|
|
|
165
167
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
166
168
|
|
|
167
169
|
/**
|
|
168
|
-
* Provides
|
|
170
|
+
* Provides shared state to a series of radio buttons.
|
|
169
171
|
* Renders a `<div>` element.
|
|
170
172
|
*
|
|
171
|
-
* Documentation: [Base UI Radio Group](https://base-ui.com/react/components/radio)
|
|
173
|
+
* Documentation: [Base UI Radio Group](https://base-ui.com/react/components/radio-group)
|
|
172
174
|
*/
|
|
173
175
|
declare const RadioGroup_3: {
|
|
174
176
|
<Value>(props: RadioGroup_3.Props<Value>): React_2.JSX.Element;
|
|
@@ -320,6 +322,7 @@ declare namespace REASONS {
|
|
|
320
322
|
drag,
|
|
321
323
|
wheel,
|
|
322
324
|
scrub,
|
|
325
|
+
popupClose,
|
|
323
326
|
cancelOpen,
|
|
324
327
|
siblingOpen,
|
|
325
328
|
disabled,
|
|
@@ -374,23 +377,23 @@ declare interface ReasonToEventMap {
|
|
|
374
377
|
[REASONS.windowResize]: UIEvent;
|
|
375
378
|
}
|
|
376
379
|
|
|
377
|
-
declare const scrub:
|
|
380
|
+
declare const scrub: 'scrub';
|
|
378
381
|
|
|
379
|
-
declare const siblingOpen:
|
|
382
|
+
declare const siblingOpen: 'sibling-open';
|
|
380
383
|
|
|
381
|
-
declare const swipe:
|
|
384
|
+
declare const swipe: 'swipe';
|
|
382
385
|
|
|
383
|
-
declare const trackPress:
|
|
386
|
+
declare const trackPress: 'track-press';
|
|
384
387
|
|
|
385
|
-
declare const triggerFocus:
|
|
388
|
+
declare const triggerFocus: 'trigger-focus';
|
|
386
389
|
|
|
387
|
-
declare const triggerHover:
|
|
390
|
+
declare const triggerHover: 'trigger-hover';
|
|
388
391
|
|
|
389
|
-
declare const triggerPress:
|
|
392
|
+
declare const triggerPress: 'trigger-press';
|
|
390
393
|
|
|
391
|
-
declare const wheel:
|
|
394
|
+
declare const wheel: 'wheel';
|
|
392
395
|
|
|
393
|
-
declare const windowResize:
|
|
396
|
+
declare const windowResize: 'window-resize';
|
|
394
397
|
|
|
395
398
|
/**
|
|
396
399
|
* Adds a `preventBaseUIHandler` method to all event handlers.
|