@ark-ui/solid 4.10.2 → 5.0.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/{E72NMPSK.jsx → 2FYSIKNK.jsx} +5 -13
- package/dist/chunk/{ASCGEGA5.jsx → 2TEQVFZN.jsx} +11 -15
- package/dist/chunk/{2H4WHODR.js → 3CUJRNYI.js} +7 -10
- package/dist/chunk/{MRQ2UYM4.jsx → 3VB4UGEY.jsx} +8 -10
- package/dist/chunk/{ATMUKDFF.js → 44YJVOL2.js} +8 -10
- package/dist/chunk/{7YIHAT7J.jsx → 4D76BVTD.jsx} +35 -17
- package/dist/chunk/{VARNCRUN.js → 4E5OPUFZ.js} +16 -18
- package/dist/chunk/{5JS7LFUQ.js → 4GOBFWQB.js} +9 -8
- package/dist/chunk/{RAEDLHD3.js → 55NHLACH.js} +11 -14
- package/dist/chunk/{2HTNQLGP.jsx → 676ULDTZ.jsx} +9 -13
- package/dist/chunk/{U7SPBSDD.jsx → 6AKFQH4M.jsx} +8 -13
- package/dist/chunk/{QODB3C3M.js → 6MQ6S5JP.js} +8 -5
- package/dist/chunk/{CIPYIXIW.js → 6NMPU3T3.js} +8 -10
- package/dist/chunk/{FNEB2RAF.js → 6VITT55B.js} +9 -10
- package/dist/chunk/{MQDN267C.jsx → 7AJYNPOZ.jsx} +8 -11
- package/dist/chunk/{EHJDQTTW.jsx → 7IAJIOJR.jsx} +3 -16
- package/dist/chunk/{UGKLUHKU.js → A4HLKXDW.js} +8 -11
- package/dist/chunk/{3LRXHWW2.js → A6LAAZDX.js} +32 -27
- package/dist/chunk/{LVPQ6GR4.js → AIQ2GVFX.js} +6 -7
- package/dist/chunk/{JVXNYKNA.js → ANDTZLCB.js} +8 -10
- package/dist/chunk/{5O4RWSWO.jsx → BPYAMTER.jsx} +6 -4
- package/dist/chunk/{AIQFNVCU.jsx → BTPWLTJU.jsx} +9 -18
- package/dist/chunk/{6MXKM4GA.js → C4WAO4VB.js} +9 -10
- package/dist/chunk/{2W32Z6JZ.js → DBAO7VQW.js} +9 -10
- package/dist/chunk/{5SRZ3YYC.js → DEA5DIWS.js} +7 -8
- package/dist/chunk/{CCA5XJM6.jsx → DH5DKFFF.jsx} +19 -37
- package/dist/chunk/{Y4LH2CR6.jsx → DS2MX7YY.jsx} +8 -11
- package/dist/chunk/{34OZO53S.js → DVI7TRLG.js} +9 -12
- package/dist/chunk/{QQUR4MWN.js → E2TLJMGI.js} +15 -17
- package/dist/chunk/{H4RSHLA7.jsx → EH5LPBSV.jsx} +9 -13
- package/dist/chunk/{F3QPTRGW.jsx → EIGYBOW2.jsx} +27 -34
- package/dist/chunk/{HU7FZMJI.jsx → ENXUS2WG.jsx} +9 -14
- package/dist/chunk/{AX5SMQMA.js → EUXWRO3A.js} +16 -17
- package/dist/chunk/{K54W24N6.jsx → FHWNUAQM.jsx} +10 -15
- package/dist/chunk/{7S43DIPW.js → FX6TOMB3.js} +13 -25
- package/dist/chunk/{MBQQASZE.js → GUQTNAZU.js} +9 -10
- package/dist/chunk/{B7LE23PE.jsx → H5QZC4VW.jsx} +9 -13
- package/dist/chunk/{NK4T7LIZ.jsx → H7SWP54F.jsx} +7 -11
- package/dist/chunk/{M2FICVVI.js → HQEG6EKY.js} +9 -11
- package/dist/chunk/{U3XJZI3X.jsx → I4VF53LH.jsx} +15 -25
- package/dist/chunk/{G2WIACWP.js → JOWPVE6E.js} +8 -9
- package/dist/chunk/{SN5TXTB6.jsx → JZ7ZQZT4.jsx} +17 -54
- package/dist/chunk/{X3BMEEJH.js → KMFRZGLF.js} +34 -14
- package/dist/chunk/{GZVCPLKK.jsx → KQ4BIFPS.jsx} +9 -10
- package/dist/chunk/{WPFSEVTX.js → LFWIA7VB.js} +11 -14
- package/dist/chunk/{3O5VTKDF.jsx → LKOJO4VB.jsx} +16 -32
- package/dist/chunk/{5XD5ZSBX.js → M2C67TPA.js} +13 -17
- package/dist/chunk/{2GATVLPK.js → M63JXHU4.js} +7 -8
- package/dist/chunk/MOG4V2NQ.jsx +15 -0
- package/dist/chunk/{XUVXUPEH.js → MZD7ZKWI.js} +2 -7
- package/dist/chunk/{YCYZZGN2.jsx → NCURFCYQ.jsx} +9 -8
- package/dist/chunk/{5ONYCKM3.jsx → NEBB7COJ.jsx} +1 -1
- package/dist/chunk/{Q7NPTAJI.js → NNZQ2FQW.js} +8 -9
- package/dist/chunk/{QGV2SUTQ.jsx → O5AHG7DQ.jsx} +16 -19
- package/dist/chunk/{6YQ3EF2J.js → O62NKGT4.js} +9 -11
- package/dist/chunk/{2J42A7KM.js → OA5UZFKE.js} +2 -2
- package/dist/chunk/{CPMYIT5J.jsx → OAH52ZNM.jsx} +11 -12
- package/dist/chunk/OAPCRIL5.js +8 -0
- package/dist/chunk/{T4NRAKVA.jsx → OEZAIQU2.jsx} +9 -10
- package/dist/chunk/{YV5BACLX.js → OIGKROX4.js} +9 -9
- package/dist/chunk/{IQJBNZOX.jsx → PES3MXH3.jsx} +8 -6
- package/dist/chunk/{DXYB7RYX.js → PJNGX4UT.js} +9 -8
- package/dist/chunk/{3HMZSTYX.js → PL4PGQFF.js} +8 -10
- package/dist/chunk/{PRMWTLUY.jsx → POFK2TVP.jsx} +8 -9
- package/dist/chunk/{WKVZFHUH.jsx → PVOFTEOB.jsx} +14 -25
- package/dist/chunk/{HPDOBQ3V.js → QEMQBM6W.js} +1 -1
- package/dist/chunk/{L7OSYHVR.js → QFAL6GWC.js} +1 -1
- package/dist/chunk/{PSLLOEMD.js → QKFZ3XTM.js} +14 -28
- package/dist/chunk/{IZC6PKGT.jsx → QZQUUXCF.jsx} +10 -14
- package/dist/chunk/{MMS6MJ72.js → R6Q7TUSQ.js} +8 -11
- package/dist/chunk/{3QQZKR3F.jsx → RCXMZN3G.jsx} +1 -1
- package/dist/chunk/{WM2IZOYM.jsx → RG3IJESS.jsx} +48 -80
- package/dist/chunk/{SWUA2VFC.js → SAI3RCJY.js} +7 -10
- package/dist/chunk/{ZC6KWJ4T.jsx → SBKJA5N2.jsx} +7 -12
- package/dist/chunk/{RZBYC7DR.jsx → SBLZHOW2.jsx} +3 -12
- package/dist/chunk/SDD2HKR3.js +71 -0
- package/dist/chunk/{WIVXL7HJ.jsx → SL2ZPLSH.jsx} +9 -13
- package/dist/chunk/{3WGLTS6O.js → SRPSYZUL.js} +7 -8
- package/dist/chunk/{DOPROT6M.jsx → SWZSXMPJ.jsx} +10 -8
- package/dist/chunk/{BY62F4IV.jsx → TEZHN26Z.jsx} +8 -11
- package/dist/chunk/{5EVN6V64.js → TMTD3AUG.js} +12 -15
- package/dist/chunk/{I5UG2QUO.js → TROPIN4C.js} +1 -7
- package/dist/chunk/{NMGUCD2L.jsx → TVCIHLER.jsx} +2 -11
- package/dist/chunk/{5CYHETDY.js → UIAQFG6P.js} +7 -7
- package/dist/chunk/{7PKUSZKY.jsx → USV2CYTP.jsx} +9 -9
- package/dist/chunk/{GXWVYON6.js → V2YBSJKS.js} +8 -10
- package/dist/chunk/{WQQVH7YG.jsx → VLUE7XIS.jsx} +34 -19
- package/dist/chunk/{TC2QHQ47.jsx → WPEIDU6T.jsx} +17 -42
- package/dist/chunk/{LCESUDZB.js → WRLQ7Y6E.js} +5 -13
- package/dist/chunk/{34MDPAG6.js → WT3OTYHP.js} +27 -11
- package/dist/chunk/{IOTZAUDA.jsx → WUTUKX4C.jsx} +1 -1
- package/dist/chunk/{DU4TY3XA.jsx → WZ7FNJXM.jsx} +11 -15
- package/dist/chunk/X34KVQNW.js +1 -1
- package/dist/chunk/{P7I44WC4.jsx → XHA6B6L2.jsx} +21 -22
- package/dist/chunk/{TOVWS5LG.jsx → XNZ7GOP4.jsx} +15 -24
- package/dist/chunk/{MYMGOYXH.js → XR4WJDUT.js} +2 -2
- package/dist/chunk/{SJSLQDBZ.jsx → YE6V66JY.jsx} +10 -18
- package/dist/chunk/{W43X4SNE.js → YS6KIHEB.js} +6 -6
- package/dist/chunk/{QZYE5W7T.jsx → ZOMTU4P2.jsx} +11 -19
- package/dist/components/accordion/index.d.ts +2 -7
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.jsx +7 -8
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.jsx +5 -6
- package/dist/components/carousel/index.d.ts +3 -8
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/index.jsx +5 -6
- package/dist/components/checkbox/index.d.ts +3 -8
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +8 -9
- package/dist/components/clipboard/index.d.ts +2 -2
- package/dist/components/clipboard/index.js +1 -1
- package/dist/components/clipboard/index.jsx +5 -6
- package/dist/components/collapsible/index.d.ts +2 -7
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/collapsible/index.jsx +6 -7
- 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 +4 -14
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.jsx +10 -10
- package/dist/components/combobox/index.d.ts +3 -13
- package/dist/components/combobox/index.js +2 -2
- package/dist/components/combobox/index.jsx +12 -12
- package/dist/components/date-picker/index.d.ts +4 -16
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-picker/index.jsx +7 -8
- package/dist/components/dialog/index.d.ts +3 -8
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.jsx +7 -8
- package/dist/components/editable/index.d.ts +2 -12
- package/dist/components/editable/index.js +1 -1
- package/dist/components/editable/index.jsx +8 -8
- package/dist/components/field/index.d.ts +2 -2
- package/dist/components/field/index.js +1 -1
- package/dist/components/field/index.jsx +4 -3
- package/dist/components/fieldset/index.d.ts +2 -2
- package/dist/components/fieldset/index.js +1 -1
- package/dist/components/fieldset/index.jsx +2 -2
- package/dist/components/file-upload/index.d.ts +2 -2
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/index.jsx +8 -8
- package/dist/components/focus-trap/index.d.ts +1 -1
- package/dist/components/format/index.js +1 -1
- package/dist/components/format/index.jsx +4 -5
- package/dist/components/frame/index.js +1 -1
- package/dist/components/frame/index.jsx +4 -5
- package/dist/components/hover-card/index.d.ts +3 -8
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/hover-card/index.jsx +7 -8
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +45 -45
- package/dist/components/index.jsx +295 -297
- package/dist/components/menu/index.d.ts +4 -9
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.jsx +7 -8
- package/dist/components/number-input/index.d.ts +2 -7
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/index.jsx +8 -8
- package/dist/components/pagination/index.d.ts +2 -7
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/index.jsx +5 -6
- package/dist/components/pin-input/index.d.ts +2 -7
- package/dist/components/pin-input/index.js +1 -1
- package/dist/components/pin-input/index.jsx +8 -8
- package/dist/components/popover/index.d.ts +3 -8
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.jsx +7 -8
- package/dist/components/presence/index.d.ts +2 -2
- package/dist/components/presence/index.js +1 -1
- package/dist/components/presence/index.jsx +3 -3
- package/dist/components/progress/index.d.ts +2 -7
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/index.jsx +5 -6
- package/dist/components/qr-code/index.d.ts +2 -7
- package/dist/components/qr-code/index.js +1 -1
- package/dist/components/qr-code/index.jsx +5 -6
- package/dist/components/radio-group/index.d.ts +2 -7
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/radio-group/index.jsx +5 -6
- package/dist/components/rating-group/index.d.ts +5 -10
- package/dist/components/rating-group/index.js +1 -1
- package/dist/components/rating-group/index.jsx +8 -8
- package/dist/components/segment-group/index.d.ts +3 -8
- package/dist/components/segment-group/index.js +1 -1
- package/dist/components/segment-group/index.jsx +5 -6
- package/dist/components/select/index.d.ts +3 -13
- package/dist/components/select/index.js +2 -2
- package/dist/components/select/index.jsx +12 -12
- package/dist/components/signature-pad/index.d.ts +2 -2
- package/dist/components/signature-pad/index.js +1 -1
- package/dist/components/signature-pad/index.jsx +8 -8
- package/dist/components/slider/index.d.ts +3 -8
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.jsx +5 -6
- package/dist/components/splitter/index.d.ts +3 -8
- package/dist/components/splitter/index.js +1 -1
- package/dist/components/splitter/index.jsx +5 -6
- package/dist/components/steps/index.d.ts +6 -10
- package/dist/components/steps/index.js +1 -1
- package/dist/components/steps/index.jsx +5 -6
- package/dist/components/switch/index.d.ts +2 -7
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.jsx +8 -8
- package/dist/components/tabs/index.d.ts +2 -7
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.jsx +7 -8
- package/dist/components/tags-input/index.d.ts +2 -7
- package/dist/components/tags-input/index.js +1 -1
- package/dist/components/tags-input/index.jsx +8 -8
- package/dist/components/time-picker/index.d.ts +3 -13
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/time-picker/index.jsx +7 -8
- package/dist/components/timer/index.d.ts +2 -2
- package/dist/components/timer/index.js +1 -1
- package/dist/components/timer/index.jsx +5 -6
- package/dist/components/toast/index.d.ts +6 -7
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toast/index.jsx +5 -2
- package/dist/components/toggle/index.d.ts +5 -34
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/toggle/index.jsx +2 -4
- package/dist/components/toggle-group/index.d.ts +3 -8
- package/dist/components/toggle-group/index.js +1 -1
- package/dist/components/toggle-group/index.jsx +5 -6
- package/dist/components/tooltip/index.d.ts +3 -8
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.jsx +7 -8
- package/dist/components/tour/index.d.ts +4 -4
- package/dist/components/tour/index.js +1 -1
- package/dist/components/tour/index.jsx +7 -8
- package/dist/components/tree-view/index.d.ts +6 -16
- package/dist/components/tree-view/index.js +2 -2
- package/dist/components/tree-view/index.jsx +9 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +47 -47
- package/dist/index.jsx +295 -297
- package/dist/providers/environment/index.js +1 -1
- package/dist/providers/environment/index.jsx +2 -3
- package/dist/providers/index.js +2 -2
- package/dist/providers/index.jsx +3 -4
- package/dist/providers/locale/index.js +1 -1
- package/dist/providers/locale/index.jsx +2 -2
- package/dist/{use-presence-Ct1onT3-.d.ts → use-presence-C07V_WCb.d.ts} +1 -1
- 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/DT73WLR4.js +0 -5
- package/dist/chunk/JHG4EID2.jsx +0 -233
- package/dist/chunk/KGOB2IMX.jsx +0 -7
- package/dist/chunk/MV3KTL7M.js +0 -107
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
splitPresenceProps,
|
|
4
4
|
usePresence,
|
|
5
5
|
usePresenceContext
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./2FYSIKNK.jsx";
|
|
7
7
|
import {
|
|
8
8
|
createSplitProps
|
|
9
9
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -12,13 +12,13 @@ import {
|
|
|
12
12
|
} from "./UFYZ7HLU.jsx";
|
|
13
13
|
import {
|
|
14
14
|
useEnvironmentContext
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./BPYAMTER.jsx";
|
|
16
16
|
import {
|
|
17
17
|
useLocaleContext
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./RCXMZN3G.jsx";
|
|
19
19
|
import {
|
|
20
20
|
createContext
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./TVCIHLER.jsx";
|
|
22
22
|
import {
|
|
23
23
|
__export
|
|
24
24
|
} from "./7IUG3E2V.jsx";
|
|
@@ -86,19 +86,17 @@ import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
|
86
86
|
import * as tooltip from "@zag-js/tooltip";
|
|
87
87
|
import { createMemo, createUniqueId } from "solid-js";
|
|
88
88
|
var useTooltip = (props = {}) => {
|
|
89
|
+
const id = createUniqueId();
|
|
89
90
|
const locale = useLocaleContext();
|
|
90
91
|
const environment = useEnvironmentContext();
|
|
91
|
-
const
|
|
92
|
-
const context = createMemo(() => ({
|
|
92
|
+
const machineProps = createMemo(() => ({
|
|
93
93
|
id,
|
|
94
94
|
dir: locale().dir,
|
|
95
95
|
getRootNode: environment().getRootNode,
|
|
96
|
-
open: props.defaultOpen,
|
|
97
|
-
"open.controlled": props.open !== void 0,
|
|
98
96
|
...props
|
|
99
97
|
}));
|
|
100
|
-
const
|
|
101
|
-
return createMemo(() => tooltip.connect(
|
|
98
|
+
const service = useMachine(tooltip.machine, machineProps);
|
|
99
|
+
return createMemo(() => tooltip.connect(service, normalizeProps));
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
// src/components/tooltip/tooltip-root.tsx
|
|
@@ -132,9 +130,7 @@ var TooltipRoot = (props) => {
|
|
|
132
130
|
import { mergeProps as mergeProps6 } from "@zag-js/solid";
|
|
133
131
|
var TooltipRootProvider = (props) => {
|
|
134
132
|
const [presenceProps, tooltipProps] = splitPresenceProps(props);
|
|
135
|
-
const presence = usePresence(
|
|
136
|
-
mergeProps6(presenceProps, () => ({ present: tooltipProps.value().open }))
|
|
137
|
-
);
|
|
133
|
+
const presence = usePresence(mergeProps6(presenceProps, () => ({ present: tooltipProps.value().open })));
|
|
138
134
|
return <TooltipProvider value={tooltipProps.value}>
|
|
139
135
|
<PresenceProvider value={presence}>{tooltipProps.children}</PresenceProvider>
|
|
140
136
|
</TooltipProvider>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useFieldContext } from './
|
|
1
|
+
import { useFieldContext } from './KMFRZGLF.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 './6MQ6S5JP.js';
|
|
5
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
6
|
+
import { createContext } from './TROPIN4C.js';
|
|
7
7
|
import { __export } from './ESLJRKWD.js';
|
|
8
8
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
9
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -54,7 +54,7 @@ var useNumberInput = (props = {}) => {
|
|
|
54
54
|
const locale = useLocaleContext();
|
|
55
55
|
const environment = useEnvironmentContext();
|
|
56
56
|
const field = useFieldContext();
|
|
57
|
-
const
|
|
57
|
+
const machineProps = createMemo(() => ({
|
|
58
58
|
id,
|
|
59
59
|
ids: {
|
|
60
60
|
label: field?.().ids.label,
|
|
@@ -67,11 +67,10 @@ var useNumberInput = (props = {}) => {
|
|
|
67
67
|
dir: locale().dir,
|
|
68
68
|
locale: locale().locale,
|
|
69
69
|
getRootNode: environment().getRootNode,
|
|
70
|
-
value: props.defaultValue,
|
|
71
70
|
...props
|
|
72
71
|
}));
|
|
73
|
-
const
|
|
74
|
-
return createMemo(() => numberInput.connect(
|
|
72
|
+
const service = useMachine(numberInput.machine, machineProps);
|
|
73
|
+
return createMemo(() => numberInput.connect(service, normalizeProps));
|
|
75
74
|
};
|
|
76
75
|
|
|
77
76
|
// src/components/number-input/number-input-root.tsx
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./UFYZ7HLU.jsx";
|
|
7
7
|
import {
|
|
8
8
|
useEnvironmentContext
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./BPYAMTER.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
16
|
import {
|
|
17
17
|
__export
|
|
18
18
|
} from "./7IUG3E2V.jsx";
|
|
@@ -76,26 +76,28 @@ import * as progress from "@zag-js/progress";
|
|
|
76
76
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
77
77
|
import { createMemo, createUniqueId } from "solid-js";
|
|
78
78
|
var useProgress = (props = {}) => {
|
|
79
|
+
const id = createUniqueId();
|
|
79
80
|
const locale = useLocaleContext();
|
|
80
81
|
const environment = useEnvironmentContext();
|
|
81
|
-
const
|
|
82
|
-
const context = createMemo(() => ({
|
|
82
|
+
const machineProps = createMemo(() => ({
|
|
83
83
|
id,
|
|
84
84
|
dir: locale().dir,
|
|
85
|
+
locale: locale().locale,
|
|
85
86
|
getRootNode: environment().getRootNode,
|
|
86
|
-
value: props.defaultValue,
|
|
87
87
|
...props
|
|
88
88
|
}));
|
|
89
|
-
const
|
|
90
|
-
return createMemo(() => progress.connect(
|
|
89
|
+
const service = useMachine(progress.machine, machineProps);
|
|
90
|
+
return createMemo(() => progress.connect(service, normalizeProps));
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
// src/components/progress/progress-root.tsx
|
|
94
94
|
var ProgressRoot = (props) => {
|
|
95
95
|
const [progressProps, localProps] = createSplitProps()(props, [
|
|
96
96
|
"defaultValue",
|
|
97
|
+
"formatOptions",
|
|
97
98
|
"id",
|
|
98
99
|
"ids",
|
|
100
|
+
"locale",
|
|
99
101
|
"max",
|
|
100
102
|
"min",
|
|
101
103
|
"onValueChange",
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
} from "./UFYZ7HLU.jsx";
|
|
7
7
|
import {
|
|
8
8
|
useEnvironmentContext
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./BPYAMTER.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
16
|
import {
|
|
17
17
|
__export
|
|
18
18
|
} from "./7IUG3E2V.jsx";
|
|
@@ -48,9 +48,7 @@ var SliderDraggingIndicator = (props) => {
|
|
|
48
48
|
const slider2 = useSliderContext();
|
|
49
49
|
const thumbProps = useSliderThumbPropsContext();
|
|
50
50
|
const mergedProps = mergeProps2(() => slider2().getDraggingIndicatorProps(thumbProps), props);
|
|
51
|
-
return <ark.span {...mergedProps}>
|
|
52
|
-
{props.children || slider2().getThumbValue(thumbProps.index)}
|
|
53
|
-
</ark.span>;
|
|
51
|
+
return <ark.span {...mergedProps}>{props.children || slider2().getThumbValue(thumbProps.index)}</ark.span>;
|
|
54
52
|
};
|
|
55
53
|
|
|
56
54
|
// src/components/slider/slider-hidden-input.tsx
|
|
@@ -103,18 +101,17 @@ import * as slider from "@zag-js/slider";
|
|
|
103
101
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
104
102
|
import { createMemo, createUniqueId } from "solid-js";
|
|
105
103
|
var useSlider = (props = {}) => {
|
|
104
|
+
const id = createUniqueId();
|
|
106
105
|
const locale = useLocaleContext();
|
|
107
106
|
const environment = useEnvironmentContext();
|
|
108
|
-
const
|
|
109
|
-
const context = createMemo(() => ({
|
|
107
|
+
const machineProps = createMemo(() => ({
|
|
110
108
|
id,
|
|
111
109
|
dir: locale().dir,
|
|
112
110
|
getRootNode: environment().getRootNode,
|
|
113
|
-
value: props.defaultValue,
|
|
114
111
|
...props
|
|
115
112
|
}));
|
|
116
|
-
const
|
|
117
|
-
return createMemo(() => slider.connect(
|
|
113
|
+
const service = useMachine(slider.machine, machineProps);
|
|
114
|
+
return createMemo(() => slider.connect(service, normalizeProps));
|
|
118
115
|
};
|
|
119
116
|
|
|
120
117
|
// src/components/slider/slider-root.tsx
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './WRLQ7Y6E.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 './6MQ6S5JP.js';
|
|
5
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
6
|
+
import { createContext } from './TROPIN4C.js';
|
|
7
7
|
import { __export } from './ESLJRKWD.js';
|
|
8
8
|
import * as datePicker from '@zag-js/date-picker';
|
|
9
9
|
import { anatomy } from '@zag-js/date-picker';
|
|
10
10
|
export { parse } from '@zag-js/date-picker';
|
|
11
|
-
import { createComponent, mergeProps as mergeProps$1, insert, effect
|
|
11
|
+
import { createComponent, mergeProps as mergeProps$1, template, insert, effect } from 'solid-js/web';
|
|
12
12
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
13
|
-
import {
|
|
13
|
+
import { Index, createMemo, createUniqueId, Show } from 'solid-js';
|
|
14
14
|
|
|
15
15
|
// src/components/date-picker/use-date-picker-context.ts
|
|
16
16
|
var [DatePickerProvider, useDatePickerContext] = createContext({
|
|
@@ -127,27 +127,24 @@ var DatePickerRangeText = (props) => {
|
|
|
127
127
|
}));
|
|
128
128
|
};
|
|
129
129
|
var useDatePicker = (props = {}) => {
|
|
130
|
+
const id = createUniqueId();
|
|
130
131
|
const locale = useLocaleContext();
|
|
131
132
|
const environment = useEnvironmentContext();
|
|
132
|
-
const
|
|
133
|
-
const context = createMemo(() => ({
|
|
133
|
+
const machineProps = createMemo(() => ({
|
|
134
134
|
id,
|
|
135
135
|
dir: locale().dir,
|
|
136
|
+
locale: locale().locale,
|
|
136
137
|
getRootNode: environment().getRootNode,
|
|
137
|
-
open: props.defaultOpen,
|
|
138
|
-
"open.controlled": props.open !== void 0,
|
|
139
|
-
value: props.defaultValue,
|
|
140
|
-
view: props.defaultView,
|
|
141
138
|
...props
|
|
142
139
|
}));
|
|
143
|
-
const
|
|
144
|
-
return createMemo(() => datePicker.connect(
|
|
140
|
+
const service = useMachine(datePicker.machine, machineProps);
|
|
141
|
+
return createMemo(() => datePicker.connect(service, normalizeProps));
|
|
145
142
|
};
|
|
146
143
|
|
|
147
144
|
// src/components/date-picker/date-picker-root.tsx
|
|
148
145
|
var DatePickerRoot = (props) => {
|
|
149
146
|
const [presenceProps, datePickerProps] = splitPresenceProps(props);
|
|
150
|
-
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "defaultView", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "maxView", "min", "minView", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "parse", "placeholder", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
|
|
147
|
+
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultFocusedValue", "defaultOpen", "defaultValue", "defaultView", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "maxView", "min", "minView", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "parse", "placeholder", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
|
|
151
148
|
const api = useDatePicker(useDatePickerProps);
|
|
152
149
|
const apiPresence = usePresence(mergeProps(presenceProps, () => ({
|
|
153
150
|
present: api().open
|
|
@@ -5,13 +5,7 @@ function getErrorMessage(hook, provider) {
|
|
|
5
5
|
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
|
6
6
|
}
|
|
7
7
|
function createContext(options = {}) {
|
|
8
|
-
const {
|
|
9
|
-
strict = true,
|
|
10
|
-
hookName = "useContext",
|
|
11
|
-
providerName = "Provider",
|
|
12
|
-
errorMessage,
|
|
13
|
-
defaultValue
|
|
14
|
-
} = options;
|
|
8
|
+
const { strict = true, hookName = "useContext", providerName = "Provider", errorMessage, defaultValue } = options;
|
|
15
9
|
const Context = createContext$1(defaultValue);
|
|
16
10
|
function useContext$1() {
|
|
17
11
|
const context = useContext(Context);
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
// src/utils/create-context.ts
|
|
2
|
-
import {
|
|
3
|
-
createContext as createSolidContext,
|
|
4
|
-
useContext as useSolidContext
|
|
5
|
-
} from "solid-js";
|
|
2
|
+
import { createContext as createSolidContext, useContext as useSolidContext } from "solid-js";
|
|
6
3
|
function getErrorMessage(hook, provider) {
|
|
7
4
|
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
|
8
5
|
}
|
|
9
6
|
function createContext(options = {}) {
|
|
10
|
-
const {
|
|
11
|
-
strict = true,
|
|
12
|
-
hookName = "useContext",
|
|
13
|
-
providerName = "Provider",
|
|
14
|
-
errorMessage,
|
|
15
|
-
defaultValue
|
|
16
|
-
} = options;
|
|
7
|
+
const { strict = true, hookName = "useContext", providerName = "Provider", errorMessage, defaultValue } = options;
|
|
17
8
|
const Context = createSolidContext(defaultValue);
|
|
18
9
|
function useContext() {
|
|
19
10
|
const context = useSolidContext(Context);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSplitProps } from './ZMHI4GDJ.js';
|
|
2
2
|
import { ark } from './EPLBB4QN.js';
|
|
3
|
-
import { useEnvironmentContext } from './
|
|
4
|
-
import { createContext } from './
|
|
3
|
+
import { useEnvironmentContext } from './6MQ6S5JP.js';
|
|
4
|
+
import { createContext } from './TROPIN4C.js';
|
|
5
5
|
import { __export } from './ESLJRKWD.js';
|
|
6
6
|
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
7
7
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -56,20 +56,20 @@ var ClipboardLabel = (props) => {
|
|
|
56
56
|
return createComponent(ark.label, mergedProps);
|
|
57
57
|
};
|
|
58
58
|
var useClipboard = (props = {}) => {
|
|
59
|
-
const environment = useEnvironmentContext();
|
|
60
59
|
const id = createUniqueId();
|
|
61
|
-
const
|
|
60
|
+
const environment = useEnvironmentContext();
|
|
61
|
+
const machineProps = createMemo(() => ({
|
|
62
62
|
id,
|
|
63
63
|
getRootNode: environment().getRootNode,
|
|
64
64
|
...props
|
|
65
65
|
}));
|
|
66
|
-
const
|
|
67
|
-
return createMemo(() => clipboard.connect(
|
|
66
|
+
const service = useMachine(clipboard.machine, machineProps);
|
|
67
|
+
return createMemo(() => clipboard.connect(service, normalizeProps));
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
// src/components/clipboard/clipboard-root.tsx
|
|
71
71
|
var ClipboardRoot = (props) => {
|
|
72
|
-
const [useClipboardProps, localProps] = createSplitProps()(props, ["id", "ids", "onStatusChange", "timeout", "value"]);
|
|
72
|
+
const [useClipboardProps, localProps] = createSplitProps()(props, ["defaultValue", "id", "ids", "onStatusChange", "onValueChange", "timeout", "value"]);
|
|
73
73
|
const api = useClipboard(useClipboardProps);
|
|
74
74
|
const mergedProps = mergeProps(() => api().getRootProps(), localProps);
|
|
75
75
|
return createComponent(ClipboardProvider, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useFieldContext
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./XHA6B6L2.jsx";
|
|
4
4
|
import {
|
|
5
5
|
createSplitProps
|
|
6
6
|
} from "./6WEDGJKQ.jsx";
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
} from "./UFYZ7HLU.jsx";
|
|
10
10
|
import {
|
|
11
11
|
useEnvironmentContext
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./BPYAMTER.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
19
|
import {
|
|
20
20
|
__export
|
|
21
21
|
} from "./7IUG3E2V.jsx";
|
|
@@ -71,11 +71,11 @@ import * as pinInput from "@zag-js/pin-input";
|
|
|
71
71
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
72
72
|
import { createMemo, createUniqueId } from "solid-js";
|
|
73
73
|
var usePinInput = (props = {}) => {
|
|
74
|
+
const id = createUniqueId();
|
|
74
75
|
const locale = useLocaleContext();
|
|
75
76
|
const environment = useEnvironmentContext();
|
|
76
|
-
const id = createUniqueId();
|
|
77
77
|
const field = useFieldContext();
|
|
78
|
-
const
|
|
78
|
+
const machineProps = createMemo(() => ({
|
|
79
79
|
id,
|
|
80
80
|
ids: {
|
|
81
81
|
label: field?.().ids.label,
|
|
@@ -87,11 +87,10 @@ var usePinInput = (props = {}) => {
|
|
|
87
87
|
invalid: field?.().invalid,
|
|
88
88
|
dir: locale().dir,
|
|
89
89
|
getRootNode: environment().getRootNode,
|
|
90
|
-
value: props.defaultValue,
|
|
91
90
|
...props
|
|
92
91
|
}));
|
|
93
|
-
const
|
|
94
|
-
return createMemo(() => pinInput.connect(
|
|
92
|
+
const service = useMachine(pinInput.machine, machineProps);
|
|
93
|
+
return createMemo(() => pinInput.connect(service, normalizeProps));
|
|
95
94
|
};
|
|
96
95
|
|
|
97
96
|
// src/components/pin-input/pin-input-root.tsx
|
|
@@ -99,6 +98,7 @@ var PinInputRoot = (props) => {
|
|
|
99
98
|
const [usePinInputProps, localProps] = createSplitProps()(props, [
|
|
100
99
|
"autoFocus",
|
|
101
100
|
"blurOnComplete",
|
|
101
|
+
"count",
|
|
102
102
|
"defaultValue",
|
|
103
103
|
"disabled",
|
|
104
104
|
"form",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { splitPresenceProps, usePresence, PresenceProvider, usePresenceContext } from './WRLQ7Y6E.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 './6MQ6S5JP.js';
|
|
5
|
+
import { useLocaleContext } from './QEMQBM6W.js';
|
|
6
|
+
import { createContext } from './TROPIN4C.js';
|
|
7
7
|
import { __export } from './ESLJRKWD.js';
|
|
8
8
|
import { createComponent } from 'solid-js/web';
|
|
9
9
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
@@ -58,19 +58,17 @@ var TooltipPositioner = (props) => {
|
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
var useTooltip = (props = {}) => {
|
|
61
|
+
const id = createUniqueId();
|
|
61
62
|
const locale = useLocaleContext();
|
|
62
63
|
const environment = useEnvironmentContext();
|
|
63
|
-
const
|
|
64
|
-
const context = createMemo(() => ({
|
|
64
|
+
const machineProps = createMemo(() => ({
|
|
65
65
|
id,
|
|
66
66
|
dir: locale().dir,
|
|
67
67
|
getRootNode: environment().getRootNode,
|
|
68
|
-
open: props.defaultOpen,
|
|
69
|
-
"open.controlled": props.open !== void 0,
|
|
70
68
|
...props
|
|
71
69
|
}));
|
|
72
|
-
const
|
|
73
|
-
return createMemo(() => tooltip.connect(
|
|
70
|
+
const service = useMachine(tooltip.machine, machineProps);
|
|
71
|
+
return createMemo(() => tooltip.connect(service, normalizeProps));
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
// src/components/tooltip/tooltip-root.tsx
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ark
|
|
3
3
|
} from "./UFYZ7HLU.jsx";
|
|
4
|
+
import {
|
|
5
|
+
useEnvironmentContext
|
|
6
|
+
} from "./BPYAMTER.jsx";
|
|
7
|
+
import {
|
|
8
|
+
useLocaleContext
|
|
9
|
+
} from "./RCXMZN3G.jsx";
|
|
4
10
|
import {
|
|
5
11
|
createContext
|
|
6
|
-
} from "./
|
|
12
|
+
} from "./TVCIHLER.jsx";
|
|
7
13
|
import {
|
|
8
14
|
__export
|
|
9
15
|
} from "./7IUG3E2V.jsx";
|
|
10
16
|
|
|
11
17
|
// src/components/toast/create-toaster.tsx
|
|
12
|
-
import { normalizeProps } from "@zag-js/solid";
|
|
13
18
|
import * as toast from "@zag-js/toast";
|
|
14
19
|
var createToaster = (props) => {
|
|
15
|
-
|
|
16
|
-
const api = toast.group.connect(machine, machine.send, normalizeProps);
|
|
17
|
-
return { ...api, machine };
|
|
20
|
+
return toast.createStore(props);
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
// src/components/toast/toast-action-trigger.tsx
|
|
@@ -76,27 +79,39 @@ var ToastTitle = (props) => {
|
|
|
76
79
|
import { anatomy } from "@zag-js/toast";
|
|
77
80
|
|
|
78
81
|
// src/components/toast/toaster.tsx
|
|
79
|
-
import { mergeProps as mergeProps6, normalizeProps
|
|
82
|
+
import { Key, mergeProps as mergeProps6, normalizeProps, useMachine } from "@zag-js/solid";
|
|
80
83
|
import * as toast2 from "@zag-js/toast";
|
|
81
|
-
import {
|
|
84
|
+
import { createMemo, createUniqueId, splitProps } from "solid-js";
|
|
82
85
|
var Toaster = (props) => {
|
|
83
86
|
const [toasterProps, localProps] = splitProps(props, ["toaster", "children"]);
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
const locale = useLocaleContext();
|
|
88
|
+
const env = useEnvironmentContext();
|
|
89
|
+
const service = useMachine(toast2.group.machine, () => ({
|
|
90
|
+
store: toasterProps.toaster,
|
|
91
|
+
id: createUniqueId(),
|
|
92
|
+
dir: locale()?.dir,
|
|
93
|
+
getRootNode: () => env()?.getDocument()
|
|
94
|
+
}));
|
|
95
|
+
const api = createMemo(() => toast2.group.connect(service, normalizeProps));
|
|
96
|
+
const toasts = createMemo(() => api().getToasts());
|
|
97
|
+
const mergedProps = mergeProps6(api().getGroupProps(), localProps);
|
|
89
98
|
return <ark.div {...mergedProps}>
|
|
90
|
-
<
|
|
91
|
-
{(toast3) => <ToastActor value={toast3}
|
|
92
|
-
|
|
99
|
+
<Key each={toasts()} by="id">
|
|
100
|
+
{(toast3, index) => <ToastActor value={toast3} index={index} parent={service}>
|
|
101
|
+
{(ctx) => toasterProps.children(ctx)}
|
|
102
|
+
</ToastActor>}
|
|
103
|
+
</Key>
|
|
93
104
|
</ark.div>;
|
|
94
105
|
};
|
|
95
106
|
var ToastActor = (props) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
const localProps = createMemo(() => ({
|
|
108
|
+
...props.value(),
|
|
109
|
+
parent: props.parent,
|
|
110
|
+
index: props.index
|
|
111
|
+
}));
|
|
112
|
+
const service = useMachine(toast2.machine, localProps);
|
|
113
|
+
const api = createMemo(() => toast2.connect(service, normalizeProps));
|
|
114
|
+
return <ToastProvider value={api}>{props.children(props.value)}</ToastProvider>;
|
|
100
115
|
};
|
|
101
116
|
|
|
102
117
|
// src/components/toast/toast.ts
|
|
@@ -6,24 +6,22 @@ import {
|
|
|
6
6
|
} from "./UFYZ7HLU.jsx";
|
|
7
7
|
import {
|
|
8
8
|
useEnvironmentContext
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./BPYAMTER.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
16
|
import {
|
|
17
17
|
__export
|
|
18
18
|
} from "./7IUG3E2V.jsx";
|
|
19
19
|
|
|
20
20
|
// src/components/segment-group/use-segment-group-context.ts
|
|
21
|
-
var [SegmentGroupProvider, useSegmentGroupContext] = createContext(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
);
|
|
21
|
+
var [SegmentGroupProvider, useSegmentGroupContext] = createContext({
|
|
22
|
+
hookName: "useSegmentGroupContext",
|
|
23
|
+
providerName: "<SegmentGroupProvider />"
|
|
24
|
+
});
|
|
27
25
|
|
|
28
26
|
// src/components/segment-group/segment-group-context.tsx
|
|
29
27
|
var SegmentGroupContext = (props) => props.children(useSegmentGroupContext());
|
|
@@ -39,11 +37,7 @@ var parts = segmentGroupAnatomy.build();
|
|
|
39
37
|
// src/components/segment-group/segment-group-indicator.tsx
|
|
40
38
|
var SegmentGroupIndicator = (props) => {
|
|
41
39
|
const segmentGroup2 = useSegmentGroupContext();
|
|
42
|
-
const mergedProps = mergeProps(
|
|
43
|
-
() => segmentGroup2().getIndicatorProps(),
|
|
44
|
-
parts.indicator.attrs,
|
|
45
|
-
props
|
|
46
|
-
);
|
|
40
|
+
const mergedProps = mergeProps(() => segmentGroup2().getIndicatorProps(), parts.indicator.attrs, props);
|
|
47
41
|
return <ark.div {...mergedProps} />;
|
|
48
42
|
};
|
|
49
43
|
|
|
@@ -65,17 +59,9 @@ var [SegmentGroupItemPropsProvider, useSegmentGroupItemPropsContext] = createCon
|
|
|
65
59
|
|
|
66
60
|
// src/components/segment-group/segment-group-item.tsx
|
|
67
61
|
var SegmentGroupItem = (props) => {
|
|
68
|
-
const [itemProps, localProps] = createSplitProps()(props, [
|
|
69
|
-
"value",
|
|
70
|
-
"disabled",
|
|
71
|
-
"invalid"
|
|
72
|
-
]);
|
|
62
|
+
const [itemProps, localProps] = createSplitProps()(props, ["value", "disabled", "invalid"]);
|
|
73
63
|
const segmentGroup2 = useSegmentGroupContext();
|
|
74
|
-
const mergedProps = mergeProps2(
|
|
75
|
-
() => segmentGroup2().getItemProps(itemProps),
|
|
76
|
-
parts.item.attrs,
|
|
77
|
-
localProps
|
|
78
|
-
);
|
|
64
|
+
const mergedProps = mergeProps2(() => segmentGroup2().getItemProps(itemProps), parts.item.attrs, localProps);
|
|
79
65
|
const itemState = createMemo(() => segmentGroup2().getItemState(itemProps));
|
|
80
66
|
return <SegmentGroupItemPropsProvider value={itemProps}>
|
|
81
67
|
<SegmentGroupItemProvider value={itemState}>
|
|
@@ -92,11 +78,7 @@ import { mergeProps as mergeProps3 } from "@zag-js/solid";
|
|
|
92
78
|
var SegmentGroupItemControl = (props) => {
|
|
93
79
|
const segmentGroup2 = useSegmentGroupContext();
|
|
94
80
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
95
|
-
const mergedProps = mergeProps3(
|
|
96
|
-
() => segmentGroup2().getItemControlProps(itemProps),
|
|
97
|
-
parts.itemControl.attrs,
|
|
98
|
-
props
|
|
99
|
-
);
|
|
81
|
+
const mergedProps = mergeProps3(() => segmentGroup2().getItemControlProps(itemProps), parts.itemControl.attrs, props);
|
|
100
82
|
return <ark.div {...mergedProps} />;
|
|
101
83
|
};
|
|
102
84
|
|
|
@@ -114,11 +96,7 @@ import { mergeProps as mergeProps5 } from "@zag-js/solid";
|
|
|
114
96
|
var SegmentGroupItemText = (props) => {
|
|
115
97
|
const segmentGroup2 = useSegmentGroupContext();
|
|
116
98
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
117
|
-
const mergedProps = mergeProps5(
|
|
118
|
-
() => segmentGroup2().getItemTextProps(itemProps),
|
|
119
|
-
parts.itemText.attrs,
|
|
120
|
-
props
|
|
121
|
-
);
|
|
99
|
+
const mergedProps = mergeProps5(() => segmentGroup2().getItemTextProps(itemProps), parts.itemText.attrs, props);
|
|
122
100
|
return <ark.span {...mergedProps} />;
|
|
123
101
|
};
|
|
124
102
|
|
|
@@ -138,18 +116,17 @@ import * as segmentGroup from "@zag-js/radio-group";
|
|
|
138
116
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
139
117
|
import { createMemo as createMemo2, createUniqueId } from "solid-js";
|
|
140
118
|
var useSegmentGroup = (props = {}) => {
|
|
119
|
+
const id = createUniqueId();
|
|
141
120
|
const locale = useLocaleContext();
|
|
142
121
|
const environment = useEnvironmentContext();
|
|
143
|
-
const
|
|
144
|
-
const context = createMemo2(() => ({
|
|
122
|
+
const machineProps = createMemo2(() => ({
|
|
145
123
|
id,
|
|
146
124
|
dir: locale().dir,
|
|
147
125
|
getRootNode: environment().getRootNode,
|
|
148
|
-
value: props.defaultValue,
|
|
149
126
|
...props
|
|
150
127
|
}));
|
|
151
|
-
const
|
|
152
|
-
return createMemo2(() => segmentGroup.connect(
|
|
128
|
+
const service = useMachine(segmentGroup.machine, machineProps);
|
|
129
|
+
return createMemo2(() => segmentGroup.connect(service, normalizeProps));
|
|
153
130
|
};
|
|
154
131
|
|
|
155
132
|
// src/components/segment-group/segment-group-root.tsx
|
|
@@ -176,9 +153,7 @@ var SegmentGroupRoot = (props) => {
|
|
|
176
153
|
// src/components/segment-group/segment-group-root-provider.tsx
|
|
177
154
|
import { mergeProps as mergeProps8 } from "@zag-js/solid";
|
|
178
155
|
var SegmentGroupRootProvider = (props) => {
|
|
179
|
-
const [{ value: segmentGroup2 }, localProps] = createSplitProps()(props, [
|
|
180
|
-
"value"
|
|
181
|
-
]);
|
|
156
|
+
const [{ value: segmentGroup2 }, localProps] = createSplitProps()(props, ["value"]);
|
|
182
157
|
const mergedProps = mergeProps8(() => segmentGroup2().getRootProps(), parts.root.attrs, localProps);
|
|
183
158
|
return <SegmentGroupProvider value={segmentGroup2}>
|
|
184
159
|
<ark.div {...mergedProps} />
|