@sprawlify/react 0.0.8 → 0.0.10
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/{collapsible-Nbt3Sequ.mjs → collapsible-DCBcxJA8.mjs} +7 -7
- package/dist/{collection-DQWWySNV.mjs → collection-XVYHjcEl.mjs} +2 -2
- package/dist/components/accordion/index.d.cts +11 -11
- package/dist/components/accordion/index.d.mts +11 -11
- package/dist/components/accordion/index.mjs +10 -10
- package/dist/components/angle-slider/index.d.cts +13 -13
- package/dist/components/angle-slider/index.d.mts +13 -13
- package/dist/components/angle-slider/index.mjs +8 -8
- package/dist/components/avatar/index.d.cts +8 -8
- package/dist/components/avatar/index.d.mts +8 -8
- package/dist/components/avatar/index.mjs +8 -8
- package/dist/components/bottom-sheet/index.d.cts +15 -15
- package/dist/components/bottom-sheet/index.d.mts +16 -16
- package/dist/components/bottom-sheet/index.mjs +12 -12
- package/dist/components/carousel/index.d.cts +17 -17
- package/dist/components/carousel/index.d.mts +18 -18
- package/dist/components/carousel/index.mjs +8 -8
- package/dist/components/checkbox/index.d.cts +14 -14
- package/dist/components/checkbox/index.d.mts +14 -14
- package/dist/components/checkbox/index.mjs +13 -13
- package/dist/components/clipboard/index.d.cts +12 -12
- package/dist/components/clipboard/index.d.mts +12 -12
- package/dist/components/clipboard/index.mjs +6 -6
- package/dist/components/collapsible/index.d.cts +10 -10
- package/dist/components/collapsible/index.d.mts +10 -10
- package/dist/components/collapsible/index.mjs +7 -7
- package/dist/components/collection/index.d.cts +1 -1
- package/dist/components/collection/index.d.mts +1 -1
- package/dist/components/collection/index.mjs +3 -3
- package/dist/components/color-picker/index.d.cts +35 -35
- package/dist/components/color-picker/index.d.mts +36 -36
- package/dist/components/color-picker/index.mjs +14 -14
- package/dist/components/combobox/index.d.cts +21 -21
- package/dist/components/combobox/index.d.mts +23 -23
- package/dist/components/combobox/index.mjs +15 -15
- package/dist/components/date-picker/index.d.cts +32 -32
- package/dist/components/date-picker/index.d.mts +33 -33
- package/dist/components/date-picker/index.mjs +11 -11
- package/dist/components/dialog/index.d.cts +15 -15
- package/dist/components/dialog/index.d.mts +16 -16
- package/dist/components/dialog/index.mjs +11 -11
- package/dist/components/download-trigger/index.d.cts +4 -4
- package/dist/components/download-trigger/index.d.mts +4 -4
- package/dist/components/download-trigger/index.mjs +5 -5
- package/dist/components/editable/index.d.cts +13 -13
- package/dist/components/editable/index.d.mts +13 -13
- package/dist/components/editable/index.mjs +11 -11
- package/dist/components/field/index.d.cts +14 -14
- package/dist/components/field/index.d.mts +14 -14
- package/dist/components/field/index.mjs +9 -9
- package/dist/components/fieldset/index.d.cts +10 -10
- package/dist/components/fieldset/index.d.mts +10 -10
- package/dist/components/fieldset/index.mjs +9 -9
- package/dist/components/file-upload/index.d.cts +18 -18
- package/dist/components/file-upload/index.d.mts +18 -18
- package/dist/components/file-upload/index.mjs +11 -11
- package/dist/components/floating-panel/index.d.cts +19 -19
- package/dist/components/floating-panel/index.d.mts +20 -20
- package/dist/components/floating-panel/index.mjs +11 -11
- package/dist/components/focus-trap/index.d.cts +4 -4
- package/dist/components/focus-trap/index.d.mts +4 -4
- package/dist/components/focus-trap/index.mjs +4 -4
- package/dist/components/format/index.d.cts +4 -4
- package/dist/components/format/index.d.mts +4 -4
- package/dist/components/format/index.mjs +3 -3
- package/dist/components/frame/index.d.cts +3 -3
- package/dist/components/frame/index.d.mts +3 -3
- package/dist/components/frame/index.mjs +6 -6
- package/dist/components/highlight/index.d.cts +3 -3
- package/dist/components/highlight/index.d.mts +3 -3
- package/dist/components/highlight/index.mjs +1 -1
- package/dist/components/hover-card/index.cjs +165 -0
- package/dist/components/hover-card/index.d.cts +70 -0
- package/dist/components/hover-card/index.d.mts +71 -0
- package/dist/components/hover-card/index.mjs +143 -0
- package/dist/components/image-cropper/index.cjs +197 -0
- package/dist/components/image-cropper/index.d.cts +64 -0
- package/dist/components/image-cropper/index.d.mts +64 -0
- package/dist/components/image-cropper/index.mjs +175 -0
- package/dist/components/json-tree-view/index.cjs +246 -0
- package/dist/components/json-tree-view/index.d.cts +43 -0
- package/dist/components/json-tree-view/index.d.mts +48 -0
- package/dist/components/json-tree-view/index.mjs +237 -0
- package/dist/components/listbox/index.cjs +314 -0
- package/dist/components/listbox/index.d.cts +110 -0
- package/dist/components/listbox/index.d.mts +110 -0
- package/dist/components/listbox/index.mjs +289 -0
- package/dist/components/marquee/index.cjs +176 -0
- package/dist/components/marquee/index.d.cts +61 -0
- package/dist/components/marquee/index.d.mts +61 -0
- package/dist/components/marquee/index.mjs +155 -0
- package/dist/components/menu/index.cjs +548 -0
- package/dist/components/menu/index.d.cts +159 -0
- package/dist/components/menu/index.d.mts +162 -0
- package/dist/components/menu/index.mjs +512 -0
- package/dist/components/navigation-menu/index.cjs +339 -0
- package/dist/components/navigation-menu/index.d.cts +90 -0
- package/dist/components/navigation-menu/index.d.mts +90 -0
- package/dist/components/navigation-menu/index.mjs +312 -0
- package/dist/components/number-input/index.cjs +237 -0
- package/dist/components/number-input/index.d.cts +74 -0
- package/dist/components/number-input/index.d.mts +74 -0
- package/dist/components/number-input/index.mjs +213 -0
- package/dist/components/pagination/index.cjs +197 -0
- package/dist/components/pagination/index.d.cts +69 -0
- package/dist/components/pagination/index.d.mts +69 -0
- package/dist/components/pagination/index.mjs +174 -0
- package/dist/components/password-input/index.cjs +193 -0
- package/dist/components/password-input/index.d.cts +66 -0
- package/dist/components/password-input/index.d.mts +66 -0
- package/dist/components/password-input/index.mjs +171 -0
- package/dist/components/pin-input/index.cjs +192 -0
- package/dist/components/pin-input/index.d.cts +59 -0
- package/dist/components/pin-input/index.d.mts +59 -0
- package/dist/components/pin-input/index.mjs +171 -0
- package/dist/components/popover/index.cjs +237 -0
- package/dist/components/popover/index.d.cts +95 -0
- package/dist/components/popover/index.d.mts +96 -0
- package/dist/components/popover/index.mjs +210 -0
- package/dist/components/portal/index.cjs +3 -29
- package/dist/components/portal/index.d.cts +2 -2
- package/dist/components/portal/index.d.mts +2 -2
- package/dist/components/portal/index.mjs +5 -30
- package/dist/components/presence/index.d.cts +1 -1
- package/dist/components/presence/index.d.mts +3 -3
- package/dist/components/presence/index.mjs +5 -5
- package/dist/components/progress/index.cjs +222 -0
- package/dist/components/progress/index.d.cts +79 -0
- package/dist/components/progress/index.d.mts +79 -0
- package/dist/components/progress/index.mjs +197 -0
- package/dist/components/qr-code/index.cjs +166 -0
- package/dist/components/qr-code/index.d.cts +59 -0
- package/dist/components/qr-code/index.d.mts +59 -0
- package/dist/components/qr-code/index.mjs +145 -0
- package/dist/components/radio-group/index.cjs +240 -0
- package/dist/components/radio-group/index.d.cts +78 -0
- package/dist/components/radio-group/index.d.mts +78 -0
- package/dist/components/radio-group/index.mjs +215 -0
- package/dist/components/rating-group/index.cjs +202 -0
- package/dist/components/rating-group/index.d.cts +68 -0
- package/dist/components/rating-group/index.d.mts +68 -0
- package/dist/components/rating-group/index.mjs +179 -0
- package/dist/components/scroll-area/index.cjs +180 -0
- package/dist/components/scroll-area/index.d.cts +68 -0
- package/dist/components/scroll-area/index.d.mts +68 -0
- package/dist/components/scroll-area/index.mjs +158 -0
- package/dist/components/segment-group/index.cjs +233 -0
- package/dist/components/segment-group/index.d.cts +82 -0
- package/dist/components/segment-group/index.d.mts +82 -0
- package/dist/components/segment-group/index.mjs +213 -0
- package/dist/components/select/index.d.cts +21 -21
- package/dist/components/select/index.d.mts +22 -22
- package/dist/components/select/index.mjs +15 -15
- package/dist/components/tree-view/index.cjs +51 -0
- package/dist/components/tree-view/index.d.cts +3 -0
- package/dist/components/tree-view/index.d.mts +6 -0
- package/dist/components/tree-view/index.mjs +13 -0
- package/dist/{environment-Ded7DkGr.mjs → environment-Cnx9ZBbN.mjs} +1 -1
- package/dist/{factory-Bi8oEg8i.mjs → factory-BwIiMV5g.mjs} +1 -1
- package/dist/{field-B-6qoKdn.mjs → field-BuPxh7ZO.mjs} +9 -9
- package/dist/{fieldset-gaVneDYh.mjs → fieldset-UIFriN0i.mjs} +8 -8
- package/dist/index-BoKwZUuR.d.mts +150 -0
- package/dist/{index-BhGgEHWc.d.cts → index-C-uklBbh.d.cts} +7 -7
- package/dist/index-CQrt31Vz.d.mts +40 -0
- package/dist/index-IQMPWCzE.d.cts +150 -0
- package/dist/index-YjtX6_Hn.d.cts +52 -0
- package/dist/{index-Cp1i1zbg.d.mts → index-tmg3Dc0S.d.mts} +7 -7
- package/dist/index.d.cts +6 -56
- package/dist/index.d.mts +6 -44
- package/dist/index.mjs +7 -7
- package/dist/{locale-Coin-d7R.mjs → locale-BheNIyu4.mjs} +1 -1
- package/dist/portal-Cf1DNJ7L.mjs +29 -0
- package/dist/portal-DRyJqgA1.cjs +35 -0
- package/dist/{presence-Bc6Bxe5i.mjs → presence-D-rmmMDm.mjs} +6 -6
- package/dist/{render-strategy-FiPgAp1U.mjs → render-strategy-D2htg_Zz.mjs} +2 -2
- package/dist/tree-view-Br67rmuK.mjs +365 -0
- package/dist/tree-view-DsOPEocd.cjs +509 -0
- package/dist/{use-fieldset-context-LwveT1OS.mjs → use-fieldset-context-DPgRcctn.mjs} +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +192 -2
- /package/dist/{chunk-BXPHTOwk.mjs → chunk-tPcuhsU6.mjs} +0 -0
- /package/dist/{compose-refs-BEptPEkE.mjs → compose-refs-ymQahgeo.mjs} +0 -0
- /package/dist/{core-Ba4IEjhK.mjs → core-BrQa5x6H.mjs} +0 -0
- /package/dist/{create-context-CCXzjEv8.mjs → create-context-aizX7yAt.mjs} +0 -0
- /package/dist/{create-split-props-CBL0m-GX.mjs → create-split-props-BHHQqbKs.mjs} +0 -0
- /package/dist/{factory-C-EBNsCW.d.mts → factory-Bv0JsGLd.d.cts} +0 -0
- /package/dist/{factory-C4cfTHs7.d.cts → factory-DcDjbYQq.d.mts} +0 -0
- /package/dist/{index-ByIsf4E7.d.mts → index-BH0zbKp3.d.mts} +0 -0
- /package/dist/{index-CumJbg8V.d.cts → index-CsVbgeF4.d.cts} +0 -0
- /package/dist/{index-dbTyAXLy.d.cts → index-D2T5b4fK.d.cts} +0 -0
- /package/dist/{index-BJvW7OpY.d.mts → index-DJx_8PSR.d.mts} +0 -0
- /package/dist/{index-CureNJdc.d.mts → index-WJ-tNaCp.d.mts} +0 -0
- /package/dist/{normalize-props-skGwa8Dk.d.cts → normalize-props-EzaAUPva.d.cts} +0 -0
- /package/dist/{providers-Dm2P3F2_.mjs → providers-B1DbplwV.mjs} +0 -0
- /package/dist/{render-strategy-C8IyLw0O.d.mts → render-strategy-C5J78Qs-.d.mts} +0 -0
- /package/dist/{render-strategy-rA4C5NUX.d.cts → render-strategy-DEUBHfUP.d.cts} +0 -0
- /package/dist/{types-B4tvWlDb.d.cts → types-C2LNTNCl.d.cts} +0 -0
- /package/dist/{types-BmBABPZb.d.mts → types-CdhepaRC.d.mts} +0 -0
- /package/dist/{use-event-4J5QFFqK.mjs → use-event-qKb6UUEI.mjs} +0 -0
- /package/dist/{use-safe-layout-effect-CLjnuJFb.mjs → use-safe-layout-effect-BHE-Ll-k.mjs} +0 -0
- /package/dist/{utils-C-m3mZWI.mjs → utils-Bx4WJ5W9.mjs} +0 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
const require_chunk = require('../../chunk-BYnRvbsk.cjs');
|
|
2
|
+
const require_core = require('../../core-DCWyxy9D.cjs');
|
|
3
|
+
const require_create_context = require('../../create-context-CQ4U0lLj.cjs');
|
|
4
|
+
const require_environment = require('../../environment-CvilmfQt.cjs');
|
|
5
|
+
const require_locale = require('../../locale-BcnWD1Hf.cjs');
|
|
6
|
+
require('../../providers-BNAArubQ.cjs');
|
|
7
|
+
const require_factory = require('../../factory-C166evrS.cjs');
|
|
8
|
+
const require_create_split_props = require('../../create-split-props-Dp4TWOyM.cjs');
|
|
9
|
+
const require_use_fieldset_context = require('../../use-fieldset-context-CCQLmNLL.cjs');
|
|
10
|
+
require('../../fieldset-B-MkM2Ms.cjs');
|
|
11
|
+
require('../../use-safe-layout-effect-C2GgvNT3.cjs');
|
|
12
|
+
let react = require("react");
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
let __sprawlify_primitives_machines_radio_group = require("@sprawlify/primitives/machines/radio-group");
|
|
15
|
+
__sprawlify_primitives_machines_radio_group = require_chunk.__toESM(__sprawlify_primitives_machines_radio_group);
|
|
16
|
+
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
17
|
+
|
|
18
|
+
//#region src/components/radio-group/use-radio-group-context.ts
|
|
19
|
+
const [RadioGroupProvider, useRadioGroupContext] = require_create_context.createContext({
|
|
20
|
+
name: "RadioGroupContext",
|
|
21
|
+
hookName: "useRadioGroupContext",
|
|
22
|
+
providerName: "<RadioGroupProvider />"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/radio-group/radio-group-context.tsx
|
|
27
|
+
const RadioGroupContext = (props) => props.children(useRadioGroupContext());
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/radio-group/radio-group-indicator.tsx
|
|
31
|
+
const RadioGroupIndicator = (0, react.forwardRef)((props, ref) => {
|
|
32
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useRadioGroupContext().getIndicatorProps(), props);
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
34
|
+
...mergedProps,
|
|
35
|
+
ref
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
RadioGroupIndicator.displayName = "RadioGroupIndicator";
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/radio-group/use-radio-group-item-context.ts
|
|
42
|
+
const [RadioGroupItemProvider, useRadioGroupItemContext] = require_create_context.createContext({
|
|
43
|
+
name: "RadioGroupItemContext",
|
|
44
|
+
hookName: "useRadioGroupItemContext",
|
|
45
|
+
providerName: "<RadioGroupItemProvider />"
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/radio-group/use-radio-group-item-props-context.ts
|
|
50
|
+
const [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = require_create_context.createContext({
|
|
51
|
+
name: "RadioGroupItemPropsContext",
|
|
52
|
+
hookName: "useRadioGroupItemPropsContext",
|
|
53
|
+
providerName: "<RadioGroupItemPropsProvider />"
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/radio-group/radio-group-item.tsx
|
|
58
|
+
const splitItemProps = require_create_split_props.createSplitProps();
|
|
59
|
+
const RadioGroupItem = (0, react.forwardRef)((props, ref) => {
|
|
60
|
+
const [itemProps, localProps] = splitItemProps(props, [
|
|
61
|
+
"value",
|
|
62
|
+
"disabled",
|
|
63
|
+
"invalid"
|
|
64
|
+
]);
|
|
65
|
+
const radioGroup = useRadioGroupContext();
|
|
66
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getItemProps(itemProps), localProps);
|
|
67
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroupItemProvider, {
|
|
68
|
+
value: radioGroup.getItemState(itemProps),
|
|
69
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroupItemPropsProvider, {
|
|
70
|
+
value: itemProps,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
72
|
+
...mergedProps,
|
|
73
|
+
ref
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/radio-group/radio-group-item-context.tsx
|
|
82
|
+
const RadioGroupItemContext = (props) => props.children(useRadioGroupItemContext());
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/radio-group/radio-group-item-control.tsx
|
|
86
|
+
const RadioGroupItemControl = (0, react.forwardRef)((props, ref) => {
|
|
87
|
+
const radioGroup = useRadioGroupContext();
|
|
88
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
89
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getItemControlProps(itemProps), props);
|
|
90
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
91
|
+
...mergedProps,
|
|
92
|
+
ref
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
RadioGroupItemControl.displayName = "RadioGroupItemControl";
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.tsx
|
|
99
|
+
const RadioGroupItemHiddenInput = (0, react.forwardRef)((props, ref) => {
|
|
100
|
+
const radioGroup = useRadioGroupContext();
|
|
101
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
102
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getItemHiddenInputProps(itemProps), props);
|
|
103
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.input, {
|
|
104
|
+
...mergedProps,
|
|
105
|
+
ref
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
RadioGroupItemHiddenInput.displayName = "RadioGroupItemHiddenInput";
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/radio-group/radio-group-item-text.tsx
|
|
112
|
+
const RadioGroupItemText = (0, react.forwardRef)((props, ref) => {
|
|
113
|
+
const radioGroup = useRadioGroupContext();
|
|
114
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
115
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getItemTextProps(itemProps), props);
|
|
116
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
117
|
+
...mergedProps,
|
|
118
|
+
ref
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
RadioGroupItemText.displayName = "RadioGroupItemText";
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/radio-group/radio-group-label.tsx
|
|
125
|
+
const RadioGroupLabel = (0, react.forwardRef)((props, ref) => {
|
|
126
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useRadioGroupContext().getLabelProps(), props);
|
|
127
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
128
|
+
...mergedProps,
|
|
129
|
+
ref
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
RadioGroupLabel.displayName = "RadioGroupLabel";
|
|
133
|
+
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/components/radio-group/use-radio-group.ts
|
|
136
|
+
const useRadioGroup = (props) => {
|
|
137
|
+
const fieldset = require_use_fieldset_context.useFieldsetContext();
|
|
138
|
+
const id = (0, react.useId)();
|
|
139
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
140
|
+
const { dir } = require_locale.useLocaleContext();
|
|
141
|
+
const machineProps = {
|
|
142
|
+
id,
|
|
143
|
+
ids: { label: fieldset?.ids?.legend },
|
|
144
|
+
dir,
|
|
145
|
+
disabled: fieldset?.disabled,
|
|
146
|
+
invalid: fieldset?.invalid,
|
|
147
|
+
getRootNode,
|
|
148
|
+
...props
|
|
149
|
+
};
|
|
150
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_radio_group.machine, machineProps);
|
|
151
|
+
return __sprawlify_primitives_machines_radio_group.connect(service, require_core.normalizeProps);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/components/radio-group/radio-group-root.tsx
|
|
156
|
+
const splitRootProps = require_create_split_props.createSplitProps();
|
|
157
|
+
const RadioGroupRoot = (0, react.forwardRef)((props, ref) => {
|
|
158
|
+
const [useRadioGroupProps, localProps] = splitRootProps(props, [
|
|
159
|
+
"defaultValue",
|
|
160
|
+
"disabled",
|
|
161
|
+
"form",
|
|
162
|
+
"id",
|
|
163
|
+
"ids",
|
|
164
|
+
"invalid",
|
|
165
|
+
"name",
|
|
166
|
+
"onValueChange",
|
|
167
|
+
"orientation",
|
|
168
|
+
"readOnly",
|
|
169
|
+
"required",
|
|
170
|
+
"value"
|
|
171
|
+
]);
|
|
172
|
+
const radioGroup = useRadioGroup(useRadioGroupProps);
|
|
173
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getRootProps(), localProps);
|
|
174
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroupProvider, {
|
|
175
|
+
value: radioGroup,
|
|
176
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
177
|
+
...mergedProps,
|
|
178
|
+
ref
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
RadioGroupRoot.displayName = "RadioGroupRoot";
|
|
183
|
+
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/components/radio-group/radio-group-root-provider.tsx
|
|
186
|
+
const splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
187
|
+
const RadioGroupRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
188
|
+
const [{ value: radioGroup }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
189
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(radioGroup.getRootProps(), localProps);
|
|
190
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioGroupProvider, {
|
|
191
|
+
value: radioGroup,
|
|
192
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
193
|
+
...mergedProps,
|
|
194
|
+
ref
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
RadioGroupRootProvider.displayName = "RadioGroupRootProvider";
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/components/radio-group/radio-group.ts
|
|
202
|
+
var radio_group_exports = /* @__PURE__ */ require_chunk.__export({
|
|
203
|
+
Context: () => RadioGroupContext,
|
|
204
|
+
Indicator: () => RadioGroupIndicator,
|
|
205
|
+
Item: () => RadioGroupItem,
|
|
206
|
+
ItemContext: () => RadioGroupItemContext,
|
|
207
|
+
ItemControl: () => RadioGroupItemControl,
|
|
208
|
+
ItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
209
|
+
ItemText: () => RadioGroupItemText,
|
|
210
|
+
Label: () => RadioGroupLabel,
|
|
211
|
+
Root: () => RadioGroupRoot,
|
|
212
|
+
RootProvider: () => RadioGroupRootProvider
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
//#endregion
|
|
216
|
+
Object.defineProperty(exports, 'RadioGroup', {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return radio_group_exports;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
exports.RadioGroupContext = RadioGroupContext;
|
|
223
|
+
exports.RadioGroupIndicator = RadioGroupIndicator;
|
|
224
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
225
|
+
exports.RadioGroupItemContext = RadioGroupItemContext;
|
|
226
|
+
exports.RadioGroupItemControl = RadioGroupItemControl;
|
|
227
|
+
exports.RadioGroupItemHiddenInput = RadioGroupItemHiddenInput;
|
|
228
|
+
exports.RadioGroupItemText = RadioGroupItemText;
|
|
229
|
+
exports.RadioGroupLabel = RadioGroupLabel;
|
|
230
|
+
exports.RadioGroupRoot = RadioGroupRoot;
|
|
231
|
+
exports.RadioGroupRootProvider = RadioGroupRootProvider;
|
|
232
|
+
Object.defineProperty(exports, 'radioGroupAnatomy', {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
get: function () {
|
|
235
|
+
return __sprawlify_primitives_machines_radio_group.anatomy;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
exports.useRadioGroup = useRadioGroup;
|
|
239
|
+
exports.useRadioGroupContext = useRadioGroupContext;
|
|
240
|
+
exports.useRadioGroupItemContext = useRadioGroupItemContext;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { t as PropTypes } from "../../normalize-props-EzaAUPva.cjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "../../types-C2LNTNCl.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-Bv0JsGLd.cjs";
|
|
4
|
+
import * as react73 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
7
|
+
import { ItemProps, ItemState, ValueChangeDetails, ValueChangeDetails as RadioGroupValueChangeDetails, anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/radio-group/use-radio-group.d.ts
|
|
10
|
+
interface UseRadioGroupProps extends Optional<Omit<radio.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseRadioGroupReturn extends radio.Api<PropTypes> {}
|
|
12
|
+
declare const useRadioGroup: (props?: UseRadioGroupProps) => UseRadioGroupReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/radio-group/use-radio-group-context.d.ts
|
|
15
|
+
interface UseRadioGroupContext extends UseRadioGroupReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/radio-group/radio-group-context.d.ts
|
|
18
|
+
interface RadioGroupContextProps {
|
|
19
|
+
children: (context: UseRadioGroupContext) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const RadioGroupContext: (props: RadioGroupContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/radio-group/radio-group-indicator.d.ts
|
|
24
|
+
interface RadioGroupIndicatorBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface RadioGroupIndicatorProps extends HTMLProps<"div">, RadioGroupIndicatorBaseProps {}
|
|
26
|
+
declare const RadioGroupIndicator: react73.ForwardRefExoticComponent<RadioGroupIndicatorProps & react73.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/radio-group/radio-group-item.d.ts
|
|
29
|
+
interface RadioGroupItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
30
|
+
interface RadioGroupItemProps extends HTMLProps<"label">, RadioGroupItemBaseProps {}
|
|
31
|
+
declare const RadioGroupItem: react73.ForwardRefExoticComponent<RadioGroupItemProps & react73.RefAttributes<HTMLLabelElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/radio-group/use-radio-group-item-context.d.ts
|
|
34
|
+
interface UseRadioGroupItemContext extends ItemState {}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/radio-group/radio-group-item-context.d.ts
|
|
37
|
+
interface RadioGroupItemContextProps {
|
|
38
|
+
children: (context: UseRadioGroupItemContext) => ReactNode;
|
|
39
|
+
}
|
|
40
|
+
declare const RadioGroupItemContext: (props: RadioGroupItemContextProps) => ReactNode;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/radio-group/radio-group-item-control.d.ts
|
|
43
|
+
interface RadioGroupItemControlBaseProps extends PolymorphicProps {}
|
|
44
|
+
interface RadioGroupItemControlProps extends HTMLProps<"div">, RadioGroupItemControlBaseProps {}
|
|
45
|
+
declare const RadioGroupItemControl: react73.ForwardRefExoticComponent<RadioGroupItemControlProps & react73.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.d.ts
|
|
48
|
+
interface RadioGroupItemHiddenInputBaseProps extends PolymorphicProps {}
|
|
49
|
+
interface RadioGroupItemHiddenInputProps extends HTMLProps<"input">, RadioGroupItemHiddenInputBaseProps {}
|
|
50
|
+
declare const RadioGroupItemHiddenInput: react73.ForwardRefExoticComponent<RadioGroupItemHiddenInputProps & react73.RefAttributes<HTMLInputElement>>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/radio-group/radio-group-item-text.d.ts
|
|
53
|
+
interface RadioGroupItemTextBaseProps extends PolymorphicProps {}
|
|
54
|
+
interface RadioGroupItemTextProps extends HTMLProps<"span">, RadioGroupItemTextBaseProps {}
|
|
55
|
+
declare const RadioGroupItemText: react73.ForwardRefExoticComponent<RadioGroupItemTextProps & react73.RefAttributes<HTMLSpanElement>>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/radio-group/radio-group-label.d.ts
|
|
58
|
+
interface RadioGroupLabelBaseProps extends PolymorphicProps {}
|
|
59
|
+
interface RadioGroupLabelProps extends HTMLProps<"label">, RadioGroupLabelBaseProps {}
|
|
60
|
+
declare const RadioGroupLabel: react73.ForwardRefExoticComponent<RadioGroupLabelProps & react73.RefAttributes<HTMLLabelElement>>;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/radio-group/radio-group-root.d.ts
|
|
63
|
+
interface RadioGroupRootBaseProps extends UseRadioGroupProps, PolymorphicProps {}
|
|
64
|
+
interface RadioGroupRootProps extends Assign<HTMLProps<"div">, RadioGroupRootBaseProps> {}
|
|
65
|
+
declare const RadioGroupRoot: react73.ForwardRefExoticComponent<RadioGroupRootProps & react73.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/radio-group/radio-group-root-provider.d.ts
|
|
68
|
+
interface RootProviderProps {
|
|
69
|
+
value: UseRadioGroupReturn;
|
|
70
|
+
}
|
|
71
|
+
interface RadioGroupRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
72
|
+
interface RadioGroupRootProviderProps extends HTMLProps<"div">, RadioGroupRootProviderBaseProps {}
|
|
73
|
+
declare const RadioGroupRootProvider: react73.ForwardRefExoticComponent<RadioGroupRootProviderProps & react73.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
declare namespace radio_group_d_exports {
|
|
75
|
+
export { RadioGroupContext as Context, RadioGroupContext as ContextProps, RadioGroupIndicator as Indicator, RadioGroupIndicatorBaseProps as IndicatorBaseProps, RadioGroupIndicatorProps as IndicatorProps, RadioGroupItem as Item, RadioGroupItemBaseProps as ItemBaseProps, RadioGroupItemContext as ItemContext, RadioGroupItemContext as ItemContextProps, RadioGroupItemControl as ItemControl, RadioGroupItemControlBaseProps as ItemControlBaseProps, RadioGroupItemControlProps as ItemControlProps, RadioGroupItemHiddenInput as ItemHiddenInput, RadioGroupItemHiddenInputBaseProps as ItemHiddenInputBaseProps, RadioGroupItemHiddenInputProps as ItemHiddenInputProps, RadioGroupItemProps as ItemProps, RadioGroupItemText as ItemText, RadioGroupItemTextBaseProps as ItemTextBaseProps, RadioGroupItemTextProps as ItemTextProps, RadioGroupLabel as Label, RadioGroupLabelBaseProps as LabelBaseProps, RadioGroupLabelProps as LabelProps, RadioGroupRoot as Root, RadioGroupRootBaseProps as RootBaseProps, RadioGroupRootProps as RootProps, RadioGroupRootProvider as RootProvider, RadioGroupRootProviderBaseProps as RootProviderBaseProps, RadioGroupRootProviderProps as RootProviderProps, ValueChangeDetails };
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { radio_group_d_exports as RadioGroup, RadioGroupContext, type RadioGroupContextProps, RadioGroupIndicator, type RadioGroupIndicatorBaseProps, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemBaseProps, RadioGroupItemContext, type RadioGroupItemContextProps, RadioGroupItemControl, type RadioGroupItemControlBaseProps, type RadioGroupItemControlProps, RadioGroupItemHiddenInput, type RadioGroupItemHiddenInputBaseProps, type RadioGroupItemHiddenInputProps, type RadioGroupItemProps, RadioGroupItemText, type RadioGroupItemTextBaseProps, type RadioGroupItemTextProps, RadioGroupLabel, type RadioGroupLabelBaseProps, type RadioGroupLabelProps, RadioGroupRoot, type RadioGroupRootBaseProps, type RadioGroupRootProps, RadioGroupRootProvider, type RadioGroupRootProviderBaseProps, type RadioGroupRootProviderProps, type RadioGroupValueChangeDetails, type UseRadioGroupContext, type UseRadioGroupItemContext, type UseRadioGroupProps, type UseRadioGroupReturn, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { r as PropTypes } from "../../index-DJx_8PSR.mjs";
|
|
2
|
+
import { r as Optional, t as Assign } from "../../types-CdhepaRC.mjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-DcDjbYQq.mjs";
|
|
4
|
+
import * as react111 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
7
|
+
import { ItemProps, ItemState, ValueChangeDetails, ValueChangeDetails as RadioGroupValueChangeDetails, anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
8
|
+
|
|
9
|
+
//#region src/components/radio-group/use-radio-group.d.ts
|
|
10
|
+
interface UseRadioGroupProps extends Optional<Omit<radio.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseRadioGroupReturn extends radio.Api<PropTypes> {}
|
|
12
|
+
declare const useRadioGroup: (props?: UseRadioGroupProps) => UseRadioGroupReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/radio-group/use-radio-group-context.d.ts
|
|
15
|
+
interface UseRadioGroupContext extends UseRadioGroupReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/radio-group/radio-group-context.d.ts
|
|
18
|
+
interface RadioGroupContextProps {
|
|
19
|
+
children: (context: UseRadioGroupContext) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const RadioGroupContext: (props: RadioGroupContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/radio-group/radio-group-indicator.d.ts
|
|
24
|
+
interface RadioGroupIndicatorBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface RadioGroupIndicatorProps extends HTMLProps<"div">, RadioGroupIndicatorBaseProps {}
|
|
26
|
+
declare const RadioGroupIndicator: react111.ForwardRefExoticComponent<RadioGroupIndicatorProps & react111.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/radio-group/radio-group-item.d.ts
|
|
29
|
+
interface RadioGroupItemBaseProps extends ItemProps, PolymorphicProps {}
|
|
30
|
+
interface RadioGroupItemProps extends HTMLProps<"label">, RadioGroupItemBaseProps {}
|
|
31
|
+
declare const RadioGroupItem: react111.ForwardRefExoticComponent<RadioGroupItemProps & react111.RefAttributes<HTMLLabelElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/radio-group/use-radio-group-item-context.d.ts
|
|
34
|
+
interface UseRadioGroupItemContext extends ItemState {}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/radio-group/radio-group-item-context.d.ts
|
|
37
|
+
interface RadioGroupItemContextProps {
|
|
38
|
+
children: (context: UseRadioGroupItemContext) => ReactNode;
|
|
39
|
+
}
|
|
40
|
+
declare const RadioGroupItemContext: (props: RadioGroupItemContextProps) => ReactNode;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/radio-group/radio-group-item-control.d.ts
|
|
43
|
+
interface RadioGroupItemControlBaseProps extends PolymorphicProps {}
|
|
44
|
+
interface RadioGroupItemControlProps extends HTMLProps<"div">, RadioGroupItemControlBaseProps {}
|
|
45
|
+
declare const RadioGroupItemControl: react111.ForwardRefExoticComponent<RadioGroupItemControlProps & react111.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.d.ts
|
|
48
|
+
interface RadioGroupItemHiddenInputBaseProps extends PolymorphicProps {}
|
|
49
|
+
interface RadioGroupItemHiddenInputProps extends HTMLProps<"input">, RadioGroupItemHiddenInputBaseProps {}
|
|
50
|
+
declare const RadioGroupItemHiddenInput: react111.ForwardRefExoticComponent<RadioGroupItemHiddenInputProps & react111.RefAttributes<HTMLInputElement>>;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/components/radio-group/radio-group-item-text.d.ts
|
|
53
|
+
interface RadioGroupItemTextBaseProps extends PolymorphicProps {}
|
|
54
|
+
interface RadioGroupItemTextProps extends HTMLProps<"span">, RadioGroupItemTextBaseProps {}
|
|
55
|
+
declare const RadioGroupItemText: react111.ForwardRefExoticComponent<RadioGroupItemTextProps & react111.RefAttributes<HTMLSpanElement>>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/radio-group/radio-group-label.d.ts
|
|
58
|
+
interface RadioGroupLabelBaseProps extends PolymorphicProps {}
|
|
59
|
+
interface RadioGroupLabelProps extends HTMLProps<"label">, RadioGroupLabelBaseProps {}
|
|
60
|
+
declare const RadioGroupLabel: react111.ForwardRefExoticComponent<RadioGroupLabelProps & react111.RefAttributes<HTMLLabelElement>>;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/radio-group/radio-group-root.d.ts
|
|
63
|
+
interface RadioGroupRootBaseProps extends UseRadioGroupProps, PolymorphicProps {}
|
|
64
|
+
interface RadioGroupRootProps extends Assign<HTMLProps<"div">, RadioGroupRootBaseProps> {}
|
|
65
|
+
declare const RadioGroupRoot: react111.ForwardRefExoticComponent<RadioGroupRootProps & react111.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/radio-group/radio-group-root-provider.d.ts
|
|
68
|
+
interface RootProviderProps {
|
|
69
|
+
value: UseRadioGroupReturn;
|
|
70
|
+
}
|
|
71
|
+
interface RadioGroupRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
72
|
+
interface RadioGroupRootProviderProps extends HTMLProps<"div">, RadioGroupRootProviderBaseProps {}
|
|
73
|
+
declare const RadioGroupRootProvider: react111.ForwardRefExoticComponent<RadioGroupRootProviderProps & react111.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
declare namespace radio_group_d_exports {
|
|
75
|
+
export { RadioGroupContext as Context, RadioGroupContext as ContextProps, RadioGroupIndicator as Indicator, RadioGroupIndicatorBaseProps as IndicatorBaseProps, RadioGroupIndicatorProps as IndicatorProps, RadioGroupItem as Item, RadioGroupItemBaseProps as ItemBaseProps, RadioGroupItemContext as ItemContext, RadioGroupItemContext as ItemContextProps, RadioGroupItemControl as ItemControl, RadioGroupItemControlBaseProps as ItemControlBaseProps, RadioGroupItemControlProps as ItemControlProps, RadioGroupItemHiddenInput as ItemHiddenInput, RadioGroupItemHiddenInputBaseProps as ItemHiddenInputBaseProps, RadioGroupItemHiddenInputProps as ItemHiddenInputProps, RadioGroupItemProps as ItemProps, RadioGroupItemText as ItemText, RadioGroupItemTextBaseProps as ItemTextBaseProps, RadioGroupItemTextProps as ItemTextProps, RadioGroupLabel as Label, RadioGroupLabelBaseProps as LabelBaseProps, RadioGroupLabelProps as LabelProps, RadioGroupRoot as Root, RadioGroupRootBaseProps as RootBaseProps, RadioGroupRootProps as RootProps, RadioGroupRootProvider as RootProvider, RadioGroupRootProviderBaseProps as RootProviderBaseProps, RadioGroupRootProviderProps as RootProviderProps, ValueChangeDetails };
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { radio_group_d_exports as RadioGroup, RadioGroupContext, type RadioGroupContextProps, RadioGroupIndicator, type RadioGroupIndicatorBaseProps, type RadioGroupIndicatorProps, RadioGroupItem, type RadioGroupItemBaseProps, RadioGroupItemContext, type RadioGroupItemContextProps, RadioGroupItemControl, type RadioGroupItemControlBaseProps, type RadioGroupItemControlProps, RadioGroupItemHiddenInput, type RadioGroupItemHiddenInputBaseProps, type RadioGroupItemHiddenInputProps, type RadioGroupItemProps, RadioGroupItemText, type RadioGroupItemTextBaseProps, type RadioGroupItemTextProps, RadioGroupLabel, type RadioGroupLabelBaseProps, type RadioGroupLabelProps, RadioGroupRoot, type RadioGroupRootBaseProps, type RadioGroupRootProps, RadioGroupRootProvider, type RadioGroupRootProviderBaseProps, type RadioGroupRootProviderProps, type RadioGroupValueChangeDetails, type UseRadioGroupContext, type UseRadioGroupItemContext, type UseRadioGroupProps, type UseRadioGroupReturn, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-tPcuhsU6.mjs";
|
|
2
|
+
import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-BrQa5x6H.mjs";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-aizX7yAt.mjs";
|
|
4
|
+
import { n as useEnvironmentContext } from "../../environment-Cnx9ZBbN.mjs";
|
|
5
|
+
import { i as useLocaleContext } from "../../locale-BheNIyu4.mjs";
|
|
6
|
+
import "../../providers-B1DbplwV.mjs";
|
|
7
|
+
import { n as sprawlify } from "../../factory-BwIiMV5g.mjs";
|
|
8
|
+
import { t as createSplitProps } from "../../create-split-props-BHHQqbKs.mjs";
|
|
9
|
+
import { n as useFieldsetContext } from "../../use-fieldset-context-DPgRcctn.mjs";
|
|
10
|
+
import "../../fieldset-UIFriN0i.mjs";
|
|
11
|
+
import "../../use-safe-layout-effect-BHE-Ll-k.mjs";
|
|
12
|
+
import { forwardRef, useId } from "react";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
import * as radio from "@sprawlify/primitives/machines/radio-group";
|
|
15
|
+
import { anatomy as radioGroupAnatomy } from "@sprawlify/primitives/machines/radio-group";
|
|
16
|
+
|
|
17
|
+
//#region src/components/radio-group/use-radio-group-context.ts
|
|
18
|
+
const [RadioGroupProvider, useRadioGroupContext] = createContext$1({
|
|
19
|
+
name: "RadioGroupContext",
|
|
20
|
+
hookName: "useRadioGroupContext",
|
|
21
|
+
providerName: "<RadioGroupProvider />"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/radio-group/radio-group-context.tsx
|
|
26
|
+
const RadioGroupContext = (props) => props.children(useRadioGroupContext());
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/radio-group/radio-group-indicator.tsx
|
|
30
|
+
const RadioGroupIndicator = forwardRef((props, ref) => {
|
|
31
|
+
const mergedProps = mergeProps(useRadioGroupContext().getIndicatorProps(), props);
|
|
32
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
RadioGroupIndicator.displayName = "RadioGroupIndicator";
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/radio-group/use-radio-group-item-context.ts
|
|
41
|
+
const [RadioGroupItemProvider, useRadioGroupItemContext] = createContext$1({
|
|
42
|
+
name: "RadioGroupItemContext",
|
|
43
|
+
hookName: "useRadioGroupItemContext",
|
|
44
|
+
providerName: "<RadioGroupItemProvider />"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/radio-group/use-radio-group-item-props-context.ts
|
|
49
|
+
const [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = createContext$1({
|
|
50
|
+
name: "RadioGroupItemPropsContext",
|
|
51
|
+
hookName: "useRadioGroupItemPropsContext",
|
|
52
|
+
providerName: "<RadioGroupItemPropsProvider />"
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/radio-group/radio-group-item.tsx
|
|
57
|
+
const splitItemProps = createSplitProps();
|
|
58
|
+
const RadioGroupItem = forwardRef((props, ref) => {
|
|
59
|
+
const [itemProps, localProps] = splitItemProps(props, [
|
|
60
|
+
"value",
|
|
61
|
+
"disabled",
|
|
62
|
+
"invalid"
|
|
63
|
+
]);
|
|
64
|
+
const radioGroup = useRadioGroupContext();
|
|
65
|
+
const mergedProps = mergeProps(radioGroup.getItemProps(itemProps), localProps);
|
|
66
|
+
return /* @__PURE__ */ jsx(RadioGroupItemProvider, {
|
|
67
|
+
value: radioGroup.getItemState(itemProps),
|
|
68
|
+
children: /* @__PURE__ */ jsx(RadioGroupItemPropsProvider, {
|
|
69
|
+
value: itemProps,
|
|
70
|
+
children: /* @__PURE__ */ jsx(sprawlify.label, {
|
|
71
|
+
...mergedProps,
|
|
72
|
+
ref
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
RadioGroupItem.displayName = "RadioGroupItem";
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/components/radio-group/radio-group-item-context.tsx
|
|
81
|
+
const RadioGroupItemContext = (props) => props.children(useRadioGroupItemContext());
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/radio-group/radio-group-item-control.tsx
|
|
85
|
+
const RadioGroupItemControl = forwardRef((props, ref) => {
|
|
86
|
+
const radioGroup = useRadioGroupContext();
|
|
87
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
88
|
+
const mergedProps = mergeProps(radioGroup.getItemControlProps(itemProps), props);
|
|
89
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
90
|
+
...mergedProps,
|
|
91
|
+
ref
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
RadioGroupItemControl.displayName = "RadioGroupItemControl";
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/radio-group/radio-group-item-hidden-input.tsx
|
|
98
|
+
const RadioGroupItemHiddenInput = forwardRef((props, ref) => {
|
|
99
|
+
const radioGroup = useRadioGroupContext();
|
|
100
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
101
|
+
const mergedProps = mergeProps(radioGroup.getItemHiddenInputProps(itemProps), props);
|
|
102
|
+
return /* @__PURE__ */ jsx(sprawlify.input, {
|
|
103
|
+
...mergedProps,
|
|
104
|
+
ref
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
RadioGroupItemHiddenInput.displayName = "RadioGroupItemHiddenInput";
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/components/radio-group/radio-group-item-text.tsx
|
|
111
|
+
const RadioGroupItemText = forwardRef((props, ref) => {
|
|
112
|
+
const radioGroup = useRadioGroupContext();
|
|
113
|
+
const itemProps = useRadioGroupItemPropsContext();
|
|
114
|
+
const mergedProps = mergeProps(radioGroup.getItemTextProps(itemProps), props);
|
|
115
|
+
return /* @__PURE__ */ jsx(sprawlify.span, {
|
|
116
|
+
...mergedProps,
|
|
117
|
+
ref
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
RadioGroupItemText.displayName = "RadioGroupItemText";
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/radio-group/radio-group-label.tsx
|
|
124
|
+
const RadioGroupLabel = forwardRef((props, ref) => {
|
|
125
|
+
const mergedProps = mergeProps(useRadioGroupContext().getLabelProps(), props);
|
|
126
|
+
return /* @__PURE__ */ jsx(sprawlify.label, {
|
|
127
|
+
...mergedProps,
|
|
128
|
+
ref
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
RadioGroupLabel.displayName = "RadioGroupLabel";
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/components/radio-group/use-radio-group.ts
|
|
135
|
+
const useRadioGroup = (props) => {
|
|
136
|
+
const fieldset = useFieldsetContext();
|
|
137
|
+
const id = useId();
|
|
138
|
+
const { getRootNode } = useEnvironmentContext();
|
|
139
|
+
const { dir } = useLocaleContext();
|
|
140
|
+
const machineProps = {
|
|
141
|
+
id,
|
|
142
|
+
ids: { label: fieldset?.ids?.legend },
|
|
143
|
+
dir,
|
|
144
|
+
disabled: fieldset?.disabled,
|
|
145
|
+
invalid: fieldset?.invalid,
|
|
146
|
+
getRootNode,
|
|
147
|
+
...props
|
|
148
|
+
};
|
|
149
|
+
const service = useMachine(radio.machine, machineProps);
|
|
150
|
+
return radio.connect(service, normalizeProps);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/components/radio-group/radio-group-root.tsx
|
|
155
|
+
const splitRootProps = createSplitProps();
|
|
156
|
+
const RadioGroupRoot = forwardRef((props, ref) => {
|
|
157
|
+
const [useRadioGroupProps, localProps] = splitRootProps(props, [
|
|
158
|
+
"defaultValue",
|
|
159
|
+
"disabled",
|
|
160
|
+
"form",
|
|
161
|
+
"id",
|
|
162
|
+
"ids",
|
|
163
|
+
"invalid",
|
|
164
|
+
"name",
|
|
165
|
+
"onValueChange",
|
|
166
|
+
"orientation",
|
|
167
|
+
"readOnly",
|
|
168
|
+
"required",
|
|
169
|
+
"value"
|
|
170
|
+
]);
|
|
171
|
+
const radioGroup = useRadioGroup(useRadioGroupProps);
|
|
172
|
+
const mergedProps = mergeProps(radioGroup.getRootProps(), localProps);
|
|
173
|
+
return /* @__PURE__ */ jsx(RadioGroupProvider, {
|
|
174
|
+
value: radioGroup,
|
|
175
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
176
|
+
...mergedProps,
|
|
177
|
+
ref
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
RadioGroupRoot.displayName = "RadioGroupRoot";
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/components/radio-group/radio-group-root-provider.tsx
|
|
185
|
+
const splitRootProviderProps = createSplitProps();
|
|
186
|
+
const RadioGroupRootProvider = forwardRef((props, ref) => {
|
|
187
|
+
const [{ value: radioGroup }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
188
|
+
const mergedProps = mergeProps(radioGroup.getRootProps(), localProps);
|
|
189
|
+
return /* @__PURE__ */ jsx(RadioGroupProvider, {
|
|
190
|
+
value: radioGroup,
|
|
191
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
192
|
+
...mergedProps,
|
|
193
|
+
ref
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
RadioGroupRootProvider.displayName = "RadioGroupRootProvider";
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/components/radio-group/radio-group.ts
|
|
201
|
+
var radio_group_exports = /* @__PURE__ */ __export({
|
|
202
|
+
Context: () => RadioGroupContext,
|
|
203
|
+
Indicator: () => RadioGroupIndicator,
|
|
204
|
+
Item: () => RadioGroupItem,
|
|
205
|
+
ItemContext: () => RadioGroupItemContext,
|
|
206
|
+
ItemControl: () => RadioGroupItemControl,
|
|
207
|
+
ItemHiddenInput: () => RadioGroupItemHiddenInput,
|
|
208
|
+
ItemText: () => RadioGroupItemText,
|
|
209
|
+
Label: () => RadioGroupLabel,
|
|
210
|
+
Root: () => RadioGroupRoot,
|
|
211
|
+
RootProvider: () => RadioGroupRootProvider
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
export { radio_group_exports as RadioGroup, RadioGroupContext, RadioGroupIndicator, RadioGroupItem, RadioGroupItemContext, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemText, RadioGroupLabel, RadioGroupRoot, RadioGroupRootProvider, radioGroupAnatomy, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext };
|