@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,136 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Modal
|
|
3
|
+
Backdrop blur, shadow-2xl, rounded-xl. Smooth scale transition.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Container: role="dialog", aria-modal="true", aria-labelledby="[title-id]"
|
|
7
|
+
- Close button: aria-label="Close"
|
|
8
|
+
- Focus: trap focus inside modal when open
|
|
9
|
+
- Keyboard: Escape closes modal
|
|
10
|
+
- On open: move focus to first focusable element or close button
|
|
11
|
+
- On close: return focus to the element that triggered the modal
|
|
12
|
+
========================================================================== */
|
|
13
|
+
|
|
14
|
+
.ds-modal {
|
|
15
|
+
position: fixed;
|
|
16
|
+
inset: 0;
|
|
17
|
+
z-index: var(--ds-z-modal);
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
padding: var(--ds-space-4);
|
|
22
|
+
background-color: var(--ds-color-overlay);
|
|
23
|
+
backdrop-filter: blur(var(--ds-blur-sm));
|
|
24
|
+
-webkit-backdrop-filter: blur(var(--ds-blur-sm));
|
|
25
|
+
opacity: 0;
|
|
26
|
+
visibility: hidden;
|
|
27
|
+
transition:
|
|
28
|
+
opacity var(--ds-duration-slow) var(--ds-ease-default),
|
|
29
|
+
visibility var(--ds-duration-slow) var(--ds-ease-default);
|
|
30
|
+
|
|
31
|
+
&[open],
|
|
32
|
+
&--open {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
visibility: visible;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__content {
|
|
38
|
+
width: 100%;
|
|
39
|
+
max-width: 28rem;
|
|
40
|
+
max-height: 90dvh;
|
|
41
|
+
background-color: var(--ds-color-surface);
|
|
42
|
+
border: 1px solid var(--ds-color-border);
|
|
43
|
+
border-radius: var(--ds-radius-xl);
|
|
44
|
+
box-shadow: var(--ds-shadow-lg);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
transform: scale(0.96);
|
|
49
|
+
transition: transform var(--ds-duration-slow) var(--ds-ease-out-expo);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[open] .ds-modal__content,
|
|
53
|
+
&--open .ds-modal__content {
|
|
54
|
+
transform: scale(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__header {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: flex-start;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
padding: var(--ds-space-4) var(--ds-space-5);
|
|
62
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
63
|
+
|
|
64
|
+
& h3 {
|
|
65
|
+
font-family: var(--ds-font-display);
|
|
66
|
+
font-weight: var(--ds-font-display-weight);
|
|
67
|
+
font-size: var(--ds-text-lg);
|
|
68
|
+
color: var(--ds-color-text);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
& p {
|
|
72
|
+
font-size: var(--ds-text-sm);
|
|
73
|
+
color: var(--ds-color-text-tertiary);
|
|
74
|
+
margin-block-start: var(--ds-space-1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__close {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
width: 2rem;
|
|
83
|
+
height: 2rem;
|
|
84
|
+
color: var(--ds-color-text-tertiary);
|
|
85
|
+
border-radius: var(--ds-radius-md);
|
|
86
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
|
|
89
|
+
&:hover {
|
|
90
|
+
color: var(--ds-color-text);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:focus-visible {
|
|
94
|
+
outline: none;
|
|
95
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
96
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__body {
|
|
101
|
+
padding: var(--ds-space-5);
|
|
102
|
+
overflow-y: auto;
|
|
103
|
+
flex: 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__footer {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: flex-end;
|
|
110
|
+
gap: var(--ds-space-2);
|
|
111
|
+
padding: var(--ds-space-4) var(--ds-space-5);
|
|
112
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Size variants */
|
|
116
|
+
&--md .ds-modal__content { max-width: var(--ds-container-md); }
|
|
117
|
+
&--lg .ds-modal__content { max-width: var(--ds-container-lg); }
|
|
118
|
+
|
|
119
|
+
/* Fullscreen on mobile */
|
|
120
|
+
@media (max-width: 1023px) /* below --ds-breakpoint-lg */ {
|
|
121
|
+
&--fullscreen-mobile .ds-modal__content {
|
|
122
|
+
max-width: none;
|
|
123
|
+
max-height: none;
|
|
124
|
+
width: 100%;
|
|
125
|
+
height: 100dvh;
|
|
126
|
+
margin: 0;
|
|
127
|
+
border-radius: 0;
|
|
128
|
+
border: none;
|
|
129
|
+
box-shadow: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--fullscreen-mobile {
|
|
133
|
+
padding: 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Navigation
|
|
3
|
+
Fixed glass header, backdrop-blur, h-16. Clean links.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Nav: <nav aria-label="Main navigation"> (or aria-label="Sidebar")
|
|
7
|
+
- Active link: aria-current="page" on the current page link
|
|
8
|
+
- Mobile menu: toggle aria-expanded on hamburger button
|
|
9
|
+
- Mobile menu button: aria-label="Open menu" / "Close menu"
|
|
10
|
+
- Skip nav: add ds-skip-link before nav to skip to main content
|
|
11
|
+
========================================================================== */
|
|
12
|
+
|
|
13
|
+
.ds-nav {
|
|
14
|
+
position: fixed;
|
|
15
|
+
inset-block-start: 0;
|
|
16
|
+
inset-inline-start: 0;
|
|
17
|
+
inset-inline-end: 0;
|
|
18
|
+
z-index: var(--ds-z-sticky);
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
height: 4rem;
|
|
23
|
+
background-color: color-mix(in srgb, var(--ds-color-surface) 80%, transparent);
|
|
24
|
+
border-block-end: 1px solid color-mix(in srgb, var(--ds-color-border) 60%, transparent);
|
|
25
|
+
backdrop-filter: blur(var(--ds-blur-lg)) saturate(1.5);
|
|
26
|
+
-webkit-backdrop-filter: blur(var(--ds-blur-lg)) saturate(1.5);
|
|
27
|
+
|
|
28
|
+
&--static {
|
|
29
|
+
position: relative;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__inner {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
width: 100%;
|
|
37
|
+
max-width: var(--ds-container-max);
|
|
38
|
+
margin-inline: auto;
|
|
39
|
+
padding-inline: var(--ds-container-padding);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__brand {
|
|
43
|
+
font-family: var(--ds-font-display);
|
|
44
|
+
font-weight: var(--ds-font-display-weight);
|
|
45
|
+
font-size: var(--ds-text-lg);
|
|
46
|
+
color: var(--ds-color-text);
|
|
47
|
+
letter-spacing: var(--ds-tracking-tight);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__menu {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--ds-space-8);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&__link {
|
|
57
|
+
font-size: var(--ds-text-sm);
|
|
58
|
+
color: var(--ds-color-text-secondary);
|
|
59
|
+
transition: color var(--ds-duration-normal) var(--ds-ease-default);
|
|
60
|
+
|
|
61
|
+
@media (hover: hover) {
|
|
62
|
+
&:hover {
|
|
63
|
+
color: var(--ds-color-text);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:focus-visible {
|
|
68
|
+
outline: none;
|
|
69
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
70
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&--active {
|
|
74
|
+
color: var(--ds-color-text);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Nav actions (theme toggle, etc) */
|
|
79
|
+
&__actions {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: var(--ds-space-2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Icon button in nav */
|
|
86
|
+
&__icon-btn {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
width: 2.25rem;
|
|
91
|
+
height: 2.25rem;
|
|
92
|
+
border-radius: var(--ds-radius-md);
|
|
93
|
+
color: var(--ds-color-text-secondary);
|
|
94
|
+
transition: all var(--ds-duration-normal) var(--ds-ease-default);
|
|
95
|
+
|
|
96
|
+
@media (hover: hover) {
|
|
97
|
+
&:hover {
|
|
98
|
+
color: var(--ds-color-text);
|
|
99
|
+
background-color: var(--ds-color-surface-hover);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:focus-visible {
|
|
104
|
+
outline: none;
|
|
105
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
106
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* --- Mobile nav overlay --- */
|
|
111
|
+
&__mobile {
|
|
112
|
+
overflow: hidden;
|
|
113
|
+
max-height: 0;
|
|
114
|
+
border-block-end: 0 solid color-mix(in srgb, var(--ds-color-border) 60%, transparent);
|
|
115
|
+
background-color: color-mix(in srgb, var(--ds-color-surface) 80%, transparent);
|
|
116
|
+
backdrop-filter: blur(var(--ds-blur-lg));
|
|
117
|
+
transition: all var(--ds-duration-slow) var(--ds-ease-out-expo);
|
|
118
|
+
|
|
119
|
+
&--open {
|
|
120
|
+
max-height: calc(100dvh - 4rem);
|
|
121
|
+
border-block-end-width: 1px;
|
|
122
|
+
overflow-y: auto;
|
|
123
|
+
overscroll-behavior: contain;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&__mobile-links {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: var(--ds-space-1);
|
|
131
|
+
padding: var(--ds-space-4) var(--ds-container-padding);
|
|
132
|
+
|
|
133
|
+
& .ds-nav__link {
|
|
134
|
+
font-size: var(--ds-text-lg);
|
|
135
|
+
padding: var(--ds-space-3) 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* --- Sidebar --- */
|
|
141
|
+
|
|
142
|
+
.ds-sidebar {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
width: 16rem;
|
|
146
|
+
padding: var(--ds-space-5);
|
|
147
|
+
background-color: var(--ds-color-surface);
|
|
148
|
+
border-inline-end: 1px solid var(--ds-color-border);
|
|
149
|
+
height: 100%;
|
|
150
|
+
|
|
151
|
+
&__section {
|
|
152
|
+
margin-block-end: var(--ds-space-6);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&__title {
|
|
156
|
+
font-size: var(--ds-text-sm);
|
|
157
|
+
font-weight: var(--ds-weight-medium);
|
|
158
|
+
text-transform: uppercase;
|
|
159
|
+
letter-spacing: var(--ds-tracking-wide);
|
|
160
|
+
color: var(--ds-color-text-tertiary);
|
|
161
|
+
margin-block-end: var(--ds-space-3);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&__link {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: var(--ds-space-2);
|
|
168
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
169
|
+
width: 100%;
|
|
170
|
+
font-size: var(--ds-text-sm);
|
|
171
|
+
color: var(--ds-color-text-secondary);
|
|
172
|
+
border-radius: var(--ds-radius-md);
|
|
173
|
+
transition: all var(--ds-duration-normal) var(--ds-ease-default);
|
|
174
|
+
|
|
175
|
+
& + & {
|
|
176
|
+
margin-block-start: var(--ds-space-1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@media (hover: hover) {
|
|
180
|
+
&:hover {
|
|
181
|
+
color: var(--ds-color-text);
|
|
182
|
+
background-color: var(--ds-color-surface-hover);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&:focus-visible {
|
|
187
|
+
outline: none;
|
|
188
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
189
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&--active,
|
|
193
|
+
&--active:hover {
|
|
194
|
+
color: var(--ds-color-text);
|
|
195
|
+
background-color: var(--ds-color-surface-elevated);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Number Input
|
|
3
|
+
Numeric input with increment/decrement stepper buttons.
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Input: type="number", aria-label or aria-labelledby
|
|
7
|
+
- Buttons: aria-label="Increase" / aria-label="Decrease"
|
|
8
|
+
- Disabled: aria-disabled="true" on buttons when at min/max
|
|
9
|
+
- Keyboard: ArrowUp/Down to increment/decrement
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
<div class="ds-number-input">
|
|
13
|
+
<button class="ds-number-input__decrement" aria-label="Decrease">−</button>
|
|
14
|
+
<input class="ds-number-input__field" type="number" value="1" />
|
|
15
|
+
<button class="ds-number-input__increment" aria-label="Increase">+</button>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
Modifiers:
|
|
19
|
+
.ds-number-input--xs/--sm/--lg — Size variants
|
|
20
|
+
========================================================================== */
|
|
21
|
+
|
|
22
|
+
.ds-number-input {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
border: 1px solid var(--ds-color-border);
|
|
26
|
+
border-radius: var(--ds-radius-lg);
|
|
27
|
+
background-color: var(--ds-color-surface);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
transition:
|
|
30
|
+
border-color var(--ds-duration-fast) var(--ds-ease-default),
|
|
31
|
+
box-shadow var(--ds-duration-fast) var(--ds-ease-default);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ds-number-input:focus-within {
|
|
35
|
+
border-color: var(--ds-color-border-active);
|
|
36
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* --- Field --- */
|
|
40
|
+
.ds-number-input__field {
|
|
41
|
+
width: 3.5rem;
|
|
42
|
+
height: var(--ds-size-3);
|
|
43
|
+
padding: 0;
|
|
44
|
+
border: none;
|
|
45
|
+
outline: none;
|
|
46
|
+
background: transparent;
|
|
47
|
+
color: var(--ds-color-text);
|
|
48
|
+
font-family: var(--ds-font-sans);
|
|
49
|
+
font-size: var(--ds-text-base);
|
|
50
|
+
font-variant-numeric: tabular-nums;
|
|
51
|
+
text-align: center;
|
|
52
|
+
-moz-appearance: textfield;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ds-number-input__field::-webkit-inner-spin-button,
|
|
56
|
+
.ds-number-input__field::-webkit-outer-spin-button {
|
|
57
|
+
-webkit-appearance: none;
|
|
58
|
+
margin: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* --- Stepper buttons --- */
|
|
62
|
+
.ds-number-input__decrement,
|
|
63
|
+
.ds-number-input__increment {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
width: var(--ds-size-3);
|
|
68
|
+
height: var(--ds-size-3);
|
|
69
|
+
padding: 0;
|
|
70
|
+
border: none;
|
|
71
|
+
background: transparent;
|
|
72
|
+
color: var(--ds-color-text-secondary);
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
flex-shrink: 0;
|
|
75
|
+
font-size: var(--ds-text-lg);
|
|
76
|
+
font-family: var(--ds-font-sans);
|
|
77
|
+
transition:
|
|
78
|
+
color var(--ds-duration-fast) var(--ds-ease-default),
|
|
79
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-number-input__decrement {
|
|
83
|
+
border-inline-end: 1px solid var(--ds-color-border-subtle);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ds-number-input__increment {
|
|
87
|
+
border-inline-start: 1px solid var(--ds-color-border-subtle);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-number-input__decrement:hover,
|
|
91
|
+
.ds-number-input__increment:hover {
|
|
92
|
+
background-color: var(--ds-color-surface-hover);
|
|
93
|
+
color: var(--ds-color-text);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ds-number-input__decrement:focus-visible,
|
|
97
|
+
.ds-number-input__increment:focus-visible {
|
|
98
|
+
outline: none;
|
|
99
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ds-number-input__decrement:disabled,
|
|
103
|
+
.ds-number-input__increment:disabled,
|
|
104
|
+
.ds-number-input__decrement[aria-disabled="true"],
|
|
105
|
+
.ds-number-input__increment[aria-disabled="true"] {
|
|
106
|
+
opacity: var(--ds-opacity-disabled);
|
|
107
|
+
cursor: not-allowed;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ==========================================================================
|
|
112
|
+
Size variants
|
|
113
|
+
========================================================================== */
|
|
114
|
+
|
|
115
|
+
/* XS */
|
|
116
|
+
.ds-number-input--xs .ds-number-input__field {
|
|
117
|
+
height: var(--ds-size-1);
|
|
118
|
+
width: 2.5rem;
|
|
119
|
+
font-size: var(--ds-text-xs);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ds-number-input--xs .ds-number-input__decrement,
|
|
123
|
+
.ds-number-input--xs .ds-number-input__increment {
|
|
124
|
+
width: var(--ds-size-1);
|
|
125
|
+
height: var(--ds-size-1);
|
|
126
|
+
font-size: var(--ds-text-sm);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ds-number-input--xs {
|
|
130
|
+
border-radius: var(--ds-radius-md);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* SM */
|
|
134
|
+
.ds-number-input--sm .ds-number-input__field {
|
|
135
|
+
height: var(--ds-size-2);
|
|
136
|
+
width: 3rem;
|
|
137
|
+
font-size: var(--ds-text-sm);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ds-number-input--sm .ds-number-input__decrement,
|
|
141
|
+
.ds-number-input--sm .ds-number-input__increment {
|
|
142
|
+
width: var(--ds-size-2);
|
|
143
|
+
height: var(--ds-size-2);
|
|
144
|
+
font-size: var(--ds-text-base);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-number-input--sm {
|
|
148
|
+
border-radius: var(--ds-radius-md);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* LG */
|
|
152
|
+
.ds-number-input--lg .ds-number-input__field {
|
|
153
|
+
height: var(--ds-size-4);
|
|
154
|
+
width: 4rem;
|
|
155
|
+
font-size: var(--ds-text-lg);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ds-number-input--lg .ds-number-input__decrement,
|
|
159
|
+
.ds-number-input--lg .ds-number-input__increment {
|
|
160
|
+
width: var(--ds-size-4);
|
|
161
|
+
height: var(--ds-size-4);
|
|
162
|
+
font-size: var(--ds-text-xl);
|
|
163
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Pagination Component
|
|
3
|
+
==========================================================================
|
|
4
|
+
A row of page-number controls for navigating multi-page content.
|
|
5
|
+
|
|
6
|
+
ARIA requirements (consumer responsibility):
|
|
7
|
+
- Container: <nav aria-label="Pagination">
|
|
8
|
+
- Active page: aria-current="page"
|
|
9
|
+
- Prev/Next: aria-label="Previous page" / "Next page"
|
|
10
|
+
- Disabled: aria-disabled="true" on disabled prev/next buttons
|
|
11
|
+
- Page items: aria-label="Page [N]" (optional, number is visible)
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
<nav class="ds-pagination" aria-label="Pagination">
|
|
15
|
+
<button class="ds-pagination__prev" aria-label="Previous page">‹</button>
|
|
16
|
+
<button class="ds-pagination__item">1</button>
|
|
17
|
+
<button class="ds-pagination__item ds-pagination__item--active" aria-current="page">2</button>
|
|
18
|
+
<span class="ds-pagination__ellipsis">…</span>
|
|
19
|
+
<button class="ds-pagination__item">10</button>
|
|
20
|
+
<button class="ds-pagination__next" aria-label="Next page">›</button>
|
|
21
|
+
</nav>
|
|
22
|
+
========================================================================== */
|
|
23
|
+
|
|
24
|
+
/* ---------------------------------------------------------------------------
|
|
25
|
+
Container
|
|
26
|
+
--------------------------------------------------------------------------- */
|
|
27
|
+
|
|
28
|
+
.ds-pagination {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--ds-space-1);
|
|
33
|
+
font-family: var(--ds-font-sans);
|
|
34
|
+
|
|
35
|
+
/* ---------------------------------------------------------------------------
|
|
36
|
+
Item (page number)
|
|
37
|
+
--------------------------------------------------------------------------- */
|
|
38
|
+
|
|
39
|
+
&__item {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
min-width: 2rem;
|
|
44
|
+
height: 2rem;
|
|
45
|
+
padding: 0 var(--ds-space-1);
|
|
46
|
+
border: none;
|
|
47
|
+
border-radius: var(--ds-radius-md);
|
|
48
|
+
background: transparent;
|
|
49
|
+
color: var(--ds-color-text-secondary);
|
|
50
|
+
font-size: var(--ds-text-sm);
|
|
51
|
+
font-family: var(--ds-font-sans);
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition:
|
|
54
|
+
background-color var(--ds-duration-fast) var(--ds-ease-out),
|
|
55
|
+
color var(--ds-duration-fast) var(--ds-ease-out);
|
|
56
|
+
-webkit-appearance: none;
|
|
57
|
+
appearance: none;
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: var(--ds-color-surface-hover);
|
|
61
|
+
color: var(--ds-color-text);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus-visible {
|
|
65
|
+
outline: none;
|
|
66
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
67
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ---------------------------------------------------------------------------
|
|
71
|
+
Active page
|
|
72
|
+
--------------------------------------------------------------------------- */
|
|
73
|
+
|
|
74
|
+
&--active,
|
|
75
|
+
&--active:hover {
|
|
76
|
+
background-color: var(--ds-color-inverted);
|
|
77
|
+
color: var(--ds-color-on-inverted);
|
|
78
|
+
cursor: default;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ---------------------------------------------------------------------------
|
|
82
|
+
Disabled item
|
|
83
|
+
--------------------------------------------------------------------------- */
|
|
84
|
+
|
|
85
|
+
&--disabled,
|
|
86
|
+
&--disabled:hover {
|
|
87
|
+
opacity: var(--ds-opacity-disabled);
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ---------------------------------------------------------------------------
|
|
93
|
+
Previous / Next navigation buttons
|
|
94
|
+
--------------------------------------------------------------------------- */
|
|
95
|
+
|
|
96
|
+
&__prev,
|
|
97
|
+
&__next {
|
|
98
|
+
display: flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
min-width: 2rem;
|
|
102
|
+
height: 2rem;
|
|
103
|
+
padding: 0;
|
|
104
|
+
border: none;
|
|
105
|
+
border-radius: var(--ds-radius-md);
|
|
106
|
+
background: transparent;
|
|
107
|
+
color: var(--ds-color-text-secondary);
|
|
108
|
+
font-size: var(--ds-text-sm);
|
|
109
|
+
font-family: var(--ds-font-sans);
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
transition:
|
|
112
|
+
background-color var(--ds-duration-fast) var(--ds-ease-out),
|
|
113
|
+
color var(--ds-duration-fast) var(--ds-ease-out);
|
|
114
|
+
-webkit-appearance: none;
|
|
115
|
+
appearance: none;
|
|
116
|
+
|
|
117
|
+
&:hover {
|
|
118
|
+
background-color: var(--ds-color-surface-hover);
|
|
119
|
+
color: var(--ds-color-text);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:focus-visible {
|
|
123
|
+
outline: none;
|
|
124
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
125
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:disabled {
|
|
129
|
+
opacity: var(--ds-opacity-disabled);
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* ---------------------------------------------------------------------------
|
|
135
|
+
Ellipsis
|
|
136
|
+
--------------------------------------------------------------------------- */
|
|
137
|
+
|
|
138
|
+
&__ellipsis {
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
min-width: 2rem;
|
|
143
|
+
height: 2rem;
|
|
144
|
+
color: var(--ds-color-text-tertiary);
|
|
145
|
+
font-size: var(--ds-text-sm);
|
|
146
|
+
user-select: none;
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* ---------------------------------------------------------------------------
|
|
151
|
+
Page info text (e.g. "Page 1 of 10")
|
|
152
|
+
--------------------------------------------------------------------------- */
|
|
153
|
+
|
|
154
|
+
&__info {
|
|
155
|
+
font-size: var(--ds-text-sm);
|
|
156
|
+
color: var(--ds-color-text-tertiary);
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* ---------------------------------------------------------------------------
|
|
161
|
+
Modifier: Compact
|
|
162
|
+
--------------------------------------------------------------------------- */
|
|
163
|
+
|
|
164
|
+
&--compact {
|
|
165
|
+
& .ds-pagination__item,
|
|
166
|
+
& .ds-pagination__prev,
|
|
167
|
+
& .ds-pagination__next,
|
|
168
|
+
& .ds-pagination__ellipsis {
|
|
169
|
+
min-width: 1.75rem;
|
|
170
|
+
height: 1.75rem;
|
|
171
|
+
font-size: var(--ds-text-xs);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|