@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
|
@@ -0,0 +1,277 @@
|
|
|
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
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
24
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
25
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
26
|
+
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;
|
|
27
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
28
|
+
};
|
|
29
|
+
import { html, css, nothing } from "lit";
|
|
30
|
+
import { customElement, property } from "lit/decorators.js";
|
|
31
|
+
import { OhElement, baseStyles } from "./base.js";
|
|
32
|
+
let OhBreadcrumb = class OhBreadcrumb extends OhElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
this.items = [];
|
|
36
|
+
}
|
|
37
|
+
static { this.styles = [
|
|
38
|
+
baseStyles,
|
|
39
|
+
css `
|
|
40
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
41
|
+
ORANGE HALO BREADCRUMB
|
|
42
|
+
Semantic • Responsive • Accessible
|
|
43
|
+
═══════════════════════════════════════════════════════════════ */
|
|
44
|
+
|
|
45
|
+
:host {
|
|
46
|
+
display: block;
|
|
47
|
+
font-family: var(--oh-font-family-sans);
|
|
48
|
+
font-size: var(--oh-font-size-base);
|
|
49
|
+
line-height: var(--oh-font-line-height-normal);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
53
|
+
BREADCRUMB LIST
|
|
54
|
+
═══════════════════════════════════════════════════════════════ */
|
|
55
|
+
|
|
56
|
+
.breadcrumb-list {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: var(--oh-spacing-2);
|
|
61
|
+
list-style: none;
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.breadcrumb-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: var(--oh-spacing-2);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
73
|
+
SEPARATOR
|
|
74
|
+
═══════════════════════════════════════════════════════════════ */
|
|
75
|
+
|
|
76
|
+
.breadcrumb-separator {
|
|
77
|
+
color: var(--oh-color-text-secondary);
|
|
78
|
+
user-select: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
82
|
+
LINKS — Reusing oh-link inline styles
|
|
83
|
+
═══════════════════════════════════════════════════════════════ */
|
|
84
|
+
|
|
85
|
+
.breadcrumb-link {
|
|
86
|
+
position: relative;
|
|
87
|
+
display: inline-block;
|
|
88
|
+
color: var(--oh-color-text-link);
|
|
89
|
+
text-decoration: none;
|
|
90
|
+
padding-bottom: 2px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.breadcrumb-link::after {
|
|
94
|
+
content: '';
|
|
95
|
+
position: absolute;
|
|
96
|
+
left: 0;
|
|
97
|
+
bottom: 0;
|
|
98
|
+
width: 100%;
|
|
99
|
+
height: 2px;
|
|
100
|
+
background-image: repeating-linear-gradient(
|
|
101
|
+
to right,
|
|
102
|
+
var(--oh-color-text-link) 0,
|
|
103
|
+
var(--oh-color-text-link) 4px,
|
|
104
|
+
transparent 4px,
|
|
105
|
+
transparent 8px
|
|
106
|
+
);
|
|
107
|
+
background-size: 100% 100%;
|
|
108
|
+
background-repeat: no-repeat;
|
|
109
|
+
transform-origin: right;
|
|
110
|
+
transition: transform var(--oh-motion-relaxed, 300ms) var(--oh-motion-ease-gentle, ease);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.breadcrumb-link:hover::after {
|
|
114
|
+
transform: scaleX(0);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.breadcrumb-link:focus-visible {
|
|
118
|
+
outline: none;
|
|
119
|
+
background-color: var(--oh-color-surface-hover);
|
|
120
|
+
border-radius: var(--oh-radius-xs);
|
|
121
|
+
padding: 0 2px 2px 2px;
|
|
122
|
+
margin: 0 -2px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.breadcrumb-link:focus-visible::after {
|
|
126
|
+
background-image: none;
|
|
127
|
+
background-color: var(--oh-color-brand-primary);
|
|
128
|
+
height: 2px;
|
|
129
|
+
transform: scaleX(1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
133
|
+
CURRENT PAGE
|
|
134
|
+
═══════════════════════════════════════════════════════════════ */
|
|
135
|
+
|
|
136
|
+
.breadcrumb-current {
|
|
137
|
+
color: var(--oh-color-text-primary);
|
|
138
|
+
font-weight: var(--oh-font-weight-medium);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
142
|
+
MOBILE BACK LINK
|
|
143
|
+
═══════════════════════════════════════════════════════════════ */
|
|
144
|
+
|
|
145
|
+
.breadcrumb-back {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.back-link {
|
|
150
|
+
position: relative;
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: var(--oh-spacing-1);
|
|
154
|
+
color: var(--oh-color-text-link);
|
|
155
|
+
text-decoration: none;
|
|
156
|
+
padding-bottom: 2px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.back-link::after {
|
|
160
|
+
content: '';
|
|
161
|
+
position: absolute;
|
|
162
|
+
left: 0;
|
|
163
|
+
bottom: 0;
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 2px;
|
|
166
|
+
background-image: repeating-linear-gradient(
|
|
167
|
+
to right,
|
|
168
|
+
var(--oh-color-text-link) 0,
|
|
169
|
+
var(--oh-color-text-link) 4px,
|
|
170
|
+
transparent 4px,
|
|
171
|
+
transparent 8px
|
|
172
|
+
);
|
|
173
|
+
background-size: 100% 100%;
|
|
174
|
+
background-repeat: no-repeat;
|
|
175
|
+
transform-origin: right;
|
|
176
|
+
transition: transform var(--oh-motion-relaxed, 300ms) var(--oh-motion-ease-gentle, ease);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.back-link:hover::after {
|
|
180
|
+
transform: scaleX(0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.back-link:focus-visible {
|
|
184
|
+
outline: none;
|
|
185
|
+
background-color: var(--oh-color-surface-hover);
|
|
186
|
+
border-radius: var(--oh-radius-xs);
|
|
187
|
+
padding: 0 2px 2px 2px;
|
|
188
|
+
margin: 0 -2px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.back-link:focus-visible::after {
|
|
192
|
+
background-image: none;
|
|
193
|
+
background-color: var(--oh-color-brand-primary);
|
|
194
|
+
height: 2px;
|
|
195
|
+
transform: scaleX(1);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.back-arrow {
|
|
199
|
+
flex-shrink: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
203
|
+
RESPONSIVE — Mobile collapse
|
|
204
|
+
═══════════════════════════════════════════════════════════════ */
|
|
205
|
+
|
|
206
|
+
@media (max-width: 639px) {
|
|
207
|
+
.breadcrumb-list {
|
|
208
|
+
display: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.breadcrumb-back {
|
|
212
|
+
display: block;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
217
|
+
REDUCED MOTION
|
|
218
|
+
═══════════════════════════════════════════════════════════════ */
|
|
219
|
+
|
|
220
|
+
@media (prefers-reduced-motion: reduce) {
|
|
221
|
+
.breadcrumb-link::after,
|
|
222
|
+
.back-link::after {
|
|
223
|
+
transition-duration: 0.01ms !important;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
`,
|
|
227
|
+
]; }
|
|
228
|
+
render() {
|
|
229
|
+
if (this.items.length === 0) {
|
|
230
|
+
return nothing;
|
|
231
|
+
}
|
|
232
|
+
const parentItem = this.items.length > 1 ? this.items[this.items.length - 2] : null;
|
|
233
|
+
return html `
|
|
234
|
+
<nav aria-label="Breadcrumb">
|
|
235
|
+
<!-- Desktop: Full breadcrumb -->
|
|
236
|
+
<ol class="breadcrumb-list">
|
|
237
|
+
${this.items.map((item, index) => {
|
|
238
|
+
const isLast = index === this.items.length - 1;
|
|
239
|
+
const showSeparator = index < this.items.length - 1;
|
|
240
|
+
return html `
|
|
241
|
+
<li class="breadcrumb-item">
|
|
242
|
+
${isLast
|
|
243
|
+
? html `<span class="breadcrumb-current" aria-current="page">${item.label}</span>`
|
|
244
|
+
: html `<a class="breadcrumb-link" href=${item.href || "#"}>${item.label}</a>`}
|
|
245
|
+
${showSeparator
|
|
246
|
+
? html `<span class="breadcrumb-separator" aria-hidden="true">/</span>`
|
|
247
|
+
: nothing}
|
|
248
|
+
</li>
|
|
249
|
+
`;
|
|
250
|
+
})}
|
|
251
|
+
</ol>
|
|
252
|
+
|
|
253
|
+
<!-- Mobile: Back link -->
|
|
254
|
+
${parentItem
|
|
255
|
+
? html `
|
|
256
|
+
<div class="breadcrumb-back">
|
|
257
|
+
<a class="back-link" href=${parentItem.href || "#"}>
|
|
258
|
+
<svg class="back-arrow" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
259
|
+
<path d="M10 12L6 8L10 4" />
|
|
260
|
+
</svg>
|
|
261
|
+
<span>Back to ${parentItem.label}</span>
|
|
262
|
+
</a>
|
|
263
|
+
</div>
|
|
264
|
+
`
|
|
265
|
+
: nothing}
|
|
266
|
+
</nav>
|
|
267
|
+
`;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
__decorate([
|
|
271
|
+
property({ type: Array })
|
|
272
|
+
], OhBreadcrumb.prototype, "items", void 0);
|
|
273
|
+
OhBreadcrumb = __decorate([
|
|
274
|
+
customElement("oh-breadcrumb")
|
|
275
|
+
], OhBreadcrumb);
|
|
276
|
+
export { OhBreadcrumb };
|
|
277
|
+
//# sourceMappingURL=oh-breadcrumb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-breadcrumb.js","sourceRoot":"","sources":["../src/oh-breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;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;AAQ3C,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,SAAS;IAApC;;QAkML,UAAK,GAAqB,EAAE,CAAC;IA8C/B,CAAC;aA/OiB,WAAM,GAAG;QACvB,UAAU;QACV,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2LF;KACF,AA9LqB,CA8LpB;IAKF,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEpF,OAAO,IAAI,CAAA;;;;YAIH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YAC/B,MAAM,MAAM,GAAG,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YAC/C,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YAEpD,OAAO,IAAI,CAAA;;kBAEL,MAAM;gBACN,CAAC,CAAC,IAAI,CAAA,wDAAwD,IAAI,CAAC,KAAK,SAAS;gBACjF,CAAC,CAAC,IAAI,CAAA,mCAAmC,IAAI,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,MAAM;kBAC7E,aAAa;gBACb,CAAC,CAAC,IAAI,CAAA,gEAAgE;gBACtE,CAAC,CAAC,OAAO;;aAEd,CAAC;QACJ,CAAC,CAAC;;;;UAIF,UAAU;YACV,CAAC,CAAC,IAAI,CAAA;;4CAE4B,UAAU,CAAC,IAAI,IAAI,GAAG;;;;kCAIhC,UAAU,CAAC,KAAK;;;aAGrC;YACH,CAAC,CAAC,OAAO;;KAEd,CAAC;IACJ,CAAC;;AA7CD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CACG;AAlMlB,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAgPxB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* oh-button
|
|
3
|
+
*
|
|
4
|
+
* A chunky, confident button with playful personality.
|
|
5
|
+
* Inspired by hand-crafted, illustrative UI — not corporate SaaS.
|
|
6
|
+
*
|
|
7
|
+
* DESIGN DECISIONS:
|
|
8
|
+
* ─────────────────
|
|
9
|
+
* 1. CHUNKY & CONFIDENT
|
|
10
|
+
* - Thick border (2px) that feels illustrative
|
|
11
|
+
* - Solid fills, no subtle gradients
|
|
12
|
+
* - Generous padding, substantial presence
|
|
13
|
+
*
|
|
14
|
+
* 2. OFFSET SHADOW (STICKER EFFECT)
|
|
15
|
+
* - Shadow offset to bottom-right
|
|
16
|
+
* - Feels like a physical sticker or stamp
|
|
17
|
+
* - Not a generic centered drop shadow
|
|
18
|
+
*
|
|
19
|
+
* 3. PLAYFUL INTERACTIONS
|
|
20
|
+
* - Hover: slight upward lift + shadow grows
|
|
21
|
+
* - Active: pressed down, shadow shrinks (stamp effect)
|
|
22
|
+
* - Focus: warm glow + accessible underline
|
|
23
|
+
*
|
|
24
|
+
* 4. HAND-CRAFTED FEEL
|
|
25
|
+
* - Bold, defined edges
|
|
26
|
+
* - Confident color choices
|
|
27
|
+
* - Personality over polish
|
|
28
|
+
*
|
|
29
|
+
* @element oh-button
|
|
30
|
+
*/
|
|
31
|
+
import { OhElement } from "./base.js";
|
|
32
|
+
export type ButtonVariant = "primary" | "secondary" | "accent";
|
|
33
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
34
|
+
export type ButtonState = "default" | "hover" | "active" | "focus";
|
|
35
|
+
export declare class OhButton extends OhElement {
|
|
36
|
+
static styles: import("lit").CSSResult[];
|
|
37
|
+
variant: ButtonVariant;
|
|
38
|
+
size: ButtonSize;
|
|
39
|
+
loading: boolean;
|
|
40
|
+
iconOnly: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Force a visual state (for documentation/Figma sync only)
|
|
43
|
+
* Values: 'hover' | 'active' | 'focus'
|
|
44
|
+
*/
|
|
45
|
+
forceState: ButtonState;
|
|
46
|
+
/** When provided, renders as an anchor tag instead of a button */
|
|
47
|
+
href?: string;
|
|
48
|
+
/** Target for the link (e.g., "_blank" for new tab) */
|
|
49
|
+
target?: string;
|
|
50
|
+
private _handleClick;
|
|
51
|
+
/** Focus the internal button/anchor element */
|
|
52
|
+
focus(options?: FocusOptions): void;
|
|
53
|
+
/** Blur the internal button/anchor element */
|
|
54
|
+
blur(): void;
|
|
55
|
+
render(): import("lit").TemplateResult<1>;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
"oh-button": OhButton;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=oh-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-button.d.ts","sourceRoot":"","sources":["../src/oh-button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;AAC/D,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnE,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,4BA8VpB;IAGF,OAAO,EAAE,aAAa,CAAa;IAGnC,IAAI,EAAE,UAAU,CAAQ;IAGxB,OAAO,UAAS;IAGhB,QAAQ,UAAS;IAEjB;;;OAGG;IAEH,UAAU,EAAE,WAAW,CAAa;IAEpC,kEAAkE;IAElE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,uDAAuD;IAEvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,OAAO,CAAC,YAAY;IASpB,+CAA+C;IACtC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAKrC,8CAA8C;IACrC,IAAI;IAKb,MAAM;CA6CP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-button.figma.d.ts","sourceRoot":"","sources":["../src/oh-button.figma.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import figma, { html } from "@figma/code-connect/html";
|
|
2
|
+
/**
|
|
3
|
+
* Code Connect for oh-button
|
|
4
|
+
*/
|
|
5
|
+
figma.connect("https://www.figma.com/design/q9ZYrOj2w9DrTVmgQFU7bu/OHDS?node-id=1-21", {
|
|
6
|
+
props: {
|
|
7
|
+
variant: figma.enum("Variant", {
|
|
8
|
+
Primary: "primary",
|
|
9
|
+
Secondary: "secondary",
|
|
10
|
+
Accent: "accent",
|
|
11
|
+
}),
|
|
12
|
+
label: figma.string("Label"),
|
|
13
|
+
},
|
|
14
|
+
example: (props) => html `
|
|
15
|
+
<oh-button variant="${props.variant}">
|
|
16
|
+
${props.label}
|
|
17
|
+
</oh-button>
|
|
18
|
+
`,
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=oh-button.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oh-button.figma.js","sourceRoot":"","sources":["../src/oh-button.figma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;GAEG;AAEH,KAAK,CAAC,OAAO,CACX,uEAAuE,EACvE;IACE,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE;YAC7B,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,WAAW;YACtB,MAAM,EAAE,QAAQ;SACjB,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;KAC7B;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;4BACA,KAAK,CAAC,OAAO;UAC/B,KAAK,CAAC,KAAK;;KAEhB;CACF,CACF,CAAC"}
|