@uselets/ui 0.1.1 → 0.3.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 (59) hide show
  1. package/README.md +136 -0
  2. package/dist/components/alert.js +1 -1
  3. package/dist/components/alert.js.map +1 -1
  4. package/dist/components/avatar.d.ts +4 -4
  5. package/dist/components/avatar.js +1 -1
  6. package/dist/components/avatar.js.map +1 -1
  7. package/dist/components/button.d.ts +5 -2
  8. package/dist/components/button.js +1 -1
  9. package/dist/components/button.js.map +1 -1
  10. package/dist/components/card.js +1 -1
  11. package/dist/components/card.js.map +1 -1
  12. package/dist/components/checkbox.d.ts +20 -0
  13. package/dist/components/checkbox.js +2 -0
  14. package/dist/components/checkbox.js.map +1 -0
  15. package/dist/components/dialog.d.ts +17 -9
  16. package/dist/components/dialog.js +1 -1
  17. package/dist/components/dialog.js.map +1 -1
  18. package/dist/components/drawer.js +1 -1
  19. package/dist/components/drawer.js.map +1 -1
  20. package/dist/components/dropdown-menu.d.ts +101 -0
  21. package/dist/components/dropdown-menu.js +2 -0
  22. package/dist/components/dropdown-menu.js.map +1 -0
  23. package/dist/components/field.js +1 -1
  24. package/dist/components/field.js.map +1 -1
  25. package/dist/components/input-otp.js +1 -1
  26. package/dist/components/input-otp.js.map +1 -1
  27. package/dist/components/input.js +1 -1
  28. package/dist/components/input.js.map +1 -1
  29. package/dist/components/kbd.d.ts +6 -3
  30. package/dist/components/kbd.js.map +1 -1
  31. package/dist/components/label.d.ts +2 -1
  32. package/dist/components/label.js +1 -1
  33. package/dist/components/label.js.map +1 -1
  34. package/dist/components/native-select.js +1 -1
  35. package/dist/components/native-select.js.map +1 -1
  36. package/dist/components/popover.d.ts +43 -0
  37. package/dist/components/popover.js +2 -0
  38. package/dist/components/popover.js.map +1 -0
  39. package/dist/components/select.d.ts +15 -17
  40. package/dist/components/select.js +1 -1
  41. package/dist/components/select.js.map +1 -1
  42. package/dist/components/separator.d.ts +4 -2
  43. package/dist/components/separator.js +1 -1
  44. package/dist/components/separator.js.map +1 -1
  45. package/dist/components/sonner.js.map +1 -1
  46. package/dist/components/spinner.d.ts +10 -2
  47. package/dist/components/spinner.js +1 -1
  48. package/dist/components/spinner.js.map +1 -1
  49. package/dist/components/theme.d.ts +28 -0
  50. package/dist/components/theme.js +2 -0
  51. package/dist/components/theme.js.map +1 -0
  52. package/dist/components/tooltip.d.ts +29 -0
  53. package/dist/components/tooltip.js +2 -0
  54. package/dist/components/tooltip.js.map +1 -0
  55. package/dist/index.d.ts +24 -0
  56. package/dist/index.js +1 -0
  57. package/dist/styles.css +1 -1
  58. package/dist/styles.css.map +1 -1
  59. package/package.json +18 -8
