@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.
Files changed (127) hide show
  1. package/dist/{collapsible-C5ZpjCRe.mjs → collapsible-B06GGGE7.mjs} +7 -4
  2. package/dist/{collapsible-D_cXuaRy.cjs → collapsible-D5kle6Bc.cjs} +12 -9
  3. package/dist/collection-BKabYqpE.cjs +229 -0
  4. package/dist/collection-DEsp9z6X.mjs +187 -0
  5. package/dist/components/accordion/index.cjs +19 -24
  6. package/dist/components/accordion/index.d.cts +11 -9
  7. package/dist/components/accordion/index.d.mts +11 -9
  8. package/dist/components/accordion/index.mjs +9 -14
  9. package/dist/components/angle-slider/index.cjs +12 -9
  10. package/dist/components/angle-slider/index.d.cts +13 -11
  11. package/dist/components/angle-slider/index.d.mts +13 -11
  12. package/dist/components/angle-slider/index.mjs +7 -4
  13. package/dist/components/avatar/index.cjs +128 -0
  14. package/dist/components/avatar/index.d.cts +49 -0
  15. package/dist/components/avatar/index.d.mts +49 -0
  16. package/dist/components/avatar/index.mjs +110 -0
  17. package/dist/components/bottom-sheet/index.cjs +213 -0
  18. package/dist/components/bottom-sheet/index.d.cts +80 -0
  19. package/dist/components/bottom-sheet/index.d.mts +81 -0
  20. package/dist/components/bottom-sheet/index.mjs +190 -0
  21. package/dist/components/carousel/index.cjs +263 -0
  22. package/dist/components/carousel/index.d.cts +95 -0
  23. package/dist/components/carousel/index.d.mts +95 -0
  24. package/dist/components/carousel/index.mjs +242 -0
  25. package/dist/components/checkbox/index.cjs +308 -0
  26. package/dist/components/checkbox/index.d.cts +115 -0
  27. package/dist/components/checkbox/index.d.mts +115 -0
  28. package/dist/components/checkbox/index.mjs +289 -0
  29. package/dist/components/client-only/index.cjs +14 -0
  30. package/dist/components/client-only/index.d.cts +8 -0
  31. package/dist/components/client-only/index.d.mts +8 -0
  32. package/dist/components/client-only/index.mjs +13 -0
  33. package/dist/components/clipboard/index.cjs +185 -0
  34. package/dist/components/clipboard/index.d.cts +71 -0
  35. package/dist/components/clipboard/index.d.mts +71 -0
  36. package/dist/components/clipboard/index.mjs +163 -0
  37. package/dist/components/collapsible/index.cjs +6 -3
  38. package/dist/components/collapsible/index.d.cts +10 -8
  39. package/dist/components/collapsible/index.d.mts +10 -8
  40. package/dist/components/collapsible/index.mjs +6 -3
  41. package/dist/components/collection/index.cjs +11 -0
  42. package/dist/components/collection/index.d.cts +2 -0
  43. package/dist/components/collection/index.d.mts +2 -0
  44. package/dist/components/collection/index.mjs +5 -0
  45. package/dist/components/color-picker/index.cjs +613 -0
  46. package/dist/components/color-picker/index.d.cts +181 -0
  47. package/dist/components/color-picker/index.d.mts +182 -0
  48. package/dist/components/color-picker/index.mjs +570 -0
  49. package/dist/components/combobox/index.cjs +416 -0
  50. package/dist/components/combobox/index.d.cts +132 -0
  51. package/dist/components/combobox/index.d.mts +133 -0
  52. package/dist/components/combobox/index.mjs +387 -0
  53. package/dist/components/field/index.cjs +27 -0
  54. package/dist/components/field/index.d.cts +116 -0
  55. package/dist/components/field/index.d.mts +116 -0
  56. package/dist/components/field/index.mjs +9 -0
  57. package/dist/components/fieldset/index.cjs +23 -0
  58. package/dist/components/fieldset/index.d.cts +73 -0
  59. package/dist/components/fieldset/index.d.mts +73 -0
  60. package/dist/components/fieldset/index.mjs +9 -0
  61. package/dist/components/highlight/index.cjs +32 -0
  62. package/dist/components/highlight/index.d.cts +14 -0
  63. package/dist/components/highlight/index.d.mts +14 -0
  64. package/dist/components/highlight/index.mjs +30 -0
  65. package/dist/components/portal/index.cjs +32 -0
  66. package/dist/components/portal/index.d.cts +11 -0
  67. package/dist/components/portal/index.d.mts +11 -0
  68. package/dist/components/portal/index.mjs +31 -0
  69. package/dist/components/presence/index.cjs +11 -0
  70. package/dist/components/presence/index.d.cts +2 -0
  71. package/dist/components/presence/index.d.mts +4 -0
  72. package/dist/components/presence/index.mjs +7 -0
  73. package/dist/components/select/index.cjs +419 -0
  74. package/dist/components/select/index.d.cts +132 -0
  75. package/dist/components/select/index.d.mts +133 -0
  76. package/dist/components/select/index.mjs +384 -0
  77. package/dist/{factory-DbgGeb_e.mjs → core-C0F-4KYH.mjs} +4 -154
  78. package/dist/{factory-CfqPG186.cjs → core-CPLjF6nm.cjs} +0 -198
  79. package/dist/{create-context-DCEySQ7J.cjs → create-context-D6DyFRSf.cjs} +1 -1
  80. package/dist/environment-BXkWNF2O.mjs +46 -0
  81. package/dist/environment-DLPiALpf.cjs +58 -0
  82. package/dist/factory-BbbIuDqa.d.mts +15 -0
  83. package/dist/factory-CDX-oCN5.cjs +81 -0
  84. package/dist/factory-DQlmCPH2.mjs +63 -0
  85. package/dist/factory-DaNWFLLN.d.cts +15 -0
  86. package/dist/field-CGCTFCx2.mjs +322 -0
  87. package/dist/field-CXhpW6zO.cjs +404 -0
  88. package/dist/fieldset-CuSSYZxV.cjs +237 -0
  89. package/dist/fieldset-poJ8RDvB.mjs +184 -0
  90. package/dist/index-BUN9wyVM.d.mts +34 -0
  91. package/dist/index-Dhthtdz_.d.mts +74 -0
  92. package/dist/index-DqRXPiW_.d.cts +34 -0
  93. package/dist/index-DsZldSch.d.cts +74 -0
  94. package/dist/index-DtdZfcpz.d.mts +25 -0
  95. package/dist/index.cjs +14 -11
  96. package/dist/index.d.cts +7 -5
  97. package/dist/index.d.mts +7 -5
  98. package/dist/index.mjs +6 -3
  99. package/dist/normalize-props-sqcs77GC.d.cts +13 -0
  100. package/dist/presence-2A4loEJY.mjs +71 -0
  101. package/dist/presence-BX1tNsGA.cjs +101 -0
  102. package/dist/providers-Bk3ALTxZ.cjs +78 -0
  103. package/dist/providers-CyTYcOU1.mjs +54 -0
  104. package/dist/render-strategy-D3w8btTD.mjs +13 -0
  105. package/dist/render-strategy-k1JmEGnq.cjs +30 -0
  106. package/dist/types-DYWV3uAj.d.cts +5 -0
  107. package/dist/types-FLvjyw__.d.mts +5 -0
  108. package/dist/use-event-BcyNH29h.mjs +19 -0
  109. package/dist/use-event-CGMgV6xB.cjs +25 -0
  110. package/dist/use-safe-layout-effect-BlOhFUAp.mjs +17 -0
  111. package/dist/use-safe-layout-effect-vuYaDIpT.cjs +35 -0
  112. package/dist/utils/index.cjs +2 -2
  113. package/dist/utils/index.d.cts +1 -1
  114. package/dist/utils/index.d.mts +1 -1
  115. package/dist/utils/index.mjs +2 -2
  116. package/package.json +152 -2
  117. package/dist/factory-CNfD9NVO.d.mts +0 -41
  118. package/dist/factory-D5qarvEF.d.cts +0 -29
  119. /package/dist/{chunk-DJTHdtxa.mjs → chunk-DLP0tNsH.mjs} +0 -0
  120. /package/dist/{create-context-DLMHiig4.mjs → create-context-CdjrBhu7.mjs} +0 -0
  121. /package/dist/{create-split-props-DvwGh64U.mjs → create-split-props-BJQdOyld.mjs} +0 -0
  122. /package/dist/{create-split-props-CSaOnJRj.cjs → create-split-props-CSkzaUOy.cjs} +0 -0
  123. /package/dist/{index--Dciu8yd.d.mts → index-BwTxN5vG.d.mts} +0 -0
  124. /package/dist/{index-wpUGMM30.d.cts → index-zOmANnUL.d.cts} +0 -0
  125. /package/dist/{render-strategy-G1aEn-1X.d.cts → render-strategy-CdpAg9jb.d.cts} +0 -0
  126. /package/dist/{render-strategy-D37ixdTi.d.mts → render-strategy-GetMScNK.d.mts} +0 -0
  127. /package/dist/{utils-BQjTDAMH.mjs → utils-DflO0-3U.mjs} +0 -0
