@politiet/sheriff-web-components 2.1.3 → 2.2.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/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sds-alert/sds-alert.component.d.ts +25 -0
- package/dist/sds-alert/sds-alert.component.d.ts.map +1 -0
- package/dist/sds-alert/sds-alert.component.js +73 -0
- package/dist/sds-alert/sds-alert.component.js.map +1 -0
- package/dist/sds-alert/sds-alert.d.ts +3 -19
- package/dist/sds-alert/sds-alert.d.ts.map +1 -1
- package/dist/sds-alert/sds-alert.js +2 -55
- package/dist/sds-alert/sds-alert.js.map +1 -1
- package/dist/sds-alert/sds-alert.styles.d.ts.map +1 -1
- package/dist/sds-alert/sds-alert.styles.js +5 -4
- package/dist/sds-alert/sds-alert.styles.js.map +1 -1
- package/dist/sds-button/sds-button.component.d.ts +44 -0
- package/dist/sds-button/sds-button.component.d.ts.map +1 -0
- package/dist/sds-button/sds-button.component.js +159 -0
- package/dist/sds-button/sds-button.component.js.map +1 -0
- package/dist/sds-button/sds-button.d.ts +2 -42
- package/dist/sds-button/sds-button.d.ts.map +1 -1
- package/dist/sds-button/sds-button.js +2 -151
- package/dist/sds-button/sds-button.js.map +1 -1
- package/dist/sds-heading/sds-heading.component.d.ts +16 -0
- package/dist/sds-heading/sds-heading.component.d.ts.map +1 -0
- package/dist/sds-heading/sds-heading.component.js +50 -0
- package/dist/sds-heading/sds-heading.component.js.map +1 -0
- package/dist/sds-heading/sds-heading.d.ts +2 -14
- package/dist/sds-heading/sds-heading.d.ts.map +1 -1
- package/dist/sds-heading/sds-heading.js +2 -42
- package/dist/sds-heading/sds-heading.js.map +1 -1
- package/dist/sds-icon/sds-icon.component.d.ts +31 -0
- package/dist/sds-icon/sds-icon.component.d.ts.map +1 -0
- package/dist/sds-icon/sds-icon.component.js +73 -0
- package/dist/sds-icon/sds-icon.component.js.map +1 -0
- package/dist/sds-icon/sds-icon.d.ts +2 -29
- package/dist/sds-icon/sds-icon.d.ts.map +1 -1
- package/dist/sds-icon/sds-icon.js +3 -67
- package/dist/sds-icon/sds-icon.js.map +1 -1
- package/dist/sds-text/sds-text.component.d.ts +17 -0
- package/dist/sds-text/sds-text.component.d.ts.map +1 -0
- package/dist/sds-text/sds-text.component.js +33 -0
- package/dist/sds-text/sds-text.component.js.map +1 -0
- package/dist/sds-text/sds-text.d.ts +2 -15
- package/dist/sds-text/sds-text.d.ts.map +1 -1
- package/dist/sds-text/sds-text.js +2 -25
- package/dist/sds-text/sds-text.js.map +1 -1
- package/dist/sheriff-web-components.js +118 -114
- package/package.json +1 -1
|
@@ -4,75 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
var SDSIcon_1;
|
|
8
|
-
import { LitElement, html } from 'lit';
|
|
9
|
-
import { property, state } from 'lit/decorators.js';
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
|
-
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
12
|
-
import { SDSIconLoader } from './sds-icon-loader';
|
|
13
7
|
import { guardedCustomElement } from '../utils/guarded-custom-element';
|
|
14
|
-
import {
|
|
15
|
-
let SDSIcon =
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.name = '';
|
|
19
|
-
this.color = '';
|
|
20
|
-
this.label = '';
|
|
21
|
-
this.svg = '';
|
|
22
|
-
}
|
|
23
|
-
static setLoadLocal(loadLocal) {
|
|
24
|
-
this.iconLoader.loadLocal = loadLocal;
|
|
25
|
-
}
|
|
26
|
-
static registerResolver(resolver) {
|
|
27
|
-
this.iconLoader.resolver = resolver;
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
return html `
|
|
31
|
-
<div class="sds-icon" role="${ifDefined(this.label ? 'img' : undefined)}" style="${ifDefined(this.color ? `color:${this.color}` : undefined)}" aria-label="${ifDefined(this.label)}">
|
|
32
|
-
${this.name ? html `<slot aria-hidden="true">${unsafeSVG(this.svg)}</slot>` : html `<slot aria-hidden="true"></slot>`}
|
|
33
|
-
</div>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Wraps the icon loader's callback in a promise. Even if the loader
|
|
38
|
-
* calls the callback synchronously, awaiting the promise defers the
|
|
39
|
-
* property update to the next microtask.
|
|
40
|
-
*/
|
|
41
|
-
async fetchIcon() {
|
|
42
|
-
if (!this.name) {
|
|
43
|
-
this.svg = '';
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const svg = await new Promise((resolve) => {
|
|
47
|
-
SDSIcon_1.iconLoader.resolve(this.name, resolve);
|
|
48
|
-
});
|
|
49
|
-
this.svg = svg;
|
|
50
|
-
}
|
|
51
|
-
updated(changedProperties) {
|
|
52
|
-
super.updated(changedProperties);
|
|
53
|
-
if (changedProperties.has('name') && this.name) {
|
|
54
|
-
void this.fetchIcon();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
8
|
+
import { SDSIconComponent } from './sds-icon.component';
|
|
9
|
+
let SDSIcon = class SDSIcon extends SDSIconComponent {
|
|
57
10
|
};
|
|
58
|
-
SDSIcon
|
|
59
|
-
SDSIcon.iconLoader = new SDSIconLoader();
|
|
60
|
-
__decorate([
|
|
61
|
-
property({ type: String, reflect: true })
|
|
62
|
-
], SDSIcon.prototype, "name", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
property({ type: String, reflect: true })
|
|
65
|
-
], SDSIcon.prototype, "size", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
property({ type: String, reflect: true })
|
|
68
|
-
], SDSIcon.prototype, "color", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
property({ type: String, reflect: true })
|
|
71
|
-
], SDSIcon.prototype, "label", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
state()
|
|
74
|
-
], SDSIcon.prototype, "svg", void 0);
|
|
75
|
-
SDSIcon = SDSIcon_1 = __decorate([
|
|
11
|
+
SDSIcon = __decorate([
|
|
76
12
|
guardedCustomElement('sds-icon')
|
|
77
13
|
], SDSIcon);
|
|
78
14
|
export { SDSIcon };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-icon.js","sourceRoot":"","sources":["../../src/sds-icon/sds-icon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sds-icon.js","sourceRoot":"","sources":["../../src/sds-icon/sds-icon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGjD,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,gBAAgB;CAAG,CAAA;AAAnC,OAAO;IADnB,oBAAoB,CAAC,UAAU,CAAC;GACpB,OAAO,CAA4B","sourcesContent":["import { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { SDSIconComponent } from './sds-icon.component';\n\n@guardedCustomElement('sds-icon')\nexport class SDSIcon extends SDSIconComponent {}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-icon': SDSIcon;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SDS_SIZES } from '../types';
|
|
3
|
+
type Size = SDS_SIZES;
|
|
4
|
+
export interface SDSTextProps {
|
|
5
|
+
size?: Size;
|
|
6
|
+
strong?: boolean;
|
|
7
|
+
tall?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class SDSTextComponent extends LitElement {
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
size: Size;
|
|
12
|
+
strong: boolean;
|
|
13
|
+
tall: boolean;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=sds-text.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-text.component.d.ts","sourceRoot":"","sources":["../../src/sds-text/sds-text.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,KAAK,IAAI,GAAG,SAAS,CAAC;AAEtB,MAAM,WAAW,YAAY;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,qBAAa,gBAAiB,SAAQ,UAAU;IAE/C,OAAgB,MAAM,4BAAY;IAGS,IAAI,EAAE,IAAI,CAAQ;IACjB,MAAM,EAAE,OAAO,CAAS;IACxB,IAAI,EAAE,OAAO,CAAS;IAEzD,MAAM;CAGf"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { styles } from './sds-text.styles';
|
|
10
|
+
export class SDSTextComponent extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
// Reactive Props
|
|
14
|
+
this.size = 'md';
|
|
15
|
+
this.strong = false;
|
|
16
|
+
this.tall = false;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return html `<p><slot></slot></p>`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Styling
|
|
23
|
+
SDSTextComponent.styles = [styles];
|
|
24
|
+
__decorate([
|
|
25
|
+
property({ type: String, reflect: true })
|
|
26
|
+
], SDSTextComponent.prototype, "size", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
property({ type: Boolean, reflect: true })
|
|
29
|
+
], SDSTextComponent.prototype, "strong", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
property({ type: Boolean, reflect: true })
|
|
32
|
+
], SDSTextComponent.prototype, "tall", void 0);
|
|
33
|
+
//# sourceMappingURL=sds-text.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sds-text.component.js","sourceRoot":"","sources":["../../src/sds-text/sds-text.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAW3C,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QAIC,iBAAiB;QAC0B,SAAI,GAAS,IAAI,CAAC;QACjB,WAAM,GAAY,KAAK,CAAC;QACxB,SAAI,GAAY,KAAK,CAAC;IAKnE,CAAC;IAHS,MAAM;QACd,OAAO,IAAI,CAAA,sBAAsB,CAAC;IACnC,CAAC;;AAVD,UAAU;AACM,uBAAM,GAAG,CAAC,MAAM,CAAC,AAAX,CAAY;AAGS;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAmB;AACjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAyB;AACxB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAuB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { styles } from './sds-text.styles';\nimport { SDS_SIZES } from '../types';\n\ntype Size = SDS_SIZES;\n\nexport interface SDSTextProps {\n\tsize?: Size;\n\tstrong?: boolean;\n\ttall?: boolean;\n}\n\nexport class SDSTextComponent extends LitElement {\n\t// Styling\n\tstatic override styles = [styles];\n\n\t// Reactive Props\n\t@property({ type: String, reflect: true }) size: Size = 'md';\n\t@property({ type: Boolean, reflect: true }) strong: boolean = false;\n\t@property({ type: Boolean, reflect: true }) tall: boolean = false;\n\n\toverride render() {\n\t\treturn html`<p><slot></slot></p>`;\n\t}\n}\n"]}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
type Size = SDS_SIZES;
|
|
4
|
-
export interface SDSTextProps {
|
|
5
|
-
size?: Size;
|
|
6
|
-
strong?: boolean;
|
|
7
|
-
tall?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class SDSText extends LitElement {
|
|
10
|
-
static styles: import("lit").CSSResult[];
|
|
11
|
-
size: Size;
|
|
12
|
-
strong: boolean;
|
|
13
|
-
tall: boolean;
|
|
14
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
1
|
+
import { SDSTextComponent } from './sds-text.component';
|
|
2
|
+
export declare class SDSText extends SDSTextComponent {
|
|
15
3
|
}
|
|
16
4
|
declare global {
|
|
17
5
|
interface HTMLElementTagNameMap {
|
|
18
6
|
'sds-text': SDSText;
|
|
19
7
|
}
|
|
20
8
|
}
|
|
21
|
-
export {};
|
|
22
9
|
//# sourceMappingURL=sds-text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-text.d.ts","sourceRoot":"","sources":["../../src/sds-text/sds-text.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sds-text.d.ts","sourceRoot":"","sources":["../../src/sds-text/sds-text.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,qBACa,OAAQ,SAAQ,gBAAgB;CAAG;AAEhD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,UAAU,EAAE,OAAO,CAAC;KACpB;CACD"}
|
|
@@ -4,33 +4,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, html } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
9
7
|
import { guardedCustomElement } from '../utils/guarded-custom-element';
|
|
10
|
-
import {
|
|
11
|
-
let SDSText = class SDSText extends
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
// Reactive Props
|
|
15
|
-
this.size = 'md';
|
|
16
|
-
this.strong = false;
|
|
17
|
-
this.tall = false;
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return html `<p><slot></slot></p>`;
|
|
21
|
-
}
|
|
8
|
+
import { SDSTextComponent } from './sds-text.component';
|
|
9
|
+
let SDSText = class SDSText extends SDSTextComponent {
|
|
22
10
|
};
|
|
23
|
-
// Styling
|
|
24
|
-
SDSText.styles = [styles];
|
|
25
|
-
__decorate([
|
|
26
|
-
property({ type: String, reflect: true })
|
|
27
|
-
], SDSText.prototype, "size", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
property({ type: Boolean, reflect: true })
|
|
30
|
-
], SDSText.prototype, "strong", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
property({ type: Boolean, reflect: true })
|
|
33
|
-
], SDSText.prototype, "tall", void 0);
|
|
34
11
|
SDSText = __decorate([
|
|
35
12
|
guardedCustomElement('sds-text')
|
|
36
13
|
], SDSText);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-text.js","sourceRoot":"","sources":["../../src/sds-text/sds-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sds-text.js","sourceRoot":"","sources":["../../src/sds-text/sds-text.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGjD,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,gBAAgB;CAAG,CAAA;AAAnC,OAAO;IADnB,oBAAoB,CAAC,UAAU,CAAC;GACpB,OAAO,CAA4B","sourcesContent":["import { guardedCustomElement } from '../utils/guarded-custom-element';\nimport { SDSTextComponent } from './sds-text.component';\n\n@guardedCustomElement('sds-text')\nexport class SDSText extends SDSTextComponent {}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'sds-text': SDSText;\n\t}\n}\n"]}
|