@ichaingo/ui 1.1.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 (141) hide show
  1. package/.babelrc +12 -0
  2. package/README.md +103 -0
  3. package/components.json +21 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.mjs +64 -0
  6. package/dist/alert-dialog.d.ts +27 -0
  7. package/dist/alert-dialog.mjs +146 -0
  8. package/dist/alert.d.ts +16 -0
  9. package/dist/alert.mjs +66 -0
  10. package/dist/aspect-ratio.d.ts +6 -0
  11. package/dist/aspect-ratio.mjs +10 -0
  12. package/dist/avatar.d.ts +11 -0
  13. package/dist/avatar.mjs +53 -0
  14. package/dist/badge.d.ts +14 -0
  15. package/dist/badge.mjs +39 -0
  16. package/dist/breadcrumb.d.ts +20 -0
  17. package/dist/breadcrumb.mjs +102 -0
  18. package/dist/button.d.ts +15 -0
  19. package/dist/button.mjs +49 -0
  20. package/dist/calendar.d.ts +23 -0
  21. package/dist/calendar.mjs +173 -0
  22. package/dist/card.d.ts +18 -0
  23. package/dist/card.mjs +90 -0
  24. package/dist/carousel.d.ts +42 -0
  25. package/dist/carousel.mjs +177 -0
  26. package/dist/checkbox.d.ts +7 -0
  27. package/dist/checkbox.mjs +31 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.mjs +34 -0
  30. package/dist/command.d.ts +31 -0
  31. package/dist/command.mjs +170 -0
  32. package/dist/context-menu.d.ts +42 -0
  33. package/dist/context-menu.mjs +223 -0
  34. package/dist/dialog.d.ts +27 -0
  35. package/dist/dialog.mjs +136 -0
  36. package/dist/dropdown-menu.d.ts +42 -0
  37. package/dist/dropdown-menu.mjs +231 -0
  38. package/dist/form.d.ts +38 -0
  39. package/dist/form.mjs +101 -0
  40. package/dist/hover-card.d.ts +11 -0
  41. package/dist/hover-card.mjs +38 -0
  42. package/dist/input.d.ts +6 -0
  43. package/dist/input.mjs +21 -0
  44. package/dist/label.d.ts +7 -0
  45. package/dist/label.mjs +23 -0
  46. package/dist/menubar.d.ts +44 -0
  47. package/dist/menubar.mjs +251 -0
  48. package/dist/navigation-menu.d.ts +26 -0
  49. package/dist/navigation-menu.mjs +170 -0
  50. package/dist/pagination.d.ts +33 -0
  51. package/dist/pagination.mjs +116 -0
  52. package/dist/popover.d.ts +13 -0
  53. package/dist/popover.mjs +44 -0
  54. package/dist/progress.d.ts +7 -0
  55. package/dist/progress.mjs +31 -0
  56. package/dist/radio-group.d.ts +9 -0
  57. package/dist/radio-group.mjs +45 -0
  58. package/dist/resizable.d.ts +13 -0
  59. package/dist/resizable.mjs +48 -0
  60. package/dist/scroll-area.d.ts +9 -0
  61. package/dist/scroll-area.mjs +60 -0
  62. package/dist/select.d.ts +27 -0
  63. package/dist/select.mjs +169 -0
  64. package/dist/separator.d.ts +7 -0
  65. package/dist/separator.mjs +26 -0
  66. package/dist/sheet.d.ts +23 -0
  67. package/dist/sheet.mjs +126 -0
  68. package/dist/skeleton.d.ts +5 -0
  69. package/dist/skeleton.mjs +15 -0
  70. package/dist/slider.d.ts +7 -0
  71. package/dist/slider.mjs +63 -0
  72. package/dist/sonner.d.ts +6 -0
  73. package/dist/sonner.mjs +22 -0
  74. package/dist/switch.d.ts +7 -0
  75. package/dist/switch.mjs +31 -0
  76. package/dist/table.d.ts +20 -0
  77. package/dist/table.mjs +114 -0
  78. package/dist/tabs.d.ts +13 -0
  79. package/dist/tabs.mjs +67 -0
  80. package/dist/textarea.d.ts +6 -0
  81. package/dist/textarea.mjs +18 -0
  82. package/dist/toggle-group.d.ts +16 -0
  83. package/dist/toggle-group.mjs +62 -0
  84. package/dist/toggle.d.ts +14 -0
  85. package/dist/toggle.mjs +43 -0
  86. package/dist/tooltip.d.ts +13 -0
  87. package/dist/tooltip.mjs +55 -0
  88. package/dist/utils-B7J70Nno.js +8 -0
  89. package/eslint.config.mjs +12 -0
  90. package/package.json +273 -0
  91. package/postcss.config.js +6 -0
  92. package/src/components/ui/accordion.tsx +64 -0
  93. package/src/components/ui/alert-dialog.tsx +155 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/aspect-ratio.tsx +9 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +46 -0
  98. package/src/components/ui/breadcrumb.tsx +109 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +211 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/carousel.tsx +239 -0
  103. package/src/components/ui/checkbox.tsx +30 -0
  104. package/src/components/ui/collapsible.tsx +31 -0
  105. package/src/components/ui/command.tsx +182 -0
  106. package/src/components/ui/context-menu.tsx +250 -0
  107. package/src/components/ui/dialog.tsx +141 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/hover-card.tsx +42 -0
  111. package/src/components/ui/input.tsx +21 -0
  112. package/src/components/ui/label.tsx +24 -0
  113. package/src/components/ui/menubar.tsx +274 -0
  114. package/src/components/ui/navigation-menu.tsx +168 -0
  115. package/src/components/ui/pagination.tsx +125 -0
  116. package/src/components/ui/popover.tsx +46 -0
  117. package/src/components/ui/progress.tsx +29 -0
  118. package/src/components/ui/radio-group.tsx +43 -0
  119. package/src/components/ui/resizable.tsx +54 -0
  120. package/src/components/ui/scroll-area.tsx +56 -0
  121. package/src/components/ui/select.tsx +183 -0
  122. package/src/components/ui/separator.tsx +26 -0
  123. package/src/components/ui/sheet.tsx +137 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/slider.tsx +61 -0
  126. package/src/components/ui/sonner.tsx +23 -0
  127. package/src/components/ui/switch.tsx +29 -0
  128. package/src/components/ui/table.tsx +114 -0
  129. package/src/components/ui/tabs.tsx +64 -0
  130. package/src/components/ui/textarea.tsx +18 -0
  131. package/src/components/ui/toggle-group.tsx +71 -0
  132. package/src/components/ui/toggle.tsx +45 -0
  133. package/src/components/ui/tooltip.tsx +59 -0
  134. package/src/index.ts +46 -0
  135. package/src/lib/utils.ts +6 -0
  136. package/src/style.css +0 -0
  137. package/tailwind.config.js +52 -0
  138. package/tsconfig.json +19 -0
  139. package/tsconfig.lib.json +54 -0
  140. package/tsconfig.spec.json +32 -0
  141. package/vite.config.ts +136 -0
