hlmnhkl-ui 0.16.0 → 0.18.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/package.json +1 -1
- package/src/components/ScrollArea/ScrollArea.module.css +3 -1
- package/src/components/SegmentedControl/SegmentedControl.module.css +1 -1
- package/src/components/Skeleton/Skeleton.module.css +21 -0
- package/src/components/Skeleton/Skeleton.tsx +6 -3
- package/src/components/Slider/Slider.module.css +2 -2
- package/src/components/Table/Table.module.css +2 -1
- package/src/tokens.css +12 -4
package/package.json
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
/* Native scrolling kept; only the bar is custom */
|
|
9
9
|
.viewport {
|
|
10
10
|
overflow: auto;
|
|
11
|
-
|
|
11
|
+
/* Sideways only: a swipe at the edge must not go back a page, and once the area is at its end the
|
|
12
|
+
wheel carries on to the page, as people expect. */
|
|
13
|
+
overscroll-behavior-x: contain;
|
|
12
14
|
scrollbar-width: none;
|
|
13
15
|
border-radius: inherit;
|
|
14
16
|
}
|
|
@@ -26,10 +26,31 @@
|
|
|
26
26
|
.rect { width: 100%; height: var(--hl-skeleton-block); border-radius: var(--hl-radius-md); }
|
|
27
27
|
.circle { width: var(--hl-skeleton-avatar); height: var(--hl-skeleton-avatar); border-radius: var(--hl-radius-full); }
|
|
28
28
|
|
|
29
|
+
/* A sketch: the shapes as dashed pencil outlines, no fill. Text becomes dashed baselines. The lines
|
|
30
|
+
themselves fade gently instead of a shimmer, which would light up the empty box behind them. */
|
|
31
|
+
.sketch {
|
|
32
|
+
background: none;
|
|
33
|
+
border: var(--hl-line) dashed var(--hl-color-border-strong);
|
|
34
|
+
animation: sketching var(--hl-motion-shimmer) var(--hl-ease-in-out) infinite alternate;
|
|
35
|
+
animation-delay: calc(var(--i, 0) * var(--hl-motion-stagger) * 3);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.sketch::after { display: none; }
|
|
39
|
+
|
|
40
|
+
.sketch.text {
|
|
41
|
+
border-width: 0 0 var(--hl-line);
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes sketching {
|
|
46
|
+
from { border-color: var(--hl-color-border); }
|
|
47
|
+
}
|
|
48
|
+
|
|
29
49
|
@keyframes shimmer {
|
|
30
50
|
to { transform: translateX(100%); }
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
@media (prefers-reduced-motion: reduce) {
|
|
34
54
|
.bone::after { animation: none; display: none; }
|
|
55
|
+
.sketch { animation: none; }
|
|
35
56
|
}
|
|
@@ -11,24 +11,27 @@ export type SkeletonProps = {
|
|
|
11
11
|
height?: CSSProperties['height']
|
|
12
12
|
/** For text: number of lines. The last one is shorter, like real text. */
|
|
13
13
|
lines?: number
|
|
14
|
+
/** Solid grey shapes, or a sketch: the same shapes as dashed outlines, like a pencil layout. */
|
|
15
|
+
variant?: 'solid' | 'sketch'
|
|
14
16
|
/** Extra class for the root element. */
|
|
15
17
|
className?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
// Decorative only. Mark the loading container with aria-busy and a label instead.
|
|
19
|
-
export function Skeleton({ shape = 'rect', width, height, lines = 1, className }: SkeletonProps) {
|
|
21
|
+
export function Skeleton({ shape = 'rect', width, height, lines = 1, variant = 'solid', className }: SkeletonProps) {
|
|
22
|
+
const look = variant === 'sketch' && styles.sketch
|
|
20
23
|
if (shape === 'text') {
|
|
21
24
|
return (
|
|
22
25
|
<span className={cx(styles.lines, className)} style={{ width }} aria-hidden="true">
|
|
23
26
|
{Array.from({ length: lines }, (_, i) => (
|
|
24
27
|
<span
|
|
25
28
|
key={i}
|
|
26
|
-
className={cx(styles.bone, styles.text)}
|
|
29
|
+
className={cx(styles.bone, styles.text, look)}
|
|
27
30
|
style={{ width: lines > 1 && i === lines - 1 ? '62%' : '100%', ['--i' as string]: i }}
|
|
28
31
|
/>
|
|
29
32
|
))}
|
|
30
33
|
</span>
|
|
31
34
|
)
|
|
32
35
|
}
|
|
33
|
-
return <span className={cx(styles.bone, styles[shape], className)} style={{ width, height }} aria-hidden="true" />
|
|
36
|
+
return <span className={cx(styles.bone, styles[shape], look, className)} style={{ width, height }} aria-hidden="true" />
|
|
34
37
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
margin-top: calc((var(--hl-track-h) - var(--thumb)) / 2);
|
|
74
74
|
border: var(--hl-line-thick) solid var(--hl-color-accent);
|
|
75
75
|
border-radius: var(--hl-radius-full);
|
|
76
|
-
background: var(--hl-color-surface);
|
|
76
|
+
background: var(--hl-color-surface-raised);
|
|
77
77
|
box-shadow: var(--hl-shadow-2);
|
|
78
78
|
transition:
|
|
79
79
|
transform var(--hl-motion-slow) var(--hl-ease-spring),
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
box-sizing: border-box;
|
|
87
87
|
border: var(--hl-line-thick) solid var(--hl-color-accent);
|
|
88
88
|
border-radius: var(--hl-radius-full);
|
|
89
|
-
background: var(--hl-color-surface);
|
|
89
|
+
background: var(--hl-color-surface-raised);
|
|
90
90
|
box-shadow: var(--hl-shadow-2);
|
|
91
91
|
transition:
|
|
92
92
|
transform var(--hl-motion-slow) var(--hl-ease-spring),
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
.scroll {
|
|
14
14
|
overflow: auto;
|
|
15
|
-
|
|
15
|
+
/* Sideways only: a swipe at the edge must not go back a page, but the wheel still scrolls the page. */
|
|
16
|
+
overscroll-behavior-x: contain;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.scroll:focus-visible { outline: none; box-shadow: inset 0 0 0 var(--hl-line-focus) var(--hl-color-fg); }
|
package/src/tokens.css
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
--hl-color-surface-sunken: var(--hl-gray-100);
|
|
24
24
|
--hl-color-surface-hover: var(--hl-gray-150);
|
|
25
25
|
--hl-color-surface-active: var(--hl-gray-200);
|
|
26
|
+
/* Something that sits on a track, such as a sliding pill or a slider thumb. */
|
|
27
|
+
--hl-color-surface-raised: var(--hl-color-surface);
|
|
26
28
|
--hl-color-overlay: rgb(10 10 10 / 0.32);
|
|
27
29
|
--hl-color-fg: var(--hl-gray-950);
|
|
28
30
|
--hl-color-fg-muted: var(--hl-gray-600);
|
|
@@ -212,6 +214,7 @@
|
|
|
212
214
|
--hl-color-surface-sunken: #121212;
|
|
213
215
|
--hl-color-surface-hover: #262626;
|
|
214
216
|
--hl-color-surface-active: #2e2e2e;
|
|
217
|
+
--hl-color-surface-raised: #2c2c2c;
|
|
215
218
|
--hl-color-overlay: rgb(0 0 0 / 0.6);
|
|
216
219
|
--hl-color-fg: #ececec;
|
|
217
220
|
--hl-color-fg-muted: #ababab;
|
|
@@ -232,8 +235,9 @@
|
|
|
232
235
|
--hl-color-danger-solid: #d63a2e;
|
|
233
236
|
/* Darker on hover: a lighter red drops white text under 4.5:1 */
|
|
234
237
|
--hl-color-danger-solid-hover: #b8302a;
|
|
235
|
-
|
|
236
|
-
--hl-shadow-
|
|
238
|
+
/* Faint: in the dark, height shows as a lighter surface, not a deep shadow. */
|
|
239
|
+
--hl-shadow-1: 0 1px 2px rgb(0 0 0 / 0.2);
|
|
240
|
+
--hl-shadow-2: 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 12px rgb(0 0 0 / 0.15);
|
|
237
241
|
--hl-shadow-3: 0 2px 4px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
|
|
238
242
|
--hl-shadow-4: 0 4px 8px rgb(0 0 0 / 0.4), 0 24px 64px rgb(0 0 0 / 0.6);
|
|
239
243
|
color-scheme: dark;
|
|
@@ -248,6 +252,7 @@
|
|
|
248
252
|
--hl-color-surface-sunken: #121212;
|
|
249
253
|
--hl-color-surface-hover: #262626;
|
|
250
254
|
--hl-color-surface-active: #2e2e2e;
|
|
255
|
+
--hl-color-surface-raised: #2c2c2c;
|
|
251
256
|
--hl-color-overlay: rgb(0 0 0 / 0.6);
|
|
252
257
|
--hl-color-fg: #ececec;
|
|
253
258
|
--hl-color-fg-muted: #ababab;
|
|
@@ -268,8 +273,9 @@
|
|
|
268
273
|
--hl-color-danger-solid: #d63a2e;
|
|
269
274
|
/* Darker on hover: a lighter red drops white text under 4.5:1 */
|
|
270
275
|
--hl-color-danger-solid-hover: #b8302a;
|
|
271
|
-
|
|
272
|
-
--hl-shadow-
|
|
276
|
+
/* Faint: in the dark, height shows as a lighter surface, not a deep shadow. */
|
|
277
|
+
--hl-shadow-1: 0 1px 2px rgb(0 0 0 / 0.2);
|
|
278
|
+
--hl-shadow-2: 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 12px rgb(0 0 0 / 0.15);
|
|
273
279
|
--hl-shadow-3: 0 2px 4px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.5);
|
|
274
280
|
--hl-shadow-4: 0 4px 8px rgb(0 0 0 / 0.4), 0 24px 64px rgb(0 0 0 / 0.6);
|
|
275
281
|
color-scheme: dark;
|
|
@@ -357,6 +363,8 @@
|
|
|
357
363
|
--hl-sparkline-w: 120px;
|
|
358
364
|
--hl-sparkline-h: 32px;
|
|
359
365
|
--hl-tree-indent: 20px;
|
|
366
|
+
/* How long a closed folder waits under a dragged item before it opens. Intent, not motion, so reduced motion keeps it. */
|
|
367
|
+
--hl-tree-open-delay: 800ms;
|
|
360
368
|
--hl-timeline-marker: 12px;
|
|
361
369
|
--hl-table-check: 18px;
|
|
362
370
|
/* A cell's widest, so long text wraps and a sideways-scrolling table stays readable. */
|