package/README.md ADDED
@@ -0,0 +1,136 @@
1
+ # @uselets/ui
2
+
3
+ React component library for the LET'S design system.
4
+
5
+ ## Requirements
6
+
7
+ - React `>=19`
8
+ - React DOM `>=19`
9
+ - Tailwind CSS 4
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ npm install @uselets/ui
15
+ ```
16
+
17
+ ```bash
18
+ pnpm add @uselets/ui
19
+ ```
20
+
21
+ ```bash
22
+ yarn add @uselets/ui
23
+ ```
24
+
25
+ ```bash
26
+ bun add @uselets/ui
27
+ ```
28
+
29
+ ## Tailwind CSS v4 setup
30
+
31
+ If your app already uses Tailwind CSS v4, you can skip this section.
32
+
33
+ 1. Install Tailwind v4 and the PostCSS plugin:
34
+
35
+ ```bash
36
+ npm install tailwindcss @tailwindcss/postcss
37
+ ```
38
+
39
+ 2. Configure PostCSS (recommended: reuse the package preset):
40
+
41
+ ```js
42
+ // postcss.config.mjs
43
+ export { default } from '@uselets/ui/postcss.config'
44
+ ```
45
+
46
+ 3. Import Tailwind in your global stylesheet:
47
+
48
+ ```css
49
+ /* app.css */
50
+ @import 'tailwindcss';
51
+ ```
52
+
53
+ ## Quick start
54
+
55
+ 1. Import the package styles once in your app entry point:
56
+
57
+ ```tsx
58
+ import '@uselets/ui/styles.css'
59
+ import '@fontsource-variable/inter'
60
+ ```
61
+
62
+ 2. Import components from the package root:
63
+
64
+ ```tsx
65
+ import { Alert, Button } from '@uselets/ui'
66
+
67
+ export function Example() {
68
+ return (
69
+ <Alert>
70
+ <Button>Continue</Button>
71
+ </Alert>
72
+ )
73
+ }
74
+ ```
75
+
76
+ 3. You can also import through subpaths:
77
+
78
+ ```tsx
79
+ import { Button } from '@uselets/ui/button'
80
+ ```
81
+
82
+ ## Components
83
+
84
+ You can import from the package root (`@uselets/ui`) or by subpath (`@uselets/ui/<component>`).
85
+
86
+ | Component | Exports | Key props / notes |
87
+ | --- | --- | --- |
88
+ | `alert` | `Alert`, `AlertTitle`, `AlertDescription`, `AlertAction` | `Alert` supports `variant: 'default' \| 'destructive'` (default: `default`). |
89
+ | `avatar` | `Avatar`, `AvatarImage`, `AvatarFallback`, `AvatarBadge`, `AvatarGroup`, `AvatarGroupCount` | `Avatar` supports `size: 'sm' \| 'default' \| 'lg'` (default: `default`). |
90
+ | `button` | `Button`, `buttonVariants` | `variant: 'default' \| 'outline' \| 'secondary' \| 'ghost' \| 'destructive' \| 'link'`; `size: 'xs' \| 'sm' \| 'default' \| 'lg' \| 'icon-xs' \| 'icon-sm' \| 'icon' \| 'icon-lg'`. |
91
+ | `card` | `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter` | `Card` supports `size: 'default' \| 'sm'` (default: `default`). |
92
+ | `dialog` | `Dialog`, `DialogTrigger`, `DialogPortal`, `DialogClose`, `DialogOverlay`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogTitle`, `DialogDescription` | `Dialog` supports `size: 'sm' \| 'md' \| 'lg' \| 'xl' \| '2xl'` (default: `sm`); `DialogContent.showCloseButton` (default: `true`); `DialogFooter.showCloseButton` (default: `false`). |
93
+ | `drawer` | `Drawer`, `DrawerTrigger`, `DrawerPortal`, `DrawerClose`, `DrawerOverlay`, `DrawerContent`, `DrawerHeader`, `DrawerFooter`, `DrawerTitle`, `DrawerDescription` | `Drawer` supports `size: 'sm' \| 'md' \| 'lg'` (default: `sm`). Direction (`top/right/bottom/left`) is handled by Vaul root props. |
94
+ | `dropdown-menu` | `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioGroup`, `DropdownMenuRadioItem`, `DropdownMenuSub`, `DropdownMenuSubTrigger`, `DropdownMenuSubContent`, `DropdownMenuSeparator`, `DropdownMenuShortcut` | `DropdownMenuContent` supports `side`, `sideOffset`, `align`, `alignOffset`; items support `inset`, and `DropdownMenuItem` supports `variant: 'default' \| 'destructive'`. |
95
+ | `empty` | `Empty`, `EmptyHeader`, `EmptyMedia`, `EmptyTitle`, `EmptyDescription`, `EmptyContent` | `EmptyMedia` supports `variant: 'default' \| 'icon'` (default: `default`). |
96
+ | `field` | `FieldSet`, `FieldLegend`, `FieldGroup`, `Field`, `FieldContent`, `FieldLabel`, `FieldTitle`, `FieldDescription`, `FieldSeparator`, `FieldError` | `Field.orientation: 'vertical' \| 'horizontal' \| 'responsive'` (default: `vertical`); `FieldLegend.variant: 'legend' \| 'label'`; `FieldError.errors` accepts an array of error objects. |
97
+ | `input` | `Input` | Wrapper for Base UI Input with all native `<input>` props. |
98
+ | `input-otp` | `InputOTP`, `InputOTPGroup`, `InputOTPSlot`, `InputOTPSeparator`, `REGEXP_ONLY_CHARS`, `REGEXP_ONLY_DIGITS`, `REGEXP_ONLY_DIGITS_AND_CHARS` | `InputOTP` supports all `input-otp` props plus `containerClassName`; use `maxLength` and `pattern` for validation. |
99
+ | `kbd` | `Kbd`, `KbdGroup` | Keyboard shortcut presentation primitives. |
100
+ | `label` | `Label` | Styled `<label>` wrapper. |
101
+ | `native-select` | `NativeSelect`, `NativeSelectOption`, `NativeSelectOptGroup` | Native `<select>` API with `size: 'sm' \| 'default'` (default: `default`). |
102
+ | `popover` | `Popover`, `PopoverTrigger`, `PopoverContent`, `PopoverAnchor`, `PopoverHeader`, `PopoverTitle`, `PopoverDescription` | `PopoverContent` supports positioning props (`side`, `sideOffset`, `align`, `alignOffset`) and can be used in controlled mode via root props (`open`, `onOpenChange`). |
103
+ | `select` | `Select`, `SelectTrigger`, `SelectValue`, `SelectContent`, `SelectGroup`, `SelectItem`, `SelectLabel`, `SelectSeparator`, `SelectScrollUpButton`, `SelectScrollDownButton` | `SelectTrigger.size: 'sm' \| 'default'`; `SelectContent` supports positioning props (`side`, `sideOffset`, `align`, `alignOffset`, `alignItemWithTrigger`). |
104
+ | `separator` | `Separator` | `orientation: 'horizontal' \| 'vertical'` (default: `horizontal`). |
105
+ | `skeleton` | `Skeleton` | Generic loading placeholder block. |
106
+ | `spinner` | `Spinner` | Loader icon (`role="status"`), accepts SVG props and supports `size: 'sm' \| 'default' \| 'lg'` (default: `default`). |
107
+ | `tooltip` | `TooltipProvider`, `Tooltip`, `TooltipTrigger`, `TooltipContent` | `TooltipProvider.delayDuration` controls global hover delay; `Tooltip` supports controlled mode (`open`, `onOpenChange`); `TooltipContent` supports positioning props like `side`, `align`, and `sideOffset`. |
108
+ | `sonner` | `Toaster`, `toast` | Toaster wrapper around Sonner with theme integration from `next-themes` and custom icons. |
109
+
110
+ ### Sonner example
111
+
112
+ ```tsx
113
+ import { ThemeProvider } from 'next-themes'
114
+ import { Toaster, toast } from '@uselets/ui/sonner'
115
+
116
+ export function App() {
117
+ return (
118
+ <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
119
+ <button onClick={() => toast.success('Saved')}>Notify</button>
120
+ <Toaster />
121
+ </ThemeProvider>
122
+ )
123
+ }
124
+ ```
125
+
126
+ ## Tooltip setup
127
+
128
+ For consistent tooltip behavior across the app, wrap your application root with `TooltipProvider`.
129
+
130
+ ```tsx
131
+ import { TooltipProvider } from '@uselets/ui/tooltip'
132
+
133
+ export function AppRoot() {
134
+ return <TooltipProvider delayDuration={200}>{/* app */}</TooltipProvider>
135
+ }
136
+ ```
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";const i=n(`grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Alert({className:e,variant:n,...a}){return r(`div`,{"data-slot":`alert`,role:`alert`,className:t(i({variant:n}),e),...a})}function AlertTitle({className:e,...n}){return r(`div`,{"data-slot":`alert-title`,className:t(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3`,e),...n})}function AlertDescription({className:e,...n}){return r(`div`,{"data-slot":`alert-description`,className:t(`text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3`,e),...n})}function AlertAction({className:e,...n}){return r(`div`,{"data-slot":`alert-action`,className:t(`absolute top-2 right-2`,e),...n})}export{Alert,AlertAction,AlertDescription,AlertTitle};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";const i=n(`grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function Alert({className:e,variant:n,...a}){return r(`div`,{"data-slot":`alert`,role:`alert`,className:t(i({variant:n}),e),...a})}function AlertTitle({className:e,...n}){return r(`div`,{"data-slot":`alert-title`,className:t(`font-medium group-has-[>svg]/alert:col-start-2`,`[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...n})}function AlertDescription({className:e,...n}){return r(`div`,{"data-slot":`alert-description`,className:t(`text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4`,`[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...n})}function AlertAction({className:e,...n}){return r(`div`,{"data-slot":`alert-action`,className:t(`absolute top-2 right-2`,e),...n})}export{Alert,AlertAction,AlertDescription,AlertTitle};
2
2
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":[],"sources":["../../src/components/alert.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst alertVariants = cva(\n \"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert\",\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive: 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nexport type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>\n\nexport type AlertTitleProps = React.ComponentProps<'div'>\n\nexport type AlertDescriptionProps = React.ComponentProps<'div'>\n\nexport type AlertActionProps = React.ComponentProps<'div'>\n\nfunction Alert({ className, variant, ...props }: AlertProps) {\n return <div data-slot=\"alert\" role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n}\n\nfunction AlertTitle({ className, ...props }: AlertTitleProps) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertAction({ className, ...props }: AlertActionProps) {\n return <div data-slot=\"alert-action\" className={cn('absolute top-2 right-2', className)} {...props} />\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle }\n"],"mappings":"qKAMA,MAAM,EAAgB,EACpB,4TACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,+BACT,YAAa,oGACd,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAUD,SAAS,MAAM,CAAE,YAAW,UAAS,GAAG,GAAqB,CAC3D,OAAO,EAAC,MAAA,CAAI,YAAU,QAAQ,KAAK,QAAQ,UAAW,EAAG,EAAc,CAAE,UAAS,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGhH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,sHACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,oBACV,UAAW,EACT,6JACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAA,CAAI,YAAU,eAAe,UAAW,EAAG,yBAA0B,EAAU,CAAE,GAAI,GAAS"}
1
+ {"version":3,"file":"alert.js","names":[],"sources":["../../src/components/alert.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst alertVariants = cva(\n \"grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert\",\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground',\n destructive: 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current'\n }\n },\n defaultVariants: {\n variant: 'default'\n }\n }\n)\n\nexport type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>\n\nexport type AlertTitleProps = React.ComponentProps<'div'>\n\nexport type AlertDescriptionProps = React.ComponentProps<'div'>\n\nexport type AlertActionProps = React.ComponentProps<'div'>\n\nfunction Alert({ className, variant, ...props }: AlertProps) {\n return <div data-slot=\"alert\" role=\"alert\" className={cn(alertVariants({ variant }), className)} {...props} />\n}\n\nfunction AlertTitle({ className, ...props }: AlertTitleProps) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n 'font-medium group-has-[>svg]/alert:col-start-2',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({ className, ...props }: AlertDescriptionProps) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n 'text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4',\n '[&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertAction({ className, ...props }: AlertActionProps) {\n return <div data-slot=\"alert-action\" className={cn('absolute top-2 right-2', className)} {...props} />\n}\n\nexport { Alert, AlertAction, AlertDescription, AlertTitle }\n"],"mappings":"qKAMA,MAAM,EAAgB,EACpB,4TACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,+BACT,YAAa,oGACd,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAUD,SAAS,MAAM,CAAE,YAAW,UAAS,GAAG,GAAqB,CAC3D,OAAO,EAAC,MAAA,CAAI,YAAU,QAAQ,KAAK,QAAQ,UAAW,EAAG,EAAc,CAAE,UAAS,CAAC,CAAE,EAAU,CAAE,GAAI,GAAS,CAGhH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,iDACA,uEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,oBACV,UAAW,EACT,wFACA,uEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAA,CAAI,YAAU,eAAe,UAAW,EAAG,yBAA0B,EAAU,CAAE,GAAI,GAAS"}
@@ -1,14 +1,14 @@
1
1
  import { t as __name } from "../chunk-IpJEthwI.js";
2
2
  import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
3
+ import { Avatar as Avatar$1 } from "radix-ui";
4
4
  import * as React from "react";
5
5
 
6
6
  //#region src/components/avatar.d.ts
7
- type AvatarProps = Avatar$1.Root.Props & {
7
+ type AvatarProps = React.ComponentProps<typeof Avatar$1.Root> & {
8
8
  size?: 'default' | 'sm' | 'lg';
9
9
  };
10
- type AvatarImageProps = Avatar$1.Image.Props;
11
- type AvatarFallbackProps = Avatar$1.Fallback.Props;
10
+ type AvatarImageProps = React.ComponentProps<typeof Avatar$1.Image>;
11
+ type AvatarFallbackProps = React.ComponentProps<typeof Avatar$1.Fallback>;
12
12
  type AvatarBadgeProps = React.ComponentProps<'span'>;
13
13
  type AvatarGroupProps = React.ComponentProps<'div'>;
14
14
  type AvatarGroupCountProps = React.ComponentProps<'div'>;
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{jsx as n}from"react/jsx-runtime";import{Avatar as r}from"@base-ui/react/avatar";function Avatar({className:e,size:i=`default`,...a}){return n(r.Root,{"data-slot":`avatar`,"data-size":i,className:t(`size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten`,e),...a})}function AvatarImage({className:e,...i}){return n(r.Image,{"data-slot":`avatar-image`,className:t(`rounded-full aspect-square size-full object-cover`,e),...i})}function AvatarFallback({className:e,...i}){return n(r.Fallback,{"data-slot":`avatar-fallback`,className:t(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,e),...i})}function AvatarBadge({className:e,...r}){return n(`span`,{"data-slot":`avatar-badge`,className:t(`bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,e),...r})}function AvatarGroup({className:e,...r}){return n(`div`,{"data-slot":`avatar-group`,className:t(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,e),...r})}function AvatarGroupCount({className:e,...r}){return n(`div`,{"data-slot":`avatar-group-count`,className:t(`bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2`,e),...r})}export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{jsx as n}from"react/jsx-runtime";import{Avatar as r}from"radix-ui";function Avatar({className:e,size:i=`default`,...a}){return n(r.Root,{"data-slot":`avatar`,"data-size":i,className:t(`group/avatar relative flex shrink-0 size-8 rounded-full select-none`,`data-[size=lg]:size-10 data-[size=sm]:size-6`,`after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten`,e),...a})}function AvatarImage({className:e,...i}){return n(r.Image,{"data-slot":`avatar-image`,className:t(`rounded-full aspect-square size-full object-cover`,e),...i})}function AvatarFallback({className:e,...i}){return n(r.Fallback,{"data-slot":`avatar-fallback`,className:t(`bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs`,e),...i})}function AvatarBadge({className:e,...r}){return n(`span`,{"data-slot":`avatar-badge`,className:t(`bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none`,`group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden`,`group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2`,`group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2`,e),...r})}function AvatarGroup({className:e,...r}){return n(`div`,{"data-slot":`avatar-group`,className:t(`*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2`,e),...r})}function AvatarGroupCount({className:e,...r}){return n(`div`,{"data-slot":`avatar-group-count`,className:t(`bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2`,`group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6`,`[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3`,e),...r})}export{Avatar,AvatarBadge,AvatarFallback,AvatarGroup,AvatarGroupCount,AvatarImage};
2
2
  //# sourceMappingURL=avatar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":["AvatarPrimitive"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from '@base-ui/react/avatar'\n\nimport { cn } from '../lib/utils'\n\nexport type AvatarProps = AvatarPrimitive.Root.Props & {\n size?: 'default' | 'sm' | 'lg'\n}\n\nexport type AvatarImageProps = AvatarPrimitive.Image.Props\n\nexport type AvatarFallbackProps = AvatarPrimitive.Fallback.Props\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'default', ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('rounded-full aspect-square size-full object-cover', className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({ className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"qKAoBA,SAAS,OAAO,CAAE,YAAW,OAAO,UAAW,GAAG,GAAsB,CACtE,OACE,EAACA,EAAgB,KAAA,CACf,YAAU,SACV,YAAW,EACX,UAAW,EACT,wPACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,oDAAqD,EAAU,CAC7E,GAAI,GACJ,CAIN,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAACA,EAAgB,SAAA,CACf,YAAU,kBACV,UAAW,EACT,qIACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,OAAA,CACC,YAAU,eACV,UAAW,EACT,2KACA,gFACA,4FACA,gFACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,MAAA,CACC,YAAU,eACV,UAAW,EACT,sGACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,qBACV,UAAW,EACT,2VACA,EACD,CACD,GAAI,GACJ"}
