@orange-halo/components 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +968 -362
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +1 -2
- package/dist/base.js.map +1 -1
- package/dist/index.d.ts +4 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/oh-accordion.d.ts +53 -8
- package/dist/oh-accordion.d.ts.map +1 -1
- package/dist/oh-accordion.js +99 -29
- package/dist/oh-accordion.js.map +1 -1
- package/dist/oh-alert.d.ts +26 -8
- package/dist/oh-alert.d.ts.map +1 -1
- package/dist/oh-alert.js +96 -36
- package/dist/oh-alert.js.map +1 -1
- package/dist/oh-badge.d.ts +32 -13
- package/dist/oh-badge.d.ts.map +1 -1
- package/dist/oh-badge.js +38 -19
- package/dist/oh-badge.js.map +1 -1
- package/dist/oh-breadcrumb.d.ts +39 -12
- package/dist/oh-breadcrumb.d.ts.map +1 -1
- package/dist/oh-breadcrumb.js +66 -25
- package/dist/oh-breadcrumb.js.map +1 -1
- package/dist/oh-button.d.ts +49 -23
- package/dist/oh-button.d.ts.map +1 -1
- package/dist/oh-button.figma.js +1 -3
- package/dist/oh-button.figma.js.map +1 -1
- package/dist/oh-button.js +133 -82
- package/dist/oh-button.js.map +1 -1
- package/dist/oh-card.d.ts +47 -19
- package/dist/oh-card.d.ts.map +1 -1
- package/dist/oh-card.js +143 -96
- package/dist/oh-card.js.map +1 -1
- package/dist/oh-checkbox-group.d.ts +56 -12
- package/dist/oh-checkbox-group.d.ts.map +1 -1
- package/dist/oh-checkbox-group.figma.js +4 -6
- package/dist/oh-checkbox-group.figma.js.map +1 -1
- package/dist/oh-checkbox-group.js +114 -49
- package/dist/oh-checkbox-group.js.map +1 -1
- package/dist/oh-checkbox.d.ts +54 -17
- package/dist/oh-checkbox.d.ts.map +1 -1
- package/dist/oh-checkbox.js +117 -60
- package/dist/oh-checkbox.js.map +1 -1
- package/dist/oh-cluster.d.ts +19 -14
- package/dist/oh-cluster.d.ts.map +1 -1
- package/dist/oh-cluster.js +19 -19
- package/dist/oh-cluster.js.map +1 -1
- package/dist/oh-container.d.ts +19 -16
- package/dist/oh-container.d.ts.map +1 -1
- package/dist/oh-container.js +21 -23
- package/dist/oh-container.js.map +1 -1
- package/dist/oh-drawer.d.ts +28 -11
- package/dist/oh-drawer.d.ts.map +1 -1
- package/dist/oh-drawer.js +52 -24
- package/dist/oh-drawer.js.map +1 -1
- package/dist/oh-footer.d.ts +37 -18
- package/dist/oh-footer.d.ts.map +1 -1
- package/dist/oh-footer.js +38 -19
- package/dist/oh-footer.js.map +1 -1
- package/dist/oh-grid.d.ts +27 -14
- package/dist/oh-grid.d.ts.map +1 -1
- package/dist/oh-grid.js +28 -21
- package/dist/oh-grid.js.map +1 -1
- package/dist/oh-icon.d.ts +21 -5
- package/dist/oh-icon.d.ts.map +1 -1
- package/dist/oh-icon.js +27 -9
- package/dist/oh-icon.js.map +1 -1
- package/dist/oh-input.d.ts +110 -21
- package/dist/oh-input.d.ts.map +1 -1
- package/dist/oh-input.figma.js +2 -2
- package/dist/oh-input.figma.js.map +1 -1
- package/dist/oh-input.js +227 -71
- package/dist/oh-input.js.map +1 -1
- package/dist/oh-link.d.ts +42 -19
- package/dist/oh-link.d.ts.map +1 -1
- package/dist/oh-link.js +83 -38
- package/dist/oh-link.js.map +1 -1
- package/dist/oh-modal.d.ts +35 -6
- package/dist/oh-modal.d.ts.map +1 -1
- package/dist/oh-modal.js +90 -39
- package/dist/oh-modal.js.map +1 -1
- package/dist/oh-navbar.d.ts +42 -19
- package/dist/oh-navbar.d.ts.map +1 -1
- package/dist/oh-navbar.js +44 -20
- package/dist/oh-navbar.js.map +1 -1
- package/dist/oh-progress.d.ts +26 -7
- package/dist/oh-progress.d.ts.map +1 -1
- package/dist/oh-progress.js +35 -14
- package/dist/oh-progress.js.map +1 -1
- package/dist/oh-radio-group.d.ts +55 -13
- package/dist/oh-radio-group.d.ts.map +1 -1
- package/dist/oh-radio-group.figma.js +2 -2
- package/dist/oh-radio-group.figma.js.map +1 -1
- package/dist/oh-radio-group.js +122 -51
- package/dist/oh-radio-group.js.map +1 -1
- package/dist/oh-radio.d.ts +55 -17
- package/dist/oh-radio.d.ts.map +1 -1
- package/dist/oh-radio.js +120 -61
- package/dist/oh-radio.js.map +1 -1
- package/dist/oh-select.d.ts +59 -16
- package/dist/oh-select.d.ts.map +1 -1
- package/dist/oh-select.js +141 -69
- package/dist/oh-select.js.map +1 -1
- package/dist/oh-skip-link.d.ts +33 -15
- package/dist/oh-skip-link.d.ts.map +1 -1
- package/dist/oh-skip-link.js +43 -32
- package/dist/oh-skip-link.js.map +1 -1
- package/dist/oh-stack.d.ts +17 -14
- package/dist/oh-stack.d.ts.map +1 -1
- package/dist/oh-stack.js +18 -20
- package/dist/oh-stack.js.map +1 -1
- package/dist/oh-tabs.d.ts +55 -30
- package/dist/oh-tabs.d.ts.map +1 -1
- package/dist/oh-tabs.js +100 -76
- package/dist/oh-tabs.js.map +1 -1
- package/dist/oh-textarea.d.ts +129 -0
- package/dist/oh-textarea.d.ts.map +1 -0
- package/dist/oh-textarea.js +401 -0
- package/dist/oh-textarea.js.map +1 -0
- package/dist/oh-toggle.d.ts +45 -12
- package/dist/oh-toggle.d.ts.map +1 -1
- package/dist/oh-toggle.js +84 -34
- package/dist/oh-toggle.js.map +1 -1
- package/dist/styles/typography.js +1 -1
- package/package.json +7 -7
- package/dist/oh-hero.d.ts +0 -33
- package/dist/oh-hero.d.ts.map +0 -1
- package/dist/oh-hero.js +0 -246
- package/dist/oh-hero.js.map +0 -1
package/dist/oh-drawer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-drawer.d.ts","sourceRoot":"","sources":["../src/oh-drawer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-drawer.d.ts","sourceRoot":"","sources":["../src/oh-drawer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAGlD,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BAqHpB;IAEF,iCAAiC;IAEjC,IAAI,UAAS;IAEb,6BAA6B;IAE7B,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAU;IAEpC,uCAAuC;IAEvC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,2DAA2D;IAE3D,OAAO,CAAC,eAAe,CAA4B;IAGnD,OAAO,CAAC,OAAO,CAAe;IAE9B,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU/C,OAAO,CAAC,OAAO;IAqBf,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,MAAM;IAOd,OAAO,CAAC,oBAAoB;IAI5B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAOlB,uCAAuC;IACvC,IAAI;IAIJ,wCAAwC;IACxC,IAAI;IAIJ,MAAM;CA0DP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/oh-drawer.js
CHANGED
|
@@ -7,27 +7,21 @@
|
|
|
7
7
|
* ─────────────────
|
|
8
8
|
* 1. POSITIONING
|
|
9
9
|
* - Slides in from left or right
|
|
10
|
-
* - Full height,
|
|
11
|
-
* - Overlays content with
|
|
10
|
+
* - Full height, width set by --oh-drawer-width
|
|
11
|
+
* - Overlays content with a color.surface.overlay backdrop
|
|
12
12
|
*
|
|
13
|
-
* 2.
|
|
14
|
-
* -
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
13
|
+
* 2. LOOK FROM TOKENS
|
|
14
|
+
* - Panel: color.surface.base
|
|
15
|
+
* - Shadow: elevation.strong (left); an elevation.offset.lg offset in
|
|
16
|
+
* color.border.strong (right)
|
|
17
|
+
* - Slide: motion.relaxed with motion.easeGentle, off under reduced motion
|
|
17
18
|
*
|
|
18
19
|
* 3. ACCESSIBILITY
|
|
19
20
|
* - Focus trap when open (focus guards at each end of the panel)
|
|
20
21
|
* - Escape key closes
|
|
21
22
|
* - aria-modal and role="dialog"
|
|
22
23
|
* - Returns focus to trigger on close
|
|
23
|
-
*
|
|
24
|
-
* @element oh-drawer
|
|
25
|
-
*
|
|
26
|
-
* @slot - Default slot for drawer content
|
|
27
|
-
*
|
|
28
|
-
* @fires oh-close - When the drawer is closed
|
|
29
|
-
*
|
|
30
|
-
* @cssprop --oh-drawer-width - Width of the drawer (default: 280px)
|
|
24
|
+
* - inert while closed, and hidden once it has slid away
|
|
31
25
|
*/
|
|
32
26
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
33
27
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -41,6 +35,29 @@ import { OhElement, baseStyles } from "./base.js";
|
|
|
41
35
|
import { getFocusableElementsDeep } from "@orange-halo/utils";
|
|
42
36
|
import "./oh-button.js";
|
|
43
37
|
import "./oh-icon.js";
|
|
38
|
+
/**
|
|
39
|
+
* A panel that slides in from the side of the viewport, over the page, for navigation or supplementary content.
|
|
40
|
+
*
|
|
41
|
+
* **Use it for** a site's navigation on small screens, filters, or settings that relate to the page behind. **Don't use it for** a decision the user must make before going on (use `oh-modal`); or for content that should always be visible (put it in the page).
|
|
42
|
+
*
|
|
43
|
+
* **Parts:** `heading` (an optional visible `h2`), a built-in Close button, and the default slot for the content, which scrolls when it's taller than the viewport.
|
|
44
|
+
*
|
|
45
|
+
* **Positions:** `left` (default) or `right`.
|
|
46
|
+
*
|
|
47
|
+
* **Behaviour:** set `open`, or call `show()` and `hide()`. On open, focus moves to the Close button, Tab and Shift+Tab wrap inside the panel, and the page behind stops scrolling. The Close button, Escape, a click on the backdrop and `hide()` close it and fire `oh-close`; focus then returns to the element that opened it. While closed the panel is `inert`. Motion is off under `prefers-reduced-motion`.
|
|
48
|
+
*
|
|
49
|
+
* **Accessibility:** the panel is `role="dialog"` with `aria-modal="true"`, labelled by `heading`, or "Navigation menu" when there's no heading, so set `heading` for any other use. The Close button's accessible name is "Close menu".
|
|
50
|
+
*
|
|
51
|
+
* **Look:** set by tokens. `color.surface.overlay` sets the backdrop and `color.surface.base` the panel. A left drawer's shadow is `elevation.strong`; a right drawer's is an `elevation.offset.lg` offset in `color.border.strong`. The heading uses `typography.heading.h5.fontSize` and `typography.emphasis.fontWeight`. Motion uses `motion.relaxed` and `motion.easeGentle`. `--oh-drawer-width` sets the width.
|
|
52
|
+
*
|
|
53
|
+
* @element oh-drawer
|
|
54
|
+
*
|
|
55
|
+
* @slot - Default slot for drawer content
|
|
56
|
+
*
|
|
57
|
+
* @fires oh-close - When the drawer is closed by the Close button, Escape, the backdrop or `hide()`. Not fired when you set `open` to false yourself.
|
|
58
|
+
*
|
|
59
|
+
* @cssprop --oh-drawer-width - Width of the drawer. It never fills the whole viewport width.
|
|
60
|
+
*/
|
|
44
61
|
let OhDrawer = class OhDrawer extends OhElement {
|
|
45
62
|
constructor() {
|
|
46
63
|
super(...arguments);
|
|
@@ -66,8 +83,9 @@ let OhDrawer = class OhDrawer extends OhElement {
|
|
|
66
83
|
z-index: 999;
|
|
67
84
|
opacity: 0;
|
|
68
85
|
visibility: hidden;
|
|
69
|
-
transition:
|
|
70
|
-
|
|
86
|
+
transition:
|
|
87
|
+
opacity var(--oh-motion-relaxed) var(--oh-motion-ease-gentle),
|
|
88
|
+
visibility var(--oh-motion-relaxed) var(--oh-motion-ease-gentle);
|
|
71
89
|
}
|
|
72
90
|
|
|
73
91
|
.drawer-backdrop.is-open {
|
|
@@ -117,7 +135,8 @@ let OhDrawer = class OhDrawer extends OhElement {
|
|
|
117
135
|
/* Right position */
|
|
118
136
|
.drawer--right {
|
|
119
137
|
right: 0;
|
|
120
|
-
box-shadow: calc(-1 * var(--oh-elevation-offset-lg))
|
|
138
|
+
box-shadow: calc(-1 * var(--oh-elevation-offset-lg))
|
|
139
|
+
var(--oh-elevation-offset-lg) 0 0 var(--oh-color-border-strong);
|
|
121
140
|
transform: translateX(100%);
|
|
122
141
|
}
|
|
123
142
|
|
|
@@ -246,11 +265,12 @@ let OhDrawer = class OhDrawer extends OhElement {
|
|
|
246
265
|
"drawer",
|
|
247
266
|
`drawer--${this.position}`,
|
|
248
267
|
this.open ? "is-open" : "",
|
|
249
|
-
]
|
|
250
|
-
|
|
251
|
-
"
|
|
252
|
-
|
|
253
|
-
|
|
268
|
+
]
|
|
269
|
+
.filter(Boolean)
|
|
270
|
+
.join(" ");
|
|
271
|
+
const backdropClasses = ["drawer-backdrop", this.open ? "is-open" : ""]
|
|
272
|
+
.filter(Boolean)
|
|
273
|
+
.join(" ");
|
|
254
274
|
return html `
|
|
255
275
|
<div
|
|
256
276
|
class=${backdropClasses}
|
|
@@ -265,7 +285,11 @@ let OhDrawer = class OhDrawer extends OhElement {
|
|
|
265
285
|
aria-label=${this.heading || "Navigation menu"}
|
|
266
286
|
?inert=${!this.open}
|
|
267
287
|
>
|
|
268
|
-
<span
|
|
288
|
+
<span
|
|
289
|
+
class="focus-guard"
|
|
290
|
+
tabindex="0"
|
|
291
|
+
@focus=${() => this._focusEdge("last")}
|
|
292
|
+
></span>
|
|
269
293
|
<div class="drawer__header">
|
|
270
294
|
${this.heading
|
|
271
295
|
? html `<h2 class="drawer__title">${this.heading}</h2>`
|
|
@@ -284,7 +308,11 @@ let OhDrawer = class OhDrawer extends OhElement {
|
|
|
284
308
|
<div class="drawer__content">
|
|
285
309
|
<slot></slot>
|
|
286
310
|
</div>
|
|
287
|
-
<span
|
|
311
|
+
<span
|
|
312
|
+
class="focus-guard"
|
|
313
|
+
tabindex="0"
|
|
314
|
+
@focus=${() => this._focusEdge("first")}
|
|
315
|
+
></span>
|
|
288
316
|
</div>
|
|
289
317
|
`;
|
|
290
318
|
}
|
package/dist/oh-drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-drawer.js","sourceRoot":"","sources":["../src/oh-drawer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-drawer.js","sourceRoot":"","sources":["../src/oh-drawer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,SAAS;IAAhC;;QAwHL,iCAAiC;QAEjC,SAAI,GAAG,KAAK,CAAC;QAEb,6BAA6B;QAE7B,aAAQ,GAAqB,MAAM,CAAC;QAMpC,2DAA2D;QAEnD,oBAAe,GAAuB,IAAI,CAAC;IA4JrD,CAAC;aAjSiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkHF;KACF,AArHqB,CAqHpB;IAqBF,iBAAiB;QACf,KAAK,CAAC,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ist/oh-footer.d.ts
CHANGED
|
@@ -1,24 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-footer
|
|
3
3
|
*
|
|
4
|
-
* A footer component with logo, multi-column links, and social icons.
|
|
5
|
-
*
|
|
6
4
|
* DESIGN DECISIONS:
|
|
7
5
|
* ─────────────────
|
|
8
6
|
* 1. LAYOUT
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
7
|
+
* - A four-column oh-grid inside an oh-container (size lg): the logo,
|
|
8
|
+
* copyright and social icons first, then a column per slotted oh-stack
|
|
9
|
+
* - At and below `size.breakpoint.md` the first column spans the full width
|
|
10
|
+
*
|
|
11
|
+
* 2. LOOK FROM TOKENS
|
|
12
|
+
* - `color.accent.default` background, `color.text.onAccent` text; use
|
|
13
|
+
* `inverse` links and icons inside it
|
|
14
|
+
*
|
|
15
|
+
* 3. CORE, NOT A BRAND PATTERN
|
|
16
|
+
* - Every site needs a footer, and its shape (logo, copyright, social,
|
|
17
|
+
* link columns) isn't specific to one brand, so it stays in the core
|
|
18
|
+
*/
|
|
19
|
+
import { OhElement } from "./base.js";
|
|
20
|
+
import "./oh-container.js";
|
|
21
|
+
import "./oh-grid.js";
|
|
22
|
+
import "./oh-stack.js";
|
|
23
|
+
import "./oh-cluster.js";
|
|
24
|
+
/**
|
|
25
|
+
* A site footer with a logo, copyright line, social links and columns of links.
|
|
26
|
+
*
|
|
27
|
+
* **Use it for** the footer at the bottom of every page. **Don't use it for**
|
|
28
|
+
* the main navigation (use `oh-navbar`).
|
|
29
|
+
*
|
|
30
|
+
* **Parts:** the `logo` slot; `copyright`, a line of text under the logo;
|
|
31
|
+
* the `social` slot for `oh-icon` links (with `inverse`); and the default
|
|
32
|
+
* slot, where each `oh-stack` becomes a column (start it with a heading, then
|
|
33
|
+
* `oh-link`s with `inverse`).
|
|
12
34
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* - Generous padding
|
|
35
|
+
* **Behaviour:** the columns follow `oh-grid`'s four-column steps at the
|
|
36
|
+
* `size.breakpoint.*` widths; at and below `size.breakpoint.md` the logo
|
|
37
|
+
* column spans the full width.
|
|
17
38
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
39
|
+
* **Accessibility:** renders a `<footer>`. Give the logo an accessible name,
|
|
40
|
+
* each social icon a `label`, and the column headings a level that fits the
|
|
41
|
+
* page's outline.
|
|
42
|
+
*
|
|
43
|
+
* **Look:** set by tokens — `color.accent.default` the background,
|
|
44
|
+
* `color.text.onAccent` the text, `typography.body.*` the type, `spacing.8`
|
|
45
|
+
* the vertical padding.
|
|
22
46
|
*
|
|
23
47
|
* @element oh-footer
|
|
24
48
|
*
|
|
@@ -26,11 +50,6 @@
|
|
|
26
50
|
* @slot social - Slot for social media icons
|
|
27
51
|
* @slot - Default slot for link columns (use oh-stack for each column)
|
|
28
52
|
*/
|
|
29
|
-
import { OhElement } from "./base.js";
|
|
30
|
-
import "./oh-container.js";
|
|
31
|
-
import "./oh-grid.js";
|
|
32
|
-
import "./oh-stack.js";
|
|
33
|
-
import "./oh-cluster.js";
|
|
34
53
|
export declare class OhFooter extends OhElement {
|
|
35
54
|
static styles: import("lit").CSSResult[];
|
|
36
55
|
/** Copyright text */
|
package/dist/oh-footer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-footer.d.ts","sourceRoot":"","sources":["../src/oh-footer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-footer.d.ts","sourceRoot":"","sources":["../src/oh-footer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BAmCpB;IAEF,qBAAqB;IAErB,SAAS,SAAM;IAEf,MAAM;CAyBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/oh-footer.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-footer
|
|
3
3
|
*
|
|
4
|
-
* A footer component with logo, multi-column links, and social icons.
|
|
5
|
-
*
|
|
6
4
|
* DESIGN DECISIONS:
|
|
7
5
|
* ─────────────────
|
|
8
6
|
* 1. LAYOUT
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
*
|
|
13
|
-
* 2. STYLING
|
|
14
|
-
* - Accent blue background (dark)
|
|
15
|
-
* - White/inverse text and links
|
|
16
|
-
* - Generous padding
|
|
7
|
+
* - A four-column oh-grid inside an oh-container (size lg): the logo,
|
|
8
|
+
* copyright and social icons first, then a column per slotted oh-stack
|
|
9
|
+
* - At and below `size.breakpoint.md` the first column spans the full width
|
|
17
10
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the brand package (brand plan phase 8).
|
|
11
|
+
* 2. LOOK FROM TOKENS
|
|
12
|
+
* - `color.accent.default` background, `color.text.onAccent` text; use
|
|
13
|
+
* `inverse` links and icons inside it
|
|
22
14
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @slot social - Slot for social media icons
|
|
27
|
-
* @slot - Default slot for link columns (use oh-stack for each column)
|
|
15
|
+
* 3. CORE, NOT A BRAND PATTERN
|
|
16
|
+
* - Every site needs a footer, and its shape (logo, copyright, social,
|
|
17
|
+
* link columns) isn't specific to one brand, so it stays in the core
|
|
28
18
|
*/
|
|
29
19
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
30
20
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -39,6 +29,35 @@ import "./oh-container.js";
|
|
|
39
29
|
import "./oh-grid.js";
|
|
40
30
|
import "./oh-stack.js";
|
|
41
31
|
import "./oh-cluster.js";
|
|
32
|
+
/**
|
|
33
|
+
* A site footer with a logo, copyright line, social links and columns of links.
|
|
34
|
+
*
|
|
35
|
+
* **Use it for** the footer at the bottom of every page. **Don't use it for**
|
|
36
|
+
* the main navigation (use `oh-navbar`).
|
|
37
|
+
*
|
|
38
|
+
* **Parts:** the `logo` slot; `copyright`, a line of text under the logo;
|
|
39
|
+
* the `social` slot for `oh-icon` links (with `inverse`); and the default
|
|
40
|
+
* slot, where each `oh-stack` becomes a column (start it with a heading, then
|
|
41
|
+
* `oh-link`s with `inverse`).
|
|
42
|
+
*
|
|
43
|
+
* **Behaviour:** the columns follow `oh-grid`'s four-column steps at the
|
|
44
|
+
* `size.breakpoint.*` widths; at and below `size.breakpoint.md` the logo
|
|
45
|
+
* column spans the full width.
|
|
46
|
+
*
|
|
47
|
+
* **Accessibility:** renders a `<footer>`. Give the logo an accessible name,
|
|
48
|
+
* each social icon a `label`, and the column headings a level that fits the
|
|
49
|
+
* page's outline.
|
|
50
|
+
*
|
|
51
|
+
* **Look:** set by tokens — `color.accent.default` the background,
|
|
52
|
+
* `color.text.onAccent` the text, `typography.body.*` the type, `spacing.8`
|
|
53
|
+
* the vertical padding.
|
|
54
|
+
*
|
|
55
|
+
* @element oh-footer
|
|
56
|
+
*
|
|
57
|
+
* @slot logo - Slot for logo element
|
|
58
|
+
* @slot social - Slot for social media icons
|
|
59
|
+
* @slot - Default slot for link columns (use oh-stack for each column)
|
|
60
|
+
*/
|
|
42
61
|
let OhFooter = class OhFooter extends OhElement {
|
|
43
62
|
constructor() {
|
|
44
63
|
super(...arguments);
|
package/dist/oh-footer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-footer.js","sourceRoot":"","sources":["../src/oh-footer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-footer.js","sourceRoot":"","sources":["../src/oh-footer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,mBAAmB,CAAC;AAC3B,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,CAAC;AACvB,OAAO,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,SAAS;IAAhC;;QAsCL,qBAAqB;QAErB,cAAS,GAAG,EAAE,CAAC;IA2BjB,CAAC;aAlEiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCF;KACF,AAnCqB,CAmCpB;IAMF,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;;gBASC,IAAI,CAAC,SAAS;YACd,CAAC,CAAC,IAAI,CAAA,gCAAgC,IAAI,CAAC,SAAS,MAAM;YAC1D,CAAC,CAAC,IAAI;;;;;;;;;;;KAWjB,CAAC;IACJ,CAAC;;AA1BD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CACZ;AAxCJ,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAmEpB"}
|
package/dist/oh-grid.d.ts
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-grid
|
|
3
3
|
*
|
|
4
|
-
* CSS Grid layout with configurable columns.
|
|
5
|
-
* Flexible grid system for cards, galleries, and layouts.
|
|
6
|
-
*
|
|
7
4
|
* DESIGN DECISIONS:
|
|
8
5
|
* ─────────────────
|
|
9
6
|
* 1. COLUMN PRESETS
|
|
10
|
-
* - 1
|
|
11
|
-
*
|
|
12
|
-
* - auto-fill:
|
|
13
|
-
*
|
|
14
|
-
* 2. MIN-WIDTH FOR AUTO COLUMNS
|
|
15
|
-
* - Configurable minimum column width
|
|
16
|
-
* - Defaults to 280px for card-friendly layouts
|
|
17
|
-
*
|
|
18
|
-
* 3. GAP SCALE
|
|
19
|
-
* - Uses design token spacing values
|
|
7
|
+
* - 1–4 fixed columns, which step down on narrower viewports at the
|
|
8
|
+
* `size.breakpoint.*` widths
|
|
9
|
+
* - auto-fit / auto-fill: as many columns as fit, each at least
|
|
10
|
+
* `min-width` wide
|
|
20
11
|
*
|
|
21
|
-
*
|
|
12
|
+
* 2. GAP SCALE
|
|
13
|
+
* - Named steps mapped to `spacing.*` tokens
|
|
22
14
|
*/
|
|
23
15
|
import { OhElement } from "./base.js";
|
|
24
16
|
export type GridColumns = "1" | "2" | "3" | "4" | "auto-fit" | "auto-fill";
|
|
25
17
|
export type GridGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
18
|
+
/**
|
|
19
|
+
* A CSS grid of equal-width columns, fixed or as many as fit.
|
|
20
|
+
*
|
|
21
|
+
* **Use it for** cards, galleries and other sets of similar items. **Don't
|
|
22
|
+
* use it for** a single column (use `oh-stack`) or items of varying width in
|
|
23
|
+
* a row (use `oh-cluster`).
|
|
24
|
+
*
|
|
25
|
+
* **Columns:** `columns` is `1`–`4`, `auto-fit` (default) or `auto-fill`.
|
|
26
|
+
* Auto columns are at least `min-width` wide (any CSS length); `auto-fit`
|
|
27
|
+
* stretches the items to fill the row, `auto-fill` keeps empty tracks.
|
|
28
|
+
* **Gaps:** `gap` is `none`, `xs` (`spacing.1`), `sm` (`spacing.2`), `md`
|
|
29
|
+
* (default, `spacing.4`), `lg` (`spacing.6`) or `xl` (`spacing.8`).
|
|
30
|
+
* `align-items` is `start`, `center`, `end` or `stretch` (default).
|
|
31
|
+
*
|
|
32
|
+
* **Behaviour:** fixed columns respond to the viewport: up to
|
|
33
|
+
* `size.breakpoint.sm` they become one column; up to `size.breakpoint.md`,
|
|
34
|
+
* 3 and 4 become 2; up to `size.breakpoint.lg`, 4 becomes 3.
|
|
35
|
+
*
|
|
36
|
+
* @element oh-grid
|
|
37
|
+
* @slot - The grid items.
|
|
38
|
+
*/
|
|
26
39
|
export declare class OhGrid extends OhElement {
|
|
27
40
|
static styles: import("lit").CSSResult[];
|
|
28
41
|
columns: GridColumns;
|
package/dist/oh-grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-grid.d.ts","sourceRoot":"","sources":["../src/oh-grid.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-grid.d.ts","sourceRoot":"","sources":["../src/oh-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,UAAU,GAAG,WAAW,CAAC;AAC3E,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBACa,MAAO,SAAQ,SAAS;IACnC,OAAgB,MAAM,4BAyFpB;IAGF,OAAO,EAAE,WAAW,CAAc;IAGlC,GAAG,EAAE,OAAO,CAAQ;IAGpB,QAAQ,SAAW;IAGnB,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAa;IAEtD,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAaxD,MAAM;CAGP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
package/dist/oh-grid.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-grid
|
|
3
3
|
*
|
|
4
|
-
* CSS Grid layout with configurable columns.
|
|
5
|
-
* Flexible grid system for cards, galleries, and layouts.
|
|
6
|
-
*
|
|
7
4
|
* DESIGN DECISIONS:
|
|
8
5
|
* ─────────────────
|
|
9
6
|
* 1. COLUMN PRESETS
|
|
10
|
-
* - 1
|
|
11
|
-
*
|
|
12
|
-
* - auto-fill:
|
|
13
|
-
*
|
|
14
|
-
* 2. MIN-WIDTH FOR AUTO COLUMNS
|
|
15
|
-
* - Configurable minimum column width
|
|
16
|
-
* - Defaults to 280px for card-friendly layouts
|
|
17
|
-
*
|
|
18
|
-
* 3. GAP SCALE
|
|
19
|
-
* - Uses design token spacing values
|
|
7
|
+
* - 1–4 fixed columns, which step down on narrower viewports at the
|
|
8
|
+
* `size.breakpoint.*` widths
|
|
9
|
+
* - auto-fit / auto-fill: as many columns as fit, each at least
|
|
10
|
+
* `min-width` wide
|
|
20
11
|
*
|
|
21
|
-
*
|
|
12
|
+
* 2. GAP SCALE
|
|
13
|
+
* - Named steps mapped to `spacing.*` tokens
|
|
22
14
|
*/
|
|
23
15
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
24
16
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -29,6 +21,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
29
21
|
import { html, css } from "lit";
|
|
30
22
|
import { customElement, property } from "lit/decorators.js";
|
|
31
23
|
import { OhElement, baseStyles } from "./base.js";
|
|
24
|
+
/**
|
|
25
|
+
* A CSS grid of equal-width columns, fixed or as many as fit.
|
|
26
|
+
*
|
|
27
|
+
* **Use it for** cards, galleries and other sets of similar items. **Don't
|
|
28
|
+
* use it for** a single column (use `oh-stack`) or items of varying width in
|
|
29
|
+
* a row (use `oh-cluster`).
|
|
30
|
+
*
|
|
31
|
+
* **Columns:** `columns` is `1`–`4`, `auto-fit` (default) or `auto-fill`.
|
|
32
|
+
* Auto columns are at least `min-width` wide (any CSS length); `auto-fit`
|
|
33
|
+
* stretches the items to fill the row, `auto-fill` keeps empty tracks.
|
|
34
|
+
* **Gaps:** `gap` is `none`, `xs` (`spacing.1`), `sm` (`spacing.2`), `md`
|
|
35
|
+
* (default, `spacing.4`), `lg` (`spacing.6`) or `xl` (`spacing.8`).
|
|
36
|
+
* `align-items` is `start`, `center`, `end` or `stretch` (default).
|
|
37
|
+
*
|
|
38
|
+
* **Behaviour:** fixed columns respond to the viewport: up to
|
|
39
|
+
* `size.breakpoint.sm` they become one column; up to `size.breakpoint.md`,
|
|
40
|
+
* 3 and 4 become 2; up to `size.breakpoint.lg`, 4 becomes 3.
|
|
41
|
+
*
|
|
42
|
+
* @element oh-grid
|
|
43
|
+
* @slot - The grid items.
|
|
44
|
+
*/
|
|
32
45
|
let OhGrid = class OhGrid extends OhElement {
|
|
33
46
|
constructor() {
|
|
34
47
|
super(...arguments);
|
|
@@ -40,11 +53,6 @@ let OhGrid = class OhGrid extends OhElement {
|
|
|
40
53
|
static { this.styles = [
|
|
41
54
|
baseStyles,
|
|
42
55
|
css `
|
|
43
|
-
/* ═══════════════════════════════════════════════════════════════
|
|
44
|
-
ORANGE HALO GRID
|
|
45
|
-
CSS Grid layout • Responsive columns • Flexible gaps
|
|
46
|
-
═══════════════════════════════════════════════════════════════ */
|
|
47
|
-
|
|
48
56
|
:host {
|
|
49
57
|
display: grid;
|
|
50
58
|
width: 100%;
|
|
@@ -135,8 +143,7 @@ let OhGrid = class OhGrid extends OhElement {
|
|
|
135
143
|
updated(changedProperties) {
|
|
136
144
|
super.updated(changedProperties);
|
|
137
145
|
// Handle auto-fit and auto-fill with dynamic min-width
|
|
138
|
-
if (changedProperties.has("columns") ||
|
|
139
|
-
changedProperties.has("minWidth")) {
|
|
146
|
+
if (changedProperties.has("columns") || changedProperties.has("minWidth")) {
|
|
140
147
|
if (this.columns === "auto-fit" || this.columns === "auto-fill") {
|
|
141
148
|
this.style.gridTemplateColumns = `repeat(${this.columns}, minmax(${this.minWidth}, 1fr))`;
|
|
142
149
|
}
|
package/dist/oh-grid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-grid.js","sourceRoot":"","sources":["../src/oh-grid.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-grid.js","sourceRoot":"","sources":["../src/oh-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAKlD;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,SAAS;IAA9B;;QA6FL,YAAO,GAAgB,UAAU,CAAC;QAGlC,QAAG,GAAY,IAAI,CAAC;QAGpB,aAAQ,GAAG,OAAO,CAAC;QAGnB,eAAU,GAA2C,SAAS,CAAC;IAkBjE,CAAC;aAvHiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsFF;KACF,AAzFqB,CAyFpB;IAcO,OAAO,CAAC,iBAAuC;QACtD,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEjC,uDAAuD;QACvD,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAC1E,IAAI,IAAI,CAAC,OAAO,KAAK,UAAU,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;gBAChE,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,UAAU,IAAI,CAAC,OAAO,YAAY,IAAI,CAAC,QAAQ,SAAS,CAAC;YAC5F,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,KAAK,CAAC,mBAAmB,GAAG,EAAE,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AA1BD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACR;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mCACtB;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;wCAChC;AAGnB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACL;AAtGpD,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAwHlB"}
|
package/dist/oh-icon.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-icon
|
|
3
3
|
*
|
|
4
|
-
* A flexible icon component for the
|
|
4
|
+
* A flexible icon component for the design system.
|
|
5
5
|
* Can render as a standalone icon or as an interactive link.
|
|
6
6
|
*
|
|
7
7
|
* DESIGN DECISIONS:
|
|
8
8
|
* ─────────────────
|
|
9
9
|
* 1. SIZE
|
|
10
|
-
* -
|
|
11
|
-
* - Size variants: sm
|
|
10
|
+
* - With no size, the icon is 1em, so it follows the text around it
|
|
11
|
+
* - Size variants: sm, md, lg, xl (fixed sizes, set in this file; there
|
|
12
|
+
* are no icon size tokens yet)
|
|
12
13
|
*
|
|
13
14
|
* 2. LINK MODE
|
|
14
15
|
* - When `href` is provided, renders as an <a> tag
|
|
@@ -19,13 +20,28 @@
|
|
|
19
20
|
* - Decorative by default (aria-hidden="true")
|
|
20
21
|
* - Provide `label` for meaningful icons
|
|
21
22
|
* - When used as link, label becomes aria-label
|
|
22
|
-
*
|
|
23
|
-
* @element oh-icon
|
|
24
23
|
*/
|
|
25
24
|
import { nothing } from "lit";
|
|
26
25
|
import { OhElement } from "./base.js";
|
|
27
26
|
export type IconName = "twitter" | "github" | "linkedin" | "instagram" | "youtube" | "facebook" | "email" | "substack" | "arrow-right" | "arrow-left" | "arrow-up" | "arrow-down" | "chevron-right" | "chevron-left" | "chevron-up" | "chevron-down" | "external-link" | "close" | "plus" | "minus" | "check" | "search" | "menu" | "settings" | "heart" | "sparkle" | "info" | "warning" | "error" | "success";
|
|
28
27
|
export type IconSize = "sm" | "md" | "lg" | "xl";
|
|
28
|
+
/**
|
|
29
|
+
* An icon from the system's built-in set, shown on its own, with a label, or as an icon-only link.
|
|
30
|
+
*
|
|
31
|
+
* **Use it for** an icon next to text, an icon that carries meaning on its own (with `label`), or a compact link such as a social profile (`href` + `label`). **Don't use it for** an icon-only button (use `oh-button` with `icon-only`); or for an image or logo (use `<img>`).
|
|
32
|
+
*
|
|
33
|
+
* **Names:** `name` picks the icon: social (`twitter`, `github`, `linkedin`, `instagram`, `youtube`, `facebook`, `email`, `substack`), navigation (`arrow-*`, `chevron-*`, `external-link`), actions (`close`, `plus`, `minus`, `check`, `search`, `menu`, `settings`, `heart`, `sparkle`) and feedback (`info`, `warning`, `error`, `success`). An unknown name renders nothing and logs a warning.
|
|
34
|
+
*
|
|
35
|
+
* **Sizes:** with no `size` the icon is 1em and follows the text; `sm`, `md`, `lg`, `xl` set fixed sizes. **`inverse`:** for icons on an accent-coloured or dark background.
|
|
36
|
+
*
|
|
37
|
+
* **Behaviour:** the icon takes the current text colour. With `href` it renders as a link, with hover, active and focus-visible states; `target="_blank"` adds `rel="noopener noreferrer"`.
|
|
38
|
+
*
|
|
39
|
+
* **Accessibility:** without `label` the icon is decorative (`aria-hidden="true"`). With `label` it's `role="img"` with that name. As a link, `label` is required (it logs a warning without one) and becomes the link's `aria-label`. Focus-visible shows a solid ring in `focus.ringColor` (`color.text.onAccent` when `inverse`).
|
|
40
|
+
*
|
|
41
|
+
* **Look:** set by tokens. The icon is `currentColor`; `inverse` sets `color.text.onAccent`. As a link: `shape.compact` corners, hover moves by `lift.hoverMd` with an `elevation.offset.lg` shadow in `color.border.default` (`color.text.onAccent` when `inverse`); motion uses `motion.snappy` and `motion.easeGentle`, off under `prefers-reduced-motion`.
|
|
42
|
+
*
|
|
43
|
+
* @element oh-icon
|
|
44
|
+
*/
|
|
29
45
|
export declare class OhIcon extends OhElement {
|
|
30
46
|
static styles: import("lit").CSSResult[];
|
|
31
47
|
name: IconName;
|
package/dist/oh-icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-icon.d.ts","sourceRoot":"","sources":["../src/oh-icon.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-icon.d.ts","sourceRoot":"","sources":["../src/oh-icon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,QAAQ,GAEhB,SAAS,GACT,QAAQ,GACR,UAAU,GACV,WAAW,GACX,SAAS,GACT,UAAU,GACV,OAAO,GACP,UAAU,GAEV,aAAa,GACb,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,eAAe,GACf,cAAc,GACd,YAAY,GACZ,cAAc,GACd,eAAe,GAEf,OAAO,GACP,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,MAAM,GACN,UAAU,GACV,OAAO,GACP,SAAS,GAET,MAAM,GACN,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAqIjD;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,MAAO,SAAQ,SAAS;IACnC,OAAgB,MAAM,4BA+FpB;IAGF,IAAI,EAAE,QAAQ,CAAU;IAGxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAGhB,OAAO,UAAS;IAGhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,MAAM;CA6CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
package/dist/oh-icon.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-icon
|
|
3
3
|
*
|
|
4
|
-
* A flexible icon component for the
|
|
4
|
+
* A flexible icon component for the design system.
|
|
5
5
|
* Can render as a standalone icon or as an interactive link.
|
|
6
6
|
*
|
|
7
7
|
* DESIGN DECISIONS:
|
|
8
8
|
* ─────────────────
|
|
9
9
|
* 1. SIZE
|
|
10
|
-
* -
|
|
11
|
-
* - Size variants: sm
|
|
10
|
+
* - With no size, the icon is 1em, so it follows the text around it
|
|
11
|
+
* - Size variants: sm, md, lg, xl (fixed sizes, set in this file; there
|
|
12
|
+
* are no icon size tokens yet)
|
|
12
13
|
*
|
|
13
14
|
* 2. LINK MODE
|
|
14
15
|
* - When `href` is provided, renders as an <a> tag
|
|
@@ -19,8 +20,6 @@
|
|
|
19
20
|
* - Decorative by default (aria-hidden="true")
|
|
20
21
|
* - Provide `label` for meaningful icons
|
|
21
22
|
* - When used as link, label becomes aria-label
|
|
22
|
-
*
|
|
23
|
-
* @element oh-icon
|
|
24
23
|
*/
|
|
25
24
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
26
25
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -158,6 +157,23 @@ const icons = {
|
|
|
158
157
|
path: `M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,
|
|
159
158
|
},
|
|
160
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* An icon from the system's built-in set, shown on its own, with a label, or as an icon-only link.
|
|
162
|
+
*
|
|
163
|
+
* **Use it for** an icon next to text, an icon that carries meaning on its own (with `label`), or a compact link such as a social profile (`href` + `label`). **Don't use it for** an icon-only button (use `oh-button` with `icon-only`); or for an image or logo (use `<img>`).
|
|
164
|
+
*
|
|
165
|
+
* **Names:** `name` picks the icon: social (`twitter`, `github`, `linkedin`, `instagram`, `youtube`, `facebook`, `email`, `substack`), navigation (`arrow-*`, `chevron-*`, `external-link`), actions (`close`, `plus`, `minus`, `check`, `search`, `menu`, `settings`, `heart`, `sparkle`) and feedback (`info`, `warning`, `error`, `success`). An unknown name renders nothing and logs a warning.
|
|
166
|
+
*
|
|
167
|
+
* **Sizes:** with no `size` the icon is 1em and follows the text; `sm`, `md`, `lg`, `xl` set fixed sizes. **`inverse`:** for icons on an accent-coloured or dark background.
|
|
168
|
+
*
|
|
169
|
+
* **Behaviour:** the icon takes the current text colour. With `href` it renders as a link, with hover, active and focus-visible states; `target="_blank"` adds `rel="noopener noreferrer"`.
|
|
170
|
+
*
|
|
171
|
+
* **Accessibility:** without `label` the icon is decorative (`aria-hidden="true"`). With `label` it's `role="img"` with that name. As a link, `label` is required (it logs a warning without one) and becomes the link's `aria-label`. Focus-visible shows a solid ring in `focus.ringColor` (`color.text.onAccent` when `inverse`).
|
|
172
|
+
*
|
|
173
|
+
* **Look:** set by tokens. The icon is `currentColor`; `inverse` sets `color.text.onAccent`. As a link: `shape.compact` corners, hover moves by `lift.hoverMd` with an `elevation.offset.lg` shadow in `color.border.default` (`color.text.onAccent` when `inverse`); motion uses `motion.snappy` and `motion.easeGentle`, off under `prefers-reduced-motion`.
|
|
174
|
+
*
|
|
175
|
+
* @element oh-icon
|
|
176
|
+
*/
|
|
161
177
|
let OhIcon = class OhIcon extends OhElement {
|
|
162
178
|
constructor() {
|
|
163
179
|
super(...arguments);
|
|
@@ -218,14 +234,15 @@ let OhIcon = class OhIcon extends OhElement {
|
|
|
218
234
|
border-radius: var(--oh-shape-compact);
|
|
219
235
|
padding: var(--oh-spacing-2);
|
|
220
236
|
margin: calc(-1 * var(--oh-spacing-2));
|
|
221
|
-
transition:
|
|
237
|
+
transition:
|
|
222
238
|
transform var(--oh-motion-snappy) var(--oh-motion-ease-gentle),
|
|
223
239
|
box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-gentle);
|
|
224
240
|
}
|
|
225
241
|
|
|
226
242
|
.icon-link:hover {
|
|
227
243
|
transform: translate(var(--oh-lift-hover-md), var(--oh-lift-hover-md));
|
|
228
|
-
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
244
|
+
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
245
|
+
0 0 var(--oh-color-border-default);
|
|
229
246
|
}
|
|
230
247
|
|
|
231
248
|
.icon-link:active {
|
|
@@ -243,7 +260,8 @@ let OhIcon = class OhIcon extends OhElement {
|
|
|
243
260
|
|
|
244
261
|
/* Inverse link styles (for dark/colored backgrounds) */
|
|
245
262
|
:host([inverse]) .icon-link:hover {
|
|
246
|
-
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
263
|
+
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
264
|
+
0 0 var(--oh-color-text-on-accent);
|
|
247
265
|
}
|
|
248
266
|
|
|
249
267
|
:host([inverse]) .icon-link:focus-visible {
|
|
@@ -268,7 +286,7 @@ let OhIcon = class OhIcon extends OhElement {
|
|
|
268
286
|
<svg
|
|
269
287
|
viewBox=${iconData.viewBox}
|
|
270
288
|
fill="currentColor"
|
|
271
|
-
aria-hidden=${this.href ? "true" :
|
|
289
|
+
aria-hidden=${this.href ? "true" : this.label ? "false" : "true"}
|
|
272
290
|
role=${!this.href && this.label ? "img" : nothing}
|
|
273
291
|
aria-label=${!this.href && this.label ? this.label : nothing}
|
|
274
292
|
>
|