@biotechusa/pdo-ui 1.0.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 (89) hide show
  1. package/README.md +23 -0
  2. package/dist/alert-dialog.js +80 -0
  3. package/dist/alert.js +49 -0
  4. package/dist/autocomplete.js +137 -0
  5. package/dist/avatar.js +25 -0
  6. package/dist/badge.js +43 -0
  7. package/dist/button.js +52 -0
  8. package/dist/card.js +52 -0
  9. package/dist/checkbox-group.js +10 -0
  10. package/dist/checkbox.js +47 -0
  11. package/dist/combobox.js +214 -0
  12. package/dist/dialog.js +89 -0
  13. package/dist/empty.js +85 -0
  14. package/dist/field.js +34 -0
  15. package/dist/fieldset.js +18 -0
  16. package/dist/form.js +11 -0
  17. package/dist/frame.js +45 -0
  18. package/dist/group.js +48 -0
  19. package/dist/index.css +5026 -0
  20. package/dist/index.js +43 -0
  21. package/dist/input-group.js +66 -0
  22. package/dist/input.js +17 -0
  23. package/dist/label.js +10 -0
  24. package/dist/lib/utils.d.ts +2 -0
  25. package/dist/menu.js +141 -0
  26. package/dist/number-field.js +88 -0
  27. package/dist/pagination.js +95 -0
  28. package/dist/popover.js +52 -0
  29. package/dist/progress.js +42 -0
  30. package/dist/radio-group.js +23 -0
  31. package/dist/scroll-area.js +44 -0
  32. package/dist/select.js +118 -0
  33. package/dist/separator.js +12 -0
  34. package/dist/sheet.js +104 -0
  35. package/dist/skeleton.js +10 -0
  36. package/dist/slider.js +61 -0
  37. package/dist/spinner.js +12 -0
  38. package/dist/src/alert-dialog.d.ts +12 -0
  39. package/dist/src/alert.d.ts +10 -0
  40. package/dist/src/autocomplete.d.ts +23 -0
  41. package/dist/src/avatar.d.ts +5 -0
  42. package/dist/src/badge.d.ts +12 -0
  43. package/dist/src/button.d.ts +13 -0
  44. package/dist/src/card.d.ts +9 -0
  45. package/dist/src/checkbox-group.d.ts +3 -0
  46. package/dist/src/checkbox.d.ts +3 -0
  47. package/dist/src/combobox.d.ts +25 -0
  48. package/dist/src/dialog.d.ts +14 -0
  49. package/dist/src/empty.d.ts +11 -0
  50. package/dist/src/field.d.ts +8 -0
  51. package/dist/src/fieldset.d.ts +4 -0
  52. package/dist/src/form.d.ts +3 -0
  53. package/dist/src/frame.d.ts +8 -0
  54. package/dist/src/group.d.ts +17 -0
  55. package/dist/src/index.d.ts +44 -0
  56. package/dist/src/input-group.d.ts +13 -0
  57. package/dist/src/input.d.ts +8 -0
  58. package/dist/src/label.d.ts +3 -0
  59. package/dist/src/menu.d.ts +34 -0
  60. package/dist/src/number-field.d.ts +12 -0
  61. package/dist/src/pagination.d.ts +15 -0
  62. package/dist/src/popover.d.ts +14 -0
  63. package/dist/src/progress.d.ts +7 -0
  64. package/dist/src/radio-group.d.ts +5 -0
  65. package/dist/src/scroll-area.d.ts +6 -0
  66. package/dist/src/select.d.ts +15 -0
  67. package/dist/src/separator.d.ts +3 -0
  68. package/dist/src/sheet.d.ts +19 -0
  69. package/dist/src/skeleton.d.ts +2 -0
  70. package/dist/src/slider.d.ts +4 -0
  71. package/dist/src/spinner.d.ts +2 -0
  72. package/dist/src/switch.d.ts +3 -0
  73. package/dist/src/table.d.ts +10 -0
  74. package/dist/src/tabs.d.ts +9 -0
  75. package/dist/src/textarea.d.ts +7 -0
  76. package/dist/src/toggle-group.d.ts +12 -0
  77. package/dist/src/toggle.d.ts +8 -0
  78. package/dist/src/toolbar.d.ts +8 -0
  79. package/dist/src/tooltip.d.ts +10 -0
  80. package/dist/styles.css +144 -0
  81. package/dist/switch.js +15 -0
  82. package/dist/table.js +63 -0
  83. package/dist/tabs.js +39 -0
  84. package/dist/textarea.js +19 -0
  85. package/dist/toggle-group.js +49 -0
  86. package/dist/toggle.js +33 -0
  87. package/dist/toolbar.js +46 -0
  88. package/dist/tooltip.js +29 -0
  89. package/package.json +76 -0
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # Rslib project
2
+
3
+ ## Setup
4
+
5
+ Install the dependencies:
6
+
7
+ ```bash
8
+ pnpm install
9
+ ```
10
+
11
+ ## Get started
12
+
13
+ Build the library:
14
+
15
+ ```bash
16
+ pnpm build
17
+ ```
18
+
19
+ Build the library in watch mode:
20
+
21
+ ```bash
22
+ pnpm dev
23
+ ```
@@ -0,0 +1,80 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { AlertDialog } from "@base-ui-components/react/alert-dialog";
3
+ import { cn } from "../lib/utils";
4
+ function alert_dialog_AlertDialog(props) {
5
+ return /*#__PURE__*/ jsx(AlertDialog.Root, {
6
+ "data-slot": "alert-dialog",
7
+ ...props
8
+ });
9
+ }
10
+ function AlertDialogTrigger(props) {
11
+ return /*#__PURE__*/ jsx(AlertDialog.Trigger, {
12
+ "data-slot": "alert-dialog-trigger",
13
+ ...props
14
+ });
15
+ }
16
+ function AlertDialogPortal(props) {
17
+ return /*#__PURE__*/ jsx(AlertDialog.Portal, {
18
+ ...props
19
+ });
20
+ }
21
+ function AlertDialogBackdrop({ className, ...props }) {
22
+ return /*#__PURE__*/ jsx(AlertDialog.Backdrop, {
23
+ className: cn("fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-all duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0", className),
24
+ "data-slot": "alert-dialog-backdrop",
25
+ ...props
26
+ });
27
+ }
28
+ function AlertDialogPopup({ className, ...props }) {
29
+ return /*#__PURE__*/ jsxs(AlertDialogPortal, {
30
+ children: [
31
+ /*#__PURE__*/ jsx(AlertDialogBackdrop, {}),
32
+ /*#__PURE__*/ jsx("div", {
33
+ className: "fixed inset-0 z-50",
34
+ children: /*#__PURE__*/ jsx("div", {
35
+ className: "flex h-dvh flex-col items-center overflow-hidden pt-6 max-sm:before:flex-1 sm:overflow-y-auto sm:p-4 sm:after:flex-1 sm:before:basis-[20vh]",
36
+ children: /*#__PURE__*/ jsx(AlertDialog.Popup, {
37
+ className: cn("sm:-translate-y-[calc(1.25rem*var(--nested-dialogs))] row-start-2 grid w-full min-w-0 origin-top gap-4 border bg-popover bg-clip-padding p-6 text-popover-foreground shadow-lg transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:overflow-y-auto max-sm:border-none max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4 sm:max-w-lg sm:scale-[calc(1-0.1*var(--nested-dialogs))] sm:rounded-2xl sm:data-ending-style:scale-98 sm:data-starting-style:scale-98 dark:bg-clip-border", "relative before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] max-sm:before:hidden sm:data-nested:data-ending-style:translate-y-8 sm:data-nested:data-starting-style:translate-y-8 sm:before:rounded-[calc(var(--radius-2xl)-1px)] dark:before:shadow-[0_-1px_--theme(--color-white/8%)]", className),
38
+ "data-slot": "alert-dialog-popup",
39
+ ...props
40
+ })
41
+ })
42
+ })
43
+ ]
44
+ });
45
+ }
46
+ function AlertDialogHeader({ className, ...props }) {
47
+ return /*#__PURE__*/ jsx("div", {
48
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
49
+ "data-slot": "alert-dialog-header",
50
+ ...props
51
+ });
52
+ }
53
+ function AlertDialogFooter({ className, ...props }) {
54
+ return /*#__PURE__*/ jsx("div", {
55
+ className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
56
+ "data-slot": "alert-dialog-footer",
57
+ ...props
58
+ });
59
+ }
60
+ function AlertDialogTitle({ className, ...props }) {
61
+ return /*#__PURE__*/ jsx(AlertDialog.Title, {
62
+ className: cn("font-semibold text-lg", className),
63
+ "data-slot": "alert-dialog-title",
64
+ ...props
65
+ });
66
+ }
67
+ function AlertDialogDescription({ className, ...props }) {
68
+ return /*#__PURE__*/ jsx(AlertDialog.Description, {
69
+ className: cn("text-muted-foreground text-sm", className),
70
+ "data-slot": "alert-dialog-description",
71
+ ...props
72
+ });
73
+ }
74
+ function AlertDialogClose(props) {
75
+ return /*#__PURE__*/ jsx(AlertDialog.Close, {
76
+ "data-slot": "alert-dialog-close",
77
+ ...props
78
+ });
79
+ }
80
+ export { alert_dialog_AlertDialog as AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogPopup as AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogBackdrop as AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
package/dist/alert.js ADDED
@@ -0,0 +1,49 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "../lib/utils";
4
+ const alertVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-3.5 py-3 text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-[1lh] [&>svg]:w-4", {
5
+ defaultVariants: {
6
+ variant: "default"
7
+ },
8
+ variants: {
9
+ variant: {
10
+ default: "bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground",
11
+ error: "border-destructive/32 bg-destructive/4 [&>svg]:text-destructive",
12
+ info: "border-info/32 bg-info/4 [&>svg]:text-info",
13
+ success: "border-success/32 bg-success/4 [&>svg]:text-success",
14
+ warning: "border-warning/32 bg-warning/4 [&>svg]:text-warning"
15
+ }
16
+ }
17
+ });
18
+ function Alert({ className, variant, ...props }) {
19
+ return /*#__PURE__*/ jsx("div", {
20
+ className: cn(alertVariants({
21
+ variant
22
+ }), className),
23
+ "data-slot": "alert",
24
+ role: "alert",
25
+ ...props
26
+ });
27
+ }
28
+ function AlertTitle({ className, ...props }) {
29
+ return /*#__PURE__*/ jsx("div", {
30
+ className: cn("font-medium [svg~&]:col-start-2", className),
31
+ "data-slot": "alert-title",
32
+ ...props
33
+ });
34
+ }
35
+ function AlertDescription({ className, ...props }) {
36
+ return /*#__PURE__*/ jsx("div", {
37
+ className: cn("flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2", className),
38
+ "data-slot": "alert-description",
39
+ ...props
40
+ });
41
+ }
42
+ function AlertAction({ className, ...props }) {
43
+ return /*#__PURE__*/ jsx("div", {
44
+ className: cn("flex gap-1 max-sm:col-start-2 max-sm:mt-2 sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-description]~&]:col-start-2 sm:[[data-slot=alert-title]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-description]~&]:col-start-3 sm:[svg~[data-slot=alert-title]~&]:col-start-3", className),
45
+ "data-slot": "alert-action",
46
+ ...props
47
+ });
48
+ }
49
+ export { Alert, AlertAction, AlertDescription, AlertTitle };
@@ -0,0 +1,137 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Autocomplete } from "@base-ui-components/react/autocomplete";
3
+ import { ChevronsUpDownIcon, XIcon } from "lucide-react";
4
+ import { cn } from "../lib/utils";
5
+ import { Input } from "./input.js";
6
+ import { ScrollArea } from "./scroll-area.js";
7
+ const autocomplete_Autocomplete = Autocomplete.Root;
8
+ function AutocompleteInput({ className, showTrigger = false, showClear = false, size, ...props }) {
9
+ const sizeValue = size ?? "default";
10
+ return /*#__PURE__*/ jsxs("div", {
11
+ className: "relative w-full",
12
+ children: [
13
+ /*#__PURE__*/ jsx(Autocomplete.Input, {
14
+ className: cn("sm" === sizeValue ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7", className),
15
+ "data-slot": "autocomplete-input",
16
+ render: /*#__PURE__*/ jsx(Input, {
17
+ size: sizeValue
18
+ }),
19
+ ...props
20
+ }),
21
+ showTrigger && /*#__PURE__*/ jsx(AutocompleteTrigger, {
22
+ className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-72 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "sm" === sizeValue ? "end-0" : "end-0.5"),
23
+ children: /*#__PURE__*/ jsx(ChevronsUpDownIcon, {})
24
+ }),
25
+ showClear && /*#__PURE__*/ jsx(AutocompleteClear, {
26
+ className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-72 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", "sm" === sizeValue ? "end-0" : "end-0.5"),
27
+ children: /*#__PURE__*/ jsx(XIcon, {})
28
+ })
29
+ ]
30
+ });
31
+ }
32
+ function AutocompletePopup({ className, children, sideOffset = 4, ...props }) {
33
+ return /*#__PURE__*/ jsx(Autocomplete.Portal, {
34
+ children: /*#__PURE__*/ jsx(Autocomplete.Positioner, {
35
+ className: "z-50 select-none",
36
+ "data-slot": "autocomplete-positioner",
37
+ sideOffset: sideOffset,
38
+ children: /*#__PURE__*/ jsx("span", {
39
+ className: "relative flex max-h-full origin-(--transform-origin) rounded-lg border bg-popover bg-clip-padding transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-lg has-data-starting-style:scale-98 has-data-starting-style:opacity-0 dark:not-in-data-[slot=group]:bg-clip-border",
40
+ children: /*#__PURE__*/ jsx(Autocomplete.Popup, {
41
+ className: cn("flex max-h-[min(var(--available-height),23rem)] w-(--anchor-width) max-w-(--available-width) flex-col", className),
42
+ "data-slot": "autocomplete-popup",
43
+ ...props,
44
+ children: children
45
+ })
46
+ })
47
+ })
48
+ });
49
+ }
50
+ function AutocompleteItem({ className, children, ...props }) {
51
+ return /*#__PURE__*/ jsx(Autocomplete.Item, {
52
+ className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:text-sm", className),
53
+ "data-slot": "autocomplete-item",
54
+ ...props,
55
+ children: children
56
+ });
57
+ }
58
+ function AutocompleteSeparator({ className, ...props }) {
59
+ return /*#__PURE__*/ jsx(Autocomplete.Separator, {
60
+ className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
61
+ "data-slot": "autocomplete-separator",
62
+ ...props
63
+ });
64
+ }
65
+ function AutocompleteGroup({ className, ...props }) {
66
+ return /*#__PURE__*/ jsx(Autocomplete.Group, {
67
+ className: className,
68
+ "data-slot": "autocomplete-group",
69
+ ...props
70
+ });
71
+ }
72
+ function AutocompleteGroupLabel({ className, ...props }) {
73
+ return /*#__PURE__*/ jsx(Autocomplete.GroupLabel, {
74
+ className: cn("px-2 py-1.5 font-medium text-muted-foreground text-xs", className),
75
+ "data-slot": "autocomplete-group-label",
76
+ ...props
77
+ });
78
+ }
79
+ function AutocompleteEmpty({ className, ...props }) {
80
+ return /*#__PURE__*/ jsx(Autocomplete.Empty, {
81
+ className: cn("not-empty:p-2 text-center text-muted-foreground text-sm", className),
82
+ "data-slot": "autocomplete-empty",
83
+ ...props
84
+ });
85
+ }
86
+ function AutocompleteRow({ className, ...props }) {
87
+ return /*#__PURE__*/ jsx(Autocomplete.Row, {
88
+ className: className,
89
+ "data-slot": "autocomplete-row",
90
+ ...props
91
+ });
92
+ }
93
+ function AutocompleteValue({ ...props }) {
94
+ return /*#__PURE__*/ jsx(Autocomplete.Value, {
95
+ "data-slot": "autocomplete-value",
96
+ ...props
97
+ });
98
+ }
99
+ function AutocompleteList({ className, ...props }) {
100
+ return /*#__PURE__*/ jsx(ScrollArea, {
101
+ className: "flex-1",
102
+ children: /*#__PURE__*/ jsx(Autocomplete.List, {
103
+ className: cn("not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3", className),
104
+ "data-slot": "autocomplete-list",
105
+ ...props
106
+ })
107
+ });
108
+ }
109
+ function AutocompleteClear({ className, ...props }) {
110
+ return /*#__PURE__*/ jsx(Autocomplete.Clear, {
111
+ className: cn("-translate-y-1/2 absolute end-0.5 top-1/2 inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-72 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
112
+ "data-slot": "autocomplete-clear",
113
+ ...props,
114
+ children: /*#__PURE__*/ jsx(XIcon, {})
115
+ });
116
+ }
117
+ function AutocompleteStatus({ className, ...props }) {
118
+ return /*#__PURE__*/ jsx(Autocomplete.Status, {
119
+ className: cn("px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0", className),
120
+ "data-slot": "autocomplete-status",
121
+ ...props
122
+ });
123
+ }
124
+ function AutocompleteCollection({ ...props }) {
125
+ return /*#__PURE__*/ jsx(Autocomplete.Collection, {
126
+ "data-slot": "autocomplete-collection",
127
+ ...props
128
+ });
129
+ }
130
+ function AutocompleteTrigger({ className, ...props }) {
131
+ return /*#__PURE__*/ jsx(Autocomplete.Trigger, {
132
+ className: className,
133
+ "data-slot": "autocomplete-trigger",
134
+ ...props
135
+ });
136
+ }
137
+ export { autocomplete_Autocomplete as Autocomplete, AutocompleteClear, AutocompleteCollection, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, AutocompleteRow, AutocompleteSeparator, AutocompleteStatus, AutocompleteTrigger, AutocompleteValue };
package/dist/avatar.js ADDED
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Avatar } from "@base-ui-components/react/avatar";
3
+ import { cn } from "../lib/utils";
4
+ function avatar_Avatar({ className, ...props }) {
5
+ return /*#__PURE__*/ jsx(Avatar.Root, {
6
+ className: cn("inline-flex size-8 shrink-0 select-none items-center justify-center overflow-hidden rounded-full bg-background align-middle font-medium text-xs", className),
7
+ "data-slot": "avatar",
8
+ ...props
9
+ });
10
+ }
11
+ function AvatarImage({ className, ...props }) {
12
+ return /*#__PURE__*/ jsx(Avatar.Image, {
13
+ className: cn("size-full object-cover", className),
14
+ "data-slot": "avatar-image",
15
+ ...props
16
+ });
17
+ }
18
+ function AvatarFallback({ className, ...props }) {
19
+ return /*#__PURE__*/ jsx(Avatar.Fallback, {
20
+ className: cn("flex size-full items-center justify-center rounded-full bg-muted", className),
21
+ "data-slot": "avatar-fallback",
22
+ ...props
23
+ });
24
+ }
25
+ export { avatar_Avatar as Avatar, AvatarFallback, AvatarImage };
package/dist/badge.js ADDED
@@ -0,0 +1,43 @@
1
+ import { mergeProps } from "@base-ui-components/react/merge-props";
2
+ import { useRender } from "@base-ui-components/react/use-render";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../lib/utils";
5
+ const badgeVariants = cva("relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button,a&]:cursor-pointer [button,a&]:pointer-coarse:after:absolute [button,a&]:pointer-coarse:after:size-full [button,a&]:pointer-coarse:after:min-h-11 [button,a&]:pointer-coarse:after:min-w-11", {
6
+ defaultVariants: {
7
+ size: "default",
8
+ variant: "default"
9
+ },
10
+ variants: {
11
+ size: {
12
+ default: "px-[calc(--spacing(1)-1px)] text-xs",
13
+ lg: "px-[calc(--spacing(1.5)-1px)] text-sm",
14
+ sm: "rounded-[calc(var(--radius-sm)-2px)] px-[calc(--spacing(1)-1px)] text-[.625rem]"
15
+ },
16
+ variant: {
17
+ default: "bg-primary text-primary-foreground [button,a&]:hover:bg-primary/90",
18
+ destructive: "bg-destructive text-white [button,a&]:hover:bg-destructive/90",
19
+ error: "bg-destructive/8 text-destructive-foreground dark:bg-destructive/16",
20
+ info: "bg-info/8 text-info-foreground dark:bg-info/16",
21
+ outline: "border-border bg-transparent dark:bg-input/32 [button,a&]:hover:bg-accent/50 dark:[button,a&]:hover:bg-input/48",
22
+ secondary: "bg-secondary text-secondary-foreground [button,a&]:hover:bg-secondary/90",
23
+ success: "bg-success/8 text-success-foreground dark:bg-success/16",
24
+ warning: "bg-warning/8 text-warning-foreground dark:bg-warning/16"
25
+ }
26
+ }
27
+ });
28
+ function Badge({ className, variant, size, render, ...props }) {
29
+ const defaultProps = {
30
+ className: cn(badgeVariants({
31
+ className,
32
+ size,
33
+ variant
34
+ })),
35
+ "data-slot": "badge"
36
+ };
37
+ return useRender({
38
+ defaultTagName: "span",
39
+ props: mergeProps(defaultProps, props),
40
+ render
41
+ });
42
+ }
43
+ export { Badge, badgeVariants };
package/dist/button.js ADDED
@@ -0,0 +1,52 @@
1
+ import { mergeProps } from "@base-ui-components/react/merge-props";
2
+ import { useRender } from "@base-ui-components/react/use-render";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../lib/utils";
5
+ const buttonVariants = cva("relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border bg-clip-padding font-medium text-sm outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
6
+ defaultVariants: {
7
+ size: "default",
8
+ variant: "default"
9
+ },
10
+ variants: {
11
+ size: {
12
+ default: "min-h-8 px-[calc(--spacing(3)-1px)] py-[calc(--spacing(1.5)-1px)]",
13
+ icon: "size-8",
14
+ "icon-lg": "size-9",
15
+ "icon-sm": "size-7",
16
+ "icon-xl": "size-10 [&_svg:not([class*='size-'])]:size-4.5",
17
+ "icon-xs": "size-6 rounded-md before:rounded-[calc(var(--radius-md)-1px)]",
18
+ lg: "min-h-9 px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2)-1px)]",
19
+ sm: "min-h-7 gap-1.5 px-[calc(--spacing(2.5)-1px)] py-[calc(--spacing(1)-1px)]",
20
+ xl: "min-h-10 px-[calc(--spacing(4)-1px)] py-[calc(--spacing(2)-1px)] text-base [&_svg:not([class*='size-'])]:size-4.5",
21
+ xs: "min-h-6 gap-1 rounded-md px-[calc(--spacing(2)-1px)] py-[calc(--spacing(1)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] [&_svg:not([class*='size-'])]:size-3",
22
+ touch: "py-5 px-6 min-w-[120px]"
23
+ },
24
+ variant: {
25
+ default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [&:is(:active,[data-pressed])]:inset-shadow-[0_1px_--theme(--color-black/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none",
26
+ destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [&:is(:active,[data-pressed])]:inset-shadow-[0_1px_--theme(--color-black/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none",
27
+ "destructive-outline": "border-border bg-transparent text-destructive-foreground shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none [&:is(:hover,[data-pressed])]:border-destructive/32 [&:is(:hover,[data-pressed])]:bg-destructive/4",
28
+ ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
29
+ link: "border-transparent underline-offset-4 hover:underline",
30
+ outline: "border-border bg-background shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [&:is(:disabled,:active,[data-pressed])]:shadow-none [&:is(:hover,[data-pressed])]:bg-accent/50 dark:[&:is(:hover,[data-pressed])]:bg-input/64",
31
+ secondary: "border-secondary bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90"
32
+ }
33
+ }
34
+ });
35
+ function Button({ className, variant, size, render, ...props }) {
36
+ const typeValue = render ? void 0 : "button";
37
+ const defaultProps = {
38
+ className: cn(buttonVariants({
39
+ className,
40
+ size,
41
+ variant
42
+ })),
43
+ "data-slot": "button",
44
+ type: typeValue
45
+ };
46
+ return useRender({
47
+ defaultTagName: "button",
48
+ props: mergeProps(defaultProps, props),
49
+ render
50
+ });
51
+ }
52
+ export { Button, buttonVariants };
package/dist/card.js ADDED
@@ -0,0 +1,52 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils";
3
+ function Card({ className, ...props }) {
4
+ return /*#__PURE__*/ jsx("div", {
5
+ className: cn("relative flex flex-col gap-6 rounded-2xl border bg-card bg-clip-padding py-6 text-card-foreground shadow-xs before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]", className),
6
+ "data-slot": "card",
7
+ ...props
8
+ });
9
+ }
10
+ function CardHeader({ className, ...props }) {
11
+ return /*#__PURE__*/ jsx("div", {
12
+ className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
13
+ "data-slot": "card-header",
14
+ ...props
15
+ });
16
+ }
17
+ function CardTitle({ className, ...props }) {
18
+ return /*#__PURE__*/ jsx("div", {
19
+ className: cn("font-semibold text-lg leading-none", className),
20
+ "data-slot": "card-title",
21
+ ...props
22
+ });
23
+ }
24
+ function CardDescription({ className, ...props }) {
25
+ return /*#__PURE__*/ jsx("div", {
26
+ className: cn("text-muted-foreground text-sm", className),
27
+ "data-slot": "card-description",
28
+ ...props
29
+ });
30
+ }
31
+ function CardAction({ className, ...props }) {
32
+ return /*#__PURE__*/ jsx("div", {
33
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
34
+ "data-slot": "card-action",
35
+ ...props
36
+ });
37
+ }
38
+ function CardPanel({ className, ...props }) {
39
+ return /*#__PURE__*/ jsx("div", {
40
+ className: cn("px-6", className),
41
+ "data-slot": "card-content",
42
+ ...props
43
+ });
44
+ }
45
+ function CardFooter({ className, ...props }) {
46
+ return /*#__PURE__*/ jsx("div", {
47
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
48
+ "data-slot": "card-footer",
49
+ ...props
50
+ });
51
+ }
52
+ export { Card, CardAction, CardPanel as CardContent, CardDescription, CardFooter, CardHeader, CardPanel, CardTitle };
@@ -0,0 +1,10 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { CheckboxGroup } from "@base-ui-components/react/checkbox-group";
3
+ import { cn } from "../lib/utils";
4
+ function checkbox_group_CheckboxGroup({ className, ...props }) {
5
+ return /*#__PURE__*/ jsx(CheckboxGroup, {
6
+ className: cn("flex flex-col items-start gap-3", className),
7
+ ...props
8
+ });
9
+ }
10
+ export { checkbox_group_CheckboxGroup as CheckboxGroup };
@@ -0,0 +1,47 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Checkbox } from "@base-ui-components/react/checkbox";
3
+ import { cn } from "../lib/utils";
4
+ function checkbox_Checkbox({ className, ...props }) {
5
+ return /*#__PURE__*/ jsx(Checkbox.Root, {
6
+ className: cn("relative inline-flex size-4 shrink-0 items-center justify-center rounded-lg border border-input bg-background bg-clip-padding shadow-xs outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(0.25rem-1px)] not-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-64 aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 dark:not-data-checked:bg-input/32 dark:bg-clip-border dark:aria-invalid:ring-destructive/24 dark:not-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)] [&:is(:disabled,[data-checked],[aria-invalid])]:shadow-none", className),
7
+ "data-slot": "checkbox",
8
+ ...props,
9
+ children: /*#__PURE__*/ jsx(Checkbox.Indicator, {
10
+ className: "-inset-px absolute flex items-center justify-center rounded-lg text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground",
11
+ "data-slot": "checkbox-indicator",
12
+ render: (props, state)=>/*#__PURE__*/ jsx("span", {
13
+ ...props,
14
+ children: state.indeterminate ? /*#__PURE__*/ jsx("svg", {
15
+ className: "size-3",
16
+ fill: "none",
17
+ height: "24",
18
+ stroke: "currentColor",
19
+ strokeLinecap: "round",
20
+ strokeLinejoin: "round",
21
+ strokeWidth: "3",
22
+ viewBox: "0 0 24 24",
23
+ width: "24",
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ children: /*#__PURE__*/ jsx("path", {
26
+ d: "M5.252 12h13.496"
27
+ })
28
+ }) : /*#__PURE__*/ jsx("svg", {
29
+ className: "size-3",
30
+ fill: "none",
31
+ height: "24",
32
+ stroke: "currentColor",
33
+ strokeLinecap: "round",
34
+ strokeLinejoin: "round",
35
+ strokeWidth: "3",
36
+ viewBox: "0 0 24 24",
37
+ width: "24",
38
+ xmlns: "http://www.w3.org/2000/svg",
39
+ children: /*#__PURE__*/ jsx("path", {
40
+ d: "M5.252 12.7 10.2 18.63 18.748 5.37"
41
+ })
42
+ })
43
+ })
44
+ })
45
+ });
46
+ }
47
+ export { checkbox_Checkbox as Checkbox };