1
+ {"version":3,"file":"avatar.js","names":["AvatarPrimitive"],"sources":["../../src/components/avatar.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Avatar as AvatarPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type AvatarProps = React.ComponentProps<typeof AvatarPrimitive.Root> & {\n size?: 'default' | 'sm' | 'lg'\n}\n\nexport type AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>\n\nexport type AvatarFallbackProps = React.ComponentProps<typeof AvatarPrimitive.Fallback>\n\nexport type AvatarBadgeProps = React.ComponentProps<'span'>\n\nexport type AvatarGroupProps = React.ComponentProps<'div'>\n\nexport type AvatarGroupCountProps = React.ComponentProps<'div'>\n\nfunction Avatar({ className, size = 'default', ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-size={size}\n className={cn(\n 'group/avatar relative flex shrink-0 size-8 rounded-full select-none',\n 'data-[size=lg]:size-10 data-[size=sm]:size-6',\n 'after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken dark:after:mix-blend-lighten',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('rounded-full aspect-square size-full object-cover', className)}\n {...props}\n />\n )\n}\n\nfunction AvatarFallback({ className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n 'bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarBadge({ className, ...props }: AvatarBadgeProps) {\n return (\n <span\n data-slot=\"avatar-badge\"\n className={cn(\n 'bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroup({ className, ...props }: AvatarGroupProps) {\n return (\n <div\n data-slot=\"avatar-group\"\n className={cn(\n '*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AvatarGroupCount({ className, ...props }: AvatarGroupCountProps) {\n return (\n <div\n data-slot=\"avatar-group-count\"\n className={cn(\n 'bg-muted text-muted-foreground ring-background relative flex shrink-0 items-center justify-center size-8 rounded-full text-sm ring-2',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }\n"],"mappings":"wJAoBA,SAAS,OAAO,CAAE,YAAW,OAAO,UAAW,GAAG,GAAsB,CACtE,OACE,EAACA,EAAgB,KAAA,CACf,YAAU,SACV,YAAW,EACX,UAAW,EACT,sEACA,+CACA,uIACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,oDAAqD,EAAU,CAC7E,GAAI,GACJ,CAIN,SAAS,eAAe,CAAE,YAAW,GAAG,GAA8B,CACpE,OACE,EAACA,EAAgB,SAAA,CACf,YAAU,kBACV,UAAW,EACT,qIACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,OAAA,CACC,YAAU,eACV,UAAW,EACT,2KACA,gFACA,4FACA,gFACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAAC,MAAA,CACC,YAAU,eACV,UAAW,EACT,sGACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,iBAAiB,CAAE,YAAW,GAAG,GAAgC,CACxE,OACE,EAAC,MAAA,CACC,YAAU,qBACV,UAAW,EACT,uIACA,6FACA,2HACA,EACD,CACD,GAAI,GACJ"}
@@ -1,7 +1,7 @@
1
1
  import { t as __name } from "../chunk-IpJEthwI.js";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
- import { Button as Button$1 } from "@base-ui/react/button";
4
+ import * as React from "react";
5
5
  import * as class_variance_authority_types0 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/components/button.d.ts
