@syscore/ui-library 1.15.1 → 1.15.3
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 +19 -2
- package/client/components/ui/section-badge.tsx +22 -0
- package/client/components/ui/typography.tsx +80 -80
- package/client/global.css +32 -0
- package/client/ui/SectionBadge.stories.tsx +28 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +29 -11
- package/package.json +1 -1
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { cn } from "../../lib/utils";
|
|
3
3
|
|
|
4
|
+
/** Green = low, Plum = medium, Coral = high */
|
|
5
|
+
export type UtilityTriangleInfoVariant = "low" | "medium" | "high";
|
|
6
|
+
|
|
7
|
+
const VARIANT_COLORS: Record<
|
|
8
|
+
UtilityTriangleInfoVariant,
|
|
9
|
+
{ fill: string; stroke: string }
|
|
10
|
+
> = {
|
|
11
|
+
low: { fill: "#50E7CA", stroke: "#1BC5A3" },
|
|
12
|
+
medium: { fill: "#DCADD2", stroke: "#AA6A9B" },
|
|
13
|
+
high: { fill: "#F0AA99", stroke: "#E67357" },
|
|
14
|
+
};
|
|
15
|
+
|
|
4
16
|
interface UtilityTriangleInfoProps {
|
|
5
17
|
className?: string;
|
|
18
|
+
/** Low (green), Medium (plum), High (coral) */
|
|
19
|
+
variant?: UtilityTriangleInfoVariant;
|
|
6
20
|
}
|
|
7
21
|
|
|
8
22
|
export const UtilityTriangleInfo: React.FC<UtilityTriangleInfoProps> = ({
|
|
9
23
|
className,
|
|
24
|
+
variant = "low",
|
|
10
25
|
}) => {
|
|
26
|
+
const { fill, stroke } = VARIANT_COLORS[variant];
|
|
27
|
+
|
|
11
28
|
return (
|
|
12
29
|
<svg
|
|
13
30
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -19,8 +36,8 @@ export const UtilityTriangleInfo: React.FC<UtilityTriangleInfoProps> = ({
|
|
|
19
36
|
>
|
|
20
37
|
<path
|
|
21
38
|
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=
|
|
23
|
-
stroke=
|
|
39
|
+
fill={fill}
|
|
40
|
+
stroke={stroke}
|
|
24
41
|
strokeWidth="1.5"
|
|
25
42
|
strokeLinecap="round"
|
|
26
43
|
strokeLinejoin="round"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
|
|
3
|
+
function SectionBadge({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
}: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) {
|
|
10
|
+
return (
|
|
11
|
+
<span
|
|
12
|
+
className={cn(
|
|
13
|
+
"section-badge overline-large",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</span>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { SectionBadge };
|
|
@@ -4,113 +4,113 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
6
|
const typographyVariants = cva("", {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
variant: "body-base",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
"heading-xlarge": "heading-xlarge",
|
|
10
|
+
"heading-large": "heading-large",
|
|
11
|
+
"heading-medium": "heading-medium",
|
|
12
|
+
"heading-small": "heading-small",
|
|
13
|
+
"heading-xsmall": "heading-xsmall",
|
|
14
|
+
"heading-xxsmall": "heading-xxsmall",
|
|
15
|
+
"body-large": "body-large",
|
|
16
|
+
"body-base": "body-base",
|
|
17
|
+
"body-small": "body-small",
|
|
18
|
+
"overline-large": "overline-large",
|
|
19
|
+
"overline-medium": "overline-medium",
|
|
20
|
+
"overline-small": "overline-small",
|
|
21
|
+
"number-large": "number-large",
|
|
22
|
+
"number-base": "number-base",
|
|
26
23
|
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: "body-base",
|
|
27
|
+
},
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
type Variant = NonNullable<VariantProps<typeof typographyVariants>["variant"]>;
|
|
30
31
|
|
|
31
32
|
const defaultElementMap: Record<Variant, React.ElementType> = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
"heading-xlarge": "h1",
|
|
34
|
+
"heading-large": "h1",
|
|
35
|
+
"heading-medium": "h2",
|
|
36
|
+
"heading-small": "h3",
|
|
37
|
+
"heading-xsmall": "h4",
|
|
38
|
+
"heading-xxsmall": "h5",
|
|
39
|
+
"body-large": "p",
|
|
40
|
+
"body-base": "p",
|
|
41
|
+
"body-small": "p",
|
|
42
|
+
"overline-large": "span",
|
|
43
|
+
"overline-medium": "span",
|
|
44
|
+
"overline-small": "span",
|
|
45
|
+
"number-large": "span",
|
|
46
|
+
"number-base": "span",
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
variant?: Variant;
|
|
51
|
+
as?: React.ElementType;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
const Text = React.forwardRef<HTMLElement, TextProps>(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
({ className, variant = "body-base", as, ...props }, ref) => {
|
|
56
|
+
const Component = as || defaultElementMap[variant];
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
return (
|
|
59
|
+
<Component
|
|
60
|
+
ref={ref}
|
|
61
|
+
className={cn(typographyVariants({ variant }), className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
64
66
|
);
|
|
65
67
|
Text.displayName = "Text";
|
|
66
68
|
|
|
67
69
|
interface ListProps extends React.HTMLAttributes<HTMLUListElement> {}
|
|
68
70
|
|
|
69
71
|
const List = React.forwardRef<HTMLUListElement, ListProps>(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
72
|
+
({ className, ...props }, ref) => {
|
|
73
|
+
return (
|
|
74
|
+
<ul ref={ref} className={cn("typography-list", className)} {...props} />
|
|
75
|
+
);
|
|
76
|
+
},
|
|
79
77
|
);
|
|
80
78
|
List.displayName = "List";
|
|
81
79
|
|
|
82
80
|
interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
83
|
-
|
|
81
|
+
variant?: Variant;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
const ListItem = React.forwardRef<HTMLLIElement, ListItemProps>(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
);
|
|
110
|
-
}
|
|
85
|
+
({ className, variant = "body-base", children, ...props }, ref) => {
|
|
86
|
+
return (
|
|
87
|
+
<li
|
|
88
|
+
ref={ref}
|
|
89
|
+
className={cn("typography-list-item", className)}
|
|
90
|
+
{...props}
|
|
91
|
+
>
|
|
92
|
+
<svg
|
|
93
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
94
|
+
width="4"
|
|
95
|
+
height="4"
|
|
96
|
+
viewBox="0 0 4 4"
|
|
97
|
+
fill="none"
|
|
98
|
+
className="typography-list-bullet"
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
>
|
|
101
|
+
<circle cx="2" cy="2" r="2" fill="#71747D" />
|
|
102
|
+
</svg>
|
|
103
|
+
<span className={cn(typographyVariants({ variant }))}>{children}</span>
|
|
104
|
+
</li>
|
|
105
|
+
);
|
|
106
|
+
},
|
|
111
107
|
);
|
|
112
108
|
ListItem.displayName = "ListItem";
|
|
113
109
|
|
|
114
110
|
export { Text, List, ListItem, typographyVariants, defaultElementMap };
|
|
115
|
-
export type {
|
|
116
|
-
|
|
111
|
+
export type {
|
|
112
|
+
TextProps,
|
|
113
|
+
ListProps,
|
|
114
|
+
ListItemProps,
|
|
115
|
+
Variant as TypographyVariant,
|
|
116
|
+
};
|
package/client/global.css
CHANGED
|
@@ -701,6 +701,9 @@ layer(base);
|
|
|
701
701
|
--blur-lg: 12px;
|
|
702
702
|
--blur-xl: 20px;
|
|
703
703
|
|
|
704
|
+
--radius-modal: 40px;
|
|
705
|
+
--modal-color: rgba(0, 0, 0, 0.08);
|
|
706
|
+
|
|
704
707
|
--shadow-xs: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
|
|
705
708
|
--shadow-sm:
|
|
706
709
|
0 1px 3px 0 rgba(16, 24, 40, 0.1), 0 1px 2px -1px rgba(16, 24, 40, 0.1);
|
|
@@ -1145,6 +1148,9 @@ body {
|
|
|
1145
1148
|
position: relative;
|
|
1146
1149
|
z-index: 10;
|
|
1147
1150
|
font-weight: 600 !important;
|
|
1151
|
+
display: flex;
|
|
1152
|
+
align-items: center;
|
|
1153
|
+
padding-top: 2px;
|
|
1148
1154
|
}
|
|
1149
1155
|
|
|
1150
1156
|
/* Accordion Styles */
|
|
@@ -1252,6 +1258,14 @@ body {
|
|
|
1252
1258
|
color: hsl(var(--foreground));
|
|
1253
1259
|
}
|
|
1254
1260
|
|
|
1261
|
+
/* Section Badge Styles */
|
|
1262
|
+
.section-badge {
|
|
1263
|
+
display: inline-block;
|
|
1264
|
+
border-radius: 0.375rem;
|
|
1265
|
+
padding: 1rem;
|
|
1266
|
+
margin-bottom: 2rem;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1255
1269
|
/* Label Styles */
|
|
1256
1270
|
.label {
|
|
1257
1271
|
color: var(--color-gray-600, #52545d);
|
|
@@ -6549,6 +6563,24 @@ body {
|
|
|
6549
6563
|
margin-right: 1rem;
|
|
6550
6564
|
}
|
|
6551
6565
|
|
|
6566
|
+
.heading-xlarge {
|
|
6567
|
+
font-family: var(--font-ftmade);
|
|
6568
|
+
font-size: 58px;
|
|
6569
|
+
line-height: 64px;
|
|
6570
|
+
letter-spacing: -0.58px;
|
|
6571
|
+
|
|
6572
|
+
&::before {
|
|
6573
|
+
content: "";
|
|
6574
|
+
margin-bottom: -0.2703em;
|
|
6575
|
+
display: table;
|
|
6576
|
+
}
|
|
6577
|
+
&::after {
|
|
6578
|
+
content: "";
|
|
6579
|
+
margin-top: -0.1023em;
|
|
6580
|
+
display: table;
|
|
6581
|
+
}
|
|
6582
|
+
}
|
|
6583
|
+
|
|
6552
6584
|
.heading-large {
|
|
6553
6585
|
font-family: var(--font-ftmade);
|
|
6554
6586
|
font-size: 38px;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { SectionBadge } from "../components/ui/section-badge";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Review/SectionBadge",
|
|
6
|
+
component: SectionBadge,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "centered",
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof SectionBadge>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
children: "Section Title",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Styled: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
children: "Custom Styled",
|
|
26
|
+
className: "bg-cyan-100 text-blue-500",
|
|
27
|
+
},
|
|
28
|
+
};
|