@birdycom/omniaui 0.15.1 → 0.16.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 +3 -0
- package/bin/lib/webicons.mjs +120 -0
- package/bin/omniaui.mjs +10 -1
- package/dist/carousel.d.ts +2 -0
- package/dist/carousel.js +38 -2
- package/dist/combobox.d.ts +13 -0
- package/dist/combobox.js +143 -0
- package/dist/components-extra.css +7 -3
- package/dist/components.css +1260 -153
- package/dist/components.min.css +1 -1
- package/dist/docs-ui.css +1 -1
- package/dist/fly.js +13 -2
- package/dist/logo.d.ts +14 -0
- package/dist/logo.js +98 -0
- package/dist/oc-theme.css +1 -1
- package/dist/parts/app-0160-apps.css +141 -0
- package/dist/parts/app-accordion-accent.css +1 -1
- package/dist/parts/app-busy-overlay.css +1 -1
- package/dist/parts/app-confirm-dialog.css +4 -18
- package/dist/parts/app-cookie-consent.css +1 -1
- package/dist/parts/app-data-table-rich.css +1 -1
- package/dist/parts/app-mode-badge.css +130 -0
- package/dist/parts/app-name-card.css +10 -0
- package/dist/parts/app-severity-card.css +4 -3
- package/dist/parts/app-sheet-options.css +70 -0
- package/dist/parts/app-sidebar-dark.css +1 -1
- package/dist/parts/app-sidebar-meta.css +40 -0
- package/dist/parts/app-stat-card.css +2 -2
- package/dist/parts/app-upgrade-banner.css +1 -1
- package/dist/parts/data-chart-line.css +5 -2
- package/dist/parts/data-reading.css +2 -1
- package/dist/parts/data-stock.css +1 -1
- package/dist/parts/forms-affix-input.css +7 -0
- package/dist/parts/forms-barcode-input.css +2 -1
- package/dist/parts/forms-combobox-icons.css +78 -0
- package/dist/parts/forms-language-menu.css +89 -0
- package/dist/parts/forms-language-select.css +3 -2
- package/dist/parts/forms-phone-input.css +3 -0
- package/dist/parts/media-art.css +7 -5
- package/dist/parts/media-doc-viewer.css +1 -1
- package/dist/parts/media-flip-card.css +1 -1
- package/dist/parts/media-glass-liquid.css +14 -0
- package/dist/parts/media-glass.css +8 -0
- package/dist/parts/media-live-frame.css +58 -0
- package/dist/parts/media-logo.css +48 -0
- package/dist/parts/media-terminal-log.css +4 -3
- package/dist/parts/media-thumb.css +1 -1
- package/dist/parts/site-backgrounds.css +1 -1
- package/dist/parts/site-base.css +14 -7
- package/dist/parts/site-brand-mark.css +1 -1
- package/dist/parts/site-cards.css +4 -1
- package/dist/parts/site-fact-list.css +1 -1
- package/dist/parts/site-fly.css +1 -0
- package/dist/parts/site-header-variants.css +6 -1
- package/dist/parts/site-layout.css +1 -1
- package/dist/parts/site-link-arrow.css +1 -1
- package/dist/parts/site-link-row.css +1 -1
- package/dist/parts/site-next-teaser.css +2 -2
- package/dist/parts/site-paper.css +189 -0
- package/dist/parts/site-price-card.css +4 -3
- package/dist/parts/site-product-mark.css +1 -1
- package/dist/parts/site-project-card.css +13 -8
- package/dist/parts/site-stack-list.css +1 -1
- package/dist/parts/site-timeline.css +1 -1
- package/dist/parts/utility-hover.css +4 -3
- package/dist/showcase.css +74 -28
- package/dist/theme.js +130 -0
- package/manifest.json +40 -0
- package/package.json +5 -2
- package/snippets/card.html +4 -1
- package/snippets/code-plate.html +10 -0
- package/snippets/collapsible.html +2 -2
- package/snippets/combobox.html +19 -0
- package/snippets/context-menu.html +5 -2
- package/snippets/definition-list.html +1 -1
- package/snippets/dropdown-menu.html +1 -0
- package/snippets/language-select.html +15 -0
- package/snippets/live-frame.html +3 -1
- package/snippets/logo.html +10 -0
- package/snippets/mode-badge.html +12 -0
- package/snippets/next-teaser.html +1 -1
- package/snippets/page-sections.html +1 -1
- package/snippets/paper.html +32 -0
- package/snippets/project-card.html +4 -4
- package/snippets/sheet.html +4 -0
- package/snippets/shot-grid.html +2 -2
- package/snippets/sidebar.html +2 -0
- package/snippets/timeline.html +1 -1
- package/snippets/webicon.html +11 -0
package/dist/showcase.css
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/* Showcase components — modern site/marketing building blocks, pure CSS (no JavaScript).
|
|
6
6
|
Colors: Omnia palette tokens only (OKLCH), via the theme tokens of components.css.
|
|
7
7
|
Accent per element: --oc-accent-from / --oc-accent-to (or an .oc-accent--* preset).
|
|
8
|
-
Accent as text color: in dark mode lifted to at least OKLCH L 0.72, so a dark custom accent stays readable
|
|
8
|
+
Accent as text color: in dark mode lifted to at least OKLCH L 0.72, so a dark custom accent stays readable; in light
|
|
9
|
+
mode capped at L 0.52, so a light custom accent (green, gold, orange) stays readable too. */
|
|
9
10
|
|
|
10
11
|
:root {
|
|
11
12
|
--oc-accent-from: var(--oc-brand-1);
|
|
@@ -49,19 +50,25 @@
|
|
|
49
50
|
|
|
50
51
|
/* Buttons: pill shape, gradient fill and glass (combine with .oc-btn) */
|
|
51
52
|
.oc-btn--pill { border-radius: 999px; }
|
|
53
|
+
/* Gradient button: a calm shift inside one color family (from the accent to a slightly deeper tone of it), in the
|
|
54
|
+
normal button shape. No glow underneath and no lift on hover. Colors: --oc-accent-from / --oc-accent-to of the nearest
|
|
55
|
+
.oc-accent--* scope (the brand colors by default). The text color follows the fill; --oc-btn-gradient-ink sets it
|
|
56
|
+
by hand. Add .oc-btn--pill for round ends. */
|
|
52
57
|
.oc-btn--gradient {
|
|
53
|
-
|
|
58
|
+
--oc-btn-gradient-from: var(--oc-accent-from);
|
|
59
|
+
--oc-btn-gradient-to: color-mix(in oklch, var(--oc-accent-from) 72%, var(--oc-accent-to));
|
|
60
|
+
border-color: transparent;
|
|
54
61
|
/* border-box: the gradient also runs under the transparent 1px border of .oc-btn; from the padding box it would
|
|
55
62
|
repeat in that border and show a thin stripe of the other end's color on both sides. */
|
|
56
|
-
background: linear-gradient(
|
|
57
|
-
/* --oc-btn-gradient-ink: dark text on a light accent (set it with the accent). */
|
|
63
|
+
background: linear-gradient(135deg, var(--oc-btn-gradient-from), var(--oc-btn-gradient-to)) border-box;
|
|
58
64
|
color: var(--oc-btn-gradient-ink, var(--color-white-50));
|
|
59
|
-
box-shadow: 0 10px 30px -10px var(--oc-accent-to);
|
|
60
|
-
transition: transform 0.2s var(--oc-ease-out), box-shadow 0.2s;
|
|
61
65
|
}
|
|
62
|
-
|
|
66
|
+
@supports (color: contrast-color(red)) {
|
|
67
|
+
.oc-btn--gradient { color: var(--oc-btn-gradient-ink, contrast-color(var(--oc-btn-gradient-from))); }
|
|
68
|
+
}
|
|
69
|
+
.oc-btn--gradient:hover { filter: brightness(0.93); opacity: 1; }
|
|
70
|
+
/* Glass button: the quiet companion of the gradient button, a soft translucent surface with a clear edge. */
|
|
63
71
|
.oc-btn--glass {
|
|
64
|
-
border-radius: 999px;
|
|
65
72
|
border-color: var(--oc-border-strong);
|
|
66
73
|
background: var(--oc-surface);
|
|
67
74
|
color: var(--oc-foreground);
|
|
@@ -121,8 +128,9 @@
|
|
|
121
128
|
/* Container, section spacing and display headings */
|
|
122
129
|
/* --oc-container is the width, --oc-container-gutter the room on each side on a narrower screen (1.25rem). */
|
|
123
130
|
.oc-container { inline-size: min(100% - 2 * var(--oc-container-gutter, 1.25rem), var(--oc-container, 1200px)); margin-inline: auto; }
|
|
124
|
-
|
|
125
|
-
.oc-section-pad
|
|
131
|
+
/* --oc-section-space and --oc-section-space-tight set the room between sections for a whole site (on :root or a scope). */
|
|
132
|
+
.oc-section-pad { padding-block: var(--oc-section-space, clamp(4rem, 9vw, 7rem)); }
|
|
133
|
+
.oc-section-pad--tight { padding-block: var(--oc-section-space-tight, clamp(2rem, 5vw, 3.5rem)); }
|
|
126
134
|
/* The hero of a home page: a little less room on top and below than a section. */
|
|
127
135
|
.oc-section-pad--hero { padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 6vw, 5rem); }
|
|
128
136
|
.oc-display {
|
|
@@ -177,18 +185,18 @@
|
|
|
177
185
|
--oc-syntax-comment: light-dark(var(--color-gray-60), var(--color-purple-2));
|
|
178
186
|
--oc-syntax-string: light-dark(var(--color-green-80), var(--color-green-2));
|
|
179
187
|
--oc-syntax-keyword: light-dark(var(--color-purple-70), var(--color-purple-2));
|
|
180
|
-
--oc-syntax-variable: light-dark(var(--color-
|
|
181
|
-
--oc-syntax-function: light-dark(var(--color-
|
|
188
|
+
--oc-syntax-variable: light-dark(var(--color-steelblue-80),var(--color-skycyan-30));
|
|
189
|
+
--oc-syntax-function: light-dark(var(--color-steelblue-80),var(--color-skycyan-60));
|
|
182
190
|
--oc-syntax-number: light-dark(var(--color-peru-80), var(--color-peru-40));
|
|
183
191
|
--oc-syntax-operator: light-dark(var(--color-red-70), var(--color-red-50));
|
|
184
|
-
--oc-syntax-constant: light-dark(var(--color-
|
|
192
|
+
--oc-syntax-constant: light-dark(var(--color-steelblue-80),var(--color-skycyan-70));
|
|
185
193
|
--oc-syntax-storage: light-dark(var(--color-green-80), var(--color-green-2));
|
|
186
194
|
--oc-syntax-tag: light-dark(var(--color-brown-70), var(--color-brown-10));
|
|
187
|
-
--oc-syntax-attr: light-dark(var(--color-
|
|
195
|
+
--oc-syntax-attr: light-dark(var(--color-steelblue-80),var(--color-skycyan-70));
|
|
188
196
|
--oc-syntax-prop: light-dark(var(--color-green-80), var(--color-green-2));
|
|
189
197
|
--oc-syntax-value: light-dark(var(--color-teal-80), var(--color-teal-10));
|
|
190
198
|
--oc-syntax-cls: light-dark(var(--color-darkgoldenrod-80), var(--color-wheat-70));
|
|
191
|
-
--oc-syntax-id: light-dark(var(--color-
|
|
199
|
+
--oc-syntax-id: light-dark(var(--color-steelblue-80),var(--color-skycyan-70));
|
|
192
200
|
--oc-syntax-unit: light-dark(var(--color-peru-80), var(--color-peru-40));
|
|
193
201
|
--oc-syntax-key: light-dark(var(--color-brown-70), var(--color-brown-10));
|
|
194
202
|
--oc-code-block-line-number-color: light-dark(var(--color-gray-40), oklch(from var(--color-white-2) l c h / 0.25));
|
|
@@ -205,14 +213,14 @@
|
|
|
205
213
|
.oc-code-window .oc-code-block { margin: 0; border: 0; border-radius: 0; }
|
|
206
214
|
.oc-code-window__body { margin: 0; padding: 1.4rem 1.5rem; font-family: var(--oc-font-mono); font-size: clamp(0.75rem, 1.3vw, 0.92rem); line-height: 1.85; color: var(--oc-foreground); overflow-x: auto; }
|
|
207
215
|
|
|
208
|
-
/* Browser frame around a screenshot */
|
|
216
|
+
/* Browser frame around a screenshot. The shadow is neutral; .oc-browser-frame--glow gives it the accent color. */
|
|
209
217
|
.oc-browser-frame {
|
|
210
218
|
display: block;
|
|
211
219
|
border: 1px solid var(--oc-border-strong);
|
|
212
220
|
border-radius: var(--oc-radius-md);
|
|
213
221
|
background: var(--oc-card);
|
|
214
222
|
overflow: hidden;
|
|
215
|
-
box-shadow: 0 30px 60px -30px oklch(from var(--
|
|
223
|
+
box-shadow: 0 30px 60px -30px light-dark(oklch(from var(--color-black-50) l c h / 0.22), oklch(from var(--color-black-50) l c h / 0.6));
|
|
216
224
|
}
|
|
217
225
|
.oc-browser-frame__bar { display: flex; gap: 0.4rem; padding: 0.6rem 0.8rem; border-block-end: 1px solid var(--oc-border); background: var(--oc-surface-strong); }
|
|
218
226
|
.oc-browser-frame__bar > i { inline-size: 0.6rem; aspect-ratio: 1; border-radius: 50%; background: var(--oc-border-strong); }
|
|
@@ -233,7 +241,7 @@
|
|
|
233
241
|
background:
|
|
234
242
|
linear-gradient(135deg, oklch(from var(--oc-accent-from) l c h / 0.3), oklch(from var(--oc-accent-to) l c h / 0.18)),
|
|
235
243
|
var(--oc-card);
|
|
236
|
-
color: light-dark(var(--oc-accent-from), oklch(from var(--oc-accent-from) max(l, 0.72) c h));
|
|
244
|
+
color: light-dark(oklch(from var(--oc-accent-from) min(l, 0.52) c h), oklch(from var(--oc-accent-from) max(l, 0.72) c h));
|
|
237
245
|
font-size: calc(var(--oc-tile-size) * 0.45);
|
|
238
246
|
line-height: 1;
|
|
239
247
|
}
|
|
@@ -279,7 +287,7 @@
|
|
|
279
287
|
}
|
|
280
288
|
.oc-product-card__top { display: flex; justify-content: space-between; align-items: flex-start; margin-block-end: 0.75rem; }
|
|
281
289
|
.oc-product-card__name { margin: 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
|
|
282
|
-
.oc-product-card__tagline { margin: 0; color: light-dark(var(--oc-accent-from), oklch(from var(--oc-accent-from) max(l, 0.72) c h)); font-weight: 600; font-size: 0.95rem; }
|
|
290
|
+
.oc-product-card__tagline { margin: 0; color: light-dark(oklch(from var(--oc-accent-from) min(l, 0.52) c h), oklch(from var(--oc-accent-from) max(l, 0.72) c h)); font-weight: 600; font-size: 0.95rem; }
|
|
283
291
|
.oc-product-card__summary { margin: 0; color: var(--oc-muted-foreground); font-size: 0.95rem; flex-grow: 1; }
|
|
284
292
|
.oc-product-card__more { display: inline-flex; align-items: center; gap: 0.4rem; margin-block-start: 0.75rem; font-weight: 600; font-size: 0.92rem; }
|
|
285
293
|
.oc-product-card__more::after { content: "\002192"; transition: translate 0.25s var(--oc-ease-out); }
|
|
@@ -301,7 +309,7 @@
|
|
|
301
309
|
.oc-pill--accent {
|
|
302
310
|
border-color: oklch(from var(--oc-accent-from) l c h / 0.45);
|
|
303
311
|
background: oklch(from var(--oc-accent-from) l c h / 0.14);
|
|
304
|
-
color: light-dark(var(--oc-accent-from), oklch(from var(--oc-accent-from) max(l, 0.72) c h));
|
|
312
|
+
color: light-dark(oklch(from var(--oc-accent-from) min(l, 0.52) c h), oklch(from var(--oc-accent-from) max(l, 0.72) c h));
|
|
305
313
|
}
|
|
306
314
|
/* Live dot in a pill (.oc-pill > .oc-status-dot): the ring starts at --oc-status-dot-pulse-alpha of the accent and grows
|
|
307
315
|
to --oc-status-dot-pulse-size. Scoped to the pill: a plain .oc-status-dot is the status light (parts/app-status-dot.css).
|
|
@@ -372,7 +380,7 @@
|
|
|
372
380
|
var(--oc-card);
|
|
373
381
|
}
|
|
374
382
|
.oc-spotlight__title { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0 0.5rem; font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.1; }
|
|
375
|
-
.oc-spotlight__tagline { color: light-dark(var(--oc-accent-from), oklch(from var(--oc-accent-from) max(l, 0.72) c h)); font-size: 1.2rem; font-weight: 600; }
|
|
383
|
+
.oc-spotlight__tagline { color: light-dark(oklch(from var(--oc-accent-from) min(l, 0.52) c h), oklch(from var(--oc-accent-from) max(l, 0.72) c h)); font-size: 1.2rem; font-weight: 600; }
|
|
376
384
|
/* --oc-spotlight-cols: your own ratio above 960px (copy | modules); on a smaller screen the spotlight stacks. */
|
|
377
385
|
@media (min-width: 961px) {
|
|
378
386
|
.oc-spotlight { grid-template-columns: var(--oc-spotlight-cols, repeat(auto-fit, minmax(min(100%, 22rem), 1fr))); }
|
|
@@ -382,6 +390,8 @@
|
|
|
382
390
|
|
|
383
391
|
/* Steps: numbered process with a gradient tick (numbers come from a CSS counter) */
|
|
384
392
|
.oc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; counter-reset: oc-step; }
|
|
393
|
+
/* Four steps: one row of four from about 44rem instead of three and a lone one. */
|
|
394
|
+
.oc-steps:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }
|
|
385
395
|
.oc-steps > li { position: relative; padding: 1.75rem 1.5rem; border-block-start: 2px solid var(--oc-border-strong); counter-increment: oc-step; }
|
|
386
396
|
.oc-steps > li::before { content: ""; position: absolute; inset-block-start: -2px; inset-inline-start: 0; inline-size: 3rem; block-size: 2px; background: var(--oc-gradient-brand); }
|
|
387
397
|
.oc-steps > li::after { content: counter(oc-step, decimal-leading-zero); position: absolute; inset-block-start: 1.75rem; inset-inline-end: 1.5rem; color: var(--oc-brand-1); font-family: var(--oc-font-mono); font-size: 0.85rem; }
|
|
@@ -424,7 +434,16 @@
|
|
|
424
434
|
position: sticky;
|
|
425
435
|
inset-block-start: 0;
|
|
426
436
|
z-index: 50;
|
|
427
|
-
|
|
437
|
+
/* The glass is written as plain declarations with a factor (0 = clear, 1 = glass). Only the factor is animated, so
|
|
438
|
+
the colors keep following the theme, also when it changes while the page is scrolled (a theme switch in a scope). */
|
|
439
|
+
border-block-end: 1px solid color-mix(in oklch, var(--oc-border) calc(var(--oc-header-glass) * 100%), transparent);
|
|
440
|
+
background-color: oklch(from var(--oc-background) l c h / calc(0.72 * var(--oc-header-glass)));
|
|
441
|
+
backdrop-filter: blur(calc(16px * var(--oc-header-glass))) saturate(calc(1 + 0.4 * var(--oc-header-glass)));
|
|
442
|
+
}
|
|
443
|
+
@property --oc-header-glass {
|
|
444
|
+
syntax: "<number>";
|
|
445
|
+
inherits: false;
|
|
446
|
+
initial-value: 0;
|
|
428
447
|
}
|
|
429
448
|
@supports (animation-timeline: scroll()) {
|
|
430
449
|
.oc-site-header {
|
|
@@ -434,11 +453,15 @@
|
|
|
434
453
|
}
|
|
435
454
|
}
|
|
436
455
|
@keyframes oc-header-glass {
|
|
437
|
-
to {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
456
|
+
to { --oc-header-glass: 1; }
|
|
457
|
+
}
|
|
458
|
+
/* No scroll timeline (older browsers) or "reduce motion": the glass is always on, so the sticky bar never sits
|
|
459
|
+
clear over the text below it. */
|
|
460
|
+
@supports not (animation-timeline: scroll()) {
|
|
461
|
+
.oc-site-header { --oc-header-glass: 1; }
|
|
462
|
+
}
|
|
463
|
+
@media (prefers-reduced-motion: reduce) {
|
|
464
|
+
.oc-site-header { --oc-header-glass: 1; }
|
|
442
465
|
}
|
|
443
466
|
.oc-site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; block-size: 4.5rem; }
|
|
444
467
|
.oc-site-header__brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--oc-foreground); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; }
|
|
@@ -473,10 +496,33 @@
|
|
|
473
496
|
background: oklch(from var(--oc-background) l c h / 0.96);
|
|
474
497
|
backdrop-filter: blur(16px);
|
|
475
498
|
}
|
|
476
|
-
|
|
499
|
+
/* Not the items of a dropdown in the menu (language select): they keep their own size. */
|
|
500
|
+
.oc-site-header__nav[popover] a:not(.oc-btn, .oc-dropdown-item) { padding: 0.75rem 0; font-size: 1.1rem; }
|
|
477
501
|
/* The call to action (.oc-site-header__cta, a button) gets room above it in the open menu. */
|
|
478
502
|
.oc-site-header__cta { margin-block-start: 0.75rem; }
|
|
479
503
|
}
|
|
504
|
+
/* --collapse-lg: the menu becomes a popover below 1180px instead of 860px, for a bar with many or long items
|
|
505
|
+
(theme switch, language select, long words). A media query cannot read a variable, so it is a modifier. */
|
|
506
|
+
@media (min-width: 861px) and (max-width: 1180px) {
|
|
507
|
+
.oc-site-header--collapse-lg .oc-site-header__toggle { display: block; }
|
|
508
|
+
.oc-site-header--collapse-lg .oc-site-header__nav[popover]:not(:popover-open) { display: none; }
|
|
509
|
+
.oc-site-header--collapse-lg .oc-site-header__nav[popover]:popover-open {
|
|
510
|
+
position: fixed;
|
|
511
|
+
inset: 4.5rem 0 auto;
|
|
512
|
+
inline-size: auto;
|
|
513
|
+
block-size: auto;
|
|
514
|
+
display: flex;
|
|
515
|
+
flex-direction: column;
|
|
516
|
+
align-items: stretch;
|
|
517
|
+
gap: 0.25rem;
|
|
518
|
+
padding: 1rem 1.25rem 1.5rem;
|
|
519
|
+
border-block-end: 1px solid var(--oc-border);
|
|
520
|
+
background: oklch(from var(--oc-background) l c h / 0.96);
|
|
521
|
+
backdrop-filter: blur(16px);
|
|
522
|
+
}
|
|
523
|
+
.oc-site-header--collapse-lg .oc-site-header__nav[popover] a:not(.oc-btn, .oc-dropdown-item) { padding: 0.75rem 0; font-size: 1.1rem; }
|
|
524
|
+
.oc-site-header--collapse-lg .oc-site-header__cta { margin-block-start: 0.75rem; }
|
|
525
|
+
}
|
|
480
526
|
|
|
481
527
|
/* Site footer: brand column + link columns + bottom bar */
|
|
482
528
|
.oc-site-footer {
|
package/dist/theme.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// File: packages/ui/src/theme.js
|
|
2
|
+
// Map: read / write the stored choice -> apply (data-theme, .dark, color-scheme) -> sync switches and toggle buttons
|
|
3
|
+
// -> listen (radios, toggle buttons, other tabs) -> head snippet against a flash -> boot
|
|
4
|
+
// Theme helper: remembers the choice of a .oc-theme-switch (system / light / dark) and puts it on <html> as
|
|
5
|
+
// data-theme, so CSS and scripts have one place to look. The switch itself keeps working without this script.
|
|
6
|
+
// <html data-theme="dark" class="dark"> chosen dark (no attribute = follow the operating system)
|
|
7
|
+
// <fieldset class="oc-theme-switch"> … radios name="oc-theme" value="system | light | dark"
|
|
8
|
+
// <button data-oc-theme-toggle> one button: light <-> dark (aria-pressed = dark)
|
|
9
|
+
// <button data-oc-theme-set="dark"> a button for one value (cards on a settings page; aria-pressed)
|
|
10
|
+
// Switches inside .oc-theme-scope theme only their own element and are left alone.
|
|
11
|
+
// Against a flash of the wrong theme on load: put THEME_HEAD_SCRIPT inline in <head>, before the stylesheets.
|
|
12
|
+
|
|
13
|
+
const VALUES = ["system", "light", "dark"];
|
|
14
|
+
|
|
15
|
+
/** "light", "dark" or "system" (also for an unknown or missing value). */
|
|
16
|
+
export function normalizeTheme(value) {
|
|
17
|
+
return VALUES.includes(value) ? value : "system";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The stored choice, "system" when nothing is stored or storage is blocked. */
|
|
21
|
+
export function readTheme(storage, key = "oc-theme") {
|
|
22
|
+
try { return normalizeTheme(storage?.getItem(key)); } catch { return "system"; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Store the choice; "system" removes the key. Returns false when storage is blocked. */
|
|
26
|
+
export function writeTheme(storage, value, key = "oc-theme") {
|
|
27
|
+
try {
|
|
28
|
+
if (normalizeTheme(value) === "system") storage?.removeItem(key);
|
|
29
|
+
else storage?.setItem(key, value);
|
|
30
|
+
return true;
|
|
31
|
+
} catch { return false; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The theme that is shown: the choice, or the operating system for "system". */
|
|
35
|
+
export function effectiveTheme(choice, prefersDark) {
|
|
36
|
+
const value = normalizeTheme(choice);
|
|
37
|
+
return value === "system" ? (prefersDark ? "dark" : "light") : value;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Put the choice on the root element: data-theme="light|dark" (removed for "system") and, with darkClass, the class
|
|
42
|
+
* .dark for code that looks at a class. Returns the theme that is shown.
|
|
43
|
+
*/
|
|
44
|
+
export function applyTheme(root, choice, { darkClass = true, prefersDark = false } = {}) {
|
|
45
|
+
const value = normalizeTheme(choice);
|
|
46
|
+
const shown = effectiveTheme(value, prefersDark);
|
|
47
|
+
if (value === "system") root.removeAttribute("data-theme");
|
|
48
|
+
else root.setAttribute("data-theme", value);
|
|
49
|
+
if (darkClass) root.classList.toggle("dark", value === "dark");
|
|
50
|
+
return shown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Inline script for <head>: sets data-theme (and .dark) before the first paint. The key must match initTheme. */
|
|
54
|
+
export const THEME_HEAD_SCRIPT = '(function(){try{var t=localStorage.getItem("oc-theme"),d=document.documentElement;if(t==="light"||t==="dark"){d.setAttribute("data-theme",t);if(t==="dark")d.classList.add("dark")}}catch(e){}})();';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Remember the theme and keep every switch and button on the page in step.
|
|
58
|
+
* @param {Document} doc
|
|
59
|
+
* @param {{ storageKey?: string, darkClass?: boolean, name?: string }} options
|
|
60
|
+
* storageKey: localStorage key ("oc-theme"); darkClass: also toggle .dark on <html> (true);
|
|
61
|
+
* name: only radios with this name (default: every .oc-theme-switch outside a .oc-theme-scope).
|
|
62
|
+
* @returns {{ get: () => string, set: (value: string) => void, stop: () => void }}
|
|
63
|
+
*/
|
|
64
|
+
export function initTheme(doc = document, { storageKey = "oc-theme", darkClass = true, name } = {}) {
|
|
65
|
+
const win = doc.defaultView;
|
|
66
|
+
const root = doc.documentElement;
|
|
67
|
+
const media = win?.matchMedia?.("(prefers-color-scheme: dark)");
|
|
68
|
+
let storage = null;
|
|
69
|
+
try { storage = win?.localStorage ?? null; } catch { storage = null; }
|
|
70
|
+
let choice = readTheme(storage, storageKey);
|
|
71
|
+
|
|
72
|
+
const radios = () => [...doc.querySelectorAll(".oc-theme-switch input[type=radio]")]
|
|
73
|
+
.filter((input) => !input.closest(".oc-theme-scope") && (!name || input.name === name));
|
|
74
|
+
const sync = () => {
|
|
75
|
+
const shown = applyTheme(root, choice, { darkClass, prefersDark: !!media?.matches });
|
|
76
|
+
for (const input of radios()) input.checked = input.value === choice;
|
|
77
|
+
for (const button of doc.querySelectorAll("[data-oc-theme-toggle]")) button.setAttribute("aria-pressed", shown === "dark" ? "true" : "false");
|
|
78
|
+
for (const button of doc.querySelectorAll("[data-oc-theme-set]")) button.setAttribute("aria-pressed", button.getAttribute("data-oc-theme-set") === choice ? "true" : "false");
|
|
79
|
+
root.dispatchEvent(new win.CustomEvent("oc-theme-change", { detail: { choice, theme: shown } }));
|
|
80
|
+
};
|
|
81
|
+
const set = (value) => {
|
|
82
|
+
choice = normalizeTheme(value);
|
|
83
|
+
writeTheme(storage, choice, storageKey);
|
|
84
|
+
sync();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const onChange = (event) => {
|
|
88
|
+
const input = event.target;
|
|
89
|
+
if (input?.matches?.(".oc-theme-switch input[type=radio]") && radios().includes(input) && input.checked) set(input.value);
|
|
90
|
+
};
|
|
91
|
+
const onClick = (event) => {
|
|
92
|
+
const toggle = event.target.closest?.("[data-oc-theme-toggle]");
|
|
93
|
+
if (toggle) return set(effectiveTheme(choice, !!media?.matches) === "dark" ? "light" : "dark");
|
|
94
|
+
const one = event.target.closest?.("[data-oc-theme-set]");
|
|
95
|
+
if (one) set(one.getAttribute("data-oc-theme-set"));
|
|
96
|
+
};
|
|
97
|
+
// Another tab changed the choice, or the operating system switched while the choice is "system".
|
|
98
|
+
const onStorage = (event) => { if (event.key === storageKey) { choice = readTheme(storage, storageKey); sync(); } };
|
|
99
|
+
const onSystem = () => { if (choice === "system") sync(); };
|
|
100
|
+
|
|
101
|
+
doc.addEventListener("change", onChange);
|
|
102
|
+
doc.addEventListener("click", onClick);
|
|
103
|
+
win?.addEventListener("storage", onStorage);
|
|
104
|
+
media?.addEventListener?.("change", onSystem);
|
|
105
|
+
sync();
|
|
106
|
+
return {
|
|
107
|
+
get: () => choice,
|
|
108
|
+
set,
|
|
109
|
+
stop() {
|
|
110
|
+
doc.removeEventListener("change", onChange);
|
|
111
|
+
doc.removeEventListener("click", onClick);
|
|
112
|
+
win?.removeEventListener("storage", onStorage);
|
|
113
|
+
media?.removeEventListener?.("change", onSystem);
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Starts on its own as /js/oc-theme.js (`npx omniaui copy-js theme`), with ?auto in the URL or data-oc-auto on the tag.
|
|
119
|
+
function autoStart() {
|
|
120
|
+
if (typeof document === "undefined") return false;
|
|
121
|
+
const url = String(import.meta.url);
|
|
122
|
+
if (url.includes("oc-theme") || /[?&]auto(=|&|$)/.test(url)) return true;
|
|
123
|
+
const file = url.split(/[?#]/)[0];
|
|
124
|
+
return [...document.querySelectorAll("script[data-oc-auto][src]")].some((s) => s.src.split(/[?#]/)[0] === file);
|
|
125
|
+
}
|
|
126
|
+
if (autoStart()) {
|
|
127
|
+
const boot = () => initTheme(document);
|
|
128
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
|
|
129
|
+
else boot();
|
|
130
|
+
}
|
package/manifest.json
CHANGED
|
@@ -1392,6 +1392,14 @@
|
|
|
1392
1392
|
"@birdycom/omniaui"
|
|
1393
1393
|
]
|
|
1394
1394
|
},
|
|
1395
|
+
{
|
|
1396
|
+
"name": "paper",
|
|
1397
|
+
"file": "snippets/paper.html",
|
|
1398
|
+
"description": "An off-white paper surface with a fine grain: tones, writing paper with lines, squares or dots, and paper edges",
|
|
1399
|
+
"requires": [
|
|
1400
|
+
"@birdycom/omniaui"
|
|
1401
|
+
]
|
|
1402
|
+
},
|
|
1395
1403
|
{
|
|
1396
1404
|
"name": "particle-field",
|
|
1397
1405
|
"file": "snippets/particle-field.html",
|
|
@@ -1431,6 +1439,38 @@
|
|
|
1431
1439
|
"requires": [
|
|
1432
1440
|
"@birdycom/omniaui"
|
|
1433
1441
|
]
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
"name": "code-plate",
|
|
1445
|
+
"file": "snippets/code-plate.html",
|
|
1446
|
+
"description": "A QR code or barcode on its own white plate, with a caption on the plate itself (scans in any theme, the label is on a photo or print too)",
|
|
1447
|
+
"requires": [
|
|
1448
|
+
"@birdycom/omniaui"
|
|
1449
|
+
]
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
"name": "logo",
|
|
1453
|
+
"file": "snippets/logo.html",
|
|
1454
|
+
"description": "A customer logo in its own colors and ratio, never filtered, with a neutral plate only in the theme where it would disappear",
|
|
1455
|
+
"requires": [
|
|
1456
|
+
"@birdycom/omniaui"
|
|
1457
|
+
]
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
"name": "mode-badge",
|
|
1461
|
+
"file": "snippets/mode-badge.html",
|
|
1462
|
+
"description": "Test and live at a glance: a badge in fixed mode colors (also on a photo or print), \"both\" as two parts side by side",
|
|
1463
|
+
"requires": [
|
|
1464
|
+
"@birdycom/omniaui"
|
|
1465
|
+
]
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
"name": "webicon",
|
|
1469
|
+
"file": "snippets/webicon.html",
|
|
1470
|
+
"description": "An icon by name from the six webicon sets as inline SVG in currentColor, from icon data the app bundles (no network)",
|
|
1471
|
+
"requires": [
|
|
1472
|
+
"@birdycom/omniaui"
|
|
1473
|
+
]
|
|
1434
1474
|
}
|
|
1435
1475
|
]
|
|
1436
1476
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@birdycom/omniaui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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",
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"./fly.js": "./dist/fly.js",
|
|
38
38
|
"./particles.js": "./dist/particles.js",
|
|
39
39
|
"./toc.js": "./dist/toc.js",
|
|
40
|
+
"./theme.js": "./dist/theme.js",
|
|
40
41
|
"./language-select.js": "./dist/language-select.js",
|
|
42
|
+
"./combobox.js": "./dist/combobox.js",
|
|
43
|
+
"./logo.js": "./dist/logo.js",
|
|
41
44
|
"./manifest.json": "./manifest.json",
|
|
42
45
|
"./package.json": "./package.json"
|
|
43
46
|
},
|
|
@@ -65,7 +68,7 @@
|
|
|
65
68
|
"omniaui": "./bin/omniaui.mjs"
|
|
66
69
|
},
|
|
67
70
|
"peerDependencies": {
|
|
68
|
-
"@birdycom/omniacss": "^0.
|
|
71
|
+
"@birdycom/omniacss": "^0.16.1"
|
|
69
72
|
},
|
|
70
73
|
"peerDependenciesMeta": {
|
|
71
74
|
"@birdycom/omniacss": {
|
package/snippets/card.html
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<!-- OmniaUI component: card — Card with header, content, footer. Needs @birdycom/omniaui CSS.
|
|
1
|
+
<!-- OmniaUI component: card — Card with header, content, footer. Needs @birdycom/omniaui CSS.
|
|
2
|
+
Accent (0.16.0): .oc-card--accent[data-tone="primary|info|success|warning|destructive|test|live"] (2px border in that
|
|
3
|
+
color) + .oc-card-band at the top (soft band: a badge, .oc-card-band__title with a <small> line, a status);
|
|
4
|
+
data-active="false" = a set that is not in use now (dashed). -->
|
|
2
5
|
<div class="oc-card">
|
|
3
6
|
<div class="oc-card-header">
|
|
4
7
|
<h3 class="oc-card-title">Create project</h3>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- OmniaUI component: code-plate - A QR code or barcode on its own white plate, with a caption on the plate itself (scans in any theme, the label is on a photo or print too). Needs @birdycom/omniaui CSS.
|
|
2
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
3
|
+
figure.oc-code-plate: the white plate (always light). Modifier: --sm (for a code of about 72px).
|
|
4
|
+
Child: the code (img, svg, canvas or .oc-barcode), then figcaption.oc-code-plate__caption.
|
|
5
|
+
data-mode="test|live|both": the caption in the mode colors; "both" = two spans in the caption.
|
|
6
|
+
-->
|
|
7
|
+
<figure class="oc-code-plate" data-mode="test" style="inline-size: 12rem">
|
|
8
|
+
<img src="/img/samples/qr-company-1-test.svg" alt="QR code to join the test round of Company 1" width="192" height="192">
|
|
9
|
+
<figcaption class="oc-code-plate__caption">Test</figcaption>
|
|
10
|
+
</figure>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- OmniaUI component: collapsible - Card-style details/summary form section with icon, title and chevron. Needs @birdycom/omniaui CSS.
|
|
2
2
|
Class API (modifiers are extra classes / attributes on the same element):
|
|
3
|
-
details.oc-collapsible: Root.
|
|
3
|
+
details.oc-collapsible: Root. Modifiers: --dense (compact paddings), --plain (no card: for lists inside a panel, a line between neighbours).
|
|
4
4
|
summary: Header row with .oc-collapsible-icon + .oc-collapsible-title; the chevron is CSS
|
|
5
5
|
.oc-collapsible-content: Body with a top border
|
|
6
6
|
Slots: icon, title (summary), content (default)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<div class="oc-collapsible-content">
|
|
14
14
|
<div class="oc-field">
|
|
15
15
|
<label class="oc-field-label" for="oc-collapsible-name">Name</label>
|
|
16
|
-
<input class="oc-input" id="oc-collapsible-name" value="
|
|
16
|
+
<input class="oc-input" id="oc-collapsible-name" value="Company 1 BV">
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
</details>
|
package/snippets/combobox.html
CHANGED
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
ul.oc-combobox-list: role="listbox"
|
|
6
6
|
li.oc-combobox-option: role="option" tabindex="-1"; aria-selected="true" shows a check; [data-active] marks the keyboard-active option
|
|
7
7
|
.oc-combobox-group / .oc-combobox-empty: group heading and empty message
|
|
8
|
+
Icons (0.16.0): span.oc-combobox-option-icon first in an option (svg, iconify-icon or img); span.oc-combobox-icon first in
|
|
9
|
+
the wrapper shows the icon of the chosen value in the field. Options without an icon line up with the others.
|
|
10
|
+
Behaviour: data-oc-combobox + oc-combobox.js (npx omniaui copy-js combobox) filters while typing, moves with the arrow keys,
|
|
11
|
+
chooses with Enter or a click, closes with Escape, copies the icon into the field; event oc-combobox-change { value, label }.
|
|
8
12
|
-->
|
|
9
13
|
<div class="oc-combobox">
|
|
10
14
|
<input class="oc-input oc-combobox-input" type="text" role="combobox" aria-expanded="false" aria-controls="oc-cb-list" aria-autocomplete="list" placeholder="Select framework…" aria-label="Framework">
|
|
@@ -17,3 +21,18 @@
|
|
|
17
21
|
<li class="oc-combobox-option" role="option" tabindex="-1">Vue</li>
|
|
18
22
|
</ul>
|
|
19
23
|
</div>
|
|
24
|
+
|
|
25
|
+
<!-- With icons in front of the options and of the chosen value (needs oc-combobox.js for typing and the keyboard) -->
|
|
26
|
+
<div class="oc-combobox" data-oc-combobox>
|
|
27
|
+
<span class="oc-combobox-icon" aria-hidden="true"><iconify-icon icon="mdi:source-branch" aria-hidden="true"></iconify-icon></span>
|
|
28
|
+
<input class="oc-input oc-combobox-input" type="text" role="combobox" aria-expanded="false" aria-controls="oc-cb-icons" aria-autocomplete="list" placeholder="Choose a source…" aria-label="Source">
|
|
29
|
+
<input type="hidden" name="source" value="">
|
|
30
|
+
<ul class="oc-combobox-list" id="oc-cb-icons" role="listbox" aria-label="Sources">
|
|
31
|
+
<li class="oc-combobox-option" role="option" tabindex="-1" data-value="github"><span class="oc-combobox-option-icon" aria-hidden="true"><iconify-icon icon="mdi:github" aria-hidden="true"></iconify-icon></span>GitHub</li>
|
|
32
|
+
<li class="oc-combobox-option" role="option" tabindex="-1" data-value="gitlab"><span class="oc-combobox-option-icon" aria-hidden="true"><iconify-icon icon="mdi:gitlab" aria-hidden="true"></iconify-icon></span>GitLab</li>
|
|
33
|
+
<li class="oc-combobox-option" role="option" tabindex="-1" data-value="folder"><span class="oc-combobox-option-icon" aria-hidden="true"><iconify-icon icon="mdi:folder-outline" aria-hidden="true"></iconify-icon></span>Local folder</li>
|
|
34
|
+
<li class="oc-combobox-option" role="option" tabindex="-1" data-value="other">Other</li>
|
|
35
|
+
<li class="oc-combobox-empty" role="presentation" hidden>No results</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</div>
|
|
38
|
+
<script type="module" src="/js/oc-combobox.js"></script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Class API (modifiers are extra classes / attributes on the same element):
|
|
3
3
|
.oc-dropdown-menu.oc-context-menu[popover]: the menu (role="menu"); position from --oc-context-x / --oc-context-y
|
|
4
4
|
.oc-context-area: dashed right-click target (demo styling)
|
|
5
|
-
Script: contextmenu -> preventDefault, set the two variables, showPopover()
|
|
5
|
+
Script: contextmenu -> preventDefault, set the two variables, showPopover() (after pointerup while a button is down: Firefox)
|
|
6
6
|
-->
|
|
7
7
|
<div class="oc-context-area" id="oc-ctx-area" tabindex="0">Right-click (or press the menu key) here</div>
|
|
8
8
|
<div class="oc-dropdown-menu oc-context-menu" id="oc-ctx-menu" popover role="menu" aria-label="Actions">
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
e.preventDefault();
|
|
20
20
|
menu.style.setProperty('--oc-context-x', Math.min(e.clientX, innerWidth - 220) + 'px');
|
|
21
21
|
menu.style.setProperty('--oc-context-y', Math.min(e.clientY, innerHeight - 220) + 'px');
|
|
22
|
-
|
|
22
|
+
// Firefox fires contextmenu while the right button is still down: open after the release,
|
|
23
|
+
// or that release would close the menu again right away.
|
|
24
|
+
if (e.buttons) window.addEventListener('pointerup', function () { setTimeout(function () { menu.showPopover(); }); }, { once: true });
|
|
25
|
+
else menu.showPopover();
|
|
23
26
|
});
|
|
24
27
|
})();
|
|
25
28
|
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<h3 class="oc-dl-title">Company data found</h3>
|
|
15
15
|
<p class="oc-dl-description">Retrieved from the VAT register.</p>
|
|
16
16
|
<dl class="oc-dl">
|
|
17
|
-
<div class="oc-dl-row"><dt class="oc-dl-term">Name</dt><dd class="oc-dl-detail">
|
|
17
|
+
<div class="oc-dl-row"><dt class="oc-dl-term">Name</dt><dd class="oc-dl-detail">Company 1 BV</dd></div>
|
|
18
18
|
<div class="oc-dl-row"><dt class="oc-dl-term">Enterprise number</dt><dd class="oc-dl-detail">BE 0123.456.789</dd></div>
|
|
19
19
|
<div class="oc-dl-row"><dt class="oc-dl-term">Address</dt><dd class="oc-dl-detail">Main Street 1, 2000 Antwerp</dd></div>
|
|
20
20
|
</dl>
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
.oc-dropdown-sub > button.oc-dropdown-item + .oc-dropdown-submenu: nested menu (opens on hover and focus-within, chevron added)
|
|
4
4
|
.oc-dropdown-item[role="menuitemcheckbox"|"menuitemradio"][aria-checked]: check mark / dot indicator
|
|
5
5
|
.oc-dropdown-shortcut: right aligned key hint
|
|
6
|
+
.oc-dropdown-icon (0.16.0): icon in front of the label; items without one line up with the others
|
|
6
7
|
.oc-dropdown-item--destructive | --inset | [aria-disabled=true]
|
|
7
8
|
-->
|
|
8
9
|
<button class="oc-btn oc-btn--outline" type="button" popovertarget="oc-dd-extras">Open menu</button>
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
.oc-language-select: Pill frame around icon and select. Modifiers: --ghost (no frame), --currency (symbol in primary color).
|
|
5
5
|
.oc-language-select-icon: Leading icon (inline SVG) or symbol; aria-hidden="true"
|
|
6
6
|
.oc-language-select-control: The native <select> (give it an aria-label)
|
|
7
|
+
Menu (0.16.0): button.oc-language-select[popovertarget] + .oc-dropdown-menu.oc-language-menu[popover]: one link per
|
|
8
|
+
language (hreflang + lang) with .oc-language-flag (flag webicon), the name in that language, .oc-language-menu-code,
|
|
9
|
+
and a check at aria-current="true". Trigger: .oc-language-flag + .oc-language-select-code ("NL") or the name;
|
|
10
|
+
--icon = round icon-only trigger (globe or flag) with the name in aria-label and a tooltip (oc-tooltip). No script.
|
|
7
11
|
States: :focus-within (ring), disabled select (dimmed)
|
|
8
12
|
Behaviour: the app listens to "change" (navigate to /nl/..., set a cookie, or submit the form).
|
|
9
13
|
-->
|
|
@@ -35,3 +39,14 @@
|
|
|
35
39
|
</select>
|
|
36
40
|
</label>
|
|
37
41
|
</div>
|
|
42
|
+
|
|
43
|
+
<!-- Menu with flags: the trigger shows the flag and the code, the list the flag, the name in that language and a check -->
|
|
44
|
+
<button type="button" class="oc-language-select" popovertarget="oc-language-flags" aria-label="Language: Nederlands">
|
|
45
|
+
<span class="oc-language-flag" aria-hidden="true"><iconify-icon icon="flag:nl-4x3" aria-hidden="true"></iconify-icon></span>
|
|
46
|
+
<span class="oc-language-select-code">NL</span>
|
|
47
|
+
</button>
|
|
48
|
+
<div class="oc-dropdown-menu oc-language-menu" id="oc-language-flags" popover aria-label="Language">
|
|
49
|
+
<a class="oc-dropdown-item" href="/en/" hreflang="en" lang="en"><span class="oc-language-flag" aria-hidden="true"><iconify-icon icon="flag:gb-4x3" aria-hidden="true"></iconify-icon></span><span>English</span><span class="oc-language-menu-code" aria-hidden="true">EN</span></a>
|
|
50
|
+
<a class="oc-dropdown-item" href="/nl/" hreflang="nl" lang="nl" aria-current="true"><span class="oc-language-flag" aria-hidden="true"><iconify-icon icon="flag:nl-4x3" aria-hidden="true"></iconify-icon></span><span>Nederlands</span><span class="oc-language-menu-code" aria-hidden="true">NL</span></a>
|
|
51
|
+
<a class="oc-dropdown-item" href="/fr/" hreflang="fr" lang="fr"><span class="oc-language-flag" aria-hidden="true"><iconify-icon icon="flag:fr-4x3" aria-hidden="true"></iconify-icon></span><span>Français</span><span class="oc-language-menu-code" aria-hidden="true">FR</span></a>
|
|
52
|
+
</div>
|
package/snippets/live-frame.html
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Class API (modifiers are extra classes on the same element):
|
|
4
4
|
.oc-live-frame: box with the ratio of the virtual size; its iframe / video / img / .oc-live-frame__content is laid out
|
|
5
5
|
at that size and scaled to the box width (pure CSS: tan(atan2(100cqi, width)))
|
|
6
|
-
Modifiers: --static (clicks and scrolling pass through: a picture of a page)
|
|
6
|
+
Modifiers: --static (clicks and scrolling pass through: a picture of a page), --phone / --tv (a device bezel;
|
|
7
|
+
phone 390 x 844 at most --oc-live-phone-max wide; bezel color --oc-live-bezel)
|
|
8
|
+
inert on the iframe: only to look at (no focus, no clicks, hidden from screen readers)
|
|
7
9
|
Tokens: --oc-live-w, --oc-live-h (unitless px, default 1280 x 720)
|
|
8
10
|
Also on .oc-browser-frame__view, the view slot of the browser frame.
|
|
9
11
|
Slots: the iframe (or other content). Give the iframe a title; scrolling="no" hides its scrollbar.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- OmniaUI component: logo - A customer logo in its own colors and ratio, never filtered, with a neutral plate only in the theme where it would disappear. Needs @birdycom/omniaui CSS.
|
|
2
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
3
|
+
.oc-logo > img: the logo at --oc-logo-h (height), at most --oc-logo-w wide. Modifier: --box (the same box for every logo).
|
|
4
|
+
data-plate="light" (a white logo: a plate in the light theme) | "dark" (a dark logo: a plate in the dark theme) |
|
|
5
|
+
"both" (a mid plate in both) | "none" | "auto" (measured once by oc-logo.js: npx omniaui copy-js logo).
|
|
6
|
+
Tokens: --oc-logo-plate-light, --oc-logo-plate-dark, --oc-logo-plate-both.
|
|
7
|
+
The image must be same-origin (or send CORS headers) for "auto"; otherwise it stays without a plate.
|
|
8
|
+
-->
|
|
9
|
+
<span class="oc-logo" data-plate="auto"><img src="/uploads/logo-company-1.svg" alt="Company 1"></span>
|
|
10
|
+
<script type="module" src="/js/oc-logo.js"></script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- OmniaUI component: mode-badge - Test and live at a glance: a badge in fixed mode colors (also on a photo or print), "both" as two parts side by side. Needs @birdycom/omniaui CSS.
|
|
2
|
+
Class API (modifiers are extra classes / attributes on the same element):
|
|
3
|
+
.oc-mode-badge[data-mode="test|live|both"]: the badge (test amber, live green, the same in light and dark mode)
|
|
4
|
+
Modifiers: --sm, --lg. data-mode="both": two child spans (Test, Live), each in its own color.
|
|
5
|
+
Tokens: --oc-mode-test, --oc-mode-live, --oc-mode-ink (text). Also used by .oc-card--accent[data-tone="test|live"]
|
|
6
|
+
and .oc-code-plate[data-mode].
|
|
7
|
+
-->
|
|
8
|
+
<span class="oc-mode-badge" data-mode="test">Test</span>
|
|
9
|
+
<span class="oc-mode-badge" data-mode="live">Live</span>
|
|
10
|
+
<span class="oc-mode-badge" data-mode="both"><span>Test</span><span>Live</span></span>
|
|
11
|
+
<span class="oc-mode-badge oc-mode-badge--sm" data-mode="live">Live</span>
|
|
12
|
+
<span class="oc-mode-badge oc-mode-badge--lg" data-mode="test">Test</span>
|
|
@@ -10,6 +10,6 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<a class="oc-next-teaser oc-accent--violet" href="#next">
|
|
12
12
|
<span class="oc-next-teaser__label">Next product</span>
|
|
13
|
-
<span class="oc-next-teaser__name"><span class="oc-product-mark oc-product-mark--sm oc-accent--violet" aria-hidden="true">◉</span>
|
|
13
|
+
<span class="oc-next-teaser__name"><span class="oc-product-mark oc-product-mark--sm oc-accent--violet" aria-hidden="true">◉</span>Product 1</span>
|
|
14
14
|
<span class="oc-next-teaser__tagline">The design system behind our apps</span>
|
|
15
15
|
</a>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<section class="oc-section-pad--page" style="inline-size:100%">
|
|
14
14
|
<div class="oc-container">
|
|
15
15
|
<p class="oc-eyebrow">Contact</p>
|
|
16
|
-
<h1 class="oc-display oc-display--page">Let's
|
|
16
|
+
<h1 class="oc-display oc-display--page">Let's talk</h1>
|
|
17
17
|
<p class="oc-lead">A new project, a question about one of our apps or help with your IT? We would like to hear from you.</p>
|
|
18
18
|
<p class="oc-meta">Version 2 · 30 October 2026</p>
|
|
19
19
|
<div class="oc-actions">
|