@sprawlify/solid 0.0.14 → 0.0.15
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-C4aQI7lE.jsx +18 -0
- package/dist/chunk-CKcAJnC7.js +18 -0
- package/dist/collapsible-Cg7zPadX.js +129 -0
- package/dist/collapsible-CjuC6xYl.jsx +117 -0
- package/dist/collection-BiyRTWsX.js +219 -0
- package/dist/collection-BlnS2UQy.jsx +219 -0
- package/dist/components/accordion/index.d.ts +69 -0
- package/dist/components/accordion/index.js +183 -0
- package/dist/components/accordion/index.jsx +157 -0
- package/dist/components/angle-slider/index.d.ts +74 -0
- package/dist/components/angle-slider/index.js +155 -0
- package/dist/components/angle-slider/index.jsx +144 -0
- package/dist/components/avatar/index.d.ts +49 -0
- package/dist/components/avatar/index.js +95 -0
- package/dist/components/avatar/index.jsx +88 -0
- package/dist/components/bottom-sheet/index.d.ts +80 -0
- package/dist/components/bottom-sheet/index.js +218 -0
- package/dist/components/bottom-sheet/index.jsx +177 -0
- package/dist/components/carousel/index.d.ts +98 -0
- package/dist/components/carousel/index.js +207 -0
- package/dist/components/carousel/index.jsx +192 -0
- package/dist/components/checkbox/index.d.ts +138 -0
- package/dist/components/checkbox/index.js +265 -0
- package/dist/components/checkbox/index.jsx +247 -0
- package/dist/components/client-only/index.d.ts +10 -0
- package/dist/components/client-only/index.js +24 -0
- package/dist/components/client-only/index.jsx +15 -0
- package/dist/components/clipboard/index.d.ts +72 -0
- package/dist/components/clipboard/index.js +149 -0
- package/dist/components/clipboard/index.jsx +132 -0
- package/dist/components/collapsible/index.d.ts +60 -0
- package/dist/components/collapsible/index.js +8 -0
- package/dist/components/collapsible/index.jsx +8 -0
- package/dist/components/collection/index.d.ts +3 -0
- package/dist/components/collection/index.js +4 -0
- package/dist/components/collection/index.jsx +4 -0
- package/dist/components/field/index.d.ts +201 -0
- package/dist/components/field/index.js +9 -0
- package/dist/components/field/index.jsx +9 -0
- package/dist/components/fieldset/index.d.ts +109 -0
- package/dist/components/fieldset/index.js +8 -0
- package/dist/components/fieldset/index.jsx +8 -0
- package/dist/components/presence/index.d.ts +5 -0
- package/dist/components/presence/index.js +8 -0
- package/dist/components/presence/index.jsx +8 -0
- package/dist/components/select/index.d.ts +134 -0
- package/dist/components/select/index.js +361 -0
- package/dist/components/select/index.jsx +310 -0
- package/dist/compose-refs-CzyOb8yH.jsx +20 -0
- package/dist/compose-refs-vsrTrt13.js +20 -0
- package/dist/create-split-props-CQVsvhvg.jsx +41 -0
- package/dist/factory-B6RK6SH4.d.ts +14 -0
- package/dist/factory-CEdj72aS.js +47 -0
- package/dist/field-C_WuoXOj.js +287 -0
- package/dist/field-CphvciGc.jsx +259 -0
- package/dist/fieldset-BG-0ZqWT.jsx +167 -0
- package/dist/fieldset-D1BO0LmU.js +182 -0
- package/dist/index-C3ATynHc.d.ts +23 -0
- package/dist/index-DXheKbqg.d.ts +76 -0
- package/dist/index-NWiNyxpL.d.ts +38 -0
- package/dist/index-vSwYtc2L.d.ts +38 -0
- package/dist/index.d.ts +5 -29
- package/dist/index.js +4 -511
- package/dist/index.jsx +4 -497
- package/dist/presence-Bfjusgm3.js +79 -0
- package/dist/presence-arWh1hVd.jsx +66 -0
- package/dist/providers-CHqGPEsc.jsx +82 -0
- package/dist/providers-CQkAUunr.js +96 -0
- package/dist/render-strategy-COrlrUuR.js +12 -0
- package/dist/render-strategy-CZDG_yDi.jsx +12 -0
- package/dist/render-strategy-CtRkdWei.d.ts +9 -0
- package/dist/run-if-fn-DRWB51JE.jsx +421 -0
- package/dist/run-if-fn-eYlaegHy.js +421 -0
- package/dist/types-bQRbEioA.d.ts +9 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.jsx +2 -1
- package/dist/utils-DYer-9SY.js +0 -0
- package/dist/utils-DrvO4Hk3.jsx +0 -0
- package/package.json +62 -2
- /package/dist/{utils-DSKoW7eB.jsx → create-context-PS2j4mEo.js} +0 -0
- /package/dist/{utils-GEMuT7an.js → create-context-h3cXiEld.jsx} +0 -0
- /package/dist/{index-C_ThrXdH.d.ts → index-B0YoIRC4.d.ts} +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-CKcAJnC7.js";
|
|
2
|
+
import { a as useMachine, i as mergeProps$2, r as normalizeProps, t as runIfFn } from "../../run-if-fn-eYlaegHy.js";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-PS2j4mEo.js";
|
|
4
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-CQkAUunr.js";
|
|
5
|
+
import { n as createSplitProps, t as sprawlify } from "../../factory-CEdj72aS.js";
|
|
6
|
+
import { Show, createMemo, createUniqueId } from "solid-js";
|
|
7
|
+
import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
|
|
8
|
+
import * as carousel from "@sprawlify/primitives/machines/carousel";
|
|
9
|
+
import { anatomy } from "@sprawlify/primitives/machines/carousel";
|
|
10
|
+
|
|
11
|
+
//#region src/components/carousel/carousel-anatomy.ts
|
|
12
|
+
const carouselAnatomy = anatomy.extendWith("progressText", "autoplayIndicator");
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/carousel/use-carousel-context.ts
|
|
16
|
+
const [CarouselProvider, useCarouselContext] = createContext$1({
|
|
17
|
+
hookName: "useCarouselContext",
|
|
18
|
+
providerName: "<CarouselProvider />"
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/components/carousel/carousel-autoplay-indicator.tsx
|
|
23
|
+
const parts$1 = carouselAnatomy.build();
|
|
24
|
+
const CarouselAutoplayIndicator = (props) => {
|
|
25
|
+
const api = useCarouselContext();
|
|
26
|
+
return createComponent(sprawlify.span, mergeProps$1(() => parts$1.autoplayIndicator.attrs, props, { get children() {
|
|
27
|
+
return createComponent(Show, {
|
|
28
|
+
get when() {
|
|
29
|
+
return api().isPlaying;
|
|
30
|
+
},
|
|
31
|
+
get fallback() {
|
|
32
|
+
return props.fallback;
|
|
33
|
+
},
|
|
34
|
+
get children() {
|
|
35
|
+
return props.children;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
} }));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/components/carousel/carousel-progress-text.tsx
|
|
43
|
+
const parts = carouselAnatomy.build();
|
|
44
|
+
const CarouselProgressText = (props) => {
|
|
45
|
+
const api = useCarouselContext();
|
|
46
|
+
const progressText = createMemo(() => {
|
|
47
|
+
return `${api().page + 1} / ${api().pageSnapPoints.length}`;
|
|
48
|
+
});
|
|
49
|
+
return createComponent(sprawlify.span, mergeProps$1(() => parts.progressText.attrs, props, { get children() {
|
|
50
|
+
return props.children || progressText();
|
|
51
|
+
} }));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/carousel/carousel-autoplay-trigger.tsx
|
|
56
|
+
const CarouselAutoplayTrigger = (props) => {
|
|
57
|
+
const api = useCarouselContext();
|
|
58
|
+
const mergedProps = mergeProps$2(() => api().getAutoplayTriggerProps(), props);
|
|
59
|
+
return createComponent(sprawlify.button, mergedProps);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/carousel/carousel-context.tsx
|
|
64
|
+
const CarouselContext = (props) => props.children(useCarouselContext());
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/components/carousel/carousel-control.tsx
|
|
68
|
+
const CarouselControl = (props) => {
|
|
69
|
+
const api = useCarouselContext();
|
|
70
|
+
const mergedProps = mergeProps$2(() => api().getControlProps(), props);
|
|
71
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/carousel/carousel-indicator.tsx
|
|
76
|
+
const CarouselIndicator = (props) => {
|
|
77
|
+
const [indicatorProps, localProps] = createSplitProps()(props, ["index", "readOnly"]);
|
|
78
|
+
const api = useCarouselContext();
|
|
79
|
+
const mergedProps = mergeProps$2(() => api().getIndicatorProps(indicatorProps), localProps);
|
|
80
|
+
return createComponent(sprawlify.button, mergedProps);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/carousel/carousel-indicator-group.tsx
|
|
85
|
+
const CarouselIndicatorGroup = (props) => {
|
|
86
|
+
const api = useCarouselContext();
|
|
87
|
+
const mergedProps = mergeProps$2(() => api().getIndicatorGroupProps(), props);
|
|
88
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/components/carousel/carousel-item.tsx
|
|
93
|
+
const CarouselItem = (props) => {
|
|
94
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index", "snapAlign"]);
|
|
95
|
+
const api = useCarouselContext();
|
|
96
|
+
const mergedProps = mergeProps$2(() => api().getItemProps(itemProps), localProps);
|
|
97
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/carousel/carousel-item-group.tsx
|
|
102
|
+
const CarouselItemGroup = (props) => {
|
|
103
|
+
const api = useCarouselContext();
|
|
104
|
+
const mergedProps = mergeProps$2(() => api().getItemGroupProps(), props);
|
|
105
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/carousel/carousel-next-trigger.tsx
|
|
110
|
+
const CarouselNextTrigger = (props) => {
|
|
111
|
+
const api = useCarouselContext();
|
|
112
|
+
const mergedProps = mergeProps$2(() => api().getNextTriggerProps(), props);
|
|
113
|
+
return createComponent(sprawlify.button, mergedProps);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/components/carousel/carousel-prev-trigger.tsx
|
|
118
|
+
const CarouselPrevTrigger = (props) => {
|
|
119
|
+
const api = useCarouselContext();
|
|
120
|
+
const mergedProps = mergeProps$2(() => api().getPrevTriggerProps(), props);
|
|
121
|
+
return createComponent(sprawlify.button, mergedProps);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/components/carousel/use-carousel.ts
|
|
126
|
+
const useCarousel = (props) => {
|
|
127
|
+
const id = createUniqueId();
|
|
128
|
+
const locale = useLocaleContext();
|
|
129
|
+
const environment = useEnvironmentContext();
|
|
130
|
+
const machineProps = createMemo(() => ({
|
|
131
|
+
id,
|
|
132
|
+
dir: locale().dir,
|
|
133
|
+
getRootNode: environment().getRootNode,
|
|
134
|
+
...runIfFn(props)
|
|
135
|
+
}));
|
|
136
|
+
const service = useMachine(carousel.machine, machineProps);
|
|
137
|
+
return createMemo(() => carousel.connect(service, normalizeProps));
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/components/carousel/carousel-root.tsx
|
|
142
|
+
const CarouselRoot = (props) => {
|
|
143
|
+
const [useCarouselProps, localProps] = createSplitProps()(props, [
|
|
144
|
+
"allowMouseDrag",
|
|
145
|
+
"autoplay",
|
|
146
|
+
"autoSize",
|
|
147
|
+
"defaultPage",
|
|
148
|
+
"id",
|
|
149
|
+
"ids",
|
|
150
|
+
"inViewThreshold",
|
|
151
|
+
"loop",
|
|
152
|
+
"onAutoplayStatusChange",
|
|
153
|
+
"onDragStatusChange",
|
|
154
|
+
"onPageChange",
|
|
155
|
+
"orientation",
|
|
156
|
+
"padding",
|
|
157
|
+
"page",
|
|
158
|
+
"slideCount",
|
|
159
|
+
"slidesPerMove",
|
|
160
|
+
"slidesPerPage",
|
|
161
|
+
"snapType",
|
|
162
|
+
"spacing",
|
|
163
|
+
"translations"
|
|
164
|
+
]);
|
|
165
|
+
const api = useCarousel(useCarouselProps);
|
|
166
|
+
const mergedProps = mergeProps$2(() => api().getRootProps(), localProps);
|
|
167
|
+
return createComponent(CarouselProvider, {
|
|
168
|
+
value: api,
|
|
169
|
+
get children() {
|
|
170
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/components/carousel/carousel-root-provider.tsx
|
|
177
|
+
const CarouselRootProvider = (props) => {
|
|
178
|
+
const [{ value: carousel$1 }, localProps] = createSplitProps()(props, ["value"]);
|
|
179
|
+
const mergedProps = mergeProps$2(() => carousel$1().getRootProps(), localProps);
|
|
180
|
+
return createComponent(CarouselProvider, {
|
|
181
|
+
value: carousel$1,
|
|
182
|
+
get children() {
|
|
183
|
+
return createComponent(sprawlify.div, mergedProps);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/components/carousel/carousel.ts
|
|
190
|
+
var carousel_exports = /* @__PURE__ */ __export({
|
|
191
|
+
AutoplayIndicator: () => CarouselAutoplayIndicator,
|
|
192
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
193
|
+
Context: () => CarouselContext,
|
|
194
|
+
Control: () => CarouselControl,
|
|
195
|
+
Indicator: () => CarouselIndicator,
|
|
196
|
+
IndicatorGroup: () => CarouselIndicatorGroup,
|
|
197
|
+
Item: () => CarouselItem,
|
|
198
|
+
ItemGroup: () => CarouselItemGroup,
|
|
199
|
+
NextTrigger: () => CarouselNextTrigger,
|
|
200
|
+
PrevTrigger: () => CarouselPrevTrigger,
|
|
201
|
+
ProgressText: () => CarouselProgressText,
|
|
202
|
+
Root: () => CarouselRoot,
|
|
203
|
+
RootProvider: () => CarouselRootProvider
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
//#endregion
|
|
207
|
+
export { carousel_exports as Carousel, CarouselAutoplayIndicator, CarouselAutoplayTrigger, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselProgressText, CarouselRoot, CarouselRootProvider, carouselAnatomy, useCarousel, useCarouselContext };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-C4aQI7lE.jsx";
|
|
2
|
+
import { a as useMachine, i as mergeProps$1, r as normalizeProps, t as runIfFn } from "../../run-if-fn-DRWB51JE.jsx";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-h3cXiEld.jsx";
|
|
4
|
+
import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-CHqGPEsc.jsx";
|
|
5
|
+
import { n as sprawlify, t as createSplitProps } from "../../create-split-props-CQVsvhvg.jsx";
|
|
6
|
+
import { Show, createMemo, createUniqueId } from "solid-js";
|
|
7
|
+
import * as carousel from "@sprawlify/primitives/machines/carousel";
|
|
8
|
+
import { anatomy } from "@sprawlify/primitives/machines/carousel";
|
|
9
|
+
|
|
10
|
+
//#region src/components/carousel/carousel-anatomy.ts
|
|
11
|
+
const carouselAnatomy = anatomy.extendWith("progressText", "autoplayIndicator");
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/components/carousel/use-carousel-context.ts
|
|
15
|
+
const [CarouselProvider, useCarouselContext] = createContext$1({
|
|
16
|
+
hookName: "useCarouselContext",
|
|
17
|
+
providerName: "<CarouselProvider />"
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/components/carousel/carousel-autoplay-indicator.tsx
|
|
22
|
+
const parts$1 = carouselAnatomy.build();
|
|
23
|
+
const CarouselAutoplayIndicator = (props) => {
|
|
24
|
+
const api = useCarouselContext();
|
|
25
|
+
return <sprawlify.span {...parts$1.autoplayIndicator.attrs} {...props}>
|
|
26
|
+
<Show when={api().isPlaying} fallback={props.fallback}>
|
|
27
|
+
{props.children}
|
|
28
|
+
</Show>
|
|
29
|
+
</sprawlify.span>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/carousel/carousel-progress-text.tsx
|
|
34
|
+
const parts = carouselAnatomy.build();
|
|
35
|
+
const CarouselProgressText = (props) => {
|
|
36
|
+
const api = useCarouselContext();
|
|
37
|
+
const progressText = createMemo(() => {
|
|
38
|
+
return `${api().page + 1} / ${api().pageSnapPoints.length}`;
|
|
39
|
+
});
|
|
40
|
+
return <sprawlify.span {...parts.progressText.attrs} {...props}>
|
|
41
|
+
{props.children || progressText()}
|
|
42
|
+
</sprawlify.span>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/components/carousel/carousel-autoplay-trigger.tsx
|
|
47
|
+
const CarouselAutoplayTrigger = (props) => {
|
|
48
|
+
const api = useCarouselContext();
|
|
49
|
+
const mergedProps = mergeProps$1(() => api().getAutoplayTriggerProps(), props);
|
|
50
|
+
return <sprawlify.button {...mergedProps} />;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/carousel/carousel-context.tsx
|
|
55
|
+
const CarouselContext = (props) => props.children(useCarouselContext());
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/carousel/carousel-control.tsx
|
|
59
|
+
const CarouselControl = (props) => {
|
|
60
|
+
const api = useCarouselContext();
|
|
61
|
+
const mergedProps = mergeProps$1(() => api().getControlProps(), props);
|
|
62
|
+
return <sprawlify.div {...mergedProps} />;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/components/carousel/carousel-indicator.tsx
|
|
67
|
+
const CarouselIndicator = (props) => {
|
|
68
|
+
const [indicatorProps, localProps] = createSplitProps()(props, ["index", "readOnly"]);
|
|
69
|
+
const api = useCarouselContext();
|
|
70
|
+
const mergedProps = mergeProps$1(() => api().getIndicatorProps(indicatorProps), localProps);
|
|
71
|
+
return <sprawlify.button {...mergedProps} />;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/carousel/carousel-indicator-group.tsx
|
|
76
|
+
const CarouselIndicatorGroup = (props) => {
|
|
77
|
+
const api = useCarouselContext();
|
|
78
|
+
const mergedProps = mergeProps$1(() => api().getIndicatorGroupProps(), props);
|
|
79
|
+
return <sprawlify.div {...mergedProps} />;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/carousel/carousel-item.tsx
|
|
84
|
+
const CarouselItem = (props) => {
|
|
85
|
+
const [itemProps, localProps] = createSplitProps()(props, ["index", "snapAlign"]);
|
|
86
|
+
const api = useCarouselContext();
|
|
87
|
+
const mergedProps = mergeProps$1(() => api().getItemProps(itemProps), localProps);
|
|
88
|
+
return <sprawlify.div {...mergedProps} />;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/components/carousel/carousel-item-group.tsx
|
|
93
|
+
const CarouselItemGroup = (props) => {
|
|
94
|
+
const api = useCarouselContext();
|
|
95
|
+
const mergedProps = mergeProps$1(() => api().getItemGroupProps(), props);
|
|
96
|
+
return <sprawlify.div {...mergedProps} />;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region src/components/carousel/carousel-next-trigger.tsx
|
|
101
|
+
const CarouselNextTrigger = (props) => {
|
|
102
|
+
const api = useCarouselContext();
|
|
103
|
+
const mergedProps = mergeProps$1(() => api().getNextTriggerProps(), props);
|
|
104
|
+
return <sprawlify.button {...mergedProps} />;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/components/carousel/carousel-prev-trigger.tsx
|
|
109
|
+
const CarouselPrevTrigger = (props) => {
|
|
110
|
+
const api = useCarouselContext();
|
|
111
|
+
const mergedProps = mergeProps$1(() => api().getPrevTriggerProps(), props);
|
|
112
|
+
return <sprawlify.button {...mergedProps} />;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/components/carousel/use-carousel.ts
|
|
117
|
+
const useCarousel = (props) => {
|
|
118
|
+
const id = createUniqueId();
|
|
119
|
+
const locale = useLocaleContext();
|
|
120
|
+
const environment = useEnvironmentContext();
|
|
121
|
+
const machineProps = createMemo(() => ({
|
|
122
|
+
id,
|
|
123
|
+
dir: locale().dir,
|
|
124
|
+
getRootNode: environment().getRootNode,
|
|
125
|
+
...runIfFn(props)
|
|
126
|
+
}));
|
|
127
|
+
const service = useMachine(carousel.machine, machineProps);
|
|
128
|
+
return createMemo(() => carousel.connect(service, normalizeProps));
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/carousel/carousel-root.tsx
|
|
133
|
+
const CarouselRoot = (props) => {
|
|
134
|
+
const [useCarouselProps, localProps] = createSplitProps()(props, [
|
|
135
|
+
"allowMouseDrag",
|
|
136
|
+
"autoplay",
|
|
137
|
+
"autoSize",
|
|
138
|
+
"defaultPage",
|
|
139
|
+
"id",
|
|
140
|
+
"ids",
|
|
141
|
+
"inViewThreshold",
|
|
142
|
+
"loop",
|
|
143
|
+
"onAutoplayStatusChange",
|
|
144
|
+
"onDragStatusChange",
|
|
145
|
+
"onPageChange",
|
|
146
|
+
"orientation",
|
|
147
|
+
"padding",
|
|
148
|
+
"page",
|
|
149
|
+
"slideCount",
|
|
150
|
+
"slidesPerMove",
|
|
151
|
+
"slidesPerPage",
|
|
152
|
+
"snapType",
|
|
153
|
+
"spacing",
|
|
154
|
+
"translations"
|
|
155
|
+
]);
|
|
156
|
+
const api = useCarousel(useCarouselProps);
|
|
157
|
+
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
158
|
+
return <CarouselProvider value={api}>
|
|
159
|
+
<sprawlify.div {...mergedProps} />
|
|
160
|
+
</CarouselProvider>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region src/components/carousel/carousel-root-provider.tsx
|
|
165
|
+
const CarouselRootProvider = (props) => {
|
|
166
|
+
const [{ value: carousel$1 }, localProps] = createSplitProps()(props, ["value"]);
|
|
167
|
+
const mergedProps = mergeProps$1(() => carousel$1().getRootProps(), localProps);
|
|
168
|
+
return <CarouselProvider value={carousel$1}>
|
|
169
|
+
<sprawlify.div {...mergedProps} />
|
|
170
|
+
</CarouselProvider>;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/components/carousel/carousel.ts
|
|
175
|
+
var carousel_exports = /* @__PURE__ */ __export({
|
|
176
|
+
AutoplayIndicator: () => CarouselAutoplayIndicator,
|
|
177
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
178
|
+
Context: () => CarouselContext,
|
|
179
|
+
Control: () => CarouselControl,
|
|
180
|
+
Indicator: () => CarouselIndicator,
|
|
181
|
+
IndicatorGroup: () => CarouselIndicatorGroup,
|
|
182
|
+
Item: () => CarouselItem,
|
|
183
|
+
ItemGroup: () => CarouselItemGroup,
|
|
184
|
+
NextTrigger: () => CarouselNextTrigger,
|
|
185
|
+
PrevTrigger: () => CarouselPrevTrigger,
|
|
186
|
+
ProgressText: () => CarouselProgressText,
|
|
187
|
+
Root: () => CarouselRoot,
|
|
188
|
+
RootProvider: () => CarouselRootProvider
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
//#endregion
|
|
192
|
+
export { carousel_exports as Carousel, CarouselAutoplayIndicator, CarouselAutoplayTrigger, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselProgressText, CarouselRoot, CarouselRootProvider, carouselAnatomy, useCarousel, useCarouselContext };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { n as PropTypes } from "../../index-C3ATynHc.js";
|
|
2
|
+
import { i as Optional, n as MaybeAccessor, t as Assign } from "../../types-bQRbEioA.js";
|
|
3
|
+
import { n as PolymorphicProps, t as HTMLProps } from "../../factory-B6RK6SH4.js";
|
|
4
|
+
import * as solid_js36 from "solid-js";
|
|
5
|
+
import { Accessor, JSX } from "solid-js";
|
|
6
|
+
import * as checkbox from "@sprawlify/primitives/machines/checkbox";
|
|
7
|
+
import { CheckedChangeDetails, CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState, CheckedState as CheckboxCheckedState } from "@sprawlify/primitives/machines/checkbox";
|
|
8
|
+
import * as _sprawlify_primitives_anatomy1 from "@sprawlify/primitives/anatomy";
|
|
9
|
+
|
|
10
|
+
//#region src/components/checkbox/use-checkbox.d.ts
|
|
11
|
+
interface UseCheckboxProps extends Optional<Omit<checkbox.Props, 'dir' | 'getRootNode'>, 'id'> {}
|
|
12
|
+
interface UseCheckboxReturn extends Accessor<checkbox.Api<PropTypes>> {}
|
|
13
|
+
declare const useCheckbox: (ownProps?: MaybeAccessor<UseCheckboxProps>) => UseCheckboxReturn;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/checkbox/use-checkbox-context.d.ts
|
|
16
|
+
interface UseCheckboxContext extends UseCheckboxReturn {}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/checkbox/checkbox-context.d.ts
|
|
19
|
+
interface CheckboxContextProps {
|
|
20
|
+
children: (context: UseCheckboxContext) => JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
declare const CheckboxContext: (props: CheckboxContextProps) => JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/checkbox/checkbox-control.d.ts
|
|
25
|
+
interface CheckboxControlBaseProps extends PolymorphicProps<'div'> {}
|
|
26
|
+
interface CheckboxControlProps extends HTMLProps<'div'>, CheckboxControlBaseProps {}
|
|
27
|
+
declare const CheckboxControl: (props: CheckboxControlProps) => solid_js36.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/checkbox/use-checkbox-group.d.ts
|
|
30
|
+
interface UseCheckboxGroupProps {
|
|
31
|
+
/**
|
|
32
|
+
* The initial value of `value` when uncontrolled
|
|
33
|
+
*/
|
|
34
|
+
defaultValue?: Accessor<string[]> | string[];
|
|
35
|
+
/**
|
|
36
|
+
* The controlled value of the checkbox group
|
|
37
|
+
*/
|
|
38
|
+
value?: Accessor<string[]>;
|
|
39
|
+
/**
|
|
40
|
+
* The name of the input fields in the checkbox group
|
|
41
|
+
* (Useful for form submission).
|
|
42
|
+
*/
|
|
43
|
+
name?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The callback to call when the value changes
|
|
46
|
+
*/
|
|
47
|
+
onValueChange?: (value: string[]) => void;
|
|
48
|
+
/**
|
|
49
|
+
* If `true`, the checkbox group is disabled
|
|
50
|
+
*/
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* If `true`, the checkbox group is read-only
|
|
54
|
+
*/
|
|
55
|
+
readOnly?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* If `true`, the checkbox group is invalid
|
|
58
|
+
*/
|
|
59
|
+
invalid?: boolean;
|
|
60
|
+
}
|
|
61
|
+
interface CheckboxGroupItemProps {
|
|
62
|
+
value: string | undefined;
|
|
63
|
+
}
|
|
64
|
+
declare function useCheckboxGroup(props?: UseCheckboxGroupProps): Accessor<{
|
|
65
|
+
isChecked: (val: string | undefined) => boolean;
|
|
66
|
+
value: Accessor<string[]>;
|
|
67
|
+
name: string | undefined;
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
readOnly: boolean | undefined;
|
|
70
|
+
invalid: boolean;
|
|
71
|
+
setValue: (next: string[] | ((prev: string[]) => string[])) => void;
|
|
72
|
+
addValue: (val: string) => void;
|
|
73
|
+
toggleValue: (val: string) => void;
|
|
74
|
+
getItemProps: (itemProps: CheckboxGroupItemProps) => {
|
|
75
|
+
checked: boolean | undefined;
|
|
76
|
+
onCheckedChange(): void;
|
|
77
|
+
name: string | undefined;
|
|
78
|
+
disabled: boolean;
|
|
79
|
+
readOnly: boolean | undefined;
|
|
80
|
+
invalid: boolean;
|
|
81
|
+
};
|
|
82
|
+
}>;
|
|
83
|
+
type UseCheckboxGroupReturn = ReturnType<typeof useCheckboxGroup>;
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/components/checkbox/checkbox-group.d.ts
|
|
86
|
+
interface CheckboxGroupBaseProps extends UseCheckboxGroupProps, PolymorphicProps<'div'> {}
|
|
87
|
+
interface CheckboxGroupProps extends HTMLProps<'div'>, CheckboxGroupBaseProps {}
|
|
88
|
+
declare const CheckboxGroup: (props: CheckboxGroupProps) => solid_js36.JSX.Element;
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/components/checkbox/use-checkbox-group-context.d.ts
|
|
91
|
+
interface UseCheckboxGroupContext extends UseCheckboxGroupReturn {}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/components/checkbox/checkbox-group-provider.d.ts
|
|
94
|
+
interface ProviderProps {
|
|
95
|
+
value: UseCheckboxGroupContext;
|
|
96
|
+
}
|
|
97
|
+
interface CheckboxGroupProviderBaseProps extends ProviderProps, PolymorphicProps<'div'> {}
|
|
98
|
+
interface CheckboxGroupProviderProps extends Assign<HTMLProps<'div'>, CheckboxGroupProviderBaseProps> {}
|
|
99
|
+
declare const CheckboxGroupProvider: (props: CheckboxGroupProviderProps) => solid_js36.JSX.Element;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/checkbox/checkbox-hidden-input.d.ts
|
|
102
|
+
interface CheckboxHiddenInputBaseProps extends PolymorphicProps<'input'> {}
|
|
103
|
+
interface CheckboxHiddenInputProps extends HTMLProps<'input'>, CheckboxHiddenInputBaseProps {}
|
|
104
|
+
declare const CheckboxHiddenInput: (props: CheckboxHiddenInputProps) => solid_js36.JSX.Element;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/components/checkbox/checkbox-indicator.d.ts
|
|
107
|
+
interface IndicatorProps {
|
|
108
|
+
indeterminate?: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface CheckboxIndicatorBaseProps extends IndicatorProps, PolymorphicProps<'div'> {}
|
|
111
|
+
interface CheckboxIndicatorProps extends HTMLProps<'div'>, CheckboxIndicatorBaseProps {}
|
|
112
|
+
declare const CheckboxIndicator: (props: CheckboxIndicatorProps) => solid_js36.JSX.Element;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/components/checkbox/checkbox-label.d.ts
|
|
115
|
+
interface CheckboxLabelBaseProps extends PolymorphicProps<'span'> {}
|
|
116
|
+
interface CheckboxLabelProps extends HTMLProps<'span'>, CheckboxLabelBaseProps {}
|
|
117
|
+
declare const CheckboxLabel: (props: CheckboxLabelProps) => solid_js36.JSX.Element;
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/checkbox/checkbox-root.d.ts
|
|
120
|
+
interface CheckboxRootBaseProps extends UseCheckboxProps, PolymorphicProps<'label'> {}
|
|
121
|
+
interface CheckboxRootProps extends HTMLProps<'label'>, CheckboxRootBaseProps {}
|
|
122
|
+
declare const CheckboxRoot: (props: CheckboxRootProps) => solid_js36.JSX.Element;
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/components/checkbox/checkbox-root-provider.d.ts
|
|
125
|
+
interface RootProviderProps {
|
|
126
|
+
value: UseCheckboxReturn;
|
|
127
|
+
}
|
|
128
|
+
interface CheckboxRootProviderBaseProps extends PolymorphicProps<'label'> {}
|
|
129
|
+
interface CheckboxRootProviderProps extends HTMLProps<'label'>, RootProviderProps, CheckboxRootProviderBaseProps {}
|
|
130
|
+
declare const CheckboxRootProvider: (props: CheckboxRootProviderProps) => solid_js36.JSX.Element;
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/checkbox/checkbox-anatomy.d.ts
|
|
133
|
+
declare const checkboxAnatomy: _sprawlify_primitives_anatomy1.AnatomyInstance<"label" | "root" | "control" | "indicator" | "group">;
|
|
134
|
+
declare namespace checkbox_d_exports {
|
|
135
|
+
export { CheckedChangeDetails, CheckedState, CheckboxContext as Context, CheckboxContextProps as ContextProps, CheckboxControl as Control, CheckboxControlBaseProps as ControlBaseProps, CheckboxControlProps as ControlProps, CheckboxGroup as Group, CheckboxGroupBaseProps as GroupBaseProps, CheckboxGroupProps as GroupProps, CheckboxGroupProvider as GroupProvider, CheckboxGroupProviderBaseProps as GroupProviderBaseProps, CheckboxGroupProviderProps as GroupProviderProps, CheckboxHiddenInput as HiddenInput, CheckboxHiddenInputBaseProps as HiddenInputBaseProps, CheckboxHiddenInputProps as HiddenInputProps, CheckboxIndicator as Indicator, CheckboxIndicatorBaseProps as IndicatorBaseProps, CheckboxIndicatorProps as IndicatorProps, CheckboxLabel as Label, CheckboxLabelBaseProps as LabelBaseProps, CheckboxLabelProps as LabelProps, CheckboxRoot as Root, CheckboxRootBaseProps as RootBaseProps, CheckboxRootProps as RootProps, CheckboxRootProvider as RootProvider, CheckboxRootProviderBaseProps as RootProviderBaseProps, CheckboxRootProviderProps as RootProviderProps };
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
export { checkbox_d_exports as Checkbox, type CheckboxCheckedChangeDetails, type CheckboxCheckedState, CheckboxContext, type CheckboxContextProps, CheckboxControl, type CheckboxControlBaseProps, type CheckboxControlProps, CheckboxGroup, type CheckboxGroupBaseProps, type CheckboxGroupProps, CheckboxGroupProvider, type CheckboxGroupProviderBaseProps, type CheckboxGroupProviderProps, CheckboxHiddenInput, type CheckboxHiddenInputBaseProps, type CheckboxHiddenInputProps, CheckboxIndicator, type CheckboxIndicatorBaseProps, type CheckboxIndicatorProps, CheckboxLabel, type CheckboxLabelBaseProps, type CheckboxLabelProps, CheckboxRoot, type CheckboxRootBaseProps, type CheckboxRootProps, CheckboxRootProvider, type CheckboxRootProviderBaseProps, type CheckboxRootProviderProps, type UseCheckboxContext, type UseCheckboxGroupContext, type UseCheckboxGroupProps, type UseCheckboxGroupReturn, type UseCheckboxProps, type UseCheckboxReturn, checkboxAnatomy, useCheckbox, useCheckboxContext, useCheckboxGroup, useCheckboxGroupContext };
|