@politiet/sheriff-web-components 0.1.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -52
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/react-wrappers/SDSButtonWrapper.d.ts +2 -0
- package/dist/react-wrappers/SDSButtonWrapper.d.ts.map +1 -1
- package/dist/react-wrappers/SDSButtonWrapper.js +2 -0
- package/dist/react-wrappers/SDSButtonWrapper.js.map +1 -1
- package/dist/react-wrappers/SDSCheckboxGroupWrapper.d.ts +5 -0
- package/dist/react-wrappers/SDSCheckboxGroupWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSCheckboxGroupWrapper.js +12 -0
- package/dist/react-wrappers/SDSCheckboxGroupWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSCheckboxWrapper.d.ts +7 -0
- package/dist/react-wrappers/SDSCheckboxWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSCheckboxWrapper.js +14 -0
- package/dist/react-wrappers/SDSCheckboxWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSChipWrapper.d.ts +6 -0
- package/dist/react-wrappers/SDSChipWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSChipWrapper.js +13 -0
- package/dist/react-wrappers/SDSChipWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSDetailWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSDetailWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSDetailWrapper.js +10 -0
- package/dist/react-wrappers/SDSDetailWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSHeadingWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSHeadingWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSHeadingWrapper.js +10 -0
- package/dist/react-wrappers/SDSHeadingWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSIconWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSIconWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSIconWrapper.js +10 -0
- package/dist/react-wrappers/SDSIconWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSLabelWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSLabelWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSLabelWrapper.js +10 -0
- package/dist/react-wrappers/SDSLabelWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSLinkWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSLinkWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSLinkWrapper.js +10 -0
- package/dist/react-wrappers/SDSLinkWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSLoaderWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSLoaderWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSLoaderWrapper.js +10 -0
- package/dist/react-wrappers/SDSLoaderWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSNotificationWrapper.d.ts +5 -0
- package/dist/react-wrappers/SDSNotificationWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSNotificationWrapper.js +12 -0
- package/dist/react-wrappers/SDSNotificationWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSParagraphWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSParagraphWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSParagraphWrapper.js +10 -0
- package/dist/react-wrappers/SDSParagraphWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSRadioGroupWrapper.d.ts +5 -0
- package/dist/react-wrappers/SDSRadioGroupWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSRadioGroupWrapper.js +12 -0
- package/dist/react-wrappers/SDSRadioGroupWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSRadioWrapper.d.ts +7 -0
- package/dist/react-wrappers/SDSRadioWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSRadioWrapper.js +14 -0
- package/dist/react-wrappers/SDSRadioWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSSwitchWrapper.d.ts +7 -0
- package/dist/react-wrappers/SDSSwitchWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSSwitchWrapper.js +14 -0
- package/dist/react-wrappers/SDSSwitchWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSTextFieldWrapper.d.ts +9 -0
- package/dist/react-wrappers/SDSTextFieldWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSTextFieldWrapper.js +16 -0
- package/dist/react-wrappers/SDSTextFieldWrapper.js.map +1 -0
- package/dist/react-wrappers/SDSTextWrapper.d.ts +3 -0
- package/dist/react-wrappers/SDSTextWrapper.d.ts.map +1 -0
- package/dist/react-wrappers/SDSTextWrapper.js +10 -0
- package/dist/react-wrappers/SDSTextWrapper.js.map +1 -0
- package/dist/react-wrappers/index.d.ts +19 -0
- package/dist/react-wrappers/index.d.ts.map +1 -0
- package/dist/react-wrappers/index.js +19 -0
- package/dist/react-wrappers/index.js.map +1 -0
- package/dist/sds-button/sds-button.d.ts +11 -3
- package/dist/sds-button/sds-button.d.ts.map +1 -1
- package/dist/sds-button/sds-button.js +83 -13
- package/dist/sds-button/sds-button.js.map +1 -1
- package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
- package/dist/sds-button/sds-button.styles.js +41 -10
- package/dist/sds-button/sds-button.styles.js.map +1 -1
- package/dist/sds-checkbox/sds-checkbox.d.ts +26 -0
- package/dist/sds-checkbox/sds-checkbox.d.ts.map +1 -0
- package/dist/sds-checkbox/sds-checkbox.js +116 -0
- package/dist/sds-checkbox/sds-checkbox.js.map +1 -0
- package/dist/sds-checkbox/sds-checkbox.styles.d.ts +2 -0
- package/dist/sds-checkbox/sds-checkbox.styles.d.ts.map +1 -0
- package/dist/sds-checkbox/sds-checkbox.styles.js +110 -0
- package/dist/sds-checkbox/sds-checkbox.styles.js.map +1 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.d.ts +18 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.d.ts.map +1 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.js +75 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.js.map +1 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.styles.d.ts +2 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.styles.d.ts.map +1 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.styles.js +52 -0
- package/dist/sds-checkbox-group/sds-checkbox-group.styles.js.map +1 -0
- package/dist/sds-chip/sds-chip.d.ts +15 -10
- package/dist/sds-chip/sds-chip.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.js +60 -70
- package/dist/sds-chip/sds-chip.js.map +1 -1
- package/dist/sds-chip/sds-chip.styles.d.ts.map +1 -1
- package/dist/sds-chip/sds-chip.styles.js +42 -75
- package/dist/sds-chip/sds-chip.styles.js.map +1 -1
- package/dist/sds-detail/sds-detail.d.ts +14 -0
- package/dist/sds-detail/sds-detail.d.ts.map +1 -0
- package/dist/sds-detail/sds-detail.js +36 -0
- package/dist/sds-detail/sds-detail.js.map +1 -0
- package/dist/sds-detail/sds-detail.styles.d.ts +2 -0
- package/dist/sds-detail/sds-detail.styles.d.ts.map +1 -0
- package/dist/sds-detail/sds-detail.styles.js +25 -0
- package/dist/sds-detail/sds-detail.styles.js.map +1 -0
- package/dist/sds-heading/sds-heading.d.ts +16 -0
- package/dist/sds-heading/sds-heading.d.ts.map +1 -0
- package/dist/sds-heading/sds-heading.js +57 -0
- package/dist/sds-heading/sds-heading.js.map +1 -0
- package/dist/sds-heading/sds-heading.styles.d.ts +2 -0
- package/dist/sds-heading/sds-heading.styles.d.ts.map +1 -0
- package/dist/sds-heading/sds-heading.styles.js +105 -0
- package/dist/sds-heading/sds-heading.styles.js.map +1 -0
- package/dist/sds-icon/sds-icon-loader.d.ts +7 -0
- package/dist/sds-icon/sds-icon-loader.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon-loader.js +26 -0
- package/dist/sds-icon/sds-icon-loader.js.map +1 -0
- package/dist/sds-icon/sds-icon.allowed-colors.d.ts +3 -0
- package/dist/sds-icon/sds-icon.allowed-colors.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.allowed-colors.js +17 -0
- package/dist/sds-icon/sds-icon.allowed-colors.js.map +1 -0
- package/dist/sds-icon/sds-icon.allowed-names.d.ts +3 -0
- package/dist/sds-icon/sds-icon.allowed-names.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.allowed-names.js +2 -0
- package/dist/sds-icon/sds-icon.allowed-names.js.map +1 -0
- package/dist/sds-icon/sds-icon.color-types.d.ts +2 -0
- package/dist/sds-icon/sds-icon.color-types.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.color-types.js +2 -0
- package/dist/sds-icon/sds-icon.color-types.js.map +1 -0
- package/dist/sds-icon/sds-icon.d.ts +27 -0
- package/dist/sds-icon/sds-icon.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.icon-types.d.ts +2 -0
- package/dist/sds-icon/sds-icon.icon-types.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.icon-types.js +2 -0
- package/dist/sds-icon/sds-icon.icon-types.js.map +1 -0
- package/dist/sds-icon/sds-icon.js +83 -0
- package/dist/sds-icon/sds-icon.js.map +1 -0
- package/dist/sds-icon/sds-icon.styles.d.ts +2 -0
- package/dist/sds-icon/sds-icon.styles.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.styles.js +15 -0
- package/dist/sds-icon/sds-icon.styles.js.map +1 -0
- package/dist/sds-label/sds-label.d.ts +15 -0
- package/dist/sds-label/sds-label.d.ts.map +1 -0
- package/dist/sds-label/sds-label.js +43 -0
- package/dist/sds-label/sds-label.js.map +1 -0
- package/dist/sds-label/sds-label.styles.d.ts +2 -0
- package/dist/sds-label/sds-label.styles.d.ts.map +1 -0
- package/dist/sds-label/sds-label.styles.js +31 -0
- package/dist/sds-label/sds-label.styles.js.map +1 -0
- package/dist/sds-link/sds-link.d.ts +17 -0
- package/dist/sds-link/sds-link.d.ts.map +1 -0
- package/dist/sds-link/sds-link.js +45 -0
- package/dist/sds-link/sds-link.js.map +1 -0
- package/dist/sds-link/sds-link.styles.d.ts +2 -0
- package/dist/sds-link/sds-link.styles.d.ts.map +1 -0
- package/dist/sds-link/sds-link.styles.js +74 -0
- package/dist/sds-link/sds-link.styles.js.map +1 -0
- package/dist/sds-loader/sds-loader.d.ts +16 -0
- package/dist/sds-loader/sds-loader.d.ts.map +1 -0
- package/dist/sds-loader/sds-loader.js +39 -0
- package/dist/sds-loader/sds-loader.js.map +1 -0
- package/dist/sds-loader/sds-loader.styles.d.ts +2 -0
- package/dist/sds-loader/sds-loader.styles.d.ts.map +1 -0
- package/dist/sds-loader/sds-loader.styles.js +39 -0
- package/dist/sds-loader/sds-loader.styles.js.map +1 -0
- package/dist/sds-nav-card/sds-nav-card.d.ts +1 -2
- package/dist/sds-nav-card/sds-nav-card.d.ts.map +1 -1
- package/dist/sds-nav-card/sds-nav-card.js +6 -11
- package/dist/sds-nav-card/sds-nav-card.js.map +1 -1
- package/dist/sds-nav-card/sds-nav-card.styles.js +1 -1
- package/dist/sds-nav-card/sds-nav-card.styles.js.map +1 -1
- package/dist/sds-notification/sds-notification.d.ts +17 -0
- package/dist/sds-notification/sds-notification.d.ts.map +1 -0
- package/dist/sds-notification/sds-notification.js +70 -0
- package/dist/sds-notification/sds-notification.js.map +1 -0
- package/dist/sds-notification/sds-notification.styles.d.ts +2 -0
- package/dist/sds-notification/sds-notification.styles.d.ts.map +1 -0
- package/dist/sds-notification/sds-notification.styles.js +160 -0
- package/dist/sds-notification/sds-notification.styles.js.map +1 -0
- package/dist/sds-paragraph/sds-paragraph.d.ts +14 -0
- package/dist/sds-paragraph/sds-paragraph.d.ts.map +1 -0
- package/dist/sds-paragraph/sds-paragraph.js +37 -0
- package/dist/sds-paragraph/sds-paragraph.js.map +1 -0
- package/dist/sds-paragraph/sds-paragraph.styles.d.ts +2 -0
- package/dist/sds-paragraph/sds-paragraph.styles.d.ts.map +1 -0
- package/dist/sds-paragraph/sds-paragraph.styles.js +37 -0
- package/dist/sds-paragraph/sds-paragraph.styles.js.map +1 -0
- package/dist/sds-radio/sds-radio.d.ts +49 -0
- package/dist/sds-radio/sds-radio.d.ts.map +1 -0
- package/dist/sds-radio/sds-radio.js +241 -0
- package/dist/sds-radio/sds-radio.js.map +1 -0
- package/dist/sds-radio/sds-radio.styles.d.ts +2 -0
- package/dist/sds-radio/sds-radio.styles.d.ts.map +1 -0
- package/dist/sds-radio/sds-radio.styles.js +109 -0
- package/dist/sds-radio/sds-radio.styles.js.map +1 -0
- package/dist/sds-radio-group/sds-radio-group.d.ts +22 -0
- package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -0
- package/dist/sds-radio-group/sds-radio-group.js +75 -0
- package/dist/sds-radio-group/sds-radio-group.js.map +1 -0
- package/dist/sds-radio-group/sds-radio-group.styles.d.ts +2 -0
- package/dist/sds-radio-group/sds-radio-group.styles.d.ts.map +1 -0
- package/dist/sds-radio-group/sds-radio-group.styles.js +47 -0
- package/dist/sds-radio-group/sds-radio-group.styles.js.map +1 -0
- package/dist/sds-switch/sds-switch.d.ts +43 -0
- package/dist/sds-switch/sds-switch.d.ts.map +1 -0
- package/dist/sds-switch/sds-switch.js +189 -0
- package/dist/sds-switch/sds-switch.js.map +1 -0
- package/dist/sds-switch/sds-switch.styles.d.ts +2 -0
- package/dist/sds-switch/sds-switch.styles.d.ts.map +1 -0
- package/dist/sds-switch/sds-switch.styles.js +125 -0
- package/dist/sds-switch/sds-switch.styles.js.map +1 -0
- package/dist/sds-text/sds-text.d.ts +14 -0
- package/dist/sds-text/sds-text.d.ts.map +1 -0
- package/dist/sds-text/sds-text.js +37 -0
- package/dist/sds-text/sds-text.js.map +1 -0
- package/dist/sds-text/sds-text.styles.d.ts +2 -0
- package/dist/sds-text/sds-text.styles.d.ts.map +1 -0
- package/dist/sds-text/sds-text.styles.js +31 -0
- package/dist/sds-text/sds-text.styles.js.map +1 -0
- package/dist/sds-textfield/sds-textfield.d.ts +35 -0
- package/dist/sds-textfield/sds-textfield.d.ts.map +1 -0
- package/dist/sds-textfield/sds-textfield.js +179 -0
- package/dist/sds-textfield/sds-textfield.js.map +1 -0
- package/dist/sds-textfield/sds-textfield.styles.d.ts +2 -0
- package/dist/sds-textfield/sds-textfield.styles.d.ts.map +1 -0
- package/dist/sds-textfield/sds-textfield.styles.js +116 -0
- package/dist/sds-textfield/sds-textfield.styles.js.map +1 -0
- package/package.json +36 -17
|
@@ -0,0 +1,43 @@
|
|
|
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 { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
+
import { styles } from './sds-label.styles';
|
|
12
|
+
let SDSLabel = class SDSLabel extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
// Reactive Props
|
|
16
|
+
this.size = 'l';
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const styleClasses = {
|
|
20
|
+
'sds-label': true,
|
|
21
|
+
'sds-label--l': this.size === 'l',
|
|
22
|
+
'sds-label--m': this.size === 'm',
|
|
23
|
+
'sds-label--s': this.size === 's',
|
|
24
|
+
};
|
|
25
|
+
const classes = classMap(styleClasses);
|
|
26
|
+
return html `<label for="${ifDefined(this.for)}" class=${classes}
|
|
27
|
+
><slot></slot
|
|
28
|
+
></label>`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
// Styling
|
|
32
|
+
SDSLabel.styles = [styles];
|
|
33
|
+
__decorate([
|
|
34
|
+
property({ type: String })
|
|
35
|
+
], SDSLabel.prototype, "size", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
property({ type: String })
|
|
38
|
+
], SDSLabel.prototype, "for", void 0);
|
|
39
|
+
SDSLabel = __decorate([
|
|
40
|
+
customElement('sds-label')
|
|
41
|
+
], SDSLabel);
|
|
42
|
+
export { SDSLabel };
|
|
43
|
+
//# sourceMappingURL=sds-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-label.js","sourceRoot":"","sources":["../../src/sds-label/sds-label.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKrC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAIN,iBAAiB;QAEjB,SAAI,GAAS,GAAG,CAAC;IAmBlB,CAAC;IAdS,MAAM;QACd,MAAM,YAAY,GAAG;YACpB,WAAW,EAAE,IAAI;YACjB,cAAc,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;YACjC,cAAc,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;YACjC,cAAc,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;SACjC,CAAC;QAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAA,eAAe,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,OAAO;;YAErD,CAAC;IACZ,CAAC;;AAvBD,UAAU;AACM,eAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACd;AATD,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAyBpB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-label.styles';\n\ntype Size = 'l' | 'm' | 's';\n\n@customElement('sds-label')\nexport class SDSLabel extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String })\n\tsize: Size = 'l';\n\n\t@property({ type: String })\n\tfor?: string;\n\n\toverride render() {\n\t\tconst styleClasses = {\n\t\t\t'sds-label': true,\n\t\t\t'sds-label--l': this.size === 'l',\n\t\t\t'sds-label--m': this.size === 'm',\n\t\t\t'sds-label--s': this.size === 's',\n\t\t};\n\n\t\tconst classes = classMap(styleClasses);\n\n\t\treturn html`<label for=\"${ifDefined(this.for)}\" class=${classes}\n\t\t\t><slot></slot\n\t\t></label>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-label': SDSLabel;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-label.styles.d.ts","sourceRoot":"","sources":["../../src/sds-label/sds-label.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA4BlB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sds-label {
|
|
8
|
+
font-family: var(--sds-typography-font-family);
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
color: var(--sds-color-semantic-text-default);
|
|
11
|
+
margin: 0;
|
|
12
|
+
max-width: var(--sds-typography-max-line-width);
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sds-label--l {
|
|
17
|
+
font-size: 1.125rem;
|
|
18
|
+
line-height: 1.333;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.sds-label--m {
|
|
22
|
+
font-size: 1rem;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sds-label--s {
|
|
27
|
+
font-size: 0.875rem;
|
|
28
|
+
line-height: 1.428;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=sds-label.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-label.styles.js","sourceRoot":"","sources":["../../src/sds-label/sds-label.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.sds-label {\n\t\tfont-family: var(--sds-typography-font-family);\n\t\tfont-weight: 500;\n\t\tcolor: var(--sds-color-semantic-text-default);\n\t\tmargin: 0;\n\t\tmax-width: var(--sds-typography-max-line-width);\n\t\tpadding: 0;\n\t}\n\n\t.sds-label--l {\n\t\tfont-size: 1.125rem;\n\t\tline-height: 1.333;\n\t}\n\n\t.sds-label--m {\n\t\tfont-size: 1rem;\n\t\tline-height: 1.5;\n\t}\n\n\t.sds-label--s {\n\t\tfont-size: 0.875rem;\n\t\tline-height: 1.428;\n\t}\n`;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Size = 'l' | 'm' | 's';
|
|
3
|
+
type Target = '_blank' | '_self' | '_parent' | '_top';
|
|
4
|
+
export declare class SDSLink extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
href?: string;
|
|
7
|
+
size: Size;
|
|
8
|
+
target?: Target;
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'sds-link': SDSLink;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=sds-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-link.d.ts","sourceRoot":"","sources":["../../src/sds-link/sds-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAMvC,KAAK,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC5B,KAAK,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD,qBACa,OAAQ,SAAQ,UAAU;IAEtC,OAAgB,MAAM,4BAAY;IAIlC,IAAI,CAAC,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,IAAI,CAAO;IAGjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEP,MAAM;CAcf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
10
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
11
|
+
import { styles } from './sds-link.styles';
|
|
12
|
+
let SDSLink = class SDSLink extends LitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.size = 'm';
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const styleClasses = {
|
|
19
|
+
'sds-link': true,
|
|
20
|
+
'sds-link--l': this.size === 'l',
|
|
21
|
+
'sds-link--m': this.size === 'm',
|
|
22
|
+
'sds-link--s': this.size === 's',
|
|
23
|
+
};
|
|
24
|
+
const classes = classMap(styleClasses);
|
|
25
|
+
return html `<a href="${ifDefined(this.href)}" target="${ifDefined(this.target)}" class=${classes}
|
|
26
|
+
><slot></slot
|
|
27
|
+
></a>`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// Styling
|
|
31
|
+
SDSLink.styles = [styles];
|
|
32
|
+
__decorate([
|
|
33
|
+
property({ type: String })
|
|
34
|
+
], SDSLink.prototype, "href", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
property({ type: String })
|
|
37
|
+
], SDSLink.prototype, "size", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ type: String })
|
|
40
|
+
], SDSLink.prototype, "target", void 0);
|
|
41
|
+
SDSLink = __decorate([
|
|
42
|
+
customElement('sds-link')
|
|
43
|
+
], SDSLink);
|
|
44
|
+
export { SDSLink };
|
|
45
|
+
//# sourceMappingURL=sds-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-link.js","sourceRoot":"","sources":["../../src/sds-link/sds-link.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMpC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QASN,SAAI,GAAS,GAAG,CAAC;IAmBlB,CAAC;IAdS,MAAM;QACd,MAAM,YAAY,GAAG;YACpB,UAAU,EAAE,IAAI;YAChB,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;YAChC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;YAChC,aAAa,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG;SAChC,CAAC;QAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAEvC,OAAO,IAAI,CAAA,YAAY,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,OAAO;;QAE1F,CAAC;IACR,CAAC;;AA1BD,UAAU;AACM,cAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACV;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACX;AAZJ,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA4BnB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-link.styles';\n\ntype Size = 'l' | 'm' | 's';\ntype Target = '_blank' | '_self' | '_parent' | '_top';\n\n@customElement('sds-link')\nexport class SDSLink extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String })\n\thref?: string;\n\n\t@property({ type: String })\n\tsize: Size = 'm';\n\n\t@property({ type: String })\n\ttarget?: Target;\n\n\toverride render() {\n\t\tconst styleClasses = {\n\t\t\t'sds-link': true,\n\t\t\t'sds-link--l': this.size === 'l',\n\t\t\t'sds-link--m': this.size === 'm',\n\t\t\t'sds-link--s': this.size === 's',\n\t\t};\n\n\t\tconst classes = classMap(styleClasses);\n\n\t\treturn html`<a href=\"${ifDefined(this.href)}\" target=\"${ifDefined(this.target)}\" class=${classes}\n\t\t\t><slot></slot\n\t\t></a>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-link': SDSLink;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-link.styles.d.ts","sourceRoot":"","sources":["../../src/sds-link/sds-link.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAuElB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: inline;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host([display-type='block']) {
|
|
8
|
+
display: block;
|
|
9
|
+
max-width: var(--sds-typography-max-line-width);
|
|
10
|
+
|
|
11
|
+
.sds-link {
|
|
12
|
+
display: block;
|
|
13
|
+
max-width: var(--sds-typography-max-line-width);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([display-type='inline-block']) {
|
|
18
|
+
display: inline-block;
|
|
19
|
+
|
|
20
|
+
.sds-link {
|
|
21
|
+
display: inline-block;
|
|
22
|
+
max-width: var(--sds-typography-max-line-width);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([display-type='inline']) {
|
|
27
|
+
display: inline;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sds-link {
|
|
31
|
+
color: var(--sds-color-semantic-text-default);
|
|
32
|
+
display: inline;
|
|
33
|
+
font-family: var(--sds-typography-font-family);
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
line-height: 1.333;
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
|
|
39
|
+
&:link,
|
|
40
|
+
&:visited {
|
|
41
|
+
color: var(--sds-color-semantic-text-action-default);
|
|
42
|
+
text-decoration: underline;
|
|
43
|
+
text-decoration-thickness: 1px;
|
|
44
|
+
text-underline-offset: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:active {
|
|
48
|
+
color: var(--sds-color-semantic-text-action-active);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
color: var(--sds-color-semantic-text-action-hover);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus {
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
outline: 2px solid var(--sds-color-semantic-border-focus);
|
|
58
|
+
outline-offset: 2px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sds-link--l {
|
|
63
|
+
font-size: 1.125rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sds-link--m {
|
|
67
|
+
font-size: 1rem;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.sds-link--s {
|
|
71
|
+
font-size: 0.875rem;
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
//# sourceMappingURL=sds-link.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-link.styles.js","sourceRoot":"","sources":["../../src/sds-link/sds-link.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuExB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tdisplay: inline;\n\t}\n\n\t:host([display-type='block']) {\n\t\tdisplay: block;\n\t\tmax-width: var(--sds-typography-max-line-width);\n\n\t\t.sds-link {\n\t\t\tdisplay: block;\n\t\t\tmax-width: var(--sds-typography-max-line-width);\n\t\t}\n\t}\n\n\t:host([display-type='inline-block']) {\n\t\tdisplay: inline-block;\n\n\t\t.sds-link {\n\t\t\tdisplay: inline-block;\n\t\t\tmax-width: var(--sds-typography-max-line-width);\n\t\t}\n\t}\n\n\t:host([display-type='inline']) {\n\t\tdisplay: inline;\n\t}\n\n\t.sds-link {\n\t\tcolor: var(--sds-color-semantic-text-default);\n\t\tdisplay: inline;\n\t\tfont-family: var(--sds-typography-font-family);\n\t\tfont-weight: 400;\n\t\tline-height: 1.333;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\n\t\t&:link,\n\t\t&:visited {\n\t\t\tcolor: var(--sds-color-semantic-text-action-default);\n\t\t\ttext-decoration: underline;\n\t\t\ttext-decoration-thickness: 1px;\n\t\t\ttext-underline-offset: 2px;\n\t\t}\n\n\t\t&:active {\n\t\t\tcolor: var(--sds-color-semantic-text-action-active);\n\t\t}\n\n\t\t&:hover {\n\t\t\tcolor: var(--sds-color-semantic-text-action-hover);\n\t\t}\n\n\t\t&:focus {\n\t\t\tborder-radius: 4px;\n\t\t\toutline: 2px solid var(--sds-color-semantic-border-focus);\n\t\t\toutline-offset: 2px;\n\t\t}\n\t}\n\n\t.sds-link--l {\n\t\tfont-size: 1.125rem;\n\t}\n\n\t.sds-link--m {\n\t\tfont-size: 1rem;\n\t}\n\n\t.sds-link--s {\n\t\tfont-size: 0.875rem;\n\t}\n`;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { type ColorType } from '../sds-icon/sds-icon.color-types';
|
|
3
|
+
type LoaderSize = 'large' | 'medium' | 'small';
|
|
4
|
+
export declare class SDSLoader extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
size: LoaderSize;
|
|
7
|
+
color: ColorType;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'sds-loader': SDSLoader;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=sds-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-loader.d.ts","sourceRoot":"","sources":["../../src/sds-loader/sds-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE/C,qBACa,SAAU,SAAQ,UAAU;IAExC,OAAgB,MAAM,4BAAY;IAIlC,IAAI,EAAE,UAAU,CAAW;IAG3B,KAAK,EAAE,SAAS,CAAkB;IAEzB,MAAM;CASf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,YAAY,EAAE,SAAS,CAAC;KACxB;CACD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { styles } from './sds-loader.styles';
|
|
11
|
+
let SDSLoader = class SDSLoader extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
// Reactive Props
|
|
15
|
+
this.size = 'large';
|
|
16
|
+
this.color = 'currentColor';
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const loaderClasses = {
|
|
20
|
+
'sds-loader': true,
|
|
21
|
+
'sds-loader--medium': this.size === 'medium',
|
|
22
|
+
'sds-loader--small': this.size === 'small',
|
|
23
|
+
};
|
|
24
|
+
return html `<span class="${classMap(loaderClasses)}" style="${`color:${this.color}`}"></span> `;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
// Styling
|
|
28
|
+
SDSLoader.styles = [styles];
|
|
29
|
+
__decorate([
|
|
30
|
+
property({ type: String, reflect: true })
|
|
31
|
+
], SDSLoader.prototype, "size", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
property({ type: String, reflect: true })
|
|
34
|
+
], SDSLoader.prototype, "color", void 0);
|
|
35
|
+
SDSLoader = __decorate([
|
|
36
|
+
customElement('sds-loader')
|
|
37
|
+
], SDSLoader);
|
|
38
|
+
export { SDSLoader };
|
|
39
|
+
//# sourceMappingURL=sds-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-loader.js","sourceRoot":"","sources":["../../src/sds-loader/sds-loader.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMtC,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAIN,iBAAiB;QAEjB,SAAI,GAAe,OAAO,CAAC;QAG3B,UAAK,GAAc,cAAc,CAAC;IAWnC,CAAC;IATS,MAAM;QACd,MAAM,aAAa,GAAG;YACrB,YAAY,EAAE,IAAI;YAClB,oBAAoB,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;YAC5C,mBAAmB,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;SAC1C,CAAC;QAEF,OAAO,IAAI,CAAA,gBAAgB,QAAQ,CAAC,aAAa,CAAC,YAAY,SAAS,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC;IACjG,CAAC;;AAlBD,UAAU;AACM,gBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACf;AAG3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACR;AATtB,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAoBrB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-loader.styles';\nimport { type ColorType } from '../sds-icon/sds-icon.color-types';\n\ntype LoaderSize = 'large' | 'medium' | 'small';\n\n@customElement('sds-loader')\nexport class SDSLoader extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true })\n\tsize: LoaderSize = 'large';\n\n\t@property({ type: String, reflect: true })\n\tcolor: ColorType = 'currentColor';\n\n\toverride render() {\n\t\tconst loaderClasses = {\n\t\t\t'sds-loader': true,\n\t\t\t'sds-loader--medium': this.size === 'medium',\n\t\t\t'sds-loader--small': this.size === 'small',\n\t\t};\n\n\t\treturn html`<span class=\"${classMap(loaderClasses)}\" style=\"${`color:${this.color}`}\"></span> `;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-loader': SDSLoader;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-loader.styles.d.ts","sourceRoot":"","sources":["../../src/sds-loader/sds-loader.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAoClB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
line-height: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sds-loader {
|
|
8
|
+
width: 24px;
|
|
9
|
+
height: 24px;
|
|
10
|
+
border: 3px solid currentColor;
|
|
11
|
+
border-bottom-color: transparent;
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
animation: rotation 1s linear infinite;
|
|
16
|
+
|
|
17
|
+
&.sds-loader--medium {
|
|
18
|
+
width: 18px;
|
|
19
|
+
height: 18px;
|
|
20
|
+
border-width: 2px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.sds-loader--small {
|
|
24
|
+
width: 14px;
|
|
25
|
+
height: 14px;
|
|
26
|
+
border-width: 2px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes rotation {
|
|
31
|
+
0% {
|
|
32
|
+
transform: rotate(0deg);
|
|
33
|
+
}
|
|
34
|
+
100% {
|
|
35
|
+
transform: rotate(360deg);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
//# sourceMappingURL=sds-loader.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-loader.styles.js","sourceRoot":"","sources":["../../src/sds-loader/sds-loader.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tline-height: 0;\n\t}\n\n\t.sds-loader {\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder: 3px solid currentColor;\n\t\tborder-bottom-color: transparent;\n\t\tborder-radius: 50%;\n\t\tdisplay: inline-block;\n\t\tbox-sizing: border-box;\n\t\tanimation: rotation 1s linear infinite;\n\n\t\t&.sds-loader--medium {\n\t\t\twidth: 18px;\n\t\t\theight: 18px;\n\t\t\tborder-width: 2px;\n\t\t}\n\n\t\t&.sds-loader--small {\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tborder-width: 2px;\n\t\t}\n\t}\n\n\t@keyframes rotation {\n\t\t0% {\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\t\t100% {\n\t\t\ttransform: rotate(360deg);\n\t\t}\n\t}\n`;\n"]}
|
|
@@ -13,7 +13,6 @@ export declare class SDSNavCard extends LitElement {
|
|
|
13
13
|
size: 'large' | 'medium' | 'small';
|
|
14
14
|
heading: string;
|
|
15
15
|
level: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
16
|
-
text: string;
|
|
17
16
|
link: string;
|
|
18
17
|
private hasIcon;
|
|
19
18
|
private iconSlot;
|
|
@@ -22,7 +21,7 @@ export declare class SDSNavCard extends LitElement {
|
|
|
22
21
|
private _filterToMeaningfulNodes;
|
|
23
22
|
private _checkSlotContent;
|
|
24
23
|
private _renderHeading;
|
|
25
|
-
render(): import("lit
|
|
24
|
+
render(): import("lit").TemplateResult<1>;
|
|
26
25
|
}
|
|
27
26
|
declare global {
|
|
28
27
|
interface HTMLElementTagNameMap {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-nav-card.d.ts","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,qBACa,UAAW,SAAQ,UAAU;IACzC;;;;;;;;OAQG;IAGH,OAAgB,MAAM,4BAAY;IAIlC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAW;IAG7C,OAAO,EAAG,MAAM,CAAC;IAGjB,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAG/C,IAAI,EAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-nav-card.d.ts","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,qBACa,UAAW,SAAQ,UAAU;IACzC;;;;;;;;OAQG;IAGH,OAAgB,MAAM,4BAAY;IAIlC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAW;IAG7C,OAAO,EAAG,MAAM,CAAC;IAGjB,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAG/C,IAAI,EAAG,MAAM,CAAC;IAId,OAAO,CAAC,OAAO,CAAkB;IAGjC,OAAO,CAAC,QAAQ,CAAmB;IAE1B,YAAY;IAIrB,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,wBAAwB;IAWhC,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,cAAc;IAmBb,MAAM;CAmBf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,cAAc,EAAE,UAAU,CAAC;KAC3B;CACD"}
|
|
@@ -75,12 +75,10 @@ let SDSNavCard = class SDSNavCard extends LitElement {
|
|
|
75
75
|
};
|
|
76
76
|
return html `
|
|
77
77
|
<a class="${classMap(navCardClasses)}" href="${this.link}">
|
|
78
|
-
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
78
|
+
<slot name="before" @slotchange=${this._handleSlotChange}></slot>
|
|
79
79
|
<div class="sds-nav-card__content">
|
|
80
80
|
${this._renderHeading()}
|
|
81
|
-
|
|
82
|
-
? ''
|
|
83
|
-
: html `<p class="sds-nav-card__text">${this.text}</p>`}
|
|
81
|
+
<slot></slot>
|
|
84
82
|
</div>
|
|
85
83
|
</a>
|
|
86
84
|
`;
|
|
@@ -89,19 +87,16 @@ let SDSNavCard = class SDSNavCard extends LitElement {
|
|
|
89
87
|
// Styling
|
|
90
88
|
SDSNavCard.styles = [styles];
|
|
91
89
|
__decorate([
|
|
92
|
-
property({ type: String })
|
|
90
|
+
property({ type: String, reflect: true })
|
|
93
91
|
], SDSNavCard.prototype, "size", void 0);
|
|
94
92
|
__decorate([
|
|
95
|
-
property({ type: String })
|
|
93
|
+
property({ type: String, reflect: true })
|
|
96
94
|
], SDSNavCard.prototype, "heading", void 0);
|
|
97
95
|
__decorate([
|
|
98
|
-
property({ type: String })
|
|
96
|
+
property({ type: String, reflect: true })
|
|
99
97
|
], SDSNavCard.prototype, "level", void 0);
|
|
100
98
|
__decorate([
|
|
101
|
-
property({ type: String })
|
|
102
|
-
], SDSNavCard.prototype, "text", void 0);
|
|
103
|
-
__decorate([
|
|
104
|
-
property({ type: String })
|
|
99
|
+
property({ type: String, reflect: true })
|
|
105
100
|
], SDSNavCard.prototype, "link", void 0);
|
|
106
101
|
__decorate([
|
|
107
102
|
state()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-nav-card.js","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGxC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;QACN;;;;;;;;WAQG;;QAKH,iBAAiB;QAEjB,SAAI,GAAiC,OAAO,CAAC;QAM7C,UAAK,GAAqC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-nav-card.js","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGxC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;QACN;;;;;;;;WAQG;;QAKH,iBAAiB;QAEjB,SAAI,GAAiC,OAAO,CAAC;QAM7C,UAAK,GAAqC,IAAI,CAAC;QAK/C,yBAAyB;QAEjB,YAAO,GAAY,KAAK,CAAC;IAqElC,CAAC;IAhES,YAAY;QACpB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAEO,iBAAiB;QACxB,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC1B,CAAC;IAED,sDAAsD;IAC9C,wBAAwB,CAAC,KAAa;QAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5B,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;gBACtC,MAAM,WAAW,GAAI,IAAa,CAAC,WAAW,CAAC;gBAC/C,OAAO,WAAW,KAAK,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;YAC9D,CAAC;YACD,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,qEAAqE;IAC7D,iBAAiB;QACxB,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG,IAAI,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC,MAAM,KAAK,CAAC,CAAC;IAC7C,CAAC;IAEO,cAAc;QACrB,MAAM,YAAY,GAAG,uBAAuB,CAAC;QAE7C,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;YACpB,KAAK,IAAI;gBACR,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;YAC/D,KAAK,IAAI;gBACR,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;YAC/D,KAAK,IAAI;gBACR,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;YAC/D,KAAK,IAAI;gBACR,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;YAC/D,KAAK,IAAI;gBACR,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;YAC/D;gBACC,OAAO,IAAI,CAAA,cAAc,YAAY,KAAK,IAAI,CAAC,OAAO,OAAO,CAAC;QAChE,CAAC;IACF,CAAC;IAEQ,MAAM;QACd,MAAM,cAAc,GAAG;YACtB,cAAc,EAAE,IAAI;YACpB,uBAAuB,EAAE,IAAI,CAAC,OAAO;YACrC,qBAAqB,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;YAC5C,sBAAsB,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;YAC9C,qBAAqB,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;SAC5C,CAAC;QAEF,OAAO,IAAI,CAAA;eACE,QAAQ,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,IAAI;sCACrB,IAAI,CAAC,iBAAiB;;OAErD,IAAI,CAAC,cAAc,EAAE;;;;GAIzB,CAAC;IACH,CAAC;;AAtFD,UAAU;AACM,iBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACG;AAG7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACzB;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACK;AAG/C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAC5B;AAIN;IADP,KAAK,EAAE;2CACyB;AAGzB;IADP,KAAK,CAAC,MAAM,CAAC;4CACqB;AAhCvB,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CAkGtB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-nav-card.styles';\n\n@customElement('sds-nav-card')\nexport class SDSNavCard extends LitElement {\n\t/**\n\t * This is the navigation card component\n\t *\n\t * @remarks The way the icon is handled now, causes a double update/side effect when loading the webpage.\n\t * The svg that should be placed inside the slot, currently needs have its stroke attribute manually removed,\n\t * in order for the components CSS to insert its own stroke color.\n\t * This should be looked more into.\n\t *\n\t */\n\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true })\n\tsize: 'large' | 'medium' | 'small' = 'large';\n\n\t@property({ type: String, reflect: true })\n\theading!: string;\n\n\t@property({ type: String, reflect: true })\n\tlevel: 'h2' | 'h3' | 'h4' | 'h5' | 'h6' = 'h2';\n\n\t@property({ type: String, reflect: true })\n\tlink!: string;\n\n\t// Managing the icon slot\n\t@state()\n\tprivate hasIcon: boolean = false;\n\n\t@query('slot')\n\tprivate iconSlot!: HTMLSlotElement;\n\n\toverride firstUpdated() {\n\t\tthis._checkSlotContent();\n\t}\n\n\tprivate _handleSlotChange() {\n\t\tthis._checkSlotContent();\n\t}\n\n\t// Filters out text nodes that only contain whitespace\n\tprivate _filterToMeaningfulNodes(nodes: Node[]) {\n\t\treturn nodes.filter((node) => {\n\t\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\t\tconst textContent = (node as Text).textContent;\n\t\t\t\treturn textContent !== null && textContent.trim().length > 0;\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t}\n\n\t// Checks if the icon slot has content and updates the state variable\n\tprivate _checkSlotContent() {\n\t\tconst assignedNodes = this.iconSlot.assignedNodes({ flatten: true });\n\t\tconst meaningfulNodes = this._filterToMeaningfulNodes(assignedNodes);\n\t\tthis.hasIcon = meaningfulNodes.length !== 0;\n\t}\n\n\tprivate _renderHeading() {\n\t\tconst headingClass = 'sds-nav-card__heading';\n\n\t\tswitch (this.level) {\n\t\t\tcase 'h2':\n\t\t\t\treturn html`<h2 class=\"${headingClass}\">${this.heading}</h2>`;\n\t\t\tcase 'h3':\n\t\t\t\treturn html`<h3 class=\"${headingClass}\">${this.heading}</h3>`;\n\t\t\tcase 'h4':\n\t\t\t\treturn html`<h4 class=\"${headingClass}\">${this.heading}</h4>`;\n\t\t\tcase 'h5':\n\t\t\t\treturn html`<h5 class=\"${headingClass}\">${this.heading}</h5>`;\n\t\t\tcase 'h6':\n\t\t\t\treturn html`<h6 class=\"${headingClass}\">${this.heading}</h6>`;\n\t\t\tdefault:\n\t\t\t\treturn html`<h2 class=\"${headingClass}\">${this.heading}</h2>`;\n\t\t}\n\t}\n\n\toverride render() {\n\t\tconst navCardClasses = {\n\t\t\t'sds-nav-card': true,\n\t\t\t'sds-nav-card--hasIcon': this.hasIcon,\n\t\t\t'sds-nav-card--small': this.size === 'small',\n\t\t\t'sds-nav-card--medium': this.size === 'medium',\n\t\t\t'sds-nav-card--large': this.size === 'large',\n\t\t};\n\n\t\treturn html`\n\t\t\t<a class=\"${classMap(navCardClasses)}\" href=\"${this.link}\">\n\t\t\t\t<slot name=\"before\" @slotchange=${this._handleSlotChange}></slot>\n\t\t\t\t<div class=\"sds-nav-card__content\">\n\t\t\t\t\t${this._renderHeading()}\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</div>\n\t\t\t</a>\n\t\t`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-nav-card': SDSNavCard;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-nav-card.styles.js","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0JxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t.sds-nav-card {\n\t\tcolor: var(--sds-color-semantic-text-default);\n\t\tbackground-color: var(\n\t\t\t--sds-color-global-lightblue-100\n\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\n\t\tfont-size: var(--sds-typography-base-font-size);\n\t\tline-height: var(--sds-typography-base-line-height);\n\t\tfont-weight: var(--sds-typography-base-font-weight);\n\t\tfont-family: var(--sds-typography-font-family);\n\n\t\tdisplay: flex;\n\t\tmin-height: 10.25rem;\n\t\theight: 100%;\n\t\twidth: 100%;\n\t\tmax-width: 50rem;\n\n\t\tbox-sizing: border-box;\n\t\tpadding: var(--sds-spacing-7) var(--sds-spacing-9) var(--sds-spacing-8);\n\t\tgap: var(--sds-spacing-5);\n\t\ttext-align: left;\n\n\t\tborder-radius: var(--sds-radius-card);\n\t\tborder: 1px solid transparent;\n\n\t\tcursor: pointer;\n\n\t\t& p {\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\thyphens: auto;\n\t\t}\n\n\t\t&:link {\n\t\t\ttext-decoration: none;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: var(\n\t\t\t\t--sds-color-global-lightblue-300\n\t\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\n\t\t\t.sds-nav-card__heading {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\n\t\t&:active,\n\t\t&:focus:active {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-action-selected);\n\t\t\tcolor: var(--sds-color-semantic-text-on-action);\n\n\t\t\t.sds-nav-card__heading {\n\t\t\t\ttext-decoration: underline;\n\t\t\t\ttext-decoration-thickness: 0.075rem;\n\t\t\t}\n\n\t\t\t::slotted(*) {\n\t\t\t\tstroke: var(--sds-color-semantic-icon-on-action);\n\t\t\t}\n\t\t}\n\n\t\t&:focus {\n\t\t\tborder: 1px solid var(--sds-color-semantic-border-focus);\n\t\t\tbackground: var(\n\t\t\t\t--sds-color-global-lightblue-100\n\t\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\t\t}\n\n\t\t&:disabled {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-disabled);\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t.sds-nav-card--hasIcon {\n\t\tpadding: var(--sds-spacing-7) var(--sds-spacing-7) var(--sds-spacing-8);\n\t}\n\n\t.sds-nav-card__content {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tgap: var(--sds-spacing-3);\n\t}\n\n\t.sds-nav-card__text {\n\t\tdisplay: -webkit-box;\n\t\t-webkit-line-clamp: 3;\n\t\t-webkit-box-orient: vertical;\n\t\toverflow: hidden;\n\t}\n\n\t::slotted(*) {\n\t\theight: 4.5rem;\n\t\tmin-width: 4.5rem;\n\t\twidth: 4.5rem;\n\t\talign-self: center;\n\t\tstroke: var(\n\t\t\t--sds-color-global-black\n\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\t}\n\n\t.sds-nav-card__heading {\n\t\tfont-weight:
|
|
1
|
+
{"version":3,"file":"sds-nav-card.styles.js","sourceRoot":"","sources":["../../src/sds-nav-card/sds-nav-card.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0JxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n\t.sds-nav-card {\n\t\tcolor: var(--sds-color-semantic-text-default);\n\t\tbackground-color: var(\n\t\t\t--sds-color-global-lightblue-100\n\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\n\t\tfont-size: var(--sds-typography-base-font-size);\n\t\tline-height: var(--sds-typography-base-line-height);\n\t\tfont-weight: var(--sds-typography-base-font-weight);\n\t\tfont-family: var(--sds-typography-font-family);\n\n\t\tdisplay: flex;\n\t\tmin-height: 10.25rem;\n\t\theight: 100%;\n\t\twidth: 100%;\n\t\tmax-width: 50rem;\n\n\t\tbox-sizing: border-box;\n\t\tpadding: var(--sds-spacing-7) var(--sds-spacing-9) var(--sds-spacing-8);\n\t\tgap: var(--sds-spacing-5);\n\t\ttext-align: left;\n\n\t\tborder-radius: var(--sds-radius-card);\n\t\tborder: 1px solid transparent;\n\n\t\tcursor: pointer;\n\n\t\t& p {\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\thyphens: auto;\n\t\t}\n\n\t\t&:link {\n\t\t\ttext-decoration: none;\n\t\t}\n\n\t\t&:hover {\n\t\t\tbackground-color: var(\n\t\t\t\t--sds-color-global-lightblue-300\n\t\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\n\t\t\t.sds-nav-card__heading {\n\t\t\t\ttext-decoration: none;\n\t\t\t}\n\t\t}\n\n\t\t&:active,\n\t\t&:focus:active {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-action-selected);\n\t\t\tcolor: var(--sds-color-semantic-text-on-action);\n\n\t\t\t.sds-nav-card__heading {\n\t\t\t\ttext-decoration: underline;\n\t\t\t\ttext-decoration-thickness: 0.075rem;\n\t\t\t}\n\n\t\t\t::slotted(*) {\n\t\t\t\tstroke: var(--sds-color-semantic-icon-on-action);\n\t\t\t}\n\t\t}\n\n\t\t&:focus {\n\t\t\tborder: 1px solid var(--sds-color-semantic-border-focus);\n\t\t\tbackground: var(\n\t\t\t\t--sds-color-global-lightblue-100\n\t\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\t\t}\n\n\t\t&:disabled {\n\t\t\tbackground-color: var(--sds-color-semantic-surface-disabled);\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t.sds-nav-card--hasIcon {\n\t\tpadding: var(--sds-spacing-7) var(--sds-spacing-7) var(--sds-spacing-8);\n\t}\n\n\t.sds-nav-card__content {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\twidth: 100%;\n\t\tgap: var(--sds-spacing-3);\n\t}\n\n\t.sds-nav-card__text {\n\t\tdisplay: -webkit-box;\n\t\t-webkit-line-clamp: 3;\n\t\t-webkit-box-orient: vertical;\n\t\toverflow: hidden;\n\t}\n\n\t::slotted(*) {\n\t\theight: 4.5rem;\n\t\tmin-width: 4.5rem;\n\t\twidth: 4.5rem;\n\t\talign-self: center;\n\t\tstroke: var(\n\t\t\t--sds-color-global-black\n\t\t); // TODO: Global variable used, should be replaced by a more spesific one\n\t}\n\n\t.sds-nav-card__heading {\n\t\tfont-weight: 700;\n\t\tfont-size: 1.5rem;\n\t\tmargin: 0;\n\t\ttext-decoration: underline;\n\t\ttext-decoration-thickness: 0.075rem;\n\t\ttext-underline-offset: 0.146rem;\n\t}\n\n\t.sds-nav-card--medium {\n\t\tmin-height: 7rem;\n\n\t\t.sds-nav-card__text {\n\t\t\tdisplay: -webkit-box;\n\t\t\tdisplay: flex;\n\n\t\t\t-webkit-line-clamp: 1;\n\t\t\t-webkit-box-orient: vertical;\n\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t::slotted(*) {\n\t\t\theight: 3rem;\n\t\t\tmin-width: 3rem;\n\t\t\twidth: 3rem;\n\t\t}\n\t}\n\n\t.sds-nav-card--small {\n\t\tmin-height: 4.5rem;\n\t\tpadding: var(--sds-spacing-5) var(--sds-spacing-8) var(--sds-spacing-6);\n\n\t\t.sds-nav-card--hasIcon {\n\t\t\tpadding: var(--sds-spacing-5) var(--sds-spacing-7)\n\t\t\t\tvar(--sds-spacing-6);\n\t\t}\n\n\t\t.sds-nav-card__content {\n\t\t\tgap: 0;\n\t\t\talign-self: center;\n\t\t}\n\n\t\t::slotted(*) {\n\t\t\theight: 2.5rem;\n\t\t\tmin-width: 2.5rem;\n\t\t\twidth: 2.5rem;\n\t\t}\n\t}\n`;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import '../sds-icon/sds-icon';
|
|
3
|
+
type NotificationVariant = 'info' | 'success' | 'attention' | 'warning' | 'critical';
|
|
4
|
+
export declare class SDSNotification extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
variant: NotificationVariant;
|
|
7
|
+
removableLabel?: string;
|
|
8
|
+
private readonly _remove;
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'sds-notification': SDSNotification;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=sds-notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-notification.d.ts","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AAMhD,OAAO,sBAAsB,CAAC;AAE9B,KAAK,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAUrF,qBACa,eAAgB,SAAQ,UAAU;IAE9C,OAAgB,MAAM,4BAAY;IAIlC,OAAO,EAAE,mBAAmB,CAAU;IAGtC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAOtB;IAEO,MAAM;CA2Bf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,kBAAkB,EAAE,eAAe,CAAC;KACpC;CACD"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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, nothing } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
+
import { styles } from './sds-notification.styles';
|
|
11
|
+
import '../sds-icon/sds-icon';
|
|
12
|
+
const notificationIcons = {
|
|
13
|
+
info: 'info-material-filled',
|
|
14
|
+
success: 'check_circle-material-filled',
|
|
15
|
+
attention: 'error-material-filled',
|
|
16
|
+
warning: 'warning-material-filled',
|
|
17
|
+
critical: 'dangerous-material-filled',
|
|
18
|
+
};
|
|
19
|
+
let SDSNotification = class SDSNotification extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
// Reactive Props
|
|
23
|
+
this.variant = 'info';
|
|
24
|
+
this._remove = () => {
|
|
25
|
+
this.dispatchEvent(new CustomEvent('sds-remove', {
|
|
26
|
+
bubbles: true,
|
|
27
|
+
composed: true,
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const notificationClasses = {
|
|
33
|
+
'sds-notification': true,
|
|
34
|
+
[`sds-notification--${this.variant}`]: true,
|
|
35
|
+
};
|
|
36
|
+
return html `<div class="${classMap(notificationClasses)}">
|
|
37
|
+
<div class="sds-notification__type">
|
|
38
|
+
<sds-icon class="sds-notification__icon" name="${notificationIcons[this.variant]}" size="m"></sds-icon>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="sds-notification__content">
|
|
41
|
+
<div class="sds-notification__content-text">
|
|
42
|
+
<slot name="title"></slot>
|
|
43
|
+
<slot name="message"></slot>
|
|
44
|
+
</div>
|
|
45
|
+
${this.removableLabel
|
|
46
|
+
? html `<button
|
|
47
|
+
class="sds-notification__remove-btn"
|
|
48
|
+
@click=${this._remove}
|
|
49
|
+
aria-label="${this.removableLabel}"
|
|
50
|
+
>
|
|
51
|
+
<sds-icon name="close-material-outlined" size="s"></sds-icon>
|
|
52
|
+
</button>`
|
|
53
|
+
: nothing}
|
|
54
|
+
</div>
|
|
55
|
+
</div>`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
// Styling
|
|
59
|
+
SDSNotification.styles = [styles];
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: String, reflect: true })
|
|
62
|
+
], SDSNotification.prototype, "variant", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: String, attribute: 'removable-label', reflect: true })
|
|
65
|
+
], SDSNotification.prototype, "removableLabel", void 0);
|
|
66
|
+
SDSNotification = __decorate([
|
|
67
|
+
customElement('sds-notification')
|
|
68
|
+
], SDSNotification);
|
|
69
|
+
export { SDSNotification };
|
|
70
|
+
//# sourceMappingURL=sds-notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-notification.js","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD,OAAO,sBAAsB,CAAC;AAI9B,MAAM,iBAAiB,GAA0C;IAChE,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,8BAA8B;IACvC,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,yBAAyB;IAClC,QAAQ,EAAE,2BAA2B;CACrC,CAAC;AAGK,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAIN,iBAAiB;QAEjB,YAAO,GAAwB,MAAM,CAAC;QAKrB,YAAO,GAAG,GAAG,EAAE;YAC/B,IAAI,CAAC,aAAa,CACjB,IAAI,WAAW,CAAC,YAAY,EAAE;gBAC7B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACd,CAAC,CACF,CAAC;QACH,CAAC,CAAC;IA6BH,CAAC;IA3BS,MAAM;QACd,MAAM,mBAAmB,GAAG;YAC3B,kBAAkB,EAAE,IAAI;YACxB,CAAC,qBAAqB,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI;SAC3C,CAAC;QAEF,OAAO,IAAI,CAAA,eAAe,QAAQ,CAAC,mBAAmB,CAAC;;qDAEJ,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC;;;;;;;MAO9E,IAAI,CAAC,cAAc;YACpB,CAAC,CAAC,IAAI,CAAA;;gBAEK,IAAI,CAAC,OAAO;qBACP,IAAI,CAAC,cAAc;;;gBAGxB;YACX,CAAC,CAAC,OAAO;;SAEL,CAAC;IACT,CAAC;;AA7CD,UAAU;AACM,sBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACJ;AAGtC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDAChD;AATZ,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CA+C3B","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './sds-notification.styles';\nimport { type IconType } from 'src/sds-icon/sds-icon.icon-types';\n\nimport '../sds-icon/sds-icon';\n\ntype NotificationVariant = 'info' | 'success' | 'attention' | 'warning' | 'critical';\n\nconst notificationIcons: Record<NotificationVariant, IconType> = {\n\tinfo: 'info-material-filled',\n\tsuccess: 'check_circle-material-filled',\n\tattention: 'error-material-filled',\n\twarning: 'warning-material-filled',\n\tcritical: 'dangerous-material-filled',\n};\n\n@customElement('sds-notification')\nexport class SDSNotification extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true })\n\tvariant: NotificationVariant = 'info';\n\n\t@property({ type: String, attribute: 'removable-label', reflect: true })\n\tremovableLabel?: string;\n\n\tprivate readonly _remove = () => {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent('sds-remove', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t})\n\t\t);\n\t};\n\n\toverride render() {\n\t\tconst notificationClasses = {\n\t\t\t'sds-notification': true,\n\t\t\t[`sds-notification--${this.variant}`]: true,\n\t\t};\n\n\t\treturn html`<div class=\"${classMap(notificationClasses)}\">\n\t\t\t<div class=\"sds-notification__type\">\n\t\t\t\t<sds-icon class=\"sds-notification__icon\" name=\"${notificationIcons[this.variant]}\" size=\"m\"></sds-icon>\n\t\t\t</div>\n\t\t\t<div class=\"sds-notification__content\">\n\t\t\t\t<div class=\"sds-notification__content-text\">\n\t\t\t\t\t<slot name=\"title\"></slot>\n\t\t\t\t\t<slot name=\"message\"></slot>\n\t\t\t\t</div>\n\t\t\t\t${this.removableLabel\n\t\t\t\t\t? html`<button\n\t\t\t\t\t\t\tclass=\"sds-notification__remove-btn\"\n\t\t\t\t\t\t\t@click=${this._remove}\n\t\t\t\t\t\t\taria-label=\"${this.removableLabel}\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<sds-icon name=\"close-material-outlined\" size=\"s\"></sds-icon>\n\t\t\t\t\t\t</button>`\n\t\t\t\t\t: nothing}\n\t\t\t</div>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-notification': SDSNotification;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-notification.styles.d.ts","sourceRoot":"","sources":["../../src/sds-notification/sds-notification.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA6JlB,CAAC"}
|