@arcadeai/design-system 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -45,7 +45,7 @@ npm install react react-dom tailwindcss lucide-react
45
45
  Import the design system styles in your main CSS file or at the root of your application:
46
46
 
47
47
  ```css
48
- @import '@arcadeai/design-system/dist/index.css';
48
+ @import '@arcadeai/design-system/dist/assets/index.css';
49
49
  ```
50
50
 
51
51
  ### 2. Configure Tailwind CSS
@@ -2,39 +2,40 @@ import { Accordion as r, AccordionContent as t, AccordionItem as a, AccordionTri
2
2
  import { Alert as l, AlertDescription as p, AlertTitle as d } from "./ui/atoms/alert.js";
3
3
  import { Avatar as b, AvatarFallback as S, AvatarImage as u } from "./ui/atoms/avatar.js";
4
4
  import { Badge as g, badgeVariants as c } from "./ui/atoms/badge.js";
5
- import { Breadcrumb as x, BreadcrumbEllipsis as f, BreadcrumbItem as s, BreadcrumbLink as D, BreadcrumbList as M, BreadcrumbPage as h, BreadcrumbSeparator as B } from "./ui/atoms/breadcrumb.js";
5
+ import { Breadcrumb as T, BreadcrumbEllipsis as f, BreadcrumbItem as s, BreadcrumbLink as D, BreadcrumbList as M, BreadcrumbPage as h, BreadcrumbSeparator as B } from "./ui/atoms/breadcrumb.js";
6
6
  import { Button as F, buttonVariants as I } from "./ui/atoms/button.js";
7
7
  import { ByocBadge as v } from "./ui/atoms/byoc-badge.js";
8
8
  import { Card as G, CardAction as L, CardContent as H, CardDescription as R, CardFooter as k, CardHeader as y, CardTitle as V } from "./ui/atoms/card.js";
9
9
  import { ChartContainer as E, ChartLegend as O, ChartLegendContent as U, ChartStyle as j, ChartTooltip as q, ChartTooltipContent as J } from "./ui/atoms/chart.js";
10
- import { Collapsible as N, CollapsibleContent as Q, CollapsibleTrigger as W } from "./ui/atoms/collapsible.js";
11
- import { Command as Y, CommandDialog as Z, CommandEmpty as _, CommandGroup as $, CommandInput as ee, CommandItem as oe, CommandList as re, CommandSeparator as te, CommandShortcut as ae } from "./ui/atoms/command.js";
12
- import { Dialog as ie, DialogClose as le, DialogContent as pe, DialogDescription as de, DialogFooter as me, DialogHeader as be, DialogOverlay as Se, DialogPortal as ue, DialogTitle as Ce, DialogTrigger as ge } from "./ui/atoms/dialog.js";
13
- import { DropdownMenu as Te, DropdownMenuCheckboxItem as xe, DropdownMenuContent as fe, DropdownMenuGroup as se, DropdownMenuItem as De, DropdownMenuLabel as Me, DropdownMenuPortal as he, DropdownMenuRadioGroup as Be, DropdownMenuRadioItem as we, DropdownMenuSeparator as Fe, DropdownMenuShortcut as Ie, DropdownMenuSub as Ae, DropdownMenuSubContent as ve, DropdownMenuSubTrigger as Pe, DropdownMenuTrigger as Ge } from "./ui/atoms/dropdown-menu.js";
14
- import { Form as He, FormControl as Re, FormDescription as ke, FormField as ye, FormItem as Ve, FormLabel as ze, FormMessage as Ee, useFormField as Oe } from "./ui/atoms/form.js";
15
- import { HoverCard as je, HoverCardContent as qe, HoverCardTrigger as Je } from "./ui/atoms/hover-card.js";
16
- import { Input as Ne } from "./ui/atoms/input.js";
17
- import { Label as We } from "./ui/atoms/label.js";
18
- import { MobileTooltip as Ye, MobileTooltipContent as Ze, MobileTooltipProvider as _e, MobileTooltipTrigger as $e } from "./ui/atoms/mobile-tooltip.js";
19
- import { Popover as oo, PopoverAnchor as ro, PopoverContent as to, PopoverTrigger as ao } from "./ui/atoms/popover.js";
20
- import { ProBadge as io } from "./ui/atoms/pro-badge.js";
21
- import { Progress as po } from "./ui/atoms/progress.js";
22
- import { RadioGroup as bo, RadioGroupItem as So } from "./ui/atoms/radio-group.js";
23
- import { ResizableHandle as Co, ResizablePanel as go, ResizablePanelGroup as co } from "./ui/atoms/resizable.js";
24
- import { ScrollArea as xo, ScrollBar as fo } from "./ui/atoms/scroll-area.js";
25
- import { Select as Do, SelectContent as Mo, SelectGroup as ho, SelectItem as Bo, SelectLabel as wo, SelectScrollDownButton as Fo, SelectScrollUpButton as Io, SelectSeparator as Ao, SelectTrigger as vo, SelectValue as Po } from "./ui/atoms/select.js";
26
- import { Separator as Lo } from "./ui/atoms/separator.js";
27
- import { Sheet as Ro, SheetClose as ko, SheetContent as yo, SheetDescription as Vo, SheetFooter as zo, SheetHeader as Eo, SheetTitle as Oo, SheetTrigger as Uo } from "./ui/atoms/sheet.js";
28
- import { Sidebar as qo, SidebarContent as Jo, SidebarFooter as Ko, SidebarGroup as No, SidebarGroupAction as Qo, SidebarGroupContent as Wo, SidebarGroupLabel as Xo, SidebarHeader as Yo, SidebarInput as Zo, SidebarInset as _o, SidebarMenu as $o, SidebarMenuAction as er, SidebarMenuBadge as or, SidebarMenuButton as rr, SidebarMenuItem as tr, SidebarMenuSkeleton as ar, SidebarMenuSub as nr, SidebarMenuSubButton as ir, SidebarMenuSubItem as lr, SidebarProvider as pr, SidebarRail as dr, SidebarSeparator as mr, SidebarTrigger as br, useSidebar as Sr } from "./ui/atoms/sidebar.js";
29
- import { Skeleton as Cr } from "./ui/atoms/skeleton.js";
30
- import { Slider as cr } from "./ui/atoms/slider.js";
31
- import { Switch as xr } from "./ui/atoms/switch.js";
32
- import { Table as sr, TableBody as Dr, TableCaption as Mr, TableCell as hr, TableFooter as Br, TableHead as wr, TableHeader as Fr, TableRow as Ir } from "./ui/atoms/table.js";
33
- import { Tabs as vr, TabsContent as Pr, TabsList as Gr, TabsTrigger as Lr } from "./ui/atoms/tabs.js";
34
- import { Textarea as Rr } from "./ui/atoms/textarea.js";
35
- import { Toggle as yr, toggleVariants as Vr } from "./ui/atoms/toggle.js";
36
- import { Tooltip as Er, TooltipContent as Or, TooltipProvider as Ur, TooltipTrigger as jr } from "./ui/atoms/tooltip.js";
37
- import { useFormContext as Jr } from "react-hook-form";
10
+ import { Checkbox as N } from "./ui/atoms/checkbox.js";
11
+ import { Collapsible as W, CollapsibleContent as X, CollapsibleTrigger as Y } from "./ui/atoms/collapsible.js";
12
+ import { Command as _, CommandDialog as $, CommandEmpty as ee, CommandGroup as oe, CommandInput as re, CommandItem as te, CommandList as ae, CommandSeparator as ne, CommandShortcut as ie } from "./ui/atoms/command.js";
13
+ import { Dialog as pe, DialogClose as de, DialogContent as me, DialogDescription as be, DialogFooter as Se, DialogHeader as ue, DialogOverlay as Ce, DialogPortal as ge, DialogTitle as ce, DialogTrigger as xe } from "./ui/atoms/dialog.js";
14
+ import { DropdownMenu as fe, DropdownMenuCheckboxItem as se, DropdownMenuContent as De, DropdownMenuGroup as Me, DropdownMenuItem as he, DropdownMenuLabel as Be, DropdownMenuPortal as we, DropdownMenuRadioGroup as Fe, DropdownMenuRadioItem as Ie, DropdownMenuSeparator as Ae, DropdownMenuShortcut as ve, DropdownMenuSub as Pe, DropdownMenuSubContent as Ge, DropdownMenuSubTrigger as Le, DropdownMenuTrigger as He } from "./ui/atoms/dropdown-menu.js";
15
+ import { Form as ke, FormControl as ye, FormDescription as Ve, FormField as ze, FormItem as Ee, FormLabel as Oe, FormMessage as Ue, useFormField as je } from "./ui/atoms/form.js";
16
+ import { HoverCard as Je, HoverCardContent as Ke, HoverCardTrigger as Ne } from "./ui/atoms/hover-card.js";
17
+ import { Input as We } from "./ui/atoms/input.js";
18
+ import { Label as Ye } from "./ui/atoms/label.js";
19
+ import { MobileTooltip as _e, MobileTooltipContent as $e, MobileTooltipProvider as eo, MobileTooltipTrigger as oo } from "./ui/atoms/mobile-tooltip.js";
20
+ import { Popover as to, PopoverAnchor as ao, PopoverContent as no, PopoverTrigger as io } from "./ui/atoms/popover.js";
21
+ import { ProBadge as po } from "./ui/atoms/pro-badge.js";
22
+ import { Progress as bo } from "./ui/atoms/progress.js";
23
+ import { RadioGroup as uo, RadioGroupItem as Co } from "./ui/atoms/radio-group.js";
24
+ import { ResizableHandle as co, ResizablePanel as xo, ResizablePanelGroup as To } from "./ui/atoms/resizable.js";
25
+ import { ScrollArea as so, ScrollBar as Do } from "./ui/atoms/scroll-area.js";
26
+ import { Select as ho, SelectContent as Bo, SelectGroup as wo, SelectItem as Fo, SelectLabel as Io, SelectScrollDownButton as Ao, SelectScrollUpButton as vo, SelectSeparator as Po, SelectTrigger as Go, SelectValue as Lo } from "./ui/atoms/select.js";
27
+ import { Separator as Ro } from "./ui/atoms/separator.js";
28
+ import { Sheet as yo, SheetClose as Vo, SheetContent as zo, SheetDescription as Eo, SheetFooter as Oo, SheetHeader as Uo, SheetTitle as jo, SheetTrigger as qo } from "./ui/atoms/sheet.js";
29
+ import { Sidebar as Ko, SidebarContent as No, SidebarFooter as Qo, SidebarGroup as Wo, SidebarGroupAction as Xo, SidebarGroupContent as Yo, SidebarGroupLabel as Zo, SidebarHeader as _o, SidebarInput as $o, SidebarInset as er, SidebarMenu as or, SidebarMenuAction as rr, SidebarMenuBadge as tr, SidebarMenuButton as ar, SidebarMenuItem as nr, SidebarMenuSkeleton as ir, SidebarMenuSub as lr, SidebarMenuSubButton as pr, SidebarMenuSubItem as dr, SidebarProvider as mr, SidebarRail as br, SidebarSeparator as Sr, SidebarTrigger as ur, useSidebar as Cr } from "./ui/atoms/sidebar.js";
30
+ import { Skeleton as cr } from "./ui/atoms/skeleton.js";
31
+ import { Slider as Tr } from "./ui/atoms/slider.js";
32
+ import { Switch as sr } from "./ui/atoms/switch.js";
33
+ import { Table as Mr, TableBody as hr, TableCaption as Br, TableCell as wr, TableFooter as Fr, TableHead as Ir, TableHeader as Ar, TableRow as vr } from "./ui/atoms/table.js";
34
+ import { Tabs as Gr, TabsContent as Lr, TabsList as Hr, TabsTrigger as Rr } from "./ui/atoms/tabs.js";
35
+ import { Textarea as yr } from "./ui/atoms/textarea.js";
36
+ import { Toggle as zr, toggleVariants as Er } from "./ui/atoms/toggle.js";
37
+ import { Tooltip as Ur, TooltipContent as jr, TooltipProvider as qr, TooltipTrigger as Jr } from "./ui/atoms/tooltip.js";
38
+ import { useFormContext as Nr } from "react-hook-form";
38
39
  export {
39
40
  r as Accordion,
40
41
  t as AccordionContent,
@@ -47,7 +48,7 @@ export {
47
48
  S as AvatarFallback,
48
49
  u as AvatarImage,
49
50
  g as Badge,
50
- x as Breadcrumb,
51
+ T as Breadcrumb,
51
52
  f as BreadcrumbEllipsis,
52
53
  s as BreadcrumbItem,
53
54
  D as BreadcrumbLink,
@@ -69,139 +70,140 @@ export {
69
70
  j as ChartStyle,
70
71
  q as ChartTooltip,
71
72
  J as ChartTooltipContent,
72
- N as Collapsible,
73
- Q as CollapsibleContent,
74
- W as CollapsibleTrigger,
75
- Y as Command,
76
- Z as CommandDialog,
77
- _ as CommandEmpty,
78
- $ as CommandGroup,
79
- ee as CommandInput,
80
- oe as CommandItem,
81
- re as CommandList,
82
- te as CommandSeparator,
83
- ae as CommandShortcut,
84
- ie as Dialog,
85
- le as DialogClose,
86
- pe as DialogContent,
87
- de as DialogDescription,
88
- me as DialogFooter,
89
- be as DialogHeader,
90
- Se as DialogOverlay,
91
- ue as DialogPortal,
92
- Ce as DialogTitle,
93
- ge as DialogTrigger,
94
- Te as DropdownMenu,
95
- xe as DropdownMenuCheckboxItem,
96
- fe as DropdownMenuContent,
97
- se as DropdownMenuGroup,
98
- De as DropdownMenuItem,
99
- Me as DropdownMenuLabel,
100
- he as DropdownMenuPortal,
101
- Be as DropdownMenuRadioGroup,
102
- we as DropdownMenuRadioItem,
103
- Fe as DropdownMenuSeparator,
104
- Ie as DropdownMenuShortcut,
105
- Ae as DropdownMenuSub,
106
- ve as DropdownMenuSubContent,
107
- Pe as DropdownMenuSubTrigger,
108
- Ge as DropdownMenuTrigger,
109
- He as Form,
110
- Re as FormControl,
111
- ke as FormDescription,
112
- ye as FormField,
113
- Ve as FormItem,
114
- ze as FormLabel,
115
- Ee as FormMessage,
116
- je as HoverCard,
117
- qe as HoverCardContent,
118
- Je as HoverCardTrigger,
119
- Ne as Input,
120
- We as Label,
121
- Ye as MobileTooltip,
122
- Ze as MobileTooltipContent,
123
- _e as MobileTooltipProvider,
124
- $e as MobileTooltipTrigger,
125
- oo as Popover,
126
- ro as PopoverAnchor,
127
- to as PopoverContent,
128
- ao as PopoverTrigger,
129
- io as ProBadge,
130
- po as Progress,
131
- bo as RadioGroup,
132
- So as RadioGroupItem,
133
- Co as ResizableHandle,
134
- go as ResizablePanel,
135
- co as ResizablePanelGroup,
136
- xo as ScrollArea,
137
- fo as ScrollBar,
138
- Do as Select,
139
- Mo as SelectContent,
140
- ho as SelectGroup,
141
- Bo as SelectItem,
142
- wo as SelectLabel,
143
- Fo as SelectScrollDownButton,
144
- Io as SelectScrollUpButton,
145
- Ao as SelectSeparator,
146
- vo as SelectTrigger,
147
- Po as SelectValue,
148
- Lo as Separator,
149
- Ro as Sheet,
150
- ko as SheetClose,
151
- yo as SheetContent,
152
- Vo as SheetDescription,
153
- zo as SheetFooter,
154
- Eo as SheetHeader,
155
- Oo as SheetTitle,
156
- Uo as SheetTrigger,
157
- qo as Sidebar,
158
- Jo as SidebarContent,
159
- Ko as SidebarFooter,
160
- No as SidebarGroup,
161
- Qo as SidebarGroupAction,
162
- Wo as SidebarGroupContent,
163
- Xo as SidebarGroupLabel,
164
- Yo as SidebarHeader,
165
- Zo as SidebarInput,
166
- _o as SidebarInset,
167
- $o as SidebarMenu,
168
- er as SidebarMenuAction,
169
- or as SidebarMenuBadge,
170
- rr as SidebarMenuButton,
171
- tr as SidebarMenuItem,
172
- ar as SidebarMenuSkeleton,
173
- nr as SidebarMenuSub,
174
- ir as SidebarMenuSubButton,
175
- lr as SidebarMenuSubItem,
176
- pr as SidebarProvider,
177
- dr as SidebarRail,
178
- mr as SidebarSeparator,
179
- br as SidebarTrigger,
180
- Cr as Skeleton,
181
- cr as Slider,
182
- xr as Switch,
183
- sr as Table,
184
- Dr as TableBody,
185
- Mr as TableCaption,
186
- hr as TableCell,
187
- Br as TableFooter,
188
- wr as TableHead,
189
- Fr as TableHeader,
190
- Ir as TableRow,
191
- vr as Tabs,
192
- Pr as TabsContent,
193
- Gr as TabsList,
194
- Lr as TabsTrigger,
195
- Rr as Textarea,
196
- yr as Toggle,
197
- Er as Tooltip,
198
- Or as TooltipContent,
199
- Ur as TooltipProvider,
200
- jr as TooltipTrigger,
73
+ N as Checkbox,
74
+ W as Collapsible,
75
+ X as CollapsibleContent,
76
+ Y as CollapsibleTrigger,
77
+ _ as Command,
78
+ $ as CommandDialog,
79
+ ee as CommandEmpty,
80
+ oe as CommandGroup,
81
+ re as CommandInput,
82
+ te as CommandItem,
83
+ ae as CommandList,
84
+ ne as CommandSeparator,
85
+ ie as CommandShortcut,
86
+ pe as Dialog,
87
+ de as DialogClose,
88
+ me as DialogContent,
89
+ be as DialogDescription,
90
+ Se as DialogFooter,
91
+ ue as DialogHeader,
92
+ Ce as DialogOverlay,
93
+ ge as DialogPortal,
94
+ ce as DialogTitle,
95
+ xe as DialogTrigger,
96
+ fe as DropdownMenu,
97
+ se as DropdownMenuCheckboxItem,
98
+ De as DropdownMenuContent,
99
+ Me as DropdownMenuGroup,
100
+ he as DropdownMenuItem,
101
+ Be as DropdownMenuLabel,
102
+ we as DropdownMenuPortal,
103
+ Fe as DropdownMenuRadioGroup,
104
+ Ie as DropdownMenuRadioItem,
105
+ Ae as DropdownMenuSeparator,
106
+ ve as DropdownMenuShortcut,
107
+ Pe as DropdownMenuSub,
108
+ Ge as DropdownMenuSubContent,
109
+ Le as DropdownMenuSubTrigger,
110
+ He as DropdownMenuTrigger,
111
+ ke as Form,
112
+ ye as FormControl,
113
+ Ve as FormDescription,
114
+ ze as FormField,
115
+ Ee as FormItem,
116
+ Oe as FormLabel,
117
+ Ue as FormMessage,
118
+ Je as HoverCard,
119
+ Ke as HoverCardContent,
120
+ Ne as HoverCardTrigger,
121
+ We as Input,
122
+ Ye as Label,
123
+ _e as MobileTooltip,
124
+ $e as MobileTooltipContent,
125
+ eo as MobileTooltipProvider,
126
+ oo as MobileTooltipTrigger,
127
+ to as Popover,
128
+ ao as PopoverAnchor,
129
+ no as PopoverContent,
130
+ io as PopoverTrigger,
131
+ po as ProBadge,
132
+ bo as Progress,
133
+ uo as RadioGroup,
134
+ Co as RadioGroupItem,
135
+ co as ResizableHandle,
136
+ xo as ResizablePanel,
137
+ To as ResizablePanelGroup,
138
+ so as ScrollArea,
139
+ Do as ScrollBar,
140
+ ho as Select,
141
+ Bo as SelectContent,
142
+ wo as SelectGroup,
143
+ Fo as SelectItem,
144
+ Io as SelectLabel,
145
+ Ao as SelectScrollDownButton,
146
+ vo as SelectScrollUpButton,
147
+ Po as SelectSeparator,
148
+ Go as SelectTrigger,
149
+ Lo as SelectValue,
150
+ Ro as Separator,
151
+ yo as Sheet,
152
+ Vo as SheetClose,
153
+ zo as SheetContent,
154
+ Eo as SheetDescription,
155
+ Oo as SheetFooter,
156
+ Uo as SheetHeader,
157
+ jo as SheetTitle,
158
+ qo as SheetTrigger,
159
+ Ko as Sidebar,
160
+ No as SidebarContent,
161
+ Qo as SidebarFooter,
162
+ Wo as SidebarGroup,
163
+ Xo as SidebarGroupAction,
164
+ Yo as SidebarGroupContent,
165
+ Zo as SidebarGroupLabel,
166
+ _o as SidebarHeader,
167
+ $o as SidebarInput,
168
+ er as SidebarInset,
169
+ or as SidebarMenu,
170
+ rr as SidebarMenuAction,
171
+ tr as SidebarMenuBadge,
172
+ ar as SidebarMenuButton,
173
+ nr as SidebarMenuItem,
174
+ ir as SidebarMenuSkeleton,
175
+ lr as SidebarMenuSub,
176
+ pr as SidebarMenuSubButton,
177
+ dr as SidebarMenuSubItem,
178
+ mr as SidebarProvider,
179
+ br as SidebarRail,
180
+ Sr as SidebarSeparator,
181
+ ur as SidebarTrigger,
182
+ cr as Skeleton,
183
+ Tr as Slider,
184
+ sr as Switch,
185
+ Mr as Table,
186
+ hr as TableBody,
187
+ Br as TableCaption,
188
+ wr as TableCell,
189
+ Fr as TableFooter,
190
+ Ir as TableHead,
191
+ Ar as TableHeader,
192
+ vr as TableRow,
193
+ Gr as Tabs,
194
+ Lr as TabsContent,
195
+ Hr as TabsList,
196
+ Rr as TabsTrigger,
197
+ yr as Textarea,
198
+ zr as Toggle,
199
+ Ur as Tooltip,
200
+ jr as TooltipContent,
201
+ qr as TooltipProvider,
202
+ Jr as TooltipTrigger,
201
203
  c as badgeVariants,
202
204
  I as buttonVariants,
203
- Vr as toggleVariants,
204
- Jr as useFormContext,
205
- Oe as useFormField,
206
- Sr as useSidebar
205
+ Er as toggleVariants,
206
+ Nr as useFormContext,
207
+ je as useFormField,
208
+ Cr as useSidebar
207
209
  };
@@ -0,0 +1,4 @@
1
+ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
2
+ import type * as React from 'react';
3
+ declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Checkbox };
@@ -0,0 +1,268 @@
1
+ import { jsx as s, jsxs as L, Fragment as O } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { u as S } from "../../../index-5Bhkapwi.js";
4
+ import { c as H } from "../../../index-DFZozV_h.js";
5
+ import { c as N } from "../../../index-B695uy69.js";
6
+ import { u as G } from "../../../index-437EL2iq.js";
7
+ import { u as K } from "../../../index-BZPx6jYI.js";
8
+ import { u as U } from "../../../index-BGQepRFJ.js";
9
+ import { P as X } from "../../../index-C8_QusYl.js";
10
+ import { P as _ } from "../../../index-CpDnqHCm.js";
11
+ import { CheckIcon as $ } from "lucide-react";
12
+ import { c as J } from "../../../utils-CRiPKpXj.js";
13
+ var y = "Checkbox", [Q, ue] = H(y), [V, E] = Q(y);
14
+ function W(t) {
15
+ const {
16
+ __scopeCheckbox: o,
17
+ checked: a,
18
+ children: l,
19
+ defaultChecked: n,
20
+ disabled: e,
21
+ form: f,
22
+ name: b,
23
+ onCheckedChange: d,
24
+ required: m,
25
+ value: k = "on",
26
+ // @ts-expect-error
27
+ internal_do_not_use_render: u
28
+ } = t, [p, v] = G({
29
+ prop: a,
30
+ defaultProp: n ?? !1,
31
+ onChange: d,
32
+ caller: y
33
+ }), [C, x] = i.useState(null), [g, r] = i.useState(null), c = i.useRef(!1), P = C ? !!f || !!C.closest("form") : (
34
+ // We set this to true by default so that events bubble to forms without JS (SSR)
35
+ !0
36
+ ), R = {
37
+ checked: p,
38
+ disabled: e,
39
+ setChecked: v,
40
+ control: C,
41
+ setControl: x,
42
+ name: b,
43
+ form: f,
44
+ value: k,
45
+ hasConsumerStoppedPropagationRef: c,
46
+ required: m,
47
+ defaultChecked: h(n) ? !1 : n,
48
+ isFormControl: P,
49
+ bubbleInput: g,
50
+ setBubbleInput: r
51
+ };
52
+ return /* @__PURE__ */ s(
53
+ V,
54
+ {
55
+ scope: o,
56
+ ...R,
57
+ children: Y(u) ? u(R) : l
58
+ }
59
+ );
60
+ }
61
+ var w = "CheckboxTrigger", B = i.forwardRef(
62
+ ({ __scopeCheckbox: t, onKeyDown: o, onClick: a, ...l }, n) => {
63
+ const {
64
+ control: e,
65
+ value: f,
66
+ disabled: b,
67
+ checked: d,
68
+ required: m,
69
+ setControl: k,
70
+ setChecked: u,
71
+ hasConsumerStoppedPropagationRef: p,
72
+ isFormControl: v,
73
+ bubbleInput: C
74
+ } = E(w, t), x = S(n, k), g = i.useRef(d);
75
+ return i.useEffect(() => {
76
+ const r = e?.form;
77
+ if (r) {
78
+ const c = () => u(g.current);
79
+ return r.addEventListener("reset", c), () => r.removeEventListener("reset", c);
80
+ }
81
+ }, [e, u]), /* @__PURE__ */ s(
82
+ _.button,
83
+ {
84
+ type: "button",
85
+ role: "checkbox",
86
+ "aria-checked": h(d) ? "mixed" : d,
87
+ "aria-required": m,
88
+ "data-state": z(d),
89
+ "data-disabled": b ? "" : void 0,
90
+ disabled: b,
91
+ value: f,
92
+ ...l,
93
+ ref: x,
94
+ onKeyDown: N(o, (r) => {
95
+ r.key === "Enter" && r.preventDefault();
96
+ }),
97
+ onClick: N(a, (r) => {
98
+ u((c) => h(c) ? !0 : !c), C && v && (p.current = r.isPropagationStopped(), p.current || r.stopPropagation());
99
+ })
100
+ }
101
+ );
102
+ }
103
+ );
104
+ B.displayName = w;
105
+ var M = i.forwardRef(
106
+ (t, o) => {
107
+ const {
108
+ __scopeCheckbox: a,
109
+ name: l,
110
+ checked: n,
111
+ defaultChecked: e,
112
+ required: f,
113
+ disabled: b,
114
+ value: d,
115
+ onCheckedChange: m,
116
+ form: k,
117
+ ...u
118
+ } = t;
119
+ return /* @__PURE__ */ s(
120
+ W,
121
+ {
122
+ __scopeCheckbox: a,
123
+ checked: n,
124
+ defaultChecked: e,
125
+ disabled: b,
126
+ required: f,
127
+ onCheckedChange: m,
128
+ name: l,
129
+ form: k,
130
+ value: d,
131
+ internal_do_not_use_render: ({ isFormControl: p }) => /* @__PURE__ */ L(O, { children: [
132
+ /* @__PURE__ */ s(
133
+ B,
134
+ {
135
+ ...u,
136
+ ref: o,
137
+ __scopeCheckbox: a
138
+ }
139
+ ),
140
+ p && /* @__PURE__ */ s(
141
+ j,
142
+ {
143
+ __scopeCheckbox: a
144
+ }
145
+ )
146
+ ] })
147
+ }
148
+ );
149
+ }
150
+ );
151
+ M.displayName = y;
152
+ var T = "CheckboxIndicator", q = i.forwardRef(
153
+ (t, o) => {
154
+ const { __scopeCheckbox: a, forceMount: l, ...n } = t, e = E(T, a);
155
+ return /* @__PURE__ */ s(
156
+ X,
157
+ {
158
+ present: l || h(e.checked) || e.checked === !0,
159
+ children: /* @__PURE__ */ s(
160
+ _.span,
161
+ {
162
+ "data-state": z(e.checked),
163
+ "data-disabled": e.disabled ? "" : void 0,
164
+ ...n,
165
+ ref: o,
166
+ style: { pointerEvents: "none", ...t.style }
167
+ }
168
+ )
169
+ }
170
+ );
171
+ }
172
+ );
173
+ q.displayName = T;
174
+ var A = "CheckboxBubbleInput", j = i.forwardRef(
175
+ ({ __scopeCheckbox: t, ...o }, a) => {
176
+ const {
177
+ control: l,
178
+ hasConsumerStoppedPropagationRef: n,
179
+ checked: e,
180
+ defaultChecked: f,
181
+ required: b,
182
+ disabled: d,
183
+ name: m,
184
+ value: k,
185
+ form: u,
186
+ bubbleInput: p,
187
+ setBubbleInput: v
188
+ } = E(A, t), C = S(a, v), x = K(e), g = U(l);
189
+ i.useEffect(() => {
190
+ const c = p;
191
+ if (!c) return;
192
+ const P = window.HTMLInputElement.prototype, I = Object.getOwnPropertyDescriptor(
193
+ P,
194
+ "checked"
195
+ ).set, D = !n.current;
196
+ if (x !== e && I) {
197
+ const F = new Event("click", { bubbles: D });
198
+ c.indeterminate = h(e), I.call(c, h(e) ? !1 : e), c.dispatchEvent(F);
199
+ }
200
+ }, [p, x, e, n]);
201
+ const r = i.useRef(h(e) ? !1 : e);
202
+ return /* @__PURE__ */ s(
203
+ _.input,
204
+ {
205
+ type: "checkbox",
206
+ "aria-hidden": !0,
207
+ defaultChecked: f ?? r.current,
208
+ required: b,
209
+ disabled: d,
210
+ name: m,
211
+ value: k,
212
+ form: u,
213
+ ...o,
214
+ tabIndex: -1,
215
+ ref: C,
216
+ style: {
217
+ ...o.style,
218
+ ...g,
219
+ position: "absolute",
220
+ pointerEvents: "none",
221
+ opacity: 0,
222
+ margin: 0,
223
+ // We transform because the input is absolutely positioned but we have
224
+ // rendered it **after** the button. This pulls it back to sit on top
225
+ // of the button.
226
+ transform: "translateX(-100%)"
227
+ }
228
+ }
229
+ );
230
+ }
231
+ );
232
+ j.displayName = A;
233
+ function Y(t) {
234
+ return typeof t == "function";
235
+ }
236
+ function h(t) {
237
+ return t === "indeterminate";
238
+ }
239
+ function z(t) {
240
+ return h(t) ? "indeterminate" : t ? "checked" : "unchecked";
241
+ }
242
+ function le({
243
+ className: t,
244
+ ...o
245
+ }) {
246
+ return /* @__PURE__ */ s(
247
+ M,
248
+ {
249
+ className: J(
250
+ "peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",
251
+ t
252
+ ),
253
+ "data-slot": "checkbox",
254
+ ...o,
255
+ children: /* @__PURE__ */ s(
256
+ q,
257
+ {
258
+ className: "flex items-center justify-center text-current transition-none",
259
+ "data-slot": "checkbox-indicator",
260
+ children: /* @__PURE__ */ s($, { className: "size-3.5" })
261
+ }
262
+ )
263
+ }
264
+ );
265
+ }
266
+ export {
267
+ le as Checkbox
268
+ };
@@ -7,6 +7,7 @@ export * from './button';
7
7
  export * from './byoc-badge';
8
8
  export * from './card';
9
9
  export * from './chart';
10
+ export * from './checkbox';
10
11
  export * from './collapsible';
11
12
  export * from './command';
12
13
  export * from './dialog';