@sprawlify/react 0.0.5 → 0.0.7
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/{collapsible-C5ZpjCRe.mjs → collapsible-B06GGGE7.mjs} +7 -4
- package/dist/{collapsible-D_cXuaRy.cjs → collapsible-D5kle6Bc.cjs} +12 -9
- package/dist/collection-BKabYqpE.cjs +229 -0
- package/dist/collection-DEsp9z6X.mjs +187 -0
- package/dist/components/accordion/index.cjs +19 -24
- package/dist/components/accordion/index.d.cts +11 -9
- package/dist/components/accordion/index.d.mts +11 -9
- package/dist/components/accordion/index.mjs +9 -14
- package/dist/components/angle-slider/index.cjs +12 -9
- package/dist/components/angle-slider/index.d.cts +13 -11
- package/dist/components/angle-slider/index.d.mts +13 -11
- package/dist/components/angle-slider/index.mjs +7 -4
- package/dist/components/avatar/index.cjs +128 -0
- package/dist/components/avatar/index.d.cts +49 -0
- package/dist/components/avatar/index.d.mts +49 -0
- package/dist/components/avatar/index.mjs +110 -0
- package/dist/components/bottom-sheet/index.cjs +213 -0
- package/dist/components/bottom-sheet/index.d.cts +80 -0
- package/dist/components/bottom-sheet/index.d.mts +81 -0
- package/dist/components/bottom-sheet/index.mjs +190 -0
- package/dist/components/carousel/index.cjs +263 -0
- package/dist/components/carousel/index.d.cts +95 -0
- package/dist/components/carousel/index.d.mts +95 -0
- package/dist/components/carousel/index.mjs +242 -0
- package/dist/components/checkbox/index.cjs +308 -0
- package/dist/components/checkbox/index.d.cts +115 -0
- package/dist/components/checkbox/index.d.mts +115 -0
- package/dist/components/checkbox/index.mjs +289 -0
- package/dist/components/client-only/index.cjs +14 -0
- package/dist/components/client-only/index.d.cts +8 -0
- package/dist/components/client-only/index.d.mts +8 -0
- package/dist/components/client-only/index.mjs +13 -0
- package/dist/components/clipboard/index.cjs +185 -0
- package/dist/components/clipboard/index.d.cts +71 -0
- package/dist/components/clipboard/index.d.mts +71 -0
- package/dist/components/clipboard/index.mjs +163 -0
- package/dist/components/collapsible/index.cjs +6 -3
- package/dist/components/collapsible/index.d.cts +10 -8
- package/dist/components/collapsible/index.d.mts +10 -8
- package/dist/components/collapsible/index.mjs +6 -3
- package/dist/components/collection/index.cjs +11 -0
- package/dist/components/collection/index.d.cts +2 -0
- package/dist/components/collection/index.d.mts +2 -0
- package/dist/components/collection/index.mjs +5 -0
- package/dist/components/color-picker/index.cjs +613 -0
- package/dist/components/color-picker/index.d.cts +181 -0
- package/dist/components/color-picker/index.d.mts +182 -0
- package/dist/components/color-picker/index.mjs +570 -0
- package/dist/components/combobox/index.cjs +416 -0
- package/dist/components/combobox/index.d.cts +132 -0
- package/dist/components/combobox/index.d.mts +133 -0
- package/dist/components/combobox/index.mjs +387 -0
- package/dist/components/field/index.cjs +27 -0
- package/dist/components/field/index.d.cts +116 -0
- package/dist/components/field/index.d.mts +116 -0
- package/dist/components/field/index.mjs +9 -0
- package/dist/components/fieldset/index.cjs +23 -0
- package/dist/components/fieldset/index.d.cts +73 -0
- package/dist/components/fieldset/index.d.mts +73 -0
- package/dist/components/fieldset/index.mjs +9 -0
- package/dist/components/highlight/index.cjs +32 -0
- package/dist/components/highlight/index.d.cts +14 -0
- package/dist/components/highlight/index.d.mts +14 -0
- package/dist/components/highlight/index.mjs +30 -0
- package/dist/components/portal/index.cjs +32 -0
- package/dist/components/portal/index.d.cts +11 -0
- package/dist/components/portal/index.d.mts +11 -0
- package/dist/components/portal/index.mjs +31 -0
- package/dist/components/presence/index.cjs +11 -0
- package/dist/components/presence/index.d.cts +2 -0
- package/dist/components/presence/index.d.mts +4 -0
- package/dist/components/presence/index.mjs +7 -0
- package/dist/components/select/index.cjs +419 -0
- package/dist/components/select/index.d.cts +132 -0
- package/dist/components/select/index.d.mts +133 -0
- package/dist/components/select/index.mjs +384 -0
- package/dist/{factory-DbgGeb_e.mjs → core-C0F-4KYH.mjs} +4 -154
- package/dist/{factory-CfqPG186.cjs → core-CPLjF6nm.cjs} +0 -198
- package/dist/{create-context-DCEySQ7J.cjs → create-context-D6DyFRSf.cjs} +1 -1
- package/dist/environment-BXkWNF2O.mjs +46 -0
- package/dist/environment-DLPiALpf.cjs +58 -0
- package/dist/factory-BbbIuDqa.d.mts +15 -0
- package/dist/factory-CDX-oCN5.cjs +81 -0
- package/dist/factory-DQlmCPH2.mjs +63 -0
- package/dist/factory-DaNWFLLN.d.cts +15 -0
- package/dist/field-CGCTFCx2.mjs +322 -0
- package/dist/field-CXhpW6zO.cjs +404 -0
- package/dist/fieldset-CuSSYZxV.cjs +237 -0
- package/dist/fieldset-poJ8RDvB.mjs +184 -0
- package/dist/index-BUN9wyVM.d.mts +34 -0
- package/dist/index-Dhthtdz_.d.mts +74 -0
- package/dist/index-DqRXPiW_.d.cts +34 -0
- package/dist/index-DsZldSch.d.cts +74 -0
- package/dist/index-DtdZfcpz.d.mts +25 -0
- package/dist/index.cjs +14 -11
- package/dist/index.d.cts +7 -5
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +6 -3
- package/dist/normalize-props-sqcs77GC.d.cts +13 -0
- package/dist/presence-2A4loEJY.mjs +71 -0
- package/dist/presence-BX1tNsGA.cjs +101 -0
- package/dist/providers-Bk3ALTxZ.cjs +78 -0
- package/dist/providers-CyTYcOU1.mjs +54 -0
- package/dist/render-strategy-D3w8btTD.mjs +13 -0
- package/dist/render-strategy-k1JmEGnq.cjs +30 -0
- package/dist/types-DYWV3uAj.d.cts +5 -0
- package/dist/types-FLvjyw__.d.mts +5 -0
- package/dist/use-event-BcyNH29h.mjs +19 -0
- package/dist/use-event-CGMgV6xB.cjs +25 -0
- package/dist/use-safe-layout-effect-BlOhFUAp.mjs +17 -0
- package/dist/use-safe-layout-effect-vuYaDIpT.cjs +35 -0
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +152 -2
- package/dist/factory-CNfD9NVO.d.mts +0 -41
- package/dist/factory-D5qarvEF.d.cts +0 -29
- /package/dist/{chunk-DJTHdtxa.mjs → chunk-DLP0tNsH.mjs} +0 -0
- /package/dist/{create-context-DLMHiig4.mjs → create-context-CdjrBhu7.mjs} +0 -0
- /package/dist/{create-split-props-DvwGh64U.mjs → create-split-props-BJQdOyld.mjs} +0 -0
- /package/dist/{create-split-props-CSaOnJRj.cjs → create-split-props-CSkzaUOy.cjs} +0 -0
- /package/dist/{index--Dciu8yd.d.mts → index-BwTxN5vG.d.mts} +0 -0
- /package/dist/{index-wpUGMM30.d.cts → index-zOmANnUL.d.cts} +0 -0
- /package/dist/{render-strategy-G1aEn-1X.d.cts → render-strategy-CdpAg9jb.d.cts} +0 -0
- /package/dist/{render-strategy-D37ixdTi.d.mts → render-strategy-GetMScNK.d.mts} +0 -0
- /package/dist/{utils-BQjTDAMH.mjs → utils-DflO0-3U.mjs} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { t as __export } from "../../chunk-DLP0tNsH.mjs";
|
|
2
|
+
import { i as useMachine, r as normalizeProps, t as mergeProps } from "../../core-C0F-4KYH.mjs";
|
|
3
|
+
import { t as createContext$1 } from "../../create-context-CdjrBhu7.mjs";
|
|
4
|
+
import { n as useEnvironmentContext } from "../../environment-BXkWNF2O.mjs";
|
|
5
|
+
import { i as useLocaleContext } from "../../providers-CyTYcOU1.mjs";
|
|
6
|
+
import { n as sprawlify } from "../../factory-DQlmCPH2.mjs";
|
|
7
|
+
import { t as createSplitProps } from "../../create-split-props-BJQdOyld.mjs";
|
|
8
|
+
import { forwardRef, useId, useMemo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import * as carousel from "@sprawlify/primitives/machines/carousel";
|
|
11
|
+
import { anatomy } from "@sprawlify/primitives/machines/carousel";
|
|
12
|
+
|
|
13
|
+
//#region src/components/carousel/carousel-anatomy.ts
|
|
14
|
+
const carouselAnatomy = anatomy.extendWith("progressText", "autoplayIndicator");
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/components/carousel/use-carousel-context.ts
|
|
18
|
+
const [CarouselProvider, useCarouselContext] = createContext$1({
|
|
19
|
+
name: "CarouselContext",
|
|
20
|
+
hookName: "useCarouselContext",
|
|
21
|
+
providerName: "<CarouselProvider />"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/carousel/carousel-autoplay-indicator.tsx
|
|
26
|
+
const parts$1 = carouselAnatomy.build();
|
|
27
|
+
const CarouselAutoplayIndicator = forwardRef((props, ref) => {
|
|
28
|
+
const { children, fallback, ...restProps } = props;
|
|
29
|
+
const carousel$1 = useCarouselContext();
|
|
30
|
+
return /* @__PURE__ */ jsx(sprawlify.span, {
|
|
31
|
+
ref,
|
|
32
|
+
...parts$1.autoplayIndicator.attrs,
|
|
33
|
+
...restProps,
|
|
34
|
+
children: carousel$1.isPlaying ? children : fallback
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
CarouselAutoplayIndicator.displayName = "CarouselAutoplayIndicator";
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/carousel/carousel-progress-text.tsx
|
|
41
|
+
const parts = carouselAnatomy.build();
|
|
42
|
+
const CarouselProgressText = forwardRef((props, ref) => {
|
|
43
|
+
const carousel$1 = useCarouselContext();
|
|
44
|
+
const progressText = useMemo(() => {
|
|
45
|
+
return `${carousel$1.page + 1} / ${carousel$1.pageSnapPoints.length}`;
|
|
46
|
+
}, [carousel$1.page, carousel$1.pageSnapPoints.length]);
|
|
47
|
+
return /* @__PURE__ */ jsx(sprawlify.span, {
|
|
48
|
+
ref,
|
|
49
|
+
...parts.progressText.attrs,
|
|
50
|
+
...props,
|
|
51
|
+
children: props.children || progressText
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
CarouselProgressText.displayName = "CarouselProgressText";
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/carousel/carousel-autoplay-trigger.tsx
|
|
58
|
+
const CarouselAutoplayTrigger = forwardRef((props, ref) => {
|
|
59
|
+
const mergedProps = mergeProps(useCarouselContext().getAutoplayTriggerProps(), props);
|
|
60
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
61
|
+
...mergedProps,
|
|
62
|
+
ref
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
CarouselAutoplayTrigger.displayName = "CarouselAutoplayTrigger";
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/components/carousel/carousel-context.tsx
|
|
69
|
+
const CarouselContext = (props) => props.children(useCarouselContext());
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/components/carousel/carousel-control.tsx
|
|
73
|
+
const CarouselControl = forwardRef((props, ref) => {
|
|
74
|
+
const mergedProps = mergeProps(useCarouselContext().getControlProps(), props);
|
|
75
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
76
|
+
...mergedProps,
|
|
77
|
+
...props,
|
|
78
|
+
ref
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
CarouselControl.displayName = "CarouselControl";
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/carousel/carousel-indicator.tsx
|
|
85
|
+
const splitIndicatorProps = createSplitProps();
|
|
86
|
+
const CarouselIndicator = forwardRef((props, ref) => {
|
|
87
|
+
const [indicatorProps, localProps] = splitIndicatorProps(props, ["readOnly", "index"]);
|
|
88
|
+
const mergedProps = mergeProps(useCarouselContext().getIndicatorProps(indicatorProps), localProps);
|
|
89
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
90
|
+
...mergedProps,
|
|
91
|
+
ref
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
CarouselIndicator.displayName = "CarouselIndicator";
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/carousel/carousel-indicator-group.tsx
|
|
98
|
+
const CarouselIndicatorGroup = forwardRef((props, ref) => {
|
|
99
|
+
const mergedProps = mergeProps(useCarouselContext().getIndicatorGroupProps(), props);
|
|
100
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
101
|
+
...mergedProps,
|
|
102
|
+
ref
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
CarouselIndicatorGroup.displayName = "CarouselIndicatorGroup";
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/components/carousel/carousel-item.tsx
|
|
109
|
+
const splitItemProps = createSplitProps();
|
|
110
|
+
const CarouselItem = forwardRef((props, ref) => {
|
|
111
|
+
const [itemProps, localProps] = splitItemProps(props, ["index", "snapAlign"]);
|
|
112
|
+
const mergedProps = mergeProps(useCarouselContext().getItemProps(itemProps), localProps);
|
|
113
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
114
|
+
...mergedProps,
|
|
115
|
+
ref
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
CarouselItem.displayName = "CarouselItem";
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/components/carousel/carousel-item-group.tsx
|
|
122
|
+
const CarouselItemGroup = forwardRef((props, ref) => {
|
|
123
|
+
const mergedProps = mergeProps(useCarouselContext().getItemGroupProps(), props);
|
|
124
|
+
return /* @__PURE__ */ jsx(sprawlify.div, {
|
|
125
|
+
...mergedProps,
|
|
126
|
+
ref
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
CarouselItemGroup.displayName = "CarouselItemGroup";
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/carousel/carousel-next-trigger.tsx
|
|
133
|
+
const CarouselNextTrigger = forwardRef((props, ref) => {
|
|
134
|
+
const mergedProps = mergeProps(useCarouselContext().getNextTriggerProps(), props);
|
|
135
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
136
|
+
...mergedProps,
|
|
137
|
+
ref
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
CarouselNextTrigger.displayName = "CarouselNextTrigger";
|
|
141
|
+
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/components/carousel/carousel-prev-trigger.tsx
|
|
144
|
+
const CarouselPrevTrigger = forwardRef((props, ref) => {
|
|
145
|
+
const mergedProps = mergeProps(useCarouselContext().getPrevTriggerProps(), props);
|
|
146
|
+
return /* @__PURE__ */ jsx(sprawlify.button, {
|
|
147
|
+
...mergedProps,
|
|
148
|
+
ref
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
CarouselPrevTrigger.displayName = "CarouselPrevTrigger";
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/components/carousel/use-carousel.ts
|
|
155
|
+
const useCarousel = (props) => {
|
|
156
|
+
const id = useId();
|
|
157
|
+
const { getRootNode } = useEnvironmentContext();
|
|
158
|
+
const { dir } = useLocaleContext();
|
|
159
|
+
const machineProps = {
|
|
160
|
+
id,
|
|
161
|
+
dir,
|
|
162
|
+
getRootNode,
|
|
163
|
+
...props
|
|
164
|
+
};
|
|
165
|
+
const service = useMachine(carousel.machine, machineProps);
|
|
166
|
+
return carousel.connect(service, normalizeProps);
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/components/carousel/carousel-root.tsx
|
|
171
|
+
const splitRootProps = createSplitProps();
|
|
172
|
+
const CarouselRoot = forwardRef((props, ref) => {
|
|
173
|
+
const [useCarouselProps, localProps] = splitRootProps(props, [
|
|
174
|
+
"allowMouseDrag",
|
|
175
|
+
"autoplay",
|
|
176
|
+
"autoSize",
|
|
177
|
+
"defaultPage",
|
|
178
|
+
"id",
|
|
179
|
+
"ids",
|
|
180
|
+
"inViewThreshold",
|
|
181
|
+
"loop",
|
|
182
|
+
"onAutoplayStatusChange",
|
|
183
|
+
"onDragStatusChange",
|
|
184
|
+
"onPageChange",
|
|
185
|
+
"orientation",
|
|
186
|
+
"padding",
|
|
187
|
+
"page",
|
|
188
|
+
"slideCount",
|
|
189
|
+
"slidesPerMove",
|
|
190
|
+
"slidesPerPage",
|
|
191
|
+
"snapType",
|
|
192
|
+
"spacing",
|
|
193
|
+
"translations"
|
|
194
|
+
]);
|
|
195
|
+
const carousel$1 = useCarousel(useCarouselProps);
|
|
196
|
+
const mergedProps = mergeProps(carousel$1.getRootProps(), localProps);
|
|
197
|
+
return /* @__PURE__ */ jsx(CarouselProvider, {
|
|
198
|
+
value: carousel$1,
|
|
199
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
200
|
+
...mergedProps,
|
|
201
|
+
ref
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
CarouselRoot.displayName = "CarouselRoot";
|
|
206
|
+
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/components/carousel/carousel-root-provider.tsx
|
|
209
|
+
const splitRootProviderProps = createSplitProps();
|
|
210
|
+
const CarouselRootProvider = forwardRef((props, ref) => {
|
|
211
|
+
const [{ value: carousel$1 }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
212
|
+
const mergedProps = mergeProps(carousel$1.getRootProps(), localProps);
|
|
213
|
+
return /* @__PURE__ */ jsx(CarouselProvider, {
|
|
214
|
+
value: carousel$1,
|
|
215
|
+
children: /* @__PURE__ */ jsx(sprawlify.div, {
|
|
216
|
+
...mergedProps,
|
|
217
|
+
ref
|
|
218
|
+
})
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
CarouselRootProvider.displayName = "CarouselRootProvider";
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/components/carousel/carousel.ts
|
|
225
|
+
var carousel_exports = /* @__PURE__ */ __export({
|
|
226
|
+
AutoplayIndicator: () => CarouselAutoplayIndicator,
|
|
227
|
+
AutoplayTrigger: () => CarouselAutoplayTrigger,
|
|
228
|
+
Context: () => CarouselContext,
|
|
229
|
+
Control: () => CarouselControl,
|
|
230
|
+
Indicator: () => CarouselIndicator,
|
|
231
|
+
IndicatorGroup: () => CarouselIndicatorGroup,
|
|
232
|
+
Item: () => CarouselItem,
|
|
233
|
+
ItemGroup: () => CarouselItemGroup,
|
|
234
|
+
NextTrigger: () => CarouselNextTrigger,
|
|
235
|
+
PrevTrigger: () => CarouselPrevTrigger,
|
|
236
|
+
ProgressText: () => CarouselProgressText,
|
|
237
|
+
Root: () => CarouselRoot,
|
|
238
|
+
RootProvider: () => CarouselRootProvider
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
//#endregion
|
|
242
|
+
export { carousel_exports as Carousel, CarouselAutoplayIndicator, CarouselAutoplayTrigger, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselProgressText, CarouselRoot, CarouselRootProvider, carouselAnatomy, useCarousel, useCarouselContext };
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
const require_core = require('../../core-CPLjF6nm.cjs');
|
|
2
|
+
const require_create_context = require('../../create-context-D6DyFRSf.cjs');
|
|
3
|
+
const require_environment = require('../../environment-DLPiALpf.cjs');
|
|
4
|
+
const require_providers = require('../../providers-Bk3ALTxZ.cjs');
|
|
5
|
+
const require_factory = require('../../factory-CDX-oCN5.cjs');
|
|
6
|
+
const require_create_split_props = require('../../create-split-props-CSkzaUOy.cjs');
|
|
7
|
+
const require_use_event = require('../../use-event-CGMgV6xB.cjs');
|
|
8
|
+
const require_use_safe_layout_effect = require('../../use-safe-layout-effect-vuYaDIpT.cjs');
|
|
9
|
+
require('../../fieldset-CuSSYZxV.cjs');
|
|
10
|
+
const require_field = require('../../field-CXhpW6zO.cjs');
|
|
11
|
+
let react = require("react");
|
|
12
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
13
|
+
let __sprawlify_primitives_machines_checkbox = require("@sprawlify/primitives/machines/checkbox");
|
|
14
|
+
__sprawlify_primitives_machines_checkbox = require_core.__toESM(__sprawlify_primitives_machines_checkbox);
|
|
15
|
+
let __sprawlify_primitives_core = require("@sprawlify/primitives/core");
|
|
16
|
+
|
|
17
|
+
//#region src/components/checkbox/use-checkbox-context.ts
|
|
18
|
+
const [CheckboxProvider, useCheckboxContext] = require_create_context.createContext({
|
|
19
|
+
name: "CheckboxContext",
|
|
20
|
+
hookName: "useCheckboxContext",
|
|
21
|
+
providerName: "<CheckboxProvider />"
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/checkbox/checkbox-context.tsx
|
|
26
|
+
const CheckboxContext = (props) => props.children(useCheckboxContext());
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/checkbox/checkbox-control.tsx
|
|
30
|
+
const CheckboxControl = (0, react.forwardRef)((props, ref) => {
|
|
31
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useCheckboxContext().getControlProps(), props);
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
33
|
+
...mergedProps,
|
|
34
|
+
ref
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
CheckboxControl.displayName = "CheckboxControl";
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/checkbox/checkbox-anatomy.ts
|
|
41
|
+
const checkboxAnatomy = __sprawlify_primitives_machines_checkbox.anatomy.extendWith("group");
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils/use-controllable-state.ts
|
|
45
|
+
function useControllableState(props) {
|
|
46
|
+
const { value, onChange, defaultValue } = props;
|
|
47
|
+
const [uncontrolledValue, setUncontrolledValue] = (0, react.useState)(defaultValue);
|
|
48
|
+
const controlled = value !== void 0;
|
|
49
|
+
return [controlled ? value : uncontrolledValue, (0, react.useCallback)((value$1) => {
|
|
50
|
+
if (controlled) return onChange?.(value$1);
|
|
51
|
+
setUncontrolledValue(value$1);
|
|
52
|
+
return onChange?.(value$1);
|
|
53
|
+
}, [controlled, onChange])];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/checkbox/use-checkbox-group.ts
|
|
58
|
+
function useCheckboxGroup(props = {}) {
|
|
59
|
+
const fieldset = require_use_safe_layout_effect.useFieldsetContext();
|
|
60
|
+
const { defaultValue, value: controlledValue, onValueChange, disabled = fieldset?.disabled, readOnly, name, invalid = fieldset?.invalid } = props;
|
|
61
|
+
const interactive = !(disabled || readOnly);
|
|
62
|
+
const onChangeProp = require_use_event.useEvent(onValueChange, { sync: true });
|
|
63
|
+
const [value, setValue] = useControllableState({
|
|
64
|
+
value: controlledValue,
|
|
65
|
+
defaultValue: defaultValue || [],
|
|
66
|
+
onChange: onChangeProp
|
|
67
|
+
});
|
|
68
|
+
const isChecked = (val) => {
|
|
69
|
+
return value.some((v) => String(v) === String(val));
|
|
70
|
+
};
|
|
71
|
+
const toggleValue = (val) => {
|
|
72
|
+
isChecked(val) ? removeValue(val) : addValue(val);
|
|
73
|
+
};
|
|
74
|
+
const addValue = (val) => {
|
|
75
|
+
if (!interactive) return;
|
|
76
|
+
if (isChecked(val)) return;
|
|
77
|
+
setValue(value.concat(val));
|
|
78
|
+
};
|
|
79
|
+
const removeValue = (val) => {
|
|
80
|
+
if (!interactive) return;
|
|
81
|
+
setValue(value.filter((v) => String(v) !== String(val)));
|
|
82
|
+
};
|
|
83
|
+
const getItemProps = (props$1) => {
|
|
84
|
+
return {
|
|
85
|
+
checked: props$1.value != null ? isChecked(props$1.value) : void 0,
|
|
86
|
+
onCheckedChange() {
|
|
87
|
+
if (props$1.value != null) toggleValue(props$1.value);
|
|
88
|
+
},
|
|
89
|
+
name,
|
|
90
|
+
disabled,
|
|
91
|
+
readOnly,
|
|
92
|
+
invalid
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
isChecked,
|
|
97
|
+
value,
|
|
98
|
+
name,
|
|
99
|
+
disabled: !!disabled,
|
|
100
|
+
readOnly: !!readOnly,
|
|
101
|
+
invalid: !!invalid,
|
|
102
|
+
setValue,
|
|
103
|
+
addValue,
|
|
104
|
+
toggleValue,
|
|
105
|
+
getItemProps
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/components/checkbox/use-checkbox-group-context.tsx
|
|
111
|
+
const [CheckboxGroupContextProvider, useCheckboxGroupContext] = require_create_context.createContext({
|
|
112
|
+
name: "CheckboxGroupContext",
|
|
113
|
+
hookName: "useCheckboxGroupContext",
|
|
114
|
+
providerName: "<CheckboxGroupProvider />",
|
|
115
|
+
strict: false
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/checkbox/checkbox-group.tsx
|
|
120
|
+
const splitGroupProps = require_create_split_props.createSplitProps();
|
|
121
|
+
const CheckboxGroup = (0, react.forwardRef)((props, ref) => {
|
|
122
|
+
const [checkboxGroupProps, localProps] = splitGroupProps(props, [
|
|
123
|
+
"defaultValue",
|
|
124
|
+
"value",
|
|
125
|
+
"onValueChange",
|
|
126
|
+
"disabled",
|
|
127
|
+
"invalid",
|
|
128
|
+
"readOnly",
|
|
129
|
+
"name"
|
|
130
|
+
]);
|
|
131
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxGroupContextProvider, {
|
|
132
|
+
value: useCheckboxGroup(checkboxGroupProps),
|
|
133
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
134
|
+
ref,
|
|
135
|
+
role: "group",
|
|
136
|
+
...localProps,
|
|
137
|
+
...checkboxAnatomy.build().group.attrs
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
CheckboxGroup.displayName = "CheckboxGroup";
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/components/checkbox/checkbox-group-provider.tsx
|
|
145
|
+
const splitProviderProps = require_create_split_props.createSplitProps();
|
|
146
|
+
const CheckboxGroupProvider = (0, react.forwardRef)((props, ref) => {
|
|
147
|
+
const [localProps, restProps] = splitProviderProps(props, ["value"]);
|
|
148
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxGroupContextProvider, {
|
|
149
|
+
value: localProps.value,
|
|
150
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
151
|
+
ref,
|
|
152
|
+
role: "group",
|
|
153
|
+
...restProps,
|
|
154
|
+
...checkboxAnatomy.build().group.attrs
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
CheckboxGroupProvider.displayName = "CheckboxGroupProvider";
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/checkbox/checkbox-hidden-input.tsx
|
|
162
|
+
const CheckboxHiddenInput = (0, react.forwardRef)((props, ref) => {
|
|
163
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useCheckboxContext().getHiddenInputProps(), props);
|
|
164
|
+
const field = require_field.useFieldContext();
|
|
165
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.input, {
|
|
166
|
+
"aria-describedby": field?.ariaDescribedby,
|
|
167
|
+
...mergedProps,
|
|
168
|
+
ref
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
CheckboxHiddenInput.displayName = "CheckboxHiddenInput";
|
|
172
|
+
|
|
173
|
+
//#endregion
|
|
174
|
+
//#region src/components/checkbox/checkbox-indicator.tsx
|
|
175
|
+
const CheckboxIndicator = (0, react.forwardRef)((props, ref) => {
|
|
176
|
+
const { indeterminate, ...rest } = props;
|
|
177
|
+
const checkbox = useCheckboxContext();
|
|
178
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(checkbox.getIndicatorProps(), rest);
|
|
179
|
+
const isVisible = indeterminate ? checkbox.indeterminate : checkbox.checked;
|
|
180
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.div, {
|
|
181
|
+
...mergedProps,
|
|
182
|
+
hidden: !isVisible,
|
|
183
|
+
ref
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
CheckboxIndicator.displayName = "CheckboxIndicator";
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/components/checkbox/checkbox-label.tsx
|
|
190
|
+
const CheckboxLabel = (0, react.forwardRef)((props, ref) => {
|
|
191
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(useCheckboxContext().getLabelProps(), props);
|
|
192
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.span, {
|
|
193
|
+
...mergedProps,
|
|
194
|
+
ref
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
CheckboxLabel.displayName = "CheckboxLabel";
|
|
198
|
+
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/components/checkbox/use-checkbox.ts
|
|
201
|
+
const useCheckbox = (ownProps = {}) => {
|
|
202
|
+
const checkboxGroup = useCheckboxGroupContext();
|
|
203
|
+
const field = require_field.useFieldContext();
|
|
204
|
+
const props = (0, react.useMemo)(() => {
|
|
205
|
+
return (0, __sprawlify_primitives_core.mergeProps)(ownProps, checkboxGroup?.getItemProps({ value: ownProps.value }) ?? {});
|
|
206
|
+
}, [ownProps, checkboxGroup]);
|
|
207
|
+
const id = (0, react.useId)();
|
|
208
|
+
const { getRootNode } = require_environment.useEnvironmentContext();
|
|
209
|
+
const { dir } = require_providers.useLocaleContext();
|
|
210
|
+
const machineProps = {
|
|
211
|
+
id,
|
|
212
|
+
ids: {
|
|
213
|
+
label: field?.ids.label,
|
|
214
|
+
hiddenInput: field?.ids.control
|
|
215
|
+
},
|
|
216
|
+
dir,
|
|
217
|
+
disabled: field?.disabled,
|
|
218
|
+
readOnly: field?.readOnly,
|
|
219
|
+
invalid: field?.invalid,
|
|
220
|
+
required: field?.required,
|
|
221
|
+
getRootNode,
|
|
222
|
+
...props
|
|
223
|
+
};
|
|
224
|
+
const service = require_core.useMachine(__sprawlify_primitives_machines_checkbox.machine, machineProps);
|
|
225
|
+
return __sprawlify_primitives_machines_checkbox.connect(service, require_core.normalizeProps);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/components/checkbox/checkbox-root.tsx
|
|
230
|
+
const splitRootProps = require_create_split_props.createSplitProps();
|
|
231
|
+
const CheckboxRoot = (0, react.forwardRef)((props, ref) => {
|
|
232
|
+
const [useCheckboxProps, localProps] = splitRootProps(props, [
|
|
233
|
+
"checked",
|
|
234
|
+
"defaultChecked",
|
|
235
|
+
"disabled",
|
|
236
|
+
"form",
|
|
237
|
+
"id",
|
|
238
|
+
"ids",
|
|
239
|
+
"invalid",
|
|
240
|
+
"name",
|
|
241
|
+
"onCheckedChange",
|
|
242
|
+
"readOnly",
|
|
243
|
+
"required",
|
|
244
|
+
"value"
|
|
245
|
+
]);
|
|
246
|
+
const checkbox = useCheckbox(useCheckboxProps);
|
|
247
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(checkbox.getRootProps(), localProps);
|
|
248
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxProvider, {
|
|
249
|
+
value: checkbox,
|
|
250
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
251
|
+
...mergedProps,
|
|
252
|
+
ref
|
|
253
|
+
})
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
CheckboxRoot.displayName = "CheckboxRoot";
|
|
257
|
+
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/components/checkbox/checkbox-root-provider.tsx
|
|
260
|
+
const splitRootProviderProps = require_create_split_props.createSplitProps();
|
|
261
|
+
const CheckboxRootProvider = (0, react.forwardRef)((props, ref) => {
|
|
262
|
+
const [{ value: checkbox }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
263
|
+
const mergedProps = (0, __sprawlify_primitives_core.mergeProps)(checkbox.getRootProps(), localProps);
|
|
264
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckboxProvider, {
|
|
265
|
+
value: checkbox,
|
|
266
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.sprawlify.label, {
|
|
267
|
+
...mergedProps,
|
|
268
|
+
ref
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
CheckboxRootProvider.displayName = "CheckboxRootProvider";
|
|
273
|
+
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/components/checkbox/checkbox.ts
|
|
276
|
+
var checkbox_exports = /* @__PURE__ */ require_core.__export({
|
|
277
|
+
Context: () => CheckboxContext,
|
|
278
|
+
Control: () => CheckboxControl,
|
|
279
|
+
Group: () => CheckboxGroup,
|
|
280
|
+
GroupProvider: () => CheckboxGroupProvider,
|
|
281
|
+
HiddenInput: () => CheckboxHiddenInput,
|
|
282
|
+
Indicator: () => CheckboxIndicator,
|
|
283
|
+
Label: () => CheckboxLabel,
|
|
284
|
+
Root: () => CheckboxRoot,
|
|
285
|
+
RootProvider: () => CheckboxRootProvider
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
//#endregion
|
|
289
|
+
Object.defineProperty(exports, 'Checkbox', {
|
|
290
|
+
enumerable: true,
|
|
291
|
+
get: function () {
|
|
292
|
+
return checkbox_exports;
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
exports.CheckboxContext = CheckboxContext;
|
|
296
|
+
exports.CheckboxControl = CheckboxControl;
|
|
297
|
+
exports.CheckboxGroup = CheckboxGroup;
|
|
298
|
+
exports.CheckboxGroupProvider = CheckboxGroupProvider;
|
|
299
|
+
exports.CheckboxHiddenInput = CheckboxHiddenInput;
|
|
300
|
+
exports.CheckboxIndicator = CheckboxIndicator;
|
|
301
|
+
exports.CheckboxLabel = CheckboxLabel;
|
|
302
|
+
exports.CheckboxRoot = CheckboxRoot;
|
|
303
|
+
exports.CheckboxRootProvider = CheckboxRootProvider;
|
|
304
|
+
exports.checkboxAnatomy = checkboxAnatomy;
|
|
305
|
+
exports.useCheckbox = useCheckbox;
|
|
306
|
+
exports.useCheckboxContext = useCheckboxContext;
|
|
307
|
+
exports.useCheckboxGroup = useCheckboxGroup;
|
|
308
|
+
exports.useCheckboxGroupContext = useCheckboxGroupContext;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { t as PropTypes } from "../../normalize-props-sqcs77GC.cjs";
|
|
2
|
+
import { n as Optional, t as Assign } from "../../types-DYWV3uAj.cjs";
|
|
3
|
+
import { r as PolymorphicProps, t as HTMLProps } from "../../factory-DaNWFLLN.cjs";
|
|
4
|
+
import * as react193 from "react";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
import * as _sprawlify_primitives_anatomy5 from "@sprawlify/primitives/anatomy";
|
|
7
|
+
import * as checkbox from "@sprawlify/primitives/machines/checkbox";
|
|
8
|
+
import { CheckedChangeDetails, CheckedChangeDetails as CheckboxCheckedChangeDetails, CheckedState, CheckedState as CheckboxCheckedState } from "@sprawlify/primitives/machines/checkbox";
|
|
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 checkbox.Api<PropTypes> {}
|
|
13
|
+
declare const useCheckbox: (ownProps?: 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) => ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const CheckboxContext: (props: CheckboxContextProps) => ReactNode;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/checkbox/checkbox-control.d.ts
|
|
25
|
+
interface CheckboxControlBaseProps extends PolymorphicProps {}
|
|
26
|
+
interface CheckboxControlProps extends HTMLProps<"div">, CheckboxControlBaseProps {}
|
|
27
|
+
declare const CheckboxControl: react193.ForwardRefExoticComponent<CheckboxControlProps & react193.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/checkbox/use-checkbox-group.d.ts
|
|
30
|
+
interface UseCheckboxGroupProps {
|
|
31
|
+
defaultValue?: string[] | undefined;
|
|
32
|
+
value?: string[] | undefined;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
onValueChange?: ((value: string[]) => void) | undefined;
|
|
35
|
+
disabled?: boolean | undefined;
|
|
36
|
+
readOnly?: boolean | undefined;
|
|
37
|
+
invalid?: boolean | undefined;
|
|
38
|
+
}
|
|
39
|
+
interface CheckboxGroupItemProps {
|
|
40
|
+
value: string | undefined;
|
|
41
|
+
}
|
|
42
|
+
declare function useCheckboxGroup(props?: UseCheckboxGroupProps): {
|
|
43
|
+
isChecked: (val: string | undefined) => boolean;
|
|
44
|
+
value: string[];
|
|
45
|
+
name: string | undefined;
|
|
46
|
+
disabled: boolean;
|
|
47
|
+
readOnly: boolean;
|
|
48
|
+
invalid: boolean;
|
|
49
|
+
setValue: (value: string[]) => void | undefined;
|
|
50
|
+
addValue: (val: string) => void;
|
|
51
|
+
toggleValue: (val: string) => void;
|
|
52
|
+
getItemProps: (props: CheckboxGroupItemProps) => {
|
|
53
|
+
checked: boolean | undefined;
|
|
54
|
+
onCheckedChange(): void;
|
|
55
|
+
name: string | undefined;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
readOnly: boolean | undefined;
|
|
58
|
+
invalid: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
type UseCheckboxGroupReturn = ReturnType<typeof useCheckboxGroup>;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/components/checkbox/checkbox-group.d.ts
|
|
64
|
+
interface CheckboxGroupBaseProps extends UseCheckboxGroupProps, PolymorphicProps {}
|
|
65
|
+
interface CheckboxGroupProps extends Assign<HTMLProps<"div">, CheckboxGroupBaseProps> {}
|
|
66
|
+
declare const CheckboxGroup: react193.ForwardRefExoticComponent<CheckboxGroupProps & react193.RefAttributes<HTMLDivElement>>;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/components/checkbox/use-checkbox-group-context.d.ts
|
|
69
|
+
interface UseCheckboxGroupContext extends UseCheckboxGroupReturn {}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/components/checkbox/checkbox-group-provider.d.ts
|
|
72
|
+
interface ProviderProps {
|
|
73
|
+
value: UseCheckboxGroupContext;
|
|
74
|
+
}
|
|
75
|
+
interface CheckboxGroupProviderBaseProps extends ProviderProps, PolymorphicProps {}
|
|
76
|
+
interface CheckboxGroupProviderProps extends Assign<HTMLProps<"div">, CheckboxGroupProviderBaseProps> {}
|
|
77
|
+
declare const CheckboxGroupProvider: react193.ForwardRefExoticComponent<CheckboxGroupProviderProps & react193.RefAttributes<HTMLDivElement>>;
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/components/checkbox/checkbox-hidden-input.d.ts
|
|
80
|
+
interface CheckboxHiddenInputBaseProps extends PolymorphicProps {}
|
|
81
|
+
interface CheckboxHiddenInputProps extends HTMLProps<"input">, CheckboxHiddenInputBaseProps {}
|
|
82
|
+
declare const CheckboxHiddenInput: react193.ForwardRefExoticComponent<CheckboxHiddenInputProps & react193.RefAttributes<HTMLInputElement>>;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/checkbox/checkbox-indicator.d.ts
|
|
85
|
+
interface CheckboxIndicatorBaseProps extends PolymorphicProps {
|
|
86
|
+
indeterminate?: boolean | undefined;
|
|
87
|
+
}
|
|
88
|
+
interface CheckboxIndicatorProps extends HTMLProps<"div">, CheckboxIndicatorBaseProps {}
|
|
89
|
+
declare const CheckboxIndicator: react193.ForwardRefExoticComponent<CheckboxIndicatorProps & react193.RefAttributes<HTMLDivElement>>;
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/components/checkbox/checkbox-label.d.ts
|
|
92
|
+
interface CheckboxLabelBaseProps extends PolymorphicProps {}
|
|
93
|
+
interface CheckboxLabelProps extends HTMLProps<"span">, CheckboxLabelBaseProps {}
|
|
94
|
+
declare const CheckboxLabel: react193.ForwardRefExoticComponent<CheckboxLabelProps & react193.RefAttributes<HTMLSpanElement>>;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/checkbox/checkbox-root.d.ts
|
|
97
|
+
interface CheckboxRootBaseProps extends UseCheckboxProps, PolymorphicProps {}
|
|
98
|
+
interface CheckboxRootProps extends Assign<HTMLProps<"label">, CheckboxRootBaseProps> {}
|
|
99
|
+
declare const CheckboxRoot: react193.ForwardRefExoticComponent<CheckboxRootProps & react193.RefAttributes<HTMLLabelElement>>;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/checkbox/checkbox-root-provider.d.ts
|
|
102
|
+
interface RootProviderProps {
|
|
103
|
+
value: UseCheckboxReturn;
|
|
104
|
+
}
|
|
105
|
+
interface CheckboxRootProviderBaseProps extends RootProviderProps, PolymorphicProps {}
|
|
106
|
+
interface CheckboxRootProviderProps extends HTMLProps<"label">, CheckboxRootProviderBaseProps {}
|
|
107
|
+
declare const CheckboxRootProvider: react193.ForwardRefExoticComponent<CheckboxRootProviderProps & react193.RefAttributes<HTMLLabelElement>>;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/components/checkbox/checkbox-anatomy.d.ts
|
|
110
|
+
declare const checkboxAnatomy: _sprawlify_primitives_anatomy5.AnatomyInstance<"label" | "root" | "control" | "indicator" | "group">;
|
|
111
|
+
declare namespace checkbox_d_exports {
|
|
112
|
+
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 };
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
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 };
|