@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.
Files changed (62) hide show
  1. package/client/components/icons/AchievementBadges.tsx +33 -0
  2. package/client/components/icons/ConceptIcons.tsx +169 -22
  3. package/client/components/icons/NavLogo.tsx +4 -4
  4. package/client/components/icons/ProviderBadges.tsx +28 -28
  5. package/client/components/icons/ProviderSeals.tsx +35 -35
  6. package/client/components/icons/StandardLogo.tsx +47 -0
  7. package/client/components/icons/UtilityChevronDown.tsx +1 -1
  8. package/client/components/icons/UtilityClearRegular.tsx +43 -0
  9. package/client/components/icons/UtilityCompare.tsx +71 -0
  10. package/client/components/icons/UtilityHome.tsx +26 -0
  11. package/client/components/icons/UtilityReset.tsx +7 -7
  12. package/client/components/icons/UtilitySave.tsx +35 -0
  13. package/client/components/icons/UtilityScopeLarge.tsx +86 -0
  14. package/client/components/icons/UtilityShow.tsx +41 -0
  15. package/client/components/icons/UtilityTarget.tsx +21 -0
  16. package/client/components/icons/UtilityTargetActive.tsx +34 -0
  17. package/client/components/icons/UtilityText.tsx +8 -8
  18. package/client/components/ui/breadcrumb.tsx +26 -4
  19. package/client/components/ui/button.tsx +30 -18
  20. package/client/components/ui/card.tsx +2 -2
  21. package/client/components/ui/code-badge.tsx +25 -0
  22. package/client/components/ui/dialog.tsx +4 -4
  23. package/client/components/ui/input.tsx +53 -9
  24. package/client/components/ui/label.tsx +2 -2
  25. package/client/components/ui/{Navigation.tsx → navigation.tsx} +291 -250
  26. package/client/components/ui/select.tsx +20 -20
  27. package/client/components/ui/tabs.tsx +27 -178
  28. package/client/components/ui/{Tag.tsx → tag.tsx} +11 -10
  29. package/client/components/ui/textarea.tsx +1 -1
  30. package/client/components/ui/toggle-group.tsx +19 -2
  31. package/client/components/ui/toggle.tsx +2 -2
  32. package/client/components/ui/tooltip.tsx +148 -8
  33. package/client/global.css +18 -11
  34. package/client/ui/AspectRatio.stories.tsx +1 -1
  35. package/client/ui/Button.stories.tsx +5 -5
  36. package/client/ui/Card.stories.tsx +223 -2
  37. package/client/ui/CodeBadge.stories.tsx +76 -0
  38. package/client/ui/Dialog.stories.tsx +52 -5
  39. package/client/ui/Icons.stories.tsx +31 -31
  40. package/client/ui/Input.stories.tsx +125 -0
  41. package/client/ui/Label.stories.tsx +8 -11
  42. package/client/ui/Navigation.stories.tsx +1 -1
  43. package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
  44. package/client/ui/SearchField.stories.tsx +1 -1
  45. package/client/ui/{Select/Select.stories.tsx → Select.stories.tsx} +2 -2
  46. package/client/ui/{Switch/Switch.stories.tsx → Switch.stories.tsx} +3 -3
  47. package/client/ui/Tabs.stories.tsx +174 -10
  48. package/client/ui/Tag.stories.tsx +48 -1
  49. package/client/ui/{Textarea/Textarea.stories.tsx → Textarea.stories.tsx} +9 -10
  50. package/client/ui/Toggle.stories.tsx +3 -3
  51. package/client/ui/Tooltip.stories.tsx +28 -4
  52. package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +1 -1
  53. package/client/ui/WELLDashboard/index.tsx +147 -51
  54. package/dist/ui/index.cjs.js +1 -1
  55. package/dist/ui/index.d.ts +8 -1
  56. package/dist/ui/index.es.js +2127 -561
  57. package/package.json +2 -2
  58. package/client/components/ui/StrategyTable.tsx +0 -303
  59. package/client/ui/Input/Input.stories.tsx +0 -69
  60. package/client/ui/StrategyTable.stories.tsx +0 -138
  61. /package/client/components/ui/{SearchField.tsx → search.tsx} +0 -0
  62. /package/client/hooks/{UseTabs.tsx → use-tabs.tsx} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syscore/ui-library",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
4
4
  "description": "A comprehensive React component library built with Radix UI, Tailwind CSS, and TypeScript",
5
5
  "private": false,
6
6
  "type": "module",
@@ -82,7 +82,7 @@
82
82
  "express": "^4.18.2",
83
83
  "input-otp": "^1.4.2",
84
84
  "lucide-react": "^0.539.0",
85
- "motion": "^12.23.24",
85
+ "motion": "^12.29.0",
86
86
  "next-themes": "^0.4.6",
87
87
  "react-day-picker": "^9.8.1",
88
88
  "react-hook-form": "^7.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,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
- };
File without changes