@politiet/sheriff-web-components 2.7.2 → 2.9.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 +422 -9
- package/dist/mixins/sds-dialog-target-mixin.d.ts.map +1 -1
- package/dist/mixins/sds-dialog-target-mixin.js +4 -2
- package/dist/mixins/sds-dialog-target-mixin.js.map +1 -1
- package/dist/mixins/sds-event-dispatcher-mixin.js +1 -1
- package/dist/mixins/sds-event-dispatcher-mixin.js.map +1 -1
- package/dist/mixins/sds-form-control-mixin.d.ts +1 -0
- package/dist/mixins/sds-form-control-mixin.d.ts.map +1 -1
- package/dist/mixins/sds-form-control-mixin.js +7 -0
- package/dist/mixins/sds-form-control-mixin.js.map +1 -1
- package/dist/react-wrappers/SDSDialogWrapper.d.ts.map +1 -1
- package/dist/react-wrappers/SDSDialogWrapper.js +1 -1
- package/dist/react-wrappers/SDSDialogWrapper.js.map +1 -1
- package/dist/sds-button/sds-button.component.d.ts +7 -0
- package/dist/sds-button/sds-button.component.d.ts.map +1 -1
- package/dist/sds-button/sds-button.component.js +52 -50
- package/dist/sds-button/sds-button.component.js.map +1 -1
- package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
- package/dist/sds-button/sds-button.styles.js +87 -3
- package/dist/sds-button/sds-button.styles.js.map +1 -1
- package/dist/sds-card/sds-card.d.ts +1 -0
- package/dist/sds-card/sds-card.d.ts.map +1 -1
- package/dist/sds-card/sds-card.js +11 -3
- 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 +14 -3
- package/dist/sds-card/sds-card.styles.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts +3 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.js +13 -3
- package/dist/sds-checkbox/sds-checkbox.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.styles.js +4 -2
- package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -1
- package/dist/sds-chip/sds-chip.d.ts +1 -0
- package/dist/sds-chip/sds-chip.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.js +3 -0
- package/dist/sds-chip/sds-chip.js.map +1 -1
- package/dist/sds-details/sds-details.styles.js +6 -6
- package/dist/sds-details/sds-details.styles.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.component.d.ts +1 -0
- package/dist/sds-dialog/sds-dialog.component.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.component.js +10 -0
- package/dist/sds-dialog/sds-dialog.component.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.d.ts +1 -0
- package/dist/sds-dialog/sds-dialog.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.styles.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.styles.js +8 -2
- package/dist/sds-dialog/sds-dialog.styles.js.map +1 -1
- package/dist/sds-popover/assets/popover-styles.d.ts.map +1 -1
- package/dist/sds-popover/assets/popover-styles.js +1 -1
- package/dist/sds-popover/assets/popover-styles.js.map +1 -1
- package/dist/sds-radio/sds-radio.d.ts +3 -1
- package/dist/sds-radio/sds-radio.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.js +13 -3
- package/dist/sds-radio/sds-radio.js.map +1 -1
- package/dist/sds-radio/sds-radio.styles.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.styles.js +10 -3
- package/dist/sds-radio/sds-radio.styles.js.map +1 -1
- package/dist/sds-select/sds-select.component.d.ts +3 -1
- package/dist/sds-select/sds-select.component.d.ts.map +1 -1
- package/dist/sds-select/sds-select.component.js +14 -5
- package/dist/sds-select/sds-select.component.js.map +1 -1
- package/dist/sds-select/sds-select.styles.d.ts.map +1 -1
- package/dist/sds-select/sds-select.styles.js +3 -2
- package/dist/sds-select/sds-select.styles.js.map +1 -1
- package/dist/sds-stepper-step/sds-stepper-step.styles.d.ts.map +1 -1
- package/dist/sds-stepper-step/sds-stepper-step.styles.js +4 -3
- package/dist/sds-stepper-step/sds-stepper-step.styles.js.map +1 -1
- package/dist/sds-switch/sds-switch.d.ts +4 -0
- package/dist/sds-switch/sds-switch.d.ts.map +1 -1
- package/dist/sds-switch/sds-switch.js +16 -2
- package/dist/sds-switch/sds-switch.js.map +1 -1
- package/dist/sds-switch/sds-switch.styles.js +6 -6
- package/dist/sds-switch/sds-switch.styles.js.map +1 -1
- package/dist/sds-text/sds-text.styles.d.ts.map +1 -1
- package/dist/sds-text/sds-text.styles.js +2 -1
- package/dist/sds-text/sds-text.styles.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.d.ts +4 -1
- package/dist/sds-textarea/sds-textarea.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.js +22 -8
- package/dist/sds-textarea/sds-textarea.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.js +12 -3
- package/dist/sds-textarea/sds-textarea.styles.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.d.ts +8 -1
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.js +40 -13
- package/dist/sds-textfield/sds-textfield.js.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -1
- package/dist/sds-textfield/sds-textfield.styles.js +4 -3
- package/dist/sds-textfield/sds-textfield.styles.js.map +1 -1
- package/dist/sds-tooltip/assets/tooltip-styles.d.ts.map +1 -1
- package/dist/sds-tooltip/assets/tooltip-styles.js +1 -1
- package/dist/sds-tooltip/assets/tooltip-styles.js.map +1 -1
- package/dist/shared/assets/positioning.js +1 -1
- package/dist/sheriff-web-components.js +409 -269
- package/dist/skill/references/components.md +1 -1
- package/dist/skill/references/react-wrappers.md +1 -1
- package/package.json +2 -2
- package/web-types.json +312 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-dialog-target-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-dialog-target-mixin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-dialog-target-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-dialog-target-mixin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAO7C,SAAS,WAAW,CAAC,IAAoB;IACxC,OAAO,IAAI,IAAI,IAAI,IAAI,WAAW,IAAI,IAAI,IAAI,cAAc,IAAI,IAAI,IAAI,OAAO,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,CAAC;AAC3G,CAAC;AAUD,MAAM,UAAU,oBAAoB,CAAsC,UAAa;IACtF,MAAM,eAAgB,SAAQ,UAAU;QASvC,IAAI,gBAAgB;YACnB,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC;QACzC,CAAC;QAED,IAAI,mBAAmB;YACtB,OAAO,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,cAAc,CAAC;QAC/C,CAAC;QAEQ,OAAO,CAAC,OAAuB;YACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAEvB,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC;gBACxH,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC7B,CAAC;QACF,CAAC;QAEQ,oBAAoB;YAC5B,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAC7B,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC/B,CAAC;QAEO,sB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gBACP,KAAK,eAAe;oBACnB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;oBACnC,MAAM;YACR,CAAC;QACF,CAAC;KACD;IA7GiE;QAAhE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAyB;IACrB;QAAnE,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAAqB;IACjC;QAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;wDAA6B;IACzB;QAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;2DAAyB;IA4GnF,OAAO,eAAe,CAAC;AACxB,CAAC","sourcesContent":["import { LitElement, PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Constructable } from './types';\n\nimport type { SDSDialog } from '../sds-dialog/sds-dialog';\n\ntype DialogCommand = 'close' | 'request-close' | 'show-modal';\n\nfunction isSDSDialog(node: Element | null): node is SDSDialog {\n\treturn node != null && 'showModal' in node && 'requestClose' in node && 'close' in node && 'open' in node;\n}\n\nexport interface SDSDialogTargetMixinInterface {\n\tcommand?: DialogCommand;\n\tcommandFor?: string;\n\treadonly effectiveCommand?: DialogCommand;\n\treadonly effectiveCommandFor?: string;\n\trunDialogCommand(): void;\n}\n\nexport function SDSDialogTargetMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSDialogTargetMixinInterface> & T {\n\tclass SDSDialogTarget extends superClass {\n\t\t@property({ type: String, attribute: 'command', reflect: true }) command?: DialogCommand;\n\t\t@property({ type: String, attribute: 'commandfor', reflect: true }) commandFor?: string;\n\t\t@property({ type: String, attribute: 'data-command' }) dataCommand?: DialogCommand;\n\t\t@property({ type: String, attribute: 'data-commandfor' }) dataCommandFor?: string;\n\n\t\tprivate _dialogElement?: SDSDialog;\n\t\tprivate _dialogOpenObserver?: MutationObserver;\n\n\t\tget effectiveCommand(): DialogCommand | undefined {\n\t\t\treturn this.command ?? this.dataCommand;\n\t\t}\n\n\t\tget effectiveCommandFor(): string | undefined {\n\t\t\treturn this.commandFor ?? this.dataCommandFor;\n\t\t}\n\n\t\toverride updated(changed: PropertyValues) {\n\t\t\tsuper.updated(changed);\n\n\t\t\tif (changed.has('command') || changed.has('commandFor') || changed.has('dataCommand') || changed.has('dataCommandFor')) {\n\t\t\t\tthis._updateCommandTarget();\n\t\t\t}\n\t\t}\n\n\t\toverride disconnectedCallback() {\n\t\t\tsuper.disconnectedCallback();\n\t\t\tthis._cleanupDialogObserver();\n\t\t}\n\n\t\tprivate _cleanupDialogObserver() {\n\t\t\tif (this._dialogOpenObserver) {\n\t\t\t\tthis._dialogOpenObserver.disconnect();\n\t\t\t\tthis._dialogOpenObserver = undefined;\n\t\t\t}\n\t\t\tthis._dialogElement = undefined;\n\t\t}\n\n\t\tprivate _observeDialog(button: HTMLButtonElement, dialog: SDSDialog) {\n\t\t\t// Observe the 'open' attribute to detect when the dialog opens\n\t\t\tthis._dialogOpenObserver = new MutationObserver((mutations) => {\n\t\t\t\tfor (const mutation of mutations) {\n\t\t\t\t\tif (mutation.attributeName === 'open') {\n\t\t\t\t\t\tconst isOpen = dialog.hasAttribute('open');\n\t\t\t\t\t\tbutton.setAttribute('aria-expanded', String(isOpen));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._dialogOpenObserver.observe(dialog, { attributes: true, attributeFilter: ['open'] });\n\t\t}\n\n\t\tprivate _clearAriaFields(button: HTMLButtonElement) {\n\t\t\tbutton.removeAttribute('aria-haspopup');\n\t\t\tbutton.removeAttribute('aria-expanded');\n\t\t\tbutton.removeAttribute('aria-controls');\n\t\t}\n\n\t\tprivate _updateCommandTarget() {\n\t\t\tthis._cleanupDialogObserver();\n\n\t\t\tconst internalButton = this.shadowRoot?.querySelector<HTMLButtonElement>('#control');\n\t\t\tif (!internalButton) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst command = this.effectiveCommand;\n\t\t\tconst commandFor = this.effectiveCommandFor;\n\n\t\t\tif (!commandFor || !command) {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\tconst targetDialog = root.getElementById?.(commandFor) ?? document.getElementById(commandFor);\n\n\t\t\tif (!isSDSDialog(targetDialog)) {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._dialogElement = targetDialog;\n\n\t\t\tif (command === 'show-modal') {\n\t\t\t\tinternalButton.setAttribute('aria-haspopup', 'dialog');\n\t\t\t\tinternalButton.setAttribute('aria-expanded', String(targetDialog.open));\n\t\t\t\tinternalButton.setAttribute('aria-controls', commandFor);\n\t\t\t\tthis._observeDialog(internalButton, targetDialog);\n\t\t\t} else {\n\t\t\t\tthis._clearAriaFields(internalButton);\n\t\t\t}\n\t\t}\n\n\t\trunDialogCommand(): void {\n\t\t\tif (!this._dialogElement) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tswitch (this.effectiveCommand) {\n\t\t\t\tcase 'show-modal':\n\t\t\t\t\tthis._dialogElement.showModal();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'close':\n\t\t\t\t\tthis._dialogElement.close();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'request-close':\n\t\t\t\t\tthis._dialogElement.requestClose();\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn SDSDialogTarget;\n}\n"]}
|
|
@@ -26,6 +26,7 @@ const NON_CANCELABLE_EVENTS = new Set([
|
|
|
26
26
|
'waiting',
|
|
27
27
|
'ratechange',
|
|
28
28
|
// Lifecycle/window events
|
|
29
|
+
'close',
|
|
29
30
|
'load',
|
|
30
31
|
'unload',
|
|
31
32
|
'abort',
|
|
@@ -35,7 +36,6 @@ const NON_CANCELABLE_EVENTS = new Set([
|
|
|
35
36
|
// Keyboard
|
|
36
37
|
'keyup',
|
|
37
38
|
// Misc
|
|
38
|
-
'reset',
|
|
39
39
|
'select',
|
|
40
40
|
]);
|
|
41
41
|
export function SDSEventDispatcherMixin(superClass) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-event-dispatcher-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-event-dispatcher-mixin.ts"],"names":[],"mappings":"AAGA,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACrC,eAAe;IACf,OAAO;IACP,MAAM;IACN,SAAS;IACT,UAAU;IACV,eAAe;IACf,OAAO;IACP,QAAQ;IACR,eAAe;IACf,MAAM;IACN,OAAO;IACP,OAAO;IACP,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,0BAA0B;IAC1B,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,OAAO;IACP,OAAO;IACP,
|
|
1
|
+
{"version":3,"file":"sds-event-dispatcher-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-event-dispatcher-mixin.ts"],"names":[],"mappings":"AAGA,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACrC,eAAe;IACf,OAAO;IACP,MAAM;IACN,SAAS;IACT,UAAU;IACV,eAAe;IACf,OAAO;IACP,QAAQ;IACR,eAAe;IACf,MAAM;IACN,OAAO;IACP,OAAO;IACP,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,SAAS;IACT,gBAAgB;IAChB,SA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from './types';\n\nconst NON_CANCELABLE_EVENTS = new Set([\n\t// Focus events\n\t'focus',\n\t'blur',\n\t'focusin',\n\t'focusout',\n\t// Input events\n\t'input',\n\t'change',\n\t// Media events\n\t'play',\n\t'pause',\n\t'ended',\n\t'volumechange',\n\t'timeupdate',\n\t'durationchange',\n\t'loadeddata',\n\t'loadedmetadata',\n\t'loadstart',\n\t'canplay',\n\t'canplaythrough',\n\t'playing',\n\t'seeked',\n\t'stalled',\n\t'suspend',\n\t'waiting',\n\t'ratechange',\n\t// Lifecycle/window events\n\t'close',\n\t'load',\n\t'unload',\n\t'abort',\n\t'error',\n\t'resize',\n\t'scroll',\n\t// Keyboard\n\t'keyup',\n\t// Misc\n\t'select',\n]);\n\nexport interface SDSEventDispatcherMixinInterface {\n\tdispatchSheriffEvent<TDetail = void>(type: string, detail?: TDetail, cancelable?: boolean): boolean;\n\tdispatchKeyboardEvent(type: string, originalEvent: KeyboardEvent): boolean;\n}\n\nexport function SDSEventDispatcherMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSEventDispatcherMixinInterface> & T {\n\treturn class SDSEventDispatcher extends superClass {\n\t\tdispatchSheriffEvent<TDetail = void>(type: string, detail?: TDetail, cancelable = !NON_CANCELABLE_EVENTS.has(type)): boolean {\n\t\t\treturn this.dispatchEvent(\n\t\t\t\tnew CustomEvent<TDetail>(type, {\n\t\t\t\t\tdetail,\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t\tcancelable,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\n\t\tdispatchKeyboardEvent(type: string, originalEvent: KeyboardEvent): boolean {\n\t\t\treturn this.dispatchEvent(\n\t\t\t\tnew KeyboardEvent(type, {\n\t\t\t\t\tkey: originalEvent.key,\n\t\t\t\t\tcode: originalEvent.code,\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcomposed: true,\n\t\t\t\t\tcancelable: !NON_CANCELABLE_EVENTS.has(type),\n\t\t\t\t\tctrlKey: originalEvent.ctrlKey,\n\t\t\t\t\tshiftKey: originalEvent.shiftKey,\n\t\t\t\t\taltKey: originalEvent.altKey,\n\t\t\t\t\tmetaKey: originalEvent.metaKey,\n\t\t\t\t\trepeat: originalEvent.repeat,\n\t\t\t\t\tisComposing: originalEvent.isComposing,\n\t\t\t\t\tlocation: originalEvent.location,\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t};\n}\n"]}
|
|
@@ -14,6 +14,7 @@ export interface SDSFormControlMixinInterface extends SDSFormControlProps {
|
|
|
14
14
|
readonly internals: ElementInternals;
|
|
15
15
|
readonly form: HTMLFormElement | null;
|
|
16
16
|
formDisabledCallback(disabled: boolean): void;
|
|
17
|
+
updateValidity(): void;
|
|
17
18
|
}
|
|
18
19
|
export declare function SDSFormControlMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSFormControlMixinInterface> & T;
|
|
19
20
|
//# sourceMappingURL=sds-form-control-mixin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-form-control-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"sds-form-control-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,mBAAmB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACxE,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9C,cAAc,IAAI,IAAI,CAAC;CACvB;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,aAAa,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAwCvI"}
|
|
@@ -20,6 +20,13 @@ export function SDSFormControlMixin(superClass) {
|
|
|
20
20
|
formDisabledCallback(disabled) {
|
|
21
21
|
this.disabled = disabled;
|
|
22
22
|
}
|
|
23
|
+
// Make sure to call updateValidity on first update
|
|
24
|
+
// to register validity as soon as possible
|
|
25
|
+
firstUpdated(changedProperties) {
|
|
26
|
+
super.firstUpdated(changedProperties);
|
|
27
|
+
this.updateValidity();
|
|
28
|
+
}
|
|
29
|
+
updateValidity() { }
|
|
23
30
|
}
|
|
24
31
|
SDSFormControl.formAssociated = true;
|
|
25
32
|
SDSFormControl.shadowRootOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-form-control-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"sds-form-control-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-form-control-mixin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAsB7C,MAAM,UAAU,mBAAmB,CAAsC,UAAa;IACrF,MAAM,cAAe,SAAQ,UAAU;QAetC,YAAY,GAAG,IAAW;YACzB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAJ4B,aAAQ,GAAY,KAAK,CAAC;YACH,aAAQ,GAAY,KAAK,CAAC;YAI5F,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,CAAC;QAED,IAAI,IAAI;YACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC5B,CAAC;QAED,oBAAoB,CAAC,QAAiB;YACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED,mDAAmD;QACnD,2CAA2C;QAClC,YAAY,CAAC,iBAAiC;YACtD,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;YACtC,IAAI,CAAC,cAAc,EAAE,CAAC;QACvB,CAAC;QAED,cAAc,KAAU,CAAC;;IAlClB,6BAAc,GAAG,IAAI,AAAP,CAAQ;IACtB,gCAAiB,GAAmB;QAC1C,GAAG,UAAU,CAAC,iBAAiB;QAC/B,cAAc,EAAE,IAAI;KACpB,AAHuB,CAGtB;IAMyC;QAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;IACb;QAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;IACH;QAAlE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAA2B;IAyB9F,OAAO,cAAc,CAAC;AACvB,CAAC","sourcesContent":["import { LitElement, PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Constructable } from './types';\n\nexport interface SDSFormControlProps {\n\tname?: string;\n\tdisabled?: boolean;\n\treadOnly?: boolean;\n}\n\nexport interface SDSFormControlAttributes {\n\tname?: string;\n\tdisabled?: boolean;\n\treadonly?: boolean;\n}\n\nexport interface SDSFormControlMixinInterface extends SDSFormControlProps {\n\treadonly internals: ElementInternals;\n\treadonly form: HTMLFormElement | null;\n\tformDisabledCallback(disabled: boolean): void;\n\tupdateValidity(): void;\n}\n\nexport function SDSFormControlMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSFormControlMixinInterface> & T {\n\tclass SDSFormControl extends superClass {\n\t\tstatic formAssociated = true;\n\t\tstatic shadowRootOptions: ShadowRootInit = {\n\t\t\t...LitElement.shadowRootOptions,\n\t\t\tdelegatesFocus: true,\n\t\t};\n\n\t\treadonly internals: ElementInternals;\n\n\t\t// Props\n\t\t// TODO: Add size: Extract<SDS_SIZES, 'lg' | 'md' | 'sm'> once legacy size aliases are removed from sds-chip and sds-switch\n\t\t@property({ type: String, reflect: true }) name?: string;\n\t\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t\t@property({ type: Boolean, attribute: 'readonly', reflect: true }) readOnly: boolean = false;\n\n\t\tconstructor(...args: any[]) {\n\t\t\tsuper(...args);\n\t\t\tthis.internals = this.attachInternals();\n\t\t}\n\n\t\tget form(): HTMLFormElement | null {\n\t\t\treturn this.internals.form;\n\t\t}\n\n\t\tformDisabledCallback(disabled: boolean): void {\n\t\t\tthis.disabled = disabled;\n\t\t}\n\n\t\t// Make sure to call updateValidity on first update\n\t\t// to register validity as soon as possible\n\t\toverride firstUpdated(changedProperties: PropertyValues): void {\n\t\t\tsuper.firstUpdated(changedProperties);\n\t\t\tthis.updateValidity();\n\t\t}\n\n\t\tupdateValidity(): void {}\n\t}\n\n\treturn SDSFormControl;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SDSDialogWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSDialogWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,eAAO,MAAM,gBAAgB;
|
|
1
|
+
{"version":3,"file":"SDSDialogWrapper.d.ts","sourceRoot":"","sources":["../../src/react-wrappers/SDSDialogWrapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,eAAO,MAAM,gBAAgB;aAKP,gBAAgB;EAEpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SDSDialogWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSDialogWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC/C,OAAO,EAAE,YAAY;IACrB,YAAY,EAAE,SAAS;IACvB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SDSDialogWrapper.js","sourceRoot":"","sources":["../../src/react-wrappers/SDSDialogWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;IAC/C,OAAO,EAAE,YAAY;IACrB,YAAY,EAAE,SAAS;IACvB,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACP,OAAO,EAAE,OAA2B;KACpC;CACD,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport React from 'react';\nimport { SheriffEventName } from './types';\nimport { SDSDialog } from '../sds-dialog/sds-dialog';\n\nexport const SDSDialogWrapper = createComponent({\n\ttagName: 'sds-dialog',\n\telementClass: SDSDialog,\n\treact: React,\n\tevents: {\n\t\tonClose: 'close' as SheriffEventName,\n\t},\n});\n"]}
|
|
@@ -11,6 +11,7 @@ export interface SDSButtonProps {
|
|
|
11
11
|
form?: string;
|
|
12
12
|
href?: string;
|
|
13
13
|
icon?: boolean;
|
|
14
|
+
inverted?: boolean;
|
|
14
15
|
loading?: boolean;
|
|
15
16
|
name?: string;
|
|
16
17
|
popoverTarget?: string;
|
|
@@ -29,6 +30,7 @@ export declare class SDSButtonComponent extends SDSButtonComponent_base {
|
|
|
29
30
|
static shadowRootOptions: ShadowRootInit;
|
|
30
31
|
disabled: boolean;
|
|
31
32
|
icon: boolean;
|
|
33
|
+
inverted: boolean;
|
|
32
34
|
loading: boolean;
|
|
33
35
|
form?: string;
|
|
34
36
|
href?: string;
|
|
@@ -42,6 +44,11 @@ export declare class SDSButtonComponent extends SDSButtonComponent_base {
|
|
|
42
44
|
control: HTMLButtonElement;
|
|
43
45
|
constructor();
|
|
44
46
|
updated(changed: PropertyValues): void;
|
|
47
|
+
private _resolveForm;
|
|
48
|
+
private _handlePopoverClick;
|
|
49
|
+
private _handleDialogCommandClick;
|
|
50
|
+
private _handleSubmitClick;
|
|
51
|
+
private _handleResetClick;
|
|
45
52
|
private readonly _handleClick;
|
|
46
53
|
render(): import("lit-html").TemplateResult<1>;
|
|
47
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.component.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAIhE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAInD,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAChD,KAAK,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;AAC/C,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GA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I,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;;AAED,qBAAa,kBAAmB,SAAQ,uBAA6G;IACpJ,OAAgB,MAAM,4BAAY;IAElC,MAAM,CAAC,cAAc,UAAQ;IAC7B,SAAgB,SAAS,EAAE,gBAAgB,CAAC;IAE5C,OAAgB,iBAAiB,EAAE,cAAc,CAG/C;IAE0C,QAAQ,EAAE,OAAO,CAAS;IAC1B,IAAI,EAAE,OAAO,CAAS;IACtB,QAAQ,EAAE,OAAO,CAAS;IAC1B,OAAO,EAAE,OAAO,CAAS;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAQ;IACxB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,UAAU,CAAY;IAC5B,KAAK,EAAE,MAAM,CAAM;IACnB,OAAO,EAAE,aAAa,CAAa;IACnC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAa;IAE9D,OAAO,EAAG,iBAAiB,CAAC;;IAOtC,OAAO,CAAC,OAAO,EAAE,cAAc;IASxC,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,yBAAyB;IAKjC,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAsB3B;IAEO,MAAM;CAgCf"}
|
|
@@ -15,6 +15,7 @@ export class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMix
|
|
|
15
15
|
super();
|
|
16
16
|
this.disabled = false;
|
|
17
17
|
this.icon = false;
|
|
18
|
+
this.inverted = false;
|
|
18
19
|
this.loading = false;
|
|
19
20
|
this.size = 'lg';
|
|
20
21
|
this.type = 'button';
|
|
@@ -22,61 +23,27 @@ export class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMix
|
|
|
22
23
|
this.variant = 'primary';
|
|
23
24
|
this.label = undefined;
|
|
24
25
|
this._handleClick = (event) => {
|
|
25
|
-
// For popover triggers, let the browser handle the toggle natively.
|
|
26
|
-
// Stop propagation and re-dispatch a composed click for listeners on the host.
|
|
27
26
|
if (this.popoverTarget) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
this._handlePopoverClick(event);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
event.stopImmediatePropagation();
|
|
32
|
+
if (this.disabled) {
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
34
|
-
// For dialog commands, emulate the native commandfor/command behavior on the host.
|
|
35
|
-
// Stop propagation and re-dispatch a composed click for listeners on the host.
|
|
36
35
|
if (this.effectiveCommandFor && this.effectiveCommand) {
|
|
37
|
-
|
|
38
|
-
event.stopImmediatePropagation();
|
|
39
|
-
if (!this.disabled) {
|
|
40
|
-
this.runDialogCommand();
|
|
41
|
-
this.dispatchSheriffEvent('click');
|
|
42
|
-
}
|
|
36
|
+
this._handleDialogCommandClick();
|
|
43
37
|
return;
|
|
44
38
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const root = this.getRootNode();
|
|
54
|
-
const formElement = root.querySelector(`form#${this.form}`);
|
|
55
|
-
formElement?.requestSubmit();
|
|
56
|
-
}
|
|
57
|
-
else if (this.internals.form) {
|
|
58
|
-
this.internals.form.requestSubmit();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
case 'reset': {
|
|
64
|
-
const shouldReset = this.dispatchSheriffEvent('reset');
|
|
65
|
-
if (shouldReset) {
|
|
66
|
-
if (this.form) {
|
|
67
|
-
const root = this.getRootNode();
|
|
68
|
-
const formElement = root.querySelector(`form#${this.form}`);
|
|
69
|
-
formElement?.reset();
|
|
70
|
-
}
|
|
71
|
-
else if (this.internals.form) {
|
|
72
|
-
this.internals.form.reset();
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
default:
|
|
78
|
-
this.dispatchSheriffEvent('click');
|
|
79
|
-
}
|
|
39
|
+
else if (this.type === 'submit') {
|
|
40
|
+
this._handleSubmitClick();
|
|
41
|
+
}
|
|
42
|
+
else if (this.type === 'reset') {
|
|
43
|
+
this._handleResetClick();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.dispatchSheriffEvent('click');
|
|
80
47
|
}
|
|
81
48
|
};
|
|
82
49
|
this.internals = this.attachInternals();
|
|
@@ -88,6 +55,38 @@ export class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMix
|
|
|
88
55
|
this.setAttribute('data-palette', 'danger');
|
|
89
56
|
}
|
|
90
57
|
}
|
|
58
|
+
_resolveForm() {
|
|
59
|
+
if (this.form) {
|
|
60
|
+
const root = this.getRootNode();
|
|
61
|
+
return root.querySelector(`form#${this.form}`);
|
|
62
|
+
}
|
|
63
|
+
return this.internals.form;
|
|
64
|
+
}
|
|
65
|
+
// For popover triggers, let the browser handle the toggle natively.
|
|
66
|
+
// Stop propagation and re-dispatch a composed click for listeners on the host.
|
|
67
|
+
_handlePopoverClick(event) {
|
|
68
|
+
event.stopImmediatePropagation();
|
|
69
|
+
if (this.disabled) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.dispatchSheriffEvent('click');
|
|
73
|
+
}
|
|
74
|
+
// For dialog commands, emulate the native commandfor/command behavior on the host.
|
|
75
|
+
// Stop propagation and re-dispatch a composed click for listeners on the host.
|
|
76
|
+
_handleDialogCommandClick() {
|
|
77
|
+
this.runDialogCommand();
|
|
78
|
+
this.dispatchSheriffEvent('click');
|
|
79
|
+
}
|
|
80
|
+
_handleSubmitClick() {
|
|
81
|
+
if (this.dispatchSheriffEvent('submit')) {
|
|
82
|
+
this._resolveForm()?.requestSubmit();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
_handleResetClick() {
|
|
86
|
+
if (this.dispatchSheriffEvent('reset')) {
|
|
87
|
+
this._resolveForm()?.reset();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
91
90
|
render() {
|
|
92
91
|
const buttonClasses = {
|
|
93
92
|
'sds-button': true,
|
|
@@ -112,7 +111,7 @@ export class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMix
|
|
|
112
111
|
@click="${this._handleClick}"
|
|
113
112
|
aria-label="${ifDefined(this.label)}"
|
|
114
113
|
>
|
|
115
|
-
${this.loading ? html `<sds-loader slot="before" ?contrast="${this.variant !== 'primary'}"></sds-loader>` : nothing} ${this.loading ? nothing : html `<slot name="before"></slot>`}
|
|
114
|
+
${this.loading ? html `<sds-loader slot="before" ?contrast="${this.inverted || this.variant !== 'primary'}"></sds-loader>` : nothing} ${this.loading ? nothing : html `<slot name="before"></slot>`}
|
|
116
115
|
<slot></slot>
|
|
117
116
|
${this.loading ? nothing : html `<slot name="after"></slot>`}
|
|
118
117
|
</button>
|
|
@@ -131,6 +130,9 @@ __decorate([
|
|
|
131
130
|
__decorate([
|
|
132
131
|
property({ type: Boolean, reflect: true })
|
|
133
132
|
], SDSButtonComponent.prototype, "icon", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ type: Boolean, reflect: true })
|
|
135
|
+
], SDSButtonComponent.prototype, "inverted", void 0);
|
|
134
136
|
__decorate([
|
|
135
137
|
property({ type: Boolean, reflect: true })
|
|
136
138
|
], SDSButtonComponent.prototype, "loading", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.component.js","sourceRoot":"","sources":["../../src/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,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAyB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAsB;AACrB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA6B;AAC5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAoB;AACnB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAoC;AACnC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAuC;AAE9D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tcommand?: 'close' | 'request-close' | 'show-modal';\n\tcommandFor?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: 'hide' | 'show' | 'toggle';\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\t@property({ type: String, reflect: true }) label: string | undefined = undefined;\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\t// For popover triggers, let the browser handle the toggle natively.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.popoverTarget) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// For dialog commands, emulate the native commandfor/command behavior on the host.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.effectiveCommandFor && this.effectiveCommand) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.runDialogCommand();\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst shouldSubmit = this.dispatchSheriffEvent('submit');\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.requestSubmit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.requestSubmit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst shouldReset = this.dispatchSheriffEvent('reset');\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t\taria-label=\"${ifDefined(this.label)}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sds-button.component.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM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AM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAuC;AAE9D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tcommand?: 'close' | 'request-close' | 'show-modal';\n\tcommandFor?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tinverted?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: 'hide' | 'show' | 'toggle';\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) inverted: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\t@property({ type: String, reflect: true }) label: string | undefined = undefined;\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate _resolveForm(): HTMLFormElement | null {\n\t\tif (this.form) {\n\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\treturn root.querySelector<HTMLFormElement>(`form#${this.form}`);\n\t\t}\n\t\treturn this.internals.form;\n\t}\n\n\t// For popover triggers, let the browser handle the toggle natively.\n\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\tprivate _handlePopoverClick(event: MouseEvent): void {\n\t\tevent.stopImmediatePropagation();\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\t\tthis.dispatchSheriffEvent('click');\n\t}\n\n\t// For dialog commands, emulate the native commandfor/command behavior on the host.\n\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\tprivate _handleDialogCommandClick(): void {\n\t\tthis.runDialogCommand();\n\t\tthis.dispatchSheriffEvent('click');\n\t}\n\n\tprivate _handleSubmitClick(): void {\n\t\tif (this.dispatchSheriffEvent('submit')) {\n\t\t\tthis._resolveForm()?.requestSubmit();\n\t\t}\n\t}\n\n\tprivate _handleResetClick(): void {\n\t\tif (this.dispatchSheriffEvent('reset')) {\n\t\t\tthis._resolveForm()?.reset();\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\tif (this.popoverTarget) {\n\t\t\tthis._handlePopoverClick(event);\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\t\tif (this.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.effectiveCommandFor && this.effectiveCommand) {\n\t\t\tthis._handleDialogCommandClick();\n\t\t\treturn;\n\t\t} else if (this.type === 'submit') {\n\t\t\tthis._handleSubmitClick();\n\t\t} else if (this.type === 'reset') {\n\t\t\tthis._handleResetClick();\n\t\t} else {\n\t\t\tthis.dispatchSheriffEvent('click');\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t\taria-label=\"${ifDefined(this.label)}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.inverted || this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.styles.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"sds-button.styles.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAgQlB,CAAC"}
|
|
@@ -8,6 +8,7 @@ export const styles = css `
|
|
|
8
8
|
--_sds-button-focus-color: var(--sds-button-focus-color, var(--sds-color-states-focus-outer));
|
|
9
9
|
--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));
|
|
10
10
|
--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));
|
|
11
|
+
--_sds-button-focus-outline-size: var(--sds-button-focus-outline-size, var(--sds-color-states-focus-outline-size));
|
|
11
12
|
--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));
|
|
12
13
|
--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-lg));
|
|
13
14
|
--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));
|
|
@@ -56,9 +57,9 @@ export const styles = css `
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
&:focus-visible {
|
|
59
|
-
box-shadow: 0 0 0 var(--
|
|
60
|
-
outline:
|
|
61
|
-
outline-offset:
|
|
60
|
+
box-shadow: 0 0 0 var(--_sds-button-focus-spacing) var(--_sds-button-focus-inner-color);
|
|
61
|
+
outline: var(--_sds-button-focus-outline-size) solid var(--_sds-button-focus-color);
|
|
62
|
+
outline-offset: var(--_sds-button-focus-spacing);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
&:active {
|
|
@@ -171,5 +172,88 @@ export const styles = css `
|
|
|
171
172
|
--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);
|
|
172
173
|
min-width: var(--_sds-button-min-height);
|
|
173
174
|
}
|
|
175
|
+
|
|
176
|
+
:host([inverted]) {
|
|
177
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
178
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
179
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));
|
|
180
|
+
|
|
181
|
+
--sds-loader-main-color: var(--sds-color-action-default, var(--sds-color-accent-action-default));
|
|
182
|
+
--sds-loader-secondary-color: var(--sds-color-border-subtle, var(--sds-color-accent-border-subtle));
|
|
183
|
+
--sds-icon-color: var(--sds-color-action-default, var(--sds-color-accent-action-default));
|
|
184
|
+
|
|
185
|
+
.sds-button:hover {
|
|
186
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-accent-surface-hover)));
|
|
187
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-hover, var(--sds-color-accent-surface-hover)));
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.sds-button:active {
|
|
191
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
192
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([inverted][variant='primary']) {
|
|
197
|
+
.sds-button:disabled {
|
|
198
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));
|
|
199
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));
|
|
200
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-neutral-action-default)));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([inverted][variant='secondary']) {
|
|
205
|
+
--_sds-button-background-color: var(--sds-button-background-color, transparent);
|
|
206
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
207
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
208
|
+
--sds-loader-main-color: var(--sds-color-accent-action-contrast-default);
|
|
209
|
+
|
|
210
|
+
.sds-button:hover {
|
|
211
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
212
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
213
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));
|
|
214
|
+
--sds-loader-main-color: var(--sds-color-accent-action-default);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.sds-button:active {
|
|
218
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
219
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
220
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));
|
|
221
|
+
--sds-loader-main-color: var(--sds-color-accent-action-default);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.sds-button:disabled {
|
|
225
|
+
--_sds-button-background-color: var(--sds-button-background-color, transparent);
|
|
226
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));
|
|
227
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:host([inverted][variant='tertiary']) {
|
|
232
|
+
--_sds-button-background-color: var(--sds-button-background-color, transparent);
|
|
233
|
+
--_sds-button-border-color: var(--sds-button-border-color, transparent);
|
|
234
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
235
|
+
--sds-typography-link-text-decoration: none;
|
|
236
|
+
--sds-loader-main-color: var(--sds-color-accent-action-contrast-default);
|
|
237
|
+
|
|
238
|
+
.sds-button:hover {
|
|
239
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
240
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));
|
|
241
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));
|
|
242
|
+
--sds-loader-main-color: var(--sds-color-accent-action-default);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.sds-button:active {
|
|
246
|
+
--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
247
|
+
--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));
|
|
248
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));
|
|
249
|
+
--sds-loader-main-color: var(--sds-color-accent-action-default);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.sds-button:disabled {
|
|
253
|
+
--_sds-button-background-color: var(--sds-button-background-color, transparent);
|
|
254
|
+
--_sds-button-border-color: var(--sds-button-border-color, transparent);
|
|
255
|
+
--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
174
258
|
`;
|
|
175
259
|
//# sourceMappingURL=sds-button.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.styles.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4KxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-width: var(--sds-button-border-width, var(--sds-border-md));\n\t\t--_sds-button-disabled-opacity: var(--sds-button-disabled-opacity, var(--sds-color-states-disabled-opacity));\n\t\t--_sds-button-focus-color: var(--sds-button-focus-color, var(--sds-color-states-focus-outer));\n\t\t--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));\n\t\t--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));\n\t\t--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-lg));\n\t\t--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));\n\t\t--_sds-button-gap: var(--sds-button-gap, var(--sds-spacing-3xs));\n\t\t--_sds-button-line-height: var(--sds-button-line-height, var(--sds-typography-body-md-desktop-line-height));\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-lg));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-xs));\n\t\t--_sds-button-radius: var(--sds-button-radius, var(--sds-radius-sm));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-main-action-contrast-default)));\n\n\t\t--_sds-button-tertiary-text-decoration: var(--sds-typography-link-text-decoration, underline);\n\t\t--_sds-button-tertiary-text-underline-offset: var(--sds-typography-link-text-underline-offset, 4px);\n\t\t--_sds-button-tertiary-text-underline-thickness: 2px;\n\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\n\t\t::slotted(sds-icon) {\n\t\t\t--sds-icon-color: var(--_sds-button-text-color);\n\t\t}\n\t}\n\n\t.sds-button {\n\t\talign-items: center;\n\t\tbackground-color: var(--_sds-button-background-color);\n\t\tborder-radius: var(--_sds-button-radius);\n\t\tborder: var(--_sds-button-border-width) solid var(--_sds-button-border-color);\n\t\tcolor: var(--_sds-button-text-color);\n\t\tcursor: pointer;\n\t\tdisplay: inline-flex;\n\t\tfont-family: var(--_sds-button-font-family);\n\t\tfont-size: var(--_sds-button-font-size);\n\t\tfont-weight: var(--_sds-button-font-weight);\n\t\tgap: var(--_sds-button-gap);\n\t\tinline-size: 100%;\n\t\tjustify-content: center;\n\t\tline-height: var(--_sds-button-line-height);\n\t\tmin-height: var(--_sds-button-min-height);\n\t\tpadding: var(--_sds-button-padding-block) var(--_sds-button-padding-inline);\n\t\ttext-align: center;\n\n\t\t&:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\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-button-focus-inner-color);\n\t\t\toutline: 3px solid var(--_sds-button-focus-color);\n\t\t\toutline-offset: 3px;\n\t\t}\n\n\t\t&:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t&:disabled {\n\t\t\topacity: var(--_sds-button-disabled-opacity);\n\t\t\tcursor: not-allowed;\n\t\t\tpointer-events: none;\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-contrast-default));\n\t\t}\n\t}\n\n\t.sds-button--as-link {\n\t\tbox-sizing: border-box;\n\t\tinline-size: auto;\n\t\ttext-decoration: none;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-default));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\n\t\t\ttext-decoration: var(--_sds-button-tertiary-text-decoration);\n\t\t\ttext-decoration-thickness: var(--_sds-button-tertiary-text-underline-thickness);\n\t\t\ttext-underline-offset: var(--_sds-button-tertiary-text-underline-offset);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-default));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']):host([icon]) {\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\t}\n\n\t:host([size='medium']), /* Deprecated */\n\t:host([size='md']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, var(--sds-spacing-4xs));\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-md));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([size='small']), /* Deprecated */\n\t:host([size='sm']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-sm));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-sm));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([icon]) {\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\tmin-width: var(--_sds-button-min-height);\n\t}\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"sds-button.styles.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgQxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-border-width: var(--sds-button-border-width, var(--sds-border-md));\n\t\t--_sds-button-disabled-opacity: var(--sds-button-disabled-opacity, var(--sds-color-states-disabled-opacity));\n\t\t--_sds-button-focus-color: var(--sds-button-focus-color, var(--sds-color-states-focus-outer));\n\t\t--_sds-button-focus-inner-color: var(--sds-button-focus-inner-color, var(--sds-color-states-focus-inner));\n\t\t--_sds-button-focus-spacing: var(--sds-button-focus-spacing, var(--sds-color-states-focus-spacing));\n\t\t--_sds-button-focus-outline-size: var(--sds-button-focus-outline-size, var(--sds-color-states-focus-outline-size));\n\t\t--_sds-button-font-family: var(--sds-button-font, var(--sds-typography-font-family-roboto));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-lg));\n\t\t--_sds-button-font-weight: var(--sds-button-font-weight, var(--sds-typography-body-md-strong-desktop-font-weight));\n\t\t--_sds-button-gap: var(--sds-button-gap, var(--sds-spacing-3xs));\n\t\t--_sds-button-line-height: var(--sds-button-line-height, var(--sds-typography-body-md-desktop-line-height));\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-lg));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-xs));\n\t\t--_sds-button-radius: var(--sds-button-radius, var(--sds-radius-sm));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-main-action-contrast-default)));\n\n\t\t--_sds-button-tertiary-text-decoration: var(--sds-typography-link-text-decoration, underline);\n\t\t--_sds-button-tertiary-text-underline-offset: var(--sds-typography-link-text-underline-offset, 4px);\n\t\t--_sds-button-tertiary-text-underline-thickness: 2px;\n\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\n\t\t::slotted(sds-icon) {\n\t\t\t--sds-icon-color: var(--_sds-button-text-color);\n\t\t}\n\t}\n\n\t.sds-button {\n\t\talign-items: center;\n\t\tbackground-color: var(--_sds-button-background-color);\n\t\tborder-radius: var(--_sds-button-radius);\n\t\tborder: var(--_sds-button-border-width) solid var(--_sds-button-border-color);\n\t\tcolor: var(--_sds-button-text-color);\n\t\tcursor: pointer;\n\t\tdisplay: inline-flex;\n\t\tfont-family: var(--_sds-button-font-family);\n\t\tfont-size: var(--_sds-button-font-size);\n\t\tfont-weight: var(--_sds-button-font-weight);\n\t\tgap: var(--_sds-button-gap);\n\t\tinline-size: 100%;\n\t\tjustify-content: center;\n\t\tline-height: var(--_sds-button-line-height);\n\t\tmin-height: var(--_sds-button-min-height);\n\t\tpadding: var(--_sds-button-padding-block) var(--_sds-button-padding-inline);\n\t\ttext-align: center;\n\n\t\t&:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\t\t}\n\n\t\t&:focus-visible {\n\t\t\tbox-shadow: 0 0 0 var(--_sds-button-focus-spacing) var(--_sds-button-focus-inner-color);\n\t\t\toutline: var(--_sds-button-focus-outline-size) solid var(--_sds-button-focus-color);\n\t\t\toutline-offset: var(--_sds-button-focus-spacing);\n\t\t}\n\n\t\t&:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t&:disabled {\n\t\t\topacity: var(--_sds-button-disabled-opacity);\n\t\t\tcursor: not-allowed;\n\t\t\tpointer-events: none;\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-contrast-default));\n\t\t}\n\t}\n\n\t.sds-button--as-link {\n\t\tbox-sizing: border-box;\n\t\tinline-size: auto;\n\t\ttext-decoration: none;\n\t}\n\n\t:host([variant='secondary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-neutral-action-default));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-default));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-main-action-default)));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-hover, var(--sds-color-main-action-hover)));\n\n\t\t\ttext-decoration: var(--_sds-button-tertiary-text-decoration);\n\t\t\ttext-decoration-thickness: var(--_sds-button-tertiary-text-underline-thickness);\n\t\t\ttext-underline-offset: var(--_sds-button-tertiary-text-underline-offset);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-active, var(--sds-color-main-action-active)));\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-neutral-action-default));\n\t\t}\n\t}\n\n\t:host([variant='tertiary']):host([icon]) {\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-main-surface-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-main-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t}\n\t}\n\n\t:host([size='medium']), /* Deprecated */\n\t:host([size='md']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-md));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, var(--sds-spacing-4xs));\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-md));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([size='small']), /* Deprecated */\n\t:host([size='sm']) {\n\t\t--_sds-button-min-height: var(--sds-button-height, var(--sds-components-button-sm));\n\t\t--_sds-button-padding-block: var(--sds-button-padding-block, 0);\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, var(--sds-spacing-3xs));\n\t\t--_sds-button-font-size: var(--sds-button-font-size, var(--sds-components-font-size-content-sm));\n\n\t\t&:host([variant='tertiary']) {\n\t\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\t}\n\t}\n\n\t:host([icon]) {\n\t\t--_sds-button-padding-inline: var(--sds-button-padding-inline, 0);\n\t\tmin-width: var(--_sds-button-min-height);\n\t}\n\n\t:host([inverted]) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));\n\n\t\t--sds-loader-main-color: var(--sds-color-action-default, var(--sds-color-accent-action-default));\n\t\t--sds-loader-secondary-color: var(--sds-color-border-subtle, var(--sds-color-accent-border-subtle));\n\t\t--sds-icon-color: var(--sds-color-action-default, var(--sds-color-accent-action-default));\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-hover, var(--sds-color-accent-surface-hover)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-hover, var(--sds-color-accent-surface-hover)));\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t}\n\t}\n\n\t:host([inverted][variant='primary']) {\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-neutral-action-default)));\n\t\t}\n\t}\n\n\t:host([inverted][variant='secondary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t--sds-loader-main-color: var(--sds-color-accent-action-contrast-default);\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));\n\t\t\t--sds-loader-main-color: var(--sds-color-accent-action-default);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));\n\t\t\t--sds-loader-main-color: var(--sds-color-accent-action-default);\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));\n\t\t}\n\t}\n\n\t:host([inverted][variant='tertiary']) {\n\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t--sds-typography-link-text-decoration: none;\n\t\t--sds-loader-main-color: var(--sds-color-accent-action-contrast-default);\n\n\t\t.sds-button:hover {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-action-contrast-default, var(--sds-color-accent-action-contrast-default)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));\n\t\t\t--sds-loader-main-color: var(--sds-color-accent-action-default);\n\t\t}\n\n\t\t.sds-button:active {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, var(--sds-color-surface-active, var(--sds-color-accent-surface-active)));\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-default, var(--sds-color-accent-action-default)));\n\t\t\t--sds-loader-main-color: var(--sds-color-accent-action-default);\n\t\t}\n\n\t\t.sds-button:disabled {\n\t\t\t--_sds-button-background-color: var(--sds-button-background-color, transparent);\n\t\t\t--_sds-button-border-color: var(--sds-button-border-color, transparent);\n\t\t\t--_sds-button-text-color: var(--sds-button-text-color, var(--sds-color-action-contrast-default, var(--sds-color-neutral-action-contrast-default)));\n\t\t}\n\t}\n`;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-card.d.ts","sourceRoot":"","sources":["../../src/sds-card/sds-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-card.d.ts","sourceRoot":"","sources":["../../src/sds-card/sds-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAOvC,MAAM,WAAW,YAAY;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,qBACa,OAAQ,SAAQ,UAAU;IAEtC,OAAgB,MAAM,4BAAY;IAGS,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAG/C,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,QAAQ,CAAmB;IAEjD,OAAO,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,eAAe,CAAsG;IAC7H,OAAO,CAAC,cAAc,CAAmF;cAEtF,YAAY,IAAI,IAAI;IAUvC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAKvC;IAEF,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAGpC;IAEO,MAAM;CAUf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
|