@gjsify/adwaita-web 0.15.1 → 0.16.1
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/dist/adwaita-web.css +408 -0
- package/dist/adwaita-web.css.map +1 -1
- package/lib/types/adw-data-grid.spec.d.ts +1 -0
- package/lib/types/adw-dialog.spec.d.ts +1 -0
- package/lib/types/adw-drop-down.spec.d.ts +1 -0
- package/lib/types/elements/adw-data-grid.d.ts +60 -0
- package/lib/types/elements/adw-dialog.d.ts +51 -0
- package/lib/types/elements/adw-drop-down.d.ts +63 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/styles.generated.d.ts +1 -1
- package/package.json +13 -11
- package/scss/_data_grid.scss +144 -0
- package/scss/_dialog.scss +220 -0
- package/scss/_drop_down.scss +185 -0
- package/scss/_icons.generated.scss +221 -0
- package/scss/_theme.scss +2 -0
- package/scss/_variables.scss +4 -0
- package/scss/adwaita-skin.scss +3 -0
- package/src/adw-data-grid.spec.ts +243 -0
- package/src/adw-dialog.spec.ts +169 -0
- package/src/adw-drop-down.spec.ts +186 -0
- package/src/elements/adw-data-grid.ts +335 -0
- package/src/elements/adw-dialog.ts +329 -0
- package/src/elements/adw-drop-down.ts +405 -0
- package/src/index.ts +11 -0
- package/src/styles.generated.ts +4 -0
- package/src/test.browser.mts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.1",
|
|
4
4
|
"description": "Adwaita/Libadwaita web components for browser targets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -33,20 +33,22 @@
|
|
|
33
33
|
"check": "gjsify run build:scss && gjsify tsc --noEmit",
|
|
34
34
|
"build": "gjsify run build:scss && gjsify run build:types",
|
|
35
35
|
"build:scss": "node scripts/build-scss.mjs",
|
|
36
|
-
"build:types": "gjsify tsc"
|
|
36
|
+
"build:types": "gjsify tsc",
|
|
37
|
+
"build:test:browser": "gjsify run build:scss && gjsify build src/test.browser.mts --app browser --outfile dist/test.browser.mjs"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@codemirror/commands": "^6.
|
|
40
|
-
"@codemirror/language": "^6.
|
|
41
|
-
"@codemirror/state": "^6.
|
|
42
|
-
"@codemirror/view": "^6.
|
|
43
|
-
"@gjsify/adwaita-fonts": "^0.
|
|
44
|
-
"@gjsify/adwaita-icons": "^0.
|
|
45
|
-
"@lezer/highlight": "^1.
|
|
40
|
+
"@codemirror/commands": "^6.10.4",
|
|
41
|
+
"@codemirror/language": "^6.12.4",
|
|
42
|
+
"@codemirror/state": "^6.7.0",
|
|
43
|
+
"@codemirror/view": "^6.43.4",
|
|
44
|
+
"@gjsify/adwaita-fonts": "^0.16.1",
|
|
45
|
+
"@gjsify/adwaita-icons": "^0.16.1",
|
|
46
|
+
"@lezer/highlight": "^1.2.3"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@gjsify/cli": "^0.
|
|
49
|
-
"
|
|
49
|
+
"@gjsify/cli": "^0.16.1",
|
|
50
|
+
"@gjsify/unit": "^0.16.1",
|
|
51
|
+
"sass": "^1.101.0",
|
|
50
52
|
"typescript": "^6.0.3"
|
|
51
53
|
},
|
|
52
54
|
"gjsify": {
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// _data_grid.scss — adw-data-grid: a slim, aligned numeric grid for genuinely
|
|
2
|
+
// tabular data (an accounting BWA / P&L statement, invoice line-items). The web
|
|
3
|
+
// mirror of the native Gtk.Grid the Buchhaltung app fills for its financial
|
|
4
|
+
// statements — labels left, amounts right-aligned with tabular figures so
|
|
5
|
+
// columns of numbers line up, plus the section / subtotal / total emphasis a
|
|
6
|
+
// statement needs. NOT a Gtk.ColumnView (no sorting, no zebra striping); boxed
|
|
7
|
+
// lists stay the default for record lists. Uses CSS subgrid so each row is a
|
|
8
|
+
// real element (hover, hairline rules, activation) while columns stay aligned.
|
|
9
|
+
// Reference: refs/libadwaita/src/stylesheet/_colors.scss (separator / card / dim tokens)
|
|
10
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_lists.scss (boxed-list density)
|
|
11
|
+
// Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
|
|
12
|
+
// Modifications: Implemented for @gjsify/adwaita-web Web Components.
|
|
13
|
+
|
|
14
|
+
.adw-data-grid {
|
|
15
|
+
display: block;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
color: var(--card-fg-color);
|
|
18
|
+
font-size: var(--font-size-base);
|
|
19
|
+
|
|
20
|
+
// Optional title above the grid.
|
|
21
|
+
.adw-data-grid-caption {
|
|
22
|
+
font-size: var(--font-size-heading);
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
color: var(--window-fg-color);
|
|
25
|
+
margin: 0 0 var(--spacing-s);
|
|
26
|
+
padding: 0 var(--spacing-xs);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Horizontal scroll is CONTAINED here — a wide statement (many month columns)
|
|
30
|
+
// scrolls sideways within the grid instead of overflowing the page.
|
|
31
|
+
.adw-data-grid-scroll {
|
|
32
|
+
overflow-x: auto;
|
|
33
|
+
overflow-y: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// The grid owns the column tracks; each row is a subgrid spanning them, so
|
|
37
|
+
// figures in the same column line up across every row. `min-width: max-content`
|
|
38
|
+
// keeps columns from crushing — they overflow into the scroller instead.
|
|
39
|
+
.adw-data-grid-table {
|
|
40
|
+
display: grid;
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
width: 100%;
|
|
43
|
+
min-width: max-content;
|
|
44
|
+
// grid-template-columns is set inline from the column descriptors.
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.adw-data-grid-row {
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: subgrid;
|
|
50
|
+
grid-column: 1 / -1;
|
|
51
|
+
align-items: center;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Airy Adwaita cell density (matching the boxed-list row rhythm), single-line.
|
|
55
|
+
.adw-data-grid-cell {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
min-width: 0;
|
|
58
|
+
padding: var(--spacing-s) var(--spacing-m);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
text-align: left;
|
|
61
|
+
|
|
62
|
+
&.align-end {
|
|
63
|
+
text-align: right;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.align-center {
|
|
67
|
+
text-align: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Tabular figures are the WHOLE POINT vs a boxed list — numbers line up.
|
|
71
|
+
&.numeric {
|
|
72
|
+
font-variant-numeric: tabular-nums;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.mono {
|
|
76
|
+
font-family: 'Adwaita Mono', 'Cantarell', ui-monospace, 'SF Mono', 'Menlo', monospace;
|
|
77
|
+
font-variant-numeric: tabular-nums;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Header row — dim, small, uppercase caps with a hairline underline (Adwaita
|
|
82
|
+
// list-column headings), never sortable.
|
|
83
|
+
.adw-data-grid-row.header {
|
|
84
|
+
.adw-data-grid-cell {
|
|
85
|
+
font-size: var(--font-size-small);
|
|
86
|
+
font-weight: 700;
|
|
87
|
+
text-transform: uppercase;
|
|
88
|
+
letter-spacing: 0.04em;
|
|
89
|
+
opacity: var(--dim-opacity);
|
|
90
|
+
border-bottom: 1px solid var(--separator-color);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// A section header spans all columns as a bold group title (a BWA's sections).
|
|
95
|
+
.adw-data-grid-row.variant-section {
|
|
96
|
+
.section-cell {
|
|
97
|
+
font-weight: 700;
|
|
98
|
+
color: var(--window-fg-color);
|
|
99
|
+
padding-top: var(--spacing-m);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// A subtotal is bold with a hairline rule above it (Gesamtleistung, Rohertrag…).
|
|
104
|
+
.adw-data-grid-row.variant-subtotal {
|
|
105
|
+
border-top: 1px solid var(--separator-color);
|
|
106
|
+
|
|
107
|
+
.adw-data-grid-cell {
|
|
108
|
+
font-weight: 700;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// The final total is bold with a STRONGER rule above (the accounting result —
|
|
113
|
+
// Betriebsergebnis), plus a thin rule below to evoke the ruled grand-total line.
|
|
114
|
+
.adw-data-grid-row.variant-total {
|
|
115
|
+
border-top: 2px solid var(--separator-color);
|
|
116
|
+
border-bottom: 1px solid var(--separator-color);
|
|
117
|
+
|
|
118
|
+
.adw-data-grid-cell {
|
|
119
|
+
font-weight: 800;
|
|
120
|
+
color: var(--window-fg-color);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Optional interactive rows (master-detail). Hairline separators only where
|
|
125
|
+
// Adwaita would — NOT zebra striping — so no default row borders; the hover /
|
|
126
|
+
// focus affordance carries the interaction.
|
|
127
|
+
.adw-data-grid-row.interactive {
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
border-radius: var(--button-radius);
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
background-color: var(--button-bg-color);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:active {
|
|
136
|
+
background-color: var(--button-active-color);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:focus-visible {
|
|
140
|
+
outline: 2px solid var(--accent-color);
|
|
141
|
+
outline-offset: -2px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// _dialog.scss — adw-dialog: a generic adaptive dialog. A full-cover scrim with
|
|
2
|
+
// a floating window-coloured "sheet" centred on wide viewports, re-anchored as a
|
|
3
|
+
// bottom sheet (full-width, rounded top corners) on narrow ones. Mirrors the
|
|
4
|
+
// AdwDialog floating-sheet + bottom-sheet presentations.
|
|
5
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_dialogs.scss (floating sheet)
|
|
6
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_bottom-sheet.scss (bottom radius)
|
|
7
|
+
// Copyright (c) 2023-2024 GNOME Foundation Inc. (libadwaita). LGPLv2.1+.
|
|
8
|
+
// Modifications: Implemented for @gjsify/adwaita-web Web Components.
|
|
9
|
+
|
|
10
|
+
// Bottom-sheet layout — shared by the explicit mode and the auto/narrow query.
|
|
11
|
+
@mixin adw-dialog-bottom-sheet {
|
|
12
|
+
.adw-dialog-scrim {
|
|
13
|
+
align-items: flex-end;
|
|
14
|
+
justify-content: stretch;
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.adw-dialog-box {
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: none;
|
|
21
|
+
// Rounded only along the top edge — it hugs the bottom viewport edge.
|
|
22
|
+
border-top-left-radius: var(--window-radius);
|
|
23
|
+
border-top-right-radius: var(--window-radius);
|
|
24
|
+
border-bottom-left-radius: 0;
|
|
25
|
+
border-bottom-right-radius: 0;
|
|
26
|
+
animation: adw-dialog-slide-up 0.25s cubic-bezier(0, 0, 0.2, 1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Host: contributes nothing to layout while closed; the `open` class reveals it.
|
|
31
|
+
adw-dialog {
|
|
32
|
+
display: none;
|
|
33
|
+
|
|
34
|
+
&.open {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// The full-cover scrim — a flex container centring the box; a dimming wash
|
|
39
|
+
// behind it. Clicking the scrim (outside the box) attempts to dismiss.
|
|
40
|
+
.adw-dialog-scrim {
|
|
41
|
+
position: fixed;
|
|
42
|
+
inset: 0;
|
|
43
|
+
z-index: 1050;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
padding: var(--spacing-l);
|
|
48
|
+
background-color: var(--dialog-scrim-color, rgba(0, 0, 6, 0.32));
|
|
49
|
+
animation: adw-dialog-fade-in 0.2s cubic-bezier(0, 0, 0.2, 1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// The dialog box ("sheet"): a rounded window-coloured surface with a soft
|
|
53
|
+
// layered shadow + hairline outline. Sized by the content-width/height props.
|
|
54
|
+
.adw-dialog-box {
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
width: min(var(--adw-dialog-content-width, 360px), calc(100vw - 2 * var(--spacing-l)));
|
|
59
|
+
max-height: min(var(--adw-dialog-content-height, 100vh), calc(100vh - 2 * var(--spacing-l)));
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
|
|
62
|
+
background-color: var(--window-bg-color);
|
|
63
|
+
color: var(--window-fg-color);
|
|
64
|
+
border-radius: var(--window-radius);
|
|
65
|
+
outline: 1px solid var(--separator-color);
|
|
66
|
+
outline-offset: -1px;
|
|
67
|
+
box-shadow:
|
|
68
|
+
0 0 0 1px rgba(0, 0, 0, 0.05),
|
|
69
|
+
0 0 5px 2px rgba(0, 0, 6, 0.1),
|
|
70
|
+
0 0 14px 2px rgba(0, 0, 6, 0.03);
|
|
71
|
+
|
|
72
|
+
font-family: var(--font-family);
|
|
73
|
+
animation: adw-dialog-pop-in 0.2s cubic-bezier(0, 0, 0.2, 1);
|
|
74
|
+
|
|
75
|
+
&:focus {
|
|
76
|
+
outline: 1px solid var(--separator-color);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Flat header bar — transparent over the window background, title strictly
|
|
81
|
+
// centred against the trailing close button (the AdwHeaderBar idiom).
|
|
82
|
+
.adw-dialog-header {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
min-height: 47px;
|
|
86
|
+
padding: 0 6px;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.adw-dialog-header-side {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
flex: 1 1 0;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.adw-dialog-header-side--end {
|
|
98
|
+
justify-content: flex-end;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.adw-dialog-title {
|
|
102
|
+
flex: 0 0 auto;
|
|
103
|
+
font-weight: bold;
|
|
104
|
+
font-size: var(--font-size-base);
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
text-overflow: ellipsis;
|
|
108
|
+
padding: 0 6px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Round flat close button drawing a CSS "×" glyph (no window-close symbolic
|
|
112
|
+
// ships in @gjsify/adwaita-icons — same approach as <adw-preferences-dialog>).
|
|
113
|
+
.adw-dialog-close {
|
|
114
|
+
appearance: none;
|
|
115
|
+
border: none;
|
|
116
|
+
margin: 0;
|
|
117
|
+
width: 28px;
|
|
118
|
+
height: 28px;
|
|
119
|
+
padding: 0;
|
|
120
|
+
border-radius: 50%;
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
color: var(--window-fg-color);
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
position: relative;
|
|
125
|
+
flex: none;
|
|
126
|
+
transition: background-color 0.1s ease;
|
|
127
|
+
|
|
128
|
+
&::before,
|
|
129
|
+
&::after {
|
|
130
|
+
content: '';
|
|
131
|
+
position: absolute;
|
|
132
|
+
top: 50%;
|
|
133
|
+
left: 50%;
|
|
134
|
+
width: 12px;
|
|
135
|
+
height: 1.5px;
|
|
136
|
+
background-color: currentColor;
|
|
137
|
+
border-radius: 1px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&::before {
|
|
141
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&::after {
|
|
145
|
+
transform: translate(-50%, -50%) rotate(-45deg);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:hover {
|
|
149
|
+
background-color: var(--button-hover-color);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&:active {
|
|
153
|
+
background-color: var(--button-active-color);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:focus-visible {
|
|
157
|
+
outline: 2px solid var(--accent-color);
|
|
158
|
+
outline-offset: 1px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.locked {
|
|
162
|
+
opacity: var(--dim-opacity);
|
|
163
|
+
cursor: default;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Content area — the author's markup; scrolls when it exceeds the box height.
|
|
168
|
+
.adw-dialog-content {
|
|
169
|
+
flex: 1 1 auto;
|
|
170
|
+
min-height: 0;
|
|
171
|
+
overflow-y: auto;
|
|
172
|
+
padding: var(--spacing-m) var(--spacing-l) var(--spacing-l);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// A header-less dialog pads the content on all sides.
|
|
176
|
+
.adw-dialog-header[hidden] + .adw-dialog-content {
|
|
177
|
+
padding-top: var(--spacing-l);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// --- Explicit bottom-sheet presentation ---
|
|
181
|
+
&[data-presentation='bottom-sheet'] {
|
|
182
|
+
@include adw-dialog-bottom-sheet;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// --- Adaptive (auto) presentation: bottom sheet on narrow viewports ---
|
|
187
|
+
@media (max-width: 550px) {
|
|
188
|
+
adw-dialog[data-presentation='auto'] {
|
|
189
|
+
@include adw-dialog-bottom-sheet;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@keyframes adw-dialog-fade-in {
|
|
194
|
+
from {
|
|
195
|
+
opacity: 0;
|
|
196
|
+
}
|
|
197
|
+
to {
|
|
198
|
+
opacity: 1;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@keyframes adw-dialog-pop-in {
|
|
203
|
+
from {
|
|
204
|
+
opacity: 0;
|
|
205
|
+
transform: scale(0.95);
|
|
206
|
+
}
|
|
207
|
+
to {
|
|
208
|
+
opacity: 1;
|
|
209
|
+
transform: scale(1);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@keyframes adw-dialog-slide-up {
|
|
214
|
+
from {
|
|
215
|
+
transform: translateY(100%);
|
|
216
|
+
}
|
|
217
|
+
to {
|
|
218
|
+
transform: translateY(0);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// _drop_down.scss — adw-drop-down: a standalone dropdown selector (the web
|
|
2
|
+
// counterpart of Gtk.DropDown). A normal Adwaita button showing the current
|
|
3
|
+
// selection + a `pan-down` chevron, dropping an elevated Adwaita popover list of
|
|
4
|
+
// options. The popover reproduces libadwaita's popover.menu > contents surface
|
|
5
|
+
// (soft triple shadow), the items its modelbutton rows, matching <adw-menu-button>.
|
|
6
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_popovers.scss (popover > contents)
|
|
7
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_menus.scss (modelbutton rows)
|
|
8
|
+
// Reference: refs/libadwaita/src/stylesheet/widgets/_drop-down.scss (dropdown button)
|
|
9
|
+
// Copyright (c) GNOME contributors (libadwaita). LGPLv2.1+.
|
|
10
|
+
// Modifications: Implemented for @gjsify/adwaita-web Web Components.
|
|
11
|
+
|
|
12
|
+
.adw-drop-down {
|
|
13
|
+
position: relative;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
|
|
18
|
+
// The selection button — a normal Adwaita button (label + dim chevron).
|
|
19
|
+
.adw-drop-down-button {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--spacing-xs);
|
|
24
|
+
min-width: 100px;
|
|
25
|
+
min-height: 34px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0 8px 0 12px;
|
|
28
|
+
border: none;
|
|
29
|
+
border-radius: var(--button-radius);
|
|
30
|
+
background-color: var(--button-bg-color);
|
|
31
|
+
color: var(--window-fg-color);
|
|
32
|
+
font-family: var(--font-family);
|
|
33
|
+
font-size: var(--font-size-base);
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: background-color 0.1s ease;
|
|
36
|
+
|
|
37
|
+
&:hover {
|
|
38
|
+
background-color: var(--button-hover-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:active {
|
|
42
|
+
background-color: var(--button-active-color);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
outline: 2px solid var(--accent-color);
|
|
47
|
+
outline-offset: 1px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:disabled {
|
|
51
|
+
cursor: default;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.adw-drop-down-label {
|
|
57
|
+
flex: 1 1 auto;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
text-align: start;
|
|
60
|
+
white-space: nowrap;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// The chevron — a smaller, dimmed down-glyph after the label.
|
|
66
|
+
.adw-drop-down-arrow {
|
|
67
|
+
width: 12px;
|
|
68
|
+
height: 12px;
|
|
69
|
+
mask-size: 12px;
|
|
70
|
+
-webkit-mask-size: 12px;
|
|
71
|
+
flex: none;
|
|
72
|
+
opacity: var(--dim-opacity);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.disabled {
|
|
76
|
+
opacity: 0.55;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// --- Popover list ---
|
|
80
|
+
// The elevated surface below the button. Reproduces popover.menu > contents.
|
|
81
|
+
.adw-drop-down-popover {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: calc(100% + 6px);
|
|
84
|
+
left: 0;
|
|
85
|
+
z-index: 10;
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
min-width: 100%;
|
|
89
|
+
max-width: 320px;
|
|
90
|
+
padding: var(--spacing-xs);
|
|
91
|
+
border-radius: var(--card-radius);
|
|
92
|
+
background-color: var(--popover-bg-color, var(--window-bg-color, #fff));
|
|
93
|
+
color: var(--popover-fg-color, var(--window-fg-color));
|
|
94
|
+
box-shadow:
|
|
95
|
+
0 0 0 1px rgba(0, 0, 0, 0.05),
|
|
96
|
+
0 1px 5px 1px rgba(0, 0, 0, 0.09),
|
|
97
|
+
0 2px 14px 3px rgba(0, 0, 0, 0.05);
|
|
98
|
+
|
|
99
|
+
&[hidden] {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Search entry atop the popover (enable-search). It reuses the .adw-entry skin
|
|
105
|
+
// but needs its own bottom margin to separate it from the list.
|
|
106
|
+
.adw-drop-down-search {
|
|
107
|
+
margin-bottom: var(--spacing-xs);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Scrollable column of option rows.
|
|
111
|
+
.adw-drop-down-list {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
max-height: 320px;
|
|
115
|
+
overflow-y: auto;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// An option row — a flat rounded row with the label and a trailing check on
|
|
119
|
+
// the selected one; fills on hover/focus like a modelbutton.
|
|
120
|
+
.adw-drop-down-item {
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: space-between;
|
|
125
|
+
gap: var(--spacing-s);
|
|
126
|
+
width: 100%;
|
|
127
|
+
min-height: 32px;
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding: var(--spacing-xs) var(--spacing-s);
|
|
130
|
+
border: none;
|
|
131
|
+
border-radius: calc(var(--button-radius) - 2px);
|
|
132
|
+
background-color: transparent;
|
|
133
|
+
color: inherit;
|
|
134
|
+
font-family: var(--font-family);
|
|
135
|
+
font-size: var(--font-size-base);
|
|
136
|
+
text-align: start;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: background-color 0.1s ease;
|
|
139
|
+
|
|
140
|
+
&:hover {
|
|
141
|
+
background-color: var(--button-hover-color);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:active {
|
|
145
|
+
background-color: var(--button-active-color);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:focus-visible {
|
|
149
|
+
outline: 2px solid var(--accent-color);
|
|
150
|
+
outline-offset: -2px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&[hidden] {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.adw-drop-down-item-label {
|
|
159
|
+
flex: 1 1 auto;
|
|
160
|
+
min-width: 0;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// The selected-row check — a CSS checkmark, shown only on `.selected`.
|
|
167
|
+
.adw-drop-down-item-check {
|
|
168
|
+
position: relative;
|
|
169
|
+
width: 16px;
|
|
170
|
+
height: 16px;
|
|
171
|
+
flex: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.adw-drop-down-item.selected .adw-drop-down-item-check::after {
|
|
175
|
+
content: '';
|
|
176
|
+
position: absolute;
|
|
177
|
+
left: 5px;
|
|
178
|
+
top: 2px;
|
|
179
|
+
width: 4px;
|
|
180
|
+
height: 8px;
|
|
181
|
+
border: solid var(--accent-color);
|
|
182
|
+
border-width: 0 2px 2px 0;
|
|
183
|
+
transform: rotate(45deg);
|
|
184
|
+
}
|
|
185
|
+
}
|