@@ -0,0 +1,570 @@
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, r as composeRefs } from "../../factory-DQlmCPH2.mjs";
7
+ import { t as createSplitProps } from "../../create-split-props-BJQdOyld.mjs";
8
+ import { a as splitPresenceProps, i as usePresence, n as usePresenceContext, t as PresenceProvider } from "../../presence-2A4loEJY.mjs";
9
+ import "../../use-event-BcyNH29h.mjs";
10
+ import "../../use-safe-layout-effect-BlOhFUAp.mjs";
11
+ import { m as useFieldContext } from "../../field-CGCTFCx2.mjs";
12
+ import { forwardRef, useId } from "react";
13
+ import { jsx } from "react/jsx-runtime";
14
+ import * as colorPicker from "@sprawlify/primitives/machines/color-picker";
15
+ import { anatomy, parse as parseColor } from "@sprawlify/primitives/machines/color-picker";
16
+
17
+ //#region src/components/color-picker/use-color-picker-area-props-context.ts
18
+ const [ColorPickerAreaPropsProvider, useColorPickerAreaPropsContext] = createContext$1({
19
+ name: "ColorPickerAreaContext",
20
+ hookName: "useColorPickerAreaContext",
21
+ providerName: "<ColorPickerAreaProvider />"
22
+ });
23
+
24
+ //#endregion
25
+ //#region src/components/color-picker/use-color-picker-context.ts
26
+ const [ColorPickerProvider, useColorPickerContext] = createContext$1({
27
+ name: "ColorPickerContext",
28
+ hookName: "useColorPickerContext",
29
+ providerName: "<ColorPickerProvider />"
30
+ });
31
+
32
+ //#endregion
33
+ //#region src/components/color-picker/color-picker-area.tsx
34
+ const splitAreaProps = createSplitProps();
35
+ const ColorPickerArea = forwardRef((props, ref) => {
36
+ const [areaProps, localProps] = splitAreaProps(props, ["xChannel", "yChannel"]);
37
+ const mergedProps = mergeProps(useColorPickerContext().getAreaProps(areaProps), localProps);
38
+ return /* @__PURE__ */ jsx(ColorPickerAreaPropsProvider, {
39
+ value: areaProps,
40
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
41
+ ...mergedProps,
42
+ ref
43
+ })
44
+ });
45
+ });
46
+ ColorPickerArea.displayName = "ColorPickerArea";
47
+
48
+ //#endregion
49
+ //#region src/components/color-picker/color-picker-area-background.tsx
50
+ const ColorPickerAreaBackground = forwardRef((props, ref) => {
51
+ const colorPicker$1 = useColorPickerContext();
52
+ const areaProps = useColorPickerAreaPropsContext();
53
+ const mergedProps = mergeProps(colorPicker$1.getAreaBackgroundProps(areaProps), props);
54
+ return /* @__PURE__ */ jsx(sprawlify.div, {
55
+ ...mergedProps,
56
+ ref
57
+ });
58
+ });
59
+ ColorPickerAreaBackground.displayName = "ColorPickerAreaBackground";
60
+
61
+ //#endregion
62
+ //#region src/components/color-picker/color-picker-area-thumb.tsx
63
+ const ColorPickerAreaThumb = forwardRef((props, ref) => {
64
+ const colorPicker$1 = useColorPickerContext();
65
+ const areaProps = useColorPickerAreaPropsContext();
66
+ const mergedProps = mergeProps(colorPicker$1.getAreaThumbProps(areaProps), props);
67
+ return /* @__PURE__ */ jsx(sprawlify.div, {
68
+ ...mergedProps,
69
+ ref
70
+ });
71
+ });
72
+ ColorPickerAreaThumb.displayName = "ColorPickerAreaThumb";
73
+
74
+ //#endregion
75
+ //#region src/components/color-picker/color-picker-channel-input.tsx
76
+ const splitChannelInputProps = createSplitProps();
77
+ const ColorPickerChannelInput = forwardRef((props, ref) => {
78
+ const [channelProps, localProps] = splitChannelInputProps(props, ["channel", "orientation"]);
79
+ const mergedProps = mergeProps(useColorPickerContext().getChannelInputProps(channelProps), localProps);
80
+ return /* @__PURE__ */ jsx(sprawlify.input, {
81
+ ...mergedProps,
82
+ ref
83
+ });
84
+ });
85
+ ColorPickerChannelInput.displayName = "ColorPickerChannelInput";
86
+
87
+ //#endregion
88
+ //#region src/components/color-picker/use-color-picker-channel-props-context.ts
89
+ const [ColorPickerChannelPropsProvider, useColorPickerChannelPropsContext] = createContext$1({
90
+ name: "ColorPickerChannelSliderContext",
91
+ hookName: "useColorPickerChannelSliderContext",
92
+ providerName: "<ColorPickerChannelSliderProvider />"
93
+ });
94
+
95
+ //#endregion
96
+ //#region src/components/color-picker/use-color-picker-format-context.ts
97
+ const [ColorPickerFormatPropsProvider, useColorPickerFormatPropsContext] = createContext$1({
98
+ name: "ColorPickerFormatContext",
99
+ hookName: "useColorPickerFormatPropsContext",
100
+ providerName: "<ColorPickerFormatPropsProvider />",
101
+ strict: false
102
+ });
103
+
104
+ //#endregion
105
+ //#region src/components/color-picker/color-picker-channel-slider.tsx
106
+ const splitChannelProps = createSplitProps();
107
+ const ColorPickerChannelSlider = forwardRef((props, ref) => {
108
+ const [channelProps, localProps] = splitChannelProps(props, ["channel", "orientation"]);
109
+ const colorPicker$1 = useColorPickerContext();
110
+ const formatProps = useColorPickerFormatPropsContext();
111
+ const channelSliderProps = {
112
+ ...channelProps,
113
+ ...formatProps
114
+ };
115
+ const mergedProps = mergeProps(colorPicker$1.getChannelSliderProps(channelSliderProps), localProps);
116
+ return /* @__PURE__ */ jsx(ColorPickerChannelPropsProvider, {
117
+ value: channelProps,
118
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
119
+ ...mergedProps,
120
+ ref
121
+ })
122
+ });
123
+ });
124
+ ColorPickerChannelSlider.displayName = "ColorPickerChannelSlider";
125
+
126
+ //#endregion
127
+ //#region src/components/color-picker/color-picker-channel-slider-label.tsx
128
+ const ColorPickerChannelSliderLabel = forwardRef((props, ref) => {
129
+ const colorPicker$1 = useColorPickerContext();
130
+ const channelProps = useColorPickerChannelPropsContext();
131
+ const mergedProps = mergeProps(colorPicker$1.getChannelSliderLabelProps(channelProps), props);
132
+ return /* @__PURE__ */ jsx(sprawlify.label, {
133
+ ...mergedProps,
134
+ ref
135
+ });
136
+ });
137
+ ColorPickerChannelSliderLabel.displayName = "ColorPickerChannelSliderLabel";
138
+
139
+ //#endregion
140
+ //#region src/components/color-picker/color-picker-channel-slider-thumb.tsx
141
+ const ColorPickerChannelSliderThumb = forwardRef((props, ref) => {
142
+ const colorPicker$1 = useColorPickerContext();
143
+ const channelProps = useColorPickerChannelPropsContext();
144
+ const formatProps = useColorPickerFormatPropsContext();
145
+ const channelSliderProps = {
146
+ ...channelProps,
147
+ ...formatProps
148
+ };
149
+ const mergedProps = mergeProps(colorPicker$1.getChannelSliderThumbProps(channelSliderProps), props);
150
+ return /* @__PURE__ */ jsx(sprawlify.div, {
151
+ ...mergedProps,
152
+ ref
153
+ });
154
+ });
155
+ ColorPickerChannelSliderThumb.displayName = "ColorPickerChannelSliderThumb";
156
+
157
+ //#endregion
158
+ //#region src/components/color-picker/color-picker-channel-slider-track.tsx
159
+ const ColorPickerChannelSliderTrack = forwardRef((props, ref) => {
160
+ const colorPicker$1 = useColorPickerContext();
161
+ const channelProps = useColorPickerChannelPropsContext();
162
+ const formatProps = useColorPickerFormatPropsContext();
163
+ const channelSliderProps = {
164
+ ...channelProps,
165
+ ...formatProps
166
+ };
167
+ const mergedProps = mergeProps(colorPicker$1.getChannelSliderTrackProps(channelSliderProps), props);
168
+ return /* @__PURE__ */ jsx(sprawlify.div, {
169
+ ...mergedProps,
170
+ ref
171
+ });
172
+ });
173
+ ColorPickerChannelSliderTrack.displayName = "ColorPickerChannelSliderTrack";
174
+
175
+ //#endregion
176
+ //#region src/components/color-picker/color-picker-channel-slider-value-text.tsx
177
+ const ColorPickerChannelSliderValueText = forwardRef((props, ref) => {
178
+ const { locale } = useLocaleContext();
179
+ const colorPicker$1 = useColorPickerContext();
180
+ const channelProps = useColorPickerChannelPropsContext();
181
+ const mergedProps = mergeProps(colorPicker$1.getChannelSliderValueTextProps(channelProps), props);
182
+ return /* @__PURE__ */ jsx(sprawlify.span, {
183
+ ...mergedProps,
184
+ ref,
185
+ children: props.children || colorPicker$1.getChannelValueText(channelProps.channel, locale)
186
+ });
187
+ });
188
+ ColorPickerChannelSliderValueText.displayName = "ColorPickerChannelSliderValueText";
189
+
190
+ //#endregion
191
+ //#region src/components/color-picker/color-picker-content.tsx
192
+ const ColorPickerContent = forwardRef((props, ref) => {
193
+ const colorPicker$1 = useColorPickerContext();
194
+ const presence = usePresenceContext();
195
+ const mergedProps = mergeProps(colorPicker$1.getContentProps(), presence.getPresenceProps(), props);
196
+ if (presence.unmounted) return null;
197
+ return /* @__PURE__ */ jsx(sprawlify.div, {
198
+ ...mergedProps,
199
+ ref: composeRefs(presence.ref, ref)
200
+ });
201
+ });
202
+ ColorPickerContent.displayName = "ColorPickerContent";
203
+
204
+ //#endregion
205
+ //#region src/components/color-picker/color-picker-context.tsx
206
+ const ColorPickerContext = (props) => props.children(useColorPickerContext());
207
+
208
+ //#endregion
209
+ //#region src/components/color-picker/color-picker-control.tsx
210
+ const ColorPickerControl = forwardRef((props, ref) => {
211
+ const mergedProps = mergeProps(useColorPickerContext().getControlProps(), props);
212
+ return /* @__PURE__ */ jsx(sprawlify.div, {
213
+ ...mergedProps,
214
+ ref
215
+ });
216
+ });
217
+ ColorPickerControl.displayName = "ColorPickerControl";
218
+
219
+ //#endregion
220
+ //#region src/components/color-picker/color-picker-eye-dropper-trigger.tsx
221
+ const ColorPickerEyeDropperTrigger = forwardRef((props, ref) => {
222
+ const mergedProps = mergeProps(useColorPickerContext().getEyeDropperTriggerProps(), props);
223
+ return /* @__PURE__ */ jsx(sprawlify.button, {
224
+ ...mergedProps,
225
+ ref
226
+ });
227
+ });
228
+ ColorPickerEyeDropperTrigger.displayName = "ColorPickerEyeDropperTrigger";
229
+
230
+ //#endregion
231
+ //#region src/components/color-picker/color-picker-format-select.tsx
232
+ const ColorPickerFormatSelect = forwardRef((props, ref) => {
233
+ const mergedProps = mergeProps(useColorPickerContext().getFormatSelectProps(), props);
234
+ return /* @__PURE__ */ jsx(sprawlify.select, {
235
+ ...mergedProps,
236
+ ref,
237
+ children: [
238
+ "rgba",
239
+ "hsla",
240
+ "hsba"
241
+ ].map((format) => /* @__PURE__ */ jsx(sprawlify.option, {
242
+ value: format,
243
+ children: format
244
+ }, format))
245
+ });
246
+ });
247
+ ColorPickerFormatSelect.displayName = "ColorPickerFormatSelect";
248
+
249
+ //#endregion
250
+ //#region src/components/color-picker/color-picker-format-trigger.tsx
251
+ const ColorPickerFormatTrigger = forwardRef((props, ref) => {
252
+ const mergedProps = mergeProps(useColorPickerContext().getFormatTriggerProps(), props);
253
+ return /* @__PURE__ */ jsx(sprawlify.button, {
254
+ ...mergedProps,
255
+ ref
256
+ });
257
+ });
258
+ ColorPickerFormatTrigger.displayName = "ColorPickerFormatTrigger";
259
+
260
+ //#endregion
261
+ //#region src/components/color-picker/color-picker-hidden-input.tsx
262
+ const ColorPickerHiddenInput = forwardRef((props, ref) => {
263
+ const mergedProps = mergeProps(useColorPickerContext().getHiddenInputProps(), props);
264
+ const field = useFieldContext();
265
+ return /* @__PURE__ */ jsx(sprawlify.input, {
266
+ "aria-describedby": field?.ariaDescribedby,
267
+ ...mergedProps,
268
+ ref
269
+ });
270
+ });
271
+ ColorPickerHiddenInput.displayName = "ColorPickerHiddenInput";
272
+
273
+ //#endregion
274
+ //#region src/components/color-picker/color-picker-label.tsx
275
+ const ColorPickerLabel = forwardRef((props, ref) => {
276
+ const mergedProps = mergeProps(useColorPickerContext().getLabelProps(), props);
277
+ return /* @__PURE__ */ jsx(sprawlify.label, {
278
+ ...mergedProps,
279
+ ref
280
+ });
281
+ });
282
+ ColorPickerLabel.displayName = "ColorPickerLabel";
283
+
284
+ //#endregion
285
+ //#region src/components/color-picker/color-picker-positioner.tsx
286
+ const ColorPickerPositioner = forwardRef((props, ref) => {
287
+ const mergedProps = mergeProps(useColorPickerContext().getPositionerProps(), props);
288
+ if (usePresenceContext().unmounted) return null;
289
+ return /* @__PURE__ */ jsx(sprawlify.div, {
290
+ ...mergedProps,
291
+ ref
292
+ });
293
+ });
294
+ ColorPickerPositioner.displayName = "ColorPickerPositioner";
295
+
296
+ //#endregion
297
+ //#region src/components/color-picker/use-color-picker.ts
298
+ const useColorPicker = (props) => {
299
+ const id = useId();
300
+ const { getRootNode } = useEnvironmentContext();
301
+ const { dir } = useLocaleContext();
302
+ const field = useFieldContext();
303
+ const machineProps = {
304
+ id,
305
+ ids: {
306
+ label: field?.ids.label,
307
+ input: field?.ids.control
308
+ },
309
+ dir,
310
+ disabled: field?.disabled,
311
+ invalid: field?.invalid,
312
+ readOnly: field?.readOnly,
313
+ required: field?.required,
314
+ getRootNode,
315
+ ...props
316
+ };
317
+ const service = useMachine(colorPicker.machine, machineProps);
318
+ return colorPicker.connect(service, normalizeProps);
319
+ };
320
+
321
+ //#endregion
322
+ //#region src/components/color-picker/color-picker-root.tsx
323
+ const splitRootProps = createSplitProps();
324
+ const ColorPickerRoot = forwardRef((props, ref) => {
325
+ const [presenceProps, colorPickerProps] = splitPresenceProps(props);
326
+ const [useColorPickerProps, localProps] = splitRootProps(colorPickerProps, [
327
+ "closeOnSelect",
328
+ "defaultOpen",
329
+ "defaultValue",
330
+ "defaultFormat",
331
+ "disabled",
332
+ "format",
333
+ "id",
334
+ "ids",
335
+ "initialFocusEl",
336
+ "invalid",
337
+ "name",
338
+ "name",
339
+ "onFocusOutside",
340
+ "onFormatChange",
341
+ "onInteractOutside",
342
+ "onOpenChange",
343
+ "onPointerDownOutside",
344
+ "onValueChange",
345
+ "onValueChangeEnd",
346
+ "open",
347
+ "openAutoFocus",
348
+ "positioning",
349
+ "readOnly",
350
+ "required",
351
+ "inline",
352
+ "value"
353
+ ]);
354
+ const colorPicker$1 = useColorPicker(useColorPickerProps);
355
+ const presence = usePresence(mergeProps({ present: colorPicker$1.open }, presenceProps));
356
+ const mergedProps = mergeProps(colorPicker$1.getRootProps(), localProps);
357
+ return /* @__PURE__ */ jsx(ColorPickerProvider, {
358
+ value: colorPicker$1,
359
+ children: /* @__PURE__ */ jsx(PresenceProvider, {
360
+ value: presence,
361
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
362
+ ...mergedProps,
363
+ ref
364
+ })
365
+ })
366
+ });
367
+ });
368
+ ColorPickerRoot.displayName = "ColorPickerRoot";
369
+
370
+ //#endregion
371
+ //#region src/components/color-picker/color-picker-root-provider.tsx
372
+ const splitRootProviderProps = createSplitProps();
373
+ const ColorPickerRootProvider = forwardRef((props, ref) => {
374
+ const [presenceProps, colorPickerProps] = splitPresenceProps(props);
375
+ const [{ value: colorPicker$1 }, localProps] = splitRootProviderProps(colorPickerProps, ["value"]);
376
+ const presence = usePresence(mergeProps({ present: colorPicker$1.open }, presenceProps));
377
+ const mergedProps = mergeProps(colorPicker$1.getRootProps(), localProps);
378
+ return /* @__PURE__ */ jsx(ColorPickerProvider, {
379
+ value: colorPicker$1,
380
+ children: /* @__PURE__ */ jsx(PresenceProvider, {
381
+ value: presence,
382
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
383
+ ...mergedProps,
384
+ ref
385
+ })
386
+ })
387
+ });
388
+ });
389
+ ColorPickerRootProvider.displayName = "ColorPickerRootProvider";
390
+
391
+ //#endregion
392
+ //#region src/components/color-picker/use-color-picker-swatch-props-context.ts
393
+ const [ColorPickerSwatchPropsProvider, useColorPickerSwatchPropsContext] = createContext$1({
394
+ name: "ColorPickerSwatchContext",
395
+ hookName: "useColorPickerSwatchContext",
396
+ providerName: "<ColorPickerSwatchProvider />"
397
+ });
398
+
399
+ //#endregion
400
+ //#region src/components/color-picker/color-picker-swatch.tsx
401
+ const splitSwatchProps = createSplitProps();
402
+ const ColorPickerSwatch = forwardRef((props, ref) => {
403
+ const [swatwchProps, localProps] = splitSwatchProps(props, ["respectAlpha", "value"]);
404
+ const mergedProps = mergeProps(useColorPickerContext().getSwatchProps(swatwchProps), localProps);
405
+ return /* @__PURE__ */ jsx(ColorPickerSwatchPropsProvider, {
406
+ value: swatwchProps,
407
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
408
+ ...mergedProps,
409
+ ref
410
+ })
411
+ });
412
+ });
413
+ ColorPickerSwatch.displayName = "ColorPickerSwatch";
414
+
415
+ //#endregion
416
+ //#region src/components/color-picker/color-picker-swatch-group.tsx
417
+ const ColorPickerSwatchGroup = forwardRef((props, ref) => {
418
+ const mergedProps = mergeProps(useColorPickerContext().getSwatchGroupProps(), props);
419
+ return /* @__PURE__ */ jsx(sprawlify.div, {
420
+ ...mergedProps,
421
+ ref
422
+ });
423
+ });
424
+ ColorPickerSwatchGroup.displayName = "ColorPickerSwatchGroup";
425
+
426
+ //#endregion
427
+ //#region src/components/color-picker/color-picker-swatch-indicator.tsx
428
+ const ColorPickerSwatchIndicator = forwardRef((props, ref) => {
429
+ const colorPicker$1 = useColorPickerContext();
430
+ const swatchProps = useColorPickerSwatchPropsContext();
431
+ const mergedProps = mergeProps(colorPicker$1.getSwatchIndicatorProps(swatchProps), props);
432
+ return /* @__PURE__ */ jsx(sprawlify.div, {
433
+ ...mergedProps,
434
+ ref
435
+ });
436
+ });
437
+ ColorPickerSwatchIndicator.displayName = "ColorPickerSwatchIndicator";
438
+
439
+ //#endregion
440
+ //#region src/components/color-picker/color-picker-swatch-trigger.tsx
441
+ const splitSwatchTriggerProps = createSplitProps();
442
+ const ColorPickerSwatchTrigger = forwardRef((props, ref) => {
443
+ const [triggerProps, localProps] = splitSwatchTriggerProps(props, ["value", "disabled"]);
444
+ const mergedProps = mergeProps(useColorPickerContext().getSwatchTriggerProps(triggerProps), localProps);
445
+ return /* @__PURE__ */ jsx(sprawlify.button, {
446
+ ...mergedProps,
447
+ ref
448
+ });
449
+ });
450
+ ColorPickerSwatchTrigger.displayName = "ColorPickerSwatchTrigger";
451
+
452
+ //#endregion
453
+ //#region src/components/color-picker/color-picker-transparency-grid.tsx
454
+ const splitTransparencyGridProps = createSplitProps();
455
+ const ColorPickerTransparencyGrid = forwardRef((props, ref) => {
456
+ const [gridProps, localProps] = splitTransparencyGridProps(props, ["size"]);
457
+ const mergedProps = mergeProps(useColorPickerContext().getTransparencyGridProps(gridProps), localProps);
458
+ return /* @__PURE__ */ jsx(sprawlify.div, {
459
+ ...mergedProps,
460
+ ref
461
+ });
462
+ });
463
+ ColorPickerTransparencyGrid.displayName = "ColorPickerTransparencyGrid";
464
+
465
+ //#endregion
466
+ //#region src/components/color-picker/color-picker-trigger.tsx
467
+ const ColorPickerTrigger = forwardRef((props, ref) => {
468
+ const mergedProps = mergeProps(useColorPickerContext().getTriggerProps(), props);
469
+ return /* @__PURE__ */ jsx(sprawlify.button, {
470
+ ...mergedProps,
471
+ ref
472
+ });
473
+ });
474
+ ColorPickerTrigger.displayName = "ColorPickerTrigger";
475
+
476
+ //#endregion
477
+ //#region src/components/color-picker/color-picker-value-swatch.tsx
478
+ const splitValueSwatchProps = createSplitProps();
479
+ const ColorPickerValueSwatch = forwardRef((props, ref) => {
480
+ const [{ respectAlpha }, localProps] = splitValueSwatchProps(props, ["respectAlpha"]);
481
+ const colorPicker$1 = useColorPickerContext();
482
+ const swatchProps = {
483
+ respectAlpha,
484
+ value: colorPicker$1.valueAsString
485
+ };
486
+ const mergedProps = mergeProps(colorPicker$1.getSwatchProps(swatchProps), localProps);
487
+ return /* @__PURE__ */ jsx(ColorPickerSwatchPropsProvider, {
488
+ value: swatchProps,
489
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
490
+ ...mergedProps,
491
+ ref
492
+ })
493
+ });
494
+ });
495
+ ColorPickerValueSwatch.displayName = "ColorPickerValueSwatch";
496
+
497
+ //#endregion
498
+ //#region src/components/color-picker/color-picker-value-text.tsx
499
+ const ColorPickerValueText = forwardRef((props, ref) => {
500
+ const { children, format, ...localProps } = props;
501
+ const colorPicker$1 = useColorPickerContext();
502
+ const mergedProps = mergeProps(colorPicker$1.getValueTextProps(), localProps);
503
+ const valueAsString = format ? colorPicker$1.value.toString(format) : colorPicker$1.valueAsString;
504
+ return /* @__PURE__ */ jsx(sprawlify.span, {
505
+ ...mergedProps,
506
+ ref,
507
+ children: children || valueAsString
508
+ });
509
+ });
510
+ ColorPickerValueText.displayName = "ColorPickerValueText";
511
+
512
+ //#endregion
513
+ //#region src/components/color-picker/color-picker-anatomy.ts
514
+ const colorPickerAnatomy = anatomy.extendWith("view");
515
+
516
+ //#endregion
517
+ //#region src/components/color-picker/color-picker-view.tsx
518
+ const splitFormatOptions = createSplitProps();
519
+ const ColorPickerView = forwardRef((props, ref) => {
520
+ const colorPicker$1 = useColorPickerContext();
521
+ const [formatProps, restProps] = splitFormatOptions(props, ["format"]);
522
+ if (colorPicker$1.format !== formatProps.format) return null;
523
+ return /* @__PURE__ */ jsx(ColorPickerFormatPropsProvider, {
524
+ value: formatProps,
525
+ children: /* @__PURE__ */ jsx(sprawlify.div, {
526
+ ref,
527
+ "data-format": props.format,
528
+ ...colorPickerAnatomy.build().view.attrs,
529
+ ...restProps
530
+ })
531
+ });
532
+ });
533
+ ColorPickerView.displayName = "ColorPickerView";
534
+
535
+ //#endregion
536
+ //#region src/components/color-picker/color-picker.ts
537
+ var color_picker_exports = /* @__PURE__ */ __export({
538
+ Area: () => ColorPickerArea,
539
+ AreaBackground: () => ColorPickerAreaBackground,
540
+ AreaThumb: () => ColorPickerAreaThumb,
541
+ ChannelInput: () => ColorPickerChannelInput,
542
+ ChannelSlider: () => ColorPickerChannelSlider,
543
+ ChannelSliderLabel: () => ColorPickerChannelSliderLabel,
544
+ ChannelSliderThumb: () => ColorPickerChannelSliderThumb,
545
+ ChannelSliderTrack: () => ColorPickerChannelSliderTrack,
546
+ ChannelSliderValueText: () => ColorPickerChannelSliderValueText,
547
+ Content: () => ColorPickerContent,
548
+ Context: () => ColorPickerContext,
549
+ Control: () => ColorPickerControl,
550
+ EyeDropperTrigger: () => ColorPickerEyeDropperTrigger,
551
+ FormatSelect: () => ColorPickerFormatSelect,
552
+ FormatTrigger: () => ColorPickerFormatTrigger,
553
+ HiddenInput: () => ColorPickerHiddenInput,
554
+ Label: () => ColorPickerLabel,
555
+ Positioner: () => ColorPickerPositioner,
556
+ Root: () => ColorPickerRoot,
557
+ RootProvider: () => ColorPickerRootProvider,
558
+ Swatch: () => ColorPickerSwatch,
559
+ SwatchGroup: () => ColorPickerSwatchGroup,
560
+ SwatchIndicator: () => ColorPickerSwatchIndicator,
561
+ SwatchTrigger: () => ColorPickerSwatchTrigger,
562
+ TransparencyGrid: () => ColorPickerTransparencyGrid,
563
+ Trigger: () => ColorPickerTrigger,
564
+ ValueSwatch: () => ColorPickerValueSwatch,
565
+ ValueText: () => ColorPickerValueText,
566
+ View: () => ColorPickerView
567
+ });
568
+
569
+ //#endregion
570
+ export { color_picker_exports as ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderLabel, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerChannelSliderValueText, ColorPickerContent, ColorPickerContext, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerFormatSelect, ColorPickerFormatTrigger, ColorPickerHiddenInput, ColorPickerLabel, ColorPickerPositioner, ColorPickerRoot, ColorPickerRootProvider, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchIndicator, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueSwatch, ColorPickerValueText, ColorPickerView, colorPickerAnatomy, parseColor, useColorPicker, useColorPickerContext };