@syscore/ui-library 1.1.12 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/accordion.tsx +6 -9
- package/client/components/ui/alert-dialog.tsx +6 -19
- package/client/components/ui/alert.tsx +5 -6
- package/client/components/ui/avatar.tsx +3 -9
- package/client/components/ui/badge.tsx +5 -8
- package/client/components/ui/breadcrumb.tsx +24 -11
- package/client/components/ui/button.tsx +40 -56
- package/client/components/ui/calendar.tsx +24 -28
- package/client/components/ui/card.tsx +6 -9
- package/client/components/ui/carousel.tsx +14 -14
- package/client/components/ui/chart.tsx +25 -28
- package/client/components/ui/checkbox.tsx +3 -8
- package/client/components/ui/code-badge.tsx +22 -0
- package/client/components/ui/command.tsx +12 -48
- package/client/components/ui/context-menu.tsx +17 -32
- package/client/components/ui/dialog.tsx +9 -18
- package/client/components/ui/drawer.tsx +7 -13
- package/client/components/ui/dropdown-menu.tsx +17 -29
- package/client/components/ui/form.tsx +4 -4
- package/client/components/ui/hover-card.tsx +1 -4
- package/client/components/ui/input-otp.tsx +7 -10
- package/client/components/ui/input.tsx +34 -9
- package/client/components/ui/label.tsx +2 -4
- package/client/components/ui/menubar.tsx +19 -40
- package/client/components/ui/navigation-menu.tsx +10 -27
- package/client/components/ui/navigation.tsx +861 -0
- package/client/components/ui/pagination.tsx +8 -8
- package/client/components/ui/popover.tsx +1 -4
- package/client/components/ui/progress.tsx +2 -5
- package/client/components/ui/radio-group.tsx +4 -7
- package/client/components/ui/resizable.tsx +4 -10
- package/client/components/ui/scroll-area.tsx +5 -8
- package/client/components/ui/{SearchField.tsx → search.tsx} +7 -10
- package/client/components/ui/select.tsx +19 -44
- package/client/components/ui/separator.tsx +2 -2
- package/client/components/ui/sheet.tsx +12 -23
- package/client/components/ui/sidebar.tsx +55 -82
- package/client/components/ui/skeleton.tsx +1 -1
- package/client/components/ui/slider.tsx +4 -7
- package/client/components/ui/sonner.tsx +5 -8
- package/client/components/ui/switch.tsx +2 -9
- package/client/components/ui/table.tsx +9 -18
- package/client/components/ui/tabs.tsx +43 -203
- package/client/components/ui/tag.tsx +68 -0
- package/client/components/ui/textarea.tsx +1 -4
- package/client/components/ui/toast.tsx +9 -19
- package/client/components/ui/toaster.tsx +1 -1
- package/client/components/ui/toggle-group.tsx +20 -3
- package/client/components/ui/toggle.tsx +13 -13
- package/client/components/ui/tooltip.tsx +147 -10
- package/client/global.css +5421 -1049
- package/client/storybook.css +1164 -0
- 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/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +4 -6
- package/dist/ui/index.es.js +1227 -2235
- package/dist/ui/ui-library.css +1 -0
- package/package.json +3 -3
- package/client/components/ui/Navigation.tsx +0 -958
- package/client/components/ui/StrategyTable.tsx +0 -303
- package/client/components/ui/Tag.tsx +0 -127
- package/client/ui/Input/Input.stories.tsx +0 -69
- package/client/ui/StrategyTable.stories.tsx +0 -138
- package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +0 -115
- package/client/ui/WELLDashboard/index.tsx +0 -317
- /package/client/hooks/{UseTabs.tsx → use-tabs.tsx} +0 -0
|
@@ -1,303 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
import { UtilityChevronDown } from "../icons/UtilityChevronDown";
|
|
4
|
-
|
|
5
|
-
// Define the concept colors matching Figma design
|
|
6
|
-
export const conceptColors = {
|
|
7
|
-
mind: {
|
|
8
|
-
solid: "#0a5161",
|
|
9
|
-
light: "rgba(10,81,97,0.08)",
|
|
10
|
-
border: "rgba(10,81,97,0.16)",
|
|
11
|
-
prefix: "M",
|
|
12
|
-
},
|
|
13
|
-
community: {
|
|
14
|
-
solid: "#0f748a",
|
|
15
|
-
light: "rgba(15,116,138,0.12)",
|
|
16
|
-
border: "rgba(15,116,138,0.24)",
|
|
17
|
-
prefix: "C",
|
|
18
|
-
},
|
|
19
|
-
movement: {
|
|
20
|
-
solid: "#149ebd",
|
|
21
|
-
light: "rgba(20,158,189,0.12)",
|
|
22
|
-
border: "rgba(20,158,189,0.24)",
|
|
23
|
-
prefix: "V",
|
|
24
|
-
},
|
|
25
|
-
water: {
|
|
26
|
-
solid: "#39c9ea",
|
|
27
|
-
light: "rgba(57,201,234,0.12)",
|
|
28
|
-
border: "rgba(57,201,234,0.24)",
|
|
29
|
-
prefix: "W",
|
|
30
|
-
},
|
|
31
|
-
air: {
|
|
32
|
-
solid: "#87dff2",
|
|
33
|
-
light: "rgba(135,223,242,0.12)",
|
|
34
|
-
border: "rgba(135,223,242,0.24)",
|
|
35
|
-
prefix: "A",
|
|
36
|
-
},
|
|
37
|
-
light: {
|
|
38
|
-
solid: "#8aefdb",
|
|
39
|
-
light: "rgba(138,239,219,0.12)",
|
|
40
|
-
border: "rgba(138,239,219,0.24)",
|
|
41
|
-
prefix: "L",
|
|
42
|
-
},
|
|
43
|
-
thermalComfort: {
|
|
44
|
-
solid: "#3eddbf",
|
|
45
|
-
light: "rgba(62,221,191,0.12)",
|
|
46
|
-
border: "rgba(62,221,191,0.24)",
|
|
47
|
-
prefix: "T",
|
|
48
|
-
},
|
|
49
|
-
nourishment: {
|
|
50
|
-
solid: "#17aa8d",
|
|
51
|
-
light: "rgba(23,170,141,0.12)",
|
|
52
|
-
border: "rgba(23,170,141,0.24)",
|
|
53
|
-
prefix: "N",
|
|
54
|
-
},
|
|
55
|
-
sound: {
|
|
56
|
-
solid: "#0c705c",
|
|
57
|
-
light: "rgba(12,112,92,0.12)",
|
|
58
|
-
border: "rgba(12,112,92,0.24)",
|
|
59
|
-
prefix: "S",
|
|
60
|
-
},
|
|
61
|
-
materials: {
|
|
62
|
-
solid: "#0a4f41",
|
|
63
|
-
light: "rgba(10,79,65,0.08)",
|
|
64
|
-
border: "rgba(10,79,65,0.16)",
|
|
65
|
-
prefix: "X",
|
|
66
|
-
},
|
|
67
|
-
} as const;
|
|
68
|
-
|
|
69
|
-
export type ConceptType = keyof typeof conceptColors;
|
|
70
|
-
|
|
71
|
-
export interface StrategyItem {
|
|
72
|
-
id: string;
|
|
73
|
-
code: string;
|
|
74
|
-
name: string;
|
|
75
|
-
score?: string;
|
|
76
|
-
hasTarget?: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface ThemeItem {
|
|
80
|
-
id: string;
|
|
81
|
-
code: string;
|
|
82
|
-
name: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface ConceptItem {
|
|
86
|
-
id: string;
|
|
87
|
-
type: ConceptType;
|
|
88
|
-
name: string;
|
|
89
|
-
icon: React.ReactNode;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface StrategyTableData {
|
|
93
|
-
concept: ConceptItem;
|
|
94
|
-
theme: ThemeItem;
|
|
95
|
-
strategies: StrategyItem[];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
interface StrategyTableRowProps {
|
|
99
|
-
data: StrategyTableData;
|
|
100
|
-
isFirst?: boolean;
|
|
101
|
-
isLast?: boolean;
|
|
102
|
-
showConceptHeader?: boolean;
|
|
103
|
-
isExpanded?: boolean;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const StrategyTableRow: React.FC<StrategyTableRowProps> = ({
|
|
107
|
-
data,
|
|
108
|
-
isFirst = false,
|
|
109
|
-
isLast = false,
|
|
110
|
-
showConceptHeader = true,
|
|
111
|
-
isExpanded = true,
|
|
112
|
-
}) => {
|
|
113
|
-
const { concept, theme, strategies } = data;
|
|
114
|
-
const colors = conceptColors[concept.type];
|
|
115
|
-
|
|
116
|
-
return (
|
|
117
|
-
<>
|
|
118
|
-
{/* Concept Row - always visible when showConceptHeader is true */}
|
|
119
|
-
{showConceptHeader && (
|
|
120
|
-
<div
|
|
121
|
-
className={cn(
|
|
122
|
-
"flex items-center gap-4 p-4 border border-[#DEDFE3] bg-[#FAFEFF]",
|
|
123
|
-
"border-b-0",
|
|
124
|
-
isFirst && "rounded-tl-[12px] rounded-tr-[12px]"
|
|
125
|
-
)}
|
|
126
|
-
>
|
|
127
|
-
{/* Icon */}
|
|
128
|
-
<div className="size-[48px] flex items-center justify-center shrink-0">
|
|
129
|
-
{concept.icon}
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
|
-
{/* Name */}
|
|
133
|
-
<div className="flex-1">
|
|
134
|
-
<span className="text-sm font-semibold text-[#282A31] uppercase tracking-[0.5px] leading-[14px]">
|
|
135
|
-
{concept.name}
|
|
136
|
-
</span>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
)}
|
|
140
|
-
|
|
141
|
-
{/* Theme Row - only show if expanded */}
|
|
142
|
-
{isExpanded && (
|
|
143
|
-
<div className="flex items-center gap-4 p-4 border border-[#DEDFE3] bg-[#FAFEFF] border-b-0">
|
|
144
|
-
{/* Code Badge */}
|
|
145
|
-
<div
|
|
146
|
-
className="flex items-center justify-center h-8 w-12 rounded-[6px] shrink-0"
|
|
147
|
-
style={{ backgroundColor: colors.solid }}
|
|
148
|
-
>
|
|
149
|
-
<span className="text-sm font-semibold text-white leading-[19.6px]">
|
|
150
|
-
{theme.code}
|
|
151
|
-
</span>
|
|
152
|
-
</div>
|
|
153
|
-
|
|
154
|
-
{/* Name */}
|
|
155
|
-
<div className="flex-1">
|
|
156
|
-
<span className="text-base font-medium text-[#282A31] leading-[21px]">
|
|
157
|
-
{theme.name}
|
|
158
|
-
</span>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
)}
|
|
162
|
-
|
|
163
|
-
{/* Strategy Rows - only show if expanded */}
|
|
164
|
-
{isExpanded && strategies.map((strategy, index) => {
|
|
165
|
-
const isLastStrategy = index === strategies.length - 1 && isLast;
|
|
166
|
-
const scoreParts = strategy.score?.split("–") || [];
|
|
167
|
-
const isRange = scoreParts.length > 1;
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<div
|
|
171
|
-
key={strategy.id}
|
|
172
|
-
className={cn(
|
|
173
|
-
"flex items-center gap-4 pl-8 pr-4 py-4 border border-[#DEDFE3] bg-white",
|
|
174
|
-
"border-b-0",
|
|
175
|
-
isLastStrategy && "rounded-bl-[12px] rounded-br-[12px] border-b-0"
|
|
176
|
-
)}
|
|
177
|
-
>
|
|
178
|
-
{/* Code Badge */}
|
|
179
|
-
<div
|
|
180
|
-
className="flex items-center justify-center h-8 w-12 rounded-[6px] border shrink-0"
|
|
181
|
-
style={{
|
|
182
|
-
backgroundColor: colors.light,
|
|
183
|
-
borderColor: colors.border,
|
|
184
|
-
}}
|
|
185
|
-
>
|
|
186
|
-
<span
|
|
187
|
-
className="text-sm font-semibold leading-[19.6px]"
|
|
188
|
-
style={{ color: colors.solid }}
|
|
189
|
-
>
|
|
190
|
-
{strategy.code}
|
|
191
|
-
</span>
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
{/* Name */}
|
|
195
|
-
<div className="flex-1">
|
|
196
|
-
<span className="text-base font-medium text-[#282A31] leading-[21px]">
|
|
197
|
-
{strategy.name}
|
|
198
|
-
</span>
|
|
199
|
-
</div>
|
|
200
|
-
|
|
201
|
-
{/* Actions */}
|
|
202
|
-
<div className="flex items-center gap-4 shrink-0">
|
|
203
|
-
{strategy.hasTarget && (
|
|
204
|
-
<div className="size-8 flex items-center justify-center">
|
|
205
|
-
<svg
|
|
206
|
-
width="14"
|
|
207
|
-
height="14"
|
|
208
|
-
viewBox="0 0 14 14"
|
|
209
|
-
fill="none"
|
|
210
|
-
className="text-gray-400"
|
|
211
|
-
>
|
|
212
|
-
<circle
|
|
213
|
-
cx="7"
|
|
214
|
-
cy="7"
|
|
215
|
-
r="6.25"
|
|
216
|
-
stroke="currentColor"
|
|
217
|
-
strokeWidth="1.5"
|
|
218
|
-
/>
|
|
219
|
-
<circle
|
|
220
|
-
cx="7"
|
|
221
|
-
cy="7"
|
|
222
|
-
r="3.5"
|
|
223
|
-
stroke="currentColor"
|
|
224
|
-
strokeWidth="1.5"
|
|
225
|
-
/>
|
|
226
|
-
<circle cx="7" cy="7" r="1" fill="currentColor" />
|
|
227
|
-
</svg>
|
|
228
|
-
</div>
|
|
229
|
-
)}
|
|
230
|
-
|
|
231
|
-
{strategy.score && (
|
|
232
|
-
<div className="flex items-end gap-[4px]">
|
|
233
|
-
<span className="text-lg font-semibold text-[#282A31] leading-[25.2px]">
|
|
234
|
-
{strategy.score}
|
|
235
|
-
</span>
|
|
236
|
-
<span className="text-xs font-semibold text-[#282A31] uppercase tracking-[0.5px] leading-[12px]">
|
|
237
|
-
{isRange ? "PTS" : "PT"}
|
|
238
|
-
{!isRange && <span className="text-transparent">S</span>}
|
|
239
|
-
</span>
|
|
240
|
-
</div>
|
|
241
|
-
)}
|
|
242
|
-
</div>
|
|
243
|
-
</div>
|
|
244
|
-
);
|
|
245
|
-
})}
|
|
246
|
-
</>
|
|
247
|
-
);
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
interface StrategyTableProps {
|
|
251
|
-
data: StrategyTableData[];
|
|
252
|
-
className?: string;
|
|
253
|
-
isExpanded?: boolean;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export const StrategyTable: React.FC<StrategyTableProps> = ({
|
|
257
|
-
data,
|
|
258
|
-
className,
|
|
259
|
-
isExpanded = true,
|
|
260
|
-
}) => {
|
|
261
|
-
// Group by concept to avoid duplicate concept headers
|
|
262
|
-
const groupedData = React.useMemo(() => {
|
|
263
|
-
const groups: Record<string, StrategyTableData[]> = {};
|
|
264
|
-
data.forEach((item) => {
|
|
265
|
-
const key = item.concept.id;
|
|
266
|
-
if (!groups[key]) {
|
|
267
|
-
groups[key] = [];
|
|
268
|
-
}
|
|
269
|
-
groups[key].push(item);
|
|
270
|
-
});
|
|
271
|
-
return Object.values(groups);
|
|
272
|
-
}, [data]);
|
|
273
|
-
|
|
274
|
-
return (
|
|
275
|
-
<div className={cn("flex flex-col", className)}>
|
|
276
|
-
{groupedData.map((group, groupIndex) => {
|
|
277
|
-
const isFirstGroup = groupIndex === 0;
|
|
278
|
-
const isLastGroup = groupIndex === groupedData.length - 1;
|
|
279
|
-
|
|
280
|
-
return group.map((item, itemIndex) => {
|
|
281
|
-
const isFirst = isFirstGroup && itemIndex === 0;
|
|
282
|
-
const isLastItemInGroup = itemIndex === group.length - 1;
|
|
283
|
-
// Check if this is the very last strategy row across all groups
|
|
284
|
-
const isLastStrategyRow = isLastGroup && isLastItemInGroup && item.strategies.length > 0;
|
|
285
|
-
const showConceptHeader = itemIndex === 0; // Only show concept header for first theme
|
|
286
|
-
const uniqueId = `${item.concept.id}-${item.theme.id}`;
|
|
287
|
-
|
|
288
|
-
return (
|
|
289
|
-
<StrategyTableRow
|
|
290
|
-
key={uniqueId}
|
|
291
|
-
data={item}
|
|
292
|
-
isFirst={isFirst}
|
|
293
|
-
isLast={isLastStrategyRow}
|
|
294
|
-
showConceptHeader={showConceptHeader}
|
|
295
|
-
isExpanded={isExpanded}
|
|
296
|
-
/>
|
|
297
|
-
);
|
|
298
|
-
});
|
|
299
|
-
})}
|
|
300
|
-
</div>
|
|
301
|
-
);
|
|
302
|
-
};
|
|
303
|
-
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
|
|
4
|
-
export type TagStatus = "todo" | "low" | "medium" | "high" | "done";
|
|
5
|
-
|
|
6
|
-
export interface TagProps
|
|
7
|
-
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
active?: boolean;
|
|
10
|
-
status?: TagStatus;
|
|
11
|
-
variant?: "light" | "dark";
|
|
12
|
-
onClick?: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const getStatusColors = (
|
|
16
|
-
status: TagStatus,
|
|
17
|
-
variant: "light" | "dark" = "light",
|
|
18
|
-
) => {
|
|
19
|
-
const colors = {
|
|
20
|
-
light: {
|
|
21
|
-
todo: {
|
|
22
|
-
bg: "bg-gray-100",
|
|
23
|
-
text: "text-gray-600",
|
|
24
|
-
},
|
|
25
|
-
low: {
|
|
26
|
-
bg: "bg-cyan-100",
|
|
27
|
-
text: "text-cyan-600",
|
|
28
|
-
},
|
|
29
|
-
medium: {
|
|
30
|
-
bg: "bg-plum-100",
|
|
31
|
-
text: "text-plum-600",
|
|
32
|
-
},
|
|
33
|
-
high: {
|
|
34
|
-
bg: "bg-coral-100",
|
|
35
|
-
text: "text-coral-600",
|
|
36
|
-
},
|
|
37
|
-
done: {
|
|
38
|
-
bg: "bg-emerald-100",
|
|
39
|
-
text: "text-emerald-600",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
dark: {
|
|
43
|
-
todo: {
|
|
44
|
-
bg: "bg-gray-600",
|
|
45
|
-
text: "text-gray-100",
|
|
46
|
-
},
|
|
47
|
-
low: {
|
|
48
|
-
bg: "bg-cyan-700",
|
|
49
|
-
text: "text-cyan-100",
|
|
50
|
-
},
|
|
51
|
-
medium: {
|
|
52
|
-
bg: "bg-plum-700",
|
|
53
|
-
text: "text-plum-100",
|
|
54
|
-
},
|
|
55
|
-
high: {
|
|
56
|
-
bg: "bg-coral-700",
|
|
57
|
-
text: "text-coral-100",
|
|
58
|
-
},
|
|
59
|
-
done: {
|
|
60
|
-
bg: "bg-emerald-700",
|
|
61
|
-
text: "text-emerald-100",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return colors[variant][status];
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
70
|
-
(
|
|
71
|
-
{
|
|
72
|
-
children,
|
|
73
|
-
active = false,
|
|
74
|
-
status,
|
|
75
|
-
variant = "light",
|
|
76
|
-
className,
|
|
77
|
-
onClick,
|
|
78
|
-
...props
|
|
79
|
-
},
|
|
80
|
-
ref,
|
|
81
|
-
) => {
|
|
82
|
-
// Status tag styling
|
|
83
|
-
if (status) {
|
|
84
|
-
const statusColors = getStatusColors(status, variant);
|
|
85
|
-
return (
|
|
86
|
-
<button
|
|
87
|
-
ref={ref}
|
|
88
|
-
onClick={onClick}
|
|
89
|
-
className={cn(
|
|
90
|
-
"inline-flex items-center p-[8px] rounded-[6px] w-fit",
|
|
91
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
92
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
93
|
-
statusColors.bg,
|
|
94
|
-
statusColors.text,
|
|
95
|
-
className,
|
|
96
|
-
)}
|
|
97
|
-
{...props}
|
|
98
|
-
>
|
|
99
|
-
<span className="overline-medium">{children}</span>
|
|
100
|
-
</button>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Dual-state general purpose tag styling
|
|
105
|
-
return (
|
|
106
|
-
<button
|
|
107
|
-
ref={ref}
|
|
108
|
-
onClick={onClick}
|
|
109
|
-
className={cn(
|
|
110
|
-
"inline-flex items-center h-[32px] px-[12px] py-0 rounded-[6px] w-fit",
|
|
111
|
-
|
|
112
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
113
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
114
|
-
active
|
|
115
|
-
? "bg-white border border-cyan-300 text-gray-800 hover:border-cyan-400"
|
|
116
|
-
: "bg-blue-100 text-blue-700 hover:bg-blue-200",
|
|
117
|
-
className,
|
|
118
|
-
)}
|
|
119
|
-
{...props}
|
|
120
|
-
>
|
|
121
|
-
<span className="body-small font-medium">{children}</span>
|
|
122
|
-
</button>
|
|
123
|
-
);
|
|
124
|
-
},
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
Tag.displayName = "Tag";
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Input } from "../../components/ui/input";
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "UI/Input",
|
|
6
|
-
component: Input,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
},
|
|
11
|
-
} satisfies Meta<typeof Input>;
|
|
12
|
-
|
|
13
|
-
export default meta;
|
|
14
|
-
|
|
15
|
-
type Story = StoryObj<typeof meta>;
|
|
16
|
-
|
|
17
|
-
export const Default: Story = {
|
|
18
|
-
args: {
|
|
19
|
-
placeholder: "Enter text...",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const WithType: Story = {
|
|
24
|
-
render: () => (
|
|
25
|
-
<div className="space-y-4 w-full max-w-md">
|
|
26
|
-
<div>
|
|
27
|
-
<label className="text-sm font-medium mb-2 block">Text</label>
|
|
28
|
-
<Input type="text" placeholder="Enter text..." />
|
|
29
|
-
</div>
|
|
30
|
-
<div>
|
|
31
|
-
<label className="text-sm font-medium mb-2 block">Email</label>
|
|
32
|
-
<Input type="email" placeholder="Enter email..." />
|
|
33
|
-
</div>
|
|
34
|
-
<div>
|
|
35
|
-
<label className="text-sm font-medium mb-2 block">Password</label>
|
|
36
|
-
<Input type="password" placeholder="Enter password..." />
|
|
37
|
-
</div>
|
|
38
|
-
<div>
|
|
39
|
-
<label className="text-sm font-medium mb-2 block">Number</label>
|
|
40
|
-
<Input type="number" placeholder="Enter number..." />
|
|
41
|
-
</div>
|
|
42
|
-
<div>
|
|
43
|
-
<label className="text-sm font-medium mb-2 block">Date</label>
|
|
44
|
-
<Input type="date" />
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const Disabled: Story = {
|
|
51
|
-
args: {
|
|
52
|
-
placeholder: "Disabled input",
|
|
53
|
-
disabled: true,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const ReadOnly: Story = {
|
|
58
|
-
args: {
|
|
59
|
-
placeholder: "Read-only input",
|
|
60
|
-
value: "This is read-only",
|
|
61
|
-
readOnly: true,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const WithFile: Story = {
|
|
66
|
-
args: {
|
|
67
|
-
type: "file",
|
|
68
|
-
},
|
|
69
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { StrategyTable } from "@/components/ui/StrategyTable";
|
|
3
|
-
import {
|
|
4
|
-
IconConceptMind,
|
|
5
|
-
IconConceptCommunity,
|
|
6
|
-
IconConceptMovement,
|
|
7
|
-
} from "@/components/icons/ConceptIcons";
|
|
8
|
-
|
|
9
|
-
const meta = {
|
|
10
|
-
title: "Review/StrategyTable",
|
|
11
|
-
component: StrategyTable,
|
|
12
|
-
tags: ["autodocs"],
|
|
13
|
-
parameters: {
|
|
14
|
-
layout: "padded",
|
|
15
|
-
},
|
|
16
|
-
} satisfies Meta<typeof StrategyTable>;
|
|
17
|
-
|
|
18
|
-
export default meta;
|
|
19
|
-
|
|
20
|
-
type Story = StoryObj<typeof meta>;
|
|
21
|
-
|
|
22
|
-
const mockData = [
|
|
23
|
-
{
|
|
24
|
-
concept: {
|
|
25
|
-
id: "mind",
|
|
26
|
-
type: "mind" as const,
|
|
27
|
-
name: "Mind",
|
|
28
|
-
icon: <IconConceptMind />,
|
|
29
|
-
},
|
|
30
|
-
theme: {
|
|
31
|
-
id: "theme1",
|
|
32
|
-
code: "M01",
|
|
33
|
-
name: "Mental Health Support",
|
|
34
|
-
},
|
|
35
|
-
strategies: [
|
|
36
|
-
{
|
|
37
|
-
id: "strategy1",
|
|
38
|
-
code: "M01.1",
|
|
39
|
-
name: "Mental Health Support Policy",
|
|
40
|
-
score: "12",
|
|
41
|
-
hasTarget: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "strategy2",
|
|
45
|
-
code: "M01.2",
|
|
46
|
-
name: "Mental Health Resources",
|
|
47
|
-
score: "8",
|
|
48
|
-
hasTarget: false,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
concept: {
|
|
54
|
-
id: "community",
|
|
55
|
-
type: "community" as const,
|
|
56
|
-
name: "Community",
|
|
57
|
-
icon: <IconConceptCommunity />,
|
|
58
|
-
},
|
|
59
|
-
theme: {
|
|
60
|
-
id: "theme2",
|
|
61
|
-
code: "C01",
|
|
62
|
-
name: "Social Equity",
|
|
63
|
-
},
|
|
64
|
-
strategies: [
|
|
65
|
-
{
|
|
66
|
-
id: "strategy3",
|
|
67
|
-
code: "C01.1",
|
|
68
|
-
name: "Accessibility Features",
|
|
69
|
-
score: "15",
|
|
70
|
-
hasTarget: true,
|
|
71
|
-
},
|
|
72
|
-
],
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
concept: {
|
|
76
|
-
id: "movement",
|
|
77
|
-
type: "movement" as const,
|
|
78
|
-
name: "Movement",
|
|
79
|
-
icon: <IconConceptMovement />,
|
|
80
|
-
},
|
|
81
|
-
theme: {
|
|
82
|
-
id: "theme3",
|
|
83
|
-
code: "V01",
|
|
84
|
-
name: "Physical Activity",
|
|
85
|
-
},
|
|
86
|
-
strategies: [
|
|
87
|
-
{
|
|
88
|
-
id: "strategy4",
|
|
89
|
-
code: "V01.1",
|
|
90
|
-
name: "Active Design",
|
|
91
|
-
score: "10",
|
|
92
|
-
hasTarget: false,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
id: "strategy5",
|
|
96
|
-
code: "V01.2",
|
|
97
|
-
name: "Exercise Facilities",
|
|
98
|
-
score: "6",
|
|
99
|
-
hasTarget: true,
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
export const Default: Story = {
|
|
106
|
-
render: () => <StrategyTable data={mockData} />,
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const SingleConcept: Story = {
|
|
110
|
-
render: () => (
|
|
111
|
-
<StrategyTable
|
|
112
|
-
data={[
|
|
113
|
-
{
|
|
114
|
-
concept: {
|
|
115
|
-
id: "mind",
|
|
116
|
-
type: "mind" as const,
|
|
117
|
-
name: "Mind",
|
|
118
|
-
icon: <IconConceptMind />,
|
|
119
|
-
},
|
|
120
|
-
theme: {
|
|
121
|
-
id: "theme1",
|
|
122
|
-
code: "M01",
|
|
123
|
-
name: "Mental Health Support",
|
|
124
|
-
},
|
|
125
|
-
strategies: [
|
|
126
|
-
{
|
|
127
|
-
id: "strategy1",
|
|
128
|
-
code: "M01.1",
|
|
129
|
-
name: "Mental Health Support Policy",
|
|
130
|
-
score: "12",
|
|
131
|
-
hasTarget: true,
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
]}
|
|
136
|
-
/>
|
|
137
|
-
),
|
|
138
|
-
};
|