@infineon/infineon-design-system-stencil 30.9.1--canary.1663.04cb986ccd7894a97ab77b9bea18e02ca81adbee.0 → 30.9.2--canary.1640.55f6082d40b32de317977a352b37983c1f14902c.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.
Files changed (187) hide show
  1. package/dist/cjs/ifx-accordion_2.cjs.entry.js +2 -2
  2. package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/ifx-modal.cjs.entry.js +8 -8
  4. package/dist/cjs/ifx-modal.cjs.entry.js.map +1 -1
  5. package/dist/cjs/ifx-multiselect_2.cjs.entry.js +5 -5
  6. package/dist/cjs/ifx-multiselect_2.cjs.entry.js.map +1 -1
  7. package/dist/cjs/ifx-search-bar.cjs.entry.js +5 -5
  8. package/dist/cjs/ifx-search-bar.cjs.entry.js.map +1 -1
  9. package/dist/cjs/ifx-sidebar-item.cjs.entry.js +9 -9
  10. package/dist/cjs/ifx-sidebar-item.cjs.entry.js.map +1 -1
  11. package/dist/cjs/infineon-design-system-stencil.cjs.js +1 -1
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/collection/components/accordion/accordion.stories.js +79 -3
  14. package/dist/collection/components/accordion/accordion.stories.js.map +1 -1
  15. package/dist/collection/components/accordion/accordionItem.js +4 -4
  16. package/dist/collection/components/accordion/accordionItem.js.map +1 -1
  17. package/dist/collection/components/alert/alert.stories.js +45 -12
  18. package/dist/collection/components/alert/alert.stories.js.map +1 -1
  19. package/dist/collection/components/badge/badge.stories.js +28 -7
  20. package/dist/collection/components/badge/badge.stories.js.map +1 -1
  21. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +66 -7
  22. package/dist/collection/components/breadcrumb/breadcrumb.stories.js.map +1 -1
  23. package/dist/collection/components/button/button.stories.js +104 -9
  24. package/dist/collection/components/button/button.stories.js.map +1 -1
  25. package/dist/collection/components/card/card.stories.js +85 -2
  26. package/dist/collection/components/card/card.stories.js.map +1 -1
  27. package/dist/collection/components/checkbox/checkbox.stories.js +75 -14
  28. package/dist/collection/components/checkbox/checkbox.stories.js.map +1 -1
  29. package/dist/collection/components/content-switcher/content-switcher.stories.js +65 -3
  30. package/dist/collection/components/content-switcher/content-switcher.stories.js.map +1 -1
  31. package/dist/collection/components/date-picker/date-picker.stories.js +73 -6
  32. package/dist/collection/components/date-picker/date-picker.stories.js.map +1 -1
  33. package/dist/collection/components/dropdown/dropdown.stories.js +161 -64
  34. package/dist/collection/components/dropdown/dropdown.stories.js.map +1 -1
  35. package/dist/collection/components/footer/footer.stories.js +7 -1
  36. package/dist/collection/components/footer/footer.stories.js.map +1 -1
  37. package/dist/collection/components/icon/infineonIconStencil.stories.js +7 -2
  38. package/dist/collection/components/icon/infineonIconStencil.stories.js.map +1 -1
  39. package/dist/collection/components/icon-button/icon-button.stories.js +61 -5
  40. package/dist/collection/components/icon-button/icon-button.stories.js.map +1 -1
  41. package/dist/collection/components/link/link.stories.js +56 -4
  42. package/dist/collection/components/link/link.stories.js.map +1 -1
  43. package/dist/collection/components/modal/modal.js +10 -10
  44. package/dist/collection/components/modal/modal.js.map +1 -1
  45. package/dist/collection/components/modal/modal.stories.js +96 -19
  46. package/dist/collection/components/modal/modal.stories.js.map +1 -1
  47. package/dist/collection/components/navigation/navbar/navbar.stories.js +203 -12
  48. package/dist/collection/components/navigation/navbar/navbar.stories.js.map +1 -1
  49. package/dist/collection/components/navigation/sidebar/sidebar-item.js +11 -11
  50. package/dist/collection/components/navigation/sidebar/sidebar-item.js.map +1 -1
  51. package/dist/collection/components/navigation/sidebar/sidebar.stories.js +110 -17
  52. package/dist/collection/components/navigation/sidebar/sidebar.stories.js.map +1 -1
  53. package/dist/collection/components/notification/notification.stories.js +51 -4
  54. package/dist/collection/components/notification/notification.stories.js.map +1 -1
  55. package/dist/collection/components/number-indicator/number-indicator.stories.js +19 -0
  56. package/dist/collection/components/number-indicator/number-indicator.stories.js.map +1 -1
  57. package/dist/collection/components/pagination/pagination.stories.js +30 -3
  58. package/dist/collection/components/pagination/pagination.stories.js.map +1 -1
  59. package/dist/collection/components/progress-bar/progress-bar.stories.js +31 -8
  60. package/dist/collection/components/progress-bar/progress-bar.stories.js.map +1 -1
  61. package/dist/collection/components/radio-button/radio-button.stories.js +66 -13
  62. package/dist/collection/components/radio-button/radio-button.stories.js.map +1 -1
  63. package/dist/collection/components/search-bar/search-bar.js +6 -6
  64. package/dist/collection/components/search-bar/search-bar.js.map +1 -1
  65. package/dist/collection/components/search-bar/search-bar.stories.js +58 -9
  66. package/dist/collection/components/search-bar/search-bar.stories.js.map +1 -1
  67. package/dist/collection/components/search-field/search-field.stories.js +43 -7
  68. package/dist/collection/components/search-field/search-field.stories.js.map +1 -1
  69. package/dist/collection/components/select/multi-select/multiselect.js +6 -6
  70. package/dist/collection/components/select/multi-select/multiselect.js.map +1 -1
  71. package/dist/collection/components/select/multi-select/multiselect.stories.js +131 -5
  72. package/dist/collection/components/select/multi-select/multiselect.stories.js.map +1 -1
  73. package/dist/collection/components/select/single-select/select.stories.js +83 -26
  74. package/dist/collection/components/select/single-select/select.stories.js.map +1 -1
  75. package/dist/collection/components/slider/slider.stories.js +97 -13
  76. package/dist/collection/components/slider/slider.stories.js.map +1 -1
  77. package/dist/collection/components/spinner/spinner.stories.js +34 -2
  78. package/dist/collection/components/spinner/spinner.stories.js.map +1 -1
  79. package/dist/collection/components/status/status.stories.js +24 -1
  80. package/dist/collection/components/status/status.stories.js.map +1 -1
  81. package/dist/collection/components/stepper/stepper.stories.js +33 -16
  82. package/dist/collection/components/stepper/stepper.stories.js.map +1 -1
  83. package/dist/collection/components/switch/switch.stories.js +54 -4
  84. package/dist/collection/components/switch/switch.stories.js.map +1 -1
  85. package/dist/collection/components/table-advanced-version/table.stories.js +71 -11
  86. package/dist/collection/components/table-advanced-version/table.stories.js.map +1 -1
  87. package/dist/collection/components/table-basic-version/table.stories.js +17 -1
  88. package/dist/collection/components/table-basic-version/table.stories.js.map +1 -1
  89. package/dist/collection/components/tabs/tabs.stories.js +89 -23
  90. package/dist/collection/components/tabs/tabs.stories.js.map +1 -1
  91. package/dist/collection/components/tag/tag.stories.js +18 -0
  92. package/dist/collection/components/tag/tag.stories.js.map +1 -1
  93. package/dist/collection/components/text-field/text-field.stories.js +104 -13
  94. package/dist/collection/components/text-field/text-field.stories.js.map +1 -1
  95. package/dist/collection/components/tooltip/tooltip.stories.js +48 -4
  96. package/dist/collection/components/tooltip/tooltip.stories.js.map +1 -1
  97. package/dist/components/ifx-accordion-item.js +1 -1
  98. package/dist/components/ifx-faq.js +1 -1
  99. package/dist/components/ifx-modal.js +8 -8
  100. package/dist/components/ifx-modal.js.map +1 -1
  101. package/dist/components/ifx-multiselect.js +1 -1
  102. package/dist/components/ifx-search-bar.js +5 -5
  103. package/dist/components/ifx-search-bar.js.map +1 -1
  104. package/dist/components/ifx-set-filter.js +1 -1
  105. package/dist/components/ifx-sidebar-item.js +11 -11
  106. package/dist/components/ifx-sidebar-item.js.map +1 -1
  107. package/dist/components/{p-b2439194.js → p-62c6aeb2.js} +4 -4
  108. package/dist/components/{p-b2439194.js.map → p-62c6aeb2.js.map} +1 -1
  109. package/dist/components/{p-04b73e62.js → p-cf8fd0f4.js} +6 -6
  110. package/dist/components/p-cf8fd0f4.js.map +1 -0
  111. package/dist/esm/ifx-accordion_2.entry.js +2 -2
  112. package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
  113. package/dist/esm/ifx-modal.entry.js +8 -8
  114. package/dist/esm/ifx-modal.entry.js.map +1 -1
  115. package/dist/esm/ifx-multiselect_2.entry.js +5 -5
  116. package/dist/esm/ifx-multiselect_2.entry.js.map +1 -1
  117. package/dist/esm/ifx-search-bar.entry.js +5 -5
  118. package/dist/esm/ifx-search-bar.entry.js.map +1 -1
  119. package/dist/esm/ifx-sidebar-item.entry.js +9 -9
  120. package/dist/esm/ifx-sidebar-item.entry.js.map +1 -1
  121. package/dist/esm/infineon-design-system-stencil.js +1 -1
  122. package/dist/esm/loader.js +1 -1
  123. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
  124. package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js.map +1 -1
  125. package/dist/infineon-design-system-stencil/p-60dcd508.entry.js +2 -0
  126. package/dist/infineon-design-system-stencil/p-60dcd508.entry.js.map +1 -0
  127. package/dist/infineon-design-system-stencil/p-6a274db4.entry.js +2 -0
  128. package/dist/infineon-design-system-stencil/p-6a274db4.entry.js.map +1 -0
  129. package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js +2 -0
  130. package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js.map +1 -0
  131. package/dist/infineon-design-system-stencil/{p-bc8a4226.entry.js → p-d93eb561.entry.js} +2 -2
  132. package/dist/infineon-design-system-stencil/p-d93eb561.entry.js.map +1 -0
  133. package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js +2 -0
  134. package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js.map +1 -0
  135. package/dist/types/components/accordion/accordion.stories.d.ts +67 -1
  136. package/dist/types/components/accordion/accordionItem.d.ts +1 -1
  137. package/dist/types/components/alert/alert.stories.d.ts +38 -11
  138. package/dist/types/components/badge/badge.stories.d.ts +23 -3
  139. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +66 -1
  140. package/dist/types/components/button/button.stories.d.ts +95 -16
  141. package/dist/types/components/card/card.stories.d.ts +95 -1
  142. package/dist/types/components/checkbox/checkbox.stories.d.ts +68 -10
  143. package/dist/types/components/content-switcher/content-switcher.stories.d.ts +66 -0
  144. package/dist/types/components/date-picker/date-picker.stories.d.ts +67 -2
  145. package/dist/types/components/dropdown/dropdown.stories.d.ts +111 -27
  146. package/dist/types/components/footer/footer.stories.d.ts +4 -0
  147. package/dist/types/components/icon/infineonIconStencil.stories.d.ts +5 -0
  148. package/dist/types/components/icon-button/icon-button.stories.d.ts +56 -8
  149. package/dist/types/components/link/link.stories.d.ts +52 -6
  150. package/dist/types/components/modal/modal.d.ts +2 -2
  151. package/dist/types/components/modal/modal.stories.d.ts +77 -3
  152. package/dist/types/components/navigation/navbar/navbar.stories.d.ts +243 -6
  153. package/dist/types/components/navigation/sidebar/sidebar-item.d.ts +2 -2
  154. package/dist/types/components/navigation/sidebar/sidebar.stories.d.ts +90 -7
  155. package/dist/types/components/notification/notification.stories.d.ts +44 -0
  156. package/dist/types/components/number-indicator/number-indicator.stories.d.ts +19 -0
  157. package/dist/types/components/pagination/pagination.stories.d.ts +27 -0
  158. package/dist/types/components/progress-bar/progress-bar.stories.d.ts +25 -4
  159. package/dist/types/components/radio-button/radio-button.stories.d.ts +59 -8
  160. package/dist/types/components/search-bar/search-bar.d.ts +1 -1
  161. package/dist/types/components/search-bar/search-bar.stories.d.ts +60 -3
  162. package/dist/types/components/search-field/search-field.stories.d.ts +36 -6
  163. package/dist/types/components/select/multi-select/multiselect.d.ts +1 -1
  164. package/dist/types/components/select/multi-select/multiselect.stories.d.ts +125 -0
  165. package/dist/types/components/select/single-select/select.stories.d.ts +67 -24
  166. package/dist/types/components/slider/slider.stories.d.ts +110 -0
  167. package/dist/types/components/spinner/spinner.stories.d.ts +32 -0
  168. package/dist/types/components/status/status.stories.d.ts +23 -2
  169. package/dist/types/components/stepper/stepper.stories.d.ts +21 -4
  170. package/dist/types/components/switch/switch.stories.d.ts +50 -1
  171. package/dist/types/components/table-basic-version/table.stories.d.ts +19 -1
  172. package/dist/types/components/tabs/tabs.stories.d.ts +77 -7
  173. package/dist/types/components/tag/tag.stories.d.ts +20 -0
  174. package/dist/types/components/text-field/text-field.stories.d.ts +96 -11
  175. package/dist/types/components/tooltip/tooltip.stories.d.ts +41 -6
  176. package/dist/types/components.d.ts +10 -10
  177. package/package.json +1 -1
  178. package/dist/components/p-04b73e62.js.map +0 -1
  179. package/dist/infineon-design-system-stencil/p-222c1af9.entry.js +0 -2
  180. package/dist/infineon-design-system-stencil/p-222c1af9.entry.js.map +0 -1
  181. package/dist/infineon-design-system-stencil/p-436babb8.entry.js +0 -2
  182. package/dist/infineon-design-system-stencil/p-436babb8.entry.js.map +0 -1
  183. package/dist/infineon-design-system-stencil/p-9481adc8.entry.js +0 -2
  184. package/dist/infineon-design-system-stencil/p-9481adc8.entry.js.map +0 -1
  185. package/dist/infineon-design-system-stencil/p-bc8a4226.entry.js.map +0 -1
  186. package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js +0 -2
  187. package/dist/infineon-design-system-stencil/p-dc7deb14.entry.js.map +0 -1
