@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';
|
|
@@ -30,19 +31,18 @@ var SplitterResizeTrigger = (props) => {
|
|
|
30
31
|
const mergedProps = mergeProps(() => api().getResizeTriggerProps(resizeTriggerProps), restProps);
|
|
31
32
|
return createComponent(ark.button, mergedProps);
|
|
32
33
|
};
|
|
33
|
-
var useSplitter = (props
|
|
34
|
+
var useSplitter = (props) => {
|
|
34
35
|
const locale = useLocaleContext();
|
|
35
36
|
const environment = useEnvironmentContext();
|
|
36
37
|
const id = createUniqueId();
|
|
37
|
-
const
|
|
38
|
+
const machineProps = createMemo(() => ({
|
|
38
39
|
id,
|
|
39
40
|
dir: locale().dir,
|
|
40
41
|
getRootNode: environment().getRootNode,
|
|
41
|
-
|
|
42
|
-
...props
|
|
42
|
+
...runIfFn(props)
|
|
43
43
|
}));
|
|
44
|
-
const
|
|
45
|
-
return createMemo(() => splitter.connect(
|
|
44
|
+
const service = useMachine(splitter.machine, machineProps);
|
|
45
|
+
return createMemo(() => splitter.connect(service, normalizeProps));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// src/components/splitter/splitter-root.tsx
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './OY4ARTMM.js';
|
|
2
|
+
import { useFieldContext } from './KVVYU5Z3.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 * as colorPicker from '@zag-js/color-picker';
|
|
10
11
|
import { anatomy } from '@zag-js/color-picker';
|
|
11
12
|
export { parse } from '@zag-js/color-picker';
|
|
12
13
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
13
14
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
14
|
-
import { Show, Index, createUniqueId
|
|
15
|
+
import { Show, createMemo, Index, createUniqueId } from 'solid-js';
|
|
15
16
|
|
|
16
17
|
// src/components/color-picker/use-color-picker-area-props-context.ts
|
|
17
18
|
var [ColorPickerAreaPropsProvider, useColorPickerAreaPropsContext] = createContext({
|
|
@@ -194,12 +195,12 @@ var ColorPickerPositioner = (props) => {
|
|
|
194
195
|
}
|
|
195
196
|
});
|
|
196
197
|
};
|
|
197
|
-
var useColorPicker = (props
|
|
198
|
+
var useColorPicker = (props) => {
|
|
199
|
+
const id = createUniqueId();
|
|
198
200
|
const locale = useLocaleContext();
|
|
199
201
|
const environment = useEnvironmentContext();
|
|
200
202
|
const field = useFieldContext();
|
|
201
|
-
const
|
|
202
|
-
const context = createMemo(() => ({
|
|
203
|
+
const machineProps = createMemo(() => ({
|
|
203
204
|
id,
|
|
204
205
|
ids: {
|
|
205
206
|
label: field?.().ids.label,
|
|
@@ -211,19 +212,16 @@ var useColorPicker = (props = {}) => {
|
|
|
211
212
|
readOnly: field?.().readOnly,
|
|
212
213
|
required: field?.().required,
|
|
213
214
|
getRootNode: environment().getRootNode,
|
|
214
|
-
|
|
215
|
-
"open.controlled": props.open !== void 0,
|
|
216
|
-
value: props.defaultValue,
|
|
217
|
-
...props
|
|
215
|
+
...runIfFn(props)
|
|
218
216
|
}));
|
|
219
|
-
const
|
|
220
|
-
return createMemo(() => colorPicker.connect(
|
|
217
|
+
const service = useMachine(colorPicker.machine, machineProps);
|
|
218
|
+
return createMemo(() => colorPicker.connect(service, normalizeProps));
|
|
221
219
|
};
|
|
222
220
|
|
|
223
221
|
// src/components/color-picker/color-picker-root.tsx
|
|
224
222
|
var ColorPickerRoot = (props) => {
|
|
225
223
|
const [presenceProps, colorPickerProps] = splitPresenceProps(props);
|
|
226
|
-
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "disabled", "format", "id", "ids", "initialFocusEl", "invalid", "name", "name", "onFocusOutside", "onFormatChange", "onInteractOutside", "onOpenChange", "onPointerDownOutside", "onValueChange", "onValueChangeEnd", "open", "openAutoFocus", "positioning", "readOnly", "required", "value"]);
|
|
224
|
+
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "defaultFormat", "disabled", "format", "id", "ids", "initialFocusEl", "invalid", "name", "name", "onFocusOutside", "onFormatChange", "onInteractOutside", "onOpenChange", "onPointerDownOutside", "onValueChange", "onValueChangeEnd", "open", "openAutoFocus", "positioning", "readOnly", "required", "value"]);
|
|
227
225
|
const api = useColorPicker(useColorPickerProps);
|
|
228
226
|
const apiPresence = usePresence(mergeProps(presenceProps, () => ({
|
|
229
227
|
present: api().open
|
|
@@ -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";
|
|
@@ -52,11 +55,7 @@ var [RadioGroupItemPropsProvider, useRadioGroupItemPropsContext] = createContext
|
|
|
52
55
|
|
|
53
56
|
// src/components/radio-group/radio-group-item.tsx
|
|
54
57
|
var RadioGroupItem = (props) => {
|
|
55
|
-
const [itemProps, localProps] = createSplitProps()(props, [
|
|
56
|
-
"value",
|
|
57
|
-
"disabled",
|
|
58
|
-
"invalid"
|
|
59
|
-
]);
|
|
58
|
+
const [itemProps, localProps] = createSplitProps()(props, ["value", "disabled", "invalid"]);
|
|
60
59
|
const radioGroup = useRadioGroupContext();
|
|
61
60
|
const mergedProps = mergeProps2(() => radioGroup().getItemProps(itemProps), localProps);
|
|
62
61
|
const itemState = createMemo(() => radioGroup().getItemState(itemProps));
|
|
@@ -112,21 +111,18 @@ import { mergeProps as mergeProps7 } from "@zag-js/solid";
|
|
|
112
111
|
import * as radio from "@zag-js/radio-group";
|
|
113
112
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
114
113
|
import { createMemo as createMemo2, createUniqueId } from "solid-js";
|
|
115
|
-
var useRadioGroup = (props
|
|
114
|
+
var useRadioGroup = (props) => {
|
|
115
|
+
const id = createUniqueId();
|
|
116
116
|
const locale = useLocaleContext();
|
|
117
117
|
const environment = useEnvironmentContext();
|
|
118
|
-
const
|
|
119
|
-
const context = createMemo2(() => ({
|
|
118
|
+
const machineProps = createMemo2(() => ({
|
|
120
119
|
id,
|
|
121
120
|
dir: locale().dir,
|
|
122
121
|
getRootNode: environment().getRootNode,
|
|
123
|
-
|
|
124
|
-
...props
|
|
122
|
+
...runIfFn(props)
|
|
125
123
|
}));
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
});
|
|
129
|
-
return createMemo2(() => radio.connect(state, send, normalizeProps));
|
|
124
|
+
const service = useMachine(radio.machine, machineProps);
|
|
125
|
+
return createMemo2(() => radio.connect(service, normalizeProps));
|
|
130
126
|
};
|
|
131
127
|
|
|
132
128
|
// src/components/radio-group/radio-group-root.tsx
|
|
@@ -153,9 +149,7 @@ var RadioGroupRoot = (props) => {
|
|
|
153
149
|
// src/components/radio-group/radio-group-root-provider.tsx
|
|
154
150
|
import { mergeProps as mergeProps8 } from "@zag-js/solid";
|
|
155
151
|
var RadioGroupRootProvider = (props) => {
|
|
156
|
-
const [{ value: radioGroup }, localProps] = createSplitProps()(props, [
|
|
157
|
-
"value"
|
|
158
|
-
]);
|
|
152
|
+
const [{ value: radioGroup }, localProps] = createSplitProps()(props, ["value"]);
|
|
159
153
|
const mergedProps = mergeProps8(() => radioGroup().getRootProps(), localProps);
|
|
160
154
|
return <RadioGroupProvider value={radioGroup}>
|
|
161
155
|
<ark.div {...mergedProps} />
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFieldContext
|
|
3
|
+
} from "./UCYPIMZC.jsx";
|
|
1
4
|
import {
|
|
2
5
|
PresenceProvider,
|
|
3
6
|
splitPresenceProps,
|
|
4
7
|
usePresence,
|
|
5
8
|
usePresenceContext
|
|
6
|
-
} from "./
|
|
7
|
-
import {
|
|
8
|
-
useFieldContext
|
|
9
|
-
} from "./P7I44WC4.jsx";
|
|
9
|
+
} from "./A4744EEE.jsx";
|
|
10
10
|
import {
|
|
11
11
|
createSplitProps
|
|
12
12
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -15,13 +15,16 @@ import {
|
|
|
15
15
|
} from "./UFYZ7HLU.jsx";
|
|
16
16
|
import {
|
|
17
17
|
useEnvironmentContext
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./D2Z5BEON.jsx";
|
|
19
19
|
import {
|
|
20
20
|
useLocaleContext
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./RCXMZN3G.jsx";
|
|
22
22
|
import {
|
|
23
23
|
createContext
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./TVCIHLER.jsx";
|
|
25
|
+
import {
|
|
26
|
+
runIfFn
|
|
27
|
+
} from "./KGOB2IMX.jsx";
|
|
25
28
|
import {
|
|
26
29
|
__export
|
|
27
30
|
} from "./7IUG3E2V.jsx";
|
|
@@ -158,10 +161,7 @@ import { mergeProps as mergeProps8 } from "@zag-js/solid";
|
|
|
158
161
|
var SelectItemGroupLabel = (props) => {
|
|
159
162
|
const select2 = useSelectContext();
|
|
160
163
|
const itemGroupProps = useSelectItemGroupPropsContext();
|
|
161
|
-
const mergedProps = mergeProps8(
|
|
162
|
-
() => select2().getItemGroupLabelProps({ htmlFor: itemGroupProps.id }),
|
|
163
|
-
props
|
|
164
|
-
);
|
|
164
|
+
const mergedProps = mergeProps8(() => select2().getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);
|
|
165
165
|
return <ark.div {...mergedProps} />;
|
|
166
166
|
};
|
|
167
167
|
|
|
@@ -217,13 +217,13 @@ import { mergeProps as mergeProps14 } from "@zag-js/solid";
|
|
|
217
217
|
// src/components/select/use-select.ts
|
|
218
218
|
import * as select from "@zag-js/select";
|
|
219
219
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
220
|
-
import {
|
|
220
|
+
import { createMemo as createMemo3, createUniqueId as createUniqueId2 } from "solid-js";
|
|
221
221
|
var useSelect = (props) => {
|
|
222
|
+
const id = createUniqueId2();
|
|
222
223
|
const locale = useLocaleContext();
|
|
223
224
|
const environment = useEnvironmentContext();
|
|
224
|
-
const id = createUniqueId2();
|
|
225
225
|
const field = useFieldContext();
|
|
226
|
-
const
|
|
226
|
+
const machineProps = createMemo3(() => ({
|
|
227
227
|
id,
|
|
228
228
|
ids: {
|
|
229
229
|
label: field?.().ids.label,
|
|
@@ -235,22 +235,10 @@ var useSelect = (props) => {
|
|
|
235
235
|
required: field?.().required,
|
|
236
236
|
dir: locale().dir,
|
|
237
237
|
getRootNode: environment().getRootNode,
|
|
238
|
-
|
|
239
|
-
value: props.defaultValue,
|
|
240
|
-
"open.controlled": props.open !== void 0,
|
|
241
|
-
...props
|
|
238
|
+
...runIfFn(props)
|
|
242
239
|
}));
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
return restProps;
|
|
246
|
-
});
|
|
247
|
-
const [state, send, service] = useMachine(select.machine(initialContext()), {
|
|
248
|
-
context
|
|
249
|
-
});
|
|
250
|
-
createEffect(() => {
|
|
251
|
-
service.setContext({ collection: props.collection });
|
|
252
|
-
});
|
|
253
|
-
return createMemo3(() => select.connect(state, send, normalizeProps));
|
|
240
|
+
const service = useMachine(select.machine, machineProps);
|
|
241
|
+
return createMemo3(() => select.connect(service, normalizeProps));
|
|
254
242
|
};
|
|
255
243
|
|
|
256
244
|
// src/components/select/select-root.tsx
|
|
@@ -258,8 +246,9 @@ var SelectRoot = (props) => {
|
|
|
258
246
|
const [presenceProps, selectProps] = splitPresenceProps(props);
|
|
259
247
|
const [useSelectProps, localProps] = createSplitProps()(selectProps, [
|
|
260
248
|
"closeOnSelect",
|
|
261
|
-
"composite",
|
|
262
249
|
"collection",
|
|
250
|
+
"composite",
|
|
251
|
+
"defaultHighlightedValue",
|
|
263
252
|
"defaultOpen",
|
|
264
253
|
"defaultValue",
|
|
265
254
|
"deselectable",
|
|
@@ -299,9 +288,7 @@ var SelectRoot = (props) => {
|
|
|
299
288
|
import { mergeProps as mergeProps15 } from "@zag-js/solid";
|
|
300
289
|
var SelectRootProvider = (props) => {
|
|
301
290
|
const [presenceProps, selectProps] = splitPresenceProps(props);
|
|
302
|
-
const [{ value: select2 }, localProps] = createSplitProps()(selectProps, [
|
|
303
|
-
"value"
|
|
304
|
-
]);
|
|
291
|
+
const [{ value: select2 }, localProps] = createSplitProps()(selectProps, ["value"]);
|
|
305
292
|
const presence = usePresence(mergeProps15(() => ({ present: select2().open }), presenceProps));
|
|
306
293
|
const mergedProps = mergeProps15(() => select2().getRootProps(), localProps);
|
|
307
294
|
return <SelectProvider value={select2}>
|
|
@@ -3,17 +3,10 @@ import {
|
|
|
3
3
|
} from "./DOBZPYAN.jsx";
|
|
4
4
|
import {
|
|
5
5
|
EnvironmentProvider
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./D2Z5BEON.jsx";
|
|
7
7
|
|
|
8
8
|
// src/components/frame/frame.tsx
|
|
9
|
-
import {
|
|
10
|
-
Show,
|
|
11
|
-
createEffect as createEffect2,
|
|
12
|
-
createMemo,
|
|
13
|
-
createSignal,
|
|
14
|
-
onCleanup as onCleanup2,
|
|
15
|
-
splitProps
|
|
16
|
-
} from "solid-js";
|
|
9
|
+
import { Show, createEffect as createEffect2, createMemo, createSignal, onCleanup as onCleanup2, splitProps } from "solid-js";
|
|
17
10
|
import { Portal } from "solid-js/web";
|
|
18
11
|
|
|
19
12
|
// src/components/frame/frame-content.tsx
|
|
@@ -38,13 +31,7 @@ function getMountNode(frame) {
|
|
|
38
31
|
return doc.body.querySelector(".frame-root") || doc.body;
|
|
39
32
|
}
|
|
40
33
|
var Frame = (props) => {
|
|
41
|
-
const [frameProps, localProps] = splitProps(props, [
|
|
42
|
-
"children",
|
|
43
|
-
"head",
|
|
44
|
-
"onMount",
|
|
45
|
-
"onUnmount",
|
|
46
|
-
"srcdoc"
|
|
47
|
-
]);
|
|
34
|
+
const [frameProps, localProps] = splitProps(props, ["children", "head", "onMount", "onUnmount", "srcdoc"]);
|
|
48
35
|
const srcdoc = createMemo(() => frameProps.srcdoc ?? initialSrcDoc);
|
|
49
36
|
const [frameRef, setFrameRef] = createSignal(null);
|
|
50
37
|
const [mountNode, setMountNode] = createSignal(null);
|
|
@@ -1,13 +1,14 @@
|
|
|
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';
|
|
10
|
-
import {
|
|
11
|
+
import { createEffect, onMount, createUniqueId, createMemo, Show } from 'solid-js';
|
|
11
12
|
import * as menu from '@zag-js/menu';
|
|
12
13
|
export { anatomy } from '@zag-js/menu';
|
|
13
14
|
|
|
@@ -198,23 +199,21 @@ var MenuRadioItemGroup = (props) => {
|
|
|
198
199
|
}
|
|
199
200
|
});
|
|
200
201
|
};
|
|
201
|
-
var useMenu = (props
|
|
202
|
+
var useMenu = (props) => {
|
|
203
|
+
const id = createUniqueId();
|
|
202
204
|
const locale = useLocaleContext();
|
|
203
205
|
const environment = useEnvironmentContext();
|
|
204
|
-
const
|
|
205
|
-
const context = createMemo(() => ({
|
|
206
|
+
const machineProps = createMemo(() => ({
|
|
206
207
|
id,
|
|
207
208
|
dir: locale().dir,
|
|
208
209
|
getRootNode: environment().getRootNode,
|
|
209
|
-
|
|
210
|
-
"open.controlled": props.open !== void 0,
|
|
211
|
-
...props
|
|
210
|
+
...runIfFn(props)
|
|
212
211
|
}));
|
|
213
|
-
const
|
|
214
|
-
const api = createMemo(() => menu.connect(
|
|
212
|
+
const service = useMachine(menu.machine, machineProps);
|
|
213
|
+
const api = createMemo(() => menu.connect(service, normalizeProps));
|
|
215
214
|
return {
|
|
216
215
|
api,
|
|
217
|
-
|
|
216
|
+
service
|
|
218
217
|
};
|
|
219
218
|
};
|
|
220
219
|
|
|
@@ -235,16 +234,16 @@ var [MenuTriggerItemProvider, useMenuTriggerItemContext] = createContext({
|
|
|
235
234
|
// src/components/menu/menu-root.tsx
|
|
236
235
|
var MenuRoot = (props) => {
|
|
237
236
|
const [presenceProps, menuProps] = splitPresenceProps(props);
|
|
238
|
-
const [useMenuProps, localProps] = createSplitProps()(menuProps, ["anchorPoint", "aria-label", "closeOnSelect", "composite", "defaultOpen", "highlightedValue", "id", "ids", "loopFocus", "onEscapeKeyDown", "onFocusOutside", "onHighlightChange", "onInteractOutside", "onOpenChange", "onPointerDownOutside", "onSelect", "open", "
|
|
237
|
+
const [useMenuProps, localProps] = createSplitProps()(menuProps, ["anchorPoint", "aria-label", "closeOnSelect", "composite", "defaultHighlightedValue", "defaultOpen", "highlightedValue", "id", "ids", "loopFocus", "navigate", "onEscapeKeyDown", "onFocusOutside", "onHighlightChange", "onInteractOutside", "onOpenChange", "onPointerDownOutside", "onSelect", "open", "positioning", "typeahead"]);
|
|
239
238
|
const parentApi = useMenuContext();
|
|
240
239
|
const parentMachine = useMenuMachineContext();
|
|
241
240
|
const menu2 = useMenu(useMenuProps);
|
|
242
241
|
const presenceApi = usePresence(mergeProps(presenceProps, () => ({
|
|
243
242
|
present: menu2.api().open
|
|
244
243
|
})));
|
|
245
|
-
|
|
244
|
+
onMount(() => {
|
|
246
245
|
if (!parentMachine) return;
|
|
247
|
-
parentApi?.().setChild(menu2.
|
|
246
|
+
parentApi?.().setChild(menu2.service);
|
|
248
247
|
menu2.api().setParent(parentMachine);
|
|
249
248
|
});
|
|
250
249
|
const triggerItemContext = () => parentApi?.().getTriggerItemProps(menu2.api());
|
|
@@ -253,7 +252,7 @@ var MenuRoot = (props) => {
|
|
|
253
252
|
get children() {
|
|
254
253
|
return createComponent(MenuMachineProvider, {
|
|
255
254
|
get value() {
|
|
256
|
-
return menu2.
|
|
255
|
+
return menu2.service;
|
|
257
256
|
},
|
|
258
257
|
get children() {
|
|
259
258
|
return createComponent(MenuProvider, {
|
|
@@ -283,7 +282,7 @@ var MenuRootProvider = (props) => {
|
|
|
283
282
|
})));
|
|
284
283
|
createEffect(() => {
|
|
285
284
|
if (!parentMachine) return;
|
|
286
|
-
parentApi?.().setChild(menuProps.value.
|
|
285
|
+
parentApi?.().setChild(menuProps.value.service);
|
|
287
286
|
menuProps.value.api().setParent(parentMachine);
|
|
288
287
|
});
|
|
289
288
|
const triggerItemContext = () => parentApi?.().getTriggerItemProps(menuProps.value.api());
|
|
@@ -292,7 +291,7 @@ var MenuRootProvider = (props) => {
|
|
|
292
291
|
get children() {
|
|
293
292
|
return createComponent(MenuMachineProvider, {
|
|
294
293
|
get value() {
|
|
295
|
-
return menuProps.value.
|
|
294
|
+
return menuProps.value.service;
|
|
296
295
|
},
|
|
297
296
|
get children() {
|
|
298
297
|
return createComponent(MenuProvider, {
|
|
@@ -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';
|
|
@@ -69,7 +70,7 @@ var StepsItem = (props) => {
|
|
|
69
70
|
return createComponent(StepsItemProvider, {
|
|
70
71
|
value: itemState,
|
|
71
72
|
get children() {
|
|
72
|
-
return createComponent(ark.
|
|
73
|
+
return createComponent(ark.div, mergedProps);
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
}
|
|
@@ -84,7 +85,7 @@ StepsItemContext.displayName = "StepsItemContext";
|
|
|
84
85
|
var StepsList = (props) => {
|
|
85
86
|
const steps2 = useStepsContext();
|
|
86
87
|
const mergedProps = mergeProps(() => steps2().getListProps(), props);
|
|
87
|
-
return createComponent(ark.
|
|
88
|
+
return createComponent(ark.div, mergedProps);
|
|
88
89
|
};
|
|
89
90
|
var StepsNextTrigger = (props) => {
|
|
90
91
|
const steps2 = useStepsContext();
|
|
@@ -101,19 +102,18 @@ var StepsProgress = (props) => {
|
|
|
101
102
|
const mergedProps = mergeProps(() => steps2().getProgressProps(), props);
|
|
102
103
|
return createComponent(ark.div, mergedProps);
|
|
103
104
|
};
|
|
104
|
-
function useSteps(props
|
|
105
|
+
function useSteps(props) {
|
|
106
|
+
const id = createUniqueId();
|
|
105
107
|
const environment = useEnvironmentContext();
|
|
106
108
|
const locale = useLocaleContext();
|
|
107
|
-
const
|
|
108
|
-
const context = createMemo(() => ({
|
|
109
|
+
const machineProps = createMemo(() => ({
|
|
109
110
|
id,
|
|
110
111
|
dir: locale().dir,
|
|
111
112
|
getRootNode: environment().getRootNode,
|
|
112
|
-
|
|
113
|
-
...props
|
|
113
|
+
...runIfFn(props)
|
|
114
114
|
}));
|
|
115
|
-
const
|
|
116
|
-
return createMemo(() => steps.connect(
|
|
115
|
+
const service = useMachine(steps.machine, machineProps);
|
|
116
|
+
return createMemo(() => steps.connect(service, normalizeProps));
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// src/components/steps/steps-root.tsx
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useControllableState
|
|
3
|
-
} from "./52WUF3CY.jsx";
|
|
4
1
|
import {
|
|
5
2
|
createSplitProps
|
|
6
3
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -9,7 +6,7 @@ import {
|
|
|
9
6
|
} from "./UFYZ7HLU.jsx";
|
|
10
7
|
import {
|
|
11
8
|
createContext
|
|
12
|
-
} from "./
|
|
9
|
+
} from "./TVCIHLER.jsx";
|
|
13
10
|
import {
|
|
14
11
|
__export
|
|
15
12
|
} from "./7IUG3E2V.jsx";
|
|
@@ -37,13 +34,13 @@ import { mergeProps } from "@zag-js/solid";
|
|
|
37
34
|
import { Show } from "solid-js";
|
|
38
35
|
var ToggleIndicator = (props) => {
|
|
39
36
|
const { children, fallback, ...restProps } = props;
|
|
40
|
-
const
|
|
41
|
-
const mergedProps = mergeProps(() =>
|
|
37
|
+
const toggle2 = useToggleContext();
|
|
38
|
+
const mergedProps = mergeProps(() => toggle2().getIndicatorProps(), restProps);
|
|
42
39
|
return <ark.div {...mergedProps}>
|
|
43
40
|
{
|
|
44
41
|
/* @ts-ignore */
|
|
45
42
|
}
|
|
46
|
-
<Show when={
|
|
43
|
+
<Show when={toggle2().pressed} fallback={fallback}>
|
|
47
44
|
{children}
|
|
48
45
|
</Show>
|
|
49
46
|
</ark.div>;
|
|
@@ -53,51 +50,12 @@ var ToggleIndicator = (props) => {
|
|
|
53
50
|
import { mergeProps as mergeProps2 } from "@zag-js/solid";
|
|
54
51
|
|
|
55
52
|
// src/components/toggle/use-toggle.ts
|
|
56
|
-
import {
|
|
53
|
+
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
54
|
+
import * as toggle from "@zag-js/toggle";
|
|
57
55
|
import { createMemo } from "solid-js";
|
|
58
|
-
|
|
59
|
-
// src/components/toggle/toggle.anatomy.ts
|
|
60
|
-
import { createAnatomy } from "@zag-js/anatomy";
|
|
61
|
-
var toggleAnatomy = createAnatomy("toggle", ["root", "indicator"]);
|
|
62
|
-
var parts = toggleAnatomy.build();
|
|
63
|
-
|
|
64
|
-
// src/components/toggle/use-toggle.ts
|
|
65
56
|
function useToggle(props) {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
defaultValue: !!defaultPressed,
|
|
69
|
-
value: pressed,
|
|
70
|
-
onChange: onPressedChange
|
|
71
|
-
});
|
|
72
|
-
return createMemo(() => ({
|
|
73
|
-
pressed: pressedState(),
|
|
74
|
-
disabled: !!disabled,
|
|
75
|
-
setPressed: setPressedState,
|
|
76
|
-
getRootProps() {
|
|
77
|
-
return {
|
|
78
|
-
...parts.root.attrs,
|
|
79
|
-
type: "button",
|
|
80
|
-
disabled,
|
|
81
|
-
"aria-pressed": pressedState(),
|
|
82
|
-
"data-state": pressedState() ? "on" : "off",
|
|
83
|
-
"data-pressed": dataAttr(pressedState()),
|
|
84
|
-
"data-disabled": dataAttr(disabled),
|
|
85
|
-
onClick(event) {
|
|
86
|
-
if (event.defaultPrevented) return;
|
|
87
|
-
if (disabled) return;
|
|
88
|
-
setPressedState(!pressedState());
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
getIndicatorProps() {
|
|
93
|
-
return {
|
|
94
|
-
...parts.indicator.attrs,
|
|
95
|
-
"data-disabled": dataAttr(disabled),
|
|
96
|
-
"data-pressed": dataAttr(pressedState()),
|
|
97
|
-
"data-state": pressedState() ? "on" : "off"
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}));
|
|
57
|
+
const service = useMachine(toggle.machine, props);
|
|
58
|
+
return createMemo(() => toggle.connect(service, normalizeProps));
|
|
101
59
|
}
|
|
102
60
|
|
|
103
61
|
// src/components/toggle/toggle-root.tsx
|
|
@@ -108,19 +66,24 @@ var ToggleRoot = (props) => {
|
|
|
108
66
|
"disabled",
|
|
109
67
|
"onPressedChange"
|
|
110
68
|
]);
|
|
111
|
-
const
|
|
112
|
-
const mergedProps = mergeProps2(() =>
|
|
113
|
-
return <ToggleProvider value={
|
|
69
|
+
const toggle2 = useToggle(useToggleProps);
|
|
70
|
+
const mergedProps = mergeProps2(() => toggle2().getRootProps(), localProps);
|
|
71
|
+
return <ToggleProvider value={toggle2}>
|
|
114
72
|
<button {...mergedProps} />
|
|
115
73
|
</ToggleProvider>;
|
|
116
74
|
};
|
|
117
75
|
|
|
76
|
+
// src/components/toggle/toggle.anatomy.ts
|
|
77
|
+
import { createAnatomy } from "@zag-js/anatomy";
|
|
78
|
+
var toggleAnatomy = createAnatomy("toggle", ["root", "indicator"]);
|
|
79
|
+
var parts = toggleAnatomy.build();
|
|
80
|
+
|
|
118
81
|
export {
|
|
119
82
|
useToggleContext,
|
|
120
83
|
ToggleContext,
|
|
121
84
|
ToggleIndicator,
|
|
122
|
-
toggleAnatomy,
|
|
123
85
|
useToggle,
|
|
124
86
|
ToggleRoot,
|
|
87
|
+
toggleAnatomy,
|
|
125
88
|
toggle_exports
|
|
126
89
|
};
|