@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,193 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
INPUT COMPONENT
|
|
3
|
+
Text input with label, icons, and helper text
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-input {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--gap-sm); /* 8px */
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ============================================
|
|
14
|
+
LABEL
|
|
15
|
+
============================================ */
|
|
16
|
+
|
|
17
|
+
.ds-input__label {
|
|
18
|
+
font-family: var(--font-paragraph-em-family);
|
|
19
|
+
font-size: var(--font-paragraph-em-size);
|
|
20
|
+
font-weight: var(--font-paragraph-em-weight);
|
|
21
|
+
line-height: var(--font-paragraph-em-line-height);
|
|
22
|
+
letter-spacing: var(--font-paragraph-em-letter-spacing);
|
|
23
|
+
color: var(--color-text-primary);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ds-input__required {
|
|
27
|
+
color: var(--color-core-accent-coral);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ============================================
|
|
31
|
+
FIELD WRAPPER
|
|
32
|
+
============================================ */
|
|
33
|
+
|
|
34
|
+
.ds-input__field-wrapper {
|
|
35
|
+
position: relative;
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ============================================
|
|
41
|
+
FIELD
|
|
42
|
+
============================================ */
|
|
43
|
+
|
|
44
|
+
.ds-input__field {
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding: var(--padding-sm) var(--padding-md); /* 8px 16px */
|
|
47
|
+
border: var(--border-xs) solid var(--color-input-border-primary);
|
|
48
|
+
border-radius: var(--radius-md); /* 12px */
|
|
49
|
+
background-color: var(--color-input-bg-primary);
|
|
50
|
+
|
|
51
|
+
/* Typography */
|
|
52
|
+
font-family: var(--font-paragraph-family);
|
|
53
|
+
font-size: var(--font-paragraph-size);
|
|
54
|
+
font-weight: var(--font-paragraph-weight);
|
|
55
|
+
line-height: var(--font-paragraph-line-height);
|
|
56
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
57
|
+
color: var(--color-input-text-primary);
|
|
58
|
+
|
|
59
|
+
/* Transitions */
|
|
60
|
+
transition: border-color var(--motion-duration-base) var(--motion-ease-standard), background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ds-input__field::placeholder {
|
|
65
|
+
color: var(--color-input-text-placeholder);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ds-input__field:hover:not(:focus):not(:disabled) {
|
|
69
|
+
border-color: var(--color-input-border-hover);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-input__field:focus {
|
|
73
|
+
border-color: var(--color-input-border-selected);
|
|
74
|
+
background-color: var(--color-input-bg-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ============================================
|
|
78
|
+
ICONS
|
|
79
|
+
============================================ */
|
|
80
|
+
|
|
81
|
+
.ds-input__icon {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 50%;
|
|
84
|
+
transform: translateY(-50%);
|
|
85
|
+
--icon-size: var(--icon-size-md);
|
|
86
|
+
color: var(--color-icon-primary);
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-input__icon--left {
|
|
91
|
+
left: var(--padding-md); /* 16px */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.ds-input__icon--right {
|
|
95
|
+
right: var(--padding-md); /* 16px */
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ds-input--has-icon-left .ds-input__field {
|
|
99
|
+
padding-left: calc(var(--padding-md) + 24px + var(--gap-sm)); /* 16px + 24px icon + 8px gap */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ds-input--has-icon-right .ds-input__field {
|
|
103
|
+
padding-right: calc(var(--padding-md) + 24px + var(--gap-sm)); /* 16px + 24px icon + 8px gap */
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ============================================
|
|
107
|
+
HELPER TEXT
|
|
108
|
+
============================================ */
|
|
109
|
+
|
|
110
|
+
.ds-input__helper {
|
|
111
|
+
font-family: var(--font-paragraph-sm-family);
|
|
112
|
+
font-size: var(--font-paragraph-sm-size);
|
|
113
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
114
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
115
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
116
|
+
color: var(--color-text-tertiary);
|
|
117
|
+
margin: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ============================================
|
|
121
|
+
ERROR STATE
|
|
122
|
+
============================================ */
|
|
123
|
+
|
|
124
|
+
.ds-input--error .ds-input__field {
|
|
125
|
+
border-color: var(--color-status-error-border);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.ds-input--error .ds-input__field:focus {
|
|
129
|
+
border-color: var(--color-status-error-border);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ds-input--error .ds-input__helper {
|
|
133
|
+
color: var(--color-status-error-border);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ============================================
|
|
137
|
+
DISABLED STATE
|
|
138
|
+
============================================ */
|
|
139
|
+
|
|
140
|
+
.ds-input--disabled .ds-input__label {
|
|
141
|
+
color: var(--color-input-text-disabled);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ds-input--disabled .ds-input__field {
|
|
145
|
+
background-color: var(--color-input-bg-disabled);
|
|
146
|
+
border-color: var(--color-input-border-disabled);
|
|
147
|
+
color: var(--color-input-text-disabled);
|
|
148
|
+
cursor: not-allowed;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ds-input--disabled .ds-input__field::placeholder {
|
|
152
|
+
color: var(--color-input-text-disabled);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.ds-input--disabled .ds-input__icon {
|
|
156
|
+
color: var(--color-input-text-disabled);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* ============================================
|
|
160
|
+
SIZE — COMPACT
|
|
161
|
+
============================================ */
|
|
162
|
+
|
|
163
|
+
.ds-input--compact .ds-input__field {
|
|
164
|
+
padding: var(--padding-xs) var(--padding-sm-md); /* 6px 12px */
|
|
165
|
+
font-size: var(--font-paragraph-sm-size);
|
|
166
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
167
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.ds-input--compact .ds-input__icon {
|
|
171
|
+
--icon-size: var(--icon-size-sm);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ds-input--compact .ds-input__icon--left {
|
|
175
|
+
left: var(--padding-sm-md); /* 12px */
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.ds-input--compact .ds-input__icon--right {
|
|
179
|
+
right: var(--padding-sm-md); /* 12px */
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.ds-input--compact.ds-input--has-icon-left .ds-input__field {
|
|
183
|
+
padding-left: calc(var(--padding-sm-md) + 20px + var(--gap-sm)); /* 12px + 20px icon + 8px gap */
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.ds-input--compact.ds-input--has-icon-right .ds-input__field {
|
|
187
|
+
padding-right: calc(var(--padding-sm-md) + 20px + var(--gap-sm)); /* 12px + 20px icon + 8px gap */
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ds-input--compact .ds-input__label {
|
|
191
|
+
font-size: var(--font-paragraph-sm-size);
|
|
192
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
193
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface InputProps {
|
|
3
|
+
/** Input label text */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Placeholder text */
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
/** Current value */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Input type */
|
|
10
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url';
|
|
11
|
+
/** Component size */
|
|
12
|
+
size?: 'default' | 'compact';
|
|
13
|
+
/** Whether the input is disabled */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Whether the input is required */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** Error state — shows error styling and message */
|
|
18
|
+
error?: boolean;
|
|
19
|
+
/** Helper or error message displayed below the input */
|
|
20
|
+
helperText?: string;
|
|
21
|
+
/** Material Symbol icon name on the left */
|
|
22
|
+
iconLeft?: string;
|
|
23
|
+
/** Material Symbol icon name on the right */
|
|
24
|
+
iconRight?: string;
|
|
25
|
+
/** Callback when value changes */
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
/** Callback on focus */
|
|
28
|
+
onFocus?: () => void;
|
|
29
|
+
/** Callback on blur */
|
|
30
|
+
onBlur?: () => void;
|
|
31
|
+
/** Additional CSS classes */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Accessible name override */
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
/** HTML name attribute */
|
|
36
|
+
name?: string;
|
|
37
|
+
/** HTML id attribute */
|
|
38
|
+
id?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare const Input: ({ label, placeholder, value, type, size, disabled, required, error, helperText, iconLeft, iconRight, onChange, onFocus, onBlur, className, ariaLabel, name, id, }: InputProps) => React.JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./Input.css";
|
|
4
|
+
import "../../fonts/material-symbols.css";
|
|
5
|
+
const Input = ({
|
|
6
|
+
label,
|
|
7
|
+
placeholder = "",
|
|
8
|
+
value,
|
|
9
|
+
type = "text",
|
|
10
|
+
size = "default",
|
|
11
|
+
disabled = false,
|
|
12
|
+
required = false,
|
|
13
|
+
error = false,
|
|
14
|
+
helperText,
|
|
15
|
+
iconLeft,
|
|
16
|
+
iconRight,
|
|
17
|
+
onChange,
|
|
18
|
+
onFocus,
|
|
19
|
+
onBlur,
|
|
20
|
+
className = "",
|
|
21
|
+
ariaLabel,
|
|
22
|
+
name,
|
|
23
|
+
id
|
|
24
|
+
}) => {
|
|
25
|
+
const baseClass = "ds-input";
|
|
26
|
+
const sizeClass = size === "compact" ? `${baseClass}--compact` : "";
|
|
27
|
+
const errorClass = error ? `${baseClass}--error` : "";
|
|
28
|
+
const disabledClass = disabled ? `${baseClass}--disabled` : "";
|
|
29
|
+
const hasLeftIcon = iconLeft ? `${baseClass}--has-icon-left` : "";
|
|
30
|
+
const hasRightIcon = iconRight ? `${baseClass}--has-icon-right` : "";
|
|
31
|
+
const classes = [baseClass, sizeClass, errorClass, disabledClass, hasLeftIcon, hasRightIcon, className].filter(Boolean).join(" ");
|
|
32
|
+
const handleChange = (e) => {
|
|
33
|
+
if (onChange) {
|
|
34
|
+
onChange(e.target.value);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const inputId = id || name || label?.toLowerCase().replace(/\s+/g, "-");
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
39
|
+
label && /* @__PURE__ */ jsxs("label", { className: `${baseClass}__label`, htmlFor: inputId, children: [
|
|
40
|
+
label,
|
|
41
|
+
required && /* @__PURE__ */ jsx("span", { className: `${baseClass}__required`, "aria-hidden": "true", children: " *" })
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__field-wrapper`, children: [
|
|
44
|
+
iconLeft && /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon ${baseClass}__icon--left material-symbols-rounded`, "aria-hidden": "true", children: iconLeft }),
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
className: `${baseClass}__field`,
|
|
49
|
+
type,
|
|
50
|
+
id: inputId,
|
|
51
|
+
name,
|
|
52
|
+
value,
|
|
53
|
+
placeholder,
|
|
54
|
+
disabled,
|
|
55
|
+
required,
|
|
56
|
+
"aria-label": ariaLabel || label,
|
|
57
|
+
"aria-invalid": error,
|
|
58
|
+
"aria-describedby": helperText ? `${inputId}-helper` : void 0,
|
|
59
|
+
onChange: handleChange,
|
|
60
|
+
onFocus,
|
|
61
|
+
onBlur
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
iconRight && /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon ${baseClass}__icon--right material-symbols-rounded`, "aria-hidden": "true", children: iconRight })
|
|
65
|
+
] }),
|
|
66
|
+
helperText && /* @__PURE__ */ jsx("p", { className: `${baseClass}__helper`, id: `${inputId}-helper`, children: helperText })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
Input
|
|
71
|
+
};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
INSTRUCTIONS COMPONENT
|
|
3
|
+
Step-by-step guidance with numbered steps
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-instructions {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--gap-md); /* 16px */
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ============================================
|
|
14
|
+
TITLE
|
|
15
|
+
============================================ */
|
|
16
|
+
|
|
17
|
+
.ds-instructions__title {
|
|
18
|
+
font-family: var(--font-heading-3-family);
|
|
19
|
+
font-size: var(--font-heading-3-size);
|
|
20
|
+
font-weight: var(--font-heading-3-weight);
|
|
21
|
+
line-height: var(--font-heading-3-line-height);
|
|
22
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
23
|
+
color: var(--color-text-primary);
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* ============================================
|
|
28
|
+
LIST
|
|
29
|
+
============================================ */
|
|
30
|
+
|
|
31
|
+
.ds-instructions__list {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: 0;
|
|
35
|
+
list-style: none;
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ============================================
|
|
41
|
+
STEP
|
|
42
|
+
============================================ */
|
|
43
|
+
|
|
44
|
+
.ds-instructions__step {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: var(--gap-sm); /* 8px */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ============================================
|
|
50
|
+
INDICATOR (badge + connector)
|
|
51
|
+
============================================ */
|
|
52
|
+
|
|
53
|
+
.ds-instructions__indicator {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
align-items: center;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ds-instructions__badge {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
width: 32px;
|
|
65
|
+
height: 32px;
|
|
66
|
+
border-radius: var(--radius-full);
|
|
67
|
+
border: var(--border-xs) solid var(--color-action-primary-border);
|
|
68
|
+
background-color: transparent;
|
|
69
|
+
flex-shrink: 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-instructions__badge .material-symbols-rounded {
|
|
73
|
+
--icon-size: var(--icon-size-md);
|
|
74
|
+
color: var(--color-action-primary-bg);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-instructions__number {
|
|
78
|
+
font-family: var(--font-title-body-family);
|
|
79
|
+
font-size: var(--font-paragraph-sm-size);
|
|
80
|
+
font-weight: var(--font-title-body-weight);
|
|
81
|
+
line-height: 1;
|
|
82
|
+
color: var(--color-action-primary-bg);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ds-instructions__dot {
|
|
86
|
+
width: 8px;
|
|
87
|
+
height: 8px;
|
|
88
|
+
border-radius: var(--radius-full);
|
|
89
|
+
background-color: var(--color-action-primary-bg);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ds-instructions__connector {
|
|
93
|
+
width: var(--border-xs); /* 1px */
|
|
94
|
+
flex: 1;
|
|
95
|
+
min-height: var(--padding-md); /* 16px */
|
|
96
|
+
background-color: var(--color-bg-container-border);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* ============================================
|
|
100
|
+
CONTENT
|
|
101
|
+
============================================ */
|
|
102
|
+
|
|
103
|
+
.ds-instructions__content {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
gap: var(--gap-xxs); /* 2px */
|
|
107
|
+
padding-top: var(--padding-xxs); /* 4px — align text with badge center */
|
|
108
|
+
padding-bottom: var(--padding-md); /* 16px — space before next step */
|
|
109
|
+
min-width: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ds-instructions__step:last-child .ds-instructions__content {
|
|
113
|
+
padding-bottom: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ds-instructions__label {
|
|
117
|
+
font-family: var(--font-paragraph-em-family);
|
|
118
|
+
font-size: var(--font-paragraph-em-size);
|
|
119
|
+
font-weight: var(--font-paragraph-em-weight);
|
|
120
|
+
line-height: var(--font-paragraph-em-line-height);
|
|
121
|
+
letter-spacing: var(--font-paragraph-em-letter-spacing);
|
|
122
|
+
color: var(--color-text-primary);
|
|
123
|
+
margin: 0;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ds-instructions__description {
|
|
127
|
+
font-family: var(--font-paragraph-family);
|
|
128
|
+
font-size: var(--font-paragraph-size);
|
|
129
|
+
font-weight: var(--font-paragraph-weight);
|
|
130
|
+
line-height: var(--font-paragraph-line-height);
|
|
131
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
132
|
+
color: var(--color-text-secondary);
|
|
133
|
+
margin: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ============================================
|
|
137
|
+
HORIZONTAL LAYOUT
|
|
138
|
+
============================================ */
|
|
139
|
+
|
|
140
|
+
.ds-instructions--horizontal .ds-instructions__list {
|
|
141
|
+
flex-direction: row;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.ds-instructions--horizontal .ds-instructions__step {
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: center;
|
|
147
|
+
text-align: center;
|
|
148
|
+
flex: 1;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ds-instructions--horizontal .ds-instructions__indicator {
|
|
152
|
+
flex-direction: row;
|
|
153
|
+
width: 100%;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.ds-instructions--horizontal .ds-instructions__connector {
|
|
157
|
+
width: auto;
|
|
158
|
+
height: var(--border-xs); /* 1px */
|
|
159
|
+
min-height: 0;
|
|
160
|
+
min-width: 0;
|
|
161
|
+
flex: 1;
|
|
162
|
+
align-self: center;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ds-instructions--horizontal .ds-instructions__content {
|
|
166
|
+
padding-top: var(--padding-sm); /* 8px */
|
|
167
|
+
padding-bottom: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* ============================================
|
|
171
|
+
SIZE — COMPACT
|
|
172
|
+
============================================ */
|
|
173
|
+
|
|
174
|
+
.ds-instructions--compact .ds-instructions__title {
|
|
175
|
+
font-size: var(--font-title-body-size);
|
|
176
|
+
line-height: var(--font-title-body-line-height);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.ds-instructions--compact .ds-instructions__badge {
|
|
180
|
+
width: 24px;
|
|
181
|
+
height: 24px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.ds-instructions--compact .ds-instructions__badge .material-symbols-rounded {
|
|
185
|
+
--icon-size: var(--icon-size-sm);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.ds-instructions--compact .ds-instructions__number {
|
|
189
|
+
font-size: 12px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.ds-instructions--compact .ds-instructions__dot {
|
|
193
|
+
width: 6px;
|
|
194
|
+
height: 6px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.ds-instructions--compact .ds-instructions__label {
|
|
198
|
+
font-size: var(--font-paragraph-sm-size);
|
|
199
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
200
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.ds-instructions--compact .ds-instructions__description {
|
|
204
|
+
font-size: var(--font-paragraph-sm-size);
|
|
205
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
206
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.ds-instructions--compact .ds-instructions__content {
|
|
210
|
+
padding-top: var(--padding-xxxs); /* 2px */
|
|
211
|
+
padding-bottom: var(--padding-sm); /* 8px */
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ds-instructions--compact .ds-instructions__step:last-child .ds-instructions__content {
|
|
215
|
+
padding-bottom: 0;
|
|
216
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface InstructionStep {
|
|
2
|
+
/** Step label/title */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Optional step description */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Optional custom icon — defaults to step number */
|
|
7
|
+
icon?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface InstructionsProps {
|
|
10
|
+
/** Instructions title */
|
|
11
|
+
title?: string;
|
|
12
|
+
/** Array of instruction steps */
|
|
13
|
+
steps: InstructionStep[];
|
|
14
|
+
/** Component size */
|
|
15
|
+
size?: 'default' | 'compact';
|
|
16
|
+
/** Layout direction */
|
|
17
|
+
direction?: 'vertical' | 'horizontal';
|
|
18
|
+
/** Whether to show step numbers instead of icons */
|
|
19
|
+
numbered?: boolean;
|
|
20
|
+
/** Additional CSS classes */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Instructions component for step-by-step guidance.
|
|
25
|
+
* Displays an ordered list of steps with optional icons,
|
|
26
|
+
* descriptions, and connecting lines.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Instructions: ({ title, steps, size, direction, numbered, className, }: InstructionsProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./Instructions.css";
|
|
3
|
+
import "../../fonts/material-symbols.css";
|
|
4
|
+
const Instructions = ({
|
|
5
|
+
title,
|
|
6
|
+
steps,
|
|
7
|
+
size = "default",
|
|
8
|
+
direction = "vertical",
|
|
9
|
+
numbered = true,
|
|
10
|
+
className = ""
|
|
11
|
+
}) => {
|
|
12
|
+
const baseClass = "ds-instructions";
|
|
13
|
+
const sizeClass = `${baseClass}--${size}`;
|
|
14
|
+
const dirClass = `${baseClass}--${direction}`;
|
|
15
|
+
const classes = [baseClass, sizeClass, dirClass, className].filter(Boolean).join(" ");
|
|
16
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
17
|
+
title && /* @__PURE__ */ jsx("h3", { className: `${baseClass}__title`, children: title }),
|
|
18
|
+
/* @__PURE__ */ jsx("ol", { className: `${baseClass}__list`, children: steps.map((step, idx) => /* @__PURE__ */ jsxs("li", { className: `${baseClass}__step`, children: [
|
|
19
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__indicator`, children: [
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__badge`, children: step.icon ? /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", "aria-hidden": "true", children: step.icon }) : numbered ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__number`, children: idx + 1 }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__dot` }) }),
|
|
21
|
+
idx < steps.length - 1 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__connector` })
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
|
|
24
|
+
/* @__PURE__ */ jsx("p", { className: `${baseClass}__label`, children: step.label }),
|
|
25
|
+
step.description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: step.description })
|
|
26
|
+
] })
|
|
27
|
+
] }, idx)) })
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
Instructions
|
|
32
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
.ds-link-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--gap-lg);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ds-link-list__item {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: var(--gap-md);
|
|
11
|
+
text-decoration: none;
|
|
12
|
+
color: inherit;
|
|
13
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ds-link-list__item:hover {
|
|
17
|
+
opacity: 0.8;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ds-link-list__icon-wrap {
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
width: 28px;
|
|
23
|
+
height: 28px;
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ds-link-list__logo {
|
|
30
|
+
width: 28px;
|
|
31
|
+
height: 28px;
|
|
32
|
+
object-fit: contain;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ds-link-list__symbol {
|
|
36
|
+
font-size: 28px;
|
|
37
|
+
line-height: 1;
|
|
38
|
+
color: var(--color-text-secondary);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ds-link-list__content {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
gap: 2px;
|
|
45
|
+
min-width: 0;
|
|
46
|
+
flex: 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-link-list__title {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: var(--gap-xs);
|
|
53
|
+
font-family: var(--font-title-body-family);
|
|
54
|
+
font-size: var(--font-title-body-size);
|
|
55
|
+
font-weight: var(--font-title-body-weight);
|
|
56
|
+
line-height: var(--font-title-body-line-height);
|
|
57
|
+
color: var(--color-text-primary);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ds-link-list__open-icon {
|
|
61
|
+
--icon-size: var(--icon-size-sm);
|
|
62
|
+
color: var(--color-text-tertiary);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ds-link-list__sub {
|
|
66
|
+
font-family: var(--font-paragraph-sm-family);
|
|
67
|
+
font-size: var(--font-paragraph-sm-size);
|
|
68
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
69
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
70
|
+
color: var(--color-text-tertiary);
|
|
71
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface LinkListItem {
|
|
2
|
+
/** Link destination */
|
|
3
|
+
href: string;
|
|
4
|
+
/** Primary label — shown with the open_in_new icon */
|
|
5
|
+
label: string;
|
|
6
|
+
/** One or more subtitle lines shown below the label */
|
|
7
|
+
sub?: string | string[];
|
|
8
|
+
/** Path to a logo image (preferred over icon when both are set) */
|
|
9
|
+
logo?: string;
|
|
10
|
+
/** Alt text for the logo — defaults to empty string (decorative) */
|
|
11
|
+
logoAlt?: string;
|
|
12
|
+
/** Material Symbol name used when no logo is provided (e.g. "emoji_events") */
|
|
13
|
+
icon?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface LinkListProps {
|
|
16
|
+
items: LinkListItem[];
|
|
17
|
+
/** Additional CSS classes */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const LinkList: ({ items, className }: LinkListProps) => import("react").JSX.Element;
|