@@ -10,43 +10,138 @@ export default {
10
10
  size: 'm',
11
11
  fullWidth: false,
12
12
  disabled: false,
13
+ icon: '',
13
14
  iconPosition: 'left',
14
15
  href: false,
15
16
  url: '',
16
17
  target: '_blank',
17
18
  },
18
19
  argTypes: {
20
+ label: {
21
+ name: 'Label of Button',
22
+ description: 'Sets the text displayed on the button.',
23
+ table: {
24
+ category: 'story controls',
25
+ type: {
26
+ summary: '<ifx-button> `label` </ifx-button>'
27
+ }
28
+ }
29
+ },
19
30
  icon: {
31
+ description: 'The icon to be displayed.',
32
+ control: 'select',
20
33
  options: Object.values(icons).map(i => i['name']),
21
- control: { type: 'select' },
34
+ table: {
35
+ category: 'ifx-button props',
36
+ type: {
37
+ summary: 'string'
38
+ }
39
+ }
22
40
  },
23
41
  variant: {
42
+ description: 'Sets the style variant of the button.',
43
+ control: 'radio',
24
44
  options: ['primary', 'secondary', 'tertiary'],
25
- control: { type: 'radio' },
45
+ table: {
46
+ category: 'ifx-button props',
47
+ defaultValue: {
48
+ summary: 'primary'
49
+ }
50
+ }
26
51
  },
27
52
  theme: {
53
+ description: 'Specifies the theme style of the button.',
54
+ control: 'radio',
28
55
  options: ['default', 'danger', 'inverse'],
29
- control: { type: 'radio' },
56
+ table: {
57
+ category: 'ifx-button props',
58
+ defaultValue: {
59
+ summary: 'default'
60
+ }
61
+ }
30
62
  },
31
63
  type: {
64
+ description: 'Sets the type attribute of the button.',
65
+ control: 'radio',
32
66
  options: ['button', 'submit', 'reset'],
33
- control: { type: 'radio' },
67
+ table: {
68
+ category: 'ifx-button props',
69
+ defaultValue: {
70
+ summary: 'button'
71
+ }
72
+ }
34
73
  },
35
74
  size: {
36
- description: 'Size options: xs (32px) s (36px), m (40px), l (48px) - default: m',
75
+ description: 'Sets the size of the button. Options: xs (32px) s (36px), m (40px), l (48px)',
76
+ control: 'radio',
37
77
  options: ['xs', 's', 'm', 'l'],
38
- control: { type: 'radio' },
78
+ table: {
79
+ category: 'ifx-button props',
80
+ defaultValue: {
81
+ summary: 'm'
82
+ }
83
+ }
39
84
  },
40
85
  fullWidth: {
41
- control: { type: 'boolean' },
86
+ description: 'When set to **true**, expands the button to take the full width of its container.',
87
+ control: 'boolean',
88
+ table: {
89
+ category: 'ifx-button props',
90
+ defaultValue: {
91
+ summary: 'false'
92
+ }
93
+ }
94
+ },
95
+ disabled: {
96
+ description: 'Disables the button when set to true.',
97
+ control: 'boolean',
98
+ table: {
99
+ category: 'ifx-button props',
100
+ defaultValue: {
101
+ summary: 'false'
102
+ }
103
+ }
42
104
  },
43
105
  iconPosition: {
106
+ description: 'Determines the position of an icon within the button if an icon is used.',
107
+ control: 'radio',
44
108
  options: ['left', 'right'],
45
- control: { type: 'radio' },
109
+ table: {
110
+ category: 'ifx-button props',
111
+ defaultValue: {
112
+ summary: 'left'
113
+ }
114
+ }
115
+ },
116
+ href: {
117
+ description: 'When set to **true**, treats the button as a link by setting a URL.',
118
+ control: 'boolean',
119
+ table: {
120
+ category: 'ifx-button props',
121
+ defaultValue: {
122
+ summary: 'false'
123
+ }
124
+ }
125
+ },
126
+ url: {
127
+ description: 'Specifies the destination URL for the button when it acts as a link.',
128
+ table: {
129
+ category: 'ifx-button props',
130
+ type: {
131
+ summary: 'string'
132
+ }
133
+ }
46
134
  },
47
135
  target: {
136
+ description: 'Determines where to open the linked document when the button is clicked.',
137
+ control: 'radio',
48
138
  options: ['_blank', '_self', '_parent'],
49
- control: { type: 'radio' },
139
+ table: {
140
+ category: 'ifx-button props',
141
+ defaultValue: {
142
+ summary: '_blank'
143
+ }
144
+ }
50
145
  },
51
146
  },