@@ -9,11 +9,14 @@ declare const buttonVariants: (props?: ({
9
9
  variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
10
10
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
11
11
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
12
- type ButtonProps = Button$1.Props & VariantProps<typeof buttonVariants>;
12
+ type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
13
+ asChild?: boolean;
14
+ };
13
15
  declare function Button({
14
16
  className,
15
17
  variant,
16
18
  size,
19
+ asChild,
17
20
  ...props
18
21
  }: ButtonProps): react_jsx_runtime0.JSX.Element;
19
22
  //#endregion
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";import{Button as i}from"@base-ui/react/button";const a=n(`focus-visible:border-ring cursor-pointer focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Button({className:e,variant:n=`default`,size:o=`default`,...s}){return r(i,{"data-slot":`button`,className:t(a({variant:n,size:o,className:e})),...s})}export{Button,a as buttonVariants};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";import{Slot as i}from"radix-ui";const a=n(`focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground`,destructive:`bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Button({className:e,variant:n=`default`,size:o=`default`,asChild:s=!1,...c}){return r(s?i.Root:`button`,{"data-slot":`button`,"data-variant":n,"data-size":o,className:t(a({variant:n,size:o,className:e})),...c})}export{Button,a as buttonVariants};
2
2
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["ButtonPrimitive"],"sources":["../../src/components/button.tsx"],"sourcesContent":["import { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring cursor-pointer focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/80',\n outline:\n 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',\n ghost:\n 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n destructive:\n 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',\n link: 'text-primary underline-offset-4 hover:underline'\n },\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n icon: 'size-8',\n 'icon-xs':\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'default'\n }\n }\n)\n\nexport type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants>\n\nfunction Button({ className, variant = 'default', size = 'default', ...props }: ButtonProps) {\n return <ButtonPrimitive data-slot=\"button\" className={cn(buttonVariants({ variant, size, className }))} {...props} />\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"oNAKA,MAAM,EAAiB,EACrB,kkBACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,QACE,kLACF,UACE,kIACF,MACE,mHACF,YACE,8NACF,KAAM,kDACP,CACD,KAAM,CACJ,QAAS,uFACT,GAAI,gNACJ,GAAI,0NACJ,GAAI,uFACJ,KAAM,SACN,UACE,0HACF,UAAW,qFACX,UAAW,SACZ,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,UACP,CACF,CACF,CAID,SAAS,OAAO,CAAE,YAAW,UAAU,UAAW,OAAO,UAAW,GAAG,GAAsB,CAC3F,OAAO,EAACA,EAAAA,CAAgB,YAAU,SAAS,UAAW,EAAG,EAAe,CAAE,UAAS,OAAM,YAAW,CAAC,CAAC,CAAE,GAAI,GAAS"}
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../src/components/button.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Slot } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/80',\n outline:\n 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',\n ghost:\n 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n destructive:\n 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',\n link: 'text-primary underline-offset-4 hover:underline'\n },\n size: {\n default: 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',\n icon: 'size-8',\n 'icon-xs':\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg',\n 'icon-lg': 'size-9'\n }\n },\n defaultVariants: {\n variant: 'default',\n size: 'default'\n }\n }\n)\n\nexport type ButtonProps = React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }\n\nfunction Button({ className, variant = 'default', size = 'default', asChild = false, ...props }: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button'\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":"qMAOA,MAAM,EAAiB,EACrB,mjBACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,yDACT,QACE,kLACF,UACE,kIACF,MACE,mHACF,YACE,8NACF,KAAM,kDACP,CACD,KAAM,CACJ,QAAS,uFACT,GAAI,gNACJ,GAAI,0NACJ,GAAI,uFACJ,KAAM,SACN,UACE,0HACF,UAAW,qFACX,UAAW,SACZ,CACF,CACD,gBAAiB,CACf,QAAS,UACT,KAAM,UACP,CACF,CACF,CAOD,SAAS,OAAO,CAAE,YAAW,UAAU,UAAW,OAAO,UAAW,UAAU,GAAO,GAAG,GAAsB,CAG5G,OACE,EAHW,EAAU,EAAK,KAAO,SAAA,CAI/B,YAAU,SACV,eAAc,EACd,YAAW,EACX,UAAW,EAAG,EAAe,CAAE,UAAS,OAAM,YAAW,CAAC,CAAC,CAC3D,GAAI,GACJ"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{jsx as n}from"react/jsx-runtime";function Card({className:e,size:r=`default`,...i}){return n(`div`,{"data-slot":`card`,"data-size":r,className:t(`ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col`,e),...i})}function CardHeader({className:e,...r}){return n(`div`,{"data-slot":`card-header`,className:t(`gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]`,e),...r})}function CardTitle({className:e,...r}){return n(`div`,{"data-slot":`card-title`,className:t(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...r})}function CardDescription({className:e,...r}){return n(`div`,{"data-slot":`card-description`,className:t(`text-muted-foreground text-sm`,e),...r})}function CardAction({className:e,...r}){return n(`div`,{"data-slot":`card-action`,className:t(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...r})}function CardContent({className:e,...r}){return n(`div`,{"data-slot":`card-content`,className:t(`px-4 group-data-[size=sm]/card:px-3`,e),...r})}function CardFooter({className:e,...r}){return n(`div`,{"data-slot":`card-footer`,className:t(`bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center`,e),...r})}export{Card,CardAction,CardContent,CardDescription,CardFooter,CardHeader,CardTitle};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{jsx as n}from"react/jsx-runtime";function Card({className:e,size:r=`default`,...i}){return n(`div`,{"data-slot":`card`,"data-size":r,className:t(`group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm bg-card text-card-foreground ring-foreground/10 ring-1`,`has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0`,`data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0`,`*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...i})}function CardHeader({className:e,...r}){return n(`div`,{"data-slot":`card-header`,className:t(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4`,`group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,`has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]`,e),...r})}function CardTitle({className:e,...r}){return n(`div`,{"data-slot":`card-title`,className:t(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...r})}function CardDescription({className:e,...r}){return n(`div`,{"data-slot":`card-description`,className:t(`text-muted-foreground text-sm`,e),...r})}function CardAction({className:e,...r}){return n(`div`,{"data-slot":`card-action`,className:t(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...r})}function CardContent({className:e,...r}){return n(`div`,{"data-slot":`card-content`,className:t(`px-4 group-data-[size=sm]/card:px-3`,e),...r})}function CardFooter({className:e,...r}){return n(`div`,{"data-slot":`card-footer`,className:t(`bg-muted/50 flex items-center rounded-b-xl border-t p-4`,`group-data-[size=sm]/card:p-3`,e),...r})}export{Card,CardAction,CardContent,CardDescription,CardFooter,CardHeader,CardTitle};
2
2
  //# sourceMappingURL=card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & { size?: 'default' | 'sm' }\n\nexport type CardHeaderProps = React.ComponentProps<'div'>\n\nexport type CardTitleProps = React.ComponentProps<'div'>\n\nexport type CardDescriptionProps = React.ComponentProps<'div'>\n\nexport type CardActionProps = React.ComponentProps<'div'>\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport type CardFooterProps = React.ComponentProps<'div'>\n\nfunction Card({ className, size = 'default', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: CardTitleProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: CardDescriptionProps) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: CardContentProps) {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />\n}\n\nfunction CardFooter({ className, ...props }: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center', className)}\n {...props}\n />\n )\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }\n"],"mappings":"sHAkBA,SAAS,KAAK,CAAE,YAAW,OAAO,UAAW,GAAG,GAAoB,CAClE,OACE,EAAC,MAAA,CACC,YAAU,OACV,YAAW,EACX,UAAW,EACT,uVACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,qSACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,UAAU,CAAE,YAAW,GAAG,GAAyB,CAC1D,OACE,EAAC,MAAA,CACC,YAAU,aACV,UAAW,EAAG,uEAAwE,EAAU,CAChG,GAAI,GACJ,CAIN,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OAAO,EAAC,MAAA,CAAI,YAAU,mBAAmB,UAAW,EAAG,gCAAiC,EAAU,CAAE,GAAI,GAAS,CAGnH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EAAG,iEAAkE,EAAU,CAC1F,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAA,CAAI,YAAU,eAAe,UAAW,EAAG,sCAAuC,EAAU,CAAE,GAAI,GAAS,CAGrH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EAAG,wFAAyF,EAAU,CACjH,GAAI,GACJ"}
1
+ {"version":3,"file":"card.js","names":[],"sources":["../../src/components/card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cn } from '../lib/utils'\n\nexport type CardProps = React.ComponentProps<'div'> & { size?: 'default' | 'sm' }\n\nexport type CardHeaderProps = React.ComponentProps<'div'>\n\nexport type CardTitleProps = React.ComponentProps<'div'>\n\nexport type CardDescriptionProps = React.ComponentProps<'div'>\n\nexport type CardActionProps = React.ComponentProps<'div'>\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport type CardFooterProps = React.ComponentProps<'div'>\n\nfunction Card({ className, size = 'default', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n data-size={size}\n className={cn(\n 'group/card flex flex-col gap-4 overflow-hidden rounded-xl py-4 text-sm bg-card text-card-foreground ring-foreground/10 ring-1',\n 'has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0',\n 'data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0',\n '*:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4',\n 'group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3',\n 'has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: CardTitleProps) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('text-base leading-snug font-medium group-data-[size=sm]/card:text-sm', className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: CardDescriptionProps) {\n return <div data-slot=\"card-description\" className={cn('text-muted-foreground text-sm', className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: CardContentProps) {\n return <div data-slot=\"card-content\" className={cn('px-4 group-data-[size=sm]/card:px-3', className)} {...props} />\n}\n\nfunction CardFooter({ className, ...props }: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'bg-muted/50 flex items-center rounded-b-xl border-t p-4',\n 'group-data-[size=sm]/card:p-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }\n"],"mappings":"sHAkBA,SAAS,KAAK,CAAE,YAAW,OAAO,UAAW,GAAG,GAAoB,CAClE,OACE,EAAC,MAAA,CACC,YAAU,OACV,YAAW,EACX,UAAW,EACT,gIACA,+DACA,2FACA,mEACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,kGACA,6FACA,0GACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,UAAU,CAAE,YAAW,GAAG,GAAyB,CAC1D,OACE,EAAC,MAAA,CACC,YAAU,aACV,UAAW,EAAG,uEAAwE,EAAU,CAChG,GAAI,GACJ,CAIN,SAAS,gBAAgB,CAAE,YAAW,GAAG,GAA+B,CACtE,OAAO,EAAC,MAAA,CAAI,YAAU,mBAAmB,UAAW,EAAG,gCAAiC,EAAU,CAAE,GAAI,GAAS,CAGnH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EAAG,iEAAkE,EAAU,CAC1F,GAAI,GACJ,CAIN,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OAAO,EAAC,MAAA,CAAI,YAAU,eAAe,UAAW,EAAG,sCAAuC,EAAU,CAAE,GAAI,GAAS,CAGrH,SAAS,WAAW,CAAE,YAAW,GAAG,GAA0B,CAC5D,OACE,EAAC,MAAA,CACC,YAAU,cACV,UAAW,EACT,0DACA,gCACA,EACD,CACD,GAAI,GACJ"}
@@ -0,0 +1,20 @@
1
+ import { t as __name } from "../chunk-IpJEthwI.js";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { Checkbox as Checkbox$1 } from "radix-ui";
5
+ import * as React from "react";
6
+ import * as class_variance_authority_types0 from "class-variance-authority/types";
7
+
8
+ //#region src/components/checkbox.d.ts
9
+ declare const checkboxVariants: (props?: ({
10
+ size?: "default" | "sm" | "lg" | null | undefined;
11
+ } & class_variance_authority_types0.ClassProp) | undefined) => string;
12
+ type CheckboxProps = React.ComponentProps<typeof Checkbox$1.Root> & VariantProps<typeof checkboxVariants>;
13
+ declare function Checkbox({
14
+ className,
15
+ size,
16
+ ...props
17
+ }: CheckboxProps): react_jsx_runtime0.JSX.Element;
18
+ //#endregion
19
+ export { Checkbox, CheckboxProps };
20
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1,2 @@
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r}from"react/jsx-runtime";import{Checkbox as i}from"radix-ui";import{IconCheck as a}from"@tabler/icons-react";const o=n(`border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50`,{variants:{size:{sm:`size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3`,default:`size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5`,lg:`size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4`}},defaultVariants:{size:`default`}});function Checkbox({className:e,size:n=`default`,...s}){return r(i.Root,{"data-slot":`checkbox`,"data-size":n,className:t(o({size:n}),e),...s,children:r(i.Indicator,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:r(a,{})})})}export{Checkbox};
2
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.js","names":["CheckboxPrimitive"],"sources":["../../src/components/checkbox.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { IconCheck } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nconst checkboxVariants = cva(\n 'border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex items-center justify-center border transition-colors group-has-disabled/field:opacity-50 focus-visible:ring-3 aria-invalid:ring-3 peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50',\n {\n variants: {\n size: {\n sm: 'size-3.5 rounded-[3px] [&_[data-slot=checkbox-indicator]>svg]:size-3',\n default: 'size-4 rounded-[4px] [&_[data-slot=checkbox-indicator]>svg]:size-3.5',\n lg: 'size-5 rounded-[5px] [&_[data-slot=checkbox-indicator]>svg]:size-4'\n }\n },\n defaultVariants: {\n size: 'default'\n }\n }\n)\n\nexport type CheckboxProps = React.ComponentProps<typeof CheckboxPrimitive.Root> & VariantProps<typeof checkboxVariants>\n\nfunction Checkbox({ className, size = 'default', ...props }: CheckboxProps) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n data-size={size}\n className={cn(checkboxVariants({ size }), className)}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <IconCheck />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":"yPAQA,MAAM,EAAmB,EACvB,+oBACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,uEACJ,QAAS,uEACT,GAAI,qEACL,CACF,CACD,gBAAiB,CACf,KAAM,UACP,CACF,CACF,CAID,SAAS,SAAS,CAAE,YAAW,OAAO,UAAW,GAAG,GAAwB,CAC1E,OACE,EAACA,EAAkB,KAAA,CACjB,YAAU,WACV,YAAW,EACX,UAAW,EAAG,EAAiB,CAAE,OAAM,CAAC,CAAE,EAAU,CACpD,GAAI,WAEJ,EAACA,EAAkB,UAAA,CACjB,YAAU,qBACV,UAAU,kEAEV,EAAC,EAAA,EAAA,CAAY,EACe,EACP"}
@@ -1,8 +1,8 @@
1
1
  import { t as __name } from "../chunk-IpJEthwI.js";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { Dialog as Dialog$1 } from "radix-ui";
