@sprawlify/solid 0.0.14 → 0.0.16

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.
Files changed (108) hide show
  1. package/dist/chunk-B5so6B0y.jsx +18 -0
  2. package/dist/chunk-B93cd-Dz.js +18 -0
  3. package/dist/collapsible-CX2tnXKq.js +131 -0
  4. package/dist/collapsible-sG-Rzvf2.jsx +119 -0
  5. package/dist/collection-BRr4O2_i.jsx +220 -0
  6. package/dist/collection-zj3lxnwW.js +220 -0
  7. package/dist/components/accordion/index.d.ts +69 -0
  8. package/dist/components/accordion/index.js +185 -0
  9. package/dist/components/accordion/index.jsx +159 -0
  10. package/dist/components/angle-slider/index.d.ts +74 -0
  11. package/dist/components/angle-slider/index.js +157 -0
  12. package/dist/components/angle-slider/index.jsx +146 -0
  13. package/dist/components/avatar/index.d.ts +49 -0
  14. package/dist/components/avatar/index.js +97 -0
  15. package/dist/components/avatar/index.jsx +90 -0
  16. package/dist/components/bottom-sheet/index.d.ts +80 -0
  17. package/dist/components/bottom-sheet/index.js +220 -0
  18. package/dist/components/bottom-sheet/index.jsx +179 -0
  19. package/dist/components/carousel/index.d.ts +98 -0
  20. package/dist/components/carousel/index.js +209 -0
  21. package/dist/components/carousel/index.jsx +194 -0
  22. package/dist/components/checkbox/index.d.ts +138 -0
  23. package/dist/components/checkbox/index.js +267 -0
  24. package/dist/components/checkbox/index.jsx +249 -0
  25. package/dist/components/client-only/index.d.ts +10 -0
  26. package/dist/components/client-only/index.js +24 -0
  27. package/dist/components/client-only/index.jsx +15 -0
  28. package/dist/components/clipboard/index.d.ts +72 -0
  29. package/dist/components/clipboard/index.js +151 -0
  30. package/dist/components/clipboard/index.jsx +134 -0
  31. package/dist/components/collapsible/index.d.ts +60 -0
  32. package/dist/components/collapsible/index.js +9 -0
  33. package/dist/components/collapsible/index.jsx +9 -0
  34. package/dist/components/collection/index.d.ts +3 -0
  35. package/dist/components/collection/index.js +4 -0
  36. package/dist/components/collection/index.jsx +4 -0
  37. package/dist/components/color-picker/index.d.ts +183 -0
  38. package/dist/components/color-picker/index.js +500 -0
  39. package/dist/components/color-picker/index.jsx +436 -0
  40. package/dist/components/combobox/index.d.ts +134 -0
  41. package/dist/components/combobox/index.js +357 -0
  42. package/dist/components/combobox/index.jsx +315 -0
  43. package/dist/components/date-picker/index.d.ts +165 -0
  44. package/dist/components/date-picker/index.js +476 -0
  45. package/dist/components/date-picker/index.jsx +415 -0
  46. package/dist/components/dialog/index.d.ts +80 -0
  47. package/dist/components/dialog/index.js +219 -0
  48. package/dist/components/dialog/index.jsx +173 -0
  49. package/dist/components/download-trigger/index.d.ts +25 -0
  50. package/dist/components/download-trigger/index.js +42 -0
  51. package/dist/components/download-trigger/index.jsx +38 -0
  52. package/dist/components/editable/index.d.ts +79 -0
  53. package/dist/components/editable/index.js +190 -0
  54. package/dist/components/editable/index.jsx +181 -0
  55. package/dist/components/field/index.d.ts +201 -0
  56. package/dist/components/field/index.js +10 -0
  57. package/dist/components/field/index.jsx +10 -0
  58. package/dist/components/fieldset/index.d.ts +109 -0
  59. package/dist/components/fieldset/index.js +9 -0
  60. package/dist/components/fieldset/index.jsx +9 -0
  61. package/dist/components/highlight/index.d.ts +15 -0
  62. package/dist/components/highlight/index.js +47 -0
  63. package/dist/components/highlight/index.jsx +31 -0
  64. package/dist/components/presence/index.d.ts +5 -0
  65. package/dist/components/presence/index.js +9 -0
  66. package/dist/components/presence/index.jsx +9 -0
  67. package/dist/components/select/index.d.ts +134 -0
  68. package/dist/components/select/index.js +363 -0
  69. package/dist/components/select/index.jsx +312 -0
  70. package/dist/compose-refs-BVVIB7xn.js +20 -0
  71. package/dist/compose-refs-icUeuyHm.jsx +20 -0
  72. package/dist/core-DbInRfhI.jsx +416 -0
  73. package/dist/core-oNB2jGcl.js +416 -0
  74. package/dist/create-split-props-B8A7_AF7.jsx +7 -0
  75. package/dist/create-split-props-pQu7jijw.js +7 -0
  76. package/dist/factory-4A25bngy.d.ts +14 -0
  77. package/dist/factory-Ch5jgk20.jsx +37 -0
  78. package/dist/factory-PGDAvOKb.js +43 -0
  79. package/dist/field-BRr9Zdes.jsx +260 -0
  80. package/dist/field-CoYiA2ek.js +288 -0
  81. package/dist/fieldset-B_LyllEa.jsx +169 -0
  82. package/dist/fieldset-BrJqMLEd.js +184 -0
  83. package/dist/index-C7N791Fc.d.ts +23 -0
  84. package/dist/index-GEfvAmRc.d.ts +76 -0
  85. package/dist/index-j2avJy7D.d.ts +38 -0
  86. package/dist/index-oc8gLl07.d.ts +38 -0
  87. package/dist/index.d.ts +5 -29
  88. package/dist/index.js +4 -511
  89. package/dist/index.jsx +4 -497
  90. package/dist/presence-Bmn43U_q.jsx +68 -0
  91. package/dist/presence-BpwBRlZW.js +81 -0
  92. package/dist/providers-Bo0OFe08.js +96 -0
  93. package/dist/providers-DFaRRd80.jsx +82 -0
  94. package/dist/render-strategy-BNECKEQk.d.ts +9 -0
  95. package/dist/render-strategy-CdJhRv3I.jsx +12 -0
  96. package/dist/render-strategy-DFlz7Uc4.js +12 -0
  97. package/dist/run-if-fn-A3VwXy-o.jsx +6 -0
  98. package/dist/run-if-fn-D5794CxE.js +6 -0
  99. package/dist/types-Dbw4va3W.d.ts +9 -0
  100. package/dist/utils/index.d.ts +1 -1
  101. package/dist/utils/index.js +2 -1
  102. package/dist/utils/index.jsx +2 -1
  103. package/dist/utils-DQi-Cen5.js +0 -0
  104. package/dist/utils-vSjszv0W.jsx +0 -0
  105. package/package.json +102 -2
  106. /package/dist/{utils-DSKoW7eB.jsx → create-context-C3rvZvkc.jsx} +0 -0
  107. /package/dist/{utils-GEMuT7an.js → create-context-GfQ_MylE.js} +0 -0
  108. /package/dist/{index-C_ThrXdH.d.ts → index-B6dBCfnB.d.ts} +0 -0