52
147
  };
@@ -1 +1 @@
1
- {"version":3,"file":"button.stories.js","sourceRoot":"","sources":["../../../src/components/button/button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,GAAG;QACT,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,KAAK;QACf,YAAY,EAAE,MAAM;QACpB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,EAAE;QACP,MAAM,EAAE,QAAQ;KACjB;IAED,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B;QACD,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC;YAC7C,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QACD,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;YACzC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC;YACtC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,oEAAoE;YAC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/infineon-icons';\n\nexport default {\n title: 'Components/Button',\n tags: ['autodocs'],\n\n args: {\n label: 'Button',\n variant: 'primary',\n theme: 'default',\n type: 'button',\n size: 'm',\n fullWidth: false,\n disabled: false,\n iconPosition: 'left',\n href: false,\n url: '',\n target: '_blank',\n },\n\n argTypes: {\n icon: {\n options: Object.values(icons).map(i => i['name']),\n control: { type: 'select' },\n },\n variant: {\n options: ['primary', 'secondary', 'tertiary'],\n control: { type: 'radio' },\n },\n theme: {\n options: ['default', 'danger', 'inverse'],\n control: { type: 'radio' },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'radio' },\n },\n size: {\n description: 'Size options: xs (32px) s (36px), m (40px), l (48px) - default: m',\n options: ['xs', 's', 'm', 'l'],\n control: { type: 'radio' },\n },\n fullWidth: {\n control: { type: 'boolean' },\n },\n iconPosition: {\n options: ['left', 'right'],\n control: { type: 'radio' },\n },\n target: {\n options: ['_blank', '_self', '_parent'],\n control: { type: 'radio' },\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-button type=\"${args.type}\" disabled=\"${args.disabled}\" variant=\"${args.variant}\" size=\"${args.size}\" target=\"${args.target}\" theme=\"${args.theme}\" ${args.href ? `href=\"${args.url}\"` : ''} full-width=\"${args.fullWidth}\">\n ${args.icon && args.iconPosition.toUpperCase() === 'LEFT' ? `<ifx-icon icon=\"${args.icon}\"></ifx-icon>` : ''}${args.label}${args.icon && args.iconPosition.toUpperCase() === 'RIGHT' ? `<ifx-icon icon=\"${args.icon}\"></ifx-icon>` : ''} \n</ifx-button>`;\n\nexport const Default = DefaultTemplate.bind({});\n"]}
1
+ {"version":3,"file":"button.stories.js","sourceRoot":"","sources":["../../../src/components/button/button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,mBAAmB;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,K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/Button',\n tags: ['autodocs'],\n\n args: {\n label: 'Button',\n variant: 'primary',\n theme: 'default',\n type: 'button',\n size: 'm',\n fullWidth: false,\n disabled: false,\n icon: '',\n iconPosition: 'left',\n href: false,\n url: '',\n target: '_blank',\n },\n\n argTypes: {\n label: {\n name: 'Label of Button',\n description: 'Sets the text displayed on the button.',\n table: {\n category: 'story controls',\n type: {\n summary: '<ifx-button> `label` </ifx-button>'\n }\n }\n },\n icon: {\n description: 'The icon to be displayed.',\n control: 'select',\n options: Object.values(icons).map(i => i['name']),\n table: {\n category: 'ifx-button props',\n type: {\n summary: 'string'\n }\n }\n },\n variant: {\n description: 'Sets the style variant of the button.',\n control: 'radio',\n options: ['primary', 'secondary', 'tertiary'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'primary'\n }\n }\n },\n theme: {\n description: 'Specifies the theme style of the button.',\n control: 'radio',\n options: ['default', 'danger', 'inverse'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'default'\n }\n }\n },\n type: {\n description: 'Sets the type attribute of the button.',\n control: 'radio',\n options: ['button', 'submit', 'reset'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'button'\n }\n }\n },\n size: {\n description: 'Sets the size of the button. Options: xs (32px) s (36px), m (40px), l (48px)',\n control: 'radio',\n options: ['xs', 's', 'm', 'l'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'm'\n }\n }\n },\n fullWidth: {\n description: 'When set to **true**, expands the button to take the full width of its container.',\n control: 'boolean',\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'false'\n }\n }\n },\n disabled: {\n description: 'Disables the button when set to true.',\n control: 'boolean',\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'false'\n }\n }\n },\n iconPosition: {\n description: 'Determines the position of an icon within the button if an icon is used.',\n control: 'radio',\n options: ['left', 'right'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'left'\n }\n }\n },\n href: {\n description: 'When set to **true**, treats the button as a link by setting a URL.',\n control: 'boolean',\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: 'false'\n }\n }\n },\n url: {\n description: 'Specifies the destination URL for the button when it acts as a link.',\n table: {\n category: 'ifx-button props',\n type: {\n summary: 'string'\n }\n }\n },\n target: {\n description: 'Determines where to open the linked document when the button is clicked.',\n control: 'radio',\n options: ['_blank', '_self', '_parent'],\n table: {\n category: 'ifx-button props',\n defaultValue: {\n summary: '_blank'\n }\n }\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-button type=\"${args.type}\" disabled=\"${args.disabled}\" variant=\"${args.variant}\" size=\"${args.size}\" target=\"${args.target}\" theme=\"${args.theme}\" ${args.href ? `href=\"${args.url}\"` : ''} full-width=\"${args.fullWidth}\">\n ${args.icon && args.iconPosition.toUpperCase() === 'LEFT' ? `<ifx-icon icon=\"${args.icon}\"></ifx-icon>` : ''}${args.label}${args.icon && args.iconPosition.toUpperCase() === 'RIGHT' ? `<ifx-icon icon=\"${args.icon}\"></ifx-icon>` : ''} \n</ifx-button>`;\n\nexport const Default = DefaultTemplate.bind({});\n"]}
@@ -2,10 +2,10 @@ export default {
2
2
  title: 'Components/Card',
3
3
  tags: ['autodocs'],
4
4
  args: {
5
- direction: 'vertical',
6
5
  overline: 'Overline',
7
6
  headline: 'Headline',
8
7
  description: "Some quick example text to build on the card title and make up the bulk of the card's content.",
8
+ direction: 'vertical',
9
9
  button: 'button',
10
10
  href: '',
11
11
  target: '_blank',
@@ -13,23 +13,105 @@ export default {
13
13
  src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',
14
14
  },
15
15
  argTypes: {
16
+ overline: {
17
+ name: 'Overline',
18
+ description: 'Sets the overline text of the card.',
19
+ type: { name: 'string' },
20
+ table: {
21
+ category: 'story controls',
22
+ },
23
+ },
24
+ headline: {
25
+ name: 'Headline',
26
+ description: 'Sets the headline text of the card.',
27
+ type: { name: 'string' },
28
+ table: {
29
+ category: 'story controls',
30
+ },
31
+ },
32
+ description: {
33
+ name: 'Description',
34
+ description: 'Sets the description text of the card.',
35
+ type: { name: 'string' },
36
+ table: {
37
+ category: 'story controls',
38
+ },
39
+ },
16
40
  button: {
41
+ name: 'Button',
17
42
  options: ['button', 'link', 'none'],
43
+ description: 'Sets the button type of the card.',
18
44
  control: { type: 'radio' },
45
+ table: {
46
+ category: 'story controls',
47
+ },
19
48
  },
20
49
  direction: {
50
+ description: 'Sets the direction of the card layout.',
51
+ table: {
52
+ category: 'ifx-card props',
53
+ defaultValue: {
54
+ summary: 'vertical',
55
+ },
56
+ type: {
57
+ summary: 'horizontal | vertical',
58
+ disable: true,
59
+ },
60
+ },
21
61
  options: ['horizontal', 'vertical'],
22
62
  control: { type: 'radio' },
23
63
  },
24
64
  position: {
65
+ description: 'Sets the position of the image in the card.',
66
+ table: {
67
+ category: 'ifx-card-image props',
68
+ },
25
69
  options: ['left', 'right'],
26
70
  control: { type: 'radio' },
27
71
  if: { arg: 'direction', eq: 'horizontal' },
28
72
  },
73
+ href: {
74
+ description: 'Sets the hyperlink reference.',
75
+ type: { name: 'string' },
76
+ table: {
77
+ category: 'ifx-card props',
78
+ },
79
+ },
29
80
  target: {
81
+ description: 'Sets the target of the hyperlink reference',
82
+ table: {
83
+ category: 'ifx-card props',
84
+ defaultValue: {
85
+ summary: '_self',
86
+ },
87
+ },
30
88
  options: ['_blank', '_self', '_parent'],
31
89
  control: { type: 'radio' },
32
90
  },
91
+ isHovered: {
92
+ description: 'Changes the color of the headline when hovered.',
93
+ type: 'boolean',
94
+ table: {
95
+ defaultValue: {
96
+ summary: false
97
+ },
98
+ category: 'ifx-card-headline props',
99
+ },
100
+ },
101
+ src: {
102
+ description: 'Sets the image source.',
103
+ type: { name: 'string' },
104
+ table: {
105
+ category: 'ifx-card-image props',
106
+ },
107
+ },
108
+ alt: {
109
+ description: 'Sets the alternative text for the image.',
110
+ type: { name: 'string' },
111
+ table: {
112
+ category: 'ifx-card-image props',
113
+ },
114
+ },
33
115
  },
34
116
  };
35
117
  const DefaultTemplate = args => `<ifx-card direction="${args.direction}" href="${args.href}" target="${args.target}">
@@ -70,10 +152,11 @@ const DefaultTemplate = args => `<ifx-card direction="${args.direction}" href="$
70
152
  </ifx-card>`;
71
153
  export const Default = DefaultTemplate.bind({});
72
154
  Default.args = {
155
+ alt: 'Coffee',
73
156
  src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',
74
157
  };
75
158
  const HorizontalTemplate = args => `<ifx-card direction="${args.direction}" href="${args.href}" target="${args.target}">
76
- <ifx-card-image position="${args.position}" src="${args.src}" alt="" slot="img"></ifx-card-image>
159
+ <ifx-card-image position="${args.position}" src="${args.src}" alt="${args.alt}" slot="img"></ifx-card-image>
77
160
  ${args.overline
78
161
  ? `<ifx-card-overline>
79
162
  ${args.overline}
@@ -1 +1 @@
1
- {"version":3,"file":"card.stories.js","sourceRoot":"","sources":["../../../src/components/card/card.stories.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,SAAS,EAAE,UAAU;QACrB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,gGAAgG;QAC7G,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,OAAO;QACjB,GAAG,EAAE,+EAA+E;KACrF;IAED,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;YACnC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QACD,SAAS,EAAE;YACT,OAAO,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;YACnC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QAED,QAAQ,E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Aa,IAAI,CAAC,MAAM;gCACpD,IAAI,CAAC,QAAQ,UAAU,IAAI,CAAC,GAAG;MAEzD,IAAI,CAAC,QAAQ;IACX,CAAC,CAAC;UACA,IAAI,CAAC,QAAQ;6BACM;IACrB,CAAC,CAAC,EACN;QAEI,IAAI,CAAC,QAAQ;IACX,CAAC,CAAC;YACA,IAAI,CAAC,QAAQ;+BACM;IACrB,CAAC,CAAC,EACN;UAEI,IAAI,CAAC,WAAW;IACd,CAAC,CAAC;cACA,IAAI,CAAC,WAAW;6BACD;IACjB,CAAC,CAAC,EACN;QAEA,IAAI,CAAC,MAAM,KAAK,QAAQ;IACtB,CAAC,CAAC;;;4BAGgB;IAClB,CAAC,CAAC,EACN;YAEM,IAAI,CAAC,MAAM,KAAK,MAAM;IACpB,CAAC,CAAC;;;;;;;;;0BASU;IACZ,CAAC,CAAC,EACN;cACI,CAAC;AAEf,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtD,UAAU,CAAC,IAAI,GAAG;IAChB,SAAS,EAAE,YAAY;IACvB,GAAG,EAAE,+EAA+E;CACrF,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG;IACpB,SAAS,EAAE;QACT,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC","sourcesContent":["export default {\n title: 'Components/Card',\n tags: ['autodocs'],\n args: {\n direction: 'vertical',\n overline: 'Overline',\n headline: 'Headline',\n description: \"Some quick example text to build on the card title and make up the bulk of the card's content.\",\n button: 'button',\n href: '',\n target: '_blank',\n position: 'right',\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n },\n\n argTypes: {\n button: {\n options: ['button', 'link', 'none'],\n control: { type: 'radio' },\n },\n direction: {\n options: ['horizontal', 'vertical'],\n control: { type: 'radio' },\n },\n\n position: {\n options: ['left', 'right'],\n control: { type: 'radio' },\n if: { arg: 'direction', eq: 'horizontal' },\n },\n\n target: {\n options: ['_blank', '_self', '_parent'],\n control: { type: 'radio' },\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-card direction=\"${args.direction}\" href=\"${args.href}\" target=\"${args.target}\">\n <ifx-card-image position=\"${args.position}\" src=\"${args.src}\" alt=\"\" slot=\"img\"></ifx-card-image>\n ${\n args.overline\n ? `<ifx-card-overline>\n ${args.overline}\n </ifx-card-overline>`\n : ''\n }\n ${\n args.headline\n ? `<ifx-card-headline>\n ${args.headline}\n </ifx-card-headline>`\n : ''\n }\n ${\n args.description\n ? `<ifx-card-text>\n ${args.description}\n </ifx-card-text>`\n : ''\n }\n ${\n args.button === 'button'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-button variant=\"primary\">Button</ifx-button>\n <ifx-button variant=\"secondary\">Button</ifx-button>\n </ifx-card-links>`\n : ''\n }\n ${\n args.button === 'link'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-link href=\"https://google.com\" target=\"_blank\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n <ifx-link href=\"https://yahoo.com\" target=\"_blank\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n </ifx-card-links>`\n : ''\n }\n </ifx-card>`;\n\nexport const Default = DefaultTemplate.bind({});\nDefault.args = {\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n};\n\nconst HorizontalTemplate = args =>\n `<ifx-card direction=\"${args.direction}\" href=\"${args.href}\" target=\"${args.target}\">\n <ifx-card-image position=\"${args.position}\" src=\"${args.src}\" alt=\"\" slot=\"img\"></ifx-card-image>\n ${\n args.overline\n ? `<ifx-card-overline>\n ${args.overline}\n </ifx-card-overline>`\n : ''\n }\n ${\n args.headline\n ? `<ifx-card-headline>\n ${args.headline}\n </ifx-card-headline>`\n : ''\n }\n ${\n args.description\n ? `<ifx-card-text>\n ${args.description}\n </ifx-card-text>`\n : ''\n }\n ${\n args.button === 'button'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-button variant=\"primary\">Button</ifx-button>\n <ifx-button variant=\"secondary\">Button</ifx-button>\n </ifx-card-links>`\n : ''\n }\n ${\n args.button === 'link'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-link color=\"primary\" href=\"https://google.com\" target=\"_blank\" underline=\"false\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n <ifx-link color=\"primary\" href=\"https://yahoo.com\" target=\"_blank\" underline=\"false\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n </ifx-card-links>`\n : ''\n }\n </ifx-card>`;\n\nexport const Horizontal = HorizontalTemplate.bind({});\nHorizontal.args = {\n direction: 'horizontal',\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n};\nHorizontal.argTypes = {\n direction: {\n table: {\n disable: true,\n },\n },\n};\n"]}
1
+ {"version":3,"file":"card.stories.js","sourceRoot":"","sources":["../../../src/components/card/card.stories.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,gGAAgG;QAC7G,SAAS,EAAE,UAAU;QACrB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,OAAO;QACjB,GAAG,EAAE,+EAA+E;KACrF;IAED,QAAQ,EAAE;QACR,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;aAC3B;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YACh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E,+EAA+E;CACrF,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG;IACpB,SAAS,EAAE;QACT,KAAK,EAAE;YACL,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC","sourcesContent":["export default {\n title: 'Components/Card',\n tags: ['autodocs'],\n args: {\n overline: 'Overline',\n headline: 'Headline',\n description: \"Some quick example text to build on the card title and make up the bulk of the card's content.\",\n direction: 'vertical',\n button: 'button',\n href: '',\n target: '_blank',\n position: 'right',\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n },\n\n argTypes: {\n overline: {\n name: 'Overline',\n description: 'Sets the overline text of the card.',\n type: { name: 'string' },\n table: {\n category: 'story controls',\n },\n },\n headline: {\n name: 'Headline',\n description: 'Sets the headline text of the card.',\n type: { name: 'string' },\n table: {\n category: 'story controls',\n },\n },\n description: {\n name: 'Description',\n description: 'Sets the description text of the card.',\n type: { name: 'string' },\n table: {\n category: 'story controls',\n },\n },\n button: {\n name: 'Button',\n options: ['button', 'link', 'none'],\n description: 'Sets the button type of the card.',\n control: { type: 'radio' },\n table: {\n category: 'story controls',\n },\n },\n direction: {\n description: 'Sets the direction of the card layout.',\n table: {\n category: 'ifx-card props',\n defaultValue: {\n summary: 'vertical',\n },\n type: {\n summary: 'horizontal | vertical',\n disable: true,\n },\n },\n options: ['horizontal', 'vertical'],\n control: { type: 'radio' },\n },\n\n position: {\n description: 'Sets the position of the image in the card.',\n table: {\n category: 'ifx-card-image props',\n },\n options: ['left', 'right'],\n control: { type: 'radio' },\n if: { arg: 'direction', eq: 'horizontal' },\n },\n href: {\n description: 'Sets the hyperlink reference.',\n type: { name: 'string' },\n table: {\n category: 'ifx-card props',\n },\n },\n target: {\n description: 'Sets the target of the hyperlink reference',\n table: {\n category: 'ifx-card props',\n defaultValue: {\n summary: '_self',\n },\n },\n options: ['_blank', '_self', '_parent'],\n control: { type: 'radio' },\n },\n isHovered: {\n description: 'Changes the color of the headline when hovered.',\n type: 'boolean',\n table: {\n defaultValue: {\n summary: false\n },\n category: 'ifx-card-headline props',\n },\n },\n src: {\n description: 'Sets the image source.',\n type: { name: 'string' },\n table: {\n category: 'ifx-card-image props',\n },\n },\n alt: {\n description: 'Sets the alternative text for the image.',\n type: { name: 'string' },\n table: {\n category: 'ifx-card-image props',\n },\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-card direction=\"${args.direction}\" href=\"${args.href}\" target=\"${args.target}\">\n <ifx-card-image position=\"${args.position}\" src=\"${args.src}\" alt=\"\" slot=\"img\"></ifx-card-image>\n ${args.overline\n ? `<ifx-card-overline>\n ${args.overline}\n </ifx-card-overline>`\n : ''\n }\n ${args.headline\n ? `<ifx-card-headline>\n ${args.headline}\n </ifx-card-headline>`\n : ''\n }\n ${args.description\n ? `<ifx-card-text>\n ${args.description}\n </ifx-card-text>`\n : ''\n }\n ${args.button === 'button'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-button variant=\"primary\">Button</ifx-button>\n <ifx-button variant=\"secondary\">Button</ifx-button>\n </ifx-card-links>`\n : ''\n }\n ${args.button === 'link'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-link href=\"https://google.com\" target=\"_blank\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n <ifx-link href=\"https://yahoo.com\" target=\"_blank\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n </ifx-card-links>`\n : ''\n }\n </ifx-card>`;\n\nexport const Default = DefaultTemplate.bind({});\nDefault.args = {\n alt: 'Coffee',\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n};\n\nconst HorizontalTemplate = args =>\n `<ifx-card direction=\"${args.direction}\" href=\"${args.href}\" target=\"${args.target}\">\n <ifx-card-image position=\"${args.position}\" src=\"${args.src}\" alt=\"${args.alt}\" slot=\"img\"></ifx-card-image>\n ${args.overline\n ? `<ifx-card-overline>\n ${args.overline}\n </ifx-card-overline>`\n : ''\n }\n ${args.headline\n ? `<ifx-card-headline>\n ${args.headline}\n </ifx-card-headline>`\n : ''\n }\n ${args.description\n ? `<ifx-card-text>\n ${args.description}\n </ifx-card-text>`\n : ''\n }\n ${args.button === 'button'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-button variant=\"primary\">Button</ifx-button>\n <ifx-button variant=\"secondary\">Button</ifx-button>\n </ifx-card-links>`\n : ''\n }\n ${args.button === 'link'\n ? `<ifx-card-links slot=\"buttons\">\n <ifx-link color=\"primary\" href=\"https://google.com\" target=\"_blank\" underline=\"false\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n <ifx-link color=\"primary\" href=\"https://yahoo.com\" target=\"_blank\" underline=\"false\">\n <ifx-icon icon=\"calendar16\"></ifx-icon>\n Link\n </ifx-link>\n </ifx-card-links>`\n : ''\n }\n </ifx-card>`;\n\nexport const Horizontal = HorizontalTemplate.bind({});\nHorizontal.args = {\n direction: 'horizontal',\n src: 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg',\n};\nHorizontal.argTypes = {\n direction: {\n table: {\n disable: true,\n },\n },\n};\n"]}
@@ -3,41 +3,102 @@ export default {
3
3
  title: 'Components/Checkbox',
4
4
  tags: ['autodocs'],
5
5
  args: {
6
+ label: 'Text',
6
7
  error: false,
8
+ disabled: false,
7
9
  checked: false,
8
- label: 'Text',
9
10
  size: 's',
10
11
  indeterminate: false,
11
- name: 'checkbox',
12
- value: 'checkbox',
12
+ name: 'checkbox'
13
13
  },
14
14
  argTypes: {
15
+ label: {
16
+ name: 'Label of Checkbox',
17
+ description: 'Sets the label of *<ifx-checkbox>*.',
18
+ table: {
19
+ category: 'story controls',
20
+ type: {
21
+ summary: '<ifx-checkbox> `label` </ifx-checkbox>'
22
+ }
23
+ }
24
+ },
25
+ error: {
26
+ description: 'Toggles the error state for the checkbox.',
27
+ control: 'boolean',
28
+ table: {
29
+ category: 'ifx-checkbox props',
30
+ defaultValue: {
31
+ summary: false,
32
+ }
33
+ }
34
+ },
35
+ disabled: {
36
+ description: 'Disables the checkbox when set to true.',
37
+ control: 'boolean',
38
+ table: {
39
+ category: 'ifx-checkbox props',
40
+ defaultValue: {
41
+ summary: false,
42
+ }
43
+ }
44
+ },
45
+ checked: {
46
+ description: 'Controls whether the checkbox is checked.',
47
+ control: 'boolean',
48
+ table: {
49
+ category: 'ifx-checkbox props',
50
+ defaultValue: {
51
+ summary: false,
52
+ }
53
+ }
54
+ },
55
+ indeterminate: {
56
+ description: 'Activates the indeterminate state for the checkbox when set to true.',
57
+ control: 'boolean',
58
+ table: {
59
+ category: 'ifx-checkbox props',
60
+ defaultValue: {
61
+ summary: false,
62
+ }
63
+ }
64
+ },
15
65
  size: {
16
- description: 'Size options: s (21px) and m (25px) - default: m',
66
+ description: 'Sets the size of the checkbox. Options: s (21px) and m (25px).',
67
+ control: 'radio',
17
68
  options: ['s', 'm'],
18
- control: { type: 'radio' },
69
+ table: {
70
+ category: 'ifx-checkbox props',
71
+ defaultValue: {
72
+ summary: 's'
73
+ },
74
+ type: {
75
+ summary: 's | m'
76
+ }
77
+ }
78
+ },
79
+ name: {
80
+ description: 'Name of the element, that is used as reference when a form is submitted.',
81
+ table: {
82
+ category: 'ifx-checkbox props'
83
+ }
19
84
  },
20
85
  ifxChange: {
21
86
  action: 'ifxChange',
22
- description: 'Custom event emitted when accordion-item is closed',
87
+ description: 'Custom event that is triggered when the checkbox is clicked.',
23
88
  table: {
89
+ category: 'custom events',
24
90
  type: {
25
91
  summary: 'Framework integration',
26
92
  detail: 'React: onIfxChange={handleChange}\nVue:@ifxChange="handleChange"\nAngular:(ifxChange)="handleChange()"\nVanillaJs:.addEventListener("ifxChange", (event) => {//handle change});',
27
93
  },
28
94
  },
29
95
  },
30
- name: {
31
- description: 'Name of the element, that is used as reference when a form is submitted.'
32
- },
33
- value: {
34
- description: 'The value that gets submitted, when the checkbox is seleted'
35
- }
36
96
  },
37
97
  };
38
- const DefaultTemplate = ({ error, checked, indeterminate, size, label, name }) => {
98
+ const Template = ({ error, disabled, checked, indeterminate, size, label, name }) => {
39
99
  const checkbox = document.createElement('ifx-checkbox');
40
100
  checkbox.setAttribute('error', error);
101
+ checkbox.setAttribute('disabled', disabled);
41
102
  checkbox.setAttribute('checked', checked);
42
103
  checkbox.setAttribute('size', size);
43
104
  checkbox.setAttribute('indeterminate', indeterminate);
@@ -48,5 +109,5 @@ const DefaultTemplate = ({ error, checked, indeterminate, size, label, name }) =
48
109
  `;
49
110
  return checkbox;
50
111
  };
51
- export const Default = DefaultTemplate.bind({});
112
+ export const Default = Template.bind({});
52
113
  //# sourceMappingURL=checkbox.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.stories.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,GAAG;QACT,aAAa,EAAE,KAAK;QACpB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;KAClB;IAED,QAAQ,EAAE;QACR,IAAI,EAAE;YACJ,WAAW,EAAE,kDAAkD;YAC/D,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;YACnB,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;SAC3B;QACD,SAAS,EAAE;YACT,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,oDAAoD;YACjE,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,uBAAuB;oBAChC,MAAM,EACJ,iLAAiL;iBACpL;aACF;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,0EAA0E;SACxF;QACD,KAAK,EAAE;YACL,WAAW,EAAE,6DAA6D;SAC3E;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC/E,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IACxD,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEpC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAE5D,QAAQ,CAAC,SAAS,GAAG;MACjB,KAAK;GACR,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\n\nexport default {\n title: 'Components/Checkbox',\n tags: ['autodocs'],\n args: {\n error: false,\n checked: false,\n label: 'Text',\n size: 's',\n indeterminate: false,\n name: 'checkbox',\n value: 'checkbox',\n },\n\n argTypes: {\n size: {\n description: 'Size options: s (21px) and m (25px) - default: m',\n options: ['s', 'm'],\n control: { type: 'radio' },\n },\n ifxChange: {\n action: 'ifxChange',\n description: 'Custom event emitted when accordion-item is closed',\n table: {\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxChange={handleChange}\\nVue:@ifxChange=\"handleChange\"\\nAngular:(ifxChange)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxChange\", (event) => {//handle change});',\n },\n },\n },\n name: {\n description: 'Name of the element, that is used as reference when a form is submitted.'\n },\n value: {\n description: 'The value that gets submitted, when the checkbox is seleted'\n }\n },\n};\n\nconst DefaultTemplate = ({ error, checked, indeterminate, size, label, name }) => {\n const checkbox = document.createElement('ifx-checkbox');\n checkbox.setAttribute('error', error);\n checkbox.setAttribute('checked', checked);\n checkbox.setAttribute('size', size);\n checkbox.setAttribute('indeterminate', indeterminate);\n checkbox.setAttribute('name', name);\n\n checkbox.addEventListener('ifxChange', action('ifxChange'));\n\n checkbox.innerHTML = `\n ${label}\n `;\n\n return checkbox;\n};\n\nexport const Default = DefaultTemplate.bind({});\n"]}
1
+ {"version":3,"file":"checkbox.stories.js","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,GAAG;QACT,aAAa,EAAE,KAAK;QACpB,IAAI,EAAE,UAAU;KACjB;IAED,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,mBAAmB;YACzB,WAAW,EAAE,qCAAqC;YAClD,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,IAAI,EAAE;oBACJ,OAAO,EAAE,wCAAwC;iBAClD;aACF;SACF;QACD,KAAK,EAAE;YACL,WAAW,EAAE,2CAA2C;YACxD,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE;gBACL,QAAQ,EAAE,oBAAoB;gBAC9B,YAAY,EAAE;oBACZ,OAAO,EAAE,KAAK;iBACf;aACF;SACF;QACD,QAAQ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EAAE;IAClF,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;IACxD,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC5C,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEpC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAE5D,QAAQ,CAAC,SAAS,GAAG;MACjB,KAAK;GACR,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\n\nexport default {\n title: 'Components/Checkbox',\n tags: ['autodocs'],\n args: {\n label: 'Text',\n error: false,\n disabled: false,\n checked: false,\n size: 's',\n indeterminate: false,\n name: 'checkbox'\n },\n\n argTypes: {\n label: {\n name: 'Label of Checkbox',\n description: 'Sets the label of *<ifx-checkbox>*.',\n table: {\n category: 'story controls',\n type: {\n summary: '<ifx-checkbox> `label` </ifx-checkbox>'\n }\n }\n },\n error: {\n description: 'Toggles the error state for the checkbox.',\n control: 'boolean',\n table: {\n category: 'ifx-checkbox props',\n defaultValue: {\n summary: false,\n }\n }\n },\n disabled: {\n description: 'Disables the checkbox when set to true.',\n control: 'boolean',\n table: {\n category: 'ifx-checkbox props',\n defaultValue: {\n summary: false,\n }\n }\n },\n checked: {\n description: 'Controls whether the checkbox is checked.',\n control: 'boolean',\n table: {\n category: 'ifx-checkbox props',\n defaultValue: {\n summary: false,\n }\n }\n },\n indeterminate: {\n description: 'Activates the indeterminate state for the checkbox when set to true.',\n control: 'boolean',\n table: {\n category: 'ifx-checkbox props',\n defaultValue: {\n summary: false,\n }\n }\n },\n size: {\n description: 'Sets the size of the checkbox. Options: s (21px) and m (25px).',\n control: 'radio',\n options: ['s', 'm'],\n table: {\n category: 'ifx-checkbox props',\n defaultValue: {\n summary: 's'\n },\n type: {\n summary: 's | m'\n }\n }\n },\n name: {\n description: 'Name of the element, that is used as reference when a form is submitted.',\n table: {\n category: 'ifx-checkbox props'\n }\n },\n ifxChange: {\n action: 'ifxChange',\n description: 'Custom event that is triggered when the checkbox is clicked.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxChange={handleChange}\\nVue:@ifxChange=\"handleChange\"\\nAngular:(ifxChange)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxChange\", (event) => {//handle change});',\n },\n },\n },\n },\n};\n\nconst Template = ({ error, disabled, checked, indeterminate, size, label, name }) => {\n const checkbox = document.createElement('ifx-checkbox');\n checkbox.setAttribute('error', error);\n checkbox.setAttribute('disabled', disabled);\n checkbox.setAttribute('checked', checked);\n checkbox.setAttribute('size', size);\n checkbox.setAttribute('indeterminate', indeterminate);\n checkbox.setAttribute('name', name);\n\n checkbox.addEventListener('ifxChange', action('ifxChange'));\n\n checkbox.innerHTML = `\n ${label}\n `;\n\n return checkbox;\n};\n\nexport const Default = Template.bind({});"]}
@@ -1,18 +1,77 @@
1
1
  import { action } from "@storybook/addon-actions";
2
+ import { icons } from "@infineon/infineon-icons";
2
3
  export default {
3
4
  title: 'Components/Content Switcher',
4
5
  tags: ['autodocs'],
5
6
  args: {
6
7
  amountOfItems: 4,
8
+ label: 'Item',
9
+ value: 'item',
10
+ selected: false,
11
+ icon: 'applications-16'
7
12
  },
8
13
  argTypes: {
9
14
  amountOfItems: {
15
+ name: 'Amount of Items',
10
16
  control: { type: 'number' },
17
+ description: 'Set the number of content-switcher-items to be rendered.',
18
+ table: {
19
+ category: 'story controls',
20
+ type: {
21
+ summary: 'number'
22
+ }
23
+ }
24
+ },
25
+ label: {
26
+ name: 'Label',
27
+ control: { type: 'text' },
28
+ description: 'Set the label of the content-switcher-item.',
29
+ table: {
30
+ category: 'story controls',
31
+ type: {
32
+ summary: 'string'
33
+ }
34
+ }
35
+ },
36
+ value: {
37
+ control: { type: 'text' },
38
+ description: 'Set the value of the content-switcher-item.',
39
+ table: {
40
+ category: 'content-switcher-item props',
41
+ type: {
42
+ summary: 'string'
43
+ }
44
+ }
45
+ },
46
+ selected: {
47
+ control: { type: 'boolean' },
48
+ description: 'Set the selected state of the content-switcher-item. Only one item can be selected at the time. If there initially exists more than one selected item, then only the first item will be selected.',
49
+ table: {
50
+ category: 'content-switcher-item props',
51
+ defaultValue: {
52
+ summary: 'false'
53
+ },
54
+ type: {
55
+ summary: 'boolean'
56
+ }
57
+ }
58
+ },
59
+ icon: {
60
+ description: 'The icon of the content-switcher-item.',
61
+ options: Object.values(icons).map(i => i['name']),
62
+ control: { type: 'select' },
63
+ table: {
64
+ category: 'ifx-icon props',
65
+ type: {
66
+ summary: 'string'
67
+ }
68
+ }
11
69
  },
12
70
  ifxChange: {
13
71
  action: 'ifxChange',
14
72
  description: 'Custom event emitted when a different content-switcher-item gets selected. Contains the value of the previous and the new selected item.',
15
73
  table: {
74
+ category: 'custom events',
16
75
  type: {
17
76
  summary: 'Framework integration',
18
77
  detail: 'React: onIfxChange={handleChange}\nVue:@ifxChange="handleChange"\nAngular:(ifxChange)="handleChange()"\nVanillaJs:.addEventListener("ifxChange", (event) => {//handle change});',
@@ -21,14 +80,17 @@ export default {
21
80
  }
22
81
  },
23
82
  };
24
- const DefaultTemplate = ({ amountOfItems }) => {
83
+ const DefaultTemplate = ({ amountOfItems, label, value, icon, selected }) => {
25
84
  const element = document.createElement('ifx-content-switcher');
26
85
  for (let i = 0; i < amountOfItems; i++) {
27
86
  const item = document.createElement('ifx-content-switcher-item');
28
- item.setAttribute('value', `item-${i + 1}`);
87
+ item.setAttribute('value', `${value} ${i + 1}`);
29
88
  item.innerHTML = `
30
- <ifx-icon icon="applications-16"></ifx-icon>Item ${i + 1}
89
+ <ifx-icon icon="${icon}"></ifx-icon> ${label} ${i + 1}
31
90
  `;
91
+ if (i === 1 && selected) {
92
+ item.setAttribute('selected', 'true');
93
+ }
32
94
  element.appendChild(item);
33
95
  }
34
96
  element.addEventListener('ifxChange', action('ifxChange'));
@@ -1 +1 @@
1
- {"version":3,"file":"content-switcher.stories.js","sourceRoot":"","sources":["../../../src/components/content-switcher/content-switcher.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,aAAa,EAAE,CAAC;KAEjB;IACD,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B;QACD,SAAS,EAAE;YACT,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,0IAA0I;YACvJ,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,OAAO,EAAE,uBAAuB;oBAChC,MAAM,EACJ,iLAAiL;iBACpL;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE;IAC5C,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAE/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;QACjE,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG;yDACoC,CAAC,GAAG,CAAC;KACzD,CAAC;QAEF,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAE3D,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';\n\nexport default {\n title: 'Components/Content Switcher',\n tags: ['autodocs'],\n\n args: {\n amountOfItems: 4,\n\n },\n argTypes: {\n amountOfItems: {\n control: { type: 'number' },\n }, \n ifxChange: {\n action: 'ifxChange',\n description: 'Custom event emitted when a different content-switcher-item gets selected. Contains the value of the previous and the new selected item.', \n table: {\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxChange={handleChange}\\nVue:@ifxChange=\"handleChange\"\\nAngular:(ifxChange)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxChange\", (event) => {//handle change});',\n },\n },\n }\n },\n};\n\nconst DefaultTemplate = ({ amountOfItems }) => {\n const element = document.createElement('ifx-content-switcher');\n\n for (let i = 0; i < amountOfItems; i++) {\n const item = document.createElement('ifx-content-switcher-item');\n item.setAttribute('value', `item-${i + 1}`);\n item.innerHTML = `\n <ifx-icon icon=\"applications-16\"></ifx-icon>Item ${i + 1}\n `;\n\n element.appendChild(item);\n }\n\n element.addEventListener('ifxChange', action('ifxChange'));\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});"]}
1
+ {"version":3,"file":"content-switcher.stories.js","sourceRoot":"","sources":["../../../src/components/content-switcher/content-switcher.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,K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C,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAE3D,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/Content Switcher',\n tags: ['autodocs'],\n\n args: {\n amountOfItems: 4,\n label: 'Item',\n value: 'item',\n selected: false,\n icon: 'applications-16'\n\n },\n argTypes: {\n amountOfItems: {\n name: 'Amount of Items',\n control: { type: 'number' },\n description: 'Set the number of content-switcher-items to be rendered.',\n table: {\n category: 'story controls',\n type: {\n summary: 'number'\n }\n }\n },\n label: {\n name: 'Label',\n control: { type: 'text' },\n description: 'Set the label of the content-switcher-item.',\n table: {\n category: 'story controls',\n type: {\n summary: 'string'\n }\n }\n },\n value: {\n control: { type: 'text' },\n description: 'Set the value of the content-switcher-item.',\n table: {\n category: 'content-switcher-item props',\n type: {\n summary: 'string'\n }\n }\n },\n selected: {\n control: { type: 'boolean' },\n description: 'Set the selected state of the content-switcher-item. Only one item can be selected at the time. If there initially exists more than one selected item, then only the first item will be selected.',\n table: {\n category: 'content-switcher-item props',\n defaultValue: {\n summary: 'false'\n },\n type: {\n summary: 'boolean'\n }\n }\n },\n icon: {\n description: 'The icon of the content-switcher-item.',\n options: Object.values(icons).map(i => i['name']),\n control: { type: 'select' },\n table: {\n category: 'ifx-icon props',\n type: {\n summary: 'string'\n }\n }\n },\n ifxChange: {\n action: 'ifxChange',\n description: 'Custom event emitted when a different content-switcher-item gets selected. Contains the value of the previous and the new selected item.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxChange={handleChange}\\nVue:@ifxChange=\"handleChange\"\\nAngular:(ifxChange)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxChange\", (event) => {//handle change});',\n },\n },\n }\n },\n};\n\nconst DefaultTemplate = ({ amountOfItems, label, value, icon, selected }) => {\n const element = document.createElement('ifx-content-switcher');\n\n for (let i = 0; i < amountOfItems; i++) {\n const item = document.createElement('ifx-content-switcher-item');\n item.setAttribute('value', `${value} ${i + 1}`);\n item.innerHTML = `\n <ifx-icon icon=\"${icon}\"></ifx-icon> ${label} ${i + 1}\n `;\n if (i === 1 && selected) {\n item.setAttribute('selected', 'true');\n }\n\n element.appendChild(item);\n }\n element.addEventListener('ifxChange', action('ifxChange'));\n\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});"]}