@coston/ui 0.1.1 → 0.2.2
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 +75 -10
- package/dist/{button-CJvoztqg.js → button-BJdMtkHX.js} +3 -3
- package/dist/button-BJdMtkHX.js.map +1 -0
- package/dist/{button-QxkOGnNm.d.ts → button-CyD56dqi.d.ts} +5 -5
- package/dist/{button-QxkOGnNm.d.ts.map → button-CyD56dqi.d.ts.map} +1 -1
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/accordion.js +4 -4
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +3 -3
- package/dist/components/alert-dialog.d.ts.map +1 -1
- package/dist/components/alert-dialog.js +5 -5
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +2 -2
- package/dist/components/alert.js +3 -3
- package/dist/components/alert.js.map +1 -1
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +5 -5
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +4 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +3 -3
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.d.ts +2 -2
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.d.ts +4 -1
- package/dist/components/card.d.ts.map +1 -1
- package/dist/components/card.js +5 -5
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.d.ts +1 -1
- package/dist/components/carousel.js +2 -2
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.d.ts.map +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/command.d.ts +75 -10
- package/dist/components/command.d.ts.map +1 -1
- package/dist/components/command.js +3 -3
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.d.ts +2 -2
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +3 -3
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.d.ts +3 -3
- package/dist/components/dialog.js +2 -2
- package/dist/components/drawer.d.ts +13 -11
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +3 -3
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/hover-card.js +2 -2
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.d.ts +3 -3
- package/dist/components/menubar.js +4 -4
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.d.ts +7 -7
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.js +2 -2
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js +2 -2
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/resizable.d.ts +5 -5
- package/dist/components/resizable.d.ts.map +1 -1
- package/dist/components/resizable.js +4 -4
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +2 -2
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +2 -2
- package/dist/components/sheet.d.ts +6 -6
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +8 -8
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +5 -5
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +3 -3
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.d.ts +2 -2
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/switch.js +3 -3
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +2 -2
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +3 -3
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.js +2 -2
- package/dist/{dialog-B_8jhMOs.js → dialog-COSqOqbH.js} +6 -6
- package/dist/dialog-COSqOqbH.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +2 -2
- package/dist/{separator-9lzFsfCC.js → separator-C3mBJ8ik.js} +2 -2
- package/dist/{separator-9lzFsfCC.js.map → separator-C3mBJ8ik.js.map} +1 -1
- package/dist/{toggle-BpKiTVe4.js → toggle-CD9xIRlr.js} +3 -3
- package/dist/toggle-CD9xIRlr.js.map +1 -0
- package/dist/{tooltip-CXS6wR7g.js → tooltip-PxI7r4yP.js} +3 -3
- package/dist/tooltip-PxI7r4yP.js.map +1 -0
- package/dist/{utils-C0f9Ma6r.js → utils-CyPJ3VV3.js} +3 -2
- package/dist/utils-CyPJ3VV3.js.map +1 -0
- package/llms.txt +989 -0
- package/package.json +52 -14
- package/source.css +40 -0
- package/dist/button-CJvoztqg.js.map +0 -1
- package/dist/dialog-B_8jhMOs.js.map +0 -1
- package/dist/toggle-BpKiTVe4.js.map +0 -1
- package/dist/tooltip-CXS6wR7g.js.map +0 -1
- package/dist/utils-C0f9Ma6r.js.map +0 -1
- package/src/components/accordion.tsx +0 -51
- package/src/components/alert-dialog.tsx +0 -115
- package/src/components/alert.tsx +0 -49
- package/src/components/aspect-ratio.tsx +0 -5
- package/src/components/avatar.tsx +0 -44
- package/src/components/badge.tsx +0 -32
- package/src/components/breadcrumb.tsx +0 -101
- package/src/components/button.tsx +0 -48
- package/src/components/calendar.tsx +0 -76
- package/src/components/card.tsx +0 -60
- package/src/components/carousel.tsx +0 -240
- package/src/components/chart.tsx +0 -232
- package/src/components/checkbox.tsx +0 -25
- package/src/components/collapsible.tsx +0 -11
- package/src/components/command.tsx +0 -136
- package/src/components/context-menu.tsx +0 -187
- package/src/components/dialog.tsx +0 -105
- package/src/components/drawer.tsx +0 -98
- package/src/components/dropdown-menu.tsx +0 -185
- package/src/components/hover-card.tsx +0 -29
- package/src/components/input.tsx +0 -24
- package/src/components/label.tsx +0 -19
- package/src/components/menubar.tsx +0 -219
- package/src/components/navigation-menu.tsx +0 -120
- package/src/components/pagination.tsx +0 -98
- package/src/components/popover.tsx +0 -27
- package/src/components/progress.tsx +0 -23
- package/src/components/radio-group.tsx +0 -35
- package/src/components/resizable.tsx +0 -38
- package/src/components/scroll-area.tsx +0 -43
- package/src/components/select.tsx +0 -147
- package/src/components/separator.tsx +0 -23
- package/src/components/sheet.tsx +0 -122
- package/src/components/sidebar.tsx +0 -507
- package/src/components/skeleton.tsx +0 -7
- package/src/components/slider.tsx +0 -23
- package/src/components/sonner.tsx +0 -26
- package/src/components/switch.tsx +0 -26
- package/src/components/table.tsx +0 -95
- package/src/components/tabs.tsx +0 -53
- package/src/components/textarea.tsx +0 -20
- package/src/components/toggle-group.tsx +0 -54
- package/src/components/toggle.tsx +0 -40
- package/src/components/tooltip.tsx +0 -27
- package/src/hooks/use-mobile.tsx +0 -19
- package/src/lib/utils.ts +0 -6
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coston/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "React UI component library built on Radix UI and Tailwind CSS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
8
|
+
"./source.css": "./source.css",
|
|
8
9
|
"./lib/utils": {
|
|
9
10
|
"types": "./dist/lib/utils.d.ts",
|
|
10
11
|
"default": "./dist/lib/utils.js"
|
|
@@ -20,7 +21,8 @@
|
|
|
20
21
|
},
|
|
21
22
|
"files": [
|
|
22
23
|
"dist",
|
|
23
|
-
"
|
|
24
|
+
"source.css",
|
|
25
|
+
"llms.txt"
|
|
24
26
|
],
|
|
25
27
|
"scripts": {
|
|
26
28
|
"build": "tsdown",
|
|
@@ -28,27 +30,34 @@
|
|
|
28
30
|
"test": "vitest run",
|
|
29
31
|
"test:watch": "vitest",
|
|
30
32
|
"test:coverage": "vitest run --coverage",
|
|
31
|
-
"lint": "eslint 'src/**/*.{ts,tsx}'
|
|
32
|
-
"lint:fix": "eslint 'src/**/*.{ts,tsx}'
|
|
33
|
-
"format": "prettier --write 'src/**/*.{ts,tsx}'
|
|
34
|
-
"format:check": "prettier --check 'src/**/*.{ts,tsx}'
|
|
33
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
34
|
+
"lint:fix": "eslint 'src/**/*.{ts,tsx}' --fix",
|
|
35
|
+
"format": "prettier --write 'src/**/*.{ts,tsx}'",
|
|
36
|
+
"format:check": "prettier --check 'src/**/*.{ts,tsx}'",
|
|
35
37
|
"type-check": "tsc --noEmit",
|
|
36
38
|
"prepare": "[ -d .git ] && husky || npm run build",
|
|
37
|
-
"prepublishOnly": "npm run build && npm test"
|
|
39
|
+
"prepublishOnly": "npm run build && npm test",
|
|
40
|
+
"demo": "npm run build && cd demo && npm run dev",
|
|
41
|
+
"demo:build": "npm run build && cd demo && npm run build",
|
|
42
|
+
"knip": "knip"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
45
|
+
"@coston/design-tokens": ">=0.1.0",
|
|
46
|
+
"cmdk": "^1.0.0",
|
|
47
|
+
"date-fns": "^4.0.0",
|
|
48
|
+
"embla-carousel-react": "^8.0.0",
|
|
40
49
|
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
+
"react-day-picker": "^9.0.0",
|
|
41
51
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
52
|
+
"react-resizable-panels": "^4.0.0",
|
|
42
53
|
"recharts": "^3.0.0",
|
|
43
|
-
"embla-carousel-react": "^8.0.0",
|
|
44
54
|
"sonner": "^2.0.0",
|
|
45
|
-
"vaul": "^1.0.0"
|
|
46
|
-
"cmdk": "^1.0.0",
|
|
47
|
-
"react-resizable-panels": "^4.0.0",
|
|
48
|
-
"react-day-picker": "^9.0.0",
|
|
49
|
-
"date-fns": "^4.0.0"
|
|
55
|
+
"vaul": "^1.0.0"
|
|
50
56
|
},
|
|
51
57
|
"peerDependenciesMeta": {
|
|
58
|
+
"@coston/design-tokens": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
52
61
|
"recharts": {
|
|
53
62
|
"optional": true
|
|
54
63
|
},
|
|
@@ -116,17 +125,26 @@
|
|
|
116
125
|
"@types/react": "^18.3.0",
|
|
117
126
|
"@types/react-dom": "^18.3.0",
|
|
118
127
|
"@vitest/coverage-v8": "^1.6.1",
|
|
128
|
+
"cmdk": "^1.1.1",
|
|
129
|
+
"date-fns": "^4.1.0",
|
|
130
|
+
"embla-carousel-react": "^8.6.0",
|
|
119
131
|
"eslint": "^9.39.3",
|
|
120
132
|
"eslint-config-prettier": "^10.1.8",
|
|
121
133
|
"husky": "^9.1.7",
|
|
122
134
|
"jsdom": "^26.1.0",
|
|
135
|
+
"knip": "^6.6.1",
|
|
123
136
|
"lint-staged": "^16.2.7",
|
|
124
137
|
"prettier": "^3.8.1",
|
|
125
138
|
"react": "^18.3.1",
|
|
139
|
+
"react-day-picker": "^9.14.0",
|
|
126
140
|
"react-dom": "^18.3.1",
|
|
141
|
+
"react-resizable-panels": "^4.10.0",
|
|
142
|
+
"recharts": "^3.8.1",
|
|
143
|
+
"sonner": "^2.0.7",
|
|
127
144
|
"tsdown": "^0.12.0",
|
|
128
145
|
"typescript": "^5.3.3",
|
|
129
146
|
"typescript-eslint": "^8.56.1",
|
|
147
|
+
"vaul": "^1.1.2",
|
|
130
148
|
"vitest": "^1.2.0"
|
|
131
149
|
},
|
|
132
150
|
"lint-staged": {
|
|
@@ -164,5 +182,25 @@
|
|
|
164
182
|
"url": "https://github.com/coston/ui/issues"
|
|
165
183
|
},
|
|
166
184
|
"author": "coston",
|
|
167
|
-
"license": "MIT"
|
|
185
|
+
"license": "MIT",
|
|
186
|
+
"publishConfig": {
|
|
187
|
+
"access": "public"
|
|
188
|
+
},
|
|
189
|
+
"knip": {
|
|
190
|
+
"entry": [
|
|
191
|
+
"src/components/**/*.{ts,tsx}",
|
|
192
|
+
"src/lib/*.ts",
|
|
193
|
+
"src/hooks/*.{ts,tsx}"
|
|
194
|
+
],
|
|
195
|
+
"project": [
|
|
196
|
+
"src/**/*.{ts,tsx}"
|
|
197
|
+
],
|
|
198
|
+
"ignore": [
|
|
199
|
+
"demo/**"
|
|
200
|
+
],
|
|
201
|
+
"ignoreDependencies": [
|
|
202
|
+
"@commitlint/config-conventional",
|
|
203
|
+
"date-fns"
|
|
204
|
+
]
|
|
205
|
+
}
|
|
168
206
|
}
|
package/source.css
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@source "./src/**/*.tsx";
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
/* Duration tokens */
|
|
5
|
+
--duration-instant: 100ms;
|
|
6
|
+
--duration-fast: 150ms;
|
|
7
|
+
--duration-standard: 200ms;
|
|
8
|
+
--duration-slow: 300ms;
|
|
9
|
+
--duration-slower: 500ms;
|
|
10
|
+
|
|
11
|
+
/* Easing tokens */
|
|
12
|
+
--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
13
|
+
--ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
|
|
14
|
+
--ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
|
|
15
|
+
--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
16
|
+
|
|
17
|
+
/* Accordion animations — referenced in accordion.tsx */
|
|
18
|
+
--animate-accordion-down: accordion-down var(--duration-standard) var(--ease-decelerate);
|
|
19
|
+
--animate-accordion-up: accordion-up var(--duration-standard) var(--ease-accelerate);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@keyframes accordion-down {
|
|
23
|
+
from { height: 0; opacity: 0; }
|
|
24
|
+
to { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes accordion-up {
|
|
28
|
+
from { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
29
|
+
to { height: 0; opacity: 0; }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Respect user's motion preferences */
|
|
33
|
+
@media (prefers-reduced-motion: reduce) {
|
|
34
|
+
*,
|
|
35
|
+
*::before,
|
|
36
|
+
*::after {
|
|
37
|
+
animation-duration: 0.01ms !important;
|
|
38
|
+
transition-duration: 0.01ms !important;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-CJvoztqg.js","names":[],"sources":["../src/components/button.tsx"],"sourcesContent":["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 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',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-10 px-4 py-2',\n sm: 'h-9 rounded-md px-3',\n lg: 'h-11 rounded-md px-8',\n icon: 'h-10 w-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n );\n }\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;AAMA,MAAM,iBAAiB,IACrB,gSACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,aAAa;GACb,SAAS;GACT,WAAW;GACX,OAAO;GACP,MAAM;EACP;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;EACP;CACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;CACP;AACF,EACF;AAOD,MAAM,SAAS,MAAM,WACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,MAAO,GAAG,OAAO,EAAE,QAAQ;CAChE,MAAM,OAAO,UAAU,OAAO;AAC9B,wBACE,IAAC;EAAK,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;EAAW,EAAC,CAAC;EAAO;EAAK,GAAI;GAAS;AAE7F,EACF;AACD,OAAO,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-B_8jhMOs.js","names":[],"sources":["../src/components/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from 'lucide-react';\n\nimport { cn } from '../lib/utils';\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-popover 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',\n className\n )}\n {...props}\n >\n {children}\n <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\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight text-popover-foreground',\n className\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;;AAMA,MAAM,SAAS,gBAAgB;AAE/B,MAAM,gBAAgB,gBAAgB;AAEtC,MAAM,eAAe,gBAAgB;AAErC,MAAM,cAAc,gBAAgB;AAEpC,MAAM,gBAAgB,MAAM,WAG1B,CAAC,EAAE,UAAW,GAAG,OAAO,EAAE,wBAC1B,IAAC,gBAAgB;CACV;CACL,WAAW,GACT,gLACA,UACD;CACD,GAAI;EACJ,CACF;AACF,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,MAAM,gBAAgB,MAAM,WAG1B,CAAC,EAAE,WAAW,SAAU,GAAG,OAAO,EAAE,wBACpC,KAAC,2CACC,IAAC,kBAAgB,kBACjB,KAAC,gBAAgB;CACV;CACL,WAAW,GACT,0gBACA,UACD;CACD,GAAI;YAEH,0BACD,KAAC,gBAAgB;EAAM,WAAU;6BAC/B,IAAC,KAAE,WAAU,YAAY,kBACzB,IAAC;GAAK,WAAU;aAAU;IAAY;GAChB;EACA,IACb,CACf;AACF,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,MAAM,eAAe,CAAC,EAAE,UAAW,GAAG,OAA6C,qBACjF,IAAC;CAAI,WAAW,GAAG,sDAAsD,UAAU;CAAE,GAAI;EAAS;AAEpG,aAAa,cAAc;AAE3B,MAAM,eAAe,CAAC,EAAE,UAAW,GAAG,OAA6C,qBACjF,IAAC;CACC,WAAW,GAAG,iEAAiE,UAAU;CACzF,GAAI;EACJ;AAEJ,aAAa,cAAc;AAE3B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,UAAW,GAAG,OAAO,EAAE,wBAC1B,IAAC,gBAAgB;CACV;CACL,WAAW,GACT,6EACA,UACD;CACD,GAAI;EACJ,CACF;AACF,YAAY,cAAc,gBAAgB,MAAM;AAEhD,MAAM,oBAAoB,MAAM,WAG9B,CAAC,EAAE,UAAW,GAAG,OAAO,EAAE,wBAC1B,IAAC,gBAAgB;CACV;CACL,WAAW,GAAG,iCAAiC,UAAU;CACzD,GAAI;EACJ,CACF;AACF,kBAAkB,cAAc,gBAAgB,YAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-BpKiTVe4.js","names":[],"sources":["../src/components/toggle.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n outline: 'border border-input bg-transparent hover:bg-accent hover:text-accent-foreground',\n },\n size: {\n default: 'h-10 px-3 min-w-10',\n sm: 'h-9 px-2.5 min-w-9',\n lg: 'h-11 px-5 min-w-11',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ComponentRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n"],"mappings":";;;;;;;AAKA,MAAM,iBAAiB,IACrB,obACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SAAS;EACV;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;EACL;CACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;CACP;AACF,EACF;AAED,MAAM,SAAS,MAAM,WAGnB,CAAC,EAAE,WAAW,SAAS,KAAM,GAAG,OAAO,EAAE,wBACzC,IAAC,gBAAgB;CACV;CACL,WAAW,GAAG,eAAe;EAAE;EAAS;EAAM;CAAW,EAAC,CAAC;CAC3D,GAAI;EACJ,CACF;AAEF,OAAO,cAAc,gBAAgB,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-CXS6wR7g.js","names":[],"sources":["../src/components/tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { cn } from '../lib/utils';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95',\n className\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":";;;;;;AAIA,MAAM,kBAAkB,iBAAiB;AACzC,MAAM,UAAU,iBAAiB;AACjC,MAAM,iBAAiB,iBAAiB;AAExC,MAAM,iBAAiB,MAAM,WAG3B,CAAC,EAAE,WAAW,aAAa,EAAG,GAAG,OAAO,EAAE,wBAC1C,IAAC,iBAAiB,oCAChB,IAAC,iBAAiB;CACX;CACO;CACZ,WAAW,GACT,2IACA,UACD;CACD,GAAI;EACJ,GACsB,CAC1B;AACF,eAAe,cAAc,iBAAiB,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-C0f9Ma6r.js","names":[],"sources":["../src/lib/utils.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;AAGA,SAAgB,GAAG,GAAG,QAAsB;AAC1C,QAAO,QAAQ,KAAK,OAAO,CAAC;AAC7B"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
|
-
import { ChevronDown } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
const Accordion = AccordionPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const AccordionItem = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
11
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
12
|
-
>(({ className, ...props }, ref) => (
|
|
13
|
-
<AccordionPrimitive.Item ref={ref} className={cn('border-b', className)} {...props} />
|
|
14
|
-
));
|
|
15
|
-
AccordionItem.displayName = 'AccordionItem';
|
|
16
|
-
|
|
17
|
-
const AccordionTrigger = React.forwardRef<
|
|
18
|
-
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
19
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
20
|
-
>(({ className, children, ...props }, ref) => (
|
|
21
|
-
<AccordionPrimitive.Header className="flex">
|
|
22
|
-
<AccordionPrimitive.Trigger
|
|
23
|
-
ref={ref}
|
|
24
|
-
className={cn(
|
|
25
|
-
'flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180',
|
|
26
|
-
className
|
|
27
|
-
)}
|
|
28
|
-
{...props}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
32
|
-
</AccordionPrimitive.Trigger>
|
|
33
|
-
</AccordionPrimitive.Header>
|
|
34
|
-
));
|
|
35
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
36
|
-
|
|
37
|
-
const AccordionContent = React.forwardRef<
|
|
38
|
-
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
39
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
40
|
-
>(({ className, children, ...props }, ref) => (
|
|
41
|
-
<AccordionPrimitive.Content
|
|
42
|
-
ref={ref}
|
|
43
|
-
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
44
|
-
{...props}
|
|
45
|
-
>
|
|
46
|
-
<div className={cn('pb-4 pt-0', className)}>{children}</div>
|
|
47
|
-
</AccordionPrimitive.Content>
|
|
48
|
-
));
|
|
49
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
50
|
-
|
|
51
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
-
|
|
4
|
-
import { cn } from '../lib/utils';
|
|
5
|
-
import { buttonVariants } from './button';
|
|
6
|
-
|
|
7
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
16
|
-
>(({ className, ...props }, ref) => (
|
|
17
|
-
<AlertDialogPrimitive.Overlay
|
|
18
|
-
className={cn(
|
|
19
|
-
'fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
20
|
-
className
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
ref={ref}
|
|
24
|
-
/>
|
|
25
|
-
));
|
|
26
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
27
|
-
|
|
28
|
-
const AlertDialogContent = React.forwardRef<
|
|
29
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
30
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
31
|
-
>(({ className, ...props }, ref) => (
|
|
32
|
-
<AlertDialogPortal>
|
|
33
|
-
<AlertDialogOverlay />
|
|
34
|
-
<AlertDialogPrimitive.Content
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(
|
|
37
|
-
'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',
|
|
38
|
-
className
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
</AlertDialogPortal>
|
|
43
|
-
));
|
|
44
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
45
|
-
|
|
46
|
-
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
47
|
-
<div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />
|
|
48
|
-
);
|
|
49
|
-
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
50
|
-
|
|
51
|
-
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
52
|
-
<div
|
|
53
|
-
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
|
|
54
|
-
{...props}
|
|
55
|
-
/>
|
|
56
|
-
);
|
|
57
|
-
AlertDialogFooter.displayName = 'AlertDialogFooter';
|
|
58
|
-
|
|
59
|
-
const AlertDialogTitle = React.forwardRef<
|
|
60
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
61
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
62
|
-
>(({ className, ...props }, ref) => (
|
|
63
|
-
<AlertDialogPrimitive.Title
|
|
64
|
-
ref={ref}
|
|
65
|
-
className={cn('text-lg font-semibold', className)}
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
));
|
|
69
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
70
|
-
|
|
71
|
-
const AlertDialogDescription = React.forwardRef<
|
|
72
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
73
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
74
|
-
>(({ className, ...props }, ref) => (
|
|
75
|
-
<AlertDialogPrimitive.Description
|
|
76
|
-
ref={ref}
|
|
77
|
-
className={cn('text-sm text-muted-foreground', className)}
|
|
78
|
-
{...props}
|
|
79
|
-
/>
|
|
80
|
-
));
|
|
81
|
-
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
82
|
-
|
|
83
|
-
const AlertDialogAction = React.forwardRef<
|
|
84
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
85
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
86
|
-
>(({ className, ...props }, ref) => (
|
|
87
|
-
<AlertDialogPrimitive.Action ref={ref} className={cn(buttonVariants(), className)} {...props} />
|
|
88
|
-
));
|
|
89
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
90
|
-
|
|
91
|
-
const AlertDialogCancel = React.forwardRef<
|
|
92
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
93
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
94
|
-
>(({ className, ...props }, ref) => (
|
|
95
|
-
<AlertDialogPrimitive.Cancel
|
|
96
|
-
ref={ref}
|
|
97
|
-
className={cn(buttonVariants({ variant: 'outline' }), 'mt-2 sm:mt-0', className)}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
));
|
|
101
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
102
|
-
|
|
103
|
-
export {
|
|
104
|
-
AlertDialog,
|
|
105
|
-
AlertDialogPortal,
|
|
106
|
-
AlertDialogOverlay,
|
|
107
|
-
AlertDialogTrigger,
|
|
108
|
-
AlertDialogContent,
|
|
109
|
-
AlertDialogHeader,
|
|
110
|
-
AlertDialogFooter,
|
|
111
|
-
AlertDialogTitle,
|
|
112
|
-
AlertDialogDescription,
|
|
113
|
-
AlertDialogAction,
|
|
114
|
-
AlertDialogCancel,
|
|
115
|
-
};
|
package/src/components/alert.tsx
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { cn } from '../lib/utils';
|
|
5
|
-
|
|
6
|
-
const alertVariants = cva(
|
|
7
|
-
'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',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: 'bg-background text-foreground',
|
|
12
|
-
destructive:
|
|
13
|
-
'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
variant: 'default',
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
const Alert = React.forwardRef<
|
|
23
|
-
HTMLDivElement,
|
|
24
|
-
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
|
25
|
-
>(({ className, variant, ...props }, ref) => (
|
|
26
|
-
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} />
|
|
27
|
-
));
|
|
28
|
-
Alert.displayName = 'Alert';
|
|
29
|
-
|
|
30
|
-
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
|
|
31
|
-
({ className, ...props }, ref) => (
|
|
32
|
-
<h5
|
|
33
|
-
ref={ref}
|
|
34
|
-
className={cn('mb-1 font-medium leading-none tracking-tight', className)}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
);
|
|
39
|
-
AlertTitle.displayName = 'AlertTitle';
|
|
40
|
-
|
|
41
|
-
const AlertDescription = React.forwardRef<
|
|
42
|
-
HTMLParagraphElement,
|
|
43
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
44
|
-
>(({ className, ...props }, ref) => (
|
|
45
|
-
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
46
|
-
));
|
|
47
|
-
AlertDescription.displayName = 'AlertDescription';
|
|
48
|
-
|
|
49
|
-
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
const Avatar = React.forwardRef<
|
|
6
|
-
React.ComponentRef<typeof AvatarPrimitive.Root>,
|
|
7
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
8
|
-
>(({ className, ...props }, ref) => (
|
|
9
|
-
<AvatarPrimitive.Root
|
|
10
|
-
ref={ref}
|
|
11
|
-
className={cn('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
));
|
|
15
|
-
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
16
|
-
|
|
17
|
-
const AvatarImage = React.forwardRef<
|
|
18
|
-
React.ComponentRef<typeof AvatarPrimitive.Image>,
|
|
19
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
20
|
-
>(({ className, ...props }, ref) => (
|
|
21
|
-
<AvatarPrimitive.Image
|
|
22
|
-
ref={ref}
|
|
23
|
-
className={cn('aspect-square h-full w-full', className)}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
));
|
|
27
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28
|
-
|
|
29
|
-
const AvatarFallback = React.forwardRef<
|
|
30
|
-
React.ComponentRef<typeof AvatarPrimitive.Fallback>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
33
|
-
<AvatarPrimitive.Fallback
|
|
34
|
-
ref={ref}
|
|
35
|
-
className={cn(
|
|
36
|
-
'flex h-full w-full items-center justify-center rounded-full bg-muted',
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
));
|
|
42
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
43
|
-
|
|
44
|
-
export { Avatar, AvatarImage, AvatarFallback };
|
package/src/components/badge.tsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { cn } from '../lib/utils';
|
|
5
|
-
|
|
6
|
-
const badgeVariants = cva(
|
|
7
|
-
'inline-flex items-center rounded-full border border-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',
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
12
|
-
secondary:
|
|
13
|
-
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
14
|
-
destructive:
|
|
15
|
-
'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
16
|
-
outline: 'text-foreground',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
defaultVariants: {
|
|
20
|
-
variant: 'default',
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export interface BadgeProps
|
|
26
|
-
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
27
|
-
|
|
28
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
29
|
-
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { Badge, badgeVariants };
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
const Breadcrumb = React.forwardRef<
|
|
8
|
-
HTMLElement,
|
|
9
|
-
React.ComponentPropsWithoutRef<'nav'> & {
|
|
10
|
-
separator?: React.ReactNode;
|
|
11
|
-
}
|
|
12
|
-
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />);
|
|
13
|
-
Breadcrumb.displayName = 'Breadcrumb';
|
|
14
|
-
|
|
15
|
-
const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<'ol'>>(
|
|
16
|
-
({ className, ...props }, ref) => (
|
|
17
|
-
<ol
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
);
|
|
27
|
-
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
28
|
-
|
|
29
|
-
const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<'li'>>(
|
|
30
|
-
({ className, ...props }, ref) => (
|
|
31
|
-
<li ref={ref} className={cn('inline-flex items-center gap-1.5', className)} {...props} />
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
35
|
-
|
|
36
|
-
const BreadcrumbLink = React.forwardRef<
|
|
37
|
-
HTMLAnchorElement,
|
|
38
|
-
React.ComponentPropsWithoutRef<'a'> & {
|
|
39
|
-
asChild?: boolean;
|
|
40
|
-
}
|
|
41
|
-
>(({ asChild, className, ...props }, ref) => {
|
|
42
|
-
const Comp = asChild ? Slot : 'a';
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<Comp
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn('transition-colors hover:text-foreground', className)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
});
|
|
52
|
-
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
53
|
-
|
|
54
|
-
const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<'span'>>(
|
|
55
|
-
({ className, ...props }, ref) => (
|
|
56
|
-
<span
|
|
57
|
-
ref={ref}
|
|
58
|
-
role="link"
|
|
59
|
-
aria-disabled="true"
|
|
60
|
-
aria-current="page"
|
|
61
|
-
className={cn('font-normal text-foreground', className)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
)
|
|
65
|
-
);
|
|
66
|
-
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
67
|
-
|
|
68
|
-
const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<'li'>) => (
|
|
69
|
-
<li
|
|
70
|
-
role="presentation"
|
|
71
|
-
aria-hidden="true"
|
|
72
|
-
className={cn('[&>svg]:h-3.5 [&>svg]:w-3.5', className)}
|
|
73
|
-
{...props}
|
|
74
|
-
>
|
|
75
|
-
{children ?? <ChevronRight />}
|
|
76
|
-
</li>
|
|
77
|
-
);
|
|
78
|
-
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
79
|
-
|
|
80
|
-
const BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
|
|
81
|
-
<span
|
|
82
|
-
role="presentation"
|
|
83
|
-
aria-hidden="true"
|
|
84
|
-
className={cn('flex h-9 w-9 items-center justify-center', className)}
|
|
85
|
-
{...props}
|
|
86
|
-
>
|
|
87
|
-
<MoreHorizontal className="h-4 w-4" />
|
|
88
|
-
<span className="sr-only">More</span>
|
|
89
|
-
</span>
|
|
90
|
-
);
|
|
91
|
-
BreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
Breadcrumb,
|
|
95
|
-
BreadcrumbList,
|
|
96
|
-
BreadcrumbItem,
|
|
97
|
-
BreadcrumbLink,
|
|
98
|
-
BreadcrumbPage,
|
|
99
|
-
BreadcrumbSeparator,
|
|
100
|
-
BreadcrumbEllipsis,
|
|
101
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
'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',
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
13
|
-
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
14
|
-
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
15
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
16
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
17
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
default: 'h-10 px-4 py-2',
|
|
21
|
-
sm: 'h-9 rounded-md px-3',
|
|
22
|
-
lg: 'h-11 rounded-md px-8',
|
|
23
|
-
icon: 'h-10 w-10',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
defaultVariants: {
|
|
27
|
-
variant: 'default',
|
|
28
|
-
size: 'default',
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
export interface ButtonProps
|
|
34
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
35
|
-
asChild?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
39
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
40
|
-
const Comp = asChild ? Slot : 'button';
|
|
41
|
-
return (
|
|
42
|
-
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
Button.displayName = 'Button';
|
|
47
|
-
|
|
48
|
-
export { Button, buttonVariants };
|