@@ -0,0 +1,267 @@
1
+ import { t as __export } from "../../chunk-B93cd-Dz.js";
2
+ import { i as useMachine, n as normalizeProps, r as mergeProps$2 } from "../../core-oNB2jGcl.js";
3
+ import { t as runIfFn } from "../../run-if-fn-D5794CxE.js";
4
+ import { t as createContext$1 } from "../../create-context-GfQ_MylE.js";
5
+ import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-Bo0OFe08.js";
6
+ import { t as createSplitProps } from "../../create-split-props-pQu7jijw.js";
7
+ import { t as sprawlify } from "../../factory-PGDAvOKb.js";
8
+ import "../../compose-refs-BVVIB7xn.js";
9
+ import { u as useFieldsetContext } from "../../fieldset-BrJqMLEd.js";
10
+ import { m as useFieldContext } from "../../field-CoYiA2ek.js";
11
+ import { createMemo, createSignal, createUniqueId, untrack } from "solid-js";
12
+ import { createComponent, mergeProps as mergeProps$1 } from "solid-js/web";
13
+ import * as checkbox from "@sprawlify/primitives/machines/checkbox";
14
+ import { anatomy } from "@sprawlify/primitives/machines/checkbox";
15
+
16
+ //#region src/components/checkbox/use-checkbox-context.ts
17
+ const [CheckboxProvider, useCheckboxContext] = createContext$1({
18
+ hookName: "useCheckboxContext",
19
+ providerName: "<CheckboxProvider />"
20
+ });
21
+
22
+ //#endregion
23
+ //#region src/components/checkbox/checkbox-context.tsx
24
+ const CheckboxContext = (props) => props.children(useCheckboxContext());
25
+
26
+ //#endregion
27
+ //#region src/components/checkbox/checkbox-control.tsx
28
+ const CheckboxControl = (props) => {
29
+ const checkbox$1 = useCheckboxContext();
30
+ const mergedProps = mergeProps$2(() => checkbox$1().getControlProps(), props);
31
+ return createComponent(sprawlify.div, mergedProps);
32
+ };
33
+
34
+ //#endregion
35
+ //#region src/components/checkbox/checkbox-anatomy.ts
36
+ const checkboxAnatomy = anatomy.extendWith("group");
37
+
38
+ //#endregion
39
+ //#region src/utils/use-controllable-state.ts
40
+ function useControllableState(props) {
41
+ const [uncontrolledValue, setUncontrolledValue] = createSignal(runIfFn(props.defaultValue));
42
+ const controlled = createMemo(() => props.value?.() !== void 0);
43
+ const currentValue = createMemo(() => controlled() ? props.value?.() : uncontrolledValue());
44
+ const setValue = (next) => {
45
+ untrack(() => {
46
+ const nextValue = runIfFn(next, currentValue());
47
+ if (controlled()) return props.onChange?.(nextValue);
48
+ setUncontrolledValue(nextValue);
49
+ return props.onChange?.(nextValue);
50
+ });
51
+ };
52
+ return [currentValue, setValue];
53
+ }
54
+
55
+ //#endregion
56
+ //#region src/components/checkbox/use-checkbox-group.ts
57
+ function useCheckboxGroup(props = {}) {
58
+ const fieldset = useFieldsetContext();
59
+ const disabled = () => props.disabled ?? fieldset?.()?.disabled;
60
+ const invalid = () => props.invalid ?? fieldset?.()?.invalid;
61
+ const interactive = createMemo(() => !(disabled() || props.readOnly));
62
+ const [value, setValue] = useControllableState({
63
+ value: props.value,
64
+ defaultValue: props.defaultValue || [],
65
+ onChange: props.onValueChange
66
+ });
67
+ return createMemo(() => {
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 = (itemProps) => {
84
+ return {
85
+ checked: itemProps.value != null ? isChecked(itemProps.value) : void 0,
86
+ onCheckedChange() {
87
+ if (itemProps.value != null) toggleValue(itemProps.value);
88
+ },
89
+ name: props.name,
90
+ disabled: disabled(),
91
+ readOnly: props.readOnly,
92
+ invalid: invalid()
93
+ };
94
+ };
95
+ return {
96
+ isChecked,
97
+ value,
98
+ name: props.name,
99
+ disabled: disabled(),
100
+ readOnly: props.readOnly,
101
+ invalid: invalid(),
102
+ setValue,
103
+ addValue,
104
+ toggleValue,
105
+ getItemProps
106
+ };
107
+ });
108
+ }
109
+
110
+ //#endregion
111
+ //#region src/components/checkbox/use-checkbox-group-context.tsx
112
+ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext$1({
113
+ hookName: "useCheckboxGroupContext",
114
+ providerName: "<CheckboxGroupProvider />",
115
+ strict: false
116
+ });
117
+
118
+ //#endregion
119
+ //#region src/components/checkbox/checkbox-group.tsx
120
+ const CheckboxGroup = (props) => {
121
+ const [checkboxGroupProps, localProps] = createSplitProps()(props, [
122
+ "defaultValue",
123
+ "value",
124
+ "onValueChange",
125
+ "disabled",
126
+ "invalid",
127
+ "readOnly",
128
+ "name"
129
+ ]);
130
+ return createComponent(CheckboxGroupContextProvider, {
131
+ value: useCheckboxGroup(checkboxGroupProps),
132
+ get children() {
133
+ return createComponent(sprawlify.div, mergeProps$1({ role: "group" }, localProps, () => checkboxAnatomy.build().group.attrs));
134
+ }
135
+ });
136
+ };
137
+
138
+ //#endregion
139
+ //#region src/components/checkbox/checkbox-group-provider.tsx
140
+ const CheckboxGroupProvider = (props) => {
141
+ const [localProps, restProps] = createSplitProps()(props, ["value"]);
142
+ return createComponent(CheckboxGroupContextProvider, {
143
+ get value() {
144
+ return localProps.value;
145
+ },
146
+ get children() {
147
+ return createComponent(sprawlify.div, mergeProps$1({ role: "group" }, restProps, () => checkboxAnatomy.build().group.attrs));
148
+ }
149
+ });
150
+ };
151
+
152
+ //#endregion
153
+ //#region src/components/checkbox/checkbox-hidden-input.tsx
154
+ const CheckboxHiddenInput = (props) => {
155
+ const checkbox$1 = useCheckboxContext();
156
+ const mergedProps = mergeProps$2(() => checkbox$1().getHiddenInputProps(), props);
157
+ const field = useFieldContext();
158
+ return createComponent(sprawlify.input, mergeProps$1({ get ["aria-describedby"]() {
159
+ return field?.().ariaDescribedby;
160
+ } }, mergedProps));
161
+ };
162
+
163
+ //#endregion
164
+ //#region src/components/checkbox/checkbox-indicator.tsx
165
+ const CheckboxIndicator = (props) => {
166
+ const [indicatorProps, localProps] = createSplitProps()(props, ["indeterminate"]);
167
+ const checkbox$1 = useCheckboxContext();
168
+ const mergedProps = mergeProps$2(() => checkbox$1().getIndicatorProps(), localProps);
169
+ return createComponent(sprawlify.div, mergeProps$1(mergedProps, { get hidden() {
170
+ return !(indicatorProps.indeterminate ? checkbox$1().indeterminate : checkbox$1().checked);
171
+ } }));
172
+ };
173
+
174
+ //#endregion
175
+ //#region src/components/checkbox/checkbox-label.tsx
176
+ const CheckboxLabel = (props) => {
177
+ const checkbox$1 = useCheckboxContext();
178
+ const mergedProps = mergeProps$2(() => checkbox$1().getLabelProps(), props);
179
+ return createComponent(sprawlify.span, mergedProps);
180
+ };
181
+
182
+ //#endregion
183
+ //#region src/components/checkbox/use-checkbox.ts
184
+ const useCheckbox = (ownProps = {}) => {
185
+ const checkboxGroup = useCheckboxGroupContext();
186
+ const props = createMemo(() => {
187
+ const resolvedProps = runIfFn(ownProps);
188
+ return mergeProps$2(resolvedProps, checkboxGroup?.().getItemProps({ value: resolvedProps.value }) ?? {});
189
+ });
190
+ const id = createUniqueId();
191
+ const locale = useLocaleContext();
192
+ const environment = useEnvironmentContext();
193
+ const field = useFieldContext();
194
+ const machineProps = createMemo(() => ({
195
+ id,
196
+ ids: {
197
+ label: field?.().ids.label,
198
+ hiddenInput: field?.().ids.control
199
+ },
200
+ disabled: field?.().disabled,
201
+ readOnly: field?.().readOnly,
202
+ invalid: field?.().invalid,
203
+ required: field?.().required,
204
+ dir: locale().dir,
205
+ getRootNode: environment().getRootNode,
206
+ ...props()
207
+ }));
208
+ const service = useMachine(checkbox.machine, machineProps);
209
+ return createMemo(() => checkbox.connect(service, normalizeProps));
210
+ };
211
+
212
+ //#endregion
213
+ //#region src/components/checkbox/checkbox-root.tsx
214
+ const CheckboxRoot = (props) => {
215
+ const [useCheckboxProps, labelprops] = createSplitProps()(props, [
216
+ "checked",
217
+ "defaultChecked",
218
+ "disabled",
219
+ "form",
220
+ "id",
221
+ "ids",
222
+ "invalid",
223
+ "name",
224
+ "onCheckedChange",
225
+ "readOnly",
226
+ "required",
227
+ "value"
228
+ ]);
229
+ const checkbox$1 = useCheckbox(useCheckboxProps);
230
+ const mergedProps = mergeProps$2(() => checkbox$1().getRootProps(), labelprops);
231
+ return createComponent(CheckboxProvider, {
232
+ value: checkbox$1,
233
+ get children() {
234
+ return createComponent(sprawlify.label, mergedProps);
235
+ }
236
+ });
237
+ };
238
+
239
+ //#endregion
240
+ //#region src/components/checkbox/checkbox-root-provider.tsx
241
+ const CheckboxRootProvider = (props) => {
242
+ const [{ value: checkbox$1 }, labelprops] = createSplitProps()(props, ["value"]);
243
+ const mergedProps = mergeProps$2(() => checkbox$1().getRootProps(), labelprops);
244
+ return createComponent(CheckboxProvider, {
245
+ value: checkbox$1,
246
+ get children() {
247
+ return createComponent(sprawlify.label, mergedProps);
248
+ }
249
+ });
250
+ };
251
+
252
+ //#endregion
253
+ //#region src/components/checkbox/checkbox.ts
254
+ var checkbox_exports = /* @__PURE__ */ __export({
255
+ Context: () => CheckboxContext,
256
+ Control: () => CheckboxControl,
257
+ Group: () => CheckboxGroup,
258
+ GroupProvider: () => CheckboxGroupProvider,
259
+ HiddenInput: () => CheckboxHiddenInput,
260
+ Indicator: () => CheckboxIndicator,
261
+ Label: () => CheckboxLabel,
262
+ Root: () => CheckboxRoot,
263
+ RootProvider: () => CheckboxRootProvider
264
+ });
265
+
266
+ //#endregion
267
+ export { checkbox_exports as Checkbox, CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxGroupProvider, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider, checkboxAnatomy, useCheckbox, useCheckboxContext, useCheckboxGroup, useCheckboxGroupContext };
@@ -0,0 +1,249 @@
1
+ import { t as __export } from "../../chunk-B5so6B0y.jsx";
2
+ import { i as useMachine, n as normalizeProps, r as mergeProps$1 } from "../../core-DbInRfhI.jsx";
3
+ import { t as runIfFn } from "../../run-if-fn-A3VwXy-o.jsx";
4
+ import { t as createContext$1 } from "../../create-context-C3rvZvkc.jsx";
5
+ import { i as useLocaleContext, o as useEnvironmentContext } from "../../providers-DFaRRd80.jsx";
6
+ import { t as createSplitProps } from "../../create-split-props-B8A7_AF7.jsx";
7
+ import { t as sprawlify } from "../../factory-Ch5jgk20.jsx";
8
+ import "../../compose-refs-icUeuyHm.jsx";
9
+ import { u as useFieldsetContext } from "../../fieldset-B_LyllEa.jsx";
10
+ import { m as useFieldContext } from "../../field-BRr9Zdes.jsx";
11
+ import { createMemo, createSignal, createUniqueId, untrack } from "solid-js";
12
+ import * as checkbox from "@sprawlify/primitives/machines/checkbox";
13
+ import { anatomy } from "@sprawlify/primitives/machines/checkbox";
14
+
15
+ //#region src/components/checkbox/use-checkbox-context.ts
16
+ const [CheckboxProvider, useCheckboxContext] = createContext$1({
17
+ hookName: "useCheckboxContext",
18
+ providerName: "<CheckboxProvider />"
19
+ });
20
+
21
+ //#endregion
22
+ //#region src/components/checkbox/checkbox-context.tsx
23
+ const CheckboxContext = (props) => props.children(useCheckboxContext());
24
+
25
+ //#endregion
26
+ //#region src/components/checkbox/checkbox-control.tsx
27
+ const CheckboxControl = (props) => {
28
+ const checkbox$1 = useCheckboxContext();
29
+ const mergedProps = mergeProps$1(() => checkbox$1().getControlProps(), props);
30
+ return <sprawlify.div {...mergedProps} />;
31
+ };
32
+
33
+ //#endregion
34
+ //#region src/components/checkbox/checkbox-anatomy.ts
35
+ const checkboxAnatomy = anatomy.extendWith("group");
36
+
37
+ //#endregion
38
+ //#region src/utils/use-controllable-state.ts
39
+ function useControllableState(props) {
40
+ const [uncontrolledValue, setUncontrolledValue] = createSignal(runIfFn(props.defaultValue));
41
+ const controlled = createMemo(() => props.value?.() !== void 0);
42
+ const currentValue = createMemo(() => controlled() ? props.value?.() : uncontrolledValue());
43
+ const setValue = (next) => {
44
+ untrack(() => {
45
+ const nextValue = runIfFn(next, currentValue());
46
+ if (controlled()) return props.onChange?.(nextValue);
47
+ setUncontrolledValue(nextValue);
48
+ return props.onChange?.(nextValue);
49
+ });
50
+ };
51
+ return [currentValue, setValue];
52
+ }
53
+
54
+ //#endregion
55
+ //#region src/components/checkbox/use-checkbox-group.ts
56
+ function useCheckboxGroup(props = {}) {
57
+ const fieldset = useFieldsetContext();
58
+ const disabled = () => props.disabled ?? fieldset?.()?.disabled;
59
+ const invalid = () => props.invalid ?? fieldset?.()?.invalid;
60
+ const interactive = createMemo(() => !(disabled() || props.readOnly));
61
+ const [value, setValue] = useControllableState({
62
+ value: props.value,
63
+ defaultValue: props.defaultValue || [],
64
+ onChange: props.onValueChange
65
+ });
66
+ return createMemo(() => {
67
+ const isChecked = (val) => {
68
+ return value().some((v) => String(v) === String(val));
69
+ };
70
+ const toggleValue = (val) => {
71
+ isChecked(val) ? removeValue(val) : addValue(val);
72
+ };
73
+ const addValue = (val) => {
74
+ if (!interactive()) return;
75
+ if (isChecked(val)) return;
76
+ setValue(value().concat(val));
77
+ };
78
+ const removeValue = (val) => {
79
+ if (!interactive()) return;
80
+ setValue(value().filter((v) => String(v) !== String(val)));
81
+ };
82
+ const getItemProps = (itemProps) => {
83
+ return {
84
+ checked: itemProps.value != null ? isChecked(itemProps.value) : void 0,
85
+ onCheckedChange() {
86
+ if (itemProps.value != null) toggleValue(itemProps.value);
87
+ },
88
+ name: props.name,
89
+ disabled: disabled(),
90
+ readOnly: props.readOnly,
91
+ invalid: invalid()
92
+ };
93
+ };
94
+ return {
95
+ isChecked,
96
+ value,
97
+ name: props.name,
98
+ disabled: disabled(),
99
+ readOnly: props.readOnly,
100
+ invalid: invalid(),
101
+ setValue,
102
+ addValue,
103
+ toggleValue,
104
+ getItemProps
105
+ };
106
+ });
107
+ }
108
+
109
+ //#endregion
110
+ //#region src/components/checkbox/use-checkbox-group-context.tsx
111
+ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext$1({
112
+ hookName: "useCheckboxGroupContext",
113
+ providerName: "<CheckboxGroupProvider />",
114
+ strict: false
115
+ });
116
+
117
+ //#endregion
118
+ //#region src/components/checkbox/checkbox-group.tsx
119
+ const CheckboxGroup = (props) => {
120
+ const [checkboxGroupProps, localProps] = createSplitProps()(props, [
121
+ "defaultValue",
122
+ "value",
123
+ "onValueChange",
124
+ "disabled",
125
+ "invalid",
126
+ "readOnly",
127
+ "name"
128
+ ]);
129
+ const checkboxGroup = useCheckboxGroup(checkboxGroupProps);
130
+ return <CheckboxGroupContextProvider value={checkboxGroup}>
131
+ <sprawlify.div role="group" {...localProps} {...checkboxAnatomy.build().group.attrs} />
132
+ </CheckboxGroupContextProvider>;
133
+ };
134
+
135
+ //#endregion
136
+ //#region src/components/checkbox/checkbox-group-provider.tsx
137
+ const CheckboxGroupProvider = (props) => {
138
+ const [localProps, restProps] = createSplitProps()(props, ["value"]);
139
+ return <CheckboxGroupContextProvider value={localProps.value}>
140
+ <sprawlify.div role="group" {...restProps} {...checkboxAnatomy.build().group.attrs} />
141
+ </CheckboxGroupContextProvider>;
142
+ };
143
+
144
+ //#endregion
145
+ //#region src/components/checkbox/checkbox-hidden-input.tsx
146
+ const CheckboxHiddenInput = (props) => {
147
+ const checkbox$1 = useCheckboxContext();
148
+ const mergedProps = mergeProps$1(() => checkbox$1().getHiddenInputProps(), props);
149
+ const field = useFieldContext();
150
+ return <sprawlify.input aria-describedby={field?.().ariaDescribedby} {...mergedProps} />;
151
+ };
152
+
153
+ //#endregion
154
+ //#region src/components/checkbox/checkbox-indicator.tsx
155
+ const CheckboxIndicator = (props) => {
156
+ const [indicatorProps, localProps] = createSplitProps()(props, ["indeterminate"]);
157
+ const checkbox$1 = useCheckboxContext();
158
+ const mergedProps = mergeProps$1(() => checkbox$1().getIndicatorProps(), localProps);
159
+ return <sprawlify.div {...mergedProps} hidden={!(indicatorProps.indeterminate ? checkbox$1().indeterminate : checkbox$1().checked)} />;
160
+ };
161
+
162
+ //#endregion
163
+ //#region src/components/checkbox/checkbox-label.tsx
164
+ const CheckboxLabel = (props) => {
165
+ const checkbox$1 = useCheckboxContext();
166
+ const mergedProps = mergeProps$1(() => checkbox$1().getLabelProps(), props);
167
+ return <sprawlify.span {...mergedProps} />;
168
+ };
169
+
170
+ //#endregion
171
+ //#region src/components/checkbox/use-checkbox.ts
172
+ const useCheckbox = (ownProps = {}) => {
173
+ const checkboxGroup = useCheckboxGroupContext();
174
+ const props = createMemo(() => {
175
+ const resolvedProps = runIfFn(ownProps);
176
+ return mergeProps$1(resolvedProps, checkboxGroup?.().getItemProps({ value: resolvedProps.value }) ?? {});
177
+ });
178
+ const id = createUniqueId();
179
+ const locale = useLocaleContext();
180
+ const environment = useEnvironmentContext();
181
+ const field = useFieldContext();
182
+ const machineProps = createMemo(() => ({
183
+ id,
184
+ ids: {
185
+ label: field?.().ids.label,
186
+ hiddenInput: field?.().ids.control
187
+ },
188
+ disabled: field?.().disabled,
189
+ readOnly: field?.().readOnly,
190
+ invalid: field?.().invalid,
191
+ required: field?.().required,
192
+ dir: locale().dir,
193
+ getRootNode: environment().getRootNode,
194
+ ...props()
195
+ }));
196
+ const service = useMachine(checkbox.machine, machineProps);
197
+ return createMemo(() => checkbox.connect(service, normalizeProps));
198
+ };
199
+
200
+ //#endregion
201
+ //#region src/components/checkbox/checkbox-root.tsx
202
+ const CheckboxRoot = (props) => {
203
+ const [useCheckboxProps, labelprops] = createSplitProps()(props, [
204
+ "checked",
205
+ "defaultChecked",
206
+ "disabled",
207
+ "form",
208
+ "id",
209
+ "ids",
210
+ "invalid",
211
+ "name",
212
+ "onCheckedChange",
213
+ "readOnly",
214
+ "required",
215
+ "value"
216
+ ]);
217
+ const checkbox$1 = useCheckbox(useCheckboxProps);
218
+ const mergedProps = mergeProps$1(() => checkbox$1().getRootProps(), labelprops);
219
+ return <CheckboxProvider value={checkbox$1}>
220
+ <sprawlify.label {...mergedProps} />
221
+ </CheckboxProvider>;
222
+ };
223
+
224
+ //#endregion
225
+ //#region src/components/checkbox/checkbox-root-provider.tsx
226
+ const CheckboxRootProvider = (props) => {
227
+ const [{ value: checkbox$1 }, labelprops] = createSplitProps()(props, ["value"]);
228
+ const mergedProps = mergeProps$1(() => checkbox$1().getRootProps(), labelprops);
229
+ return <CheckboxProvider value={checkbox$1}>
230
+ <sprawlify.label {...mergedProps} />
231
+ </CheckboxProvider>;
232
+ };
233
+
234
+ //#endregion
235
+ //#region src/components/checkbox/checkbox.ts
236
+ var checkbox_exports = /* @__PURE__ */ __export({
237
+ Context: () => CheckboxContext,
238
+ Control: () => CheckboxControl,
239
+ Group: () => CheckboxGroup,
240
+ GroupProvider: () => CheckboxGroupProvider,
241
+ HiddenInput: () => CheckboxHiddenInput,
242
+ Indicator: () => CheckboxIndicator,
243
+ Label: () => CheckboxLabel,
244
+ Root: () => CheckboxRoot,
245
+ RootProvider: () => CheckboxRootProvider
246
+ });
247
+
248
+ //#endregion
249
+ export { checkbox_exports as Checkbox, CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxGroupProvider, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider, checkboxAnatomy, useCheckbox, useCheckboxContext, useCheckboxGroup, useCheckboxGroupContext };
@@ -0,0 +1,10 @@
1
+ import { JSX } from "solid-js";
2
+
3
+ //#region src/components/client-only/client-only.d.ts
4
+ interface ClientOnlyProps {
5
+ children: JSX.Element;
6
+ fallback?: JSX.Element;
7
+ }
8
+ declare function ClientOnly(props: ClientOnlyProps): JSX.Element;
9
+ //#endregion
10
+ export { ClientOnly, type ClientOnlyProps };
@@ -0,0 +1,24 @@
1
+ import { Show, createSignal, onMount } from "solid-js";
2
+ import { createComponent } from "solid-js/web";
3
+
4
+ //#region src/components/client-only/client-only.tsx
5
+ function ClientOnly(props) {
6
+ const [isClient, setIsClient] = createSignal(false);
7
+ onMount(() => {
8
+ setIsClient(true);
9
+ });
10
+ return createComponent(Show, {
11
+ get when() {
12
+ return isClient();
13
+ },
14
+ get fallback() {
15
+ return props.fallback;
16
+ },
17
+ get children() {
18
+ return props.children;
19
+ }
20
+ });
21
+ }
22
+
23
+ //#endregion
24
+ export { ClientOnly };
@@ -0,0 +1,15 @@
1
+ import { Show, createSignal, onMount } from "solid-js";
2
+
3
+ //#region src/components/client-only/client-only.tsx
4
+ function ClientOnly(props) {
5
+ const [isClient, setIsClient] = createSignal(false);
6
+ onMount(() => {
7
+ setIsClient(true);
8
+ });
9
+ return <Show when={isClient()} fallback={props.fallback}>
10
+ {props.children}
11
+ </Show>;
12
+ }
13
+
14
+ //#endregion
15
+ export { ClientOnly };
@@ -0,0 +1,72 @@
1
+ import { n as PropTypes } from "../../index-C7N791Fc.js";
2
+ import { i as Optional, n as MaybeAccessor } from "../../types-Dbw4va3W.js";
3
+ import { n as PolymorphicProps, t as HTMLProps } from "../../factory-4A25bngy.js";
4
+ import * as solid_js164 from "solid-js";
5
+ import { Accessor, JSX } from "solid-js";
6
+ import * as clipboard from "@sprawlify/primitives/machines/clipboard";
7
+ import { CopyStatusDetails, CopyStatusDetails as ClipboardCopyStatusDetails, anatomy as clipboardAnatomy } from "@sprawlify/primitives/machines/clipboard";
8
+
9
+ //#region src/components/clipboard/use-clipboard.d.ts
10
+ interface UseClipboardProps extends Optional<Omit<clipboard.Props, 'dir' | 'getRootNode'>, 'id'> {}
11
+ interface UseClipboardReturn extends Accessor<clipboard.Api<PropTypes>> {}
12
+ declare const useClipboard: (props?: MaybeAccessor<UseClipboardProps>) => UseClipboardReturn;
13
+ //#endregion
14
+ //#region src/components/clipboard/use-clipboard-context.d.ts
15
+ interface UseClipboardContext extends UseClipboardReturn {}
16
+ //#endregion
17
+ //#region src/components/clipboard/clipboard-context.d.ts
18
+ interface ClipboardContextProps {
19
+ children: (context: UseClipboardContext) => JSX.Element;
20
+ }
21
+ declare const ClipboardContext: (props: ClipboardContextProps) => JSX.Element;
22
+ //#endregion
23
+ //#region src/components/clipboard/clipboard-control.d.ts
24
+ interface ClipboardControlBaseProps extends PolymorphicProps<'div'> {}
25
+ interface ClipboardControlProps extends HTMLProps<'div'>, ClipboardControlBaseProps {}
26
+ declare const ClipboardControl: (props: ClipboardControlProps) => solid_js164.JSX.Element;
27
+ //#endregion
28
+ //#region src/components/clipboard/clipboard-indicator.d.ts
29
+ interface IndicatorProps {
30
+ copied?: JSX.Element;
31
+ }
32
+ interface ClipboardIndicatorBaseProps extends IndicatorProps, PolymorphicProps<'div'> {}
33
+ interface ClipboardIndicatorProps extends HTMLProps<'div'>, ClipboardIndicatorBaseProps {}
34
+ declare const ClipboardIndicator: (props: ClipboardIndicatorProps) => JSX.Element;
35
+ //#endregion
36
+ //#region src/components/clipboard/clipboard-input.d.ts
37
+ interface ClipboardInputBaseProps extends PolymorphicProps<'input'> {}
38
+ interface ClipboardInputProps extends HTMLProps<'input'>, ClipboardInputBaseProps {}
39
+ declare const ClipboardInput: (props: ClipboardInputProps) => solid_js164.JSX.Element;
40
+ //#endregion
41
+ //#region src/components/clipboard/clipboard-label.d.ts
42
+ interface ClipboardLabelBaseProps extends PolymorphicProps<'label'> {}
43
+ interface ClipboardLabelProps extends HTMLProps<'label'>, ClipboardLabelBaseProps {}
44
+ declare const ClipboardLabel: (props: ClipboardLabelProps) => solid_js164.JSX.Element;
45
+ //#endregion
46
+ //#region src/components/clipboard/clipboard-root.d.ts
47
+ interface ClipboardRootBaseProps extends UseClipboardProps, PolymorphicProps<'div'> {}
48
+ interface ClipboardRootProps extends HTMLProps<'div'>, ClipboardRootBaseProps {}
49
+ declare const ClipboardRoot: (props: ClipboardRootProps) => solid_js164.JSX.Element;
50
+ //#endregion
51
+ //#region src/components/clipboard/clipboard-root-provider.d.ts
52
+ interface RootProviderProps {
53
+ value: UseClipboardReturn;
54
+ }
55
+ interface ClipboardRootProviderBaseProps extends PolymorphicProps<'div'> {}
56
+ interface ClipboardRootProviderProps extends HTMLProps<'div'>, RootProviderProps, ClipboardRootProviderBaseProps {}
57
+ declare const ClipboardRootProvider: (props: ClipboardRootProviderProps) => solid_js164.JSX.Element;
58
+ //#endregion
59
+ //#region src/components/clipboard/clipboard-trigger.d.ts
60
+ interface ClipboardTriggerBaseProps extends PolymorphicProps<'button'> {}
61
+ interface ClipboardTriggerProps extends HTMLProps<'button'>, ClipboardTriggerBaseProps {}
62
+ declare const ClipboardTrigger: (props: ClipboardTriggerProps) => solid_js164.JSX.Element;
63
+ //#endregion
64
+ //#region src/components/clipboard/clipboard-value-text.d.ts
65
+ interface ClipboardValueTextBaseProps extends PolymorphicProps<'span'> {}
66
+ interface ClipboardValueTextProps extends HTMLProps<'span'>, ClipboardValueTextBaseProps {}
67
+ declare const ClipboardValueText: (props: ClipboardValueTextProps) => solid_js164.JSX.Element;
68
+ declare namespace clipboard_d_exports {
69
+ export { ClipboardContext as Context, ClipboardContextProps as ContextProps, ClipboardControl as Control, ClipboardControlBaseProps as ControlBaseProps, ClipboardControlProps as ControlProps, CopyStatusDetails, ClipboardIndicator as Indicator, ClipboardIndicatorBaseProps as IndicatorBaseProps, ClipboardIndicatorProps as IndicatorProps, ClipboardInput as Input, ClipboardInputBaseProps as InputBaseProps, ClipboardInputProps as InputProps, ClipboardLabel as Label, ClipboardLabelBaseProps as LabelBaseProps, ClipboardLabelProps as LabelProps, ClipboardRoot as Root, ClipboardRootBaseProps as RootBaseProps, ClipboardRootProps as RootProps, ClipboardRootProvider as RootProvider, ClipboardRootProviderBaseProps as RootProviderBaseProps, ClipboardRootProviderProps as RootProviderProps, ClipboardTrigger as Trigger, ClipboardTriggerBaseProps as TriggerBaseProps, ClipboardTriggerProps as TriggerProps, ClipboardValueText as ValueText, ClipboardValueTextBaseProps as ValueTextBaseProps, ClipboardValueTextProps as ValueTextProps };
70
+ }
71
+ //#endregion
72
+ export { clipboard_d_exports as Clipboard, ClipboardContext, type ClipboardContextProps, ClipboardControl, type ClipboardControlBaseProps, type ClipboardControlProps, type ClipboardCopyStatusDetails, ClipboardIndicator, type ClipboardIndicatorBaseProps, type ClipboardIndicatorProps, ClipboardInput, type ClipboardInputBaseProps, type ClipboardInputProps, ClipboardLabel, type ClipboardLabelBaseProps, type ClipboardLabelProps, ClipboardRoot, type ClipboardRootBaseProps, type ClipboardRootProps, ClipboardRootProvider, type ClipboardRootProviderBaseProps, type ClipboardRootProviderProps, ClipboardTrigger, type ClipboardTriggerBaseProps, type ClipboardTriggerProps, ClipboardValueText, type ClipboardValueTextBaseProps, type ClipboardValueTextProps, type UseClipboardContext, type UseClipboardProps, type UseClipboardReturn, clipboardAnatomy, useClipboard, useClipboardContext };