@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,162 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Context Menu
|
|
3
|
+
Cursor-anchored floating menu for right-click contextual actions.
|
|
4
|
+
|
|
5
|
+
Unlike `ds-dropdown` (which is trigger-anchored), this component is
|
|
6
|
+
positioned at arbitrary viewport coordinates. The consumer sets `top`
|
|
7
|
+
and `left` at runtime (typically via a React wrapper like ds-react's
|
|
8
|
+
`<ContextMenu>` that handles portal, positioning, and dismissal).
|
|
9
|
+
|
|
10
|
+
ARIA requirements (consumer responsibility):
|
|
11
|
+
- Menu: role="menu"
|
|
12
|
+
- Items: role="menuitem"
|
|
13
|
+
- Keyboard: ArrowUp/Down to navigate, Enter/Space to activate,
|
|
14
|
+
Escape to close, Tab exits focus
|
|
15
|
+
- On open: move focus to the menu (or first enabled item)
|
|
16
|
+
- On close: return focus to the element that triggered the contextmenu
|
|
17
|
+
========================================================================== */
|
|
18
|
+
|
|
19
|
+
.ds-context-menu {
|
|
20
|
+
position: fixed;
|
|
21
|
+
inset-block-start: 0;
|
|
22
|
+
inset-inline-start: 0;
|
|
23
|
+
z-index: var(--ds-z-dropdown);
|
|
24
|
+
min-width: 11rem;
|
|
25
|
+
max-inline-size: min(20rem, calc(100vw - var(--ds-space-4)));
|
|
26
|
+
max-block-size: calc(100vh - var(--ds-space-4));
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
padding-block: var(--ds-space-1-5);
|
|
31
|
+
background-color: var(--ds-color-surface-muted);
|
|
32
|
+
border: 1px solid var(--ds-color-border);
|
|
33
|
+
border-radius: var(--ds-radius-xl);
|
|
34
|
+
box-shadow: var(--ds-shadow-lg);
|
|
35
|
+
transform-origin: top left;
|
|
36
|
+
animation: ds-context-menu-in var(--ds-duration-fast) var(--ds-ease-out-expo);
|
|
37
|
+
|
|
38
|
+
/* --- Flip placement (when near viewport edges) ---
|
|
39
|
+
The wrapper applies these when the menu would overflow right/bottom.
|
|
40
|
+
They shift the menu so the cursor aligns with the opposite corner. */
|
|
41
|
+
|
|
42
|
+
&--flip-x {
|
|
43
|
+
transform-origin: top right;
|
|
44
|
+
translate: -100% 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--flip-y {
|
|
48
|
+
transform-origin: bottom left;
|
|
49
|
+
translate: 0 -100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&--flip-x&--flip-y {
|
|
53
|
+
transform-origin: bottom right;
|
|
54
|
+
translate: -100% -100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* --- Item --- */
|
|
58
|
+
|
|
59
|
+
&__item {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--ds-space-2);
|
|
64
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
65
|
+
margin-inline: var(--ds-space-1);
|
|
66
|
+
font-size: var(--ds-text-sm);
|
|
67
|
+
color: var(--ds-color-text-secondary);
|
|
68
|
+
background: transparent;
|
|
69
|
+
border: 0;
|
|
70
|
+
text-align: start;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
border-radius: var(--ds-radius-md);
|
|
73
|
+
transition:
|
|
74
|
+
color var(--ds-duration-fast) var(--ds-ease-default),
|
|
75
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
background-color: var(--ds-color-surface-muted-hover);
|
|
79
|
+
color: var(--ds-color-text);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:focus-visible {
|
|
83
|
+
outline: none;
|
|
84
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
85
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Keyboard-selected item — visual parity with :hover but driven by JS
|
|
89
|
+
setting aria-selected / a modifier class so the highlight persists
|
|
90
|
+
while the pointer is elsewhere. */
|
|
91
|
+
&--active,
|
|
92
|
+
&--active:hover {
|
|
93
|
+
background-color: var(--ds-color-surface-elevated);
|
|
94
|
+
color: var(--ds-color-text);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--danger:hover,
|
|
98
|
+
&--danger:focus-visible {
|
|
99
|
+
color: var(--ds-color-error);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--disabled {
|
|
103
|
+
opacity: var(--ds-opacity-disabled);
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* --- Item slots --- */
|
|
109
|
+
|
|
110
|
+
&__item-icon {
|
|
111
|
+
width: 1rem;
|
|
112
|
+
height: 1rem;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&__item-label {
|
|
117
|
+
flex: 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__item-shortcut {
|
|
121
|
+
margin-inline-start: auto;
|
|
122
|
+
font-size: var(--ds-text-xs);
|
|
123
|
+
color: var(--ds-color-text-tertiary);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* --- Divider --- */
|
|
127
|
+
|
|
128
|
+
&__divider {
|
|
129
|
+
margin-block: var(--ds-space-1);
|
|
130
|
+
border: 0;
|
|
131
|
+
border-block-start: 1px solid var(--ds-color-border);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* --- Section label (uppercase heading above a group of items) --- */
|
|
135
|
+
|
|
136
|
+
&__label {
|
|
137
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
138
|
+
margin-inline: var(--ds-space-1);
|
|
139
|
+
font-size: var(--ds-text-xs);
|
|
140
|
+
font-weight: var(--ds-weight-medium);
|
|
141
|
+
text-transform: uppercase;
|
|
142
|
+
letter-spacing: var(--ds-tracking-wide);
|
|
143
|
+
color: var(--ds-color-text-tertiary);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@keyframes ds-context-menu-in {
|
|
148
|
+
from {
|
|
149
|
+
opacity: 0;
|
|
150
|
+
transform: scale(0.96);
|
|
151
|
+
}
|
|
152
|
+
to {
|
|
153
|
+
opacity: 1;
|
|
154
|
+
transform: scale(1);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@media (prefers-reduced-motion: reduce) {
|
|
159
|
+
.ds-context-menu {
|
|
160
|
+
animation: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Copy Button
|
|
3
|
+
Icon button with clipboard feedback state (idle → copied).
|
|
4
|
+
|
|
5
|
+
ARIA requirements (consumer responsibility):
|
|
6
|
+
- Button: aria-label="Copy [description]"
|
|
7
|
+
- After copy: update aria-label to "Copied" temporarily
|
|
8
|
+
- Use role="status" or aria-live="polite" for screen reader feedback
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
<button class="ds-copy-btn" aria-label="Copy address">
|
|
12
|
+
<svg class="ds-copy-btn__icon">...</svg> <!-- copy icon -->
|
|
13
|
+
<svg class="ds-copy-btn__icon-check">...</svg> <!-- check icon -->
|
|
14
|
+
</button>
|
|
15
|
+
|
|
16
|
+
<!-- Active state (after copy): -->
|
|
17
|
+
<button class="ds-copy-btn ds-copy-btn--copied" aria-label="Copied">...</button>
|
|
18
|
+
|
|
19
|
+
Modifiers:
|
|
20
|
+
.ds-copy-btn--copied — Show check icon, hide copy icon
|
|
21
|
+
.ds-copy-btn--sm — Smaller (24px)
|
|
22
|
+
.ds-copy-btn--lg — Larger (40px)
|
|
23
|
+
========================================================================== */
|
|
24
|
+
|
|
25
|
+
.ds-copy-btn {
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
position: relative;
|
|
30
|
+
width: var(--ds-size-2);
|
|
31
|
+
height: var(--ds-size-2);
|
|
32
|
+
padding: var(--ds-space-1-5);
|
|
33
|
+
border: none;
|
|
34
|
+
border-radius: var(--ds-radius-md);
|
|
35
|
+
background: transparent;
|
|
36
|
+
color: var(--ds-color-text-tertiary);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
transition:
|
|
40
|
+
color var(--ds-duration-fast) var(--ds-ease-default),
|
|
41
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
42
|
+
|
|
43
|
+
&:hover {
|
|
44
|
+
background-color: var(--ds-color-surface-hover);
|
|
45
|
+
color: var(--ds-color-text-secondary);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
outline: none;
|
|
50
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
51
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* --- Icons --- */
|
|
55
|
+
&__icon,
|
|
56
|
+
&__icon-check {
|
|
57
|
+
width: 1rem;
|
|
58
|
+
height: 1rem;
|
|
59
|
+
transition: opacity var(--ds-duration-fast) var(--ds-ease-default);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__icon-check {
|
|
63
|
+
position: absolute;
|
|
64
|
+
opacity: 0;
|
|
65
|
+
color: var(--ds-color-success);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* --- Copied state --- */
|
|
69
|
+
&--copied {
|
|
70
|
+
color: var(--ds-color-success);
|
|
71
|
+
|
|
72
|
+
& .ds-copy-btn__icon {
|
|
73
|
+
opacity: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
& .ds-copy-btn__icon-check {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* --- Sizes --- */
|
|
82
|
+
&--sm {
|
|
83
|
+
width: var(--ds-size-1);
|
|
84
|
+
height: var(--ds-size-1);
|
|
85
|
+
padding: var(--ds-space-0-5);
|
|
86
|
+
border-radius: var(--ds-radius-sm);
|
|
87
|
+
|
|
88
|
+
& .ds-copy-btn__icon,
|
|
89
|
+
& .ds-copy-btn__icon-check {
|
|
90
|
+
width: 0.75rem;
|
|
91
|
+
height: 0.75rem;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&--lg {
|
|
96
|
+
width: var(--ds-size-3);
|
|
97
|
+
height: var(--ds-size-3);
|
|
98
|
+
padding: var(--ds-space-2);
|
|
99
|
+
|
|
100
|
+
& .ds-copy-btn__icon,
|
|
101
|
+
& .ds-copy-btn__icon-check {
|
|
102
|
+
width: 1.25rem;
|
|
103
|
+
height: 1.25rem;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
Component: Custom Select
|
|
3
|
+
Replaces native <select> with styled dropdown panel.
|
|
4
|
+
Desktop: absolute positioned panel below trigger.
|
|
5
|
+
Mobile: fullscreen overlay with header + search.
|
|
6
|
+
|
|
7
|
+
ARIA requirements (consumer responsibility):
|
|
8
|
+
- Trigger: role="combobox", aria-expanded="true|false", aria-haspopup="listbox"
|
|
9
|
+
- Trigger: aria-controls="[panel-list-id]", aria-labelledby="[label-id]"
|
|
10
|
+
- Panel list: role="listbox", id matching aria-controls
|
|
11
|
+
- Option: role="option", aria-selected="true|false"
|
|
12
|
+
- Multi-select: add aria-multiselectable="true" on listbox
|
|
13
|
+
- Keyboard: ArrowUp/Down to navigate, Enter/Space to select, Escape to close
|
|
14
|
+
========================================================================== */
|
|
15
|
+
|
|
16
|
+
/* --- Wrapper --- */
|
|
17
|
+
|
|
18
|
+
.ds-custom-select {
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* --- Trigger --- */
|
|
24
|
+
|
|
25
|
+
.ds-custom-select__trigger {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: var(--ds-size-3);
|
|
31
|
+
padding: 0 var(--ds-space-4);
|
|
32
|
+
font-family: var(--ds-font-sans);
|
|
33
|
+
font-size: var(--ds-text-base);
|
|
34
|
+
line-height: var(--ds-leading-normal);
|
|
35
|
+
color: var(--ds-color-text);
|
|
36
|
+
background-color: var(--ds-color-surface);
|
|
37
|
+
border: 1px solid var(--ds-color-border);
|
|
38
|
+
border-radius: var(--ds-radius-lg);
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
text-align: start;
|
|
41
|
+
transition: all var(--ds-duration-fast) var(--ds-ease-default);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ds-custom-select__trigger:hover {
|
|
45
|
+
border-color: var(--ds-color-border-hover);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.ds-custom-select__trigger:focus-visible {
|
|
49
|
+
border-color: var(--ds-color-border-active);
|
|
50
|
+
outline: none;
|
|
51
|
+
box-shadow: 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
52
|
+
scroll-margin-block: var(--ds-space-16, 4rem);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ds-custom-select__trigger--open {
|
|
56
|
+
border-color: var(--ds-color-border-active);
|
|
57
|
+
box-shadow: inset 0 0 0 1px var(--ds-color-border-active);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ds-custom-select__trigger--disabled {
|
|
61
|
+
opacity: var(--ds-opacity-disabled);
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ds-custom-select__trigger-label {
|
|
66
|
+
flex: 1;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ds-custom-select__placeholder {
|
|
74
|
+
color: var(--ds-color-text-tertiary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Chevron icon */
|
|
78
|
+
.ds-custom-select__chevron {
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
width: 1rem;
|
|
81
|
+
height: 1rem;
|
|
82
|
+
margin-inline-start: var(--ds-space-2);
|
|
83
|
+
color: var(--ds-color-text-tertiary);
|
|
84
|
+
transition: transform var(--ds-duration-fast) var(--ds-ease-default);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ds-custom-select__trigger--open .ds-custom-select__chevron {
|
|
88
|
+
transform: rotate(180deg);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* --- Trigger sizes --- */
|
|
92
|
+
|
|
93
|
+
.ds-custom-select--xs .ds-custom-select__trigger {
|
|
94
|
+
height: var(--ds-size-1);
|
|
95
|
+
padding: 0 var(--ds-space-1-5);
|
|
96
|
+
font-size: var(--ds-text-xs);
|
|
97
|
+
border-radius: var(--ds-radius-sm);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ds-custom-select--sm .ds-custom-select__trigger {
|
|
101
|
+
height: var(--ds-size-2);
|
|
102
|
+
padding: 0 var(--ds-space-2);
|
|
103
|
+
font-size: var(--ds-text-sm);
|
|
104
|
+
border-radius: var(--ds-radius-md);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ds-custom-select--lg .ds-custom-select__trigger {
|
|
108
|
+
height: var(--ds-size-4);
|
|
109
|
+
padding: 0 var(--ds-space-4);
|
|
110
|
+
font-size: var(--ds-text-base);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* --- Backdrop (mobile only) --- */
|
|
114
|
+
|
|
115
|
+
.ds-custom-select__backdrop {
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* --- Panel --- */
|
|
120
|
+
|
|
121
|
+
/* Desktop: position:fixed set via JS to escape overflow:hidden parents.
|
|
122
|
+
Fallback absolute positioning when JS hasn't applied styles yet. */
|
|
123
|
+
.ds-custom-select__panel {
|
|
124
|
+
position: fixed;
|
|
125
|
+
z-index: var(--ds-z-dropdown);
|
|
126
|
+
background-color: var(--ds-color-surface-muted);
|
|
127
|
+
border: 1px solid var(--ds-color-border);
|
|
128
|
+
border-radius: var(--ds-radius-xl);
|
|
129
|
+
box-shadow: var(--ds-shadow-lg);
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
opacity: 0;
|
|
134
|
+
transform: scale(0.96);
|
|
135
|
+
transform-origin: top center;
|
|
136
|
+
animation: ds-custom-select-in var(--ds-duration-normal) var(--ds-ease-out-expo) forwards;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@keyframes ds-custom-select-in {
|
|
140
|
+
to {
|
|
141
|
+
opacity: 1;
|
|
142
|
+
transform: scale(1);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* --- Header (mobile only — hidden on desktop) --- */
|
|
147
|
+
|
|
148
|
+
.ds-custom-select__header {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* --- Search --- */
|
|
153
|
+
|
|
154
|
+
.ds-custom-select__search {
|
|
155
|
+
position: relative;
|
|
156
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
157
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ds-custom-select__search-icon {
|
|
161
|
+
position: absolute;
|
|
162
|
+
inset-inline-start: calc(var(--ds-space-3) + var(--ds-space-2-5));
|
|
163
|
+
inset-block-start: 50%;
|
|
164
|
+
transform: translateY(-50%);
|
|
165
|
+
width: 1rem;
|
|
166
|
+
height: 1rem;
|
|
167
|
+
color: var(--ds-color-text-tertiary);
|
|
168
|
+
pointer-events: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ds-custom-select__search input {
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: var(--ds-size-2);
|
|
174
|
+
padding: 0 var(--ds-space-2) 0 calc(1rem + var(--ds-space-3) + var(--ds-space-2));
|
|
175
|
+
font-family: var(--ds-font-sans);
|
|
176
|
+
font-size: var(--ds-text-sm);
|
|
177
|
+
color: var(--ds-color-text);
|
|
178
|
+
background-color: transparent;
|
|
179
|
+
border: none;
|
|
180
|
+
outline: none;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ds-custom-select__search input::placeholder {
|
|
184
|
+
color: var(--ds-color-text-tertiary);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* --- Options list --- */
|
|
188
|
+
|
|
189
|
+
.ds-custom-select__list {
|
|
190
|
+
max-height: 15rem;
|
|
191
|
+
overflow-y: auto;
|
|
192
|
+
padding-block: var(--ds-space-1);
|
|
193
|
+
overscroll-behavior: contain;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* --- Option --- */
|
|
197
|
+
|
|
198
|
+
.ds-custom-select__option {
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: space-between;
|
|
202
|
+
gap: var(--ds-space-2);
|
|
203
|
+
padding: var(--ds-space-2) var(--ds-space-3);
|
|
204
|
+
margin-inline: var(--ds-space-1);
|
|
205
|
+
font-size: var(--ds-text-sm);
|
|
206
|
+
color: var(--ds-color-text-secondary);
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
border-radius: var(--ds-radius-md);
|
|
209
|
+
transition:
|
|
210
|
+
color var(--ds-duration-fast) var(--ds-ease-default),
|
|
211
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ds-custom-select__option:hover {
|
|
215
|
+
background-color: var(--ds-color-surface-hover);
|
|
216
|
+
color: var(--ds-color-text);
|
|
217
|
+
}
|
|
218
|
+
.ds-custom-select__option:focus-visible {
|
|
219
|
+
outline: none;
|
|
220
|
+
box-shadow: inset 0 0 0 var(--ds-ring-width) var(--ds-ring-color);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.ds-custom-select__option--selected,
|
|
224
|
+
.ds-custom-select__option--selected:hover {
|
|
225
|
+
background-color: var(--ds-color-surface-elevated);
|
|
226
|
+
color: var(--ds-color-text);
|
|
227
|
+
font-weight: var(--ds-weight-medium);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.ds-custom-select__option-check {
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
width: 1rem;
|
|
233
|
+
height: 1rem;
|
|
234
|
+
color: var(--ds-color-interactive);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* --- Empty state --- */
|
|
238
|
+
|
|
239
|
+
.ds-custom-select__empty {
|
|
240
|
+
padding: var(--ds-space-6) var(--ds-space-4);
|
|
241
|
+
text-align: center;
|
|
242
|
+
font-size: var(--ds-text-sm);
|
|
243
|
+
color: var(--ds-color-text-tertiary);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* ==========================================================================
|
|
247
|
+
Mobile: fullscreen panel
|
|
248
|
+
========================================================================== */
|
|
249
|
+
|
|
250
|
+
@media (max-width: 767px) {
|
|
251
|
+
.ds-custom-select__backdrop {
|
|
252
|
+
display: block;
|
|
253
|
+
position: fixed;
|
|
254
|
+
inset: 0;
|
|
255
|
+
z-index: var(--ds-z-overlay);
|
|
256
|
+
background-color: var(--ds-color-overlay);
|
|
257
|
+
animation: ds-custom-select-backdrop-in var(--ds-duration-normal) var(--ds-ease-default) forwards;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
@keyframes ds-custom-select-backdrop-in {
|
|
261
|
+
from { opacity: 0; }
|
|
262
|
+
to { opacity: 1; }
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.ds-custom-select__panel {
|
|
266
|
+
position: fixed;
|
|
267
|
+
inset: 0;
|
|
268
|
+
inset-block-start: auto;
|
|
269
|
+
z-index: var(--ds-z-modal);
|
|
270
|
+
max-height: 85dvh;
|
|
271
|
+
border-radius: var(--ds-radius-xl) var(--ds-radius-xl) 0 0;
|
|
272
|
+
box-shadow: var(--ds-shadow-lg);
|
|
273
|
+
transform: none;
|
|
274
|
+
opacity: 1;
|
|
275
|
+
animation: ds-custom-select-slide-up var(--ds-duration-normal) var(--ds-ease-out-expo) forwards;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
@keyframes ds-custom-select-slide-up {
|
|
279
|
+
from {
|
|
280
|
+
transform: translateY(100%);
|
|
281
|
+
}
|
|
282
|
+
to {
|
|
283
|
+
transform: translateY(0);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.ds-custom-select__header {
|
|
288
|
+
display: flex;
|
|
289
|
+
align-items: center;
|
|
290
|
+
justify-content: space-between;
|
|
291
|
+
padding: var(--ds-space-4) var(--ds-space-4);
|
|
292
|
+
border-block-end: 1px solid var(--ds-color-border);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ds-custom-select__header-title {
|
|
296
|
+
font-family: var(--ds-font-display);
|
|
297
|
+
font-weight: var(--ds-font-display-weight);
|
|
298
|
+
font-size: var(--ds-text-base);
|
|
299
|
+
color: var(--ds-color-text);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.ds-custom-select__header-close {
|
|
303
|
+
display: flex;
|
|
304
|
+
align-items: center;
|
|
305
|
+
justify-content: center;
|
|
306
|
+
width: 2rem;
|
|
307
|
+
height: 2rem;
|
|
308
|
+
color: var(--ds-color-text-tertiary);
|
|
309
|
+
border-radius: var(--ds-radius-md);
|
|
310
|
+
cursor: pointer;
|
|
311
|
+
transition: color var(--ds-duration-fast) var(--ds-ease-default);
|
|
312
|
+
}
|
|
313
|
+
.ds-custom-select__header-close:hover {
|
|
314
|
+
color: var(--ds-color-text);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ds-custom-select__list {
|
|
318
|
+
max-height: none;
|
|
319
|
+
flex: 1;
|
|
320
|
+
overflow-y: auto;
|
|
321
|
+
padding-block: var(--ds-space-2);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.ds-custom-select__option {
|
|
325
|
+
padding: var(--ds-space-3) var(--ds-space-4);
|
|
326
|
+
margin-inline: 0;
|
|
327
|
+
font-size: var(--ds-text-base);
|
|
328
|
+
border-radius: 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* ==========================================================================
|
|
333
|
+
Multi-select mode
|
|
334
|
+
========================================================================== */
|
|
335
|
+
|
|
336
|
+
/* --- Multi trigger: tags inside trigger --- */
|
|
337
|
+
|
|
338
|
+
.ds-custom-select--multi .ds-custom-select__trigger {
|
|
339
|
+
height: auto;
|
|
340
|
+
min-height: var(--ds-size-3);
|
|
341
|
+
flex-wrap: wrap;
|
|
342
|
+
padding: var(--ds-space-1) var(--ds-space-4) var(--ds-space-1) var(--ds-space-2);
|
|
343
|
+
gap: var(--ds-space-1);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* --- Tags container --- */
|
|
347
|
+
|
|
348
|
+
.ds-custom-select__tags {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-wrap: wrap;
|
|
351
|
+
gap: var(--ds-space-1);
|
|
352
|
+
flex: 1;
|
|
353
|
+
min-width: 0;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* --- Single tag (based on ds-tag styling) --- */
|
|
357
|
+
|
|
358
|
+
.ds-custom-select__tag {
|
|
359
|
+
display: inline-flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
gap: var(--ds-space-1);
|
|
362
|
+
padding: var(--ds-space-0-5) var(--ds-space-1) var(--ds-space-0-5) var(--ds-space-2);
|
|
363
|
+
font-size: var(--ds-text-xs);
|
|
364
|
+
font-weight: var(--ds-weight-medium);
|
|
365
|
+
font-family: var(--ds-font-sans);
|
|
366
|
+
line-height: var(--ds-leading-none);
|
|
367
|
+
border-radius: var(--ds-radius-full);
|
|
368
|
+
background-color: var(--ds-color-surface-muted);
|
|
369
|
+
border: 1px solid var(--ds-color-border);
|
|
370
|
+
color: var(--ds-color-text-secondary);
|
|
371
|
+
white-space: nowrap;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.ds-custom-select__tag-remove {
|
|
375
|
+
display: inline-flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
justify-content: center;
|
|
378
|
+
width: 1rem;
|
|
379
|
+
height: 1rem;
|
|
380
|
+
min-width: 1.5rem; /* WCAG 2.5.8: minimum 24px target */
|
|
381
|
+
min-height: 1.5rem;
|
|
382
|
+
padding: 0;
|
|
383
|
+
border: none;
|
|
384
|
+
border-radius: var(--ds-radius-full);
|
|
385
|
+
background: transparent;
|
|
386
|
+
color: currentColor;
|
|
387
|
+
font-size: inherit;
|
|
388
|
+
line-height: var(--ds-leading-none);
|
|
389
|
+
opacity: 0.6;
|
|
390
|
+
cursor: pointer;
|
|
391
|
+
transition: opacity var(--ds-duration-fast) var(--ds-ease-out);
|
|
392
|
+
-webkit-appearance: none;
|
|
393
|
+
appearance: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.ds-custom-select__tag-remove:hover {
|
|
397
|
+
opacity: 1;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* --- Multi option: checkbox style indicator --- */
|
|
401
|
+
|
|
402
|
+
.ds-custom-select--multi .ds-custom-select__option-check {
|
|
403
|
+
width: 1rem;
|
|
404
|
+
height: 1rem;
|
|
405
|
+
border: 1px solid var(--ds-color-border);
|
|
406
|
+
border-radius: var(--ds-radius-sm);
|
|
407
|
+
flex-shrink: 0;
|
|
408
|
+
display: flex;
|
|
409
|
+
align-items: center;
|
|
410
|
+
justify-content: center;
|
|
411
|
+
transition:
|
|
412
|
+
background-color var(--ds-duration-fast) var(--ds-ease-default),
|
|
413
|
+
border-color var(--ds-duration-fast) var(--ds-ease-default);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.ds-custom-select--multi .ds-custom-select__option--selected .ds-custom-select__option-check {
|
|
417
|
+
background-color: var(--ds-color-interactive);
|
|
418
|
+
border-color: var(--ds-color-interactive);
|
|
419
|
+
color: var(--ds-color-on-inverted);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* --- Multi size variants --- */
|
|
423
|
+
|
|
424
|
+
.ds-custom-select--xs.ds-custom-select--multi .ds-custom-select__trigger {
|
|
425
|
+
min-height: var(--ds-size-1);
|
|
426
|
+
padding: var(--ds-space-0-5) var(--ds-space-1-5) var(--ds-space-0-5) var(--ds-space-1);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.ds-custom-select--sm.ds-custom-select--multi .ds-custom-select__trigger {
|
|
430
|
+
min-height: var(--ds-size-2);
|
|
431
|
+
padding: var(--ds-space-0-5) var(--ds-space-2) var(--ds-space-0-5) var(--ds-space-1-5);
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.ds-custom-select--lg.ds-custom-select--multi .ds-custom-select__trigger {
|
|
435
|
+
min-height: var(--ds-size-4);
|
|
436
|
+
padding: var(--ds-space-1) var(--ds-space-4) var(--ds-space-1) var(--ds-space-2);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
@media (prefers-reduced-motion: reduce) {
|
|
440
|
+
.ds-custom-select__panel {
|
|
441
|
+
animation: none;
|
|
442
|
+
opacity: 1;
|
|
443
|
+
transform: scale(1);
|
|
444
|
+
}
|
|
445
|
+
.ds-custom-select__backdrop { animation: none; opacity: 1; }
|
|
446
|
+
}
|