@politiet/sheriff-web-components 2.6.1 → 2.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/custom-elements.json +425 -262
- package/dist/frameworks/preact.d.ts +4 -1
- package/dist/frameworks/preact.d.ts.map +1 -1
- package/dist/frameworks/react.d.ts +13 -10
- package/dist/frameworks/react.d.ts.map +1 -1
- package/dist/frameworks/solidjs.d.ts +1 -0
- package/dist/frameworks/solidjs.d.ts.map +1 -1
- package/dist/frameworks/svelte.d.ts +1 -0
- package/dist/frameworks/svelte.d.ts.map +1 -1
- package/dist/frameworks/vue.d.ts +1 -0
- package/dist/frameworks/vue.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mixins/sds-form-control-mixin.d.ts +5 -0
- package/dist/mixins/sds-form-control-mixin.d.ts.map +1 -1
- package/dist/mixins/sds-form-control-mixin.js +1 -1
- package/dist/mixins/sds-form-control-mixin.js.map +1 -1
- package/dist/react-wrappers/SDSDetailsGroupWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSDetailsGroupWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSDetailsGroupWrapper.js +9 -0
- package/dist/react-wrappers/SDSDetailsGroupWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSDetailsWrapper.d.ts.map +1 -1
- package/dist/react-wrappers/SDSDetailsWrapper.js +1 -1
- package/dist/react-wrappers/SDSDetailsWrapper.js.map +1 -1
- package/dist/react-wrappers/index.d.ts +1 -0
- package/dist/react-wrappers/index.d.ts.map +1 -1
- package/dist/react-wrappers/index.js +1 -0
- package/dist/react-wrappers/index.js.map +1 -1
- package/dist/sds-alert/sds-alert.component.js +1 -1
- package/dist/sds-alert/sds-alert.component.js.map +1 -1
- package/dist/sds-button/sds-button.component.d.ts +1 -0
- package/dist/sds-button/sds-button.component.d.ts.map +1 -1
- package/dist/sds-button/sds-button.component.js +5 -0
- package/dist/sds-button/sds-button.component.js.map +1 -1
- package/dist/sds-button/sds-button.spec.js +1 -1
- package/dist/sds-button/sds-button.spec.js.map +1 -1
- package/dist/sds-card/sds-card.js +1 -1
- package/dist/sds-card/sds-card.js.map +1 -1
- package/dist/sds-card/sds-card.styles.d.ts.map +1 -1
- package/dist/sds-card/sds-card.styles.js +24 -21
- package/dist/sds-card/sds-card.styles.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts +2 -2
- package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.js +6 -3
- package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
- package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -1
- package/dist/sds-checkbox-group/sds-checkbox-group.js +5 -3
- package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -1
- package/dist/sds-chip/sds-chip.d.ts +7 -5
- package/dist/sds-chip/sds-chip.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.js +29 -16
- package/dist/sds-chip/sds-chip.js.map +1 -1
- package/dist/sds-details/sds-details.d.ts +3 -2
- package/dist/sds-details/sds-details.d.ts.map +1 -1
- package/dist/sds-details/sds-details.js +11 -2
- package/dist/sds-details/sds-details.js.map +1 -1
- package/dist/sds-details/sds-details.styles.d.ts.map +1 -1
- package/dist/sds-details/sds-details.styles.js +10 -5
- package/dist/sds-details/sds-details.styles.js.map +1 -1
- package/dist/sds-details-group/sds-details-group.d.ts +24 -0
- package/dist/sds-details-group/sds-details-group.d.ts.map +1 -0
- package/dist/sds-details-group/sds-details-group.js +73 -0
- package/dist/sds-details-group/sds-details-group.js.map +1 -0
- package/dist/sds-details-group/sds-details-group.styles.d.ts +2 -0
- package/dist/sds-details-group/sds-details-group.styles.d.ts.map +1 -0
- package/dist/sds-details-group/sds-details-group.styles.js +30 -0
- package/dist/sds-details-group/sds-details-group.styles.js.map +1 -0
- package/dist/sds-dialog/sds-dialog.component.js +1 -1
- package/dist/sds-dialog/sds-dialog.component.js.map +1 -1
- package/dist/sds-heading/sds-heading.styles.d.ts.map +1 -1
- package/dist/sds-heading/sds-heading.styles.js +8 -2
- package/dist/sds-heading/sds-heading.styles.js.map +1 -1
- package/dist/sds-process-step/sds-process-step.styles.d.ts.map +1 -1
- package/dist/sds-process-step/sds-process-step.styles.js +6 -2
- package/dist/sds-process-step/sds-process-step.styles.js.map +1 -1
- package/dist/sds-radio/sds-radio.d.ts +2 -2
- package/dist/sds-radio/sds-radio.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.js +5 -2
- package/dist/sds-radio/sds-radio.js.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.js +5 -3
- package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
- package/dist/sds-select/sds-select.component.d.ts +2 -2
- package/dist/sds-select/sds-select.component.d.ts.map +1 -1
- package/dist/sds-select/sds-select.component.js +5 -3
- package/dist/sds-select/sds-select.component.js.map +1 -1
- package/dist/sds-switch/sds-switch.d.ts +2 -2
- package/dist/sds-switch/sds-switch.d.ts.map +1 -1
- package/dist/sds-switch/sds-switch.js.map +1 -1
- package/dist/sds-text/sds-text.styles.d.ts.map +1 -1
- package/dist/sds-text/sds-text.styles.js +193 -54
- package/dist/sds-text/sds-text.styles.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.d.ts +2 -2
- package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.js +7 -3
- package/dist/sds-textarea/sds-textarea.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.d.ts +2 -2
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.js +5 -2
- package/dist/sds-textfield/sds-textfield.js.map +1 -1
- package/dist/sheriff-web-components.js +412 -216
- package/package.json +6 -2
- package/web-types.json +203 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-chip.js","sourceRoot":"","sources":["../../src/sds-chip/sds-chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-chip.js","sourceRoot":"","sources":["../../src/sds-chip/sds-chip.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGtG,OAAO,sBAAsB,CAAC;AAavB,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,2BAA2B,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC;IAA3G;;QAIE,oBAAe,GAAY,KAAK,CAAC;QACjC,cAAS,GAAY,KAAK,CAAC;QAGlB,eAAU,GAAW,EAAE,CAAC;QAEzC,iBAAiB;QAC0B,YAAO,GAA4B,YAAY,CAAC;QAChD,SAAI,GAAyB,IAAI,CAAC;QACjC,YAAO,GAA4B,KAAK,CAAC;QAkEpE,sBAAiB,GAAG,CAAC,KAAY,EAAE,EAAE;YACrD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAyB,CAAC;YAC7C,IAAI,CAAC,UAAU,GAAG,IAAI;iBACpB,aAAa,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nB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-chip.styles';\nimport { SDS_SIZES } from '../types';\nimport { SDSDelegateInteractionMixin, SDSEventDispatcherMixin, SDSFormControlMixin } from '../mixins';\nimport type { SDSFormControlAttributes } from '../mixins/sds-form-control-mixin';\n\nimport '../sds-icon/sds-icon';\n\ntype ChipVariant = 'selectable' | 'removable';\ntype ChipSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\n\nexport interface SDSChipProps extends SDSFormControlAttributes {\n\tchecked?: boolean;\n\tsize?: ChipSize;\n\tvalue?: string;\n\tvariant?: ChipVariant;\n}\n\n@guardedCustomElement('sds-chip')\nexport class SDSChip extends SDSDelegateInteractionMixin(SDSEventDispatcherMixin(SDSFormControlMixin(LitElement))) {\n\t// Styling\n\tstatic override styles = [styles];\n\n\tprivate _initialChecked: boolean = false;\n\tprivate _readOnly: boolean = false;\n\n\t@query('#control') control!: HTMLInputElement;\n\t@state() private _slotLabel: string = '';\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true }) variant: SDSChipProps['variant'] = 'selectable';\n\t@property({ type: String, reflect: true }) size: SDSChipProps['size'] = 'md';\n\t@property({ type: Boolean, reflect: true }) checked: SDSChipProps['checked'] = false;\n\t@property({ type: String }) value?: SDSChipProps['value'];\n\t// TODO: Revert til normal prop and remove readonly fallback handling in next major version of web components package.\n\t@property({ type: Boolean, attribute: 'readonly', reflect: true })\n\toverride get readOnly(): boolean {\n\t\treturn this._readOnly;\n\t}\n\toverride set readOnly(value: SDSChipProps['readonly']) {\n\t\tconst oldVal = this._readOnly;\n\t\tthis._readOnly = value ?? false;\n\t\tthis.requestUpdate('readOnly', oldVal);\n\t}\n\n\t/** @deprecated Use readOnly instead */\n\tset readonly(value: SDSChipProps['readonly']) {\n\t\tthis.readOnly = value;\n\t}\n\n\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\t\tthis._initialChecked = this.checked ?? false;\n\t\tthis.internals.role = 'none';\n\t\tif (this.checked) {\n\t\t\tthis.internals.setFormValue(this.value ?? null);\n\t\t}\n\t}\n\n\tformResetCallback() {\n\t\tthis.checked = this._initialChecked;\n\t\tthis.internals.setFormValue(this.value ?? null);\n\t}\n\n\toverride render() {\n\t\tconst isRemovableVariant = this.variant === 'removable' && !this.readOnly && !this.disabled;\n\n\t\tconst chipClasses = {\n\t\t\t'sds-chip': true,\n\t\t\t'sds-chip--small': this.size === 'small' || this.size === 'sm',\n\t\t\t'sds-chip--large': this.size === 'large' || this.size === 'lg',\n\t\t\t'sds-chip--removable': isRemovableVariant,\n\t\t};\n\n\t\tif (isRemovableVariant) {\n\t\t\treturn html`<button class=\"${classMap(chipClasses)}\" @click=${this._remove} @keyup=\"${this._keypress}\">\n\t\t\t\t<slot></slot>\n\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"s\"></sds-icon>\n\t\t\t</button>`;\n\t\t}\n\n\t\treturn html`<label class=\"${classMap(chipClasses)}\">\n\t\t\t<input\n\t\t\t\tid=\"control\"\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\taria-label=\"${this._slotLabel}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t.checked=\"${this.checked ?? false}\"\n\t\t\t\t?checked=\"${this.checked}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t?readonly=\"${this.readOnly}\"\n\t\t\t\t@change=\"${this._handleChange}\"\n\t\t\t/>\n\t\t\t<span aria-hidden=\"true\"><slot @slotchange=\"${this._handleSlotChange}\"></slot></span>\n\t\t</label>`;\n\t}\n\n\tprivate readonly _handleSlotChange = (event: Event) => {\n\t\tconst slot = event.target as HTMLSlotElement;\n\t\tthis._slotLabel = slot\n\t\t\t.assignedNodes()\n\t\t\t.map((node) => node.textContent)\n\t\t\t.join('')\n\t\t\t.trim();\n\t};\n\n\tprivate readonly _handleChange = (event: Event) => {\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!(event.target instanceof HTMLInputElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.disabled || this.readOnly) {\n\t\t\tevent.target.checked = this.checked ?? false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst elem = event.target;\n\t\tthis.checked = elem.checked;\n\t\tthis.internals.setFormValue(this.checked ? this.value ?? 'on' : null);\n\t\tthis.dispatchSheriffEvent('change');\n\t};\n\n\tprivate readonly _remove = () => {\n\t\tif (this.disabled || this.readOnly) return;\n\t\tthis.dispatchSheriffEvent('sds-remove');\n\t};\n\n\tprivate readonly _keypress = (event: KeyboardEvent) => {\n\t\tif (event.key === ' ' || event.key === 'Enter') {\n\t\t\tthis._remove();\n\t\t}\n\t};\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-chip': SDSChip;\n\t}\n}\n"]}
|
|
@@ -3,15 +3,16 @@ import '../sds-icon/sds-icon';
|
|
|
3
3
|
export interface SDSDetailsProps {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
standalone?: boolean;
|
|
6
|
-
name?: string;
|
|
7
6
|
}
|
|
8
7
|
declare const SDSDetails_base: import("../mixins/types").Constructable<import("../mixins/sds-event-dispatcher-mixin").SDSEventDispatcherMixinInterface> & typeof LitElement;
|
|
9
8
|
export declare class SDSDetails extends SDSDetails_base {
|
|
10
9
|
static styles: import("lit").CSSResult[];
|
|
11
10
|
open: SDSDetailsProps['open'];
|
|
12
11
|
standalone: SDSDetailsProps['standalone'];
|
|
13
|
-
name:
|
|
12
|
+
name: string | undefined;
|
|
13
|
+
private _initialized;
|
|
14
14
|
private _handleToggle;
|
|
15
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
15
16
|
render(): import("lit-html").TemplateResult<1>;
|
|
16
17
|
}
|
|
17
18
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-details.d.ts","sourceRoot":"","sources":["../../src/sds-details/sds-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,sBAAsB,CAAC;AAG9B,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-details.d.ts","sourceRoot":"","sources":["../../src/sds-details/sds-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,sBAAsB,CAAC;AAG9B,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;;AAED,qBACa,UAAW,SAAQ,eAAmC;IAClE,OAAgB,MAAM,4BAAY;IAGlC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAS;IAGtC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAS;IAGlD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAa;IAErC,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,aAAa,CAKnB;IAEO,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAU/C,MAAM;CAef;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,aAAa,EAAE,UAAU,CAAC;KAC1B;CACD"}
|
|
@@ -16,19 +16,28 @@ let SDSDetails = class SDSDetails extends SDSEventDispatcherMixin(LitElement) {
|
|
|
16
16
|
this.open = false;
|
|
17
17
|
this.standalone = false;
|
|
18
18
|
this.name = undefined;
|
|
19
|
+
this._initialized = false;
|
|
19
20
|
this._handleToggle = (event) => {
|
|
20
21
|
const details = event.currentTarget;
|
|
21
22
|
if (this.open !== details.open) {
|
|
22
23
|
this.open = details.open;
|
|
23
24
|
}
|
|
24
|
-
this.dispatchSheriffEvent('sds-toggle', { open: details.open });
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
+
updated(changedProperties) {
|
|
28
|
+
if (!this._initialized) {
|
|
29
|
+
this._initialized = true;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (changedProperties.has('open')) {
|
|
33
|
+
this.dispatchSheriffEvent('toggle', { open: !!this.open });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
27
36
|
render() {
|
|
28
37
|
return html `
|
|
29
38
|
<details class="sds-details" .name="${this.name ?? ''}" ?data-standalone="${this.standalone}" ?open="${this.open}" @toggle="${this._handleToggle}">
|
|
30
39
|
<summary class="sds-details__summary">
|
|
31
|
-
<sds-icon name="chevron_up-material-filled"></sds-icon>
|
|
40
|
+
<sds-icon name="chevron_up-material-filled" role="presentation"></sds-icon>
|
|
32
41
|
<div class="sds-details__summary-content">
|
|
33
42
|
<slot name="summary"></slot>
|
|
34
43
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-details.js","sourceRoot":"","sources":["../../src/sds-details/sds-details.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-details.js","sourceRoot":"","sources":["../../src/sds-details/sds-details.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,O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,iBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAGlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACL;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CACO;AAGlD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACL;AAVzB,UAAU;IADtB,oBAAoB,CAAC,aAAa,CAAC;GACvB,UAAU,CA8CtB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-details.styles';\nimport '../sds-icon/sds-icon';\nimport { SDSEventDispatcherMixin } from '../mixins/sds-event-dispatcher-mixin';\n\nexport interface SDSDetailsProps {\n\topen?: boolean;\n\tstandalone?: boolean;\n}\n\n@guardedCustomElement('sds-details')\nexport class SDSDetails extends SDSEventDispatcherMixin(LitElement) {\n\tstatic override styles = [styles];\n\n\t@property({ type: Boolean, reflect: true })\n\topen: SDSDetailsProps['open'] = false;\n\n\t@property({ type: Boolean, reflect: true })\n\tstandalone: SDSDetailsProps['standalone'] = false;\n\n\t@property({ type: String, reflect: true })\n\tname: string | undefined = undefined;\n\n\tprivate _initialized = false;\n\n\tprivate _handleToggle = (event: Event) => {\n\t\tconst details = event.currentTarget as HTMLDetailsElement;\n\t\tif (this.open !== details.open) {\n\t\t\tthis.open = details.open;\n\t\t}\n\t};\n\n\toverride updated(changedProperties: Map<string, unknown>) {\n\t\tif (!this._initialized) {\n\t\t\tthis._initialized = true;\n\t\t\treturn;\n\t\t}\n\t\tif (changedProperties.has('open')) {\n\t\t\tthis.dispatchSheriffEvent('toggle', { open: !!this.open });\n\t\t}\n\t}\n\n\toverride render() {\n\t\treturn html`\n\t\t\t<details class=\"sds-details\" .name=\"${this.name ?? ''}\" ?data-standalone=\"${this.standalone}\" ?open=\"${this.open}\" @toggle=\"${this._handleToggle}\">\n\t\t\t\t<summary class=\"sds-details__summary\">\n\t\t\t\t\t<sds-icon name=\"chevron_up-material-filled\" role=\"presentation\"></sds-icon>\n\t\t\t\t\t<div class=\"sds-details__summary-content\">\n\t\t\t\t\t\t<slot name=\"summary\"></slot>\n\t\t\t\t\t</div>\n\t\t\t\t</summary>\n\t\t\t\t<div class=\"sds-details__content\">\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\t\t\t</details>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-details': SDSDetails;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-details.styles.d.ts","sourceRoot":"","sources":["../../src/sds-details/sds-details.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"sds-details.styles.d.ts","sourceRoot":"","sources":["../../src/sds-details/sds-details.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwIlB,CAAC"}
|
|
@@ -6,6 +6,7 @@ export const styles = css `
|
|
|
6
6
|
--_sds-details-summary-padding: var(--sds-details-summary-padding, var(--sds-spacing-xs));
|
|
7
7
|
--_sds-details-summary-background-color: var(--sds-details-background-color, var(--sds-color-surface-default, var(--sds-color-main-surface-default)));
|
|
8
8
|
--_sds-details-summary-gap: var(--sds-details-summary-gap, var(--sds-spacing-3xs));
|
|
9
|
+
--_sds-details-summary-border-radius: var(--sds-details-summary-border-radius, 0);
|
|
9
10
|
|
|
10
11
|
--_sds-details-content-padding-start: var(--sds-details-content-padding-start, calc(var(--_sds-details-summary-padding) + var(--_sds-details-summary-gap) + var(--sds-components-icon-md)));
|
|
11
12
|
--_sds-details-content-padding: var(--sds-details-content-padding, var(--sds-spacing-xs));
|
|
@@ -20,6 +21,9 @@ export const styles = css `
|
|
|
20
21
|
|
|
21
22
|
--_sds-details-border-color: var(--sds-details-border-color, var(--sds-color-border-subtle, var(--sds-color-main-border-subtle)));
|
|
22
23
|
--_sds-details-border-bottom: var(--sds-details-border-bottom, solid 1px var(--_sds-details-border-color));
|
|
24
|
+
--_sds-details-border-top: var(--sds-details-border-top, solid 1px var(--_sds-details-border-color));
|
|
25
|
+
--_sds-details-border-standalone: var(--sds-details-border-standalone, solid 1px var(--_sds-details-border-color));
|
|
26
|
+
--_sds-details-border-radius: var(--sds-details-border-radius, var(--sds-radius-md));
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
:host([data-palette]) {
|
|
@@ -35,7 +39,7 @@ export const styles = css `
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
&:not([data-standalone]) {
|
|
38
|
-
border-top:
|
|
42
|
+
border-top: var(--_sds-details-border-top);
|
|
39
43
|
border-bottom: var(--_sds-details-border-bottom);
|
|
40
44
|
}
|
|
41
45
|
|
|
@@ -44,8 +48,8 @@ export const styles = css `
|
|
|
44
48
|
*/
|
|
45
49
|
&:is([data-standalone]) {
|
|
46
50
|
summary {
|
|
47
|
-
border-radius: var(--
|
|
48
|
-
border:
|
|
51
|
+
border-radius: var(--_sds-details-border-radius);
|
|
52
|
+
border: var(--_sds-details-border-standalone);
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
&:is([open]) {
|
|
@@ -58,8 +62,8 @@ export const styles = css `
|
|
|
58
62
|
border-left: solid 1px var(--_sds-details-border-color);
|
|
59
63
|
border-right: solid 1px var(--_sds-details-border-color);
|
|
60
64
|
border-bottom: solid 1px var(--_sds-details-border-color);
|
|
61
|
-
border-bottom-left-radius: var(--
|
|
62
|
-
border-bottom-right-radius: var(--
|
|
65
|
+
border-bottom-left-radius: var(--_sds-details-border-radius);
|
|
66
|
+
border-bottom-right-radius: var(--_sds-details-border-radius);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
}
|
|
@@ -72,6 +76,7 @@ export const styles = css `
|
|
|
72
76
|
justify-content: space-between;
|
|
73
77
|
padding: var(--_sds-details-summary-padding);
|
|
74
78
|
background-color: var(--_sds-details-summary-background-color);
|
|
79
|
+
border-radius: var(--_sds-details-summary-border-radius);
|
|
75
80
|
gap: var(--_sds-details-summary-gap);
|
|
76
81
|
list-style: none;
|
|
77
82
|
user-select: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-details.styles.js","sourceRoot":"","sources":["../../src/sds-details/sds-details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"sds-details.styles.js","sourceRoot":"","sources":["../../src/sds-details/sds-details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-details-text-color: var(--sds-details-text-color, var(--sds-color-text-default, var(--sds-color-main-text-default)));\n\n\t\t--_sds-details-summary-padding: var(--sds-details-summary-padding, var(--sds-spacing-xs));\n\t\t--_sds-details-summary-background-color: var(--sds-details-background-color, var(--sds-color-surface-default, var(--sds-color-main-surface-default)));\n\t\t--_sds-details-summary-gap: var(--sds-details-summary-gap, var(--sds-spacing-3xs));\n\t\t--_sds-details-summary-border-radius: var(--sds-details-summary-border-radius, 0);\n\n\t\t--_sds-details-content-padding-start: var(--sds-details-content-padding-start, calc(var(--_sds-details-summary-padding) + var(--_sds-details-summary-gap) + var(--sds-components-icon-md)));\n\t\t--_sds-details-content-padding: var(--sds-details-content-padding, var(--sds-spacing-xs));\n\t\t--_sds-details-content-background-color: var(--sds-details-background-color, var(--sds-color-surface-default, var(--sds-color-main-surface-default)));\n\n\t\t--_sds-details-focus-outline-width: var(--sds-details-focus-outline-width, var(--sds-border-md));\n\t\t--_sds-details-focus-outline-color: var(--sds-details-focus-outline-color, var(--sds-color-states-focus-outer));\n\t\t--_sds-details-focus-outline-offset: var(--sds-details-focus-outline-offset, var(--sds-color-states-focus-spacing));\n\t\t--_sds-details-focus-inner-color: var(--sds-details-focus-inner-color, var(--sds-color-states-focus-inner));\n\n\t\t--_sds-details-icon-transition: var(--sds-details-icon-transition, transform 0.2s ease);\n\n\t\t--_sds-details-border-color: var(--sds-details-border-color, var(--sds-color-border-subtle, var(--sds-color-main-border-subtle)));\n\t\t--_sds-details-border-bottom: var(--sds-details-border-bottom, solid 1px var(--_sds-details-border-color));\n\t\t--_sds-details-border-top: var(--sds-details-border-top, solid 1px var(--_sds-details-border-color));\n\t\t--_sds-details-border-standalone: var(--sds-details-border-standalone, solid 1px var(--_sds-details-border-color));\n\t\t--_sds-details-border-radius: var(--sds-details-border-radius, var(--sds-radius-md));\n\t}\n\n\t:host([data-palette]) {\n\t\t--_sds-details-text-color: var(--sds-details-text-color, var(--sds-color-text-default, var(--sds-color-main-text-default)));\n\t\t--_sds-details-summary-background-color: var(--sds-details-background-color, var(--sds-color-surface-default, var(--sds-color-main-surface-default)));\n\t}\n\n\t.sds-details {\n\t\tcolor: var(--_sds-details-text-color);\n\n\t\t&:is([open]) {\n\t\t\t--_sds-details-summary-background-color: var(----_sds-details-summary-background-color, var(--sds-color-surface-tinted, var(--sds-color-main-surface-tinted)));\n\t\t}\n\n\t\t&:not([data-standalone]) {\n\t\t\tborder-top: var(--_sds-details-border-top);\n\t\t\tborder-bottom: var(--_sds-details-border-bottom);\n\t\t}\n\n\t\t/* Setting the border on the summary element preserves the border\n\t\t when the element has focus\n\t\t*/\n\t\t&:is([data-standalone]) {\n\t\t\tsummary {\n\t\t\t\tborder-radius: var(--_sds-details-border-radius);\n\t\t\t\tborder: var(--_sds-details-border-standalone);\n\t\t\t}\n\n\t\t\t&:is([open]) {\n\t\t\t\t& summary {\n\t\t\t\t\tborder-bottom-left-radius: 0px;\n\t\t\t\t\tborder-bottom-right-radius: 0px;\n\t\t\t\t}\n\n\t\t\t\t& .sds-details__content {\n\t\t\t\t\tborder-left: solid 1px var(--_sds-details-border-color);\n\t\t\t\t\tborder-right: solid 1px var(--_sds-details-border-color);\n\t\t\t\t\tborder-bottom: solid 1px var(--_sds-details-border-color);\n\t\t\t\t\tborder-bottom-left-radius: var(--_sds-details-border-radius);\n\t\t\t\t\tborder-bottom-right-radius: var(--_sds-details-border-radius);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.sds-details__summary {\n\t\tcursor: pointer;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tpadding: var(--_sds-details-summary-padding);\n\t\tbackground-color: var(--_sds-details-summary-background-color);\n\t\tborder-radius: var(--_sds-details-summary-border-radius);\n\t\tgap: var(--_sds-details-summary-gap);\n\t\tlist-style: none;\n\t\tuser-select: none;\n\n\t\t&:hover {\n\t\t\t--_sds-details-summary-background-color: var(--sds-details-summary-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t}\n\n\t\t&:active {\n\t\t\t--_sds-details-summary-background-color: var(--sds-details-summary-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: 0 0 0 var(--sds-color-states-focus-spacing) var(--_sds-details-focus-inner-color);\n\t\t\toutline: var(--_sds-details-focus-outline-width) solid var(--_sds-details-focus-outline-color);\n\t\t\toutline-offset: var(--_sds-details-focus-outline-offset);\n\t\t}\n\t}\n\n\t.sds-details__summary-content {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t}\n\n\tsds-icon {\n\t\ttransition: var(--_sds-details-icon-transition);\n\t}\n\n\t.sds-details:not([open]) sds-icon {\n\t\ttransform: rotate(180deg);\n\t}\n\n\t.sds-details__content {\n\t\tpadding: var(--_sds-details-content-padding);\n\t\tpadding-inline-start: var(--_sds-details-content-padding-start);\n\t}\n\n\t@media (prefers-reduced-motion: no-preference) {\n\t\t.sds-details__content {\n\t\t\tanimation: show-content-keyframes 200ms ease-in-out;\n\t\t}\n\t}\n\n\t@keyframes show-content-keyframes {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-0.5rem);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t::slotted([slot='summary']) {\n\t\tdisplay: inline;\n\t\tmargin: 0;\n\t}\n`;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface SDSDetailsGroupProps {
|
|
3
|
+
outlined?: boolean;
|
|
4
|
+
name?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SDSDetailsGroup extends LitElement {
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
outlined: SDSDetailsGroupProps['outlined'];
|
|
9
|
+
name: SDSDetailsGroupProps['name'];
|
|
10
|
+
private _detailsChildren;
|
|
11
|
+
private _toggleListeners;
|
|
12
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
13
|
+
disconnectedCallback(): void;
|
|
14
|
+
private _handleSlotChange;
|
|
15
|
+
private _syncChildren;
|
|
16
|
+
private _removeListeners;
|
|
17
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'sds-details-group': SDSDetailsGroup;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=sds-details-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-details-group.d.ts","sourceRoot":"","sources":["../../src/sds-details-group/sds-details-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAMvC,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,qBACa,eAAgB,SAAQ,UAAU;IAC9C,OAAgB,MAAM,4BAAY;IAGlC,QAAQ,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAS;IAGnD,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAGnC,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,gBAAgB,CAAwC;IAEvD,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAM/C,oBAAoB;IAK7B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,gBAAgB;IAOf,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,mBAAmB,EAAE,eAAe,CAAC;KACrC;CACD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from 'lit';
|
|
8
|
+
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import { guardedCustomElement } from '../utils/guarded-custom-element';
|
|
10
|
+
import { styles } from './sds-details-group.styles';
|
|
11
|
+
let SDSDetailsGroup = class SDSDetailsGroup extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.outlined = false;
|
|
15
|
+
this._toggleListeners = new Map();
|
|
16
|
+
}
|
|
17
|
+
updated(changedProperties) {
|
|
18
|
+
if (changedProperties.has('name')) {
|
|
19
|
+
this._syncChildren();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
disconnectedCallback() {
|
|
23
|
+
super.disconnectedCallback();
|
|
24
|
+
this._removeListeners();
|
|
25
|
+
}
|
|
26
|
+
_handleSlotChange() {
|
|
27
|
+
this._syncChildren();
|
|
28
|
+
}
|
|
29
|
+
_syncChildren() {
|
|
30
|
+
this._removeListeners();
|
|
31
|
+
const children = this._detailsChildren;
|
|
32
|
+
children.forEach(child => {
|
|
33
|
+
child.name = this.name;
|
|
34
|
+
if (this.name) {
|
|
35
|
+
const listener = (event) => {
|
|
36
|
+
const { open } = event.detail;
|
|
37
|
+
if (open) {
|
|
38
|
+
children.forEach(sibling => {
|
|
39
|
+
if (sibling !== child && sibling.open)
|
|
40
|
+
sibling.open = false;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
child.addEventListener('toggle', listener);
|
|
45
|
+
this._toggleListeners.set(child, listener);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
_removeListeners() {
|
|
50
|
+
this._toggleListeners.forEach((listener, child) => {
|
|
51
|
+
child.removeEventListener('toggle', listener);
|
|
52
|
+
});
|
|
53
|
+
this._toggleListeners.clear();
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
return html `<div><slot @slotchange="${this._handleSlotChange}"></slot></div>`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
SDSDetailsGroup.styles = [styles];
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: Boolean, reflect: true })
|
|
62
|
+
], SDSDetailsGroup.prototype, "outlined", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: String, reflect: true })
|
|
65
|
+
], SDSDetailsGroup.prototype, "name", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
queryAssignedElements({ selector: 'sds-details' })
|
|
68
|
+
], SDSDetailsGroup.prototype, "_detailsChildren", void 0);
|
|
69
|
+
SDSDetailsGroup = __decorate([
|
|
70
|
+
guardedCustomElement('sds-details-group')
|
|
71
|
+
], SDSDetailsGroup);
|
|
72
|
+
export { SDSDetailsGroup };
|
|
73
|
+
//# sourceMappingURL=sds-details-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-details-group.js","sourceRoot":"","sources":["../../src/sds-details-group/sds-details-group.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAS7C,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,aAAQ,GAAqC,KAAK,CAAC;QAO3C,qBAAgB,GAAG,IAAI,GAAG,EAA6B,CAAC;IAkDjE,CAAC;IAhDS,OAAO,CAAC,iBAAuC;QACvD,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC;IACF,CAAC;IAEQ,oBAAoB;QAC5B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACzB,CAAC;IAEO,iBAAiB;QACxB,IAAI,CAAC,aAAa,EAAE,CAA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AAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACQ;AAGnD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CACP;AAG3B;IADP,qBAAqB,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;yDACN;AAVjC,eAAe;IAD3B,oBAAoB,CAAC,mBAAmB,CAAC;GAC7B,eAAe,CA6D3B","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\nimport { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { styles } from './sds-details-group.styles';\nimport type { SDSDetails } from '../sds-details/sds-details';\n\nexport interface SDSDetailsGroupProps {\n\toutlined?: boolean;\n\tname?: string;\n}\n\n@guardedCustomElement('sds-details-group')\nexport class SDSDetailsGroup extends LitElement {\n\tstatic override styles = [styles];\n\n\t@property({ type: Boolean, reflect: true })\n\toutlined: SDSDetailsGroupProps['outlined'] = false;\n\n\t@property({ type: String, reflect: true })\n\tname: SDSDetailsGroupProps['name'];\n\n\t@queryAssignedElements({ selector: 'sds-details' })\n\tprivate _detailsChildren!: Array<SDSDetails>;\n\tprivate _toggleListeners = new Map<SDSDetails, EventListener>();\n\n\toverride updated(changedProperties: Map<string, unknown>) {\n\t\tif (changedProperties.has('name')) {\n\t\t\tthis._syncChildren();\n\t\t}\n\t}\n\n\toverride disconnectedCallback() {\n\t\tsuper.disconnectedCallback();\n\t\tthis._removeListeners();\n\t}\n\n\tprivate _handleSlotChange() {\n\t\tthis._syncChildren();\n\t}\n\n\tprivate _syncChildren() {\n\t\tthis._removeListeners();\n\n\t\tconst children = this._detailsChildren;\n\n\t\tchildren.forEach(child => {\n\t\t\tchild.name = this.name;\n\n\t\t\tif (this.name) {\n\t\t\t\tconst listener: EventListener = (event: Event) => {\n\t\t\t\t\tconst { open } = (event as CustomEvent<{ open: boolean }>).detail;\n\t\t\t\t\tif (open) {\n\t\t\t\t\t\tchildren.forEach(sibling => {\n\t\t\t\t\t\t\tif (sibling !== child && sibling.open) sibling.open = false;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tchild.addEventListener('toggle', listener);\n\t\t\t\tthis._toggleListeners.set(child, listener);\n\t\t\t}\n\t\t});\n\t}\n\n\tprivate _removeListeners() {\n\t\tthis._toggleListeners.forEach((listener, child) => {\n\t\t\tchild.removeEventListener('toggle', listener);\n\t\t});\n\t\tthis._toggleListeners.clear();\n\t}\n\n\toverride render() {\n\t\treturn html`<div><slot @slotchange=\"${this._handleSlotChange}\"></slot></div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-details-group': SDSDetailsGroup;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-details-group.styles.d.ts","sourceRoot":"","sources":["../../src/sds-details-group/sds-details-group.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA2BlB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
div ::slotted(sds-details:not(:last-child)) {
|
|
8
|
+
--sds-details-border-bottom: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([outlined]) div {
|
|
12
|
+
border: 1px solid var(--sds-color-border-subtle, var(--sds-color-main-border-subtle));
|
|
13
|
+
border-radius: var(--sds-radius-md);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([outlined]) div ::slotted(sds-details:first-child) {
|
|
17
|
+
--sds-details-border-top: 0;
|
|
18
|
+
--sds-details-summary-border-radius: var(--sds-radius-md) var(--sds-radius-md) 0 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([outlined]) div ::slotted(sds-details:last-child) {
|
|
22
|
+
--sds-details-border-bottom: 0;
|
|
23
|
+
--sds-details-summary-border-radius: 0 0 var(--sds-radius-md) var(--sds-radius-md);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([outlined]) div ::slotted(sds-details:last-child[open]) {
|
|
27
|
+
--sds-details-summary-border-radius: 0;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
//# sourceMappingURL=sds-details-group.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-details-group.styles.js","sourceRoot":"","sources":["../../src/sds-details-group/sds-details-group.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\tdiv ::slotted(sds-details:not(:last-child)) {\n\t\t--sds-details-border-bottom: 0;\n\t}\n\n\t:host([outlined]) div {\n\t\tborder: 1px solid var(--sds-color-border-subtle, var(--sds-color-main-border-subtle));\n\t\tborder-radius: var(--sds-radius-md);\n\t}\n\n\t:host([outlined]) div ::slotted(sds-details:first-child) {\n\t\t--sds-details-border-top: 0;\n\t\t--sds-details-summary-border-radius: var(--sds-radius-md) var(--sds-radius-md) 0 0;\n\t}\n\n\t:host([outlined]) div ::slotted(sds-details:last-child) {\n\t\t--sds-details-border-bottom: 0;\n\t\t--sds-details-summary-border-radius: 0 0 var(--sds-radius-md) var(--sds-radius-md);\n\t}\n\n\t:host([outlined]) div ::slotted(sds-details:last-child[open]) {\n\t\t--sds-details-summary-border-radius: 0;\n\t}\n`;\n"]}
|
|
@@ -147,7 +147,7 @@ export class SDSDialogComponent extends SDSEventDispatcherMixin(LitElement) {
|
|
|
147
147
|
<slot name="header" @slotchange=${this._handleHeaderSlotChange}></slot>
|
|
148
148
|
${this.closeButtonLabel
|
|
149
149
|
? html `
|
|
150
|
-
<sds-button class="sds-dialog__close-button" icon variant="tertiary" size="md" data-command="close"
|
|
150
|
+
<sds-button class="sds-dialog__close-button" icon variant="tertiary" size="md" data-command="close" label="${this.closeButtonLabel}">
|
|
151
151
|
<sds-icon name="close-material-outlined" size="md"></sds-icon>
|
|
152
152
|
</sds-button>
|
|
153
153
|
`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-dialog.component.js","sourceRoot":"","sources":["../../src/sds-dialog/sds-dialog.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AA6B/E,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB,CAAC,UAAU,CAAC;IAA3E;;QAG6C,SAAI,GAAY,KAAK,CAAC;QACtB,UAAK,GAAY,KAAK,CAAC;QACxB,aAAQ,GAAa,cAAc,CAAC;QAClB,qBAAgB,GAAW,kBAAkB,CAAC;QAI1F,uBAAkB,GAAY,IAAI,CAAC;QAEpD,qCAAqC;QAC7B,uBAAkB,GAAG,KAAK,CAAC;QAiDlB,iBAAY,GAAG,GAAS,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACxC,CAAC,CAAC;QAEe,iBAAY,GAAG,CAAC,KAAiB,EAAQ,EAAE;YAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAwB,CAAC;YAE9C,IAAI,MAAM,EAAE,OAAO,CAAC,0CAA0C,CAAC,EAAE,CAAC;gBACjE,I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IAAI,CAAC;IAClB,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACnB,CAAC;IAEM,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAEQ,MAAM;QACd,OAAO,IAAI,CAAA;wBACW,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE;;uCAElE,IAAI,CAAC,uBAAuB;OAC5D,IAAI,CAAC,gBAAgB;YACtB,CAAC,CAAC,IAAI,CAAA;0HAC8G,IAAI,CAAC,gBAAgB;;;QAGvI;YACF,CAAC,CAAC,OAAO;;;;;GAKZ,CAAC;IACH,CAAC;;AAhLe,yBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAEU;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAuB;AACtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAwB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAqC;AAClB;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;4DAA+C;AAElF;IAAxB,KAAK,CAAC,QAAQ,CAAC;mDAAqC;AAEpC;IAAhB,KAAK,EAAE;8DAA4C","sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { styles } from './sds-dialog.styles';\nimport { SDSEventDispatcherMixin } from '../mixins/sds-event-dispatcher-mixin';\n\ntype ClosedBy = 'none' | 'closerequest' | 'any';\n\nexport interface SDSDialogProps {\n\topen?: boolean;\n\t/**\n\t * Set if dialog opens as a modal or not\n\t *\n\t * If non-modal, the user is allowed to interact with content outside of the dialog.\n\t * If modal, the dialog is placed in the top layer with a ::backdrop pseudo-element.\n\t *\n\t * Docs:\n\t * - https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/show\n\t * - https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal\n\t */\n\tmodal?: boolean;\n\t/**\n\t * Set what type of dismiss behavior closes the dialog\n\t * - 'none': Dialog can only be closed programmatically\n\t * - 'closerequest': Dialog closes on ESC key (default)\n\t * - 'any': Dialog closes on ESC key or clicking outside\n\t *\n\t * Docs: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\t */\n\tclosedby?: ClosedBy;\n\t'close-button-label'?: string;\n}\n\nexport class SDSDialogComponent extends SDSEventDispatcherMixin(LitElement) {\n\tstatic override styles = [styles];\n\n\t@property({ type: Boolean, reflect: true }) open: boolean = false;\n\t@property({ type: Boolean, reflect: true }) modal: boolean = false;\n\t@property({ type: String, reflect: true }) closedby: ClosedBy = 'closerequest';\n\t@property({ type: String, attribute: 'close-button-label' }) closeButtonLabel: string = 'Lukk dialogvindu';\n\n\t@query('dialog') private _dialog!: HTMLDialogElement;\n\n\t@state() private _isHeaderSlotEmpty: boolean = true;\n\n\t// Safari closedBy=any polyfill state\n\tprivate _pointerDownInside = false;\n\n\toverride firstUpdated(): void {\n\t\tthis._setupEventListeners();\n\t\tif (this.open) {\n\t\t\tthis._openDialog();\n\t\t}\n\t}\n\n\toverride updated(changedProperties: PropertyValues): void {\n\t\tif (!changedProperties.has('open')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis._openDialog();\n\t\t} else {\n\t\t\tthis._closeDialog();\n\t\t}\n\t}\n\n\tprivate _setupEventListeners(): void {\n\t\tthis._dialog.addEventListener('close', this._handleClose);\n\t\tthis._dialog.addEventListener('cancel', this._handleCancel);\n\t\tthis._dialog.addEventListener('click', this._handleClick);\n\t\tthis._dialog.addEventListener('pointerdown', this._handlePointerDown);\n\t\tthis._dialog.addEventListener('pointerup', this._handlePointerUp);\n\t\tthis._dialog.addEventListener('animationend', this._handleAutoFocus);\n\t}\n\n\tprivate _openDialog(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.modal) {\n\t\t\tthis._dialog.showModal();\n\t\t} else {\n\t\t\tthis._dialog.show();\n\t\t}\n\t}\n\n\tprivate _closeDialog(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\t\tthis._dialog.close();\n\t}\n\n\tprivate readonly _handleClose = (): void => {\n\t\tthis.open = false;\n\t\tthis.dispatchSheriffEvent('sds-close');\n\t};\n\n\tprivate readonly _handleClick = (event: MouseEvent): void => {\n\t\tconst target = event.target as Element | null;\n\n\t\tif (target?.closest('[data-command=\"close\"],[command=\"close\"]')) {\n\t\t\tthis._closeDialog();\n\t\t}\n\t};\n\n\t// Safari closedBy=\"any\" polyfill\n\t// Calculate whether the user's pointer down event is outside or inside dialog\n\t// If outside, close the dialog\n\tprivate readonly _handlePointerDown = (event: PointerEvent): void => {\n\t\tconst rect = this._dialog.getBoundingClientRect();\n\t\tconst { clientX: x, clientY: y } = event;\n\t\tthis._pointerDownInside = rect.top <= y && y <= rect.bottom && rect.left <= x && x <= rect.right;\n\t};\n\n\tprivate readonly _handlePointerUp = (event: PointerEvent): void => {\n\t\tconst wasDownInside = this._pointerDownInside;\n\t\tthis._pointerDownInside = false;\n\n\t\tif (this.closedby !== 'any' || wasDownInside) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clicking the backdrop will have the dialog as the target in Safari/Chrome.\n\t\t// Firefox does not fire this callback when ::backdrop is clicked.\n\t\tif (event.target !== this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Use requestAnimationFrame to let the browser handle native closedBy first.\n\t\t// This avoids checking for the closedBy property, which Safari 26.2 exposes\n\t\t// without implementing.\n\t\trequestAnimationFrame(() => {\n\t\t\tif (this._dialog && this._dialog.open) {\n\t\t\t\tthis._closeDialog();\n\t\t\t}\n\t\t});\n\t};\n\n\tprivate readonly _handleCancel = (event: Event): void => {\n\t\tif (this.closedby === 'none') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tprivate readonly _handleHeaderSlotChange = (event: Event): void => {\n\t\tconst slot = event.target as HTMLSlotElement;\n\t\tthis._isHeaderSlotEmpty = slot.assignedElements().length === 0;\n\t};\n\n\tprivate readonly _handleAutoFocus = (): void => {\n\t\t// slot:not([name]) finds the default nameless slot\n\t\tconst contentSlotElements = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])')?.assignedElements({ flatten: true });\n\t\tif (!contentSlotElements || contentSlotElements.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementToFocus = contentSlotElements.find((element) => {\n\t\t\treturn element.getAttribute('autofocus') != null;\n\t\t});\n\n\t\tif (!(elementToFocus instanceof HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (document.activeElement !== elementToFocus) {\n\t\t\telementToFocus.focus();\n\t\t}\n\t};\n\n\tpublic show(): void {\n\t\tthis.open = true;\n\t}\n\n\tpublic showModal(): void {\n\t\tthis.modal = true;\n\t\tthis.open = true;\n\t}\n\n\tpublic close(): void {\n\t\tthis.open = false;\n\t}\n\n\tpublic requestClose(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._dialog.requestClose();\n\t}\n\n\toverride render() {\n\t\treturn html`\n\t\t\t<dialog .closedBy=\"${this.closedby}\" class=${this._isHeaderSlotEmpty ? 'sds-dialog__empty-header' : ''}>\n\t\t\t\t<div class=\"sds-dialog__header\">\n\t\t\t\t\t<slot name=\"header\" @slotchange=${this._handleHeaderSlotChange}></slot>\n\t\t\t\t\t${this.closeButtonLabel\n\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t<sds-button class=\"sds-dialog__close-button\" icon variant=\"tertiary\" size=\"md\" data-command=\"close\" aria-label=\"${this.closeButtonLabel}\">\n\t\t\t\t\t\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"md\"></sds-icon>\n\t\t\t\t\t\t\t\t</sds-button>\n\t\t\t\t\t\t\t`\n\t\t\t\t\t\t: nothing}\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t</dialog>\n\t\t`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sds-dialog.component.js","sourceRoot":"","sources":["../../src/sds-dialog/sds-dialog.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AA6B/E,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB,CAAC,UAAU,CAAC;IAA3E;;QAG6C,SAAI,GAAY,KAAK,CAAC;QACtB,UAAK,GAAY,KAAK,CAAC;QACxB,aAAQ,GAAa,cAAc,CAAC;QAClB,qBAAgB,GAAW,kBAAkB,CAAC;QAI1F,uBAAkB,GAAY,IAAI,CAAC;QAEpD,qCAAqC;QAC7B,uBAAkB,GAAG,KAAK,CAAC;QAiDlB,iBAAY,GAAG,GAAS,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;YAClB,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACxC,CAAC,CAAC;QAEe,iBAAY,GAAG,CAAC,KAAiB,EAAQ,EAAE;YAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAwB,CAAC;YAE9C,IAAI,MAAM,EA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K,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAEM,KAAK;QACX,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;IACnB,CAAC;IAEM,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAEQ,MAAM;QACd,OAAO,IAAI,CAAA;wBACW,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE;;uCAElE,IAAI,CAAC,uBAAuB;OAC5D,IAAI,CAAC,gBAAgB;YACtB,CAAC,CAAC,IAAI,CAAA;qHACyG,IAAI,CAAC,gBAAgB;;;QAGlI;YACF,CAAC,CAAC,OAAO;;;;;GAKZ,CAAC;IACH,CAAC;;AAhLe,yBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAEU;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAuB;AACtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAwB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAqC;AAClB;IAA5D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;4DAA+C;AAElF;IAAxB,KAAK,CAAC,QAAQ,CAAC;mDAAqC;AAEpC;IAAhB,KAAK,EAAE;8DAA4C","sourcesContent":["import { LitElement, html, nothing, type PropertyValues } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport { styles } from './sds-dialog.styles';\nimport { SDSEventDispatcherMixin } from '../mixins/sds-event-dispatcher-mixin';\n\ntype ClosedBy = 'none' | 'closerequest' | 'any';\n\nexport interface SDSDialogProps {\n\topen?: boolean;\n\t/**\n\t * Set if dialog opens as a modal or not\n\t *\n\t * If non-modal, the user is allowed to interact with content outside of the dialog.\n\t * If modal, the dialog is placed in the top layer with a ::backdrop pseudo-element.\n\t *\n\t * Docs:\n\t * - https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/show\n\t * - https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal\n\t */\n\tmodal?: boolean;\n\t/**\n\t * Set what type of dismiss behavior closes the dialog\n\t * - 'none': Dialog can only be closed programmatically\n\t * - 'closerequest': Dialog closes on ESC key (default)\n\t * - 'any': Dialog closes on ESC key or clicking outside\n\t *\n\t * Docs: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\t */\n\tclosedby?: ClosedBy;\n\t'close-button-label'?: string;\n}\n\nexport class SDSDialogComponent extends SDSEventDispatcherMixin(LitElement) {\n\tstatic override styles = [styles];\n\n\t@property({ type: Boolean, reflect: true }) open: boolean = false;\n\t@property({ type: Boolean, reflect: true }) modal: boolean = false;\n\t@property({ type: String, reflect: true }) closedby: ClosedBy = 'closerequest';\n\t@property({ type: String, attribute: 'close-button-label' }) closeButtonLabel: string = 'Lukk dialogvindu';\n\n\t@query('dialog') private _dialog!: HTMLDialogElement;\n\n\t@state() private _isHeaderSlotEmpty: boolean = true;\n\n\t// Safari closedBy=any polyfill state\n\tprivate _pointerDownInside = false;\n\n\toverride firstUpdated(): void {\n\t\tthis._setupEventListeners();\n\t\tif (this.open) {\n\t\t\tthis._openDialog();\n\t\t}\n\t}\n\n\toverride updated(changedProperties: PropertyValues): void {\n\t\tif (!changedProperties.has('open')) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.open) {\n\t\t\tthis._openDialog();\n\t\t} else {\n\t\t\tthis._closeDialog();\n\t\t}\n\t}\n\n\tprivate _setupEventListeners(): void {\n\t\tthis._dialog.addEventListener('close', this._handleClose);\n\t\tthis._dialog.addEventListener('cancel', this._handleCancel);\n\t\tthis._dialog.addEventListener('click', this._handleClick);\n\t\tthis._dialog.addEventListener('pointerdown', this._handlePointerDown);\n\t\tthis._dialog.addEventListener('pointerup', this._handlePointerUp);\n\t\tthis._dialog.addEventListener('animationend', this._handleAutoFocus);\n\t}\n\n\tprivate _openDialog(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.modal) {\n\t\t\tthis._dialog.showModal();\n\t\t} else {\n\t\t\tthis._dialog.show();\n\t\t}\n\t}\n\n\tprivate _closeDialog(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\t\tthis._dialog.close();\n\t}\n\n\tprivate readonly _handleClose = (): void => {\n\t\tthis.open = false;\n\t\tthis.dispatchSheriffEvent('sds-close');\n\t};\n\n\tprivate readonly _handleClick = (event: MouseEvent): void => {\n\t\tconst target = event.target as Element | null;\n\n\t\tif (target?.closest('[data-command=\"close\"],[command=\"close\"]')) {\n\t\t\tthis._closeDialog();\n\t\t}\n\t};\n\n\t// Safari closedBy=\"any\" polyfill\n\t// Calculate whether the user's pointer down event is outside or inside dialog\n\t// If outside, close the dialog\n\tprivate readonly _handlePointerDown = (event: PointerEvent): void => {\n\t\tconst rect = this._dialog.getBoundingClientRect();\n\t\tconst { clientX: x, clientY: y } = event;\n\t\tthis._pointerDownInside = rect.top <= y && y <= rect.bottom && rect.left <= x && x <= rect.right;\n\t};\n\n\tprivate readonly _handlePointerUp = (event: PointerEvent): void => {\n\t\tconst wasDownInside = this._pointerDownInside;\n\t\tthis._pointerDownInside = false;\n\n\t\tif (this.closedby !== 'any' || wasDownInside) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clicking the backdrop will have the dialog as the target in Safari/Chrome.\n\t\t// Firefox does not fire this callback when ::backdrop is clicked.\n\t\tif (event.target !== this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Use requestAnimationFrame to let the browser handle native closedBy first.\n\t\t// This avoids checking for the closedBy property, which Safari 26.2 exposes\n\t\t// without implementing.\n\t\trequestAnimationFrame(() => {\n\t\t\tif (this._dialog && this._dialog.open) {\n\t\t\t\tthis._closeDialog();\n\t\t\t}\n\t\t});\n\t};\n\n\tprivate readonly _handleCancel = (event: Event): void => {\n\t\tif (this.closedby === 'none') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tprivate readonly _handleHeaderSlotChange = (event: Event): void => {\n\t\tconst slot = event.target as HTMLSlotElement;\n\t\tthis._isHeaderSlotEmpty = slot.assignedElements().length === 0;\n\t};\n\n\tprivate readonly _handleAutoFocus = (): void => {\n\t\t// slot:not([name]) finds the default nameless slot\n\t\tconst contentSlotElements = this.shadowRoot?.querySelector<HTMLSlotElement>('slot:not([name])')?.assignedElements({ flatten: true });\n\t\tif (!contentSlotElements || contentSlotElements.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst elementToFocus = contentSlotElements.find((element) => {\n\t\t\treturn element.getAttribute('autofocus') != null;\n\t\t});\n\n\t\tif (!(elementToFocus instanceof HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (document.activeElement !== elementToFocus) {\n\t\t\telementToFocus.focus();\n\t\t}\n\t};\n\n\tpublic show(): void {\n\t\tthis.open = true;\n\t}\n\n\tpublic showModal(): void {\n\t\tthis.modal = true;\n\t\tthis.open = true;\n\t}\n\n\tpublic close(): void {\n\t\tthis.open = false;\n\t}\n\n\tpublic requestClose(): void {\n\t\tif (!this._dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._dialog.requestClose();\n\t}\n\n\toverride render() {\n\t\treturn html`\n\t\t\t<dialog .closedBy=\"${this.closedby}\" class=${this._isHeaderSlotEmpty ? 'sds-dialog__empty-header' : ''}>\n\t\t\t\t<div class=\"sds-dialog__header\">\n\t\t\t\t\t<slot name=\"header\" @slotchange=${this._handleHeaderSlotChange}></slot>\n\t\t\t\t\t${this.closeButtonLabel\n\t\t\t\t\t\t? html`\n\t\t\t\t\t\t\t\t<sds-button class=\"sds-dialog__close-button\" icon variant=\"tertiary\" size=\"md\" data-command=\"close\" label=\"${this.closeButtonLabel}\">\n\t\t\t\t\t\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"md\"></sds-icon>\n\t\t\t\t\t\t\t\t</sds-button>\n\t\t\t\t\t\t\t`\n\t\t\t\t\t\t: nothing}\n\t\t\t\t</div>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t</dialog>\n\t\t`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-heading.styles.d.ts","sourceRoot":"","sources":["../../src/sds-heading/sds-heading.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"sds-heading.styles.d.ts","sourceRoot":"","sources":["../../src/sds-heading/sds-heading.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA+JlB,CAAC"}
|
|
@@ -7,12 +7,15 @@ export const styles = css `
|
|
|
7
7
|
--_sds-heading-margin: var(--sds-heading-margin, 0);
|
|
8
8
|
--_sds-heading-padding: var(--sds-heading-padding, 0);
|
|
9
9
|
--_sds-heading-text-align: var(--sds-heading-text-align, left);
|
|
10
|
+
--_sds-heading-text-decoration: var(--sds-heading-text-decoration, inherit);
|
|
11
|
+
--_sds-heading-text-decoration-thickness: var(--sds-heading-text-decoration-thickness, var(--sds-typography-link-text-decoration-thickness));
|
|
12
|
+
--_sds-heading-text-underline-offset: var(--sds-heading-text-underline-offset, var(--sds-typography-link-text-underline-offset));
|
|
10
13
|
|
|
11
14
|
--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xl-mobile-font-size));
|
|
12
15
|
--_sds-heading-font-weight: var(--sds-heading-font-weight, var(--sds-typography-font-weight-bold));
|
|
13
16
|
--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xl-mobile-line-height));
|
|
14
17
|
|
|
15
|
-
display:
|
|
18
|
+
display: block;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
:host([data-palette]) {
|
|
@@ -27,7 +30,7 @@ export const styles = css `
|
|
|
27
30
|
h6,
|
|
28
31
|
.sds-heading {
|
|
29
32
|
color: var(--_sds-heading-text-color);
|
|
30
|
-
display:
|
|
33
|
+
display: inherit;
|
|
31
34
|
font-family: var(--_sds-heading-font-family);
|
|
32
35
|
font-size: var(--_sds-heading-font-size);
|
|
33
36
|
font-weight: var(--_sds-heading-font-weight);
|
|
@@ -36,6 +39,9 @@ export const styles = css `
|
|
|
36
39
|
max-width: var(--_sds-heading-max-line-width);
|
|
37
40
|
padding: var(--_sds-heading-padding);
|
|
38
41
|
text-align: var(--_sds-heading-text-align);
|
|
42
|
+
text-decoration: var(--_sds-heading-text-decoration);
|
|
43
|
+
text-decoration-thickness: var(--_sds-heading-text-decoration-thickness);
|
|
44
|
+
text-underline-offset: var(--_sds-heading-text-underline-offset);
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
h1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-heading.styles.js","sourceRoot":"","sources":["../../src/sds-heading/sds-heading.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"sds-heading.styles.js","sourceRoot":"","sources":["../../src/sds-heading/sds-heading.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+JxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-heading-font-family: var(--sds-heading-font-family, var(--sds-typography-font-family-roboto));\n\t\t--_sds-heading-text-color: var(--sds-heading-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));\n\t\t--_sds-heading-max-line-width: var(--sds-heading-max-line-width, var(--sds-typography-max-line-width));\n\t\t--_sds-heading-margin: var(--sds-heading-margin, 0);\n\t\t--_sds-heading-padding: var(--sds-heading-padding, 0);\n\t\t--_sds-heading-text-align: var(--sds-heading-text-align, left);\n\t\t--_sds-heading-text-decoration: var(--sds-heading-text-decoration, inherit);\n\t\t--_sds-heading-text-decoration-thickness: var(--sds-heading-text-decoration-thickness, var(--sds-typography-link-text-decoration-thickness));\n\t\t--_sds-heading-text-underline-offset: var(--sds-heading-text-underline-offset, var(--sds-typography-link-text-underline-offset));\n\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xl-mobile-font-size));\n\t\t--_sds-heading-font-weight: var(--sds-heading-font-weight, var(--sds-typography-font-weight-bold));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xl-mobile-line-height));\n\n\t\tdisplay: block;\n\t}\n\n\t:host([data-palette]) {\n\t\t--_sds-heading-text-color: var(--sds-heading-text-color, var(--sds-color-text-default, var(--sds-color-neutral-text-default)));\n\t}\n\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\t.sds-heading {\n\t\tcolor: var(--_sds-heading-text-color);\n\t\tdisplay: inherit;\n\t\tfont-family: var(--_sds-heading-font-family);\n\t\tfont-size: var(--_sds-heading-font-size);\n\t\tfont-weight: var(--_sds-heading-font-weight);\n\t\tline-height: var(--_sds-heading-line-height);\n\t\tmargin: var(--_sds-heading-margin);\n\t\tmax-width: var(--_sds-heading-max-line-width);\n\t\tpadding: var(--_sds-heading-padding);\n\t\ttext-align: var(--_sds-heading-text-align);\n\t\ttext-decoration: var(--_sds-heading-text-decoration);\n\t\ttext-decoration-thickness: var(--_sds-heading-text-decoration-thickness);\n\t\ttext-underline-offset: var(--_sds-heading-text-underline-offset);\n\t}\n\n\th1,\n\t.sds-heading--xl {\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xl-mobile-font-size));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xl-mobile-line-height));\n\t}\n\n\t@media (min-width: 640px) {\n\t\th1,\n\t\t.sds-heading--xl {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xl-tablet-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xl-tablet-line-height));\n\t\t}\n\t}\n\n\t@media (min-width: 1024px) {\n\t\th1,\n\t\t.sds-heading--xl {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xl-desktop-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xl-desktop-line-height));\n\t\t}\n\t}\n\n\th2,\n\t.sds-heading--lg {\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-lg-mobile-font-size));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-lg-mobile-line-height));\n\t}\n\n\t@media (min-width: 640px) {\n\t\th2,\n\t\t.sds-heading--lg {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-lg-tablet-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-lg-tablet-line-height));\n\t\t}\n\t}\n\n\t@media (min-width: 1024px) {\n\t\th2,\n\t\t.sds-heading--lg {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-lg-desktop-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-lg-desktop-line-height));\n\t\t}\n\t}\n\n\th3,\n\t.sds-heading--md {\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-md-mobile-font-size));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-md-mobile-line-height));\n\t}\n\n\t@media (min-width: 640px) {\n\t\th3,\n\t\t.sds-heading--md {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-md-tablet-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-md-tablet-line-height));\n\t\t}\n\t}\n\n\t@media (min-width: 1024px) {\n\t\th3,\n\t\t.sds-heading--md {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-md-desktop-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-md-desktop-line-height));\n\t\t}\n\t}\n\n\th4,\n\t.sds-heading--sm {\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-sm-mobile-font-size));\n\t\t--_sds-heading-font-weight: var(--sds-heading-font-weight, var(--sds-typography-font-weight-semibold));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-sm-mobile-line-height));\n\t}\n\n\t@media (min-width: 640px) {\n\t\th4,\n\t\t.sds-heading--sm {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-sm-tablet-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-sm-tablet-line-height));\n\t\t}\n\t}\n\n\t@media (min-width: 1024px) {\n\t\th4,\n\t\t.sds-heading--sm {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-sm-desktop-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-sm-desktop-line-height));\n\t\t}\n\t}\n\n\th5,\n\th6,\n\t.sds-heading--xs {\n\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xs-mobile-font-size));\n\t\t--_sds-heading-font-weight: var(--sds-heading-font-weight, var(--sds-typography-font-weight-semibold));\n\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xs-mobile-line-height));\n\t}\n\n\t@media (min-width: 640px) {\n\t\th5,\n\t\th6,\n\t\t.sds-heading--xs {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xs-tablet-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xs-tablet-line-height));\n\t\t}\n\t}\n\n\t@media (min-width: 1024px) {\n\t\th5,\n\t\th6,\n\t\t.sds-heading--xs {\n\t\t\t--_sds-heading-font-size: var(--sds-heading-font-size, var(--sds-typography-heading-xs-desktop-font-size));\n\t\t\t--_sds-heading-line-height: var(--sds-heading-line-height, var(--sds-typography-heading-xs-desktop-line-height));\n\t\t}\n\t}\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-process-step.styles.d.ts","sourceRoot":"","sources":["../../src/sds-process-step/sds-process-step.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"sds-process-step.styles.d.ts","sourceRoot":"","sources":["../../src/sds-process-step/sds-process-step.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAgJlB,CAAC"}
|
|
@@ -20,6 +20,8 @@ export const styles = css `
|
|
|
20
20
|
|
|
21
21
|
--_sds-process-step-line-display: var(--sds-process-step-line-display, block);
|
|
22
22
|
--_sds-process-step-line-min-height: var(--sds-process-step-line-min-height, 2rem);
|
|
23
|
+
--_sds-process-step-line-width: var(--sds-process-step-line-width, 1px);
|
|
24
|
+
--_sds-process-step-line-color: var(--sds-process-step-line-color, var(--sds-color-neutral-border-subtle));
|
|
23
25
|
|
|
24
26
|
--_sds-process-step-heading-color: var(--sds-process-step-heading-color, var(--sds-color-neutral-text-default));
|
|
25
27
|
--_sds-process-step-heading-font-weight: var(--sds-process-step-heading-font-weight, var(--sds-typography-body-sm-strong-desktop-font-weight));
|
|
@@ -84,6 +86,7 @@ export const styles = css `
|
|
|
84
86
|
place-items: center;
|
|
85
87
|
line-height: 1;
|
|
86
88
|
display: inline-grid;
|
|
89
|
+
z-index: 2;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
.sds-process-step__content {
|
|
@@ -92,14 +95,15 @@ export const styles = css `
|
|
|
92
95
|
|
|
93
96
|
.sds-process-step__line {
|
|
94
97
|
display: var(--_sds-process-step-line-display);
|
|
95
|
-
|
|
98
|
+
background-color: var(--_sds-process-step-line-color);
|
|
96
99
|
grid-column: 1;
|
|
97
100
|
justify-self: center;
|
|
98
|
-
width:
|
|
101
|
+
width: var(--_sds-process-step-line-width);
|
|
99
102
|
min-height: var(--_sds-process-step-line-min-height);
|
|
100
103
|
grid-row: line-2;
|
|
101
104
|
position: relative;
|
|
102
105
|
top: var(--_sds-process-step-border-width);
|
|
106
|
+
z-index: 1;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
.sds-process-step__heading {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-process-step.styles.js","sourceRoot":"","sources":["../../src/sds-process-step/sds-process-step.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"sds-process-step.styles.js","sourceRoot":"","sources":["../../src/sds-process-step/sds-process-step.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgJxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-process-step-border-width: var(--sds-process-step-border-width, 2px);\n\t\t--_sds-process-step-border-color: var(--sds-process-step-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-process-step-marker-sm: var(--sds-process-step-marker-sm, 1rem);\n\t\t--_sds-process-step-marker-lg: var(--sds-process-step-marker-lg, 2rem);\n\t\t--_sds-process-step-marker-size: var(--_sds-process-step-marker-lg);\n\t\t--_sds-process-step-marker-base: var(--sds-process-step-marker-base, 2rem);\n\t\t--_sds-process-step-marker-text-color: var(--sds-process-step-marker-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-process-step-marker-background: var(--sds-process-step-marker-background, var(--sds-color-action-contrast-subtle, var(--sds-color-main-action-contrast-subtle)));\n\t\t--_sds-process-step-marker-margin-block-start: var(--sds-process-step-marker-margin-block-start, calc((var(--_sds-process-step-marker-lg) - var(--_sds-process-step-marker-sm)) / 2));\n\t\t--_sds-process-step-marker-border-radius: var(--sds-process-step-marker-border-radius, var(--sds-radius-full));\n\t\t--_sds-process-step-grid-template-rows: var(--sds-process-step-grid-template-rows, [line-1] auto [step-start] var(--_sds-process-step-marker-size) [line-2 step-end] auto);\n\t\t--_sds-process-step-grid-template-columns: var(--sds-process-step-grid-template-columns, var(--_sds-process-step-marker-base) auto);\n\t\t--_sds-process-step-sub-step-margin-block-start: var(--sds-process-step-sub-step-margin-block-start, calc((var(--_sds-process-step-marker-sm) / 2) * -1));\n\n\t\t--_sds-process-step-item-grid-template-columns: var(--sds-process-step-item-grid-template-columns, [marker] var(--_sds-process-step-marker-base) [content] auto);\n\t\t--_sds-process-step-item-grid-area: var(--sds-process-step-item-grid-area, 2 / 1 / -1 / -1);\n\n\t\t--_sds-process-step-line-display: var(--sds-process-step-line-display, block);\n\t\t--_sds-process-step-line-min-height: var(--sds-process-step-line-min-height, 2rem);\n\t\t--_sds-process-step-line-width: var(--sds-process-step-line-width, 1px);\n\t\t--_sds-process-step-line-color: var(--sds-process-step-line-color, var(--sds-color-neutral-border-subtle));\n\n\t\t--_sds-process-step-heading-color: var(--sds-process-step-heading-color, var(--sds-color-neutral-text-default));\n\t\t--_sds-process-step-heading-font-weight: var(--sds-process-step-heading-font-weight, var(--sds-typography-body-sm-strong-desktop-font-weight));\n\t\t--_sds-process-step-heading-font-size: var(--sds-process-step-heading-font-size, var(--sds-typography-body-md-desktop-font-size));\n\t\t--_sds-process-step-heading-line-height: var(--sds-process-step-heading-line-height, var(--sds-typography-body-md-strong-desktop-line-height));\n\t\t--_sds-process-step-heading-padding-block: var(--sds-process-step-heading-padding-block, var(--sds-spacing-3xs));\n\t\t--_sds-process-step-heading-margin-block: var(--sds-process-step-heading-margin-block, 0);\n\n\t\t--_sds-process-step-timestamp-color: var(--sds-process-step-timestamp-color, var(--sds-color-neutral-text-subtle));\n\t\t--_sds-process-step-timestamp-font-weight: var(--sds-process-step-timestamp-font-weight, var(--sds-typography-body-sm-desktop-font-weight));\n\t\t--_sds-process-step-timestamp-font-size: var(--sds-process-step-timestamp-font-size, var(--sds-typography-body-sm-desktop-font-size));\n\t\t--_sds-process-step-timestamp-line-height: var(--sds-process-step-timestamp-line-height, var(--sds-typography-body-sm-desktop-line-height));\n\t\t--_sds-process-step-timestamp-padding-block-start: var(--sds-process-step-timestamp-padding-block-start, var(--sds-spacing-zero));\n\t\t--_sds-process-step-timestamp-padding-block-end: var(--sds-process-step-timestamp-padding-block-end, var(--sds-spacing-3xs));\n\n\t\t--_sds-process-step-slot-content-padding-block: var(--sds-process-step-slot-content-padding-block, var(--sds-spacing-zero));\n\n\t\t--sds-icon-color: var(--_sds-process-step-marker-text-color);\n\t}\n\n\t.sds-process-step {\n\t\tdisplay: grid;\n\t\tfont-family: var(--sds-typography-font-family);\n\t\tgrid-template-rows: var(--_sds-process-step-grid-template-rows);\n\t\tgrid-template-columns: var(--_sds-process-step-grid-template-columns);\n\t\tjustify-items: flex-start;\n\t}\n\n\t.sds-process-step--sub-step {\n\t\t--_sds-process-step-marker-background: var(--sds-process-step-marker-background, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-process-step-marker-size: var(--_sds-process-step-marker-sm);\n\t\t--_sds-process-step-grid-template-rows: var(--sds-process-step-grid-template-rows, [line-1] auto [step-start] var(--_sds-process-step-marker-size) [line-2 step-end] auto);\n\t\tmargin-block-start: var(--_sds-process-step-sub-step-margin-block-start);\n\n\t\t.sds-process-step__marker {\n\t\t\tmargin-block-start: var(--_sds-process-step-marker-margin-block-start);\n\t\t}\n\t}\n\n\t.sds-process-step__item {\n\t\tgrid-area: var(--_sds-process-step-item-grid-area);\n\t\tgrid-template-columns: var(--_sds-process-step-item-grid-template-columns);\n\t\tgap: var(--sds-spacing-xs);\n\t\tpadding: var(--_sds-process-step-border-width);\n\t\tmargin: calc(var(--_sds-process-step-border-width) * -1) calc(var(--_sds-process-step-border-width) * -1) var(--sds-spacing-sm);\n\t\tjustify-content: flex-start;\n\t\twidth: 100%;\n\t\tdisplay: grid;\n\t}\n\n\t.sds-process-step__marker {\n\t\twidth: var(--_sds-process-step-marker-size);\n\t\theight: var(--_sds-process-step-marker-size);\n\t\tborder-radius: var(--_sds-process-step-marker-border-radius);\n\t\tborder: var(--_sds-process-step-border-width) solid;\n\t\tcolor: var(--_sds-process-step-marker-text-color);\n\t\tbackground-color: var(--_sds-process-step-marker-background);\n\t\tborder-color: var(--_sds-process-step-border-color);\n\t\tfont-weight: var(--sds-typography-body-sm-strong-desktop-font-weight);\n\t\tgrid-column: marker;\n\t\tplace-self: baseline center;\n\t\tplace-items: center;\n\t\tline-height: 1;\n\t\tdisplay: inline-grid;\n\t\tz-index: 2;\n\t}\n\n\t.sds-process-step__content {\n\t\tgrid-column: content;\n\t}\n\n\t.sds-process-step__line {\n\t\tdisplay: var(--_sds-process-step-line-display);\n\t\tbackground-color: var(--_sds-process-step-line-color);\n\t\tgrid-column: 1;\n\t\tjustify-self: center;\n\t\twidth: var(--_sds-process-step-line-width);\n\t\tmin-height: var(--_sds-process-step-line-min-height);\n\t\tgrid-row: line-2;\n\t\tposition: relative;\n\t\ttop: var(--_sds-process-step-border-width);\n\t\tz-index: 1;\n\t}\n\n\t.sds-process-step__heading {\n\t\tcolor: var(--_sds-process-step-heading-color);\n\t\tfont-weight: var(--_sds-process-step-heading-font-weight);\n\t\tfont-size: var(--_sds-process-step-heading-font-size);\n\t\tline-height: var(--_sds-process-step-heading-line-height);\n\t\tpadding-block: var(--_sds-process-step-heading-padding-block);\n\t\tmargin-block: var(--_sds-process-step-heading-margin-block);\n\t}\n\n\t.sds-process-step__timestamp {\n\t\tcolor: var(--_sds-process-step-timestamp-color);\n\t\tfont-weight: var(--_sds-process-step-timestamp-font-weight);\n\t\tfont-size: var(--_sds-process-step-timestamp-font-size);\n\t\tline-height: var(--_sds-process-step-timestamp-line-height);\n\t\tpadding-block-start: var(--_sds-process-step-timestamp-padding-block-start);\n\t\tpadding-block-end: var(--_sds-process-step-timestamp-padding-block-end);\n\n\t\t&:first-child {\n\t\t\t--_sds-process-step-timestamp-padding-block-start: var(--sds-process-step-timestamp-padding-block-start, var(--sds-spacing-3xs));\n\t\t}\n\n\t\t&:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t.sds-process-step__slot-content {\n\t\tpadding-block: var(--_sds-process-step-slot-content-padding-block);\n\n\t\t&:first-child {\n\t\t\t--_sds-process-step-slot-content-padding-block: var(--sds-process-step-slot-content-padding-block, var(--sds-spacing-3xs));\n\t\t}\n\t}\n\n\t:host(:last-of-type) {\n\t\t--_sds-process-step-line-display: none;\n\t}\n`;\n"]}
|