@infineon/infineon-design-system-stencil 30.9.1 → 30.9.2--canary.1640.8926aa040c1241b80b9d12b6600d721691845221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ifx-accordion_2.cjs.entry.js +2 -2
- package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-modal.cjs.entry.js +8 -8
- package/dist/cjs/ifx-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js +5 -5
- package/dist/cjs/ifx-multiselect_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-search-bar.cjs.entry.js +5 -5
- package/dist/cjs/ifx-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js +9 -9
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +79 -3
- package/dist/collection/components/accordion/accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/accordionItem.js +4 -4
- package/dist/collection/components/accordion/accordionItem.js.map +1 -1
- package/dist/collection/components/alert/alert.stories.js +45 -12
- package/dist/collection/components/alert/alert.stories.js.map +1 -1
- package/dist/collection/components/badge/badge.stories.js +28 -7
- package/dist/collection/components/badge/badge.stories.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +66 -7
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js.map +1 -1
- package/dist/collection/components/button/button.stories.js +104 -9
- package/dist/collection/components/button/button.stories.js.map +1 -1
- package/dist/collection/components/card/card.stories.js +85 -2
- package/dist/collection/components/card/card.stories.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +75 -14
- package/dist/collection/components/checkbox/checkbox.stories.js.map +1 -1
- package/dist/collection/components/content-switcher/content-switcher.stories.js +65 -3
- package/dist/collection/components/content-switcher/content-switcher.stories.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.stories.js +73 -6
- package/dist/collection/components/date-picker/date-picker.stories.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.stories.js +161 -64
- package/dist/collection/components/dropdown/dropdown.stories.js.map +1 -1
- package/dist/collection/components/footer/footer.stories.js +7 -1
- package/dist/collection/components/footer/footer.stories.js.map +1 -1
- package/dist/collection/components/icon/infineonIconStencil.stories.js +7 -2
- package/dist/collection/components/icon/infineonIconStencil.stories.js.map +1 -1
- package/dist/collection/components/icon-button/icon-button.stories.js +61 -5
- package/dist/collection/components/icon-button/icon-button.stories.js.map +1 -1
- package/dist/collection/components/link/link.stories.js +56 -4
- package/dist/collection/components/link/link.stories.js.map +1 -1
- package/dist/collection/components/modal/modal.js +10 -10
- package/dist/collection/components/modal/modal.js.map +1 -1
- package/dist/collection/components/modal/modal.stories.js +96 -19
- package/dist/collection/components/modal/modal.stories.js.map +1 -1
- package/dist/collection/components/navigation/navbar/navbar.stories.js +203 -12
- package/dist/collection/components/navigation/navbar/navbar.stories.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar-item.js +11 -11
- package/dist/collection/components/navigation/sidebar/sidebar-item.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js +110 -17
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js.map +1 -1
- package/dist/collection/components/notification/notification.stories.js +51 -4
- package/dist/collection/components/notification/notification.stories.js.map +1 -1
- package/dist/collection/components/number-indicator/number-indicator.stories.js +19 -0
- package/dist/collection/components/number-indicator/number-indicator.stories.js.map +1 -1
- package/dist/collection/components/pagination/pagination.stories.js +30 -3
- package/dist/collection/components/pagination/pagination.stories.js.map +1 -1
- package/dist/collection/components/progress-bar/progress-bar.stories.js +31 -8
- package/dist/collection/components/progress-bar/progress-bar.stories.js.map +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.js +66 -13
- package/dist/collection/components/radio-button/radio-button.stories.js.map +1 -1
- package/dist/collection/components/search-bar/search-bar.js +6 -6
- package/dist/collection/components/search-bar/search-bar.js.map +1 -1
- package/dist/collection/components/search-bar/search-bar.stories.js +58 -9
- package/dist/collection/components/search-bar/search-bar.stories.js.map +1 -1
- package/dist/collection/components/search-field/search-field.stories.js +43 -7
- package/dist/collection/components/search-field/search-field.stories.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.js +6 -6
- package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
- package/dist/collection/components/select/multi-select/multiselect.stories.js +131 -5
- package/dist/collection/components/select/multi-select/multiselect.stories.js.map +1 -1
- package/dist/collection/components/select/single-select/select.stories.js +83 -26
- package/dist/collection/components/select/single-select/select.stories.js.map +1 -1
- package/dist/collection/components/slider/slider.stories.js +97 -13
- package/dist/collection/components/slider/slider.stories.js.map +1 -1
- package/dist/collection/components/spinner/spinner.stories.js +34 -2
- package/dist/collection/components/spinner/spinner.stories.js.map +1 -1
- package/dist/collection/components/status/status.stories.js +24 -1
- package/dist/collection/components/status/status.stories.js.map +1 -1
- package/dist/collection/components/stepper/stepper.stories.js +33 -16
- package/dist/collection/components/stepper/stepper.stories.js.map +1 -1
- package/dist/collection/components/switch/switch.stories.js +54 -4
- package/dist/collection/components/switch/switch.stories.js.map +1 -1
- package/dist/collection/components/table-advanced-version/table.stories.js +71 -11
- package/dist/collection/components/table-advanced-version/table.stories.js.map +1 -1
- package/dist/collection/components/table-basic-version/table.stories.js +17 -1
- package/dist/collection/components/table-basic-version/table.stories.js.map +1 -1
- package/dist/collection/components/tabs/tabs.stories.js +89 -23
- package/dist/collection/components/tabs/tabs.stories.js.map +1 -1
- package/dist/collection/components/tag/tag.stories.js +18 -0
- package/dist/collection/components/tag/tag.stories.js.map +1 -1
- package/dist/collection/components/text-field/text-field.stories.js +104 -13
- package/dist/collection/components/text-field/text-field.stories.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.stories.js +48 -4
- package/dist/collection/components/tooltip/tooltip.stories.js.map +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-faq.js +1 -1
- package/dist/components/ifx-modal.js +8 -8
- package/dist/components/ifx-modal.js.map +1 -1
- package/dist/components/ifx-multiselect.js +1 -1
- package/dist/components/ifx-search-bar.js +5 -5
- package/dist/components/ifx-search-bar.js.map +1 -1
- package/dist/components/ifx-set-filter.js +1 -1
- package/dist/components/ifx-sidebar-item.js +11 -11
- package/dist/components/ifx-sidebar-item.js.map +1 -1
- package/dist/components/{p-b2439194.js → p-62c6aeb2.js} +4 -4
- package/dist/components/{p-b2439194.js.map → p-62c6aeb2.js.map} +1 -1
- package/dist/components/{p-04b73e62.js → p-cf8fd0f4.js} +6 -6
- package/dist/components/p-cf8fd0f4.js.map +1 -0
- package/dist/esm/ifx-accordion_2.entry.js +2 -2
- package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
- package/dist/esm/ifx-modal.entry.js +8 -8
- package/dist/esm/ifx-modal.entry.js.map +1 -1
- package/dist/esm/ifx-multiselect_2.entry.js +5 -5
- package/dist/esm/ifx-multiselect_2.entry.js.map +1 -1
- package/dist/esm/ifx-search-bar.entry.js +5 -5
- package/dist/esm/ifx-search-bar.entry.js.map +1 -1
- package/dist/esm/ifx-sidebar-item.entry.js +9 -9
- package/dist/esm/ifx-sidebar-item.entry.js.map +1 -1
- package/dist/esm/infineon-design-system-stencil.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
- package/dist/infineon-design-system-stencil/p-60dcd508.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-60dcd508.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-6a274db4.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-6a274db4.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/{p-bc8a4226.entry.js → p-d93eb561.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-d93eb561.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js.map +1 -0
- package/dist/types/components/accordion/accordion.stories.d.ts +67 -1
- package/dist/types/components/accordion/accordionItem.d.ts +1 -1
- package/dist/types/components/alert/alert.stories.d.ts +38 -11
- package/dist/types/components/badge/badge.stories.d.ts +23 -3
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +66 -1
- package/dist/types/components/button/button.stories.d.ts +95 -16
- package/dist/types/components/card/card.stories.d.ts +95 -1
- package/dist/types/components/checkbox/checkbox.stories.d.ts +68 -10
- package/dist/types/components/content-switcher/content-switcher.stories.d.ts +66 -0
- package/dist/types/components/date-picker/date-picker.stories.d.ts +67 -2
- package/dist/types/components/dropdown/dropdown.stories.d.ts +111 -27
- package/dist/types/components/footer/footer.stories.d.ts +4 -0
- package/dist/types/components/icon/infineonIconStencil.stories.d.ts +5 -0
- package/dist/types/components/icon-button/icon-button.stories.d.ts +56 -8
- package/dist/types/components/link/link.stories.d.ts +52 -6
- package/dist/types/components/modal/modal.d.ts +2 -2
- package/dist/types/components/modal/modal.stories.d.ts +77 -3
- package/dist/types/components/navigation/navbar/navbar.stories.d.ts +243 -6
- package/dist/types/components/navigation/sidebar/sidebar-item.d.ts +2 -2
- package/dist/types/components/navigation/sidebar/sidebar.stories.d.ts +90 -7
- package/dist/types/components/notification/notification.stories.d.ts +44 -0
- package/dist/types/components/number-indicator/number-indicator.stories.d.ts +19 -0
- package/dist/types/components/pagination/pagination.stories.d.ts +27 -0
- package/dist/types/components/progress-bar/progress-bar.stories.d.ts +25 -4
- package/dist/types/components/radio-button/radio-button.stories.d.ts +59 -8
- package/dist/types/components/search-bar/search-bar.d.ts +1 -1
- package/dist/types/components/search-bar/search-bar.stories.d.ts +60 -3
- package/dist/types/components/search-field/search-field.stories.d.ts +36 -6
- package/dist/types/components/select/multi-select/multiselect.d.ts +1 -1
- package/dist/types/components/select/multi-select/multiselect.stories.d.ts +125 -0
- package/dist/types/components/select/single-select/select.stories.d.ts +67 -24
- package/dist/types/components/slider/slider.stories.d.ts +110 -0
- package/dist/types/components/spinner/spinner.stories.d.ts +32 -0
- package/dist/types/components/status/status.stories.d.ts +23 -2
- package/dist/types/components/stepper/stepper.stories.d.ts +21 -4
- package/dist/types/components/switch/switch.stories.d.ts +50 -1
- package/dist/types/components/table-basic-version/table.stories.d.ts +19 -1
- package/dist/types/components/tabs/tabs.stories.d.ts +77 -7
- package/dist/types/components/tag/tag.stories.d.ts +20 -0
- package/dist/types/components/text-field/text-field.stories.d.ts +96 -11
- package/dist/types/components/tooltip/tooltip.stories.d.ts +41 -6
- package/dist/types/components.d.ts +10 -10
- package/package.json +1 -1
- package/dist/components/p-04b73e62.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-222c1af9.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-222c1af9.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-436babb8.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-436babb8.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-9481adc8.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-9481adc8.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-bc8a4226.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js.map +0 -1
@@ -4,17 +4,87 @@ export default {
|
|
4
4
|
component: 'ifx-accordion',
|
5
5
|
//tags: ['autodocs'],
|
6
6
|
args: {
|
7
|
-
|
7
|
+
amountOfItems: 3,
|
8
8
|
AriaLevel: 3,
|
9
|
+
autoCollapse: false,
|
9
10
|
},
|
10
11
|
argTypes: {
|
11
|
-
amountOfItems: {
|
12
|
+
amountOfItems: {
|
13
|
+
control: 'number',
|
14
|
+
name: 'Amount of Items',
|
15
|
+
description: 'Control the number of *<ifx-accordion-item>*.',
|
16
|
+
table: {
|
17
|
+
category: 'story controls',
|
18
|
+
type: {
|
19
|
+
summary: 'number'
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
12
23
|
AriaLevel: {
|
13
24
|
control: 'number',
|
14
25
|
min: 1,
|
15
26
|
max: 6,
|
16
|
-
description: 'The aria-level attribute for the accordion item header.'
|
27
|
+
description: 'The aria-level attribute for the accordion item header.',
|
28
|
+
table: {
|
29
|
+
defaultValue: { summary: '3' },
|
30
|
+
category: 'ifx-accordion-item props',
|
31
|
+
type: {
|
32
|
+
summary: 'number'
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
mutable: {
|
37
|
+
control: 'boolean',
|
38
|
+
description: 'Set the mutable attribute.',
|
39
|
+
table: {
|
40
|
+
category: 'ifx-accordion-item props',
|
41
|
+
defaultValue: { summary: 'true' },
|
42
|
+
type: {
|
43
|
+
summary: 'boolean'
|
44
|
+
}
|
45
|
+
}
|
17
46
|
},
|
47
|
+
autoCollapse: {
|
48
|
+
control: 'boolean',
|
49
|
+
description: 'Collapse the other items when one item is opened.',
|
50
|
+
table: {
|
51
|
+
category: 'ifx-accordion props',
|
52
|
+
defaultValue: {
|
53
|
+
summary: 'false'
|
54
|
+
},
|
55
|
+
type: {
|
56
|
+
summary: 'boolean'
|
57
|
+
}
|
58
|
+
}
|
59
|
+
},
|
60
|
+
ifxItemOpen: {
|
61
|
+
action: 'ifxItemOpen',
|
62
|
+
description: 'Event emitted when an accordion item is opened.',
|
63
|
+
table: {
|
64
|
+
category: 'custom events',
|
65
|
+
type: {
|
66
|
+
summary: 'Framework integration',
|
67
|
+
detail: `React: onIfxItemOpen={handleOpen}
|
68
|
+
Vue: @ifxItemOpen="handleOpen"
|
69
|
+
Angular: (ifxItemOpen)="handleOpen()"
|
70
|
+
VanillaJs: .addEventListener("ifxItemOpen", (event) => {/*handle open*/});`
|
71
|
+
}
|
72
|
+
},
|
73
|
+
},
|
74
|
+
ifxItemClose: {
|
75
|
+
action: 'ifxItemClose',
|
76
|
+
description: 'Event emitted when an accordion item is closed.',
|
77
|
+
table: {
|
78
|
+
category: 'custom events',
|
79
|
+
type: {
|
80
|
+
summary: 'Framework integration',
|
81
|
+
detail: `React: onIfxItemClose={handleClose}
|
82
|
+
Vue: @ifxItemClose="handleClose"
|
83
|
+
Angular: (ifxItemClose)="handleClose()"
|
84
|
+
VanillaJs: .addEventListener("ifxItemClose", (event) => {/*handle close*/});`
|
85
|
+
}
|
86
|
+
},
|
87
|
+
}
|
18
88
|
},
|
19
89
|
};
|
20
90
|
const Template = args => {
|
@@ -23,11 +93,15 @@ const Template = args => {
|
|
23
93
|
initialItem.setAttribute('caption', `Label`);
|
24
94
|
initialItem.setAttribute('open', `true`);
|
25
95
|
initialItem.setAttribute('aria-level', args.AriaLevel);
|
96
|
+
initialItem.setAttribute('mutable', args.mutable);
|
97
|
+
initialItem.addEventListener('ifxItemOpen', action('ifxItemOpen'));
|
98
|
+
initialItem.addEventListener('ifxItemClose', action('ifxItemClose'));
|
26
99
|
initialItem.innerHTML = `
|
27
100
|
Content for Initial Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.
|
28
101
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.
|
29
102
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.
|
30
103
|
`;
|
104
|
+
initialItem.setAttribute('caption', `Label`);
|
31
105
|
initialItem.addEventListener('ifxItemOpen', action('ifxItemOpen'));
|
32
106
|
initialItem.addEventListener('ifxItemClose', action('ifxItemClose'));
|
33
107
|
accordionElement.append(initialItem);
|
@@ -37,6 +111,7 @@ const Template = args => {
|
|
37
111
|
item.setAttribute('caption', `Label`);
|
38
112
|
item.setAttribute('open', `false`);
|
39
113
|
item.setAttribute('aria-level', args.AriaLevel);
|
114
|
+
item.setAttribute('mutable', args.mutable);
|
40
115
|
item.innerHTML = `
|
41
116
|
Content for Item #${i + 1}. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.
|
42
117
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.
|
@@ -51,5 +126,6 @@ const Template = args => {
|
|
51
126
|
export const Default = Template.bind({});
|
52
127
|
Default.args = {
|
53
128
|
amountOfItems: 3,
|
129
|
+
mutable: true,
|
54
130
|
};
|
55
131
|
//# sourceMappingURL=accordion.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accordion.stories.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,eAAe;IAC1B,qBAAqB;IAErB,IAAI,EAAE;QACJ,
|
1
|
+
{"version":3,"file":"accordion.stories.js","sourceRoot":"","sources":["../../../src/components/accordion/accordion.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,eAAe;IAC1B,qBAAqB;IAErB,IAAI,EAAE;QACJ,aAAa,EAAE,CAAC;QAChB,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,KAAK;KACpB;IAED,QAAQ,EAAE;QACR,aAAa,EAAE;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AAG,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,SAAS,GAAG;4BAEX,CAAC,GAAG,CACN;;;KAGH,CAAC;QACF,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAE9D,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,aAAa,EAAE,CAAC;IAChB,OAAO,EAAE,IAAI;CACd,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\n\nexport default {\n title: 'Components/Accordion',\n component: 'ifx-accordion',\n //tags: ['autodocs'],\n\n args: {\n amountOfItems: 3,\n AriaLevel: 3,\n autoCollapse: false,\n },\n\n argTypes: {\n amountOfItems: { \n control: 'number', \n name: 'Amount of Items',\n description: 'Control the number of *<ifx-accordion-item>*.',\n table: {\n category: 'story controls',\n type: {\n summary: 'number'\n }\n }\n },\n AriaLevel: {\n control: 'number', \n min: 1, \n max: 6, \n description: 'The aria-level attribute for the accordion item header.',\n table: {\n defaultValue: {summary: '3'},\n category: 'ifx-accordion-item props',\n type: {\n summary: 'number'\n }\n } \n }, \n mutable: {\n control: 'boolean',\n description: 'Set the mutable attribute.',\n table: {\n category: 'ifx-accordion-item props',\n defaultValue: {summary: 'true'},\n type: {\n summary: 'boolean'\n }\n }\n },\n autoCollapse: {\n control: 'boolean',\n description: 'Collapse the other items when one item is opened.',\n table: {\n category: 'ifx-accordion props',\n defaultValue: { \n summary: 'false' \n },\n type: {\n summary: 'boolean'\n }\n }\n },\n ifxItemOpen: { \n action: 'ifxItemOpen',\n description: 'Event emitted when an accordion item is opened.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:`React: onIfxItemOpen={handleOpen}\n Vue: @ifxItemOpen=\"handleOpen\"\n Angular: (ifxItemOpen)=\"handleOpen()\"\n VanillaJs: .addEventListener(\"ifxItemOpen\", (event) => {/*handle open*/});`\n }\n },\n },\n ifxItemClose: { \n action: 'ifxItemClose',\n description: 'Event emitted when an accordion item is closed.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail: \n `React: onIfxItemClose={handleClose}\n Vue: @ifxItemClose=\"handleClose\"\n Angular: (ifxItemClose)=\"handleClose()\"\n VanillaJs: .addEventListener(\"ifxItemClose\", (event) => {/*handle close*/});`\n }\n },\n }\n },\n};\n\nconst Template = args => {\n const accordionElement = document.createElement('ifx-accordion');\n const initialItem = document.createElement('ifx-accordion-item');\n initialItem.setAttribute('caption', `Label`);\n initialItem.setAttribute('open', `true`);\n initialItem.setAttribute('aria-level', args.AriaLevel);\n initialItem.setAttribute('mutable', args.mutable);\n initialItem.addEventListener('ifxItemOpen', action('ifxItemOpen'));\n initialItem.addEventListener('ifxItemClose', action('ifxItemClose'));\n\n initialItem.innerHTML = `\n Content for Initial Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n`;\ninitialItem.setAttribute('caption', `Label`);\n initialItem.addEventListener('ifxItemOpen', action('ifxItemOpen'));\n initialItem.addEventListener('ifxItemClose', action('ifxItemClose'));\n\n accordionElement.append(initialItem);\n\n accordionElement.setAttribute('auto-collapse', args.autoCollapse);\n for (let i = 1; i < args.amountOfItems; i++) {\n const item = document.createElement('ifx-accordion-item');\n item.setAttribute('caption', `Label`);\n item.setAttribute('open', `false`);\n item.setAttribute('aria-level', args.AriaLevel);\n item.setAttribute('mutable', args.mutable);\n\n item.innerHTML = `\n Content for Item #${\n i + 1\n }. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent volutpat, ligula eu aliquam bibendum, orci nisl cursus ipsum, nec egestas odio sapien eget neque.\n `;\n item.addEventListener('ifxItemOpen', action('ifxItemOpen'));\n item.addEventListener('ifxItemClose', action('ifxItemClose'));\n\n accordionElement.append(item);\n }\n\n return accordionElement;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n amountOfItems: 3,\n mutable: true,\n};\n"]}
|
@@ -4,7 +4,7 @@ export class IfxAccordionItem {
|
|
4
4
|
constructor() {
|
5
5
|
this.caption = undefined;
|
6
6
|
this.open = false;
|
7
|
-
this.
|
7
|
+
this.AriaLevel = 3;
|
8
8
|
this.internalOpen = false;
|
9
9
|
}
|
10
10
|
componentWillLoad() {
|
@@ -68,7 +68,7 @@ export class IfxAccordionItem {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
render() {
|
71
|
-
return (h("div", { key: '
|
71
|
+
return (h("div", { key: '81ca5bfa7f1766eb5b2657b4e2df0019cde776aa', class: `accordion-item ${this.internalOpen ? 'open' : ''}` }, h("div", { key: '0b4daafa22e601cbf1ad1efbe79665c19b751fde', role: "button", "aria-expanded": this.internalOpen, "aria-controls": "accordion-content", class: "accordion-title", onClick: () => this.toggleOpen(), tabindex: '0' }, h("span", { key: 'e48ea5054c730b317df221a3f191d13186af1932', "aria-hidden": "true", role: "heading", "aria-level": String(this.AriaLevel), class: "accordion-icon" }, h("ifx-icon", { key: 'e9581b95bb5a60319c1537c3de6525030d56bf2c', icon: "chevron-down-12" })), h("span", { key: '28862a5c2e3c801b6be02d38c20bd91dce003cbf', id: "accordion-caption", class: "accordion-caption" }, this.caption)), h("div", { key: 'bfe16bfca9899e00e3356bf723caeec83e256486', id: "accordion-content", class: "accordion-content", ref: (el) => (this.contentEl = el), role: "region", "aria-labelledby": "accordion-caption" }, h("div", { key: '1da3e12ea0120b6450f3f88c3a81e40b9c0c2cd5', class: "inner-content" }, h("slot", { key: '229dec050d2cf0fdd1f78b03dc37e831869c624d', onSlotchange: (e) => this.handleSlotChange(e) })))));
|
72
72
|
}
|
73
73
|
static get is() { return "ifx-accordion-item"; }
|
74
74
|
static get encapsulation() { return "shadow"; }
|
@@ -123,7 +123,7 @@ export class IfxAccordionItem {
|
|
123
123
|
"reflect": false,
|
124
124
|
"defaultValue": "false"
|
125
125
|
},
|
126
|
-
"
|
126
|
+
"AriaLevel": {
|
127
127
|
"type": "number",
|
128
128
|
"mutable": false,
|
129
129
|
"complexType": {
|
@@ -139,7 +139,7 @@ export class IfxAccordionItem {
|
|
139
139
|
},
|
140
140
|
"getter": false,
|
141
141
|
"setter": false,
|
142
|
-
"attribute": "aria-
|
142
|
+
"attribute": "aria-level",
|
143
143
|
"reflect": false,
|
144
144
|
"defaultValue": "3"
|
145
145
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"accordionItem.js","sourceRoot":"","sources":["../../../src/components/accordion/accordionItem.tsx"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO9F,MAAM,OAAO,gBAAgB;;;oBAIR,KAAK;
|
1
|
+
{"version":3,"file":"accordionItem.js","sourceRoot":"","sources":["../../../src/components/accordion/accordionItem.tsx"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO9F,MAAM,OAAO,gBAAgB;;;oBAIR,KAAK;yBACJ,CAAC;4BACY,KAAK;;IAMtC,iBAAiB;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;IAChC,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC1B,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC1B,CAAC;IAKD,WAAW,CAAC,QAAiB;QAC3B,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC;QAE9B,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACvD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,Y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, Listen } from '@stencil/core';\n\n@Component({\n tag: 'ifx-accordion-item',\n styleUrl: 'accordionItem.scss',\n shadow: true,\n})\nexport class IfxAccordionItem {\n @Prop() caption: string;\n @Prop({\n mutable: true,\n }) open: boolean = false;\n @Prop() AriaLevel = 3;\n @State() internalOpen: boolean = false;\n @Event() ifxItemOpen: EventEmitter;\n @Event() ifxItemClose: EventEmitter;\n private contentEl!: HTMLElement;\n\n\n componentWillLoad() {\n this.internalOpen = this.open;\n }\n\n componentDidLoad() {\n this.openAccordionItem()\n }\n\n componentDidUpdate() {\n this.openAccordionItem()\n }\n\n\n\n @Watch('open')\n openChanged(newValue: boolean) {\n this.internalOpen = newValue;\n }\n\n toggleOpen() {\n this.internalOpen = !this.internalOpen;\n this.open = this.internalOpen;\n\n if (this.internalOpen) {\n this.ifxItemOpen.emit({ isOpen: this.internalOpen });\n } else {\n this.ifxItemClose.emit({ isClosed: !this.internalOpen });\n }\n }\n\n openAccordionItem() {\n if (this.internalOpen) {\n this.contentEl.style.maxHeight = `${this.contentEl.scrollHeight}px`;\n } else {\n this.contentEl.style.maxHeight = '0';\n }\n }\n\n handleSlotChange(e) {\n const slotElement = e.target;\n const nodes = slotElement.assignedNodes();\n \n if(nodes.length > 0) {\n nodes.forEach(node => {\n const observer = new MutationObserver((mutationsList, _) => {\n for(let mutation of mutationsList) {\n if (mutation.type === 'childList') {\n if (this.internalOpen) {\n this.openAccordionItem();\n }\n }\n }\n });\n observer.observe(node, { attributes: true, childList: true, subtree: true });\n });\n }\n\n if (this.internalOpen) {\n this.openAccordionItem();\n }\n }\n\n \n\n @Listen('keydown')\n handleKeydown(ev: KeyboardEvent) {\n switch (ev.key) {\n case 'Enter': // fallthrough\n case ' ': // space\n ev.preventDefault();\n this.toggleOpen();\n break;\n }\n }\n\n\n render() {\n return (\n <div class={`accordion-item ${this.internalOpen ? 'open' : ''}`}>\n <div role=\"button\" aria-expanded={this.internalOpen} aria-controls=\"accordion-content\" class=\"accordion-title\" onClick={() => this.toggleOpen()} tabindex='0'>\n <span aria-hidden=\"true\" role=\"heading\" aria-level={String(this.AriaLevel) as string} class=\"accordion-icon\">\n <ifx-icon icon=\"chevron-down-12\"/>\n </span>\n <span id=\"accordion-caption\" class=\"accordion-caption\">{this.caption}</span>\n </div>\n <div id=\"accordion-content\" class=\"accordion-content\" ref={(el) => (this.contentEl = el as HTMLElement)} role=\"region\" aria-labelledby=\"accordion-caption\">\n <div class=\"inner-content\">\n <slot onSlotchange={(e) => this.handleSlotChange(e)} />\n </div>\n </div>\n </div>\n );\n }\n}"]}
|
@@ -5,28 +5,55 @@ export default {
|
|
5
5
|
args: {
|
6
6
|
label: 'Attention! This is an alert message — check it out!',
|
7
7
|
variant: 'primary',
|
8
|
-
showIcon: true,
|
9
8
|
closable: true,
|
10
|
-
|
9
|
+
icon: 'c-info-24',
|
11
10
|
AriaLive: 'assertive',
|
12
11
|
},
|
13
12
|
argTypes: {
|
13
|
+
label: {
|
14
|
+
name: 'Label of Alert',
|
15
|
+
description: 'Sets the label of *<ifx-alert>*.',
|
16
|
+
table: {
|
17
|
+
category: 'story controls'
|
18
|
+
}
|
19
|
+
},
|
14
20
|
variant: {
|
21
|
+
description: 'Sets the style variant of the alert.',
|
15
22
|
options: ['primary', 'success', 'danger', 'warning'],
|
16
|
-
control:
|
23
|
+
control: 'radio',
|
24
|
+
table: {
|
25
|
+
category: 'ifx-alert props',
|
26
|
+
defaultValue: {
|
27
|
+
summary: 'primary'
|
28
|
+
}
|
29
|
+
}
|
17
30
|
},
|
18
|
-
|
19
|
-
|
20
|
-
|
31
|
+
icon: {
|
32
|
+
description: 'The icon to be displayed. Choose ***none*** to display no icon.',
|
33
|
+
options: ['none', ...Object.values(icons).map(i => i['name'])],
|
34
|
+
control: 'select',
|
35
|
+
table: {
|
36
|
+
category: 'ifx-alert props',
|
37
|
+
defaultValue: {
|
38
|
+
summary: 'c-info-24'
|
39
|
+
}
|
40
|
+
}
|
21
41
|
},
|
22
42
|
closable: {
|
43
|
+
description: 'Defines whether the alert should be closable or not.',
|
23
44
|
control: 'boolean',
|
24
|
-
|
45
|
+
table: {
|
46
|
+
category: 'ifx-alert props',
|
47
|
+
defaultValue: {
|
48
|
+
summary: 'true'
|
49
|
+
}
|
50
|
+
}
|
25
51
|
},
|
26
52
|
ifxClose: {
|
27
53
|
action: 'ifxClose',
|
28
|
-
description: 'Custom event emitted when close button clicked',
|
54
|
+
description: 'Custom event emitted when close button clicked.',
|
29
55
|
table: {
|
56
|
+
category: 'custom events',
|
30
57
|
type: {
|
31
58
|
summary: 'Framework integration',
|
32
59
|
detail: 'React: onIfxClose={handleChange}\nVue:@ifxClose="handleChange"\nAngular:(ifxClose)="handleChange()"\nVanillaJs:.addEventListener("ifxClose", (event) => {//handle change});',
|
@@ -35,12 +62,18 @@ export default {
|
|
35
62
|
},
|
36
63
|
AriaLive: {
|
37
64
|
options: ['off', 'polite', 'assertive'],
|
38
|
-
control:
|
39
|
-
description: 'The aria-live attribute to indicate a dynamic content.'
|
65
|
+
control: 'radio',
|
66
|
+
description: 'The aria-live attribute to indicate a dynamic content.',
|
67
|
+
table: {
|
68
|
+
category: 'ifx-alert props',
|
69
|
+
defaultValue: {
|
70
|
+
summary: 'assertive'
|
71
|
+
}
|
72
|
+
}
|
40
73
|
},
|
41
74
|
},
|
42
75
|
};
|
43
|
-
const DefaultTemplate = args => `<ifx-alert aria-live="${args.AriaLive}" variant="${args.variant}" icon="${args.
|
76
|
+
const DefaultTemplate = args => `<ifx-alert aria-live="${args.AriaLive}" variant="${args.variant}" icon="${args.icon === 'none' ? '' : args.icon}" closable="${args.closable}">${args.label}</ifx-alert>`;
|
44
77
|
export const Default = DefaultTemplate.bind({});
|
45
78
|
const InfoTemplate = args => ` <ifx-alert variant="info" closable="${args.closable}">
|
46
79
|
<div slot="headline">Headline</div>
|
@@ -55,7 +88,7 @@ Info.argTypes = {
|
|
55
88
|
disable: true,
|
56
89
|
},
|
57
90
|
},
|
58
|
-
|
91
|
+
icon: {
|
59
92
|
table: {
|
60
93
|
disable: true,
|
61
94
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"alert.stories.js","sourceRoot":"","sources":["../../../src/components/alert/alert.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,qDAAqD;QAC5D,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,IAAI;QACd,
|
1
|
+
{"version":3,"file":"alert.stories.js","sourceRoot":"","sources":["../../../src/components/alert/alert.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,qDAAqD;QAC5D,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,WAAW;KACtB;IAED,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;aAC3B;SACF;QACD,OAAO,EAAE;YACP,WAAW,EAAE,sCAAsC;YACnD,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;YACpD,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE;gBACL,QAAQ,EAAE,iBAAiB;gBAC3B,YAAY,EAAE;oBACZ,OAAO,EAAE,SAAS;iBACnB;aACF;SACF;QAED,IAAI,EAAE;YACJ,WAAW,EAAE,iEAAiE;YAC9E,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC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EAAE,CAC1B,yCAAyC,IAAI,CAAC,QAAQ;;;;;iBAKvC,CAAC;AAElB,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,IAAI,CAAC,QAAQ,GAAG;IACd,OAAO,EAAE;QACP,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Alert',\n tags: ['autodocs'],\n\n args: {\n label: 'Attention! This is an alert message — check it out!',\n variant: 'primary',\n closable: true,\n icon: 'c-info-24',\n AriaLive: 'assertive',\n },\n\n argTypes: {\n label: {\n name: 'Label of Alert',\n description: 'Sets the label of *<ifx-alert>*.',\n table: {\n category: 'story controls'\n }\n },\n variant: {\n description: 'Sets the style variant of the alert.',\n options: ['primary', 'success', 'danger', 'warning'],\n control: 'radio',\n table: {\n category: 'ifx-alert props',\n defaultValue: {\n summary: 'primary'\n }\n }\n },\n\n icon: {\n description: 'The icon to be displayed. Choose ***none*** to display no icon.',\n options: ['none', ...Object.values(icons).map(i => i['name'])],\n control: 'select',\n table: {\n category: 'ifx-alert props',\n defaultValue: {\n summary: 'c-info-24'\n }\n }\n },\n closable: {\n description: 'Defines whether the alert should be closable or not.',\n control: 'boolean',\n table: {\n category: 'ifx-alert props',\n defaultValue: {\n summary: 'true'\n }\n }\n },\n\n ifxClose: {\n action: 'ifxClose',\n description: 'Custom event emitted when close button clicked.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxClose={handleChange}\\nVue:@ifxClose=\"handleChange\"\\nAngular:(ifxClose)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxClose\", (event) => {//handle change});',\n },\n },\n },\n\n AriaLive: { \n options: ['off', 'polite', 'assertive'],\n control: 'radio',\n description: 'The aria-live attribute to indicate a dynamic content.',\n table: {\n category: 'ifx-alert props',\n defaultValue: {\n summary: 'assertive'\n }\n }\n },\n },\n};\n\nconst DefaultTemplate = args => `<ifx-alert aria-live=\"${args.AriaLive}\" variant=\"${args.variant}\" icon=\"${args.icon === 'none' ? '' : args.icon}\" closable=\"${args.closable}\">${args.label}</ifx-alert>`;\n\nexport const Default = DefaultTemplate.bind({});\n\nconst InfoTemplate = args =>\n ` <ifx-alert variant=\"info\" closable=\"${args.closable}\">\n <div slot=\"headline\">Headline</div>\n <div slot=\"desc\">\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi animi voluptatum quia esse dolor corrupti veniam dolorum. Voluptatem ut enim voluptate. Provident modi molestiae at atque rerum cupiditate, dicta recusandae ab libero veniam iusto possimus quia sequi amet, tempora dolore nobis excepturi est illo blanditiis nihil laborum enim ducimus consequuntur.\n </div>\n </ifx-alert>`;\n\nexport const Info = InfoTemplate.bind({});\nInfo.argTypes = {\n variant: {\n table: {\n disable: true,\n },\n },\n icon: {\n table: {\n disable: true,\n },\n },\n showIcon: {\n table: {\n disable: true,\n },\n },\n};\n"]}
|
@@ -4,19 +4,40 @@ export default {
|
|
4
4
|
tags: ['autodocs'],
|
5
5
|
args: {
|
6
6
|
label: 'Badge label',
|
7
|
-
icon:
|
7
|
+
icon: '',
|
8
8
|
},
|
9
9
|
argTypes: {
|
10
|
-
|
11
|
-
|
10
|
+
label: {
|
11
|
+
description: 'The label of the badge.',
|
12
|
+
name: 'Label',
|
13
|
+
control: { type: 'text' },
|
14
|
+
table: {
|
15
|
+
category: 'story controls',
|
16
|
+
type: {
|
17
|
+
summary: 'string'
|
18
|
+
}
|
19
|
+
}
|
20
|
+
},
|
21
|
+
icon: {
|
12
22
|
control: { type: 'select' },
|
23
|
+
options: ['none', ...Object.values(icons).map(i => i['name'])],
|
24
|
+
description: 'Set the icon of the tab. Choose "none" to display no icon.',
|
25
|
+
table: {
|
26
|
+
category: 'ifx-tab props',
|
27
|
+
type: {
|
28
|
+
summary: 'string'
|
29
|
+
}
|
30
|
+
}
|
13
31
|
},
|
14
32
|
},
|
15
33
|
};
|
16
|
-
const DefaultTemplate = args =>
|
17
|
-
|
18
|
-
|
19
|
-
|
34
|
+
const DefaultTemplate = args => {
|
35
|
+
const icon = args.icon === 'none' ? '' : args.icon;
|
36
|
+
return `<ifx-badge>
|
37
|
+
${args.label}
|
38
|
+
${icon ? `<ifx-icon icon="${icon}"></ifx-icon>` : ''}
|
39
|
+
</ifx-badge>`;
|
40
|
+
};
|
20
41
|
export const Default = DefaultTemplate.bind({});
|
21
42
|
Default.argTypes = {};
|
22
43
|
//# sourceMappingURL=badge.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"badge.stories.js","sourceRoot":"","sources":["../../../src/components/badge/badge.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"badge.stories.js","sourceRoot":"","sources":["../../../src/components/badge/badge.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,kBAAkB;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,EAAE;KACT;IAED,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,WAAW,EAAE,yBAAyB;YACtC,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YAC9D,WAAW,EAAE,4DAA4D;YACzE,KAAK,EAAE;gBACL,QAAQ,EAAE,eAAe;gBACzB,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IAEnD,OAAO;IACL,IAAI,CAAC,KAAK;IACV,IAAI,CAAC,CAAC,CAAC,mBAAmB,IAAI,eAAe,CAAC,CAAC,CAAC,EAAE;aACzC,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC","sourcesContent":["import { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Badge',\n tags: ['autodocs'],\n\n args: {\n label: 'Badge label',\n icon: '',\n },\n\n argTypes: {\n label: {\n description: 'The label of the badge.',\n name: 'Label',\n control: { type: 'text' },\n table: {\n category: 'story controls',\n type: {\n summary: 'string'\n }\n }\n },\n icon: {\n control: { type: 'select' },\n options: ['none', ...Object.values(icons).map(i => i['name'])],\n description: 'Set the icon of the tab. Choose \"none\" to display no icon.',\n table: {\n category: 'ifx-tab props',\n type: {\n summary: 'string'\n }\n }\n },\n },\n};\n\nconst DefaultTemplate = args => {\n const icon = args.icon === 'none' ? '' : args.icon;\n\n return `<ifx-badge>\n ${args.label}\n ${icon ? `<ifx-icon icon=\"${icon}\"></ifx-icon>` : ''}\n</ifx-badge>`;\n};\n\nexport const Default = DefaultTemplate.bind({});\nDefault.argTypes = {};\n"]}
|
@@ -1,15 +1,73 @@
|
|
1
1
|
import { action } from "@storybook/addon-actions";
|
2
|
+
import { icons } from "@infineon/infineon-icons";
|
2
3
|
export default {
|
3
4
|
title: 'Components/Breadcrumb',
|
4
5
|
tags: ['autodocs'],
|
5
6
|
args: {
|
6
|
-
icon:
|
7
|
+
icon: '',
|
8
|
+
iconArialLabel: '',
|
9
|
+
url: 'http://google.com',
|
10
|
+
target: '_self',
|
7
11
|
},
|
8
12
|
argTypes: {
|
13
|
+
icon: {
|
14
|
+
control: { type: 'select' },
|
15
|
+
options: ['none', ...Object.values(icons).map(i => i['name'])],
|
16
|
+
description: 'Set the icon of the tab. Choose "none" to display no icon.',
|
17
|
+
table: {
|
18
|
+
category: 'ifx-breadcrumb-item-label props',
|
19
|
+
defaultValue: {
|
20
|
+
summary: ''
|
21
|
+
},
|
22
|
+
type: {
|
23
|
+
summary: 'string'
|
24
|
+
}
|
25
|
+
}
|
26
|
+
},
|
27
|
+
target: {
|
28
|
+
control: { type: 'text' },
|
29
|
+
description: 'Set the target of the link.',
|
30
|
+
table: {
|
31
|
+
category: 'ifx-breadcrumb-item-label props',
|
32
|
+
defaultValue: {
|
33
|
+
summary: '_self'
|
34
|
+
},
|
35
|
+
type: {
|
36
|
+
summary: 'string'
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
iconArialLabel: {
|
41
|
+
control: { type: 'text' },
|
42
|
+
description: 'Set the aria label of the icon.',
|
43
|
+
table: {
|
44
|
+
category: 'ifx-breadcrumb-item-label props',
|
45
|
+
defaultValue: {
|
46
|
+
summary: ''
|
47
|
+
},
|
48
|
+
type: {
|
49
|
+
summary: 'string'
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
url: {
|
54
|
+
control: { type: 'text' },
|
55
|
+
description: 'Set the url of the link.',
|
56
|
+
table: {
|
57
|
+
category: 'ifx-dropdown-item props',
|
58
|
+
defaultValue: {
|
59
|
+
summary: ''
|
60
|
+
},
|
61
|
+
type: {
|
62
|
+
summary: 'string'
|
63
|
+
}
|
64
|
+
}
|
65
|
+
},
|
9
66
|
ifxDropdownMenuItem: {
|
10
67
|
action: 'ifxDropdownMenuItem',
|
11
|
-
description: 'Custom event emitted when an item is selected',
|
68
|
+
description: 'Custom event emitted when an item is selected.',
|
12
69
|
table: {
|
70
|
+
category: 'custom events',
|
13
71
|
type: {
|
14
72
|
summary: 'Framework integration',
|
15
73
|
detail: 'React: onIfxDropdownMenuItem={handleChange}\nVue:@ifxDropdownMenuItem="handleChange"\nAngular:(ifxDropdownMenuItem)="handleChange()"\nVanillaJs:.addEventListener("ifxDropdownMenuItem", (event) => {//handle change});',
|
@@ -19,12 +77,13 @@ export default {
|
|
19
77
|
},
|
20
78
|
};
|
21
79
|
const DefaultTemplate = args => {
|
80
|
+
const icon = args.icon === 'none' ? '' : args.icon;
|
22
81
|
const wrapper = document.createElement('div');
|
23
82
|
wrapper.innerHTML = `<ifx-breadcrumb>
|
24
83
|
<ifx-breadcrumb-item>
|
25
|
-
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ?
|
84
|
+
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ? icon : ''}">Breadcrumb 1</ifx-breadcrumb-item-label>
|
26
85
|
<ifx-dropdown-menu>
|
27
|
-
<ifx-dropdown-item url
|
86
|
+
<ifx-dropdown-item url=${args.url}>Google</ifx-dropdown-item>
|
28
87
|
<ifx-dropdown-item url="http://bing.com">Bing</ifx-dropdown-item>
|
29
88
|
<ifx-dropdown-item url="http://yahoo.com">Yahoo</ifx-dropdown-item>
|
30
89
|
<ifx-dropdown-item url="http://naver.com">Naver</ifx-dropdown-item>
|
@@ -32,9 +91,9 @@ const DefaultTemplate = args => {
|
|
32
91
|
</ifx-breadcrumb-item>
|
33
92
|
|
34
93
|
<ifx-breadcrumb-item>
|
35
|
-
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ?
|
94
|
+
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ? icon : ''}">Breadcrumb 2</ifx-breadcrumb-item-label>
|
36
95
|
<ifx-dropdown-menu>
|
37
|
-
<ifx-dropdown-item url
|
96
|
+
<ifx-dropdown-item url=${args.url}>Google</ifx-dropdown-item>
|
38
97
|
<ifx-dropdown-item url="http://bing.com">Bing</ifx-dropdown-item>
|
39
98
|
<ifx-dropdown-item url="http://yahoo.com">Yahoo</ifx-dropdown-item>
|
40
99
|
<ifx-dropdown-item url="http://naver.com">Naver</ifx-dropdown-item>
|
@@ -42,7 +101,7 @@ const DefaultTemplate = args => {
|
|
42
101
|
</ifx-breadcrumb-item>
|
43
102
|
|
44
103
|
<ifx-breadcrumb-item>
|
45
|
-
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ?
|
104
|
+
<ifx-breadcrumb-item-label slot="label" icon="${args.icon ? icon : ''}" url="http://google.com">Breadcrumb 3</ifx-breadcrumb-item-label>
|
46
105
|
</ifx-breadcrumb-item>
|
47
106
|
</ifx-breadcrumb>`;
|
48
107
|
const breadcrumb = wrapper.querySelector('ifx-breadcrumb');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"breadcrumb.stories.js","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
1
|
+
{"version":3,"file":"breadcrumb.stories.js","sourceRoot":"","sources":["../../../src/components/breadcrumb/breadcrumb.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,uBAAu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BAAgB,CAAC,qBAAqB,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Breadcrumb',\n tags: ['autodocs'],\n\n args: {\n icon: '',\n iconArialLabel: '',\n url: 'http://google.com',\n target: '_self',\n },\n argTypes: {\n icon: {\n control: { type: 'select' },\n options: ['none', ...Object.values(icons).map(i => i['name'])],\n description: 'Set the icon of the tab. Choose \"none\" to display no icon.',\n table: {\n category: 'ifx-breadcrumb-item-label props',\n defaultValue: {\n summary: ''\n },\n type: {\n summary: 'string'\n }\n }\n },\n target: {\n control: { type: 'text' },\n description: 'Set the target of the link.',\n table: {\n category: 'ifx-breadcrumb-item-label props',\n defaultValue: {\n summary: '_self'\n },\n type: {\n summary: 'string'\n }\n }\n },\n iconArialLabel: {\n control: { type: 'text' },\n description: 'Set the aria label of the icon.',\n table: {\n category: 'ifx-breadcrumb-item-label props',\n defaultValue: {\n summary: ''\n },\n type: {\n summary: 'string'\n }\n }\n },\n url: {\n control: { type: 'text' },\n description: 'Set the url of the link.',\n table: {\n category: 'ifx-dropdown-item props',\n defaultValue: {\n summary: ''\n },\n type: {\n summary: 'string'\n }\n }\n },\n ifxDropdownMenuItem: {\n action: 'ifxDropdownMenuItem',\n description: 'Custom event emitted when an item is selected.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxDropdownMenuItem={handleChange}\\nVue:@ifxDropdownMenuItem=\"handleChange\"\\nAngular:(ifxDropdownMenuItem)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxDropdownMenuItem\", (event) => {//handle change});',\n },\n },\n },\n },\n};\n\nconst DefaultTemplate = args => {\n const icon = args.icon === 'none' ? '' : args.icon;\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-breadcrumb>\n <ifx-breadcrumb-item>\n <ifx-breadcrumb-item-label slot=\"label\" icon=\"${args.icon ? icon : ''}\">Breadcrumb 1</ifx-breadcrumb-item-label>\n <ifx-dropdown-menu>\n <ifx-dropdown-item url=${args.url}>Google</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://bing.com\">Bing</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://yahoo.com\">Yahoo</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://naver.com\">Naver</ifx-dropdown-item>\n </ifx-dropdown-menu>\n </ifx-breadcrumb-item>\n\n <ifx-breadcrumb-item>\n <ifx-breadcrumb-item-label slot=\"label\" icon=\"${args.icon ? icon : ''}\">Breadcrumb 2</ifx-breadcrumb-item-label>\n <ifx-dropdown-menu>\n <ifx-dropdown-item url=${args.url}>Google</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://bing.com\">Bing</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://yahoo.com\">Yahoo</ifx-dropdown-item>\n <ifx-dropdown-item url=\"http://naver.com\">Naver</ifx-dropdown-item>\n </ifx-dropdown-menu>\n </ifx-breadcrumb-item>\n\n <ifx-breadcrumb-item>\n <ifx-breadcrumb-item-label slot=\"label\" icon=\"${args.icon ? icon : ''}\" url=\"http://google.com\">Breadcrumb 3</ifx-breadcrumb-item-label>\n </ifx-breadcrumb-item>\n</ifx-breadcrumb>`;\n\n const breadcrumb = wrapper.querySelector('ifx-breadcrumb') as HTMLElement;\n // Loop through each breadcrumb item and attach event listeners to its dropdown menu\n const breadcrumbItems = breadcrumb.querySelectorAll('ifx-breadcrumb-item');\n breadcrumbItems.forEach(breadcrumbItem => {\n const dropdownMenu = breadcrumbItem.querySelector('ifx-dropdown-menu');\n dropdownMenu?.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n });\n\n return wrapper;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
|