hydrateless 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/alert.css ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Alert — `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
3
+ * optional icon, `.hl-alert-title`, and body content.
4
+ * data-hl-intent: info (default) | success | warning | danger | neutral
5
+ */
6
+ @layer components {
7
+ .hl-alert {
8
+ --_accent: var(--hl-info);
9
+ --_bg: var(--hl-info-subtle);
10
+ --_fg: var(--hl-info-subtle-fg);
11
+
12
+ display: flex;
13
+ gap: var(--hl-space-3);
14
+ padding: var(--hl-space-3) var(--hl-space-4);
15
+ border: var(--hl-border-width) solid transparent;
16
+ border-left: 3px solid var(--_accent);
17
+ border-radius: var(--hl-radius-md);
18
+ background: var(--_bg);
19
+ color: var(--_fg);
20
+ font-size: var(--hl-text-sm);
21
+ line-height: var(--hl-leading-normal);
22
+ }
23
+
24
+ .hl-alert[data-hl-intent='success'] {
25
+ --_accent: var(--hl-success);
26
+ --_bg: var(--hl-success-subtle);
27
+ --_fg: var(--hl-success-subtle-fg);
28
+ }
29
+
30
+ .hl-alert[data-hl-intent='warning'] {
31
+ --_accent: var(--hl-warning);
32
+ --_bg: var(--hl-warning-subtle);
33
+ --_fg: var(--hl-warning-subtle-fg);
34
+ }
35
+
36
+ .hl-alert[data-hl-intent='danger'] {
37
+ --_accent: var(--hl-danger);
38
+ --_bg: var(--hl-danger-subtle);
39
+ --_fg: var(--hl-danger-subtle-fg);
40
+ }
41
+
42
+ .hl-alert[data-hl-intent='neutral'] {
43
+ --_accent: var(--hl-border-strong);
44
+ --_bg: var(--hl-surface-2);
45
+ --_fg: var(--hl-fg);
46
+ }
47
+
48
+ .hl-alert > svg:first-child {
49
+ flex: none;
50
+ width: 1.25rem;
51
+ height: 1.25rem;
52
+ margin-top: 0.1rem;
53
+ color: var(--_accent);
54
+ }
55
+
56
+ .hl-alert-body {
57
+ display: flex;
58
+ flex-direction: column;
59
+ gap: var(--hl-space-1);
60
+ min-width: 0;
61
+ }
62
+
63
+ .hl-alert-title {
64
+ margin: 0;
65
+ font-size: var(--hl-text-sm);
66
+ font-weight: var(--hl-font-semibold);
67
+ }
68
+
69
+ .hl-alert p {
70
+ margin: 0;
71
+ }
72
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Avatar — `<span class="hl-avatar">` containing an `<img>` or fallback
3
+ * initials/icon. Stack with `<div class="hl-avatar-group">`.
4
+ * data-hl-size: xs | sm | md (default) | lg | xl
5
+ * data-hl-shape: square
6
+ */
7
+ @layer components {
8
+ .hl-avatar {
9
+ --_size: 2.5rem;
10
+
11
+ position: relative;
12
+ display: inline-grid;
13
+ align-items: center;
14
+ justify-items: center;
15
+ place-items: center;
16
+ flex: none;
17
+ width: 2.5rem;
18
+ width: var(--_size);
19
+ height: 2.5rem;
20
+ height: var(--_size);
21
+ border-radius: var(--hl-radius-full);
22
+ overflow: hidden;
23
+ background: var(--hl-surface-3);
24
+ color: var(--hl-fg-muted);
25
+ font-size: calc(2.5rem * 0.4);
26
+ font-size: calc(var(--_size) * 0.4);
27
+ font-weight: var(--hl-font-medium);
28
+ line-height: 1;
29
+ text-transform: uppercase;
30
+ -webkit-user-select: none;
31
+ -moz-user-select: none;
32
+ user-select: none;
33
+ }
34
+
35
+ .hl-avatar[data-hl-shape='square'] {
36
+ border-radius: var(--hl-radius-lg);
37
+ }
38
+
39
+ .hl-avatar > img {
40
+ width: 100%;
41
+ height: 100%;
42
+ -o-object-fit: cover;
43
+ object-fit: cover;
44
+ }
45
+
46
+ .hl-avatar[data-hl-size='xs'] {
47
+ --_size: 1.5rem;
48
+ }
49
+
50
+ .hl-avatar[data-hl-size='sm'] {
51
+ --_size: 2rem;
52
+ }
53
+
54
+ .hl-avatar[data-hl-size='lg'] {
55
+ --_size: 3rem;
56
+ }
57
+
58
+ .hl-avatar[data-hl-size='xl'] {
59
+ --_size: 4rem;
60
+ }
61
+
62
+ .hl-avatar-group {
63
+ display: inline-flex;
64
+ align-items: center;
65
+ }
66
+
67
+ .hl-avatar-group > .hl-avatar {
68
+ box-shadow: 0 0 0 2px var(--hl-surface);
69
+ }
70
+
71
+ .hl-avatar-group > .hl-avatar:not(:first-child) {
72
+ margin-left: -0.6rem;
73
+ }
74
+ }
package/dist/badge.css ADDED
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Badge — `<span class="hl-badge" data-hl-intent="…" data-hl-variant="…">`.
3
+ * data-hl-intent: neutral (default) | primary | danger | success | warning | info
4
+ * data-hl-variant: soft (default) | solid | outline
5
+ * data-hl-size: sm | md (default)
6
+ */
7
+ @layer components {
8
+ .hl-badge {
9
+ --_solid-bg: var(--hl-surface-3);
10
+ --_solid-fg: var(--hl-fg);
11
+ --_soft-bg: var(--hl-surface-2);
12
+ --_soft-fg: var(--hl-fg);
13
+ --_accent: var(--hl-border-strong);
14
+
15
+ display: inline-flex;
16
+ align-items: center;
17
+ gap: var(--hl-space-1);
18
+ padding: 0.125rem var(--hl-space-2);
19
+ border: var(--hl-border-width) solid transparent;
20
+ border-radius: var(--hl-radius-full);
21
+ background: var(--_soft-bg);
22
+ color: var(--_soft-fg);
23
+ font-size: var(--hl-text-xs);
24
+ font-weight: var(--hl-font-medium);
25
+ line-height: var(--hl-leading-tight);
26
+ white-space: nowrap;
27
+ }
28
+
29
+ .hl-badge[data-hl-intent='primary'] {
30
+ --_solid-bg: var(--hl-primary);
31
+ --_solid-fg: var(--hl-primary-fg);
32
+ --_soft-bg: var(--hl-primary-subtle);
33
+ --_soft-fg: var(--hl-primary-subtle-fg);
34
+ --_accent: var(--hl-primary);
35
+ }
36
+
37
+ .hl-badge[data-hl-intent='danger'] {
38
+ --_solid-bg: var(--hl-danger);
39
+ --_solid-fg: var(--hl-danger-fg);
40
+ --_soft-bg: var(--hl-danger-subtle);
41
+ --_soft-fg: var(--hl-danger-subtle-fg);
42
+ --_accent: var(--hl-danger);
43
+ }
44
+
45
+ .hl-badge[data-hl-intent='success'] {
46
+ --_solid-bg: var(--hl-success);
47
+ --_solid-fg: var(--hl-success-fg);
48
+ --_soft-bg: var(--hl-success-subtle);
49
+ --_soft-fg: var(--hl-success-subtle-fg);
50
+ --_accent: var(--hl-success);
51
+ }
52
+
53
+ .hl-badge[data-hl-intent='warning'] {
54
+ --_solid-bg: var(--hl-warning);
55
+ --_solid-fg: var(--hl-warning-fg);
56
+ --_soft-bg: var(--hl-warning-subtle);
57
+ --_soft-fg: var(--hl-warning-subtle-fg);
58
+ --_accent: var(--hl-warning);
59
+ }
60
+
61
+ .hl-badge[data-hl-intent='info'] {
62
+ --_solid-bg: var(--hl-info);
63
+ --_solid-fg: var(--hl-info-fg);
64
+ --_soft-bg: var(--hl-info-subtle);
65
+ --_soft-fg: var(--hl-info-subtle-fg);
66
+ --_accent: var(--hl-info);
67
+ }
68
+
69
+ .hl-badge[data-hl-variant='solid'] {
70
+ background: var(--_solid-bg);
71
+ color: var(--_solid-fg);
72
+ }
73
+
74
+ .hl-badge[data-hl-variant='outline'] {
75
+ background: transparent;
76
+ color: var(--_accent);
77
+ border-color: currentcolor;
78
+ }
79
+
80
+ .hl-badge[data-hl-size='sm'] {
81
+ padding: 0 var(--hl-space-1-5);
82
+ font-size: 0.6875rem;
83
+ }
84
+ }
@@ -0,0 +1,255 @@
1
+ /**
2
+ * Button — `<button class="hl-button">` (works on `<a>`/`<input>` too).
3
+ *
4
+ * Color is driven by a small set of local custom properties so the
5
+ * intent × variant matrix stays DRY: `data-hl-intent` swaps the accent set,
6
+ * `data-hl-variant` decides how those values are applied.
7
+ *
8
+ * data-hl-variant: solid (default) | soft | outline | ghost | link
9
+ * data-hl-intent: neutral (default) | primary | danger | success | warning | info
10
+ * data-hl-size: sm | md (default) | lg
11
+ * data-hl-block: stretch to container width
12
+ * data-hl-icon: square, icon-only
13
+ */
14
+ @layer components {
15
+ .hl-button {
16
+ --_solid-bg: var(--hl-surface-2);
17
+ --_solid-bg-hover: var(--hl-surface-3);
18
+ --_solid-bg-active: var(--hl-surface-3);
19
+ --_solid-fg: var(--hl-fg);
20
+ --_accent: var(--hl-fg);
21
+ --_soft-bg: var(--hl-surface-2);
22
+ --_soft-fg: var(--hl-fg);
23
+ --_height: var(--hl-control-height-md);
24
+ --_pad-x: var(--hl-space-4);
25
+ --_font: var(--hl-text-sm);
26
+ --_gap: var(--hl-space-2);
27
+
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ gap: var(--_gap);
32
+ height: var(--_height);
33
+ padding-left: var(--_pad-x);
34
+ padding-right: var(--_pad-x);
35
+ border: var(--hl-border-width) solid transparent;
36
+ border-radius: var(--hl-radius-md);
37
+ font-family: inherit;
38
+ font-size: var(--_font);
39
+ font-weight: var(--hl-font-medium);
40
+ line-height: 1;
41
+ white-space: nowrap;
42
+ -webkit-text-decoration: none;
43
+ text-decoration: none;
44
+ cursor: pointer;
45
+ -webkit-user-select: none;
46
+ -moz-user-select: none;
47
+ user-select: none;
48
+ background: var(--_solid-bg);
49
+ color: var(--_solid-fg);
50
+ transition:
51
+ background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
52
+ }
53
+
54
+ .hl-button:hover {
55
+ background: var(--_solid-bg-hover);
56
+ }
57
+
58
+ .hl-button:active {
59
+ background: var(--_solid-bg-active);
60
+ }
61
+
62
+ .hl-button:focus-visible {
63
+ outline: var(--hl-focus-ring);
64
+ outline-offset: 2px;
65
+ }
66
+
67
+ .hl-button:disabled,
68
+ .hl-button[aria-disabled='true'],
69
+ .hl-button[data-hl-loading] {
70
+ cursor: not-allowed;
71
+ opacity: 0.55;
72
+ }
73
+
74
+ .hl-button[data-hl-loading] {
75
+ cursor: progress;
76
+ }
77
+
78
+ .hl-button[data-hl-intent='primary'] {
79
+ --_solid-bg: var(--hl-primary);
80
+ --_solid-bg-hover: var(--hl-primary-hover);
81
+ --_solid-bg-active: var(--hl-primary-active);
82
+ --_solid-fg: var(--hl-primary-fg);
83
+ --_accent: var(--hl-primary);
84
+ --_soft-bg: var(--hl-primary-subtle);
85
+ --_soft-fg: var(--hl-primary-subtle-fg);
86
+ }
87
+
88
+ .hl-button[data-hl-intent='danger'] {
89
+ --_solid-bg: var(--hl-danger);
90
+ --_solid-bg-hover: var(--hl-danger-hover);
91
+ --_solid-bg-active: var(--hl-danger-hover);
92
+ --_solid-fg: var(--hl-danger-fg);
93
+ --_accent: var(--hl-danger);
94
+ --_soft-bg: var(--hl-danger-subtle);
95
+ --_soft-fg: var(--hl-danger-subtle-fg);
96
+ }
97
+
98
+ .hl-button[data-hl-intent='success'] {
99
+ --_solid-bg: var(--hl-success);
100
+ --_solid-bg-hover: var(--hl-success-hover);
101
+ --_solid-bg-active: var(--hl-success-hover);
102
+ --_solid-fg: var(--hl-success-fg);
103
+ --_accent: var(--hl-success);
104
+ --_soft-bg: var(--hl-success-subtle);
105
+ --_soft-fg: var(--hl-success-subtle-fg);
106
+ }
107
+
108
+ .hl-button[data-hl-intent='warning'] {
109
+ --_solid-bg: var(--hl-warning);
110
+ --_solid-bg-hover: var(--hl-warning-hover);
111
+ --_solid-bg-active: var(--hl-warning-hover);
112
+ --_solid-fg: var(--hl-warning-fg);
113
+ --_accent: var(--hl-warning);
114
+ --_soft-bg: var(--hl-warning-subtle);
115
+ --_soft-fg: var(--hl-warning-subtle-fg);
116
+ }
117
+
118
+ .hl-button[data-hl-intent='info'] {
119
+ --_solid-bg: var(--hl-info);
120
+ --_solid-bg-hover: var(--hl-info-hover);
121
+ --_solid-bg-active: var(--hl-info-hover);
122
+ --_solid-fg: var(--hl-info-fg);
123
+ --_accent: var(--hl-info);
124
+ --_soft-bg: var(--hl-info-subtle);
125
+ --_soft-fg: var(--hl-info-subtle-fg);
126
+ }
127
+
128
+ .hl-button[data-hl-variant='soft'] {
129
+ background: var(--_soft-bg);
130
+ color: var(--_soft-fg);
131
+ }
132
+
133
+ .hl-button[data-hl-variant='soft']:hover {
134
+ background: color-mix(in oklab, var(--_accent) 14%, var(--_soft-bg));
135
+ }
136
+
137
+ .hl-button[data-hl-variant='outline'] {
138
+ background: transparent;
139
+ color: var(--_accent);
140
+ border-color: var(--hl-border-strong);
141
+ }
142
+
143
+ .hl-button[data-hl-variant='outline']:hover {
144
+ background: var(--_soft-bg);
145
+ border-color: var(--_accent);
146
+ }
147
+
148
+ .hl-button[data-hl-variant='ghost'] {
149
+ background: transparent;
150
+ color: var(--_accent);
151
+ }
152
+
153
+ .hl-button[data-hl-variant='ghost']:hover {
154
+ background: var(--_soft-bg);
155
+ }
156
+
157
+ .hl-button[data-hl-variant='link'] {
158
+ height: auto;
159
+ padding: 0;
160
+ background: transparent;
161
+ color: var(--_accent);
162
+ border-color: transparent;
163
+ -webkit-text-decoration: underline;
164
+ text-decoration: underline;
165
+ text-underline-offset: 0.2em;
166
+ }
167
+
168
+ .hl-button[data-hl-variant='link']:hover {
169
+ background: transparent;
170
+ text-decoration-thickness: 2px;
171
+ }
172
+
173
+ .hl-button[data-hl-size='sm'] {
174
+ --_height: var(--hl-control-height-sm);
175
+ --_pad-x: var(--hl-space-3);
176
+ --_font: var(--hl-text-xs);
177
+ --_gap: var(--hl-space-1);
178
+
179
+ border-radius: var(--hl-radius-sm);
180
+ }
181
+
182
+ .hl-button[data-hl-size='lg'] {
183
+ --_height: var(--hl-control-height-lg);
184
+ --_pad-x: var(--hl-space-5);
185
+ --_font: var(--hl-text-base);
186
+
187
+ border-radius: var(--hl-radius-lg);
188
+ }
189
+
190
+ .hl-button[data-hl-block] {
191
+ display: flex;
192
+ width: 100%;
193
+ }
194
+
195
+ .hl-button[data-hl-icon] {
196
+ width: var(--_height);
197
+ padding-left: 0;
198
+ padding-right: 0;
199
+ }
200
+
201
+ .hl-button > svg {
202
+ width: 1.1em;
203
+ height: 1.1em;
204
+ flex: none;
205
+ }
206
+
207
+ .hl-button[data-hl-loading]::before {
208
+ content: '';
209
+ width: 1em;
210
+ height: 1em;
211
+ border: 2px solid currentcolor;
212
+ border-top-color: transparent;
213
+ border-radius: var(--hl-radius-full);
214
+ animation: hl-button-spin 0.6s linear infinite;
215
+ }
216
+
217
+ @media (prefers-reduced-motion: reduce) {
218
+ .hl-button[data-hl-loading]::before {
219
+ animation-duration: 1.4s;
220
+ }
221
+ }
222
+
223
+ @keyframes hl-button-spin {
224
+ to {
225
+ transform: rotate(1turn);
226
+ }
227
+ }
228
+
229
+ .hl-button-group {
230
+ display: inline-flex;
231
+ }
232
+
233
+ .hl-button-group > .hl-button {
234
+ border-radius: 0;
235
+ }
236
+
237
+ .hl-button-group > .hl-button:not(:first-child) {
238
+ margin-left: calc(var(--hl-border-width) * -1);
239
+ }
240
+
241
+ .hl-button-group > .hl-button:first-child {
242
+ border-top-left-radius: var(--hl-radius-md);
243
+ border-bottom-left-radius: var(--hl-radius-md);
244
+ }
245
+
246
+ .hl-button-group > .hl-button:last-child {
247
+ border-top-right-radius: var(--hl-radius-md);
248
+ border-bottom-right-radius: var(--hl-radius-md);
249
+ }
250
+
251
+ .hl-button-group > .hl-button:hover,
252
+ .hl-button-group > .hl-button:focus-visible {
253
+ z-index: 1;
254
+ }
255
+ }
package/dist/card.css ADDED
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Card — `<div class="hl-card">` with optional `.hl-card-header`,
3
+ * `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
4
+ * data-hl-interactive: hover/active elevation for clickable cards
5
+ */
6
+ @layer components {
7
+ .hl-card {
8
+ display: flex;
9
+ flex-direction: column;
10
+ background: var(--hl-surface);
11
+ border: var(--hl-border-width) solid var(--hl-border);
12
+ border-radius: var(--hl-radius-xl);
13
+ box-shadow: var(--hl-shadow-sm);
14
+ overflow: hidden;
15
+ }
16
+
17
+ .hl-card-header {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: var(--hl-space-1);
21
+ padding: var(--hl-space-4) var(--hl-space-5);
22
+ border-bottom: var(--hl-border-width) solid var(--hl-border);
23
+ }
24
+
25
+ .hl-card-body {
26
+ flex: 1 1 auto;
27
+ padding: var(--hl-space-5);
28
+ }
29
+
30
+ .hl-card-footer {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: var(--hl-space-2);
34
+ padding: var(--hl-space-4) var(--hl-space-5);
35
+ border-top: var(--hl-border-width) solid var(--hl-border);
36
+ background: var(--hl-surface-2);
37
+ }
38
+
39
+ .hl-card-title {
40
+ margin: 0;
41
+ font-size: var(--hl-text-lg);
42
+ font-weight: var(--hl-font-semibold);
43
+ line-height: var(--hl-leading-tight);
44
+ }
45
+
46
+ .hl-card-description {
47
+ margin: 0;
48
+ font-size: var(--hl-text-sm);
49
+ color: var(--hl-fg-muted);
50
+ }
51
+
52
+ .hl-card[data-hl-interactive] {
53
+ cursor: pointer;
54
+ transition:
55
+ border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-base) var(--hl-ease-standard), transform var(--hl-duration-base) var(--hl-ease-standard);
56
+ }
57
+
58
+ .hl-card[data-hl-interactive]:hover {
59
+ border-color: var(--hl-border-strong);
60
+ box-shadow: var(--hl-shadow-md);
61
+ }
62
+
63
+ .hl-card[data-hl-interactive]:focus-within {
64
+ outline: var(--hl-focus-ring);
65
+ outline-offset: 2px;
66
+ }
67
+
68
+ .hl-card[data-hl-interactive]:active {
69
+ transform: translateY(1px);
70
+ }
71
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Checkbox — `<label class="hl-checkbox"><input type="checkbox"><span>…</span></label>`.
3
+ * The native input is restyled (appearance:none) with a CSS checkmark, keeping
4
+ * full keyboard + form semantics.
5
+ */
6
+ @layer components {
7
+ .hl-checkbox {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ gap: var(--hl-space-2);
11
+ font-size: var(--hl-text-sm);
12
+ line-height: var(--hl-leading-normal);
13
+ cursor: pointer;
14
+ }
15
+
16
+ .hl-checkbox > input[type='checkbox'] {
17
+ -webkit-appearance: none;
18
+ -moz-appearance: none;
19
+ appearance: none;
20
+ flex: none;
21
+ width: 1.15rem;
22
+ height: 1.15rem;
23
+ margin: 0;
24
+ border: var(--hl-border-width-2) solid var(--hl-border-strong);
25
+ border-radius: var(--hl-radius-sm);
26
+ background: var(--hl-surface);
27
+ display: grid;
28
+ align-content: center;
29
+ justify-content: center;
30
+ place-content: center;
31
+ cursor: pointer;
32
+ transition:
33
+ background-color var(--hl-duration-fast) var(--hl-ease-standard), border-color var(--hl-duration-fast) var(--hl-ease-standard);
34
+ }
35
+
36
+ .hl-checkbox > input[type='checkbox']::after {
37
+ content: '';
38
+ width: 0.34rem;
39
+ height: 0.62rem;
40
+ border: solid var(--hl-primary-fg);
41
+ border-width: 0 2px 2px 0;
42
+ margin-top: -2px;
43
+ transform: rotate(45deg) scale(0);
44
+ transition: transform var(--hl-duration-fast) var(--hl-ease-emphasized);
45
+ }
46
+
47
+ .hl-checkbox > input[type='checkbox']:checked,
48
+ .hl-checkbox > input[type='checkbox']:indeterminate {
49
+ background: var(--hl-primary);
50
+ border-color: var(--hl-primary);
51
+ }
52
+
53
+ .hl-checkbox > input[type='checkbox']:checked::after {
54
+ transform: rotate(45deg) scale(1);
55
+ }
56
+
57
+ .hl-checkbox > input[type='checkbox']:indeterminate::after {
58
+ width: 0.6rem;
59
+ height: 0;
60
+ margin: 0;
61
+ border-width: 0 0 2px;
62
+ transform: none;
63
+ }
64
+
65
+ .hl-checkbox > input[type='checkbox']:focus-visible {
66
+ outline: var(--hl-focus-ring);
67
+ outline-offset: 2px;
68
+ }
69
+
70
+ .hl-checkbox > input[type='checkbox']:disabled {
71
+ cursor: not-allowed;
72
+ opacity: 0.55;
73
+ }
74
+
75
+ .hl-checkbox:has(> input:disabled) {
76
+ cursor: not-allowed;
77
+ color: var(--hl-fg-subtle);
78
+ }
79
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Combobox — `<div data-hl-combobox>` wrapping an `<input>` and a
3
+ * `<ul role="listbox">` of `<li role="option">`. The enhancer toggles the
4
+ * listbox and manages `aria-activedescendant`.
5
+ */
6
+ @layer components {
7
+ [data-hl-combobox] {
8
+ position: relative;
9
+ display: block;
10
+ }
11
+
12
+ [data-hl-combobox] [role='listbox'] {
13
+ position: absolute;
14
+ top: calc(100% + var(--hl-space-1));
15
+ left: 0;
16
+ right: 0;
17
+ z-index: var(--hl-z-dropdown);
18
+ max-height: 16rem;
19
+ margin: 0;
20
+ padding: var(--hl-space-1);
21
+ overflow-y: auto;
22
+ list-style: none;
23
+ background: var(--hl-overlay);
24
+ border: var(--hl-border-width) solid var(--hl-border);
25
+ border-radius: var(--hl-radius-lg);
26
+ box-shadow: var(--hl-overlay-shadow);
27
+ }
28
+
29
+ [data-hl-combobox] [role='listbox'][hidden] {
30
+ display: none;
31
+ }
32
+
33
+ [data-hl-combobox] [role='option'] {
34
+ display: flex;
35
+ align-items: center;
36
+ gap: var(--hl-space-2);
37
+ padding: var(--hl-space-2) var(--hl-space-3);
38
+ border-radius: var(--hl-radius-md);
39
+ font-size: var(--hl-text-sm);
40
+ color: var(--hl-fg);
41
+ cursor: pointer;
42
+ }
43
+
44
+ [data-hl-combobox] [role='option']:hover,
45
+ [data-hl-combobox] [role='option'][aria-selected='true'] {
46
+ background: var(--hl-primary-subtle);
47
+ color: var(--hl-primary-subtle-fg);
48
+ }
49
+
50
+ [data-hl-combobox] [role='option'][hidden] {
51
+ display: none;
52
+ }
53
+
54
+ [data-hl-combobox] [role='option'][aria-disabled='true'] {
55
+ opacity: 0.5;
56
+ pointer-events: none;
57
+ }
58
+ }