@ark-ui/solid 4.5.1 → 4.7.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/dist/chunk/{WLTUCUPQ.js → 34GYXRNO.js} +3 -3
- package/dist/chunk/{U3XJZI3X.jsx → 3QKT7KP4.jsx} +4 -4
- package/dist/chunk/{BNMRTYLU.js → 3XNNMNPS.js} +16 -16
- package/dist/chunk/{QXDC5XNT.js → A7PQQPGA.js} +2 -1
- package/dist/chunk/{LKR2OLFB.jsx → ALKUQIFY.jsx} +5 -4
- package/dist/chunk/{DLHPAHCZ.js → CTTG4GSG.js} +5 -5
- package/dist/chunk/{3FIYNI67.jsx → EZ7NDY7U.jsx} +55 -46
- package/dist/chunk/{EDCPFD3E.jsx → JHG4EID2.jsx} +14 -37
- package/dist/chunk/{UMKKXI44.js → LUJELJ42.js} +2 -1
- package/dist/chunk/{OJIFQ4RX.jsx → NEI5JM4A.jsx} +6 -6
- package/dist/chunk/{VQXL4BNM.js → QVBQZJF6.js} +1 -1
- package/dist/chunk/{SJSLQDBZ.jsx → RSBH7AZU.jsx} +4 -4
- package/dist/chunk/{PZ7VV7UF.jsx → TEZSUL43.jsx} +6 -3
- package/dist/chunk/{I2O7XPVI.jsx → Y37DXSEE.jsx} +3 -4
- package/dist/components/accordion/index.jsx +3 -3
- package/dist/components/avatar/index.jsx +2 -2
- package/dist/components/carousel/index.d.ts +16 -17
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/index.jsx +6 -6
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.jsx +2 -2
- package/dist/components/clipboard/index.jsx +1 -1
- package/dist/components/collapsible/index.jsx +2 -2
- package/dist/components/collection.js +1 -1
- package/dist/components/collection.jsx +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.jsx +2 -2
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.jsx +3 -3
- package/dist/components/date-picker/index.d.ts +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-picker/index.jsx +2 -2
- package/dist/components/dialog/index.jsx +2 -2
- package/dist/components/editable/index.jsx +2 -2
- package/dist/components/file-upload/index.d.ts +4 -3
- package/dist/components/file-upload/index.jsx +2 -2
- package/dist/components/format/index.jsx +1 -1
- package/dist/components/frame/index.jsx +1 -1
- package/dist/components/hover-card/index.jsx +2 -2
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +8 -8
- package/dist/components/index.jsx +147 -145
- package/dist/components/menu/index.jsx +2 -2
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/index.jsx +2 -2
- package/dist/components/pagination/index.jsx +2 -2
- package/dist/components/pin-input/index.jsx +2 -2
- package/dist/components/popover/index.jsx +2 -2
- package/dist/components/progress/index.jsx +2 -2
- package/dist/components/qr-code/index.jsx +2 -2
- package/dist/components/radio-group/index.jsx +2 -2
- package/dist/components/rating-group/index.jsx +2 -2
- package/dist/components/segment-group/index.d.ts +1 -1
- package/dist/components/segment-group/index.jsx +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.jsx +3 -3
- package/dist/components/signature-pad/index.jsx +2 -2
- package/dist/components/slider/index.jsx +2 -2
- package/dist/components/splitter/index.jsx +2 -2
- package/dist/components/steps/index.jsx +2 -2
- package/dist/components/switch/index.jsx +2 -2
- package/dist/components/tabs/index.jsx +2 -2
- package/dist/components/tags-input/index.jsx +2 -2
- package/dist/components/time-picker/index.jsx +2 -2
- package/dist/components/timer/index.jsx +1 -1
- package/dist/components/toggle-group/index.jsx +2 -2
- package/dist/components/tooltip/index.jsx +2 -2
- package/dist/components/tree-view/index.d.ts +2 -2
- package/dist/components/tree-view/index.js +1 -1
- package/dist/components/tree-view/index.jsx +6 -4
- package/dist/index.d.ts +6 -6
- package/dist/index.js +8 -8
- package/dist/index.jsx +150 -148
- package/dist/providers/environment/index.d.ts +3 -3
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.jsx +4 -4
- package/package.json +60 -58
- package/dist/chunk/{H4RSHLA7.jsx → 4ICFJW2D.jsx} +3 -3
- package/dist/chunk/{5D3VKQUP.jsx → 4TNW4LNT.jsx} +3 -3
- package/dist/chunk/{TC2QHQ47.jsx → 6EY2Z73Y.jsx} +3 -3
- package/dist/chunk/{GZVCPLKK.jsx → 6GRTONVL.jsx} +3 -3
- package/dist/chunk/{GVRRR27D.jsx → AZBVL3C5.jsx} +3 -3
- package/dist/chunk/{ZYF7ARA6.jsx → CLZWNSRO.jsx} +3 -3
- package/dist/chunk/{K54W24N6.jsx → CRUV7XPV.jsx} +3 -3
- package/dist/chunk/{DPD4MXVK.jsx → CUHGQRR2.jsx} +3 -3
- package/dist/chunk/{RCK6LCJM.jsx → FNDB3E7F.jsx} +3 -3
- package/dist/chunk/{MRQ2UYM4.jsx → GRSRDWXO.jsx} +3 -3
- package/dist/chunk/{WIVXL7HJ.jsx → HQFEUYOV.jsx} +3 -3
- package/dist/chunk/{XAGJ7THJ.jsx → HXSFGTUH.jsx} +3 -3
- package/dist/chunk/{U7SPBSDD.jsx → LKZXE4D5.jsx} +3 -3
- package/dist/chunk/{G5HP7OCK.jsx → LMMNUVZG.jsx} +3 -3
- package/dist/chunk/{B7LE23PE.jsx → PQ3UNZE4.jsx} +3 -3
- package/dist/chunk/{3NSM24PL.jsx → PSWXIR5X.jsx} +3 -3
- package/dist/chunk/{LMVEWAVV.jsx → PZDCODVM.jsx} +3 -3
- package/dist/chunk/{AIQFNVCU.jsx → Q3STMYMV.jsx} +3 -3
- package/dist/chunk/{ABKUD4N7.jsx → R5ZNIQWU.jsx} +3 -3
- package/dist/chunk/{IZC6PKGT.jsx → T7DQP6DT.jsx} +3 -3
- package/dist/chunk/{6L7HNED6.jsx → U6PDXLCA.jsx} +3 -3
- package/dist/chunk/{DT5WVDUV.jsx → UYIC346K.jsx} +3 -3
- package/dist/chunk/{ZC6KWJ4T.jsx → VI2C2YY7.jsx} +3 -3
- package/dist/chunk/{X55ROW75.jsx → YJZDRWMW.jsx} +3 -3
- package/dist/chunk/{CPMYIT5J.jsx → YQ7OK72K.jsx} +3 -3
- package/dist/chunk/{BY62F4IV.jsx → ZSWRRXUI.jsx} +3 -3
- package/dist/chunk/{MARFWGWI.jsx → ZX3QOLR2.jsx} +3 -3
|
@@ -27,7 +27,7 @@ var CheckboxControl = (props) => {
|
|
|
27
27
|
};
|
|
28
28
|
var checkboxAnatomy = anatomy.extendWith("group");
|
|
29
29
|
function useCheckboxGroup(props = {}) {
|
|
30
|
-
const
|
|
30
|
+
const interactive = createMemo(() => !(props.disabled || props.readOnly));
|
|
31
31
|
const [value, setValue] = useControllableState({
|
|
32
32
|
value: props.value,
|
|
33
33
|
defaultValue: props.defaultValue || [],
|
|
@@ -41,12 +41,12 @@ function useCheckboxGroup(props = {}) {
|
|
|
41
41
|
isChecked(val) ? removeValue(val) : addValue(val);
|
|
42
42
|
};
|
|
43
43
|
const addValue = (val) => {
|
|
44
|
-
if (!
|
|
44
|
+
if (!interactive()) return;
|
|
45
45
|
if (isChecked(val)) return;
|
|
46
46
|
setValue(value().concat(val));
|
|
47
47
|
};
|
|
48
48
|
const removeValue = (val) => {
|
|
49
|
-
if (!
|
|
49
|
+
if (!interactive()) return;
|
|
50
50
|
setValue(value().filter((v) => String(v) !== String(val)));
|
|
51
51
|
};
|
|
52
52
|
const getItemProps = (itemProps) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collapsible_exports
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./PQ3UNZE4.jsx";
|
|
4
4
|
import {
|
|
5
5
|
RenderStrategyProvider,
|
|
6
6
|
splitRenderStrategyProps,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
ark
|
|
14
14
|
} from "./UFYZ7HLU.jsx";
|
|
15
|
-
import {
|
|
16
|
-
useEnvironmentContext
|
|
17
|
-
} from "./5O4RWSWO.jsx";
|
|
18
15
|
import {
|
|
19
16
|
useLocaleContext
|
|
20
17
|
} from "./3QQZKR3F.jsx";
|
|
18
|
+
import {
|
|
19
|
+
useEnvironmentContext
|
|
20
|
+
} from "./5O4RWSWO.jsx";
|
|
21
21
|
import {
|
|
22
22
|
createContext
|
|
23
23
|
} from "./NMGUCD2L.jsx";
|
|
@@ -7,7 +7,7 @@ import { __export } from './ESLJRKWD.js';
|
|
|
7
7
|
import { createComponent } from 'solid-js/web';
|
|
8
8
|
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
9
9
|
import * as carousel from '@zag-js/carousel';
|
|
10
|
-
|
|
10
|
+
export { anatomy } from '@zag-js/carousel';
|
|
11
11
|
import { createUniqueId, createMemo } from 'solid-js';
|
|
12
12
|
|
|
13
13
|
// src/components/carousel/use-carousel-context.ts
|
|
@@ -16,13 +16,18 @@ var [CarouselProvider, useCarouselContext] = createContext({
|
|
|
16
16
|
providerName: "<CarouselProvider />"
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
// src/components/carousel/carousel-autoplay-trigger.tsx
|
|
20
|
+
var CarouselAutoplayTrigger = (props) => {
|
|
21
|
+
const api = useCarouselContext();
|
|
22
|
+
const mergedProps = mergeProps(() => api().getAutoplayTriggerProps(), props);
|
|
23
|
+
return createComponent(ark.button, mergedProps);
|
|
24
|
+
};
|
|
25
|
+
|
|
19
26
|
// src/components/carousel/carousel-context.tsx
|
|
20
27
|
var CarouselContext = (props) => props.children(useCarouselContext());
|
|
21
|
-
var carouselAnatomy = anatomy.extendWith("control");
|
|
22
|
-
|
|
23
|
-
// src/components/carousel/carousel-control.tsx
|
|
24
28
|
var CarouselControl = (props) => {
|
|
25
|
-
const
|
|
29
|
+
const api = useCarouselContext();
|
|
30
|
+
const mergedProps = mergeProps(() => api().getControlProps(), props);
|
|
26
31
|
return createComponent(ark.div, mergedProps);
|
|
27
32
|
};
|
|
28
33
|
var CarouselIndicator = (props) => {
|
|
@@ -37,7 +42,7 @@ var CarouselIndicatorGroup = (props) => {
|
|
|
37
42
|
return createComponent(ark.div, mergedProps);
|
|
38
43
|
};
|
|
39
44
|
var CarouselItem = (props) => {
|
|
40
|
-
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
45
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index", "snapAlign"]);
|
|
41
46
|
const api = useCarouselContext();
|
|
42
47
|
const mergedProps = mergeProps(() => api().getItemProps(itemProps), localProps);
|
|
43
48
|
return createComponent(ark.div, mergedProps);
|
|
@@ -65,7 +70,7 @@ var useCarousel = (props = {}) => {
|
|
|
65
70
|
id,
|
|
66
71
|
dir: locale().dir,
|
|
67
72
|
getRootNode: environment().getRootNode,
|
|
68
|
-
index: props.
|
|
73
|
+
index: props.defaultPage,
|
|
69
74
|
...props
|
|
70
75
|
}));
|
|
71
76
|
const [state, send] = useMachine(carousel.machine(context()), { context });
|
|
@@ -74,7 +79,7 @@ var useCarousel = (props = {}) => {
|
|
|
74
79
|
|
|
75
80
|
// src/components/carousel/carousel-root.tsx
|
|
76
81
|
var CarouselRoot = (props) => {
|
|
77
|
-
const [useCarouselProps, localProps] = createSplitProps()(props, ["
|
|
82
|
+
const [useCarouselProps, localProps] = createSplitProps()(props, ["allowMouseDrag", "autoplay", "defaultPage", "id", "ids", "inViewThreshold", "loop", "onAutoplayStatusChange", "onDragStatusChange", "onPageChange", "orientation", "padding", "page", "slideCount", "slidesPerMove", "slidesPerPage", "snapType", "spacing", "translations"]);
|
|
78
83
|
const api = useCarousel(useCarouselProps);
|
|
79
84
|
const mergedProps = mergeProps(() => api().getRootProps(), localProps);
|
|
80
85
|
return createComponent(CarouselProvider, {
|
|
@@ -96,15 +101,11 @@ var CarouselRootProvider = (props) => {
|
|
|
96
101
|
}
|
|
97
102
|
});
|
|
98
103
|
};
|
|
99
|
-
var CarouselViewport = (props) => {
|
|
100
|
-
const api = useCarouselContext();
|
|
101
|
-
const mergedProps = mergeProps(() => api().getViewportProps(), props);
|
|
102
|
-
return createComponent(ark.div, mergedProps);
|
|
103
|
-
};
|
|
104
104
|
|
|
105
105
|
// src/components/carousel/carousel.ts
|
|
106
106
|
var carousel_exports = {};
|
|
107
107
|
__export(carousel_exports, {
|
|
108
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
108
109
|
Context: () => CarouselContext,
|
|
109
110
|
Control: () => CarouselControl,
|
|
110
111
|
Indicator: () => CarouselIndicator,
|
|
@@ -114,8 +115,7 @@ __export(carousel_exports, {
|
|
|
114
115
|
NextTrigger: () => CarouselNextTrigger,
|
|
115
116
|
PrevTrigger: () => CarouselPrevTrigger,
|
|
116
117
|
Root: () => CarouselRoot,
|
|
117
|
-
RootProvider: () => CarouselRootProvider
|
|
118
|
-
Viewport: () => CarouselViewport
|
|
118
|
+
RootProvider: () => CarouselRootProvider
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
export { CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselRoot, CarouselRootProvider,
|
|
121
|
+
export { CarouselAutoplayTrigger, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselRoot, CarouselRootProvider, carousel_exports, useCarousel, useCarouselContext };
|
|
@@ -50,9 +50,9 @@ var NumberInputLabel = (props) => {
|
|
|
50
50
|
return createComponent(ark.label, mergedProps);
|
|
51
51
|
};
|
|
52
52
|
var useNumberInput = (props = {}) => {
|
|
53
|
+
const id = createUniqueId();
|
|
53
54
|
const locale = useLocaleContext();
|
|
54
55
|
const environment = useEnvironmentContext();
|
|
55
|
-
const id = createUniqueId();
|
|
56
56
|
const field = useFieldContext();
|
|
57
57
|
const context = createMemo(() => ({
|
|
58
58
|
id,
|
|
@@ -65,6 +65,7 @@ var useNumberInput = (props = {}) => {
|
|
|
65
65
|
required: field?.().required,
|
|
66
66
|
invalid: field?.().invalid,
|
|
67
67
|
dir: locale().dir,
|
|
68
|
+
locale: locale().locale,
|
|
68
69
|
getRootNode: environment().getRootNode,
|
|
69
70
|
value: props.defaultValue,
|
|
70
71
|
...props
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
ark
|
|
9
9
|
} from "./UFYZ7HLU.jsx";
|
|
10
|
-
import {
|
|
11
|
-
useEnvironmentContext
|
|
12
|
-
} from "./5O4RWSWO.jsx";
|
|
13
10
|
import {
|
|
14
11
|
useLocaleContext
|
|
15
12
|
} from "./3QQZKR3F.jsx";
|
|
13
|
+
import {
|
|
14
|
+
useEnvironmentContext
|
|
15
|
+
} from "./5O4RWSWO.jsx";
|
|
16
16
|
import {
|
|
17
17
|
createContext
|
|
18
18
|
} from "./NMGUCD2L.jsx";
|
|
@@ -78,9 +78,9 @@ import * as numberInput from "@zag-js/number-input";
|
|
|
78
78
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
79
79
|
import { createMemo, createUniqueId } from "solid-js";
|
|
80
80
|
var useNumberInput = (props = {}) => {
|
|
81
|
+
const id = createUniqueId();
|
|
81
82
|
const locale = useLocaleContext();
|
|
82
83
|
const environment = useEnvironmentContext();
|
|
83
|
-
const id = createUniqueId();
|
|
84
84
|
const field = useFieldContext();
|
|
85
85
|
const context = createMemo(() => ({
|
|
86
86
|
id,
|
|
@@ -93,6 +93,7 @@ var useNumberInput = (props = {}) => {
|
|
|
93
93
|
required: field?.().required,
|
|
94
94
|
invalid: field?.().invalid,
|
|
95
95
|
dir: locale().dir,
|
|
96
|
+
locale: locale().locale,
|
|
96
97
|
getRootNode: environment().getRootNode,
|
|
97
98
|
value: props.defaultValue,
|
|
98
99
|
...props
|
|
@@ -3,20 +3,20 @@ import { ListCollection, TreeCollection, filePathToTree } from '@zag-js/collecti
|
|
|
3
3
|
// src/components/collection.ts
|
|
4
4
|
|
|
5
5
|
// ../../node_modules/@zag-js/store/dist/index.mjs
|
|
6
|
-
function
|
|
6
|
+
function glob() {
|
|
7
7
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
8
8
|
if (typeof self !== "undefined") return self;
|
|
9
9
|
if (typeof window !== "undefined") return window;
|
|
10
10
|
if (typeof global !== "undefined") return global;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const g =
|
|
12
|
+
function globalRef(key, value) {
|
|
13
|
+
const g = glob();
|
|
14
14
|
if (!g) return value();
|
|
15
15
|
g[key] || (g[key] = value());
|
|
16
16
|
return g[key];
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var refSet = globalRef("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
|
19
|
+
globalRef("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
20
20
|
function ref(obj) {
|
|
21
21
|
refSet.add(obj);
|
|
22
22
|
return obj;
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
ark
|
|
6
6
|
} from "./UFYZ7HLU.jsx";
|
|
7
|
-
import {
|
|
8
|
-
useEnvironmentContext
|
|
9
|
-
} from "./5O4RWSWO.jsx";
|
|
10
7
|
import {
|
|
11
8
|
useLocaleContext
|
|
12
9
|
} from "./3QQZKR3F.jsx";
|
|
10
|
+
import {
|
|
11
|
+
useEnvironmentContext
|
|
12
|
+
} from "./5O4RWSWO.jsx";
|
|
13
13
|
import {
|
|
14
14
|
createContext
|
|
15
15
|
} from "./NMGUCD2L.jsx";
|
|
@@ -17,83 +17,88 @@ import {
|
|
|
17
17
|
__export
|
|
18
18
|
} from "./7IUG3E2V.jsx";
|
|
19
19
|
|
|
20
|
+
// src/components/carousel/carousel-autoplay-trigger.tsx
|
|
21
|
+
import { mergeProps } from "@zag-js/solid";
|
|
22
|
+
|
|
20
23
|
// src/components/carousel/use-carousel-context.ts
|
|
21
24
|
var [CarouselProvider, useCarouselContext] = createContext({
|
|
22
25
|
hookName: "useCarouselContext",
|
|
23
26
|
providerName: "<CarouselProvider />"
|
|
24
27
|
});
|
|
25
28
|
|
|
29
|
+
// src/components/carousel/carousel-autoplay-trigger.tsx
|
|
30
|
+
var CarouselAutoplayTrigger = (props) => {
|
|
31
|
+
const api = useCarouselContext();
|
|
32
|
+
const mergedProps = mergeProps(() => api().getAutoplayTriggerProps(), props);
|
|
33
|
+
return <ark.button {...mergedProps} />;
|
|
34
|
+
};
|
|
35
|
+
|
|
26
36
|
// src/components/carousel/carousel-context.tsx
|
|
27
37
|
var CarouselContext = (props) => props.children(useCarouselContext());
|
|
28
38
|
|
|
29
39
|
// src/components/carousel/carousel-control.tsx
|
|
30
|
-
import { mergeProps } from "@zag-js/solid";
|
|
31
|
-
|
|
32
|
-
// src/components/carousel/carousel.anatomy.ts
|
|
33
|
-
import { anatomy } from "@zag-js/carousel";
|
|
34
|
-
var carouselAnatomy = anatomy.extendWith("control");
|
|
35
|
-
|
|
36
|
-
// src/components/carousel/carousel-control.tsx
|
|
40
|
+
import { mergeProps as mergeProps2 } from "@zag-js/solid";
|
|
37
41
|
var CarouselControl = (props) => {
|
|
38
|
-
const
|
|
42
|
+
const api = useCarouselContext();
|
|
43
|
+
const mergedProps = mergeProps2(() => api().getControlProps(), props);
|
|
39
44
|
return <ark.div {...mergedProps} />;
|
|
40
45
|
};
|
|
41
46
|
|
|
42
47
|
// src/components/carousel/carousel-indicator.tsx
|
|
43
|
-
import { mergeProps as
|
|
48
|
+
import { mergeProps as mergeProps3 } from "@zag-js/solid";
|
|
44
49
|
var CarouselIndicator = (props) => {
|
|
45
50
|
const [indicatorProps, localProps] = createSplitProps()(props, [
|
|
46
51
|
"index",
|
|
47
52
|
"readOnly"
|
|
48
53
|
]);
|
|
49
54
|
const api = useCarouselContext();
|
|
50
|
-
const mergedProps =
|
|
55
|
+
const mergedProps = mergeProps3(() => api().getIndicatorProps(indicatorProps), localProps);
|
|
51
56
|
return <ark.button {...mergedProps} />;
|
|
52
57
|
};
|
|
53
58
|
|
|
54
59
|
// src/components/carousel/carousel-indicator-group.tsx
|
|
55
|
-
import { mergeProps as
|
|
60
|
+
import { mergeProps as mergeProps4 } from "@zag-js/solid";
|
|
56
61
|
var CarouselIndicatorGroup = (props) => {
|
|
57
62
|
const api = useCarouselContext();
|
|
58
|
-
const mergedProps =
|
|
63
|
+
const mergedProps = mergeProps4(() => api().getIndicatorGroupProps(), props);
|
|
59
64
|
return <ark.div {...mergedProps} />;
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
// src/components/carousel/carousel-item.tsx
|
|
63
|
-
import { mergeProps as
|
|
68
|
+
import { mergeProps as mergeProps5 } from "@zag-js/solid";
|
|
64
69
|
var CarouselItem = (props) => {
|
|
65
|
-
const [itemProps, localProps] = createSplitProps()(props, ["index"]);
|
|
70
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index", "snapAlign"]);
|
|
66
71
|
const api = useCarouselContext();
|
|
67
|
-
const mergedProps =
|
|
72
|
+
const mergedProps = mergeProps5(() => api().getItemProps(itemProps), localProps);
|
|
68
73
|
return <ark.div {...mergedProps} />;
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
// src/components/carousel/carousel-item-group.tsx
|
|
72
|
-
import { mergeProps as
|
|
77
|
+
import { mergeProps as mergeProps6 } from "@zag-js/solid";
|
|
73
78
|
var CarouselItemGroup = (props) => {
|
|
74
79
|
const api = useCarouselContext();
|
|
75
|
-
const mergedProps =
|
|
80
|
+
const mergedProps = mergeProps6(() => api().getItemGroupProps(), props);
|
|
76
81
|
return <ark.div {...mergedProps} />;
|
|
77
82
|
};
|
|
78
83
|
|
|
79
84
|
// src/components/carousel/carousel-next-trigger.tsx
|
|
80
|
-
import { mergeProps as
|
|
85
|
+
import { mergeProps as mergeProps7 } from "@zag-js/solid";
|
|
81
86
|
var CarouselNextTrigger = (props) => {
|
|
82
87
|
const api = useCarouselContext();
|
|
83
|
-
const mergedProps =
|
|
88
|
+
const mergedProps = mergeProps7(() => api().getNextTriggerProps(), props);
|
|
84
89
|
return <ark.button {...mergedProps} />;
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
// src/components/carousel/carousel-prev-trigger.tsx
|
|
88
|
-
import { mergeProps as
|
|
93
|
+
import { mergeProps as mergeProps8 } from "@zag-js/solid";
|
|
89
94
|
var CarouselPrevTrigger = (props) => {
|
|
90
95
|
const api = useCarouselContext();
|
|
91
|
-
const mergedProps =
|
|
96
|
+
const mergedProps = mergeProps8(() => api().getPrevTriggerProps(), props);
|
|
92
97
|
return <ark.button {...mergedProps} />;
|
|
93
98
|
};
|
|
94
99
|
|
|
95
100
|
// src/components/carousel/carousel-root.tsx
|
|
96
|
-
import { mergeProps as
|
|
101
|
+
import { mergeProps as mergeProps9 } from "@zag-js/solid";
|
|
97
102
|
|
|
98
103
|
// src/components/carousel/use-carousel.ts
|
|
99
104
|
import * as carousel from "@zag-js/carousel";
|
|
@@ -107,7 +112,7 @@ var useCarousel = (props = {}) => {
|
|
|
107
112
|
id,
|
|
108
113
|
dir: locale().dir,
|
|
109
114
|
getRootNode: environment().getRootNode,
|
|
110
|
-
index: props.
|
|
115
|
+
index: props.defaultPage,
|
|
111
116
|
...props
|
|
112
117
|
}));
|
|
113
118
|
const [state, send] = useMachine(carousel.machine(context()), { context });
|
|
@@ -117,45 +122,50 @@ var useCarousel = (props = {}) => {
|
|
|
117
122
|
// src/components/carousel/carousel-root.tsx
|
|
118
123
|
var CarouselRoot = (props) => {
|
|
119
124
|
const [useCarouselProps, localProps] = createSplitProps()(props, [
|
|
120
|
-
"
|
|
121
|
-
"
|
|
125
|
+
"allowMouseDrag",
|
|
126
|
+
"autoplay",
|
|
127
|
+
"defaultPage",
|
|
122
128
|
"id",
|
|
123
129
|
"ids",
|
|
124
|
-
"
|
|
130
|
+
"inViewThreshold",
|
|
125
131
|
"loop",
|
|
126
|
-
"
|
|
132
|
+
"onAutoplayStatusChange",
|
|
133
|
+
"onDragStatusChange",
|
|
134
|
+
"onPageChange",
|
|
127
135
|
"orientation",
|
|
128
|
-
"
|
|
129
|
-
"
|
|
136
|
+
"padding",
|
|
137
|
+
"page",
|
|
138
|
+
"slideCount",
|
|
139
|
+
"slidesPerMove",
|
|
140
|
+
"slidesPerPage",
|
|
141
|
+
"snapType",
|
|
142
|
+
"spacing",
|
|
143
|
+
"translations"
|
|
130
144
|
]);
|
|
131
145
|
const api = useCarousel(useCarouselProps);
|
|
132
|
-
const mergedProps =
|
|
146
|
+
const mergedProps = mergeProps9(() => api().getRootProps(), localProps);
|
|
133
147
|
return <CarouselProvider value={api}>
|
|
134
148
|
<ark.div {...mergedProps} />
|
|
135
149
|
</CarouselProvider>;
|
|
136
150
|
};
|
|
137
151
|
|
|
138
152
|
// src/components/carousel/carousel-root-provider.tsx
|
|
139
|
-
import { mergeProps as
|
|
153
|
+
import { mergeProps as mergeProps10 } from "@zag-js/solid";
|
|
140
154
|
var CarouselRootProvider = (props) => {
|
|
141
155
|
const [{ value: carousel2 }, localProps] = createSplitProps()(props, ["value"]);
|
|
142
|
-
const mergedProps =
|
|
156
|
+
const mergedProps = mergeProps10(() => carousel2().getRootProps(), localProps);
|
|
143
157
|
return <CarouselProvider value={carousel2}>
|
|
144
158
|
<ark.div {...mergedProps} />
|
|
145
159
|
</CarouselProvider>;
|
|
146
160
|
};
|
|
147
161
|
|
|
148
|
-
// src/components/carousel/carousel
|
|
149
|
-
import {
|
|
150
|
-
var CarouselViewport = (props) => {
|
|
151
|
-
const api = useCarouselContext();
|
|
152
|
-
const mergedProps = mergeProps10(() => api().getViewportProps(), props);
|
|
153
|
-
return <ark.div {...mergedProps} />;
|
|
154
|
-
};
|
|
162
|
+
// src/components/carousel/carousel.anatomy.ts
|
|
163
|
+
import { anatomy } from "@zag-js/carousel";
|
|
155
164
|
|
|
156
165
|
// src/components/carousel/carousel.ts
|
|
157
166
|
var carousel_exports = {};
|
|
158
167
|
__export(carousel_exports, {
|
|
168
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
159
169
|
Context: () => CarouselContext,
|
|
160
170
|
Control: () => CarouselControl,
|
|
161
171
|
Indicator: () => CarouselIndicator,
|
|
@@ -165,14 +175,13 @@ __export(carousel_exports, {
|
|
|
165
175
|
NextTrigger: () => CarouselNextTrigger,
|
|
166
176
|
PrevTrigger: () => CarouselPrevTrigger,
|
|
167
177
|
Root: () => CarouselRoot,
|
|
168
|
-
RootProvider: () => CarouselRootProvider
|
|
169
|
-
Viewport: () => CarouselViewport
|
|
178
|
+
RootProvider: () => CarouselRootProvider
|
|
170
179
|
});
|
|
171
180
|
|
|
172
181
|
export {
|
|
173
182
|
useCarouselContext,
|
|
183
|
+
CarouselAutoplayTrigger,
|
|
174
184
|
CarouselContext,
|
|
175
|
-
carouselAnatomy,
|
|
176
185
|
CarouselControl,
|
|
177
186
|
CarouselIndicator,
|
|
178
187
|
CarouselIndicatorGroup,
|
|
@@ -183,6 +192,6 @@ export {
|
|
|
183
192
|
useCarousel,
|
|
184
193
|
CarouselRoot,
|
|
185
194
|
CarouselRootProvider,
|
|
186
|
-
|
|
195
|
+
anatomy,
|
|
187
196
|
carousel_exports
|
|
188
197
|
};
|
|
@@ -22,36 +22,28 @@ var markToTrack = (obj, mark = true) => {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/@zag-js/store/dist/index.mjs
|
|
25
|
-
function
|
|
25
|
+
function glob() {
|
|
26
26
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
27
27
|
if (typeof self !== "undefined") return self;
|
|
28
28
|
if (typeof window !== "undefined") return window;
|
|
29
29
|
if (typeof global !== "undefined") return global;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
const g =
|
|
31
|
+
function globalRef(key, value) {
|
|
32
|
+
const g = glob();
|
|
33
33
|
if (!g) return value();
|
|
34
34
|
g[key] || (g[key] = value());
|
|
35
35
|
return g[key];
|
|
36
36
|
}
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var proxyStateMap = makeGlobal("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
40
|
-
var refSet = makeGlobal("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
|
41
|
-
var isReactElement = (x) => typeof x === "object" && x !== null && "$$typeof" in x;
|
|
37
|
+
var refSet = globalRef("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
|
38
|
+
var isReactElement = (x) => typeof x === "object" && x !== null && "$$typeof" in x && "props" in x;
|
|
42
39
|
var isVueElement = (x) => typeof x === "object" && x !== null && "__v_isVNode" in x;
|
|
43
40
|
var isDOMElement = (x) => typeof x === "object" && x !== null && "nodeType" in x && typeof x.nodeName === "string";
|
|
44
41
|
var isElement = (x) => isReactElement(x) || isVueElement(x) || isDOMElement(x);
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
throw promise.reason;
|
|
51
|
-
default:
|
|
52
|
-
throw promise;
|
|
53
|
-
}
|
|
54
|
-
}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
|
|
42
|
+
var isObject = (x) => x !== null && typeof x === "object";
|
|
43
|
+
var canProxy = (x) => isObject(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !isElement(x) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer) && !(x instanceof Promise);
|
|
44
|
+
var isDev = () => true;
|
|
45
|
+
var proxyStateMap = globalRef("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
46
|
+
var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version) => {
|
|
55
47
|
const cache = snapCache.get(target);
|
|
56
48
|
if (cache?.[0] === version) {
|
|
57
49
|
return cache[1];
|
|
@@ -64,14 +56,8 @@ var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) =>
|
|
|
64
56
|
if (refSet.has(value)) {
|
|
65
57
|
markToTrack(value, false);
|
|
66
58
|
snap[key] = value;
|
|
67
|
-
} else if (value instanceof Promise) {
|
|
68
|
-
Object.defineProperty(snap, key, {
|
|
69
|
-
get() {
|
|
70
|
-
return handlePromise(value);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
59
|
} else if (proxyStateMap.has(value)) {
|
|
74
|
-
snap[key] = snapshot(value
|
|
60
|
+
snap[key] = snapshot(value);
|
|
75
61
|
} else {
|
|
76
62
|
snap[key] = value;
|
|
77
63
|
}
|
|
@@ -177,15 +163,7 @@ var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) =>
|
|
|
177
163
|
}
|
|
178
164
|
let nextValue = value;
|
|
179
165
|
if (Object.getOwnPropertyDescriptor(target, prop)?.set) ;
|
|
180
|
-
else
|
|
181
|
-
value.then((v) => {
|
|
182
|
-
Object.assign(value, { status: "fulfilled", value: v });
|
|
183
|
-
notifyUpdate(["resolve", [prop], v]);
|
|
184
|
-
}).catch((e) => {
|
|
185
|
-
Object.assign(value, { status: "rejected", reason: e });
|
|
186
|
-
notifyUpdate(["reject", [prop], e]);
|
|
187
|
-
});
|
|
188
|
-
} else {
|
|
166
|
+
else {
|
|
189
167
|
if (!proxyStateMap.has(value) && canProxy(value)) {
|
|
190
168
|
nextValue = proxy(value);
|
|
191
169
|
}
|
|
@@ -222,7 +200,6 @@ var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) =>
|
|
|
222
200
|
objectIs,
|
|
223
201
|
newProxy,
|
|
224
202
|
canProxy,
|
|
225
|
-
defaultHandlePromise,
|
|
226
203
|
snapCache,
|
|
227
204
|
createSnapshot,
|
|
228
205
|
proxyCache,
|
|
@@ -232,12 +209,12 @@ var [proxyFunction] = buildProxyFunction();
|
|
|
232
209
|
function proxy(initialObject = {}) {
|
|
233
210
|
return proxyFunction(initialObject);
|
|
234
211
|
}
|
|
235
|
-
function snapshot(proxyObject
|
|
212
|
+
function snapshot(proxyObject) {
|
|
236
213
|
const proxyState = proxyStateMap.get(proxyObject);
|
|
237
214
|
if (isDev() && !proxyState) {
|
|
238
215
|
}
|
|
239
216
|
const [target, ensureVersion, createSnapshot] = proxyState;
|
|
240
|
-
return createSnapshot(target, ensureVersion()
|
|
217
|
+
return createSnapshot(target, ensureVersion());
|
|
241
218
|
}
|
|
242
219
|
function ref(obj) {
|
|
243
220
|
refSet.add(obj);
|
|
@@ -207,6 +207,7 @@ var useColorPicker = (props = {}) => {
|
|
|
207
207
|
},
|
|
208
208
|
dir: locale().dir,
|
|
209
209
|
disabled: field?.().disabled,
|
|
210
|
+
invalid: field?.().invalid,
|
|
210
211
|
readOnly: field?.().readOnly,
|
|
211
212
|
required: field?.().required,
|
|
212
213
|
getRootNode: environment().getRootNode,
|
|
@@ -222,7 +223,7 @@ var useColorPicker = (props = {}) => {
|
|
|
222
223
|
// src/components/color-picker/color-picker-root.tsx
|
|
223
224
|
var ColorPickerRoot = (props) => {
|
|
224
225
|
const [presenceProps, colorPickerProps] = splitPresenceProps(props);
|
|
225
|
-
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "disabled", "format", "id", "ids", "initialFocusEl", "name", "name", "onFocusOutside", "onFormatChange", "onInteractOutside", "onOpenChange", "onPointerDownOutside", "onValueChange", "onValueChangeEnd", "open", "positioning", "readOnly", "required", "value"]);
|
|
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"]);
|
|
226
227
|
const api = useColorPicker(useColorPickerProps);
|
|
227
228
|
const apiPresence = usePresence(mergeProps(presenceProps, () => ({
|
|
228
229
|
present: api().open
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
ark
|
|
12
12
|
} from "./UFYZ7HLU.jsx";
|
|
13
|
-
import {
|
|
14
|
-
useEnvironmentContext
|
|
15
|
-
} from "./5O4RWSWO.jsx";
|
|
16
13
|
import {
|
|
17
14
|
useLocaleContext
|
|
18
15
|
} from "./3QQZKR3F.jsx";
|
|
16
|
+
import {
|
|
17
|
+
useEnvironmentContext
|
|
18
|
+
} from "./5O4RWSWO.jsx";
|
|
19
19
|
import {
|
|
20
20
|
createContext
|
|
21
21
|
} from "./NMGUCD2L.jsx";
|
|
@@ -47,7 +47,7 @@ var checkboxAnatomy = anatomy.extendWith("group");
|
|
|
47
47
|
// src/components/checkbox/use-checkbox-group.ts
|
|
48
48
|
import { createMemo } from "solid-js";
|
|
49
49
|
function useCheckboxGroup(props = {}) {
|
|
50
|
-
const
|
|
50
|
+
const interactive = createMemo(() => !(props.disabled || props.readOnly));
|
|
51
51
|
const [value, setValue] = useControllableState({
|
|
52
52
|
value: props.value,
|
|
53
53
|
defaultValue: props.defaultValue || [],
|
|
@@ -61,12 +61,12 @@ function useCheckboxGroup(props = {}) {
|
|
|
61
61
|
isChecked(val) ? removeValue(val) : addValue(val);
|
|
62
62
|
};
|
|
63
63
|
const addValue = (val) => {
|
|
64
|
-
if (!
|
|
64
|
+
if (!interactive()) return;
|
|
65
65
|
if (isChecked(val)) return;
|
|
66
66
|
setValue(value().concat(val));
|
|
67
67
|
};
|
|
68
68
|
const removeValue = (val) => {
|
|
69
|
-
if (!
|
|
69
|
+
if (!interactive()) return;
|
|
70
70
|
setValue(value().filter((v) => String(v) !== String(val)));
|
|
71
71
|
};
|
|
72
72
|
const getItemProps = (itemProps) => {
|
|
@@ -146,7 +146,7 @@ var useDatePicker = (props = {}) => {
|
|
|
146
146
|
// src/components/date-picker/date-picker-root.tsx
|
|
147
147
|
var DatePickerRoot = (props) => {
|
|
148
148
|
const [presenceProps, datePickerProps] = splitPresenceProps(props);
|
|
149
|
-
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "min", "
|
|
149
|
+
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ["closeOnSelect", "defaultOpen", "defaultValue", "disabled", "fixedWeeks", "focusedValue", "format", "id", "ids", "isDateUnavailable", "isDateUnavailable", "locale", "max", "min", "name", "numOfMonths", "onFocusChange", "onOpenChange", "onValueChange", "onViewChange", "open", "positioning", "readOnly", "selectionMode", "startOfWeek", "timeZone", "translations", "value", "view"]);
|
|
150
150
|
const api = useDatePicker(useDatePickerProps);
|
|
151
151
|
const apiPresence = usePresence(mergeProps(presenceProps, () => ({
|
|
152
152
|
present: api().open
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collapsible_exports,
|
|
3
3
|
useCollapsibleContext
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./PQ3UNZE4.jsx";
|
|
5
5
|
import {
|
|
6
6
|
RenderStrategyProvider,
|
|
7
7
|
splitRenderStrategyProps,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
ark
|
|
15
15
|
} from "./UFYZ7HLU.jsx";
|
|
16
|
-
import {
|
|
17
|
-
useEnvironmentContext
|
|
18
|
-
} from "./5O4RWSWO.jsx";
|
|
19
16
|
import {
|
|
20
17
|
useLocaleContext
|
|
21
18
|
} from "./3QQZKR3F.jsx";
|
|
19
|
+
import {
|
|
20
|
+
useEnvironmentContext
|
|
21
|
+
} from "./5O4RWSWO.jsx";
|
|
22
22
|
import {
|
|
23
23
|
createContext
|
|
24
24
|
} from "./NMGUCD2L.jsx";
|