@arch-cadre/ui 0.0.11 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.config.ts +23 -0
- package/dist/components/.gitkeep +0 -0
- package/dist/components/accordion.cjs +62 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.mjs +58 -0
- package/dist/components/alert-dialog.cjs +127 -0
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.mjs +144 -0
- package/dist/components/alert.cjs +58 -0
- package/dist/components/alert.d.ts +9 -0
- package/dist/components/alert.mjs +62 -0
- package/dist/components/aspect-ratio.cjs +19 -0
- package/dist/components/aspect-ratio.d.ts +4 -0
- package/dist/components/aspect-ratio.mjs +9 -0
- package/dist/components/avatar.cjs +44 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.mjs +50 -0
- package/dist/components/badge.cjs +41 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.mjs +37 -0
- package/dist/components/breadcrumb.cjs +106 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.mjs +105 -0
- package/dist/components/button-group.cjs +65 -0
- package/dist/components/button-group.d.ts +12 -0
- package/dist/components/button-group.mjs +76 -0
- package/dist/components/button.cjs +57 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.mjs +51 -0
- package/dist/components/calendar.cjs +143 -0
- package/dist/components/calendar.d.ts +8 -0
- package/dist/components/calendar.mjs +191 -0
- package/dist/components/card.cjs +86 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.mjs +90 -0
- package/dist/components/checkbox.cjs +28 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.mjs +30 -0
- package/dist/components/collapsible.cjs +37 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.mjs +31 -0
- package/dist/components/command.cjs +125 -0
- package/dist/components/command.d.ts +18 -0
- package/dist/components/command.mjs +169 -0
- package/dist/components/context-menu.cjs +188 -0
- package/dist/components/context-menu.d.ts +25 -0
- package/dist/components/context-menu.mjs +218 -0
- package/dist/components/dialog.cjs +123 -0
- package/dist/components/dialog.d.ts +15 -0
- package/dist/components/dialog.mjs +130 -0
- package/dist/components/drawer.cjs +118 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.mjs +124 -0
- package/dist/components/dropdown-menu.cjs +190 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.mjs +226 -0
- package/dist/components/empty.cjs +92 -0
- package/dist/components/empty.d.ts +12 -0
- package/dist/components/empty.mjs +102 -0
- package/dist/components/field.cjs +173 -0
- package/dist/components/field.d.ts +25 -0
- package/dist/components/field.mjs +228 -0
- package/dist/components/form.cjs +143 -0
- package/dist/components/form.d.ts +23 -0
- package/dist/components/form.mjs +123 -0
- package/dist/components/hover-card.cjs +46 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.mjs +35 -0
- package/dist/components/input-group.cjs +130 -0
- package/dist/components/input-group.d.ts +16 -0
- package/dist/components/input-group.mjs +155 -0
- package/dist/components/input-otp.cjs +69 -0
- package/dist/components/input-otp.d.ts +11 -0
- package/dist/components/input-otp.mjs +59 -0
- package/dist/components/input.cjs +22 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.mjs +19 -0
- package/dist/components/item.cjs +168 -0
- package/dist/components/item.d.ts +23 -0
- package/dist/components/item.mjs +187 -0
- package/dist/components/kbd.cjs +31 -0
- package/dist/components/kbd.d.ts +4 -0
- package/dist/components/kbd.mjs +28 -0
- package/dist/components/label.cjs +22 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.mjs +21 -0
- package/dist/components/language-switcher.cjs +43 -0
- package/dist/components/language-switcher.d.ts +2 -0
- package/dist/components/language-switcher.mjs +30 -0
- package/dist/components/menubar.cjs +207 -0
- package/dist/components/menubar.d.ts +26 -0
- package/dist/components/menubar.mjs +246 -0
- package/dist/components/navigation-menu.cjs +113 -0
- package/dist/components/navigation-menu.d.ts +14 -0
- package/dist/components/navigation-menu.mjs +166 -0
- package/dist/components/pagination.cjs +106 -0
- package/dist/components/pagination.d.ts +15 -0
- package/dist/components/pagination.mjs +116 -0
- package/dist/components/popover.cjs +53 -0
- package/dist/components/popover.d.ts +7 -0
- package/dist/components/popover.mjs +40 -0
- package/dist/components/progress.cjs +29 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.mjs +30 -0
- package/dist/components/radio-group.cjs +39 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.mjs +43 -0
- package/dist/components/scroll-area.cjs +45 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.mjs +59 -0
- package/dist/components/select.cjs +140 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.mjs +173 -0
- package/dist/components/separator.cjs +26 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.mjs +25 -0
- package/dist/components/sheet.cjs +120 -0
- package/dist/components/sheet.d.ts +13 -0
- package/dist/components/sheet.mjs +119 -0
- package/dist/components/sidebar.cjs +508 -0
- package/dist/components/sidebar.d.ts +69 -0
- package/dist/components/sidebar.mjs +635 -0
- package/dist/components/skeleton.cjs +20 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.mjs +13 -0
- package/dist/components/slider.cjs +43 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.mjs +59 -0
- package/dist/components/sonner.cjs +49 -0
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.mjs +36 -0
- package/dist/components/spinner.cjs +22 -0
- package/dist/components/spinner.d.ts +3 -0
- package/dist/components/spinner.mjs +15 -0
- package/dist/components/switch.cjs +25 -0
- package/dist/components/switch.d.ts +4 -0
- package/dist/components/switch.mjs +30 -0
- package/dist/components/table.cjs +101 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.mjs +115 -0
- package/dist/components/tabs.cjs +55 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.mjs +63 -0
- package/dist/components/textarea.cjs +20 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.mjs +16 -0
- package/dist/components/toggle-group.cjs +65 -0
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle-group.mjs +65 -0
- package/dist/components/toggle.cjs +47 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.mjs +41 -0
- package/dist/components/tooltip.cjs +56 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.mjs +49 -0
- package/dist/hooks/.gitkeep +0 -0
- package/dist/hooks/use-mobile.cjs +23 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.mjs +17 -0
- package/dist/hooks/use-user.cjs +21 -0
- package/dist/hooks/use-user.d.ts +12 -0
- package/dist/hooks/use-user.mjs +12 -0
- package/dist/index.cjs +155 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.mjs +13 -0
- package/dist/lib/utils.cjs +11 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.mjs +5 -0
- package/dist/logo.cjs +49 -0
- package/dist/logo.d.ts +15 -0
- package/dist/logo.mjs +32 -0
- package/dist/postcss.config.cjs +13 -0
- package/dist/postcss.config.d.mts +3 -0
- package/dist/postcss.config.mjs +6 -0
- package/dist/providers/auth-provider.cjs +44 -0
- package/dist/providers/auth-provider.d.ts +15 -0
- package/dist/providers/auth-provider.mjs +37 -0
- package/dist/providers/index.cjs +47 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.mjs +33 -0
- package/dist/shared/access-denied.cjs +38 -0
- package/dist/shared/access-denied.d.ts +2 -0
- package/dist/shared/access-denied.mjs +12 -0
- package/dist/shared/loader.cjs +95 -0
- package/dist/shared/loader.d.ts +11 -0
- package/dist/shared/loader.mjs +98 -0
- package/dist/shared/page-loader.cjs +23 -0
- package/dist/shared/page-loader.d.ts +7 -0
- package/dist/shared/page-loader.mjs +6 -0
- package/dist/shared/scroll-fade-effect.cjs +21 -0
- package/dist/shared/scroll-fade-effect.d.ts +4 -0
- package/dist/shared/scroll-fade-effect.mjs +20 -0
- package/dist/styles/globals.css +1 -0
- package/package.json +58 -49
- package/scripts/switchToDist.js +55 -0
- package/scripts/switchToSrc.js +52 -0
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +1 -1
- package/src/components/alert.tsx +1 -1
- package/src/components/aspect-ratio.tsx +2 -1
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +3 -3
- package/src/components/breadcrumb.tsx +5 -3
- package/src/components/button-group.tsx +4 -2
- package/src/components/button.tsx +3 -3
- package/src/components/calendar.tsx +2 -2
- package/src/components/checkbox.tsx +2 -2
- package/src/components/collapsible.tsx +2 -1
- package/src/components/command.tsx +1 -1
- package/src/components/context-menu.tsx +2 -2
- package/src/components/dialog.tsx +2 -2
- package/src/components/dropdown-menu.tsx +2 -2
- package/src/components/empty.tsx +1 -0
- package/src/components/field.tsx +5 -2
- package/src/components/form.tsx +9 -7
- package/src/components/hover-card.tsx +1 -1
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +1 -1
- package/src/components/item.tsx +3 -3
- package/src/components/kbd.tsx +1 -0
- package/src/components/label.tsx +1 -1
- package/src/components/language-switcher.tsx +16 -17
- package/src/components/menubar.tsx +2 -2
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +5 -2
- package/src/components/popover.tsx +1 -1
- package/src/components/progress.tsx +1 -1
- package/src/components/radio-group.tsx +2 -2
- package/src/components/scroll-area.tsx +1 -1
- package/src/components/select.tsx +2 -2
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +2 -2
- package/src/components/sidebar.tsx +6 -6
- package/src/components/skeleton.tsx +1 -0
- package/src/components/slider.tsx +1 -1
- package/src/components/sonner.tsx +1 -0
- package/src/components/spinner.tsx +1 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/tabs.tsx +1 -1
- package/src/components/toggle-group.tsx +2 -2
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +1 -1
- package/src/hooks/use-user.ts +2 -2
- package/src/index.ts +8 -5
- package/src/logo.tsx +1 -0
- package/src/providers/auth-provider.tsx +7 -6
- package/src/providers/index.tsx +1 -0
- package/src/shared/access-denied.tsx +1 -0
- package/src/shared/loader.tsx +2 -1
- package/src/shared/page-loader.tsx +1 -0
- package/src/shared/scroll-fade-effect.tsx +1 -1
- package/src/styles/globals.css +258 -244
- package/biome.json +0 -38
- package/src/components/carousel.tsx +0 -241
- package/src/components/chart.tsx +0 -357
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.mjs";
|
|
5
|
+
function Avatar({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ React.createElement(
|
|
10
|
+
AvatarPrimitive.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "avatar",
|
|
13
|
+
className: cn(
|
|
14
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function AvatarImage({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
AvatarPrimitive.Image,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "avatar-image",
|
|
29
|
+
className: cn("aspect-square size-full", className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function AvatarFallback({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ React.createElement(
|
|
39
|
+
AvatarPrimitive.Fallback,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "avatar-fallback",
|
|
42
|
+
className: cn(
|
|
43
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Badge = Badge;
|
|
7
|
+
exports.badgeVariants = void 0;
|
|
8
|
+
var _radixUi = require("radix-ui");
|
|
9
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _utils = require("../lib/utils.cjs");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const badgeVariants = exports.badgeVariants = (0, _classVarianceAuthority.cva)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden", {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
18
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
19
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
20
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
function Badge({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
asChild = false,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
const Comp = asChild ? _radixUi.Slot.Slot : "span";
|
|
34
|
+
return /* @__PURE__ */React.createElement(Comp, {
|
|
35
|
+
"data-slot": "badge",
|
|
36
|
+
className: (0, _utils.cn)(badgeVariants({
|
|
37
|
+
variant
|
|
38
|
+
}), className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.mjs";
|
|
5
|
+
const badgeVariants = cva(
|
|
6
|
+
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-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 transition-[color,box-shadow] overflow-hidden",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
11
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
12
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
13
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
function Badge({
|
|
22
|
+
className,
|
|
23
|
+
variant,
|
|
24
|
+
asChild = false,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const Comp = asChild ? SlotPrimitive.Slot : "span";
|
|
28
|
+
return /* @__PURE__ */ React.createElement(
|
|
29
|
+
Comp,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "badge",
|
|
32
|
+
className: cn(badgeVariants({ variant }), className),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Breadcrumb = Breadcrumb;
|
|
7
|
+
exports.BreadcrumbEllipsis = BreadcrumbEllipsis;
|
|
8
|
+
exports.BreadcrumbItem = BreadcrumbItem;
|
|
9
|
+
exports.BreadcrumbLink = BreadcrumbLink;
|
|
10
|
+
exports.BreadcrumbList = BreadcrumbList;
|
|
11
|
+
exports.BreadcrumbPage = BreadcrumbPage;
|
|
12
|
+
exports.BreadcrumbSeparator = BreadcrumbSeparator;
|
|
13
|
+
var _radixUi = require("radix-ui");
|
|
14
|
+
var _lucideReact = require("lucide-react");
|
|
15
|
+
var React = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _utils = require("../lib/utils.cjs");
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
function Breadcrumb({
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */React.createElement("nav", {
|
|
23
|
+
"aria-label": "breadcrumb",
|
|
24
|
+
"data-slot": "breadcrumb",
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function BreadcrumbList({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */React.createElement("ol", {
|
|
33
|
+
"data-slot": "breadcrumb-list",
|
|
34
|
+
className: (0, _utils.cn)("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5", className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function BreadcrumbItem({
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */React.createElement("li", {
|
|
43
|
+
"data-slot": "breadcrumb-item",
|
|
44
|
+
className: (0, _utils.cn)("inline-flex items-center gap-1.5", className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function BreadcrumbLink({
|
|
49
|
+
asChild,
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}) {
|
|
53
|
+
const Comp = asChild ? _radixUi.Slot.Slot : "a";
|
|
54
|
+
return /* @__PURE__ */React.createElement(Comp, {
|
|
55
|
+
"data-slot": "breadcrumb-link",
|
|
56
|
+
className: (0, _utils.cn)("hover:text-foreground transition-colors", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function BreadcrumbPage({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return (
|
|
65
|
+
// biome-ignore lint/a11y/useSemanticElements: <explanation>
|
|
66
|
+
// biome-ignore lint/a11y/useFocusableInteractive: <explanation>
|
|
67
|
+
/* @__PURE__ */
|
|
68
|
+
React.createElement("span", {
|
|
69
|
+
"data-slot": "breadcrumb-page",
|
|
70
|
+
role: "link",
|
|
71
|
+
"aria-disabled": "true",
|
|
72
|
+
"aria-current": "page",
|
|
73
|
+
className: (0, _utils.cn)("text-foreground font-normal", className),
|
|
74
|
+
...props
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
function BreadcrumbSeparator({
|
|
79
|
+
children,
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}) {
|
|
83
|
+
return /* @__PURE__ */React.createElement("li", {
|
|
84
|
+
"data-slot": "breadcrumb-separator",
|
|
85
|
+
role: "presentation",
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: (0, _utils.cn)("[&>svg]:size-3.5", className),
|
|
88
|
+
...props
|
|
89
|
+
}, children ?? /* @__PURE__ */React.createElement(_lucideReact.ChevronRight, null));
|
|
90
|
+
}
|
|
91
|
+
function BreadcrumbEllipsis({
|
|
92
|
+
className,
|
|
93
|
+
...props
|
|
94
|
+
}) {
|
|
95
|
+
return /* @__PURE__ */React.createElement("span", {
|
|
96
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
97
|
+
role: "presentation",
|
|
98
|
+
"aria-hidden": "true",
|
|
99
|
+
className: (0, _utils.cn)("flex size-9 items-center justify-center", className),
|
|
100
|
+
...props
|
|
101
|
+
}, /* @__PURE__ */React.createElement(_lucideReact.MoreHorizontal, {
|
|
102
|
+
className: "size-4"
|
|
103
|
+
}), /* @__PURE__ */React.createElement("span", {
|
|
104
|
+
className: "sr-only"
|
|
105
|
+
}, "More"));
|
|
106
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
2
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.mjs";
|
|
5
|
+
function Breadcrumb({ ...props }) {
|
|
6
|
+
return /* @__PURE__ */ React.createElement("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
7
|
+
}
|
|
8
|
+
function BreadcrumbList({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ React.createElement(
|
|
10
|
+
"ol",
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "breadcrumb-list",
|
|
13
|
+
className: cn(
|
|
14
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
15
|
+
className
|
|
16
|
+
),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ React.createElement(
|
|
23
|
+
"li",
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "breadcrumb-item",
|
|
26
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function BreadcrumbLink({
|
|
32
|
+
asChild,
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
const Comp = asChild ? SlotPrimitive.Slot : "a";
|
|
37
|
+
return /* @__PURE__ */ React.createElement(
|
|
38
|
+
Comp,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "breadcrumb-link",
|
|
41
|
+
className: cn("hover:text-foreground transition-colors", className),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
47
|
+
return (
|
|
48
|
+
// biome-ignore lint/a11y/useSemanticElements: <explanation>
|
|
49
|
+
// biome-ignore lint/a11y/useFocusableInteractive: <explanation>
|
|
50
|
+
/* @__PURE__ */ React.createElement(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "breadcrumb-page",
|
|
54
|
+
role: "link",
|
|
55
|
+
"aria-disabled": "true",
|
|
56
|
+
"aria-current": "page",
|
|
57
|
+
className: cn("text-foreground font-normal", className),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
function BreadcrumbSeparator({
|
|
64
|
+
children,
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
return /* @__PURE__ */ React.createElement(
|
|
69
|
+
"li",
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "breadcrumb-separator",
|
|
72
|
+
role: "presentation",
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: cn("[&>svg]:size-3.5", className),
|
|
75
|
+
...props
|
|
76
|
+
},
|
|
77
|
+
children ?? /* @__PURE__ */ React.createElement(ChevronRight, null)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function BreadcrumbEllipsis({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ React.createElement(
|
|
85
|
+
"span",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
88
|
+
role: "presentation",
|
|
89
|
+
"aria-hidden": "true",
|
|
90
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
91
|
+
...props
|
|
92
|
+
},
|
|
93
|
+
/* @__PURE__ */ React.createElement(MoreHorizontal, { className: "size-4" }),
|
|
94
|
+
/* @__PURE__ */ React.createElement("span", { className: "sr-only" }, "More")
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
Breadcrumb,
|
|
99
|
+
BreadcrumbList,
|
|
100
|
+
BreadcrumbItem,
|
|
101
|
+
BreadcrumbLink,
|
|
102
|
+
BreadcrumbPage,
|
|
103
|
+
BreadcrumbSeparator,
|
|
104
|
+
BreadcrumbEllipsis
|
|
105
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ButtonGroup = ButtonGroup;
|
|
7
|
+
exports.ButtonGroupSeparator = ButtonGroupSeparator;
|
|
8
|
+
exports.ButtonGroupText = ButtonGroupText;
|
|
9
|
+
exports.buttonGroupVariants = void 0;
|
|
10
|
+
var _radixUi = require("radix-ui");
|
|
11
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _utils = require("../lib/utils.cjs");
|
|
14
|
+
var _separator = require("./separator.cjs");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
const buttonGroupVariants = exports.buttonGroupVariants = (0, _classVarianceAuthority.cva)("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2", {
|
|
18
|
+
variants: {
|
|
19
|
+
orientation: {
|
|
20
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
21
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
orientation: "horizontal"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function ButtonGroup({
|
|
29
|
+
className,
|
|
30
|
+
orientation,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */React.createElement("div", {
|
|
34
|
+
role: "group",
|
|
35
|
+
"data-slot": "button-group",
|
|
36
|
+
"data-orientation": orientation,
|
|
37
|
+
className: (0, _utils.cn)(buttonGroupVariants({
|
|
38
|
+
orientation
|
|
39
|
+
}), className),
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function ButtonGroupText({
|
|
44
|
+
className,
|
|
45
|
+
asChild = false,
|
|
46
|
+
...props
|
|
47
|
+
}) {
|
|
48
|
+
const Comp = asChild ? _radixUi.Slot.Slot : "div";
|
|
49
|
+
return /* @__PURE__ */React.createElement(Comp, {
|
|
50
|
+
className: (0, _utils.cn)("bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function ButtonGroupSeparator({
|
|
55
|
+
className,
|
|
56
|
+
orientation = "vertical",
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */React.createElement(_separator.Separator, {
|
|
60
|
+
"data-slot": "button-group-separator",
|
|
61
|
+
orientation,
|
|
62
|
+
className: (0, _utils.cn)("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className),
|
|
63
|
+
...props
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
|
+
declare const buttonGroupVariants: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): React.JSX.Element;
|
|
8
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
12
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.mjs";
|
|
5
|
+
import { Separator } from "./separator.mjs";
|
|
6
|
+
const buttonGroupVariants = cva(
|
|
7
|
+
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
12
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
orientation: "horizontal"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
function ButtonGroup({
|
|
21
|
+
className,
|
|
22
|
+
orientation,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ React.createElement(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
role: "group",
|
|
29
|
+
"data-slot": "button-group",
|
|
30
|
+
"data-orientation": orientation,
|
|
31
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function ButtonGroupText({
|
|
37
|
+
className,
|
|
38
|
+
asChild = false,
|
|
39
|
+
...props
|
|
40
|
+
}) {
|
|
41
|
+
const Comp = asChild ? SlotPrimitive.Slot : "div";
|
|
42
|
+
return /* @__PURE__ */ React.createElement(
|
|
43
|
+
Comp,
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function ButtonGroupSeparator({
|
|
54
|
+
className,
|
|
55
|
+
orientation = "vertical",
|
|
56
|
+
...props
|
|
57
|
+
}) {
|
|
58
|
+
return /* @__PURE__ */ React.createElement(
|
|
59
|
+
Separator,
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "button-group-separator",
|
|
62
|
+
orientation,
|
|
63
|
+
className: cn(
|
|
64
|
+
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
ButtonGroup,
|
|
73
|
+
ButtonGroupSeparator,
|
|
74
|
+
ButtonGroupText,
|
|
75
|
+
buttonGroupVariants
|
|
76
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Button = Button;
|
|
7
|
+
exports.buttonVariants = void 0;
|
|
8
|
+
var _radixUi = require("radix-ui");
|
|
9
|
+
var _classVarianceAuthority = require("class-variance-authority");
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _utils = require("../lib/utils.cjs");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const buttonVariants = exports.buttonVariants = (0, _classVarianceAuthority.cva)("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", {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
18
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
19
|
+
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",
|
|
20
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
27
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
|
+
icon: "size-9",
|
|
29
|
+
"icon-sm": "size-8",
|
|
30
|
+
"icon-lg": "size-10"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
size: "default"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
function Button({
|
|
39
|
+
className,
|
|
40
|
+
variant = "default",
|
|
41
|
+
size = "default",
|
|
42
|
+
asChild = false,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const Comp = asChild ? _radixUi.Slot.Slot : "button";
|
|
46
|
+
return /* @__PURE__ */React.createElement(Comp, {
|
|
47
|
+
"data-slot": "button",
|
|
48
|
+
"data-variant": variant,
|
|
49
|
+
"data-size": size,
|
|
50
|
+
className: (0, _utils.cn)(buttonVariants({
|
|
51
|
+
variant,
|
|
52
|
+
size,
|
|
53
|
+
className
|
|
54
|
+
})),
|
|
55
|
+
...props
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../lib/utils.mjs";
|
|
5
|
+
const buttonVariants = cva(
|
|
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 hover:bg-primary/90",
|
|
11
|
+
destructive: "bg-destructive text-white 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 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
|
+
"icon-sm": "size-8",
|
|
23
|
+
"icon-lg": "size-10"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
function Button({
|
|
33
|
+
className,
|
|
34
|
+
variant = "default",
|
|
35
|
+
size = "default",
|
|
36
|
+
asChild = false,
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
const Comp = asChild ? SlotPrimitive.Slot : "button";
|
|
40
|
+
return /* @__PURE__ */ React.createElement(
|
|
41
|
+
Comp,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "button",
|
|
44
|
+
"data-variant": variant,
|
|
45
|
+
"data-size": size,
|
|
46
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export { Button, buttonVariants };
|