@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-toggle.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-toggle
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
4
|
+
* A switch for binary on/off settings.
|
|
5
5
|
*
|
|
6
6
|
* DESIGN DECISIONS:
|
|
7
7
|
* ─────────────────
|
|
8
|
-
* 1.
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
8
|
+
* 1. LOOK FROM TOKENS
|
|
9
|
+
* - Track: shape.pill, color.surface.raised off, color.brand.primary on
|
|
10
|
+
* - Thumb: color.surface.base with a stroke.control border in
|
|
11
|
+
* color.border.emphasis, and a shadow offset by elevation.offset.*
|
|
12
|
+
* (elevation.color.secondary off, elevation.color.primary on). The shadow's horizontal
|
|
13
|
+
* offset flips when checked; hover and press move the thumb by
|
|
14
|
+
* lift.hoverSm / lift.pressSm
|
|
12
15
|
*
|
|
13
16
|
* 2. VISUAL STATES
|
|
14
|
-
* - Off:
|
|
15
|
-
* - On: Brand primary track, thumb on right, shadow bottom-left (flipped)
|
|
17
|
+
* - Off: thumb at the start of the track; on: thumb at the end
|
|
16
18
|
*
|
|
17
19
|
* 3. ACCESSIBILITY
|
|
18
|
-
* -
|
|
20
|
+
* - role="switch" with aria-checked on a focusable track
|
|
19
21
|
* - Keyboard: Space/Enter to toggle
|
|
20
|
-
* - Focus
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @element oh-toggle
|
|
24
|
-
*
|
|
25
|
-
* @fires oh-change - Fired when the toggle state changes
|
|
22
|
+
* - Focus: a solid outline in focus.ringColor (focus.glowColor adds a
|
|
23
|
+
* glow around it, as decoration)
|
|
24
|
+
* - Named by its visible label (aria-labelledby) or accessible-label
|
|
26
25
|
*/
|
|
27
26
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
28
27
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -33,6 +32,40 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
33
32
|
import { html, css, nothing } from "lit";
|
|
34
33
|
import { customElement, property } from "lit/decorators.js";
|
|
35
34
|
import { OhElement, baseStyles } from "./base.js";
|
|
35
|
+
/**
|
|
36
|
+
* A switch that turns a setting on or off.
|
|
37
|
+
*
|
|
38
|
+
* **Use it for** a setting that takes effect straight away, such as turning
|
|
39
|
+
* notifications on. **Don't use it for** a choice that's only applied when a
|
|
40
|
+
* form is submitted, or one that must be agreed to (use `oh-checkbox`), or
|
|
41
|
+
* a choice between more than two options (use `oh-radio-group`).
|
|
42
|
+
*
|
|
43
|
+
* **States:** off, on, hover, active, focus.
|
|
44
|
+
*
|
|
45
|
+
* **Behaviour:** clicking the switch or its label, or pressing Space or
|
|
46
|
+
* Enter while it's focused, flips `checked` and fires `oh-change` with
|
|
47
|
+
* `{ checked }`. `name` and `value` are stored but it isn't form-associated,
|
|
48
|
+
* so it doesn't submit with a native form: listen for `oh-change`. It has no
|
|
49
|
+
* `disabled` property. Under `prefers-reduced-motion` it doesn't animate.
|
|
50
|
+
*
|
|
51
|
+
* **Accessibility:** `role="switch"` with `aria-checked`, in the tab order.
|
|
52
|
+
* Set `label` (a visible label, linked with `aria-labelledby`), or
|
|
53
|
+
* `accessible-label` when there's no visible label (not `aria-label`, which
|
|
54
|
+
* isn't forwarded into the shadow root). Focus is a solid outline in
|
|
55
|
+
* `focus.ringColor`.
|
|
56
|
+
*
|
|
57
|
+
* **Look:** set by tokens — `shape.pill` (track), `color.surface.raised` /
|
|
58
|
+
* `color.brand.primary` (track off / on), `color.surface.base`,
|
|
59
|
+
* `stroke.control` and `color.border.emphasis` (thumb),
|
|
60
|
+
* `elevation.offset.*` with `elevation.color.secondary` / `elevation.color.primary` (thumb
|
|
61
|
+
* shadow off / on), `lift.hoverSm` / `lift.pressSm` (movement on hover and
|
|
62
|
+
* press), `focus.ringColor` and `focus.glowColor` (focus),
|
|
63
|
+
* `typography.body.*` (label).
|
|
64
|
+
*
|
|
65
|
+
* @element oh-toggle
|
|
66
|
+
*
|
|
67
|
+
* @fires oh-change - Fired when the toggle state changes. detail: { checked }
|
|
68
|
+
*/
|
|
36
69
|
let OhToggle = class OhToggle extends OhElement {
|
|
37
70
|
constructor() {
|
|
38
71
|
super(...arguments);
|
|
@@ -55,7 +88,7 @@ let OhToggle = class OhToggle extends OhElement {
|
|
|
55
88
|
|
|
56
89
|
/* ═══════════════════════════════════════════════════════════════
|
|
57
90
|
TOGGLE TRACK
|
|
58
|
-
|
|
91
|
+
shape.pill corners
|
|
59
92
|
═══════════════════════════════════════════════════════════════ */
|
|
60
93
|
|
|
61
94
|
.toggle__track {
|
|
@@ -79,15 +112,16 @@ let OhToggle = class OhToggle extends OhElement {
|
|
|
79
112
|
box-shadow: 0 0 0 4px var(--oh-focus-glow-color);
|
|
80
113
|
}
|
|
81
114
|
|
|
82
|
-
/* Checked
|
|
115
|
+
/* Checked: track in color.brand.primary */
|
|
83
116
|
.toggle__track--checked {
|
|
84
117
|
background-color: var(--oh-color-brand-primary);
|
|
85
118
|
}
|
|
86
119
|
|
|
87
120
|
/* ═══════════════════════════════════════════════════════════════
|
|
88
121
|
TOGGLE THUMB
|
|
89
|
-
|
|
90
|
-
|
|
122
|
+
Circle overlapping the track edge, with an offset shadow
|
|
123
|
+
(elevation.offset.*). The shadow's horizontal offset flips when
|
|
124
|
+
checked
|
|
91
125
|
═══════════════════════════════════════════════════════════════ */
|
|
92
126
|
|
|
93
127
|
.toggle__thumb {
|
|
@@ -99,40 +133,49 @@ let OhToggle = class OhToggle extends OhElement {
|
|
|
99
133
|
background-color: var(--oh-color-surface-base);
|
|
100
134
|
border: var(--oh-stroke-control) solid var(--oh-color-border-emphasis);
|
|
101
135
|
border-radius: 50%;
|
|
102
|
-
box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
|
|
103
|
-
|
|
136
|
+
box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
|
|
137
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
138
|
+
transition:
|
|
104
139
|
transform var(--oh-motion-snappy) var(--oh-motion-ease-gentle),
|
|
105
140
|
box-shadow var(--oh-motion-snappy) ease;
|
|
106
141
|
}
|
|
107
142
|
|
|
108
|
-
/* Checked: thumb moves
|
|
143
|
+
/* Checked: thumb moves to the end of the track; shadow offset flips
|
|
144
|
+
horizontally, in elevation.color.primary */
|
|
109
145
|
.toggle__track--checked .toggle__thumb {
|
|
110
146
|
transform: translateX(30px);
|
|
111
|
-
box-shadow: calc(-1 * var(--oh-elevation-offset-md))
|
|
147
|
+
box-shadow: calc(-1 * var(--oh-elevation-offset-md))
|
|
148
|
+
var(--oh-elevation-offset-md) 0 0 var(--oh-elevation-color-primary);
|
|
112
149
|
}
|
|
113
150
|
|
|
114
|
-
/* Hover
|
|
151
|
+
/* Hover: thumb moves by lift.hoverSm; shadow offset elevation.offset.lg */
|
|
115
152
|
.toggle__track:hover .toggle__thumb {
|
|
116
153
|
transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
|
|
117
|
-
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
154
|
+
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
155
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
118
156
|
}
|
|
119
157
|
|
|
120
|
-
/* Checked hover
|
|
158
|
+
/* Checked + hover: flipped shadow at elevation.offset.lg */
|
|
121
159
|
.toggle__track--checked:hover .toggle__thumb {
|
|
122
|
-
transform: translateX(30px)
|
|
123
|
-
|
|
160
|
+
transform: translateX(30px)
|
|
161
|
+
translate(var(--oh-lift-press-sm), var(--oh-lift-hover-sm));
|
|
162
|
+
box-shadow: calc(-1 * var(--oh-elevation-offset-lg))
|
|
163
|
+
var(--oh-elevation-offset-lg) 0 0 var(--oh-elevation-color-primary);
|
|
124
164
|
}
|
|
125
165
|
|
|
126
|
-
/* Active
|
|
166
|
+
/* Active: thumb moves by lift.pressSm; shadow offset elevation.offset.xs */
|
|
127
167
|
.toggle__track:active .toggle__thumb {
|
|
128
168
|
transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
|
|
129
|
-
box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
|
|
169
|
+
box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
|
|
170
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
130
171
|
}
|
|
131
172
|
|
|
132
|
-
/* Checked active
|
|
173
|
+
/* Checked + active: flipped shadow at elevation.offset.xs */
|
|
133
174
|
.toggle__track--checked:active .toggle__thumb {
|
|
134
|
-
transform: translateX(30px)
|
|
135
|
-
|
|
175
|
+
transform: translateX(30px)
|
|
176
|
+
translate(var(--oh-lift-hover-sm), var(--oh-lift-press-sm));
|
|
177
|
+
box-shadow: calc(-1 * var(--oh-elevation-offset-xs))
|
|
178
|
+
var(--oh-elevation-offset-xs) 0 0 var(--oh-elevation-color-primary);
|
|
136
179
|
}
|
|
137
180
|
|
|
138
181
|
/* ═══════════════════════════════════════════════════════════════
|
|
@@ -182,7 +225,9 @@ let OhToggle = class OhToggle extends OhElement {
|
|
|
182
225
|
role="switch"
|
|
183
226
|
aria-checked="${this.checked}"
|
|
184
227
|
aria-labelledby="${hasVisibleLabel ? this._labelId : nothing}"
|
|
185
|
-
aria-label="${!hasVisibleLabel && this.accessibleLabel
|
|
228
|
+
aria-label="${!hasVisibleLabel && this.accessibleLabel
|
|
229
|
+
? this.accessibleLabel
|
|
230
|
+
: nothing}"
|
|
186
231
|
tabindex="0"
|
|
187
232
|
@click="${this._handleClick}"
|
|
188
233
|
@keydown="${this._handleKeydown}"
|
|
@@ -190,7 +235,12 @@ let OhToggle = class OhToggle extends OhElement {
|
|
|
190
235
|
<div class="toggle__thumb"></div>
|
|
191
236
|
</div>
|
|
192
237
|
${hasVisibleLabel
|
|
193
|
-
? html `<span
|
|
238
|
+
? html `<span
|
|
239
|
+
id="${this._labelId}"
|
|
240
|
+
class="toggle__label"
|
|
241
|
+
@click="${this._handleClick}"
|
|
242
|
+
>${this.label}</span
|
|
243
|
+
>`
|
|
194
244
|
: nothing}
|
|
195
245
|
`;
|
|
196
246
|
}
|
package/dist/oh-toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-toggle.js","sourceRoot":"","sources":["../src/oh-toggle.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-toggle.js","sourceRoot":"","sources":["../src/oh-toggle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,SAAS;IAAhC;;QA+HL,uCAAuC;QAEvC,YAAO,GAAG,KAAK,CAAC;QAiBhB,gCAAgC;QAEhC,UAAK,GAAG,IAAI,CAAC;QAwBI,aAAQ,GAAG,mBAAmB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IA8B1F,CAAC;aAzMiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAyHF;KACF,AA5HqB,CA4HpB;IAyBM,OAAO;QACb,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,WAAW,EAAE;YAC3B,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;YACjC,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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACb;AAId;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACd;AApJF,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA0MpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orange-halo/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Web Components for Orange Halo Design System",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -63,10 +63,6 @@
|
|
|
63
63
|
"types": "./dist/oh-grid.d.ts",
|
|
64
64
|
"import": "./dist/oh-grid.js"
|
|
65
65
|
},
|
|
66
|
-
"./oh-hero.js": {
|
|
67
|
-
"types": "./dist/oh-hero.d.ts",
|
|
68
|
-
"import": "./dist/oh-hero.js"
|
|
69
|
-
},
|
|
70
66
|
"./oh-icon.js": {
|
|
71
67
|
"types": "./dist/oh-icon.d.ts",
|
|
72
68
|
"import": "./dist/oh-icon.js"
|
|
@@ -115,6 +111,10 @@
|
|
|
115
111
|
"types": "./dist/oh-tabs.d.ts",
|
|
116
112
|
"import": "./dist/oh-tabs.js"
|
|
117
113
|
},
|
|
114
|
+
"./oh-textarea.js": {
|
|
115
|
+
"types": "./dist/oh-textarea.d.ts",
|
|
116
|
+
"import": "./dist/oh-textarea.js"
|
|
117
|
+
},
|
|
118
118
|
"./oh-toggle.js": {
|
|
119
119
|
"types": "./dist/oh-toggle.d.ts",
|
|
120
120
|
"import": "./dist/oh-toggle.js"
|
|
@@ -129,12 +129,12 @@
|
|
|
129
129
|
"lit": "^3.2.1"
|
|
130
130
|
},
|
|
131
131
|
"peerDependencies": {
|
|
132
|
-
"@orange-halo/tokens": "^
|
|
132
|
+
"@orange-halo/tokens": "^3.0.0",
|
|
133
133
|
"@orange-halo/utils": "^1.1.0"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
136
|
"@custom-elements-manifest/analyzer": "^0.11.0",
|
|
137
|
-
"@orange-halo/tokens": "
|
|
137
|
+
"@orange-halo/tokens": "3.0.0",
|
|
138
138
|
"@orange-halo/utils": "1.1.0"
|
|
139
139
|
},
|
|
140
140
|
"publishConfig": {
|
package/dist/oh-hero.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* oh-hero
|
|
3
|
-
*
|
|
4
|
-
* A prominent hero section for page headers.
|
|
5
|
-
*
|
|
6
|
-
* BRAND PATTERN: this belongs to the Orange Halo brand, not the core. Import
|
|
7
|
-
* it from @orange-halo/brand-orange-halo; importing it from components is
|
|
8
|
-
* deprecated and stops working in components 3.0, when this file moves to
|
|
9
|
-
* the brand package (brand plan phase 8).
|
|
10
|
-
*
|
|
11
|
-
* @element oh-hero
|
|
12
|
-
*/
|
|
13
|
-
import { LitElement } from "lit";
|
|
14
|
-
import "./oh-progress.js";
|
|
15
|
-
export type HeroVariant = "content" | "journey";
|
|
16
|
-
export type HeroSize = "sm" | "md" | "lg" | "xl";
|
|
17
|
-
export declare class OhHero extends LitElement {
|
|
18
|
-
static styles: import("lit").CSSResult;
|
|
19
|
-
variant: HeroVariant;
|
|
20
|
-
size: HeroSize;
|
|
21
|
-
heading: string;
|
|
22
|
-
subtitle: string;
|
|
23
|
-
journeyName: string;
|
|
24
|
-
currentStep: number;
|
|
25
|
-
totalSteps: number;
|
|
26
|
-
render(): import("lit").TemplateResult<1>;
|
|
27
|
-
}
|
|
28
|
-
declare global {
|
|
29
|
-
interface HTMLElementTagNameMap {
|
|
30
|
-
"oh-hero": OhHero;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=oh-hero.d.ts.map
|
package/dist/oh-hero.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oh-hero.d.ts","sourceRoot":"","sources":["../src/oh-hero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,kBAAkB,CAAC;AAE1B,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAChD,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,qBACa,MAAO,SAAQ,UAAU;IACpC,OAAgB,MAAM,0BA+IpB;IAGF,OAAO,EAAE,WAAW,CAAa;IAGjC,IAAI,EAAE,QAAQ,CAAQ;IAGtB,OAAO,SAAM;IAGb,QAAQ,SAAM;IAGd,WAAW,SAAM;IAGjB,WAAW,SAAK;IAGhB,UAAU,SAAK;IAEN,MAAM;CA4ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
package/dist/oh-hero.js
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* oh-hero
|
|
3
|
-
*
|
|
4
|
-
* A prominent hero section for page headers.
|
|
5
|
-
*
|
|
6
|
-
* BRAND PATTERN: this belongs to the Orange Halo brand, not the core. Import
|
|
7
|
-
* it from @orange-halo/brand-orange-halo; importing it from components is
|
|
8
|
-
* deprecated and stops working in components 3.0, when this file moves to
|
|
9
|
-
* the brand package (brand plan phase 8).
|
|
10
|
-
*
|
|
11
|
-
* @element oh-hero
|
|
12
|
-
*/
|
|
13
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
-
};
|
|
19
|
-
import { html, css, LitElement, nothing } from "lit";
|
|
20
|
-
import { customElement, property } from "lit/decorators.js";
|
|
21
|
-
import "./oh-progress.js";
|
|
22
|
-
let OhHero = class OhHero extends LitElement {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.variant = "content";
|
|
26
|
-
this.size = "lg";
|
|
27
|
-
this.heading = "";
|
|
28
|
-
this.subtitle = "";
|
|
29
|
-
this.journeyName = "";
|
|
30
|
-
this.currentStep = 1;
|
|
31
|
-
this.totalSteps = 1;
|
|
32
|
-
}
|
|
33
|
-
static { this.styles = css `
|
|
34
|
-
:host {
|
|
35
|
-
display: block;
|
|
36
|
-
background-color: var(--oh-color-brand-primary);
|
|
37
|
-
color: var(--oh-color-text-on-brand);
|
|
38
|
-
font-family: var(--oh-typography-body-font-family);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.hero {
|
|
42
|
-
padding: var(--oh-spacing-12) 0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.hero--journey {
|
|
46
|
-
padding: var(--oh-spacing-8) 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Container styles - matches oh-container */
|
|
50
|
-
.hero__container {
|
|
51
|
-
width: 100%;
|
|
52
|
-
max-width: var(--hero-max-width, var(--oh-layout-container-lg));
|
|
53
|
-
margin-left: auto;
|
|
54
|
-
margin-right: auto;
|
|
55
|
-
padding-left: var(--oh-spacing-4);
|
|
56
|
-
padding-right: var(--oh-spacing-4);
|
|
57
|
-
box-sizing: border-box;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Size variants */
|
|
61
|
-
:host([size="sm"]) {
|
|
62
|
-
--hero-max-width: var(--oh-layout-container-sm);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
:host([size="md"]) {
|
|
66
|
-
--hero-max-width: var(--oh-layout-container-md);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
:host([size="lg"]) {
|
|
70
|
-
--hero-max-width: var(--oh-layout-container-lg);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([size="xl"]) {
|
|
74
|
-
--hero-max-width: var(--oh-layout-container-xl);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.hero__heading {
|
|
78
|
-
font-size: var(--oh-typography-heading-h1-font-size);
|
|
79
|
-
font-weight: var(--oh-typography-heading-h1-font-weight);
|
|
80
|
-
line-height: var(--oh-typography-heading-h1-line-height);
|
|
81
|
-
margin: 0 0 var(--oh-spacing-4) 0;
|
|
82
|
-
color: var(--oh-color-text-on-brand);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.hero__subtitle {
|
|
86
|
-
font-size: var(--oh-typography-body-xl-font-size);
|
|
87
|
-
font-weight: var(--oh-typography-body-xl-font-weight);
|
|
88
|
-
line-height: var(--oh-typography-body-xl-line-height);
|
|
89
|
-
margin: 0 0 var(--oh-spacing-6) 0;
|
|
90
|
-
color: var(--oh-color-text-on-brand);
|
|
91
|
-
max-width: 65ch;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.hero__actions {
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-wrap: wrap;
|
|
97
|
-
gap: var(--oh-spacing-4);
|
|
98
|
-
margin-top: var(--oh-spacing-6);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.hero__journey-heading {
|
|
102
|
-
font-size: var(--oh-typography-heading-h2-font-size);
|
|
103
|
-
font-weight: var(--oh-typography-heading-h2-font-weight);
|
|
104
|
-
line-height: var(--oh-typography-heading-h2-line-height);
|
|
105
|
-
margin: 0 0 var(--oh-spacing-6) 0;
|
|
106
|
-
color: var(--oh-color-text-on-brand);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.hero__journey-name {
|
|
110
|
-
display: block;
|
|
111
|
-
font-family: var(--oh-typography-eyebrow-font-family);
|
|
112
|
-
font-size: var(--oh-typography-eyebrow-font-size);
|
|
113
|
-
font-weight: var(--oh-typography-eyebrow-font-weight);
|
|
114
|
-
text-transform: uppercase;
|
|
115
|
-
letter-spacing: var(--oh-typography-eyebrow-letter-spacing);
|
|
116
|
-
color: var(--oh-color-text-on-brand);
|
|
117
|
-
margin-bottom: var(--oh-spacing-2);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.hero__page-name {
|
|
121
|
-
display: block;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.hero__progress-wrapper {
|
|
125
|
-
margin-top: var(--oh-spacing-4);
|
|
126
|
-
max-width: var(--oh-layout-container-sm);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* Responsive container padding - matches oh-container */
|
|
130
|
-
@media (min-width: 640px) {
|
|
131
|
-
.hero__container {
|
|
132
|
-
padding-left: var(--oh-spacing-6);
|
|
133
|
-
padding-right: var(--oh-spacing-6);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
@media (min-width: 1024px) {
|
|
138
|
-
.hero__container {
|
|
139
|
-
padding-left: var(--oh-spacing-8);
|
|
140
|
-
padding-right: var(--oh-spacing-8);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
@media (max-width: 768px) {
|
|
145
|
-
.hero {
|
|
146
|
-
padding: var(--oh-spacing-8) 0;
|
|
147
|
-
}
|
|
148
|
-
.hero__heading {
|
|
149
|
-
font-size: var(--oh-typography-heading-h2-font-size);
|
|
150
|
-
}
|
|
151
|
-
.hero__subtitle {
|
|
152
|
-
font-size: var(--oh-typography-body-lg-font-size);
|
|
153
|
-
}
|
|
154
|
-
.hero--journey {
|
|
155
|
-
padding: var(--oh-spacing-6) 0;
|
|
156
|
-
}
|
|
157
|
-
.hero__journey-heading {
|
|
158
|
-
font-size: var(--oh-typography-heading-h3-font-size);
|
|
159
|
-
}
|
|
160
|
-
.hero__progress-wrapper {
|
|
161
|
-
max-width: 100%;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
@media (max-width: 480px) {
|
|
166
|
-
.hero__heading {
|
|
167
|
-
font-size: var(--oh-typography-heading-h3-font-size);
|
|
168
|
-
}
|
|
169
|
-
.hero__journey-heading {
|
|
170
|
-
font-size: var(--oh-typography-heading-h4-font-size);
|
|
171
|
-
}
|
|
172
|
-
.hero__actions {
|
|
173
|
-
flex-direction: column;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
`; }
|
|
177
|
-
render() {
|
|
178
|
-
if (this.variant === "journey") {
|
|
179
|
-
const progressLabel = `Step ${this.currentStep} of ${this.totalSteps}`;
|
|
180
|
-
return html `
|
|
181
|
-
<div class="hero hero--journey">
|
|
182
|
-
<div class="hero__container">
|
|
183
|
-
<h1 class="hero__journey-heading">
|
|
184
|
-
${this.journeyName
|
|
185
|
-
? html `<span class="hero__journey-name">${this.journeyName}</span>`
|
|
186
|
-
: nothing}
|
|
187
|
-
<span class="hero__page-name">${this.heading}</span>
|
|
188
|
-
</h1>
|
|
189
|
-
<div class="hero__progress-wrapper">
|
|
190
|
-
<oh-progress
|
|
191
|
-
.value=${this.currentStep}
|
|
192
|
-
.max=${this.totalSteps}
|
|
193
|
-
label=${progressLabel}
|
|
194
|
-
size="md"
|
|
195
|
-
inverse
|
|
196
|
-
show-value
|
|
197
|
-
></oh-progress>
|
|
198
|
-
</div>
|
|
199
|
-
<slot></slot>
|
|
200
|
-
</div>
|
|
201
|
-
</div>
|
|
202
|
-
`;
|
|
203
|
-
}
|
|
204
|
-
return html `
|
|
205
|
-
<div class="hero">
|
|
206
|
-
<div class="hero__container">
|
|
207
|
-
${this.heading
|
|
208
|
-
? html `<h1 class="hero__heading">${this.heading}</h1>`
|
|
209
|
-
: nothing}
|
|
210
|
-
${this.subtitle
|
|
211
|
-
? html `<p class="hero__subtitle">${this.subtitle}</p>`
|
|
212
|
-
: nothing}
|
|
213
|
-
<div class="hero__actions">
|
|
214
|
-
<slot></slot>
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
</div>
|
|
218
|
-
`;
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
__decorate([
|
|
222
|
-
property({ type: String, reflect: true })
|
|
223
|
-
], OhHero.prototype, "variant", void 0);
|
|
224
|
-
__decorate([
|
|
225
|
-
property({ type: String, reflect: true })
|
|
226
|
-
], OhHero.prototype, "size", void 0);
|
|
227
|
-
__decorate([
|
|
228
|
-
property({ type: String })
|
|
229
|
-
], OhHero.prototype, "heading", void 0);
|
|
230
|
-
__decorate([
|
|
231
|
-
property({ type: String })
|
|
232
|
-
], OhHero.prototype, "subtitle", void 0);
|
|
233
|
-
__decorate([
|
|
234
|
-
property({ type: String, attribute: "journey-name" })
|
|
235
|
-
], OhHero.prototype, "journeyName", void 0);
|
|
236
|
-
__decorate([
|
|
237
|
-
property({ type: Number, attribute: "current-step" })
|
|
238
|
-
], OhHero.prototype, "currentStep", void 0);
|
|
239
|
-
__decorate([
|
|
240
|
-
property({ type: Number, attribute: "total-steps" })
|
|
241
|
-
], OhHero.prototype, "totalSteps", void 0);
|
|
242
|
-
OhHero = __decorate([
|
|
243
|
-
customElement("oh-hero")
|
|
244
|
-
], OhHero);
|
|
245
|
-
export { OhHero };
|
|
246
|
-
//# sourceMappingURL=oh-hero.js.map
|
package/dist/oh-hero.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oh-hero.js","sourceRoot":"","sources":["../src/oh-hero.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;;;;;AAEH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,kBAAkB,CAAC;AAMnB,IAAM,MAAM,GAAZ,MAAM,MAAO,SA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