hydrateless 0.5.0 → 0.7.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/accordion.css +8 -12
- package/dist/alert.css +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/breadcrumb.css +7 -11
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/combobox.css +19 -1
- package/dist/command.css +1 -1
- package/dist/components.css +403 -222
- package/dist/disclosure.css +14 -18
- package/dist/drawer.css +34 -20
- package/dist/dropdown.css +35 -28
- package/dist/field.css +1 -1
- package/dist/hydrateless.css +457 -303
- package/dist/hydrateless.min.css +1 -1
- package/dist/input.css +1 -1
- package/dist/kbd.css +1 -1
- package/dist/menu.css +1 -1
- package/dist/modal.css +17 -19
- package/dist/pagination.css +1 -1
- package/dist/popover.css +40 -9
- package/dist/progress.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/segmented.css +1 -1
- package/dist/select.css +1 -1
- package/dist/separator.css +1 -1
- package/dist/skeleton.css +1 -1
- package/dist/skip-link.css +7 -10
- package/dist/slider.css +1 -1
- package/dist/spinner.css +1 -1
- package/dist/switch.css +20 -6
- package/dist/table.css +1 -1
- package/dist/tabs.css +96 -17
- package/dist/textarea.css +1 -1
- package/dist/toast.css +32 -25
- package/dist/toc.css +12 -12
- package/dist/tokens.css +2 -15
- package/dist/tooltip.css +40 -12
- package/package.json +2 -2
package/dist/tabs.css
CHANGED
|
@@ -1,48 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tabs. Two markups are supported and styled together:
|
|
3
|
+
*
|
|
4
|
+
* - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
|
|
5
|
+
* radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
|
|
6
|
+
* switches panels with no JavaScript (up to 8 tabs).
|
|
7
|
+
* - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
|
|
8
|
+
* `aria-selected`, toggles `[hidden]` on panels, and marks the root
|
|
9
|
+
* `data-hl-ready`, at which point the no-JS rules below stand down.
|
|
10
|
+
*/
|
|
1
11
|
@layer components {
|
|
2
12
|
[data-hl-tabs] {
|
|
3
|
-
border:
|
|
4
|
-
border-radius:
|
|
5
|
-
border-radius: var(--hl-radius-3, 0.5rem);
|
|
13
|
+
border: var(--hl-border-width) solid var(--hl-border);
|
|
14
|
+
border-radius: var(--hl-radius-lg);
|
|
6
15
|
}
|
|
7
16
|
|
|
17
|
+
.hl-tablist,
|
|
8
18
|
[data-hl-tabs] [role='tablist'] {
|
|
9
19
|
display: flex;
|
|
10
|
-
gap:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
padding: var(--hl-spacing-2, 0.5rem);
|
|
14
|
-
border-bottom: 1px solid color-mix(in oklab, var(--hl-color-fg) 12%, transparent);
|
|
20
|
+
gap: var(--hl-space-2);
|
|
21
|
+
padding: var(--hl-space-2);
|
|
22
|
+
border-bottom: var(--hl-border-width) solid var(--hl-border);
|
|
15
23
|
}
|
|
16
24
|
|
|
25
|
+
.hl-tab,
|
|
17
26
|
[data-hl-tabs] [role='tab'] {
|
|
27
|
+
position: relative;
|
|
18
28
|
-webkit-appearance: none;
|
|
19
29
|
-moz-appearance: none;
|
|
20
30
|
appearance: none;
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
21
33
|
background: transparent;
|
|
22
34
|
border: 0;
|
|
23
|
-
border-radius:
|
|
24
|
-
|
|
25
|
-
padding: 0.5rem 0.75rem;
|
|
26
|
-
padding: var(--hl-spacing-2, 0.5rem) var(--hl-spacing-3, 0.75rem);
|
|
35
|
+
border-radius: var(--hl-radius-sm);
|
|
36
|
+
padding: var(--hl-space-2) var(--hl-space-3);
|
|
27
37
|
color: inherit;
|
|
38
|
+
font: inherit;
|
|
39
|
+
cursor: pointer;
|
|
28
40
|
}
|
|
29
41
|
|
|
42
|
+
/* The baseline keeps selection in a visually hidden radio per tab label. */
|
|
43
|
+
.hl-tab > input[type='radio'] {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
margin: 0;
|
|
50
|
+
opacity: 0;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.hl-tab:has(input:checked),
|
|
30
55
|
[data-hl-tabs] [role='tab'][aria-selected='true'] {
|
|
31
|
-
background: var(--hl-
|
|
56
|
+
background: var(--hl-surface-2);
|
|
32
57
|
}
|
|
33
58
|
|
|
59
|
+
.hl-tab:has(input:focus-visible),
|
|
34
60
|
[data-hl-tabs] [role='tab']:focus-visible {
|
|
35
|
-
outline:
|
|
36
|
-
outline: var(--hl-focus-ring, 2px solid #1f6feb);
|
|
61
|
+
outline: var(--hl-focus-ring);
|
|
37
62
|
outline-offset: 2px;
|
|
38
63
|
}
|
|
39
64
|
|
|
65
|
+
.hl-tab:has(input:disabled),
|
|
66
|
+
[data-hl-tabs] [role='tab'][disabled],
|
|
67
|
+
[data-hl-tabs] [role='tab'][aria-disabled='true'] {
|
|
68
|
+
opacity: 0.5;
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hl-tabpanel,
|
|
40
73
|
[data-hl-tabs] [role='tabpanel'] {
|
|
41
|
-
padding:
|
|
42
|
-
padding: var(--hl-spacing-4, 1rem);
|
|
74
|
+
padding: var(--hl-space-4);
|
|
43
75
|
}
|
|
44
76
|
|
|
77
|
+
.hl-tabpanel[hidden],
|
|
45
78
|
[role='tabpanel'][hidden] {
|
|
46
79
|
display: none;
|
|
47
80
|
}
|
|
81
|
+
|
|
82
|
+
/* No-JS baseline: reveal the panel whose tab radio is checked, by position.
|
|
83
|
+
These stand down once the enhancer sets data-hl-ready and owns [hidden]. */
|
|
84
|
+
[data-hl-tabs]:not([data-hl-ready]) .hl-tabpanels > .hl-tabpanel {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
89
|
+
.hl-tablist:has(.hl-tab:nth-of-type(1) input:checked)
|
|
90
|
+
~ .hl-tabpanels
|
|
91
|
+
> .hl-tabpanel:nth-of-type(1),
|
|
92
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
93
|
+
.hl-tablist:has(.hl-tab:nth-of-type(2) input:checked)
|
|
94
|
+
~ .hl-tabpanels
|
|
95
|
+
> .hl-tabpanel:nth-of-type(2),
|
|
96
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
97
|
+
.hl-tablist:has(.hl-tab:nth-of-type(3) input:checked)
|
|
98
|
+
~ .hl-tabpanels
|
|
99
|
+
> .hl-tabpanel:nth-of-type(3),
|
|
100
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
101
|
+
.hl-tablist:has(.hl-tab:nth-of-type(4) input:checked)
|
|
102
|
+
~ .hl-tabpanels
|
|
103
|
+
> .hl-tabpanel:nth-of-type(4),
|
|
104
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
105
|
+
.hl-tablist:has(.hl-tab:nth-of-type(5) input:checked)
|
|
106
|
+
~ .hl-tabpanels
|
|
107
|
+
> .hl-tabpanel:nth-of-type(5),
|
|
108
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
109
|
+
.hl-tablist:has(.hl-tab:nth-of-type(6) input:checked)
|
|
110
|
+
~ .hl-tabpanels
|
|
111
|
+
> .hl-tabpanel:nth-of-type(6),
|
|
112
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
113
|
+
.hl-tablist:has(.hl-tab:nth-of-type(7) input:checked)
|
|
114
|
+
~ .hl-tabpanels
|
|
115
|
+
> .hl-tabpanel:nth-of-type(7),
|
|
116
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
117
|
+
.hl-tablist:has(.hl-tab:nth-of-type(8) input:checked)
|
|
118
|
+
~ .hl-tabpanels
|
|
119
|
+
> .hl-tabpanel:nth-of-type(8) {
|
|
120
|
+
display: block;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Role-only markup (no radios) before JS: degrade to showing the first panel. */
|
|
124
|
+
[data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
48
127
|
}
|
package/dist/textarea.css
CHANGED
package/dist/toast.css
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
[data-hl-toast-region] {
|
|
3
3
|
position: fixed;
|
|
4
|
-
z-index:
|
|
5
|
-
bottom:
|
|
6
|
-
|
|
7
|
-
right: 1rem;
|
|
8
|
-
right: var(--hl-spacing-4, 1rem);
|
|
4
|
+
z-index: var(--hl-z-toast);
|
|
5
|
+
bottom: var(--hl-space-4);
|
|
6
|
+
right: var(--hl-space-4);
|
|
9
7
|
display: flex;
|
|
10
8
|
flex-direction: column-reverse;
|
|
11
|
-
gap:
|
|
12
|
-
gap: var(--hl-spacing-2, 0.5rem);
|
|
9
|
+
gap: var(--hl-space-2);
|
|
13
10
|
pointer-events: none;
|
|
14
11
|
max-width: min(90vw, 24rem);
|
|
15
12
|
}
|
|
@@ -18,16 +15,29 @@
|
|
|
18
15
|
pointer-events: auto;
|
|
19
16
|
display: flex;
|
|
20
17
|
align-items: flex-start;
|
|
21
|
-
gap:
|
|
22
|
-
|
|
23
|
-
border:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
gap: var(--hl-space-3);
|
|
19
|
+
border: 1px solid var(--hl-border);
|
|
20
|
+
border-radius: var(--hl-radius-lg);
|
|
21
|
+
padding: var(--hl-space-3) var(--hl-space-4);
|
|
22
|
+
background: var(--hl-surface);
|
|
23
|
+
box-shadow: var(--hl-overlay-shadow);
|
|
24
|
+
animation: hl-toast-in var(--hl-duration-base) var(--hl-ease-standard);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[data-hl-toast][data-hl-variant='success'] {
|
|
28
|
+
border-left: 3px solid var(--hl-success);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-hl-toast][data-hl-variant='warning'] {
|
|
32
|
+
border-left: 3px solid var(--hl-warning);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-hl-toast][data-hl-variant='danger'] {
|
|
36
|
+
border-left: 3px solid var(--hl-danger);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-hl-toast][data-hl-variant='info'] {
|
|
40
|
+
border-left: 3px solid var(--hl-info);
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
[data-hl-toast-close] {
|
|
@@ -37,24 +47,21 @@
|
|
|
37
47
|
border: none;
|
|
38
48
|
background: transparent;
|
|
39
49
|
cursor: pointer;
|
|
40
|
-
padding:
|
|
41
|
-
|
|
42
|
-
color: color-mix(in oklab, var(--hl-color-fg) 50%, transparent);
|
|
50
|
+
padding: var(--hl-space-1);
|
|
51
|
+
color: var(--hl-fg-muted);
|
|
43
52
|
margin-left: auto;
|
|
44
53
|
flex-shrink: 0;
|
|
45
54
|
font: inherit;
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
[data-hl-toast-close]:hover {
|
|
49
|
-
color: var(--hl-
|
|
58
|
+
color: var(--hl-fg);
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
[data-hl-toast-close]:focus-visible {
|
|
53
|
-
outline:
|
|
54
|
-
outline: var(--hl-focus-ring, 2px solid #1f6feb);
|
|
62
|
+
outline: var(--hl-focus-ring);
|
|
55
63
|
outline-offset: 2px;
|
|
56
|
-
border-radius:
|
|
57
|
-
border-radius: var(--hl-radius-2, 0.25rem);
|
|
64
|
+
border-radius: var(--hl-radius-sm);
|
|
58
65
|
}
|
|
59
66
|
|
|
60
67
|
@keyframes hl-toast-in {
|
package/dist/toc.css
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
nav[data-hl-toc] {
|
|
3
|
-
border: 1px solid
|
|
4
|
-
border-radius:
|
|
5
|
-
|
|
6
|
-
padding: 0.75rem;
|
|
7
|
-
padding: var(--hl-spacing-3, 0.75rem);
|
|
3
|
+
border: 1px solid var(--hl-border);
|
|
4
|
+
border-radius: var(--hl-radius-lg);
|
|
5
|
+
padding: var(--hl-space-3);
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
nav[data-hl-toc] ul {
|
|
@@ -20,21 +18,23 @@
|
|
|
20
18
|
|
|
21
19
|
nav[data-hl-toc] a {
|
|
22
20
|
display: block;
|
|
23
|
-
padding:
|
|
24
|
-
|
|
25
|
-
border-radius: 0.25rem;
|
|
26
|
-
border-radius: var(--hl-radius-2, 0.25rem);
|
|
21
|
+
padding: var(--hl-space-1) var(--hl-space-2);
|
|
22
|
+
border-radius: var(--hl-radius-sm);
|
|
27
23
|
color: inherit;
|
|
28
24
|
-webkit-text-decoration: none;
|
|
29
25
|
text-decoration: none;
|
|
30
26
|
}
|
|
31
27
|
|
|
28
|
+
nav[data-hl-toc] a:focus-visible {
|
|
29
|
+
outline: var(--hl-focus-ring);
|
|
30
|
+
outline-offset: -2px;
|
|
31
|
+
}
|
|
32
|
+
|
|
32
33
|
nav[data-hl-toc] a[aria-current='true'] {
|
|
33
|
-
background: var(--hl-
|
|
34
|
+
background: var(--hl-surface-2);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
nav[data-hl-toc] ul ul {
|
|
37
|
-
padding-left:
|
|
38
|
-
padding-left: var(--hl-spacing-3, 0.75rem);
|
|
38
|
+
padding-left: var(--hl-space-3);
|
|
39
39
|
}
|
|
40
40
|
}
|
package/dist/tokens.css
CHANGED
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
--hl-font-semibold: 600;
|
|
144
144
|
--hl-font-bold: 700;
|
|
145
145
|
|
|
146
|
-
/* Elevation (shadows)
|
|
146
|
+
/* Elevation (shadows), tuned for light surfaces */
|
|
147
147
|
--hl-shadow-xs: 0 1px 2px 0 hsla(222, 47%, 11%, 0.05);
|
|
148
148
|
--hl-shadow-sm: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
|
|
149
149
|
--hl-shadow-md:
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
/**
|
|
188
188
|
* Semantic tokens map the raw palette to roles (surface, text, border, intent
|
|
189
189
|
* colors). Components reference only these, so theming and dark mode are a
|
|
190
|
-
* matter of remapping a couple dozen variables
|
|
190
|
+
* matter of remapping a couple dozen variables, never touching component CSS.
|
|
191
191
|
*
|
|
192
192
|
* Light is the default in `:root`. Dark applies automatically via
|
|
193
193
|
* `prefers-color-scheme` (unless `[data-theme="light"]` opts out) and always
|
|
@@ -235,19 +235,6 @@
|
|
|
235
235
|
--hl-scrim: hsla(222, 47%, 11%, 0.5);
|
|
236
236
|
--hl-overlay: var(--hl-surface);
|
|
237
237
|
--hl-overlay-shadow: var(--hl-shadow-lg);
|
|
238
|
-
|
|
239
|
-
/* Component-facing aliases — a single mapping onto the tokens above so every
|
|
240
|
-
component (old and new) themes and dark-modes from one source of truth. */
|
|
241
|
-
--hl-color-bg: var(--hl-surface);
|
|
242
|
-
--hl-color-fg: var(--hl-fg);
|
|
243
|
-
--hl-color-muted: var(--hl-surface-2);
|
|
244
|
-
--hl-color-accent: var(--hl-primary);
|
|
245
|
-
--hl-radius-2: var(--hl-radius-sm);
|
|
246
|
-
--hl-radius-3: var(--hl-radius-lg);
|
|
247
|
-
--hl-spacing-1: var(--hl-space-1);
|
|
248
|
-
--hl-spacing-2: var(--hl-space-2);
|
|
249
|
-
--hl-spacing-3: var(--hl-space-3);
|
|
250
|
-
--hl-spacing-4: var(--hl-space-4);
|
|
251
238
|
}
|
|
252
239
|
|
|
253
240
|
/* Dark theme values, shared by auto + manual dark. */
|
package/dist/tooltip.css
CHANGED
|
@@ -1,21 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
|
|
3
|
+
* trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
|
|
4
|
+
* (the tip must be the trigger's next sibling). When the enhancer runs it marks
|
|
5
|
+
* the trigger `data-hl-tooltip-managed` and drives visibility through
|
|
6
|
+
* `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
|
|
7
|
+
* Escape-to-dismiss.
|
|
8
|
+
*/
|
|
1
9
|
@layer components {
|
|
2
10
|
[role='tooltip'] {
|
|
11
|
+
/* Fallback placement: the JS positioner writes inline position/inset on
|
|
12
|
+
engines without CSS anchor positioning. */
|
|
3
13
|
position: absolute;
|
|
4
|
-
z-index:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
color: var(--hl-color-bg);
|
|
15
|
-
font-size: 0.875rem;
|
|
14
|
+
z-index: var(--hl-z-tooltip);
|
|
15
|
+
width: -moz-max-content;
|
|
16
|
+
width: max-content;
|
|
17
|
+
max-width: 32ch;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: var(--hl-space-1) var(--hl-space-2);
|
|
20
|
+
border-radius: var(--hl-radius-sm);
|
|
21
|
+
background: var(--hl-fg);
|
|
22
|
+
color: var(--hl-surface);
|
|
23
|
+
font-size: var(--hl-text-sm);
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
[role='tooltip'][hidden] {
|
|
19
27
|
display: none;
|
|
20
28
|
}
|
|
29
|
+
|
|
30
|
+
/* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
|
|
31
|
+
Suppressed once the enhancer takes over (trigger gains -managed). */
|
|
32
|
+
[data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
|
|
33
|
+
[data-hl-tooltip]:not([data-hl-tooltip-managed]):focus-visible + [role='tooltip'] {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Modern placement: pin above the trigger via the anchor-name the enhancer
|
|
38
|
+
sets, flipping below when there's no room. */
|
|
39
|
+
@supports (anchor-name: --x) {
|
|
40
|
+
[role='tooltip'] {
|
|
41
|
+
position: fixed;
|
|
42
|
+
inset-area: block-start;
|
|
43
|
+
position-area: block-start;
|
|
44
|
+
position-try-fallbacks: flip-block;
|
|
45
|
+
margin-top: var(--hl-space-1);
|
|
46
|
+
margin-bottom: var(--hl-space-1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
21
49
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hydrateless",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Accessible, themeable UI primitives
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Accessible, themeable UI primitives: semantic HTML and modern CSS first, optional JS enhancers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|