@web-my-money/primitives 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.
- package/dist/accordion/index.d.mts +9 -0
- package/dist/accordion/index.d.ts +9 -0
- package/dist/accordion/index.js +99 -0
- package/dist/accordion/index.mjs +14 -0
- package/dist/alert-dialog/index.d.mts +22 -0
- package/dist/alert-dialog/index.d.ts +22 -0
- package/dist/alert-dialog/index.js +206 -0
- package/dist/alert-dialog/index.mjs +29 -0
- package/dist/avatar/index.d.mts +23 -0
- package/dist/avatar/index.d.ts +23 -0
- package/dist/avatar/index.js +133 -0
- package/dist/avatar/index.mjs +10 -0
- package/dist/badge/index.d.mts +15 -0
- package/dist/badge/index.d.ts +15 -0
- package/dist/badge/index.js +96 -0
- package/dist/badge/index.mjs +10 -0
- package/dist/breadcrumb/index.d.mts +20 -0
- package/dist/breadcrumb/index.d.ts +20 -0
- package/dist/breadcrumb/index.js +126 -0
- package/dist/breadcrumb/index.mjs +20 -0
- package/dist/button/index.d.mts +12 -0
- package/dist/button/index.d.ts +12 -0
- package/dist/button/index.js +88 -0
- package/dist/button/index.mjs +10 -0
- package/dist/calendar/index.d.mts +29 -0
- package/dist/calendar/index.d.ts +29 -0
- package/dist/calendar/index.js +191 -0
- package/dist/calendar/index.mjs +9 -0
- package/dist/card/index.d.mts +13 -0
- package/dist/card/index.d.ts +13 -0
- package/dist/card/index.js +141 -0
- package/dist/card/index.mjs +19 -0
- package/dist/carousel/index.d.mts +20 -0
- package/dist/carousel/index.d.ts +20 -0
- package/dist/carousel/index.js +236 -0
- package/dist/carousel/index.mjs +19 -0
- package/dist/checkbox/index.d.mts +6 -0
- package/dist/checkbox/index.d.ts +6 -0
- package/dist/checkbox/index.js +63 -0
- package/dist/checkbox/index.mjs +8 -0
- package/dist/chunk-32LEHNCH.mjs +155 -0
- package/dist/chunk-3ZJ4L43B.mjs +92 -0
- package/dist/chunk-4KQNZMKT.mjs +47 -0
- package/dist/chunk-4W6U222X.mjs +113 -0
- package/dist/chunk-556SM2PJ.mjs +40 -0
- package/dist/chunk-5LYTCNI6.mjs +127 -0
- package/dist/chunk-5N7LGYZK.mjs +137 -0
- package/dist/chunk-6OG237U6.mjs +54 -0
- package/dist/chunk-7TMIJ7HZ.mjs +149 -0
- package/dist/chunk-DTENOVQN.mjs +44 -0
- package/dist/chunk-DUGW62XX.mjs +143 -0
- package/dist/chunk-DWLKKYIU.mjs +156 -0
- package/dist/chunk-DYCSGLM5.mjs +32 -0
- package/dist/chunk-DZPJV6MN.mjs +66 -0
- package/dist/chunk-FT72MNAV.mjs +25 -0
- package/dist/chunk-FV6JTZAK.mjs +30 -0
- package/dist/chunk-GLD4KQD3.mjs +90 -0
- package/dist/chunk-GWVW5OI6.mjs +106 -0
- package/dist/chunk-JWCA4M7E.mjs +160 -0
- package/dist/chunk-K4UYYX45.mjs +199 -0
- package/dist/chunk-KVQKOJNU.mjs +52 -0
- package/dist/chunk-LPMRBQLR.mjs +120 -0
- package/dist/chunk-M6HSM6GV.mjs +68 -0
- package/dist/chunk-NE5LEVMC.mjs +201 -0
- package/dist/chunk-NGWDLZ6E.mjs +33 -0
- package/dist/chunk-NH5ZVHAV.mjs +36 -0
- package/dist/chunk-PFXSPRVI.mjs +65 -0
- package/dist/chunk-PJO7WJ4G.mjs +10 -0
- package/dist/chunk-PTXZWR7Y.mjs +76 -0
- package/dist/chunk-SG747CBC.mjs +34 -0
- package/dist/chunk-UDQDW22Y.mjs +71 -0
- package/dist/chunk-UGOA6M4S.mjs +120 -0
- package/dist/chunk-UXU54FBX.mjs +63 -0
- package/dist/chunk-WYBX5VJ4.mjs +49 -0
- package/dist/chunk-Y7DNVOKO.mjs +57 -0
- package/dist/chunk-YNOS3JA2.mjs +29 -0
- package/dist/chunk-YPTARV3T.mjs +57 -0
- package/dist/chunk-YYFQVSPV.mjs +17 -0
- package/dist/chunk-ZR3J34NX.mjs +85 -0
- package/dist/collapsible/index.d.mts +8 -0
- package/dist/collapsible/index.d.ts +8 -0
- package/dist/collapsible/index.js +64 -0
- package/dist/collapsible/index.mjs +12 -0
- package/dist/combobox/index.d.mts +18 -0
- package/dist/combobox/index.d.ts +18 -0
- package/dist/combobox/index.js +198 -0
- package/dist/combobox/index.mjs +32 -0
- package/dist/context-menu/index.d.mts +16 -0
- package/dist/context-menu/index.d.ts +16 -0
- package/dist/context-menu/index.js +177 -0
- package/dist/context-menu/index.mjs +28 -0
- package/dist/date-range-input/index.d.mts +17 -0
- package/dist/date-range-input/index.d.ts +17 -0
- package/dist/date-range-input/index.js +284 -0
- package/dist/date-range-input/index.mjs +11 -0
- package/dist/dialog/index.d.mts +19 -0
- package/dist/dialog/index.d.ts +19 -0
- package/dist/dialog/index.js +240 -0
- package/dist/dialog/index.mjs +27 -0
- package/dist/dropdown-menu/index.d.mts +16 -0
- package/dist/dropdown-menu/index.d.ts +16 -0
- package/dist/dropdown-menu/index.js +189 -0
- package/dist/dropdown-menu/index.mjs +28 -0
- package/dist/field/index.d.mts +24 -0
- package/dist/field/index.d.ts +24 -0
- package/dist/field/index.js +88 -0
- package/dist/field/index.mjs +16 -0
- package/dist/hover-card/index.d.mts +8 -0
- package/dist/hover-card/index.d.ts +8 -0
- package/dist/hover-card/index.js +79 -0
- package/dist/hover-card/index.mjs +12 -0
- package/dist/index.d.mts +73 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +3167 -0
- package/dist/index.mjs +452 -0
- package/dist/input/index.d.mts +5 -0
- package/dist/input/index.d.ts +5 -0
- package/dist/input/index.js +54 -0
- package/dist/input/index.mjs +7 -0
- package/dist/kbd/index.d.mts +8 -0
- package/dist/kbd/index.d.ts +8 -0
- package/dist/kbd/index.js +64 -0
- package/dist/kbd/index.mjs +9 -0
- package/dist/lightbox/index.d.mts +17 -0
- package/dist/lightbox/index.d.ts +17 -0
- package/dist/lightbox/index.js +151 -0
- package/dist/lightbox/index.mjs +24 -0
- package/dist/pagination/index.d.mts +33 -0
- package/dist/pagination/index.d.ts +33 -0
- package/dist/pagination/index.js +212 -0
- package/dist/pagination/index.mjs +25 -0
- package/dist/popover/index.d.mts +11 -0
- package/dist/popover/index.d.ts +11 -0
- package/dist/popover/index.js +120 -0
- package/dist/popover/index.mjs +18 -0
- package/dist/progress/index.d.mts +6 -0
- package/dist/progress/index.d.ts +6 -0
- package/dist/progress/index.js +60 -0
- package/dist/progress/index.mjs +8 -0
- package/dist/radio-group/index.d.mts +8 -0
- package/dist/radio-group/index.d.ts +8 -0
- package/dist/radio-group/index.js +71 -0
- package/dist/radio-group/index.mjs +10 -0
- package/dist/resizable/index.d.mts +10 -0
- package/dist/resizable/index.d.ts +10 -0
- package/dist/resizable/index.js +80 -0
- package/dist/resizable/index.mjs +12 -0
- package/dist/scroll-area/index.d.mts +6 -0
- package/dist/scroll-area/index.d.ts +6 -0
- package/dist/scroll-area/index.js +74 -0
- package/dist/scroll-area/index.mjs +8 -0
- package/dist/select/index.d.mts +17 -0
- package/dist/select/index.d.ts +17 -0
- package/dist/select/index.js +238 -0
- package/dist/select/index.mjs +26 -0
- package/dist/separator/index.d.mts +6 -0
- package/dist/separator/index.d.ts +6 -0
- package/dist/separator/index.js +59 -0
- package/dist/separator/index.mjs +8 -0
- package/dist/sheet/index.d.mts +38 -0
- package/dist/sheet/index.d.ts +38 -0
- package/dist/sheet/index.js +212 -0
- package/dist/sheet/index.mjs +27 -0
- package/dist/skeleton/index.d.mts +17 -0
- package/dist/skeleton/index.d.ts +17 -0
- package/dist/skeleton/index.js +80 -0
- package/dist/skeleton/index.mjs +11 -0
- package/dist/slide-over/index.d.mts +92 -0
- package/dist/slide-over/index.d.ts +92 -0
- package/dist/slide-over/index.js +298 -0
- package/dist/slide-over/index.mjs +31 -0
- package/dist/slider/index.d.mts +6 -0
- package/dist/slider/index.d.ts +6 -0
- package/dist/slider/index.js +47 -0
- package/dist/slider/index.mjs +8 -0
- package/dist/switch/index.d.mts +8 -0
- package/dist/switch/index.d.ts +8 -0
- package/dist/switch/index.js +66 -0
- package/dist/switch/index.mjs +8 -0
- package/dist/tabs/index.d.mts +9 -0
- package/dist/tabs/index.d.ts +9 -0
- package/dist/tabs/index.js +96 -0
- package/dist/tabs/index.mjs +14 -0
- package/dist/toast/index.d.mts +19 -0
- package/dist/toast/index.d.ts +19 -0
- package/dist/toast/index.js +107 -0
- package/dist/toast/index.mjs +10 -0
- package/dist/toggle/index.d.mts +14 -0
- package/dist/toggle/index.d.ts +14 -0
- package/dist/toggle/index.js +89 -0
- package/dist/toggle/index.mjs +12 -0
- package/dist/tooltip/index.d.mts +9 -0
- package/dist/tooltip/index.d.ts +9 -0
- package/dist/tooltip/index.js +101 -0
- package/dist/tooltip/index.mjs +14 -0
- package/package.json +235 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Carousel,
|
|
4
|
+
CarouselContent,
|
|
5
|
+
CarouselItem,
|
|
6
|
+
CarouselNext,
|
|
7
|
+
CarouselPrevious,
|
|
8
|
+
useCarousel
|
|
9
|
+
} from "../chunk-JWCA4M7E.mjs";
|
|
10
|
+
import "../chunk-YPTARV3T.mjs";
|
|
11
|
+
import "../chunk-PJO7WJ4G.mjs";
|
|
12
|
+
export {
|
|
13
|
+
Carousel,
|
|
14
|
+
CarouselContent,
|
|
15
|
+
CarouselItem,
|
|
16
|
+
CarouselNext,
|
|
17
|
+
CarouselPrevious,
|
|
18
|
+
useCarousel
|
|
19
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/checkbox/index.tsx
|
|
22
|
+
var checkbox_exports = {};
|
|
23
|
+
__export(checkbox_exports, {
|
|
24
|
+
Checkbox: () => Checkbox
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
27
|
+
var import_checkbox = require("@base-ui/react/checkbox");
|
|
28
|
+
|
|
29
|
+
// src/utils.ts
|
|
30
|
+
var import_clsx = require("clsx");
|
|
31
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
32
|
+
function cn(...inputs) {
|
|
33
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// src/checkbox/index.tsx
|
|
37
|
+
var import_lucide_react = require("lucide-react");
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
function Checkbox({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_checkbox.Checkbox.Root,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "checkbox",
|
|
44
|
+
className: cn(
|
|
45
|
+
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props,
|
|
49
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_checkbox.Checkbox.Indicator,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "checkbox-indicator",
|
|
53
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
54
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.CheckIcon, {})
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
Checkbox
|
|
63
|
+
});
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-YPTARV3T.mjs";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
7
|
+
|
|
8
|
+
// src/dialog/index.tsx
|
|
9
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
10
|
+
import { XIcon } from "lucide-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Dialog({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
14
|
+
}
|
|
15
|
+
function DialogTrigger({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
17
|
+
}
|
|
18
|
+
function DialogPortal({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
20
|
+
}
|
|
21
|
+
function DialogClose({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
23
|
+
}
|
|
24
|
+
function DialogOverlay({
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
DialogPrimitive.Backdrop,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "dialog-overlay",
|
|
32
|
+
className: cn(
|
|
33
|
+
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function DialogContent({
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
showCloseButton = true,
|
|
44
|
+
...props
|
|
45
|
+
}) {
|
|
46
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
DialogPrimitive.Popup,
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "dialog-content",
|
|
52
|
+
className: cn(
|
|
53
|
+
"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props,
|
|
57
|
+
children: [
|
|
58
|
+
children,
|
|
59
|
+
showCloseButton && /* @__PURE__ */ jsxs(
|
|
60
|
+
DialogPrimitive.Close,
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "dialog-close",
|
|
63
|
+
render: /* @__PURE__ */ jsx(
|
|
64
|
+
Button,
|
|
65
|
+
{
|
|
66
|
+
variant: "ghost",
|
|
67
|
+
className: "absolute top-2 right-2",
|
|
68
|
+
size: "icon-sm"
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(XIcon, {}),
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function DialogHeader({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "dialog-header",
|
|
87
|
+
className: cn("flex flex-col gap-2", className),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function DialogFooter({
|
|
93
|
+
className,
|
|
94
|
+
showCloseButton = false,
|
|
95
|
+
children,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsxs(
|
|
99
|
+
"div",
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "dialog-footer",
|
|
102
|
+
className: cn(
|
|
103
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
|
|
104
|
+
className
|
|
105
|
+
),
|
|
106
|
+
...props,
|
|
107
|
+
children: [
|
|
108
|
+
children,
|
|
109
|
+
showCloseButton && /* @__PURE__ */ jsx(DialogPrimitive.Close, { render: /* @__PURE__ */ jsx(Button, { variant: "outline" }), children: "Close" })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function DialogTitle({ className, ...props }) {
|
|
115
|
+
return /* @__PURE__ */ jsx(
|
|
116
|
+
DialogPrimitive.Title,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "dialog-title",
|
|
119
|
+
className: cn(
|
|
120
|
+
"font-heading text-base leading-none font-medium",
|
|
121
|
+
className
|
|
122
|
+
),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function DialogDescription({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}) {
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
DialogPrimitive.Description,
|
|
133
|
+
{
|
|
134
|
+
"data-slot": "dialog-description",
|
|
135
|
+
className: cn(
|
|
136
|
+
"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
137
|
+
className
|
|
138
|
+
),
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export {
|
|
145
|
+
Dialog,
|
|
146
|
+
DialogTrigger,
|
|
147
|
+
DialogPortal,
|
|
148
|
+
DialogClose,
|
|
149
|
+
DialogOverlay,
|
|
150
|
+
DialogContent,
|
|
151
|
+
DialogHeader,
|
|
152
|
+
DialogFooter,
|
|
153
|
+
DialogTitle,
|
|
154
|
+
DialogDescription
|
|
155
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/avatar/index.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { cva } from "class-variance-authority";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var avatarVariants = cva(
|
|
10
|
+
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-muted font-medium select-none",
|
|
11
|
+
{
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
xs: "size-6 text-[10px]",
|
|
15
|
+
sm: "size-8 text-xs",
|
|
16
|
+
default: "size-10 text-sm",
|
|
17
|
+
lg: "size-12 text-base",
|
|
18
|
+
xl: "size-16 text-lg"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: { size: "default" }
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
function getInitials(text) {
|
|
25
|
+
if (!text) return "?";
|
|
26
|
+
const words = text.trim().split(/\s+/);
|
|
27
|
+
if (words.length === 1) return words[0].slice(0, 2).toUpperCase();
|
|
28
|
+
return (words[0][0] + words[words.length - 1][0]).toUpperCase();
|
|
29
|
+
}
|
|
30
|
+
function Avatar({
|
|
31
|
+
className,
|
|
32
|
+
size,
|
|
33
|
+
src,
|
|
34
|
+
alt,
|
|
35
|
+
initials,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
const [imgError, setImgError] = React.useState(false);
|
|
39
|
+
const showImg = src && !imgError;
|
|
40
|
+
return /* @__PURE__ */ jsx("span", { className: cn(avatarVariants({ size }), className), ...props, children: showImg ? /* @__PURE__ */ jsx(
|
|
41
|
+
"img",
|
|
42
|
+
{
|
|
43
|
+
src,
|
|
44
|
+
alt: alt ?? "",
|
|
45
|
+
className: "absolute inset-0 size-full object-cover",
|
|
46
|
+
onError: () => setImgError(true)
|
|
47
|
+
}
|
|
48
|
+
) : /* @__PURE__ */ jsx(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
"aria-label": alt,
|
|
52
|
+
className: "text-muted-foreground",
|
|
53
|
+
style: { lineHeight: 1 },
|
|
54
|
+
children: initials ?? getInitials(alt)
|
|
55
|
+
}
|
|
56
|
+
) });
|
|
57
|
+
}
|
|
58
|
+
function AvatarGroup({ avatars, max = 5, size = "sm", className }) {
|
|
59
|
+
const shown = avatars.slice(0, max);
|
|
60
|
+
const overflow = avatars.length - max;
|
|
61
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center", className), children: [
|
|
62
|
+
shown.map((a, i) => /* @__PURE__ */ jsx(
|
|
63
|
+
"span",
|
|
64
|
+
{
|
|
65
|
+
className: "ring-2 ring-background rounded-full",
|
|
66
|
+
style: { marginLeft: i === 0 ? 0 : "-0.5rem" },
|
|
67
|
+
children: /* @__PURE__ */ jsx(Avatar, { ...a, size })
|
|
68
|
+
},
|
|
69
|
+
i
|
|
70
|
+
)),
|
|
71
|
+
overflow > 0 && /* @__PURE__ */ jsxs(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
avatarVariants({ size }),
|
|
76
|
+
"ring-2 ring-background text-muted-foreground bg-muted"
|
|
77
|
+
),
|
|
78
|
+
style: { marginLeft: "-0.5rem" },
|
|
79
|
+
"aria-label": `${overflow} more`,
|
|
80
|
+
children: [
|
|
81
|
+
"+",
|
|
82
|
+
overflow
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
Avatar,
|
|
91
|
+
AvatarGroup
|
|
92
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hover-card/index.tsx
|
|
6
|
+
import { PreviewCard as HoverCardPrimitive } from "@base-ui/react/preview-card";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function HoverCard({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
10
|
+
}
|
|
11
|
+
function HoverCardTrigger({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
|
|
13
|
+
}
|
|
14
|
+
function HoverCardContent({
|
|
15
|
+
className,
|
|
16
|
+
align = "center",
|
|
17
|
+
sideOffset = 8,
|
|
18
|
+
side = "bottom",
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
22
|
+
HoverCardPrimitive.Positioner,
|
|
23
|
+
{
|
|
24
|
+
align,
|
|
25
|
+
sideOffset,
|
|
26
|
+
side,
|
|
27
|
+
className: "isolate z-50",
|
|
28
|
+
children: /* @__PURE__ */ jsx(
|
|
29
|
+
HoverCardPrimitive.Popup,
|
|
30
|
+
{
|
|
31
|
+
"data-slot": "hover-card-content",
|
|
32
|
+
className: cn(
|
|
33
|
+
"z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-3 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
) });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
HoverCard,
|
|
45
|
+
HoverCardTrigger,
|
|
46
|
+
HoverCardContent
|
|
47
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/lightbox/index.tsx
|
|
6
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
7
|
+
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function Lightbox({ ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "lightbox", ...props });
|
|
11
|
+
}
|
|
12
|
+
function LightboxTrigger({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "lightbox-trigger", ...props });
|
|
14
|
+
}
|
|
15
|
+
function LightboxPortal({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "lightbox-portal", ...props });
|
|
17
|
+
}
|
|
18
|
+
function LightboxClose({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "lightbox-close", ...props });
|
|
20
|
+
}
|
|
21
|
+
function LightboxOverlay({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
DialogPrimitive.Backdrop,
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "lightbox-overlay",
|
|
26
|
+
className: cn(
|
|
27
|
+
"fixed inset-0 z-50 bg-black/90 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function LightboxContent({ className, children, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs(LightboxPortal, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(LightboxOverlay, {}),
|
|
37
|
+
/* @__PURE__ */ jsxs(
|
|
38
|
+
DialogPrimitive.Popup,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "lightbox-content",
|
|
41
|
+
className: cn(
|
|
42
|
+
"fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 p-4 outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
LightboxClose,
|
|
49
|
+
{
|
|
50
|
+
"aria-label": "Close",
|
|
51
|
+
className: "absolute right-4 top-4 z-10 inline-flex size-9 items-center justify-center rounded-full bg-white/10 text-white outline-none transition-colors hover:bg-white/20",
|
|
52
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-5" })
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
children
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] });
|
|
60
|
+
}
|
|
61
|
+
function LightboxImage({ className, alt = "", ...props }) {
|
|
62
|
+
return (
|
|
63
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
64
|
+
/* @__PURE__ */ jsx(
|
|
65
|
+
"img",
|
|
66
|
+
{
|
|
67
|
+
"data-slot": "lightbox-image",
|
|
68
|
+
alt,
|
|
69
|
+
className: cn("max-h-[85vh] max-w-full rounded-md object-contain", className),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function LightboxNavButton({ direction, className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"button",
|
|
78
|
+
{
|
|
79
|
+
type: "button",
|
|
80
|
+
"data-slot": `lightbox-${direction}`,
|
|
81
|
+
"aria-label": direction === "prev" ? "Previous image" : "Next image",
|
|
82
|
+
className: cn(
|
|
83
|
+
"absolute top-1/2 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-white/10 text-white outline-none transition-colors hover:bg-white/20 disabled:pointer-events-none disabled:opacity-30",
|
|
84
|
+
direction === "prev" ? "left-2 sm:left-4" : "right-2 sm:right-4",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props,
|
|
88
|
+
children: direction === "prev" ? /* @__PURE__ */ jsx(ChevronLeft, { className: "size-5" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "size-5" })
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
function LightboxCaption({ className, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
"p",
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "lightbox-caption",
|
|
97
|
+
className: cn("text-center text-sm text-white/80", className),
|
|
98
|
+
...props
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
Lightbox,
|
|
105
|
+
LightboxTrigger,
|
|
106
|
+
LightboxPortal,
|
|
107
|
+
LightboxClose,
|
|
108
|
+
LightboxOverlay,
|
|
109
|
+
LightboxContent,
|
|
110
|
+
LightboxImage,
|
|
111
|
+
LightboxNavButton,
|
|
112
|
+
LightboxCaption
|
|
113
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
4
|
+
|
|
5
|
+
// src/radio-group/index.tsx
|
|
6
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
7
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function RadioGroup({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
RadioGroupPrimitive,
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "radio-group",
|
|
14
|
+
className: cn("flex flex-col gap-2.5", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function RadioGroupItem({ className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
RadioPrimitive.Root,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "radio-group-item",
|
|
24
|
+
className: cn(
|
|
25
|
+
"flex size-4 shrink-0 items-center justify-center rounded-full border border-border bg-background outline-none",
|
|
26
|
+
"data-checked:border-primary data-checked:bg-primary",
|
|
27
|
+
"focus-visible:ring-2 focus-visible:ring-ring",
|
|
28
|
+
"data-disabled:opacity-50 data-disabled:cursor-not-allowed",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(RadioPrimitive.Indicator, { className: "size-1.5 rounded-full bg-primary-foreground data-unchecked:hidden" })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
RadioGroup,
|
|
39
|
+
RadioGroupItem
|
|
40
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "./chunk-YPTARV3T.mjs";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-PJO7WJ4G.mjs";
|
|
7
|
+
|
|
8
|
+
// src/sheet/index.tsx
|
|
9
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
10
|
+
import { XIcon } from "lucide-react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Sheet({ ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
14
|
+
}
|
|
15
|
+
function SheetTrigger({ ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
17
|
+
}
|
|
18
|
+
function SheetPortal({ ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
20
|
+
}
|
|
21
|
+
function SheetClose({ ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
23
|
+
}
|
|
24
|
+
function SheetOverlay({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
DialogPrimitive.Backdrop,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "sheet-overlay",
|
|
29
|
+
className: cn("fixed inset-0 z-50 bg-black/40", className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
var SIDE_STYLES = {
|
|
35
|
+
bottom: "inset-x-0 bottom-0 max-h-[85vh] rounded-t-2xl border-t",
|
|
36
|
+
top: "inset-x-0 top-0 max-h-[85vh] rounded-b-2xl border-b",
|
|
37
|
+
right: "inset-y-0 right-0 h-full w-full max-w-sm border-l",
|
|
38
|
+
left: "inset-y-0 left-0 h-full w-full max-w-sm border-r"
|
|
39
|
+
};
|
|
40
|
+
function SheetContent({
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
side = "bottom",
|
|
44
|
+
showCloseButton = true,
|
|
45
|
+
showHandle,
|
|
46
|
+
...props
|
|
47
|
+
}) {
|
|
48
|
+
const handle = showHandle ?? side === "bottom";
|
|
49
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
51
|
+
/* @__PURE__ */ jsxs(
|
|
52
|
+
DialogPrimitive.Popup,
|
|
53
|
+
{
|
|
54
|
+
"data-slot": "sheet-content",
|
|
55
|
+
"data-side": side,
|
|
56
|
+
className: cn(
|
|
57
|
+
"fixed z-50 flex flex-col gap-4 border-border bg-popover p-4 text-popover-foreground shadow-xl outline-none",
|
|
58
|
+
side === "bottom" && "pb-[calc(1rem+env(safe-area-inset-bottom))]",
|
|
59
|
+
SIDE_STYLES[side],
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
handle && /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: "mx-auto -mt-1 h-1.5 w-9 shrink-0 rounded-full bg-border" }),
|
|
65
|
+
children,
|
|
66
|
+
showCloseButton && /* @__PURE__ */ jsxs(
|
|
67
|
+
DialogPrimitive.Close,
|
|
68
|
+
{
|
|
69
|
+
"data-slot": "sheet-close",
|
|
70
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "ghost", className: "absolute top-3 right-3", size: "icon-sm" }),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx(XIcon, {}),
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
function SheetHeader({ className, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-header", className: cn("flex flex-col gap-1.5", className), ...props });
|
|
84
|
+
}
|
|
85
|
+
function SheetFooter({ className, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
"data-slot": "sheet-footer",
|
|
90
|
+
className: cn("mt-auto flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function SheetTitle({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
97
|
+
DialogPrimitive.Title,
|
|
98
|
+
{
|
|
99
|
+
"data-slot": "sheet-title",
|
|
100
|
+
className: cn("font-heading text-base leading-none font-semibold", className),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function SheetDescription({ className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
DialogPrimitive.Description,
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "sheet-description",
|
|
110
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
Sheet,
|
|
118
|
+
SheetTrigger,
|
|
119
|
+
SheetPortal,
|
|
120
|
+
SheetClose,
|
|
121
|
+
SheetOverlay,
|
|
122
|
+
SheetContent,
|
|
123
|
+
SheetHeader,
|
|
124
|
+
SheetFooter,
|
|
125
|
+
SheetTitle,
|
|
126
|
+
SheetDescription
|
|
127
|
+
};
|