@vuer-ai/vuer-uikit 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/package.json +3 -2
  2. package/src/highlight-cursor/cursor-context.tsx +23 -0
  3. package/src/highlight-cursor/cursor-provider.tsx +264 -0
  4. package/src/highlight-cursor/enhanced-components.tsx +16 -0
  5. package/src/highlight-cursor/index.ts +21 -0
  6. package/src/highlight-cursor/tabs-cursor-context.tsx +121 -0
  7. package/src/highlight-cursor/types.ts +40 -0
  8. package/src/highlight-cursor/with-cursor.tsx +144 -0
  9. package/src/index.css +5 -0
  10. package/src/index.ts +5 -0
  11. package/src/styles/theme.css +80 -0
  12. package/src/styles/toast.css +64 -0
  13. package/src/styles/variables.css +194 -0
  14. package/src/ui/avatar.tsx +92 -0
  15. package/src/ui/badge.tsx +68 -0
  16. package/src/ui/button.tsx +100 -0
  17. package/src/ui/card.tsx +88 -0
  18. package/src/ui/checkbox.tsx +76 -0
  19. package/src/ui/collapsible.tsx +36 -0
  20. package/src/ui/dropdown.tsx +375 -0
  21. package/src/ui/index.ts +31 -0
  22. package/src/ui/input-numbers.tsx +201 -0
  23. package/src/ui/input.tsx +141 -0
  24. package/src/ui/layout.tsx +41 -0
  25. package/src/ui/modal.tsx +198 -0
  26. package/src/ui/popover.tsx +59 -0
  27. package/src/ui/radio-group.tsx +56 -0
  28. package/src/ui/select.tsx +292 -0
  29. package/src/ui/sheet.tsx +131 -0
  30. package/src/ui/slider.tsx +189 -0
  31. package/src/ui/switch.tsx +43 -0
  32. package/src/ui/tabs.tsx +128 -0
  33. package/src/ui/textarea.tsx +52 -0
  34. package/src/ui/theme-context.tsx +80 -0
  35. package/src/ui/timeline.tsx +717 -0
  36. package/src/ui/toast.tsx +27 -0
  37. package/src/ui/toggle-group.tsx +82 -0
  38. package/src/ui/toggle.tsx +88 -0
  39. package/src/ui/tooltip.tsx +132 -0
  40. package/src/ui/tree-view-v2.tsx +300 -0
  41. package/src/ui/tree-view.tsx +550 -0
  42. package/src/ui/version-badge.tsx +65 -0
  43. package/src/utils/cn.ts +21 -0
  44. package/src/utils/index.ts +2 -0
  45. package/src/utils/use-local-storage.ts +59 -0
