@orange-halo/components 1.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 +186 -0
- package/dist/base.d.ts +30 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +78 -0
- package/dist/base.js.map +1 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/oh-accordion.d.ts +47 -0
- package/dist/oh-accordion.d.ts.map +1 -0
- package/dist/oh-accordion.js +387 -0
- package/dist/oh-accordion.js.map +1 -0
- package/dist/oh-alert.d.ts +48 -0
- package/dist/oh-alert.d.ts.map +1 -0
- package/dist/oh-alert.js +343 -0
- package/dist/oh-alert.js.map +1 -0
- package/dist/oh-badge.d.ts +38 -0
- package/dist/oh-badge.d.ts.map +1 -0
- package/dist/oh-badge.js +176 -0
- package/dist/oh-badge.js.map +1 -0
- package/dist/oh-breadcrumb.d.ts +39 -0
- package/dist/oh-breadcrumb.d.ts.map +1 -0
- package/dist/oh-breadcrumb.js +277 -0
- package/dist/oh-breadcrumb.js.map +1 -0
- package/dist/oh-button.d.ts +62 -0
- package/dist/oh-button.d.ts.map +1 -0
- package/dist/oh-button.figma.d.ts +2 -0
- package/dist/oh-button.figma.d.ts.map +1 -0
- package/dist/oh-button.figma.js +20 -0
- package/dist/oh-button.figma.js.map +1 -0
- package/dist/oh-button.js +490 -0
- package/dist/oh-button.js.map +1 -0
- package/dist/oh-card.d.ts +44 -0
- package/dist/oh-card.d.ts.map +1 -0
- package/dist/oh-card.js +340 -0
- package/dist/oh-card.js.map +1 -0
- package/dist/oh-checkbox-group.d.ts +39 -0
- package/dist/oh-checkbox-group.d.ts.map +1 -0
- package/dist/oh-checkbox-group.figma.d.ts +2 -0
- package/dist/oh-checkbox-group.figma.d.ts.map +1 -0
- package/dist/oh-checkbox-group.figma.js +24 -0
- package/dist/oh-checkbox-group.figma.js.map +1 -0
- package/dist/oh-checkbox-group.js +309 -0
- package/dist/oh-checkbox-group.js.map +1 -0
- package/dist/oh-checkbox.d.ts +50 -0
- package/dist/oh-checkbox.d.ts.map +1 -0
- package/dist/oh-checkbox.js +315 -0
- package/dist/oh-checkbox.js.map +1 -0
- package/dist/oh-cluster.d.ts +38 -0
- package/dist/oh-cluster.d.ts.map +1 -0
- package/dist/oh-cluster.js +141 -0
- package/dist/oh-cluster.js.map +1 -0
- package/dist/oh-container.d.ts +38 -0
- package/dist/oh-container.d.ts.map +1 -0
- package/dist/oh-container.js +116 -0
- package/dist/oh-container.js.map +1 -0
- package/dist/oh-drawer.d.ts +66 -0
- package/dist/oh-drawer.d.ts.map +1 -0
- package/dist/oh-drawer.js +284 -0
- package/dist/oh-drawer.js.map +1 -0
- package/dist/oh-footer.d.ts +40 -0
- package/dist/oh-footer.d.ts.map +1 -0
- package/dist/oh-footer.js +112 -0
- package/dist/oh-footer.js.map +1 -0
- package/dist/oh-grid.d.ts +40 -0
- package/dist/oh-grid.d.ts.map +1 -0
- package/dist/oh-grid.js +168 -0
- package/dist/oh-grid.js.map +1 -0
- package/dist/oh-hero.d.ts +28 -0
- package/dist/oh-hero.d.ts.map +1 -0
- package/dist/oh-hero.js +242 -0
- package/dist/oh-hero.js.map +1 -0
- package/dist/oh-icon.d.ts +44 -0
- package/dist/oh-icon.d.ts.map +1 -0
- package/dist/oh-icon.js +321 -0
- package/dist/oh-icon.js.map +1 -0
- package/dist/oh-input.d.ts +56 -0
- package/dist/oh-input.d.ts.map +1 -0
- package/dist/oh-input.figma.d.ts +2 -0
- package/dist/oh-input.figma.d.ts.map +1 -0
- package/dist/oh-input.figma.js +36 -0
- package/dist/oh-input.figma.js.map +1 -0
- package/dist/oh-input.js +320 -0
- package/dist/oh-input.js.map +1 -0
- package/dist/oh-link.d.ts +45 -0
- package/dist/oh-link.d.ts.map +1 -0
- package/dist/oh-link.js +392 -0
- package/dist/oh-link.js.map +1 -0
- package/dist/oh-modal.d.ts +54 -0
- package/dist/oh-modal.d.ts.map +1 -0
- package/dist/oh-modal.js +450 -0
- package/dist/oh-modal.js.map +1 -0
- package/dist/oh-navbar.d.ts +49 -0
- package/dist/oh-navbar.d.ts.map +1 -0
- package/dist/oh-navbar.js +185 -0
- package/dist/oh-navbar.js.map +1 -0
- package/dist/oh-progress.d.ts +56 -0
- package/dist/oh-progress.d.ts.map +1 -0
- package/dist/oh-progress.js +299 -0
- package/dist/oh-progress.js.map +1 -0
- package/dist/oh-radio-group.d.ts +43 -0
- package/dist/oh-radio-group.d.ts.map +1 -0
- package/dist/oh-radio-group.figma.d.ts +2 -0
- package/dist/oh-radio-group.figma.d.ts.map +1 -0
- package/dist/oh-radio-group.figma.js +22 -0
- package/dist/oh-radio-group.figma.js.map +1 -0
- package/dist/oh-radio-group.js +324 -0
- package/dist/oh-radio-group.js.map +1 -0
- package/dist/oh-radio.d.ts +50 -0
- package/dist/oh-radio.d.ts.map +1 -0
- package/dist/oh-radio.js +314 -0
- package/dist/oh-radio.js.map +1 -0
- package/dist/oh-select.d.ts +82 -0
- package/dist/oh-select.d.ts.map +1 -0
- package/dist/oh-select.js +638 -0
- package/dist/oh-select.js.map +1 -0
- package/dist/oh-skip-link.d.ts +37 -0
- package/dist/oh-skip-link.d.ts.map +1 -0
- package/dist/oh-skip-link.js +145 -0
- package/dist/oh-skip-link.js.map +1 -0
- package/dist/oh-stack.d.ts +36 -0
- package/dist/oh-stack.d.ts.map +1 -0
- package/dist/oh-stack.js +112 -0
- package/dist/oh-stack.js.map +1 -0
- package/dist/oh-tabs.d.ts +85 -0
- package/dist/oh-tabs.d.ts.map +1 -0
- package/dist/oh-tabs.js +417 -0
- package/dist/oh-tabs.js.map +1 -0
- package/dist/oh-toggle.d.ts +51 -0
- package/dist/oh-toggle.d.ts.map +1 -0
- package/dist/oh-toggle.js +219 -0
- package/dist/oh-toggle.js.map +1 -0
- package/dist/styles/typography.d.ts +15 -0
- package/dist/styles/typography.d.ts.map +1 -0
- package/dist/styles/typography.js +235 -0
- package/dist/styles/typography.js.map +1 -0
- package/package.json +140 -0
package/dist/oh-alert.js
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oh-alert
|
|
3
|
+
*
|
|
4
|
+
* A dismissible alert for feedback messages.
|
|
5
|
+
* Subtle backgrounds only, supports rich content including links.
|
|
6
|
+
*
|
|
7
|
+
* DESIGN DECISIONS:
|
|
8
|
+
* ─────────────────
|
|
9
|
+
* 1. SUBTLE ONLY
|
|
10
|
+
* - Muted backgrounds, not overwhelming
|
|
11
|
+
* - Matches badge subtle variants
|
|
12
|
+
*
|
|
13
|
+
* 2. DISMISSIBLE
|
|
14
|
+
* - Optional close button
|
|
15
|
+
* - Emits event on dismiss
|
|
16
|
+
*
|
|
17
|
+
* 3. RICH CONTENT
|
|
18
|
+
* - Supports text with links
|
|
19
|
+
* - Default slot for flexible content
|
|
20
|
+
*
|
|
21
|
+
* 4. ACCESSIBLE
|
|
22
|
+
* - role="alert" for important messages
|
|
23
|
+
* - Close button has accessible label
|
|
24
|
+
* - Links within inherit appropriate styling
|
|
25
|
+
*
|
|
26
|
+
* @element oh-alert
|
|
27
|
+
*/
|
|
28
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
29
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
30
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
31
|
+
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;
|
|
32
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
33
|
+
};
|
|
34
|
+
import { html, css, nothing } from "lit";
|
|
35
|
+
import { customElement, property } from "lit/decorators.js";
|
|
36
|
+
import { OhElement, baseStyles } from "./base.js";
|
|
37
|
+
let OhAlert = class OhAlert extends OhElement {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.variant = "info";
|
|
41
|
+
this.dismissible = false;
|
|
42
|
+
/**
|
|
43
|
+
* When true, adds role="alert" for screen reader announcement.
|
|
44
|
+
* Use for dynamically inserted alerts only, not for static page content.
|
|
45
|
+
*/
|
|
46
|
+
this.live = false;
|
|
47
|
+
}
|
|
48
|
+
static { this.styles = [
|
|
49
|
+
baseStyles,
|
|
50
|
+
css `
|
|
51
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
52
|
+
ORANGE HALO ALERT
|
|
53
|
+
Subtle • Dismissible • Rich Content
|
|
54
|
+
═══════════════════════════════════════════════════════════════ */
|
|
55
|
+
|
|
56
|
+
:host {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([hidden]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.alert {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
gap: var(--oh-spacing-3);
|
|
68
|
+
|
|
69
|
+
/* Shape */
|
|
70
|
+
padding: var(--oh-spacing-4);
|
|
71
|
+
border-radius: var(--oh-radius-md);
|
|
72
|
+
|
|
73
|
+
/* Chunky border like other components */
|
|
74
|
+
border: var(--oh-input-base-border-width, 2.5px) solid;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
78
|
+
ICON
|
|
79
|
+
═══════════════════════════════════════════════════════════════ */
|
|
80
|
+
|
|
81
|
+
.alert-icon {
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
width: 1.25rem;
|
|
84
|
+
height: 1.25rem;
|
|
85
|
+
margin-top: 0.125rem; /* Align with text baseline */
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
89
|
+
CONTENT
|
|
90
|
+
═══════════════════════════════════════════════════════════════ */
|
|
91
|
+
|
|
92
|
+
.alert-content {
|
|
93
|
+
flex: 1;
|
|
94
|
+
min-width: 0;
|
|
95
|
+
|
|
96
|
+
/* Typography */
|
|
97
|
+
font-family: var(--oh-font-family-sans);
|
|
98
|
+
font-size: var(--oh-font-size-base);
|
|
99
|
+
line-height: var(--oh-font-line-height-normal);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Links within alert - dashed underline with shrink animation
|
|
104
|
+
* Uses background-image approach which works with ::slotted()
|
|
105
|
+
*/
|
|
106
|
+
.alert-content ::slotted(a) {
|
|
107
|
+
font-weight: var(--oh-font-weight-semibold);
|
|
108
|
+
text-decoration: none;
|
|
109
|
+
background-image: repeating-linear-gradient(
|
|
110
|
+
to right,
|
|
111
|
+
currentColor 0,
|
|
112
|
+
currentColor 4px,
|
|
113
|
+
transparent 4px,
|
|
114
|
+
transparent 8px
|
|
115
|
+
);
|
|
116
|
+
background-size: 100% 2px;
|
|
117
|
+
background-position: 0 100%;
|
|
118
|
+
background-repeat: no-repeat;
|
|
119
|
+
padding-bottom: 2px;
|
|
120
|
+
transition: background-size var(--oh-motion-slow, 450ms) ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.alert-content ::slotted(a:hover) {
|
|
124
|
+
background-size: 0% 2px;
|
|
125
|
+
background-position: 100% 100%;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.alert-content ::slotted(a:focus-visible) {
|
|
129
|
+
outline: 2px solid currentColor;
|
|
130
|
+
outline-offset: 2px;
|
|
131
|
+
border-radius: 2px;
|
|
132
|
+
background-image: linear-gradient(currentColor, currentColor);
|
|
133
|
+
background-size: 100% 2px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
137
|
+
CLOSE BUTTON
|
|
138
|
+
═══════════════════════════════════════════════════════════════ */
|
|
139
|
+
|
|
140
|
+
.alert-close {
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: var(--oh-spacing-1);
|
|
145
|
+
|
|
146
|
+
padding: var(--oh-spacing-1) var(--oh-spacing-2);
|
|
147
|
+
margin: -0.25rem -0.5rem -0.25rem 0;
|
|
148
|
+
|
|
149
|
+
font-family: var(--oh-font-family-sans);
|
|
150
|
+
font-size: var(--oh-font-size-base);
|
|
151
|
+
font-weight: var(--oh-font-weight-medium);
|
|
152
|
+
|
|
153
|
+
background: transparent;
|
|
154
|
+
border: none;
|
|
155
|
+
border-radius: var(--oh-radius-sm);
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
|
|
158
|
+
/* Use primary text color for contrast */
|
|
159
|
+
color: var(--oh-color-text-primary);
|
|
160
|
+
|
|
161
|
+
/* Chunky animation setup */
|
|
162
|
+
transition:
|
|
163
|
+
transform var(--oh-motion-snappy, 150ms) var(--oh-motion-ease-playful, cubic-bezier(0.34, 1.56, 0.64, 1)),
|
|
164
|
+
box-shadow var(--oh-motion-snappy, 150ms) var(--oh-motion-ease-playful, cubic-bezier(0.34, 1.56, 0.64, 1)),
|
|
165
|
+
background-color var(--oh-motion-quick, 120ms) ease;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.alert-close:hover {
|
|
169
|
+
background-color: rgba(0, 0, 0, 0.08);
|
|
170
|
+
transform: translate(-2px, -2px);
|
|
171
|
+
box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 0.15);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.alert-close:active {
|
|
175
|
+
transform: translate(1px, 1px);
|
|
176
|
+
box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.15);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.alert-close:focus-visible {
|
|
180
|
+
outline: none;
|
|
181
|
+
text-decoration: underline;
|
|
182
|
+
text-underline-offset: 3px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.alert-close svg {
|
|
186
|
+
width: 1rem;
|
|
187
|
+
height: 1rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
191
|
+
VARIANTS (Subtle only)
|
|
192
|
+
═══════════════════════════════════════════════════════════════ */
|
|
193
|
+
|
|
194
|
+
.alert--success {
|
|
195
|
+
background-color: var(--oh-color-feedback-success-subtle);
|
|
196
|
+
border-color: var(--oh-color-feedback-success);
|
|
197
|
+
color: var(--oh-color-feedback-success);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.alert--success .alert-content {
|
|
201
|
+
color: var(--oh-color-text-primary);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.alert--success ::slotted(a),
|
|
205
|
+
.alert--success a {
|
|
206
|
+
color: var(--oh-color-feedback-success);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.alert--error {
|
|
210
|
+
background-color: var(--oh-color-feedback-error-subtle);
|
|
211
|
+
border-color: var(--oh-color-feedback-error);
|
|
212
|
+
color: var(--oh-color-feedback-error);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.alert--error .alert-content {
|
|
216
|
+
color: var(--oh-color-text-primary);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.alert--error ::slotted(a),
|
|
220
|
+
.alert--error a {
|
|
221
|
+
color: var(--oh-color-feedback-error);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.alert--warning {
|
|
225
|
+
background-color: var(--oh-color-feedback-warning-subtle);
|
|
226
|
+
border-color: var(--oh-color-feedback-warning);
|
|
227
|
+
color: var(--oh-color-feedback-warning);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.alert--warning .alert-content {
|
|
231
|
+
color: var(--oh-color-text-primary);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.alert--warning ::slotted(a),
|
|
235
|
+
.alert--warning a {
|
|
236
|
+
color: var(--oh-color-feedback-warning);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.alert--info {
|
|
240
|
+
background-color: var(--oh-color-feedback-info-subtle);
|
|
241
|
+
border-color: var(--oh-color-feedback-info);
|
|
242
|
+
color: var(--oh-color-feedback-info);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.alert--info .alert-content {
|
|
246
|
+
color: var(--oh-color-text-primary);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.alert--info ::slotted(a),
|
|
250
|
+
.alert--info a {
|
|
251
|
+
color: var(--oh-color-feedback-info);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
255
|
+
REDUCED MOTION
|
|
256
|
+
═══════════════════════════════════════════════════════════════ */
|
|
257
|
+
|
|
258
|
+
@media (prefers-reduced-motion: reduce) {
|
|
259
|
+
.alert-close {
|
|
260
|
+
transition-duration: 0.01ms !important;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
`,
|
|
264
|
+
]; }
|
|
265
|
+
_handleDismiss() {
|
|
266
|
+
this.emit("oh-dismiss");
|
|
267
|
+
this.hidden = true;
|
|
268
|
+
}
|
|
269
|
+
_getIcon() {
|
|
270
|
+
switch (this.variant) {
|
|
271
|
+
case "success":
|
|
272
|
+
return html `
|
|
273
|
+
<svg class="alert-icon" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
274
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
|
|
275
|
+
</svg>
|
|
276
|
+
`;
|
|
277
|
+
case "error":
|
|
278
|
+
return html `
|
|
279
|
+
<svg class="alert-icon" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
280
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
|
281
|
+
</svg>
|
|
282
|
+
`;
|
|
283
|
+
case "warning":
|
|
284
|
+
return html `
|
|
285
|
+
<svg class="alert-icon" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
286
|
+
<path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd" />
|
|
287
|
+
</svg>
|
|
288
|
+
`;
|
|
289
|
+
case "info":
|
|
290
|
+
default:
|
|
291
|
+
return html `
|
|
292
|
+
<svg class="alert-icon" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
293
|
+
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
|
294
|
+
</svg>
|
|
295
|
+
`;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
render() {
|
|
299
|
+
const classes = this.classMap({
|
|
300
|
+
alert: true,
|
|
301
|
+
[`alert--${this.variant}`]: true,
|
|
302
|
+
});
|
|
303
|
+
return html `
|
|
304
|
+
<div class=${classes} role=${this.live ? "alert" : nothing} part="alert">
|
|
305
|
+
${this._getIcon()}
|
|
306
|
+
|
|
307
|
+
<div class="alert-content" part="content">
|
|
308
|
+
<slot></slot>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
${this.dismissible
|
|
312
|
+
? html `
|
|
313
|
+
<button
|
|
314
|
+
class="alert-close"
|
|
315
|
+
part="close"
|
|
316
|
+
type="button"
|
|
317
|
+
@click=${this._handleDismiss}
|
|
318
|
+
>
|
|
319
|
+
<span>Close</span>
|
|
320
|
+
<svg viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
321
|
+
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" />
|
|
322
|
+
</svg>
|
|
323
|
+
</button>
|
|
324
|
+
`
|
|
325
|
+
: nothing}
|
|
326
|
+
</div>
|
|
327
|
+
`;
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
__decorate([
|
|
331
|
+
property({ type: String, reflect: true })
|
|
332
|
+
], OhAlert.prototype, "variant", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
property({ type: Boolean, reflect: true })
|
|
335
|
+
], OhAlert.prototype, "dismissible", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
property({ type: Boolean, reflect: true })
|
|
338
|
+
], OhAlert.prototype, "live", void 0);
|
|
339
|
+
OhAlert = __decorate([
|
|
340
|
+
customElement("oh-alert")
|
|
341
|
+
], OhAlert);
|
|
342
|
+
export { OhAlert };
|
|
343
|
+
//# sourceMappingURL=oh-alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-alert.js","sourceRoot":"","sources":["../src/oh-alert.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;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;AAK3C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,SAAS;IAA/B;;QA4NL,YAAO,GAAiB,MAAM,CAAC;QAG/B,gBAAW,GAAG,KAAK,CAAC;QAEpB;;;WAGG;QAEH,SAAI,GAAG,KAAK,CAAC;IAqEf,CAAC;aA1SiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqNF;KACF,AAxNqB,CAwNpB;IAeM,cAAc;QACpB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAEO,QAAQ;QACd,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAA;;;;SAIV,CAAC;YACJ,KAAK,OAAO;gBACV,OAAO,IAAI,CAAA;;;;SAIV,CAAC;YACJ,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAA;;;;SAIV,CAAC;YACJ,KAAK,MAAM,CAAC;YACZ;gBACE,OAAO,IAAI,CAAA;;;;SAIV,CAAC;QACN,CAAC;IACH,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;SACjC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;mBACI,OAAO,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;UACtD,IAAI,CAAC,QAAQ,EAAE;;;;;;UAMf,IAAI,CAAC,WAAW;YAChB,CAAC,CAAC,IAAI,CAAA;;;;;yBAKS,IAAI,CAAC,cAAc;;;;;;;aAO/B;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AA9ED;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACX;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACvB;AAOpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAC9B;AAtOF,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA2SnB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oh-badge
|
|
3
|
+
*
|
|
4
|
+
* A flat, non-interactive badge for status indicators and labels.
|
|
5
|
+
* Two styles per color: subtle (muted bg) and filled (strong bg).
|
|
6
|
+
*
|
|
7
|
+
* DESIGN DECISIONS:
|
|
8
|
+
* ─────────────────
|
|
9
|
+
* 1. FLAT & NON-INTERACTIVE
|
|
10
|
+
* - No shadows, no hover states
|
|
11
|
+
* - Pure informational element
|
|
12
|
+
* - Not clickable
|
|
13
|
+
*
|
|
14
|
+
* 2. TWO INTENSITIES
|
|
15
|
+
* - Subtle: muted background, darker text
|
|
16
|
+
* - Filled: strong background, white/dark text
|
|
17
|
+
*
|
|
18
|
+
* 3. ACCESSIBLE CONTRAST
|
|
19
|
+
* - All text meets WCAG AA (4.5:1)
|
|
20
|
+
* - Filled variants use appropriate text color
|
|
21
|
+
*
|
|
22
|
+
* @element oh-badge
|
|
23
|
+
*/
|
|
24
|
+
import { OhElement } from "./base.js";
|
|
25
|
+
export type BadgeVariant = "success" | "error" | "warning" | "info" | "brand" | "accent";
|
|
26
|
+
export type BadgeType = "subtle" | "filled";
|
|
27
|
+
export declare class OhBadge extends OhElement {
|
|
28
|
+
static styles: import("lit").CSSResult[];
|
|
29
|
+
variant: BadgeVariant;
|
|
30
|
+
type: BadgeType;
|
|
31
|
+
render(): import("lit").TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
"oh-badge": OhBadge;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=oh-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-badge.d.ts","sourceRoot":"","sources":["../src/oh-badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACzF,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5C,qBACa,OAAQ,SAAQ,SAAS;IACpC,OAAgB,MAAM,4BAgHpB;IAGF,OAAO,EAAE,YAAY,CAAW;IAGhC,IAAI,EAAE,SAAS,CAAY;IAE3B,MAAM;CAcP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
package/dist/oh-badge.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oh-badge
|
|
3
|
+
*
|
|
4
|
+
* A flat, non-interactive badge for status indicators and labels.
|
|
5
|
+
* Two styles per color: subtle (muted bg) and filled (strong bg).
|
|
6
|
+
*
|
|
7
|
+
* DESIGN DECISIONS:
|
|
8
|
+
* ─────────────────
|
|
9
|
+
* 1. FLAT & NON-INTERACTIVE
|
|
10
|
+
* - No shadows, no hover states
|
|
11
|
+
* - Pure informational element
|
|
12
|
+
* - Not clickable
|
|
13
|
+
*
|
|
14
|
+
* 2. TWO INTENSITIES
|
|
15
|
+
* - Subtle: muted background, darker text
|
|
16
|
+
* - Filled: strong background, white/dark text
|
|
17
|
+
*
|
|
18
|
+
* 3. ACCESSIBLE CONTRAST
|
|
19
|
+
* - All text meets WCAG AA (4.5:1)
|
|
20
|
+
* - Filled variants use appropriate text color
|
|
21
|
+
*
|
|
22
|
+
* @element oh-badge
|
|
23
|
+
*/
|
|
24
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
25
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
26
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
27
|
+
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;
|
|
28
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
29
|
+
};
|
|
30
|
+
import { html, css } from "lit";
|
|
31
|
+
import { customElement, property } from "lit/decorators.js";
|
|
32
|
+
import { OhElement, baseStyles } from "./base.js";
|
|
33
|
+
let OhBadge = class OhBadge extends OhElement {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.variant = "brand";
|
|
37
|
+
this.type = "subtle";
|
|
38
|
+
}
|
|
39
|
+
static { this.styles = [
|
|
40
|
+
baseStyles,
|
|
41
|
+
css `
|
|
42
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
43
|
+
ORANGE HALO BADGE
|
|
44
|
+
Flat • Non-interactive • Informational
|
|
45
|
+
═══════════════════════════════════════════════════════════════ */
|
|
46
|
+
|
|
47
|
+
:host {
|
|
48
|
+
display: inline-block;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.badge {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: var(--oh-spacing-1);
|
|
55
|
+
|
|
56
|
+
/* Typography */
|
|
57
|
+
font-family: var(--oh-font-family-sans);
|
|
58
|
+
font-size: var(--oh-font-size-base);
|
|
59
|
+
font-weight: var(--oh-font-weight-medium);
|
|
60
|
+
line-height: var(--oh-font-line-height-tight, 1.25);
|
|
61
|
+
letter-spacing: var(--oh-font-letter-spacing-wide);
|
|
62
|
+
|
|
63
|
+
/* Shape */
|
|
64
|
+
padding: var(--oh-spacing-1) var(--oh-spacing-2-5);
|
|
65
|
+
border-radius: var(--oh-radius-sm);
|
|
66
|
+
|
|
67
|
+
/* No interaction */
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
user-select: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
73
|
+
SUBTLE VARIANTS (muted background)
|
|
74
|
+
═══════════════════════════════════════════════════════════════ */
|
|
75
|
+
|
|
76
|
+
.badge--subtle.badge--success {
|
|
77
|
+
background-color: var(--oh-color-feedback-success-subtle);
|
|
78
|
+
color: var(--oh-color-feedback-success);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.badge--subtle.badge--error {
|
|
82
|
+
background-color: var(--oh-color-feedback-error-subtle);
|
|
83
|
+
color: var(--oh-color-feedback-error);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.badge--subtle.badge--warning {
|
|
87
|
+
background-color: var(--oh-color-feedback-warning-subtle);
|
|
88
|
+
color: var(--oh-color-feedback-warning);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.badge--subtle.badge--info {
|
|
92
|
+
background-color: var(--oh-color-feedback-info-subtle);
|
|
93
|
+
color: var(--oh-color-feedback-info);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.badge--subtle.badge--brand {
|
|
97
|
+
background-color: var(--oh-color-brand-subtle);
|
|
98
|
+
color: var(--oh-color-brand-primary);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.badge--subtle.badge--accent {
|
|
102
|
+
background-color: var(--oh-color-accent-subtle);
|
|
103
|
+
color: var(--oh-color-accent-default);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
107
|
+
FILLED VARIANTS (strong background)
|
|
108
|
+
═══════════════════════════════════════════════════════════════ */
|
|
109
|
+
|
|
110
|
+
.badge--filled.badge--success {
|
|
111
|
+
background-color: var(--oh-color-feedback-success);
|
|
112
|
+
color: var(--oh-color-surface-white);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.badge--filled.badge--error {
|
|
116
|
+
background-color: var(--oh-color-feedback-error);
|
|
117
|
+
color: var(--oh-color-surface-white);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.badge--filled.badge--warning {
|
|
121
|
+
background-color: var(--oh-color-feedback-warning);
|
|
122
|
+
color: var(--oh-color-surface-white);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.badge--filled.badge--info {
|
|
126
|
+
background-color: var(--oh-color-feedback-info);
|
|
127
|
+
color: var(--oh-color-surface-white);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.badge--filled.badge--brand {
|
|
131
|
+
background-color: var(--oh-color-brand-primary);
|
|
132
|
+
color: var(--oh-color-text-on-brand);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.badge--filled.badge--accent {
|
|
136
|
+
background-color: var(--oh-color-accent-default);
|
|
137
|
+
color: var(--oh-color-text-on-accent);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
141
|
+
ICON SUPPORT
|
|
142
|
+
═══════════════════════════════════════════════════════════════ */
|
|
143
|
+
|
|
144
|
+
::slotted(svg),
|
|
145
|
+
::slotted([slot="icon"]) {
|
|
146
|
+
width: 1em;
|
|
147
|
+
height: 1em;
|
|
148
|
+
flex-shrink: 0;
|
|
149
|
+
}
|
|
150
|
+
`,
|
|
151
|
+
]; }
|
|
152
|
+
render() {
|
|
153
|
+
const classes = this.classMap({
|
|
154
|
+
badge: true,
|
|
155
|
+
[`badge--${this.variant}`]: true,
|
|
156
|
+
[`badge--${this.type}`]: true,
|
|
157
|
+
});
|
|
158
|
+
return html `
|
|
159
|
+
<span class=${classes} part="badge">
|
|
160
|
+
<slot name="icon"></slot>
|
|
161
|
+
<slot></slot>
|
|
162
|
+
</span>
|
|
163
|
+
`;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
__decorate([
|
|
167
|
+
property({ type: String, reflect: true })
|
|
168
|
+
], OhBadge.prototype, "variant", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
property({ type: String, reflect: true })
|
|
171
|
+
], OhBadge.prototype, "type", void 0);
|
|
172
|
+
OhBadge = __decorate([
|
|
173
|
+
customElement("oh-badge")
|
|
174
|
+
], OhBadge);
|
|
175
|
+
export { OhBadge };
|
|
176
|
+
//# sourceMappingURL=oh-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-badge.js","sourceRoot":"","sources":["../src/oh-badge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;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;AAM3C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,SAAS;IAA/B;;QAoHL,YAAO,GAAiB,OAAO,CAAC;QAGhC,SAAI,GAAc,QAAQ,CAAC;IAgB7B,CAAC;aAtIiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6GF;KACF,AAhHqB,CAgHpB;IAQF,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;YAChC,CAAC,UAAU,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;SAC9B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAA;oBACK,OAAO;;;;KAItB,CAAC;IACJ,CAAC;;AAlBD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACV;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCACf;AAvHhB,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAuInB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oh-breadcrumb
|
|
3
|
+
*
|
|
4
|
+
* Accessible breadcrumb navigation with responsive collapse.
|
|
5
|
+
*
|
|
6
|
+
* DESIGN DECISIONS:
|
|
7
|
+
* ─────────────────
|
|
8
|
+
* 1. SEMANTIC STRUCTURE
|
|
9
|
+
* - <nav> with aria-label="Breadcrumb"
|
|
10
|
+
* - <ol> for ordered list semantics
|
|
11
|
+
* - aria-current="page" on last item
|
|
12
|
+
*
|
|
13
|
+
* 2. REUSES EXISTING STYLES
|
|
14
|
+
* - Link styles match oh-link (dashed underline, shrink animation)
|
|
15
|
+
* - Typography and spacing from tokens
|
|
16
|
+
*
|
|
17
|
+
* 3. RESPONSIVE
|
|
18
|
+
* - Desktop: Full breadcrumb trail
|
|
19
|
+
* - Mobile (<640px): Collapses to "← Back to [parent]"
|
|
20
|
+
*
|
|
21
|
+
* @element oh-breadcrumb
|
|
22
|
+
*/
|
|
23
|
+
import { nothing } from "lit";
|
|
24
|
+
import { OhElement } from "./base.js";
|
|
25
|
+
export interface BreadcrumbItem {
|
|
26
|
+
label: string;
|
|
27
|
+
href?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare class OhBreadcrumb extends OhElement {
|
|
30
|
+
static styles: import("lit").CSSResult[];
|
|
31
|
+
items: BreadcrumbItem[];
|
|
32
|
+
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
33
|
+
}
|
|
34
|
+
declare global {
|
|
35
|
+
interface HTMLElementTagNameMap {
|
|
36
|
+
"oh-breadcrumb": OhBreadcrumb;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=oh-breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-breadcrumb.d.ts","sourceRoot":"","sources":["../src/oh-breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAa,OAAO,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBACa,YAAa,SAAQ,SAAS;IACzC,OAAgB,MAAM,4BA8LpB;IAGF,KAAK,EAAE,cAAc,EAAE,CAAM;IAE7B,MAAM;CA4CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|