@florid-kit/components 2.6.7 → 2.6.9
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/assets/icons/icons-occ.d.ts +315 -0
- package/assets/icons/icons.d.ts +7 -66
- package/components/accordion-group.mjs +61 -0
- package/components/accordion.mjs +185 -0
- package/components/arch-image.mjs +135 -0
- package/components/badge.mjs +75 -0
- package/components/breadcrumb.mjs +83 -0
- package/components/breadcrumbs.mjs +35 -0
- package/components/button.d.ts +3 -0
- package/components/button.mjs +10 -0
- package/components/checkbox.mjs +188 -0
- package/components/chip.mjs +158 -0
- package/components/chipset.mjs +44 -0
- package/components/dots.mjs +60 -0
- package/components/dropdown-variant.d.ts +1 -0
- package/components/dropdown-variant.mjs +445 -0
- package/components/dropdown.d.ts +1 -0
- package/components/dropdown.mjs +302 -0
- package/components/feedback-message.mjs +136 -0
- package/components/filter-chip.mjs +214 -0
- package/components/footer-simplify.mjs +178 -0
- package/components/header-simplify.mjs +234 -0
- package/components/icon-button.d.ts +5 -0
- package/components/icon-button.mjs +345 -0
- package/components/input.mjs +294 -0
- package/components/link.mjs +172 -0
- package/components/mediumtile.mjs +307 -0
- package/components/minitile.mjs +231 -0
- package/components/option-tile.mjs +413 -0
- package/components/popin.mjs +412 -0
- package/components/radio.mjs +165 -0
- package/components/rating.mjs +84 -0
- package/components/reassurance.mjs +163 -0
- package/components/search-input-dropdown.mjs +314 -0
- package/components/search-input.mjs +107 -0
- package/components/side-panel.mjs +1197 -0
- package/components/tab.mjs +140 -0
- package/components/tablist.mjs +44 -0
- package/components/tag.mjs +86 -0
- package/components/textarea.mjs +269 -0
- package/components/thumbnail-navigation.mjs +232 -0
- package/components/toast.mjs +190 -0
- package/components/tooltip.mjs +125 -0
- package/components/wishlist-button.d.ts +2 -0
- package/components/wishlist-button.mjs +137 -0
- package/css-r3TDS8Ma.mjs +37 -0
- package/directive-helpers-CjGdYF2i.mjs +11 -0
- package/directive-oAbCiebi.mjs +27 -0
- package/element-internals-Dw7LndlH.mjs +19 -0
- package/icons-occ-DW--7nRr.mjs +834 -0
- package/if-defined-BaFqfNKT.mjs +10 -0
- package/index.mjs +68 -9629
- package/live-BPnRJXAq.mjs +30 -0
- package/loader.d.ts +3 -0
- package/loader.mjs +81 -0
- package/logo-CEgaTL93.mjs +4 -0
- package/package.json +19 -2
- package/performance-mixin-vBVz5Iib.mjs +774 -0
- package/property-8EkRXcYy.mjs +36 -0
- package/query-NJDNu0-P.mjs +25 -0
- package/state-BvkYxy1c.mjs +12 -0
- package/unsafe-svg-CRYN20gz.mjs +210 -0
- package/index.js +0 -5742
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { i as u, m as v, a as b, x as s, t as f } from "../performance-mixin-vBVz5Iib.mjs";
|
|
2
|
+
import { n as l } from "../property-8EkRXcYy.mjs";
|
|
3
|
+
import { r as h } from "../state-BvkYxy1c.mjs";
|
|
4
|
+
import { o as g, i as y, a as p } from "../unsafe-svg-CRYN20gz.mjs";
|
|
5
|
+
var m = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (e, t, r, o) => {
|
|
6
|
+
for (var i = o > 1 ? void 0 : o ? w(t, r) : t, c = e.length - 1, d; c >= 0; c--)
|
|
7
|
+
(d = e[c]) && (i = (o ? d(t, r, i) : d(i)) || i);
|
|
8
|
+
return o && i && m(t, r, i), i;
|
|
9
|
+
};
|
|
10
|
+
let a = class extends v(b) {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.options = [], this.value = "", this.name = "", this.disabled = !1, this.width = "100%", this.open = !1, this.activeIndex = -1, this.menuWidth = "", this._handleOutsideClick = (e) => {
|
|
13
|
+
this.contains(e.target) || (this.open = !1, this.activeIndex = -1);
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), document.addEventListener("click", this._handleOutsideClick), this._unsubOcc = g(() => this.requestUpdate());
|
|
18
|
+
}
|
|
19
|
+
disconnectedCallback() {
|
|
20
|
+
var e;
|
|
21
|
+
document.removeEventListener("click", this._handleOutsideClick), (e = this._unsubOcc) == null || e.call(this), super.disconnectedCallback();
|
|
22
|
+
}
|
|
23
|
+
toggle() {
|
|
24
|
+
var e;
|
|
25
|
+
if (!this.disabled) {
|
|
26
|
+
if (this.open = !this.open, this.activeIndex = this.open ? this.options.findIndex((t) => t.value === this.value) : -1, this.open && this.width === "auto") {
|
|
27
|
+
const t = (e = this.renderRoot) == null ? void 0 : e.querySelector("button");
|
|
28
|
+
t && (this.menuWidth = `${t.getBoundingClientRect().width}px`);
|
|
29
|
+
}
|
|
30
|
+
this.open && this.updateComplete.then(() => {
|
|
31
|
+
this._focusActiveOption();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
_focusActiveOption() {
|
|
36
|
+
var t;
|
|
37
|
+
const e = (t = this.renderRoot) == null ? void 0 : t.querySelector(`#option-${this.activeIndex}`);
|
|
38
|
+
e == null || e.focus();
|
|
39
|
+
}
|
|
40
|
+
selectOption(e) {
|
|
41
|
+
this.value = e.value, this.dispatchEvent(new CustomEvent("change", { detail: { value: this.value, url: e.url } })), this.open = !1, this.activeIndex = -1;
|
|
42
|
+
}
|
|
43
|
+
handleKeydown(e) {
|
|
44
|
+
if (this.disabled) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (!this.open) {
|
|
49
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), this.open = !0, this.activeIndex = this.options.findIndex((t) => t.value === this.value), this.updateComplete.then(() => this._focusActiveOption()));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
switch (e.key) {
|
|
53
|
+
case "ArrowDown":
|
|
54
|
+
e.preventDefault(), this.activeIndex = (this.activeIndex + 1) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
|
|
55
|
+
break;
|
|
56
|
+
case "ArrowUp":
|
|
57
|
+
e.preventDefault(), this.activeIndex = (this.activeIndex - 1 + this.options.length) % this.options.length, this.updateComplete.then(() => this._focusActiveOption());
|
|
58
|
+
break;
|
|
59
|
+
case "Home":
|
|
60
|
+
e.preventDefault(), this.activeIndex = 0, this.updateComplete.then(() => this._focusActiveOption());
|
|
61
|
+
break;
|
|
62
|
+
case "End":
|
|
63
|
+
e.preventDefault(), this.activeIndex = this.options.length - 1, this.updateComplete.then(() => this._focusActiveOption());
|
|
64
|
+
break;
|
|
65
|
+
case "Enter":
|
|
66
|
+
e.preventDefault(), this.activeIndex >= 0 && this.selectOption(this.options[this.activeIndex]);
|
|
67
|
+
break;
|
|
68
|
+
case "Escape":
|
|
69
|
+
e.preventDefault(), this.open = !1, this.activeIndex = -1;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
updated(e) {
|
|
74
|
+
this.options.length > 0 && (this.options.some((r) => r.value === this.value) || (this.value = this.options[0].value));
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
const e = y["occ-check-outlined"] ?? "", t = e ? e.replace(
|
|
78
|
+
"<svg",
|
|
79
|
+
'<svg aria-hidden="true" focusable="false" part="svg"'
|
|
80
|
+
) : "", r = this.options.find((o) => o.value === this.value);
|
|
81
|
+
return s`
|
|
82
|
+
<button
|
|
83
|
+
role="combobox"
|
|
84
|
+
aria-haspopup="listbox"
|
|
85
|
+
aria-controls="dropdown-listbox"
|
|
86
|
+
aria-expanded="${this.open}"
|
|
87
|
+
aria-disabled="${this.disabled ? "true" : "false"}"
|
|
88
|
+
aria-labelledby="dropdown-label"
|
|
89
|
+
@click=${this.toggle}
|
|
90
|
+
@keydown=${this.handleKeydown}
|
|
91
|
+
style=${`width: ${this.width};`}
|
|
92
|
+
?disabled=${this.disabled}
|
|
93
|
+
>
|
|
94
|
+
<span id="dropdown-label" class="label">
|
|
95
|
+
${r ? r.label : "Select an option"}
|
|
96
|
+
</span>
|
|
97
|
+
<span class="arrow">
|
|
98
|
+
<o-icon-button icon='${this.open ? "occ-triangle-up" : "occ-triangle-down"}' size="small" bgstyle="none-contrast" type="span"></o-icon-button>
|
|
99
|
+
</span>
|
|
100
|
+
</button>
|
|
101
|
+
|
|
102
|
+
${this.open ? s`
|
|
103
|
+
<ul
|
|
104
|
+
id="dropdown-listbox"
|
|
105
|
+
role="listbox"
|
|
106
|
+
aria-activedescendant="${this.activeIndex >= 0 ? "option-" + this.activeIndex : ""}"
|
|
107
|
+
style=${`width: ${this.width};`}
|
|
108
|
+
>
|
|
109
|
+
${this.options.map(
|
|
110
|
+
(o, i) => s`
|
|
111
|
+
<li
|
|
112
|
+
id="option-${i}"
|
|
113
|
+
role="option"
|
|
114
|
+
aria-selected="${o.value === this.value}"
|
|
115
|
+
tabindex="${i === this.activeIndex ? "0" : "-1"}"
|
|
116
|
+
class="${i === this.activeIndex ? "active" : ""} ${o.disabled ? "disabled" : ""}"
|
|
117
|
+
@click=${() => this.selectOption(o)}
|
|
118
|
+
>
|
|
119
|
+
${o.url ? s`
|
|
120
|
+
<a href="${o.url}">
|
|
121
|
+
<span>${o.label}</span>
|
|
122
|
+
${o.value === this.value ? s`<span class="check">${p(t)}</span>` : null}
|
|
123
|
+
</a>` : s`
|
|
124
|
+
<span>${o.label}</span>
|
|
125
|
+
${o.value === this.value ? s`<span class="check">${p(t)}</span>` : null}`}
|
|
126
|
+
</li>`
|
|
127
|
+
)}
|
|
128
|
+
</ul>` : null}
|
|
129
|
+
|
|
130
|
+
<input type="hidden" name="${this.name}" .value="${this.value}" />
|
|
131
|
+
`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
a.styles = u`
|
|
135
|
+
:host {
|
|
136
|
+
display: inline-block;
|
|
137
|
+
position: relative;
|
|
138
|
+
width: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
button {
|
|
142
|
+
padding: var(--spacing-s) var(--spacing-l);
|
|
143
|
+
background-color: var(--color-container-bg-default);
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
border-radius: var(--radius-m);
|
|
146
|
+
border: var(--border-m) solid var(--color-border-secondary);
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
width: 100%;
|
|
150
|
+
color: var(--color-content-body);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
button .label {
|
|
154
|
+
font-family: var(--font-family-loccitane-sans);
|
|
155
|
+
font-weight: var(--font-weight-400);
|
|
156
|
+
font-size: var(--font-size-150);
|
|
157
|
+
line-height: var(--line-height-200);
|
|
158
|
+
letter-spacing: var(--letter-spacing-000);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
button .arrow {
|
|
162
|
+
margin-top: auto;
|
|
163
|
+
margin-bottom: auto;
|
|
164
|
+
margin-left: var(--spacing-s);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
button:disabled {
|
|
168
|
+
background-color: var(--color-container-disabled);
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
button:disabled .label {
|
|
173
|
+
color: var(--color-content-disabled);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
button:hover {
|
|
177
|
+
border: var(--border-m) solid var(--color-border-primary);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
button[aria-expanded="true"] {
|
|
181
|
+
border: var(--border-l) solid var(--color-border-primary);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
ul {
|
|
185
|
+
list-style: none;
|
|
186
|
+
margin: 4px 0 0 0;
|
|
187
|
+
padding: 0;
|
|
188
|
+
border: var(--border-m) solid var(--color-border-secondary);
|
|
189
|
+
position: absolute;
|
|
190
|
+
background: white;
|
|
191
|
+
height: auto;
|
|
192
|
+
overflow-y: auto;
|
|
193
|
+
z-index: 1000;
|
|
194
|
+
border-radius: var(--radius-200);
|
|
195
|
+
background-color: var(--color-container-action-secondary-default);
|
|
196
|
+
max-height: calc(5 * 40px);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
li {
|
|
200
|
+
display: flex;
|
|
201
|
+
justify-content: space-between;
|
|
202
|
+
align-items: center;
|
|
203
|
+
padding: var(--spacing-s) var(--spacing-l) var(--spacing-s) var(--spacing-s);
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
border-bottom: var(--border-s) solid var(--color-border-secondary);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
li a {
|
|
209
|
+
display: flex;
|
|
210
|
+
justify-content: space-between;
|
|
211
|
+
width: 100%;
|
|
212
|
+
text-decoration: none;
|
|
213
|
+
color: var(--color-content-body);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
li.disabled {
|
|
217
|
+
background-color: var(--color-container-disabled);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
li.disabled span {
|
|
221
|
+
color: var(--color-content-disabled);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
li:hover:not(.disabled) {
|
|
225
|
+
background-color: var(--color-container-action-secondary-hover);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
li:active:not(.disabled) {
|
|
229
|
+
background-color: var(--color-container-action-secondary-pressed);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
li[aria-selected="true"] {
|
|
233
|
+
background-color: var(--color-container-action-tertiary-default);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
li[aria-selected="true"]:hover {
|
|
237
|
+
background-color: var(--color-container-action-tertiary-hover);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
li[aria-selected="true"]:active {
|
|
241
|
+
background-color: var(--color-container-action-tertiary-pressed);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
li[aria-selected="true"].disabled {
|
|
245
|
+
background-color: var(--color-container-disabled);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
li:last-child {
|
|
249
|
+
border-bottom: none;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
li span {
|
|
253
|
+
font-family: var(--font-family-loccitane-sans);
|
|
254
|
+
font-weight: var(--font-weight-400);
|
|
255
|
+
font-size: var(--font-size-150);
|
|
256
|
+
line-height: var(--line-height-200);
|
|
257
|
+
letter-spacing: var(--letter-spacing-000);
|
|
258
|
+
height: auto;
|
|
259
|
+
color: var(--color-content-body);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.check {
|
|
263
|
+
margin-left: var(--spacing-100);
|
|
264
|
+
width: 12px;
|
|
265
|
+
height: auto;
|
|
266
|
+
color: var(--color-content-action-secondary);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
input[type="hidden"] {
|
|
270
|
+
display: none;
|
|
271
|
+
}
|
|
272
|
+
`;
|
|
273
|
+
n([
|
|
274
|
+
l({ type: Array, reflect: !0 })
|
|
275
|
+
], a.prototype, "options", 2);
|
|
276
|
+
n([
|
|
277
|
+
l({ type: String, reflect: !0 })
|
|
278
|
+
], a.prototype, "value", 2);
|
|
279
|
+
n([
|
|
280
|
+
l({ type: String, reflect: !0 })
|
|
281
|
+
], a.prototype, "name", 2);
|
|
282
|
+
n([
|
|
283
|
+
l({ type: Boolean, reflect: !0 })
|
|
284
|
+
], a.prototype, "disabled", 2);
|
|
285
|
+
n([
|
|
286
|
+
l({ type: String, reflect: !0 })
|
|
287
|
+
], a.prototype, "width", 2);
|
|
288
|
+
n([
|
|
289
|
+
h()
|
|
290
|
+
], a.prototype, "open", 2);
|
|
291
|
+
n([
|
|
292
|
+
h()
|
|
293
|
+
], a.prototype, "activeIndex", 2);
|
|
294
|
+
n([
|
|
295
|
+
h()
|
|
296
|
+
], a.prototype, "menuWidth", 2);
|
|
297
|
+
a = n([
|
|
298
|
+
f("o-dropdown")
|
|
299
|
+
], a);
|
|
300
|
+
export {
|
|
301
|
+
a as OccitaneDropdown
|
|
302
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { i as f, m as d, a as p, x as v, t as h } from "../performance-mixin-vBVz5Iib.mjs";
|
|
2
|
+
import { n } from "../property-8EkRXcYy.mjs";
|
|
3
|
+
import "./icon-button.mjs";
|
|
4
|
+
var b = Object.defineProperty, g = Object.getOwnPropertyDescriptor, o = (r, a, s, c) => {
|
|
5
|
+
for (var e = c > 1 ? void 0 : c ? g(a, s) : a, i = r.length - 1, l; i >= 0; i--)
|
|
6
|
+
(l = r[i]) && (e = (c ? l(a, s, e) : l(e)) || e);
|
|
7
|
+
return c && e && b(a, s, e), e;
|
|
8
|
+
};
|
|
9
|
+
const y = ["standard", "success", "info", "error"], u = {
|
|
10
|
+
standard: "occ-check-filled",
|
|
11
|
+
success: "occ-check-filled",
|
|
12
|
+
error: "occ-close-filled",
|
|
13
|
+
info: "occ-info"
|
|
14
|
+
};
|
|
15
|
+
let t = class extends d(p) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.variant = "standard", this.framed = !1, this.longtext = !1, this.text = "";
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const r = u[this.variant];
|
|
21
|
+
return v`
|
|
22
|
+
<div class="feedback" role="status">
|
|
23
|
+
<span class="icon">
|
|
24
|
+
<o-icon-button
|
|
25
|
+
type="span"
|
|
26
|
+
icon=${r}
|
|
27
|
+
size="medium"
|
|
28
|
+
bgstyle="none-light"
|
|
29
|
+
></o-icon-button>
|
|
30
|
+
</span>
|
|
31
|
+
<span class="text">
|
|
32
|
+
<slot>${this.text}</slot>
|
|
33
|
+
</span>
|
|
34
|
+
</div>
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
t.styles = f`
|
|
39
|
+
:host {
|
|
40
|
+
--feedback-text-color: var(--color-content-action-secondary, #3F2B2E);
|
|
41
|
+
--feedback-bg-color: var(--color-container-bg-default, #F5F0EB);
|
|
42
|
+
|
|
43
|
+
display: block;
|
|
44
|
+
width: fit-content;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([longtext]) {
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([variant="success"]) {
|
|
52
|
+
--feedback-text-color: var(--color-content-success);
|
|
53
|
+
--feedback-bg-color: var(--color-container-success, #C2D5B1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([variant="error"]) {
|
|
57
|
+
--feedback-text-color: var(--color-content-error);
|
|
58
|
+
--feedback-bg-color: var(--color-container-error, #EAB1B7);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([variant="info"]) {
|
|
62
|
+
--feedback-text-color: var(--color-content-info);
|
|
63
|
+
--feedback-bg-color: var(--color-container-info, #C5D3E3);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.feedback {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: var(--spacing-s);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([framed]) .feedback {
|
|
73
|
+
background-color: var(--feedback-bg-color);
|
|
74
|
+
border-radius: var(--radius-S, 2px);
|
|
75
|
+
padding: var(--spacing-m);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([framed][variant="success"]) .feedback,
|
|
79
|
+
:host([framed][variant="error"]) .feedback,
|
|
80
|
+
:host([framed][variant="info"]) .feedback {
|
|
81
|
+
background: linear-gradient(var(--color-alpha-light-strong, rgba(255, 255, 255, 0.56)),
|
|
82
|
+
var(--color-alpha-light-strong, rgba(255, 255, 255, 0.56))),
|
|
83
|
+
var(--feedback-bg-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([framed]) .text,
|
|
87
|
+
:host([framed]) .icon o-icon-button::part(icon-path) {
|
|
88
|
+
color: var(--color-content-action-secondary, #3F2B2E);
|
|
89
|
+
fill: var(--color-content-action-secondary, #3F2B2E);
|
|
90
|
+
font-size: var(--font-size-150);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.icon {
|
|
94
|
+
flex: 0 0 auto;
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
line-height: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.icon o-icon-button::part(icon-path) {
|
|
102
|
+
fill: var(--feedback-text-color);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.text {
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
font-family: var(--font-family-loccitane-sans);
|
|
108
|
+
font-size: var(--font-size-100);
|
|
109
|
+
font-weight: var(--font-weight-400);
|
|
110
|
+
line-height: var(--line-height-160);
|
|
111
|
+
color: var(--feedback-text-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([framed]) .text {
|
|
115
|
+
line-height: var(--line-height-200);
|
|
116
|
+
}
|
|
117
|
+
`;
|
|
118
|
+
o([
|
|
119
|
+
n({ type: String, reflect: !0 })
|
|
120
|
+
], t.prototype, "variant", 2);
|
|
121
|
+
o([
|
|
122
|
+
n({ type: Boolean, reflect: !0 })
|
|
123
|
+
], t.prototype, "framed", 2);
|
|
124
|
+
o([
|
|
125
|
+
n({ type: Boolean, reflect: !0 })
|
|
126
|
+
], t.prototype, "longtext", 2);
|
|
127
|
+
o([
|
|
128
|
+
n({ type: String })
|
|
129
|
+
], t.prototype, "text", 2);
|
|
130
|
+
t = o([
|
|
131
|
+
h("o-feedback-message")
|
|
132
|
+
], t);
|
|
133
|
+
export {
|
|
134
|
+
t as OccitaneFeedbackMessage,
|
|
135
|
+
y as feedbackMessageVariantValues
|
|
136
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { m as b, a as u, i as p, x as o, E as l, t as f } from "../performance-mixin-vBVz5Iib.mjs";
|
|
2
|
+
import { n as s } from "../property-8EkRXcYy.mjs";
|
|
3
|
+
import { f as v } from "../css-r3TDS8Ma.mjs";
|
|
4
|
+
import { m as g } from "../element-internals-Dw7LndlH.mjs";
|
|
5
|
+
import { b as m, a as y } from "../unsafe-svg-CRYN20gz.mjs";
|
|
6
|
+
import "./icon-button.mjs";
|
|
7
|
+
var x = Object.defineProperty, k = Object.getOwnPropertyDescriptor, r = (t, i, a, c) => {
|
|
8
|
+
for (var n = c > 1 ? void 0 : c ? k(i, a) : i, h = t.length - 1, d; h >= 0; h--)
|
|
9
|
+
(d = t[h]) && (n = (c ? d(i, a, n) : d(n)) || n);
|
|
10
|
+
return c && n && x(i, a, n), n;
|
|
11
|
+
};
|
|
12
|
+
const $ = b(g(u));
|
|
13
|
+
let e = class extends $ {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments), this.name = "", this.value = "", this.type = "", this.text = "", this.selected = !1, this.disabled = !1, this.fullwidth = !1, this.crossIconName = "cross", this.strikethroughImgName = "strikeDiagonal";
|
|
16
|
+
}
|
|
17
|
+
handleClick(t) {
|
|
18
|
+
if (t instanceof KeyboardEvent && t.key !== "Enter" && t.key !== " ")
|
|
19
|
+
return;
|
|
20
|
+
this.selected = !this.selected;
|
|
21
|
+
const i = { selected: this.selected }, a = new CustomEvent("selected", { detail: i, bubbles: !0, composed: !0, cancelable: !0 });
|
|
22
|
+
this.dispatchEvent(a), a.defaultPrevented && t.preventDefault(), this.selected = i.selected;
|
|
23
|
+
}
|
|
24
|
+
crossIcon() {
|
|
25
|
+
return o`<o-icon-button size="xsmall" icon="occ-close-outlined" bgstyle="none-light"></o-icon-button>`;
|
|
26
|
+
}
|
|
27
|
+
strikeThroughImg() {
|
|
28
|
+
const t = m[this.strikethroughImgName].replace(
|
|
29
|
+
"<svg",
|
|
30
|
+
'<svg aria-hidden="true" focusable="false" part="strikethrough"'
|
|
31
|
+
).replace(/stroke=[#"'a-z1-9]*/gi, "");
|
|
32
|
+
return y(t);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
const t = this.text;
|
|
36
|
+
return o`${this.type === "link" ? o`
|
|
37
|
+
<a role="button" tabindex="0" class="button" href=${this.href} ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
|
|
38
|
+
aria-label=${this.ariaLabel || l} aria-pressed=${this.selected}>
|
|
39
|
+
${t ? o`
|
|
40
|
+
${this.text ? o`<span class="text">${this.text}</span>` : l}
|
|
41
|
+
` : o`
|
|
42
|
+
<span class="text"><slot></slot></span>`}
|
|
43
|
+
${this.selected ? this.crossIcon() : l}
|
|
44
|
+
</a>
|
|
45
|
+
` : o`
|
|
46
|
+
<button type="button" class="button" ?disabled=${this.disabled} @click=${this.handleClick}
|
|
47
|
+
aria-label=${this.ariaLabel} aria-pressed=${this.selected}>
|
|
48
|
+
${t ? o`
|
|
49
|
+
${this.text ? o`<span class="text">${this.text}</span>` : l}
|
|
50
|
+
` : o`
|
|
51
|
+
<span class="text"><slot></slot></span>`}
|
|
52
|
+
${this.selected ? this.crossIcon() : l}
|
|
53
|
+
</button>
|
|
54
|
+
`}
|
|
55
|
+
${this.disabled ? this.strikeThroughImg() : l}
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
e.styles = p`
|
|
60
|
+
:host {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
display: inline-flex;
|
|
63
|
+
position: relative;
|
|
64
|
+
--button-bg: var(--color-container-action-secondary-default);
|
|
65
|
+
--button-bg-hover: var(--color-container-action-secondary-hover);
|
|
66
|
+
--button-bg-pressed: var(--color-container-action-secondary-pressed);
|
|
67
|
+
--button-text: var(--color-content-action-secondary);
|
|
68
|
+
--button-text-hover: var(--color-content-action-secondary);
|
|
69
|
+
--button-border: var(--color-border-secondary);
|
|
70
|
+
--button-border-width: var(--border-m);
|
|
71
|
+
--button-padding: var(--spacing-m) var(--spacing-xl);
|
|
72
|
+
--button-strikethrough-stroke: var(--color-border-secondary);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host(.a--tabfocus) {
|
|
76
|
+
outline: none !important;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([fullwidth]) {
|
|
80
|
+
width: 100%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([selected]) {
|
|
84
|
+
--button-bg: var(--color-container-filter-default);
|
|
85
|
+
--button-bg-hover: var(--color-container-filter-hover);
|
|
86
|
+
--button-bg-pressed: var(--color-container-filter-pressed);
|
|
87
|
+
--button-text: var(--color-content-action-primary);
|
|
88
|
+
--button-text-hover: var(--color-content-action-primary);
|
|
89
|
+
--button-border: var(--color-container-filter-default);
|
|
90
|
+
--button-strikethrough-stroke: var(--color-border-light);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([disabled]),
|
|
94
|
+
:host([aria-disabled="true"]),
|
|
95
|
+
:host([aria-disabled="true"]:hover) {
|
|
96
|
+
--button-border: var(--color-border-secondary);
|
|
97
|
+
opacity: 0.64;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.button {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: 100%;
|
|
105
|
+
gap: var(--spacing-s);
|
|
106
|
+
height: 100%;
|
|
107
|
+
background-color: var(--button-bg);
|
|
108
|
+
color: var(--button-text);
|
|
109
|
+
border: var(--button-border-width, var(--border-m)) solid var(--button-border);
|
|
110
|
+
border-radius: var(--radius-m);
|
|
111
|
+
font-family: var(--font-family-loccitane-sans);
|
|
112
|
+
font-size: var(--font-size-150);
|
|
113
|
+
font-weight: var(--font-weight-400);
|
|
114
|
+
line-height: var(--line-height-200);
|
|
115
|
+
min-width: 64px;
|
|
116
|
+
padding: var(--button-padding);
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
cursor: inherit;
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.button span {
|
|
123
|
+
font-family: var(--font-family-loccitane-sans);
|
|
124
|
+
font-size: var(--font-size-150);
|
|
125
|
+
font-weight: var(--font-weight-400);
|
|
126
|
+
line-height: var(--line-height-200);
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.button:hover:not([disabled]) {
|
|
132
|
+
background-color: var(--button-bg-hover);
|
|
133
|
+
color: var(--button-text-hover);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.button:active:not([disabled]) {
|
|
137
|
+
background-color: var(--button-bg-pressed);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.button:focus-visible {
|
|
141
|
+
${v};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
span.text + span.text::before {
|
|
145
|
+
content: "•";
|
|
146
|
+
margin-right: 8px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.cross-icon {
|
|
150
|
+
display: inline-flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.cross-icon svg {
|
|
155
|
+
width: 8px;
|
|
156
|
+
height: 8px;
|
|
157
|
+
stroke: var(--color-content-action-primary);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.button slot {
|
|
161
|
+
margin-top: 1px;
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[part="strikethrough"] {
|
|
167
|
+
position: absolute;
|
|
168
|
+
width: 100%;
|
|
169
|
+
height: 100%;
|
|
170
|
+
top: 0;
|
|
171
|
+
bottom: 0;
|
|
172
|
+
left: 0;
|
|
173
|
+
right: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[part="strikethrough"] line {
|
|
177
|
+
stroke: var(--button-strikethrough-stroke);
|
|
178
|
+
stroke-width: 4px;
|
|
179
|
+
stroke-linecap: round;
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
r([
|
|
183
|
+
s({ reflect: !0 })
|
|
184
|
+
], e.prototype, "name", 2);
|
|
185
|
+
r([
|
|
186
|
+
s({ reflect: !0 })
|
|
187
|
+
], e.prototype, "value", 2);
|
|
188
|
+
r([
|
|
189
|
+
s({ type: String, reflect: !0 })
|
|
190
|
+
], e.prototype, "type", 2);
|
|
191
|
+
r([
|
|
192
|
+
s({ type: String, reflect: !0 })
|
|
193
|
+
], e.prototype, "href", 2);
|
|
194
|
+
r([
|
|
195
|
+
s({ type: String, reflect: !0, attribute: "data-href" })
|
|
196
|
+
], e.prototype, "dataHref", 2);
|
|
197
|
+
r([
|
|
198
|
+
s({ type: String })
|
|
199
|
+
], e.prototype, "text", 2);
|
|
200
|
+
r([
|
|
201
|
+
s({ type: Boolean, reflect: !0 })
|
|
202
|
+
], e.prototype, "selected", 2);
|
|
203
|
+
r([
|
|
204
|
+
s({ type: Boolean, reflect: !0 })
|
|
205
|
+
], e.prototype, "disabled", 2);
|
|
206
|
+
r([
|
|
207
|
+
s({ type: Boolean, reflect: !0 })
|
|
208
|
+
], e.prototype, "fullwidth", 2);
|
|
209
|
+
e = r([
|
|
210
|
+
f("o-filter-chip")
|
|
211
|
+
], e);
|
|
212
|
+
export {
|
|
213
|
+
e as OccitaneFilterChip
|
|
214
|
+
};
|