@adamarant/designsystem 0.11.2
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/README.md +101 -0
- package/dist/designsystem.css +13494 -0
- package/dist/designsystem.js +67 -0
- package/dist/designsystem.min.css +2 -0
- package/package.json +111 -0
- package/src/base/index.css +2 -0
- package/src/base/reset.css +119 -0
- package/src/base/typography.css +172 -0
- package/src/components/accordion.css +166 -0
- package/src/components/admin-layout.css +371 -0
- package/src/components/alert.css +159 -0
- package/src/components/avatar.css +109 -0
- package/src/components/badge.css +80 -0
- package/src/components/bottom-nav.css +125 -0
- package/src/components/bottom-sheet.css +146 -0
- package/src/components/breadcrumb.css +102 -0
- package/src/components/button.css +250 -0
- package/src/components/card.css +117 -0
- package/src/components/chip.css +79 -0
- package/src/components/collapsible.css +112 -0
- package/src/components/color-picker.css +82 -0
- package/src/components/combobox.css +420 -0
- package/src/components/command.css +210 -0
- package/src/components/context-menu.css +162 -0
- package/src/components/copy-button.css +106 -0
- package/src/components/custom-select.css +446 -0
- package/src/components/datepicker.css +301 -0
- package/src/components/description-list.css +100 -0
- package/src/components/divider.css +66 -0
- package/src/components/drawer.css +234 -0
- package/src/components/drop-zone.css +166 -0
- package/src/components/dropdown.css +169 -0
- package/src/components/empty-state.css +75 -0
- package/src/components/field.css +112 -0
- package/src/components/gallery.css +257 -0
- package/src/components/hero.css +111 -0
- package/src/components/icon-btn.css +103 -0
- package/src/components/index.css +74 -0
- package/src/components/input.css +311 -0
- package/src/components/kbd.css +54 -0
- package/src/components/media-library.css +230 -0
- package/src/components/modal.css +136 -0
- package/src/components/nav.css +198 -0
- package/src/components/number-input.css +163 -0
- package/src/components/pagination.css +175 -0
- package/src/components/pin-input.css +136 -0
- package/src/components/popover.css +111 -0
- package/src/components/progress.css +217 -0
- package/src/components/prose.css +337 -0
- package/src/components/result.css +80 -0
- package/src/components/scroll-area.css +73 -0
- package/src/components/search.css +311 -0
- package/src/components/segmented-control.css +94 -0
- package/src/components/skeleton.css +100 -0
- package/src/components/slider.css +133 -0
- package/src/components/sortable.css +70 -0
- package/src/components/spinner.css +60 -0
- package/src/components/star-rating.css +121 -0
- package/src/components/stat-card.css +44 -0
- package/src/components/table.css +359 -0
- package/src/components/tabs.css +215 -0
- package/src/components/tag.css +188 -0
- package/src/components/timeline.css +130 -0
- package/src/components/toast.css +90 -0
- package/src/components/toggle.css +173 -0
- package/src/components/toolbar.css +206 -0
- package/src/components/tooltip.css +167 -0
- package/src/components/truncated-text.css +75 -0
- package/src/index.css +21 -0
- package/src/js/theme.js +67 -0
- package/src/tokens/colors.css +256 -0
- package/src/tokens/index.css +11 -0
- package/src/tokens/shadows.css +55 -0
- package/src/tokens/spacing.css +82 -0
- package/src/tokens/tokens.json +413 -0
- package/src/tokens/typography.css +90 -0
- package/src/utilities/a11y.css +102 -0
- package/src/utilities/index.css +7 -0
- package/src/utilities/interactive.css +121 -0
- package/src/utilities/layout.css +273 -0
- package/src/utilities/sizing.css +85 -0
- package/src/utilities/spacing.css +204 -0
- package/src/utilities/states.css +182 -0
- package/src/utilities/text.css +381 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Datepicker
|
|
3
|
+
==========================================================================
|
|
4
|
+
Calendar dropdown for date selection. Follows popover positioning pattern
|
|
5
|
+
with scale animation. Supports compact mode for inline/table usage.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
<div class="ds-datepicker ds-datepicker--open">
|
|
9
|
+
<button class="ds-datepicker__trigger">Mar 20, 2026</button>
|
|
10
|
+
<div class="ds-datepicker__panel">
|
|
11
|
+
<div class="ds-datepicker__header">
|
|
12
|
+
<button class="ds-datepicker__nav">‹</button>
|
|
13
|
+
<span class="ds-datepicker__title">March 2026</span>
|
|
14
|
+
<button class="ds-datepicker__nav">›</button>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="ds-datepicker__weekdays">
|
|
17
|
+
<span class="ds-datepicker__weekday">Mo</span>
|
|
18
|
+
...
|
|
19
|
+
</div>
|
|
20
|
+
<div class="ds-datepicker__grid">
|
|
21
|
+
<button class="ds-datepicker__day">1</button>
|
|
22
|
+
<button class="ds-datepicker__day ds-datepicker__day--today">20</button>
|
|
23
|
+
<button class="ds-datepicker__day ds-datepicker__day--selected">15</button>
|
|
24
|
+
...
|
|
25
|
+
</div>
|
|
26
|
+
<div class="ds-datepicker__footer">
|
|
27
|
+
<button class="ds-datepicker__today">Today</button>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
Modifiers:
|
|
33
|
+
.ds-datepicker--open — Shows the calendar panel
|
|
34
|
+
.ds-datepicker--compact — Reduced sizing for inline/table use
|
|
35
|
+
.ds-datepicker__day--today — Highlights current date
|
|
36
|
+
.ds-datepicker__day--selected — Marks selected date
|
|
37
|
+
.ds-datepicker__day--other-month — Dims days from adjacent months
|
|
38
|
+
========================================================================== */
|
|
39
|
+
|
|
40
|
+
.ds-datepicker {
|
|
41
|
+
/* Wrapper */
|
|
42
|
+
position: relative;
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
|
|
45
|
+
/* Trigger button */
|
|
46
|
+
&__trigger {
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--ds-space-1);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
background: none;
|
|
52
|
+
border: none;
|
|
53
|
+
padding: 0;
|
|
54
|
+
color: var(--ds-color-text);
|
|
55
|
+
font: inherit;
|
|
56
|
+
line-height: 1;
|
|
57
|
+
|
|
58
|
+
&:focus-visible {
|
|
59
|
+
outline: none;
|
|
60
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Calendar panel */
|
|
65
|
+
&__panel {
|
|
66
|
+
position: absolute;
|
|
67
|
+
z-index: var(--ds-z-dropdown);
|
|
68
|
+
inset-block-start: calc(100% + var(--ds-offset-sm));
|
|
69
|
+
inset-inline-start: 0;
|
|
70
|
+
background-color: var(--ds-color-surface-muted);
|
|
71
|
+
border: 1px solid var(--ds-color-border);
|
|
72
|
+
border-radius: var(--ds-radius-xl);
|
|
73
|
+
box-shadow: var(--ds-shadow-lg);
|
|
74
|
+
padding: var(--ds-space-3);
|
|
75
|
+
min-width: 17rem;
|
|
76
|
+
opacity: 0;
|
|
77
|
+
visibility: hidden;
|
|
78
|
+
transform: scale(0.96);
|
|
79
|
+
transition:
|
|
80
|
+
opacity var(--ds-duration-fast) var(--ds-ease-default),
|
|
81
|
+
visibility var(--ds-duration-fast) var(--ds-ease-default),
|
|
82
|
+
transform var(--ds-duration-fast) var(--ds-ease-out-expo);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Open state */
|
|
86
|
+
&--open &__panel {
|
|
87
|
+
opacity: 1;
|
|
88
|
+
visibility: visible;
|
|
89
|
+
transform: scale(1);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Header — month/year + nav arrows */
|
|
93
|
+
&__header {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: space-between;
|
|
97
|
+
margin-block-end: var(--ds-space-2);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__title {
|
|
101
|
+
font-size: var(--ds-text-sm);
|
|
102
|
+
font-weight: var(--ds-weight-semibold);
|
|
103
|
+
color: var(--ds-color-text);
|
|
104
|
+
user-select: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__nav {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
width: 1.75rem;
|
|
112
|
+
height: 1.75rem;
|
|
113
|
+
border: none;
|
|
114
|
+
background: none;
|
|
115
|
+
border-radius: var(--ds-radius-md);
|
|
116
|
+
color: var(--ds-color-text-secondary);
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
font-size: var(--ds-text-base);
|
|
119
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
120
|
+
|
|
121
|
+
&:hover {
|
|
122
|
+
background-color: var(--ds-color-surface-muted-hover);
|
|
123
|
+
color: var(--ds-color-text);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:focus-visible {
|
|
127
|
+
outline: none;
|
|
128
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Weekday header row */
|
|
133
|
+
&__weekdays {
|
|
134
|
+
display: grid;
|
|
135
|
+
grid-template-columns: repeat(7, 1fr);
|
|
136
|
+
margin-block-end: var(--ds-space-1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&__weekday {
|
|
140
|
+
font-size: var(--ds-text-xs);
|
|
141
|
+
color: var(--ds-color-text-tertiary);
|
|
142
|
+
text-align: center;
|
|
143
|
+
padding: var(--ds-space-1) 0;
|
|
144
|
+
user-select: none;
|
|
145
|
+
font-weight: var(--ds-weight-medium);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Day grid */
|
|
149
|
+
&__grid {
|
|
150
|
+
display: grid;
|
|
151
|
+
grid-template-columns: repeat(7, 1fr);
|
|
152
|
+
gap: 1px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Day cell */
|
|
156
|
+
&__day {
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
aspect-ratio: 1;
|
|
161
|
+
border: none;
|
|
162
|
+
background: none;
|
|
163
|
+
border-radius: var(--ds-radius-md);
|
|
164
|
+
font-size: var(--ds-text-sm);
|
|
165
|
+
color: var(--ds-color-text);
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
168
|
+
padding: 0;
|
|
169
|
+
line-height: 1;
|
|
170
|
+
user-select: none;
|
|
171
|
+
|
|
172
|
+
&:hover {
|
|
173
|
+
background-color: var(--ds-color-surface-muted-hover);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&:focus-visible {
|
|
177
|
+
outline: none;
|
|
178
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* Today — subtle ring */
|
|
182
|
+
&--today {
|
|
183
|
+
box-shadow: inset 0 0 0 1px var(--ds-color-border-active);
|
|
184
|
+
font-weight: var(--ds-weight-semibold);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Selected — inverted fill */
|
|
188
|
+
&--selected {
|
|
189
|
+
background-color: var(--ds-color-text);
|
|
190
|
+
color: var(--ds-color-bg);
|
|
191
|
+
font-weight: var(--ds-weight-semibold);
|
|
192
|
+
|
|
193
|
+
&:hover {
|
|
194
|
+
background-color: var(--ds-color-text);
|
|
195
|
+
opacity: 0.85;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Other month days — dimmed */
|
|
200
|
+
&--other-month {
|
|
201
|
+
color: var(--ds-color-text-tertiary);
|
|
202
|
+
opacity: 0.4;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Footer — Today pill */
|
|
207
|
+
&__footer {
|
|
208
|
+
display: flex;
|
|
209
|
+
justify-content: center;
|
|
210
|
+
margin-block-start: var(--ds-space-2);
|
|
211
|
+
padding-block-start: var(--ds-space-2);
|
|
212
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&__today {
|
|
216
|
+
font-size: var(--ds-text-xs);
|
|
217
|
+
font-weight: var(--ds-weight-medium);
|
|
218
|
+
color: var(--ds-color-text-secondary);
|
|
219
|
+
background: none;
|
|
220
|
+
border: 1px solid var(--ds-color-border);
|
|
221
|
+
border-radius: var(--ds-radius-full);
|
|
222
|
+
padding: var(--ds-space-1) var(--ds-space-3);
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
225
|
+
|
|
226
|
+
&:hover {
|
|
227
|
+
background-color: var(--ds-color-surface-muted-hover);
|
|
228
|
+
color: var(--ds-color-text);
|
|
229
|
+
border-color: var(--ds-color-border-hover);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:focus-visible {
|
|
233
|
+
outline: none;
|
|
234
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Step arrows — prev/next day buttons beside the date text */
|
|
239
|
+
&__step {
|
|
240
|
+
display: inline-flex;
|
|
241
|
+
align-items: center;
|
|
242
|
+
justify-content: center;
|
|
243
|
+
width: 1.25rem;
|
|
244
|
+
height: 1.25rem;
|
|
245
|
+
border: none;
|
|
246
|
+
background: none;
|
|
247
|
+
border-radius: var(--ds-radius-md);
|
|
248
|
+
color: var(--ds-color-text-tertiary);
|
|
249
|
+
cursor: pointer;
|
|
250
|
+
font-size: var(--ds-text-xs);
|
|
251
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
252
|
+
padding: 0;
|
|
253
|
+
flex-shrink: 0;
|
|
254
|
+
|
|
255
|
+
&:hover {
|
|
256
|
+
background-color: var(--ds-color-surface-muted-hover);
|
|
257
|
+
color: var(--ds-color-text);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&:focus-visible {
|
|
261
|
+
outline: none;
|
|
262
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Compact mode — for inline table cells */
|
|
267
|
+
&--compact {
|
|
268
|
+
& .ds-datepicker__panel {
|
|
269
|
+
min-width: 14rem;
|
|
270
|
+
padding: var(--ds-space-2);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
& .ds-datepicker__title {
|
|
274
|
+
font-size: var(--ds-text-xs);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
& .ds-datepicker__nav {
|
|
278
|
+
width: 1.5rem;
|
|
279
|
+
height: 1.5rem;
|
|
280
|
+
font-size: var(--ds-text-sm);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
& .ds-datepicker__weekday {
|
|
284
|
+
font-size: var(--ds-text-2xs);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
& .ds-datepicker__day {
|
|
288
|
+
font-size: var(--ds-text-xs);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
& .ds-datepicker__today {
|
|
292
|
+
font-size: var(--ds-text-2xs);
|
|
293
|
+
padding: 2px var(--ds-space-2);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
& .ds-datepicker__footer {
|
|
297
|
+
margin-block-start: var(--ds-space-1);
|
|
298
|
+
padding-block-start: var(--ds-space-1);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Description List
|
|
3
|
+
Key-value pairs display with horizontal and vertical layouts.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
.ds-description-list {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 0;
|
|
10
|
+
|
|
11
|
+
/* ---------------------------------------------------------------------------
|
|
12
|
+
Item
|
|
13
|
+
--------------------------------------------------------------------------- */
|
|
14
|
+
|
|
15
|
+
&__item {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--ds-space-1);
|
|
19
|
+
padding: var(--ds-space-3) 0;
|
|
20
|
+
|
|
21
|
+
&:first-child {
|
|
22
|
+
padding-block-start: 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:last-child {
|
|
26
|
+
padding-block-end: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ---------------------------------------------------------------------------
|
|
31
|
+
Term (key)
|
|
32
|
+
--------------------------------------------------------------------------- */
|
|
33
|
+
|
|
34
|
+
&__term {
|
|
35
|
+
font-family: var(--ds-font-sans);
|
|
36
|
+
font-size: var(--ds-text-sm);
|
|
37
|
+
font-weight: var(--ds-weight-medium);
|
|
38
|
+
color: var(--ds-color-text-secondary);
|
|
39
|
+
line-height: var(--ds-leading-normal);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ---------------------------------------------------------------------------
|
|
43
|
+
Detail (value)
|
|
44
|
+
--------------------------------------------------------------------------- */
|
|
45
|
+
|
|
46
|
+
&__detail {
|
|
47
|
+
font-family: var(--ds-font-sans);
|
|
48
|
+
font-size: var(--ds-text-sm);
|
|
49
|
+
color: var(--ds-color-text);
|
|
50
|
+
line-height: var(--ds-leading-normal);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ---------------------------------------------------------------------------
|
|
54
|
+
Variant: Horizontal (term and detail on same row)
|
|
55
|
+
--------------------------------------------------------------------------- */
|
|
56
|
+
|
|
57
|
+
&--horizontal {
|
|
58
|
+
& .ds-description-list__item {
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
align-items: flex-start;
|
|
61
|
+
gap: var(--ds-space-4);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
& .ds-description-list__term {
|
|
65
|
+
flex-shrink: 0;
|
|
66
|
+
min-width: 10rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
& .ds-description-list__detail {
|
|
70
|
+
flex: 1;
|
|
71
|
+
min-width: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ---------------------------------------------------------------------------
|
|
76
|
+
Variant: Bordered (separator between items)
|
|
77
|
+
--------------------------------------------------------------------------- */
|
|
78
|
+
|
|
79
|
+
&--bordered {
|
|
80
|
+
& .ds-description-list__item {
|
|
81
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
82
|
+
|
|
83
|
+
&:last-child {
|
|
84
|
+
border-block-end: 0;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* ---------------------------------------------------------------------------
|
|
90
|
+
Variant: Striped (alternating background)
|
|
91
|
+
--------------------------------------------------------------------------- */
|
|
92
|
+
|
|
93
|
+
&--striped {
|
|
94
|
+
& .ds-description-list__item:nth-child(odd) {
|
|
95
|
+
background-color: var(--ds-color-surface);
|
|
96
|
+
padding-inline: var(--ds-space-3);
|
|
97
|
+
border-radius: var(--ds-radius-md);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Divider
|
|
3
|
+
Horizontal and vertical separators with optional centered label.
|
|
4
|
+
========================================================================== */
|
|
5
|
+
|
|
6
|
+
.ds-divider {
|
|
7
|
+
border: none;
|
|
8
|
+
border-top: 1px solid var(--ds-color-border);
|
|
9
|
+
margin-block: var(--ds-space-4);
|
|
10
|
+
width: 100%;
|
|
11
|
+
|
|
12
|
+
/* --- Vertical --- */
|
|
13
|
+
|
|
14
|
+
&--vertical {
|
|
15
|
+
border-top: none;
|
|
16
|
+
border-inline-start: 1px solid var(--ds-color-border);
|
|
17
|
+
display: inline-block;
|
|
18
|
+
width: auto;
|
|
19
|
+
height: auto;
|
|
20
|
+
min-height: 1rem;
|
|
21
|
+
align-self: stretch;
|
|
22
|
+
margin-block: var(--ds-space-0);
|
|
23
|
+
margin-inline: var(--ds-space-3);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* --- Subtle --- */
|
|
27
|
+
|
|
28
|
+
&--subtle {
|
|
29
|
+
border-color: var(--ds-color-border-subtle);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* --- Spacious --- */
|
|
33
|
+
|
|
34
|
+
&--spacious {
|
|
35
|
+
margin-block: var(--ds-space-8);
|
|
36
|
+
|
|
37
|
+
&.ds-divider--vertical {
|
|
38
|
+
margin-block: var(--ds-space-0);
|
|
39
|
+
margin-inline: var(--ds-space-6);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* --- Label (centered text with lines on either side) --- */
|
|
44
|
+
|
|
45
|
+
&--label {
|
|
46
|
+
border-top: none;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: var(--ds-space-3);
|
|
50
|
+
font-family: var(--ds-font-sans);
|
|
51
|
+
font-size: var(--ds-text-xs);
|
|
52
|
+
font-weight: var(--ds-weight-medium);
|
|
53
|
+
color: var(--ds-color-text-tertiary);
|
|
54
|
+
text-transform: uppercase;
|
|
55
|
+
letter-spacing: var(--ds-tracking-wide);
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
|
|
58
|
+
&::before,
|
|
59
|
+
&::after {
|
|
60
|
+
content: '';
|
|
61
|
+
flex: 1;
|
|
62
|
+
height: 0;
|
|
63
|
+
border-top: 1px solid var(--ds-color-border);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Drawer / Sheet
|
|
3
|
+
==========================================================================
|
|
4
|
+
A sliding overlay panel anchored to the edge of the viewport.
|
|
5
|
+
Default direction is right; use `--left` or `--bottom` modifiers
|
|
6
|
+
to change the slide origin.
|
|
7
|
+
|
|
8
|
+
ARIA requirements (consumer responsibility):
|
|
9
|
+
- Container: role="dialog", aria-modal="true", aria-labelledby="[title-id]"
|
|
10
|
+
- Close button: aria-label="Close"
|
|
11
|
+
- Focus: trap focus inside drawer when open
|
|
12
|
+
- Keyboard: Escape closes drawer
|
|
13
|
+
- On open: move focus to first focusable element or close button
|
|
14
|
+
- On close: return focus to the element that triggered the drawer
|
|
15
|
+
|
|
16
|
+
Sizes:
|
|
17
|
+
--sm 18 rem
|
|
18
|
+
(default) 24 rem
|
|
19
|
+
--lg 36 rem
|
|
20
|
+
|
|
21
|
+
Usage:
|
|
22
|
+
<div class="ds-drawer ds-drawer--right ds-drawer--open" role="dialog" aria-modal="true">
|
|
23
|
+
<div class="ds-drawer__content">
|
|
24
|
+
<div class="ds-drawer__header">
|
|
25
|
+
<h3>Title</h3>
|
|
26
|
+
<button class="ds-drawer__close" aria-label="Close">×</button>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="ds-drawer__body">…</div>
|
|
29
|
+
<div class="ds-drawer__footer">…</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
========================================================================== */
|
|
33
|
+
|
|
34
|
+
/* ---------------------------------------------------------------------------
|
|
35
|
+
Overlay backdrop
|
|
36
|
+
--------------------------------------------------------------------------- */
|
|
37
|
+
|
|
38
|
+
.ds-drawer {
|
|
39
|
+
position: fixed;
|
|
40
|
+
inset: 0;
|
|
41
|
+
z-index: var(--ds-z-overlay);
|
|
42
|
+
background-color: var(--ds-color-overlay);
|
|
43
|
+
opacity: 0;
|
|
44
|
+
visibility: hidden;
|
|
45
|
+
transition:
|
|
46
|
+
opacity var(--ds-duration-normal) var(--ds-ease-default),
|
|
47
|
+
visibility var(--ds-duration-normal) var(--ds-ease-default);
|
|
48
|
+
|
|
49
|
+
&--open {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
visibility: visible;
|
|
52
|
+
|
|
53
|
+
& .ds-drawer__content {
|
|
54
|
+
transform: translateX(0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ---------------------------------------------------------------------------
|
|
59
|
+
Sliding panel
|
|
60
|
+
--------------------------------------------------------------------------- */
|
|
61
|
+
|
|
62
|
+
&__content {
|
|
63
|
+
position: fixed;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
background-color: var(--ds-color-surface);
|
|
67
|
+
box-shadow: var(--ds-shadow-lg);
|
|
68
|
+
overflow-y: auto;
|
|
69
|
+
transition: transform var(--ds-duration-normal) var(--ds-ease-out-expo);
|
|
70
|
+
/* Direction: Right (default) */
|
|
71
|
+
inset-block-start: 0;
|
|
72
|
+
inset-inline-end: 0;
|
|
73
|
+
inset-block-end: 0;
|
|
74
|
+
width: 24rem;
|
|
75
|
+
max-width: 90vw;
|
|
76
|
+
border-inline-start: 1px solid var(--ds-color-border);
|
|
77
|
+
transform: translateX(100%);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ==========================================================================
|
|
81
|
+
* Direction: Right (explicit)
|
|
82
|
+
* ========================================================================== */
|
|
83
|
+
|
|
84
|
+
&--right &__content {
|
|
85
|
+
inset-block-start: 0;
|
|
86
|
+
inset-inline-end: 0;
|
|
87
|
+
inset-block-end: 0;
|
|
88
|
+
width: 24rem;
|
|
89
|
+
max-width: 90vw;
|
|
90
|
+
border-inline-start: 1px solid var(--ds-color-border);
|
|
91
|
+
transform: translateX(100%);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--right&--open &__content {
|
|
95
|
+
transform: translateX(0);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ==========================================================================
|
|
99
|
+
* Direction: Left
|
|
100
|
+
* ========================================================================== */
|
|
101
|
+
|
|
102
|
+
&--left &__content {
|
|
103
|
+
inset-inline-start: 0;
|
|
104
|
+
inset-block-start: 0;
|
|
105
|
+
inset-block-end: 0;
|
|
106
|
+
inset-inline-end: auto;
|
|
107
|
+
width: 24rem;
|
|
108
|
+
max-width: 90vw;
|
|
109
|
+
border-inline-start: 0;
|
|
110
|
+
border-inline-end: 1px solid var(--ds-color-border);
|
|
111
|
+
transform: translateX(-100%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&--left&--open &__content {
|
|
115
|
+
transform: translateX(0);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ==========================================================================
|
|
119
|
+
* Direction: Bottom
|
|
120
|
+
* ========================================================================== */
|
|
121
|
+
|
|
122
|
+
&--bottom &__content {
|
|
123
|
+
inset-block-end: 0;
|
|
124
|
+
inset-inline-start: 0;
|
|
125
|
+
inset-inline-end: 0;
|
|
126
|
+
inset-block-start: auto;
|
|
127
|
+
width: auto;
|
|
128
|
+
max-height: 90dvh;
|
|
129
|
+
border-inline-start: 0;
|
|
130
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
131
|
+
border-radius: var(--ds-radius-xl) var(--ds-radius-xl) 0 0;
|
|
132
|
+
transform: translateY(100%);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&--bottom&--open &__content {
|
|
136
|
+
transform: translateY(0);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ==========================================================================
|
|
140
|
+
* Sizes
|
|
141
|
+
* ========================================================================== */
|
|
142
|
+
|
|
143
|
+
&--sm &__content {
|
|
144
|
+
width: 18rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&--lg &__content {
|
|
148
|
+
width: 36rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Bottom drawers should not have a fixed width */
|
|
152
|
+
&--bottom&--sm &__content,
|
|
153
|
+
&--bottom&--lg &__content {
|
|
154
|
+
width: auto;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ==========================================================================
|
|
158
|
+
* Header
|
|
159
|
+
* ========================================================================== */
|
|
160
|
+
|
|
161
|
+
&__header {
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: space-between;
|
|
164
|
+
align-items: flex-start;
|
|
165
|
+
padding: var(--ds-space-4) var(--ds-space-5);
|
|
166
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
167
|
+
|
|
168
|
+
& h3 {
|
|
169
|
+
font-family: var(--ds-font-display);
|
|
170
|
+
font-weight: var(--ds-font-display-weight);
|
|
171
|
+
font-size: var(--ds-text-lg);
|
|
172
|
+
color: var(--ds-color-text);
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* ==========================================================================
|
|
178
|
+
* Close button
|
|
179
|
+
* ========================================================================== */
|
|
180
|
+
|
|
181
|
+
&__close {
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
justify-content: center;
|
|
185
|
+
width: 2rem;
|
|
186
|
+
height: 2rem;
|
|
187
|
+
padding: 0;
|
|
188
|
+
border: 0;
|
|
189
|
+
border-radius: var(--ds-radius-md);
|
|
190
|
+
background-color: transparent;
|
|
191
|
+
color: var(--ds-color-text-tertiary);
|
|
192
|
+
font-size: var(--ds-text-lg);
|
|
193
|
+
line-height: var(--ds-leading-none);
|
|
194
|
+
cursor: pointer;
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
transition:
|
|
197
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default),
|
|
198
|
+
color var(--ds-duration-fast) var(--ds-ease-default);
|
|
199
|
+
|
|
200
|
+
&:hover {
|
|
201
|
+
background-color: var(--ds-color-overlay);
|
|
202
|
+
color: var(--ds-color-text);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&:focus-visible {
|
|
206
|
+
outline: none;
|
|
207
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
208
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ==========================================================================
|
|
213
|
+
* Body
|
|
214
|
+
* ========================================================================== */
|
|
215
|
+
|
|
216
|
+
&__body {
|
|
217
|
+
padding: var(--ds-space-5);
|
|
218
|
+
flex: 1;
|
|
219
|
+
overflow-y: auto;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* ==========================================================================
|
|
223
|
+
* Footer
|
|
224
|
+
* ========================================================================== */
|
|
225
|
+
|
|
226
|
+
&__footer {
|
|
227
|
+
padding: var(--ds-space-4) var(--ds-space-5);
|
|
228
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
justify-content: flex-end;
|
|
232
|
+
gap: var(--ds-space-2);
|
|
233
|
+
}
|
|
234
|
+
}
|