@birdycom/omniaui 0.14.0 → 0.14.2
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/bin/lib/add.mjs +7 -1
- package/bin/lib/catalog.mjs +6 -0
- package/bin/lib/copy-js.mjs +2 -0
- package/dist/components.css +540 -24
- package/dist/components.min.css +1 -1
- package/dist/docs-ui.css +12 -1
- package/dist/language-select.d.ts +7 -0
- package/dist/language-select.js +48 -0
- package/dist/oc-theme.css +1 -1
- package/dist/parts/app-page-header.css +1 -1
- package/dist/parts/app-severity-card.css +4 -0
- package/dist/parts/app-status-dot.css +19 -4
- package/dist/parts/app-version-banner.css +18 -1
- package/dist/parts/data-dl-glossary.css +22 -0
- package/dist/parts/data-meter-row.css +7 -0
- package/dist/parts/data-step-list.css +48 -0
- package/dist/parts/forms-language-select.css +62 -0
- package/dist/parts/site-doc-layout.css +39 -0
- package/dist/parts/site-layout.css +15 -1
- package/dist/parts/site-neon.css +17 -3
- package/dist/parts/site-prose.css +4 -1
- package/dist/parts/site-tint-card.css +223 -0
- package/dist/showcase.css +20 -5
- package/dist/toc.d.ts +9 -0
- package/dist/toc.js +96 -0
- package/manifest.json +24 -0
- package/package.json +4 -2
- package/snippets/definition-list.html +2 -0
- package/snippets/doc-layout.html +39 -0
- package/snippets/meter-row.html +2 -1
- package/snippets/page-sections.html +1 -1
- package/snippets/progress.html +1 -1
- package/snippets/status-dot.html +1 -0
- package/snippets/step-list.html +28 -0
- package/snippets/tint-card.html +66 -0
- package/snippets/toc.html +1 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* File: packages/ui/src/parts/site-tint-card.css */
|
|
2
|
+
/* Map: tint card (link, tint, lift) -> head (title + go chip) -> text + meta -> corner art (drift, tilt on hover)
|
|
3
|
+
-> glow -> tones -> large cards -> reduced motion */
|
|
4
|
+
/* Tint card: a card that is a link, tinted in one color (--oc-tint), with a large outline webicon that sticks out of the
|
|
5
|
+
bottom corner. The icon drifts slowly up and down (each card in a grid on its own beat) and tilts and grows on hover;
|
|
6
|
+
a soft glow behind it grows with it. The arrow chip top right fills with the tint and the arrow flies out and back
|
|
7
|
+
in. The card lifts 4px with a shadow in its own tint. For a row of services, training modules or product areas in an
|
|
8
|
+
.oc-card-grid. Colors mix with the card color, so light and dark mode work without extra classes. */
|
|
9
|
+
|
|
10
|
+
.oc-tint-card {
|
|
11
|
+
--oc-tint: var(--oc-primary);
|
|
12
|
+
--oc-tint-foreground: var(--oc-primary-foreground);
|
|
13
|
+
--oc-tint-mix: 9%;
|
|
14
|
+
--oc-tint-mix-hover: 15%;
|
|
15
|
+
position: relative;
|
|
16
|
+
isolation: isolate;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
container-type: inline-size;
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
min-block-size: 9rem;
|
|
22
|
+
padding: 1.5rem;
|
|
23
|
+
border: 1px solid color-mix(in oklab, var(--oc-tint) 14%, transparent);
|
|
24
|
+
border-radius: var(--oc-radius-xl, 1.5rem);
|
|
25
|
+
background: color-mix(in oklab, var(--oc-tint) var(--oc-tint-mix), var(--oc-card, var(--oc-background)));
|
|
26
|
+
color: var(--oc-foreground);
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
transition:
|
|
29
|
+
translate 0.3s var(--oc-ease-out, ease-out),
|
|
30
|
+
box-shadow 0.3s var(--oc-ease-out, ease-out),
|
|
31
|
+
background-color 0.3s var(--oc-ease-out, ease-out);
|
|
32
|
+
}
|
|
33
|
+
@media (min-width: 40rem) {
|
|
34
|
+
.oc-tint-card { min-block-size: 15rem; padding: 1.75rem; }
|
|
35
|
+
}
|
|
36
|
+
.oc-tint-card:is(a, button):hover,
|
|
37
|
+
.oc-tint-card:is(a, button):focus-visible,
|
|
38
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible)) {
|
|
39
|
+
translate: 0 -4px;
|
|
40
|
+
background: color-mix(in oklab, var(--oc-tint) var(--oc-tint-mix-hover), var(--oc-card, var(--oc-background)));
|
|
41
|
+
box-shadow: 0 24px 48px -24px color-mix(in oklab, var(--oc-tint) 45%, transparent);
|
|
42
|
+
}
|
|
43
|
+
.oc-tint-card:focus-visible { outline: 2px solid var(--oc-ring); outline-offset: 2px; }
|
|
44
|
+
/* A card that is not a link itself: the title link covers the whole card. */
|
|
45
|
+
.oc-tint-card__link { color: inherit; text-decoration: none; }
|
|
46
|
+
.oc-tint-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
|
|
47
|
+
.oc-tint-card__link:focus-visible { outline: none; }
|
|
48
|
+
.oc-tint-card__link:focus-visible::after { outline: 2px solid var(--oc-ring); outline-offset: 2px; }
|
|
49
|
+
|
|
50
|
+
/* Head: title on the left, the arrow chip on the right. */
|
|
51
|
+
.oc-tint-card__head {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: flex-start;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
gap: 1rem;
|
|
56
|
+
}
|
|
57
|
+
.oc-tint-card__title {
|
|
58
|
+
margin: 0;
|
|
59
|
+
font-family: var(--oc-font-display, inherit);
|
|
60
|
+
font-size: 1.125rem;
|
|
61
|
+
font-weight: 650;
|
|
62
|
+
line-height: 1.3;
|
|
63
|
+
letter-spacing: -0.01em;
|
|
64
|
+
text-wrap: balance;
|
|
65
|
+
}
|
|
66
|
+
.oc-tint-card__text {
|
|
67
|
+
margin: 0.5rem 0 0;
|
|
68
|
+
max-inline-size: 26ch;
|
|
69
|
+
color: var(--oc-muted-foreground);
|
|
70
|
+
font-size: 0.875rem;
|
|
71
|
+
line-height: 1.6;
|
|
72
|
+
text-wrap: pretty;
|
|
73
|
+
}
|
|
74
|
+
/* Meta line at the bottom (12 modules, New, From € 9): in the tint, pushed down. */
|
|
75
|
+
.oc-tint-card__meta {
|
|
76
|
+
margin-block-start: auto;
|
|
77
|
+
padding-block-start: 1rem;
|
|
78
|
+
color: color-mix(in oklab, var(--oc-tint) 75%, var(--oc-foreground));
|
|
79
|
+
font-size: 0.8rem;
|
|
80
|
+
font-weight: 600;
|
|
81
|
+
}
|
|
82
|
+
@container (min-width: 16rem) {
|
|
83
|
+
.oc-tint-card__title { font-size: 1.25rem; }
|
|
84
|
+
.oc-tint-card__text { font-size: 0.94rem; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Arrow chip: a round chip in the tint; on hover it fills and the arrow flies out top right and back in from below. */
|
|
88
|
+
.oc-tint-card__go {
|
|
89
|
+
display: inline-grid;
|
|
90
|
+
place-items: center;
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
inline-size: 2rem;
|
|
93
|
+
block-size: 2rem;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
border-radius: 999px;
|
|
96
|
+
background: color-mix(in oklab, var(--oc-tint) 16%, transparent);
|
|
97
|
+
color: var(--oc-tint);
|
|
98
|
+
font-size: 1.1rem;
|
|
99
|
+
transition: background-color 0.3s, color 0.3s;
|
|
100
|
+
}
|
|
101
|
+
.oc-tint-card__go > * { display: block; }
|
|
102
|
+
:is(a.oc-tint-card, button.oc-tint-card):is(:hover, :focus-visible) .oc-tint-card__go,
|
|
103
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible)) .oc-tint-card__go {
|
|
104
|
+
background: var(--oc-tint);
|
|
105
|
+
color: var(--oc-tint-foreground);
|
|
106
|
+
}
|
|
107
|
+
:is(a.oc-tint-card, button.oc-tint-card):is(:hover, :focus-visible) .oc-tint-card__go > *,
|
|
108
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible)) .oc-tint-card__go > * {
|
|
109
|
+
animation: oc-tint-go 0.55s var(--oc-ease-out, ease-out);
|
|
110
|
+
}
|
|
111
|
+
@keyframes oc-tint-go {
|
|
112
|
+
0% { translate: 0 0; opacity: 1; }
|
|
113
|
+
45% { translate: 130% -130%; opacity: 0; }
|
|
114
|
+
46% { translate: -130% 130%; opacity: 0; }
|
|
115
|
+
100% { translate: 0 0; opacity: 1; }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Corner art: a large outline webicon (mdi-light or material-symbols ...-outline), half outside the bottom corner.
|
|
119
|
+
It drifts slowly (transform); hover tilts and grows it (rotate, scale), so the two never fight. */
|
|
120
|
+
.oc-tint-card__art {
|
|
121
|
+
position: absolute;
|
|
122
|
+
inset-block-end: -1rem;
|
|
123
|
+
inset-inline-end: -0.75rem;
|
|
124
|
+
z-index: -1;
|
|
125
|
+
display: block;
|
|
126
|
+
color: var(--oc-tint);
|
|
127
|
+
font-size: 6rem;
|
|
128
|
+
line-height: 1;
|
|
129
|
+
opacity: 0.32;
|
|
130
|
+
pointer-events: none;
|
|
131
|
+
transform-origin: 70% 70%;
|
|
132
|
+
will-change: transform;
|
|
133
|
+
animation: oc-tint-drift var(--oc-tint-drift, 6s) ease-in-out var(--oc-tint-delay, 0s) infinite alternate;
|
|
134
|
+
transition:
|
|
135
|
+
rotate 0.5s var(--oc-ease-out, ease-out),
|
|
136
|
+
scale 0.5s var(--oc-ease-out, ease-out),
|
|
137
|
+
opacity 0.5s var(--oc-ease-out, ease-out);
|
|
138
|
+
}
|
|
139
|
+
.oc-tint-card__art > * { display: block; }
|
|
140
|
+
/* transform (not translate) + will-change: the drift runs on the GPU, so it costs no style work per frame. */
|
|
141
|
+
@keyframes oc-tint-drift {
|
|
142
|
+
from { transform: translate3d(0, 0, 0); }
|
|
143
|
+
to { transform: translate3d(-4px, -10px, 0); }
|
|
144
|
+
}
|
|
145
|
+
/* Each card in a row drifts on its own beat. */
|
|
146
|
+
.oc-tint-card:nth-child(5n + 2) { --oc-tint-delay: -1.2s; }
|
|
147
|
+
.oc-tint-card:nth-child(5n + 3) { --oc-tint-delay: -2.4s; }
|
|
148
|
+
.oc-tint-card:nth-child(5n + 4) { --oc-tint-delay: -3.6s; }
|
|
149
|
+
.oc-tint-card:nth-child(5n + 5) { --oc-tint-delay: -4.8s; }
|
|
150
|
+
:is(a.oc-tint-card, button.oc-tint-card):is(:hover, :focus-visible) .oc-tint-card__art,
|
|
151
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible)) .oc-tint-card__art {
|
|
152
|
+
rotate: -8deg;
|
|
153
|
+
scale: 1.12;
|
|
154
|
+
opacity: 0.5;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Glow: a soft spot in the tint behind the icon that grows on hover. */
|
|
158
|
+
.oc-tint-card::after {
|
|
159
|
+
content: "";
|
|
160
|
+
position: absolute;
|
|
161
|
+
inset-block-end: -35%;
|
|
162
|
+
inset-inline-end: -25%;
|
|
163
|
+
z-index: -2;
|
|
164
|
+
inline-size: min(75%, 14rem);
|
|
165
|
+
aspect-ratio: 1;
|
|
166
|
+
border-radius: 50%;
|
|
167
|
+
background: radial-gradient(circle, color-mix(in oklab, var(--oc-tint) 24%, transparent), transparent 68%);
|
|
168
|
+
scale: 0.8;
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
transition: scale 0.6s var(--oc-ease-out, ease-out);
|
|
171
|
+
}
|
|
172
|
+
.oc-tint-card:is(a, button):is(:hover, :focus-visible)::after,
|
|
173
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible))::after { scale: 1.15; }
|
|
174
|
+
|
|
175
|
+
/* On a phone the cards are low and wide: the icon stays small there and only grows from 40rem (in a card of 16rem+). */
|
|
176
|
+
@media (min-width: 40rem) {
|
|
177
|
+
.oc-tint-card__art { inset-block-end: -1.5rem; inset-inline-end: -1.5rem; font-size: 7rem; }
|
|
178
|
+
@container (min-width: 16rem) {
|
|
179
|
+
.oc-tint-card__art { font-size: 9rem; }
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* Tones (or set --oc-tint yourself: style="--oc-tint: #e8590c"). */
|
|
184
|
+
.oc-tint-card--success { --oc-tint: var(--oc-success); --oc-tint-foreground: var(--oc-success-foreground); }
|
|
185
|
+
.oc-tint-card--warning { --oc-tint: var(--oc-warning); --oc-tint-foreground: var(--oc-warning-foreground); }
|
|
186
|
+
.oc-tint-card--destructive { --oc-tint: var(--oc-destructive); --oc-tint-foreground: var(--oc-destructive-foreground); }
|
|
187
|
+
.oc-tint-card--info {
|
|
188
|
+
--oc-tint: var(--oc-info, light-dark(var(--color-deepskyblue-70), var(--color-skyblue-50)));
|
|
189
|
+
--oc-tint-foreground: #fff;
|
|
190
|
+
}
|
|
191
|
+
.oc-tint-card--muted { --oc-tint: var(--oc-muted-foreground); --oc-tint-foreground: var(--oc-background); }
|
|
192
|
+
|
|
193
|
+
/* Large: a card for a row of two or three, with more room and a larger icon. */
|
|
194
|
+
.oc-tint-card--lg { min-block-size: 18rem; }
|
|
195
|
+
@media (min-width: 40rem) {
|
|
196
|
+
.oc-tint-card--lg { padding: 2.25rem; }
|
|
197
|
+
}
|
|
198
|
+
.oc-tint-card--lg .oc-tint-card__title { font-size: 1.5rem; }
|
|
199
|
+
.oc-tint-card--lg .oc-tint-card__text { max-inline-size: 34ch; font-size: 1rem; }
|
|
200
|
+
@media (min-width: 40rem) {
|
|
201
|
+
@container (min-width: 22rem) {
|
|
202
|
+
.oc-tint-card--lg .oc-tint-card__art { font-size: 12rem; }
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* With the fly-in (.oc-reveal--fly + fly.js) the card keeps its own hover transitions next to the fly-in ones. */
|
|
207
|
+
.oc-fly-ready .oc-tint-card.oc-reveal--fly {
|
|
208
|
+
transition:
|
|
209
|
+
opacity 0.6s var(--oc-ease-out, ease) var(--oc-fly-delay, 0s),
|
|
210
|
+
transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--oc-fly-delay, 0s),
|
|
211
|
+
translate 0.3s var(--oc-ease-out, ease-out),
|
|
212
|
+
box-shadow 0.3s var(--oc-ease-out, ease-out),
|
|
213
|
+
background-color 0.3s var(--oc-ease-out, ease-out);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
@media (prefers-reduced-motion: reduce) {
|
|
217
|
+
.oc-tint-card,
|
|
218
|
+
.oc-tint-card__art,
|
|
219
|
+
.oc-tint-card::after { transition: none; animation: none; }
|
|
220
|
+
.oc-tint-card:is(a, button):is(:hover, :focus-visible),
|
|
221
|
+
.oc-tint-card:has(.oc-tint-card__link:is(:hover, :focus-visible)) { translate: none; }
|
|
222
|
+
.oc-tint-card .oc-tint-card__go > * { animation: none !important; }
|
|
223
|
+
}
|
package/dist/showcase.css
CHANGED
|
@@ -308,17 +308,32 @@
|
|
|
308
308
|
--strong starts at the full accent with a wider ring. */
|
|
309
309
|
.oc-pill .oc-status-dot {
|
|
310
310
|
--oc-status-dot-pulse-alpha: 0.6;
|
|
311
|
-
--oc-status-dot-pulse-
|
|
311
|
+
--oc-status-dot-pulse-scale: 3;
|
|
312
|
+
position: relative;
|
|
312
313
|
inline-size: 0.5rem;
|
|
313
314
|
aspect-ratio: 1;
|
|
314
315
|
border-radius: 50%;
|
|
315
316
|
background: var(--oc-accent-from);
|
|
316
|
-
|
|
317
|
+
box-shadow: none;
|
|
317
318
|
}
|
|
318
|
-
|
|
319
|
+
/* The ring is a ::after that scales and fades (transform + opacity): drawn by the GPU, no work per frame on the page. */
|
|
320
|
+
.oc-pill .oc-status-dot::after {
|
|
321
|
+
content: "";
|
|
322
|
+
position: absolute;
|
|
323
|
+
inset: 0;
|
|
324
|
+
border-radius: inherit;
|
|
325
|
+
background: var(--oc-accent-from);
|
|
326
|
+
opacity: 0;
|
|
327
|
+
pointer-events: none;
|
|
328
|
+
animation: oc-status-dot-ring 2s ease-out var(--oc-status-dot-pulses, infinite);
|
|
329
|
+
}
|
|
330
|
+
.oc-pill .oc-status-dot--strong { --oc-status-dot-pulse-alpha: 1; --oc-status-dot-pulse-scale: 3.5; }
|
|
319
331
|
@keyframes oc-status-dot-ring {
|
|
320
|
-
0% {
|
|
321
|
-
70%, 100% {
|
|
332
|
+
0% { transform: scale(1); opacity: var(--oc-status-dot-pulse-alpha); }
|
|
333
|
+
70%, 100% { transform: scale(var(--oc-status-dot-pulse-scale)); opacity: 0; }
|
|
334
|
+
}
|
|
335
|
+
@media (prefers-reduced-motion: reduce) {
|
|
336
|
+
.oc-pill .oc-status-dot::after { animation: none; }
|
|
322
337
|
}
|
|
323
338
|
|
|
324
339
|
/* Stat strip: big numbers in a bordered row (pairs with .oc-counter for counting up) */
|
package/dist/toc.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// File: packages/ui/src/toc.d.ts
|
|
2
|
+
// Types for the table-of-contents scroll-spy fallback.
|
|
3
|
+
|
|
4
|
+
/** Index of the last heading whose top is at or above the line, or -1. */
|
|
5
|
+
export function currentIndex(tops: number[], line: number): number;
|
|
6
|
+
/** Puts aria-current on the link of the heading you are reading, in browsers without :target-current. */
|
|
7
|
+
export function initToc(scope?: ParentNode, options?: { force?: boolean }): () => void;
|
|
8
|
+
/** New scrollTop that keeps a link (top/bottom in the scroller's content) in view, with a margin. */
|
|
9
|
+
export function keepInView(scrollTop: number, viewHeight: number, top: number, bottom: number, margin?: number): number;
|
package/dist/toc.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// File: packages/ui/src/toc.js
|
|
2
|
+
// Map: links and their headings per .oc-toc -> current heading (the last one above the reading line) -> aria-current on
|
|
3
|
+
// its link (only without :target-current) -> keep the current link in view in a long table of contents
|
|
4
|
+
// -> on scroll and resize (one frame) -> boot
|
|
5
|
+
// Table of contents helper (.oc-toc). Browsers with :target-current (scroll-target-group) highlight the link of the
|
|
6
|
+
// heading you are reading in CSS alone; elsewhere this script puts aria-current="true" on the link of the last heading
|
|
7
|
+
// above the reading line (35% of the window height; your own with data-oc-toc-line="0.25" on the .oc-toc).
|
|
8
|
+
// In every browser it scrolls a table of contents that is taller than its column, so the current link stays in view.
|
|
9
|
+
|
|
10
|
+
/** Index of the current heading: the last one whose top is above the line (px from the top of the window), else -1. */
|
|
11
|
+
export function currentIndex(tops, line) {
|
|
12
|
+
let current = -1;
|
|
13
|
+
tops.forEach((top, i) => { if (top <= line) current = i; });
|
|
14
|
+
return current;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** New scrollTop for a scroller so a link (top/bottom relative to the scroller's content) is in view, with a margin. */
|
|
18
|
+
export function keepInView(scrollTop, viewHeight, top, bottom, margin = 24) {
|
|
19
|
+
if (top - margin < scrollTop) return Math.max(0, top - margin);
|
|
20
|
+
if (bottom + margin > scrollTop + viewHeight) return bottom + margin - viewHeight;
|
|
21
|
+
return scrollTop;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The element that scrolls the table of contents: the .oc-toc itself or a column around it (overflow auto/scroll). */
|
|
25
|
+
function scrollerOf(toc, win) {
|
|
26
|
+
for (let el = toc; el && el !== toc.ownerDocument.body; el = el.parentElement) {
|
|
27
|
+
if (/(auto|scroll)/.test(win.getComputedStyle(el).overflowY) && el.scrollHeight > el.clientHeight) return el;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Starts the helper for every .oc-toc in scope. Returns a function that stops it.
|
|
33
|
+
* force: set aria-current also where :target-current works (tests, or your own styling on aria-current). */
|
|
34
|
+
export function initToc(scope = document, { force = false } = {}) {
|
|
35
|
+
const doc = scope.ownerDocument || scope;
|
|
36
|
+
const win = doc.defaultView;
|
|
37
|
+
if (!win) return () => {};
|
|
38
|
+
const native = !force && Boolean(win.CSS?.supports?.("selector(:target-current)"));
|
|
39
|
+
const tocs = [...scope.querySelectorAll(".oc-toc")].map((toc) => {
|
|
40
|
+
const links = [...toc.querySelectorAll('a.oc-toc-link[href^="#"]')]
|
|
41
|
+
.map((a) => ({ a, target: doc.getElementById(decodeURIComponent(a.getAttribute("href").slice(1))) }))
|
|
42
|
+
.filter((l) => l.target);
|
|
43
|
+
return { toc, links, line: parseFloat(toc.dataset.ocTocLine) || 0.35, last: null };
|
|
44
|
+
}).filter((t) => t.links.length);
|
|
45
|
+
if (!tocs.length) return () => {};
|
|
46
|
+
|
|
47
|
+
let frame = 0;
|
|
48
|
+
const update = () => {
|
|
49
|
+
frame = 0;
|
|
50
|
+
for (const t of tocs) {
|
|
51
|
+
// The heading positions decide, also where :target-current highlights (it can lag behind a jump).
|
|
52
|
+
const i = currentIndex(t.links.map((l) => l.target.getBoundingClientRect().top), win.innerHeight * t.line);
|
|
53
|
+
if (!native) {
|
|
54
|
+
t.links.forEach((l, j) => {
|
|
55
|
+
if (j === i) l.a.setAttribute("aria-current", "true");
|
|
56
|
+
else l.a.removeAttribute("aria-current");
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const link = t.links[i]?.a;
|
|
60
|
+
if (!link || link === t.last) continue;
|
|
61
|
+
t.last = link;
|
|
62
|
+
const scroller = scrollerOf(t.toc, win);
|
|
63
|
+
if (!scroller) continue;
|
|
64
|
+
const box = scroller.getBoundingClientRect();
|
|
65
|
+
const r = link.getBoundingClientRect();
|
|
66
|
+
const top = r.top - box.top + scroller.scrollTop;
|
|
67
|
+
scroller.scrollTop = keepInView(scroller.scrollTop, scroller.clientHeight, top, top + r.height);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const schedule = () => { if (!frame) frame = win.requestAnimationFrame(update); };
|
|
71
|
+
win.addEventListener("scroll", schedule, { passive: true });
|
|
72
|
+
win.addEventListener("resize", schedule, { passive: true });
|
|
73
|
+
// :target-current can change after the last scroll event of a jump: check once more when the scroll ends.
|
|
74
|
+
win.addEventListener("scrollend", schedule, { passive: true });
|
|
75
|
+
update();
|
|
76
|
+
return () => {
|
|
77
|
+
win.removeEventListener("scroll", schedule);
|
|
78
|
+
win.removeEventListener("resize", schedule);
|
|
79
|
+
win.removeEventListener("scrollend", schedule);
|
|
80
|
+
if (frame) win.cancelAnimationFrame(frame);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Starts on its own as /js/oc-toc.js (`npx omniaui copy-js toc`), with ?auto in the URL or data-oc-auto on the tag.
|
|
85
|
+
function autoStart() {
|
|
86
|
+
if (typeof document === "undefined") return false;
|
|
87
|
+
const url = String(import.meta.url);
|
|
88
|
+
if (url.includes("oc-toc") || /[?&]auto(=|&|$)/.test(url)) return true;
|
|
89
|
+
const file = url.split(/[?#]/)[0];
|
|
90
|
+
return [...document.querySelectorAll("script[data-oc-auto][src]")].some((s) => s.src.split(/[?#]/)[0] === file);
|
|
91
|
+
}
|
|
92
|
+
if (autoStart()) {
|
|
93
|
+
const boot = () => initToc(document);
|
|
94
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
|
|
95
|
+
else boot();
|
|
96
|
+
}
|
package/manifest.json
CHANGED
|
@@ -1407,6 +1407,30 @@
|
|
|
1407
1407
|
"requires": [
|
|
1408
1408
|
"@birdycom/omniaui"
|
|
1409
1409
|
]
|
|
1410
|
+
},
|
|
1411
|
+
{
|
|
1412
|
+
"name": "tint-card",
|
|
1413
|
+
"file": "snippets/tint-card.html",
|
|
1414
|
+
"description": "Link cards tinted in one color, with a large outline webicon in the corner that drifts and tilts on hover, and an arrow chip that flies out and back in",
|
|
1415
|
+
"requires": [
|
|
1416
|
+
"@birdycom/omniaui"
|
|
1417
|
+
]
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
"name": "doc-layout",
|
|
1421
|
+
"file": "snippets/doc-layout.html",
|
|
1422
|
+
"description": "A document page with a table of contents in a side column that stays in view next to the text (privacy, terms, a manual), clear of a sticky site header",
|
|
1423
|
+
"requires": [
|
|
1424
|
+
"@birdycom/omniaui"
|
|
1425
|
+
]
|
|
1426
|
+
},
|
|
1427
|
+
{
|
|
1428
|
+
"name": "step-list",
|
|
1429
|
+
"file": "snippets/step-list.html",
|
|
1430
|
+
"description": "Compact numbered list of steps inside a card or a disclosure; the number takes the color of the severity card around it",
|
|
1431
|
+
"requires": [
|
|
1432
|
+
"@birdycom/omniaui"
|
|
1433
|
+
]
|
|
1410
1434
|
}
|
|
1411
1435
|
]
|
|
1412
1436
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@birdycom/omniaui",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "OmniaUI components: CSS-first UI built on native HTML (dialog, popover, details) with light-dark() theming — no JavaScript required. Includes the omniaui CLI (add/list).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"./contact-form.js": "./dist/contact-form.js",
|
|
37
37
|
"./fly.js": "./dist/fly.js",
|
|
38
38
|
"./particles.js": "./dist/particles.js",
|
|
39
|
+
"./toc.js": "./dist/toc.js",
|
|
40
|
+
"./language-select.js": "./dist/language-select.js",
|
|
39
41
|
"./manifest.json": "./manifest.json",
|
|
40
42
|
"./package.json": "./package.json"
|
|
41
43
|
},
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
"omniaui": "./bin/omniaui.mjs"
|
|
64
66
|
},
|
|
65
67
|
"peerDependencies": {
|
|
66
|
-
"@birdycom/omniacss": "^0.14.
|
|
68
|
+
"@birdycom/omniacss": "^0.14.2"
|
|
67
69
|
},
|
|
68
70
|
"peerDependenciesMeta": {
|
|
69
71
|
"@birdycom/omniacss": {
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
.oc-dl-panel: Panel wrapper (role="region")
|
|
4
4
|
.oc-dl-title / -description: Panel heading and note
|
|
5
5
|
.oc-dl: The dl
|
|
6
|
+
.oc-dl--glossary: Term + explanation: the term bold, the explanation normal, first lines on one line
|
|
7
|
+
.oc-dl--flush: No margin and no line above the list (no title above it)
|
|
6
8
|
.oc-dl-row: div grouping one term and detail
|
|
7
9
|
.oc-dl-term / .oc-dl-detail: dt / dd
|
|
8
10
|
.oc-dl-footer: Optional footer (actions)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- OmniaUI component: doc-layout - A document page with a table of contents in a side column that stays in view next to the text (privacy, terms, a manual), clear of a sticky site header. Needs @birdycom/omniaui CSS; dist/toc.js (oc-toc.js) highlights the current heading where :target-current is missing.
|
|
2
|
+
File: packages/ui/snippets/doc-layout.html | Map: layout -> side column (toc with group labels) -> text (ruled legal prose).
|
|
3
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
|
+
.oc-doc-layout: Grid: side column (--oc-doc-aside, 17rem) and the text; stacked below 64rem, side column first. --end: side column on the right.
|
|
5
|
+
.oc-doc-layout__aside: Side column; sticky from 64rem at --oc-sticky-offset, at most the window height, scrolls itself.
|
|
6
|
+
.oc-doc-layout__main: The text column.
|
|
7
|
+
--oc-sticky-offset: Where sticky parts stop and how much room an anchor jump keeps; follows .oc-site-header (4.5rem + 1rem) or set it on :root.
|
|
8
|
+
.oc-toc-group-label: Label above a group of links in the table of contents (between two lists).
|
|
9
|
+
.oc-prose--ruled: A line under every h2 of the prose.
|
|
10
|
+
-->
|
|
11
|
+
<div class="oc-doc-layout" style="inline-size:100%">
|
|
12
|
+
<aside class="oc-doc-layout__aside">
|
|
13
|
+
<nav class="oc-toc" aria-label="On this page">
|
|
14
|
+
<p class="oc-toc-group-label">Articles</p>
|
|
15
|
+
<ul class="oc-toc-list">
|
|
16
|
+
<li><a class="oc-toc-link" href="#doc-who" aria-current="true">1. Who we are</a></li>
|
|
17
|
+
<li><a class="oc-toc-link" href="#doc-data">2. What data we keep</a></li>
|
|
18
|
+
<li><a class="oc-toc-link" href="#doc-rights">3. Your rights</a></li>
|
|
19
|
+
</ul>
|
|
20
|
+
<p class="oc-toc-group-label">Annexes</p>
|
|
21
|
+
<ul class="oc-toc-list">
|
|
22
|
+
<li><a class="oc-toc-link" href="#doc-cookies">A. Cookies</a></li>
|
|
23
|
+
</ul>
|
|
24
|
+
</nav>
|
|
25
|
+
</aside>
|
|
26
|
+
<div class="oc-doc-layout__main">
|
|
27
|
+
<div class="oc-prose oc-prose--legal oc-prose--ruled">
|
|
28
|
+
<h2 id="doc-who">1. Who we are</h2>
|
|
29
|
+
<p>Company 1 builds and maintains software for small teams. You can reach us at info@company1.example.</p>
|
|
30
|
+
<h2 id="doc-data">2. What data we keep</h2>
|
|
31
|
+
<p>Only what we need to deliver the service: your name, your e-mail address and the invoices of your plan.</p>
|
|
32
|
+
<ul><li>Account data, as long as the account exists.</li><li>Invoices, for seven years.</li></ul>
|
|
33
|
+
<h2 id="doc-rights">3. Your rights</h2>
|
|
34
|
+
<p>You can ask to see, correct or delete your data at any time. We answer within 30 days.</p>
|
|
35
|
+
<h2 id="doc-cookies">A. Cookies</h2>
|
|
36
|
+
<p>We only use the cookies that keep you signed in and remember your language.</p>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
package/snippets/meter-row.html
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
data-level="warn" / "critical": Orange / red bar (and a red value at critical). Without it the bar is green.
|
|
7
7
|
.oc-meter-row__bar[role=meter]: The bar; give it aria-valuenow and a label for screen readers.
|
|
8
8
|
.oc-meter-list (--compact): A stack of rows; --compact for a small widget.
|
|
9
|
-
.oc-meter-list--dense: Tighter rows with a 5px bar and a 0.8rem label, for a tray window.
|
|
9
|
+
.oc-meter-list--dense: Tighter rows with a 5px bar and a 0.8rem label, for a tray window (no width transition).
|
|
10
|
+
.oc-meter-list--live: No width transition, for values that change every few seconds.
|
|
10
11
|
.oc-meter-row__sub: Muted second line under the bar; .oc-meter-row__subbar: its thin bar (--oc-meter, data-level).
|
|
11
12
|
.oc-meter-row__fill: Optional fill element inside a bar or sub-bar; patch its inline inline-size in place.
|
|
12
13
|
-->
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
4
|
.oc-section-pad--page: Header of an inner page: padding clamp(4rem, 10vw, 7rem) on top, clamp(2rem, 5vw, 3rem) below.
|
|
5
5
|
.oc-display--page: Larger display title for that header: clamp(2.5rem, 6.5vw, 4.75rem).
|
|
6
|
-
.oc-section-head: Head of a section (eyebrow, title, lead): max 46rem, 3rem below. --center centers it.
|
|
6
|
+
.oc-section-head: Head of a section (eyebrow, title, lead): max 46rem, 3rem below. --center centers it; --split: title left, lead right (one column below 56rem).
|
|
7
7
|
.oc-section-more: Row under a section (a <em>see all</em> link): 2.5rem above.
|
|
8
8
|
.oc-actions: Row of buttons that wraps: gap .75rem, 2rem above. --center, --end, --tight (1rem above).
|
|
9
9
|
.oc-group-title: Title of a group of cards; .oc-group-title__count is the number in a pill.
|
package/snippets/progress.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- OmniaUI component: progress — Progress bar. Needs @birdycom/omniaui CSS. -->
|
|
1
|
+
<!-- OmniaUI component: progress — Progress bar. Needs @birdycom/omniaui CSS. .oc-progress--live: no width transition (a value every few seconds). -->
|
|
2
2
|
<div class="oc-progress" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
|
|
3
3
|
<div class="oc-progress-bar" style="width: 60%"></div>
|
|
4
4
|
</div>
|
package/snippets/status-dot.html
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
.oc-status-dot: 8 px dot with a soft ring in the tone color
|
|
5
5
|
Tones: --working (primary, pulses), --waiting (warning), --done (success), --error (destructive), --idle (muted); none = muted
|
|
6
6
|
Sizes: --sm, --lg
|
|
7
|
+
--still: working without the pulse; --oc-status-dot-pulses: 3 = pulse three times, then a steady dot (default infinite)
|
|
7
8
|
.oc-status: dot + one line of text that cuts off with …; .oc-status__text, .oc-status__meta (right, tabular numbers)
|
|
8
9
|
Token: --oc-status-dot-color (any color)
|
|
9
10
|
The dot is decoration (aria-hidden): the text says the state. A dot without text needs role="img" and an aria-label.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- OmniaUI component: step-list - Compact numbered list of steps inside a card or a disclosure; the number takes the color of the severity card around it. Needs @birdycom/omniaui CSS.
|
|
2
|
+
File: packages/ui/snippets/step-list.html | Map: plain list -> inside a high severity card (numbers in its color).
|
|
3
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
|
+
ol.oc-step-list: One column, gap 0.6rem, 0.875rem text; every li is a row with its number (CSS counter) on the left.
|
|
5
|
+
--oc-step-list-color: Color of the numbers; default the severity card color (--oc-severity-color), else primary.
|
|
6
|
+
.oc-step-list--sm: Tighter rows, 0.8125rem text.
|
|
7
|
+
style="counter-reset: oc-step-list 3": Start at another number (the first step is 4).
|
|
8
|
+
-->
|
|
9
|
+
<div style="display:grid;gap:1rem;inline-size:min(100%,30rem)">
|
|
10
|
+
<ol class="oc-step-list">
|
|
11
|
+
<li>Sign in to the account of Service 1.</li>
|
|
12
|
+
<li>Open <strong>Settings</strong> and choose <strong>Privacy</strong>.</li>
|
|
13
|
+
<li>Click <a href="#remove">Delete my data</a> and confirm the e-mail you receive.</li>
|
|
14
|
+
</ol>
|
|
15
|
+
<details class="oc-severity-card oc-severity-card--high" open>
|
|
16
|
+
<summary class="oc-severity-card-head">
|
|
17
|
+
<span class="oc-severity-card-main"><span class="oc-severity-card-title">Address found at Company 1</span></span>
|
|
18
|
+
<span class="oc-severity-card-level">High</span>
|
|
19
|
+
</summary>
|
|
20
|
+
<div class="oc-severity-card-body">
|
|
21
|
+
<ol class="oc-step-list oc-step-list--sm">
|
|
22
|
+
<li>Go to the removal page of Company 1.</li>
|
|
23
|
+
<li>Fill in the e-mail address info@company1.example.</li>
|
|
24
|
+
<li>Send the request; it takes up to 30 days.</li>
|
|
25
|
+
</ol>
|
|
26
|
+
</div>
|
|
27
|
+
</details>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<!-- OmniaUI component: tint-card - Link cards tinted in one color, with a large outline webicon in the corner that drifts and tilts on hover, and an arrow chip that flies out and back in. Needs @birdycom/omniaui CSS.
|
|
2
|
+
File: packages/ui/snippets/tint-card.html | Map: split section head -> grid of five tint cards (one per tone).
|
|
3
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
|
+
.oc-tint-card: The card (an <a>, or a <div> with a title link): tint background (--oc-tint, 9% / 15% on hover), lift 4px, shadow in the tint.
|
|
5
|
+
.oc-tint-card__head: Row with the title and the arrow chip.
|
|
6
|
+
.oc-tint-card__title: Title (display font); 1.25rem when the card is 16rem or wider.
|
|
7
|
+
.oc-tint-card__text: Short text, muted, max 26ch.
|
|
8
|
+
.oc-tint-card__meta: Line at the bottom in the tint (12 modules, New).
|
|
9
|
+
.oc-tint-card__go: Round arrow chip; fills with the tint on hover, the arrow flies out and back in.
|
|
10
|
+
.oc-tint-card__art: Large outline webicon half outside the bottom corner; drifts slowly, tilts and grows on hover.
|
|
11
|
+
.oc-tint-card__link: Title link for a card that is a <div>: it covers the whole card.
|
|
12
|
+
.oc-tint-card--success|warning|destructive|info|muted: Tones; or set --oc-tint (and --oc-tint-foreground) yourself.
|
|
13
|
+
.oc-tint-card--lg: Larger card for a row of two or three.
|
|
14
|
+
.oc-section-head--split: Section head with the title on the left and the lead on the right (one column below 56rem).
|
|
15
|
+
-->
|
|
16
|
+
<section style="inline-size:100%">
|
|
17
|
+
<div class="oc-section-head oc-section-head--split">
|
|
18
|
+
<div>
|
|
19
|
+
<p class="oc-eyebrow">Services</p>
|
|
20
|
+
<h2 class="oc-display oc-display--md">Everything your team needs, in one place</h2>
|
|
21
|
+
</div>
|
|
22
|
+
<p class="oc-lead">Five services that work together: from the warehouse to the report. Start with one, add the others when you grow.</p>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="oc-card-grid oc-card-grid--fit" style="--oc-card-min:12.5rem;--oc-card-gap:1rem">
|
|
25
|
+
<a class="oc-tint-card oc-tint-card--warning" href="#warehouse">
|
|
26
|
+
<iconify-icon class="oc-tint-card__art" icon="mdi-light:factory" aria-hidden="true"></iconify-icon>
|
|
27
|
+
<div class="oc-tint-card__head">
|
|
28
|
+
<h3 class="oc-tint-card__title">Warehouse</h3>
|
|
29
|
+
<span class="oc-tint-card__go" aria-hidden="true"><iconify-icon icon="material-symbols:arrow-outward-rounded"></iconify-icon></span>
|
|
30
|
+
</div>
|
|
31
|
+
<p class="oc-tint-card__text">Stock, locations and picking lists that stay up to date</p>
|
|
32
|
+
</a>
|
|
33
|
+
<a class="oc-tint-card oc-tint-card--destructive" href="#delivery">
|
|
34
|
+
<iconify-icon class="oc-tint-card__art" icon="mdi-light:truck" aria-hidden="true"></iconify-icon>
|
|
35
|
+
<div class="oc-tint-card__head">
|
|
36
|
+
<h3 class="oc-tint-card__title">Delivery</h3>
|
|
37
|
+
<span class="oc-tint-card__go" aria-hidden="true"><iconify-icon icon="material-symbols:arrow-outward-rounded"></iconify-icon></span>
|
|
38
|
+
</div>
|
|
39
|
+
<p class="oc-tint-card__text">Routes, time slots and proof of delivery on the phone</p>
|
|
40
|
+
</a>
|
|
41
|
+
<a class="oc-tint-card oc-tint-card--success" href="#reports">
|
|
42
|
+
<iconify-icon class="oc-tint-card__art" icon="mdi-light:chart-line" aria-hidden="true"></iconify-icon>
|
|
43
|
+
<div class="oc-tint-card__head">
|
|
44
|
+
<h3 class="oc-tint-card__title">Reports</h3>
|
|
45
|
+
<span class="oc-tint-card__go" aria-hidden="true"><iconify-icon icon="material-symbols:arrow-outward-rounded"></iconify-icon></span>
|
|
46
|
+
</div>
|
|
47
|
+
<p class="oc-tint-card__text">Figures per week, per customer and per product</p>
|
|
48
|
+
</a>
|
|
49
|
+
<a class="oc-tint-card oc-tint-card--info" href="#security">
|
|
50
|
+
<iconify-icon class="oc-tint-card__art" icon="mdi-light:shield" aria-hidden="true"></iconify-icon>
|
|
51
|
+
<div class="oc-tint-card__head">
|
|
52
|
+
<h3 class="oc-tint-card__title">Security</h3>
|
|
53
|
+
<span class="oc-tint-card__go" aria-hidden="true"><iconify-icon icon="material-symbols:arrow-outward-rounded"></iconify-icon></span>
|
|
54
|
+
</div>
|
|
55
|
+
<p class="oc-tint-card__text">Roles, two-step login and a log of every change</p>
|
|
56
|
+
</a>
|
|
57
|
+
<a class="oc-tint-card oc-tint-card--muted" href="#more">
|
|
58
|
+
<iconify-icon class="oc-tint-card__art" icon="mdi-light:sitemap" aria-hidden="true"></iconify-icon>
|
|
59
|
+
<div class="oc-tint-card__head">
|
|
60
|
+
<h3 class="oc-tint-card__title">More services</h3>
|
|
61
|
+
<span class="oc-tint-card__go" aria-hidden="true"><iconify-icon icon="material-symbols:arrow-outward-rounded"></iconify-icon></span>
|
|
62
|
+
</div>
|
|
63
|
+
<p class="oc-tint-card__text">Links to your own tools and custom work</p>
|
|
64
|
+
</a>
|
|
65
|
+
</div>
|
|
66
|
+
</section>
|
package/snippets/toc.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- OmniaUI component: toc - "On this page" list of heading links. Needs @birdycom/omniaui CSS.
|
|
2
|
-
Class API: .oc-toc (root nav, sticky) · .oc-toc-title · .oc-toc-list (ul) · .oc-toc-link (a; aria-current / .is-active = current heading) · .oc-toc-item--sub (li, sub heading)
|
|
2
|
+
Class API: .oc-toc (root nav, sticky from 64rem at --oc-sticky-offset) · .oc-toc-group-label (label between two lists) · .oc-toc-title · .oc-toc-list (ul) · .oc-toc-link (a; aria-current / .is-active = current heading) · .oc-toc-item--sub (li, sub heading)
|
|
3
3
|
-->
|
|
4
4
|
<nav class="oc-toc" aria-label="On this page">
|
|
5
5
|
<p class="oc-toc-title">On this page</p>
|