@sprawlify/react 0.0.9 → 0.0.11
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-vqmKK3px.mjs → collapsible-pBuZr56X.mjs} +7 -7
- package/dist/{collection-BYYMj_V8.mjs → collection-ZQpeUlrg.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 +18 -18
- 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 +22 -22
- 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 +8 -8
- 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.d.cts +13 -13
- package/dist/components/hover-card/index.d.mts +14 -14
- package/dist/components/hover-card/index.mjs +10 -10
- package/dist/components/image-cropper/index.d.cts +11 -11
- package/dist/components/image-cropper/index.d.mts +11 -11
- package/dist/components/image-cropper/index.mjs +8 -8
- package/dist/components/json-tree-view/index.d.cts +5 -5
- package/dist/components/json-tree-view/index.d.mts +9 -9
- package/dist/components/json-tree-view/index.mjs +13 -13
- package/dist/components/listbox/index.d.cts +17 -17
- package/dist/components/listbox/index.d.mts +17 -17
- package/dist/components/listbox/index.mjs +10 -10
- package/dist/components/marquee/index.d.cts +10 -10
- package/dist/components/marquee/index.d.mts +10 -10
- package/dist/components/marquee/index.mjs +8 -8
- package/dist/components/menu/index.d.cts +25 -25
- package/dist/components/menu/index.d.mts +28 -28
- package/dist/components/menu/index.mjs +11 -11
- package/dist/components/navigation-menu/index.d.cts +17 -17
- package/dist/components/navigation-menu/index.d.mts +17 -17
- package/dist/components/navigation-menu/index.mjs +13 -13
- package/dist/components/number-input/index.d.cts +13 -13
- package/dist/components/number-input/index.d.mts +13 -13
- package/dist/components/number-input/index.mjs +11 -11
- package/dist/components/pagination/index.d.cts +12 -12
- package/dist/components/pagination/index.d.mts +12 -12
- package/dist/components/pagination/index.mjs +8 -8
- package/dist/components/password-input/index.d.cts +11 -11
- package/dist/components/password-input/index.d.mts +11 -11
- package/dist/components/password-input/index.mjs +11 -11
- package/dist/components/pin-input/index.d.cts +10 -10
- package/dist/components/pin-input/index.d.mts +10 -10
- package/dist/components/pin-input/index.mjs +11 -11
- package/dist/components/popover/index.d.cts +18 -18
- package/dist/components/popover/index.d.mts +19 -19
- package/dist/components/popover/index.mjs +10 -10
- 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 -5
- 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/signature-pad/index.cjs +213 -0
- package/dist/components/signature-pad/index.d.cts +69 -0
- package/dist/components/signature-pad/index.d.mts +69 -0
- package/dist/components/signature-pad/index.mjs +190 -0
- package/dist/components/slider/index.cjs +278 -0
- package/dist/components/slider/index.d.cts +89 -0
- package/dist/components/slider/index.d.mts +89 -0
- package/dist/components/slider/index.mjs +251 -0
- package/dist/components/splitter/index.cjs +177 -0
- package/dist/components/splitter/index.d.cts +54 -0
- package/dist/components/splitter/index.d.mts +54 -0
- package/dist/components/splitter/index.mjs +151 -0
- package/dist/components/steps/index.cjs +289 -0
- package/dist/components/steps/index.d.cts +104 -0
- package/dist/components/steps/index.d.mts +104 -0
- package/dist/components/steps/index.mjs +260 -0
- package/dist/components/switch/index.cjs +180 -0
- package/dist/components/switch/index.d.cts +59 -0
- package/dist/components/switch/index.d.mts +59 -0
- package/dist/components/switch/index.mjs +159 -0
- package/dist/components/tabs/index.cjs +191 -0
- package/dist/components/tabs/index.d.cts +60 -0
- package/dist/components/tabs/index.d.mts +60 -0
- package/dist/components/tabs/index.mjs +170 -0
- package/dist/components/tags-input/index.cjs +318 -0
- package/dist/components/tags-input/index.d.cts +98 -0
- package/dist/components/tags-input/index.d.mts +98 -0
- package/dist/components/tags-input/index.mjs +289 -0
- package/dist/components/timer/index.cjs +179 -0
- package/dist/components/timer/index.d.cts +64 -0
- package/dist/components/timer/index.d.mts +64 -0
- package/dist/components/timer/index.mjs +157 -0
- package/dist/components/toast/index.cjs +165 -0
- package/dist/components/toast/index.d.cts +60 -0
- package/dist/components/toast/index.d.mts +60 -0
- package/dist/components/toast/index.mjs +144 -0
- package/dist/components/toggle/index.cjs +93 -0
- package/dist/components/toggle/index.d.cts +40 -0
- package/dist/components/toggle/index.d.mts +40 -0
- package/dist/components/toggle/index.mjs +80 -0
- package/dist/components/toggle-group/index.cjs +127 -0
- package/dist/components/toggle-group/index.d.cts +44 -0
- package/dist/components/toggle-group/index.d.mts +44 -0
- package/dist/components/toggle-group/index.mjs +109 -0
- package/dist/components/tooltip/index.cjs +165 -0
- package/dist/components/tooltip/index.d.cts +70 -0
- package/dist/components/tooltip/index.d.mts +71 -0
- package/dist/components/tooltip/index.mjs +143 -0
- package/dist/components/tour/index.cjs +274 -0
- package/dist/components/tour/index.d.cts +108 -0
- package/dist/components/tour/index.d.mts +109 -0
- package/dist/components/tour/index.mjs +250 -0
- package/dist/components/tree-view/index.d.cts +2 -2
- package/dist/components/tree-view/index.d.mts +5 -5
- package/dist/components/tree-view/index.mjs +11 -11
- package/dist/{environment-Cc02I6aF.mjs → environment-tlwGXNO0.mjs} +1 -1
- package/dist/{factory-7ydMApfi.mjs → factory-cfMsSoBo.mjs} +1 -1
- package/dist/{field-BXY6su53.mjs → field-gOd2zfjb.mjs} +9 -9
- package/dist/{fieldset-BeHm9oxe.mjs → fieldset-BEq6qoMh.mjs} +8 -8
- package/dist/{index-Cquz7y70.d.cts → index-BCPLfgXO.d.cts} +3 -3
- package/dist/{index-wlpTZGhs.d.mts → index-BFMTj3aZ.d.mts} +25 -25
- package/dist/{index-aYGfRRLA.d.cts → index-BTuBtHhO.d.cts} +7 -7
- package/dist/{index-DTzLUoop.d.cts → index-CceDvJme.d.cts} +25 -25
- package/dist/{index-BcXWsxRa.d.mts → index-Z3NG9Uo-.d.mts} +3 -3
- package/dist/{index-Bkxp7VrU.d.mts → index-zgzvveQM.d.mts} +7 -7
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +7 -7
- package/dist/{locale-D4LX0eEq.mjs → locale-BmYiujeK.mjs} +1 -1
- package/dist/{portal-BOhFScBS.mjs → portal-KVRub3AL.mjs} +1 -1
- package/dist/{presence-C9BcvdTf.mjs → presence-CxbyNsuo.mjs} +6 -6
- package/dist/{render-strategy-BgIBKraZ.mjs → render-strategy-BakagjKt.mjs} +2 -2
- package/dist/{tree-view-CzJvwlYQ.mjs → tree-view-D3_iO1Yt.mjs} +9 -9
- package/dist/{use-fieldset-context-6GRSrrlt.mjs → use-fieldset-context-BhJsLpTP.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-BU8PiJgx.mjs → chunk-Bw6_Qrqn.mjs} +0 -0
- /package/dist/{compose-refs-Cl5LpASY.mjs → compose-refs-DSWOgxGb.mjs} +0 -0
- /package/dist/{core-79NSyZp-.mjs → core-CAwCcfBy.mjs} +0 -0
- /package/dist/{create-context-DbhrVE2B.mjs → create-context-B-_JrOL2.mjs} +0 -0
- /package/dist/{create-split-props-BJdRM9I_.mjs → create-split-props-BjYU0VXX.mjs} +0 -0
- /package/dist/{factory-DaVlp4Ba.d.mts → factory-Fen9bAK7.d.mts} +0 -0
- /package/dist/{factory-fcFI3pbG.d.cts → factory-dXEes8-E.d.cts} +0 -0
- /package/dist/{index-DPoOdvOg.d.mts → index-BHMQ8oZ_.d.mts} +0 -0
- /package/dist/{index-BLd57Y0z.d.mts → index-BVPDbcQQ.d.mts} +0 -0
- /package/dist/{index-CReeoTjv.d.cts → index-D5x5-_6p.d.cts} +0 -0
- /package/dist/{index-BoLg0FWF.d.mts → index-DFbafCkW.d.mts} +0 -0
- /package/dist/{index-r8rv70-L.d.cts → index-Kf5h4wwZ.d.cts} +0 -0
- /package/dist/{normalize-props-Dw0EepzR.d.cts → normalize-props-Ddn7AQaE.d.cts} +0 -0
- /package/dist/{providers-CoJceYkV.mjs → providers-DPvEY1gv.mjs} +0 -0
- /package/dist/{render-strategy-M8NkD01w.d.cts → render-strategy-B_O9rJFa.d.cts} +0 -0
- /package/dist/{render-strategy-CRwPcG33.d.mts → render-strategy-DHJmxfwl.d.mts} +0 -0
- /package/dist/{types-CrwpJrFp.d.mts → types-0lfB8uM7.d.cts} +0 -0
- /package/dist/{types-DcUAwTQC.d.cts → types-C61WyxPn.d.mts} +0 -0
- /package/dist/{use-event-B4e6iJDK.mjs → use-event-CjjVkASI.mjs} +0 -0
- /package/dist/{use-safe-layout-effect-DPn_9-dD.mjs → use-safe-layout-effect-B6ZrTy_c.mjs} +0 -0
- /package/dist/{utils-BQJFlkDE.mjs → utils-BFOdioBT.mjs} +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-Bw6_Qrqn.mjs";
|
|
2
|
+
import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-CAwCcfBy.mjs";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-B-_JrOL2.mjs";
|
|
4
|
+
import { n as useEnvironmentContext } from "../../environment-tlwGXNO0.mjs";
|
|
5
|
+
import { i as useLocaleContext } from "../../locale-BmYiujeK.mjs";
|
|
6
|
+
import "../../providers-DPvEY1gv.mjs";
|
|
7
|
+
import { n as sprawlify } from "../../factory-cfMsSoBo.mjs";
|
|
8
|
+
import { t as createSplitProps } from "../../create-split-props-BjYU0VXX.mjs";
|
|
9
|
+
import { forwardRef, useId } from "react";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
import * as steps from "@sprawlify/primitives/machines/steps";
|
|
12
|
+
import { anatomy as stepsAnatomy } from "@sprawlify/primitives/machines/steps";
|
|
13
|
+
|
|
14
|
+
//#region src/components/steps/use-steps-context.ts
|
|
15
|
+
const [StepsProvider, useStepsContext] = createContext$1({
|
|
16
|
+
name: "StepsContext",
|
|
17
|
+
hookName: "useStepsContext",
|
|
18
|
+
providerName: "<StepsProvider />"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/steps/steps-completed-content.tsx
|
|
23
|
+
const StepsCompletedContent = forwardRef((props, ref) => {
|
|
24
|
+
const steps$1 = useStepsContext();
|
|
25
|
+
const mergedProps = mergeProps(steps$1.getContentProps({ index: steps$1.count }), props);
|
|
26
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
27
|
+
...mergedProps,
|
|
28
|
+
ref
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
StepsCompletedContent.displayName = "StepsCompletedContent";
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/components/steps/steps-content.tsx
|
|
35
|
+
const splitContentProps = createSplitProps();
|
|
36
|
+
const StepsContent = forwardRef((props, ref) => {
|
|
37
|
+
const [itemProps, localProps] = splitContentProps(props, ["index"]);
|
|
38
|
+
const mergedProps = mergeProps(useStepsContext().getContentProps(itemProps), localProps);
|
|
39
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
40
|
+
...mergedProps,
|
|
41
|
+
ref
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
StepsContent.displayName = "StepsContent";
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/components/steps/steps-context.tsx
|
|
48
|
+
const StepsContext = (props) => {
|
|
49
|
+
const context = useStepsContext();
|
|
50
|
+
return props.children(context);
|
|
51
|
+
};
|
|
52
|
+
StepsContext.displayName = "StepsContext";
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/steps/use-steps-item-props-context.ts
|
|
56
|
+
const [StepsItemPropsProvider, useStepsItemPropsContext] = createContext$1({
|
|
57
|
+
name: "StepsItemPropsContext",
|
|
58
|
+
hookName: "useStepsItemPropsContext",
|
|
59
|
+
providerName: "<StepsItemPropsProvider />"
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/steps/steps-indicator.tsx
|
|
64
|
+
const StepsIndicator = forwardRef((props, ref) => {
|
|
65
|
+
const steps$1 = useStepsContext();
|
|
66
|
+
const itemProps = useStepsItemPropsContext();
|
|
67
|
+
const mergedProps = mergeProps(steps$1.getIndicatorProps(itemProps), props);
|
|
68
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
69
|
+
...mergedProps,
|
|
70
|
+
ref
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
StepsIndicator.displayName = "StepsIndicator";
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/components/steps/use-steps-item-context.ts
|
|
77
|
+
const [StepsItemProvider, useStepsItemContext] = createContext$1({
|
|
78
|
+
name: "StepsItemContext",
|
|
79
|
+
hookName: "useStepsItemContext",
|
|
80
|
+
providerName: "<StepsItem />"
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/steps/steps-item.tsx
|
|
85
|
+
const splitItemProps = createSplitProps();
|
|
86
|
+
const StepsItem = forwardRef((props, ref) => {
|
|
87
|
+
const [itemProps, localProps] = splitItemProps(props, ["index"]);
|
|
88
|
+
const steps$1 = useStepsContext();
|
|
89
|
+
const mergedProps = mergeProps(steps$1.getItemProps(itemProps), localProps);
|
|
90
|
+
return /* @__PURE__ */ jsx(StepsItemPropsProvider, {
|
|
91
|
+
value: itemProps,
|
|
92
|
+
children: /* @__PURE__ */ jsx(StepsItemProvider, {
|
|
93
|
+
value: steps$1.getItemState(itemProps),
|
|
94
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
95
|
+
...mergedProps,
|
|
96
|
+
ref
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
StepsItem.displayName = "StepsItem";
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/components/steps/steps-item-context.tsx
|
|
105
|
+
const StepsItemContext = (props) => {
|
|
106
|
+
return props.children(useStepsItemContext());
|
|
107
|
+
};
|
|
108
|
+
StepsItemContext.displayName = "StepsItemContext";
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/components/steps/steps-list.tsx
|
|
112
|
+
const StepsList = forwardRef((props, ref) => {
|
|
113
|
+
const mergedProps = mergeProps(useStepsContext().getListProps(), props);
|
|
114
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
115
|
+
...mergedProps,
|
|
116
|
+
ref
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
StepsList.displayName = "StepsList";
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/components/steps/steps-next-trigger.tsx
|
|
123
|
+
const StepsNextTrigger = forwardRef((props, ref) => {
|
|
124
|
+
const mergedProps = mergeProps(useStepsContext().getNextTriggerProps(), props);
|
|
125
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
126
|
+
...mergedProps,
|
|
127
|
+
ref
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
StepsNextTrigger.displayName = "StepsNextTrigger";
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/steps/steps-prev-trigger.tsx
|
|
134
|
+
const StepsPrevTrigger = forwardRef((props, ref) => {
|
|
135
|
+
const mergedProps = mergeProps(useStepsContext().getPrevTriggerProps(), props);
|
|
136
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
137
|
+
...mergedProps,
|
|
138
|
+
ref
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
StepsPrevTrigger.displayName = "StepsPrevTrigger";
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/components/steps/steps-progress.tsx
|
|
145
|
+
const StepsProgress = forwardRef((props, ref) => {
|
|
146
|
+
const mergedProps = mergeProps(useStepsContext().getProgressProps(), props);
|
|
147
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
148
|
+
...mergedProps,
|
|
149
|
+
ref
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
StepsProgress.displayName = "StepsProgress";
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/components/steps/use-steps.ts
|
|
156
|
+
function useSteps(props) {
|
|
157
|
+
const id = useId();
|
|
158
|
+
const { getRootNode } = useEnvironmentContext();
|
|
159
|
+
const { dir } = useLocaleContext();
|
|
160
|
+
const machineProps = {
|
|
161
|
+
id,
|
|
162
|
+
dir,
|
|
163
|
+
getRootNode,
|
|
164
|
+
...props
|
|
165
|
+
};
|
|
166
|
+
const service = useMachine(steps.machine, machineProps);
|
|
167
|
+
return steps.connect(service, normalizeProps);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/components/steps/steps-root.tsx
|
|
172
|
+
const splitRootProps = createSplitProps();
|
|
173
|
+
const StepsRoot = forwardRef((props, ref) => {
|
|
174
|
+
const [useStepsProps, localProps] = splitRootProps(props, [
|
|
175
|
+
"defaultStep",
|
|
176
|
+
"id",
|
|
177
|
+
"ids",
|
|
178
|
+
"count",
|
|
179
|
+
"linear",
|
|
180
|
+
"onStepChange",
|
|
181
|
+
"onStepComplete",
|
|
182
|
+
"orientation",
|
|
183
|
+
"step"
|
|
184
|
+
]);
|
|
185
|
+
const steps$1 = useSteps(useStepsProps);
|
|
186
|
+
const mergedProps = mergeProps(steps$1.getRootProps(), localProps);
|
|
187
|
+
return /* @__PURE__ */ jsx(StepsProvider, {
|
|
188
|
+
value: steps$1,
|
|
189
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
190
|
+
...mergedProps,
|
|
191
|
+
ref
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
StepsRoot.displayName = "StepsRoot";
|
|
196
|
+
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/components/steps/steps-root-provider.tsx
|
|
199
|
+
const splitRootProviderProps = createSplitProps();
|
|
200
|
+
const StepsRootProvider = forwardRef((props, ref) => {
|
|
201
|
+
const [{ value: steps$1 }, rootProps] = splitRootProviderProps(props, ["value"]);
|
|
202
|
+
const mergedProps = mergeProps(steps$1.getRootProps(), rootProps);
|
|
203
|
+
return /* @__PURE__ */ jsx(StepsProvider, {
|
|
204
|
+
value: steps$1,
|
|
205
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
206
|
+
...mergedProps,
|
|
207
|
+
ref,
|
|
208
|
+
children: props.children
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
StepsRootProvider.displayName = "StepsRootProvider";
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/components/steps/steps-separator.tsx
|
|
216
|
+
const StepsSeparator = forwardRef((props, ref) => {
|
|
217
|
+
const steps$1 = useStepsContext();
|
|
218
|
+
const itemProps = useStepsItemPropsContext();
|
|
219
|
+
const mergedProps = mergeProps(steps$1.getSeparatorProps(itemProps), props);
|
|
220
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
221
|
+
...mergedProps,
|
|
222
|
+
ref
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
StepsSeparator.displayName = "StepsSeparator";
|
|
226
|
+
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/components/steps/steps-trigger.tsx
|
|
229
|
+
const StepsTrigger = forwardRef((props, ref) => {
|
|
230
|
+
const steps$1 = useStepsContext();
|
|
231
|
+
const itemProps = useStepsItemPropsContext();
|
|
232
|
+
const mergedProps = mergeProps(steps$1.getTriggerProps(itemProps), props);
|
|
233
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
234
|
+
...mergedProps,
|
|
235
|
+
ref
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
StepsTrigger.displayName = "StepsTrigger";
|
|
239
|
+
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/components/steps/steps.ts
|
|
242
|
+
var steps_exports = /* @__PURE__ */ __export({
|
|
243
|
+
CompletedContent: () => StepsCompletedContent,
|
|
244
|
+
Content: () => StepsContent,
|
|
245
|
+
Context: () => StepsContext,
|
|
246
|
+
Indicator: () => StepsIndicator,
|
|
247
|
+
Item: () => StepsItem,
|
|
248
|
+
ItemContext: () => StepsItemContext,
|
|
249
|
+
List: () => StepsList,
|
|
250
|
+
NextTrigger: () => StepsNextTrigger,
|
|
251
|
+
PrevTrigger: () => StepsPrevTrigger,
|
|
252
|
+
Progress: () => StepsProgress,
|
|
253
|
+
Root: () => StepsRoot,
|
|
254
|
+
RootProvider: () => StepsRootProvider,
|
|
255
|
+
Separator: () => StepsSeparator,
|
|
256
|
+
Trigger: () => StepsTrigger
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
//#endregion
|
|
260
|
+
export { steps_exports as Steps, StepsCompletedContent, StepsContent, StepsContext, StepsIndicator, StepsItem, StepsItemContext, StepsList, StepsNextTrigger, StepsPrevTrigger, StepsProgress, StepsRoot, StepsRootProvider, StepsSeparator, StepsTrigger, stepsAnatomy, useSteps, useStepsContext, useStepsItemContext };
|
|
@@ -0,0 +1,180 @@
|
|
|
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
|
+
require('../../use-fieldset-context-CCQLmNLL.cjs');
|
|
10
|
+
require('../../use-safe-layout-effect-C2GgvNT3.cjs');
|
|
11
|
+
const require_field = require('../../field-C-57Gj2E.cjs');
|
|
12
|
+
let react = require("react");
|
|
13
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
14
|
+
let __sprawlify_primitives_machines_switch = require("@sprawlify/primitives/machines/switch");
|
|
15
|
+
__sprawlify_primitives_machines_switch = require_chunk.__toESM(__sprawlify_primitives_machines_switch);
|
|
16
|
+
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
17
|
+
|
|
18
|
+
//#region src/components/switch/use-switch-context.ts
|
|
19
|
+
const [SwitchProvider, useSwitchContext] = require_create_context.createContext({
|
|
20
|
+
name: "SwitchContext",
|
|
21
|
+
hookName: "useSwitchContext",
|
|
22
|
+
providerName: "<SwitchProvider />"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/switch/switch-context.tsx
|
|
27
|
+
const SwitchContext = (props) => props.children(useSwitchContext());
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/switch/switch-control.tsx
|
|
31
|
+
const SwitchControl = (0, react.forwardRef)((props, ref) => {
|
|
32
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useSwitchContext().getControlProps(), props);
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
34
|
+
...mergedProps,
|
|
35
|
+
ref
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
SwitchControl.displayName = "SwitchControl";
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/switch/switch-hidden-input.tsx
|
|
42
|
+
const SwitchHiddenInput = (0, react.forwardRef)((props, ref) => {
|
|
43
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useSwitchContext().getHiddenInputProps(), props);
|
|
44
|
+
const field = require_field.useFieldContext();
|
|
45
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.input, {
|
|
46
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
47
|
+
...mergedProps,
|
|
48
|
+
ref
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
SwitchHiddenInput.displayName = "SwitchHiddenInput";
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/switch/switch-label.tsx
|
|
55
|
+
const SwitchLabel = (0, react.forwardRef)((props, ref) => {
|
|
56
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useSwitchContext().getLabelProps(), props);
|
|
57
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
58
|
+
...mergedProps,
|
|
59
|
+
ref
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
SwitchLabel.displayName = "SwitchLabel";
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/components/switch/use-switch.ts
|
|
66
|
+
const useSwitch = (props) => {
|
|
67
|
+
const id = (0, react.useId)();
|
|
68
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
69
|
+
const { dir } = require_locale.useLocaleContext();
|
|
70
|
+
const field = require_field.useFieldContext();
|
|
71
|
+
const machineProps = {
|
|
72
|
+
id,
|
|
73
|
+
ids: {
|
|
74
|
+
label: field?.ids.label,
|
|
75
|
+
hiddenInput: field?.ids.control
|
|
76
|
+
},
|
|
77
|
+
dir,
|
|
78
|
+
disabled: field?.disabled,
|
|
79
|
+
readOnly: field?.readOnly,
|
|
80
|
+
invalid: field?.invalid,
|
|
81
|
+
required: field?.required,
|
|
82
|
+
getRootNode,
|
|
83
|
+
...props
|
|
84
|
+
};
|
|
85
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_switch.machine, machineProps);
|
|
86
|
+
return __sprawlify_primitives_machines_switch.connect(service, require_core.normalizeProps);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/switch/switch-root.tsx
|
|
91
|
+
const splitRootProps = require_create_split_props.createSplitProps();
|
|
92
|
+
const SwitchRoot = (0, react.forwardRef)((props, ref) => {
|
|
93
|
+
const [useSwitchProps, localProps] = splitRootProps(props, [
|
|
94
|
+
"checked",
|
|
95
|
+
"defaultChecked",
|
|
96
|
+
"disabled",
|
|
97
|
+
"form",
|
|
98
|
+
"id",
|
|
99
|
+
"ids",
|
|
100
|
+
"invalid",
|
|
101
|
+
"label",
|
|
102
|
+
"name",
|
|
103
|
+
"onCheckedChange",
|
|
104
|
+
"readOnly",
|
|
105
|
+
"required",
|
|
106
|
+
"value"
|
|
107
|
+
]);
|
|
108
|
+
const switchContext = useSwitch(useSwitchProps);
|
|
109
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(switchContext.getRootProps(), localProps);
|
|
110
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwitchProvider, {
|
|
111
|
+
value: switchContext,
|
|
112
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
113
|
+
...mergedProps,
|
|
114
|
+
ref
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
SwitchRoot.displayName = "SwitchRoot";
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/components/switch/switch-root-provider.tsx
|
|
122
|
+
const splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
123
|
+
const SwitchRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
124
|
+
const [{ value: api }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
125
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(api.getRootProps(), localProps);
|
|
126
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SwitchProvider, {
|
|
127
|
+
value: api,
|
|
128
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
129
|
+
...mergedProps,
|
|
130
|
+
ref
|
|
131
|
+
})
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
SwitchRootProvider.displayName = "SwitchRootProvider";
|
|
135
|
+
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/components/switch/switch-thumb.tsx
|
|
138
|
+
const SwitchThumb = (0, react.forwardRef)((props, ref) => {
|
|
139
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useSwitchContext().getThumbProps(), props);
|
|
140
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
141
|
+
...mergedProps,
|
|
142
|
+
ref
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
SwitchThumb.displayName = "SwitchThumb";
|
|
146
|
+
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region src/components/switch/switch.ts
|
|
149
|
+
var switch_exports = /* @__PURE__ */ require_chunk.__export({
|
|
150
|
+
Context: () => SwitchContext,
|
|
151
|
+
Control: () => SwitchControl,
|
|
152
|
+
HiddenInput: () => SwitchHiddenInput,
|
|
153
|
+
Label: () => SwitchLabel,
|
|
154
|
+
Root: () => SwitchRoot,
|
|
155
|
+
RootProvider: () => SwitchRootProvider,
|
|
156
|
+
Thumb: () => SwitchThumb
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
Object.defineProperty(exports, 'Switch', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return switch_exports;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
exports.SwitchContext = SwitchContext;
|
|
167
|
+
exports.SwitchControl = SwitchControl;
|
|
168
|
+
exports.SwitchHiddenInput = SwitchHiddenInput;
|
|
169
|
+
exports.SwitchLabel = SwitchLabel;
|
|
170
|
+
exports.SwitchRoot = SwitchRoot;
|
|
171
|
+
exports.SwitchRootProvider = SwitchRootProvider;
|
|
172
|
+
exports.SwitchThumb = SwitchThumb;
|
|
173
|
+
Object.defineProperty(exports, 'switchAnatomy', {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: function () {
|
|
176
|
+
return __sprawlify_primitives_machines_switch.anatomy;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
exports.useSwitch = useSwitch;
|
|
180
|
+
exports.useSwitchContext = useSwitchContext;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as PropTypes } from "../../normalize-props-Ddn7AQaE.cjs";
|
|
2
|
+
import { r as Optional } from "../../types-0lfB8uM7.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-dXEes8-E.cjs";
|
|
4
|
+
import * as react129 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as zagSwitch from "@sprawlify/primitives/machines/switch";
|
|
7
|
+
import { CheckedChangeDetails, CheckedChangeDetails as SwitchCheckedChangeDetails, anatomy as switchAnatomy } from "@sprawlify/primitives/machines/switch";
|
|
8
|
+
|
|
9
|
+
//#region src/components/switch/use-switch.d.ts
|
|
10
|
+
interface UseSwitchProps extends Optional<Omit<zagSwitch.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseSwitchReturn extends zagSwitch.Api<PropTypes> {}
|
|
12
|
+
declare const useSwitch: (props?: UseSwitchProps) => UseSwitchReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/switch/use-switch-context.d.ts
|
|
15
|
+
interface UseSwitchContext extends UseSwitchReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/switch/switch-context.d.ts
|
|
18
|
+
interface SwitchContextProps {
|
|
19
|
+
children: (context: UseSwitchContext) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const SwitchContext: (props: SwitchContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/switch/switch-control.d.ts
|
|
24
|
+
interface SwitchControlBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface SwitchControlProps extends HTMLProps<"span">, SwitchControlBaseProps {}
|
|
26
|
+
declare const SwitchControl: react129.ForwardRefExoticComponent<SwitchControlProps & react129.RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/switch/switch-hidden-input.d.ts
|
|
29
|
+
interface SwitchHiddenInputBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface SwitchHiddenInputProps extends HTMLProps<"input">, SwitchHiddenInputBaseProps {}
|
|
31
|
+
declare const SwitchHiddenInput: react129.ForwardRefExoticComponent<SwitchHiddenInputProps & react129.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/switch/switch-label.d.ts
|
|
34
|
+
interface SwitchLabelBaseProps extends PolymorphicProps {}
|
|
35
|
+
interface SwitchLabelProps extends HTMLProps<"span">, SwitchLabelBaseProps {}
|
|
36
|
+
declare const SwitchLabel: react129.ForwardRefExoticComponent<SwitchLabelProps & react129.RefAttributes<HTMLSpanElement>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/switch/switch-root.d.ts
|
|
39
|
+
interface SwitchRootBaseProps extends UseSwitchProps, PolymorphicProps {}
|
|
40
|
+
interface SwitchRootProps extends HTMLProps<"label">, SwitchRootBaseProps {}
|
|
41
|
+
declare const SwitchRoot: react129.ForwardRefExoticComponent<SwitchRootProps & react129.RefAttributes<HTMLLabelElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/switch/switch-root-provider.d.ts
|
|
44
|
+
interface RootProviderProps {
|
|
45
|
+
value: UseSwitchReturn;
|
|
46
|
+
}
|
|
47
|
+
interface SwitchRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
48
|
+
interface SwitchRootProviderProps extends HTMLProps<"label">, SwitchRootProviderBaseProps {}
|
|
49
|
+
declare const SwitchRootProvider: react129.ForwardRefExoticComponent<SwitchRootProviderProps & react129.RefAttributes<HTMLLabelElement>>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/switch/switch-thumb.d.ts
|
|
52
|
+
interface SwitchThumbBaseProps extends PolymorphicProps {}
|
|
53
|
+
interface SwitchThumbProps extends HTMLProps<"span">, SwitchThumbBaseProps {}
|
|
54
|
+
declare const SwitchThumb: react129.ForwardRefExoticComponent<SwitchThumbProps & react129.RefAttributes<HTMLSpanElement>>;
|
|
55
|
+
declare namespace switch_d_exports {
|
|
56
|
+
export { CheckedChangeDetails, SwitchContext as Context, SwitchContextProps as ContextProps, SwitchControl as Control, SwitchControlBaseProps as ControlBaseProps, SwitchControlProps as ControlProps, SwitchHiddenInput as HiddenInput, SwitchHiddenInputBaseProps as HiddenInputBaseProps, SwitchHiddenInputProps as HiddenInputProps, SwitchLabel as Label, SwitchLabelBaseProps as LabelBaseProps, SwitchLabelProps as LabelProps, SwitchRoot as Root, SwitchRootBaseProps as RootBaseProps, SwitchRootProps as RootProps, SwitchRootProvider as RootProvider, SwitchRootProviderBaseProps as RootProviderBaseProps, SwitchRootProviderProps as RootProviderProps, SwitchThumb as Thumb, SwitchThumbBaseProps as ThumbBaseProps, SwitchThumbProps as ThumbProps };
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { switch_d_exports as Switch, type SwitchCheckedChangeDetails, SwitchContext, type SwitchContextProps, SwitchControl, type SwitchControlBaseProps, type SwitchControlProps, SwitchHiddenInput, type SwitchHiddenInputBaseProps, type SwitchHiddenInputProps, SwitchLabel, type SwitchLabelBaseProps, type SwitchLabelProps, SwitchRoot, type SwitchRootBaseProps, type SwitchRootProps, SwitchRootProvider, type SwitchRootProviderBaseProps, type SwitchRootProviderProps, SwitchThumb, type SwitchThumbBaseProps, type SwitchThumbProps, type UseSwitchContext, type UseSwitchProps, type UseSwitchReturn, switchAnatomy, useSwitch, useSwitchContext };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { r as PropTypes } from "../../index-BVPDbcQQ.mjs";
|
|
2
|
+
import { r as Optional } from "../../types-C61WyxPn.mjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-Fen9bAK7.mjs";
|
|
4
|
+
import * as react238 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as zagSwitch from "@sprawlify/primitives/machines/switch";
|
|
7
|
+
import { CheckedChangeDetails, CheckedChangeDetails as SwitchCheckedChangeDetails, anatomy as switchAnatomy } from "@sprawlify/primitives/machines/switch";
|
|
8
|
+
|
|
9
|
+
//#region src/components/switch/use-switch.d.ts
|
|
10
|
+
interface UseSwitchProps extends Optional<Omit<zagSwitch.Props, "dir" | "getRootNode">, "id"> {}
|
|
11
|
+
interface UseSwitchReturn extends zagSwitch.Api<PropTypes> {}
|
|
12
|
+
declare const useSwitch: (props?: UseSwitchProps) => UseSwitchReturn;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/switch/use-switch-context.d.ts
|
|
15
|
+
interface UseSwitchContext extends UseSwitchReturn {}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/switch/switch-context.d.ts
|
|
18
|
+
interface SwitchContextProps {
|
|
19
|
+
children: (context: UseSwitchContext) => ReactNode;
|
|
20
|
+
}
|
|
21
|
+
declare const SwitchContext: (props: SwitchContextProps) => ReactNode;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/switch/switch-control.d.ts
|
|
24
|
+
interface SwitchControlBaseProps extends PolymorphicProps {}
|
|
25
|
+
interface SwitchControlProps extends HTMLProps<"span">, SwitchControlBaseProps {}
|
|
26
|
+
declare const SwitchControl: react238.ForwardRefExoticComponent<SwitchControlProps & react238.RefAttributes<HTMLSpanElement>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/components/switch/switch-hidden-input.d.ts
|
|
29
|
+
interface SwitchHiddenInputBaseProps extends PolymorphicProps {}
|
|
30
|
+
interface SwitchHiddenInputProps extends HTMLProps<"input">, SwitchHiddenInputBaseProps {}
|
|
31
|
+
declare const SwitchHiddenInput: react238.ForwardRefExoticComponent<SwitchHiddenInputProps & react238.RefAttributes<HTMLInputElement>>;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/switch/switch-label.d.ts
|
|
34
|
+
interface SwitchLabelBaseProps extends PolymorphicProps {}
|
|
35
|
+
interface SwitchLabelProps extends HTMLProps<"span">, SwitchLabelBaseProps {}
|
|
36
|
+
declare const SwitchLabel: react238.ForwardRefExoticComponent<SwitchLabelProps & react238.RefAttributes<HTMLSpanElement>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/switch/switch-root.d.ts
|
|
39
|
+
interface SwitchRootBaseProps extends UseSwitchProps, PolymorphicProps {}
|
|
40
|
+
interface SwitchRootProps extends HTMLProps<"label">, SwitchRootBaseProps {}
|
|
41
|
+
declare const SwitchRoot: react238.ForwardRefExoticComponent<SwitchRootProps & react238.RefAttributes<HTMLLabelElement>>;
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/components/switch/switch-root-provider.d.ts
|
|
44
|
+
interface RootProviderProps {
|
|
45
|
+
value: UseSwitchReturn;
|
|
46
|
+
}
|
|
47
|
+
interface SwitchRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
48
|
+
interface SwitchRootProviderProps extends HTMLProps<"label">, SwitchRootProviderBaseProps {}
|
|
49
|
+
declare const SwitchRootProvider: react238.ForwardRefExoticComponent<SwitchRootProviderProps & react238.RefAttributes<HTMLLabelElement>>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/components/switch/switch-thumb.d.ts
|
|
52
|
+
interface SwitchThumbBaseProps extends PolymorphicProps {}
|
|
53
|
+
interface SwitchThumbProps extends HTMLProps<"span">, SwitchThumbBaseProps {}
|
|
54
|
+
declare const SwitchThumb: react238.ForwardRefExoticComponent<SwitchThumbProps & react238.RefAttributes<HTMLSpanElement>>;
|
|
55
|
+
declare namespace switch_d_exports {
|
|
56
|
+
export { CheckedChangeDetails, SwitchContext as Context, SwitchContextProps as ContextProps, SwitchControl as Control, SwitchControlBaseProps as ControlBaseProps, SwitchControlProps as ControlProps, SwitchHiddenInput as HiddenInput, SwitchHiddenInputBaseProps as HiddenInputBaseProps, SwitchHiddenInputProps as HiddenInputProps, SwitchLabel as Label, SwitchLabelBaseProps as LabelBaseProps, SwitchLabelProps as LabelProps, SwitchRoot as Root, SwitchRootBaseProps as RootBaseProps, SwitchRootProps as RootProps, SwitchRootProvider as RootProvider, SwitchRootProviderBaseProps as RootProviderBaseProps, SwitchRootProviderProps as RootProviderProps, SwitchThumb as Thumb, SwitchThumbBaseProps as ThumbBaseProps, SwitchThumbProps as ThumbProps };
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { switch_d_exports as Switch, type SwitchCheckedChangeDetails, SwitchContext, type SwitchContextProps, SwitchControl, type SwitchControlBaseProps, type SwitchControlProps, SwitchHiddenInput, type SwitchHiddenInputBaseProps, type SwitchHiddenInputProps, SwitchLabel, type SwitchLabelBaseProps, type SwitchLabelProps, SwitchRoot, type SwitchRootBaseProps, type SwitchRootProps, SwitchRootProvider, type SwitchRootProviderBaseProps, type SwitchRootProviderProps, SwitchThumb, type SwitchThumbBaseProps, type SwitchThumbProps, type UseSwitchContext, type UseSwitchProps, type UseSwitchReturn, switchAnatomy, useSwitch, useSwitchContext };
|