hydrateless 0.3.0 → 0.5.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.
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Segmented control — `<div class="hl-segmented" role="radiogroup">` of
3
+ * `<label class="hl-segmented-item"><input type="radio">…</label>` segments.
4
+ * Radio inputs give free keyboard navigation; the checked segment is raised.
5
+ * A button variant using `aria-pressed="true"` is also supported.
6
+ * data-hl-size: sm | md (default) | lg
7
+ */
8
+ @layer components {
9
+ .hl-segmented {
10
+ display: inline-flex;
11
+ align-items: stretch;
12
+ gap: var(--hl-space-1);
13
+ padding: var(--hl-space-1);
14
+ background: var(--hl-surface-2);
15
+ border: var(--hl-border-width) solid var(--hl-border);
16
+ border-radius: var(--hl-radius-lg);
17
+ }
18
+
19
+ .hl-segmented-item {
20
+ position: relative;
21
+ display: inline-flex;
22
+ align-items: center;
23
+ justify-content: center;
24
+ gap: var(--hl-space-2);
25
+ padding: var(--hl-space-1) var(--hl-space-3);
26
+ border: 0;
27
+ border-radius: var(--hl-radius-md);
28
+ background: transparent;
29
+ color: var(--hl-fg-muted);
30
+ font: inherit;
31
+ font-size: var(--hl-text-sm);
32
+ font-weight: var(--hl-font-medium);
33
+ white-space: nowrap;
34
+ cursor: pointer;
35
+ -webkit-user-select: none;
36
+ -moz-user-select: none;
37
+ user-select: none;
38
+ transition:
39
+ background-color var(--hl-duration-fast) var(--hl-ease-standard), color var(--hl-duration-fast) var(--hl-ease-standard);
40
+ }
41
+
42
+ .hl-segmented-item > input {
43
+ position: absolute;
44
+ top: 0;
45
+ right: 0;
46
+ bottom: 0;
47
+ left: 0;
48
+ margin: 0;
49
+ opacity: 0;
50
+ cursor: pointer;
51
+ }
52
+
53
+ .hl-segmented-item:hover {
54
+ color: var(--hl-fg);
55
+ }
56
+
57
+ .hl-segmented-item:has(input:checked),
58
+ .hl-segmented-item[aria-pressed='true'] {
59
+ background: var(--hl-surface);
60
+ color: var(--hl-fg);
61
+ box-shadow: var(--hl-shadow-sm);
62
+ }
63
+
64
+ .hl-segmented-item:has(input:focus-visible),
65
+ .hl-segmented-item[aria-pressed]:focus-visible {
66
+ outline: var(--hl-focus-ring);
67
+ outline-offset: 2px;
68
+ }
69
+
70
+ .hl-segmented-item:has(input:disabled),
71
+ .hl-segmented-item:disabled {
72
+ opacity: 0.5;
73
+ cursor: not-allowed;
74
+ }
75
+
76
+ .hl-segmented[data-hl-size='sm'] .hl-segmented-item {
77
+ padding: 0.125rem var(--hl-space-2);
78
+ font-size: var(--hl-text-xs);
79
+ }
80
+
81
+ .hl-segmented[data-hl-size='lg'] .hl-segmented-item {
82
+ padding: var(--hl-space-2) var(--hl-space-4);
83
+ font-size: var(--hl-text-base);
84
+ }
85
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Native select — `<span class="hl-select-wrapper"><select class="hl-select">`.
3
+ * The wrapper draws a custom caret while the native control keeps full
4
+ * keyboard/mobile behavior.
5
+ * data-hl-size: sm | md (default) | lg
6
+ * data-hl-invalid: error styling (pair with aria-invalid)
7
+ */
8
+ @layer components {
9
+ .hl-select-wrapper {
10
+ position: relative;
11
+ display: inline-flex;
12
+ width: 100%;
13
+ }
14
+
15
+ .hl-select-wrapper::after {
16
+ content: '';
17
+ position: absolute;
18
+ top: 50%;
19
+ right: var(--hl-space-3);
20
+ width: 0.5rem;
21
+ height: 0.5rem;
22
+ border-right: 2px solid var(--hl-fg-muted);
23
+ border-bottom: 2px solid var(--hl-fg-muted);
24
+ transform: translateY(-65%) rotate(45deg);
25
+ pointer-events: none;
26
+ }
27
+
28
+ .hl-select {
29
+ --_height: var(--hl-control-height-md);
30
+ --_font: var(--hl-text-sm);
31
+
32
+ -webkit-appearance: none;
33
+
34
+ -moz-appearance: none;
35
+
36
+ appearance: none;
37
+ width: 100%;
38
+ height: var(--_height);
39
+ padding-left: var(--hl-space-3);
40
+ padding-right: var(--hl-space-8);
41
+ border: var(--hl-border-width) solid var(--hl-border-strong);
42
+ border-radius: var(--hl-radius-md);
43
+ background: var(--hl-surface);
44
+ color: var(--hl-fg);
45
+ font-family: inherit;
46
+ font-size: var(--_font);
47
+ line-height: var(--hl-leading-normal);
48
+ cursor: pointer;
49
+ transition:
50
+ border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
51
+ }
52
+
53
+ .hl-select:hover:not(:disabled):not(:focus) {
54
+ border-color: var(--hl-fg-subtle);
55
+ }
56
+
57
+ .hl-select:focus-visible {
58
+ outline: none;
59
+ border-color: var(--hl-ring);
60
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
61
+ }
62
+
63
+ .hl-select:disabled {
64
+ cursor: not-allowed;
65
+ opacity: 0.6;
66
+ background: var(--hl-surface-2);
67
+ }
68
+
69
+ .hl-select[data-hl-invalid],
70
+ .hl-select[aria-invalid='true'] {
71
+ border-color: var(--hl-danger);
72
+ }
73
+
74
+ .hl-select[data-hl-size='sm'] {
75
+ --_height: var(--hl-control-height-sm);
76
+ --_font: var(--hl-text-xs);
77
+
78
+ border-radius: var(--hl-radius-sm);
79
+ }
80
+
81
+ .hl-select[data-hl-size='lg'] {
82
+ --_height: var(--hl-control-height-lg);
83
+ --_font: var(--hl-text-base);
84
+ }
85
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Separator — `<hr class="hl-separator">` or
3
+ * `<div class="hl-separator" role="separator" aria-orientation="vertical">`.
4
+ */
5
+ @layer components {
6
+ .hl-separator {
7
+ flex: none;
8
+ border: 0;
9
+ background: var(--hl-border);
10
+ }
11
+
12
+ .hl-separator:not([aria-orientation='vertical']):not([data-hl-orientation='vertical']) {
13
+ width: 100%;
14
+ height: var(--hl-border-width);
15
+ margin-top: var(--hl-space-4);
16
+ margin-bottom: var(--hl-space-4);
17
+ }
18
+
19
+ .hl-separator[aria-orientation='vertical'],
20
+ .hl-separator[data-hl-orientation='vertical'] {
21
+ align-self: stretch;
22
+ width: var(--hl-border-width);
23
+ min-height: 1rem;
24
+ margin-left: var(--hl-space-4);
25
+ margin-right: var(--hl-space-4);
26
+ }
27
+ }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Skeleton — `<span class="hl-skeleton" data-hl-variant="…" aria-hidden="true">`
3
+ * placeholder shown while content loads.
4
+ * data-hl-variant: rect (default) | text | circle
5
+ */
6
+ @layer components {
7
+ .hl-skeleton {
8
+ display: block;
9
+ width: 100%;
10
+ height: 1rem;
11
+ border-radius: var(--hl-radius-md);
12
+ background: linear-gradient(
13
+ 90deg,
14
+ var(--hl-surface-3) 25%,
15
+ var(--hl-surface-2) 37%,
16
+ var(--hl-surface-3) 63%
17
+ );
18
+ background-size: 400% 100%;
19
+ animation: hl-skeleton-shimmer 1.4s var(--hl-ease-standard) infinite;
20
+ }
21
+
22
+ .hl-skeleton[data-hl-variant='text'] {
23
+ height: 0.7em;
24
+ border-radius: var(--hl-radius-sm);
25
+ }
26
+
27
+ .hl-skeleton[data-hl-variant='circle'] {
28
+ width: 2.5rem;
29
+ height: 2.5rem;
30
+ border-radius: var(--hl-radius-full);
31
+ }
32
+
33
+ @keyframes hl-skeleton-shimmer {
34
+ 0% {
35
+ background-position: 100% 0;
36
+ }
37
+
38
+ 100% {
39
+ background-position: 0 0;
40
+ }
41
+ }
42
+
43
+ @media (prefers-reduced-motion: reduce) {
44
+ .hl-skeleton {
45
+ animation: none;
46
+ background: var(--hl-surface-3);
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Slider — native `<input type="range" class="hl-slider">`. Restyled track and
3
+ * thumb across WebKit/Blink and Firefox while keeping native keyboard support.
4
+ */
5
+ @layer components {
6
+ .hl-slider {
7
+ --_track: 0.375rem;
8
+ --_thumb: 1.15rem;
9
+
10
+ -webkit-appearance: none;
11
+
12
+ -moz-appearance: none;
13
+
14
+ appearance: none;
15
+ width: 100%;
16
+ height: 1.15rem;
17
+ height: var(--_thumb);
18
+ margin: 0;
19
+ background: transparent;
20
+ cursor: pointer;
21
+ }
22
+
23
+ .hl-slider::-webkit-slider-runnable-track {
24
+ height: var(--_track);
25
+ border-radius: var(--hl-radius-full);
26
+ background: var(--hl-surface-3);
27
+ }
28
+
29
+ .hl-slider::-moz-range-track {
30
+ height: var(--_track);
31
+ border-radius: var(--hl-radius-full);
32
+ background: var(--hl-surface-3);
33
+ }
34
+
35
+ .hl-slider::-moz-range-progress {
36
+ height: var(--_track);
37
+ border-radius: var(--hl-radius-full);
38
+ background: var(--hl-primary);
39
+ }
40
+
41
+ .hl-slider::-webkit-slider-thumb {
42
+ -webkit-appearance: none;
43
+ appearance: none;
44
+ width: var(--_thumb);
45
+ height: var(--_thumb);
46
+ margin-top: calc((var(--_track) - var(--_thumb)) / 2);
47
+ border: 2px solid var(--hl-surface);
48
+ border-radius: var(--hl-radius-full);
49
+ background: var(--hl-primary);
50
+ box-shadow: var(--hl-shadow-sm);
51
+ -webkit-transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
52
+ transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
53
+ }
54
+
55
+ .hl-slider::-moz-range-thumb {
56
+ width: var(--_thumb);
57
+ height: var(--_thumb);
58
+ border: 2px solid var(--hl-surface);
59
+ border-radius: var(--hl-radius-full);
60
+ background: var(--hl-primary);
61
+ box-shadow: var(--hl-shadow-sm);
62
+ }
63
+
64
+ .hl-slider:active::-webkit-slider-thumb {
65
+ transform: scale(1.1);
66
+ }
67
+
68
+ .hl-slider:focus-visible {
69
+ outline: none;
70
+ }
71
+
72
+ .hl-slider:focus-visible::-webkit-slider-thumb {
73
+ box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
74
+ }
75
+
76
+ .hl-slider:focus-visible::-moz-range-thumb {
77
+ box-shadow: 0 0 0 4px color-mix(in oklab, var(--hl-ring) 35%, transparent);
78
+ }
79
+
80
+ .hl-slider:disabled {
81
+ cursor: not-allowed;
82
+ opacity: 0.6;
83
+ }
84
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Spinner — `<span class="hl-spinner" role="status" aria-label="Loading">`.
3
+ * Inherits `currentColor`, so set `color` to theme it.
4
+ * data-hl-size: sm | md (default) | lg | xl
5
+ */
6
+ @layer components {
7
+ .hl-spinner {
8
+ --_size: 1.25rem;
9
+ --_width: 2px;
10
+
11
+ display: inline-block;
12
+ flex: none;
13
+ width: 1.25rem;
14
+ width: var(--_size);
15
+ height: 1.25rem;
16
+ height: var(--_size);
17
+ border: 2px solid color-mix(in oklab, currentcolor 25%, transparent);
18
+ border-top-color: currentcolor;
19
+ border-radius: var(--hl-radius-full);
20
+ animation: hl-spinner-rotate 0.6s linear infinite;
21
+ }
22
+
23
+ @supports (color: color-mix(in lch, red, blue)) {
24
+ .hl-spinner {
25
+ border: var(--_width) solid color-mix(in oklab, currentcolor 25%, transparent);
26
+ }
27
+ }
28
+
29
+ .hl-spinner[data-hl-size='sm'] {
30
+ --_size: 1rem;
31
+ }
32
+
33
+ .hl-spinner[data-hl-size='lg'] {
34
+ --_size: 1.75rem;
35
+ --_width: 3px;
36
+ }
37
+
38
+ .hl-spinner[data-hl-size='xl'] {
39
+ --_size: 2.5rem;
40
+ --_width: 3px;
41
+ }
42
+
43
+ @keyframes hl-spinner-rotate {
44
+ to {
45
+ transform: rotate(1turn);
46
+ }
47
+ }
48
+
49
+ @media (prefers-reduced-motion: reduce) {
50
+ .hl-spinner {
51
+ animation-duration: 1.4s;
52
+ }
53
+ }
54
+ }
package/dist/table.css ADDED
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Table — `<table class="hl-table">`. Semantic table styling with optional
3
+ * zebra striping and hover.
4
+ * data-hl-striped: zebra rows
5
+ * data-hl-hover: highlight row on hover
6
+ */
7
+ @layer components {
8
+ .hl-table {
9
+ width: 100%;
10
+ border-collapse: collapse;
11
+ font-size: var(--hl-text-sm);
12
+ color: var(--hl-fg);
13
+ }
14
+
15
+ .hl-table caption {
16
+ padding-top: var(--hl-space-2);
17
+ padding-bottom: var(--hl-space-2);
18
+ color: var(--hl-fg-muted);
19
+ text-align: left;
20
+ caption-side: bottom;
21
+ }
22
+
23
+ .hl-table th,
24
+ .hl-table td {
25
+ padding: var(--hl-space-2) var(--hl-space-3);
26
+ text-align: left;
27
+ vertical-align: middle;
28
+ border-bottom: var(--hl-border-width) solid var(--hl-border);
29
+ }
30
+
31
+ .hl-table thead th {
32
+ font-size: var(--hl-text-xs);
33
+ font-weight: var(--hl-font-semibold);
34
+ text-transform: uppercase;
35
+ letter-spacing: 0.03em;
36
+ color: var(--hl-fg-muted);
37
+ border-bottom-color: var(--hl-border-strong);
38
+ }
39
+
40
+ .hl-table tfoot td {
41
+ font-weight: var(--hl-font-medium);
42
+ color: var(--hl-fg-muted);
43
+ }
44
+
45
+ .hl-table[data-hl-striped] tbody tr:nth-child(even) {
46
+ background: var(--hl-surface-2);
47
+ }
48
+
49
+ .hl-table[data-hl-hover] tbody tr:hover {
50
+ background: color-mix(in oklab, var(--hl-primary) 8%, transparent);
51
+ }
52
+
53
+ .hl-table td[data-hl-align='end'],
54
+ .hl-table th[data-hl-align='end'] {
55
+ text-align: right;
56
+ }
57
+
58
+ .hl-table td[data-hl-align='center'],
59
+ .hl-table th[data-hl-align='center'] {
60
+ text-align: center;
61
+ }
62
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Multi-line text input — `<textarea class="hl-textarea">`.
3
+ * data-hl-invalid: error styling (pair with aria-invalid)
4
+ */
5
+ @layer components {
6
+ .hl-textarea {
7
+ display: block;
8
+ width: 100%;
9
+ min-height: calc(var(--hl-control-height-md) * 2);
10
+ padding: var(--hl-space-2) var(--hl-space-3);
11
+ border: var(--hl-border-width) solid var(--hl-border-strong);
12
+ border-radius: var(--hl-radius-md);
13
+ background: var(--hl-surface);
14
+ color: var(--hl-fg);
15
+ font-family: inherit;
16
+ font-size: var(--hl-text-sm);
17
+ line-height: var(--hl-leading-normal);
18
+ resize: vertical;
19
+ transition:
20
+ border-color var(--hl-duration-fast) var(--hl-ease-standard), box-shadow var(--hl-duration-fast) var(--hl-ease-standard);
21
+ }
22
+
23
+ .hl-textarea::-moz-placeholder {
24
+ color: var(--hl-fg-subtle);
25
+ }
26
+
27
+ .hl-textarea::placeholder {
28
+ color: var(--hl-fg-subtle);
29
+ }
30
+
31
+ .hl-textarea:hover:not(:disabled):not(:focus) {
32
+ border-color: var(--hl-fg-subtle);
33
+ }
34
+
35
+ .hl-textarea:focus-visible {
36
+ outline: none;
37
+ border-color: var(--hl-ring);
38
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-ring) 30%, transparent);
39
+ }
40
+
41
+ .hl-textarea:disabled {
42
+ cursor: not-allowed;
43
+ opacity: 0.6;
44
+ background: var(--hl-surface-2);
45
+ }
46
+
47
+ .hl-textarea[data-hl-invalid],
48
+ .hl-textarea[aria-invalid='true'] {
49
+ border-color: var(--hl-danger);
50
+ }
51
+
52
+ .hl-textarea[data-hl-invalid]:focus-visible,
53
+ .hl-textarea[aria-invalid='true']:focus-visible {
54
+ border-color: var(--hl-danger);
55
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--hl-danger) 30%, transparent);
56
+ }
57
+ }
package/dist/theme.css CHANGED
@@ -20,7 +20,19 @@
20
20
  }
21
21
 
22
22
  body {
23
- background-color: var(--hl-color-bg);
24
- color: var(--hl-color-fg);
23
+ background-color: var(--hl-bg);
24
+ color: var(--hl-fg);
25
+ font-family: var(--hl-font-sans);
26
+ font-size: var(--hl-text-base);
27
+ line-height: var(--hl-leading-normal);
28
+ -webkit-font-smoothing: antialiased;
29
+ }
30
+
31
+ ::-moz-selection {
32
+ background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
33
+ }
34
+
35
+ ::selection {
36
+ background-color: color-mix(in oklab, var(--hl-primary) 30%, transparent);
25
37
  }
26
38
  }
package/dist/toast.css CHANGED
@@ -62,6 +62,7 @@
62
62
  opacity: 0;
63
63
  transform: translateY(0.5rem);
64
64
  }
65
+
65
66
  to {
66
67
  opacity: 1;
67
68
  transform: translateY(0);