@@ -0,0 +1,102 @@
1
+ import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
+ import { Slot as o } from "@radix-ui/react-slot";
3
+ import { ChevronRight as i, MoreHorizontal as l } from "lucide-react";
4
+ import { c as t } from "./utils-B7J70Nno.js";
5
+ function p({ ...r }) {
6
+ return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
7
+ }
8
+ function f({ className: r, ...e }) {
9
+ return /* @__PURE__ */ a(
10
+ "ol",
11
+ {
12
+ "data-slot": "breadcrumb-list",
13
+ className: t(
14
+ "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
15
+ r
16
+ ),
17
+ ...e
18
+ }
19
+ );
20
+ }
21
+ function g({ className: r, ...e }) {
22
+ return /* @__PURE__ */ a(
23
+ "li",
24
+ {
25
+ "data-slot": "breadcrumb-item",
26
+ className: t("inline-flex items-center gap-1.5", r),
27
+ ...e
28
+ }
29
+ );
30
+ }
31
+ function x({
32
+ asChild: r,
33
+ className: e,
34
+ ...n
35
+ }) {
36
+ return /* @__PURE__ */ a(
37
+ r ? o : "a",
38
+ {
39
+ "data-slot": "breadcrumb-link",
40
+ className: t("hover:text-foreground transition-colors", e),
41
+ ...n
42
+ }
43
+ );
44
+ }
45
+ function h({ className: r, ...e }) {
46
+ return /* @__PURE__ */ a(
47
+ "span",
48
+ {
49
+ "data-slot": "breadcrumb-page",
50
+ role: "link",
51
+ "aria-disabled": "true",
52
+ "aria-current": "page",
53
+ className: t("text-foreground font-normal", r),
54
+ ...e
55
+ }
56
+ );
57
+ }
58
+ function N({
59
+ children: r,
60
+ className: e,
61
+ ...n
62
+ }) {
63
+ return /* @__PURE__ */ a(
64
+ "li",
65
+ {
66
+ "data-slot": "breadcrumb-separator",
67
+ role: "presentation",
68
+ "aria-hidden": "true",
69
+ className: t("[&>svg]:size-3.5", e),
70
+ ...n,
71
+ children: r ?? /* @__PURE__ */ a(i, {})
72
+ }
73
+ );
74
+ }
75
+ function B({
76
+ className: r,
77
+ ...e
78
+ }) {
79
+ return /* @__PURE__ */ s(
80
+ "span",
81
+ {
82
+ "data-slot": "breadcrumb-ellipsis",
83
+ role: "presentation",
84
+ "aria-hidden": "true",
85
+ className: t("flex size-9 items-center justify-center", r),
86
+ ...e,
87
+ children: [
88
+ /* @__PURE__ */ a(l, { className: "size-4" }),
89
+ /* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
90
+ ]
91
+ }
92
+ );
93
+ }
94
+ export {
95
+ p as Breadcrumb,
96
+ B as BreadcrumbEllipsis,
97
+ g as BreadcrumbItem,
98
+ x as BreadcrumbLink,
99
+ f as BreadcrumbList,
100
+ h as BreadcrumbPage,
101
+ N as BreadcrumbSeparator
102
+ };
@@ -0,0 +1,15 @@
1
+ import { ClassProp } from 'class-variance-authority/types';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import * as React_2 from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
7
+ asChild?: boolean;
8
+ }): JSX.Element;
9
+
10
+ export declare const buttonVariants: (props?: ({
11
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
12
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
13
+ } & ClassProp) | undefined) => string;
14
+
15
+ export { }
@@ -0,0 +1,49 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Slot as s } from "@radix-ui/react-slot";
3
+ import { cva as a } from "class-variance-authority";
4
+ import { c as d } from "./utils-B7J70Nno.js";
5
+ const c = a(
6
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
11
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
12
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
13
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
14
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
15
+ link: "text-primary underline-offset-4 hover:underline"
16
+ },
17
+ size: {
18
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
19
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
20
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
21
+ icon: "size-9"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default"
27
+ }
28
+ }
29
+ );
30
+ function b({
31
+ className: e,
32
+ variant: r,
33
+ size: t,
34
+ asChild: i = !1,
35
+ ...n
36
+ }) {
37
+ return /* @__PURE__ */ o(
38
+ i ? s : "button",
39
+ {
40
+ "data-slot": "button",
41
+ className: d(c({ variant: r, size: t, className: e })),
42
+ ...n
43
+ }
44
+ );
45
+ }
46
+ export {
47
+ b as Button,
48
+ c as buttonVariants
49
+ };
@@ -0,0 +1,23 @@
1
+ import { ClassProp } from 'class-variance-authority/types';
2
+ import { DayButton } from 'react-day-picker';
3
+ import { DayPicker } from 'react-day-picker';
4
+ import { JSX } from 'react/jsx-runtime';
5
+ import * as React_2 from 'react';
6
+ import { VariantProps } from 'class-variance-authority';
7
+
8
+ declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
9
+ asChild?: boolean;
10
+ }): JSX.Element;
11
+
12
+ declare const buttonVariants: (props?: ({
13
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
14
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
15
+ } & ClassProp) | undefined) => string;
16
+
17
+ export declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React_2.ComponentProps<typeof DayPicker> & {
18
+ buttonVariant?: React_2.ComponentProps<typeof Button>["variant"];
19
+ }): JSX.Element;
20
+
21
+ export declare function CalendarDayButton({ className, day, modifiers, ...props }: React_2.ComponentProps<typeof DayButton>): JSX.Element;
22
+
23
+ export { }
@@ -0,0 +1,173 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { ChevronLeftIcon as b, ChevronRightIcon as w, ChevronDownIcon as _ } from "lucide-react";
4
+ import { getDefaultClassNames as p, DayPicker as h } from "react-day-picker";
5
+ import { c as e } from "./utils-B7J70Nno.js";
6
+ import { buttonVariants as f, Button as y } from "./button.mjs";
7
+ function j({
8
+ className: i,
9
+ classNames: g,
10
+ showOutsideDays: r = !0,
11
+ captionLayout: s = "label",
12
+ buttonVariant: l = "ghost",
13
+ formatters: u,
14
+ components: c,
15
+ ...x
16
+ }) {
17
+ const t = p();
18
+ return /* @__PURE__ */ n(
19
+ h,
20
+ {
21
+ showOutsideDays: r,
22
+ className: e(
23
+ "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
24
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
25
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
26
+ i
27
+ ),
28
+ captionLayout: s,
29
+ formatters: {
30
+ formatMonthDropdown: (a) => a.toLocaleString("default", { month: "short" }),
31
+ ...u
32
+ },
33
+ classNames: {
34
+ root: e("w-fit", t.root),
35
+ months: e(
36
+ "flex gap-4 flex-col md:flex-row relative",
37
+ t.months
38
+ ),
39
+ month: e("flex flex-col w-full gap-4", t.month),
40
+ nav: e(
41
+ "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
42
+ t.nav
43
+ ),
44
+ button_previous: e(
45
+ f({ variant: l }),
46
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
47
+ t.button_previous
48
+ ),
49
+ button_next: e(
50
+ f({ variant: l }),
51
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
52
+ t.button_next
53
+ ),
54
+ month_caption: e(
55
+ "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
56
+ t.month_caption
57
+ ),
58
+ dropdowns: e(
59
+ "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
60
+ t.dropdowns
61
+ ),
62
+ dropdown_root: e(
63
+ "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
64
+ t.dropdown_root
65
+ ),
66
+ dropdown: e(
67
+ "absolute bg-popover inset-0 opacity-0",
68
+ t.dropdown
69
+ ),
70
+ caption_label: e(
71
+ "select-none font-medium",
72
+ s === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
73
+ t.caption_label
74
+ ),
75
+ table: "w-full border-collapse",
76
+ weekdays: e("flex", t.weekdays),
77
+ weekday: e(
78
+ "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
79
+ t.weekday
80
+ ),
81
+ week: e("flex w-full mt-2", t.week),
82
+ week_number_header: e(
83
+ "select-none w-(--cell-size)",
84
+ t.week_number_header
85
+ ),
86
+ week_number: e(
87
+ "text-[0.8rem] select-none text-muted-foreground",
88
+ t.week_number
89
+ ),
90
+ day: e(
91
+ "relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
92
+ t.day
93
+ ),
94
+ range_start: e(
95
+ "rounded-l-md bg-accent",
96
+ t.range_start
97
+ ),
98
+ range_middle: e("rounded-none", t.range_middle),
99
+ range_end: e("rounded-r-md bg-accent", t.range_end),
100
+ today: e(
101
+ "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
102
+ t.today
103
+ ),
104
+ outside: e(
105
+ "text-muted-foreground aria-selected:text-muted-foreground",
106
+ t.outside
107
+ ),
108
+ disabled: e(
109
+ "text-muted-foreground opacity-50",
110
+ t.disabled
111
+ ),
112
+ hidden: e("invisible", t.hidden),
113
+ ...g
114
+ },
115
+ components: {
116
+ Root: ({ className: a, rootRef: d, ...o }) => /* @__PURE__ */ n(
117
+ "div",
118
+ {
119
+ "data-slot": "calendar",
120
+ ref: d,
121
+ className: e(a),
122
+ ...o
123
+ }
124
+ ),
125
+ Chevron: ({ className: a, orientation: d, ...o }) => d === "left" ? /* @__PURE__ */ n(b, { className: e("size-4", a), ...o }) : d === "right" ? /* @__PURE__ */ n(
126
+ w,
127
+ {
128
+ className: e("size-4", a),
129
+ ...o
130
+ }
131
+ ) : /* @__PURE__ */ n(_, { className: e("size-4", a), ...o }),
132
+ DayButton: v,
133
+ WeekNumber: ({ children: a, ...d }) => /* @__PURE__ */ n("td", { ...d, children: /* @__PURE__ */ n("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: a }) }),
134
+ ...c
135
+ },
136
+ ...x
137
+ }
138
+ );
139
+ }
140
+ function v({
141
+ className: i,
142
+ day: g,
143
+ modifiers: r,
144
+ ...s
145
+ }) {
146
+ const l = p(), u = m.useRef(null);
147
+ return m.useEffect(() => {
148
+ var c;
149
+ r.focused && ((c = u.current) == null || c.focus());
150
+ }, [r.focused]), /* @__PURE__ */ n(
151
+ y,
152
+ {
153
+ ref: u,
154
+ variant: "ghost",
155
+ size: "icon",
156
+ "data-day": g.date.toLocaleDateString(),
157
+ "data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
158
+ "data-range-start": r.range_start,
159
+ "data-range-end": r.range_end,
160
+ "data-range-middle": r.range_middle,
161
+ className: e(
162
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
163
+ l.day,
164
+ i
165
+ ),
166
+ ...s
167
+ }
168
+ );
169
+ }
170
+ export {
171
+ j as Calendar,
172
+ v as CalendarDayButton
173
+ };
package/dist/card.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import * as React_2 from 'react';
3
+
4
+ export declare function Card({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
5
+
6
+ export declare function CardAction({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
7
+
8
+ export declare function CardContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
9
+
10
+ export declare function CardDescription({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
11
+
12
+ export declare function CardFooter({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
13
+
14
+ export declare function CardHeader({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
15
+
16
+ export declare function CardTitle({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
17
+
18
+ export { }
package/dist/card.mjs ADDED
@@ -0,0 +1,90 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { c as o } from "./utils-B7J70Nno.js";
3
+ function n({ className: t, ...a }) {
4
+ return /* @__PURE__ */ r(
5
+ "div",
6
+ {
7
+ "data-slot": "card",
8
+ className: o(
9
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
10
+ t
11
+ ),
12
+ ...a
13
+ }
14
+ );
15
+ }
16
+ function s({ className: t, ...a }) {
17
+ return /* @__PURE__ */ r(
18
+ "div",
19
+ {
20
+ "data-slot": "card-header",
21
+ className: o(
22
+ "@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",
23
+ t
24
+ ),
25
+ ...a
26
+ }
27
+ );
28
+ }
29
+ function c({ className: t, ...a }) {
30
+ return /* @__PURE__ */ r(
31
+ "div",
32
+ {
33
+ "data-slot": "card-title",
34
+ className: o("leading-none font-semibold", t),
35
+ ...a
36
+ }
37
+ );
38
+ }
39
+ function i({ className: t, ...a }) {
40
+ return /* @__PURE__ */ r(
41
+ "div",
42
+ {
43
+ "data-slot": "card-description",
44
+ className: o("text-muted-foreground text-sm", t),
45
+ ...a
46
+ }
47
+ );
48
+ }
49
+ function l({ className: t, ...a }) {
50
+ return /* @__PURE__ */ r(
51
+ "div",
52
+ {
53
+ "data-slot": "card-action",
54
+ className: o(
55
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
+ t
57
+ ),
58
+ ...a
59
+ }
60
+ );
61
+ }
62
+ function u({ className: t, ...a }) {
63
+ return /* @__PURE__ */ r(
64
+ "div",
65
+ {
66
+ "data-slot": "card-content",
67
+ className: o("px-6", t),
68
+ ...a
69
+ }
70
+ );
71
+ }
72
+ function f({ className: t, ...a }) {
73
+ return /* @__PURE__ */ r(
74
+ "div",
75
+ {
76
+ "data-slot": "card-footer",
77
+ className: o("flex items-center px-6 [.border-t]:pt-6", t),
78
+ ...a
79
+ }
80
+ );
81
+ }
82
+ export {
83
+ n as Card,
84
+ l as CardAction,
85
+ u as CardContent,
86
+ i as CardDescription,
87
+ f as CardFooter,
88
+ s as CardHeader,
89
+ c as CardTitle
90
+ };
@@ -0,0 +1,42 @@
1
+ import { ClassProp } from 'class-variance-authority/types';
2
+ import { default as default_2 } from 'embla-carousel-react';
3
+ import { JSX } from 'react/jsx-runtime';
4
+ import * as React_2 from 'react';
5
+ import { UseEmblaCarouselType } from 'embla-carousel-react';
6
+ import { VariantProps } from 'class-variance-authority';
7
+
8
+ declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
9
+ asChild?: boolean;
10
+ }): JSX.Element;
11
+
12
+ declare const buttonVariants: (props?: ({
13
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
14
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
15
+ } & ClassProp) | undefined) => string;
16
+
17
+ export declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React_2.ComponentProps<"div"> & CarouselProps): JSX.Element;
18
+
19
+ export declare type CarouselApi = UseEmblaCarouselType[1];
20
+
21
+ export declare function CarouselContent({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
22
+
23
+ export declare function CarouselItem({ className, ...props }: React_2.ComponentProps<"div">): JSX.Element;
24
+
25
+ export declare function CarouselNext({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
26
+
27
+ declare type CarouselOptions = UseCarouselParameters[0];
28
+
29
+ declare type CarouselPlugin = UseCarouselParameters[1];
30
+
31
+ export declare function CarouselPrevious({ className, variant, size, ...props }: React_2.ComponentProps<typeof Button>): JSX.Element;
32
+
33
+ declare type CarouselProps = {
34
+ opts?: CarouselOptions;
35
+ plugins?: CarouselPlugin;
36
+ orientation?: "horizontal" | "vertical";
37
+ setApi?: (api: CarouselApi) => void;
38
+ };
39
+
40
+ declare type UseCarouselParameters = Parameters<typeof default_2>;
41
+
42
+ export { }
@@ -0,0 +1,177 @@
1
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import z from "embla-carousel-react";
4
+ import { ArrowLeft as g, ArrowRight as p } from "lucide-react";
5
+ import { c as d } from "./utils-B7J70Nno.js";
6
+ import { Button as v } from "./button.mjs";
7
+ const N = l.createContext(null);
8
+ function m() {
9
+ const o = l.useContext(N);
10
+ if (!o)
11
+ throw new Error("useCarousel must be used within a <Carousel />");
12
+ return o;
13
+ }
14
+ function I({
15
+ orientation: o = "horizontal",
16
+ opts: r,
17
+ setApi: t,
18
+ plugins: s,
19
+ className: c,
20
+ children: i,
21
+ ...u
22
+ }) {
23
+ const [b, e] = z(
24
+ {
25
+ ...r,
26
+ axis: o === "horizontal" ? "x" : "y"
27
+ },
28
+ s
29
+ ), [w, S] = l.useState(!1), [y, P] = l.useState(!1), f = l.useCallback((a) => {
30
+ a && (S(a.canScrollPrev()), P(a.canScrollNext()));
31
+ }, []), x = l.useCallback(() => {
32
+ e == null || e.scrollPrev();
33
+ }, [e]), C = l.useCallback(() => {
34
+ e == null || e.scrollNext();
35
+ }, [e]), k = l.useCallback(
36
+ (a) => {
37
+ a.key === "ArrowLeft" ? (a.preventDefault(), x()) : a.key === "ArrowRight" && (a.preventDefault(), C());
38
+ },
39
+ [x, C]
40
+ );
41
+ return l.useEffect(() => {
42
+ !e || !t || t(e);
43
+ }, [e, t]), l.useEffect(() => {
44
+ if (e)
45
+ return f(e), e.on("reInit", f), e.on("select", f), () => {
46
+ e == null || e.off("select", f);
47
+ };
48
+ }, [e, f]), /* @__PURE__ */ n(
49
+ N.Provider,
50
+ {
51
+ value: {
52
+ carouselRef: b,
53
+ api: e,
54
+ opts: r,
55
+ orientation: o || ((r == null ? void 0 : r.axis) === "y" ? "vertical" : "horizontal"),
56
+ scrollPrev: x,
57
+ scrollNext: C,
58
+ canScrollPrev: w,
59
+ canScrollNext: y
60
+ },
61
+ children: /* @__PURE__ */ n(
62
+ "div",
63
+ {
64
+ onKeyDownCapture: k,
65
+ className: d("relative", c),
66
+ role: "region",
67
+ "aria-roledescription": "carousel",
68
+ "data-slot": "carousel",
69
+ ...u,
70
+ children: i
71
+ }
72
+ )
73
+ }
74
+ );
75
+ }
76
+ function K({ className: o, ...r }) {
77
+ const { carouselRef: t, orientation: s } = m();
78
+ return /* @__PURE__ */ n(
79
+ "div",
80
+ {
81
+ ref: t,
82
+ className: "overflow-hidden",
83
+ "data-slot": "carousel-content",
84
+ children: /* @__PURE__ */ n(
85
+ "div",
86
+ {
87
+ className: d(
88
+ "flex",
89
+ s === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
90
+ o
91
+ ),
92
+ ...r
93
+ }
94
+ )
95
+ }
96
+ );
97
+ }
98
+ function L({ className: o, ...r }) {
99
+ const { orientation: t } = m();
100
+ return /* @__PURE__ */ n(
101
+ "div",
102
+ {
103
+ role: "group",
104
+ "aria-roledescription": "slide",
105
+ "data-slot": "carousel-item",
106
+ className: d(
107
+ "min-w-0 shrink-0 grow-0 basis-full",
108
+ t === "horizontal" ? "pl-4" : "pt-4",
109
+ o
110
+ ),
111
+ ...r
112
+ }
113
+ );
114
+ }
115
+ function B({
116
+ className: o,
117
+ variant: r = "outline",
118
+ size: t = "icon",
119
+ ...s
120
+ }) {
121
+ const { orientation: c, scrollPrev: i, canScrollPrev: u } = m();
122
+ return /* @__PURE__ */ h(
123
+ v,
124
+ {
125
+ "data-slot": "carousel-previous",
126
+ variant: r,
127
+ size: t,
128
+ className: d(
129
+ "absolute size-8 rounded-full",
130
+ c === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
131
+ o
132
+ ),
133
+ disabled: !u,
134
+ onClick: i,
135
+ ...s,
136
+ children: [
137
+ /* @__PURE__ */ n(g, {}),
138
+ /* @__PURE__ */ n("span", { className: "sr-only", children: "Previous slide" })
139
+ ]
140
+ }
141
+ );
142
+ }
143
+ function q({
144
+ className: o,
145
+ variant: r = "outline",
146
+ size: t = "icon",
147
+ ...s
148
+ }) {
149
+ const { orientation: c, scrollNext: i, canScrollNext: u } = m();
150
+ return /* @__PURE__ */ h(
151
+ v,
152
+ {
153
+ "data-slot": "carousel-next",
154
+ variant: r,
155
+ size: t,
156
+ className: d(
157
+ "absolute size-8 rounded-full",
158
+ c === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
159
+ o
160
+ ),
161
+ disabled: !u,
162
+ onClick: i,
163
+ ...s,
164
+ children: [
165
+ /* @__PURE__ */ n(p, {}),
166
+ /* @__PURE__ */ n("span", { className: "sr-only", children: "Next slide" })
167
+ ]
168
+ }
169
+ );
170
+ }
171
+ export {
172
+ I as Carousel,
173
+ K as CarouselContent,
174
+ L as CarouselItem,
175
+ q as CarouselNext,
176
+ B as CarouselPrevious
177
+ };