@ark-ui/solid 4.10.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/dist/chunk/{ATMUKDFF.js → 26K66CRD.js} +11 -12
- package/dist/chunk/{U3XJZI3X.jsx → 2LZKFXR5.jsx} +19 -26
- package/dist/chunk/{H4RSHLA7.jsx → 3FYZXSQZ.jsx} +14 -15
- package/dist/chunk/{MQDN267C.jsx → 3VO34CGN.jsx} +13 -13
- package/dist/chunk/{YV5BACLX.js → 46YZVE6D.js} +12 -11
- package/dist/chunk/{MBQQASZE.js → 4QFED3VE.js} +12 -12
- package/dist/chunk/{SWUA2VFC.js → 4UD3WT4B.js} +10 -12
- package/dist/chunk/{IQJBNZOX.jsx → 5T73FAJY.jsx} +13 -8
- package/dist/chunk/{IZC6PKGT.jsx → 65SQKHCI.jsx} +15 -16
- package/dist/chunk/{WM2IZOYM.jsx → 72UBZBQP.jsx} +53 -82
- package/dist/chunk/{F3QPTRGW.jsx → 7IHVZWMT.jsx} +32 -36
- package/dist/chunk/{X34KVQNW.js → 7KGMTGCS.js} +3 -2
- package/dist/chunk/{34MDPAG6.js → 7RR233CD.js} +30 -12
- package/dist/chunk/{7S43DIPW.js → 7S7524Q3.js} +15 -26
- package/dist/chunk/{E72NMPSK.jsx → A4744EEE.jsx} +9 -14
- package/dist/chunk/{BY62F4IV.jsx → AD2EIGNX.jsx} +13 -13
- package/dist/chunk/{3HMZSTYX.js → B246J3FR.js} +10 -11
- package/dist/chunk/{K54W24N6.jsx → B2KZ5VSW.jsx} +15 -17
- package/dist/chunk/{2GATVLPK.js → C4PG7WMU.js} +9 -9
- package/dist/chunk/{3LRXHWW2.js → C745EVQO.js} +32 -27
- package/dist/chunk/{TOVWS5LG.jsx → CA4LWAR2.jsx} +20 -26
- package/dist/chunk/{WKVZFHUH.jsx → CABZW4BQ.jsx} +19 -27
- package/dist/chunk/{Y4LH2CR6.jsx → CGBS64C2.jsx} +13 -13
- package/dist/chunk/{2HTNQLGP.jsx → CHLRHJV2.jsx} +13 -14
- package/dist/chunk/{SJSLQDBZ.jsx → CSDXHOTM.jsx} +15 -20
- package/dist/chunk/{5O4RWSWO.jsx → D2Z5BEON.jsx} +3 -3
- package/dist/chunk/{CPMYIT5J.jsx → D6BC5RCX.jsx} +16 -14
- package/dist/chunk/{6MXKM4GA.js → E4A5DGUC.js} +12 -12
- package/dist/chunk/{2J42A7KM.js → E5BXBABH.js} +2 -2
- package/dist/chunk/{U7SPBSDD.jsx → EEG3DZXG.jsx} +13 -15
- package/dist/chunk/{M2FICVVI.js → EI7I4DR6.js} +12 -13
- package/dist/chunk/{5CYHETDY.js → EWPKE75H.js} +10 -9
- package/dist/chunk/{2W32Z6JZ.js → F5GOQFKX.js} +12 -12
- package/dist/chunk/{CIPYIXIW.js → F7JP3DGZ.js} +11 -12
- package/dist/chunk/{PRMWTLUY.jsx → FUS6GOJL.jsx} +13 -11
- package/dist/chunk/{ASCGEGA5.jsx → GCDTOEZN.jsx} +16 -17
- package/dist/chunk/{G2WIACWP.js → GJSXT6PD.js} +11 -11
- package/dist/chunk/{LVPQ6GR4.js → GMNTJ5KE.js} +9 -9
- package/dist/chunk/{WPFSEVTX.js → I2RQ2435.js} +14 -16
- package/dist/chunk/{AIQFNVCU.jsx → IKA3JJFV.jsx} +14 -20
- package/dist/chunk/{3O5VTKDF.jsx → IYMTFLF3.jsx} +20 -33
- package/dist/chunk/{EHJDQTTW.jsx → JRMTU7C7.jsx} +3 -16
- package/dist/chunk/{VARNCRUN.js → JUYBJNX6.js} +19 -20
- package/dist/chunk/{FNEB2RAF.js → JWXGONCE.js} +12 -12
- package/dist/chunk/{SN5TXTB6.jsx → JZ7ZQZT4.jsx} +17 -54
- package/dist/chunk/{WQQVH7YG.jsx → KBHIJYMD.jsx} +34 -19
- package/dist/chunk/{MMS6MJ72.js → KFJJXGK6.js} +11 -13
- package/dist/chunk/{X3BMEEJH.js → KVVYU5Z3.js} +34 -14
- package/dist/chunk/{T4NRAKVA.jsx → KZCXBFHA.jsx} +14 -12
- package/dist/chunk/{5EVN6V64.js → LK5627GR.js} +15 -17
- package/dist/chunk/{5JS7LFUQ.js → LTZUX6NG.js} +12 -10
- package/dist/chunk/{NK4T7LIZ.jsx → MA35L6TV.jsx} +12 -13
- package/dist/chunk/{ZC6KWJ4T.jsx → MDJAL2LV.jsx} +12 -14
- package/dist/chunk/{CCA5XJM6.jsx → MERJALY6.jsx} +23 -38
- package/dist/chunk/MOG4V2NQ.jsx +15 -0
- package/dist/chunk/{2H4WHODR.js → MSLAT5GQ.js} +10 -12
- package/dist/chunk/{5ONYCKM3.jsx → NEBB7COJ.jsx} +1 -1
- package/dist/chunk/{DU4TY3XA.jsx → NEYCBIOW.jsx} +16 -17
- package/dist/chunk/{DXYB7RYX.js → NF3HZO6T.js} +12 -10
- package/dist/chunk/{5XD5ZSBX.js → NZEL4233.js} +15 -18
- package/dist/chunk/OAPCRIL5.js +8 -0
- package/dist/chunk/{LCESUDZB.js → OY4ARTMM.js} +7 -14
- package/dist/chunk/{Q7NPTAJI.js → QBFJVUX3.js} +10 -10
- package/dist/chunk/{HPDOBQ3V.js → QEMQBM6W.js} +1 -1
- package/dist/chunk/{L7OSYHVR.js → QFAL6GWC.js} +1 -1
- package/dist/chunk/{34OZO53S.js → QTSWXPKO.js} +12 -14
- package/dist/chunk/{JVXNYKNA.js → R5NPBVOA.js} +11 -12
- package/dist/chunk/{3QQZKR3F.jsx → RCXMZN3G.jsx} +1 -1
- package/dist/chunk/{5SRZ3YYC.js → ROXCI3ZP.js} +10 -10
- package/dist/chunk/{GZVCPLKK.jsx → RY6GW37O.jsx} +14 -12
- package/dist/chunk/SDD2HKR3.js +71 -0
- package/dist/chunk/{RAEDLHD3.js → TKGOCHK5.js} +14 -16
- package/dist/chunk/{I5UG2QUO.js → TROPIN4C.js} +1 -7
- package/dist/chunk/{AX5SMQMA.js → TRUQMF25.js} +19 -19
- package/dist/chunk/{NMGUCD2L.jsx → TVCIHLER.jsx} +2 -11
- package/dist/chunk/{YCYZZGN2.jsx → TZDLUIKR.jsx} +14 -10
- package/dist/chunk/{QGV2SUTQ.jsx → U3J33PVO.jsx} +21 -21
- package/dist/chunk/{P7I44WC4.jsx → UCYPIMZC.jsx} +21 -22
- package/dist/chunk/{GXWVYON6.js → UODFV2GS.js} +11 -12
- package/dist/chunk/{7YIHAT7J.jsx → V564AMKR.jsx} +39 -18
- package/dist/chunk/{PSLLOEMD.js → VLQWCBZM.js} +16 -29
- package/dist/chunk/{3WGLTS6O.js → VNK2NPTS.js} +10 -10
- package/dist/chunk/{WIVXL7HJ.jsx → WDXH3NHK.jsx} +14 -15
- package/dist/chunk/{QQUR4MWN.js → WGFUGTWA.js} +18 -19
- package/dist/chunk/{B7LE23PE.jsx → WNIFZKTJ.jsx} +13 -14
- package/dist/chunk/{IOTZAUDA.jsx → WUTUKX4C.jsx} +1 -1
- package/dist/chunk/{XUVXUPEH.js → XN3MSM3M.js} +14 -18
- package/dist/chunk/{MYMGOYXH.js → XR4WJDUT.js} +2 -2
- package/dist/chunk/{DOPROT6M.jsx → XZZ6TULR.jsx} +15 -10
- package/dist/chunk/{QZYE5W7T.jsx → Y7EY3OTU.jsx} +16 -21
- package/dist/chunk/{MRQ2UYM4.jsx → YIVTZ7BP.jsx} +12 -11
- package/dist/chunk/{QODB3C3M.js → YMMMHJJS.js} +3 -3
- package/dist/chunk/{HU7FZMJI.jsx → YPH7FBUN.jsx} +14 -16
- package/dist/chunk/{TC2QHQ47.jsx → Z254KIAA.jsx} +22 -44
- package/dist/chunk/{W43X4SNE.js → Z2TDX72A.js} +9 -8
- package/dist/chunk/{6YQ3EF2J.js → ZGXZNLX2.js} +12 -13
- package/dist/chunk/{R6RE56DG.jsx → ZJM2GZS7.jsx} +4 -1
- package/dist/chunk/{UGKLUHKU.js → ZOGAU3AQ.js} +11 -13
- package/dist/chunk/{7PKUSZKY.jsx → ZPSBF7S2.jsx} +14 -11
- package/dist/chunk/{RZBYC7DR.jsx → ZYF7GVNI.jsx} +21 -27
- package/dist/components/accordion/index.d.ts +4 -9
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.jsx +7 -7
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.jsx +5 -5
- package/dist/components/carousel/index.d.ts +4 -9
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/index.jsx +5 -5
- package/dist/components/checkbox/index.d.ts +5 -10
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +8 -8
- package/dist/components/clipboard/index.d.ts +4 -4
- package/dist/components/clipboard/index.js +1 -1
- package/dist/components/clipboard/index.jsx +5 -5
- package/dist/components/collapsible/index.d.ts +4 -9
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/collapsible/index.jsx +6 -6
- package/dist/components/collection.d.ts +3 -3
- package/dist/components/collection.js +1 -1
- package/dist/components/collection.jsx +1 -1
- package/dist/components/color-picker/index.d.ts +6 -16
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.jsx +10 -9
- package/dist/components/combobox/index.d.ts +5 -15
- package/dist/components/combobox/index.js +2 -2
- package/dist/components/combobox/index.jsx +12 -11
- package/dist/components/date-picker/index.d.ts +6 -18
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-picker/index.jsx +7 -7
- package/dist/components/dialog/index.d.ts +5 -10
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.jsx +7 -7
- package/dist/components/editable/index.d.ts +4 -14
- package/dist/components/editable/index.js +1 -1
- package/dist/components/editable/index.jsx +8 -7
- package/dist/components/factory.d.ts +1 -1
- package/dist/components/field/index.d.ts +4 -4
- package/dist/components/field/index.js +1 -1
- package/dist/components/field/index.jsx +5 -3
- package/dist/components/fieldset/index.d.ts +4 -4
- package/dist/components/fieldset/index.js +1 -1
- package/dist/components/fieldset/index.jsx +3 -2
- package/dist/components/file-upload/index.d.ts +4 -4
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/index.jsx +8 -7
- package/dist/components/focus-trap/index.d.ts +2 -2
- package/dist/components/format/index.js +1 -1
- package/dist/components/format/index.jsx +4 -4
- package/dist/components/frame/index.d.ts +1 -1
- package/dist/components/frame/index.js +1 -1
- package/dist/components/frame/index.jsx +4 -4
- package/dist/components/highlight/index.d.ts +2 -2
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/highlight/index.jsx +2 -1
- package/dist/components/hover-card/index.d.ts +5 -10
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/hover-card/index.jsx +7 -7
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +46 -46
- package/dist/components/index.jsx +289 -290
- package/dist/components/menu/index.d.ts +6 -11
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.jsx +7 -7
- package/dist/components/number-input/index.d.ts +4 -9
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/index.jsx +8 -7
- package/dist/components/pagination/index.d.ts +4 -9
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/index.jsx +5 -5
- package/dist/components/pin-input/index.d.ts +4 -9
- package/dist/components/pin-input/index.js +1 -1
- package/dist/components/pin-input/index.jsx +8 -7
- package/dist/components/popover/index.d.ts +5 -10
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.jsx +7 -7
- package/dist/components/presence/index.d.ts +3 -3
- package/dist/components/presence/index.js +1 -1
- package/dist/components/presence/index.jsx +4 -3
- package/dist/components/progress/index.d.ts +4 -9
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/index.jsx +5 -5
- package/dist/components/qr-code/index.d.ts +4 -9
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/qr-code/index.jsx +5 -5
- package/dist/components/radio-group/index.d.ts +4 -9
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/radio-group/index.jsx +5 -5
- package/dist/components/rating-group/index.d.ts +6 -11
- package/dist/components/rating-group/index.js +1 -1
- package/dist/components/rating-group/index.jsx +8 -7
- package/dist/components/segment-group/index.d.ts +5 -10
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/segment-group/index.jsx +5 -5
- package/dist/components/select/index.d.ts +5 -15
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/index.jsx +12 -11
- package/dist/components/signature-pad/index.d.ts +4 -4
- package/dist/components/signature-pad/index.js +1 -1
- package/dist/components/signature-pad/index.jsx +8 -7
- package/dist/components/slider/index.d.ts +4 -9
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.jsx +5 -5
- package/dist/components/splitter/index.d.ts +4 -9
- package/dist/components/splitter/index.js +1 -1
- package/dist/components/splitter/index.jsx +5 -5
- package/dist/components/steps/index.d.ts +8 -12
- package/dist/components/steps/index.js +1 -1
- package/dist/components/steps/index.jsx +5 -5
- package/dist/components/switch/index.d.ts +4 -9
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.jsx +8 -7
- package/dist/components/tabs/index.d.ts +4 -9
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.jsx +7 -7
- package/dist/components/tags-input/index.d.ts +4 -9
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/tags-input/index.jsx +8 -7
- package/dist/components/time-picker/index.d.ts +5 -15
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/index.jsx +7 -7
- package/dist/components/timer/index.d.ts +4 -4
- package/dist/components/timer/index.js +1 -1
- package/dist/components/timer/index.jsx +5 -5
- package/dist/components/toast/index.d.ts +6 -7
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toast/index.jsx +6 -2
- package/dist/components/toggle/index.d.ts +7 -36
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle/index.jsx +2 -4
- package/dist/components/toggle-group/index.d.ts +4 -9
- package/dist/components/toggle-group/index.js +1 -1
- package/dist/components/toggle-group/index.jsx +5 -5
- package/dist/components/tooltip/index.d.ts +5 -10
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.jsx +7 -7
- package/dist/components/tour/index.d.ts +6 -6
- package/dist/components/tour/index.js +1 -1
- package/dist/components/tour/index.jsx +7 -7
- package/dist/components/tree-view/index.d.ts +7 -17
- package/dist/components/tree-view/index.js +2 -2
- package/dist/components/tree-view/index.jsx +9 -9
- package/dist/index.d.ts +3 -2
- package/dist/index.js +48 -48
- package/dist/index.jsx +290 -291
- package/dist/providers/environment/index.js +1 -1
- package/dist/providers/environment/index.jsx +2 -2
- package/dist/providers/index.js +2 -2
- package/dist/providers/index.jsx +4 -4
- package/dist/providers/locale/index.js +1 -1
- package/dist/providers/locale/index.jsx +2 -2
- package/dist/types-CxryXVkR.d.ts +8 -0
- package/dist/{use-presence-Ct1onT3-.d.ts → use-presence-B6QV_j94.d.ts} +3 -3
- package/package.json +71 -78
- package/dist/chunk/52WUF3CY.jsx +0 -26
- package/dist/chunk/BSPFGETO.js +0 -21
- package/dist/chunk/CTTG4GSG.js +0 -30
- package/dist/chunk/JHG4EID2.jsx +0 -233
- package/dist/chunk/MV3KTL7M.js +0 -107
- package/dist/types-B277wCdv.d.ts +0 -5
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
2
2
|
import { ark } from './EPLBB4QN.js';
|
|
3
|
-
import { useEnvironmentContext } from './
|
|
4
|
-
import { useLocaleContext } from './
|
|
5
|
-
import { createContext } from './
|
|
3
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
4
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
5
|
+
import { createContext } from './TROPIN4C.js';
|
|
6
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
6
7
|
import { __export } from './ESLJRKWD.js';
|
|
7
8
|
import { createComponent } from 'solid-js/web';
|
|
8
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -80,21 +81,18 @@ var RadioGroupLabel = (props) => {
|
|
|
80
81
|
const mergedProps = mergeProps(() => radioGroup().getLabelProps(), props);
|
|
81
82
|
return createComponent(ark.label, mergedProps);
|
|
82
83
|
};
|
|
83
|
-
var useRadioGroup = (props
|
|
84
|
+
var useRadioGroup = (props) => {
|
|
85
|
+
const id = createUniqueId();
|
|
84
86
|
const locale = useLocaleContext();
|
|
85
87
|
const environment = useEnvironmentContext();
|
|
86
|
-
const
|
|
87
|
-
const context = createMemo(() => ({
|
|
88
|
+
const machineProps = createMemo(() => ({
|
|
88
89
|
id,
|
|
89
90
|
dir: locale().dir,
|
|
90
91
|
getRootNode: environment().getRootNode,
|
|
91
|
-
|
|
92
|
-
...props
|
|
92
|
+
...runIfFn(props)
|
|
93
93
|
}));
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
});
|
|
97
|
-
return createMemo(() => radio.connect(state, send, normalizeProps));
|
|
94
|
+
const service = useMachine(radio.machine, machineProps);
|
|
95
|
+
return createMemo(() => radio.connect(service, normalizeProps));
|
|
98
96
|
};
|
|
99
97
|
|
|
100
98
|
// src/components/radio-group/radio-group-root.tsx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFieldContext
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./UCYPIMZC.jsx";
|
|
4
4
|
import {
|
|
5
5
|
createSplitProps
|
|
6
6
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -9,13 +9,16 @@ import {
|
|
|
9
9
|
} from "./UFYZ7HLU.jsx";
|
|
10
10
|
import {
|
|
11
11
|
useEnvironmentContext
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./D2Z5BEON.jsx";
|
|
13
13
|
import {
|
|
14
14
|
useLocaleContext
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./RCXMZN3G.jsx";
|
|
16
16
|
import {
|
|
17
17
|
createContext
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./TVCIHLER.jsx";
|
|
19
|
+
import {
|
|
20
|
+
runIfFn
|
|
21
|
+
} from "./KGOB2IMX.jsx";
|
|
19
22
|
import {
|
|
20
23
|
__export
|
|
21
24
|
} from "./7IUG3E2V.jsx";
|
|
@@ -82,11 +85,7 @@ var [TagsInputItemPropsProvider, useTagsInputItemPropsContext] = createContext({
|
|
|
82
85
|
|
|
83
86
|
// src/components/tags-input/tags-input-item.tsx
|
|
84
87
|
var TagsInputItem = (props) => {
|
|
85
|
-
const [itemProps, localProps] = createSplitProps()(props, [
|
|
86
|
-
"disabled",
|
|
87
|
-
"index",
|
|
88
|
-
"value"
|
|
89
|
-
]);
|
|
88
|
+
const [itemProps, localProps] = createSplitProps()(props, ["disabled", "index", "value"]);
|
|
90
89
|
const api = useTagsInputContext();
|
|
91
90
|
const mergedProps = mergeProps5(() => api().getItemProps(itemProps), localProps);
|
|
92
91
|
const itemState = createMemo(() => api().getItemState(itemProps));
|
|
@@ -151,12 +150,12 @@ import { mergeProps as mergeProps11 } from "@zag-js/solid";
|
|
|
151
150
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
152
151
|
import * as tagsInput from "@zag-js/tags-input";
|
|
153
152
|
import { createMemo as createMemo2, createUniqueId } from "solid-js";
|
|
154
|
-
var useTagsInput = (props
|
|
153
|
+
var useTagsInput = (props) => {
|
|
154
|
+
const id = createUniqueId();
|
|
155
155
|
const locale = useLocaleContext();
|
|
156
156
|
const environment = useEnvironmentContext();
|
|
157
|
-
const id = createUniqueId();
|
|
158
157
|
const field = useFieldContext();
|
|
159
|
-
const
|
|
158
|
+
const machineProps = createMemo2(() => ({
|
|
160
159
|
id,
|
|
161
160
|
ids: {
|
|
162
161
|
label: field?.().ids.label,
|
|
@@ -168,11 +167,10 @@ var useTagsInput = (props = {}) => {
|
|
|
168
167
|
readOnly: field?.().readOnly,
|
|
169
168
|
required: field?.().required,
|
|
170
169
|
getRootNode: environment().getRootNode,
|
|
171
|
-
|
|
172
|
-
...props
|
|
170
|
+
...runIfFn(props)
|
|
173
171
|
}));
|
|
174
|
-
const
|
|
175
|
-
return createMemo2(() => tagsInput.connect(
|
|
172
|
+
const service = useMachine(tagsInput.machine, machineProps);
|
|
173
|
+
return createMemo2(() => tagsInput.connect(service, normalizeProps));
|
|
176
174
|
};
|
|
177
175
|
|
|
178
176
|
// src/components/tags-input/tags-input-root.tsx
|
|
@@ -182,8 +180,9 @@ var TagsInputRoot = (props) => {
|
|
|
182
180
|
"allowOverflow",
|
|
183
181
|
"autoFocus",
|
|
184
182
|
"blurBehavior",
|
|
185
|
-
"
|
|
183
|
+
"defaultInputValue",
|
|
186
184
|
"defaultValue",
|
|
185
|
+
"delimiter",
|
|
187
186
|
"disabled",
|
|
188
187
|
"editable",
|
|
189
188
|
"form",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useFieldContext } from './
|
|
1
|
+
import { useFieldContext } from './KVVYU5Z3.js';
|
|
2
2
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
3
3
|
import { ark } from './EPLBB4QN.js';
|
|
4
|
-
import { useEnvironmentContext } from './
|
|
5
|
-
import { useLocaleContext } from './
|
|
6
|
-
import { createContext } from './
|
|
4
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
5
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
6
|
+
import { createContext } from './TROPIN4C.js';
|
|
7
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
7
8
|
import { __export } from './ESLJRKWD.js';
|
|
8
9
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
9
10
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -125,12 +126,12 @@ var FileUploadLabel = (props) => {
|
|
|
125
126
|
const mergedProps = mergeProps(() => fileUpload2().getLabelProps(), props);
|
|
126
127
|
return createComponent(ark.label, mergedProps);
|
|
127
128
|
};
|
|
128
|
-
var useFileUpload = (props
|
|
129
|
+
var useFileUpload = (props) => {
|
|
130
|
+
const id = createUniqueId();
|
|
129
131
|
const locale = useLocaleContext();
|
|
130
132
|
const environment = useEnvironmentContext();
|
|
131
|
-
const id = createUniqueId();
|
|
132
133
|
const field = useFieldContext();
|
|
133
|
-
const
|
|
134
|
+
const machineProps = createMemo(() => ({
|
|
134
135
|
id,
|
|
135
136
|
ids: {
|
|
136
137
|
label: field?.().ids.label,
|
|
@@ -138,13 +139,14 @@ var useFileUpload = (props = {}) => {
|
|
|
138
139
|
},
|
|
139
140
|
dir: locale().dir,
|
|
140
141
|
disabled: field?.().disabled,
|
|
142
|
+
locale: locale().locale,
|
|
141
143
|
required: field?.().required,
|
|
142
144
|
invalid: field?.().invalid,
|
|
143
145
|
getRootNode: environment().getRootNode,
|
|
144
|
-
...props
|
|
146
|
+
...runIfFn(props)
|
|
145
147
|
}));
|
|
146
|
-
const
|
|
147
|
-
return createMemo(() => fileUpload.connect(
|
|
148
|
+
const service = useMachine(fileUpload.machine, machineProps);
|
|
149
|
+
return createMemo(() => fileUpload.connect(service, normalizeProps));
|
|
148
150
|
};
|
|
149
151
|
|
|
150
152
|
// src/components/file-upload/file-upload-root.tsx
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { collapsible_exports } from './
|
|
2
|
-
import {
|
|
1
|
+
import { collapsible_exports } from './B246J3FR.js';
|
|
2
|
+
import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
|
|
3
3
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
4
|
import { ark } from './EPLBB4QN.js';
|
|
5
|
-
import { useEnvironmentContext } from './
|
|
6
|
-
import { useLocaleContext } from './
|
|
7
|
-
import { createContext } from './
|
|
5
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
6
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
7
|
+
import { createContext } from './TROPIN4C.js';
|
|
8
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
8
9
|
import { __export } from './ESLJRKWD.js';
|
|
9
10
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
10
11
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -113,12 +114,10 @@ var TreeViewLabel = (props) => {
|
|
|
113
114
|
};
|
|
114
115
|
|
|
115
116
|
// src/components/tree-view/use-tree-view-node-context.ts
|
|
116
|
-
var [TreeViewNodeProvider, useTreeViewNodeContext] = createContext(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
);
|
|
117
|
+
var [TreeViewNodeProvider, useTreeViewNodeContext] = createContext({
|
|
118
|
+
hookName: "useTreeViewNodeContext",
|
|
119
|
+
providerName: "<TreeViewNodeProvider />"
|
|
120
|
+
});
|
|
122
121
|
|
|
123
122
|
// src/components/tree-view/tree-view-node-context.ts
|
|
124
123
|
var TreeViewNodeContext = (props) => props.children(useTreeViewNodeContext());
|
|
@@ -132,19 +131,17 @@ function TreeViewNodeProvider2(props) {
|
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
133
|
var useTreeView = (props) => {
|
|
134
|
+
const id = createUniqueId();
|
|
135
135
|
const locale = useLocaleContext();
|
|
136
136
|
const environment = useEnvironmentContext();
|
|
137
|
-
const
|
|
138
|
-
const context = createMemo(() => ({
|
|
137
|
+
const machineProps = createMemo(() => ({
|
|
139
138
|
id,
|
|
140
139
|
dir: locale().dir,
|
|
141
140
|
getRootNode: environment().getRootNode,
|
|
142
|
-
|
|
143
|
-
expandedValue: props.defaultExpandedValue,
|
|
144
|
-
...props
|
|
141
|
+
...runIfFn(props)
|
|
145
142
|
}));
|
|
146
|
-
const
|
|
147
|
-
return createMemo(() => treeView.connect(
|
|
143
|
+
const service = useMachine(treeView.machine, machineProps);
|
|
144
|
+
return createMemo(() => treeView.connect(service, normalizeProps));
|
|
148
145
|
};
|
|
149
146
|
|
|
150
147
|
// src/components/tree-view/tree-view-root.tsx
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ListCollection, TreeCollection, filePathToTree } from '@zag-js/collection';
|
|
2
|
+
|
|
3
|
+
// src/components/collection.ts
|
|
4
|
+
var createListCollection = (options) => new ListCollection(options);
|
|
5
|
+
var createTreeCollection = (options) => new TreeCollection(options);
|
|
6
|
+
var createFileTreeCollection = (paths) => filePathToTree(paths);
|
|
7
|
+
|
|
8
|
+
export { createFileTreeCollection, createListCollection, createTreeCollection };
|
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
import { splitRenderStrategyProps } from './
|
|
1
|
+
import { splitRenderStrategyProps } from './QFAL6GWC.js';
|
|
2
2
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
3
3
|
import { ark } from './EPLBB4QN.js';
|
|
4
|
-
import { createContext } from './
|
|
4
|
+
import { createContext } from './TROPIN4C.js';
|
|
5
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
5
6
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
6
7
|
import { useMachine, normalizeProps, mergeProps } from '@zag-js/solid';
|
|
7
8
|
import { createSignal, createMemo, createEffect, Show } from 'solid-js';
|
|
8
9
|
import * as presence from '@zag-js/presence';
|
|
9
10
|
|
|
10
11
|
// src/components/presence/split-presence-props.ts
|
|
11
|
-
var splitPresenceProps = (props) => createSplitProps()(props, [
|
|
12
|
-
"immediate",
|
|
13
|
-
"lazyMount",
|
|
14
|
-
"onExitComplete",
|
|
15
|
-
"present",
|
|
16
|
-
"unmountOnExit"
|
|
17
|
-
]);
|
|
12
|
+
var splitPresenceProps = (props) => createSplitProps()(props, ["immediate", "lazyMount", "onExitComplete", "present", "unmountOnExit"]);
|
|
18
13
|
var usePresence = (props) => {
|
|
19
|
-
const [renderStrategyProps, context] = splitRenderStrategyProps(props);
|
|
14
|
+
const [renderStrategyProps, context] = splitRenderStrategyProps(runIfFn(props));
|
|
20
15
|
const [wasEverPresent, setWasEverPresent] = createSignal(false);
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
const api = createMemo(() => presence.connect(state, send, normalizeProps));
|
|
16
|
+
const service = useMachine(presence.machine, props);
|
|
17
|
+
const api = createMemo(() => presence.connect(service, normalizeProps));
|
|
25
18
|
createEffect(() => {
|
|
26
19
|
const present = api().present;
|
|
27
20
|
if (present) setWasEverPresent(true);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
2
2
|
import { ark } from './EPLBB4QN.js';
|
|
3
|
-
import { useEnvironmentContext } from './
|
|
4
|
-
import { useLocaleContext } from './
|
|
5
|
-
import { createContext } from './
|
|
3
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
4
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
5
|
+
import { createContext } from './TROPIN4C.js';
|
|
6
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
6
7
|
import { __export } from './ESLJRKWD.js';
|
|
7
8
|
import { createComponent } from 'solid-js/web';
|
|
8
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -62,19 +63,18 @@ var CarouselPrevTrigger = (props) => {
|
|
|
62
63
|
const mergedProps = mergeProps(() => api().getPrevTriggerProps(), props);
|
|
63
64
|
return createComponent(ark.button, mergedProps);
|
|
64
65
|
};
|
|
65
|
-
var useCarousel = (props
|
|
66
|
+
var useCarousel = (props) => {
|
|
67
|
+
const id = createUniqueId();
|
|
66
68
|
const locale = useLocaleContext();
|
|
67
69
|
const environment = useEnvironmentContext();
|
|
68
|
-
const
|
|
69
|
-
const context = createMemo(() => ({
|
|
70
|
+
const machineProps = createMemo(() => ({
|
|
70
71
|
id,
|
|
71
72
|
dir: locale().dir,
|
|
72
73
|
getRootNode: environment().getRootNode,
|
|
73
|
-
|
|
74
|
-
...props
|
|
74
|
+
...runIfFn(props)
|
|
75
75
|
}));
|
|
76
|
-
const
|
|
77
|
-
return createMemo(() => carousel.connect(
|
|
76
|
+
const service = useMachine(carousel.machine, machineProps);
|
|
77
|
+
return createMemo(() => carousel.connect(service, normalizeProps));
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
// src/components/carousel/carousel-root.tsx
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useCollapsibleContext, collapsible_exports } from './B246J3FR.js';
|
|
2
|
+
import { splitRenderStrategyProps, RenderStrategyProvider, useRenderStrategyContext } from './QFAL6GWC.js';
|
|
3
3
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
4
4
|
import { ark } from './EPLBB4QN.js';
|
|
5
|
-
import { useEnvironmentContext } from './
|
|
6
|
-
import { useLocaleContext } from './
|
|
7
|
-
import { createContext } from './
|
|
5
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
6
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
7
|
+
import { createContext } from './TROPIN4C.js';
|
|
8
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
8
9
|
import { __export } from './ESLJRKWD.js';
|
|
9
10
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
10
11
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
11
|
-
import {
|
|
12
|
+
import { splitProps, createMemo, createUniqueId } from 'solid-js';
|
|
12
13
|
import * as accordion from '@zag-js/accordion';
|
|
13
14
|
export { anatomy } from '@zag-js/accordion';
|
|
14
15
|
|
|
@@ -91,21 +92,18 @@ var AccordionItemTrigger = (props) => {
|
|
|
91
92
|
const [ariaControls, buttonProps] = splitProps(mergedProps, ["aria-controls"]);
|
|
92
93
|
return createComponent(ark.button, mergeProps$1(buttonProps, () => !collapsible().unmounted && ariaControls));
|
|
93
94
|
};
|
|
94
|
-
var useAccordion = (props
|
|
95
|
+
var useAccordion = (props) => {
|
|
95
96
|
const id = createUniqueId();
|
|
96
97
|
const locale = useLocaleContext();
|
|
97
98
|
const environment = useEnvironmentContext();
|
|
98
|
-
const
|
|
99
|
+
const machineProps = createMemo(() => ({
|
|
99
100
|
id,
|
|
100
101
|
dir: locale().dir,
|
|
101
|
-
value: props.defaultValue,
|
|
102
102
|
getRootNode: environment().getRootNode,
|
|
103
|
-
...props
|
|
103
|
+
...runIfFn(props)
|
|
104
104
|
}));
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
return createMemo(() => accordion.connect(state, send, normalizeProps));
|
|
105
|
+
const service = useMachine(accordion.machine, machineProps);
|
|
106
|
+
return createMemo(() => accordion.connect(service, normalizeProps));
|
|
109
107
|
};
|
|
110
108
|
|
|
111
109
|
// src/components/accordion/accordion-root.tsx
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { usePresenceContext, splitPresenceProps, usePresence, PresenceProvider } from './
|
|
1
|
+
import { usePresenceContext, splitPresenceProps, usePresence, PresenceProvider } from './OY4ARTMM.js';
|
|
2
2
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
3
3
|
import { ark } from './EPLBB4QN.js';
|
|
4
|
-
import { useEnvironmentContext } from './
|
|
5
|
-
import { useLocaleContext } from './
|
|
6
|
-
import { createContext } from './
|
|
4
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
5
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
6
|
+
import { createContext } from './TROPIN4C.js';
|
|
7
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
7
8
|
import { __export } from './ESLJRKWD.js';
|
|
8
9
|
import { createComponent } from 'solid-js/web';
|
|
9
10
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -77,20 +78,18 @@ var PopoverPositioner = (props) => {
|
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
80
|
};
|
|
80
|
-
var usePopover = (props
|
|
81
|
+
var usePopover = (props) => {
|
|
82
|
+
const id = createUniqueId();
|
|
81
83
|
const locale = useLocaleContext();
|
|
82
84
|
const environment = useEnvironmentContext();
|
|
83
|
-
const
|
|
84
|
-
const context = createMemo(() => ({
|
|
85
|
+
const machineProps = createMemo(() => ({
|
|
85
86
|
id,
|
|
86
87
|
dir: locale().dir,
|
|
87
88
|
getRootNode: environment().getRootNode,
|
|
88
|
-
|
|
89
|
-
"open.controlled": props.open !== void 0,
|
|
90
|
-
...props
|
|
89
|
+
...runIfFn(props)
|
|
91
90
|
}));
|
|
92
|
-
const
|
|
93
|
-
return createMemo(() => popover.connect(
|
|
91
|
+
const service = useMachine(popover.machine, machineProps);
|
|
92
|
+
return createMemo(() => popover.connect(service, normalizeProps));
|
|
94
93
|
};
|
|
95
94
|
|
|
96
95
|
// src/components/popover/popover-root.tsx
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
2
2
|
import { ark } from './EPLBB4QN.js';
|
|
3
|
-
import { useEnvironmentContext } from './
|
|
4
|
-
import { useLocaleContext } from './
|
|
5
|
-
import { createContext } from './
|
|
3
|
+
import { useEnvironmentContext } from './YMMMHJJS.js';
|
|
4
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
5
|
+
import { createContext } from './TROPIN4C.js';
|
|
6
|
+
import { runIfFn } from './DT73WLR4.js';
|
|
6
7
|
import { __export } from './ESLJRKWD.js';
|
|
7
8
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
8
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -68,19 +69,18 @@ var SliderRange = (props) => {
|
|
|
68
69
|
const mergedProps = mergeProps(() => api().getRangeProps(), props);
|
|
69
70
|
return createComponent(ark.div, mergedProps);
|
|
70
71
|
};
|
|
71
|
-
var useSlider = (props
|
|
72
|
+
var useSlider = (props) => {
|
|
73
|
+
const id = createUniqueId();
|
|
72
74
|
const locale = useLocaleContext();
|
|
73
75
|
const environment = useEnvironmentContext();
|
|
74
|
-
const
|
|
75
|
-
const context = createMemo(() => ({
|
|
76
|
+
const machineProps = createMemo(() => ({
|
|
76
77
|
id,
|
|
77
78
|
dir: locale().dir,
|
|
78
79
|
getRootNode: environment().getRootNode,
|
|
79
|
-
|
|
80
|
-
...props
|
|
80
|
+
...runIfFn(props)
|
|
81
81
|
}));
|
|
82
|
-
const
|
|
83
|
-
return createMemo(() => slider.connect(
|
|
82
|
+
const service = useMachine(slider.machine, machineProps);
|
|
83
|
+
return createMemo(() => slider.connect(service, normalizeProps));
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
// src/components/slider/slider-root.tsx
|
|
@@ -6,13 +6,16 @@ import {
|
|
|
6
6
|
} from "./UFYZ7HLU.jsx";
|
|
7
7
|
import {
|
|
8
8
|
useEnvironmentContext
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./D2Z5BEON.jsx";
|
|
10
10
|
import {
|
|
11
11
|
useLocaleContext
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./RCXMZN3G.jsx";
|
|
13
13
|
import {
|
|
14
14
|
createContext
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./TVCIHLER.jsx";
|
|
16
|
+
import {
|
|
17
|
+
runIfFn
|
|
18
|
+
} from "./KGOB2IMX.jsx";
|
|
16
19
|
import {
|
|
17
20
|
__export
|
|
18
21
|
} from "./7IUG3E2V.jsx";
|
|
@@ -83,7 +86,7 @@ var StepsItem = (props) => {
|
|
|
83
86
|
const itemState = createMemo(() => steps2().getItemState(itemProps));
|
|
84
87
|
return <StepsItemPropsProvider value={itemProps}>
|
|
85
88
|
<StepsItemProvider value={itemState}>
|
|
86
|
-
<ark.
|
|
89
|
+
<ark.div {...mergedProps} />
|
|
87
90
|
</StepsItemProvider>
|
|
88
91
|
</StepsItemPropsProvider>;
|
|
89
92
|
};
|
|
@@ -99,7 +102,7 @@ import { mergeProps as mergeProps5 } from "@zag-js/solid";
|
|
|
99
102
|
var StepsList = (props) => {
|
|
100
103
|
const steps2 = useStepsContext();
|
|
101
104
|
const mergedProps = mergeProps5(() => steps2().getListProps(), props);
|
|
102
|
-
return <ark.
|
|
105
|
+
return <ark.div {...mergedProps} />;
|
|
103
106
|
};
|
|
104
107
|
|
|
105
108
|
// src/components/steps/steps-next-trigger.tsx
|
|
@@ -133,19 +136,18 @@ import { mergeProps as mergeProps9 } from "@zag-js/solid";
|
|
|
133
136
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
134
137
|
import * as steps from "@zag-js/steps";
|
|
135
138
|
import { createMemo as createMemo2, createUniqueId } from "solid-js";
|
|
136
|
-
function useSteps(props
|
|
139
|
+
function useSteps(props) {
|
|
140
|
+
const id = createUniqueId();
|
|
137
141
|
const environment = useEnvironmentContext();
|
|
138
142
|
const locale = useLocaleContext();
|
|
139
|
-
const
|
|
140
|
-
const context = createMemo2(() => ({
|
|
143
|
+
const machineProps = createMemo2(() => ({
|
|
141
144
|
id,
|
|
142
145
|
dir: locale().dir,
|
|
143
146
|
getRootNode: environment().getRootNode,
|
|
144
|
-
|
|
145
|
-
...props
|
|
147
|
+
...runIfFn(props)
|
|
146
148
|
}));
|
|
147
|
-
const
|
|
148
|
-
return createMemo2(() => steps.connect(
|
|
149
|
+
const service = useMachine(steps.machine, machineProps);
|
|
150
|
+
return createMemo2(() => steps.connect(service, normalizeProps));
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
// src/components/steps/steps-root.tsx
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
2
|
+
import { ark } from './EPLBB4QN.js';
|
|
3
|
+
import { createContext } from './TROPIN4C.js';
|
|
4
|
+
import { __export } from './ESLJRKWD.js';
|
|
5
|
+
import { createComponent, mergeProps as mergeProps$1, template, spread } from 'solid-js/web';
|
|
6
|
+
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
7
|
+
import { Show, createMemo } from 'solid-js';
|
|
8
|
+
import * as toggle from '@zag-js/toggle';
|
|
9
|
+
import { createAnatomy } from '@zag-js/anatomy';
|
|
10
|
+
|
|
11
|
+
// src/components/toggle/toggle.ts
|
|
12
|
+
var toggle_exports = {};
|
|
13
|
+
__export(toggle_exports, {
|
|
14
|
+
Context: () => ToggleContext,
|
|
15
|
+
Indicator: () => ToggleIndicator,
|
|
16
|
+
Root: () => ToggleRoot,
|
|
17
|
+
toggleAnatomy: () => toggleAnatomy
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// src/components/toggle/use-toggle-context.ts
|
|
21
|
+
var [ToggleProvider, useToggleContext] = createContext({
|
|
22
|
+
hookName: "useToggleContext",
|
|
23
|
+
providerName: "<ToggleProvider />"
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/components/toggle/toggle-context.tsx
|
|
27
|
+
var ToggleContext = (props) => props.children(useToggleContext());
|
|
28
|
+
var ToggleIndicator = (props) => {
|
|
29
|
+
const {
|
|
30
|
+
children,
|
|
31
|
+
fallback,
|
|
32
|
+
...restProps
|
|
33
|
+
} = props;
|
|
34
|
+
const toggle2 = useToggleContext();
|
|
35
|
+
const mergedProps = mergeProps(() => toggle2().getIndicatorProps(), restProps);
|
|
36
|
+
return createComponent(ark.div, mergeProps$1(mergedProps, {
|
|
37
|
+
get children() {
|
|
38
|
+
return createComponent(Show, {
|
|
39
|
+
get when() {
|
|
40
|
+
return toggle2().pressed;
|
|
41
|
+
},
|
|
42
|
+
fallback,
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
function useToggle(props) {
|
|
49
|
+
const service = useMachine(toggle.machine, props);
|
|
50
|
+
return createMemo(() => toggle.connect(service, normalizeProps));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/components/toggle/toggle-root.tsx
|
|
54
|
+
var _tmpl$ = /* @__PURE__ */ template(`<button>`);
|
|
55
|
+
var ToggleRoot = (props) => {
|
|
56
|
+
const [useToggleProps, localProps] = createSplitProps()(props, ["pressed", "defaultPressed", "disabled", "onPressedChange"]);
|
|
57
|
+
const toggle2 = useToggle(useToggleProps);
|
|
58
|
+
const mergedProps = mergeProps(() => toggle2().getRootProps(), localProps);
|
|
59
|
+
return createComponent(ToggleProvider, {
|
|
60
|
+
value: toggle2,
|
|
61
|
+
get children() {
|
|
62
|
+
var _el$ = _tmpl$();
|
|
63
|
+
spread(_el$, mergedProps, false, false);
|
|
64
|
+
return _el$;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
var toggleAnatomy = createAnatomy("toggle", ["root", "indicator"]);
|
|
69
|
+
toggleAnatomy.build();
|
|
70
|
+
|
|
71
|
+
export { ToggleContext, ToggleIndicator, ToggleRoot, toggleAnatomy, toggle_exports, useToggle, useToggleContext };
|