@syscore/ui-library 1.1.11 → 1.1.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.
- package/client/components/icons/AchievementBadges.tsx +33 -0
- package/client/components/icons/ConceptIcons.tsx +169 -22
- package/client/components/icons/NavLogo.tsx +4 -4
- package/client/components/icons/ProviderBadges.tsx +28 -28
- package/client/components/icons/ProviderSeals.tsx +35 -35
- package/client/components/icons/StandardLogo.tsx +47 -0
- package/client/components/icons/UtilityChevronDown.tsx +1 -1
- package/client/components/icons/UtilityClearRegular.tsx +43 -0
- package/client/components/icons/UtilityCompare.tsx +71 -0
- package/client/components/icons/UtilityHome.tsx +26 -0
- package/client/components/icons/UtilityReset.tsx +7 -7
- package/client/components/icons/UtilitySave.tsx +35 -0
- package/client/components/icons/UtilityScopeLarge.tsx +86 -0
- package/client/components/icons/UtilityShow.tsx +41 -0
- package/client/components/icons/UtilityTarget.tsx +21 -0
- package/client/components/icons/UtilityTargetActive.tsx +34 -0
- package/client/components/icons/UtilityText.tsx +8 -8
- package/client/components/ui/breadcrumb.tsx +26 -4
- package/client/components/ui/button.tsx +30 -18
- package/client/components/ui/card.tsx +2 -2
- package/client/components/ui/code-badge.tsx +25 -0
- package/client/components/ui/dialog.tsx +4 -4
- package/client/components/ui/input.tsx +53 -9
- package/client/components/ui/label.tsx +2 -2
- package/client/components/ui/{Navigation.tsx → navigation.tsx} +291 -250
- package/client/components/ui/select.tsx +20 -20
- package/client/components/ui/tabs.tsx +27 -178
- package/client/components/ui/{Tag.tsx → tag.tsx} +11 -10
- package/client/components/ui/textarea.tsx +1 -1
- package/client/components/ui/toggle-group.tsx +19 -2
- package/client/components/ui/toggle.tsx +2 -2
- package/client/components/ui/tooltip.tsx +148 -8
- package/client/global.css +18 -11
- package/client/ui/AspectRatio.stories.tsx +1 -1
- package/client/ui/Button.stories.tsx +5 -5
- package/client/ui/Card.stories.tsx +223 -2
- package/client/ui/CodeBadge.stories.tsx +76 -0
- package/client/ui/Dialog.stories.tsx +52 -5
- package/client/ui/Icons.stories.tsx +31 -31
- package/client/ui/Input.stories.tsx +125 -0
- package/client/ui/Label.stories.tsx +8 -11
- package/client/ui/Navigation.stories.tsx +1 -1
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/client/ui/SearchField.stories.tsx +1 -1
- package/client/ui/{Select/Select.stories.tsx → Select.stories.tsx} +2 -2
- package/client/ui/{Switch/Switch.stories.tsx → Switch.stories.tsx} +3 -3
- package/client/ui/Tabs.stories.tsx +174 -10
- package/client/ui/Tag.stories.tsx +48 -1
- package/client/ui/{Textarea/Textarea.stories.tsx → Textarea.stories.tsx} +9 -10
- package/client/ui/Toggle.stories.tsx +3 -3
- package/client/ui/Tooltip.stories.tsx +28 -4
- package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +1 -1
- package/client/ui/WELLDashboard/index.tsx +147 -51
- package/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +8 -1
- package/dist/ui/index.es.js +2127 -561
- package/package.json +2 -2
- package/client/components/ui/StrategyTable.tsx +0 -303
- package/client/ui/Input/Input.stories.tsx +0 -69
- package/client/ui/StrategyTable.stories.tsx +0 -138
- /package/client/components/ui/{SearchField.tsx → search.tsx} +0 -0
- /package/client/hooks/{UseTabs.tsx → use-tabs.tsx} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
|
-
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
4
3
|
|
|
5
4
|
import { cn } from "@/lib/utils";
|
|
5
|
+
import { UtilityChevronDown } from "../icons/UtilityChevronDown";
|
|
6
6
|
|
|
7
7
|
const Select = SelectPrimitive.Root;
|
|
8
8
|
|
|
@@ -17,15 +17,19 @@ const SelectTrigger = React.forwardRef<
|
|
|
17
17
|
<SelectPrimitive.Trigger
|
|
18
18
|
ref={ref}
|
|
19
19
|
className={cn(
|
|
20
|
-
"flex h-
|
|
20
|
+
"group flex h-12 w-full rounded-[6px] border border-gray-200 bg-white p-4 text-gray-800 ring-offset-background placeholder:font-normal placeholder:text-gray-500 focus:outline-none focus:ring-0 data-[state=open]:border-cyan-300 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
21
21
|
className,
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
|
24
24
|
>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
<div className="flex items-center justify-between w-full">
|
|
26
|
+
<span className=" text-gray-800 font-mazzard body-base font-medium">
|
|
27
|
+
{children}
|
|
28
|
+
</span>
|
|
29
|
+
<SelectPrimitive.Icon asChild>
|
|
30
|
+
<UtilityChevronDown className=" text-gray-600 group-data-[state=open]:rotate-180 transition-transform duration-200" />
|
|
31
|
+
</SelectPrimitive.Icon>
|
|
32
|
+
</div>
|
|
29
33
|
</SelectPrimitive.Trigger>
|
|
30
34
|
));
|
|
31
35
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
@@ -42,7 +46,7 @@ const SelectScrollUpButton = React.forwardRef<
|
|
|
42
46
|
)}
|
|
43
47
|
{...props}
|
|
44
48
|
>
|
|
45
|
-
<
|
|
49
|
+
<UtilityChevronDown />
|
|
46
50
|
</SelectPrimitive.ScrollUpButton>
|
|
47
51
|
));
|
|
48
52
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -59,7 +63,7 @@ const SelectScrollDownButton = React.forwardRef<
|
|
|
59
63
|
)}
|
|
60
64
|
{...props}
|
|
61
65
|
>
|
|
62
|
-
<
|
|
66
|
+
<UtilityChevronDown />
|
|
63
67
|
</SelectPrimitive.ScrollDownButton>
|
|
64
68
|
));
|
|
65
69
|
SelectScrollDownButton.displayName =
|
|
@@ -73,9 +77,8 @@ const SelectContent = React.forwardRef<
|
|
|
73
77
|
<SelectPrimitive.Content
|
|
74
78
|
ref={ref}
|
|
75
79
|
className={cn(
|
|
76
|
-
"relative z-50 max-h-96 min-w-32 overflow-hidden
|
|
77
|
-
|
|
78
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
80
|
+
"relative z-50 max-h-96 min-w-32 overflow-hidden border-cyan-300 bg-gray-700 text-gray-200 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 data-[side=bottom]:-mt-1 data-[side=bottom]:rounded-t-none data-[side=bottom]:rounded-b-[6px] data-[side=top]:border-b-0 data-[side=top]:rounded-t-[6px] data-[side=top]:rounded-b-none data-[side=top]:-mb-1 data-[side=top]:border-t data-[side=bottom]:border-b",
|
|
81
|
+
|
|
79
82
|
className,
|
|
80
83
|
)}
|
|
81
84
|
position={position}
|
|
@@ -84,7 +87,7 @@ const SelectContent = React.forwardRef<
|
|
|
84
87
|
<SelectScrollUpButton />
|
|
85
88
|
<SelectPrimitive.Viewport
|
|
86
89
|
className={cn(
|
|
87
|
-
"
|
|
90
|
+
"",
|
|
88
91
|
position === "popper" &&
|
|
89
92
|
"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)",
|
|
90
93
|
)}
|
|
@@ -103,7 +106,10 @@ const SelectLabel = React.forwardRef<
|
|
|
103
106
|
>(({ className, ...props }, ref) => (
|
|
104
107
|
<SelectPrimitive.Label
|
|
105
108
|
ref={ref}
|
|
106
|
-
className={cn(
|
|
109
|
+
className={cn(
|
|
110
|
+
"py-1.5 pl-8 pr-2 text-sm font-semibold font-mazzard",
|
|
111
|
+
className,
|
|
112
|
+
)}
|
|
107
113
|
{...props}
|
|
108
114
|
/>
|
|
109
115
|
));
|
|
@@ -116,17 +122,11 @@ const SelectItem = React.forwardRef<
|
|
|
116
122
|
<SelectPrimitive.Item
|
|
117
123
|
ref={ref}
|
|
118
124
|
className={cn(
|
|
119
|
-
"relative flex w-full cursor-default select-none items-center
|
|
125
|
+
"relative flex h-12 w-full cursor-default select-none items-center border-x border-cyan-300 px-4 outline-none focus:bg-[rgba(0,0,0,0.2)] data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
120
126
|
className,
|
|
121
127
|
)}
|
|
122
128
|
{...props}
|
|
123
129
|
>
|
|
124
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
125
|
-
<SelectPrimitive.ItemIndicator>
|
|
126
|
-
<Check className="h-4 w-4" />
|
|
127
|
-
</SelectPrimitive.ItemIndicator>
|
|
128
|
-
</span>
|
|
129
|
-
|
|
130
130
|
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
131
131
|
</SelectPrimitive.Item>
|
|
132
132
|
));
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
|
-
|
|
5
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
6
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
+
import { AnimatePresence, motion, Transition } from "motion/react";
|
|
7
6
|
|
|
8
|
-
import { useTabs, type Tab } from "
|
|
7
|
+
import { useTabs, type Tab as BaseTab } from "@/hooks/use-tabs";
|
|
9
8
|
import { cn } from "@/lib/utils";
|
|
10
9
|
|
|
10
|
+
export type Tab = BaseTab & {
|
|
11
|
+
content?: React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
11
14
|
interface AnimatedTabsProps {
|
|
12
15
|
tabs: Tab[];
|
|
13
16
|
}
|
|
@@ -18,177 +21,23 @@ const transition = {
|
|
|
18
21
|
duration: 0.15,
|
|
19
22
|
};
|
|
20
23
|
|
|
21
|
-
const getHoverAnimationProps = (hoveredRect: DOMRect, navRect: DOMRect) => ({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
24
|
+
// const getHoverAnimationProps = (hoveredRect: DOMRect, navRect: DOMRect) => ({
|
|
25
|
+
// x: hoveredRect.left - navRect.left - 10,
|
|
26
|
+
// y: hoveredRect.top - navRect.top - 4,
|
|
27
|
+
// width: hoveredRect.width + 20,
|
|
28
|
+
// height: hoveredRect.height + 10,
|
|
29
|
+
// });
|
|
27
30
|
|
|
28
31
|
const TabContent = ({ tab }: { tab: Tab }) => {
|
|
29
32
|
return (
|
|
30
33
|
<motion.div
|
|
34
|
+
key={tab.value}
|
|
31
35
|
initial={{ opacity: 0, y: 10 }}
|
|
32
36
|
animate={{ opacity: 1, y: 0 }}
|
|
33
37
|
exit={{ opacity: 0, y: -10 }}
|
|
34
|
-
transition={transition}
|
|
35
|
-
className="p-6 bg-zinc-50 dark:bg-zinc-900 rounded-lg mt-4 h-[55vh]"
|
|
38
|
+
transition={transition as Transition}
|
|
36
39
|
>
|
|
37
|
-
{tab.
|
|
38
|
-
<div className="space-y-6">
|
|
39
|
-
<div className="border-b pb-6 dark:border-zinc-800">
|
|
40
|
-
<h2 className="text-3xl font-bold mb-4">Welcome to Our Platform</h2>
|
|
41
|
-
<p className="text-zinc-600 dark:text-zinc-400 mb-4">
|
|
42
|
-
Discover a new way to manage your projects and collaborate with
|
|
43
|
-
your team.
|
|
44
|
-
</p>
|
|
45
|
-
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
46
|
-
<div className="p-4 bg-white dark:bg-zinc-800 rounded-lg">
|
|
47
|
-
<h3 className="font-semibold mb-2">Quick Start</h3>
|
|
48
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-400">
|
|
49
|
-
Get started with our platform in minutes
|
|
50
|
-
</p>
|
|
51
|
-
</div>
|
|
52
|
-
<div className="p-4 bg-white dark:bg-zinc-800 rounded-lg">
|
|
53
|
-
<h3 className="font-semibold mb-2">Latest Updates</h3>
|
|
54
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-400">
|
|
55
|
-
See what's new in our latest release
|
|
56
|
-
</p>
|
|
57
|
-
</div>
|
|
58
|
-
<div className="p-4 bg-white dark:bg-zinc-800 rounded-lg">
|
|
59
|
-
<h3 className="font-semibold mb-2">Resources</h3>
|
|
60
|
-
<p className="text-sm text-zinc-600 dark:text-zinc-400">
|
|
61
|
-
Access guides and documentation
|
|
62
|
-
</p>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
<div>
|
|
67
|
-
<h3 className="text-xl font-semibold mb-4">Recent Activity</h3>
|
|
68
|
-
<div className="space-y-3">
|
|
69
|
-
<div className="flex items-center gap-3 p-3 bg-white dark:bg-zinc-800 rounded-lg">
|
|
70
|
-
<div className="w-2 h-2 bg-green-500 rounded-full"></div>
|
|
71
|
-
<p className="text-sm">
|
|
72
|
-
Project "Marketing Campaign" was updated 2 hours ago
|
|
73
|
-
</p>
|
|
74
|
-
</div>
|
|
75
|
-
<div className="flex items-center gap-3 p-3 bg-white dark:bg-zinc-800 rounded-lg">
|
|
76
|
-
<div className="w-2 h-2 bg-blue-500 rounded-full"></div>
|
|
77
|
-
<p className="text-sm">
|
|
78
|
-
New team member John Doe joined the platform
|
|
79
|
-
</p>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
)}
|
|
85
|
-
{tab.value === "about" && (
|
|
86
|
-
<div className="space-y-8">
|
|
87
|
-
<div>
|
|
88
|
-
<h2 className="text-3xl font-bold mb-4">About Us</h2>
|
|
89
|
-
<p className="text-zinc-600 dark:text-zinc-400 mb-6">
|
|
90
|
-
We're a team of passionate individuals working together to
|
|
91
|
-
create amazing solutions for our clients.
|
|
92
|
-
</p>
|
|
93
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
94
|
-
<div>
|
|
95
|
-
<h3 className="text-xl font-semibold mb-3">Our Mission</h3>
|
|
96
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
97
|
-
To empower businesses with innovative tools and solutions that
|
|
98
|
-
drive growth and success in the digital age.
|
|
99
|
-
</p>
|
|
100
|
-
</div>
|
|
101
|
-
<div>
|
|
102
|
-
<h3 className="text-xl font-semibold mb-3">Our Vision</h3>
|
|
103
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
104
|
-
To become the leading platform for business transformation and
|
|
105
|
-
digital innovation worldwide.
|
|
106
|
-
</p>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
)}
|
|
112
|
-
{tab.value === "contact" && (
|
|
113
|
-
<div className="max-w-2xl mx-auto">
|
|
114
|
-
<h2 className="text-3xl font-bold mb-6">Get in Touch</h2>
|
|
115
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
|
|
116
|
-
<div>
|
|
117
|
-
<h3 className="text-xl font-semibold mb-4">
|
|
118
|
-
Contact Information
|
|
119
|
-
</h3>
|
|
120
|
-
<div className="space-y-4">
|
|
121
|
-
<div>
|
|
122
|
-
<p className="font-medium">Address</p>
|
|
123
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
124
|
-
123 Business Street
|
|
125
|
-
</p>
|
|
126
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
127
|
-
San Francisco, CA 94105
|
|
128
|
-
</p>
|
|
129
|
-
</div>
|
|
130
|
-
<div>
|
|
131
|
-
<p className="font-medium">Email</p>
|
|
132
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
133
|
-
contact@example.com
|
|
134
|
-
</p>
|
|
135
|
-
</div>
|
|
136
|
-
<div>
|
|
137
|
-
<p className="font-medium">Phone</p>
|
|
138
|
-
<p className="text-zinc-600 dark:text-zinc-400">
|
|
139
|
-
+1 (555) 123-4567
|
|
140
|
-
</p>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
<div className="space-y-4">
|
|
145
|
-
<div>
|
|
146
|
-
<label className="block text-sm font-medium mb-1">Name</label>
|
|
147
|
-
<input
|
|
148
|
-
type="text"
|
|
149
|
-
className="w-full p-2 rounded-md border dark:bg-zinc-800 dark:border-zinc-700"
|
|
150
|
-
/>
|
|
151
|
-
</div>
|
|
152
|
-
<div>
|
|
153
|
-
<label className="block text-sm font-medium mb-1">Email</label>
|
|
154
|
-
<input
|
|
155
|
-
type="email"
|
|
156
|
-
className="w-full p-2 rounded-md border dark:bg-zinc-800 dark:border-zinc-700"
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
<button className="w-full bg-black text-white dark:bg-white dark:text-black py-2 rounded-md font-medium">
|
|
160
|
-
Send Message
|
|
161
|
-
</button>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
)}
|
|
166
|
-
{tab.value === "danger-zone" && (
|
|
167
|
-
<div className="max-w-2xl mx-auto">
|
|
168
|
-
<h2 className="text-2xl font-bold mb-6 text-red-500">Caution!</h2>
|
|
169
|
-
<div className="space-y-6">
|
|
170
|
-
<div className="border border-red-200 dark:border-red-900 rounded-lg p-6 bg-red-50 dark:bg-red-900/20">
|
|
171
|
-
<h3 className="text-lg font-semibold text-red-600 dark:text-red-400 mb-2">
|
|
172
|
-
Delete Account
|
|
173
|
-
</h3>
|
|
174
|
-
<p className="text-red-600/80 dark:text-red-400/80 mb-4">
|
|
175
|
-
This action cannot be undone. This will permanently delete your
|
|
176
|
-
account and remove your data from our servers.
|
|
177
|
-
</p>
|
|
178
|
-
<div className="flex items-center gap-4">
|
|
179
|
-
<input
|
|
180
|
-
type="text"
|
|
181
|
-
placeholder="Type 'delete' to confirm"
|
|
182
|
-
className="flex-1 p-2 rounded-md border border-red-200 dark:border-red-800 dark:bg-red-900/30"
|
|
183
|
-
/>
|
|
184
|
-
<button className="bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors">
|
|
185
|
-
Delete Account
|
|
186
|
-
</button>
|
|
187
|
-
</div>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</div>
|
|
191
|
-
)}
|
|
40
|
+
{tab.content}
|
|
192
41
|
</motion.div>
|
|
193
42
|
);
|
|
194
43
|
};
|
|
@@ -224,7 +73,7 @@ const Tabs = ({
|
|
|
224
73
|
return (
|
|
225
74
|
<nav
|
|
226
75
|
ref={navRef}
|
|
227
|
-
className="flex
|
|
76
|
+
className="flex shrink-0 justify-center items-center relative z-0 py-2 gap-x-10"
|
|
228
77
|
onPointerLeave={() => setHoveredTabIndex(null)}
|
|
229
78
|
>
|
|
230
79
|
{tabs.map((item, i) => {
|
|
@@ -233,7 +82,7 @@ const Tabs = ({
|
|
|
233
82
|
return (
|
|
234
83
|
<button
|
|
235
84
|
key={item.value}
|
|
236
|
-
className="
|
|
85
|
+
className=" overline-large relative rounded-md flex items-center h-8 z-20 bg-transparent cursor-pointer select-none transition-colors"
|
|
237
86
|
onPointerEnter={() => setHoveredTabIndex(i)}
|
|
238
87
|
onFocus={() => setHoveredTabIndex(i)}
|
|
239
88
|
onClick={() => setSelectedTab([i, i > selectedTabIndex ? 1 : -1])}
|
|
@@ -257,7 +106,7 @@ const Tabs = ({
|
|
|
257
106
|
);
|
|
258
107
|
})}
|
|
259
108
|
|
|
260
|
-
<AnimatePresence>
|
|
109
|
+
{/* <AnimatePresence>
|
|
261
110
|
{hoveredRect && navRect && (
|
|
262
111
|
<motion.div
|
|
263
112
|
key="hover"
|
|
@@ -279,10 +128,10 @@ const Tabs = ({
|
|
|
279
128
|
...getHoverAnimationProps(hoveredRect, navRect),
|
|
280
129
|
opacity: 0,
|
|
281
130
|
}}
|
|
282
|
-
transition={transition}
|
|
131
|
+
transition={transition as Transition}
|
|
283
132
|
/>
|
|
284
133
|
)}
|
|
285
|
-
</AnimatePresence>
|
|
134
|
+
</AnimatePresence> */}
|
|
286
135
|
|
|
287
136
|
<AnimatePresence>
|
|
288
137
|
{selectedRect && navRect && (
|
|
@@ -295,14 +144,16 @@ const Tabs = ({
|
|
|
295
144
|
}`}
|
|
296
145
|
initial={false}
|
|
297
146
|
animate={{
|
|
298
|
-
width: selectedRect.width
|
|
299
|
-
x:
|
|
147
|
+
width: selectedRect.width,
|
|
148
|
+
x: selectedRect.left - navRect.left,
|
|
300
149
|
opacity: 1,
|
|
301
150
|
}}
|
|
302
|
-
transition={transition}
|
|
151
|
+
transition={transition as Transition}
|
|
303
152
|
/>
|
|
304
153
|
)}
|
|
305
154
|
</AnimatePresence>
|
|
155
|
+
|
|
156
|
+
<div className="absolute bottom-0 left-0 w-full h-[2px] bg-gray-200" />
|
|
306
157
|
</nav>
|
|
307
158
|
);
|
|
308
159
|
};
|
|
@@ -313,10 +164,8 @@ export function AnimatedTabs({ tabs }: AnimatedTabsProps) {
|
|
|
313
164
|
tabs.find((tab) => tab.value === "home")?.value || tabs[0].value;
|
|
314
165
|
|
|
315
166
|
return {
|
|
316
|
-
tabs: tabs.map((
|
|
317
|
-
|
|
318
|
-
value,
|
|
319
|
-
subRoutes,
|
|
167
|
+
tabs: tabs.map((tab) => ({
|
|
168
|
+
...tab,
|
|
320
169
|
})),
|
|
321
170
|
initialTabId,
|
|
322
171
|
};
|
|
@@ -14,7 +14,7 @@ export interface TagProps
|
|
|
14
14
|
|
|
15
15
|
const getStatusColors = (
|
|
16
16
|
status: TagStatus,
|
|
17
|
-
variant: "light" | "dark" = "light"
|
|
17
|
+
variant: "light" | "dark" = "light"
|
|
18
18
|
) => {
|
|
19
19
|
const colors = {
|
|
20
20
|
light: {
|
|
@@ -77,7 +77,7 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
77
77
|
onClick,
|
|
78
78
|
...props
|
|
79
79
|
},
|
|
80
|
-
ref
|
|
80
|
+
ref
|
|
81
81
|
) => {
|
|
82
82
|
// Status tag styling
|
|
83
83
|
if (status) {
|
|
@@ -87,12 +87,12 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
87
87
|
ref={ref}
|
|
88
88
|
onClick={onClick}
|
|
89
89
|
className={cn(
|
|
90
|
-
"inline-flex items-center p-[8px] rounded-
|
|
90
|
+
"inline-flex items-center p-[8px] rounded-sm w-fit",
|
|
91
91
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
92
92
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
93
93
|
statusColors.bg,
|
|
94
94
|
statusColors.text,
|
|
95
|
-
className
|
|
95
|
+
className
|
|
96
96
|
)}
|
|
97
97
|
{...props}
|
|
98
98
|
>
|
|
@@ -107,21 +107,22 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
107
107
|
ref={ref}
|
|
108
108
|
onClick={onClick}
|
|
109
109
|
className={cn(
|
|
110
|
-
"inline-flex items-center h-[32px] px-[12px] py-0 rounded-
|
|
110
|
+
"inline-flex items-center h-[32px] px-[12px] py-0 rounded-sm w-fit cursor-pointer",
|
|
111
111
|
|
|
112
112
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
113
113
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
114
|
+
"transition-all duration-200",
|
|
114
115
|
active
|
|
115
|
-
? "bg-
|
|
116
|
-
: "bg-blue-100 text-blue-700 hover:bg-
|
|
117
|
-
className
|
|
116
|
+
? "bg-cyan-700 text-white hover:border-cyan-700"
|
|
117
|
+
: "bg-blue-100 text-blue-700 hover:bg-cyan-700 hover:text-white",
|
|
118
|
+
className
|
|
118
119
|
)}
|
|
119
120
|
{...props}
|
|
120
121
|
>
|
|
121
|
-
<span className="body-small font-
|
|
122
|
+
<span className="body-small font-semibold">{children}</span>
|
|
122
123
|
</button>
|
|
123
124
|
);
|
|
124
|
-
}
|
|
125
|
+
}
|
|
125
126
|
);
|
|
126
127
|
|
|
127
128
|
Tag.displayName = "Tag";
|
|
@@ -10,7 +10,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
10
10
|
return (
|
|
11
11
|
<textarea
|
|
12
12
|
className={cn(
|
|
13
|
-
"flex min-h-[80px] w-full rounded-
|
|
13
|
+
"flex min-h-[80px] w-full rounded-[6px] border border-gray-200 bg-white p-4 body-base font-medium text-gray-800 placeholder:font-normal placeholder:text-gray-500 focus:border-cyan-300 focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:border-blue-200 disabled:bg-transparent ring-0",
|
|
14
14
|
className,
|
|
15
15
|
)}
|
|
16
16
|
ref={ref}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
const toggleVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-gray-100 text-gray-600 hover:bg-gray-200",
|
|
13
|
+
},
|
|
14
|
+
size: {
|
|
15
|
+
default: "h-8 px-4",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "default",
|
|
20
|
+
size: "default",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
);
|
|
7
24
|
|
|
8
25
|
const ToggleGroupContext = React.createContext<
|
|
9
26
|
VariantProps<typeof toggleVariants>
|
|
@@ -50,7 +50,7 @@ const SegmentedControlInner = React.forwardRef<
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
|
-
<div ref={ref} className={cn(className)} {...props}>
|
|
53
|
+
<div ref={ref} className={cn("inline-flex", className)} {...props}>
|
|
54
54
|
{options.map((option) => {
|
|
55
55
|
const isReactElement = React.isValidElement(option.label);
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@ const SegmentedControlInner = React.forwardRef<
|
|
|
58
58
|
<button
|
|
59
59
|
key={option.value}
|
|
60
60
|
className={cn(
|
|
61
|
-
"inline-flex items-center justify-center h-8 px-
|
|
61
|
+
"inline-flex items-center justify-center h-8 px-4 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring cursor-pointer",
|
|
62
62
|
selectedValue === option.value
|
|
63
63
|
? "bg-cyan-700 text-white font-semibold"
|
|
64
64
|
: "text-gray-600 hover:bg-gray-50 font-medium",
|