@sbb-esta/lyne-elements 4.5.1 → 4.7.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/autocomplete/autocomplete-base-element.js +34 -34
- package/calendar/{calendar.component.js → calendar/calendar.component.js} +413 -401
- package/calendar/calendar-day/calendar-day.component.js +98 -0
- package/calendar/calendar-day.js +4 -0
- package/calendar/calendar.js +5 -0
- package/calendar.js +5 -2
- package/chip/chip-group/chip-group.component.js +69 -49
- package/core/styles/core.scss +46 -73
- package/core/styles/mixins/overlay.scss +25 -15
- package/core/styles/mixins/pearl-chain-bullet.scss +12 -6
- package/core.css +114 -49
- package/custom-elements.json +18902 -17898
- package/datepicker/common/datepicker-button.js +18 -14
- package/datepicker/datepicker/datepicker.component.js +1 -1
- package/datepicker/datepicker-next-day/datepicker-next-day.component.js +18 -26
- package/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +20 -28
- package/development/autocomplete/autocomplete-base-element.d.ts +2 -0
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete/autocomplete-base-element.js +37 -34
- package/development/calendar/{calendar.component.d.ts → calendar/calendar.component.d.ts} +22 -2
- package/development/calendar/calendar/calendar.component.d.ts.map +1 -0
- package/development/calendar/calendar/calendar.component.js +1990 -0
- package/development/calendar/calendar-day/calendar-day.component.d.ts +49 -0
- package/development/calendar/calendar-day/calendar-day.component.d.ts.map +1 -0
- package/development/calendar/calendar-day/calendar-day.component.js +255 -0
- package/development/calendar/calendar-day.d.ts +5 -0
- package/development/calendar/calendar-day.d.ts.map +1 -0
- package/development/calendar/calendar-day.js +5 -0
- package/development/calendar/calendar.d.ts +5 -0
- package/development/calendar/calendar.d.ts.map +1 -0
- package/development/calendar/calendar.js +6 -0
- package/development/calendar.d.ts +2 -1
- package/development/calendar.d.ts.map +1 -1
- package/development/calendar.js +6 -3
- package/development/chip/chip-group/chip-group.component.d.ts +6 -0
- package/development/chip/chip-group/chip-group.component.d.ts.map +1 -1
- package/development/chip/chip-group/chip-group.component.js +33 -4
- package/development/container/container/container.component.d.ts +2 -0
- package/development/container/container/container.component.d.ts.map +1 -1
- package/development/container/container/container.component.js +1 -1
- package/development/datepicker/common/datepicker-button.d.ts +3 -1
- package/development/datepicker/common/datepicker-button.d.ts.map +1 -1
- package/development/datepicker/common/datepicker-button.js +8 -4
- package/development/datepicker/datepicker/datepicker.component.d.ts.map +1 -1
- package/development/datepicker/datepicker/datepicker.component.js +2 -1
- package/development/datepicker/datepicker-next-day/datepicker-next-day.component.d.ts +1 -1
- package/development/datepicker/datepicker-next-day/datepicker-next-day.component.d.ts.map +1 -1
- package/development/datepicker/datepicker-next-day/datepicker-next-day.component.js +3 -12
- package/development/datepicker/datepicker-previous-day/datepicker-previous-day.component.d.ts +1 -1
- package/development/datepicker/datepicker-previous-day/datepicker-previous-day.component.d.ts.map +1 -1
- package/development/datepicker/datepicker-previous-day/datepicker-previous-day.component.js +3 -12
- package/development/dialog/dialog/dialog.component.js +24 -37
- package/development/dialog/dialog-actions/dialog-actions.component.js +2 -2
- package/development/dialog/dialog-close-button/dialog-close-button.component.js +2 -2
- package/development/footer/footer.component.js +4 -19
- package/development/form-field/form-field/form-field.component.js +8 -5
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts +1 -1
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.d.ts.map +1 -1
- package/development/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +2 -2
- package/development/option/optgroup/optgroup-base-element.js +4 -13
- package/development/option/option/option-base-element.d.ts.map +1 -1
- package/development/option/option/option-base-element.js +12 -14
- package/development/option/option/option.component.js +4 -28
- package/development/option/option-hint/option-hint.component.d.ts.map +1 -1
- package/development/option/option-hint/option-hint.component.js +11 -26
- package/development/select/select.component.js +11 -16
- package/development/status/status.component.d.ts.map +1 -1
- package/development/status/status.component.js +20 -26
- package/dialog/dialog/dialog.component.js +19 -19
- package/dialog/dialog-actions/dialog-actions.component.js +6 -6
- package/dialog/dialog-close-button/dialog-close-button.component.js +9 -9
- package/footer/footer.component.js +22 -22
- package/form-field/form-field/form-field.component.js +11 -11
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/mini-calendar/mini-calendar-month/mini-calendar-month.component.js +1 -1
- package/off-brand-theme.css +114 -49
- package/option/optgroup/optgroup-base-element.js +22 -22
- package/option/option/option-base-element.js +11 -13
- package/option/option/option.component.js +15 -15
- package/option/option-hint/option-hint.component.js +16 -18
- package/package.json +11 -1
- package/safety-theme.css +114 -49
- package/select/select.component.js +18 -18
- package/standard-theme.css +114 -49
- package/status/status.component.js +27 -29
- package/development/calendar/calendar.component.d.ts.map +0 -1
- package/development/calendar/calendar.component.js +0 -1957
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __esDecorate as d, __runInitializers as h } from "tslib";
|
|
2
|
+
import { css as y, html as f } from "lit";
|
|
3
|
+
import { customElement as g, property as p, state as m } from "lit/decorators.js";
|
|
4
|
+
import { SbbButtonLikeBaseElement as _ } from "../../core/base-elements.js";
|
|
5
|
+
import { readConfig as x } from "../../core/config/config.js";
|
|
6
|
+
import { SbbPropertyWatcherController as S } from "../../core/controllers.js";
|
|
7
|
+
import { defaultDateAdapter as D } from "../../core/datetime/native-date-adapter.js";
|
|
8
|
+
import { SbbDisabledMixin as k } from "../../core/mixins.js";
|
|
9
|
+
import { boxSizingStyles as A } from "../../core/styles.js";
|
|
10
|
+
const w = y`:host{display:block;--sbb-calendar-day-width: 2.75rem;--sbb-calendar-day-height: 3rem;--sbb-calendar-day-cell-background-color: var(--sbb-calendar-cell-background-color);--sbb-calendar-day-selected-border: none;--sbb-calendar-day-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-calendar-day-transition-easing-function: var(--sbb-animation-easing);--sbb-calendar-day-cursor: var(--sbb-cursor-pointer);--sbb-calendar-day-border-radius: var(--sbb-border-radius-4x);--sbb-calendar-day-flex-direction: column;--sbb-calendar-day-justify-content: initial;--sbb-calendar-day-align-items: initial;--sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x);--sbb-calendar-day-extra-display: block;--sbb-calendar-day-extra-height: var(--sbb-spacing-fixed-4x);--sbb-calendar-day-crossed-out-top: 33%;--sbb-calendar-day-crossed-out-translate: translate(-50%, -33%) rotate(-45deg)}:host(:is(:state(selected),[state--selected])){--sbb-calendar-day-selected-border: var(--sbb-border-width-2x) solid var(--sbb-border-color-2)}:host(:disabled){--sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);--sbb-calendar-day-cursor: unset}:host(:focus-visible){outline:0}:host(:not(:disabled):active){--sbb-calendar-day-cell-background-color: var(--sbb-calendar-cell-background-color-active)}.sbb-calendar-day{--sbb-text-font-size: var(--sbb-text-font-size-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-text);letter-spacing:var(--sbb-typo-letter-spacing-text);font-size:var(--sbb-text-font-size);display:flex;flex-direction:var(--sbb-calendar-day-flex-direction);justify-content:var(--sbb-calendar-day-justify-content);align-items:var(--sbb-calendar-day-align-items);height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width);padding:var(--sbb-calendar-cell-padding);padding-block-end:var(--sbb-calendar-day-cell-padding-hover, var(--sbb-calendar-cell-padding));margin:auto;color:var(--sbb-calendar-cell-color);cursor:var(--sbb-calendar-day-cursor);position:relative;z-index:0}.sbb-calendar-day:before{content:"";position:absolute;inset:0;background-color:var(--sbb-calendar-day-cell-background-color);border:var(--sbb-calendar-day-selected-border);border-radius:var(--sbb-calendar-day-border-radius);z-index:-1;transition-duration:var(--sbb-calendar-day-transition-duration);transition-timing-function:var(--sbb-calendar-day-transition-easing-function);transition-property:background-color}:host(:focus-visible) .sbb-calendar-day:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}@media(forced-colors:active){:host(:not(:disabled):active) .sbb-calendar-day:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}@media(any-hover:hover){:host(:not(:active,:disabled):hover) .sbb-calendar-day{--sbb-calendar-day-cell-background-color: var(--sbb-calendar-cell-background-color-hover);--sbb-calendar-day-cell-padding-hover: calc( .0625rem + var(--sbb-calendar-cell-padding) )}}@media(any-hover:hover)and (forced-colors:active){:host(:not(:active,:disabled):hover) .sbb-calendar-day:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}.sbb-calendar-day__value{height:var(--sbb-calendar-day-value-height)}:host(:is(:state(current),[state--current])) .sbb-calendar-day__value{font-weight:700}:host(:is(:state(crossed-out),[state--crossed-out])) .sbb-calendar-day__value:after{content:"";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);position:absolute;background-color:var(--sbb-calendar-cell-disabled-color);inset-block-start:var(--sbb-calendar-day-crossed-out-top);inset-inline-start:50%;transform:var(--sbb-calendar-day-crossed-out-translate)}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height);padding:var(--sbb-calendar-cell-padding)}::slotted(*){height:1rem}`;
|
|
11
|
+
let T = (() => {
|
|
12
|
+
var s;
|
|
13
|
+
let v = [g("sbb-calendar-day")], o, n = [], r, b = k(_), l = [], c, u;
|
|
14
|
+
return s = class extends b {
|
|
15
|
+
set slot(e) {
|
|
16
|
+
super.slot = e, this.value = this.dateAdapter.deserialize(e);
|
|
17
|
+
}
|
|
18
|
+
get slot() {
|
|
19
|
+
return super.slot;
|
|
20
|
+
}
|
|
21
|
+
/** Value of the calendar-day element. */
|
|
22
|
+
set value(e) {
|
|
23
|
+
const a = this.dateAdapter.getValidDateOrNull(this.dateAdapter.deserialize(e));
|
|
24
|
+
if (a) {
|
|
25
|
+
this._value = a;
|
|
26
|
+
const t = this.dateAdapter.sameDate(a, this.dateAdapter.today());
|
|
27
|
+
this.toggleState("current", t), this.internals.ariaCurrent = t ? "date" : null, this.internals.ariaLabel = this.dateAdapter.getAccessibilityFormatDate(a);
|
|
28
|
+
const i = this._getParent();
|
|
29
|
+
i && (this._setDisabledFilteredState(i), this._setSelectedState(i));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
get value() {
|
|
33
|
+
return this._value;
|
|
34
|
+
}
|
|
35
|
+
constructor() {
|
|
36
|
+
super(), this.dateAdapter = (h(this, l), x().datetime?.dateAdapter ?? D), this._value = null, this.addController(new S(this, () => this._getParent(), {
|
|
37
|
+
dateFilter: (e) => this._setDisabledFilteredState(e),
|
|
38
|
+
min: (e) => this._setDisabledFilteredState(e),
|
|
39
|
+
max: (e) => this._setDisabledFilteredState(e),
|
|
40
|
+
selected: (e) => this._setSelectedState(e)
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Intentionally empty, as buttons are not targeted by form reset.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
formResetCallback() {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Intentionally empty, as buttons are not targeted by form restore.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
formStateRestoreCallback(e, a) {
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback(), this.tabIndex = -1;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The component is used as the default day cell within the `sbb-calendar`,
|
|
60
|
+
* or, if extra content is needed, it can be slotted.
|
|
61
|
+
*/
|
|
62
|
+
_getParent() {
|
|
63
|
+
return this.closest?.("sbb-calendar") ?? this.getRootNode?.()?.host?.closest("sbb-calendar");
|
|
64
|
+
}
|
|
65
|
+
_setSelectedState(e) {
|
|
66
|
+
const a = e.multiple ? e.selected.some((t) => this.dateAdapter.sameDate(this.value, t)) : !!e.selected && this.dateAdapter.compareDate(this.value, e.selected) === 0;
|
|
67
|
+
this.toggleState("selected", a), this.internals.ariaPressed = String(a);
|
|
68
|
+
}
|
|
69
|
+
_setDisabledFilteredState(e) {
|
|
70
|
+
const a = !this._isActiveDate(e.dateFilter), t = !this._isDayInRange(e.min, e.max);
|
|
71
|
+
this.disabled = a || t, this.internals.ariaDisabled = String(this.disabled), this.toggleState("crossed-out", a && !t);
|
|
72
|
+
}
|
|
73
|
+
_isActiveDate(e) {
|
|
74
|
+
return e?.(this.value) ?? !0;
|
|
75
|
+
}
|
|
76
|
+
_isDayInRange(e, a) {
|
|
77
|
+
return !e && !a ? !0 : this.dateAdapter.sameDate(this.value, this.dateAdapter.clampDate(this.value, e, a));
|
|
78
|
+
}
|
|
79
|
+
renderTemplate() {
|
|
80
|
+
return f` <span class="sbb-calendar-day__value" aria-hidden="true">
|
|
81
|
+
${this.dateAdapter.getDate(this.value)}
|
|
82
|
+
</span>
|
|
83
|
+
<span class="sbb-calendar-day__extra">
|
|
84
|
+
<slot></slot>
|
|
85
|
+
</span>`;
|
|
86
|
+
}
|
|
87
|
+
}, r = s, (() => {
|
|
88
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(b[Symbol.metadata] ?? null) : void 0;
|
|
89
|
+
c = [p()], u = [m()], d(s, null, c, { kind: "setter", name: "slot", static: !1, private: !1, access: { has: (a) => "slot" in a, set: (a, t) => {
|
|
90
|
+
a.slot = t;
|
|
91
|
+
} }, metadata: e }, null, l), d(s, null, u, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (a) => "value" in a, set: (a, t) => {
|
|
92
|
+
a.value = t;
|
|
93
|
+
} }, metadata: e }, null, l), d(null, o = { value: r }, v, { kind: "class", name: r.name, metadata: e }, null, n), r = o.value, e && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
94
|
+
})(), s.styles = [A, w], h(r, n), r;
|
|
95
|
+
})();
|
|
96
|
+
export {
|
|
97
|
+
T as SbbCalendarDayElement
|
|
98
|
+
};
|
package/calendar.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { SbbCalendarElement as a } from "./calendar/calendar.component.js";
|
|
1
|
+
import { SbbCalendarElement as a, SbbMonthChangeEvent as b } from "./calendar/calendar/calendar.component.js";
|
|
2
|
+
import { SbbCalendarDayElement as t } from "./calendar/calendar-day/calendar-day.component.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
t as SbbCalendarDayElement,
|
|
5
|
+
a as SbbCalendarElement,
|
|
6
|
+
b as SbbMonthChangeEvent
|
|
4
7
|
};
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
var
|
|
1
|
+
var D = (i) => {
|
|
2
2
|
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __esDecorate as
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { isArrowKeyPressed as
|
|
10
|
-
import { SbbLanguageController as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
var B = (i, a, r) => a.has(i) || D("Cannot " + r);
|
|
5
|
+
var _ = (i, a, r) => (B(i, a, "read from private field"), r ? r.call(i) : a.get(i)), g = (i, a, r) => a.has(i) ? D("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, r), u = (i, a, r, p) => (B(i, a, "write to private field"), p ? p.call(i, r) : a.set(i, r), r);
|
|
6
|
+
import { __esDecorate as d, __runInitializers as h } from "tslib";
|
|
7
|
+
import { css as W, LitElement as T, isServer as K, html as F } from "lit";
|
|
8
|
+
import { customElement as q, property as y } from "lit/decorators.js";
|
|
9
|
+
import { isArrowKeyPressed as M, getNextElementIndex as V } from "../../core/a11y.js";
|
|
10
|
+
import { SbbLanguageController as R, SbbPropertyWatcherController as $ } from "../../core/controllers.js";
|
|
11
|
+
import { forceType as N } from "../../core/decorators.js";
|
|
12
|
+
import { isLean as j } from "../../core/dom/lean-context.js";
|
|
13
|
+
import { i18nSelectionRequired as G, i18nChipGroupInputDescription as U } from "../../core/i18n.js";
|
|
14
|
+
import { SbbRequiredMixin as J, SbbDisabledMixin as P, SbbNegativeMixin as H, SbbFormAssociatedMixin as Q, SbbElementInternalsMixin as X } from "../../core/mixins.js";
|
|
15
|
+
import { boxSizingStyles as Y } from "../../core/styles.js";
|
|
16
|
+
import { SbbChipElement as Z } from "../chip.js";
|
|
17
|
+
const tt = W`:host{width:100%;display:flex;flex-wrap:wrap;gap:var(--sbb-chip-group-gap);align-items:center;margin-block:var(--sbb-chip-group-margin-block)}:host(:is(:is(:state(size-s),[state--size-s]),:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: 0}:host(:is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: .375rem .3125rem}@media(min-width:64rem){:host(:is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: .3125rem .1875rem}}:host(:is(:state(without-label),[state--without-label]):is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: 0 .4375rem}@media(min-width:64rem){:host(:is(:state(without-label),[state--without-label]):is(:state(size-s),[state--size-s]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: 0 .3125rem}}:host(:is(:is(:state(size-l),[state--size-l]),:is(:state(size-m),[state--size-m]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default) 0}@media(min-width:64rem){:host(:is(:is(:state(size-l),[state--size-l]),:is(:state(size-m),[state--size-m]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default-large) 0}}:host(:is(:state(without-label),[state--without-label]):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: .1875rem .6875rem}@media(min-width:64rem){:host(:is(:state(without-label),[state--without-label]):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: .1875rem .875rem}}:host(:is(:state(without-label),[state--without-label]):not(:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block: var(--sbb-chip-group-margin-block-no-label-not-empty)}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default) var(--_sbb-chip-group-margin-block-start-default-large)}@media(min-width:64rem){:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-m),[state--size-m]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default-large) var(--_sbb-chip-group-margin-block-start-default-large)}}:host(:not(:is(:state(without-label),[state--without-label]),:is(:state(empty),[state--empty]),:is(:state(size-s),[state--size-s]),:is(:state(size-m),[state--size-m]),:is(:state(size-l),[state--size-l]))){--sbb-chip-group-margin-block: var(--sbb-chip-group-margin-block-with-label-not-empty)}:host(:is(:state(without-label),[state--without-label]):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default) 1rem}@media(min-width:64rem){:host(:is(:state(without-label),[state--without-label]):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default-large) 1.25rem}}:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default) .46875rem}@media(min-width:64rem){:host(:not(:is(:state(without-label),[state--without-label])):is(:state(size-l),[state--size-l]):not(:is(:state(empty),[state--empty]))){--sbb-chip-group-margin-block: var(--_sbb-chip-group-margin-block-start-default-large) .46875rem}}::slotted(input){flex:1 1 var(--sbb-chip-group-input-min-width);max-height:1.5rem}::slotted(sbb-chip){max-width:100%}`;
|
|
18
|
+
let ct = (() => {
|
|
19
|
+
var b, m, c, l;
|
|
20
|
+
let i = [q("sbb-chip-group")], a, r = [], p, f = J(P(H(Q(X(T))))), v = [], z, w, k = [], E = [], C, S = [], x = [], I, O = [], A = [];
|
|
21
|
+
return l = class extends f {
|
|
21
22
|
constructor() {
|
|
22
23
|
super();
|
|
23
|
-
g(this,
|
|
24
|
-
g(this,
|
|
25
|
-
|
|
24
|
+
g(this, b);
|
|
25
|
+
g(this, m);
|
|
26
|
+
g(this, c);
|
|
27
|
+
u(this, b, (h(this, v), h(this, k, null))), u(this, m, (h(this, E), h(this, S, ["Enter"]))), u(this, c, (h(this, x), h(this, O, !1))), this._inputAttributeObserver = (h(this, A), K ? null : new MutationObserver(() => this._reactToInputChanges())), this._language = new R(this), this.addEventListener?.(Z.events.requestdelete, (t) => this._deleteChip(t.target)), this.addEventListener?.("keydown", (t) => this._onChipKeyDown(t)), this.addController(new $(this, () => this.closest("sbb-form-field"), {
|
|
26
28
|
size: (t) => this._updateSize(t.size),
|
|
27
29
|
label: (t) => this._updateLabelState(t),
|
|
28
30
|
hiddenLabel: (t) => this._updateLabelState(t)
|
|
@@ -32,30 +34,37 @@ let ot = (() => {
|
|
|
32
34
|
set value(t) {
|
|
33
35
|
t = t ?? [];
|
|
34
36
|
const e = this.value, s = [...e];
|
|
35
|
-
for (const
|
|
36
|
-
s.includes(
|
|
37
|
-
s.forEach((
|
|
37
|
+
for (const n of t)
|
|
38
|
+
s.includes(n) && s.splice(s.indexOf(n), 1);
|
|
39
|
+
s.forEach((n) => this._chipElements().find((L) => L.value === n)?.remove());
|
|
38
40
|
const o = [...t];
|
|
39
|
-
for (const
|
|
40
|
-
o.includes(
|
|
41
|
-
o.forEach((
|
|
41
|
+
for (const n of e)
|
|
42
|
+
o.includes(n) && o.splice(o.indexOf(n), 1);
|
|
43
|
+
o.forEach((n) => this._createChipElement(n));
|
|
42
44
|
}
|
|
43
45
|
get value() {
|
|
44
46
|
return this._chipElements().map((t) => t.value);
|
|
45
47
|
}
|
|
46
48
|
/** Function that maps a chip's value to its display value. */
|
|
47
49
|
get displayWith() {
|
|
48
|
-
return
|
|
50
|
+
return _(this, b);
|
|
49
51
|
}
|
|
50
52
|
set displayWith(t) {
|
|
51
|
-
|
|
53
|
+
u(this, b, t);
|
|
52
54
|
}
|
|
53
55
|
/** The array of keys that will trigger a `chipinputtokenend` event. Default `['Enter']` */
|
|
54
56
|
get separatorKeys() {
|
|
55
|
-
return
|
|
57
|
+
return _(this, m);
|
|
56
58
|
}
|
|
57
59
|
set separatorKeys(t) {
|
|
58
|
-
|
|
60
|
+
u(this, m, t);
|
|
61
|
+
}
|
|
62
|
+
/** Whether to automatically add a chip when the input loses focus if there's a value. */
|
|
63
|
+
get addOnBlur() {
|
|
64
|
+
return _(this, c);
|
|
65
|
+
}
|
|
66
|
+
set addOnBlur(t) {
|
|
67
|
+
u(this, c, t);
|
|
59
68
|
}
|
|
60
69
|
_updateLabelState(t) {
|
|
61
70
|
this.toggleState("without-label", !t.label || t.hiddenLabel);
|
|
@@ -85,7 +94,7 @@ let ot = (() => {
|
|
|
85
94
|
return super.shouldValidate(t) || t === "required" || t === "value";
|
|
86
95
|
}
|
|
87
96
|
validate() {
|
|
88
|
-
super.validate(), this.required && this.value.length === 0 ? this.setValidityFlag("valueMissing",
|
|
97
|
+
super.validate(), this.required && this.value.length === 0 ? this.setValidityFlag("valueMissing", G[this._language.current]) : this.removeValidityFlag("valueMissing");
|
|
89
98
|
}
|
|
90
99
|
/** Return the list of chip elements **/
|
|
91
100
|
_chipElements() {
|
|
@@ -99,6 +108,9 @@ let ot = (() => {
|
|
|
99
108
|
const t = this.querySelector("input");
|
|
100
109
|
t && t !== this._inputElement && (this._inputAbortController?.abort(), this._inputAttributeObserver?.disconnect(), this._inputElement = t, this._inputAbortController = new AbortController(), this._inputElement.addEventListener("keydown", (e) => this._onInputKeyDown(e), {
|
|
101
110
|
signal: this._inputAbortController.signal
|
|
111
|
+
}), this._inputElement.addEventListener("blur", () => this._onInputBlur(), {
|
|
112
|
+
signal: this._inputAbortController.signal,
|
|
113
|
+
capture: !0
|
|
102
114
|
}), this._inputElement.addEventListener("inputAutocomplete", (e) => {
|
|
103
115
|
this._createChipFromInput("autocomplete", e.detail?.option.value);
|
|
104
116
|
}, {
|
|
@@ -106,7 +118,7 @@ let ot = (() => {
|
|
|
106
118
|
}), this._inputAttributeObserver?.observe(this._inputElement, {
|
|
107
119
|
attributes: !0,
|
|
108
120
|
attributeFilter: ["readonly", "disabled"]
|
|
109
|
-
})), (!this._previousSize || !this.closest("sbb-form-field")) && this._updateSize(
|
|
121
|
+
})), (!this._previousSize || !this.closest("sbb-form-field")) && this._updateSize(j() ? "s" : "m"), this.toggleState("empty", this.value.length === 0), this._reactToInputChanges(), this._updateInputDescription(), this.updateFormValue();
|
|
110
122
|
}
|
|
111
123
|
/**
|
|
112
124
|
* Listen for keyboard events on the chip elements
|
|
@@ -114,8 +126,8 @@ let ot = (() => {
|
|
|
114
126
|
_onChipKeyDown(t) {
|
|
115
127
|
const e = t.target;
|
|
116
128
|
if (e.localName === "sbb-chip") {
|
|
117
|
-
if (
|
|
118
|
-
const s = this._enabledChipElements(), o =
|
|
129
|
+
if (M(t)) {
|
|
130
|
+
const s = this._enabledChipElements(), o = V(t, s.indexOf(e), s.length);
|
|
119
131
|
s[o].focus();
|
|
120
132
|
return;
|
|
121
133
|
}
|
|
@@ -142,6 +154,12 @@ let ot = (() => {
|
|
|
142
154
|
}
|
|
143
155
|
this.separatorKeys.includes(t.key) && (t.preventDefault(), this._createChipFromInput("input"));
|
|
144
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Handle blur event on the input
|
|
159
|
+
**/
|
|
160
|
+
_onInputBlur() {
|
|
161
|
+
this.addOnBlur && this._createChipFromInput("input");
|
|
162
|
+
}
|
|
145
163
|
/**
|
|
146
164
|
* If the input is not empty, create a chip with its value
|
|
147
165
|
*/
|
|
@@ -153,8 +171,8 @@ let ot = (() => {
|
|
|
153
171
|
origin: t,
|
|
154
172
|
value: s,
|
|
155
173
|
label: (e ? this.displayWith?.(e) : null) ?? void 0,
|
|
156
|
-
setValue: (
|
|
157
|
-
setLabel: (
|
|
174
|
+
setValue: (n) => o.value = n,
|
|
175
|
+
setLabel: (n) => o.label = n
|
|
158
176
|
};
|
|
159
177
|
this._dispatchChipInputTokenEnd(o) && (this._createChipElement(o.value, o.label), this._inputElement.value = "", this._emitInputEvents());
|
|
160
178
|
}
|
|
@@ -190,7 +208,7 @@ let ot = (() => {
|
|
|
190
208
|
this.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
191
209
|
}
|
|
192
210
|
_createChipElement(t, e) {
|
|
193
|
-
if (
|
|
211
|
+
if (K)
|
|
194
212
|
return;
|
|
195
213
|
const s = document.createElement("sbb-chip");
|
|
196
214
|
s.value = t, s.innerText = e ?? (t ? this.displayWith?.(t) : null) ?? "", this.insertBefore(s, this._inputElement ?? this.querySelector("input"));
|
|
@@ -207,26 +225,28 @@ let ot = (() => {
|
|
|
207
225
|
this._previousSize && this.internals.states.delete(`size-${this._previousSize}`), this._previousSize = t, this._previousSize && this.internals.states.add(`size-${this._previousSize}`);
|
|
208
226
|
}
|
|
209
227
|
_updateInputDescription() {
|
|
210
|
-
this._inputElement && this._inputElement.setAttribute("aria-description", `${
|
|
228
|
+
this._inputElement && this._inputElement.setAttribute("aria-description", `${U[this._language.current]} ${this.value.length}`);
|
|
211
229
|
}
|
|
212
230
|
render() {
|
|
213
|
-
return
|
|
231
|
+
return F`<slot @slotchange=${this._setupComponent}></slot>`;
|
|
214
232
|
}
|
|
215
|
-
},
|
|
216
|
-
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(
|
|
217
|
-
|
|
233
|
+
}, b = new WeakMap(), m = new WeakMap(), c = new WeakMap(), p = l, (() => {
|
|
234
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(f[Symbol.metadata] ?? null) : void 0;
|
|
235
|
+
z = [y({ type: Array })], w = [y({ attribute: !1 })], C = [y({ attribute: "separator-keys", type: Array })], I = [N(), y({ attribute: "add-on-blur", type: Boolean })], d(l, null, z, { kind: "setter", name: "value", static: !1, private: !1, access: { has: (e) => "value" in e, set: (e, s) => {
|
|
218
236
|
e.value = s;
|
|
219
|
-
} }, metadata: t }, null,
|
|
237
|
+
} }, metadata: t }, null, v), d(l, null, w, { kind: "accessor", name: "displayWith", static: !1, private: !1, access: { has: (e) => "displayWith" in e, get: (e) => e.displayWith, set: (e, s) => {
|
|
220
238
|
e.displayWith = s;
|
|
221
|
-
} }, metadata: t },
|
|
239
|
+
} }, metadata: t }, k, E), d(l, null, C, { kind: "accessor", name: "separatorKeys", static: !1, private: !1, access: { has: (e) => "separatorKeys" in e, get: (e) => e.separatorKeys, set: (e, s) => {
|
|
222
240
|
e.separatorKeys = s;
|
|
223
|
-
} }, metadata: t },
|
|
224
|
-
|
|
241
|
+
} }, metadata: t }, S, x), d(l, null, I, { kind: "accessor", name: "addOnBlur", static: !1, private: !1, access: { has: (e) => "addOnBlur" in e, get: (e) => e.addOnBlur, set: (e, s) => {
|
|
242
|
+
e.addOnBlur = s;
|
|
243
|
+
} }, metadata: t }, O, A), d(null, a = { value: p }, i, { kind: "class", name: p.name, metadata: t }, null, r), p = a.value, t && Object.defineProperty(p, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
244
|
+
})(), l.role = "listbox", l.styles = [Y, tt], l.events = {
|
|
225
245
|
input: "input",
|
|
226
246
|
change: "change",
|
|
227
247
|
chipinputtokenend: "chipinputtokenend"
|
|
228
|
-
},
|
|
248
|
+
}, h(p, r), p;
|
|
229
249
|
})();
|
|
230
250
|
export {
|
|
231
|
-
|
|
251
|
+
ct as SbbChipGroupElement
|
|
232
252
|
};
|
package/core/styles/core.scss
CHANGED
|
@@ -10,6 +10,7 @@ $theme: 'standard' !default;
|
|
|
10
10
|
@use './mixins/font-face';
|
|
11
11
|
@use './mixins/helpers';
|
|
12
12
|
@use './mixins/inputs';
|
|
13
|
+
@use './mixins/overlay' as overlay;
|
|
13
14
|
@use './mixins/popover';
|
|
14
15
|
@use './mixins/scrollbar';
|
|
15
16
|
@use './mixins/typo';
|
|
@@ -68,6 +69,18 @@ $theme: 'standard' !default;
|
|
|
68
69
|
@use '../../container/sticky-bar/sticky-bar.global' as sticky-bar with (
|
|
69
70
|
$theme: $theme
|
|
70
71
|
);
|
|
72
|
+
@use '../../dialog/dialog/dialog.global' as dialog with (
|
|
73
|
+
$theme: $theme
|
|
74
|
+
);
|
|
75
|
+
@use '../../dialog/dialog-close-button/dialog-close-button.global' as dialog-close-button with (
|
|
76
|
+
$theme: $theme
|
|
77
|
+
);
|
|
78
|
+
@use '../../dialog/dialog-content/dialog-content.global' as dialog-content with (
|
|
79
|
+
$theme: $theme
|
|
80
|
+
);
|
|
81
|
+
@use '../../dialog/dialog-title/dialog-title.global' as dialog-title with (
|
|
82
|
+
$theme: $theme
|
|
83
|
+
);
|
|
71
84
|
@use '../../divider/divider.global' as divider with (
|
|
72
85
|
$theme: $theme
|
|
73
86
|
);
|
|
@@ -82,6 +95,18 @@ $theme: 'standard' !default;
|
|
|
82
95
|
expansion-panel-header with (
|
|
83
96
|
$theme: $theme
|
|
84
97
|
);
|
|
98
|
+
@use '../../footer/footer.global' as footer with (
|
|
99
|
+
$theme: $theme
|
|
100
|
+
);
|
|
101
|
+
@use '../../option/option/option.global' as option with (
|
|
102
|
+
$theme: $theme
|
|
103
|
+
);
|
|
104
|
+
@use '../../option/option-hint/option-hint.global' as option-hint with (
|
|
105
|
+
$theme: $theme
|
|
106
|
+
);
|
|
107
|
+
@use '../../option/optgroup/optgroup.global' as optgroup with (
|
|
108
|
+
$theme: $theme
|
|
109
|
+
);
|
|
85
110
|
@use '../../radio-button/common/radio-button-common.global' as radio-button-common with (
|
|
86
111
|
$theme: $theme
|
|
87
112
|
);
|
|
@@ -95,6 +120,9 @@ $theme: 'standard' !default;
|
|
|
95
120
|
with (
|
|
96
121
|
$theme: $theme
|
|
97
122
|
);
|
|
123
|
+
@use '../../status/status.global' as status with (
|
|
124
|
+
$theme: $theme
|
|
125
|
+
);
|
|
98
126
|
@use '../../tabs/common/tab-group-common.global' as tab-group-common with (
|
|
99
127
|
$theme: $theme
|
|
100
128
|
);
|
|
@@ -133,14 +161,22 @@ $theme: 'standard' !default;
|
|
|
133
161
|
@include container.base;
|
|
134
162
|
@include sticky-bar.base;
|
|
135
163
|
@include clock.base;
|
|
164
|
+
@include dialog.base;
|
|
165
|
+
@include dialog-close-button.base;
|
|
136
166
|
@include divider.base;
|
|
137
167
|
@include expansion-panel.base;
|
|
138
168
|
@include expansion-panel-content.base;
|
|
139
169
|
@include expansion-panel-header.base;
|
|
170
|
+
@include footer.base;
|
|
171
|
+
@include option.base;
|
|
172
|
+
@include option-hint.base;
|
|
173
|
+
@include optgroup.base;
|
|
174
|
+
@include overlay.options-panel-overlay-variables--global($theme);
|
|
140
175
|
@include radio-button-common.base;
|
|
141
176
|
@include radio-button-group.base;
|
|
142
177
|
@include selection-action-panel.base;
|
|
143
178
|
@include selection-expansion-panel.base;
|
|
179
|
+
@include status.base;
|
|
144
180
|
@include tab-group-common.base;
|
|
145
181
|
@include tab-label-common.base;
|
|
146
182
|
@include visual-checkbox.base;
|
|
@@ -217,6 +253,9 @@ $theme: 'standard' !default;
|
|
|
217
253
|
|
|
218
254
|
@include mediaqueries.mq($from: small) {
|
|
219
255
|
@include sbb-css-tokens.breakpoint-small;
|
|
256
|
+
|
|
257
|
+
@include dialog.base-breakpoint-small;
|
|
258
|
+
@include footer.base-breakpoint-small;
|
|
220
259
|
}
|
|
221
260
|
|
|
222
261
|
@include mediaqueries.mq($from: large) {
|
|
@@ -225,6 +264,7 @@ $theme: 'standard' !default;
|
|
|
225
264
|
@include button.base-breakpoint-large;
|
|
226
265
|
|
|
227
266
|
@include chip-group.base-breakpoint-large;
|
|
267
|
+
@include dialog.base-breakpoint-large;
|
|
228
268
|
|
|
229
269
|
// TODO: Remove complete block when new lean theme is complete
|
|
230
270
|
// Only render the block in standard theme as fallback for CSS class usage
|
|
@@ -253,7 +293,12 @@ $theme: 'standard' !default;
|
|
|
253
293
|
@include font-face.font-declarations;
|
|
254
294
|
|
|
255
295
|
// Components global styles
|
|
296
|
+
@include breadcrumb-group.rules;
|
|
256
297
|
@include container.rules;
|
|
298
|
+
@include dialog-close-button.rules;
|
|
299
|
+
@include dialog-content.rules;
|
|
300
|
+
@include dialog-title.rules;
|
|
301
|
+
@include option.rules;
|
|
257
302
|
@include tab-nav-bar.rules;
|
|
258
303
|
|
|
259
304
|
// TODO: discuss where to add these classes
|
|
@@ -363,6 +408,7 @@ html {
|
|
|
363
408
|
white-space: break-spaces;
|
|
364
409
|
overflow-y: auto;
|
|
365
410
|
min-height: calc((var(--sbb-typo-line-height-text) * 1em));
|
|
411
|
+
height: 100%;
|
|
366
412
|
}
|
|
367
413
|
|
|
368
414
|
&[size='l'] :where(textarea) {
|
|
@@ -431,13 +477,6 @@ html {
|
|
|
431
477
|
@include popover.popover-reset;
|
|
432
478
|
}
|
|
433
479
|
|
|
434
|
-
// Ensure stable breadcrumb height during hydrating
|
|
435
|
-
sbb-breadcrumb-group:not(:defined) {
|
|
436
|
-
display: block;
|
|
437
|
-
height: calc(var(--sbb-typo-line-height-text) * var(--sbb-text-font-size-xs));
|
|
438
|
-
overflow: hidden;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
480
|
// Every element in the Light DOM of a sbb-card which is focusable should receive this attribute.
|
|
442
481
|
// This style enables accessing focusable elements inside an sbb-card.
|
|
443
482
|
:is(sbb-card, sbb-flip-card) .sbb-action {
|
|
@@ -703,65 +742,6 @@ sbb-toggle:has(:focus-visible) {
|
|
|
703
742
|
@include a11y.focus-outline;
|
|
704
743
|
}
|
|
705
744
|
|
|
706
|
-
:where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size='s'] {
|
|
707
|
-
:where(sbb-option, sbb-autocomplete-grid-option) {
|
|
708
|
-
--sbb-option-min-height: var(--sbb-size-element-xxs);
|
|
709
|
-
--sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
|
|
710
|
-
--sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
sbb-optgroup {
|
|
714
|
-
--sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
sbb-option-hint {
|
|
718
|
-
--sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
sbb-dialog-title {
|
|
723
|
-
// Hide margin on the right side. Distance to button is defined by flex gap already.
|
|
724
|
-
sbb-dialog:has(> sbb-dialog-close-button) > &,
|
|
725
|
-
sbb-dialog:state(has-intermediate-element):has(> * > sbb-dialog-close-button) > * > & {
|
|
726
|
-
padding-inline-end: 0;
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
sbb-dialog-content {
|
|
731
|
-
// If there is a title, remove top spacing for the content
|
|
732
|
-
sbb-dialog:has(> sbb-dialog-title) > &,
|
|
733
|
-
sbb-dialog:state(has-intermediate-element):has(> * > sbb-dialog-title) > * > & {
|
|
734
|
-
padding-block-start: var(--sbb-spacing-fixed-1x);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// Set the negative scrollbar colors for dialog content when dialog is negative
|
|
738
|
-
sbb-dialog[negative] > &,
|
|
739
|
-
sbb-dialog[negative]:state(has-intermediate-element) > * > & {
|
|
740
|
-
@include scrollbar.scrollbar-variables--color-negative;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
sbb-dialog-close-button {
|
|
745
|
-
// If there is no dialog title, the close button should be positioned absolute
|
|
746
|
-
sbb-dialog:not(:has(> sbb-dialog-title)) > &,
|
|
747
|
-
sbb-dialog:state(has-intermediate-element):not(:has(> * > sbb-dialog-title)) > * > & {
|
|
748
|
-
position: absolute;
|
|
749
|
-
z-index: 1;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
// The close button positioning needs the current dialog title size
|
|
753
|
-
sbb-dialog:has(> sbb-dialog-title[visual-level='3']) > &,
|
|
754
|
-
sbb-dialog:state(has-intermediate-element):has(> * > sbb-dialog-title[visual-level='3']) > * > & {
|
|
755
|
-
--_sbb-dialog-title-size: var(--sbb-heading-font-size-3);
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
// The close button positioning needs the current dialog title size
|
|
759
|
-
sbb-dialog:has(> sbb-dialog-title[visual-level='5']) > &,
|
|
760
|
-
sbb-dialog:state(has-intermediate-element):has(> * > sbb-dialog-title[visual-level='5']) > * > & {
|
|
761
|
-
--_sbb-dialog-title-size: var(--sbb-heading-font-size-5);
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
745
|
sbb-notification:has(sbb-title) {
|
|
766
746
|
--_sbb-notification-icon-authoritative-font-size: var(--sbb-heading-font-size-5);
|
|
767
747
|
--_sbb-notification-icon-authoritative-line-height: var(--sbb-typo-line-height-heading);
|
|
@@ -772,13 +752,6 @@ sbb-notification:has(sbb-title) {
|
|
|
772
752
|
}
|
|
773
753
|
}
|
|
774
754
|
|
|
775
|
-
sbb-status:has(sbb-title) {
|
|
776
|
-
--sbb-status-gap: var(--sbb-spacing-responsive-xxxs);
|
|
777
|
-
--_sbb-status-text-color-override: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
|
|
778
|
-
--_sbb-status-title-font-size: var(--sbb-heading-font-size-5);
|
|
779
|
-
--_sbb-status-title-line-height: var(--sbb-typo-line-height-heading);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
755
|
.sbb-overlay-outlet {
|
|
783
756
|
position: fixed;
|
|
784
757
|
inset: 0;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
@use '../core/functions';
|
|
1
2
|
@use './scrollbar';
|
|
2
3
|
|
|
4
|
+
@mixin options-panel-overlay-variables--global($theme: 'standard') {
|
|
5
|
+
--sbb-options-panel-border-radius: var(--sbb-border-radius-4x);
|
|
6
|
+
--sbb-options-panel-animation-timing-function: ease;
|
|
7
|
+
--sbb-options-panel-background-color: var(--sbb-background-color-1);
|
|
8
|
+
--sbb-options-panel-divider-margin-block: var(--sbb-spacing-fixed-3x);
|
|
9
|
+
--sbb-options-panel-padding-block: #{functions.theme-pattern-select(
|
|
10
|
+
(
|
|
11
|
+
'standard': var(--sbb-spacing-fixed-2x),
|
|
12
|
+
'lean': var(--sbb-spacing-fixed-1x),
|
|
13
|
+
),
|
|
14
|
+
$theme
|
|
15
|
+
)};
|
|
16
|
+
}
|
|
17
|
+
|
|
3
18
|
@mixin options-panel-overlay-variables {
|
|
4
19
|
@include scrollbar.scrollbar-variables;
|
|
5
20
|
|
|
@@ -12,24 +27,15 @@
|
|
|
12
27
|
var(--sbb-options-panel-max-height, 100000em)
|
|
13
28
|
);
|
|
14
29
|
--sbb-options-panel-min-height: var(--sbb-options-panel-origin-height);
|
|
15
|
-
--sbb-options-panel-visibility: visible;
|
|
16
|
-
--sbb-options-panel-width: fit-content;
|
|
17
|
-
--sbb-options-panel-border-radius: var(--sbb-border-radius-4x);
|
|
18
30
|
--sbb-options-panel-options-border-radius: 0 0 var(--sbb-options-panel-border-radius)
|
|
19
31
|
var(--sbb-options-panel-border-radius);
|
|
20
32
|
--sbb-options-panel-animation-duration: var(
|
|
21
33
|
--sbb-disable-animation-duration,
|
|
22
34
|
var(--sbb-animation-duration-4x)
|
|
23
35
|
);
|
|
24
|
-
--sbb-options-panel-animation-timing-function: ease;
|
|
25
|
-
--sbb-options-panel-gap-fix-opacity: 0;
|
|
26
|
-
--sbb-options-panel-gap-fix-transform: none;
|
|
27
36
|
--sbb-options-panel-gap-fix-top: calc(
|
|
28
37
|
var(--sbb-options-panel-position-y) - var(--sbb-options-panel-border-radius)
|
|
29
38
|
);
|
|
30
|
-
--sbb-options-panel-background-color: var(--sbb-background-color-1);
|
|
31
|
-
--sbb-options-panel-padding-block: var(--sbb-spacing-fixed-2x);
|
|
32
|
-
--sbb-options-panel-divider-margin-block: var(--sbb-spacing-fixed-3x);
|
|
33
39
|
|
|
34
40
|
// As the overlays have always a white background, we have to fix the focus outline color
|
|
35
41
|
// to default color for cases where the overlays are used in a negative context.
|
|
@@ -53,6 +59,10 @@
|
|
|
53
59
|
--sbb-options-panel-padding-block: var(--sbb-spacing-fixed-1x);
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
@mixin options-panel-overlay-size-m-variables {
|
|
63
|
+
--sbb-options-panel-padding-block: var(--sbb-spacing-fixed-2x);
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
@mixin options-panel-overlay-container {
|
|
57
67
|
position: fixed;
|
|
58
68
|
pointer-events: none;
|
|
@@ -64,14 +74,14 @@
|
|
|
64
74
|
display: flex;
|
|
65
75
|
justify-content: space-between;
|
|
66
76
|
position: fixed;
|
|
67
|
-
visibility: var(--sbb-options-panel-visibility);
|
|
68
|
-
opacity: var(--sbb-options-panel-gap-fix-opacity);
|
|
77
|
+
visibility: var(--sbb-options-panel-visibility, visible);
|
|
78
|
+
opacity: var(--sbb-options-panel-gap-fix-opacity, 0);
|
|
69
79
|
background-color: transparent;
|
|
70
|
-
width: var(--sbb-options-panel-width);
|
|
80
|
+
width: var(--sbb-options-panel-width, fit-content);
|
|
71
81
|
height: var(--sbb-options-panel-border-radius);
|
|
72
82
|
top: var(--sbb-options-panel-gap-fix-top);
|
|
73
83
|
left: var(--sbb-options-panel-position-x);
|
|
74
|
-
transform: var(--sbb-options-panel-gap-fix-transform);
|
|
84
|
+
transform: var(--sbb-options-panel-gap-fix-transform, none);
|
|
75
85
|
transition: opacity var(--sbb-options-panel-animation-duration)
|
|
76
86
|
var(--sbb-options-panel-animation-timing-function);
|
|
77
87
|
}
|
|
@@ -79,14 +89,14 @@
|
|
|
79
89
|
@mixin options-panel-overlay {
|
|
80
90
|
display: block;
|
|
81
91
|
position: absolute;
|
|
82
|
-
visibility: var(--sbb-options-panel-visibility);
|
|
92
|
+
visibility: var(--sbb-options-panel-visibility, 'visible');
|
|
83
93
|
overflow: hidden;
|
|
84
94
|
background-color: transparent;
|
|
85
95
|
border: none;
|
|
86
96
|
border-radius: var(--sbb-options-panel-border-radius);
|
|
87
97
|
top: var(--sbb-options-panel-position-y);
|
|
88
98
|
left: var(--sbb-options-panel-position-x);
|
|
89
|
-
width: var(--sbb-options-panel-width);
|
|
99
|
+
width: var(--sbb-options-panel-width, fit-content);
|
|
90
100
|
transition: box-shadow var(--sbb-options-panel-animation-duration)
|
|
91
101
|
var(--sbb-options-panel-animation-timing-function);
|
|
92
102
|
|