@getflip/swirl-components-react 0.1.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/README.md +4 -0
- package/dist/flip-action-list-item.entry.1b728e6a.js +17 -0
- package/dist/flip-action-list-section.entry.da3e6186.js +15 -0
- package/dist/flip-action-list.entry.400a309a.js +38 -0
- package/dist/flip-avatar-group.entry.71bf1f2a.js +19 -0
- package/dist/flip-avatar.entry.2eb3242e.js +47 -0
- package/dist/flip-badge.entry.ebda6058.js +19 -0
- package/dist/flip-banner.entry.b3012465.js +32 -0
- package/dist/flip-button_2.entry.a323451d.js +42 -0
- package/dist/flip-checkbox.entry.2f740fb8.js +26 -0
- package/dist/flip-chip.entry.e9729ac7.js +34 -0
- package/dist/flip-description-list-item.entry.c789511e.js +80 -0
- package/dist/flip-description-list.entry.3b158436.js +15 -0
- package/dist/flip-dialog.entry.f2be9a9c.js +139 -0
- package/dist/flip-icon-add-photo.entry.a1003bdf.js +15 -0
- package/dist/flip-icon-add.entry.7103fbe7.js +15 -0
- package/dist/flip-icon-admin-panel-settings.entry.36a12e47.js +15 -0
- package/dist/flip-icon-arrow-back.entry.e35ba078.js +15 -0
- package/dist/flip-icon-arrow-forward.entry.5138c404.js +15 -0
- package/dist/flip-icon-arrow-right-small.entry.d1eeb150.js +15 -0
- package/dist/flip-icon-attachment.entry.594b602b.js +15 -0
- package/dist/flip-icon-cancel_2.entry.eb8d1a8c.js +25 -0
- package/dist/flip-icon-chat-bubble.entry.f56fcdc4.js +15 -0
- package/dist/flip-icon-check-circle.entry.e4f8169d.js +15 -0
- package/dist/flip-icon-check-small.entry.308d57d1.js +15 -0
- package/dist/flip-icon-check-strong.entry.b61365d2.js +15 -0
- package/dist/flip-icon-check.entry.f2c6b547.js +15 -0
- package/dist/flip-icon-chevron-left.entry.dbe9b291.js +15 -0
- package/dist/flip-icon-chevron-right.entry.9565c0f1.js +15 -0
- package/dist/flip-icon-close-small.entry.8bfcf1b1.js +15 -0
- package/dist/flip-icon-close.entry.41992748.js +15 -0
- package/dist/flip-icon-comment.entry.2aac2c10.js +15 -0
- package/dist/flip-icon-copy.entry.8e59bf1d.js +15 -0
- package/dist/flip-icon-date-range.entry.c1dd2730.js +15 -0
- package/dist/flip-icon-delete.entry.bc0b61ff.js +15 -0
- package/dist/flip-icon-description.entry.e01b2d40.js +15 -0
- package/dist/flip-icon-download.entry.a512f353.js +15 -0
- package/dist/flip-icon-edit.entry.7e3cd472.js +15 -0
- package/dist/flip-icon-emoji-mood.entry.df7b536f.js +15 -0
- package/dist/flip-icon-emoji-satisfied.entry.e3e5352b.js +15 -0
- package/dist/flip-icon-error.entry.96c3c29b.js +15 -0
- package/dist/flip-icon-expand-less.entry.3e970433.js +15 -0
- package/dist/flip-icon-expand-more.entry.4c1fa160.js +15 -0
- package/dist/flip-icon-file.entry.3a18cce8.js +15 -0
- package/dist/flip-icon-folder-shared.entry.38b22cd2.js +15 -0
- package/dist/flip-icon-group-assign.entry.a640254f.js +15 -0
- package/dist/flip-icon-groups-custom.entry.d77901cd.js +15 -0
- package/dist/flip-icon-groups.entry.80196d79.js +15 -0
- package/dist/flip-icon-image.entry.601bf2ae.js +15 -0
- package/dist/flip-icon-info.entry.b480a255.js +15 -0
- package/dist/flip-icon-inventory.entry.bb8a5615.js +15 -0
- package/dist/flip-icon-like.entry.af8b36e2.js +15 -0
- package/dist/flip-icon-link.entry.be72688c.js +15 -0
- package/dist/flip-icon-lock.entry.440459fe.js +15 -0
- package/dist/flip-icon-logout.entry.dde0bfc8.js +15 -0
- package/dist/flip-icon-mail.entry.b57a0093.js +15 -0
- package/dist/flip-icon-manage-accounts.entry.11cc3149.js +15 -0
- package/dist/flip-icon-mention.entry.32771810.js +15 -0
- package/dist/flip-icon-message.entry.636088c3.js +15 -0
- package/dist/flip-icon-more-horizontal.entry.38f14508.js +15 -0
- package/dist/flip-icon-more-vertikal.entry.8a4c613a.js +15 -0
- package/dist/flip-icon-notifications-active.entry.5658308d.js +15 -0
- package/dist/flip-icon-notifications-off.entry.8d3b11ff.js +15 -0
- package/dist/flip-icon-notifications.entry.91f77dd2.js +15 -0
- package/dist/flip-icon-people-alt.entry.b0b2e20c.js +15 -0
- package/dist/flip-icon-person-off.entry.e79df0e6.js +15 -0
- package/dist/flip-icon-person.entry.1bc59e68.js +15 -0
- package/dist/flip-icon-phone.entry.03e81177.js +15 -0
- package/dist/flip-icon-poll.entry.4e059f77.js +15 -0
- package/dist/flip-icon-recieved.entry.e3410f9e.js +15 -0
- package/dist/flip-icon-search-strong.entry.ec0849a6.js +15 -0
- package/dist/flip-icon-send.entry.3f80869c.js +15 -0
- package/dist/flip-icon-settings.entry.c86a7bca.js +15 -0
- package/dist/flip-icon-time-filled.entry.ad86a08f.js +15 -0
- package/dist/flip-icon-time-outlined.entry.75a29f76.js +15 -0
- package/dist/flip-icon-today.entry.ab272990.js +15 -0
- package/dist/flip-icon-user-assign.entry.1f331180.js +15 -0
- package/dist/flip-icon-video-camera.entry.40ea3d7d.js +15 -0
- package/dist/flip-icon-visibility-off.entry.ed4db3b5.js +15 -0
- package/dist/flip-icon-visibility.entry.1a7dfd44.js +15 -0
- package/dist/flip-icon-warning.entry.1c1540b8.js +15 -0
- package/dist/flip-inline-error.entry.38c26d13.js +17 -0
- package/dist/flip-link.entry.fe817ab1.js +15 -0
- package/dist/flip-popover.entry.18c5ead6.js +878 -0
- package/dist/flip-radio-group.entry.187f29ee.js +35 -0
- package/dist/flip-radio.entry.817d976d.js +25 -0
- package/dist/flip-search.entry.6717d77a.js +30 -0
- package/dist/flip-spinner.entry.f8f179be.js +17 -0
- package/dist/flip-stack.entry.50d88d6f.js +17 -0
- package/dist/flip-switch.entry.ef96875e.js +55 -0
- package/dist/flip-tag.entry.31a7d0f7.js +20 -0
- package/dist/flip-theme-provider.entry.9c054d33.js +181 -0
- package/dist/flip-thumbnail.entry.449e93ef.js +17 -0
- package/dist/flip-toast-provider.entry.59025e1a.js +28 -0
- package/dist/flip-toast.entry.78522d59.js +38 -0
- package/dist/flip-tooltip.entry.8b5f35c7.js +102 -0
- package/dist/flip-visually-hidden.entry.ae0ff292.js +15 -0
- package/dist/index-3c78bcaf.2675909b.js +48 -0
- package/dist/main.7e7363a7.js +1322 -0
- package/dist/swirl-components-react.js +103 -0
- package/dist/swirl-components-react.umd.cjs +106 -0
- package/dist/utils-03e3261c.f5223801.js +16 -0
- package/package.json +31 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { r as a, c as s, h as r, H as l, g as n } from "./main.7e7363a7.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const u = ".sc-flip-radio-group-h{display:block}.sc-flip-radio-group-h *.sc-flip-radio-group{box-sizing:border-box}.radio-group.sc-flip-radio-group{display:flex;flex-direction:column;gap:var(--s-space-4)}", d = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
a(this, e), this.valueChange = s(this, "valueChange", 7);
|
|
7
|
+
}
|
|
8
|
+
componentDidLoad() {
|
|
9
|
+
this.radioButtons = Array.from(this.el.querySelectorAll("flip-radio")), this.initValue(), this.handleValueChanges();
|
|
10
|
+
}
|
|
11
|
+
initValue() {
|
|
12
|
+
if (this.value === void 0)
|
|
13
|
+
return;
|
|
14
|
+
const e = this.radioButtons.find((i) => i.value === this.value);
|
|
15
|
+
!Boolean(e) || (e.checked = !0);
|
|
16
|
+
}
|
|
17
|
+
handleValueChanges() {
|
|
18
|
+
for (const [e, i] of Object.entries(this.radioButtons))
|
|
19
|
+
i.addEventListener("valueChange", () => {
|
|
20
|
+
(i.checked === !0 || i.checked === "true") && (this.valueChange.emit(i.value), this.radioButtons.forEach((t, o) => {
|
|
21
|
+
String(o) !== e && (t.checked = !1);
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return r(l, { role: "radiogroup" }, r("div", { class: "radio-group" }, r("slot", null)));
|
|
27
|
+
}
|
|
28
|
+
get el() {
|
|
29
|
+
return n(this);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
d.style = u;
|
|
33
|
+
export {
|
|
34
|
+
d as flip_radio_group
|
|
35
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { r as s, c as l, h as i, H as c } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as t } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const n = `.sc-flip-radio-h{display:inline-flex}.sc-flip-radio-h *.sc-flip-radio{box-sizing:border-box}.radio.sc-flip-radio{display:inline-flex;cursor:pointer;line-height:var(--s-line-height-base)}.radio.sc-flip-radio:focus-within .radio__box.sc-flip-radio{box-shadow:0 0 0 0.0625rem var(--s-background-default),
|
|
6
|
+
0 0 0 0.1875rem var(--s-focus-default)}.radio--checked.sc-flip-radio .radio__control.sc-flip-radio:hover .radio__box.sc-flip-radio{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.radio--checked.sc-flip-radio .radio__box.sc-flip-radio{position:relative;border-color:var(--s-icon-highlight);background-color:var(--s-icon-highlight)}.radio--checked.sc-flip-radio .radio__box.sc-flip-radio:after{position:absolute;top:50%;left:50%;width:0.5rem;height:0.5rem;border-radius:50%;background-color:var(--s-background-default);content:"";transform:translate3d(-50%, -50%, 0)}.radio--invalid.radio--checked.sc-flip-radio .radio__box.sc-flip-radio,.radio--invalid.radio--indeterminate.sc-flip-radio .radio__box.sc-flip-radio{background-color:var(--s-icon-critical)}.radio--invalid.sc-flip-radio .radio__box.sc-flip-radio{border-color:var(--s-icon-critical)}.radio--disabled.sc-flip-radio{cursor:default}.radio--disabled.radio--checked.sc-flip-radio .radio__control.sc-flip-radio:hover .radio__box.sc-flip-radio{border-color:var(--s-icon-disabled);background-color:transparent}.radio--disabled.radio--checked.sc-flip-radio .radio__box.sc-flip-radio{border-color:var(--s-icon-disabled);background-color:var(--s-background-default)}.radio--disabled.radio--checked.sc-flip-radio .radio__box.sc-flip-radio:after{background-color:var(--s-icon-disabled)}.radio--disabled.sc-flip-radio .radio__control.sc-flip-radio:hover .radio__box.sc-flip-radio{background-color:transparent}.radio--disabled.sc-flip-radio .radio__box.sc-flip-radio{border-color:var(--s-icon-disabled);backround-color:var(--s-icon-disabled)}.radio--disabled.sc-flip-radio .radio__description.sc-flip-radio,.radio--disabled.sc-flip-radio .radio__label.sc-flip-radio{color:var(--s-text-disabled)}.radio__control.sc-flip-radio{position:relative;display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.radio__control.sc-flip-radio:hover .radio__box.sc-flip-radio{background-color:var(--s-action-neutral-hovered)}.radio__box.sc-flip-radio{position:relative;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:50%}.radio__label-container.sc-flip-radio{display:inline-flex;margin-left:var(--s-space-12);padding-top:var(--s-space-2);flex-direction:column}.radio__label.sc-flip-radio{font-weight:var(--s-font-weight-medium)}.radio__description.sc-flip-radio{color:var(--s-text-subdued)}`, h = class {
|
|
7
|
+
constructor(a) {
|
|
8
|
+
s(this, a), this.valueChange = l(this, "valueChange", 7), this.checked = !1, this.disabled = !1, this.onChange = () => {
|
|
9
|
+
this.checked = !0, this.valueChange.emit(this.value);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
const a = this.checked === !1 || this.checked === "false", r = this.checked === !0 || this.checked === "true", o = r ? "true" : a ? "false" : "mixed", d = this.invalid, e = t("radio", {
|
|
14
|
+
"radio--checked": r,
|
|
15
|
+
"radio--disabled": this.disabled,
|
|
16
|
+
"radio--invalid": this.invalid,
|
|
17
|
+
"radio--unchecked": a
|
|
18
|
+
});
|
|
19
|
+
return i(c, null, i("label", { class: e, htmlFor: this.inputId }, i("span", { class: "radio__control" }, i("flip-visually-hidden", null, i("input", { "aria-checked": o, "aria-invalid": d, checked: r, class: "radio__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, type: "radio", value: this.value })), i("span", { "aria-hidden": "true", class: "radio__box" })), i("span", { class: "radio__label-container" }, this.label && i("span", { class: "radio__label" }, this.label), this.description && i("span", { class: "radio__description" }, this.description))));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
h.style = n;
|
|
23
|
+
export {
|
|
24
|
+
h as flip_radio
|
|
25
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { r as c, c as r, h as a, H as i } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as t } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const l = ".sc-flip-search-h{display:flex;width:100%}.sc-flip-search-h *.sc-flip-search{box-sizing:border-box}.search.sc-flip-search{position:relative;display:flex;width:100%}.search--disabled.sc-flip-search .search__icon.sc-flip-search{color:var(--s-icon-disabled)}.search--disabled.sc-flip-search .search__input.sc-flip-search{color:var(--s-text-disabled)}.search--disabled.sc-flip-search .search__input.sc-flip-search::-moz-placeholder{color:var(--s-text-disabled)}.search--disabled.sc-flip-search .search__input.sc-flip-search::placeholder{color:var(--s-text-disabled)}.search__icon.sc-flip-search{position:absolute;top:50%;left:var(--s-space-12);display:inline-flex;color:var(--s-icon-default);transform:translateY(-50%)}.search__input.sc-flip-search{width:100%;height:2.5rem;padding-top:var(--s-space-8);padding-right:calc(var(--s-space-12) + 1.5rem + var(--s-space-8));padding-bottom:var(--s-space-8);padding-left:calc(var(--s-space-12) + 1.5rem + var(--s-space-8));border:none;border-radius:var(--s-border-radius-base);color:var(--s-text-default);background-color:var(--s-surface-raised-default);font:inherit;line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.search__input.sc-flip-search:focus{outline-color:var(--s-focus-default)}.search__input.sc-flip-search::-moz-placeholder{color:var(--s-text-subdued)}.search__input.sc-flip-search::placeholder{color:var(--s-text-subdued)}.search__input.sc-flip-search::-webkit-search-decoration,.search__input.sc-flip-search::-webkit-search-cancel-button,.search__input.sc-flip-search::-webkit-search-results-button,.search__input.sc-flip-search::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}.search__input.sc-flip-search:not(:-moz-placeholder-shown)+.search__clear-button.sc-flip-search{display:inline-flex}.search__input.sc-flip-search:not(:placeholder-shown)+.search__clear-button.sc-flip-search{display:inline-flex}.search__clear-button.sc-flip-search{position:absolute;top:50%;right:var(--s-space-12);display:none;padding:0;border:none;color:var(--s-icon-default);background-color:transparent;cursor:pointer;transform:translateY(-50%)}", o = class {
|
|
6
|
+
constructor(s) {
|
|
7
|
+
c(this, s), this.inputBlur = r(this, "inputBlur", 7), this.inputFocus = r(this, "inputFocus", 7), this.valueChange = r(this, "valueChange", 7), this.clearButtonLabel = "Clear search term", this.placeholder = "Search \u2026", this.clear = () => {
|
|
8
|
+
this.input.value = "", this.input.focus();
|
|
9
|
+
}, this.onBlur = (e) => {
|
|
10
|
+
this.inputBlur.emit(e);
|
|
11
|
+
}, this.onChange = (e) => {
|
|
12
|
+
this.valueChange.emit(e.target.value);
|
|
13
|
+
}, this.onFocus = (e) => {
|
|
14
|
+
this.inputFocus.emit(e);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
onKeyDown(s) {
|
|
18
|
+
(s.code === "KeyK" || s.code === "Slash") && (s.ctrlKey || s.metaKey) && this.input.focus();
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const s = t("search", {
|
|
22
|
+
"search--disabled": this.disabled
|
|
23
|
+
});
|
|
24
|
+
return a(i, null, a("span", { class: s }, a("flip-icon-search", { class: "search__icon" }), a("input", { "aria-disabled": this.disabled ? "true" : void 0, "aria-label": this.label, autoComplete: "off", autoFocus: this.autoFocus, class: "search__input", disabled: this.disabled, id: this.inputId, inputMode: "search", name: this.inputName, onBlur: this.onBlur, onChange: this.onChange, onFocus: this.onFocus, placeholder: this.placeholder, ref: (e) => this.input = e, type: "search", value: this.value }), !this.disabled && a("button", { "aria-label": this.clearButtonLabel, class: "search__clear-button", onClick: this.clear, type: "button" }, a("flip-icon-cancel", null))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
o.style = l;
|
|
28
|
+
export {
|
|
29
|
+
o as flip_search
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r, h as e, H as i } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as n } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const t = ":host{display:inline-flex}:host *{box-sizing:border-box}.spinner{position:relative;display:inline-flex;overflow:hidden;width:2.25rem;height:2.25rem}.spinner--size-s{width:1.5rem;height:1.5rem}.spinner--size-s .spinner__circle{stroke-width:0.1875rem}.spinner__indicator{position:absolute;inset:0;width:100%;height:100%;transform-origin:center center;-webkit-animation:spinner-rotate 2s linear infinite;animation:spinner-rotate 2s linear infinite}.spinner__background{stroke:var(--s-border-default);stroke-linecap:round}.spinner__circle{-webkit-animation:spinner-dash 1.5s ease-in-out infinite;animation:spinner-dash 1.5s ease-in-out infinite;stroke:var(--s-interactive-primary-default);stroke-dasharray:1, 200;stroke-dashoffset:0;stroke-linecap:round}@-webkit-keyframes spinner-rotate{100%{transform:rotate(360deg)}}@keyframes spinner-rotate{100%{transform:rotate(360deg)}}@-webkit-keyframes spinner-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124}}@keyframes spinner-dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124}}", a = class {
|
|
6
|
+
constructor(s) {
|
|
7
|
+
r(this, s), this.size = "m";
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const s = n("spinner", `spinner--size-${this.size}`);
|
|
11
|
+
return e(i, null, e("span", { class: s, role: Boolean(this.label) ? "status" : void 0 }, e("svg", { "aria-hidden": "true", class: "spinner__indicator", focusable: "false", viewBox: "0 0 50 50" }, e("circle", { class: "spinner__background", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "4" }), e("circle", { class: "spinner__circle", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "4" })), this.label && e("flip-visually-hidden", null, e("span", { class: "spinner__label" }, this.label))));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
a.style = t;
|
|
15
|
+
export {
|
|
16
|
+
a as flip_spinner
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as i, h as s, H as e } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as n } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const c = ":host{display:block;width:100%}:host *{box-sizing:border-box}.stack{display:flex;width:100%;max-width:100%}.stack ::slotted(*){min-width:0;max-width:100%;flex-basis:auto;flex-grow:0;flex-shrink:0}.stack--align-start{align-items:flex-start}.stack--align-center{align-items:center}.stack--align-end{align-items:flex-end}.stack--align-stretch{align-items:stretch}.stack--justify-start{justify-content:flex-start}.stack--justify-center{justify-content:center}.stack--justify-end{justify-content:flex-end}.stack--justify-space-between{justify-content:space-between}.stack--justify-space-around{justify-content:space-around}.stack--justify-space-evenly{justify-content:space-evenly}.stack--justify-stretch{justify-content:stretch}.stack--justify-stretch ::slotted(*){flex-grow:1}.stack--orientation-vertical{flex-direction:column}.stack--orientation-horizontal{flex-direction:row}.stack--wrap{flex-wrap:wrap}", r = class {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
i(this, t), this.align = "start", this.as = "div", this.justify = "start", this.orientation = "vertical", this.spacing = "0", this.wrap = !1;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const t = this.as, a = n("stack", `stack--align-${this.align}`, `stack--justify-${this.justify}`, `stack--orientation-${this.orientation}`, { "stack--wrap": this.wrap });
|
|
11
|
+
return s(e, null, s(t, { class: a, style: { gap: `var(--s-space-${this.spacing})` } }, s("slot", null)));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
r.style = c;
|
|
15
|
+
export {
|
|
16
|
+
r as flip_stack
|
|
17
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as n, c as r, h as e, H as a, g as o } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as l } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const d = `.sc-flip-switch-h{display:inline-flex}.sc-flip-switch-h *.sc-flip-switch{box-sizing:border-box}.switch.sc-flip-switch{display:inline-flex;align-items:center;touch-action:none}.switch.sc-flip-switch:focus-within .switch__control.sc-flip-switch{box-shadow:0 0 0 0.0625rem var(--s-background-default),
|
|
6
|
+
0 0 0 0.1875rem var(--s-focus-default)}.switch--size-m.sc-flip-switch .switch__control.sc-flip-switch{width:2.75rem;height:1.5rem;border-radius:calc(1.5rem / 2)}.switch--size-m.sc-flip-switch .switch__thumb.sc-flip-switch{width:1.25rem;height:1.25rem}.switch--on.switch--size-m.sc-flip-switch .switch__thumb.sc-flip-switch{left:calc(100% - 1.25rem - var(--s-space-2))}.switch--on.sc-flip-switch .switch__control.sc-flip-switch{background-color:var(--s-interactive-primary-default)}.switch--on.sc-flip-switch .switch__thumb.sc-flip-switch{left:calc(100% - 0.875rem - var(--s-space-2))}.switch--disabled.sc-flip-switch .switch__control.sc-flip-switch{background-color:var(--s-interactive-primary-disabled);cursor:default}.switch--disabled.sc-flip-switch .switch__thumb.sc-flip-switch{background-color:var(--s-interactive-neutral-default)}.switch--disabled.sc-flip-switch .switch__label.sc-flip-switch{color:var(--s-text-disabled)}.switch__control.sc-flip-switch{position:relative;width:1.875rem;height:1.125rem;flex-shrink:0;border-radius:calc(1.125rem / 2);background-color:var(--s-interactive-primary-disabled);cursor:pointer;transition:background-color 0.2s}@media (prefers-reduced-motion){.switch__control.sc-flip-switch{transition:none}}.switch__thumb.sc-flip-switch{position:absolute;top:var(--s-space-2);left:var(--s-space-2);width:0.875rem;height:0.875rem;border-radius:50%;background-color:var(--s-surface-default);transition:left 0.2s;pointer-events:none}@media (prefers-reduced-motion){.switch__thumb.sc-flip-switch{transition:none}}.switch__label.sc-flip-switch{position:relative;z-index:1;margin-left:var(--s-space-12);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base)}`, f = class {
|
|
7
|
+
constructor(h) {
|
|
8
|
+
n(this, h), this.valueChange = r(this, "valueChange", 7), this.checked = !1, this.disabled = !1, this.size = "m", this.dragging = !1, this.recentlyDragged = !1, this.onChange = () => {
|
|
9
|
+
if (!this.dragging) {
|
|
10
|
+
if (this.recentlyDragged) {
|
|
11
|
+
this.recentlyDragged = !1;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
this.checked = !this.checked, this.valueChange.emit(this.checked);
|
|
15
|
+
}
|
|
16
|
+
}, this.onStartDrag = () => {
|
|
17
|
+
this.disabled || (this.dragging = !0, this.thumb.style.transition = "none");
|
|
18
|
+
}, this.onEndDrag = () => {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
if (this.recentlyDragged) {
|
|
21
|
+
const s = this.control.getBoundingClientRect(), c = this.thumb.getBoundingClientRect(), t = this.thumb.offsetLeft + c.width / 2 > s.width / 2;
|
|
22
|
+
this.checked !== t && (this.checked = t, this.valueChange.emit(t));
|
|
23
|
+
}
|
|
24
|
+
this.thumb.style.left = "", this.thumb.style.transition = "", this.dragging = !1, setTimeout(() => {
|
|
25
|
+
this.recentlyDragged = !1;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}, this.onDrag = (s) => {
|
|
29
|
+
if (!this.dragging)
|
|
30
|
+
return;
|
|
31
|
+
this.recentlyDragged = !0;
|
|
32
|
+
const c = this.control.getBoundingClientRect(), t = this.thumb.getBoundingClientRect();
|
|
33
|
+
let i = Math.round(s.offsetX - t.width / 2);
|
|
34
|
+
i < 0 && (i = 0), i > Math.round(c.width - t.width) && (i = Math.round(c.width - t.width)), this.thumb.style.left = `${i}px`;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
onWindowPointerUp() {
|
|
38
|
+
this.onEndDrag();
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
const h = !this.checked, s = this.checked, c = s ? "true" : "false", t = l("switch", `switch--size-${this.size}`, {
|
|
42
|
+
"switch--off": h,
|
|
43
|
+
"switch--on": s,
|
|
44
|
+
"switch--disabled": this.disabled
|
|
45
|
+
});
|
|
46
|
+
return e(a, null, e("label", { class: t, htmlFor: this.inputId }, e("span", { class: "switch__control", onPointerDown: this.onStartDrag, onPointerMove: this.onDrag, onPointerUp: this.onEndDrag, ref: (i) => this.control = i }, e("flip-visually-hidden", null, e("input", { "aria-checked": c, checked: s, class: "switch__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, role: "switch", type: "checkbox", value: this.value })), e("span", { "aria-hidden": "true", class: "switch__thumb", ref: (i) => this.thumb = i })), this.label && e("span", { class: "switch__label" }, this.label)));
|
|
47
|
+
}
|
|
48
|
+
get el() {
|
|
49
|
+
return o(this);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
f.style = d;
|
|
53
|
+
export {
|
|
54
|
+
f as flip_switch
|
|
55
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { r as e, c as s, h as t, H as n } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as i } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const c = ":host{display:inline-flex}:host *{box-sizing:border-box}.tag{display:inline-flex;padding:var(--s-space-2) var(--s-space-8);align-items:center;border-radius:var(--s-border-radius-s);color:var(--s-text-default);background-color:var(--s-surface-neutral-subdued);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);gap:var(--s-space-4)}.tag--intent-info{color:var(--s-text-info);background-color:var(--s-surface-info-subdued)}.tag--intent-info .tag__removal-button{color:var(--icon-info)}.tag--intent-critical{color:var(--s-text-critical);background-color:var(--s-surface-critical-subdued)}.tag--intent-critical .tag__removal-button{color:var(--icon-critical)}.tag--intent-warning{color:var(--s-text-warning);background-color:var(--s-surface-warning-subdued)}.tag--intent-warning .tag__removal-button{color:var(--icon-warning)}.tag--intent-success{color:var(--s-text-success);background-color:var(--s-surface-success-subdued)}.tag--intent-success .tag__removal-button{color:var(--icon-success)}.tag__removal-button{display:inline-flex;margin-right:calc(-1 * var(--s-space-4));padding:0;border:none;color:var(--s-icon-strong);background-color:transparent;cursor:pointer}.tag__removal-button:focus{outline-color:var(--s-focus-default)}", l = class {
|
|
6
|
+
constructor(a) {
|
|
7
|
+
e(this, a), this.remove = s(this, "remove", 7), this.intent = "default", this.removalButtonLabel = "Remove", this.onRemove = (r) => {
|
|
8
|
+
var o;
|
|
9
|
+
(o = this.remove) === null || o === void 0 || o.emit(r);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
const a = i("tag", `tag--intent-${this.intent}`);
|
|
14
|
+
return t(n, null, t("span", { class: a }, this.label, this.removable && t("button", { "aria-label": this.removalButtonLabel, class: "tag__removal-button", onClick: this.onRemove, type: "button" }, t("flip-icon-close", { size: 16 }))));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
l.style = c;
|
|
18
|
+
export {
|
|
19
|
+
l as flip_tag
|
|
20
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { r as C, h as b, H } from "./main.7e7363a7.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
function h(e, t, n) {
|
|
5
|
+
return Math.min(Math.max(e, n), t);
|
|
6
|
+
}
|
|
7
|
+
class P extends Error {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
super(`Failed to parse color: "${t}"`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
var g = P;
|
|
13
|
+
function j(e) {
|
|
14
|
+
if (typeof e != "string")
|
|
15
|
+
throw new g(e);
|
|
16
|
+
if (e.trim().toLowerCase() === "transparent")
|
|
17
|
+
return [0, 0, 0, 0];
|
|
18
|
+
let t = e.trim();
|
|
19
|
+
t = I.test(e) ? q(e) : e;
|
|
20
|
+
const n = M.exec(t);
|
|
21
|
+
if (n) {
|
|
22
|
+
const a = Array.from(n).slice(1);
|
|
23
|
+
return [...a.slice(0, 3).map((i) => parseInt(u(i, 2), 16)), parseInt(u(a[3] || "f", 2), 16) / 255];
|
|
24
|
+
}
|
|
25
|
+
const o = A.exec(t);
|
|
26
|
+
if (o) {
|
|
27
|
+
const a = Array.from(o).slice(1);
|
|
28
|
+
return [...a.slice(0, 3).map((i) => parseInt(i, 16)), parseInt(a[3] || "ff", 16) / 255];
|
|
29
|
+
}
|
|
30
|
+
const r = F.exec(t);
|
|
31
|
+
if (r) {
|
|
32
|
+
const a = Array.from(r).slice(1);
|
|
33
|
+
return [...a.slice(0, 3).map((i) => parseInt(i, 10)), parseFloat(a[3] || "1")];
|
|
34
|
+
}
|
|
35
|
+
const s = R.exec(t);
|
|
36
|
+
if (s) {
|
|
37
|
+
const [a, i, c, d] = Array.from(s).slice(1).map(parseFloat);
|
|
38
|
+
if (h(0, 100, i) !== i)
|
|
39
|
+
throw new g(e);
|
|
40
|
+
if (h(0, 100, c) !== c)
|
|
41
|
+
throw new g(e);
|
|
42
|
+
return [...O(a, i, c), d || 1];
|
|
43
|
+
}
|
|
44
|
+
throw new g(e);
|
|
45
|
+
}
|
|
46
|
+
function $(e) {
|
|
47
|
+
let t = 5381, n = e.length;
|
|
48
|
+
for (; n; )
|
|
49
|
+
t = t * 33 ^ e.charCodeAt(--n);
|
|
50
|
+
return (t >>> 0) % 2341;
|
|
51
|
+
}
|
|
52
|
+
const w = (e) => parseInt(e.replace(/_/g, ""), 36), E = "1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e, t) => {
|
|
53
|
+
const n = w(t.substring(0, 3)), o = w(t.substring(3)).toString(16);
|
|
54
|
+
let r = "";
|
|
55
|
+
for (let s = 0; s < 6 - o.length; s++)
|
|
56
|
+
r += "0";
|
|
57
|
+
return e[n] = `${r}${o}`, e;
|
|
58
|
+
}, {});
|
|
59
|
+
function q(e) {
|
|
60
|
+
const t = e.toLowerCase().trim(), n = E[$(t)];
|
|
61
|
+
if (!n)
|
|
62
|
+
throw new g(e);
|
|
63
|
+
return `#${n}`;
|
|
64
|
+
}
|
|
65
|
+
const u = (e, t) => Array.from(Array(t)).map(() => e).join(""), M = new RegExp(`^#${u("([a-f0-9])", 3)}([a-f0-9])?$`, "i"), A = new RegExp(`^#${u("([a-f0-9]{2})", 3)}([a-f0-9]{2})?$`, "i"), F = new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${u(",\\s*(\\d+)\\s*", 2)}(?:,\\s*([\\d.]+))?\\s*\\)$`, "i"), R = /^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i, I = /^[a-z]+$/i, z = (e) => Math.round(e * 255), O = (e, t, n) => {
|
|
66
|
+
let o = n / 100;
|
|
67
|
+
if (t === 0)
|
|
68
|
+
return [o, o, o].map(z);
|
|
69
|
+
const r = (e % 360 + 360) % 360 / 60, s = (1 - Math.abs(2 * o - 1)) * (t / 100), a = s * (1 - Math.abs(r % 2 - 1));
|
|
70
|
+
let i = 0, c = 0, d = 0;
|
|
71
|
+
r >= 0 && r < 1 ? (i = s, c = a) : r >= 1 && r < 2 ? (i = a, c = s) : r >= 2 && r < 3 ? (c = s, d = a) : r >= 3 && r < 4 ? (c = a, d = s) : r >= 4 && r < 5 ? (i = a, d = s) : r >= 5 && r < 6 && (i = s, d = a);
|
|
72
|
+
const l = o - s / 2, m = i + l, f = c + l, y = d + l;
|
|
73
|
+
return [m, f, y].map(z);
|
|
74
|
+
};
|
|
75
|
+
function v(e) {
|
|
76
|
+
const [t, n, o, r] = j(e).map((m, f) => f === 3 ? m : m / 255), s = Math.max(t, n, o), a = Math.min(t, n, o), i = (s + a) / 2;
|
|
77
|
+
if (s === a)
|
|
78
|
+
return [0, 0, i, r];
|
|
79
|
+
const c = s - a, d = i > 0.5 ? c / (2 - s - a) : c / (s + a);
|
|
80
|
+
return [60 * (t === s ? (n - o) / c + (n < o ? 6 : 0) : n === s ? (o - t) / c + 2 : (t - n) / c + 4), d, i, r];
|
|
81
|
+
}
|
|
82
|
+
function p(e, t, n, o) {
|
|
83
|
+
return `hsla(${(e % 360).toFixed()}, ${h(0, 100, t * 100).toFixed()}%, ${h(0, 100, n * 100).toFixed()}%, ${parseFloat(h(0, 1, o).toFixed(3))})`;
|
|
84
|
+
}
|
|
85
|
+
function L(e, t, n, o) {
|
|
86
|
+
return `rgba(${h(0, 255, e).toFixed()}, ${h(0, 255, t).toFixed()}, ${h(0, 255, n).toFixed()}, ${parseFloat(h(0, 1, o).toFixed(3))})`;
|
|
87
|
+
}
|
|
88
|
+
function _(e) {
|
|
89
|
+
return L(...j(e));
|
|
90
|
+
}
|
|
91
|
+
const S = ".sc-flip-theme-provider-h{display:block}", x = "flip-preferred-theme", k = {
|
|
92
|
+
"--s-action-primary-default": "primary",
|
|
93
|
+
"--s-action-primary-hovered": "primaryHovered",
|
|
94
|
+
"--s-action-primary-pressed": "primaryPressed",
|
|
95
|
+
"--s-text-on-action-primary": "primaryContrast",
|
|
96
|
+
"--s-icon-on-action-primary": "primaryContrast",
|
|
97
|
+
"--s-surface-highlight-default": "secondary",
|
|
98
|
+
"--s-surface-highlight-hovered": "secondaryHovered",
|
|
99
|
+
"--s-surface-highlight-pressed": "secondaryPressed",
|
|
100
|
+
"--s-on-surface-highlight-default": "secondaryHovered",
|
|
101
|
+
"--s-text-on-surface-highlight": "secondaryContrast",
|
|
102
|
+
"--s-icon-on-surface-highlight": "secondaryContrast",
|
|
103
|
+
"--s-text-highlight": "text",
|
|
104
|
+
"--s-interactive-primary-default": "text",
|
|
105
|
+
"--s-interactive-primary-hovered": "textHovered",
|
|
106
|
+
"--s-interactive-primary-pressed": "textPressed"
|
|
107
|
+
}, B = class {
|
|
108
|
+
constructor(e) {
|
|
109
|
+
C(this, e);
|
|
110
|
+
}
|
|
111
|
+
componentWillLoad() {
|
|
112
|
+
this.resolveConfig(), this.determineOSTheme(), this.updateAppTheme();
|
|
113
|
+
}
|
|
114
|
+
watchConfig() {
|
|
115
|
+
this.resolveConfig(), this.determineOSTheme(), this.updateAppTheme();
|
|
116
|
+
}
|
|
117
|
+
async getActiveTheme() {
|
|
118
|
+
return this.appTheme;
|
|
119
|
+
}
|
|
120
|
+
async getPreferredTheme() {
|
|
121
|
+
if (!!Boolean(this.resolvedConfig.storage))
|
|
122
|
+
return this.resolvedConfig.storage.getItem(x);
|
|
123
|
+
}
|
|
124
|
+
async setPreferredTheme(e) {
|
|
125
|
+
!Boolean(this.resolvedConfig.storage) || (this.resolvedConfig.storage.setItem(x, e), this.updateAppTheme());
|
|
126
|
+
}
|
|
127
|
+
async resetPreferredTheme() {
|
|
128
|
+
!Boolean(this.resolvedConfig.storage) || (this.resolvedConfig.storage.removeItem(x), this.updateAppTheme());
|
|
129
|
+
}
|
|
130
|
+
resolveConfig() {
|
|
131
|
+
var e, t;
|
|
132
|
+
this.resolvedConfig = Object.assign(Object.assign({}, this.config || {}), { rootElement: ((e = this.config) === null || e === void 0 ? void 0 : e.rootElement) || document.documentElement, storage: ((t = this.config) === null || t === void 0 ? void 0 : t.storage) || (window == null ? void 0 : window.localStorage) });
|
|
133
|
+
}
|
|
134
|
+
determineOSTheme() {
|
|
135
|
+
if (!Boolean(window.matchMedia)) {
|
|
136
|
+
this.osTheme = "light";
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
140
|
+
this.osTheme = e.matches ? "dark" : "light", e.addEventListener("change", (t) => {
|
|
141
|
+
this.osTheme = t.matches ? "dark" : "light", this.updateAppTheme();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async updateAppTheme() {
|
|
145
|
+
this.appTheme = await this.getPreferredTheme() || this.osTheme, this.appTheme === "dark" ? (document.documentElement.classList.remove("theme-light"), document.documentElement.classList.add("theme-dark")) : (document.documentElement.classList.remove("theme-dark"), document.documentElement.classList.add("theme-light")), this.updateTenantVariables();
|
|
146
|
+
}
|
|
147
|
+
updateTenantVariables() {
|
|
148
|
+
var e;
|
|
149
|
+
const t = (e = this.resolvedConfig) === null || e === void 0 ? void 0 : e.tenantColors;
|
|
150
|
+
if (!Boolean(t)) {
|
|
151
|
+
this.resetTenantVariables();
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const n = this.resolvedConfig.rootElement, o = v(t.primary), r = v(t.secondary), s = v(t.text), a = _(p(o[0], o[1] - 0.21, o[2] + 0.09, 1)), i = _(p(o[0], o[1] - 0.2, o[2] + 0.17, 1)), c = _(p(r[0], r[1], r[2] + 0.07, 1)), d = _(p(r[0], r[1], r[2] + 0.15, 1)), l = _(p(s[0], s[1] - 0.34, s[2] + 0.1, 1)), m = _(p(s[0], s[1] - 0.48, s[2] + 0.2, 1)), f = Object.assign(Object.assign({}, t), { primaryHovered: a, primaryPressed: i, secondaryHovered: c, secondaryPressed: d, textHovered: l, textPressed: m });
|
|
155
|
+
Object.entries(k).forEach(([y, T]) => n.style.setProperty(y, f[T]));
|
|
156
|
+
}
|
|
157
|
+
resetTenantVariables() {
|
|
158
|
+
const e = this.resolvedConfig.rootElement;
|
|
159
|
+
[
|
|
160
|
+
...Object.keys(k),
|
|
161
|
+
"primaryHovered",
|
|
162
|
+
"primaryPressed",
|
|
163
|
+
"secondaryHovered",
|
|
164
|
+
"secondaryPressed",
|
|
165
|
+
"textHovered",
|
|
166
|
+
"textPressed"
|
|
167
|
+
].forEach((t) => e.style.removeProperty(t));
|
|
168
|
+
}
|
|
169
|
+
render() {
|
|
170
|
+
return b(H, null, b("slot", null));
|
|
171
|
+
}
|
|
172
|
+
static get watchers() {
|
|
173
|
+
return {
|
|
174
|
+
config: ["watchConfig"]
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
B.style = S;
|
|
179
|
+
export {
|
|
180
|
+
B as flip_theme_provider
|
|
181
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as t, h as a, H as s } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as l } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const m = ":host{display:inline-flex}:host *{box-sizing:border-box}.thumbnail{position:relative;display:inline-flex;overflow:hidden;border-radius:var(--s-border-radius-s);box-shadow:inset 0 0 0 0.03125rem rgba(0, 0, 0, 0.1)}.thumbnail--size-s{--flip-thumbnail-size:2.5rem}.thumbnail--size-m{--flip-thumbnail-size:3rem}.thumbnail--size-l{--flip-thumbnail-size:4rem}.thumbnail--format-landscape{width:var(--flip-thumbnail-size);aspect-ratio:4 / 3}.thumbnail--format-landscape .thumbnail__image{width:100%}.thumbnail--format-portrait{height:var(--flip-thumbnail-size);aspect-ratio:3 / 4}.thumbnail--format-portrait .thumbnail__image{height:100%}.thumbnail--format-square{width:var(--flip-thumbnail-size);height:var(--flip-thumbnail-size)}.thumbnail--format-square .thumbnail__image{width:100%}.thumbnail__image{position:absolute;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}", r = class {
|
|
6
|
+
constructor(i) {
|
|
7
|
+
t(this, i), this.format = "landscape", this.size = "m";
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const i = l("thumbnail", `thumbnail--format-${this.format}`, `thumbnail--size-${this.size}`);
|
|
11
|
+
return a(s, null, a("span", { class: i }, a("img", { alt: this.alt, class: "thumbnail__image", loading: "lazy", src: this.src })));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
r.style = m;
|
|
15
|
+
export {
|
|
16
|
+
r as flip_thumbnail
|
|
17
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { r, h as a, H as n } from "./main.7e7363a7.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const l = class {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
r(this, t), this.toasts = [], this.onDismiss = (s) => {
|
|
7
|
+
this.toasts = [...this.toasts].filter((i) => i.toastId !== s.detail);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
async clearAll() {
|
|
11
|
+
this.toasts = [];
|
|
12
|
+
}
|
|
13
|
+
async dismiss(t) {
|
|
14
|
+
this.toasts = [...this.toasts].filter((s) => s.toastId !== t);
|
|
15
|
+
}
|
|
16
|
+
async toast(t) {
|
|
17
|
+
if (this.toasts.some((o) => o.toastId === t.toastId))
|
|
18
|
+
return;
|
|
19
|
+
const s = this.globalDuration === void 0 ? t.duration : this.globalDuration === 0 ? void 0 : this.globalDuration, i = Object.assign(Object.assign({}, t), { createdAt: new Date(), duration: s, toastId: t.toastId || String(Math.round(Math.random() * 1e4)) });
|
|
20
|
+
return this.toasts = [...this.toasts, i], i;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return a(n, { role: "status" }, a("flip-stack", { spacing: "12" }, this.toasts.map((t) => a("flip-toast", Object.assign({ key: t.toastId, onDismiss: this.onDismiss }, t)))));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
l as flip_toast_provider
|
|
28
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { r as i, c as a, h as t, H as e } from "./main.7e7363a7.js";
|
|
2
|
+
import { c as o } from "./index-3c78bcaf.2675909b.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
const n = ":host{display:flex}:host *{box-sizing:border-box}.toast{display:flex;width:100%;max-width:28rem;padding:var(--s-space-16);border-radius:0.75rem;color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default)}.toast--intent-critical{background-color:var(--s-surface-critical-default)}.toast--intent-success{background-color:var(--s-surface-success-default)}.toast__icon{display:inline-flex;margin-top:calc(-1 * var(--s-space-2));margin-right:0.625rem;flex-shrink:0}.toast__icon ::part(icon){color:var(--s-icon-on-status)}.toast__content{flex-grow:1;line-height:var(--s-line-height-base);text-align:left}.toast__dismiss-button{display:inline-flex;min-width:1.5rem;height:1.5rem;margin-top:calc(-1 * var(--s-space-2));margin-left:var(--s-space-16);padding:0;flex-shrink:0;justify-content:center;align-items:center;border:none;color:var(--s-text-on-status);background-color:transparent;font:inherit;font-weight:var(--s-font-weight-semibold);cursor:pointer}.toast__dismiss-button ::part(icon){color:var(--s-icon-on-status)}", r = class {
|
|
6
|
+
constructor(s) {
|
|
7
|
+
i(this, s), this.dismiss = a(this, "dismiss", 7), this.accessibleDismissLabel = "Dismiss", this.intent = "default", this.onDismiss = () => {
|
|
8
|
+
this.dismiss.emit(this.toastId);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
watchDuration() {
|
|
12
|
+
this.startTimer();
|
|
13
|
+
}
|
|
14
|
+
componentDidLoad() {
|
|
15
|
+
this.startTimer();
|
|
16
|
+
}
|
|
17
|
+
startTimer() {
|
|
18
|
+
this.clearTimer(), this.duration !== void 0 && (this.timeout = setTimeout(() => {
|
|
19
|
+
this.dismiss.emit(this.toastId);
|
|
20
|
+
}, this.duration));
|
|
21
|
+
}
|
|
22
|
+
clearTimer() {
|
|
23
|
+
!Boolean(this.timeout) || (clearTimeout(this.timeout), this.timeout = void 0);
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
const s = o("toast", `toast--intent-${this.intent}`);
|
|
27
|
+
return t(e, null, t("div", { class: s }, this.icon && t("span", { class: "toast__icon", innerHTML: this.icon }), t("span", { class: "toast__content" }, this.content), t("button", { "aria-label": this.dismissLabel || this.accessibleDismissLabel, class: "toast__dismiss-button", onClick: this.onDismiss, type: "button" }, this.dismissLabel, !Boolean(this.dismissLabel) && t("flip-icon-close", null))));
|
|
28
|
+
}
|
|
29
|
+
static get watchers() {
|
|
30
|
+
return {
|
|
31
|
+
duration: ["watchDuration"]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
r.style = n;
|
|
36
|
+
export {
|
|
37
|
+
r as flip_toast
|
|
38
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { r as A, h as e, H as D } from "./main.7e7363a7.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
/*! NanoPop 2.1.0 MIT | https://github.com/Simonwep/nanopop */
|
|
5
|
+
const H = { variantFlipOrder: { start: "sme", middle: "mse", end: "ems" }, positionFlipOrder: { top: "tbrl", right: "rltb", bottom: "btrl", left: "lrbt" }, position: "bottom", margin: 8 }, K = (s, t, b) => {
|
|
6
|
+
const { container: w, margin: r, position: y, variantFlipOrder: v, positionFlipOrder: _ } = { container: document.documentElement.getBoundingClientRect(), ...H, ...b }, { left: x, top: T } = t.style;
|
|
7
|
+
t.style.left = "0", t.style.top = "0";
|
|
8
|
+
const o = s.getBoundingClientRect(), i = t.getBoundingClientRect(), E = { t: o.top - i.height - r, b: o.bottom + r, r: o.right + r, l: o.left - i.width - r }, B = { vs: o.left, vm: o.left + o.width / 2 + -i.width / 2, ve: o.left + o.width - i.width, hs: o.top, hm: o.bottom - o.height / 2 - i.height / 2, he: o.bottom - i.height }, [F, O = "middle"] = y.split("-"), P = _[F], C = v[O], { top: p, left: d, bottom: c, right: u } = w;
|
|
9
|
+
for (const l of P) {
|
|
10
|
+
const n = l === "t" || l === "b", a = E[l], [m, f] = n ? ["top", "left"] : ["left", "top"], [k, S] = n ? [i.height, i.width] : [i.width, i.height], [W, z] = n ? [c, u] : [u, c], [L, R] = n ? [p, d] : [d, p];
|
|
11
|
+
if (!(a < L || a + k > W))
|
|
12
|
+
for (const g of C) {
|
|
13
|
+
const h = B[(n ? "v" : "h") + g];
|
|
14
|
+
if (!(h < R || h + S > z))
|
|
15
|
+
return t.style[f] = h - i[f] + "px", t.style[m] = a - i[m] + "px", l + g;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return t.style.left = x, t.style.top = T, null;
|
|
19
|
+
}, M = ":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{display:inline-flex}.tooltip .tooltip__reference{display:inline-flex}.tooltip__popper{position:fixed;z-index:var(--s-z-40);max-width:17.5rem}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);backgrund-color:red}.tooltip__arrow{position:absolute;width:0.5rem;height:0.5rem;background-color:var(--s-surface-neutral-default)}", I = class {
|
|
20
|
+
constructor(s) {
|
|
21
|
+
A(this, s), this.delay = 300, this.position = "top", this.visible = !1, this.onKeydown = (t) => {
|
|
22
|
+
t.code === "Escape" && this.hide();
|
|
23
|
+
}, this.reposition = () => {
|
|
24
|
+
!Boolean(this.referenceEl) || !Boolean(this.popperEl) || (this.actualPosition = K(this.referenceEl, this.popperEl, this.options));
|
|
25
|
+
}, this.show = () => {
|
|
26
|
+
this.visible = !0, requestAnimationFrame(() => {
|
|
27
|
+
this.reposition();
|
|
28
|
+
});
|
|
29
|
+
}, this.showWithDelay = () => {
|
|
30
|
+
Boolean(this.showTimeout) && (clearTimeout(this.showTimeout), this.showTimeout = void 0), this.showTimeout = setTimeout(() => {
|
|
31
|
+
this.show();
|
|
32
|
+
}, this.delay);
|
|
33
|
+
}, this.hide = () => {
|
|
34
|
+
Boolean(this.showTimeout) && (clearTimeout(this.showTimeout), this.showTimeout = void 0), this.visible = !1;
|
|
35
|
+
}, this.updateOptions = () => {
|
|
36
|
+
const t = +getComputedStyle(document.documentElement).getPropertyValue("--s-space-12").replace("rem", "") * 16;
|
|
37
|
+
this.options = {
|
|
38
|
+
margin: t,
|
|
39
|
+
position: this.position
|
|
40
|
+
};
|
|
41
|
+
}, this.getArrowStyles = () => {
|
|
42
|
+
if (this.actualPosition === "tm")
|
|
43
|
+
return {
|
|
44
|
+
top: "100%",
|
|
45
|
+
left: "50%",
|
|
46
|
+
transform: "translate3d(-50%, -50%, 0) rotate(45deg)"
|
|
47
|
+
};
|
|
48
|
+
if (this.actualPosition === "bm")
|
|
49
|
+
return {
|
|
50
|
+
bottom: "100%",
|
|
51
|
+
left: "50%",
|
|
52
|
+
transform: "translate3d(-50%, 50%, 0) rotate(45deg)"
|
|
53
|
+
};
|
|
54
|
+
if (this.actualPosition === "rm")
|
|
55
|
+
return {
|
|
56
|
+
top: "50%",
|
|
57
|
+
right: "100%",
|
|
58
|
+
transform: "translate3d(50%, -50%, 0) rotate(45deg)"
|
|
59
|
+
};
|
|
60
|
+
if (this.actualPosition === "lm")
|
|
61
|
+
return {
|
|
62
|
+
top: "50%",
|
|
63
|
+
left: "100%",
|
|
64
|
+
transform: "translate3d(-50%, -50%, 0) rotate(45deg)"
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
watchPosition() {
|
|
69
|
+
this.updateOptions();
|
|
70
|
+
}
|
|
71
|
+
onMouseEnter() {
|
|
72
|
+
this.showWithDelay();
|
|
73
|
+
}
|
|
74
|
+
onMouseLeave() {
|
|
75
|
+
this.hide();
|
|
76
|
+
}
|
|
77
|
+
onWindowResize() {
|
|
78
|
+
this.reposition();
|
|
79
|
+
}
|
|
80
|
+
onWindowScroll() {
|
|
81
|
+
this.reposition();
|
|
82
|
+
}
|
|
83
|
+
componentWillLoad() {
|
|
84
|
+
this.reposition();
|
|
85
|
+
}
|
|
86
|
+
componentDidLoad() {
|
|
87
|
+
this.updateOptions();
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
const s = this.getArrowStyles();
|
|
91
|
+
return e(D, { onKeydown: this.onKeydown }, e("span", { class: "tooltip" }, e("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onBlur: this.hide, onClick: this.hide, onFocus: this.show, ref: (t) => this.referenceEl = t, tabIndex: 0 }, e("slot", null)), e("span", { class: "tooltip__popper", ref: (t) => this.popperEl = t }, this.visible && e("span", { class: "tooltip__bubble", id: "tooltip", role: "tooltip" }, e("span", { class: "tooltip__content", innerHTML: this.content }), e("span", { class: "tooltip__arrow", style: s })))));
|
|
92
|
+
}
|
|
93
|
+
static get watchers() {
|
|
94
|
+
return {
|
|
95
|
+
position: ["watchPosition"]
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
I.style = M;
|
|
100
|
+
export {
|
|
101
|
+
I as flip_tooltip
|
|
102
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r, h as i, H as l } from "./main.7e7363a7.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const t = ":host{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;word-wrap:normal;clip:rect(0, 0, 0, 0)}", o = class {
|
|
5
|
+
constructor(s) {
|
|
6
|
+
r(this, s);
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return i(l, null, i("slot", null));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
o.style = t;
|
|
13
|
+
export {
|
|
14
|
+
o as flip_visually_hidden
|
|
15
|
+
};
|