@spscommerce/ds-web-components 5.0.2 → 5.2.2-ie
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/components/file-upload/file-upload.d.ts +119 -0
- package/dist/components/file-upload/file-upload.examples.d.ts +2 -0
- package/dist/components/file-upload/file-upload.examples.js +77 -0
- package/dist/components/file-upload/file-upload.examples.js.map +1 -0
- package/dist/components/file-upload/file-upload.js +415 -0
- package/dist/components/file-upload/file-upload.js.map +1 -0
- package/dist/components/file-upload/mime-type.enum.d.ts +75 -0
- package/dist/components/file-upload/mime-type.enum.js +77 -0
- package/dist/components/file-upload/mime-type.enum.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +12 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/insight-card/insight-card.d.ts +40 -0
- package/dist/components/insight-card/insight-card.examples.d.ts +51 -0
- package/dist/components/insight-card/insight-card.examples.js +58 -0
- package/dist/components/insight-card/insight-card.examples.js.map +1 -0
- package/dist/components/insight-card/insight-card.js +147 -0
- package/dist/components/insight-card/insight-card.js.map +1 -0
- package/dist/components/insight-card/insights.d.ts +18 -0
- package/dist/components/insight-card/insights.js +90 -0
- package/dist/components/insight-card/insights.js.map +1 -0
- package/dist/components/nav-tabs/nav-tab-set.d.ts +7 -0
- package/dist/components/nav-tabs/nav-tab-set.js +53 -0
- package/dist/components/nav-tabs/nav-tab-set.js.map +1 -0
- package/dist/components/nav-tabs/nav-tab.d.ts +24 -0
- package/dist/components/nav-tabs/nav-tab.js +94 -0
- package/dist/components/nav-tabs/nav-tab.js.map +1 -0
- package/dist/components/nav-tabs/nav-tabs.examples.d.ts +11 -0
- package/dist/components/nav-tabs/nav-tabs.examples.js +18 -0
- package/dist/components/nav-tabs/nav-tabs.examples.js.map +1 -0
- package/dist/components/photo/photo.d.ts +42 -0
- package/dist/components/photo/photo.examples.d.ts +2 -0
- package/dist/components/photo/photo.examples.js +58 -0
- package/dist/components/photo/photo.examples.js.map +1 -0
- package/dist/components/photo/photo.js +172 -0
- package/dist/components/photo/photo.js.map +1 -0
- package/dist/decorators/component.d.ts +33 -0
- package/dist/decorators/component.js +313 -0
- package/dist/decorators/component.js.map +1 -0
- package/dist/decorators/content.d.ts +7 -0
- package/dist/decorators/content.js +13 -0
- package/dist/decorators/content.js.map +1 -0
- package/dist/decorators/event-dispatcher.d.ts +9 -0
- package/dist/decorators/event-dispatcher.js +22 -0
- package/dist/decorators/event-dispatcher.js.map +1 -0
- package/dist/decorators/event-listener.d.ts +5 -0
- package/dist/decorators/event-listener.js +14 -0
- package/dist/decorators/event-listener.js.map +1 -0
- package/dist/decorators/index.d.ts +7 -0
- package/dist/decorators/index.js +8 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/prop.d.ts +6 -0
- package/dist/decorators/prop.js +47 -0
- package/dist/decorators/prop.js.map +1 -0
- package/dist/decorators/query-selector.d.ts +19 -0
- package/dist/decorators/query-selector.js +32 -0
- package/dist/decorators/query-selector.js.map +1 -0
- package/dist/decorators/watch.d.ts +2 -0
- package/dist/decorators/watch.js +27 -0
- package/dist/decorators/watch.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/index.cjs.js +3190 -642
- package/dist/lib/index.es.js +2914 -2368
- package/dist/manifest.d.ts +2 -0
- package/dist/manifest.js +33 -0
- package/dist/manifest.js.map +1 -0
- package/dist/package.json +4 -3
- package/dist/utils/comment.d.ts +2 -0
- package/dist/utils/comment.js +15 -0
- package/dist/utils/comment.js.map +1 -0
- package/dist/utils/i18n.d.ts +3 -0
- package/dist/utils/i18n.js +9 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/metadata.d.ts +22 -0
- package/dist/utils/metadata.js +23 -0
- package/dist/utils/metadata.js.map +1 -0
- package/dist/utils/pragma.d.ts +6 -0
- package/dist/utils/pragma.js +143 -0
- package/dist/utils/pragma.js.map +1 -0
- package/dist/utils/register.d.ts +13 -0
- package/dist/utils/register.js +73 -0
- package/dist/utils/register.js.map +1 -0
- package/lib/index.cjs.js +3190 -642
- package/lib/index.es.js +2914 -2368
- package/package.json +9 -9
- package/rollup.config.js +22 -0
- package/spscommerce-ds-web-components-4.36.3-ie.tgz +0 -0
- package/spscommerce-ds-web-components-5.0.2-ie.tgz +0 -0
- package/vite.config.js +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { SpsInsightCardKind, SpsIcon } from "@spscommerce/ds-shared";
|
|
3
|
+
import { ClassBindings } from "../../decorators/index";
|
|
4
|
+
export declare class SpsInsightCardComponent extends HTMLElement {
|
|
5
|
+
static readonly displayName = "sps-insight-card";
|
|
6
|
+
static readonly props: {
|
|
7
|
+
icon: string;
|
|
8
|
+
kind: string;
|
|
9
|
+
title: string;
|
|
10
|
+
metric: string;
|
|
11
|
+
partnerCount: string;
|
|
12
|
+
totalPartners: string;
|
|
13
|
+
secondary: string;
|
|
14
|
+
};
|
|
15
|
+
/** If icon is provided then it will override the default icon associated with kind */
|
|
16
|
+
icon: SpsIcon;
|
|
17
|
+
/** Specifies which of the visual styling variants of the Insight Card to use. */
|
|
18
|
+
kind: SpsInsightCardKind;
|
|
19
|
+
title: string;
|
|
20
|
+
/** The main number representing the metric that the Insight Card is intended to surface. */
|
|
21
|
+
metric: number;
|
|
22
|
+
/**
|
|
23
|
+
* The number of partners this insight applies to.
|
|
24
|
+
* Must be used together with `totalPartners`.
|
|
25
|
+
*/
|
|
26
|
+
partnerCount: number;
|
|
27
|
+
/** The total number of partners. Must be used together with `partnerCount`. */
|
|
28
|
+
totalPartners: number;
|
|
29
|
+
/**
|
|
30
|
+
* Whether this is a "secondary" Insight Card,
|
|
31
|
+
* meaning it will be displayed in a compact layout.
|
|
32
|
+
*/
|
|
33
|
+
secondary: boolean;
|
|
34
|
+
private content;
|
|
35
|
+
private detail;
|
|
36
|
+
get [ClassBindings](): string[];
|
|
37
|
+
render({ t }: {
|
|
38
|
+
t: any;
|
|
39
|
+
}): JSX.Element;
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const SpsInsightCardExamples: {
|
|
2
|
+
basic: {
|
|
3
|
+
label: string;
|
|
4
|
+
examples: {
|
|
5
|
+
basic: {
|
|
6
|
+
jsx: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
details: {
|
|
11
|
+
label: string;
|
|
12
|
+
examples: {
|
|
13
|
+
details: {
|
|
14
|
+
jsx: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
partner_count: {
|
|
19
|
+
label: string;
|
|
20
|
+
examples: {
|
|
21
|
+
partner_count: {
|
|
22
|
+
jsx: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
expansion: {
|
|
27
|
+
label: string;
|
|
28
|
+
examples: {
|
|
29
|
+
expansion: {
|
|
30
|
+
jsx: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
events: {
|
|
35
|
+
label: string;
|
|
36
|
+
description: string;
|
|
37
|
+
examples: {
|
|
38
|
+
events: {
|
|
39
|
+
react: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
alternateIcon: {
|
|
44
|
+
label: string;
|
|
45
|
+
examples: {
|
|
46
|
+
basic: {
|
|
47
|
+
react: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
+
return cooked;
|
|
4
|
+
};
|
|
5
|
+
import { code } from "@spscommerce/utils";
|
|
6
|
+
export var SpsInsightCardExamples = {
|
|
7
|
+
basic: {
|
|
8
|
+
label: "Basic Insight Cards",
|
|
9
|
+
examples: {
|
|
10
|
+
basic: {
|
|
11
|
+
jsx: code(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n "], ["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n "]))),
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
details: {
|
|
16
|
+
label: "With Details",
|
|
17
|
+
examples: {
|
|
18
|
+
details: {
|
|
19
|
+
jsx: code(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n </sps-insights>\n "], ["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n </sps-insights>\n "]))),
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
partner_count: {
|
|
24
|
+
label: "Partner Count",
|
|
25
|
+
examples: {
|
|
26
|
+
partner_count: {
|
|
27
|
+
jsx: code(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"250\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"122\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"207\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"12\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"94\"\n totalPartners=\"250\"\n ></sps-insight-card>\n </sps-insights>\n "], ["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"250\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"122\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"207\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"12\"\n totalPartners=\"250\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"94\"\n totalPartners=\"250\"\n ></sps-insight-card>\n </sps-insights>\n "]))),
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
expansion: {
|
|
32
|
+
label: "10+ Insight Cards",
|
|
33
|
+
examples: {
|
|
34
|
+
expansion: {
|
|
35
|
+
jsx: code(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n </sps-insights>\n "], ["\n <sps-insights>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"processing\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"success\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n <sps-insight-card kind=\"warning\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n ></sps-insight-card>\n <sps-insight-card kind=\"error\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n partnerCount=\"100\"\n totalPartners=\"200\"\n >\n <span className=\"gray600 font-weight-bold\">Detail:</span> 792 units\n </sps-insight-card>\n </sps-insights>\n "]))),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
events: {
|
|
40
|
+
label: "Adding a click handler",
|
|
41
|
+
description: code(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n <p>Attaching event handlers to native web components in React cannot be done the usual way at this time.\n Here is how to do it:</p>\n "], ["\n <p>Attaching event handlers to native web components in React cannot be done the usual way at this time.\n Here is how to do it:</p>\n "]))),
|
|
42
|
+
examples: {
|
|
43
|
+
events: {
|
|
44
|
+
react: code(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n function Component() {\n function handleClick() {\n window.alert(\"Insight card clicked\");\n }\n\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current.addEventListener(\"click\", handleClick);\n return () => {\n ref.current.removeEventListener(\"click\", handleClick);\n };\n }, []);\n\n return (\n <sps-insights>\n <sps-insight-card ref={ref}\n kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n );\n }\n "], ["\n function Component() {\n function handleClick() {\n window.alert(\"Insight card clicked\");\n }\n\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current.addEventListener(\"click\", handleClick);\n return () => {\n ref.current.removeEventListener(\"click\", handleClick);\n };\n }, []);\n\n return (\n <sps-insights>\n <sps-insight-card ref={ref}\n kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card kind=\"general\"\n metric=\"1234\"\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n );\n }\n "]))),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
alternateIcon: {
|
|
49
|
+
label: "Using alternate icons",
|
|
50
|
+
examples: {
|
|
51
|
+
basic: {
|
|
52
|
+
react: code(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n function DemoComponent() {\n return (\n <sps-insights>\n <sps-insight-card\n kind=\"general\"\n metric=\"1234\"\n icon={SpsIcon.DOLLAR_SIGN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"processing\"\n metric=\"1234\"\n icon={SpsIcon.ASTERISK}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"success\"\n metric=\"1234\"\n icon={SpsIcon.USER}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"warning\"\n metric=\"1234\"\n icon={SpsIcon.FOLDER_OPEN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"error\"\n metric=\"1234\"\n icon={SpsIcon.BAN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n )\n }\n "], ["\n function DemoComponent() {\n return (\n <sps-insights>\n <sps-insight-card\n kind=\"general\"\n metric=\"1234\"\n icon={SpsIcon.DOLLAR_SIGN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"processing\"\n metric=\"1234\"\n icon={SpsIcon.ASTERISK}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"success\"\n metric=\"1234\"\n icon={SpsIcon.USER}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"warning\"\n metric=\"1234\"\n icon={SpsIcon.FOLDER_OPEN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n <sps-insight-card\n kind=\"error\"\n metric=\"1234\"\n icon={SpsIcon.BAN}\n title=\"Insight Card Title\"\n ></sps-insight-card>\n </sps-insights>\n )\n }\n "]))),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
58
|
+
//# sourceMappingURL=insight-card.examples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-card.examples.js","sourceRoot":"","sources":["../../../src/components/insight-card/insight-card.examples.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,IAAM,sBAAsB,GAAG;IACpC,KAAK,EAAE;QACL,KAAK,EAAE,qBAAqB;QAC5B,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,GAAG,EAAE,IAAI,8/BAAA,27BAuBR,IAAA;aACF;SACF;KACF;IACD,OAAO,EAAE;QACP,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE;YACR,OAAO,EAAE;gBACP,GAAG,EAAE,IAAI,ylEAAA,shEA6CR,IAAA;aACF;SACF;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE;YACR,aAAa,EAAE;gBACb,GAAG,EAAE,IAAI,q6CAAA,k2CAiCR,IAAA;aACF;SACF;KACF;IACD,SAAS,EAAE;QACT,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE;YACR,SAAS,EAAE;gBACT,GAAG,EAAE,IAAI,60JAAA,0wJA6GR,IAAA;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,IAAI,sOAAA,mKAGd,IAAA;QACH,QAAQ,EAAE;YACR,MAAM,EAAE;gBACN,KAAK,EAAE,IAAI,mjDAAA,g/CAgCF,IAAA;aACV;SACF;KACF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,KAAK,EAAE,IAAI,i9DAAA,84DAqCF,IAAA;aACV;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
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;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
/** @jsx h */
|
|
42
|
+
/* eslint-disable new-cap */
|
|
43
|
+
import { SpsInsightCardKind, SpsInsightCardIcons, SpsIcon } from "@spscommerce/ds-shared";
|
|
44
|
+
import { ClassBindings, Component, Content, Prop, QuerySelector, } from "../../decorators/index";
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
|
+
import { h } from "../../utils/pragma";
|
|
47
|
+
var CPT_NAME = "sps-insight-card";
|
|
48
|
+
var SpsInsightCardComponent = /** @class */ (function (_super) {
|
|
49
|
+
__extends(SpsInsightCardComponent, _super);
|
|
50
|
+
function SpsInsightCardComponent() {
|
|
51
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
52
|
+
/** Specifies which of the visual styling variants of the Insight Card to use. */
|
|
53
|
+
_this.kind = SpsInsightCardKind.GENERAL;
|
|
54
|
+
return _this;
|
|
55
|
+
}
|
|
56
|
+
Object.defineProperty(SpsInsightCardComponent.prototype, ClassBindings, {
|
|
57
|
+
get: function () {
|
|
58
|
+
return [
|
|
59
|
+
CPT_NAME,
|
|
60
|
+
CPT_NAME + "--" + this.kind,
|
|
61
|
+
this.detail && this.detail.children.length ? CPT_NAME + "--has-detail" : null,
|
|
62
|
+
];
|
|
63
|
+
},
|
|
64
|
+
enumerable: false,
|
|
65
|
+
configurable: true
|
|
66
|
+
});
|
|
67
|
+
SpsInsightCardComponent.prototype.render = function (_a) {
|
|
68
|
+
var t = _a.t;
|
|
69
|
+
var metric = h("div", { className: CPT_NAME + "__metric-count" }, this.metric);
|
|
70
|
+
var description = (h("div", { className: CPT_NAME + "__description" },
|
|
71
|
+
h("div", { className: CPT_NAME + "__title",
|
|
72
|
+
/*
|
|
73
|
+
* Both Chrome & FF ignore -webkit-box-orient in the actual CSS for some reason
|
|
74
|
+
* Also the TS types don't think -webkit-box-orient is a real CSS property
|
|
75
|
+
*/
|
|
76
|
+
style: { "-webkit-box-orient": "vertical" } }, this.title),
|
|
77
|
+
h("div", { className: CPT_NAME + "__detail" }, this.content)));
|
|
78
|
+
var _b = __read((this.partnerCount
|
|
79
|
+
? t("design-system:insightCard.partnerCount", { count: this.partnerCount, total: this.totalPartners })
|
|
80
|
+
: "").split("|"), 3), count = _b[0], ofText = _b[1], total = _b[2];
|
|
81
|
+
return (h("div", { "data-fragment": true },
|
|
82
|
+
h("div", { className: CPT_NAME + "__body" },
|
|
83
|
+
this.icon ? h("i", { className: "sps-icon sps-icon-" + this.icon }) : h("i", { className: "sps-icon sps-icon-" + SpsInsightCardIcons[this.kind] }),
|
|
84
|
+
metric,
|
|
85
|
+
description),
|
|
86
|
+
this.partnerCount && (h("div", { className: CPT_NAME + "__partner-count" },
|
|
87
|
+
this.partnerCount === this.totalPartners
|
|
88
|
+
? h("div", null, t("design-system:insightCard.all"))
|
|
89
|
+
: (h("div", { "data-fragment": true },
|
|
90
|
+
h("div", null, count),
|
|
91
|
+
h("div", null, ofText),
|
|
92
|
+
h("div", null, total))),
|
|
93
|
+
h("div", { className: CPT_NAME + "__partners-text" }, t("design-system:insightCard.partners"))))));
|
|
94
|
+
};
|
|
95
|
+
SpsInsightCardComponent.displayName = CPT_NAME;
|
|
96
|
+
SpsInsightCardComponent.props = {
|
|
97
|
+
icon: "SpsIcon",
|
|
98
|
+
kind: "SpsInsightCardKind",
|
|
99
|
+
title: "string",
|
|
100
|
+
metric: "number",
|
|
101
|
+
partnerCount: "number",
|
|
102
|
+
totalPartners: "number",
|
|
103
|
+
secondary: "boolean",
|
|
104
|
+
};
|
|
105
|
+
__decorate([
|
|
106
|
+
Prop(),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], SpsInsightCardComponent.prototype, "icon", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Prop(),
|
|
111
|
+
__metadata("design:type", Object)
|
|
112
|
+
], SpsInsightCardComponent.prototype, "kind", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
Prop(),
|
|
115
|
+
__metadata("design:type", String)
|
|
116
|
+
], SpsInsightCardComponent.prototype, "title", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
Prop(),
|
|
119
|
+
__metadata("design:type", Number)
|
|
120
|
+
], SpsInsightCardComponent.prototype, "metric", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
Prop(),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], SpsInsightCardComponent.prototype, "partnerCount", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
Prop(),
|
|
127
|
+
__metadata("design:type", Number)
|
|
128
|
+
], SpsInsightCardComponent.prototype, "totalPartners", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
Prop(),
|
|
131
|
+
__metadata("design:type", Boolean)
|
|
132
|
+
], SpsInsightCardComponent.prototype, "secondary", void 0);
|
|
133
|
+
__decorate([
|
|
134
|
+
Content(),
|
|
135
|
+
__metadata("design:type", Object)
|
|
136
|
+
], SpsInsightCardComponent.prototype, "content", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
QuerySelector("." + CPT_NAME + "__detail"),
|
|
139
|
+
__metadata("design:type", Object)
|
|
140
|
+
], SpsInsightCardComponent.prototype, "detail", void 0);
|
|
141
|
+
SpsInsightCardComponent = __decorate([
|
|
142
|
+
Component({ tag: CPT_NAME })
|
|
143
|
+
], SpsInsightCardComponent);
|
|
144
|
+
return SpsInsightCardComponent;
|
|
145
|
+
}(HTMLElement));
|
|
146
|
+
export { SpsInsightCardComponent };
|
|
147
|
+
//# sourceMappingURL=insight-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insight-card.js","sourceRoot":"","sources":["../../../src/components/insight-card/insight-card.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClassBindings } from "../../decorators/index";
|
|
2
|
+
/** Container for Insight Cards. */
|
|
3
|
+
export declare class SpsInsightsComponent extends HTMLElement {
|
|
4
|
+
static readonly displayName = "sps-insights";
|
|
5
|
+
static readonly props: {};
|
|
6
|
+
private content;
|
|
7
|
+
private details;
|
|
8
|
+
private showAdditionalInsights;
|
|
9
|
+
get [ClassBindings](): string[];
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Only the first ten Insight Cards are visible by default; the rest are behind
|
|
13
|
+
* the "Show Additional Insights"/"Hide Additional Insights" button. This method
|
|
14
|
+
* will toggle the additional insights.
|
|
15
|
+
*/
|
|
16
|
+
toggleAdditionalInsights(): void;
|
|
17
|
+
render(): JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
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;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { ClassBindings, Component, Content, QuerySelectorAll, } from "../../decorators/index";
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
import { h } from "../../utils/pragma";
|
|
28
|
+
var CPT_NAME = "sps-insights";
|
|
29
|
+
/** Container for Insight Cards. */
|
|
30
|
+
var SpsInsightsComponent = /** @class */ (function (_super) {
|
|
31
|
+
__extends(SpsInsightsComponent, _super);
|
|
32
|
+
function SpsInsightsComponent() {
|
|
33
|
+
var _this = _super.call(this) || this;
|
|
34
|
+
_this.content = [];
|
|
35
|
+
_this.showAdditionalInsights = false;
|
|
36
|
+
_this.toggleAdditionalInsights = _this.toggleAdditionalInsights.bind(_this);
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
Object.defineProperty(SpsInsightsComponent.prototype, ClassBindings, {
|
|
40
|
+
get: function () {
|
|
41
|
+
return [
|
|
42
|
+
CPT_NAME,
|
|
43
|
+
this.showAdditionalInsights && CPT_NAME + "--show-additional",
|
|
44
|
+
this.details && Array.from(this.details).every(function (d) { return !d.textContent; })
|
|
45
|
+
? CPT_NAME + "--no-details"
|
|
46
|
+
: null,
|
|
47
|
+
this.content.length === 6 ? CPT_NAME + "--break-4" : null,
|
|
48
|
+
this.content.length === 7 ? CPT_NAME + "--break-5" : null,
|
|
49
|
+
this.content.length === 8 ? CPT_NAME + "--break-5" : null,
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
enumerable: false,
|
|
53
|
+
configurable: true
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Only the first ten Insight Cards are visible by default; the rest are behind
|
|
57
|
+
* the "Show Additional Insights"/"Hide Additional Insights" button. This method
|
|
58
|
+
* will toggle the additional insights.
|
|
59
|
+
*/
|
|
60
|
+
SpsInsightsComponent.prototype.toggleAdditionalInsights = function () {
|
|
61
|
+
this.showAdditionalInsights = !this.showAdditionalInsights;
|
|
62
|
+
this.update();
|
|
63
|
+
};
|
|
64
|
+
SpsInsightsComponent.prototype.render = function () {
|
|
65
|
+
return (h("div", { "data-fragment": true },
|
|
66
|
+
this.content,
|
|
67
|
+
this.content.length > 10
|
|
68
|
+
&& (h("div", { className: "sps-button sps-button--link", onClick: this.toggleAdditionalInsights },
|
|
69
|
+
h("button", { type: "button" },
|
|
70
|
+
this.showAdditionalInsights ? "Hide " : "Show ",
|
|
71
|
+
"Additional Insights")))));
|
|
72
|
+
};
|
|
73
|
+
SpsInsightsComponent.displayName = CPT_NAME;
|
|
74
|
+
SpsInsightsComponent.props = {};
|
|
75
|
+
__decorate([
|
|
76
|
+
Content(),
|
|
77
|
+
__metadata("design:type", Object)
|
|
78
|
+
], SpsInsightsComponent.prototype, "content", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
QuerySelectorAll(".sps-insight-card__detail"),
|
|
81
|
+
__metadata("design:type", NodeList)
|
|
82
|
+
], SpsInsightsComponent.prototype, "details", void 0);
|
|
83
|
+
SpsInsightsComponent = __decorate([
|
|
84
|
+
Component({ tag: CPT_NAME }),
|
|
85
|
+
__metadata("design:paramtypes", [])
|
|
86
|
+
], SpsInsightsComponent);
|
|
87
|
+
return SpsInsightsComponent;
|
|
88
|
+
}(HTMLElement));
|
|
89
|
+
export { SpsInsightsComponent };
|
|
90
|
+
//# sourceMappingURL=insights.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insights.js","sourceRoot":"","sources":["../../../src/components/insight-card/insights.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGA,OAAO,EACL,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GACpD,MAAM,wBAAwB,CAAC;AAChC,6DAA6D;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAEvC,IAAM,QAAQ,GAAG,cAAc,CAAC;AAEhC,mCAAmC;AAEnC;IAA0C,wCAAW;IAwBnD;QAAA,YACE,iBAAO,SAER;QAtBkB,aAAO,GAAG,EAAE,CAAC;QAIxB,4BAAsB,GAAG,KAAK,CAAC;QAiBrC,KAAI,CAAC,wBAAwB,GAAG,KAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAI,CAAC,CAAC;;IAC3E,CAAC;IAhBD,sBAAI,6CAAe;aAAnB;YACE,OAAO;gBACL,QAAQ;gBACR,IAAI,CAAC,sBAAsB,IAAO,QAAQ,sBAAmB;gBAC7D,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,CAAC,WAAW,EAAd,CAAc,CAAC;oBACnE,CAAC,CAAI,QAAQ,iBAAc;oBAC3B,CAAC,CAAC,IAAI;gBACR,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAI,QAAQ,cAAW,CAAC,CAAC,CAAC,IAAI;gBACzD,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAI,QAAQ,cAAW,CAAC,CAAC,CAAC,IAAI;gBACzD,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAI,QAAQ,cAAW,CAAC,CAAC,CAAC,IAAI;aAC1D,CAAC;QACJ,CAAC;;;OAAA;IAOD;;;;OAIG;IACH,uDAAwB,GAAxB;QACE,IAAI,CAAC,sBAAsB,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAC1D,IAA2B,CAAC,MAAM,EAAE,CAAC;IACxC,CAAC;IAED,qCAAM,GAAN;QACE,OAAO,CACL;YACG,IAAI,CAAC,OAAO;YACZ,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE;mBACV,CACD,WAAK,SAAS,EAAC,6BAA6B,EAAC,OAAO,EAAE,IAAI,CAAC,wBAAwB;oBACjF,cAAQ,IAAI,EAAC,QAAQ;wBAClB,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;8CAEzC,CACL,CACP,CACT,CACP,CAAC;IACJ,CAAC;IArDe,gCAAW,GAAG,QAAS,CAAA;IAEvB,0BAAK,GAAG,EAAG,CAAA;IAEhB;QAAV,OAAO,EAAE;;yDAAsB;IAEe;QAA9C,gBAAgB,CAAC,2BAA2B,CAAC;kCAAkB,QAAQ;yDAAC;IAP9D,oBAAoB;QADhC,SAAS,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;;OAChB,oBAAoB,CAuDhC;IAAD,2BAAC;CAAA,AAvDD,CAA0C,WAAW,GAuDpD;SAvDY,oBAAoB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
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;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
/** @jsx h */
|
|
26
|
+
/* eslint-disable new-cap */
|
|
27
|
+
import { Component, Content } from "../../decorators/index";
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
29
|
+
import { h } from "../../utils/pragma";
|
|
30
|
+
/** Contains a set of navigation tabs. */
|
|
31
|
+
var SpsNavTabSetComponent = /** @class */ (function (_super) {
|
|
32
|
+
__extends(SpsNavTabSetComponent, _super);
|
|
33
|
+
function SpsNavTabSetComponent() {
|
|
34
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
_this.content = [];
|
|
36
|
+
return _this;
|
|
37
|
+
}
|
|
38
|
+
SpsNavTabSetComponent.prototype.render = function () {
|
|
39
|
+
return (h("nav", { className: "sps-tabbed-nav" }, this.content));
|
|
40
|
+
};
|
|
41
|
+
SpsNavTabSetComponent.displayName = "sps-nav-tab-set";
|
|
42
|
+
SpsNavTabSetComponent.props = {};
|
|
43
|
+
__decorate([
|
|
44
|
+
Content(),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], SpsNavTabSetComponent.prototype, "content", void 0);
|
|
47
|
+
SpsNavTabSetComponent = __decorate([
|
|
48
|
+
Component({ tag: "sps-nav-tab-set" })
|
|
49
|
+
], SpsNavTabSetComponent);
|
|
50
|
+
return SpsNavTabSetComponent;
|
|
51
|
+
}(HTMLElement));
|
|
52
|
+
export { SpsNavTabSetComponent };
|
|
53
|
+
//# sourceMappingURL=nav-tab-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tab-set.js","sourceRoot":"","sources":["../../../src/components/nav-tabs/nav-tab-set.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,4BAA4B;AAC5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,6DAA6D;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAEvC,yCAAyC;AAEzC;IAA2C,yCAAW;IAAtD;QAAA,qEAcC;QAToB,aAAO,GAAG,EAAE,CAAC;;IASlC,CAAC;IAPC,sCAAM,GAAN;QACE,OAAO,CACL,WAAK,SAAS,EAAC,gBAAgB,IAC5B,IAAI,CAAC,OAAO,CACT,CACP,CAAC;IACJ,CAAC;IAZe,iCAAW,GAAG,iBAAkB,CAAA;IAEhC,2BAAK,GAAG,EAAG,CAAA;IAEhB;QAAV,OAAO,EAAE;;0DAAsB;IALrB,qBAAqB;QADjC,SAAS,CAAC,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC;OACzB,qBAAqB,CAcjC;IAAD,4BAAC;CAAA,AAdD,CAA2C,WAAW,GAcrD;SAdY,qBAAqB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** @jsx h */
|
|
2
|
+
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
3
|
+
import { ClassBindings } from "../../decorators/index";
|
|
4
|
+
export declare class SpsNavTabComponent extends HTMLElement {
|
|
5
|
+
static readonly displayName = "sps-nav-tab";
|
|
6
|
+
static readonly props: {
|
|
7
|
+
active: string;
|
|
8
|
+
label: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
tag: string;
|
|
11
|
+
href: string;
|
|
12
|
+
target: string;
|
|
13
|
+
};
|
|
14
|
+
active: boolean;
|
|
15
|
+
label: string;
|
|
16
|
+
icon: SpsIcon;
|
|
17
|
+
tag: string;
|
|
18
|
+
/** If you need the tab to operate as an HTML link, provide an href. */
|
|
19
|
+
href: string;
|
|
20
|
+
/** If you provide href, target is the same attribute as on an <a> element. */
|
|
21
|
+
target: string;
|
|
22
|
+
get [ClassBindings](): string[];
|
|
23
|
+
render(): JSX.Element;
|
|
24
|
+
}
|