@syscore/ui-library 1.9.0 → 1.10.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/UtilityTriangleInfo.tsx +30 -0
- package/client/components/ui/dialog.tsx +25 -21
- package/client/components/ui/tag.tsx +16 -3
- package/client/global.css +17 -27
- package/client/lib/concept-icons.ts +16 -0
- package/client/ui/Dialog.stories.tsx +106 -0
- package/client/ui/Panel.stories.tsx +1 -16
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.es.js +137 -75
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
|
|
4
|
+
interface UtilityTriangleInfoProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const UtilityTriangleInfo: React.FC<UtilityTriangleInfoProps> = ({
|
|
9
|
+
className,
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<svg
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
width="14"
|
|
15
|
+
height="13"
|
|
16
|
+
viewBox="0 0 14 13"
|
|
17
|
+
fill="none"
|
|
18
|
+
className={cn(className)}
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
d="M7.78821 1.348C7.6827 1.16611 7.53127 1.01514 7.34906 0.910189C7.16685 0.80524 6.96027 0.75 6.75 0.75C6.53973 0.75 6.33315 0.80524 6.15094 0.910189C5.96873 1.01514 5.8173 1.16611 5.71179 1.348L0.910803 9.74972C0.805511 9.93209 0.750054 10.139 0.75 10.3495C0.749946 10.5601 0.805297 10.767 0.910495 10.9494C1.01569 11.1319 1.16703 11.2834 1.34932 11.3888C1.53161 11.4943 1.73843 11.5499 1.94902 11.5501H11.551C11.7616 11.5499 11.9684 11.4943 12.1507 11.3888C12.333 11.2834 12.4843 11.1319 12.5895 10.9494C12.6947 10.767 12.7501 10.5601 12.75 10.3495C12.7499 10.139 12.6945 9.93209 12.5892 9.74972L7.78821 1.348Z"
|
|
22
|
+
fill="#50E7CA"
|
|
23
|
+
stroke="#1BC5A3"
|
|
24
|
+
strokeWidth="1.5"
|
|
25
|
+
strokeLinecap="round"
|
|
26
|
+
strokeLinejoin="round"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
import { XIcon } from "lucide-react";
|
|
4
3
|
|
|
5
4
|
import { cn } from "@/lib/utils";
|
|
5
|
+
import { UtilityClose } from "../icons/UtilityClose";
|
|
6
6
|
|
|
7
7
|
function Dialog({
|
|
8
8
|
...props
|
|
@@ -30,14 +30,17 @@ function DialogClose({
|
|
|
30
30
|
|
|
31
31
|
function DialogOverlay({
|
|
32
32
|
className,
|
|
33
|
+
children,
|
|
33
34
|
...props
|
|
34
35
|
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
|
|
35
36
|
return (
|
|
36
|
-
|
|
37
|
+
<DialogPrimitive.Overlay
|
|
37
38
|
data-slot="dialog-overlay"
|
|
38
39
|
className={cn("dialog-overlay", className)}
|
|
39
40
|
{...props}
|
|
40
|
-
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</DialogPrimitive.Overlay>
|
|
41
44
|
);
|
|
42
45
|
}
|
|
43
46
|
|
|
@@ -51,23 +54,24 @@ function DialogContent({
|
|
|
51
54
|
}) {
|
|
52
55
|
return (
|
|
53
56
|
<DialogPortal data-slot="dialog-portal">
|
|
54
|
-
<DialogOverlay
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
<DialogOverlay>
|
|
58
|
+
<DialogPrimitive.Content
|
|
59
|
+
data-slot="dialog-content"
|
|
60
|
+
className={cn("dialog-content", className)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
<div className="dialog-content-inner">{children}</div>
|
|
64
|
+
{showCloseButton && (
|
|
65
|
+
<DialogPrimitive.Close
|
|
66
|
+
data-slot="dialog-close"
|
|
67
|
+
className="dialog-close"
|
|
68
|
+
>
|
|
69
|
+
<UtilityClose />
|
|
70
|
+
<span className="sr-only">Close</span>
|
|
71
|
+
</DialogPrimitive.Close>
|
|
72
|
+
)}
|
|
73
|
+
</DialogPrimitive.Content>
|
|
74
|
+
</DialogOverlay>
|
|
71
75
|
</DialogPortal>
|
|
72
76
|
);
|
|
73
77
|
}
|
|
@@ -99,7 +103,7 @@ function DialogTitle({
|
|
|
99
103
|
return (
|
|
100
104
|
<DialogPrimitive.Title
|
|
101
105
|
data-slot="dialog-title"
|
|
102
|
-
className={cn("dialog-title heading-xxsmall", className)}
|
|
106
|
+
className={cn("dialog-title heading-xxsmall text-center", className)}
|
|
103
107
|
{...props}
|
|
104
108
|
/>
|
|
105
109
|
);
|
|
@@ -15,6 +15,11 @@ export interface TagProps
|
|
|
15
15
|
status?: TagStatus;
|
|
16
16
|
/** Color scheme for status tags */
|
|
17
17
|
colorScheme?: "light" | "dark";
|
|
18
|
+
/** Minimum width */
|
|
19
|
+
minWidth?: number | string;
|
|
20
|
+
/** Minimum height */
|
|
21
|
+
minHeight?: number | string;
|
|
22
|
+
|
|
18
23
|
onClick?: () => void;
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -34,12 +39,20 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
34
39
|
status,
|
|
35
40
|
colorScheme = "light",
|
|
36
41
|
className,
|
|
42
|
+
minWidth,
|
|
43
|
+
minHeight,
|
|
37
44
|
style,
|
|
38
45
|
onClick,
|
|
39
46
|
...props
|
|
40
47
|
},
|
|
41
48
|
ref,
|
|
42
49
|
) => {
|
|
50
|
+
const mergedStyle = {
|
|
51
|
+
minWidth,
|
|
52
|
+
minHeight,
|
|
53
|
+
...style,
|
|
54
|
+
};
|
|
55
|
+
|
|
43
56
|
// Status tag styling (highest priority)
|
|
44
57
|
if (status) {
|
|
45
58
|
const statusClass = getStatusClass(status, colorScheme);
|
|
@@ -48,7 +61,7 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
48
61
|
ref={ref}
|
|
49
62
|
onClick={onClick}
|
|
50
63
|
className={cn("overline-medium", statusClass, className)}
|
|
51
|
-
style={
|
|
64
|
+
style={mergedStyle}
|
|
52
65
|
{...props}
|
|
53
66
|
>
|
|
54
67
|
{children}
|
|
@@ -63,7 +76,7 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
63
76
|
ref={ref}
|
|
64
77
|
onClick={onClick}
|
|
65
78
|
className={cn("tag-code", className)}
|
|
66
|
-
style={
|
|
79
|
+
style={mergedStyle}
|
|
67
80
|
{...props}
|
|
68
81
|
>
|
|
69
82
|
<span className="number-small font-semibold" style={{ color: "inherit" }}>
|
|
@@ -83,7 +96,7 @@ export const Tag = React.forwardRef<HTMLButtonElement, TagProps>(
|
|
|
83
96
|
active ? "tag-general--active" : "tag-general--inactive",
|
|
84
97
|
className,
|
|
85
98
|
)}
|
|
86
|
-
style={
|
|
99
|
+
style={mergedStyle}
|
|
87
100
|
{...props}
|
|
88
101
|
>
|
|
89
102
|
{children}
|
package/client/global.css
CHANGED
|
@@ -2020,19 +2020,6 @@ body {
|
|
|
2020
2020
|
color: currentColor;
|
|
2021
2021
|
}
|
|
2022
2022
|
|
|
2023
|
-
/* Code Badge Styles */
|
|
2024
|
-
.code-badge {
|
|
2025
|
-
display: flex;
|
|
2026
|
-
align-items: center;
|
|
2027
|
-
justify-content: center;
|
|
2028
|
-
height: 2rem;
|
|
2029
|
-
width: 3rem;
|
|
2030
|
-
border-radius: calc(var(--radius-sm, 6px));
|
|
2031
|
-
flex-shrink: 0;
|
|
2032
|
-
border: 1.5px solid currentColor;
|
|
2033
|
-
padding-left: 1px;
|
|
2034
|
-
padding-right: 1px;
|
|
2035
|
-
}
|
|
2036
2023
|
|
|
2037
2024
|
/* Tooltip Styles */
|
|
2038
2025
|
.tooltip-content {
|
|
@@ -2461,6 +2448,11 @@ body {
|
|
|
2461
2448
|
position: fixed;
|
|
2462
2449
|
inset: 0;
|
|
2463
2450
|
z-index: 50;
|
|
2451
|
+
display: flex;
|
|
2452
|
+
align-items: center;
|
|
2453
|
+
justify-content: center;
|
|
2454
|
+
overflow-y: auto;
|
|
2455
|
+
padding-block: 1.5rem;
|
|
2464
2456
|
background-color: rgba(0, 0, 0, 0.5);
|
|
2465
2457
|
}
|
|
2466
2458
|
|
|
@@ -2473,16 +2465,13 @@ body {
|
|
|
2473
2465
|
}
|
|
2474
2466
|
|
|
2475
2467
|
.dialog-content {
|
|
2476
|
-
position:
|
|
2477
|
-
top: 50%;
|
|
2478
|
-
left: 50%;
|
|
2468
|
+
position: relative;
|
|
2479
2469
|
z-index: 50;
|
|
2480
2470
|
display: grid;
|
|
2481
2471
|
gap: 1rem;
|
|
2482
|
-
|
|
2472
|
+
margin: auto;
|
|
2483
2473
|
border-radius: 40px;
|
|
2484
2474
|
border: 12px solid rgba(255, 255, 255, 0.2);
|
|
2485
|
-
transform: translate(-50%, -50%);
|
|
2486
2475
|
transition: all 0.2s ease-in-out;
|
|
2487
2476
|
}
|
|
2488
2477
|
|
|
@@ -2500,6 +2489,7 @@ body {
|
|
|
2500
2489
|
|
|
2501
2490
|
.dialog-content-inner {
|
|
2502
2491
|
padding: 1.5rem;
|
|
2492
|
+
border-radius: 28px;
|
|
2503
2493
|
background-color: var(--color-gray-50, #f9f9fa);
|
|
2504
2494
|
}
|
|
2505
2495
|
|
|
@@ -2507,13 +2497,8 @@ body {
|
|
|
2507
2497
|
position: absolute;
|
|
2508
2498
|
top: 1rem;
|
|
2509
2499
|
right: 1rem;
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
transition: opacity 0.15s ease-in-out;
|
|
2513
|
-
}
|
|
2514
|
-
|
|
2515
|
-
.dialog-close:hover {
|
|
2516
|
-
opacity: 1;
|
|
2500
|
+
z-index: 10;
|
|
2501
|
+
cursor: pointer;
|
|
2517
2502
|
}
|
|
2518
2503
|
|
|
2519
2504
|
.dialog-close:focus {
|
|
@@ -2530,8 +2515,12 @@ body {
|
|
|
2530
2515
|
.dialog-close svg {
|
|
2531
2516
|
pointer-events: none;
|
|
2532
2517
|
flex-shrink: 0;
|
|
2533
|
-
|
|
2534
|
-
|
|
2518
|
+
color: var(--color-gray-400);
|
|
2519
|
+
transition: color 0.2s ease-in-out;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
.dialog-close:hover svg {
|
|
2523
|
+
color: var(--color-gray-500);
|
|
2535
2524
|
}
|
|
2536
2525
|
|
|
2537
2526
|
.dialog-header {
|
|
@@ -2539,6 +2528,7 @@ body {
|
|
|
2539
2528
|
flex-direction: column;
|
|
2540
2529
|
gap: 0.5rem;
|
|
2541
2530
|
text-align: center;
|
|
2531
|
+
align-items: center;
|
|
2542
2532
|
}
|
|
2543
2533
|
|
|
2544
2534
|
@media (min-width: 640px) {
|
|
@@ -36,6 +36,7 @@ export const CONCEPT_ICONS: Record<
|
|
|
36
36
|
nourishment: IconConceptNourishment,
|
|
37
37
|
light: IconConceptLight,
|
|
38
38
|
movement: IconConceptMovement,
|
|
39
|
+
thermal: IconConceptThermalComfort,
|
|
39
40
|
"thermal-comfort": IconConceptThermalComfort,
|
|
40
41
|
sound: IconConceptSound,
|
|
41
42
|
materials: IconConceptMaterials,
|
|
@@ -43,3 +44,18 @@ export const CONCEPT_ICONS: Record<
|
|
|
43
44
|
mind: IconConceptMind,
|
|
44
45
|
innovation: IconConceptInnovation,
|
|
45
46
|
};
|
|
47
|
+
|
|
48
|
+
// Order of concepts for display
|
|
49
|
+
export const conceptOrder: ConceptSlug[] = [
|
|
50
|
+
"air",
|
|
51
|
+
"water",
|
|
52
|
+
"nourishment",
|
|
53
|
+
"light",
|
|
54
|
+
"movement",
|
|
55
|
+
"thermal-comfort",
|
|
56
|
+
"sound",
|
|
57
|
+
"materials",
|
|
58
|
+
"community",
|
|
59
|
+
"mind",
|
|
60
|
+
"innovation",
|
|
61
|
+
];
|
|
@@ -114,3 +114,109 @@ export const WithForm: Story = {
|
|
|
114
114
|
);
|
|
115
115
|
},
|
|
116
116
|
};
|
|
117
|
+
|
|
118
|
+
export const LongContentScroll: Story = {
|
|
119
|
+
render: () => {
|
|
120
|
+
const [open, setOpen] = useState(false);
|
|
121
|
+
return (
|
|
122
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
123
|
+
<DialogTrigger asChild>
|
|
124
|
+
<Button variant="general-secondary">Terms & Conditions</Button>
|
|
125
|
+
</DialogTrigger>
|
|
126
|
+
<DialogContent className="sm:max-w-[540px]">
|
|
127
|
+
<DialogHeader>
|
|
128
|
+
<DialogTitle>Terms of Service</DialogTitle>
|
|
129
|
+
<DialogDescription>
|
|
130
|
+
Please review the following terms before proceeding.
|
|
131
|
+
</DialogDescription>
|
|
132
|
+
</DialogHeader>
|
|
133
|
+
<div className="flex flex-col gap-4 py-4 body-base text-gray-700">
|
|
134
|
+
<h3 className="heading-xxxsmall">1. Acceptance of Terms</h3>
|
|
135
|
+
<p>
|
|
136
|
+
By accessing and using the WELL Building Standard platform, you
|
|
137
|
+
acknowledge that you have read, understood, and agree to be bound
|
|
138
|
+
by these Terms of Service. If you do not agree to these terms, you
|
|
139
|
+
must not use the platform. These terms constitute a legally binding
|
|
140
|
+
agreement between you and the International WELL Building
|
|
141
|
+
Institute.
|
|
142
|
+
</p>
|
|
143
|
+
|
|
144
|
+
<h3 className="heading-xxxsmall">2. Use of Services</h3>
|
|
145
|
+
<p>
|
|
146
|
+
You agree to use the platform only for lawful purposes and in
|
|
147
|
+
accordance with these Terms. You are responsible for ensuring that
|
|
148
|
+
your use of the platform complies with all applicable laws,
|
|
149
|
+
regulations, and professional standards. Unauthorized use of the
|
|
150
|
+
platform may give rise to a claim for damages and/or be a criminal
|
|
151
|
+
offense.
|
|
152
|
+
</p>
|
|
153
|
+
|
|
154
|
+
<h3 className="heading-xxxsmall">3. User Accounts</h3>
|
|
155
|
+
<p>
|
|
156
|
+
To access certain features of the platform, you may be required to
|
|
157
|
+
create an account. You are responsible for maintaining the
|
|
158
|
+
confidentiality of your account credentials and for all activities
|
|
159
|
+
that occur under your account. You agree to notify us immediately
|
|
160
|
+
of any unauthorized use of your account or any other breach of
|
|
161
|
+
security.
|
|
162
|
+
</p>
|
|
163
|
+
|
|
164
|
+
<h3 className="heading-xxxsmall">4. Intellectual Property</h3>
|
|
165
|
+
<p>
|
|
166
|
+
All content, features, and functionality of the platform,
|
|
167
|
+
including but not limited to text, graphics, logos, icons, images,
|
|
168
|
+
audio clips, digital downloads, and data compilations, are the
|
|
169
|
+
exclusive property of the International WELL Building Institute
|
|
170
|
+
and are protected by international copyright, trademark, patent,
|
|
171
|
+
trade secret, and other intellectual property laws.
|
|
172
|
+
</p>
|
|
173
|
+
|
|
174
|
+
<h3 className="heading-xxxsmall">5. Data Privacy</h3>
|
|
175
|
+
<p>
|
|
176
|
+
We are committed to protecting your privacy. Our collection and
|
|
177
|
+
use of personal information is governed by our Privacy Policy,
|
|
178
|
+
which is incorporated into these Terms by reference. By using the
|
|
179
|
+
platform, you consent to the collection, use, and sharing of your
|
|
180
|
+
information as described in the Privacy Policy.
|
|
181
|
+
</p>
|
|
182
|
+
|
|
183
|
+
<h3 className="heading-xxxsmall">6. Limitation of Liability</h3>
|
|
184
|
+
<p>
|
|
185
|
+
To the fullest extent permitted by applicable law, the
|
|
186
|
+
International WELL Building Institute shall not be liable for any
|
|
187
|
+
indirect, incidental, special, consequential, or punitive damages,
|
|
188
|
+
or any loss of profits or revenues, whether incurred directly or
|
|
189
|
+
indirectly, or any loss of data, use, goodwill, or other
|
|
190
|
+
intangible losses resulting from your use of the platform.
|
|
191
|
+
</p>
|
|
192
|
+
|
|
193
|
+
<h3 className="heading-xxxsmall">7. Modifications</h3>
|
|
194
|
+
<p>
|
|
195
|
+
We reserve the right to modify these Terms at any time. We will
|
|
196
|
+
provide notice of any material changes by posting the updated
|
|
197
|
+
Terms on the platform. Your continued use of the platform after
|
|
198
|
+
such modifications constitutes your acceptance of the revised
|
|
199
|
+
Terms.
|
|
200
|
+
</p>
|
|
201
|
+
</div>
|
|
202
|
+
<DialogFooter>
|
|
203
|
+
<Button
|
|
204
|
+
size="utility"
|
|
205
|
+
variant="general-secondary"
|
|
206
|
+
onClick={() => setOpen(false)}
|
|
207
|
+
>
|
|
208
|
+
Decline
|
|
209
|
+
</Button>
|
|
210
|
+
<Button
|
|
211
|
+
size="utility"
|
|
212
|
+
variant="general-primary"
|
|
213
|
+
onClick={() => setOpen(false)}
|
|
214
|
+
>
|
|
215
|
+
Accept
|
|
216
|
+
</Button>
|
|
217
|
+
</DialogFooter>
|
|
218
|
+
</DialogContent>
|
|
219
|
+
</Dialog>
|
|
220
|
+
);
|
|
221
|
+
},
|
|
222
|
+
};
|
|
@@ -4,28 +4,13 @@ import { AnimatePresence } from "motion/react";
|
|
|
4
4
|
import { getConceptColor } from "../lib/concept-colors";
|
|
5
5
|
import { capitalize, cn } from "../lib/utils";
|
|
6
6
|
import { Tag } from "../components/ui/tag";
|
|
7
|
-
import { CONCEPT_ICONS } from "../lib/concept-icons";
|
|
7
|
+
import { CONCEPT_ICONS, conceptOrder } from "../lib/concept-icons";
|
|
8
8
|
import { conceptColors } from "../lib/concept-colors";
|
|
9
9
|
import { Card } from "../components/ui/card";
|
|
10
10
|
import { useState } from "react";
|
|
11
11
|
import { Label } from "../components/ui/label";
|
|
12
12
|
import { Toggle } from "../components/ui/toggle";
|
|
13
13
|
|
|
14
|
-
// Order of concepts for display
|
|
15
|
-
const conceptOrder: ConceptSlug[] = [
|
|
16
|
-
"air",
|
|
17
|
-
"water",
|
|
18
|
-
"nourishment",
|
|
19
|
-
"light",
|
|
20
|
-
"movement",
|
|
21
|
-
"thermal-comfort",
|
|
22
|
-
"sound",
|
|
23
|
-
"materials",
|
|
24
|
-
"community",
|
|
25
|
-
"mind",
|
|
26
|
-
"innovation",
|
|
27
|
-
];
|
|
28
|
-
|
|
29
14
|
// Wrapper component that manages state and accepts initial values from args
|
|
30
15
|
const ExploreSidePanelView = (args: any) => {
|
|
31
16
|
const {
|