4
5
  import * as React from "react";
5
- import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
6
6
  import * as class_variance_authority_types0 from "class-variance-authority/types";
7
7
 
8
8
  //#region src/components/dialog.d.ts
@@ -10,33 +10,41 @@ declare const dialogContentVariants: (props?: ({
10
10
  size?: "sm" | "lg" | "md" | "xl" | "2xl" | null | undefined;
11
11
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
12
12
  type DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>;
13
- type DialogProps = Dialog$1.Root.Props & {
13
+ type DialogProps = React.ComponentProps<typeof Dialog$1.Root> & {
14
14
  size?: DialogSize;
15
15
  };
16
- type DialogTriggerProps = Dialog$1.Trigger.Props;
17
- type DialogPortalProps = Dialog$1.Portal.Props;
18
- type DialogCloseProps = Dialog$1.Close.Props;
19
- type DialogOverlayProps = Dialog$1.Backdrop.Props;
20
- type DialogContentProps = Dialog$1.Popup.Props & {
16
+ type DialogTriggerProps = React.ComponentProps<typeof Dialog$1.Trigger> & {
17
+ render?: React.ReactElement;
18
+ };
19
+ type DialogPortalProps = React.ComponentProps<typeof Dialog$1.Portal>;
20
+ type DialogCloseProps = React.ComponentProps<typeof Dialog$1.Close> & {
21
+ render?: React.ReactElement;
22
+ };
23
+ type DialogOverlayProps = React.ComponentProps<typeof Dialog$1.Overlay>;
24
+ type DialogContentProps = React.ComponentProps<typeof Dialog$1.Content> & {
21
25
  showCloseButton?: boolean;
22
26
  };
23
27
  type DialogHeaderProps = React.ComponentProps<'div'>;
24
28
  type DialogFooterProps = React.ComponentProps<'div'> & {
25
29
  showCloseButton?: boolean;
26
30
  };
27
- type DialogTitleProps = Dialog$1.Title.Props;
28
- type DialogDescriptionProps = Dialog$1.Description.Props;
31
+ type DialogTitleProps = React.ComponentProps<typeof Dialog$1.Title>;
32
+ type DialogDescriptionProps = React.ComponentProps<typeof Dialog$1.Description>;
29
33
  declare function Dialog({
30
34
  size,
31
35
  ...props
32
36
  }: DialogProps): react_jsx_runtime0.JSX.Element;
33
37
  declare function DialogTrigger({
38
+ render,
39
+ children,
34
40
  ...props
35
41
  }: DialogTriggerProps): react_jsx_runtime0.JSX.Element;
36
42
  declare function DialogPortal({
37
43
  ...props
38
44
  }: DialogPortalProps): react_jsx_runtime0.JSX.Element;
39
45
  declare function DialogClose({
46
+ render,
47
+ children,
40
48
  ...props
41
49
  }: DialogCloseProps): react_jsx_runtime0.JSX.Element;
42
50
  declare function DialogOverlay({
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{Button as n}from"./button.js";import{cva as r}from"class-variance-authority";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"react";import{Dialog as s}from"@base-ui/react/dialog";import{IconX as c}from"@tabler/icons-react";const l=r(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,{variants:{size:{sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`}},defaultVariants:{size:`sm`}}),u=o.createContext({size:`sm`});function Dialog({size:e=`sm`,...t}){let n=o.useMemo(()=>({size:e}),[e]);return i(u.Provider,{value:n,children:i(s.Root,{"data-slot":`dialog`,...t})})}function DialogTrigger({...e}){return i(s.Trigger,{"data-slot":`dialog-trigger`,...e})}function DialogPortal({...e}){return i(s.Portal,{"data-slot":`dialog-portal`,...e})}function DialogClose({...e}){return i(s.Close,{"data-slot":`dialog-close`,...e})}function DialogOverlay({className:e,...n}){return i(s.Backdrop,{"data-slot":`dialog-overlay`,className:t(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...n})}function DialogContent({className:e,children:r,showCloseButton:d=!0,...f}){let{size:p}=o.useContext(u);return a(DialogPortal,{children:[i(DialogOverlay,{}),a(s.Popup,{"data-slot":`dialog-content`,className:t(l({size:p}),e),...f,children:[r,d&&a(s.Close,{"data-slot":`dialog-close`,render:i(n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[i(c,{}),i(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function DialogHeader({className:e,...n}){return i(`div`,{"data-slot":`dialog-header`,className:t(`gap-2 flex flex-col`,e),...n})}function DialogFooter({className:e,showCloseButton:r=!1,children:o,...c}){return a(`div`,{"data-slot":`dialog-footer`,className:t(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...c,children:[o,r&&i(s.Close,{render:i(n,{variant:`outline`}),children:`Close`})]})}function DialogTitle({className:e,...n}){return i(s.Title,{"data-slot":`dialog-title`,className:t(`text-base leading-none font-medium`,e),...n})}function DialogDescription({className:e,...n}){return i(s.Description,{"data-slot":`dialog-description`,className:t(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,e),...n})}export{Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{Button as n}from"./button.js";import{cva as r}from"class-variance-authority";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{Dialog as o}from"radix-ui";import{IconX as s}from"@tabler/icons-react";import*as c from"react";const l=r(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,{variants:{size:{sm:`sm:max-w-sm`,md:`sm:max-w-md`,lg:`sm:max-w-lg`,xl:`sm:max-w-xl`,"2xl":`sm:max-w-2xl`}},defaultVariants:{size:`sm`}}),u=c.createContext({size:`sm`});function Dialog({size:e=`sm`,...t}){let n=c.useMemo(()=>({size:e}),[e]);return i(u.Provider,{value:n,children:i(o.Root,{"data-slot":`dialog`,...t})})}function DialogTrigger({render:e,children:t,...n}){return e?i(o.Trigger,{"data-slot":`dialog-trigger`,asChild:!0,...n,children:e}):i(o.Trigger,{"data-slot":`dialog-trigger`,...n,children:t})}function DialogPortal({...e}){return i(o.Portal,{"data-slot":`dialog-portal`,...e})}function DialogClose({render:e,children:t,...n}){return e?i(o.Close,{"data-slot":`dialog-close`,asChild:!0,...n,children:e}):i(o.Close,{"data-slot":`dialog-close`,...n,children:t})}function DialogOverlay({className:e,...n}){return i(o.Overlay,{"data-slot":`dialog-overlay`,className:t(`bg-black/10 fixed inset-0 isolate z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`duration-100 supports-backdrop-filter:backdrop-blur-xs`,e),...n})}function DialogContent({className:e,children:r,showCloseButton:d=!0,...f}){let{size:p}=c.useContext(u);return a(DialogPortal,{children:[i(DialogOverlay,{}),a(o.Content,{"data-slot":`dialog-content`,className:t(l({size:p}),e),...f,children:[r,d&&i(o.Close,{"data-slot":`dialog-close`,asChild:!0,children:a(n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[i(s,{}),i(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function DialogHeader({className:e,...n}){return i(`div`,{"data-slot":`dialog-header`,className:t(`gap-2 flex flex-col`,e),...n})}function DialogFooter({className:e,showCloseButton:r=!1,children:s,...c}){return a(`div`,{"data-slot":`dialog-footer`,className:t(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4`,`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...c,children:[s,r&&i(o.Close,{asChild:!0,children:i(n,{variant:`outline`,children:`Close`})})]})}function DialogTitle({className:e,...n}){return i(o.Title,{"data-slot":`dialog-title`,className:t(`text-base leading-none font-medium`,e),...n})}function DialogDescription({className:e,...n}){return i(o.Description,{"data-slot":`dialog-description`,className:t(`text-muted-foreground text-sm`,`*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...n})}export{Dialog,DialogClose,DialogContent,DialogDescription,DialogFooter,DialogHeader,DialogOverlay,DialogPortal,DialogTitle,DialogTrigger};
2
2
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog'\nimport { IconX } from '@tabler/icons-react'\nimport { Button } from '@uselets/ui/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../lib/utils'\n\nconst dialogContentVariants = cva(\n 'bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\n\ntype DialogContextValue = {\n size: DialogSize\n}\n\nconst DialogContext = React.createContext<DialogContextValue>({\n size: 'sm'\n})\n\nexport type DialogProps = DialogPrimitive.Root.Props & {\n size?: DialogSize\n}\n\nexport type DialogTriggerProps = DialogPrimitive.Trigger.Props\n\nexport type DialogPortalProps = DialogPrimitive.Portal.Props\n\nexport type DialogCloseProps = DialogPrimitive.Close.Props\n\nexport type DialogOverlayProps = DialogPrimitive.Backdrop.Props\n\nexport type DialogContentProps = DialogPrimitive.Popup.Props & {\n showCloseButton?: boolean\n}\n\nexport type DialogHeaderProps = React.ComponentProps<'div'>\n\nexport type DialogFooterProps = React.ComponentProps<'div'> & {\n showCloseButton?: boolean\n}\n\nexport type DialogTitleProps = DialogPrimitive.Title.Props\n\nexport type DialogDescriptionProps = DialogPrimitive.Description.Props\n\nfunction Dialog({ size = 'sm', ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogContextValue>(() => ({ size }), [size])\n\n return (\n <DialogContext.Provider value={contextValue}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n </DialogContext.Provider>\n )\n}\n\nfunction DialogTrigger({ ...props }: DialogTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ ...props }: DialogCloseProps) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({ className, children, showCloseButton = true, ...props }: DialogContentProps) {\n const { size } = React.useContext(DialogContext)\n\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(dialogContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n render={<Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\" />}\n >\n <IconX />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && <DialogPrimitive.Close render={<Button variant=\"outline\" />}>Close</DialogPrimitive.Close>}\n </div>\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n 'text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"uUASA,MAAM,EAAwB,EAC5B,wUACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,MAAO,eACR,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAQK,EAAgB,EAAM,cAAkC,CAC5D,KAAM,KACP,CAAC,CA4BF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAmC,CAAE,OAAM,EAAG,CAAC,EAAK,CAAC,CAEhF,OACE,EAAC,EAAc,SAAA,CAAS,MAAO,WAC7B,EAACA,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,EAC/B,CAI7B,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAgB,SAAA,CACf,YAAU,iBACV,UAAW,EACT,wLACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,cAAc,CAAE,YAAW,WAAU,kBAAkB,GAAM,GAAG,GAA6B,CACpG,GAAM,CAAE,QAAS,EAAM,WAAW,EAAc,CAEhD,OACE,EAAC,aAAA,CAAA,SAAA,CACC,EAAC,cAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,MAAA,CACf,YAAU,iBACV,UAAW,EAAG,EAAsB,CAAE,OAAM,CAAC,CAAE,EAAU,CACzD,GAAI,YAEH,EACA,GACC,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,OAAQ,EAAC,EAAA,CAAO,QAAQ,QAAQ,UAAU,yBAAyB,KAAK,WAAY,WAEpF,EAAC,EAAA,EAAA,CAAQ,CACT,EAAC,OAAA,CAAK,UAAU,mBAAU,SAAY,CAAA,EAChB,CAAA,EAEJ,CAAA,CAAA,CACX,CAInB,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,GAAS,CAGtG,SAAS,aAAa,CAAE,YAAW,kBAAkB,GAAO,WAAU,GAAG,GAA4B,CACnG,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,2GACA,EACD,CACD,GAAI,YAEH,EACA,GAAmB,EAACA,EAAgB,MAAA,CAAM,OAAQ,EAAC,EAAA,CAAO,QAAQ,UAAA,CAAY,UAAE,SAA6B,CAAA,EAC1G,CAIV,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,qCAAsC,EAAU,CAC9D,GAAI,GACJ,CAIN,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EACT,qGACA,EACD,CACD,GAAI,GACJ"}
1
+ {"version":3,"file":"dialog.js","names":["DialogPrimitive"],"sources":["../../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { IconX } from '@tabler/icons-react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Dialog as DialogPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\n\nconst dialogContentVariants = cva(\n 'bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',\n {\n variants: {\n size: {\n sm: 'sm:max-w-sm',\n md: 'sm:max-w-md',\n lg: 'sm:max-w-lg',\n xl: 'sm:max-w-xl',\n '2xl': 'sm:max-w-2xl'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DialogSize = NonNullable<VariantProps<typeof dialogContentVariants>['size']>\ntype DialogSizeContextValue = { size: DialogSize }\nconst DialogSizeContext = React.createContext<DialogSizeContextValue>({ size: 'sm' })\n\nexport type DialogProps = React.ComponentProps<typeof DialogPrimitive.Root> & { size?: DialogSize }\nexport type DialogTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger> & { render?: React.ReactElement }\nexport type DialogPortalProps = React.ComponentProps<typeof DialogPrimitive.Portal>\nexport type DialogCloseProps = React.ComponentProps<typeof DialogPrimitive.Close> & { render?: React.ReactElement }\nexport type DialogOverlayProps = React.ComponentProps<typeof DialogPrimitive.Overlay>\nexport type DialogContentProps = React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}\nexport type DialogHeaderProps = React.ComponentProps<'div'>\nexport type DialogFooterProps = React.ComponentProps<'div'> & { showCloseButton?: boolean }\nexport type DialogTitleProps = React.ComponentProps<typeof DialogPrimitive.Title>\nexport type DialogDescriptionProps = React.ComponentProps<typeof DialogPrimitive.Description>\n\nfunction Dialog({ size = 'sm', ...props }: DialogProps) {\n const contextValue = React.useMemo<DialogSizeContextValue>(() => ({ size }), [size])\n\n return (\n <DialogSizeContext.Provider value={contextValue}>\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n </DialogSizeContext.Provider>\n )\n}\n\nfunction DialogTrigger({ render, children, ...props }: DialogTriggerProps) {\n if (render) {\n return (\n <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" asChild {...props}>\n {render}\n </DialogPrimitive.Trigger>\n )\n }\n\n return (\n <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props}>\n {children}\n </DialogPrimitive.Trigger>\n )\n}\n\nfunction DialogPortal({ ...props }: DialogPortalProps) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({ render, children, ...props }: DialogCloseProps) {\n if (render) {\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild {...props}>\n {render}\n </DialogPrimitive.Close>\n )\n }\n\n return (\n <DialogPrimitive.Close data-slot=\"dialog-close\" {...props}>\n {children}\n </DialogPrimitive.Close>\n )\n}\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 isolate z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'duration-100 supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({ className, children, showCloseButton = true, ...props }: DialogContentProps) {\n const { size } = React.useContext(DialogSizeContext)\n\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(dialogContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button variant=\"ghost\" className=\"absolute top-2 right-2\" size=\"icon-sm\">\n <IconX />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: DialogHeaderProps) {\n return <div data-slot=\"dialog-header\" className={cn('gap-2 flex flex-col', className)} {...props} />\n}\n\nfunction DialogFooter({ className, showCloseButton = false, children, ...props }: DialogFooterProps) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4',\n 'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n 'text-muted-foreground text-sm',\n '*:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n}\n"],"mappings":"0TASA,MAAM,EAAwB,EAC5B,wUACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,GAAI,cACJ,MAAO,eACR,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAIK,EAAoB,EAAM,cAAsC,CAAE,KAAM,KAAM,CAAC,CAerF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAuC,CAAE,OAAM,EAAG,CAAC,EAAK,CAAC,CAEpF,OACE,EAAC,EAAkB,SAAA,CAAS,MAAO,WACjC,EAACA,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,EAC3B,CAIjC,SAAS,cAAc,CAAE,SAAQ,WAAU,GAAG,GAA6B,CASzE,OARI,EAEA,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,QAAA,GAAQ,GAAI,WAC7D,GACuB,CAK5B,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,EACrD,YACuB,CAI9B,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,YAAY,CAAE,SAAQ,WAAU,GAAG,GAA2B,CASrE,OARI,EAEA,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,QAAA,GAAQ,GAAI,WACzD,GACqB,CAK1B,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,EACjD,YACqB,CAI5B,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,yCACA,0FACA,yDACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,cAAc,CAAE,YAAW,WAAU,kBAAkB,GAAM,GAAG,GAA6B,CACpG,GAAM,CAAE,QAAS,EAAM,WAAW,EAAkB,CAEpD,OACE,EAAC,aAAA,CAAA,SAAA,CACC,EAAC,cAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EAAG,EAAsB,CAAE,OAAM,CAAC,CAAE,EAAU,CACzD,GAAI,YAEH,EACA,GACC,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,QAAA,YAC9C,EAAC,EAAA,CAAO,QAAQ,QAAQ,UAAU,yBAAyB,KAAK,oBAC9D,EAAC,EAAA,EAAA,CAAQ,CACT,EAAC,OAAA,CAAK,UAAU,mBAAU,SAAY,CAAA,EAC/B,EACa,CAAA,EAEF,CAAA,CAAA,CACb,CAInB,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,GAAS,CAGtG,SAAS,aAAa,CAAE,YAAW,kBAAkB,GAAO,WAAU,GAAG,GAA4B,CACnG,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,oDACA,yDACA,EACD,CACD,GAAI,YAEH,EACA,GACC,EAACA,EAAgB,MAAA,CAAM,QAAA,YACrB,EAAC,EAAA,CAAO,QAAQ,mBAAU,SAAc,EAClB,CAAA,EAEtB,CAIV,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,qCAAsC,EAAU,CAC9D,GAAI,GACJ,CAIN,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EACT,gCACA,uEACA,EACD,CACD,GAAI,GACJ"}
@@ -1,2 +1,2 @@
1
- import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{Drawer as o}from"vaul";const s=n(`bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50`,{variants:{size:{sm:`data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm`,md:`data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md`,lg:`data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg`}},defaultVariants:{size:`sm`}}),c=a.createContext({size:`sm`});function Drawer({size:e=`sm`,...t}){let n=a.useMemo(()=>({size:e}),[e]);return r(c.Provider,{value:n,children:r(o.Root,{"data-slot":`drawer`,...t})})}function DrawerTrigger({...e}){return r(o.Trigger,{"data-slot":`drawer-trigger`,...e})}function DrawerPortal({...e}){return r(o.Portal,{"data-slot":`drawer-portal`,...e})}function DrawerClose({...e}){return r(o.Close,{"data-slot":`drawer-close`,...e})}function DrawerOverlay({className:e,...n}){return r(o.Overlay,{"data-slot":`drawer-overlay`,className:t(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50`,e),...n})}function DrawerContent({className:e,children:n,...l}){let{size:u}=a.useContext(c);return i(DrawerPortal,{"data-slot":`drawer-portal`,children:[r(DrawerOverlay,{}),i(o.Content,{"data-slot":`drawer-content`,className:t(s({size:u}),e),...l,children:[r(`div`,{className:`bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),n]})]})}function DrawerHeader({className:e,...n}){return r(`div`,{"data-slot":`drawer-header`,className:t(`gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left flex flex-col`,e),...n})}function DrawerFooter({className:e,...n}){return r(`div`,{"data-slot":`drawer-footer`,className:t(`gap-2 p-4 mt-auto flex flex-col`,e),...n})}function DrawerTitle({className:e,...n}){return r(o.Title,{"data-slot":`drawer-title`,className:t(`text-foreground text-base font-medium`,e),...n})}function DrawerDescription({className:e,...n}){return r(o.Description,{"data-slot":`drawer-description`,className:t(`text-muted-foreground text-sm`,e),...n})}export{Drawer,DrawerClose,DrawerContent,DrawerDescription,DrawerFooter,DrawerHeader,DrawerOverlay,DrawerPortal,DrawerTitle,DrawerTrigger};
1
+ import{t as e}from"../chunk-IpJEthwI.js";import{cn as t}from"../lib/utils.js";import{cva as n}from"class-variance-authority";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"react";import{Drawer as o}from"vaul";const s=n(`bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50`,{variants:{size:{sm:`data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm`,md:`data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md`,lg:`data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg`}},defaultVariants:{size:`sm`}}),c=a.createContext({size:`sm`});function Drawer({size:e=`sm`,...t}){let n=a.useMemo(()=>({size:e}),[e]);return r(c.Provider,{value:n,children:r(o.Root,{"data-slot":`drawer`,...t})})}function DrawerTrigger({...e}){return r(o.Trigger,{"data-slot":`drawer-trigger`,...e})}function DrawerPortal({...e}){return r(o.Portal,{"data-slot":`drawer-portal`,...e})}function DrawerClose({...e}){return r(o.Close,{"data-slot":`drawer-close`,...e})}function DrawerOverlay({className:e,...n}){return r(o.Overlay,{"data-slot":`drawer-overlay`,className:t(`bg-black/10 fixed inset-0 z-50`,`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0`,`supports-backdrop-filter:backdrop-blur-xs`,e),...n})}function DrawerContent({className:e,children:n,...l}){let{size:u}=a.useContext(c);return i(DrawerPortal,{"data-slot":`drawer-portal`,children:[r(DrawerOverlay,{}),i(o.Content,{"data-slot":`drawer-content`,className:t(s({size:u}),e),...l,children:[r(`div`,{className:`bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block`}),n]})]})}function DrawerHeader({className:e,...n}){return r(`div`,{"data-slot":`drawer-header`,className:t(`p-4 flex flex-col gap-0.5 md:gap-0.5`,`group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center`,`group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left`,e),...n})}function DrawerFooter({className:e,...n}){return r(`div`,{"data-slot":`drawer-footer`,className:t(`gap-2 p-4 mt-auto flex flex-col`,e),...n})}function DrawerTitle({className:e,...n}){return r(o.Title,{"data-slot":`drawer-title`,className:t(`text-foreground text-base font-medium`,e),...n})}function DrawerDescription({className:e,...n}){return r(o.Description,{"data-slot":`drawer-description`,className:t(`text-muted-foreground text-sm`,e),...n})}export{Drawer,DrawerClose,DrawerContent,DrawerDescription,DrawerFooter,DrawerHeader,DrawerOverlay,DrawerPortal,DrawerTitle,DrawerTrigger};
2
2
  //# sourceMappingURL=drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { cn } from '../lib/utils'\n\nconst drawerContentVariants = cva(\n 'bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50',\n {\n variants: {\n size: {\n sm: 'data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n md: 'data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md',\n lg: 'data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\n\ntype DrawerContextValue = {\n size: DrawerSize\n}\n\nconst DrawerContext = React.createContext<DrawerContextValue>({\n size: 'sm'\n})\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & {\n size?: DrawerSize\n}\n\nexport type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\n\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\n\nexport type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\n\nexport type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>\n\nexport type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content>\n\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\n\nexport type DrawerFooterProps = React.ComponentProps<'div'>\n\nexport type DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\n\nexport type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({ size = 'sm', ...props }: DrawerProps) {\n const contextValue = React.useMemo<DrawerContextValue>(() => ({ size }), [size])\n\n return (\n <DrawerContext.Provider value={contextValue}>\n <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n </DrawerContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({ className, children, ...props }: DrawerContentProps) {\n const { size } = React.useContext(DrawerContext)\n\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerContentVariants({ size }), className)}\n {...props}\n >\n <div className=\"bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left flex flex-col',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return <div data-slot=\"drawer-footer\" className={cn('gap-2 p-4 mt-auto flex flex-col', className)} {...props} />\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground text-base font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({ className, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n}\n"],"mappings":"qOAOA,MAAM,EAAwB,EAC5B,mxBACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,gWACJ,GAAI,gWACJ,GAAI,oWACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAQK,EAAgB,EAAM,cAAkC,CAC5D,KAAM,KACP,CAAC,CAwBF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAmC,CAAE,OAAM,EAAG,CAAC,EAAK,CAAC,CAEhF,OACE,EAAC,EAAc,SAAA,CAAS,MAAO,WAC7B,EAACA,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,EAC/B,CAI7B,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,mKACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,cAAc,CAAE,YAAW,WAAU,GAAG,GAA6B,CAC5E,GAAM,CAAE,QAAS,EAAM,WAAW,EAAc,CAEhD,OACE,EAAC,aAAA,CAAa,YAAU,0BACtB,EAAC,cAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EAAG,EAAsB,CAAE,OAAM,CAAC,CAAE,EAAU,CACzD,GAAI,YAEJ,EAAC,MAAA,CAAI,UAAU,6HAAA,CAA+H,CAC7I,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,2LACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,wCAAyC,EAAU,CACjE,GAAI,GACJ,CAIN,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EAAG,gCAAiC,EAAU,CACzD,GAAI,GACJ"}
1
+ {"version":3,"file":"drawer.js","names":["DrawerPrimitive"],"sources":["../../src/components/drawer.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { cn } from '../lib/utils'\n\nconst drawerContentVariants = cva(\n 'bg-background flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b group/drawer-content fixed z-50',\n {\n variants: {\n size: {\n sm: 'data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:sm:max-w-sm',\n md: 'data-[vaul-drawer-direction=bottom]:mt-20 data-[vaul-drawer-direction=bottom]:max-h-[85vh] data-[vaul-drawer-direction=top]:mb-20 data-[vaul-drawer-direction=top]:max-h-[85vh] data-[vaul-drawer-direction=left]:w-4/5 data-[vaul-drawer-direction=left]:sm:max-w-md data-[vaul-drawer-direction=right]:w-4/5 data-[vaul-drawer-direction=right]:sm:max-w-md',\n lg: 'data-[vaul-drawer-direction=bottom]:mt-12 data-[vaul-drawer-direction=bottom]:max-h-[90vh] data-[vaul-drawer-direction=top]:mb-12 data-[vaul-drawer-direction=top]:max-h-[90vh] data-[vaul-drawer-direction=left]:w-[90%] data-[vaul-drawer-direction=left]:sm:max-w-lg data-[vaul-drawer-direction=right]:w-[90%] data-[vaul-drawer-direction=right]:sm:max-w-lg'\n }\n },\n defaultVariants: {\n size: 'sm'\n }\n }\n)\n\ntype DrawerSize = NonNullable<VariantProps<typeof drawerContentVariants>['size']>\ntype DrawerSizeContextValue = { size: DrawerSize }\nconst DrawerSizeContext = React.createContext<DrawerSizeContextValue>({ size: 'sm' })\n\nexport type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root> & { size?: DrawerSize }\nexport type DrawerTriggerProps = React.ComponentProps<typeof DrawerPrimitive.Trigger>\nexport type DrawerPortalProps = React.ComponentProps<typeof DrawerPrimitive.Portal>\nexport type DrawerCloseProps = React.ComponentProps<typeof DrawerPrimitive.Close>\nexport type DrawerOverlayProps = React.ComponentProps<typeof DrawerPrimitive.Overlay>\nexport type DrawerContentProps = React.ComponentProps<typeof DrawerPrimitive.Content>\nexport type DrawerHeaderProps = React.ComponentProps<'div'>\nexport type DrawerFooterProps = React.ComponentProps<'div'>\nexport type DrawerTitleProps = React.ComponentProps<typeof DrawerPrimitive.Title>\nexport type DrawerDescriptionProps = React.ComponentProps<typeof DrawerPrimitive.Description>\n\nfunction Drawer({ size = 'sm', ...props }: DrawerProps) {\n const contextValue = React.useMemo<DrawerSizeContextValue>(() => ({ size }), [size])\n\n return (\n <DrawerSizeContext.Provider value={contextValue}>\n <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n </DrawerSizeContext.Provider>\n )\n}\n\nfunction DrawerTrigger({ ...props }: DrawerTriggerProps) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: DrawerPortalProps) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: DrawerCloseProps) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: DrawerOverlayProps) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'bg-black/10 fixed inset-0 z-50',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0',\n 'supports-backdrop-filter:backdrop-blur-xs',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({ className, children, ...props }: DrawerContentProps) {\n const { size } = React.useContext(DrawerSizeContext)\n\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerContentVariants({ size }), className)}\n {...props}\n >\n <div className=\"bg-muted mt-4 h-1 w-25 rounded-full mx-auto hidden shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n 'p-4 flex flex-col gap-0.5 md:gap-0.5',\n 'group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center',\n 'group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps) {\n return <div data-slot=\"drawer-footer\" className={cn('gap-2 p-4 mt-auto flex flex-col', className)} {...props} />\n}\n\nfunction DrawerTitle({ className, ...props }: DrawerTitleProps) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground text-base font-medium', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({ className, ...props }: DrawerDescriptionProps) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger\n}\n"],"mappings":"qOAOA,MAAM,EAAwB,EAC5B,mxBACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,gWACJ,GAAI,gWACJ,GAAI,oWACL,CACF,CACD,gBAAiB,CACf,KAAM,KACP,CACF,CACF,CAIK,EAAoB,EAAM,cAAsC,CAAE,KAAM,KAAM,CAAC,CAarF,SAAS,OAAO,CAAE,OAAO,KAAM,GAAG,GAAsB,CACtD,IAAM,EAAe,EAAM,aAAuC,CAAE,OAAM,EAAG,CAAC,EAAK,CAAC,CAEpF,OACE,EAAC,EAAkB,SAAA,CAAS,MAAO,WACjC,EAACA,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,GAAS,EAC3B,CAIjC,SAAS,cAAc,CAAE,GAAG,GAA6B,CACvD,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,GAAS,CAG1E,SAAS,aAAa,CAAE,GAAG,GAA4B,CACrD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,GAAS,CAGxE,SAAS,YAAY,CAAE,GAAG,GAA2B,CACnD,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,GAAS,CAGtE,SAAS,cAAc,CAAE,YAAW,GAAG,GAA6B,CAClE,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iCACA,0FACA,4CACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,cAAc,CAAE,YAAW,WAAU,GAAG,GAA6B,CAC5E,GAAM,CAAE,QAAS,EAAM,WAAW,EAAkB,CAEpD,OACE,EAAC,aAAA,CAAa,YAAU,0BACtB,EAAC,cAAA,EAAA,CAAgB,CACjB,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EAAG,EAAsB,CAAE,OAAM,CAAC,CAAE,EAAU,CACzD,GAAI,YAEJ,EAAC,MAAA,CAAI,UAAU,6HAAA,CAA+H,CAC7I,EAAA,EACuB,CAAA,EACb,CAInB,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,uCACA,uEACA,iFACA,EACD,CACD,GAAI,GACJ,CAIN,SAAS,aAAa,CAAE,YAAW,GAAG,GAA4B,CAChE,OAAO,EAAC,MAAA,CAAI,YAAU,gBAAgB,UAAW,EAAG,kCAAmC,EAAU,CAAE,GAAI,GAAS,CAGlH,SAAS,YAAY,CAAE,YAAW,GAAG,GAA2B,CAC9D,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,wCAAyC,EAAU,CACjE,GAAI,GACJ,CAIN,SAAS,kBAAkB,CAAE,YAAW,GAAG,GAAiC,CAC1E,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EAAG,gCAAiC,EAAU,CACzD,GAAI,GACJ"}