@birdycom/omniaui 0.13.0 → 0.14.1
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/copy-js.mjs +5 -1
- package/dist/components.css +975 -20
- package/dist/components.min.css +1 -1
- package/dist/docs-ui.css +12 -1
- package/dist/form-extras.d.ts +3 -1
- package/dist/form-extras.js +21 -3
- package/dist/language-select.d.ts +7 -0
- package/dist/language-select.js +48 -0
- package/dist/oc-theme.css +1 -1
- package/dist/particles.d.ts +14 -0
- package/dist/particles.js +133 -0
- package/dist/parts/app-accordion-accent.css +18 -1
- package/dist/parts/app-callout.css +20 -0
- package/dist/parts/app-group.css +36 -0
- package/dist/parts/app-page-header.css +1 -1
- 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 +11 -0
- package/dist/parts/data-graph.css +132 -0
- package/dist/parts/data-meter-row.css +63 -3
- package/dist/parts/data-reading.css +26 -0
- package/dist/parts/data-step-list.css +42 -0
- package/dist/parts/forms-language-select.css +80 -0
- package/dist/parts/nav-menu-static.css +50 -0
- package/dist/parts/site-backgrounds.css +68 -0
- package/dist/parts/site-cards.css +2 -1
- package/dist/parts/site-doc-layout.css +39 -0
- package/dist/parts/site-layout.css +15 -1
- package/dist/parts/site-neon.css +47 -0
- package/dist/parts/site-prose.css +4 -1
- package/dist/parts/site-tint-card.css +223 -0
- package/dist/showcase.css +22 -5
- package/dist/toc.d.ts +9 -0
- package/dist/toc.js +96 -0
- package/manifest.json +88 -0
- package/package.json +5 -2
- package/snippets/accordion-accent.html +22 -0
- package/snippets/backgrounds.html +18 -0
- package/snippets/callout.html +17 -0
- package/snippets/definition-list.html +1 -0
- package/snippets/doc-layout.html +39 -0
- package/snippets/graph.html +41 -0
- package/snippets/group.html +34 -0
- package/snippets/language-select.html +11 -0
- package/snippets/menu-static.html +36 -0
- package/snippets/meter-row.html +23 -0
- package/snippets/neon.html +18 -0
- package/snippets/page-sections.html +1 -1
- package/snippets/particle-field.html +14 -0
- package/snippets/progress.html +1 -1
- package/snippets/reading.html +25 -0
- 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
|
@@ -138,6 +138,8 @@
|
|
|
138
138
|
.oc-lead { margin: 0 0 1rem; color: var(--oc-muted-foreground); font-size: 1.15rem; line-height: 1.65; max-inline-size: 42rem; text-wrap: pretty; }
|
|
139
139
|
/* Larger and narrower, for a home hero. */
|
|
140
140
|
.oc-lead--lg { font-size: 1.2rem; max-inline-size: 36rem; }
|
|
141
|
+
/* Plain: the lead size in the text color and the full width (the intro of a product page). */
|
|
142
|
+
.oc-lead--plain { color: var(--oc-foreground); max-inline-size: none; }
|
|
141
143
|
.oc-split { display: grid; grid-template-columns: var(--oc-split-cols, repeat(auto-fit, minmax(min(100%, 24rem), 1fr))); gap: var(--oc-split-gap, 3rem); align-items: center; }
|
|
142
144
|
/* Ratio presets (one column up to 960px): --lead makes the text column wider, --media the image column.
|
|
143
145
|
Your own ratio: set --oc-split-cols in a class (and to 1fr in a media query for small screens). */
|
|
@@ -306,17 +308,32 @@
|
|
|
306
308
|
--strong starts at the full accent with a wider ring. */
|
|
307
309
|
.oc-pill .oc-status-dot {
|
|
308
310
|
--oc-status-dot-pulse-alpha: 0.6;
|
|
309
|
-
--oc-status-dot-pulse-
|
|
311
|
+
--oc-status-dot-pulse-scale: 3;
|
|
312
|
+
position: relative;
|
|
310
313
|
inline-size: 0.5rem;
|
|
311
314
|
aspect-ratio: 1;
|
|
312
315
|
border-radius: 50%;
|
|
313
316
|
background: var(--oc-accent-from);
|
|
314
|
-
|
|
317
|
+
box-shadow: none;
|
|
315
318
|
}
|
|
316
|
-
|
|
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; }
|
|
317
331
|
@keyframes oc-status-dot-ring {
|
|
318
|
-
0% {
|
|
319
|
-
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; }
|
|
320
337
|
}
|
|
321
338
|
|
|
322
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
|
@@ -1343,6 +1343,94 @@
|
|
|
1343
1343
|
"requires": [
|
|
1344
1344
|
"@birdycom/omniaui"
|
|
1345
1345
|
]
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
"name": "reading",
|
|
1349
|
+
"file": "snippets/reading.html",
|
|
1350
|
+
"description": "A small measured value next to another value, such as a temperature, with a cool, warm or hot level",
|
|
1351
|
+
"requires": [
|
|
1352
|
+
"@birdycom/omniaui"
|
|
1353
|
+
]
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
"name": "callout",
|
|
1357
|
+
"file": "snippets/callout.html",
|
|
1358
|
+
"description": "A small card with a text on the left and one action on the right; the action moves under the text when the card is narrow",
|
|
1359
|
+
"requires": [
|
|
1360
|
+
"@birdycom/omniaui"
|
|
1361
|
+
]
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
"name": "menu-static",
|
|
1365
|
+
"file": "snippets/menu-static.html",
|
|
1366
|
+
"description": "The dropdown menu as a surface of its own, with a check column and hints, for a tray menu or a menu inside a panel",
|
|
1367
|
+
"requires": [
|
|
1368
|
+
"@birdycom/omniaui"
|
|
1369
|
+
]
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"name": "group",
|
|
1373
|
+
"file": "snippets/group.html",
|
|
1374
|
+
"description": "One section inside a panel or widget, with a title, a colored status on the right and a muted line, and a hairline between groups",
|
|
1375
|
+
"requires": [
|
|
1376
|
+
"@birdycom/omniaui"
|
|
1377
|
+
]
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
"name": "neon",
|
|
1381
|
+
"file": "snippets/neon.html",
|
|
1382
|
+
"description": "A border that glows from one accent color to the other, and a button with a neon gradient",
|
|
1383
|
+
"requires": [
|
|
1384
|
+
"@birdycom/omniaui"
|
|
1385
|
+
]
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
"name": "backgrounds",
|
|
1389
|
+
"file": "snippets/backgrounds.html",
|
|
1390
|
+
"description": "Decorative layers behind a page or a section: a line grid, a soft glowing orb and fine scan lines",
|
|
1391
|
+
"requires": [
|
|
1392
|
+
"@birdycom/omniaui"
|
|
1393
|
+
]
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
"name": "particle-field",
|
|
1397
|
+
"file": "snippets/particle-field.html",
|
|
1398
|
+
"description": "A background canvas with slowly drifting points and thin lines between points that are close together",
|
|
1399
|
+
"requires": [
|
|
1400
|
+
"@birdycom/omniaui"
|
|
1401
|
+
]
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
"name": "graph",
|
|
1405
|
+
"file": "snippets/graph.html",
|
|
1406
|
+
"description": "The look of a small network graph in SVG: a center with linked nodes, colored by level, moving edges and a pulse",
|
|
1407
|
+
"requires": [
|
|
1408
|
+
"@birdycom/omniaui"
|
|
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
|
+
]
|
|
1346
1434
|
}
|
|
1347
1435
|
]
|
|
1348
1436
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@birdycom/omniaui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
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",
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"./lazy.js": "./dist/lazy.js",
|
|
36
36
|
"./contact-form.js": "./dist/contact-form.js",
|
|
37
37
|
"./fly.js": "./dist/fly.js",
|
|
38
|
+
"./particles.js": "./dist/particles.js",
|
|
39
|
+
"./toc.js": "./dist/toc.js",
|
|
40
|
+
"./language-select.js": "./dist/language-select.js",
|
|
38
41
|
"./manifest.json": "./manifest.json",
|
|
39
42
|
"./package.json": "./package.json"
|
|
40
43
|
},
|
|
@@ -62,7 +65,7 @@
|
|
|
62
65
|
"omniaui": "./bin/omniaui.mjs"
|
|
63
66
|
},
|
|
64
67
|
"peerDependencies": {
|
|
65
|
-
"@birdycom/omniacss": "^0.
|
|
68
|
+
"@birdycom/omniacss": "^0.14.1"
|
|
66
69
|
},
|
|
67
70
|
"peerDependenciesMeta": {
|
|
68
71
|
"@birdycom/omniacss": {
|
|
@@ -22,3 +22,25 @@
|
|
|
22
22
|
<div class="oc-accordion-content">Pick a start date with the customer.</div>
|
|
23
23
|
</details>
|
|
24
24
|
</div>
|
|
25
|
+
<div class="oc-accordion oc-accordion--accent" style="inline-size:min(100%,32rem)">
|
|
26
|
+
<details class="oc-accordion-item" data-status="error" open>
|
|
27
|
+
<summary class="oc-accordion-trigger"><span class="oc-accordion-accent-dot"></span>Password found in a leak<span class="oc-accordion-accent-meta">2 sources</span></summary>
|
|
28
|
+
<div class="oc-accordion-content">Change the password on every site where you used it.</div>
|
|
29
|
+
</details>
|
|
30
|
+
<details class="oc-accordion-item" data-status="warn">
|
|
31
|
+
<summary class="oc-accordion-trigger"><span class="oc-accordion-accent-dot"></span>Email address public<span class="oc-accordion-accent-meta">1 source</span></summary>
|
|
32
|
+
<div class="oc-accordion-content">Found on a public profile page.</div>
|
|
33
|
+
</details>
|
|
34
|
+
<details class="oc-accordion-item" data-status="ok">
|
|
35
|
+
<summary class="oc-accordion-trigger"><span class="oc-accordion-accent-dot"></span>Phone number<span class="oc-accordion-accent-meta">not found</span></summary>
|
|
36
|
+
<div class="oc-accordion-content">Nothing found.</div>
|
|
37
|
+
</details>
|
|
38
|
+
<details class="oc-accordion-item" data-status="pending">
|
|
39
|
+
<summary class="oc-accordion-trigger"><span class="oc-accordion-accent-dot"></span>Data brokers<span class="oc-accordion-accent-meta">checking…</span></summary>
|
|
40
|
+
<div class="oc-accordion-content">Still running.</div>
|
|
41
|
+
</details>
|
|
42
|
+
<details class="oc-accordion-item" data-status="skip">
|
|
43
|
+
<summary class="oc-accordion-trigger"><span class="oc-accordion-accent-dot"></span>Dark web<span class="oc-accordion-accent-meta">not checked</span></summary>
|
|
44
|
+
<div class="oc-accordion-content">Needs a paid plan.</div>
|
|
45
|
+
</details>
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- OmniaUI component: backgrounds - Decorative layers behind a page or a section: a line grid, a soft glowing orb and fine scan lines. Needs @birdycom/omniaui CSS.
|
|
2
|
+
File: packages/ui/snippets/backgrounds.html | Map: grid, orbs and scan lines.
|
|
3
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
|
+
.oc-bg-grid: Thin lines (4% primary) in a 60px grid, behind the content of a positioned parent.
|
|
5
|
+
.oc-bg-grid--fixed / --fade: Fixed to the viewport (40px); lines that fade out towards the edges.
|
|
6
|
+
--oc-bg-grid-size / --oc-bg-grid-line: Size and color of the grid.
|
|
7
|
+
.oc-orb: A soft round glow in --oc-accent-from; place it with inset-*. Another color: .oc-accent--violet …
|
|
8
|
+
.oc-orb--sm / --drift: A smaller orb (18rem); a slow drift.
|
|
9
|
+
--oc-orb-size / --oc-orb-strength / --oc-orb-blur: Size, strength (0.15) and blur (50px) of the orb.
|
|
10
|
+
.oc-scanlines: Fine horizontal lines over the whole page (fixed, on top, ignores the pointer). --local: inside a positioned parent.
|
|
11
|
+
-->
|
|
12
|
+
<div style="position:relative;isolation:isolate;overflow:hidden;display:grid;place-items:center;min-block-size:16rem;inline-size:100%;border-radius:var(--oc-radius)">
|
|
13
|
+
<div class="oc-bg-grid oc-bg-grid--fade" aria-hidden="true"></div>
|
|
14
|
+
<div class="oc-orb oc-orb--drift" aria-hidden="true" style="inset-block-start:-6rem;inset-inline-start:-4rem;--oc-orb-strength:0.3"></div>
|
|
15
|
+
<div class="oc-orb oc-orb--sm oc-accent--violet" aria-hidden="true" style="inset-block-end:-3rem;inset-inline-end:2rem;--oc-orb-strength:0.3"></div>
|
|
16
|
+
<div class="oc-scanlines oc-scanlines--local" aria-hidden="true"></div>
|
|
17
|
+
<p style="margin:0;font-size:1.5rem;font-weight:700">Your content</p>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!-- OmniaUI component: callout - A small card with a text on the left and one action on the right; the action moves under the text when the card is narrow. Needs @birdycom/omniaui CSS.
|
|
2
|
+
File: packages/ui/snippets/callout.html | Map: text and a button.
|
|
3
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
4
|
+
.oc-callout: The card: flex row, wraps, card colors and the padding of a small card (11px 13px).
|
|
5
|
+
.oc-callout__text: The text; a <strong> is the title on its own line, the rest is muted.
|
|
6
|
+
.oc-callout__action: One or more buttons; never shrinks. Under the text below about 300px.
|
|
7
|
+
-->
|
|
8
|
+
<div style="display:grid;gap:1rem;inline-size:100%">
|
|
9
|
+
<div class="oc-callout" style="max-inline-size:26rem">
|
|
10
|
+
<div class="oc-callout__text"><strong>Like the app?</strong><span>A small gift keeps it free for everyone.</span></div>
|
|
11
|
+
<div class="oc-callout__action"><button type="button" class="oc-btn oc-btn--sm">Support</button></div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="oc-callout" style="max-inline-size:17rem">
|
|
14
|
+
<div class="oc-callout__text"><strong>Update 2.4 is ready</strong><span>Restart to install it.</span></div>
|
|
15
|
+
<div class="oc-callout__action"><button type="button" class="oc-btn oc-btn--sm oc-btn--outline">Later</button><button type="button" class="oc-btn oc-btn--sm">Restart</button></div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -3,6 +3,7 @@
|
|
|
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
|
|
6
7
|
.oc-dl-row: div grouping one term and detail
|
|
7
8
|
.oc-dl-term / .oc-dl-detail: dt / dd
|
|
8
9
|
.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>
|