@opensite/ui 0.0.1

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 (75) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +315 -0
  3. package/dist/animated-dialog.cjs +168 -0
  4. package/dist/animated-dialog.cjs.map +1 -0
  5. package/dist/animated-dialog.d.cts +24 -0
  6. package/dist/animated-dialog.d.ts +24 -0
  7. package/dist/animated-dialog.js +166 -0
  8. package/dist/animated-dialog.js.map +1 -0
  9. package/dist/badge.cjs +49 -0
  10. package/dist/badge.cjs.map +1 -0
  11. package/dist/badge.d.cts +13 -0
  12. package/dist/badge.d.ts +13 -0
  13. package/dist/badge.js +46 -0
  14. package/dist/badge.js.map +1 -0
  15. package/dist/button.cjs +63 -0
  16. package/dist/button.cjs.map +1 -0
  17. package/dist/button.d.cts +14 -0
  18. package/dist/button.d.ts +14 -0
  19. package/dist/button.js +60 -0
  20. package/dist/button.js.map +1 -0
  21. package/dist/card.cjs +99 -0
  22. package/dist/card.cjs.map +1 -0
  23. package/dist/card.d.cts +12 -0
  24. package/dist/card.d.ts +12 -0
  25. package/dist/card.js +91 -0
  26. package/dist/card.js.map +1 -0
  27. package/dist/components.cjs +533 -0
  28. package/dist/components.cjs.map +1 -0
  29. package/dist/components.d.cts +14 -0
  30. package/dist/components.d.ts +14 -0
  31. package/dist/components.js +494 -0
  32. package/dist/components.js.map +1 -0
  33. package/dist/container.cjs +47 -0
  34. package/dist/container.cjs.map +1 -0
  35. package/dist/container.d.cts +16 -0
  36. package/dist/container.d.ts +16 -0
  37. package/dist/container.js +41 -0
  38. package/dist/container.js.map +1 -0
  39. package/dist/index.cjs +534 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +16 -0
  42. package/dist/index.d.ts +16 -0
  43. package/dist/index.js +494 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/page-hero-banner.cjs +119 -0
  46. package/dist/page-hero-banner.cjs.map +1 -0
  47. package/dist/page-hero-banner.d.cts +22 -0
  48. package/dist/page-hero-banner.d.ts +22 -0
  49. package/dist/page-hero-banner.js +113 -0
  50. package/dist/page-hero-banner.js.map +1 -0
  51. package/dist/popover.cjs +73 -0
  52. package/dist/popover.cjs.map +1 -0
  53. package/dist/popover.d.cts +10 -0
  54. package/dist/popover.d.ts +10 -0
  55. package/dist/popover.js +48 -0
  56. package/dist/popover.js.map +1 -0
  57. package/dist/section.cjs +96 -0
  58. package/dist/section.cjs.map +1 -0
  59. package/dist/section.d.cts +21 -0
  60. package/dist/section.d.ts +21 -0
  61. package/dist/section.js +90 -0
  62. package/dist/section.js.map +1 -0
  63. package/dist/types.cjs +4 -0
  64. package/dist/types.cjs.map +1 -0
  65. package/dist/types.d.cts +180 -0
  66. package/dist/types.d.ts +180 -0
  67. package/dist/types.js +3 -0
  68. package/dist/types.js.map +1 -0
  69. package/dist/utils.cjs +13 -0
  70. package/dist/utils.cjs.map +1 -0
  71. package/dist/utils.d.cts +5 -0
  72. package/dist/utils.d.ts +5 -0
  73. package/dist/utils.js +11 -0
  74. package/dist/utils.js.map +1 -0
  75. package/package.json +152 -0
