@ukic/web-components 2.35.0 → 2.35.1
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 +1 -0
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +2 -2
- package/dist/cjs/ic-toast.cjs.entry.js.map +1 -1
- package/dist/collection/components/ic-accordion/ic-accordion.stories.js +635 -0
- package/dist/collection/components/ic-alert/ic-alert.stories.js +257 -0
- package/dist/collection/components/ic-back-to-top/ic-back-to-top.stories.js +162 -0
- package/dist/collection/components/ic-badge/ic-badge.stories.js +1082 -0
- package/dist/collection/components/ic-breadcrumb-group/ic-breadcrumb-group.stories.js +502 -0
- package/dist/collection/components/ic-button/ic-button.stories.js +2218 -0
- package/dist/collection/components/ic-card/ic-card.stories.js +1034 -0
- package/dist/collection/components/ic-checkbox-group/ic-checkbox-group.stories.js +687 -0
- package/dist/collection/components/ic-chip/ic-chip.stories.js +670 -0
- package/dist/collection/components/ic-classification-banner/ic-classification-banner.stories.js +131 -0
- package/dist/collection/components/ic-data-entity/ic-data-entity.stories.js +487 -0
- package/dist/collection/components/ic-dialog/ic-dialog.stories.js +1256 -0
- package/dist/collection/components/ic-empty-state/ic-empty-state.stories.js +397 -0
- package/dist/collection/components/ic-footer/ic-footer.stories.js +383 -0
- package/dist/collection/components/ic-hero/ic-hero.stories.js +489 -0
- package/dist/collection/components/ic-link/ic-link.stories.js +114 -0
- package/dist/collection/components/ic-loading-indicator/ic-loading-indicator.stories.js +416 -0
- package/dist/collection/components/ic-navigation-item/ic-navigation-item.css +7 -35
- package/dist/collection/components/ic-page-header/ic-page-header.stories.js +557 -0
- package/dist/collection/components/ic-pagination/ic-pagination.stories.js +125 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.stories.js +486 -0
- package/dist/collection/components/ic-radio-group/ic-radio-group.stories.js +450 -0
- package/dist/collection/components/ic-search-bar/ic-search-bar.stories.js +591 -0
- package/dist/collection/components/ic-section-container/ic-section-container.stories.js +62 -0
- package/dist/collection/components/ic-select/ic-select-searchable.stories.js +953 -0
- package/dist/collection/components/ic-select/ic-select-single.stories.js +780 -0
- package/dist/collection/components/ic-side-navigation/ic-side-navigation.stories.js +2526 -0
- package/dist/collection/components/ic-skeleton/ic-skeleton.stories.js +141 -0
- package/dist/collection/components/ic-status-tag/ic-status-tag.stories.js +161 -0
- package/dist/collection/components/ic-stepper/ic-stepper.stories.js +327 -0
- package/dist/collection/components/ic-switch/ic-switch.stories.js +171 -0
- package/dist/collection/components/ic-tab-context/ic-tabs.stories.js +388 -0
- package/dist/collection/components/ic-text-field/ic-text-field.stories.js +1083 -0
- package/dist/collection/components/ic-theme/ic-theme.stories.js +171 -0
- package/dist/collection/components/ic-toast/ic-toast.js +2 -2
- package/dist/collection/components/ic-toast/ic-toast.js.map +1 -1
- package/dist/collection/components/ic-toast/ic-toast.stories.js +413 -0
- package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js +3 -3
- package/dist/collection/components/ic-toast/test/basic/ic-toast.spec.js.map +1 -1
- package/dist/collection/components/ic-toggle-button/ic-toggle-button.stories.js +537 -0
- package/dist/collection/components/ic-toggle-button-group/ic-toggle-button-group.stories.js +610 -0
- package/dist/collection/components/ic-tooltip/ic-tooltip.stories.js +356 -0
- package/dist/collection/components/ic-top-navigation/ic-top-navigation.stories.js +1083 -0
- package/dist/collection/components/ic-typography/ic-typography.stories.js +437 -0
- package/dist/collection/patterns/top-nav-content-footer.stories.js +109 -0
- package/dist/collection/patterns/z-index.stories.js +474 -0
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-item.js.map +1 -1
- package/dist/components/ic-toast.js +2 -2
- package/dist/components/ic-toast.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/p-3e8023ff.entry.js +2 -0
- package/dist/core/p-3e8023ff.entry.js.map +1 -0
- package/dist/core/{p-7e8a4abd.entry.js → p-bfaa257c.entry.js} +2 -2
- package/dist/core/{p-7e8a4abd.entry.js.map → p-bfaa257c.entry.js.map} +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js.map +1 -1
- package/dist/esm/ic-toast.entry.js +2 -2
- package/dist/esm/ic-toast.entry.js.map +1 -1
- package/hydrate/index.js +3 -3
- package/package.json +15 -11
- package/dist/core/p-dfb3e76e.entry.js +0 -2
- package/dist/core/p-dfb3e76e.entry.js.map +0 -1
@@ -0,0 +1,141 @@
|
|
1
|
+
import { html } from "lit-html";
|
2
|
+
|
3
|
+
const defaultArgs = {
|
4
|
+
appearance: "default",
|
5
|
+
variant: "rectangle",
|
6
|
+
};
|
7
|
+
|
8
|
+
export default {
|
9
|
+
title: "Web Components/Skeleton",
|
10
|
+
component: "ic-skeleton",
|
11
|
+
};
|
12
|
+
|
13
|
+
export const Rectangle = {
|
14
|
+
render: () =>
|
15
|
+
html` <ic-typography variant="h4">Default</ic-typography>
|
16
|
+
<ic-skeleton></ic-skeleton>
|
17
|
+
<ic-typography variant="h4">Inherited from child</ic-typography>
|
18
|
+
<ic-skeleton
|
19
|
+
><div style="height:200px;width:450px;">Test text</div></ic-skeleton
|
20
|
+
>
|
21
|
+
<ic-typography variant="h4"
|
22
|
+
>Height and width set with styles</ic-typography
|
23
|
+
>
|
24
|
+
<ic-skeleton style="height:200px;width:200px;"></ic-skeleton>
|
25
|
+
<ic-typography variant="h4">Height set with styles</ic-typography>
|
26
|
+
<ic-skeleton style="height:75px;"></ic-skeleton>
|
27
|
+
<ic-typography variant="h4">Width set with styles</ic-typography>
|
28
|
+
<ic-skeleton style="width:450px;"></ic-skeleton>`,
|
29
|
+
|
30
|
+
name: "Rectangle",
|
31
|
+
};
|
32
|
+
|
33
|
+
export const Circle = {
|
34
|
+
render: () => html`<ic-skeleton variant="circle" />`,
|
35
|
+
name: "Circle",
|
36
|
+
};
|
37
|
+
|
38
|
+
export const Text = {
|
39
|
+
render: () =>
|
40
|
+
html` <ic-typography variant="h1">h1</ic-typography>
|
41
|
+
<ic-typography variant="h1"><ic-skeleton variant="text" /></ic-typography>
|
42
|
+
<ic-typography variant="h2">h2</ic-typography>
|
43
|
+
<ic-typography variant="h2"><ic-skeleton variant="text" /></ic-typography>
|
44
|
+
<ic-typography variant="h3">h3</ic-typography>
|
45
|
+
<ic-typography variant="h3"><ic-skeleton variant="text" /></ic-typography>
|
46
|
+
<ic-typography variant="h4">h4</ic-typography>
|
47
|
+
<ic-typography variant="h4"><ic-skeleton variant="text" /></ic-typography>
|
48
|
+
<ic-typography variant="subtitle-large">subtitle-large</ic-typography>
|
49
|
+
<ic-typography variant="subtitle-large"
|
50
|
+
><ic-skeleton variant="text"
|
51
|
+
/></ic-typography>
|
52
|
+
<ic-typography variant="subtitle-small">subtitle-small</ic-typography>
|
53
|
+
<ic-typography variant="subtitle-small"
|
54
|
+
><ic-skeleton variant="text"
|
55
|
+
/></ic-typography>
|
56
|
+
<ic-typography variant="body">body</ic-typography>
|
57
|
+
<ic-typography variant="body"
|
58
|
+
><ic-skeleton variant="text"
|
59
|
+
/></ic-typography>
|
60
|
+
<ic-typography variant="caption">caption</ic-typography>
|
61
|
+
<ic-typography variant="caption"
|
62
|
+
><ic-skeleton variant="text"
|
63
|
+
/></ic-typography>
|
64
|
+
<ic-typography variant="label">label</ic-typography>
|
65
|
+
<ic-typography variant="subtitle-small"
|
66
|
+
><ic-skeleton variant="text"
|
67
|
+
/></ic-typography>
|
68
|
+
<ic-typography variant="caption-uppercase"
|
69
|
+
>caption uppercase</ic-typography
|
70
|
+
>
|
71
|
+
<ic-typography variant="caption-uppercase"
|
72
|
+
><ic-skeleton variant="text"
|
73
|
+
/></ic-typography>
|
74
|
+
<ic-typography variant="label-uppercase">label uppercase</ic-typography>
|
75
|
+
<ic-typography variant="subtitle-small"
|
76
|
+
><ic-skeleton variant="text"
|
77
|
+
/></ic-typography>`,
|
78
|
+
|
79
|
+
name: "Text",
|
80
|
+
};
|
81
|
+
|
82
|
+
export const Example = {
|
83
|
+
render: () =>
|
84
|
+
html` <ic-skeleton variant="circle" height="20"></ic-skeleton>
|
85
|
+
<div style="height:8px"></div>
|
86
|
+
<ic-typography variant="caption"
|
87
|
+
><ic-skeleton variant="text"
|
88
|
+
/></ic-typography>
|
89
|
+
<div style="height:8px"></div>
|
90
|
+
<ic-skeleton></ic-skeleton>`,
|
91
|
+
|
92
|
+
name: "Example",
|
93
|
+
};
|
94
|
+
|
95
|
+
export const Light = {
|
96
|
+
render: () =>
|
97
|
+
html` <ic-skeleton variant="circle" height="20" light="true"></ic-skeleton>
|
98
|
+
<div style="height:8px"></div>
|
99
|
+
<ic-typography variant="caption"
|
100
|
+
><ic-skeleton variant="text" light="true"
|
101
|
+
/></ic-typography>
|
102
|
+
<div style="height:8px"></div>
|
103
|
+
<ic-skeleton light="true"></ic-skeleton>`,
|
104
|
+
|
105
|
+
name: "Light",
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Playground = {
|
109
|
+
render: (args) =>
|
110
|
+
html` <div>
|
111
|
+
<ic-skeleton
|
112
|
+
appearance=${args.appearance}
|
113
|
+
variant=${args.variant}
|
114
|
+
style="height: ${args.variant == "circle"
|
115
|
+
? "20px"
|
116
|
+
: ""};width:${args.variant == "circle" ? "20px" : ""};"
|
117
|
+
></ic-skeleton>
|
118
|
+
</div>`,
|
119
|
+
|
120
|
+
args: defaultArgs,
|
121
|
+
|
122
|
+
argTypes: {
|
123
|
+
appearance: {
|
124
|
+
options: ["default", "light"],
|
125
|
+
|
126
|
+
control: {
|
127
|
+
type: "inline-radio",
|
128
|
+
},
|
129
|
+
},
|
130
|
+
|
131
|
+
variant: {
|
132
|
+
options: ["rectangle", "circle", "text"],
|
133
|
+
|
134
|
+
control: {
|
135
|
+
type: "radio",
|
136
|
+
},
|
137
|
+
},
|
138
|
+
},
|
139
|
+
|
140
|
+
name: "Playground",
|
141
|
+
};
|
@@ -0,0 +1,161 @@
|
|
1
|
+
import { html } from "lit-html";
|
2
|
+
|
3
|
+
const defaultArgs = {
|
4
|
+
announced: false,
|
5
|
+
label: "Status tag label",
|
6
|
+
size: "default",
|
7
|
+
status: "neutral",
|
8
|
+
variant: "filled",
|
9
|
+
};
|
10
|
+
|
11
|
+
export default {
|
12
|
+
title: "Web Components/Status tag",
|
13
|
+
component: "ic-status-tag",
|
14
|
+
};
|
15
|
+
|
16
|
+
export const Neutral = {
|
17
|
+
render: () => html`
|
18
|
+
<ic-status-tag label="Neutral"></ic-status-tag>
|
19
|
+
<ic-status-tag label="Neutral" variant="outlined"></ic-status-tag>
|
20
|
+
`,
|
21
|
+
|
22
|
+
name: "Neutral",
|
23
|
+
};
|
24
|
+
|
25
|
+
export const Success = {
|
26
|
+
render: () => html`
|
27
|
+
<ic-status-tag label="Success" status="success"></ic-status-tag>
|
28
|
+
<ic-status-tag
|
29
|
+
label="Success"
|
30
|
+
status="success"
|
31
|
+
variant="outlined"
|
32
|
+
></ic-status-tag>
|
33
|
+
`,
|
34
|
+
|
35
|
+
name: "Success",
|
36
|
+
};
|
37
|
+
|
38
|
+
export const Warning = {
|
39
|
+
render: () => html`
|
40
|
+
<ic-status-tag label="Warning" status="warning"></ic-status-tag>
|
41
|
+
<ic-status-tag
|
42
|
+
label="Warning"
|
43
|
+
status="warning"
|
44
|
+
variant="outlined"
|
45
|
+
></ic-status-tag>
|
46
|
+
`,
|
47
|
+
|
48
|
+
name: "Warning",
|
49
|
+
};
|
50
|
+
|
51
|
+
export const Danger = {
|
52
|
+
render: () => html`
|
53
|
+
<ic-status-tag label="Danger" status="danger"></ic-status-tag>
|
54
|
+
<ic-status-tag
|
55
|
+
label="Danger"
|
56
|
+
status="danger"
|
57
|
+
variant="outlined"
|
58
|
+
></ic-status-tag>
|
59
|
+
`,
|
60
|
+
|
61
|
+
name: "Danger",
|
62
|
+
};
|
63
|
+
|
64
|
+
export const Size = {
|
65
|
+
render: () => html`
|
66
|
+
<ic-status-tag label="Small" size="small"></ic-status-tag>
|
67
|
+
<ic-status-tag
|
68
|
+
label="Small"
|
69
|
+
variant="outlined"
|
70
|
+
size="small"
|
71
|
+
></ic-status-tag>
|
72
|
+
<ic-status-tag label="Default" size="default"></ic-status-tag>
|
73
|
+
<ic-status-tag
|
74
|
+
label="Default"
|
75
|
+
variant="outlined"
|
76
|
+
size="default"
|
77
|
+
></ic-status-tag>
|
78
|
+
<ic-status-tag label="Large" size="large"></ic-status-tag>
|
79
|
+
<ic-status-tag
|
80
|
+
label="Large"
|
81
|
+
variant="outlined"
|
82
|
+
size="large"
|
83
|
+
></ic-status-tag>
|
84
|
+
`,
|
85
|
+
|
86
|
+
name: "Size",
|
87
|
+
};
|
88
|
+
|
89
|
+
export const Announced = {
|
90
|
+
render: () => html`
|
91
|
+
<ic-status-tag
|
92
|
+
label="Warning"
|
93
|
+
status="warning"
|
94
|
+
id="tag"
|
95
|
+
announced="false"
|
96
|
+
></ic-status-tag>
|
97
|
+
<br />
|
98
|
+
<br />
|
99
|
+
<ic-button variant="primary" size="small" onClick="onClick()" id="btn"
|
100
|
+
>Toggle announced prop</ic-button
|
101
|
+
>
|
102
|
+
<script>
|
103
|
+
const tag = document.getElementById("tag");
|
104
|
+
const btn = document.getElementById("btn");
|
105
|
+
btn.addEventListener("click", onClick);
|
106
|
+
function onClick(e) {
|
107
|
+
e.preventDefault();
|
108
|
+
tag.announced
|
109
|
+
? ((tag.announced = "false"),
|
110
|
+
(tag.status = "warning"),
|
111
|
+
(tag.label = "Warning"))
|
112
|
+
: ((tag.announced = "true"),
|
113
|
+
(tag.status = "success"),
|
114
|
+
(tag.label = "Success"));
|
115
|
+
}
|
116
|
+
</script>
|
117
|
+
`,
|
118
|
+
|
119
|
+
name: "Announced",
|
120
|
+
};
|
121
|
+
|
122
|
+
export const Playground = {
|
123
|
+
render: (args) =>
|
124
|
+
html`<ic-status-tag
|
125
|
+
label=${args.label}
|
126
|
+
size=${args.size}
|
127
|
+
status=${args.status}
|
128
|
+
variant=${args.variant}
|
129
|
+
announced=${args.announced}
|
130
|
+
></ic-status-tag>`,
|
131
|
+
|
132
|
+
args: defaultArgs,
|
133
|
+
|
134
|
+
argTypes: {
|
135
|
+
size: {
|
136
|
+
options: ["default", "small", "large"],
|
137
|
+
|
138
|
+
control: {
|
139
|
+
type: "inline-radio",
|
140
|
+
},
|
141
|
+
},
|
142
|
+
|
143
|
+
status: {
|
144
|
+
options: ["neutral", "success", "warning", "danger"],
|
145
|
+
|
146
|
+
control: {
|
147
|
+
type: "select",
|
148
|
+
},
|
149
|
+
},
|
150
|
+
|
151
|
+
variant: {
|
152
|
+
options: ["filled", "outlined"],
|
153
|
+
|
154
|
+
control: {
|
155
|
+
type: "inline-radio",
|
156
|
+
},
|
157
|
+
},
|
158
|
+
},
|
159
|
+
|
160
|
+
name: "Playground",
|
161
|
+
};
|
@@ -0,0 +1,327 @@
|
|
1
|
+
import { html } from "lit-html";
|
2
|
+
|
3
|
+
export default {
|
4
|
+
title: "Web Components/Stepper",
|
5
|
+
component: "ic-stepper",
|
6
|
+
};
|
7
|
+
|
8
|
+
export const FullWidthStepper = {
|
9
|
+
render: () =>
|
10
|
+
html`<ic-stepper>
|
11
|
+
<ic-step step-title="Create" step-type="completed"></ic-step>
|
12
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
13
|
+
<ic-step step-title="Update" step-type="active"></ic-step>
|
14
|
+
<ic-step step-title="Delete" step-type="disabled"></ic-step>
|
15
|
+
</ic-stepper>`,
|
16
|
+
|
17
|
+
name: "Full-width stepper",
|
18
|
+
};
|
19
|
+
|
20
|
+
export const LeftAlignedStepper = {
|
21
|
+
render: () =>
|
22
|
+
html`<ic-stepper aligned="left">
|
23
|
+
<ic-step step-title="Create" step-type="completed"></ic-step>
|
24
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
25
|
+
<ic-step step-title="Update" step-type="active"></ic-step>
|
26
|
+
<ic-step step-title="Delete" step-type="disabled"></ic-step>
|
27
|
+
</ic-stepper>`,
|
28
|
+
|
29
|
+
name: "Left-aligned stepper",
|
30
|
+
};
|
31
|
+
|
32
|
+
export const WithHiddenStepInformation = {
|
33
|
+
render: () =>
|
34
|
+
html`<ic-stepper hide-step-info>
|
35
|
+
<ic-step step-title="Create" step-type="completed"></ic-step>
|
36
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
37
|
+
<ic-step step-title="Update" step-type="active"></ic-step>
|
38
|
+
<ic-step step-title="Delete" step-type="disabled"></ic-step>
|
39
|
+
</ic-stepper>`,
|
40
|
+
|
41
|
+
name: "With hidden step information",
|
42
|
+
};
|
43
|
+
|
44
|
+
export const WithoutStepTitles = {
|
45
|
+
render: () =>
|
46
|
+
html`<ic-stepper>
|
47
|
+
<ic-step step-type="completed"></ic-step>
|
48
|
+
<ic-step step-type="completed"></ic-step>
|
49
|
+
<ic-step step-type="current"></ic-step>
|
50
|
+
<ic-step></ic-step>
|
51
|
+
</ic-stepper>`,
|
52
|
+
|
53
|
+
name: "Without step titles",
|
54
|
+
};
|
55
|
+
|
56
|
+
export const CustomStepper = {
|
57
|
+
render: () =>
|
58
|
+
html`<ic-stepper>
|
59
|
+
<ic-step step-title="First"></ic-step>
|
60
|
+
<ic-step
|
61
|
+
step-title="Second With a Very Long Title"
|
62
|
+
step-subtitle="Optional subtitle that is long and should wrap"
|
63
|
+
step-type="current"
|
64
|
+
></ic-step>
|
65
|
+
<ic-step step-title="Third" step-type="disabled"></ic-step>
|
66
|
+
<ic-step
|
67
|
+
step-title="Fourth title that is long and should wrap"
|
68
|
+
step-subtitle="Optional Subtitle"
|
69
|
+
step-type="completed"
|
70
|
+
></ic-step>
|
71
|
+
</ic-stepper>`,
|
72
|
+
|
73
|
+
name: "Custom stepper",
|
74
|
+
};
|
75
|
+
|
76
|
+
export const CustomConnectorWidth = {
|
77
|
+
render: () =>
|
78
|
+
html`<ic-stepper aligned="left" connector-width="200">
|
79
|
+
<ic-step step-title="First"></ic-step>
|
80
|
+
<ic-step
|
81
|
+
step-title="Second With a Very Long Title"
|
82
|
+
step-subtitle="Optional subtitle that is long and should wrap"
|
83
|
+
step-type="current"
|
84
|
+
></ic-step>
|
85
|
+
<ic-step step-title="Third" step-type="disabled"></ic-step>
|
86
|
+
<ic-step
|
87
|
+
step-title="Fourth title that is long and should wrap"
|
88
|
+
step-subtitle="Optional Subtitle"
|
89
|
+
step-type="completed"
|
90
|
+
></ic-step>
|
91
|
+
</ic-stepper>`,
|
92
|
+
|
93
|
+
name: "Custom connector width",
|
94
|
+
};
|
95
|
+
|
96
|
+
export const Light = {
|
97
|
+
render: () =>
|
98
|
+
html`<div style="background-color:#24262b;">
|
99
|
+
<ic-stepper appearance="light">
|
100
|
+
<ic-step step-title="Create" step-type="completed"></ic-step>
|
101
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
102
|
+
<ic-step step-title="Update" step-type="active"></ic-step>
|
103
|
+
<ic-step step-title="Delete" step-type="disabled"></ic-step>
|
104
|
+
</ic-stepper>
|
105
|
+
</div>`,
|
106
|
+
|
107
|
+
name: "Light",
|
108
|
+
};
|
109
|
+
|
110
|
+
export const CompactStepper = {
|
111
|
+
render: () =>
|
112
|
+
html`<ic-stepper variant="compact" id="standard-compact-stepper">
|
113
|
+
<ic-step step-title="Create"></ic-step>
|
114
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
115
|
+
<ic-step step-title="Update" step-status="optional"></ic-step>
|
116
|
+
<ic-step step-title="Delete" step-status="required"></ic-step>
|
117
|
+
</ic-stepper>
|
118
|
+
<ic-button
|
119
|
+
class="back-btn-compact-stepper"
|
120
|
+
style="margin-right: var(--ic-space-lg)"
|
121
|
+
onclick="toPreviousStep()"
|
122
|
+
>Back</ic-button
|
123
|
+
>
|
124
|
+
<ic-button class="next-btn-compact-stepper" onclick="toNextStep()"
|
125
|
+
>Next</ic-button
|
126
|
+
>
|
127
|
+
<script>
|
128
|
+
const compactStepTypes = [
|
129
|
+
"active",
|
130
|
+
"completed",
|
131
|
+
"disabled",
|
132
|
+
"completed",
|
133
|
+
];
|
134
|
+
const backBtn = document.querySelector(".back-btn-compact-stepper");
|
135
|
+
const nextBtn = document.querySelector(".next-btn-compact-stepper");
|
136
|
+
const steps = document.querySelectorAll(
|
137
|
+
"#standard-compact-stepper > ic-step"
|
138
|
+
);
|
139
|
+
function toPreviousStep() {
|
140
|
+
for (let i = steps.length - 1; i > 0; i--) {
|
141
|
+
if (steps[i].stepType === "current") {
|
142
|
+
steps[i].stepType = compactStepTypes[i];
|
143
|
+
steps[i - 1].stepType = "current";
|
144
|
+
i--;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
if (steps[steps.length - 2].stepType === "current") {
|
148
|
+
nextBtn.setAttribute("disabled", "false");
|
149
|
+
}
|
150
|
+
if (steps[0].stepType === "current") {
|
151
|
+
backBtn.setAttribute("disabled", "true");
|
152
|
+
}
|
153
|
+
}
|
154
|
+
function toNextStep() {
|
155
|
+
for (let i = 0; i < steps.length - 1; i++) {
|
156
|
+
if (steps[i].stepType === "current") {
|
157
|
+
steps[i].stepType = compactStepTypes[i];
|
158
|
+
steps[i + 1].stepType = "current";
|
159
|
+
i++;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
if (steps[1].stepType === "current") {
|
163
|
+
backBtn.setAttribute("disabled", "false");
|
164
|
+
}
|
165
|
+
if (steps[steps.length - 1].stepType === "current") {
|
166
|
+
nextBtn.setAttribute("disabled", "true");
|
167
|
+
}
|
168
|
+
}
|
169
|
+
</script>`,
|
170
|
+
|
171
|
+
name: "Compact stepper",
|
172
|
+
};
|
173
|
+
|
174
|
+
export const CompactStepperLight = {
|
175
|
+
render: () =>
|
176
|
+
html`<div style="background-color:#24262b;">
|
177
|
+
<ic-stepper
|
178
|
+
variant="compact"
|
179
|
+
id="standard-compact-stepper"
|
180
|
+
appearance="light"
|
181
|
+
>
|
182
|
+
<ic-step step-title="Create"></ic-step>
|
183
|
+
<ic-step step-title="Read" step-type="current"></ic-step>
|
184
|
+
<ic-step step-title="Update" step-status="optional"></ic-step>
|
185
|
+
<ic-step step-title="Delete" step-status="required"></ic-step>
|
186
|
+
</ic-stepper>
|
187
|
+
</div>
|
188
|
+
<ic-button
|
189
|
+
class="back-btn-compact-stepper"
|
190
|
+
style="margin-right: var(--ic-space-lg)"
|
191
|
+
onclick="toPreviousStep()"
|
192
|
+
>Back</ic-button
|
193
|
+
>
|
194
|
+
<ic-button class="next-btn-compact-stepper" onclick="toNextStep()"
|
195
|
+
>Next</ic-button
|
196
|
+
>
|
197
|
+
<script>
|
198
|
+
const compactStepTypes = [
|
199
|
+
"active",
|
200
|
+
"completed",
|
201
|
+
"disabled",
|
202
|
+
"completed",
|
203
|
+
];
|
204
|
+
const backBtn = document.querySelector(".back-btn-compact-stepper");
|
205
|
+
const nextBtn = document.querySelector(".next-btn-compact-stepper");
|
206
|
+
const steps = document.querySelectorAll(
|
207
|
+
"#standard-compact-stepper > ic-step"
|
208
|
+
);
|
209
|
+
function toPreviousStep() {
|
210
|
+
for (let i = steps.length - 1; i > 0; i--) {
|
211
|
+
if (steps[i].stepType === "current") {
|
212
|
+
steps[i].stepType = compactStepTypes[i];
|
213
|
+
steps[i - 1].stepType = "current";
|
214
|
+
i--;
|
215
|
+
}
|
216
|
+
}
|
217
|
+
if (steps[steps.length - 2].stepType === "current") {
|
218
|
+
nextBtn.setAttribute("disabled", "false");
|
219
|
+
}
|
220
|
+
if (steps[0].stepType === "current") {
|
221
|
+
backBtn.setAttribute("disabled", "true");
|
222
|
+
}
|
223
|
+
}
|
224
|
+
function toNextStep() {
|
225
|
+
for (let i = 0; i < steps.length - 1; i++) {
|
226
|
+
if (steps[i].stepType === "current") {
|
227
|
+
steps[i].stepType = compactStepTypes[i];
|
228
|
+
steps[i + 1].stepType = "current";
|
229
|
+
i++;
|
230
|
+
}
|
231
|
+
}
|
232
|
+
if (steps[1].stepType === "current") {
|
233
|
+
backBtn.setAttribute("disabled", "false");
|
234
|
+
}
|
235
|
+
if (steps[steps.length - 1].stepType === "current") {
|
236
|
+
nextBtn.setAttribute("disabled", "true");
|
237
|
+
}
|
238
|
+
}
|
239
|
+
</script>`,
|
240
|
+
|
241
|
+
name: "Compact stepper light",
|
242
|
+
};
|
243
|
+
|
244
|
+
export const CustomCompactStepper = {
|
245
|
+
render: () =>
|
246
|
+
html`<ic-stepper variant="compact" id="custom-compact-stepper">
|
247
|
+
<ic-step step-title="First"></ic-step>
|
248
|
+
<ic-step
|
249
|
+
step-title="Second With a Very Long Title"
|
250
|
+
step-subtitle="Optional subtitle that is long and should wrap"
|
251
|
+
step-type="current"
|
252
|
+
></ic-step>
|
253
|
+
<ic-step step-title="Third" step-type="disabled"></ic-step>
|
254
|
+
<ic-step
|
255
|
+
step-title="Fourth title that is long and should wrap"
|
256
|
+
step-subtitle="Optional Subtitle"
|
257
|
+
step-type="completed"
|
258
|
+
></ic-step>
|
259
|
+
<ic-step
|
260
|
+
step-title="Fifth and final step"
|
261
|
+
step-subtitle="Optional Subtitle"
|
262
|
+
step-status="optional"
|
263
|
+
step-type="disabled"
|
264
|
+
></ic-step>
|
265
|
+
</ic-stepper>
|
266
|
+
<ic-button
|
267
|
+
class="back-btn-custom-compact-stepper"
|
268
|
+
style="margin-right: var(--ic-space-lg)"
|
269
|
+
onclick="toPreviousCustomStep()"
|
270
|
+
>Back</ic-button
|
271
|
+
>
|
272
|
+
<ic-button
|
273
|
+
class="next-btn-custom-compact-stepper"
|
274
|
+
onclick="toNextCustomStep()"
|
275
|
+
>Next</ic-button
|
276
|
+
>
|
277
|
+
<script>
|
278
|
+
const customCompactStepTypes = [
|
279
|
+
"active",
|
280
|
+
"completed",
|
281
|
+
"disabled",
|
282
|
+
"completed",
|
283
|
+
"disabled",
|
284
|
+
];
|
285
|
+
const backBtnCustomCompactStepper = document.querySelector(
|
286
|
+
".back-btn-custom-compact-stepper"
|
287
|
+
);
|
288
|
+
const nextBtnCustomCompactStepper = document.querySelector(
|
289
|
+
".next-btn-custom-compact-stepper"
|
290
|
+
);
|
291
|
+
const customSteps = document.querySelectorAll(
|
292
|
+
"#custom-compact-stepper > ic-step"
|
293
|
+
);
|
294
|
+
function toPreviousCustomStep() {
|
295
|
+
for (let i = customSteps.length - 1; i > 0; i--) {
|
296
|
+
if (customSteps[i].stepType === "current") {
|
297
|
+
customSteps[i].stepType = customCompactStepTypes[i];
|
298
|
+
customSteps[i - 1].stepType = "current";
|
299
|
+
i--;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
if (customSteps[customSteps.length - 2].stepType === "current") {
|
303
|
+
nextBtnCustomCompactStepper.setAttribute("disabled", "false");
|
304
|
+
}
|
305
|
+
if (customSteps[0].stepType === "current") {
|
306
|
+
backBtnCustomCompactStepper.setAttribute("disabled", "true");
|
307
|
+
}
|
308
|
+
}
|
309
|
+
function toNextCustomStep() {
|
310
|
+
for (let i = 0; i < customSteps.length - 1; i++) {
|
311
|
+
if (customSteps[i].stepType === "current") {
|
312
|
+
customSteps[i].stepType = customCompactStepTypes[i];
|
313
|
+
customSteps[i + 1].stepType = "current";
|
314
|
+
i++;
|
315
|
+
}
|
316
|
+
}
|
317
|
+
if (customSteps[1].stepType === "current") {
|
318
|
+
backBtnCustomCompactStepper.setAttribute("disabled", "false");
|
319
|
+
}
|
320
|
+
if (customSteps[customSteps.length - 1].stepType === "current") {
|
321
|
+
nextBtnCustomCompactStepper.setAttribute("disabled", "true");
|
322
|
+
}
|
323
|
+
}
|
324
|
+
</script>`,
|
325
|
+
|
326
|
+
name: "Custom compact stepper",
|
327
|
+
};
|