@wix/site-ui 1.347.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
package/dist/Progress/index.js
CHANGED
|
@@ -1,49 +1,54 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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>.' :
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
[
|
|
23
|
+
[progressing]: ''
|
|
26
24
|
};
|
|
27
25
|
if ('complete' === value) return {
|
|
28
|
-
[
|
|
26
|
+
[complete]: ''
|
|
29
27
|
};
|
|
30
28
|
if ('indeterminate' === value) return {
|
|
31
|
-
[
|
|
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
|
|
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
|
-
|
|
46
|
-
|
|
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':
|
|
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
|
-
|
|
73
|
-
min,
|
|
77
|
+
percentageValue,
|
|
74
78
|
setLabelId,
|
|
75
79
|
state,
|
|
76
|
-
status,
|
|
77
80
|
value
|
|
78
81
|
}), [
|
|
79
82
|
formattedValue,
|
|
80
|
-
|
|
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 {
|
|
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
|
|
141
|
-
const
|
|
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,
|
package/dist/Radio/index.d.ts
CHANGED
|
@@ -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
|
*/
|
package/dist/Radio/index.js
CHANGED
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import { transitionStatusMapping
|
|
4
|
-
import { useLabelableContext, fieldValidityMapping, useFieldRootContext } from "../
|
|
5
|
-
import {
|
|
6
|
-
import { useRadioGroupContext } from "../
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { useButton } from "../
|
|
16
|
-
import { visuallyHiddenInput, visuallyHidden } from "../
|
|
17
|
-
import { serializeValue } from "../
|
|
18
|
-
import { createChangeEventDetails } from "../
|
|
19
|
-
import { CompositeItem } from "../
|
|
20
|
-
import { useTransitionStatus } from "../
|
|
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
|
-
|
|
23
|
-
|
|
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
|
-
[
|
|
28
|
+
[RadioRootDataAttributes_checked]: ''
|
|
40
29
|
};
|
|
41
30
|
return {
|
|
42
|
-
[
|
|
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>.' :
|
|
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
|
|
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
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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 () {
|
|
@@ -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;
|