@@ -0,0 +1,166 @@
1
+ import { useId, useRef, useEffect } from 'react';
2
+ import { AnimatePresence, motion } from 'framer-motion';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { useOnClickOutside } from '@opensite/hooks';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ var sizeStyles = {
12
+ sm: "max-w-md",
13
+ md: "max-w-2xl",
14
+ lg: "max-w-4xl",
15
+ xl: "max-w-5xl",
16
+ full: "max-w-7xl"
17
+ };
18
+ var dialogTransition = {
19
+ duration: 0.35,
20
+ ease: [0.16, 1, 0.3, 1]
21
+ };
22
+ function AnimatedDialog({
23
+ open,
24
+ onOpenChange,
25
+ title,
26
+ eyebrow,
27
+ description,
28
+ children,
29
+ header,
30
+ footer,
31
+ size = "lg",
32
+ className,
33
+ contentClassName
34
+ }) {
35
+ const titleId = useId();
36
+ const descriptionId = useId();
37
+ const containerRef = useRef(null);
38
+ useOnClickOutside(containerRef, () => {
39
+ if (open) {
40
+ onOpenChange(false);
41
+ }
42
+ });
43
+ useEffect(() => {
44
+ if (!open) {
45
+ return;
46
+ }
47
+ const onKeyDown = (event) => {
48
+ if (event.key === "Escape") {
49
+ onOpenChange(false);
50
+ }
51
+ };
52
+ const previousOverflow = document.body.style.overflow;
53
+ document.body.style.overflow = "hidden";
54
+ window.addEventListener("keydown", onKeyDown);
55
+ return () => {
56
+ document.body.style.overflow = previousOverflow;
57
+ window.removeEventListener("keydown", onKeyDown);
58
+ };
59
+ }, [open, onOpenChange]);
60
+ return /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 h-screen overflow-y-auto", children: [
61
+ /* @__PURE__ */ jsx(
62
+ motion.div,
63
+ {
64
+ initial: { opacity: 0 },
65
+ animate: { opacity: 1, transition: dialogTransition },
66
+ exit: { opacity: 0, transition: dialogTransition },
67
+ className: "fixed inset-0 h-full w-full bg-foreground/80 backdrop-blur-lg"
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsxs(
71
+ motion.div,
72
+ {
73
+ initial: { opacity: 0, y: 24, scale: 0.98 },
74
+ animate: {
75
+ opacity: 1,
76
+ y: 0,
77
+ scale: 1,
78
+ transition: dialogTransition
79
+ },
80
+ exit: {
81
+ opacity: 0,
82
+ y: 12,
83
+ scale: 0.98,
84
+ transition: dialogTransition
85
+ },
86
+ ref: containerRef,
87
+ role: "dialog",
88
+ "aria-modal": "true",
89
+ "aria-labelledby": title ? titleId : void 0,
90
+ "aria-describedby": description ? descriptionId : void 0,
91
+ className: cn(
92
+ "relative z-[60] mx-auto my-10 flex w-[92vw] max-h-[85vh] flex-col overflow-hidden rounded-3xl bg-card p-4 shadow-2xl ring-1 ring-border/10 md:my-16 md:p-10",
93
+ sizeStyles[size],
94
+ className
95
+ ),
96
+ children: [
97
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-6", children: [
98
+ header ? header : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
99
+ eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-[0.3em] text-primary", children: eyebrow }) : null,
100
+ title ? /* @__PURE__ */ jsx(
101
+ "h2",
102
+ {
103
+ id: titleId,
104
+ className: "text-2xl font-semibold text-card-foreground md:text-4xl",
105
+ children: title
106
+ }
107
+ ) : null,
108
+ description ? /* @__PURE__ */ jsx(
109
+ "p",
110
+ {
111
+ id: descriptionId,
112
+ className: "text-sm text-muted-foreground md:text-base",
113
+ children: description
114
+ }
115
+ ) : null
116
+ ] }),
117
+ /* @__PURE__ */ jsx(
118
+ "button",
119
+ {
120
+ type: "button",
121
+ "aria-label": "Close dialog",
122
+ className: "flex h-9 w-9 items-center justify-center rounded-full bg-foreground text-background transition hover:bg-foreground/80",
123
+ onClick: () => onOpenChange(false),
124
+ children: /* @__PURE__ */ jsx(
125
+ "svg",
126
+ {
127
+ xmlns: "http://www.w3.org/2000/svg",
128
+ width: "24",
129
+ height: "24",
130
+ viewBox: "0 0 24 24",
131
+ children: /* @__PURE__ */ jsx(
132
+ "path",
133
+ {
134
+ fill: "none",
135
+ stroke: "currentColor",
136
+ strokeLinecap: "round",
137
+ strokeLinejoin: "round",
138
+ strokeWidth: "2",
139
+ d: "M18 6L6 18M6 6l12 12"
140
+ }
141
+ )
142
+ }
143
+ )
144
+ }
145
+ )
146
+ ] }),
147
+ children ? /* @__PURE__ */ jsx(
148
+ "div",
149
+ {
150
+ className: cn(
151
+ "mt-6 flex-1 min-h-0 overflow-y-auto pr-2",
152
+ contentClassName
153
+ ),
154
+ children
155
+ }
156
+ ) : null,
157
+ footer ? /* @__PURE__ */ jsx("div", { className: "mt-6", children: footer }) : null
158
+ ]
159
+ }
160
+ )
161
+ ] }) : null });
162
+ }
163
+
164
+ export { AnimatedDialog };
165
+ //# sourceMappingURL=animated-dialog.js.map
166
+ //# sourceMappingURL=animated-dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/animated-dialog.tsx"],"names":[],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACMA,IAAM,UAAA,GAAa;AAAA,EACjB,EAAA,EAAI,UAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,IAAA,EAAM;AACR,CAAA;AAKA,IAAM,gBAAA,GAAmB;AAAA,EACvB,QAAA,EAAU,IAAA;AAAA,EACV,IAAA,EAAM,CAAC,IAAA,EAAM,CAAA,EAAG,KAAK,CAAC;AACxB,CAAA;AAmBO,SAAS,cAAA,CAAe;AAAA,EAC7B,IAAA;AAAA,EACA,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,SAAA;AAAA,EACA;AACF,CAAA,EAAwB;AACtB,EAAA,MAAM,UAAU,KAAA,EAAM;AACtB,EAAA,MAAM,gBAAgB,KAAA,EAAM;AAC5B,EAAA,MAAM,YAAA,GAAe,OAAuB,IAAK,CAAA;AAEjD,EAAA,iBAAA,CAAkB,cAAc,MAAM;AACpC,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,YAAA,CAAa,KAAK,CAAA;AAAA,IACpB;AAAA,EACF,CAAC,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,IAAA,EAAM;AACT,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,SAAA,GAAY,CAAC,KAAA,K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;AAAA,gBACX,SAAA,EAAU,uHAAA;AAAA,gBACV,OAAA,EAAS,MAAM,YAAA,CAAa,KAAK,CAAA;AAAA,gBAEjC,QAAA,kBAAA,GAAA;AAAA,kBAAC,KAAA;AAAA,kBAAA;AAAA,oBACC,KAAA,EAAM,4BAAA;AAAA,oBACN,KAAA,EAAM,IAAA;AAAA,oBACN,MAAA,EAAO,IAAA;AAAA,oBACP,OAAA,EAAQ,WAAA;AAAA,oBAER,QAAA,kBAAA,GAAA;AAAA,sBAAC,MAAA;AAAA,sBAAA;AAAA,wBACC,IAAA,EAAK,MAAA;AAAA,wBACL,MAAA,EAAO,cAAA;AAAA,wBACP,aAAA,EAAc,OAAA;AAAA,wBACd,cAAA,EAAe,OAAA;AAAA,wBACf,WAAA,EAAY,GAAA;AAAA,wBACZ,CAAA,EAAE;AAAA;AAAA;AACJ;AAAA;AACF;AAAA;AACF,WAAA,EACF,CAAA;AAAA,UAGC,QAAA,mBACC,GAAA;AAAA,YAAC,KAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,EAAA;AAAA,gBACT,0CAAA;AAAA,gBACA;AAAA,eACF;AAAA,cAEC;AAAA;AAAA,WACH,GACE,IAAA;AAAA,UAGH,yBAAS,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,MAAA,EAAQ,kBAAO,CAAA,GAAS;AAAA;AAAA;AAAA;AACnD,GAAA,EACF,IACE,IAAA,EACN,CAAA;AAEJ","file":"animated-dialog.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport React, { useEffect, useId, useRef } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { cn } from \"../../lib/utils\";\nimport { useOnClickOutside } from \"@opensite/hooks\";\nimport type { AnimatedDialogProps } from \"../../src/types\";\n\n/**\n * Size variants for the dialog\n */\nconst sizeStyles = {\n sm: \"max-w-md\",\n md: \"max-w-2xl\",\n lg: \"max-w-4xl\",\n xl: \"max-w-5xl\",\n full: \"max-w-7xl\",\n};\n\n/**\n * Animation transition configuration\n */\nconst dialogTransition = {\n duration: 0.35,\n ease: [0.16, 1, 0.3, 1] as const,\n};\n\n/**\n * Animated dialog component with framer-motion animations\n *\n * @example\n * ```tsx\n * const [open, setOpen] = useState(false);\n *\n * <AnimatedDialog\n * open={open}\n * onOpenChange={setOpen}\n * title=\"Dialog Title\"\n * description=\"Dialog description\"\n * >\n * <div>Dialog content</div>\n * </AnimatedDialog>\n * ```\n */\nexport function AnimatedDialog({\n open,\n onOpenChange,\n title,\n eyebrow,\n description,\n children,\n header,\n footer,\n size = \"lg\",\n className,\n contentClassName,\n}: AnimatedDialogProps) {\n const titleId = useId();\n const descriptionId = useId();\n const containerRef = useRef<HTMLDivElement>(null!);\n\n useOnClickOutside(containerRef, () => {\n if (open) {\n onOpenChange(false);\n }\n });\n\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n }\n };\n\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n window.addEventListener(\"keydown\", onKeyDown);\n\n return () => {\n document.body.style.overflow = previousOverflow;\n window.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [open, onOpenChange]);\n\n return (\n <AnimatePresence>\n {open ? (\n <div className=\"fixed inset-0 z-50 h-screen overflow-y-auto\">\n {/* Backdrop */}\n <motion.div\n initial={{ opacity: 0 }}\n animate={{ opacity: 1, transition: dialogTransition }}\n exit={{ opacity: 0, transition: dialogTransition }}\n className=\"fixed inset-0 h-full w-full bg-foreground/80 backdrop-blur-lg\"\n />\n\n {/* Dialog container */}\n <motion.div\n initial={{ opacity: 0, y: 24, scale: 0.98 }}\n animate={{\n opacity: 1,\n y: 0,\n scale: 1,\n transition: dialogTransition,\n }}\n exit={{\n opacity: 0,\n y: 12,\n scale: 0.98,\n transition: dialogTransition,\n }}\n ref={containerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? titleId : undefined}\n aria-describedby={description ? descriptionId : undefined}\n className={cn(\n \"relative z-[60] mx-auto my-10 flex w-[92vw] max-h-[85vh] flex-col overflow-hidden rounded-3xl bg-card p-4 shadow-2xl ring-1 ring-border/10 md:my-16 md:p-10\",\n sizeStyles[size],\n className\n )}\n >\n {/* Header */}\n <div className=\"flex items-start justify-between gap-6\">\n {header ? (\n header\n ) : (\n <div className=\"space-y-3\">\n {eyebrow ? (\n <p className=\"text-xs font-semibold uppercase tracking-[0.3em] text-primary\">\n {eyebrow}\n </p>\n ) : null}\n {title ? (\n <h2\n id={titleId}\n className=\"text-2xl font-semibold text-card-foreground md:text-4xl\"\n >\n {title}\n </h2>\n ) : null}\n {description ? (\n <p\n id={descriptionId}\n className=\"text-sm text-muted-foreground md:text-base\"\n >\n {description}\n </p>\n ) : null}\n </div>\n )}\n\n {/* Close button */}\n <button\n type=\"button\"\n aria-label=\"Close dialog\"\n className=\"flex h-9 w-9 items-center justify-center rounded-full bg-foreground text-background transition hover:bg-foreground/80\"\n onClick={() => onOpenChange(false)}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n >\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n d=\"M18 6L6 18M6 6l12 12\"\n />\n </svg>\n </button>\n </div>\n\n {/* Content */}\n {children ? (\n <div\n className={cn(\n \"mt-6 flex-1 min-h-0 overflow-y-auto pr-2\",\n contentClassName\n )}\n >\n {children}\n </div>\n ) : null}\n\n {/* Footer */}\n {footer ? <div className=\"mt-6\">{footer}</div> : null}\n </motion.div>\n </div>\n ) : null}\n </AnimatePresence>\n );\n}\n"]}
package/dist/badge.cjs ADDED
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var reactSlot = require('@radix-ui/react-slot');
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ // components/ui/badge.tsx
10
+ function cn(...inputs) {
11
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
12
+ }
13
+ var badgeVariants = classVarianceAuthority.cva(
14
+ "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
+ {
16
+ variants: {
17
+ variant: {
18
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
19
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
20
+ 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",
21
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ variant: "default"
26
+ }
27
+ }
28
+ );
29
+ function Badge({
30
+ className,
31
+ variant,
32
+ asChild = false,
33
+ ...props
34
+ }) {
35
+ const Comp = asChild ? reactSlot.Slot : "span";
36
+ return /* @__PURE__ */ jsxRuntime.jsx(
37
+ Comp,
38
+ {
39
+ "data-slot": "badge",
40
+ className: cn(badgeVariants({ variant }), className),
41
+ ...props
42
+ }
43
+ );
44
+ }
45
+
46
+ exports.Badge = Badge;
47
+ exports.badgeVariants = badgeVariants;
48
+ //# sourceMappingURL=badge.cjs.map
49
+ //# sourceMappingURL=badge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/badge.tsx"],"names":["twMerge","clsx","cva","Slot","jsx"],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,aAAA,GAAgBC,0BAAA;AAAA,EACpB,kZAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EACE,gFAAA;AAAA,QACF,SAAA,EACE,sFAAA;AAAA,QACF,WAAA,EACE,2KAAA;AAAA,QACF,OAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ;AAEA,SAAS,KAAA,CAAM;AAAA,EACb,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,GAAG;AACL,CAAA,EAC8D;AAC5D,EAAA,MAAM,IAAA,GAAO,UAAUC,cAAA,GAAO,MAAA;AAE9B,EAAA,uBACEC,cAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,OAAA;AAAA,MACV,WAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,MAClD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"badge.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"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\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n"]}
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const badgeVariants: (props?: ({
7
+ variant?: "secondary" | "outline" | "default" | "destructive" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
10
+ asChild?: boolean;
11
+ }): react_jsx_runtime.JSX.Element;
12
+
13
+ export { Badge, badgeVariants };
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const badgeVariants: (props?: ({
7
+ variant?: "secondary" | "outline" | "default" | "destructive" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
10
+ asChild?: boolean;
11
+ }): react_jsx_runtime.JSX.Element;
12
+
13
+ export { Badge, badgeVariants };
package/dist/badge.js ADDED
@@ -0,0 +1,46 @@
1
+ import { Slot } from '@radix-ui/react-slot';
2
+ import { cva } from 'class-variance-authority';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ // components/ui/badge.tsx
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ var badgeVariants = cva(
12
+ "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",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
17
+ secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
18
+ 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",
19
+ outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "default"
24
+ }
25
+ }
26
+ );
27
+ function Badge({
28
+ className,
29
+ variant,
30
+ asChild = false,
31
+ ...props
32
+ }) {
33
+ const Comp = asChild ? Slot : "span";
34
+ return /* @__PURE__ */ jsx(
35
+ Comp,
36
+ {
37
+ "data-slot": "badge",
38
+ className: cn(badgeVariants({ variant }), className),
39
+ ...props
40
+ }
41
+ );
42
+ }
43
+
44
+ export { Badge, badgeVariants };
45
+ //# sourceMappingURL=badge.js.map
46
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/badge.tsx"],"names":[],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB,kZAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EACE,gFAAA;AAAA,QACF,SAAA,EACE,sFAAA;AAAA,QACF,WAAA,EACE,2KAAA;AAAA,QACF,OAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ;AAEA,SAAS,KAAA,CAAM;AAAA,EACb,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA,GAAU,KAAA;AAAA,EACV,GAAG;AACL,CAAA,EAC8D;AAC5D,EAAA,MAAM,IAAA,GAAO,UAAU,IAAA,GAAO,MAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,OAAA;AAAA,MACV,WAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,MAClD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"badge.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"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\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nexport { Badge, badgeVariants }\n"]}
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var reactSlot = require('@radix-ui/react-slot');
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var clsx = require('clsx');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ // components/ui/button.tsx
10
+ function cn(...inputs) {
11
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
12
+ }
13
+ var buttonVariants = classVarianceAuthority.cva(
14
+ "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
+ {
16
+ variants: {
17
+ variant: {
18
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
19
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
20
+ 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",
21
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
22
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
23
+ link: "text-primary underline-offset-4 hover:underline"
24
+ },
25
+ size: {
26
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
27
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
28
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
29
+ icon: "size-9",
30
+ "icon-sm": "size-8",
31
+ "icon-lg": "size-10"
32
+ }
33
+ },
34
+ defaultVariants: {
35
+ variant: "default",
36
+ size: "default"
37
+ }
38
+ }
39
+ );
40
+ function Button({
41
+ className,
42
+ variant = "default",
43
+ size = "default",
44
+ asChild = false,
45
+ ...props
46
+ }) {
47
+ const Comp = asChild ? reactSlot.Slot : "button";
48
+ return /* @__PURE__ */ jsxRuntime.jsx(
49
+ Comp,
50
+ {
51
+ "data-slot": "button",
52
+ "data-variant": variant,
53
+ "data-size": size,
54
+ className: cn(buttonVariants({ variant, size, className })),
55
+ ...props
56
+ }
57
+ );
58
+ }
59
+
60
+ exports.Button = Button;
61
+ exports.buttonVariants = buttonVariants;
62
+ //# sourceMappingURL=button.cjs.map
63
+ //# sourceMappingURL=button.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/button.tsx"],"names":["twMerge","clsx","cva","Sl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":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"]}
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "secondary" | "link" | "outline" | "default" | "destructive" | "ghost" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { Button, buttonVariants };
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "secondary" | "link" | "outline" | "default" | "destructive" | "ghost" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { Button, buttonVariants };
package/dist/button.js ADDED
@@ -0,0 +1,60 @@
1
+ import { Slot } from '@radix-ui/react-slot';
2
+ import { cva } from 'class-variance-authority';
3
+ import { clsx } from 'clsx';
4
+ import { twMerge } from 'tailwind-merge';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ // components/ui/button.tsx
8
+ function cn(...inputs) {
9
+ return twMerge(clsx(inputs));
10
+ }
11
+ var buttonVariants = cva(
12
+ "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",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
17
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
18
+ 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",
19
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
20
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
21
+ link: "text-primary underline-offset-4 hover:underline"
22
+ },
23
+ size: {
24
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
25
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
26
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
27
+ icon: "size-9",
28
+ "icon-sm": "size-8",
29
+ "icon-lg": "size-10"
30
+ }
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default"
35
+ }
36
+ }
37
+ );
38
+ function Button({
39
+ className,
40
+ variant = "default",
41
+ size = "default",
42
+ asChild = false,
43
+ ...props
44
+ }) {
45
+ const Comp = asChild ? Slot : "button";
46
+ return /* @__PURE__ */ jsx(
47
+ Comp,
48
+ {
49
+ "data-slot": "button",
50
+ "data-variant": variant,
51
+ "data-size": size,
52
+ className: cn(buttonVariants({ variant, size, className })),
53
+ ...props
54
+ }
55
+ );
56
+ }
57
+
58
+ export { Button, buttonVariants };
59
+ //# sourceMappingURL=button.js.map
60
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/button.tsx"],"names":[],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB,6bAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,wDAAA;AAAA,QACT,WAAA,EACE,mJAAA;AAAA,QACF,OAAA,EACE,uIAAA;AAAA,QACF,SAAA,EACE,8DAAA;AAAA,QACF,KAAA,EACE,sEAAA;AAAA,QACF,IAAA,EAAM;AAAA,OACR;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,+BAAA;AAAA,QACT,EAAA,EAAI,+CAAA;AAAA,QACJ,EAAA,EAAI,sCAAA;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,SAAA,EAAW,QAAA;AAAA,QACX,SAAA,EAAW;AAAA;AACb,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAEA,SAAS,MAAA,CAAO;AAAA,EACd,SAAA;AAAA,EACA,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,SAAA;AAAA,EACP,OAAA,GAAU,KAAA;AAAA,EACV,GAAG;AACL,CAAA,EAGK;AACH,EAAA,MAAM,IAAA,GAAO,UAAU,IAAA,GAAO,QAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,QAAA;AAAA,MACV,cAAA,EAAc,OAAA;AAAA,MACd,WAAA,EAAW,IAAA;AAAA,MACX,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,SAAA,EAAW,CAAC,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"button.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"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\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"]}
package/dist/card.cjs ADDED
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+
3
+ var clsx = require('clsx');
4
+ var tailwindMerge = require('tailwind-merge');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // lib/utils.ts
8
+ function cn(...inputs) {
9
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
10
+ }
11
+ function Card({ className, ...props }) {
12
+ return /* @__PURE__ */ jsxRuntime.jsx(
13
+ "div",
14
+ {
15
+ "data-slot": "card",
16
+ className: cn(
17
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ function CardHeader({ className, ...props }) {
25
+ return /* @__PURE__ */ jsxRuntime.jsx(
26
+ "div",
27
+ {
28
+ "data-slot": "card-header",
29
+ className: cn(
30
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
31
+ className
32
+ ),
33
+ ...props
34
+ }
35
+ );
36
+ }
37
+ function CardTitle({ className, ...props }) {
38
+ return /* @__PURE__ */ jsxRuntime.jsx(
39
+ "div",
40
+ {
41
+ "data-slot": "card-title",
42
+ className: cn("leading-none font-semibold", className),
43
+ ...props
44
+ }
45
+ );
46
+ }
47
+ function CardDescription({ className, ...props }) {
48
+ return /* @__PURE__ */ jsxRuntime.jsx(
49
+ "div",
50
+ {
51
+ "data-slot": "card-description",
52
+ className: cn("text-muted-foreground text-sm", className),
53
+ ...props
54
+ }
55
+ );
56
+ }
57
+ function CardAction({ className, ...props }) {
58
+ return /* @__PURE__ */ jsxRuntime.jsx(
59
+ "div",
60
+ {
61
+ "data-slot": "card-action",
62
+ className: cn(
63
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
64
+ className
65
+ ),
66
+ ...props
67
+ }
68
+ );
69
+ }
70
+ function CardContent({ className, ...props }) {
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ "div",
73
+ {
74
+ "data-slot": "card-content",
75
+ className: cn("px-6", className),
76
+ ...props
77
+ }
78
+ );
79
+ }
80
+ function CardFooter({ className, ...props }) {
81
+ return /* @__PURE__ */ jsxRuntime.jsx(
82
+ "div",
83
+ {
84
+ "data-slot": "card-footer",
85
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
86
+ ...props
87
+ }
88
+ );
89
+ }
90
+
91
+ exports.Card = Card;
92
+ exports.CardAction = CardAction;
93
+ exports.CardContent = CardContent;
94
+ exports.CardDescription = CardDescription;
95
+ exports.CardFooter = CardFooter;
96
+ exports.CardHeader = CardHeader;
97
+ exports.CardTitle = CardTitle;
98
+ //# sourceMappingURL=card.cjs.map
99
+ //# sourceMappingURL=card.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/ui/card.tsx"],"names":["twMerge","clsx","jsx"],"mappings":";;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,SAAS,IAAA,CAAK,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AAClE,EAAA,uBACEC,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,MAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,mFAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,UAAA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GACN;AAEJ;AAEA,SAAS,UAAA,CAAW,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACxE,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,yCAAA,EAA2C,SAAS,CAAA;AAAA,MACjE,GAAG;AAAA;AAAA,GACN;AAEJ","file":"card.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6\", className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center px-6 [.border-t]:pt-6\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
11
+
12
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
package/dist/card.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ declare function Card({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
11
+
12
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };