beez-ui 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +31 -27
  2. package/README.md +22 -2
  3. package/dist/adapters/unpic-image.js +92 -14
  4. package/dist/components/alert-dialog.js +444 -26
  5. package/dist/components/alert.js +153 -18
  6. package/dist/components/animated-theme-toggler.js +215 -76
  7. package/dist/components/avatar.js +247 -15
  8. package/dist/components/badge.js +18 -16
  9. package/dist/components/button.js +85 -28
  10. package/dist/components/calendar.js +327 -68
  11. package/dist/components/card.js +39 -9
  12. package/dist/components/carousel.js +454 -84
  13. package/dist/components/checkbox.js +50 -3
  14. package/dist/components/data-table.js +827 -583
  15. package/dist/components/dialog.js +363 -22
  16. package/dist/components/dropdown-menu.js +543 -32
  17. package/dist/components/filter-query-bar.js +809 -468
  18. package/dist/components/filter-query-grammar.js +781 -736
  19. package/dist/components/form.js +305 -43
  20. package/dist/components/highlighter.js +142 -87
  21. package/dist/components/hover-card.js +97 -7
  22. package/dist/components/input-group.js +261 -41
  23. package/dist/components/input.js +8 -2
  24. package/dist/components/label.js +38 -3
  25. package/dist/components/link.js +45 -7
  26. package/dist/components/pagination.js +332 -16
  27. package/dist/components/popover.js +222 -16
  28. package/dist/components/radio-group.js +85 -5
  29. package/dist/components/select.js +451 -22
  30. package/dist/components/separator.js +43 -3
  31. package/dist/components/sheet.js +345 -22
  32. package/dist/components/sidebar.js +1385 -193
  33. package/dist/components/skeleton.js +6 -2
  34. package/dist/components/svgs/whatsappIcon.js +11 -1
  35. package/dist/components/switch.js +55 -3
  36. package/dist/components/table.js +288 -18
  37. package/dist/components/tabs.js +161 -18
  38. package/dist/components/textarea.js +7 -2
  39. package/dist/components/themed-toaster.js +63 -20
  40. package/dist/components/tooltip.js +128 -9
  41. package/dist/components/typing-animation.js +335 -150
  42. package/dist/constants/sidebar.js +1 -4
  43. package/dist/hooks/use-mobile.js +8 -8
  44. package/dist/hooks/use-sidebar-persistence.js +27 -27
  45. package/dist/lib/image-dimensions.js +2 -2
  46. package/dist/lib/year-month-filter.js +38 -40
  47. package/dist/next.js +69 -17
  48. package/dist/providers/beez-ui-provider.js +48 -7
  49. package/dist/providers/native-provider.js +40 -6
  50. package/dist/tanstack.js +35 -23
  51. package/package.json +4 -1
@@ -1,98 +1,468 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react/compiler-runtime";
3
3
  import * as React from "react";
4
4
  import useEmblaCarousel from "embla-carousel-react";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { Button } from "./button.js";
7
7
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  const CarouselContext = React.createContext(null);
9
10
  function useCarousel() {
10
- const context = React.useContext(CarouselContext);
11
- if (!context) {
12
- throw new Error("useCarousel must be used within a <Carousel />");
13
- }
14
- return context;
11
+ const context = React.useContext(CarouselContext);
12
+ if (!context) {
13
+ throw new Error("useCarousel must be used within a <Carousel />");
14
+ }
15
+ return context;
15
16
  }
