ds-leobecker 0.1.0 → 0.2.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/README.md +84 -14
- package/dist/figma-variables.json +761 -0
- package/dist/tokens.json +193 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +22 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +20 -0
- package/dist/ui/button.d.ts +12 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +33 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +8 -0
- package/dist/ui/dialog.d.ts +20 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +22 -0
- package/dist/ui/dropdown-menu.d.ts +28 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +36 -0
- package/dist/ui/form.d.ts +24 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +65 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +8 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +9 -0
- package/dist/ui/popover.d.ts +7 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +10 -0
- package/dist/ui/select.d.ts +14 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +26 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +20 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +10 -0
- package/package.json +81 -20
- package/src/components/accent-dot.tsx +11 -0
- package/src/components/background-pattern.tsx +36 -0
- package/src/components/badge-dot.tsx +34 -0
- package/src/components/index.ts +7 -0
- package/src/components/pill.tsx +22 -0
- package/src/components/stripe-button.tsx +49 -0
- package/src/index.ts +1 -0
- package/src/lib/utils.ts +6 -0
- package/src/theme.css +63 -5
- package/src/tokens/tokens.json +193 -0
- package/guidelines/components/badge-dot.md +0 -33
- package/guidelines/components/button.md +0 -39
- package/guidelines/components/overview.md +0 -14
- package/guidelines/foundations/color.md +0 -48
- package/guidelines/foundations/motion.md +0 -37
- package/guidelines/foundations/overview.md +0 -7
- package/guidelines/foundations/radius.md +0 -19
- package/guidelines/foundations/spacing.md +0 -36
- package/guidelines/foundations/typography.md +0 -29
- package/guidelines/overview.md +0 -26
- package/guidelines/setup.md +0 -26
package/dist/tokens.json
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://design-tokens.org/draft/2024",
|
|
3
|
+
"meta": {
|
|
4
|
+
"name": "Leo Becker Design System",
|
|
5
|
+
"version": "0.1.0"
|
|
6
|
+
},
|
|
7
|
+
"color": {
|
|
8
|
+
"raw": {
|
|
9
|
+
"orange-100": { "value": "#f05524" },
|
|
10
|
+
"orange-200": { "value": "#e34a18" },
|
|
11
|
+
"orange-300": { "value": "#d2441c" },
|
|
12
|
+
"teal-1000": { "value": "#00110e" },
|
|
13
|
+
"teal-900": { "value": "#00201c" },
|
|
14
|
+
"teal-800": { "value": "#00302a" },
|
|
15
|
+
"teal-700": { "value": "#00453f" },
|
|
16
|
+
"teal-600": { "value": "#005c54" },
|
|
17
|
+
"teal-500": { "value": "#326f68" },
|
|
18
|
+
"teal-400": { "value": "#6e8a83" },
|
|
19
|
+
"beige-50": { "value": "#e8dcc1" },
|
|
20
|
+
"beige-100": { "value": "#d4c7a8" },
|
|
21
|
+
"beige-200": { "value": "#c4b597" },
|
|
22
|
+
"beige-300": { "value": "#9dafa4" },
|
|
23
|
+
"green-500": { "value": "#79e27e" },
|
|
24
|
+
"red-500": { "value": "#ff4b4b" },
|
|
25
|
+
"yellow-500": { "value": "#f5c542" },
|
|
26
|
+
"blue-500": { "value": "#4b9eff" }
|
|
27
|
+
},
|
|
28
|
+
"semantic": {
|
|
29
|
+
"background": { "value": "{color.raw.teal-1000}", "light": "{color.raw.beige-50}" },
|
|
30
|
+
"background-secondary": { "value": "{color.raw.teal-900}", "light": "{color.raw.beige-100}" },
|
|
31
|
+
"background-tertiary": { "value": "{color.raw.teal-800}", "light": "{color.raw.beige-200}" },
|
|
32
|
+
"foreground": { "value": "{color.raw.beige-200}", "light": "{color.raw.teal-900}" },
|
|
33
|
+
"foreground-strong": { "value": "{color.raw.beige-50}", "light": "{color.raw.teal-1000}" },
|
|
34
|
+
"foreground-muted": { "value": "{color.raw.teal-400}", "light": "{color.raw.teal-500}" },
|
|
35
|
+
"primary": { "value": "{color.raw.orange-100}", "light": "{color.raw.orange-100}" },
|
|
36
|
+
"primary-hover": { "value": "{color.raw.orange-200}", "light": "{color.raw.orange-300}" },
|
|
37
|
+
"primary-foreground": { "value": "{color.raw.teal-1000}", "light": "{color.raw.beige-50}" },
|
|
38
|
+
"border": { "value": "{color.raw.teal-700}", "light": "{color.raw.beige-300}" },
|
|
39
|
+
"border-muted": { "value": "{color.raw.teal-800}", "light": "{color.raw.beige-200}" },
|
|
40
|
+
"input": { "value": "{color.raw.teal-800}", "light": "{color.raw.beige-100}" },
|
|
41
|
+
"ring": { "value": "{color.raw.orange-200}", "light": "{color.raw.orange-200}" },
|
|
42
|
+
"success": { "value": "{color.raw.green-500}", "light": "{color.raw.green-500}" },
|
|
43
|
+
"error": { "value": "{color.raw.red-500}", "light": "{color.raw.red-500}" },
|
|
44
|
+
"warning": { "value": "{color.raw.yellow-500}", "light": "{color.raw.yellow-500}" },
|
|
45
|
+
"info": { "value": "{color.raw.blue-500}", "light": "{color.raw.blue-500}" },
|
|
46
|
+
|
|
47
|
+
"card": { "value": "{color.raw.teal-900}", "light": "{color.raw.beige-50}" },
|
|
48
|
+
"card-foreground": { "value": "{color.raw.beige-200}", "light": "{color.raw.teal-900}" },
|
|
49
|
+
"popover": { "value": "{color.raw.teal-900}", "light": "{color.raw.beige-50}" },
|
|
50
|
+
"popover-foreground": { "value": "{color.raw.beige-200}", "light": "{color.raw.teal-900}" },
|
|
51
|
+
"muted": { "value": "{color.raw.teal-800}", "light": "{color.raw.beige-100}" },
|
|
52
|
+
"muted-foreground": { "value": "{color.raw.teal-400}", "light": "{color.raw.teal-500}" },
|
|
53
|
+
"secondary": { "value": "{color.raw.teal-800}", "light": "{color.raw.beige-100}" },
|
|
54
|
+
"secondary-foreground": { "value": "{color.raw.beige-200}", "light": "{color.raw.teal-900}" },
|
|
55
|
+
"accent": { "value": "{color.raw.orange-100}", "light": "{color.raw.orange-100}" },
|
|
56
|
+
"accent-foreground": { "value": "{color.raw.teal-1000}", "light": "{color.raw.beige-50}" },
|
|
57
|
+
"destructive": { "value": "{color.raw.red-500}", "light": "{color.raw.red-500}" },
|
|
58
|
+
"destructive-foreground": { "value": "{color.raw.beige-50}", "light": "{color.raw.beige-50}" }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"typography": {
|
|
62
|
+
"fontFamily": {
|
|
63
|
+
"display": { "value": "\"Geist\", \"Geist Fallback\", ui-sans-serif, system-ui, sans-serif" },
|
|
64
|
+
"body": { "value": "\"Geist\", \"Geist Fallback\", ui-sans-serif, system-ui, sans-serif" },
|
|
65
|
+
"mono": { "value": "\"Geist Mono\", \"Geist Mono Fallback\", ui-monospace, SFMono-Regular, Menlo, monospace" }
|
|
66
|
+
},
|
|
67
|
+
"scale": {
|
|
68
|
+
"display": { "fontSize": "clamp(56px, 12vw, 180px)", "fontWeight": 700, "lineHeight": 1, "letterSpacing": "-0.03em" },
|
|
69
|
+
"hero": { "fontSize": "clamp(40px, 8.5vw, 96px)", "fontWeight": 700, "lineHeight": 1, "letterSpacing": "-0.03em" },
|
|
70
|
+
"h2": { "fontSize": "clamp(30px, 4vw, 48px)", "fontWeight": 600, "lineHeight": 1.1, "letterSpacing": "-0.025em" },
|
|
71
|
+
"h3": { "fontSize": "36px", "fontWeight": 600, "lineHeight": 1.15, "letterSpacing": "-0.02em" },
|
|
72
|
+
"h4": { "fontSize": "30px", "fontWeight": 600, "lineHeight": 1.2, "letterSpacing": "-0.02em" },
|
|
73
|
+
"h5": { "fontSize": "24px", "fontWeight": 600, "lineHeight": 1.2, "letterSpacing": "-0.015em" },
|
|
74
|
+
"h6": { "fontSize": "18px", "fontWeight": 600, "lineHeight": 1.3, "letterSpacing": "-0.015em" },
|
|
75
|
+
"body": { "fontSize": "16px", "fontWeight": 400, "lineHeight": 1.5, "letterSpacing": "0" },
|
|
76
|
+
"body-sm": { "fontSize": "14px", "fontWeight": 400, "lineHeight": 1.5, "letterSpacing": "0" },
|
|
77
|
+
"label": { "fontSize": "12px", "fontWeight": 500, "lineHeight": 1.3, "letterSpacing": "0.01em" },
|
|
78
|
+
"badge": { "fontSize": "14px", "fontWeight": 600, "lineHeight": 1.3, "letterSpacing": "0.025em", "textTransform": "uppercase" },
|
|
79
|
+
"meta": { "fontSize": "11px", "fontWeight": 400, "lineHeight": 1.3, "letterSpacing": "0.05em" },
|
|
80
|
+
"code": { "fontSize": "13px", "fontWeight": 400, "lineHeight": 1.5, "letterSpacing": "0" }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"spacing": {
|
|
84
|
+
"1": { "value": "4px" },
|
|
85
|
+
"2": { "value": "8px" },
|
|
86
|
+
"3": { "value": "12px" },
|
|
87
|
+
"4": { "value": "16px" },
|
|
88
|
+
"5": { "value": "20px" },
|
|
89
|
+
"6": { "value": "24px" },
|
|
90
|
+
"8": { "value": "32px" },
|
|
91
|
+
"10": { "value": "40px" },
|
|
92
|
+
"12": { "value": "48px" },
|
|
93
|
+
"16": { "value": "64px" },
|
|
94
|
+
"20": { "value": "80px" },
|
|
95
|
+
"24": { "value": "96px" }
|
|
96
|
+
},
|
|
97
|
+
"radius": {
|
|
98
|
+
"base": { "value": "0rem", "description": "Brutalist zero radius — sharp corners by default" }
|
|
99
|
+
},
|
|
100
|
+
"shadow": {
|
|
101
|
+
"sm": { "value": "0 1px 2px 0 rgb(0 0 0 / 0.3)" },
|
|
102
|
+
"md": { "value": "0 4px 12px 0 rgb(0 0 0 / 0.25)" },
|
|
103
|
+
"lg": { "value": "0 8px 24px 0 rgb(0 0 0 / 0.35)" },
|
|
104
|
+
"xl": { "value": "0 20px 25px -5px rgb(0 0 0 / 0.4)" },
|
|
105
|
+
"popover": { "value": "0 0 0 1px rgb(0 0 0 / 0.2), 0 3px 6px 0 rgb(0 0 0 / 0.25), 0 9px 24px 0 rgb(0 0 0 / 0.35)" }
|
|
106
|
+
},
|
|
107
|
+
"motion": {
|
|
108
|
+
"easing": {
|
|
109
|
+
"default": { "value": "cubic-bezier(0.4, 0, 0.2, 1)" },
|
|
110
|
+
"out": { "value": "cubic-bezier(0, 0, 0.2, 1)" },
|
|
111
|
+
"in-out": { "value": "cubic-bezier(0.4, 0, 0.2, 1)" },
|
|
112
|
+
"linear": { "value": "linear" }
|
|
113
|
+
},
|
|
114
|
+
"duration": {
|
|
115
|
+
"fast": { "value": "100ms" },
|
|
116
|
+
"base": { "value": "150ms" },
|
|
117
|
+
"medium": { "value": "250ms" },
|
|
118
|
+
"slow": { "value": "500ms" }
|
|
119
|
+
},
|
|
120
|
+
"keyframes": {
|
|
121
|
+
"blink": {
|
|
122
|
+
"0%, 90%, 100%": { "opacity": "0" },
|
|
123
|
+
"95%": { "opacity": "1" }
|
|
124
|
+
},
|
|
125
|
+
"delayed-fade-in": {
|
|
126
|
+
"0%": { "opacity": "0" },
|
|
127
|
+
"100%": { "opacity": "1" }
|
|
128
|
+
},
|
|
129
|
+
"slide-pattern": {
|
|
130
|
+
"from": { "backgroundPosition": "0 0" },
|
|
131
|
+
"to": { "backgroundPosition": "40px 0" }
|
|
132
|
+
},
|
|
133
|
+
"scale-in": {
|
|
134
|
+
"from": { "opacity": "0", "transform": "scale(0.95)" },
|
|
135
|
+
"to": { "opacity": "1", "transform": "scale(1)" }
|
|
136
|
+
},
|
|
137
|
+
"scale-out": {
|
|
138
|
+
"from": { "opacity": "1", "transform": "scale(1)" },
|
|
139
|
+
"to": { "opacity": "0", "transform": "scale(0.95)" }
|
|
140
|
+
},
|
|
141
|
+
"rise-in": {
|
|
142
|
+
"from": { "opacity": "0", "transform": "translateY(24px)" },
|
|
143
|
+
"to": { "opacity": "1", "transform": "translateY(0)" }
|
|
144
|
+
},
|
|
145
|
+
"enter-right": {
|
|
146
|
+
"from": { "opacity": "0", "transform": "translateX(40px)" },
|
|
147
|
+
"to": { "opacity": "1", "transform": "translateX(0)" }
|
|
148
|
+
},
|
|
149
|
+
"enter-left": {
|
|
150
|
+
"from": { "opacity": "0", "transform": "translateX(-40px)" },
|
|
151
|
+
"to": { "opacity": "1", "transform": "translateX(0)" }
|
|
152
|
+
},
|
|
153
|
+
"fade-in": {
|
|
154
|
+
"from": { "opacity": "0" },
|
|
155
|
+
"to": { "opacity": "1" }
|
|
156
|
+
},
|
|
157
|
+
"spin": {
|
|
158
|
+
"to": { "transform": "rotate(360deg)" }
|
|
159
|
+
},
|
|
160
|
+
"shimmer": {
|
|
161
|
+
"0%": { "backgroundPosition": "-200% 0" },
|
|
162
|
+
"100%": { "backgroundPosition": "200% 0" }
|
|
163
|
+
},
|
|
164
|
+
"slide-in-right": {
|
|
165
|
+
"from": { "transform": "translateX(100%)", "opacity": "0" },
|
|
166
|
+
"to": { "transform": "translateX(0)", "opacity": "1" }
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"animation": {
|
|
170
|
+
"blink": { "value": "blink 3s ease-in-out infinite" },
|
|
171
|
+
"delayed-fade-in": { "value": "delayed-fade-in 100ms ease-out forwards" },
|
|
172
|
+
"slide-pattern": { "value": "slide-pattern 2s linear infinite" },
|
|
173
|
+
"scale-in": { "value": "scale-in 175ms cubic-bezier(0, 0, 0.2, 1)" },
|
|
174
|
+
"scale-out": { "value": "scale-out 175ms cubic-bezier(0, 0, 0.2, 1)" },
|
|
175
|
+
"rise-in": { "value": "rise-in 700ms cubic-bezier(0, 0, 0.2, 1)" },
|
|
176
|
+
"enter-right": { "value": "enter-right 500ms cubic-bezier(0, 0, 0.2, 1)" },
|
|
177
|
+
"enter-left": { "value": "enter-left 500ms cubic-bezier(0, 0, 0.2, 1)" },
|
|
178
|
+
"fade-in": { "value": "fade-in 300ms ease-out" },
|
|
179
|
+
"spin": { "value": "spin 1s linear infinite" },
|
|
180
|
+
"shimmer": { "value": "shimmer 2s linear infinite" },
|
|
181
|
+
"slide-in-right": { "value": "slide-in-right 300ms cubic-bezier(0, 0, 0.2, 1)" }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"zIndex": {
|
|
185
|
+
"base": { "value": "1" },
|
|
186
|
+
"dropdown": { "value": "10" },
|
|
187
|
+
"sticky": { "value": "20" },
|
|
188
|
+
"overlay": { "value": "40" },
|
|
189
|
+
"header": { "value": "60" },
|
|
190
|
+
"modal": { "value": "80" },
|
|
191
|
+
"toast": { "value": "100" }
|
|
192
|
+
}
|
|
193
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
9
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAoBjE,QAAA,MAAM,KAAK;;sHAUT,CAAA;AAGF,QAAA,MAAM,UAAU,uHASd,CAAA;AAGF,QAAA,MAAM,gBAAgB,yHASpB,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA"}
|
package/dist/ui/alert.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
const alertVariants = cva("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-background text-foreground",
|
|
9
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "default",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
const Alert = React.forwardRef(({ className, variant, ...props }, ref) => (_jsx("div", { ref: ref, role: "alert", className: cn(alertVariants({ variant }), className), ...props })));
|
|
17
|
+
Alert.displayName = "Alert";
|
|
18
|
+
const AlertTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("h5", { ref: ref, className: cn("mb-1 font-medium leading-none tracking-tight", className), ...props })));
|
|
19
|
+
AlertTitle.displayName = "AlertTitle";
|
|
20
|
+
const AlertDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm [&_p]:leading-relaxed", className), ...props })));
|
|
21
|
+
AlertDescription.displayName = "AlertDescription";
|
|
22
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
10
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,aAAa;;8EAkBlB,CAAA;AAED,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAEzC,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAI1D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/ui/badge.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
const badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
8
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
9
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
10
|
+
outline: "text-foreground",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
function Badge({ className, variant, ...props }) {
|
|
18
|
+
return (_jsx("div", { className: cn(badgeVariants({ variant }), className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "secondary" | "ghost" | "destructive" | "outline" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button, buttonVariants };
|
|
12
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EA2BnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
const buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
10
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
11
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-10 px-4 py-2",
|
|
18
|
+
sm: "h-9 rounded-md px-3",
|
|
19
|
+
lg: "h-11 rounded-md px-8",
|
|
20
|
+
icon: "h-10 w-10",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default",
|
|
25
|
+
size: "default",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const Button = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
29
|
+
const Comp = asChild ? Slot : "button";
|
|
30
|
+
return (_jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props }));
|
|
31
|
+
});
|
|
32
|
+
Button.displayName = "Button";
|
|
33
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
9
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,IAAI,6GAYR,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,QAAA,MAAM,SAAS,6GAYb,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAKf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/ui/card.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
const Card = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className), ...props })));
|
|
5
|
+
Card.displayName = "Card";
|
|
6
|
+
const CardHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className), ...props })));
|
|
7
|
+
CardHeader.displayName = "CardHeader";
|
|
8
|
+
const CardTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-2xl font-semibold leading-none tracking-tight", className), ...props })));
|
|
9
|
+
CardTitle.displayName = "CardTitle";
|
|
10
|
+
const CardDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
11
|
+
CardDescription.displayName = "CardDescription";
|
|
12
|
+
const CardContent = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("p-6 pt-0", className), ...props })));
|
|
13
|
+
CardContent.displayName = "CardContent";
|
|
14
|
+
const CardFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center p-6 pt-0", className), ...props })));
|
|
15
|
+
CardFooter.displayName = "CardFooter";
|
|
16
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
|
5
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/ui/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAA;AAK7D,QAAA,MAAM,QAAQ,iKAkBZ,CAAA;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Check } from "lucide-react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
const Checkbox = React.forwardRef(({ className, ...props }, ref) => (_jsx(CheckboxPrimitive.Root, { ref: ref, className: cn("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { className: cn("grid place-content-center text-current"), children: _jsx(Check, { className: "h-4 w-4" }) }) })));
|
|
7
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8
|
+
export { Checkbox };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
20
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/ui/dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,QAAA,MAAM,MAAM,uCAAuB,CAAA;AAEnC,QAAA,MAAM,aAAa,8GAA0B,CAAA;AAE7C,QAAA,MAAM,YAAY,6CAAyB,CAAA;AAE3C,QAAA,MAAM,WAAW,4GAAwB,CAAA;AAEzC,QAAA,MAAM,aAAa,8JAYjB,CAAA;AAGF,QAAA,MAAM,aAAa,8JAqBjB,CAAA;AAGF,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,YAAY;8BAGf,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;CAQtC,CAAA;AAGD,QAAA,MAAM,WAAW,oKAYf,CAAA;AAGF,QAAA,MAAM,iBAAiB,8KASrB,CAAA;AAGF,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { X } from "lucide-react";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
9
|
+
const DialogClose = DialogPrimitive.Close;
|
|
10
|
+
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
|
|
11
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
12
|
+
const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(X, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
|
|
13
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
14
|
+
const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
|
|
15
|
+
DialogHeader.displayName = "DialogHeader";
|
|
16
|
+
const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
|
|
17
|
+
DialogFooter.displayName = "DialogFooter";
|
|
18
|
+
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
|
|
19
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
20
|
+
const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
|
|
21
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
22
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
28
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAKtE,QAAA,MAAM,YAAY,mDAA6B,CAAA;AAE/C,QAAA,MAAM,mBAAmB,0HAAgC,CAAA;AAEzD,QAAA,MAAM,iBAAiB,qHAA8B,CAAA;AAErD,QAAA,MAAM,kBAAkB,yDAA+B,CAAA;AAEvD,QAAA,MAAM,eAAe,sDAA4B,CAAA;AAEjD,QAAA,MAAM,sBAAsB,0HAAmC,CAAA;AAE/D,QAAA,MAAM,sBAAsB;YAGhB,OAAO;wCAejB,CAAA;AAIF,QAAA,MAAM,sBAAsB,6KAY1B,CAAA;AAIF,QAAA,MAAM,mBAAmB,0KAevB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAGV,OAAO;wCAYjB,CAAA;AAGF,QAAA,MAAM,wBAAwB,+KAoB5B,CAAA;AAIF,QAAA,MAAM,qBAAqB,4KAmBzB,CAAA;AAGF,QAAA,MAAM,iBAAiB;YAGX,OAAO;wCAYjB,CAAA;AAGF,QAAA,MAAM,qBAAqB,4KASzB,CAAA;AAGF,QAAA,MAAM,oBAAoB;8BAGvB,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;;CAOvC,CAAA;AAGD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
8
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
9
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
10
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
11
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
12
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
13
|
+
const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto" })] })));
|
|
14
|
+
DropdownMenuSubTrigger.displayName =
|
|
15
|
+
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
16
|
+
const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className), ...props })));
|
|
17
|
+
DropdownMenuSubContent.displayName =
|
|
18
|
+
DropdownMenuPrimitive.SubContent.displayName;
|
|
19
|
+
const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className), ...props }) })));
|
|
20
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
21
|
+
const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props })));
|
|
22
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
23
|
+
const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
24
|
+
DropdownMenuCheckboxItem.displayName =
|
|
25
|
+
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
26
|
+
const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
27
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
28
|
+
const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
|
|
29
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
30
|
+
const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
|
|
31
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
32
|
+
const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
33
|
+
return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
|
|
34
|
+
};
|
|
35
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
36
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const useFormField: () => {
|
|
7
|
+
invalid: boolean;
|
|
8
|
+
isDirty: boolean;
|
|
9
|
+
isTouched: boolean;
|
|
10
|
+
isValidating: boolean;
|
|
11
|
+
error?: import("react-hook-form").FieldError;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
formItemId: string;
|
|
15
|
+
formDescriptionId: string;
|
|
16
|
+
formMessageId: string;
|
|
17
|
+
};
|
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
24
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/ui/form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAKxB,QAAA,MAAM,IAAI,4MAAe,CAAA;AAWzB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAyBjB,CAAA;AAQD,QAAA,MAAM,QAAQ,6GAWZ,CAAA;AAGF,QAAA,MAAM,SAAS,yJAcb,CAAA;AAGF,QAAA,MAAM,WAAW,8JAmBf,CAAA;AAGF,QAAA,MAAM,eAAe,yHAcnB,CAAA;AAGF,QAAA,MAAM,WAAW,yHAqBf,CAAA;AAGF,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/dist/ui/form.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { Controller, FormProvider, useFormContext, } from "react-hook-form";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
import { Label } from "@/ui/label";
|
|
7
|
+
const Form = FormProvider;
|
|
8
|
+
const FormFieldContext = React.createContext(null);
|
|
9
|
+
const FormField = ({ ...props }) => {
|
|
10
|
+
return (_jsx(FormFieldContext.Provider, { value: { name: props.name }, children: _jsx(Controller, { ...props }) }));
|
|
11
|
+
};
|
|
12
|
+
const useFormField = () => {
|
|
13
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
14
|
+
const itemContext = React.useContext(FormItemContext);
|
|
15
|
+
const { getFieldState, formState } = useFormContext();
|
|
16
|
+
if (!fieldContext) {
|
|
17
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
18
|
+
}
|
|
19
|
+
if (!itemContext) {
|
|
20
|
+
throw new Error("useFormField should be used within <FormItem>");
|
|
21
|
+
}
|
|
22
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
23
|
+
const { id } = itemContext;
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
name: fieldContext.name,
|
|
27
|
+
formItemId: `${id}-form-item`,
|
|
28
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
29
|
+
formMessageId: `${id}-form-item-message`,
|
|
30
|
+
...fieldState,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const FormItemContext = React.createContext(null);
|
|
34
|
+
const FormItem = React.forwardRef(({ className, ...props }, ref) => {
|
|
35
|
+
const id = React.useId();
|
|
36
|
+
return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { ref: ref, className: cn("space-y-2", className), ...props }) }));
|
|
37
|
+
});
|
|
38
|
+
FormItem.displayName = "FormItem";
|
|
39
|
+
const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
|
|
40
|
+
const { error, formItemId } = useFormField();
|
|
41
|
+
return (_jsx(Label, { ref: ref, className: cn(error && "text-destructive", className), htmlFor: formItemId, ...props }));
|
|
42
|
+
});
|
|
43
|
+
FormLabel.displayName = "FormLabel";
|
|
44
|
+
const FormControl = React.forwardRef(({ ...props }, ref) => {
|
|
45
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
46
|
+
return (_jsx(Slot, { ref: ref, id: formItemId, "aria-describedby": !error
|
|
47
|
+
? `${formDescriptionId}`
|
|
48
|
+
: `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
|
|
49
|
+
});
|
|
50
|
+
FormControl.displayName = "FormControl";
|
|
51
|
+
const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
52
|
+
const { formDescriptionId } = useFormField();
|
|
53
|
+
return (_jsx("p", { ref: ref, id: formDescriptionId, className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
54
|
+
});
|
|
55
|
+
FormDescription.displayName = "FormDescription";
|
|
56
|
+
const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
|
|
57
|
+
const { error, formMessageId } = useFormField();
|
|
58
|
+
const body = error ? String(error?.message ?? "") : children;
|
|
59
|
+
if (!body) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return (_jsx("p", { ref: ref, id: formMessageId, className: cn("text-sm font-medium text-destructive", className), ...props, children: body }));
|
|
63
|
+
});
|
|
64
|
+
FormMessage.displayName = "FormMessage";
|
|
65
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
export { Input };
|
|
4
|
+
//# sourceMappingURL=input.d.ts.map
|