@orange-halo/components 2.2.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 +551 -314
- package/dist/index.d.ts +1 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -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 +77 -15
- 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 +32 -14
- 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 +35 -16
- 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 +39 -17
- 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.js +63 -44
- 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 +110 -82
- 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 +86 -44
- 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 +85 -55
- 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 +31 -14
- 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 +27 -19
- 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 +21 -5
- package/dist/oh-icon.js.map +1 -1
- package/dist/oh-input.d.ts +104 -20
- 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 +205 -66
- 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 +47 -29
- package/dist/oh-link.js.map +1 -1
- package/dist/oh-modal.d.ts +29 -6
- package/dist/oh-modal.d.ts.map +1 -1
- package/dist/oh-modal.js +37 -16
- 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 +42 -19
- 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 +31 -12
- 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 +83 -43
- 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 +87 -56
- package/dist/oh-radio.js.map +1 -1
- package/dist/oh-select.d.ts +58 -16
- package/dist/oh-select.d.ts.map +1 -1
- package/dist/oh-select.js +70 -33
- 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 +38 -25
- 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 +80 -65
- package/dist/oh-tabs.js.map +1 -1
- package/dist/oh-textarea.d.ts +37 -6
- package/dist/oh-textarea.d.ts.map +1 -1
- package/dist/oh-textarea.js +40 -9
- package/dist/oh-textarea.js.map +1 -1
- package/dist/oh-toggle.d.ts +45 -12
- package/dist/oh-toggle.d.ts.map +1 -1
- package/dist/oh-toggle.js +64 -29
- package/dist/oh-toggle.js.map +1 -1
- package/package.json +3 -7
- package/dist/oh-hero.d.ts +0 -33
- package/dist/oh-hero.d.ts.map +0 -1
- package/dist/oh-hero.js +0 -248
- package/dist/oh-hero.js.map +0 -1
package/dist/oh-radio.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-radio
|
|
3
3
|
*
|
|
4
|
-
* A chunky, playful radio button with hand-crafted feel.
|
|
5
|
-
* Matches the inset/pressed aesthetic of oh-input.
|
|
6
|
-
*
|
|
7
4
|
* DESIGN DECISIONS:
|
|
8
5
|
* ─────────────────
|
|
9
|
-
* 1.
|
|
10
|
-
* -
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
6
|
+
* 1. LOOK FROM TOKENS
|
|
7
|
+
* - Border: stroke.control in color.border.emphasis
|
|
8
|
+
* - Circular: shape.pill
|
|
9
|
+
* - Shadow: offset by elevation.offset.* in elevation.color.secondary; hover and
|
|
10
|
+
* press move the circle by lift.hoverSm / lift.pressSm
|
|
13
11
|
*
|
|
14
12
|
* 2. CHECKED STATE
|
|
15
|
-
* - Filled dot in
|
|
16
|
-
*
|
|
17
|
-
* - Shadow shifts to feel "activated"
|
|
13
|
+
* - Filled with color.brand.primary, a centre dot in color.text.onBrand,
|
|
14
|
+
* and the shadow in elevation.color.primary
|
|
18
15
|
*
|
|
19
16
|
* 3. ACCESSIBILITY
|
|
20
|
-
* -
|
|
17
|
+
* - A native radio, visually hidden but focusable and announced
|
|
21
18
|
* - Label always required
|
|
22
|
-
* - Focus
|
|
23
|
-
* -
|
|
24
|
-
*
|
|
25
|
-
* @element oh-radio
|
|
19
|
+
* - Focus underlines the label (a solid indicator)
|
|
20
|
+
* - Two oh-radios with the same name don't form a group (each native
|
|
21
|
+
* radio is in its own shadow root): use oh-radio-group for a set
|
|
26
22
|
*/
|
|
27
23
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
28
24
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -33,6 +29,44 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
33
29
|
import { html, css, nothing } from "lit";
|
|
34
30
|
import { customElement, property, state } from "lit/decorators.js";
|
|
35
31
|
import { OhElement, baseStyles } from "./base.js";
|
|
32
|
+
/**
|
|
33
|
+
* A single radio button with its label.
|
|
34
|
+
*
|
|
35
|
+
* **Use it for** a one-off radio you manage yourself. **For a set of
|
|
36
|
+
* choices, use `oh-radio-group`.** Each `oh-radio` keeps its native radio
|
|
37
|
+
* inside its own shadow root, so two of them with the same `name` don't form
|
|
38
|
+
* a group: checking one doesn't uncheck the other, and arrow keys don't move
|
|
39
|
+
* between them. `oh-radio-group` renders the whole set in one place, with
|
|
40
|
+
* arrow-key navigation and one label for the group. For an independent
|
|
41
|
+
* on/off choice use `oh-checkbox`.
|
|
42
|
+
*
|
|
43
|
+
* **States:** unchecked, checked, hover, active, focus, error (set `error-text`).
|
|
44
|
+
*
|
|
45
|
+
* **Behaviour:** clicking the circle or label checks it. Checking sets
|
|
46
|
+
* `checked` and fires `oh-change`. The native radio sits in the shadow
|
|
47
|
+
* root, so it doesn't submit with a native form.
|
|
48
|
+
*
|
|
49
|
+
* **Accessibility:** a real native radio, visually hidden, carries the role
|
|
50
|
+
* and state; the drawn circle is decoration. Always set `label`: it's the
|
|
51
|
+
* radio's name. Focus underlines the label. The error message shows under
|
|
52
|
+
* the radio with an icon, sets `aria-invalid` and is linked with
|
|
53
|
+
* `aria-describedby`; it's announced (`role="alert"`) only when it appears
|
|
54
|
+
* after first render.
|
|
55
|
+
*
|
|
56
|
+
* **Look:** set by tokens — `stroke.control` in `color.border.emphasis`
|
|
57
|
+
* (border), `shape.pill` (circle), `typography.control.*` (label),
|
|
58
|
+
* `elevation.offset.*` and `elevation.color.secondary` (shadow), `lift.hoverSm` /
|
|
59
|
+
* `lift.pressSm` (movement on hover and press), `color.border.hover`
|
|
60
|
+
* (hover), `color.brand.primary` (and its hover and active tokens),
|
|
61
|
+
* `color.text.onBrand` and `elevation.color.primary` (checked),
|
|
62
|
+
* `color.feedback.error` and `elevation.color.error` (error).
|
|
63
|
+
*
|
|
64
|
+
* @element oh-radio
|
|
65
|
+
* @fires oh-change - The radio was checked. detail: { checked, value }
|
|
66
|
+
* @csspart circle - The drawn radio circle
|
|
67
|
+
* @csspart label - The label text
|
|
68
|
+
* @csspart error - The error message
|
|
69
|
+
*/
|
|
36
70
|
let OhRadio = class OhRadio extends OhElement {
|
|
37
71
|
constructor() {
|
|
38
72
|
super(...arguments);
|
|
@@ -40,8 +74,11 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
40
74
|
this.label = "";
|
|
41
75
|
this.name = "";
|
|
42
76
|
this.value = "";
|
|
43
|
-
|
|
44
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Error shown with the control and linked to it. Setting it puts the
|
|
79
|
+
* control in its error state; clear it to leave that state.
|
|
80
|
+
*/
|
|
81
|
+
this.errorText = "";
|
|
45
82
|
/**
|
|
46
83
|
* Force a visual state (for documentation/Figma sync only)
|
|
47
84
|
* Values: 'hover' | 'focus'
|
|
@@ -58,11 +95,6 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
58
95
|
static { this.styles = [
|
|
59
96
|
baseStyles,
|
|
60
97
|
css `
|
|
61
|
-
/* ═══════════════════════════════════════════════════════════════
|
|
62
|
-
ORANGE HALO RADIO
|
|
63
|
-
Chunky • Tactile • Playful
|
|
64
|
-
═══════════════════════════════════════════════════════════════ */
|
|
65
|
-
|
|
66
98
|
:host {
|
|
67
99
|
display: inline-block;
|
|
68
100
|
}
|
|
@@ -97,18 +129,18 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
97
129
|
height: 24px;
|
|
98
130
|
flex-shrink: 0;
|
|
99
131
|
|
|
100
|
-
/*
|
|
132
|
+
/* Border: stroke.control in color.border.emphasis; circular (shape.pill) */
|
|
101
133
|
border: var(--oh-stroke-control) solid var(--oh-color-border-emphasis);
|
|
102
134
|
border-radius: var(--oh-shape-pill);
|
|
103
135
|
|
|
104
|
-
/* Offset shadow
|
|
136
|
+
/* Offset shadow: elevation.offset.md in elevation.color.secondary */
|
|
105
137
|
background-color: var(--oh-color-surface-base);
|
|
106
138
|
box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
|
|
107
|
-
0 0 var(--oh-
|
|
139
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
108
140
|
|
|
109
141
|
transition:
|
|
110
|
-
transform var(--oh-motion-snappy) var(--oh-motion-ease-
|
|
111
|
-
box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-
|
|
142
|
+
transform var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
|
|
143
|
+
box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
|
|
112
144
|
background-color var(--oh-motion-quick) ease,
|
|
113
145
|
border-color var(--oh-motion-quick) ease;
|
|
114
146
|
}
|
|
@@ -125,34 +157,34 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
125
157
|
border-radius: var(--oh-shape-pill);
|
|
126
158
|
transform: translate(-50%, -50%) scale(0);
|
|
127
159
|
transition: transform var(--oh-motion-snappy)
|
|
128
|
-
var(--oh-motion-ease-
|
|
160
|
+
var(--oh-motion-ease-emphasized);
|
|
129
161
|
}
|
|
130
162
|
|
|
131
163
|
/* ═══════════════════════════════════════════════════════════════
|
|
132
164
|
STATES
|
|
133
165
|
═══════════════════════════════════════════════════════════════ */
|
|
134
166
|
|
|
135
|
-
/* Hover: lift
|
|
167
|
+
/* Hover: moves by lift.hoverSm; shadow offset elevation.offset.lg */
|
|
136
168
|
.radio-wrapper:hover .radio-circle {
|
|
137
169
|
border-color: var(--oh-color-border-hover);
|
|
138
170
|
transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
|
|
139
171
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
140
|
-
0 0 var(--oh-
|
|
172
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
141
173
|
}
|
|
142
174
|
|
|
143
|
-
/* Active:
|
|
175
|
+
/* Active: moves by lift.pressSm; shadow offset elevation.offset.xs */
|
|
144
176
|
.radio-wrapper:active .radio-circle {
|
|
145
177
|
transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
|
|
146
178
|
box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
|
|
147
|
-
0 0 var(--oh-
|
|
179
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
148
180
|
}
|
|
149
181
|
|
|
150
|
-
/* Checked: primary color
|
|
182
|
+
/* Checked: color.brand.primary fill, elevation.color.primary shadow */
|
|
151
183
|
.native-radio:checked + .radio-circle {
|
|
152
184
|
background-color: var(--oh-color-brand-primary);
|
|
153
185
|
border-color: var(--oh-color-brand-primary);
|
|
154
186
|
box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
|
|
155
|
-
0 0 var(--oh-
|
|
187
|
+
0 0 var(--oh-elevation-color-primary);
|
|
156
188
|
}
|
|
157
189
|
|
|
158
190
|
.native-radio:checked + .radio-circle::after {
|
|
@@ -165,7 +197,7 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
165
197
|
border-color: var(--oh-color-brand-primary-hover);
|
|
166
198
|
transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
|
|
167
199
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
168
|
-
0 0 var(--oh-
|
|
200
|
+
0 0 var(--oh-elevation-color-primary);
|
|
169
201
|
}
|
|
170
202
|
|
|
171
203
|
/* Checked + Active */
|
|
@@ -173,7 +205,7 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
173
205
|
background-color: var(--oh-color-brand-primary-active);
|
|
174
206
|
transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
|
|
175
207
|
box-shadow: var(--oh-elevation-offset-xs) var(--oh-elevation-offset-xs)
|
|
176
|
-
0 0 var(--oh-
|
|
208
|
+
0 0 var(--oh-elevation-color-primary);
|
|
177
209
|
}
|
|
178
210
|
|
|
179
211
|
/* Focus: underline the label (accessible indicator) */
|
|
@@ -199,16 +231,16 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
199
231
|
ERROR STATE
|
|
200
232
|
═══════════════════════════════════════════════════════════════ */
|
|
201
233
|
|
|
202
|
-
:host([
|
|
234
|
+
:host([data-invalid]) .radio-circle {
|
|
203
235
|
border-color: var(--oh-color-feedback-error);
|
|
204
236
|
box-shadow: var(--oh-elevation-offset-md) var(--oh-elevation-offset-md)
|
|
205
|
-
0 0 var(--oh-
|
|
237
|
+
0 0 var(--oh-elevation-color-error);
|
|
206
238
|
}
|
|
207
239
|
|
|
208
|
-
:host([
|
|
240
|
+
:host([data-invalid]) .radio-wrapper:hover .radio-circle {
|
|
209
241
|
border-color: var(--oh-color-feedback-error-hover);
|
|
210
242
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
211
|
-
0 0 var(--oh-
|
|
243
|
+
0 0 var(--oh-elevation-color-error);
|
|
212
244
|
}
|
|
213
245
|
|
|
214
246
|
.error-message {
|
|
@@ -248,7 +280,7 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
248
280
|
border-color: var(--oh-color-border-hover);
|
|
249
281
|
transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
|
|
250
282
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
251
|
-
0 0 var(--oh-
|
|
283
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
252
284
|
}
|
|
253
285
|
|
|
254
286
|
/* Forced Focus - Unchecked */
|
|
@@ -263,7 +295,7 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
263
295
|
border-color: var(--oh-color-brand-primary-hover);
|
|
264
296
|
transform: translate(var(--oh-lift-hover-sm), var(--oh-lift-hover-sm));
|
|
265
297
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
266
|
-
0 0 var(--oh-
|
|
298
|
+
0 0 var(--oh-elevation-color-primary);
|
|
267
299
|
}
|
|
268
300
|
`,
|
|
269
301
|
]; }
|
|
@@ -272,10 +304,14 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
272
304
|
this.checked = target.checked;
|
|
273
305
|
this.emit("oh-change", { checked: this.checked, value: this.value });
|
|
274
306
|
}
|
|
307
|
+
updated(changed) {
|
|
308
|
+
// Styling hook for the error state (data-invalid on the host)
|
|
309
|
+
if (changed.has("errorText"))
|
|
310
|
+
this.toggleAttribute("data-invalid", !!this.errorText);
|
|
311
|
+
}
|
|
275
312
|
willUpdate(changed) {
|
|
276
|
-
if (this.hasUpdated &&
|
|
277
|
-
|
|
278
|
-
this._announceError = !!(this.error && this.errorMessage);
|
|
313
|
+
if (this.hasUpdated && changed.has("errorText")) {
|
|
314
|
+
this._announceError = !!this.errorText;
|
|
279
315
|
}
|
|
280
316
|
}
|
|
281
317
|
render() {
|
|
@@ -290,16 +326,14 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
290
326
|
name=${this.name}
|
|
291
327
|
.value=${this.value}
|
|
292
328
|
.checked=${this.checked}
|
|
293
|
-
aria-invalid=${this.
|
|
294
|
-
aria-describedby=${this.
|
|
295
|
-
? this._errorId
|
|
296
|
-
: nothing}
|
|
329
|
+
aria-invalid=${this.errorText ? "true" : "false"}
|
|
330
|
+
aria-describedby=${this.errorText ? this._errorId : nothing}
|
|
297
331
|
@change=${this._handleChange}
|
|
298
332
|
/>
|
|
299
333
|
<span class="radio-circle" part="circle"></span>
|
|
300
334
|
<span class="label" part="label">${this.label}</span>
|
|
301
335
|
</label>
|
|
302
|
-
${this.
|
|
336
|
+
${this.errorText
|
|
303
337
|
? html `
|
|
304
338
|
<div
|
|
305
339
|
id=${this._errorId}
|
|
@@ -319,7 +353,7 @@ let OhRadio = class OhRadio extends OhElement {
|
|
|
319
353
|
clip-rule="evenodd"
|
|
320
354
|
/>
|
|
321
355
|
</svg>
|
|
322
|
-
${this.
|
|
356
|
+
${this.errorText}
|
|
323
357
|
</div>
|
|
324
358
|
`
|
|
325
359
|
: ""}
|
|
@@ -340,11 +374,8 @@ __decorate([
|
|
|
340
374
|
property({ type: String })
|
|
341
375
|
], OhRadio.prototype, "value", void 0);
|
|
342
376
|
__decorate([
|
|
343
|
-
property({ type:
|
|
344
|
-
], OhRadio.prototype, "
|
|
345
|
-
__decorate([
|
|
346
|
-
property({ type: String })
|
|
347
|
-
], OhRadio.prototype, "errorMessage", void 0);
|
|
377
|
+
property({ type: String, attribute: "error-text" })
|
|
378
|
+
], OhRadio.prototype, "errorText", void 0);
|
|
348
379
|
__decorate([
|
|
349
380
|
property({ type: String, reflect: true, attribute: "force-state" })
|
|
350
381
|
], OhRadio.prototype, "forceState", void 0);
|
package/dist/oh-radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-radio.js","sourceRoot":"","sources":["../src/oh-radio.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oh-radio.js","sourceRoot":"","sources":["../src/oh-radio.ts"],"names":[],"mappings":"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"}
|
package/dist/oh-select.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-select
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
5
|
-
*
|
|
4
|
+
* A custom dropdown select (not a native <select>), so the trigger and the
|
|
5
|
+
* list can be styled with tokens.
|
|
6
6
|
*
|
|
7
7
|
* DESIGN DECISIONS:
|
|
8
8
|
* ─────────────────
|
|
9
|
-
* 1.
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* 1. TRIGGER
|
|
10
|
+
* - A <button role="combobox">, with the same tokens as the other
|
|
11
|
+
* controls: stroke.control border in color.border.emphasis,
|
|
12
|
+
* shape.control corners, an outset shadow offset by
|
|
13
|
+
* elevation.offset.lg in elevation.color.secondary
|
|
14
|
+
* - Hover and press move it by lift.hoverMd / lift.pressSm, like oh-button
|
|
14
15
|
*
|
|
15
16
|
* 2. DROPDOWN PANEL
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
*
|
|
17
|
+
* - A listbox below the trigger, on color.surface.highlight with
|
|
18
|
+
* shape.container corners
|
|
19
|
+
* - The highlighted option is underlined; the selected option is marked
|
|
20
|
+
* in color.brand.primary and set in typography.emphasis.fontWeight
|
|
21
|
+
* - Opens and closes with a transition (none under reduced motion)
|
|
20
22
|
*
|
|
21
23
|
* 3. ACCESSIBILITY
|
|
22
|
-
* - role="combobox" with
|
|
23
|
-
*
|
|
24
|
+
* - role="combobox" with aria-expanded, aria-controls and
|
|
25
|
+
* aria-activedescendant; focus stays on the trigger
|
|
26
|
+
* - Keyboard navigation (arrows, Enter, Space, Escape, Home, End, Tab)
|
|
24
27
|
* - Type-ahead search
|
|
25
|
-
* - Focus management
|
|
26
28
|
* - Label always required
|
|
27
|
-
*
|
|
28
|
-
* @element oh-select
|
|
29
29
|
*/
|
|
30
30
|
import { type PropertyValues } from "lit";
|
|
31
31
|
import { OhElement } from "./base.js";
|
|
@@ -33,6 +33,48 @@ export interface SelectOption {
|
|
|
33
33
|
label: string;
|
|
34
34
|
value: string;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* A dropdown for choosing one option from a list.
|
|
38
|
+
*
|
|
39
|
+
* **Use it for** one choice from a list too long to show every option.
|
|
40
|
+
* **Don't use it for** a few options (use `oh-radio-group`, which shows them
|
|
41
|
+
* all), several choices (use `oh-checkbox-group`) or free text (use
|
|
42
|
+
* `oh-input` with `suggestions`).
|
|
43
|
+
*
|
|
44
|
+
* **Parts:** a trigger showing the selected option's label (or
|
|
45
|
+
* `placeholder`), and a list of `options` (`{ label, value }`). One size.
|
|
46
|
+
* **States:** rest, hover, active, focus, open, error (set `error-text`),
|
|
47
|
+
* required.
|
|
48
|
+
*
|
|
49
|
+
* **Behaviour:** click the trigger, or press Enter, Space or an arrow key,
|
|
50
|
+
* to open the list. Arrow keys, Home and End move the highlight, Enter or
|
|
51
|
+
* Space selects, Escape and Tab close, and clicking outside closes. Typing
|
|
52
|
+
* letters jumps to a matching option (and selects it while the list is
|
|
53
|
+
* closed). Selecting sets `value`, returns focus to the trigger and fires
|
|
54
|
+
* `oh-change`. It isn't form-associated: it doesn't submit with a native
|
|
55
|
+
* form, so read `value` or listen for `oh-change`. It has no `disabled`
|
|
56
|
+
* property.
|
|
57
|
+
*
|
|
58
|
+
* **Accessibility:** the trigger is a `combobox` controlling a `listbox`,
|
|
59
|
+
* with `aria-activedescendant` for the highlighted option, so focus stays
|
|
60
|
+
* on the trigger. Always set `label`: it names the trigger and the list.
|
|
61
|
+
* The error shows after the label and before the trigger, with an icon, sets
|
|
62
|
+
* `aria-invalid` and is linked with `aria-describedby`; it's announced
|
|
63
|
+
* (`role="alert"`) only when it appears after first render. Focus is a
|
|
64
|
+
* solid underline on the trigger text.
|
|
65
|
+
*
|
|
66
|
+
* **Look:** set by tokens — `stroke.control` in `color.border.emphasis`
|
|
67
|
+
* (border), `shape.control` (trigger corners), `shape.container` (list
|
|
68
|
+
* corners), `typography.control.*` (type), `elevation.offset.*` and
|
|
69
|
+
* `elevation.color.secondary` (shadow), `lift.hoverMd` / `lift.pressSm` (movement
|
|
70
|
+
* on hover and press), `color.border.hover` (hover), `focus.ringColor` and
|
|
71
|
+
* `color.surface.highlight` (open), `color.surface.hover` and
|
|
72
|
+
* `color.brand.primary` (selected option), `color.feedback.error` and
|
|
73
|
+
* `elevation.color.error` (error).
|
|
74
|
+
*
|
|
75
|
+
* @element oh-select
|
|
76
|
+
* @fires oh-change - An option was selected. detail: { value }
|
|
77
|
+
*/
|
|
36
78
|
export declare class OhSelect extends OhElement {
|
|
37
79
|
static styles: import("lit").CSSResult[];
|
|
38
80
|
label: string;
|
package/dist/oh-select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oh-select.d.ts","sourceRoot":"","sources":["../src/oh-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"oh-select.d.ts","sourceRoot":"","sources":["../src/oh-select.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BAqQpB;IAGF,KAAK,SAAM;IAGX,WAAW,SAAsB;IAGjC,IAAI,SAAM;IAGV,OAAO,EAAE,YAAY,EAAE,CAAM;IAG7B,KAAK,SAAM;IAGX,QAAQ,UAAS;IAGjB,UAAU,SAAM;IAGhB,SAAS,SAAM;IAGf,OAAO,CAAC,KAAK,CAAS;IAGtB,OAAO,CAAC,iBAAiB,CAAM;IAG/B,OAAO,CAAC,QAAQ,CAAS;IAGzB,OAAO,CAAC,QAAQ,CAAqB;IAGrC,OAAO,CAAC,QAAQ,CAAoB;IAEpC,OAAO,CAAC,QAAQ,CAAgE;IAChF,OAAO,CAAC,UAAU,CAAkE;IACpF,OAAO,CAAC,QAAQ,CAAgE;IAChF,OAAO,CAAC,SAAS,CAAiE;IAClF,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,iBAAiB,CAAuB;IAEhD,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,qBAAqB;IAqE7B,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,oBAAoB;IAO5B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,mBAAmB,CAIzB;IAEO,iBAAiB;IAKjB,oBAAoB;IAK7B;;;;OAIG;IAEH,OAAO,CAAC,cAAc,CAAS;IAE/B,UAAU,CAAC,OAAO,EAAE,cAAc;IAMlC,MAAM;CAoIP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/oh-select.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* oh-select
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
5
|
-
*
|
|
4
|
+
* A custom dropdown select (not a native <select>), so the trigger and the
|
|
5
|
+
* list can be styled with tokens.
|
|
6
6
|
*
|
|
7
7
|
* DESIGN DECISIONS:
|
|
8
8
|
* ─────────────────
|
|
9
|
-
* 1.
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* 1. TRIGGER
|
|
10
|
+
* - A <button role="combobox">, with the same tokens as the other
|
|
11
|
+
* controls: stroke.control border in color.border.emphasis,
|
|
12
|
+
* shape.control corners, an outset shadow offset by
|
|
13
|
+
* elevation.offset.lg in elevation.color.secondary
|
|
14
|
+
* - Hover and press move it by lift.hoverMd / lift.pressSm, like oh-button
|
|
14
15
|
*
|
|
15
16
|
* 2. DROPDOWN PANEL
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
*
|
|
17
|
+
* - A listbox below the trigger, on color.surface.highlight with
|
|
18
|
+
* shape.container corners
|
|
19
|
+
* - The highlighted option is underlined; the selected option is marked
|
|
20
|
+
* in color.brand.primary and set in typography.emphasis.fontWeight
|
|
21
|
+
* - Opens and closes with a transition (none under reduced motion)
|
|
20
22
|
*
|
|
21
23
|
* 3. ACCESSIBILITY
|
|
22
|
-
* - role="combobox" with
|
|
23
|
-
*
|
|
24
|
+
* - role="combobox" with aria-expanded, aria-controls and
|
|
25
|
+
* aria-activedescendant; focus stays on the trigger
|
|
26
|
+
* - Keyboard navigation (arrows, Enter, Space, Escape, Home, End, Tab)
|
|
24
27
|
* - Type-ahead search
|
|
25
|
-
* - Focus management
|
|
26
28
|
* - Label always required
|
|
27
|
-
*
|
|
28
|
-
* @element oh-select
|
|
29
29
|
*/
|
|
30
30
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
31
31
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -36,6 +36,48 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
36
36
|
import { html, css, nothing } from "lit";
|
|
37
37
|
import { customElement, property, state, query } from "lit/decorators.js";
|
|
38
38
|
import { OhElement, baseStyles } from "./base.js";
|
|
39
|
+
/**
|
|
40
|
+
* A dropdown for choosing one option from a list.
|
|
41
|
+
*
|
|
42
|
+
* **Use it for** one choice from a list too long to show every option.
|
|
43
|
+
* **Don't use it for** a few options (use `oh-radio-group`, which shows them
|
|
44
|
+
* all), several choices (use `oh-checkbox-group`) or free text (use
|
|
45
|
+
* `oh-input` with `suggestions`).
|
|
46
|
+
*
|
|
47
|
+
* **Parts:** a trigger showing the selected option's label (or
|
|
48
|
+
* `placeholder`), and a list of `options` (`{ label, value }`). One size.
|
|
49
|
+
* **States:** rest, hover, active, focus, open, error (set `error-text`),
|
|
50
|
+
* required.
|
|
51
|
+
*
|
|
52
|
+
* **Behaviour:** click the trigger, or press Enter, Space or an arrow key,
|
|
53
|
+
* to open the list. Arrow keys, Home and End move the highlight, Enter or
|
|
54
|
+
* Space selects, Escape and Tab close, and clicking outside closes. Typing
|
|
55
|
+
* letters jumps to a matching option (and selects it while the list is
|
|
56
|
+
* closed). Selecting sets `value`, returns focus to the trigger and fires
|
|
57
|
+
* `oh-change`. It isn't form-associated: it doesn't submit with a native
|
|
58
|
+
* form, so read `value` or listen for `oh-change`. It has no `disabled`
|
|
59
|
+
* property.
|
|
60
|
+
*
|
|
61
|
+
* **Accessibility:** the trigger is a `combobox` controlling a `listbox`,
|
|
62
|
+
* with `aria-activedescendant` for the highlighted option, so focus stays
|
|
63
|
+
* on the trigger. Always set `label`: it names the trigger and the list.
|
|
64
|
+
* The error shows after the label and before the trigger, with an icon, sets
|
|
65
|
+
* `aria-invalid` and is linked with `aria-describedby`; it's announced
|
|
66
|
+
* (`role="alert"`) only when it appears after first render. Focus is a
|
|
67
|
+
* solid underline on the trigger text.
|
|
68
|
+
*
|
|
69
|
+
* **Look:** set by tokens — `stroke.control` in `color.border.emphasis`
|
|
70
|
+
* (border), `shape.control` (trigger corners), `shape.container` (list
|
|
71
|
+
* corners), `typography.control.*` (type), `elevation.offset.*` and
|
|
72
|
+
* `elevation.color.secondary` (shadow), `lift.hoverMd` / `lift.pressSm` (movement
|
|
73
|
+
* on hover and press), `color.border.hover` (hover), `focus.ringColor` and
|
|
74
|
+
* `color.surface.highlight` (open), `color.surface.hover` and
|
|
75
|
+
* `color.brand.primary` (selected option), `color.feedback.error` and
|
|
76
|
+
* `elevation.color.error` (error).
|
|
77
|
+
*
|
|
78
|
+
* @element oh-select
|
|
79
|
+
* @fires oh-change - An option was selected. detail: { value }
|
|
80
|
+
*/
|
|
39
81
|
let OhSelect = class OhSelect extends OhElement {
|
|
40
82
|
constructor() {
|
|
41
83
|
super(...arguments);
|
|
@@ -71,11 +113,6 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
71
113
|
static { this.styles = [
|
|
72
114
|
baseStyles,
|
|
73
115
|
css `
|
|
74
|
-
/* ═══════════════════════════════════════════════════════════════
|
|
75
|
-
ORANGE HALO SELECT
|
|
76
|
-
Chunky • Playful • Tactile Dropdown
|
|
77
|
-
═══════════════════════════════════════════════════════════════ */
|
|
78
|
-
|
|
79
116
|
:host {
|
|
80
117
|
display: block;
|
|
81
118
|
position: relative;
|
|
@@ -124,7 +161,7 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
124
161
|
border: var(--oh-stroke-control) solid var(--oh-color-border-emphasis);
|
|
125
162
|
border-radius: var(--oh-shape-control);
|
|
126
163
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
127
|
-
0 0 var(--oh-
|
|
164
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
128
165
|
|
|
129
166
|
cursor: pointer;
|
|
130
167
|
-webkit-appearance: none;
|
|
@@ -132,8 +169,8 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
132
169
|
appearance: none;
|
|
133
170
|
|
|
134
171
|
transition:
|
|
135
|
-
transform var(--oh-motion-snappy) var(--oh-motion-ease-
|
|
136
|
-
box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-
|
|
172
|
+
transform var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
|
|
173
|
+
box-shadow var(--oh-motion-snappy) var(--oh-motion-ease-emphasized),
|
|
137
174
|
border-color var(--oh-motion-snappy) ease,
|
|
138
175
|
background-color var(--oh-motion-quick) ease;
|
|
139
176
|
}
|
|
@@ -171,13 +208,13 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
171
208
|
border-color: var(--oh-color-border-hover);
|
|
172
209
|
transform: translate(var(--oh-lift-hover-md), var(--oh-lift-hover-md));
|
|
173
210
|
box-shadow: var(--oh-elevation-offset-2xl)
|
|
174
|
-
var(--oh-elevation-offset-2xl) 0 0 var(--oh-
|
|
211
|
+
var(--oh-elevation-offset-2xl) 0 0 var(--oh-elevation-color-secondary);
|
|
175
212
|
}
|
|
176
213
|
|
|
177
214
|
.trigger:active {
|
|
178
215
|
transform: translate(var(--oh-lift-press-sm), var(--oh-lift-press-sm));
|
|
179
216
|
box-shadow: var(--oh-elevation-offset-sm) var(--oh-elevation-offset-sm)
|
|
180
|
-
0 0 var(--oh-
|
|
217
|
+
0 0 var(--oh-elevation-color-secondary);
|
|
181
218
|
}
|
|
182
219
|
|
|
183
220
|
.trigger--open {
|
|
@@ -185,7 +222,7 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
185
222
|
background-color: var(--oh-color-surface-highlight);
|
|
186
223
|
}
|
|
187
224
|
|
|
188
|
-
/* Focus: underline trigger text (
|
|
225
|
+
/* Focus: underline the trigger text (a solid indicator, like oh-button) */
|
|
189
226
|
.trigger:focus {
|
|
190
227
|
outline: none;
|
|
191
228
|
}
|
|
@@ -217,7 +254,7 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
217
254
|
border: var(--oh-stroke-control) solid var(--oh-color-border-emphasis);
|
|
218
255
|
border-radius: var(--oh-shape-container);
|
|
219
256
|
box-shadow: var(--oh-elevation-offset-2xl)
|
|
220
|
-
var(--oh-elevation-offset-2xl) 0 0 var(--oh-
|
|
257
|
+
var(--oh-elevation-offset-2xl) 0 0 var(--oh-elevation-color-secondary);
|
|
221
258
|
|
|
222
259
|
max-height: 0;
|
|
223
260
|
overflow: hidden;
|
|
@@ -227,7 +264,7 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
227
264
|
transition:
|
|
228
265
|
max-height var(--oh-motion-gentle) ease,
|
|
229
266
|
opacity var(--oh-motion-snappy) ease,
|
|
230
|
-
transform var(--oh-motion-snappy) var(--oh-motion-ease-
|
|
267
|
+
transform var(--oh-motion-snappy) var(--oh-motion-ease-emphasized);
|
|
231
268
|
}
|
|
232
269
|
|
|
233
270
|
.dropdown--open {
|
|
@@ -290,13 +327,13 @@ let OhSelect = class OhSelect extends OhElement {
|
|
|
290
327
|
.trigger--error {
|
|
291
328
|
border-color: var(--oh-color-feedback-error);
|
|
292
329
|
box-shadow: var(--oh-elevation-offset-lg) var(--oh-elevation-offset-lg)
|
|
293
|
-
0 0 var(--oh-
|
|
330
|
+
0 0 var(--oh-elevation-color-error);
|
|
294
331
|
}
|
|
295
332
|
|
|
296
333
|
.trigger--error:hover {
|
|
297
334
|
border-color: var(--oh-color-feedback-error-hover);
|
|
298
335
|
box-shadow: var(--oh-elevation-offset-2xl)
|
|
299
|
-
var(--oh-elevation-offset-2xl) 0 0 var(--oh-
|
|
336
|
+
var(--oh-elevation-offset-2xl) 0 0 var(--oh-elevation-color-error);
|
|
300
337
|
}
|
|
301
338
|
|
|
302
339
|
.helper {
|
|
@@ -662,10 +699,10 @@ __decorate([
|
|
|
662
699
|
property({ type: Boolean, reflect: true })
|
|
663
700
|
], OhSelect.prototype, "required", void 0);
|
|
664
701
|
__decorate([
|
|
665
|
-
property({ type: String })
|
|
702
|
+
property({ type: String, attribute: "helper-text" })
|
|
666
703
|
], OhSelect.prototype, "helperText", void 0);
|
|
667
704
|
__decorate([
|
|
668
|
-
property({ type: String })
|
|
705
|
+
property({ type: String, attribute: "error-text" })
|
|
669
706
|
], OhSelect.prototype, "errorText", void 0);
|
|
670
707
|
__decorate([
|
|
671
708
|
state()
|