16
- function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
17
- const [carouselRef, api] = useEmblaCarousel({
18
- ...opts,
19
- axis: orientation === "horizontal" ? "x" : "y",
20
- }, plugins);
21
- const [canScrollPrev, setCanScrollPrev] = React.useState(false);
22
- const [canScrollNext, setCanScrollNext] = React.useState(false);
23
- const onSelect = React.useCallback((api) => {
24
- if (!api)
25
- return;
26
- setCanScrollPrev(api.canScrollPrev());
27
- setCanScrollNext(api.canScrollNext());
28
- }, []);
29
- const scrollPrev = React.useCallback(() => {
30
- api?.scrollPrev();
31
- }, [api]);
32
- const scrollNext = React.useCallback(() => {
33
- api?.scrollNext();
34
- }, [api]);
35
- const handleKeyDown = React.useCallback((event) => {
36
- if (event.key === "ArrowLeft") {
37
- event.preventDefault();
38
- scrollPrev();
39
- }
40
- else if (event.key === "ArrowRight") {
41
- event.preventDefault();
42
- scrollNext();
43
- }
44
- }, [scrollPrev, scrollNext]);
45
- React.useEffect(() => {
46
- if (!api || !setApi)
47
- return;
48
- setApi(api);
49
- }, [api, setApi]);
50
- React.useEffect(() => {
51
- if (!api)
52
- return;
53
- let isMounted = true;
54
- queueMicrotask(() => {
55
- if (isMounted) {
56
- onSelect(api);
57
- }
58
- });
59
- api.on("reInit", onSelect);
60
- api.on("select", onSelect);
61
- return () => {
62
- isMounted = false;
63
- api?.off("reInit", onSelect);
64
- api?.off("select", onSelect);
65
- };
66
- }, [api, onSelect]);
67
- return (_jsx(CarouselContext.Provider, { value: {
68
- carouselRef,
69
- api: api,
70
- opts,
71
- orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
72
- scrollPrev,
73
- scrollNext,
74
- canScrollPrev,
75
- canScrollNext,
76
- }, children: _jsx("div", { onKeyDownCapture: handleKeyDown, className: cn("relative", className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
17
+ function Carousel(t0) {
18
+ const $ = _c(45);
19
+ let children;
20
+ let className;
21
+ let opts;
22
+ let plugins;
23
+ let props;
24
+ let setApi;
25
+ let t1;
26
+ if ($[0] !== t0) {
27
+ ({orientation: t1, opts, setApi, plugins, className, children, ...props} = t0);
28
+ $[0] = t0;
29
+ $[1] = children;
30
+ $[2] = className;
31
+ $[3] = opts;
32
+ $[4] = plugins;
33
+ $[5] = props;
34
+ $[6] = setApi;
35
+ $[7] = t1;
36
+ } else {
37
+ children = $[1];
38
+ className = $[2];
39
+ opts = $[3];
40
+ plugins = $[4];
41
+ props = $[5];
42
+ setApi = $[6];
43
+ t1 = $[7];
44
+ }
45
+ const orientation = t1 === undefined ? "horizontal" : t1;
46
+ const t2 = orientation === "horizontal" ? "x" : "y";
47
+ let t3;
48
+ if ($[8] !== opts || $[9] !== t2) {
49
+ t3 = {
50
+ ...opts,
51
+ axis: t2
52
+ };
53
+ $[8] = opts;
54
+ $[9] = t2;
55
+ $[10] = t3;
56
+ } else {
57
+ t3 = $[10];
58
+ }
59
+ const [carouselRef, api] = useEmblaCarousel(t3, plugins);
60
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
61
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
62
+ let t4;
63
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
64
+ t4 = (api_0) => {
65
+ if (!api_0) {
66
+ return;
67
+ }
68
+ setCanScrollPrev(api_0.canScrollPrev());
69
+ setCanScrollNext(api_0.canScrollNext());
70
+ };
71
+ $[11] = t4;
72
+ } else {
73
+ t4 = $[11];
74
+ }
75
+ const onSelect = t4;
76
+ let t5;
77
+ if ($[12] !== api) {
78
+ t5 = () => {
79
+ api?.scrollPrev();
80
+ };
81
+ $[12] = api;
82
+ $[13] = t5;
83
+ } else {
84
+ t5 = $[13];
85
+ }
86
+ const scrollPrev = t5;
87
+ let t6;
88
+ if ($[14] !== api) {
89
+ t6 = () => {
90
+ api?.scrollNext();
91
+ };
92
+ $[14] = api;
93
+ $[15] = t6;
94
+ } else {
95
+ t6 = $[15];
96
+ }
97
+ const scrollNext = t6;
98
+ let t7;
99
+ if ($[16] !== scrollNext || $[17] !== scrollPrev) {
100
+ t7 = (event) => {
101
+ if (event.key === "ArrowLeft") {
102
+ event.preventDefault();
103
+ scrollPrev();
104
+ } else {
105
+ if (event.key === "ArrowRight") {
106
+ event.preventDefault();
107
+ scrollNext();
108
+ }
109
+ }
110
+ };
111
+ $[16] = scrollNext;
112
+ $[17] = scrollPrev;
113
+ $[18] = t7;
114
+ } else {
115
+ t7 = $[18];
116
+ }
117
+ const handleKeyDown = t7;
118
+ let t8;
119
+ let t9;
120
+ if ($[19] !== api || $[20] !== setApi) {
121
+ t8 = () => {
122
+ if (!api || !setApi) {
123
+ return;
124
+ }
125
+ setApi(api);
126
+ };
127
+ t9 = [api, setApi];
128
+ $[19] = api;
129
+ $[20] = setApi;
130
+ $[21] = t8;
131
+ $[22] = t9;
132
+ } else {
133
+ t8 = $[21];
134
+ t9 = $[22];
135
+ }
136
+ React.useEffect(t8, t9);
137
+ let t10;
138
+ let t11;
139
+ if ($[23] !== api) {
140
+ t10 = () => {
141
+ if (!api) {
142
+ return;
143
+ }
144
+ let isMounted = true;
145
+ queueMicrotask(() => {
146
+ if (isMounted) {
147
+ onSelect(api);
148
+ }
149
+ });
150
+ api.on("reInit", onSelect);
151
+ api.on("select", onSelect);
152
+ return () => {
153
+ isMounted = false;
154
+ api?.off("reInit", onSelect);
155
+ api?.off("select", onSelect);
156
+ };
157
+ };
158
+ t11 = [api, onSelect];
159
+ $[23] = api;
160
+ $[24] = t10;
161
+ $[25] = t11;
162
+ } else {
163
+ t10 = $[24];
164
+ t11 = $[25];
165
+ }
166
+ React.useEffect(t10, t11);
167
+ const t12 = orientation || (opts?.axis === "y" ? "vertical" : "horizontal");
168
+ let t13;
169
+ if ($[26] !== api || $[27] !== canScrollNext || $[28] !== canScrollPrev || $[29] !== carouselRef || $[30] !== opts || $[31] !== scrollNext || $[32] !== scrollPrev || $[33] !== t12) {
170
+ t13 = {
171
+ carouselRef,
172
+ api,
173
+ opts,
174
+ orientation: t12,
175
+ scrollPrev,
176
+ scrollNext,
177
+ canScrollPrev,
178
+ canScrollNext
179
+ };
180
+ $[26] = api;
181
+ $[27] = canScrollNext;
182
+ $[28] = canScrollPrev;
183
+ $[29] = carouselRef;
184
+ $[30] = opts;
185
+ $[31] = scrollNext;
186
+ $[32] = scrollPrev;
187
+ $[33] = t12;
188
+ $[34] = t13;
189
+ } else {
190
+ t13 = $[34];
191
+ }
192
+ let t14;
193
+ if ($[35] !== className) {
194
+ t14 = cn("relative", className);
195
+ $[35] = className;
196
+ $[36] = t14;
197
+ } else {
198
+ t14 = $[36];
199
+ }
200
+ let t15;
201
+ if ($[37] !== children || $[38] !== handleKeyDown || $[39] !== props || $[40] !== t14) {
202
+ t15 = /* @__PURE__ */ _jsx("div", {
203
+ onKeyDownCapture: handleKeyDown,
204
+ className: t14,
205
+ role: "region",
206
+ "aria-roledescription": "carousel",
207
+ "data-slot": "carousel",
208
+ ...props,
209
+ children
210
+ });
211
+ $[37] = children;
212
+ $[38] = handleKeyDown;
213
+ $[39] = props;
214
+ $[40] = t14;
215
+ $[41] = t15;
216
+ } else {
217
+ t15 = $[41];
218
+ }
219
+ let t16;
220
+ if ($[42] !== t13 || $[43] !== t15) {
221
+ t16 = /* @__PURE__ */ _jsx(CarouselContext.Provider, {
222
+ value: t13,
223
+ children: t15
224
+ });
225
+ $[42] = t13;
226
+ $[43] = t15;
227
+ $[44] = t16;
228
+ } else {
229
+ t16 = $[44];
230
+ }
231
+ return t16;
77
232
  }
78
- function CarouselContent({ className, ...props }) {
79
- const { carouselRef, orientation } = useCarousel();
80
- return (_jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: _jsx("div", { className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className), ...props }) }));
233
+ function CarouselContent(t0) {
234
+ const $ = _c(12);
235
+ let className;
236
+ let props;
237
+ if ($[0] !== t0) {
238
+ ({className, ...props} = t0);
239
+ $[0] = t0;
240
+ $[1] = className;
241
+ $[2] = props;
242
+ } else {
243
+ className = $[1];
244
+ props = $[2];
245
+ }
246
+ const { carouselRef, orientation } = useCarousel();
247
+ const t1 = orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col";
248
+ let t2;
249
+ if ($[3] !== className || $[4] !== t1) {
250
+ t2 = cn("flex", t1, className);
251
+ $[3] = className;
252
+ $[4] = t1;
253
+ $[5] = t2;
254
+ } else {
255
+ t2 = $[5];
256
+ }
257
+ let t3;
258
+ if ($[6] !== props || $[7] !== t2) {
259
+ t3 = /* @__PURE__ */ _jsx("div", {
260
+ className: t2,
261
+ ...props
262
+ });
263
+ $[6] = props;
264
+ $[7] = t2;
265
+ $[8] = t3;
266
+ } else {
267
+ t3 = $[8];
268
+ }
269
+ let t4;
270
+ if ($[9] !== carouselRef || $[10] !== t3) {
271
+ t4 = /* @__PURE__ */ _jsx("div", {
272
+ ref: carouselRef,
273
+ className: "overflow-hidden",
274
+ "data-slot": "carousel-content",
275
+ children: t3
276
+ });
277
+ $[9] = carouselRef;
278
+ $[10] = t3;
279
+ $[11] = t4;
280
+ } else {
281
+ t4 = $[11];
282
+ }
283
+ return t4;
81
284
  }
82
- function CarouselItem({ className, ...props }) {
83
- const { orientation } = useCarousel();
84
- return (_jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className), ...props }));
285
+ function CarouselItem(t0) {
286
+ const $ = _c(9);
287
+ let className;
288
+ let props;
289
+ if ($[0] !== t0) {
290
+ ({className, ...props} = t0);
291
+ $[0] = t0;
292
+ $[1] = className;
293
+ $[2] = props;
294
+ } else {
295
+ className = $[1];
296
+ props = $[2];
297
+ }
298
+ const { orientation } = useCarousel();
299
+ const t1 = orientation === "horizontal" ? "pl-4" : "pt-4";
300
+ let t2;
301
+ if ($[3] !== className || $[4] !== t1) {
302
+ t2 = cn("min-w-0 shrink-0 grow-0 basis-full", t1, className);
303
+ $[3] = className;
304
+ $[4] = t1;
305
+ $[5] = t2;
306
+ } else {
307
+ t2 = $[5];
308
+ }
309
+ let t3;
310
+ if ($[6] !== props || $[7] !== t2) {
311
+ t3 = /* @__PURE__ */ _jsx("div", {
312
+ role: "group",
313
+ "aria-roledescription": "slide",
314
+ "data-slot": "carousel-item",
315
+ className: t2,
316
+ ...props
317
+ });
318
+ $[6] = props;
319
+ $[7] = t2;
320
+ $[8] = t3;
321
+ } else {
322
+ t3 = $[8];
323
+ }
324
+ return t3;
85
325
  }
86
- function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
87
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
88
- return (_jsxs(Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
89
- ? "top-1/2 -left-12 -translate-y-1/2"
90
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Previous slide" })] }));
326
+ function CarouselPrevious(t0) {
327
+ const $ = _c(17);
328
+ let className;
329
+ let props;
330
+ let t1;
331
+ let t2;
332
+ if ($[0] !== t0) {
333
+ ({className, variant: t1, size: t2, ...props} = t0);
334
+ $[0] = t0;
335
+ $[1] = className;
336
+ $[2] = props;
337
+ $[3] = t1;
338
+ $[4] = t2;
339
+ } else {
340
+ className = $[1];
341
+ props = $[2];
342
+ t1 = $[3];
343
+ t2 = $[4];
344
+ }
345
+ const variant = t1 === undefined ? "outline" : t1;
346
+ const size = t2 === undefined ? "icon-sm" : t2;
347
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
348
+ const t3 = orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90";
349
+ let t4;
350
+ if ($[5] !== className || $[6] !== t3) {
351
+ t4 = cn("absolute touch-manipulation rounded-full", t3, className);
352
+ $[5] = className;
353
+ $[6] = t3;
354
+ $[7] = t4;
355
+ } else {
356
+ t4 = $[7];
357
+ }
358
+ const t5 = !canScrollPrev;
359
+ let t6;
360
+ let t7;
361
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
362
+ t6 = /* @__PURE__ */ _jsx(ChevronLeftIcon, {});
363
+ t7 = /* @__PURE__ */ _jsx("span", {
364
+ className: "sr-only",
365
+ children: "Previous slide"
366
+ });
367
+ $[8] = t6;
368
+ $[9] = t7;
369
+ } else {
370
+ t6 = $[8];
371
+ t7 = $[9];
372
+ }
373
+ let t8;
374
+ if ($[10] !== props || $[11] !== scrollPrev || $[12] !== size || $[13] !== t4 || $[14] !== t5 || $[15] !== variant) {
375
+ t8 = /* @__PURE__ */ _jsxs(Button, {
376
+ "data-slot": "carousel-previous",
377
+ variant,
378
+ size,
379
+ className: t4,
380
+ disabled: t5,
381
+ onClick: scrollPrev,
382
+ ...props,
383
+ children: [t6, t7]
384
+ });
385
+ $[10] = props;
386
+ $[11] = scrollPrev;
387
+ $[12] = size;
388
+ $[13] = t4;
389
+ $[14] = t5;
390
+ $[15] = variant;
391
+ $[16] = t8;
392
+ } else {
393
+ t8 = $[16];
394
+ }
395
+ return t8;
91
396
  }
92
- function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
93
- const { orientation, scrollNext, canScrollNext } = useCarousel();
94
- return (_jsxs(Button, { "data-slot": "carousel-next", variant: variant, size: size, className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
95
- ? "top-1/2 -right-12 -translate-y-1/2"
96
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [_jsx(ChevronRightIcon, {}), _jsx("span", { className: "sr-only", children: "Next slide" })] }));
397
+ function CarouselNext(t0) {
398
+ const $ = _c(17);
399
+ let className;
400
+ let props;
401
+ let t1;
402
+ let t2;
403
+ if ($[0] !== t0) {
404
+ ({className, variant: t1, size: t2, ...props} = t0);
405
+ $[0] = t0;
406
+ $[1] = className;
407
+ $[2] = props;
408
+ $[3] = t1;
409
+ $[4] = t2;
410
+ } else {
411
+ className = $[1];
412
+ props = $[2];
413
+ t1 = $[3];
414
+ t2 = $[4];
415
+ }
416
+ const variant = t1 === undefined ? "outline" : t1;
417
+ const size = t2 === undefined ? "icon-sm" : t2;
418
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
419
+ const t3 = orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90";
420
+ let t4;
421
+ if ($[5] !== className || $[6] !== t3) {
422
+ t4 = cn("absolute touch-manipulation rounded-full", t3, className);
423
+ $[5] = className;
424
+ $[6] = t3;
425
+ $[7] = t4;
426
+ } else {
427
+ t4 = $[7];
428
+ }
429
+ const t5 = !canScrollNext;
430
+ let t6;
431
+ let t7;
432
+ if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
433
+ t6 = /* @__PURE__ */ _jsx(ChevronRightIcon, {});
434
+ t7 = /* @__PURE__ */ _jsx("span", {
435
+ className: "sr-only",
436
+ children: "Next slide"
437
+ });
438
+ $[8] = t6;
439
+ $[9] = t7;
440
+ } else {
441
+ t6 = $[8];
442
+ t7 = $[9];
443
+ }
444
+ let t8;
445
+ if ($[10] !== props || $[11] !== scrollNext || $[12] !== size || $[13] !== t4 || $[14] !== t5 || $[15] !== variant) {
446
+ t8 = /* @__PURE__ */ _jsxs(Button, {
447
+ "data-slot": "carousel-next",
448
+ variant,
449
+ size,
450
+ className: t4,
451
+ disabled: t5,
452
+ onClick: scrollNext,
453
+ ...props,
454
+ children: [t6, t7]
455
+ });
456
+ $[10] = props;
457
+ $[11] = scrollNext;
458
+ $[12] = size;
459
+ $[13] = t4;
460
+ $[14] = t5;
461
+ $[15] = variant;
462
+ $[16] = t8;
463
+ } else {
464
+ t8 = $[16];
465
+ }
466
+ return t8;
97
467
  }
98
- export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel, };
468
+ export { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel };
@@ -1,9 +1,56 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react/compiler-runtime";
3
+ import * as React from "react";
3
4
  import { Checkbox as CheckboxPrimitive } from "radix-ui";
4
5
  import { CheckIcon } from "lucide-react";
5
6
  import { cn } from "../lib/utils.js";
6
- function Checkbox({ className, ...props }) {
7
- return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ function Checkbox(t0) {
9
+ const $ = _c(9);
10
+ let className;
11
+ let props;
12
+ if ($[0] !== t0) {
13
+ ({className, ...props} = t0);
14
+ $[0] = t0;
15
+ $[1] = className;
16
+ $[2] = props;
17
+ } else {
18
+ className = $[1];
19
+ props = $[2];
20
+ }
21
+ let t1;
22
+ if ($[3] !== className) {
23
+ t1 = cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", className);
24
+ $[3] = className;
25
+ $[4] = t1;
26
+ } else {
27
+ t1 = $[4];
28
+ }
29
+ let t2;
30
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
31
+ t2 = /* @__PURE__ */ _jsx(CheckboxPrimitive.Indicator, {
32
+ "data-slot": "checkbox-indicator",
33
+ className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
34
+ children: /* @__PURE__ */ _jsx(CheckIcon, {})
35
+ });
36
+ $[5] = t2;
37
+ } else {
38
+ t2 = $[5];
39
+ }
40
+ let t3;
41
+ if ($[6] !== props || $[7] !== t1) {
42
+ t3 = /* @__PURE__ */ _jsx(CheckboxPrimitive.Root, {
43
+ "data-slot": "checkbox",
44
+ className: t1,
45
+ ...props,
46
+ children: t2
47
+ });
48
+ $[6] = props;
49
+ $[7] = t1;
50
+ $[8] = t3;
51
+ } else {
52
+ t3 = $[8];
53
+ }
54
+ return t3;
8
55
  }
9
56
  export { Checkbox };