@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,171 @@
|
|
1
|
+
import { html } from "lit-html";
|
2
|
+
|
3
|
+
const defaultArgs = {
|
4
|
+
label: "Custom Switch",
|
5
|
+
helperText: "Custom helper text",
|
6
|
+
disabled: false,
|
7
|
+
checked: false,
|
8
|
+
hideLabel: false,
|
9
|
+
showState: false,
|
10
|
+
size: "default",
|
11
|
+
};
|
12
|
+
|
13
|
+
export default {
|
14
|
+
title: "Web Components/Switch",
|
15
|
+
component: "ic-switch",
|
16
|
+
};
|
17
|
+
|
18
|
+
export const Default = {
|
19
|
+
render: () => html` <ic-switch label="Label"></ic-switch> `,
|
20
|
+
name: "Default",
|
21
|
+
};
|
22
|
+
|
23
|
+
export const Name = {
|
24
|
+
render: () => html` <ic-switch label="Label"></ic-switch> `,
|
25
|
+
name: "Name",
|
26
|
+
};
|
27
|
+
|
28
|
+
export const State = {
|
29
|
+
render: () =>
|
30
|
+
html`<div style="display:flex; justify-content: center">
|
31
|
+
<ic-switch show-state="true" label="Label"></ic-switch>
|
32
|
+
</div>`,
|
33
|
+
|
34
|
+
name: "State",
|
35
|
+
};
|
36
|
+
|
37
|
+
export const Checked = {
|
38
|
+
render: () => html`
|
39
|
+
<ic-switch checked="true" label="Label" show-state="true"></ic-switch>
|
40
|
+
`,
|
41
|
+
|
42
|
+
name: "Checked",
|
43
|
+
};
|
44
|
+
|
45
|
+
export const Small = {
|
46
|
+
render: () => html`
|
47
|
+
<ic-switch size="small" show-state="true" label="Label"></ic-switch>
|
48
|
+
`,
|
49
|
+
|
50
|
+
name: "Small",
|
51
|
+
};
|
52
|
+
|
53
|
+
export const DeprecatedSmall = {
|
54
|
+
render: () => html`
|
55
|
+
<ic-switch small show-state="true" label="Label"></ic-switch>
|
56
|
+
`,
|
57
|
+
name: "Deprecated - small",
|
58
|
+
};
|
59
|
+
|
60
|
+
export const Disabled = {
|
61
|
+
render: () => html` <ic-switch disabled="true" label="Label"></ic-switch> `,
|
62
|
+
name: "Disabled",
|
63
|
+
};
|
64
|
+
|
65
|
+
export const DisabledNameAndState = {
|
66
|
+
render: () => html`
|
67
|
+
<ic-switch disabled="true" show-state="true" label="Label"></ic-switch>
|
68
|
+
`,
|
69
|
+
|
70
|
+
name: "Disabled, name and state",
|
71
|
+
};
|
72
|
+
|
73
|
+
export const DisabledNameStateAndChecked = {
|
74
|
+
render: () => html`
|
75
|
+
<ic-switch
|
76
|
+
disabled="true"
|
77
|
+
show-state="true"
|
78
|
+
label="Label"
|
79
|
+
checked="true"
|
80
|
+
></ic-switch>
|
81
|
+
`,
|
82
|
+
|
83
|
+
name: "Disabled, name, state and checked",
|
84
|
+
};
|
85
|
+
|
86
|
+
export const AriaLabel = {
|
87
|
+
render: () => html`
|
88
|
+
<ic-switch label="Custom label" hide-label="true"></ic-switch>
|
89
|
+
`,
|
90
|
+
name: "ARIA label",
|
91
|
+
};
|
92
|
+
|
93
|
+
export const HelperText = {
|
94
|
+
render: () =>
|
95
|
+
html` <ic-switch label="Label" helper-text="Helper Text"></ic-switch>`,
|
96
|
+
name: "Helper text",
|
97
|
+
};
|
98
|
+
|
99
|
+
export const RightAdornment = {
|
100
|
+
render: () =>
|
101
|
+
html` <ic-switch label="Right adornment">
|
102
|
+
<svg
|
103
|
+
slot="right-adornment"
|
104
|
+
width="16"
|
105
|
+
height="16"
|
106
|
+
viewBox="0 0 16 16"
|
107
|
+
fill="none"
|
108
|
+
xmlns="http://www.w3.org/2000/svg"
|
109
|
+
>
|
110
|
+
<path
|
111
|
+
d="M8 8C10.21 8 12 6.21 12 4C12 1.79 10.21 0 8 0C5.79 0 4 1.79 4 4C4 6.21 5.79 8 8 8ZM8 10C5.33 10 0 11.34 0 14V16H16V14C16 11.34 10.67 10 8 10Z"
|
112
|
+
/>
|
113
|
+
</svg>
|
114
|
+
</ic-switch>`,
|
115
|
+
|
116
|
+
name: "Right adornment",
|
117
|
+
};
|
118
|
+
|
119
|
+
export const DefaultInForm = {
|
120
|
+
render: () =>
|
121
|
+
html` <form id="form" aria-label="test form">
|
122
|
+
<ic-switch id="switch" label="custom label" hide-label="true"></ic-switch>
|
123
|
+
<br />
|
124
|
+
<br />
|
125
|
+
<input type="submit" value="Submit" />
|
126
|
+
<input type="reset" value="Reset" />
|
127
|
+
<form>
|
128
|
+
<script>
|
129
|
+
const tcForm = document.getElementById("form");
|
130
|
+
tcForm.addEventListener("submit", handleSubmit);
|
131
|
+
function handleSubmit(e) {
|
132
|
+
e.preventDefault();
|
133
|
+
var data = "HTML Form Data (name: value): \\n";
|
134
|
+
for (const element of document.getElementById("form").elements) {
|
135
|
+
data += element.name + ": " + element.value + "\\n";
|
136
|
+
}
|
137
|
+
alert(data);
|
138
|
+
}
|
139
|
+
</script>
|
140
|
+
</form>
|
141
|
+
</form>`,
|
142
|
+
|
143
|
+
name: "Default in form",
|
144
|
+
};
|
145
|
+
|
146
|
+
export const Playground = {
|
147
|
+
render: (args) =>
|
148
|
+
html`<ic-switch
|
149
|
+
disabled=${args.disabled}
|
150
|
+
show-state=${args.showState}
|
151
|
+
label=${args.label}
|
152
|
+
checked=${args.checked}
|
153
|
+
hide-label=${args.hideLabel}
|
154
|
+
helper-text=${args.helperText}
|
155
|
+
size=${args.size}
|
156
|
+
></ic-switch>`,
|
157
|
+
|
158
|
+
args: defaultArgs,
|
159
|
+
|
160
|
+
argTypes: {
|
161
|
+
size: {
|
162
|
+
options: ["default", "small"],
|
163
|
+
|
164
|
+
control: {
|
165
|
+
type: "inline-radio",
|
166
|
+
},
|
167
|
+
},
|
168
|
+
},
|
169
|
+
|
170
|
+
name: "Playground",
|
171
|
+
};
|
@@ -0,0 +1,388 @@
|
|
1
|
+
import { html } from "lit-html";
|
2
|
+
|
3
|
+
const defaultArgs = {
|
4
|
+
activationType: "automatic",
|
5
|
+
appearance: "dark",
|
6
|
+
disabled: false,
|
7
|
+
inline: false,
|
8
|
+
groupLabel: "Example tab group",
|
9
|
+
};
|
10
|
+
|
11
|
+
export default {
|
12
|
+
title: "Web Components/Tabs",
|
13
|
+
component: "ic-tab-context",
|
14
|
+
};
|
15
|
+
|
16
|
+
export const Default = {
|
17
|
+
render: () =>
|
18
|
+
html`<ic-tab-context>
|
19
|
+
<ic-tab-group label="Example tab group">
|
20
|
+
<ic-tab>One</ic-tab>
|
21
|
+
<ic-tab>Two</ic-tab>
|
22
|
+
<ic-tab>Three</ic-tab>
|
23
|
+
</ic-tab-group>
|
24
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
25
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
26
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
27
|
+
</ic-tab-context>`,
|
28
|
+
|
29
|
+
name: "Default",
|
30
|
+
};
|
31
|
+
|
32
|
+
export const WithIcons = {
|
33
|
+
render: () =>
|
34
|
+
html` <ic-tab-context>
|
35
|
+
<ic-tab-group label="Example tab group">
|
36
|
+
<ic-tab
|
37
|
+
>One
|
38
|
+
<svg
|
39
|
+
slot="icon"
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
41
|
+
height="24px"
|
42
|
+
viewBox="0 0 24 24"
|
43
|
+
width="24px"
|
44
|
+
fill="#000000"
|
45
|
+
>
|
46
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
47
|
+
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" /></svg
|
48
|
+
></ic-tab>
|
49
|
+
<ic-tab
|
50
|
+
>Two
|
51
|
+
<svg
|
52
|
+
slot="icon"
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
54
|
+
height="24px"
|
55
|
+
viewBox="0 0 24 24"
|
56
|
+
width="24px"
|
57
|
+
fill="#000000"
|
58
|
+
>
|
59
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
60
|
+
<path
|
61
|
+
d="M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"
|
62
|
+
/></svg
|
63
|
+
></ic-tab>
|
64
|
+
<ic-tab
|
65
|
+
>Three
|
66
|
+
<svg
|
67
|
+
slot="icon"
|
68
|
+
xmlns="http://www.w3.org/2000/svg"
|
69
|
+
height="24px"
|
70
|
+
viewBox="0 0 24 24"
|
71
|
+
width="24px"
|
72
|
+
fill="#000000"
|
73
|
+
>
|
74
|
+
<path
|
75
|
+
d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"
|
76
|
+
/>
|
77
|
+
</svg>
|
78
|
+
</ic-tab>
|
79
|
+
</ic-tab-group>
|
80
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
81
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
82
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
83
|
+
</ic-tab-context>`,
|
84
|
+
|
85
|
+
name: "With icons",
|
86
|
+
};
|
87
|
+
|
88
|
+
export const Disabled = {
|
89
|
+
render: () =>
|
90
|
+
html` <ic-tab-context>
|
91
|
+
<ic-tab-group label="Example tab group">
|
92
|
+
<ic-tab>One</ic-tab>
|
93
|
+
<ic-tab disabled>Two</ic-tab>
|
94
|
+
<ic-tab>Three</ic-tab>
|
95
|
+
</ic-tab-group>
|
96
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
97
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
98
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
99
|
+
</ic-tab-context>`,
|
100
|
+
|
101
|
+
name: "Disabled",
|
102
|
+
};
|
103
|
+
|
104
|
+
export const Inline = {
|
105
|
+
render: () =>
|
106
|
+
html` <ic-tab-context>
|
107
|
+
<ic-tab-group label="Example tab group" inline>
|
108
|
+
<ic-tab>One</ic-tab>
|
109
|
+
<ic-tab>Two</ic-tab>
|
110
|
+
<ic-tab>Three</ic-tab>
|
111
|
+
</ic-tab-group>
|
112
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
113
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
114
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
115
|
+
</ic-tab-context>`,
|
116
|
+
|
117
|
+
name: "Inline",
|
118
|
+
};
|
119
|
+
|
120
|
+
export const ManualActivation = {
|
121
|
+
render: () =>
|
122
|
+
html` <ic-tab-context activation-type="manual">
|
123
|
+
<ic-tab-group label="Example tab group">
|
124
|
+
<ic-tab>One</ic-tab>
|
125
|
+
<ic-tab>Two</ic-tab>
|
126
|
+
<ic-tab>Three</ic-tab>
|
127
|
+
</ic-tab-group>
|
128
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
129
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
130
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
131
|
+
</ic-tab-context>`,
|
132
|
+
|
133
|
+
name: "Manual activation",
|
134
|
+
};
|
135
|
+
|
136
|
+
export const LightText = {
|
137
|
+
render: () =>
|
138
|
+
html` <ic-tab-context appearance="light">
|
139
|
+
<ic-tab-group label="Example tab group">
|
140
|
+
<ic-tab>One</ic-tab>
|
141
|
+
<ic-tab>Two</ic-tab>
|
142
|
+
<ic-tab
|
143
|
+
>Three<svg
|
144
|
+
slot="icon"
|
145
|
+
xmlns="http://www.w3.org/2000/svg"
|
146
|
+
height="24px"
|
147
|
+
viewBox="0 0 24 24"
|
148
|
+
width="24px"
|
149
|
+
fill="#000000"
|
150
|
+
>
|
151
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
152
|
+
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" /></svg
|
153
|
+
></ic-tab>
|
154
|
+
</ic-tab-group>
|
155
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
156
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
157
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
158
|
+
</ic-tab-context>`,
|
159
|
+
|
160
|
+
name: "Light text",
|
161
|
+
|
162
|
+
parameters: {
|
163
|
+
backgrounds: {
|
164
|
+
default: "dark",
|
165
|
+
},
|
166
|
+
},
|
167
|
+
};
|
168
|
+
|
169
|
+
export const Responsive = {
|
170
|
+
render: () => html`
|
171
|
+
<ic-tab-context>
|
172
|
+
<ic-tab-group label="Example tab group">
|
173
|
+
<ic-tab>One</ic-tab>
|
174
|
+
<ic-tab>Two</ic-tab>
|
175
|
+
<ic-tab>Three</ic-tab>
|
176
|
+
<ic-tab>Four</ic-tab>
|
177
|
+
<ic-tab>Five</ic-tab>
|
178
|
+
<ic-tab>Six</ic-tab>
|
179
|
+
<ic-tab>Seven</ic-tab>
|
180
|
+
<ic-tab>Eight</ic-tab>
|
181
|
+
<ic-tab>Nine</ic-tab>
|
182
|
+
<ic-tab>Ten</ic-tab>
|
183
|
+
<ic-tab>Eleven</ic-tab>
|
184
|
+
<ic-tab>Twelve</ic-tab>
|
185
|
+
</ic-tab-group>
|
186
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
187
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
188
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
189
|
+
<ic-tab-panel>Tab Four</ic-tab-panel>
|
190
|
+
<ic-tab-panel>Tab Five</ic-tab-panel>
|
191
|
+
<ic-tab-panel>Tab Six</ic-tab-panel>
|
192
|
+
<ic-tab-panel>Tab Seven</ic-tab-panel>
|
193
|
+
<ic-tab-panel>Tab Eight</ic-tab-panel>
|
194
|
+
<ic-tab-panel>Tab Nine</ic-tab-panel>
|
195
|
+
<ic-tab-panel>Tab Ten</ic-tab-panel>
|
196
|
+
<ic-tab-panel>Tab Eleven</ic-tab-panel>
|
197
|
+
<ic-tab-panel>Tab Twelve</ic-tab-panel>
|
198
|
+
</ic-tab-context>
|
199
|
+
`,
|
200
|
+
|
201
|
+
name: "Responsive",
|
202
|
+
};
|
203
|
+
|
204
|
+
export const ResponsiveLightText = {
|
205
|
+
render: () => html`
|
206
|
+
<ic-tab-context appearance="light">
|
207
|
+
<ic-tab-group label="Example tab group">
|
208
|
+
<ic-tab>One</ic-tab>
|
209
|
+
<ic-tab>Two</ic-tab>
|
210
|
+
<ic-tab>Three</ic-tab>
|
211
|
+
<ic-tab>Four</ic-tab>
|
212
|
+
<ic-tab>Five</ic-tab>
|
213
|
+
<ic-tab>Six</ic-tab>
|
214
|
+
<ic-tab>Seven</ic-tab>
|
215
|
+
<ic-tab>Eight</ic-tab>
|
216
|
+
<ic-tab>Nine</ic-tab>
|
217
|
+
<ic-tab>Ten</ic-tab>
|
218
|
+
<ic-tab>Eleven</ic-tab>
|
219
|
+
<ic-tab>Twelve</ic-tab>
|
220
|
+
</ic-tab-group>
|
221
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
222
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
223
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
224
|
+
<ic-tab-panel>Tab Four</ic-tab-panel>
|
225
|
+
<ic-tab-panel>Tab Five</ic-tab-panel>
|
226
|
+
<ic-tab-panel>Tab Six</ic-tab-panel>
|
227
|
+
<ic-tab-panel>Tab Seven</ic-tab-panel>
|
228
|
+
<ic-tab-panel>Tab Eight</ic-tab-panel>
|
229
|
+
<ic-tab-panel>Tab Nine</ic-tab-panel>
|
230
|
+
<ic-tab-panel>Tab Ten</ic-tab-panel>
|
231
|
+
<ic-tab-panel>Tab Eleven</ic-tab-panel>
|
232
|
+
<ic-tab-panel>Tab Twelve</ic-tab-panel>
|
233
|
+
</ic-tab-context>
|
234
|
+
`,
|
235
|
+
|
236
|
+
name: "Responsive (Light text)",
|
237
|
+
|
238
|
+
parameters: {
|
239
|
+
backgrounds: {
|
240
|
+
default: "dark",
|
241
|
+
},
|
242
|
+
},
|
243
|
+
};
|
244
|
+
|
245
|
+
export const NestedTabs = {
|
246
|
+
render: () =>
|
247
|
+
html`<ic-tab-context id="main">
|
248
|
+
<ic-tab-group label="Example tab group">
|
249
|
+
<ic-tab>Outer One</ic-tab>
|
250
|
+
<ic-tab>Outer Two</ic-tab>
|
251
|
+
<ic-tab>Outer Three</ic-tab>
|
252
|
+
</ic-tab-group>
|
253
|
+
<ic-tab-panel>
|
254
|
+
<ic-tab-context context-id="context-nested" id="nested">
|
255
|
+
<ic-tab-group label="Example tab group">
|
256
|
+
<ic-tab>Nested One</ic-tab>
|
257
|
+
<ic-tab>Nested Two</ic-tab>
|
258
|
+
<ic-tab>Nested Three</ic-tab>
|
259
|
+
</ic-tab-group>
|
260
|
+
<ic-tab-panel>Nested Tab One</ic-tab-panel>
|
261
|
+
<ic-tab-panel>Nested Tab Two</ic-tab-panel>
|
262
|
+
<ic-tab-panel>Nested Tab Three</ic-tab-panel>
|
263
|
+
</ic-tab-context>
|
264
|
+
</ic-tab-panel>
|
265
|
+
<ic-tab-panel>Outer Tab Two</ic-tab-panel>
|
266
|
+
<ic-tab-panel>Outer Tab Three</ic-tab-panel>
|
267
|
+
</ic-tab-context>
|
268
|
+
<script>
|
269
|
+
const main = document.querySelector("#main");
|
270
|
+
const nested = document.querySelector("#nested");
|
271
|
+
main.addEventListener("icTabSelect", () => console.log("main"));
|
272
|
+
nested.addEventListener("icTabSelect", () => console.log("nested"));
|
273
|
+
</script> `,
|
274
|
+
|
275
|
+
name: "Nested tabs",
|
276
|
+
};
|
277
|
+
|
278
|
+
export const IcTabSelectEvent = {
|
279
|
+
render: (args) =>
|
280
|
+
html`<ic-tab-context>
|
281
|
+
<ic-tab-group label="Example tab group">
|
282
|
+
<ic-tab>One</ic-tab>
|
283
|
+
<ic-tab>Two</ic-tab>
|
284
|
+
<ic-tab>Three</ic-tab>
|
285
|
+
</ic-tab-group>
|
286
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
287
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
288
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
289
|
+
</ic-tab-context>
|
290
|
+
<script>
|
291
|
+
function handleIcTabSelect(ev) {
|
292
|
+
console.log(ev.detail, "icTabSelect");
|
293
|
+
}
|
294
|
+
document
|
295
|
+
.querySelector("ic-tab-context")
|
296
|
+
.addEventListener("icTabSelect", handleIcTabSelect);
|
297
|
+
</script>`,
|
298
|
+
|
299
|
+
name: "icTabSelect event",
|
300
|
+
};
|
301
|
+
|
302
|
+
export const MinAndMaxContent = {
|
303
|
+
render: () =>
|
304
|
+
html`<div style="max-width:500px">
|
305
|
+
<ic-tab-context>
|
306
|
+
<ic-tab-group label="Example tab group">
|
307
|
+
<ic-tab>Extremely long tab label made of plenty of words</ic-tab>
|
308
|
+
<ic-tab>A</ic-tab>
|
309
|
+
<ic-tab>Antidisestablishmentarianismbutmadeevenlonger</ic-tab>
|
310
|
+
</ic-tab-group>
|
311
|
+
<ic-tab-panel
|
312
|
+
>Testing tab behaviour with lots of words in label</ic-tab-panel
|
313
|
+
>
|
314
|
+
<ic-tab-panel>Testing minimum label length</ic-tab-panel>
|
315
|
+
<ic-tab-panel
|
316
|
+
>Testing tab behaviour with one really long word in
|
317
|
+
label</ic-tab-panel
|
318
|
+
>
|
319
|
+
</ic-tab-context>
|
320
|
+
</div>`,
|
321
|
+
|
322
|
+
name: "Min and max content",
|
323
|
+
};
|
324
|
+
|
325
|
+
export const Playground = {
|
326
|
+
render: (args) =>
|
327
|
+
html`<div
|
328
|
+
style="background-color: ${args.appearance == "light" ? "black" : ""};"
|
329
|
+
>
|
330
|
+
<ic-tab-context
|
331
|
+
activation-type=${args.activationType}
|
332
|
+
appearance=${args.appearance}
|
333
|
+
>
|
334
|
+
<ic-tab-group label=${args.groupLabel} inline=${args.inline}>
|
335
|
+
<ic-tab disabled=${args.disabled}> One </ic-tab>
|
336
|
+
<ic-tab>
|
337
|
+
Two
|
338
|
+
<ic-badge
|
339
|
+
text-label="1"
|
340
|
+
slot="badge"
|
341
|
+
position="inline"
|
342
|
+
accessible-label="1 notification found"
|
343
|
+
>
|
344
|
+
</ic-badge>
|
345
|
+
</ic-tab>
|
346
|
+
<ic-tab>
|
347
|
+
Three
|
348
|
+
<svg
|
349
|
+
slot="icon"
|
350
|
+
xmlns="http://www.w3.org/2000/svg"
|
351
|
+
height="24px"
|
352
|
+
viewBox="0 0 24 24"
|
353
|
+
width="24px"
|
354
|
+
fill="#000000"
|
355
|
+
>
|
356
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
357
|
+
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />
|
358
|
+
</svg>
|
359
|
+
</ic-tab>
|
360
|
+
</ic-tab-group>
|
361
|
+
<ic-tab-panel>Tab One</ic-tab-panel>
|
362
|
+
<ic-tab-panel>Tab Two</ic-tab-panel>
|
363
|
+
<ic-tab-panel>Tab Three</ic-tab-panel>
|
364
|
+
</ic-tab-context>
|
365
|
+
</div>`,
|
366
|
+
|
367
|
+
args: defaultArgs,
|
368
|
+
|
369
|
+
argTypes: {
|
370
|
+
activationType: {
|
371
|
+
options: ["automatic", "manual"],
|
372
|
+
|
373
|
+
control: {
|
374
|
+
type: "inline-radio",
|
375
|
+
},
|
376
|
+
},
|
377
|
+
|
378
|
+
appearance: {
|
379
|
+
options: ["dark", "light"],
|
380
|
+
|
381
|
+
control: {
|
382
|
+
type: "inline-radio",
|
383
|
+
},
|
384
|
+
},
|
385
|
+
},
|
386
|
+
|
387
|
+
name: "Playground",
|
388
|
+
};
|