@@ -0,0 +1,80 @@
1
+ @import "./variables.css";
2
+
3
+ @custom-variant liquid (&:is(.liquiddark *, .liquidlight *));
4
+
5
+ @utility liquid-bg {
6
+ background: linear-gradient(
7
+ 147.1deg,
8
+ rgba(172, 172, 172, 0.1) 0%,
9
+ rgba(74, 74, 74, 0.1) 105.28%
10
+ ) !important;
11
+ backdrop-filter: blur(20px) !important;
12
+ }
13
+
14
+ @utility scrollbar-hide {
15
+ scrollbar-width: none;
16
+ &::-webkit-scrollbar {
17
+ display: none;
18
+ }
19
+ }
20
+
21
+ @theme inline {
22
+ --font-sans: Inter;
23
+ --font-number-input: "Fira Mono";
24
+
25
+ /* color */
26
+ --color-brand-primary: var(--brand-primary);
27
+ --color-brand-secondary: var(--brand-secondary);
28
+ --color-brand-tertiary: var(--brand-tertiary);
29
+ --color-text-highlight: var(--text-highlight);
30
+ --color-text-primary: var(--text-primary);
31
+ --color-text-secondary: var(--text-secondary);
32
+ --color-text-tertiary: var(--text-tertiary);
33
+ --color-text-withbg: var(--text-withbg);
34
+ --color-bg-primary: var(--bg-primary);
35
+ --color-bg-secondary: var(--bg-secondary);
36
+ --color-bg-tertiary: var(--bg-tertiary);
37
+ --color-bg-quaternary: var(--bg-quaternary);
38
+ --color-bg-mask: var(--bg-mask);
39
+ --color-icon-highlight: var(--icon-highlight);
40
+ --color-icon-primary: var(--icon-primary);
41
+ --color-icon-secondary: var(--icon-secondary);
42
+ --color-icon-tertiary: var(--icon-tertiary);
43
+ --color-icon-withbg: var(--icon-withbg);
44
+ --color-danger-primary: var(--danger-primary);
45
+ --color-danger-secondary: var(--danger-secondary);
46
+ --color-danger-tertiary: var(--danger-tertiary);
47
+ --color-accent-warning: var(--accent-warning);
48
+ --color-accent-success: var(--accent-success);
49
+ --color-line-primary: var(--line-primary);
50
+ --color-line-secondary: var(--line-secondary);
51
+ --color-shadow-primary: var(--shadow-primary);
52
+ --color-shadow-secondary: var(--shadow-secondary);
53
+ /* radius */
54
+ --radius-uk-xs: var(--radius); /* 4px */
55
+ --radius-uk-sm: calc(var(--radius) + 2px); /* 6px */
56
+ --radius-uk-md: calc(var(--radius) + 4px); /* 8px */
57
+ --radius-uk-lg: calc(var(--radius) + 8px); /* 12px */
58
+ --radius-uk-xl: calc(var(--radius) + 12px); /* 16px */
59
+ /* spacing */
60
+ --spacing-xxs: calc(var(--spacing) - 2px); /* 2px */
61
+ --spacing-xs: var(--spacing); /* 4px */
62
+ --spacing-sm: calc(var(--spacing) + 2px); /* 6px */
63
+ --spacing-md: calc(var(--spacing) + 4px); /* 8px */
64
+ --spacing-lg: calc(var(--spacing) + 8px); /* 12px */
65
+ --spacing-xl: calc(var(--spacing) + 12px); /* 16px */
66
+ /* font-size */
67
+ --text-uk-xs: 11px;
68
+ --text-uk-sm: 12px;
69
+ --text-uk-md: 14px;
70
+ --text-uk-lg: 16px;
71
+ --text-uk-xl: 18px;
72
+ --text-uk-xxl: 20px;
73
+ /* line-height */
74
+ --leading-uk-xs: 14px;
75
+ --leading-uk-sm: 16px;
76
+ --leading-uk-md: 20px;
77
+ --leading-uk-lg: 24px;
78
+ --leading-uk-xl: 28px;
79
+ --leading-uk-xxl: 32px;
80
+ }
@@ -0,0 +1,64 @@
1
+ .vk-toast,
2
+ [data-sonner-toast].vk-toast {
3
+ background: var(--color-bg-primary) !important;
4
+ border: none !important;
5
+ border-radius: var(--radius-uk-md) !important;
6
+ padding: var(--spacing-lg) !important;
7
+ box-shadow: 0px 8px 24px 0px var(--color-shadow-primary) !important;
8
+ padding-right: 60px !important;
9
+ }
10
+
11
+ .vk-toast [data-title] {
12
+ color: var(--color-text-primary) !important;
13
+ font-size: var(--text-uk-md) !important;
14
+ line-height: var(--leading-uk-md) !important;
15
+ font-weight: 500 !important;
16
+ display: -webkit-box;
17
+ line-clamp: 1;
18
+ box-orient: vertical;
19
+ -webkit-line-clamp: 1;
20
+ -webkit-box-orient: vertical;
21
+ overflow: hidden;
22
+ text-overflow: ellipsis;
23
+ }
24
+
25
+ .vk-toast-description {
26
+ color: var(--color-text-secondary) !important;
27
+ font-size: var(--text-uk-sm) !important;
28
+ line-height: var(--leading-uk-sm) !important;
29
+ font-weight: 400 !important;
30
+ display: -webkit-box;
31
+ line-clamp: 3;
32
+ box-orient: vertical;
33
+ -webkit-line-clamp: 3;
34
+ -webkit-box-orient: vertical;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
37
+ }
38
+
39
+ .vk-toast button[data-button] {
40
+ background: transparent !important;
41
+ color: var(--color-text-primary) !important;
42
+ border: none !important;
43
+ font-size: var(--text-uk-sm) !important;
44
+ line-height: var(--leading-uk-sm) !important;
45
+ font-weight: 400 !important;
46
+ text-decoration: none !important;
47
+ cursor: pointer !important;
48
+ position: absolute !important;
49
+ border-radius: 0 !important;
50
+ right: 0 !important;
51
+ top: 0 !important;
52
+ height: 100% !important;
53
+ width: 60px !important;
54
+ display: flex !important;
55
+ align-items: center !important;
56
+ justify-content: center !important;
57
+ text-overflow: ellipsis !important;
58
+ overflow: hidden !important;
59
+ white-space: nowrap !important;
60
+ }
61
+
62
+ .vk-toast button[data-button]:hover {
63
+ background: var(--color-bg-secondary) !important;
64
+ }
@@ -0,0 +1,194 @@
1
+ :root {
2
+ /* themes - light */
3
+ --brand-primary: var(--blue-6);
4
+ --brand-secondary: var(--blue-4);
5
+ --brand-tertiary: var(--blue-8);
6
+ --text-highlight: var(--black-1);
7
+ --text-primary: var(--gray-9);
8
+ --text-secondary: var(--gray-7);
9
+ --text-tertiary: var(--gray-5);
10
+ --text-withbg: var(--white-1);
11
+ --bg-primary: var(--white-1);
12
+ --bg-secondary: var(--gray-1);
13
+ --bg-tertiary: var(--gray-2);
14
+ --bg-quaternary: var(--gray-3);
15
+ --bg-mask: var(--black-alpha-5);
16
+ --icon-highlight: var(--black-1);
17
+ --icon-primary: var(--gray-8);
18
+ --icon-secondary: var(--gray-6);
19
+ --icon-tertiary: var(--gray-4);
20
+ --icon-withbg: var(--white-1);
21
+ --danger-primary: var(--red-6);
22
+ --danger-secondary: var(--red-4);
23
+ --danger-tertiary: var(--red-8);
24
+ --accent-warning: var(--yellow-6);
25
+ --accent-success: var(--green-6);
26
+ --line-primary: var(--gray-2);
27
+ --line-secondary: var(--gray-6);
28
+ --shadow-primary: var(--black-alpha-3);
29
+ --shadow-secondary: var(--black-alpha-4);
30
+ --shadow-tertiary: var(--black-alpha-4);
31
+
32
+ /* color - scheme */
33
+ --black-1: rgba(0, 0, 0, 1);
34
+ --black-alpha-1: rgba(0, 0, 0, 0.6);
35
+ --black-alpha-2: rgba(0, 0, 0, 0.2);
36
+ --black-alpha-3: rgba(0, 0, 0, 0.1);
37
+ --black-alpha-4: rgba(0, 0, 0, 0.06);
38
+ --black-alpha-5: rgba(56, 57, 59, 0.5);
39
+ --black-alpha-6: rgba(90, 93, 98, 0.3);
40
+ --black-alpha-7: rgba(75, 77, 83, 0.5);
41
+ --white-1: rgba(255, 255, 255, 1);
42
+ --white-alpha-1: rgba(227, 230, 235, 0.6);
43
+ --white-alpha-2: rgba(173, 176, 183, 0.6);
44
+ --white-alpha-3: rgba(246, 247, 248, 0.8);
45
+ --blue-1: rgba(230, 246, 255, 1);
46
+ --blue-2: rgba(163, 220, 255, 1);
47
+ --blue-3: rgba(122, 200, 255, 1);
48
+ --blue-4: rgba(82, 177, 255, 1);
49
+ --blue-5: rgba(41, 151, 255, 1);
50
+ --blue-6: rgba(0, 123, 255, 1);
51
+ --blue-7: rgba(0, 98, 217, 1);
52
+ --blue-8: rgba(0, 74, 179, 1);
53
+ --blue-9: rgba(0, 54, 140, 1);
54
+ --blue-10: rgba(0, 36, 102, 1);
55
+ --gray-1: rgba(245, 245, 245, 1);
56
+ --gray-2: rgba(220, 222, 229, 1);
57
+ --gray-3: rgba(202, 206, 217, 1);
58
+ --gray-4: rgba(181, 184, 196, 1);
59
+ --gray-5: rgba(147, 150, 159, 1);
60
+ --gray-6: rgba(121, 124, 131, 1);
61
+ --gray-7: rgba(87, 90, 96, 1);
62
+ --gray-8: rgba(75, 77, 83, 1);
63
+ --gray-9: rgba(52, 53, 56, 1);
64
+ --gray-10: rgba(29, 29, 30, 1);
65
+ --red-1: rgba(255, 240, 240, 1);
66
+ --red-2: rgba(255, 232, 232, 1);
67
+ --red-3: rgba(255, 191, 192, 1);
68
+ --red-4: rgba(255, 150, 156, 1);
69
+ --red-5: rgba(255, 110, 122, 1);
70
+ --red-6: rgba(255, 69, 91, 1);
71
+ --red-7: rgba(217, 48, 73, 1);
72
+ --red-8: rgba(179, 30, 58, 1);
73
+ --red-9: rgba(140, 17, 44, 1);
74
+ --red-10: rgba(102, 11, 34, 1);
75
+ --yellow-1: rgba(255, 253, 240, 1);
76
+ --yellow-2: rgba(255, 248, 214, 1);
77
+ --yellow-3: rgba(255, 237, 173, 1);
78
+ --yellow-4: rgba(255, 224, 133, 1);
79
+ --yellow-5: rgba(255, 209, 92, 1);
80
+ --yellow-6: rgba(251, 187, 49, 1);
81
+ --yellow-7: rgba(212, 149, 32, 1);
82
+ --yellow-8: rgba(173, 114, 17, 1);
83
+ --yellow-9: rgba(135, 82, 7, 1);
84
+ --yellow-10: rgba(97, 55, 4, 1);
85
+ --green-1: rgba(240, 255, 243, 1);
86
+ --green-2: rgba(228, 242, 231, 1);
87
+ --green-3: rgba(211, 230, 216, 1);
88
+ --green-4: rgba(165, 217, 181, 1);
89
+ --green-5: rgba(122, 204, 151, 1);
90
+ --green-6: rgba(84, 190, 125, 1);
91
+ --green-7: rgba(60, 153, 99, 1);
92
+ --green-8: rgba(39, 115, 73, 1);
93
+ --green-9: rgba(22, 77, 48, 1);
94
+ --green-10: rgba(11, 38, 25, 1);
95
+
96
+ --radius: 0.25rem; /* 4px */
97
+ --spacing: 0.25rem; /* 4px */
98
+ }
99
+
100
+ .dark {
101
+ color-scheme: dark;
102
+ --brand-primary: var(--blue-6);
103
+ --brand-secondary: var(--blue-4);
104
+ --brand-tertiary: var(--blue-8);
105
+ --text-highlight: var(--white-1);
106
+ --text-primary: var(--gray-2);
107
+ --text-secondary: var(--gray-5);
108
+ --text-tertiary: var(--gray-6);
109
+ --text-withbg: var(--white-1);
110
+ --bg-primary: var(--gray-10);
111
+ --bg-secondary: var(--gray-9);
112
+ --bg-tertiary: var(--gray-8);
113
+ --bg-quaternary: var(--gray-7);
114
+ --bg-mask: var(--black-alpha-5);
115
+ --icon-highlight: var(--white-1);
116
+ --icon-primary: var(--gray-2);
117
+ --icon-secondary: var(--gray-5);
118
+ --icon-tertiary: var(--gray-6);
119
+ --icon-withbg: var(--white-1);
120
+ --danger-primary: var(--red-6);
121
+ --danger-secondary: var(--red-4);
122
+ --danger-tertiary: var(--red-8);
123
+ --accent-warning: var(--yellow-6);
124
+ --accent-success: var(--green-6);
125
+ --line-primary: var(--gray-8);
126
+ --line-secondary: var(--gray-4);
127
+ --shadow-primary: var(--black-alpha-1);
128
+ --shadow-secondary: var(--black-alpha-2);
129
+ --shadow-tertiary: var(--black-alpha-6);
130
+ }
131
+
132
+ .liquidlight {
133
+ color-scheme: light;
134
+ --brand-primary: var(--blue-6);
135
+ --brand-secondary: var(--blue-4);
136
+ --brand-tertiary: var(--blue-8);
137
+ --text-highlight: var(--black-1);
138
+ --text-primary: var(--gray-9);
139
+ --text-secondary: var(--gray-7);
140
+ --text-tertiary: var(--gray-5);
141
+ --text-withbg: var(--white-1);
142
+ --bg-primary: var(--white-1);
143
+ --bg-secondary: var(--white-alpha-1);
144
+ --bg-tertiary: var(--gray-2);
145
+ --bg-quaternary: var(--gray-3);
146
+ --bg-mask: var(--white-alpha-3);
147
+ --icon-highlight: var(--black-1);
148
+ --icon-primary: var(--gray-8);
149
+ --icon-secondary: var(--gray-6);
150
+ --icon-tertiary: var(--gray-4);
151
+ --icon-withbg: var(--white-1);
152
+ --danger-primary: var(--red-6);
153
+ --danger-secondary: var(--red-4);
154
+ --danger-tertiary: var(--red-8);
155
+ --accent-warning: var(--yellow-6);
156
+ --accent-success: var(--green-6);
157
+ --line-primary: var(--white-alpha-2);
158
+ --line-secondary: var(--gray-6);
159
+ --shadow-primary: var(--black-alpha-3);
160
+ --shadow-secondary: var(--black-alpha-4);
161
+ --shadow-tertiary: var(--black-alpha-4);
162
+ }
163
+
164
+ .liquiddark {
165
+ color-scheme: dark;
166
+ --brand-primary: var(--blue-6);
167
+ --brand-secondary: var(--blue-4);
168
+ --brand-tertiary: var(--blue-8);
169
+ --text-highlight: var(--white-1);
170
+ --text-primary: var(--gray-2);
171
+ --text-secondary: var(--gray-5);
172
+ --text-tertiary: var(--gray-6);
173
+ --text-withbg: var(--white-1);
174
+ --bg-primary: var(--gray-10);
175
+ --bg-secondary: var(--black-alpha-6);
176
+ --bg-tertiary: var(--gray-8);
177
+ --bg-quaternary: var(--gray-7);
178
+ --bg-mask: var(--black-alpha-5);
179
+ --icon-highlight: var(--white-1);
180
+ --icon-primary: var(--gray-2);
181
+ --icon-secondary: var(--gray-5);
182
+ --icon-tertiary: var(--gray-6);
183
+ --icon-withbg: var(--white-1);
184
+ --danger-primary: var(--red-6);
185
+ --danger-secondary: var(--red-4);
186
+ --danger-tertiary: var(--red-8);
187
+ --accent-warning: var(--yellow-6);
188
+ --accent-success: var(--green-6);
189
+ --line-primary: var(--black-alpha-7);
190
+ --line-secondary: var(--gray-4);
191
+ --shadow-primary: var(--black-alpha-1);
192
+ --shadow-secondary: var(--black-alpha-2);
193
+ --shadow-tertiary: var(--black-alpha-6);
194
+ }
@@ -0,0 +1,92 @@
1
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
2
+ import React, { ComponentProps } from "react";
3
+
4
+ import { cn } from "../utils";
5
+
6
+ function Avatar({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Root>) {
7
+ return (
8
+ <AvatarPrimitive.Root
9
+ data-slot="avatar"
10
+ className={cn("relative flex size-[24px] shrink-0 overflow-hidden rounded-full", className)}
11
+ {...props}
12
+ />
13
+ );
14
+ }
15
+
16
+ function AvatarImage({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Image>) {
17
+ return (
18
+ <AvatarPrimitive.Image
19
+ data-slot="avatar-image"
20
+ className={cn("aspect-square size-full", className)}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ function AvatarFallback({ className, ...props }: ComponentProps<typeof AvatarPrimitive.Fallback>) {
27
+ return (
28
+ <AvatarPrimitive.Fallback
29
+ data-slot="avatar-fallback"
30
+ className={cn(
31
+ "bg-bg-tertiary flex size-full items-center justify-center rounded-full",
32
+ className,
33
+ )}
34
+ {...props}
35
+ />
36
+ );
37
+ }
38
+
39
+ interface AvatarGroupProps {
40
+ children: React.ReactNode;
41
+ className?: string;
42
+ spacing?: "tight" | "normal" | "loose";
43
+ max?: number;
44
+ }
45
+
46
+ function AvatarGroup({ children, className, spacing = "normal", max }: AvatarGroupProps) {
47
+ const spacingClasses = {
48
+ tight: "-space-x-1.5",
49
+ normal: "-space-x-1",
50
+ loose: "-space-x-0.45",
51
+ };
52
+
53
+ const childrenArray = React.Children.toArray(children);
54
+ const displayChildren = max ? childrenArray.slice(0, max) : childrenArray;
55
+ const remainingCount = max && childrenArray.length > max ? childrenArray.length - max : 0;
56
+
57
+ return (
58
+ <div className={cn("flex", spacingClasses[spacing], className)}>
59
+ {displayChildren.map((child, index) => {
60
+ const zIndex = 30 - index;
61
+ if (React.isValidElement(child)) {
62
+ return React.cloneElement(
63
+ child as React.ReactElement<{
64
+ className?: string;
65
+ style?: React.CSSProperties;
66
+ }>,
67
+ {
68
+ key: index,
69
+ className: cn(
70
+ `ring-background relative ring-2 z-[${zIndex}] transition-all duration-200 ease-in-out hover:z-[100] hover:scale-120`,
71
+ (child.props as { className?: string })?.className,
72
+ ),
73
+ },
74
+ );
75
+ }
76
+ return child;
77
+ })}
78
+ {remainingCount > 0 && (
79
+ <Avatar
80
+ className={cn(
81
+ "ring-background relative cursor-default ring-2 transition-all duration-200 ease-in-out hover:z-[100] hover:scale-120",
82
+ `z-[${30 - displayChildren.length}]`,
83
+ )}
84
+ >
85
+ <AvatarFallback>+{remainingCount}</AvatarFallback>
86
+ </Avatar>
87
+ )}
88
+ </div>
89
+ );
90
+ }
91
+
92
+ export { Avatar, AvatarImage, AvatarFallback, AvatarGroup };
@@ -0,0 +1,68 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { ComponentProps } from "react";
4
+
5
+ import { cn } from "../utils";
6
+
7
+ const badgeVariants = cva(
8
+ [
9
+ "inline-flex",
10
+ "items-center",
11
+ "justify-center",
12
+ "rounded-uk-xs",
13
+ "px-md",
14
+ "py-xxs",
15
+ "align-middle",
16
+ "text-uk-sm",
17
+ "leading-uk-sm",
18
+ "w-fit",
19
+ "whitespace-nowrap",
20
+ "shrink-0",
21
+ "[&>svg]:size-3",
22
+ "[&>svg]:pointer-events-none",
23
+ "transition-[color,box-shadow]",
24
+ "overflow-hidden",
25
+ "text-text-withbg",
26
+ ],
27
+ {
28
+ variants: {
29
+ variant: {
30
+ default: "bg-brand-primary text-text-primary",
31
+ secondary: "bg-bg-secondary",
32
+ destructive: "bg-danger-primary",
33
+ success: "bg-accent-success",
34
+ warning: "bg-accent-warning",
35
+ accent: "bg-accent-primary text-text-primary",
36
+ },
37
+ type: {
38
+ default: "",
39
+ circle: "size-[18px] !rounded-full",
40
+ dot: "size-[6px] rounded-full !px-0 !py-0 text-transparent",
41
+ },
42
+ },
43
+ defaultVariants: {
44
+ variant: "default",
45
+ type: "default",
46
+ },
47
+ },
48
+ );
49
+
50
+ function Badge({
51
+ className,
52
+ variant,
53
+ type,
54
+ asChild = false,
55
+ ...props
56
+ }: ComponentProps<"span"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
57
+ const Comp = asChild ? Slot : "span";
58
+
59
+ return (
60
+ <Comp
61
+ data-slot="badge"
62
+ className={cn(badgeVariants({ variant, type }), className)}
63
+ {...props}
64
+ />
65
+ );
66
+ }
67
+
68
+ export { Badge, badgeVariants };
@@ -0,0 +1,100 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { type ComponentProps, forwardRef } from "react";
4
+
5
+ import { cn } from "../utils";
6
+
7
+ const buttonVariants = cva(
8
+ [
9
+ "inline-flex",
10
+ "items-center",
11
+ "justify-center",
12
+ "shrink-0",
13
+ "whitespace-nowrap",
14
+ "rounded-uk-sm",
15
+ "font-medium",
16
+ "transition-all",
17
+ "[&_svg]:shrink-0 ",
18
+ "[&_svg]:pointer-events-none",
19
+ "outline-none",
20
+ "disabled:pointer-events-none",
21
+ "disabled:bg-bg-tertiary",
22
+ "disabled:text-text-tertiary",
23
+ "focus-visible:border-ring",
24
+ "focus-visible:ring-ring/50",
25
+ "focus-visible:ring-[3px]",
26
+ "focus-visible:bg-brand-tertiary",
27
+ "aria-invalid:ring-destructive/20",
28
+ "aria-invalid:border-destructive",
29
+ ],
30
+ {
31
+ variants: {
32
+ variant: {
33
+ primary: [
34
+ "bg-brand-primary",
35
+ "text-text-withbg",
36
+ "hover:bg-brand-secondary",
37
+ "active:bg-brand-tertiary",
38
+ ],
39
+ secondary: [
40
+ "bg-bg-secondary",
41
+ "text-text-highlight",
42
+ "hover:bg-bg-quaternary",
43
+ "active:bg-bg-tertiary",
44
+ ],
45
+ destructive: [
46
+ "bg-danger-primary",
47
+ "text-text-withbg",
48
+ "hover:bg-danger-secondary",
49
+ "active:bg-danger-tertiary",
50
+ ],
51
+ ghost: [
52
+ "text-text-primary",
53
+ "hover:bg-bg-tertiary",
54
+ "hover:text-text-secondary",
55
+ "active:bg-bg-secondary",
56
+ ],
57
+ link: ["text-text-primary", "underline-offset-4", "hover:underline"],
58
+ },
59
+ size: {
60
+ sm: ["text-uk-sm", "h-5.5", "gap-xxs", "px-md", "[&_svg:not([class*='size-'])]:size-3"],
61
+ base: ["text-uk-md", "h-7 ", "gap-xs", " px-lg", "[&_svg:not([class*='size-'])]:size-3.5"],
62
+ lg: ["text-uk-lg", "h-8", " gap-xs", "px-xl", "[&_svg:not([class*='size-'])]:size-4"],
63
+ },
64
+ icon: { false: null, true: null },
65
+ },
66
+ compoundVariants: [
67
+ { size: "sm", icon: true, class: ["px-xs", "py-xs", " size-5.5"] },
68
+ { size: "base", icon: true, class: ["px-sm", "py-sm", "size-7"] },
69
+ { size: "lg", icon: true, class: ["px-md", "py-md", " size-8"] },
70
+ ],
71
+ defaultVariants: {
72
+ variant: "primary",
73
+ size: "base",
74
+ icon: false,
75
+ },
76
+ },
77
+ );
78
+
79
+ interface ButtonProps extends ComponentProps<"button">, VariantProps<typeof buttonVariants> {
80
+ asChild?: boolean;
81
+ }
82
+
83
+ const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
84
+ { className, variant, size, icon, asChild = false, ...props },
85
+ ref,
86
+ ) {
87
+ const Comp = asChild ? Slot : "button";
88
+
89
+ return (
90
+ <Comp
91
+ ref={ref}
92
+ data-slot="button"
93
+ className={cn(buttonVariants({ variant, size, icon, className }))}
94
+ {...props}
95
+ />
96
+ );
97
+ });
98
+
99
+ export { Button };
100
+ export type { ButtonProps };
@@ -0,0 +1,88 @@
1
+ import { type ComponentProps } from "react";
2
+
3
+ import { cn } from "../utils";
4
+
5
+ function Card({ className, ...props }: ComponentProps<"div">) {
6
+ return (
7
+ <div
8
+ data-slot="card"
9
+ className={cn(
10
+ "flex",
11
+ "flex-col",
12
+ "gap-md",
13
+ "min-w-[300px]",
14
+ "rounded-uk-lg",
15
+ "p-lg",
16
+ "bg-bg-primary",
17
+ "shadow-[0_4px_16px_0_var(--color-shadow-secondary)]",
18
+ "liquid:liquid-bg",
19
+ className,
20
+ )}
21
+ {...props}
22
+ />
23
+ );
24
+ }
25
+
26
+ function CardHeader({ className, ...props }: ComponentProps<"div">) {
27
+ return (
28
+ <div
29
+ data-slot="card-header"
30
+ className={cn("flex", "flex-row", "items-center", "justify-between", "gap-lg", className)}
31
+ {...props}
32
+ />
33
+ );
34
+ }
35
+
36
+ function CardTitle({ className, ...props }: ComponentProps<"div">) {
37
+ return (
38
+ <div
39
+ data-slot="card-title"
40
+ className={cn(
41
+ "text-text-highlight",
42
+ "text-uk-md",
43
+ "leading-uk-md",
44
+ "font-medium",
45
+ "vertical-align-middle",
46
+ className,
47
+ )}
48
+ {...props}
49
+ />
50
+ );
51
+ }
52
+
53
+ function CardDescription({ className, ...props }: ComponentProps<"div">) {
54
+ return (
55
+ <div
56
+ data-slot="card-description"
57
+ className={cn("text-text-secondary text-uk-sm leading-uk-sm", className)}
58
+ {...props}
59
+ />
60
+ );
61
+ }
62
+
63
+ function CardAction({ className, ...props }: ComponentProps<"div">) {
64
+ return (
65
+ <div
66
+ data-slot="card-action"
67
+ className={cn(
68
+ "text-text-secondary",
69
+ "text-uk-sm",
70
+ "leading-uk-sm",
71
+ "font-medium",
72
+ "vertical-align-middle",
73
+ className,
74
+ )}
75
+ {...props}
76
+ />
77
+ );
78
+ }
79
+
80
+ function CardContent({ className, ...props }: ComponentProps<"div">) {
81
+ return <div data-slot="card-content" className={cn("", className)} {...props} />;
82
+ }
83
+
84
+ function CardFooter({ className, ...props }: ComponentProps<"div">) {
85
+ return <div data-slot="card-footer" className={cn("flex items-center", className)} {...props} />;
86
+ }
87
+
88
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };