@robr0/design-system 0.1.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/LICENSE +21 -0
- package/README.md +127 -0
- package/charts.d.ts +14 -0
- package/charts.js +20 -0
- package/components/Accordion/Accordion.css +119 -0
- package/components/Accordion/Accordion.d.ts +24 -0
- package/components/Accordion/Accordion.js +76 -0
- package/components/Alert/Alert.css +252 -0
- package/components/Alert/Alert.d.ts +24 -0
- package/components/Alert/Alert.js +53 -0
- package/components/AlertDialog/AlertDialog.css +131 -0
- package/components/AlertDialog/AlertDialog.d.ts +29 -0
- package/components/AlertDialog/AlertDialog.js +143 -0
- package/components/AppLayout/AppLayout.css +52 -0
- package/components/AppLayout/AppLayout.d.ts +27 -0
- package/components/AppLayout/AppLayout.js +45 -0
- package/components/AppSidebar/AppSidebar.css +434 -0
- package/components/AppSidebar/AppSidebar.d.ts +67 -0
- package/components/AppSidebar/AppSidebar.js +272 -0
- package/components/Avatar/Avatar.css +133 -0
- package/components/Avatar/Avatar.d.ts +20 -0
- package/components/Avatar/Avatar.js +56 -0
- package/components/Avatar/demoAvatars.d.ts +14 -0
- package/components/Avatar/demoAvatars.js +16 -0
- package/components/Badge/Badge.css +68 -0
- package/components/Badge/Badge.d.ts +13 -0
- package/components/Badge/Badge.js +15 -0
- package/components/Breadcrumb/Breadcrumb.css +92 -0
- package/components/Breadcrumb/Breadcrumb.d.ts +19 -0
- package/components/Breadcrumb/Breadcrumb.js +39 -0
- package/components/Button/Button.css +381 -0
- package/components/Button/Button.d.ts +39 -0
- package/components/Button/Button.js +71 -0
- package/components/ButtonGroup/ButtonGroup.css +39 -0
- package/components/ButtonGroup/ButtonGroup.d.ts +13 -0
- package/components/ButtonGroup/ButtonGroup.js +37 -0
- package/components/Card/Card.css +169 -0
- package/components/Card/Card.d.ts +30 -0
- package/components/Card/Card.js +90 -0
- package/components/Carousel/Carousel.css +112 -0
- package/components/Carousel/Carousel.d.ts +25 -0
- package/components/Carousel/Carousel.js +126 -0
- package/components/Chart/AreaChart.d.ts +36 -0
- package/components/Chart/AreaChart.js +99 -0
- package/components/Chart/BarChart.d.ts +34 -0
- package/components/Chart/BarChart.js +107 -0
- package/components/Chart/Chart.css +176 -0
- package/components/Chart/LineChart.d.ts +34 -0
- package/components/Chart/LineChart.js +90 -0
- package/components/Chart/PieChart.d.ts +34 -0
- package/components/Chart/PieChart.js +106 -0
- package/components/Chart/RadarChart.d.ts +34 -0
- package/components/Chart/RadarChart.js +91 -0
- package/components/Chart/RadialChart.d.ts +37 -0
- package/components/Chart/RadialChart.js +119 -0
- package/components/Chart/ScatterChart.d.ts +36 -0
- package/components/Chart/ScatterChart.js +109 -0
- package/components/Chart/StackedBarChart.d.ts +34 -0
- package/components/Chart/StackedBarChart.js +111 -0
- package/components/Chart/Treemap.d.ts +33 -0
- package/components/Chart/Treemap.js +109 -0
- package/components/Checkbox/Checkbox.css +164 -0
- package/components/Checkbox/Checkbox.d.ts +45 -0
- package/components/Checkbox/Checkbox.js +125 -0
- package/components/Chip/Chip.css +195 -0
- package/components/Chip/Chip.d.ts +27 -0
- package/components/Chip/Chip.js +80 -0
- package/components/CircularButton/CircularButton.css +206 -0
- package/components/CircularButton/CircularButton.d.ts +30 -0
- package/components/CircularButton/CircularButton.js +54 -0
- package/components/CodeBlock/CodeBlock.css +180 -0
- package/components/CodeBlock/CodeBlock.d.ts +23 -0
- package/components/CodeBlock/CodeBlock.js +85 -0
- package/components/ColourSwatch/ColourSwatch.css +88 -0
- package/components/ColourSwatch/ColourSwatch.d.ts +34 -0
- package/components/ColourSwatch/ColourSwatch.js +42 -0
- package/components/Combobox/Combobox.css +411 -0
- package/components/Combobox/Combobox.d.ts +73 -0
- package/components/Combobox/Combobox.js +312 -0
- package/components/CommandPalette/CommandPalette.css +310 -0
- package/components/CommandPalette/CommandPalette.d.ts +60 -0
- package/components/CommandPalette/CommandPalette.js +263 -0
- package/components/ContactCard/ContactCard.css +123 -0
- package/components/ContactCard/ContactCard.d.ts +23 -0
- package/components/ContactCard/ContactCard.js +78 -0
- package/components/ContributionGraph/ContributionGraph.css +142 -0
- package/components/ContributionGraph/ContributionGraph.d.ts +26 -0
- package/components/ContributionGraph/ContributionGraph.js +125 -0
- package/components/DateInput/DateInput.css +163 -0
- package/components/DateInput/DateInput.d.ts +43 -0
- package/components/DateInput/DateInput.js +69 -0
- package/components/DatePicker/DatePicker.css +198 -0
- package/components/DatePicker/DatePicker.d.ts +22 -0
- package/components/DatePicker/DatePicker.js +170 -0
- package/components/Dialog/Dialog.css +176 -0
- package/components/Dialog/Dialog.d.ts +28 -0
- package/components/Dialog/Dialog.js +132 -0
- package/components/Divider/Divider.css +100 -0
- package/components/Divider/Divider.d.ts +18 -0
- package/components/Divider/Divider.js +31 -0
- package/components/Drawer/Drawer.css +262 -0
- package/components/Drawer/Drawer.d.ts +30 -0
- package/components/Drawer/Drawer.js +134 -0
- package/components/Dropdown/Dropdown.css +300 -0
- package/components/Dropdown/Dropdown.d.ts +48 -0
- package/components/Dropdown/Dropdown.js +196 -0
- package/components/DropdownMenu/DropdownMenu.css +303 -0
- package/components/DropdownMenu/DropdownMenu.d.ts +42 -0
- package/components/DropdownMenu/DropdownMenu.js +322 -0
- package/components/EmptyState/EmptyState.css +115 -0
- package/components/EmptyState/EmptyState.d.ts +27 -0
- package/components/EmptyState/EmptyState.js +32 -0
- package/components/EntityCard/EntityCard.css +69 -0
- package/components/EntityCard/EntityCard.d.ts +18 -0
- package/components/EntityCard/EntityCard.js +26 -0
- package/components/Figure/Figure.css +61 -0
- package/components/Figure/Figure.d.ts +17 -0
- package/components/Figure/Figure.js +35 -0
- package/components/FileInput/FileInput.css +308 -0
- package/components/FileInput/FileInput.d.ts +54 -0
- package/components/FileInput/FileInput.js +177 -0
- package/components/Input/Input.css +193 -0
- package/components/Input/Input.d.ts +40 -0
- package/components/Input/Input.js +71 -0
- package/components/Instructions/Instructions.css +216 -0
- package/components/Instructions/Instructions.d.ts +28 -0
- package/components/Instructions/Instructions.js +32 -0
- package/components/LinkList/LinkList.css +71 -0
- package/components/LinkList/LinkList.d.ts +20 -0
- package/components/LinkList/LinkList.js +41 -0
- package/components/MotionSwatch/MotionSwatch.css +176 -0
- package/components/MotionSwatch/MotionSwatch.d.ts +25 -0
- package/components/MotionSwatch/MotionSwatch.js +74 -0
- package/components/Nav/Nav.css +51 -0
- package/components/Nav/Nav.d.ts +19 -0
- package/components/Nav/Nav.js +26 -0
- package/components/Pagination/Pagination.css +126 -0
- package/components/Pagination/Pagination.d.ts +22 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Popover/Popover.css +99 -0
- package/components/Popover/Popover.d.ts +28 -0
- package/components/Popover/Popover.js +102 -0
- package/components/ProgressBar/ProgressBar.css +60 -0
- package/components/ProgressBar/ProgressBar.d.ts +16 -0
- package/components/ProgressBar/ProgressBar.js +27 -0
- package/components/Quote/Quote.css +79 -0
- package/components/Quote/Quote.d.ts +18 -0
- package/components/Quote/Quote.js +26 -0
- package/components/RadioButton/RadioButton.css +132 -0
- package/components/RadioButton/RadioButton.d.ts +43 -0
- package/components/RadioButton/RadioButton.js +77 -0
- package/components/SectionTitle/SectionTitle.css +37 -0
- package/components/SectionTitle/SectionTitle.d.ts +10 -0
- package/components/SectionTitle/SectionTitle.js +17 -0
- package/components/SegmentedControl/SegmentedControl.css +129 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +33 -0
- package/components/SegmentedControl/SegmentedControl.js +91 -0
- package/components/SelectionCard/SelectionCard.css +251 -0
- package/components/SelectionCard/SelectionCard.d.ts +26 -0
- package/components/SelectionCard/SelectionCard.js +85 -0
- package/components/Skeleton/Skeleton.css +79 -0
- package/components/Skeleton/Skeleton.d.ts +16 -0
- package/components/Skeleton/Skeleton.js +30 -0
- package/components/Slider/Slider.css +86 -0
- package/components/Slider/Slider.d.ts +25 -0
- package/components/Slider/Slider.js +46 -0
- package/components/SpacingSwatch/SpacingSwatch.css +108 -0
- package/components/SpacingSwatch/SpacingSwatch.d.ts +20 -0
- package/components/SpacingSwatch/SpacingSwatch.js +50 -0
- package/components/Spinner/Spinner.css +73 -0
- package/components/Spinner/Spinner.d.ts +14 -0
- package/components/Spinner/Spinner.js +42 -0
- package/components/Stat/Stat.css +78 -0
- package/components/Stat/Stat.d.ts +19 -0
- package/components/Stat/Stat.js +30 -0
- package/components/Table/Table.css +186 -0
- package/components/Table/Table.d.ts +45 -0
- package/components/Table/Table.js +65 -0
- package/components/Tabs/Tabs.css +140 -0
- package/components/Tabs/Tabs.d.ts +28 -0
- package/components/Tabs/Tabs.js +77 -0
- package/components/Textarea/Textarea.css +152 -0
- package/components/Textarea/Textarea.d.ts +40 -0
- package/components/Textarea/Textarea.js +74 -0
- package/components/Timeline/Timeline.css +339 -0
- package/components/Timeline/Timeline.d.ts +63 -0
- package/components/Timeline/Timeline.js +69 -0
- package/components/Toast/Toast.css +342 -0
- package/components/Toast/Toast.d.ts +63 -0
- package/components/Toast/Toast.js +213 -0
- package/components/ToggleGroup/ToggleGroup.css +84 -0
- package/components/ToggleGroup/ToggleGroup.d.ts +30 -0
- package/components/ToggleGroup/ToggleGroup.js +53 -0
- package/components/ToggleSwitch/ToggleSwitch.css +139 -0
- package/components/ToggleSwitch/ToggleSwitch.d.ts +23 -0
- package/components/ToggleSwitch/ToggleSwitch.js +50 -0
- package/components/Tooltip/Tooltip.css +122 -0
- package/components/Tooltip/Tooltip.d.ts +21 -0
- package/components/Tooltip/Tooltip.js +63 -0
- package/components/TypographySwatch/TypographySwatch.css +81 -0
- package/components/TypographySwatch/TypographySwatch.d.ts +24 -0
- package/components/TypographySwatch/TypographySwatch.js +40 -0
- package/components/registry.d.ts +20 -0
- package/components/registry.js +7 -0
- package/components/registry.json +67 -0
- package/components/registry.json.d.ts +70 -0
- package/components/registry.json.js +8 -0
- package/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.woff2 +0 -0
- package/fonts/material-symbols.css +94 -0
- package/index.d.ts +62 -0
- package/index.js +123 -0
- package/package.json +63 -0
- package/tokens/registry.d.ts +22 -0
- package/tokens/registry.js +14 -0
- package/tokens/registry.json +203 -0
- package/tokens/registry.json.d.ts +206 -0
- package/tokens/registry.json.js +8 -0
- package/tokens/tokens-dark.css +119 -0
- package/tokens/tokens-light.css +159 -0
- package/tokens/tokens-motion.css +68 -0
- package/tokens/tokens-primitives.css +176 -0
- package/tokens/tokens-typography.css +116 -0
- package/tokens/tokens.css +11 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Button } from "../Button/Button.js";
|
|
4
|
+
import "./ButtonGroup.css";
|
|
5
|
+
const ButtonGroup = ({
|
|
6
|
+
orientation = "horizontal",
|
|
7
|
+
buttons,
|
|
8
|
+
ariaLabel,
|
|
9
|
+
className = ""
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: `ds-button-group ds-button-group--${orientation} ${className}`,
|
|
15
|
+
role: "group",
|
|
16
|
+
"aria-label": ariaLabel,
|
|
17
|
+
children: buttons.map((button, index) => /* @__PURE__ */ jsx(
|
|
18
|
+
Button,
|
|
19
|
+
{
|
|
20
|
+
priority: button.priority || "tertiary",
|
|
21
|
+
state: button.state || "default",
|
|
22
|
+
label: button.label,
|
|
23
|
+
iconLeft: button.iconLeft,
|
|
24
|
+
iconRight: button.iconRight,
|
|
25
|
+
icon: button.icon,
|
|
26
|
+
onClick: button.onClick,
|
|
27
|
+
href: button.href,
|
|
28
|
+
ariaCurrent: button.ariaCurrent
|
|
29
|
+
},
|
|
30
|
+
index
|
|
31
|
+
))
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
ButtonGroup
|
|
37
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
CARD COMPONENT
|
|
3
|
+
Content card with preview area and title
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-card {
|
|
7
|
+
/* Layout */
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: var(--gap-md); /* 12px */
|
|
11
|
+
|
|
12
|
+
/* Sizing */
|
|
13
|
+
flex: 1 1 0;
|
|
14
|
+
min-width: 250px;
|
|
15
|
+
height: 268px;
|
|
16
|
+
|
|
17
|
+
/* Appearance */
|
|
18
|
+
background: var(--color-bg-container-primary-semi);
|
|
19
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
20
|
+
border-radius: var(--radius-xl); /* 24px */
|
|
21
|
+
padding: var(--padding-lg); /* 20px */
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
color: inherit;
|
|
24
|
+
text-decoration: none;
|
|
25
|
+
|
|
26
|
+
/* Interaction */
|
|
27
|
+
transition: transform var(--motion-duration-slow) var(--motion-ease-standard), box-shadow var(--motion-duration-slow) var(--motion-ease-standard);
|
|
28
|
+
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ds-card--interactive {
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ds-card--interactive:hover {
|
|
36
|
+
transform: translateY(-4px);
|
|
37
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ============================================
|
|
41
|
+
PREVIEW AREA
|
|
42
|
+
============================================ */
|
|
43
|
+
|
|
44
|
+
.ds-card__preview {
|
|
45
|
+
flex: 1;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
height: 184px;
|
|
50
|
+
min-height: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ============================================
|
|
54
|
+
TITLE
|
|
55
|
+
============================================ */
|
|
56
|
+
|
|
57
|
+
.ds-card__title {
|
|
58
|
+
font-family: var(--font-paragraph-family);
|
|
59
|
+
font-size: var(--font-heading-3-size);
|
|
60
|
+
font-weight: var(--font-heading-3-weight);
|
|
61
|
+
line-height: var(--font-heading-3-line-height);
|
|
62
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
63
|
+
color: var(--color-text-primary);
|
|
64
|
+
width: 100%;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ============================================
|
|
69
|
+
CASE-STUDY VARIANT
|
|
70
|
+
============================================ */
|
|
71
|
+
|
|
72
|
+
.ds-card--case-study {
|
|
73
|
+
height: auto;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
padding: 0;
|
|
76
|
+
gap: 0;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ds-card--case-study:hover {
|
|
82
|
+
transform: translateY(-4px);
|
|
83
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ds-card--case-study--placeholder {
|
|
87
|
+
opacity: 0.55;
|
|
88
|
+
cursor: default;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ds-card--case-study--placeholder:hover {
|
|
92
|
+
transform: none;
|
|
93
|
+
box-shadow: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ds-card--case-study__cover-wrap {
|
|
97
|
+
width: 100%;
|
|
98
|
+
aspect-ratio: 940 / 480;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
background: var(--color-bg-container-secondary);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ds-card--case-study__cover-image {
|
|
104
|
+
width: 100%;
|
|
105
|
+
height: 100%;
|
|
106
|
+
object-fit: cover;
|
|
107
|
+
display: block;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ds-card--case-study__cover-placeholder {
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
background: var(--color-bg-container-secondary);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ds-card--case-study__cover-placeholder-logo {
|
|
120
|
+
width: 64px;
|
|
121
|
+
height: 64px;
|
|
122
|
+
object-fit: contain;
|
|
123
|
+
opacity: 0.6;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ds-card--case-study__body {
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
gap: var(--gap-sm);
|
|
130
|
+
padding: var(--padding-lg);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ds-card--case-study__eyebrow {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
gap: var(--gap-xs);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.ds-card--case-study__company-logo {
|
|
140
|
+
width: 20px;
|
|
141
|
+
height: 20px;
|
|
142
|
+
object-fit: contain;
|
|
143
|
+
flex-shrink: 0;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ds-card--case-study__company-name {
|
|
147
|
+
font-size: var(--font-paragraph-sm-size);
|
|
148
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
149
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
150
|
+
color: var(--color-text-secondary);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ds-card--case-study__title {
|
|
154
|
+
font-size: var(--font-heading-3-size);
|
|
155
|
+
font-weight: var(--font-heading-3-weight);
|
|
156
|
+
line-height: var(--font-heading-3-line-height);
|
|
157
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
158
|
+
color: var(--color-text-primary);
|
|
159
|
+
margin: 0;
|
|
160
|
+
text-align: left;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ds-card--case-study__dek {
|
|
164
|
+
font-size: var(--font-paragraph-size);
|
|
165
|
+
font-weight: var(--font-paragraph-weight);
|
|
166
|
+
line-height: var(--font-paragraph-line-height);
|
|
167
|
+
color: var(--color-text-secondary);
|
|
168
|
+
margin: 0;
|
|
169
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
/** Card variant */
|
|
4
|
+
variant?: 'default' | 'case-study';
|
|
5
|
+
/** Card title displayed below the preview */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Preview content rendered inside the card (default variant only) */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** Whether the card is interactive (hoverable) */
|
|
10
|
+
interactive?: boolean;
|
|
11
|
+
/** Click handler */
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
/** Additional CSS classes */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Navigation href — renders the card as an <a> tag */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** Cover image src */
|
|
18
|
+
coverSrc?: string;
|
|
19
|
+
/** Cover image alt text */
|
|
20
|
+
coverAlt?: string;
|
|
21
|
+
/** Path to the company logo shown in the eyebrow */
|
|
22
|
+
companyLogo?: string;
|
|
23
|
+
/** Company name shown in the eyebrow */
|
|
24
|
+
companyName?: string;
|
|
25
|
+
/** Subtitle / dek line below the title */
|
|
26
|
+
dek?: string;
|
|
27
|
+
/** Render as a disabled placeholder (no href, dimmed, not interactive) */
|
|
28
|
+
placeholder?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const Card: ({ variant, title, children, interactive, onClick, className, href, coverSrc, coverAlt, companyLogo, companyName, dek, placeholder, }: CardProps) => React.JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./Card.css";
|
|
4
|
+
import "../../fonts/material-symbols.css";
|
|
5
|
+
const Card = ({
|
|
6
|
+
variant = "default",
|
|
7
|
+
title,
|
|
8
|
+
children,
|
|
9
|
+
interactive = false,
|
|
10
|
+
onClick,
|
|
11
|
+
className = "",
|
|
12
|
+
href,
|
|
13
|
+
coverSrc,
|
|
14
|
+
coverAlt,
|
|
15
|
+
companyLogo,
|
|
16
|
+
companyName,
|
|
17
|
+
dek,
|
|
18
|
+
placeholder = false
|
|
19
|
+
}) => {
|
|
20
|
+
if (variant === "case-study") {
|
|
21
|
+
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "ds-card--case-study__cover-wrap", children: coverSrc ? /* @__PURE__ */ jsx(
|
|
23
|
+
"img",
|
|
24
|
+
{
|
|
25
|
+
src: coverSrc,
|
|
26
|
+
alt: coverAlt ?? `${title} cover`,
|
|
27
|
+
className: "ds-card--case-study__cover-image"
|
|
28
|
+
}
|
|
29
|
+
) : /* @__PURE__ */ jsx("div", { className: "ds-card--case-study__cover-placeholder", children: companyLogo && /* @__PURE__ */ jsx(
|
|
30
|
+
"img",
|
|
31
|
+
{
|
|
32
|
+
src: companyLogo,
|
|
33
|
+
alt: "",
|
|
34
|
+
className: "ds-card--case-study__cover-placeholder-logo"
|
|
35
|
+
}
|
|
36
|
+
) }) }),
|
|
37
|
+
/* @__PURE__ */ jsxs("div", { className: "ds-card--case-study__body", children: [
|
|
38
|
+
(companyLogo || companyName) && /* @__PURE__ */ jsxs("div", { className: "ds-card--case-study__eyebrow", children: [
|
|
39
|
+
companyLogo && /* @__PURE__ */ jsx(
|
|
40
|
+
"img",
|
|
41
|
+
{
|
|
42
|
+
src: companyLogo,
|
|
43
|
+
alt: "",
|
|
44
|
+
className: "ds-card--case-study__company-logo"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
companyName && /* @__PURE__ */ jsx("span", { className: "ds-card--case-study__company-name", children: companyName })
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx("h3", { className: "ds-card--case-study__title", children: title }),
|
|
50
|
+
dek && /* @__PURE__ */ jsx("p", { className: "ds-card--case-study__dek", children: dek })
|
|
51
|
+
] })
|
|
52
|
+
] });
|
|
53
|
+
const classes2 = [
|
|
54
|
+
"ds-card",
|
|
55
|
+
"ds-card--case-study",
|
|
56
|
+
placeholder ? "ds-card--case-study--placeholder" : "",
|
|
57
|
+
className
|
|
58
|
+
].filter(Boolean).join(" ");
|
|
59
|
+
if (placeholder || !href) {
|
|
60
|
+
return /* @__PURE__ */ jsx("div", { className: classes2, "aria-disabled": "true", children: inner });
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ jsx("a", { href, className: classes2, children: inner });
|
|
63
|
+
}
|
|
64
|
+
const baseClass = "ds-card";
|
|
65
|
+
const interactiveClass = interactive ? `${baseClass}--interactive` : "";
|
|
66
|
+
const classes = [baseClass, interactiveClass, className].filter(Boolean).join(" ");
|
|
67
|
+
return /* @__PURE__ */ jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: classes,
|
|
71
|
+
onClick: interactive ? onClick : void 0,
|
|
72
|
+
onKeyDown: interactive ? (e) => {
|
|
73
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
onClick?.();
|
|
76
|
+
}
|
|
77
|
+
} : void 0,
|
|
78
|
+
role: interactive ? "button" : void 0,
|
|
79
|
+
tabIndex: interactive ? 0 : void 0,
|
|
80
|
+
"aria-label": interactive ? title : void 0,
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__preview`, children }),
|
|
83
|
+
/* @__PURE__ */ jsx("h3", { className: `${baseClass}__title`, children: title })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
Card
|
|
90
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
CAROUSEL COMPONENT
|
|
3
|
+
Sliding content viewer with navigation
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-carousel {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* ============================================
|
|
12
|
+
VIEWPORT & TRACK
|
|
13
|
+
============================================ */
|
|
14
|
+
|
|
15
|
+
.ds-carousel__viewport {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
border-radius: var(--radius-sm); /* 8px */
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ds-carousel__track {
|
|
21
|
+
display: flex;
|
|
22
|
+
transition: transform var(--motion-duration-deliberate) var(--motion-ease-standard);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ds-carousel__slide {
|
|
26
|
+
min-width: 100%;
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ============================================
|
|
31
|
+
ARROWS
|
|
32
|
+
============================================ */
|
|
33
|
+
|
|
34
|
+
.ds-carousel__arrow {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 50%;
|
|
37
|
+
transform: translateY(-50%);
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
width: 36px;
|
|
42
|
+
height: 36px;
|
|
43
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
44
|
+
border-radius: var(--radius-full);
|
|
45
|
+
background-color: var(--color-bg-page-primary);
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
z-index: 2;
|
|
48
|
+
color: var(--color-icon-primary);
|
|
49
|
+
padding: 0;
|
|
50
|
+
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ds-carousel__arrow:hover:not(:disabled) {
|
|
54
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ds-carousel__arrow:focus-visible {
|
|
58
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
59
|
+
outline-offset: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ds-carousel__arrow--prev {
|
|
63
|
+
left: var(--gap-sm); /* 8px */
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ds-carousel__arrow--next {
|
|
67
|
+
right: var(--gap-sm);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ds-carousel__arrow:disabled {
|
|
71
|
+
opacity: 0.4;
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ds-carousel__arrow .material-symbols-rounded {
|
|
76
|
+
--icon-size: var(--icon-size-sm);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ============================================
|
|
80
|
+
DOTS
|
|
81
|
+
============================================ */
|
|
82
|
+
|
|
83
|
+
.ds-carousel__dots {
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: var(--gap-sm); /* 8px */
|
|
87
|
+
padding-top: var(--padding-sm); /* 8px */
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-carousel__dot {
|
|
91
|
+
width: 8px;
|
|
92
|
+
height: 8px;
|
|
93
|
+
border-radius: var(--radius-full);
|
|
94
|
+
border: none;
|
|
95
|
+
padding: 0;
|
|
96
|
+
background-color: var(--color-bg-container-border);
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ds-carousel__dot:hover {
|
|
102
|
+
background-color: var(--color-text-tertiary);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ds-carousel__dot--active {
|
|
106
|
+
background-color: var(--color-action-primary-bg);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-carousel__dot:focus-visible {
|
|
110
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
111
|
+
outline-offset: 2px;
|
|
112
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface CarouselProps {
|
|
3
|
+
/** Carousel slides */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** Show dot indicators */
|
|
6
|
+
showDots?: boolean;
|
|
7
|
+
/** Show previous/next navigation arrows */
|
|
8
|
+
showArrows?: boolean;
|
|
9
|
+
/** Auto-play slides */
|
|
10
|
+
autoPlay?: boolean;
|
|
11
|
+
/** Auto-play interval in milliseconds */
|
|
12
|
+
autoPlayInterval?: number;
|
|
13
|
+
/** Whether navigation should loop */
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
/** Callback when active slide changes */
|
|
16
|
+
onSlideChange?: (index: number) => void;
|
|
17
|
+
/** Additional CSS classes */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Carousel component for sliding through content.
|
|
22
|
+
* Supports navigation arrows, dot indicators, auto-play,
|
|
23
|
+
* and keyboard navigation.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Carousel: ({ children, showDots, showArrows, autoPlay, autoPlayInterval, loop, onSlideChange, className, }: CarouselProps) => React.JSX.Element | null;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import "./Carousel.css";
|
|
4
|
+
import "../../fonts/material-symbols.css";
|
|
5
|
+
const Carousel = ({
|
|
6
|
+
children,
|
|
7
|
+
showDots = true,
|
|
8
|
+
showArrows = true,
|
|
9
|
+
autoPlay = false,
|
|
10
|
+
autoPlayInterval = 5e3,
|
|
11
|
+
loop = false,
|
|
12
|
+
onSlideChange,
|
|
13
|
+
className = ""
|
|
14
|
+
}) => {
|
|
15
|
+
const slides = React.Children.toArray(children);
|
|
16
|
+
const slideCount = slides.length;
|
|
17
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
18
|
+
const [paused, setPaused] = useState(false);
|
|
19
|
+
const containerRef = useRef(null);
|
|
20
|
+
const baseClass = "ds-carousel";
|
|
21
|
+
const goTo = useCallback(
|
|
22
|
+
(index) => {
|
|
23
|
+
let next = index;
|
|
24
|
+
if (loop) {
|
|
25
|
+
next = (index % slideCount + slideCount) % slideCount;
|
|
26
|
+
} else {
|
|
27
|
+
next = Math.max(0, Math.min(index, slideCount - 1));
|
|
28
|
+
}
|
|
29
|
+
setActiveIndex(next);
|
|
30
|
+
onSlideChange?.(next);
|
|
31
|
+
},
|
|
32
|
+
[slideCount, loop, onSlideChange]
|
|
33
|
+
);
|
|
34
|
+
const goNext = useCallback(() => goTo(activeIndex + 1), [activeIndex, goTo]);
|
|
35
|
+
const goPrev = useCallback(() => goTo(activeIndex - 1), [activeIndex, goTo]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!autoPlay || paused || slideCount <= 1) return;
|
|
38
|
+
const interval = setInterval(goNext, autoPlayInterval);
|
|
39
|
+
return () => clearInterval(interval);
|
|
40
|
+
}, [autoPlay, paused, autoPlayInterval, goNext, slideCount]);
|
|
41
|
+
const handleKeyDown = (e) => {
|
|
42
|
+
if (e.key === "ArrowLeft") {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
goPrev();
|
|
45
|
+
} else if (e.key === "ArrowRight") {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
goNext();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const canGoPrev = loop || activeIndex > 0;
|
|
51
|
+
const canGoNext = loop || activeIndex < slideCount - 1;
|
|
52
|
+
const containerClasses = [baseClass, className].filter(Boolean).join(" ");
|
|
53
|
+
if (slideCount === 0) return null;
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: containerClasses,
|
|
58
|
+
ref: containerRef,
|
|
59
|
+
onMouseEnter: () => setPaused(true),
|
|
60
|
+
onMouseLeave: () => setPaused(false),
|
|
61
|
+
onKeyDown: handleKeyDown,
|
|
62
|
+
role: "region",
|
|
63
|
+
"aria-roledescription": "carousel",
|
|
64
|
+
"aria-label": "Carousel",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__viewport`, children: /* @__PURE__ */ jsx(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: `${baseClass}__track`,
|
|
70
|
+
style: { transform: `translateX(-${activeIndex * 100}%)` },
|
|
71
|
+
children: slides.map((slide, index) => /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: `${baseClass}__slide`,
|
|
75
|
+
role: "group",
|
|
76
|
+
"aria-roledescription": "slide",
|
|
77
|
+
"aria-label": `Slide ${index + 1} of ${slideCount}`,
|
|
78
|
+
children: slide
|
|
79
|
+
},
|
|
80
|
+
index
|
|
81
|
+
))
|
|
82
|
+
}
|
|
83
|
+
) }),
|
|
84
|
+
showArrows && slideCount > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"button",
|
|
87
|
+
{
|
|
88
|
+
className: `${baseClass}__arrow ${baseClass}__arrow--prev`,
|
|
89
|
+
onClick: goPrev,
|
|
90
|
+
disabled: !canGoPrev,
|
|
91
|
+
"aria-label": "Previous slide",
|
|
92
|
+
type: "button",
|
|
93
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "chevron_left" })
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
"button",
|
|
98
|
+
{
|
|
99
|
+
className: `${baseClass}__arrow ${baseClass}__arrow--next`,
|
|
100
|
+
onClick: goNext,
|
|
101
|
+
disabled: !canGoNext,
|
|
102
|
+
"aria-label": "Next slide",
|
|
103
|
+
type: "button",
|
|
104
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: "chevron_right" })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }),
|
|
108
|
+
showDots && slideCount > 1 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__dots`, role: "tablist", "aria-label": "Slide indicators", children: slides.map((_, index) => /* @__PURE__ */ jsx(
|
|
109
|
+
"button",
|
|
110
|
+
{
|
|
111
|
+
className: `${baseClass}__dot${index === activeIndex ? ` ${baseClass}__dot--active` : ""}`,
|
|
112
|
+
onClick: () => goTo(index),
|
|
113
|
+
role: "tab",
|
|
114
|
+
"aria-selected": index === activeIndex,
|
|
115
|
+
"aria-label": `Go to slide ${index + 1}`,
|
|
116
|
+
type: "button"
|
|
117
|
+
},
|
|
118
|
+
index
|
|
119
|
+
)) })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
export {
|
|
125
|
+
Carousel
|
|
126
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChartSummaryItem } from './BarChart';
|
|
2
|
+
export interface AreaSeriesConfig {
|
|
3
|
+
/** Key in data for this series */
|
|
4
|
+
dataKey: string;
|
|
5
|
+
/** Display name (shown in tooltip and legend) */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Area stroke / fill colour — CSS value */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Fill opacity (0–1) */
|
|
10
|
+
fillOpacity?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface AreaChartProps {
|
|
13
|
+
/** Array of data objects */
|
|
14
|
+
data: Record<string, unknown>[];
|
|
15
|
+
/** Key in data for x-axis values */
|
|
16
|
+
xKey?: string;
|
|
17
|
+
/** One or more area series to render */
|
|
18
|
+
series: AreaSeriesConfig[];
|
|
19
|
+
/** Whether areas stack on top of each other */
|
|
20
|
+
stacked?: boolean;
|
|
21
|
+
/** Chart title */
|
|
22
|
+
title?: string;
|
|
23
|
+
/** Description text below the title */
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
/** Summary stats displayed in the header */
|
|
26
|
+
summaryItems?: ChartSummaryItem[];
|
|
27
|
+
/** Chart area height in pixels */
|
|
28
|
+
height?: number;
|
|
29
|
+
/** Additional CSS classes on the wrapper */
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Area chart built on Recharts with design-system tokens.
|
|
34
|
+
* Supports multiple stacked or overlapping series with gradient fills.
|
|
35
|
+
*/
|
|
36
|
+
export declare const AreaChart: ({ data, xKey, series, stacked, title, subtitle, summaryItems, height, className, }: AreaChartProps) => import("react").JSX.Element;
|