@infineon/infineon-design-system-stencil 30.9.2--canary.1640.8926aa040c1241b80b9d12b6600d721691845221.0 → 30.9.2--canary.1640.70fa3eaef8e23b3cce71878a1e99bd63e614a640.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 +6 -6
- package/dist/cjs/ifx-accordion_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-breadcrumb-item-label.cjs.entry.js +2 -2
- package/dist/cjs/ifx-breadcrumb-item-label.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/ifx-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-chip_3.cjs.entry.js +18 -18
- package/dist/cjs/ifx-chip_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js +5 -6
- package/dist/cjs/ifx-sidebar-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ifx-table.cjs.entry.js +2 -2
- package/dist/cjs/ifx-table.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.js +2 -2
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +18 -18
- package/dist/collection/components/accordion/accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/accordionItem.js +7 -7
- package/dist/collection/components/accordion/accordionItem.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb-item-label.js +4 -4
- package/dist/collection/components/breadcrumb/breadcrumb-item-label.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.js +3 -3
- package/dist/collection/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js +29 -14
- package/dist/collection/components/breadcrumb/breadcrumb.stories.js.map +1 -1
- package/dist/collection/components/button/button.stories.js +1 -4
- package/dist/collection/components/button/button.stories.js.map +1 -1
- package/dist/collection/components/card/card.stories.js +9 -11
- package/dist/collection/components/card/card.stories.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.stories.js +1 -4
- package/dist/collection/components/checkbox/checkbox.stories.js.map +1 -1
- package/dist/collection/components/chip/chip-item/chip-item.js +4 -4
- package/dist/collection/components/chip/chip-item/chip-item.js.map +1 -1
- package/dist/collection/components/chip/chip.js +15 -15
- package/dist/collection/components/chip/chip.js.map +1 -1
- package/dist/collection/components/chip/chip.stories.js +18 -26
- package/dist/collection/components/chip/chip.stories.js.map +1 -1
- package/dist/collection/components/chip/interfaces.js.map +1 -1
- package/dist/collection/components/content-switcher/content-switcher.stories.js +2 -2
- package/dist/collection/components/content-switcher/content-switcher.stories.js.map +1 -1
- package/dist/collection/components/date-picker/date-picker.stories.js +22 -1
- package/dist/collection/components/date-picker/date-picker.stories.js.map +1 -1
- package/dist/collection/components/dropdown/dropdown.stories.js +100 -39
- package/dist/collection/components/dropdown/dropdown.stories.js.map +1 -1
- package/dist/collection/components/link/link.stories.js +1 -4
- package/dist/collection/components/link/link.stories.js.map +1 -1
- package/dist/collection/components/navigation/navbar/navbar.stories.js +5 -32
- package/dist/collection/components/navigation/navbar/navbar.stories.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar-item.js +5 -26
- package/dist/collection/components/navigation/sidebar/sidebar-item.js.map +1 -1
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js +90 -18
- package/dist/collection/components/navigation/sidebar/sidebar.stories.js.map +1 -1
- package/dist/collection/components/notification/notification.stories.js +1 -1
- package/dist/collection/components/notification/notification.stories.js.map +1 -1
- package/dist/collection/components/number-indicator/number-indicator.stories.js +1 -1
- package/dist/collection/components/number-indicator/number-indicator.stories.js.map +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.js +1 -1
- package/dist/collection/components/radio-button/radio-button.stories.js.map +1 -1
- package/dist/collection/components/segmented-control/segmented-control.stories.js +0 -3
- package/dist/collection/components/segmented-control/segmented-control.stories.js.map +1 -1
- package/dist/collection/components/status/status.stories.js +1 -1
- package/dist/collection/components/status/status.stories.js.map +1 -1
- package/dist/collection/components/switch/switch.stories.js +2 -5
- package/dist/collection/components/switch/switch.stories.js.map +1 -1
- package/dist/collection/components/table-advanced-version/table.js +3 -3
- package/dist/collection/components/table-advanced-version/table.js.map +1 -1
- package/dist/collection/components/tag/tag.stories.js +2 -2
- package/dist/collection/components/tag/tag.stories.js.map +1 -1
- package/dist/collection/components/text-field/text-field.stories.js +1 -1
- package/dist/collection/components/text-field/text-field.stories.js.map +1 -1
- package/dist/components/ifx-accordion-item.js +1 -1
- package/dist/components/ifx-accordion.js +1 -1
- package/dist/components/ifx-breadcrumb-item-label.js +3 -3
- package/dist/components/ifx-breadcrumb-item-label.js.map +1 -1
- package/dist/components/ifx-breadcrumb.js +3 -3
- package/dist/components/ifx-breadcrumb.js.map +1 -1
- package/dist/components/ifx-chip-item.js +1 -1
- package/dist/components/ifx-chip.js +1 -1
- package/dist/components/ifx-faq.js +2 -2
- package/dist/components/ifx-sidebar-item.js +5 -7
- package/dist/components/ifx-sidebar-item.js.map +1 -1
- package/dist/components/ifx-table.js +5 -5
- package/dist/components/ifx-table.js.map +1 -1
- package/dist/components/{p-62c6aeb2.js → p-053d42ef.js} +6 -6
- package/dist/components/{p-62c6aeb2.js.map → p-053d42ef.js.map} +1 -1
- package/dist/components/{p-094bb435.js → p-3baaa460.js} +3 -3
- package/dist/components/{p-094bb435.js.map → p-3baaa460.js.map} +1 -1
- package/dist/components/{p-184f1004.js → p-793d89e7.js} +15 -15
- package/dist/components/p-793d89e7.js.map +1 -0
- package/dist/components/{p-23cdd5a7.js → p-7b5e297f.js} +5 -5
- package/dist/components/p-7b5e297f.js.map +1 -0
- package/dist/esm/ifx-accordion_2.entry.js +6 -6
- package/dist/esm/ifx-accordion_2.entry.js.map +1 -1
- package/dist/esm/ifx-breadcrumb-item-label.entry.js +2 -2
- package/dist/esm/ifx-breadcrumb-item-label.entry.js.map +1 -1
- package/dist/esm/ifx-breadcrumb.entry.js +3 -3
- package/dist/esm/ifx-breadcrumb.entry.js.map +1 -1
- package/dist/esm/ifx-chip_3.entry.js +18 -18
- package/dist/esm/ifx-chip_3.entry.js.map +1 -1
- package/dist/esm/ifx-sidebar-item.entry.js +5 -6
- package/dist/esm/ifx-sidebar-item.entry.js.map +1 -1
- package/dist/esm/ifx-table.entry.js +2 -2
- package/dist/esm/ifx-table.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-00d6e46e.entry.js → p-26810237.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/p-26810237.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-26df4dfe.entry.js +2 -0
- package/dist/infineon-design-system-stencil/{p-28fb795b.entry.js.map → p-26df4dfe.entry.js.map} +1 -1
- package/dist/infineon-design-system-stencil/p-355cea09.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-355cea09.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-68752789.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-68752789.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-9f6c1499.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-9f6c1499.entry.js.map +1 -0
- package/dist/infineon-design-system-stencil/p-df6cadc1.entry.js +2 -0
- package/dist/infineon-design-system-stencil/p-df6cadc1.entry.js.map +1 -0
- package/dist/types/components/accordion/accordion.stories.d.ts +2 -2
- package/dist/types/components/accordion/accordionItem.d.ts +2 -2
- package/dist/types/components/breadcrumb/breadcrumb-item-label.d.ts +1 -1
- package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +19 -2
- package/dist/types/components/button/button.stories.d.ts +0 -3
- package/dist/types/components/card/card.stories.d.ts +10 -10
- package/dist/types/components/checkbox/checkbox.stories.d.ts +0 -3
- package/dist/types/components/chip/chip-item/chip-item.d.ts +1 -1
- package/dist/types/components/chip/chip.d.ts +1 -1
- package/dist/types/components/chip/chip.stories.d.ts +11 -4
- package/dist/types/components/chip/interfaces.d.ts +1 -1
- package/dist/types/components/date-picker/date-picker.stories.d.ts +21 -0
- package/dist/types/components/dropdown/dropdown.stories.d.ts +3 -30
- package/dist/types/components/link/link.stories.d.ts +0 -3
- package/dist/types/components/navigation/navbar/navbar.stories.d.ts +1 -22
- package/dist/types/components/navigation/sidebar/sidebar-item.d.ts +0 -1
- package/dist/types/components/navigation/sidebar/sidebar.stories.d.ts +69 -0
- package/dist/types/components/segmented-control/segmented-control.stories.d.ts +0 -3
- package/dist/types/components/switch/switch.stories.d.ts +0 -3
- package/dist/types/components.d.ts +8 -10
- package/package.json +1 -1
- package/dist/components/p-184f1004.js.map +0 -1
- package/dist/components/p-23cdd5a7.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-00d6e46e.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-28fb795b.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-72d804fb.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-72d804fb.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-7bef9272.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-7bef9272.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-c3e3eda9.entry.js.map +0 -1
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js +0 -2
- package/dist/infineon-design-system-stencil/p-dac5d6d5.entry.js.map +0 -1
@@ -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;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,iBAAiB;KAExB;IACD,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,WAAW,EAAE,0DAA0D;YACvE,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,IAAI,EAAE;oBACJ,OAAO,EAAE,QAAQ;iBAClB;aACF;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,
|
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,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,aAAa,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,iBAAiB;KAExB;IACD,QAAQ,EAAE;QACR,aAAa,EAAE;YACb,IAAI,EAAE,iBAAiB;YACvB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,WAAW,EAAE,0DAA0D;YACvE,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,IAAI,EAAE;oBACJ,OA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aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC1E,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,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG;wBACG,IAAI,iBAAiB,KAAK,IAAI,CAAC,GAAG,CAAC;KACtD,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,IAAI,QAAQ,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD,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';\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 of Content Switcher Item',\n control: { type: 'text' },\n description: 'Set the label of the *<ifx-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({});"]}
|
@@ -13,6 +13,8 @@ export default {
|
|
13
13
|
min: '',
|
14
14
|
label: "Label Text",
|
15
15
|
caption: "Caption text, description, error notification.",
|
16
|
+
AriaLabel: 'Date Picker',
|
17
|
+
required: false,
|
16
18
|
},
|
17
19
|
argTypes: {
|
18
20
|
label: {
|
@@ -92,6 +94,23 @@ export default {
|
|
92
94
|
category: 'ifx-date-picker props'
|
93
95
|
}
|
94
96
|
},
|
97
|
+
AriaLabel: {
|
98
|
+
control: { type: 'text' },
|
99
|
+
description: 'Set the aria label of the date picker. Enhances accessibility.',
|
100
|
+
table: {
|
101
|
+
category: 'ifx-date-picker props'
|
102
|
+
}
|
103
|
+
},
|
104
|
+
required: {
|
105
|
+
description: 'Set the required attribute to true to make the date picker mandatory.',
|
106
|
+
control: 'boolean',
|
107
|
+
table: {
|
108
|
+
category: 'ifx-date-picker props',
|
109
|
+
defaultValue: {
|
110
|
+
summary: false
|
111
|
+
}
|
112
|
+
}
|
113
|
+
},
|
95
114
|
ifxDate: {
|
96
115
|
action: 'ifxDate',
|
97
116
|
description: 'A custom event emitted when a date in the calendar is being selected.',
|
@@ -105,7 +124,7 @@ export default {
|
|
105
124
|
},
|
106
125
|
},
|
107
126
|
};
|
108
|
-
const DefaultTemplate = ({ error, disabled, success, size, value, max, min, caption, label }) => {
|
127
|
+
const DefaultTemplate = ({ error, disabled, success, size, value, max, min, caption, label, AriaLabel, required }) => {
|
109
128
|
const element = document.createElement('ifx-date-picker');
|
110
129
|
element.setAttribute('error', error);
|
111
130
|
element.setAttribute('disabled', disabled);
|
@@ -116,6 +135,8 @@ const DefaultTemplate = ({ error, disabled, success, size, value, max, min, capt
|
|
116
135
|
element.setAttribute('min', min);
|
117
136
|
element.setAttribute('label', label);
|
118
137
|
element.setAttribute('caption', caption);
|
138
|
+
element.setAttribute('AreaLabel', AriaLabel);
|
139
|
+
element.setAttribute('required', required);
|
119
140
|
element.addEventListener('ifxDate', action('ifxDate'));
|
120
141
|
return element;
|
121
142
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"date-picker.stories.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE,gDAAgD;
|
1
|
+
{"version":3,"file":"date-picker.stories.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,eAAe;IACb,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,EAAE;QACT,GAAG,EAAE,EAAE;QACP,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,YAAY;QACnB,OAAO,EAAE,gDAAgD;QACzD,SAAS,EAAE,aAAa;QACxB,QAAQ,EAAE,KAAK;KAChB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,WAAW,EAAE,uBAAuB;YACpC,KAAK,EAAE;gBACL,QAAQ,EAAE,uBAAuB;aAClC;SACF;QACD,OAAO,EAAE;YACP,WAAW,EAAE,gDAAgD;YAC7D,KAAK,EAAE;gBACL,QAAQ,EAAE,uBAAuB;aAClC;SACF;QACD,GAAG,EAAE;YACH,WAAW,EAAE,mCAAmC;YAChD,KAAK,EAAE;gBACL,QAAQ,EAAE,u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AAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,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/Date Picker',\n tags: ['autodocs'],\n\n args: {\n disabled: false,\n size: 's',\n success: false,\n error: false,\n name: 'date-picker',\n value: '',\n max: '',\n min: '',\n label: \"Label Text\",\n caption: \"Caption text, description, error notification.\",\n AriaLabel: 'Date Picker',\n required: false,\n },\n argTypes: {\n label: {\n description: 'Label of Date Picker.',\n table: {\n category: 'ifx-date-picker props',\n }\n },\n caption: {\n description: 'Caption text, description, error notification.',\n table: {\n category: 'ifx-date-picker props',\n }\n },\n min: {\n description: 'Minimum date that can be selected',\n table: {\n category: 'ifx-date-picker props',\n }\n },\n max: {\n description: 'The latest date that can be selected.',\n table: {\n category: 'ifx-date-picker props',\n }\n },\n disabled: {\n description: 'Disables the date picker',\n control: 'boolean',\n table: {\n category: 'ifx-date-picker props',\n defaultValue: {\n summary: false\n }\n }\n },\n success: {\n description: 'Indicates success in the date picker.',\n control: 'boolean',\n table: {\n category: 'ifx-date-picker props',\n defaultValue: {\n summary: false\n }\n }\n },\n error: {\n description: 'Indicates error in the date picker.',\n control: 'boolean',\n table: {\n category: 'ifx-date-picker props',\n defaultValue: {\n summary: false\n }\n }\n },\n size: {\n description: 'Sets the size of the date picker. Options: Height small (36px) and Height large (40px)',\n control: 'radio',\n options: ['s', 'l'],\n table: {\n category: 'ifx-date-picker props',\n defaultValue: {\n summary: 's'\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-date-picker props'\n }\n },\n value: {\n description: 'Displayed date is formatted based on the locale of the user`s browser, but the parsed value is always formatted yyyy-mm-dd',\n table: {\n category: 'ifx-date-picker props'\n }\n },\n AriaLabel: {\n control: { type: 'text' },\n description: 'Set the aria label of the date picker. Enhances accessibility.',\n table: {\n category: 'ifx-date-picker props'\n }\n },\n required: {\n description: 'Set the required attribute to true to make the date picker mandatory.',\n control: 'boolean',\n table: {\n category: 'ifx-date-picker props',\n defaultValue: {\n summary: false\n }\n }\n },\n ifxDate: {\n action: 'ifxDate',\n description: 'A custom event emitted when a date in the calendar is being selected.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxDate={handleInput}\\nVue:@ifxDate=\"handleInput\"\\nAngular:(ifxDate)=\"handleInput()\"\\nVanillaJs:.addEventListener(\"ifxDate\", (event) => {//handle input});',\n },\n },\n },\n },\n};\n\nconst DefaultTemplate = ({ error, disabled, success, size, value, max, min, caption, label, AriaLabel, required }) => {\n const element = document.createElement('ifx-date-picker');\n element.setAttribute('error', error);\n element.setAttribute('disabled', disabled);\n element.setAttribute('size', size);\n element.setAttribute('success', success);\n element.setAttribute('value', value);\n element.setAttribute('max', max);\n element.setAttribute('min', min);\n element.setAttribute('label', label);\n element.setAttribute('caption', caption);\n element.setAttribute('AreaLabel', AriaLabel);\n element.setAttribute('required', required);\n element.addEventListener('ifxDate', action('ifxDate'));\n return element;\n};\n\nexport const Default = DefaultTemplate.bind({});"]}
|
@@ -13,9 +13,6 @@ export default {
|
|
13
13
|
variant: 'primary',
|
14
14
|
placement: 'bottom-start',
|
15
15
|
size: 'm',
|
16
|
-
searchField: false,
|
17
|
-
header: false,
|
18
|
-
separator: false,
|
19
16
|
href: '',
|
20
17
|
target: '_self',
|
21
18
|
icon: 'c-info-16',
|
@@ -49,8 +46,8 @@ export default {
|
|
49
46
|
}
|
50
47
|
},
|
51
48
|
label: {
|
52
|
-
name: 'Label of Dropdown',
|
53
|
-
description: '
|
49
|
+
name: 'Label of Dropdown Trigger Button',
|
50
|
+
description: 'Set the label displayed on the *<ifx-dropdown-trigger-button>*.',
|
54
51
|
table: {
|
55
52
|
category: 'story controls',
|
56
53
|
defaultValue: {
|
@@ -121,33 +118,6 @@ export default {
|
|
121
118
|
}
|
122
119
|
// if: { arg: 'Type', eq: 'Label Trigger' }
|
123
120
|
},
|
124
|
-
searchField: {
|
125
|
-
description: 'Show Search Bar.',
|
126
|
-
table: {
|
127
|
-
category: 'ifx-dropdown-menu props',
|
128
|
-
defaultValue: {
|
129
|
-
summary: false
|
130
|
-
}
|
131
|
-
}
|
132
|
-
},
|
133
|
-
header: {
|
134
|
-
description: 'Add Header Text.',
|
135
|
-
table: {
|
136
|
-
category: 'ifx-dropdown-menu props',
|
137
|
-
defaultValue: {
|
138
|
-
summary: false
|
139
|
-
}
|
140
|
-
}
|
141
|
-
},
|
142
|
-
separator: {
|
143
|
-
description: 'Use separator in dropdown.',
|
144
|
-
table: {
|
145
|
-
category: 'ifx-dropdown-menu props',
|
146
|
-
defaultValue: {
|
147
|
-
summary: false
|
148
|
-
}
|
149
|
-
}
|
150
|
-
},
|
151
121
|
defaultOpen: {
|
152
122
|
description: 'Determines if the dropdown should be open by default.',
|
153
123
|
control: 'boolean',
|
@@ -212,7 +182,7 @@ export default {
|
|
212
182
|
},
|
213
183
|
ifxDropdownMenuItem: {
|
214
184
|
action: 'ifxDropdownMenuItem',
|
215
|
-
description: 'Custom event emitted when an item is selected.',
|
185
|
+
description: 'Custom event emitted by ifx-dropdown-menu when an item is selected.',
|
216
186
|
table: {
|
217
187
|
category: 'custom events',
|
218
188
|
type: {
|
@@ -237,13 +207,10 @@ const DefaultTemplate = args => {
|
|
237
207
|
</ifx-dropdown-trigger-button>
|
238
208
|
|
239
209
|
<ifx-dropdown-menu size="${args.size}">
|
240
|
-
${args.header ? `<ifx-dropdown-header>Header Text</ifx-dropdown-header>` : ''}
|
241
|
-
${args.searchField ? `<ifx-search-field show-delete-icon="false"></ifx-search-field>` : ''}
|
242
210
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
243
211
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
244
212
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
245
213
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
246
|
-
${args.separator ? `<ifx-dropdown-separator></ifx-dropdown-separator>` : ''}
|
247
214
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
248
215
|
</ifx-dropdown-menu>
|
249
216
|
</ifx-dropdown>`;
|
@@ -271,13 +238,10 @@ const LabelTriggerTemplate = args => {
|
|
271
238
|
</ifx-dropdown-trigger>
|
272
239
|
Some more text
|
273
240
|
<ifx-dropdown-menu size="${args.size}">
|
274
|
-
${args.header ? `<ifx-dropdown-header>Header Text</ifx-dropdown-header>` : ''}
|
275
|
-
${args.search ? `<ifx-search-field show-delete-icon="false"></ifx-search-field>` : ''}
|
276
241
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
277
242
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
278
243
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
279
244
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
280
|
-
${args.separator ? `<ifx-dropdown-separator></ifx-dropdown-separator>` : ''}
|
281
245
|
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
282
246
|
</ifx-dropdown-menu>
|
283
247
|
</ifx-dropdown>`;
|
@@ -301,4 +265,101 @@ LabelTrigger.argTypes = {
|
|
301
265
|
}
|
302
266
|
}
|
303
267
|
};
|
268
|
+
const HeaderTemplate = args => {
|
269
|
+
const wrapper = document.createElement('div');
|
270
|
+
wrapper.innerHTML = `<ifx-dropdown
|
271
|
+
placement="${args.placement}"
|
272
|
+
default-open="${args.defaultOpen}"
|
273
|
+
no-close-on-outside-click="${args.noCloseOnOutsideClick}"
|
274
|
+
no-close-on-menu-click="${args.noCloseOnOutsideClick}"
|
275
|
+
no-append-to-body="${args.noAppendToBody}">
|
276
|
+
<ifx-dropdown-header>Dropdown Header</ifx-dropdown-header>
|
277
|
+
<ifx-dropdown-trigger-button variant="${args.variant}">
|
278
|
+
${args.label}
|
279
|
+
</ifx-dropdown-trigger-button>
|
280
|
+
<ifx-dropdown-menu size="${args.size}">
|
281
|
+
<ifx-dropdown-header>Header Text</ifx-dropdown-header>
|
282
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
283
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
284
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
285
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
286
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
287
|
+
</ifx-dropdown-menu>
|
288
|
+
</ifx-dropdown>`;
|
289
|
+
const dropdown = wrapper.querySelector('ifx-dropdown');
|
290
|
+
const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');
|
291
|
+
dropdown.addEventListener('ifxOpen', action('ifxOpen'));
|
292
|
+
dropdown.addEventListener('ifxClose', action('ifxClose'));
|
293
|
+
dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));
|
294
|
+
return wrapper;
|
295
|
+
};
|
296
|
+
export const Header = HeaderTemplate.bind({});
|
297
|
+
Header.argTypes = {
|
298
|
+
label: {
|
299
|
+
table: {
|
300
|
+
disable: true
|
301
|
+
}
|
302
|
+
},
|
303
|
+
variant: {
|
304
|
+
table: {
|
305
|
+
disable: true
|
306
|
+
}
|
307
|
+
},
|
308
|
+
};
|
309
|
+
const SearchTemplate = args => {
|
310
|
+
const wrapper = document.createElement('div');
|
311
|
+
wrapper.innerHTML = `<ifx-dropdown
|
312
|
+
placement="${args.placement}"
|
313
|
+
default-open="${args.defaultOpen}"
|
314
|
+
no-close-on-outside-click="${args.noCloseOnOutsideClick}"
|
315
|
+
no-close-on-menu-click="${args.noCloseOnOutsideClick}"
|
316
|
+
no-append-to-body="${args.noAppendToBody}">
|
317
|
+
<ifx-dropdown-trigger-button variant="${args.variant}">
|
318
|
+
${args.label}
|
319
|
+
</ifx-dropdown-trigger-button>
|
320
|
+
<ifx-dropdown-menu size="${args.size}">
|
321
|
+
<ifx-search-field show-delete-icon="false"></ifx-search-field>
|
322
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
323
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
324
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
325
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
326
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
327
|
+
</ifx-dropdown-menu>
|
328
|
+
</ifx-dropdown>`;
|
329
|
+
const dropdown = wrapper.querySelector('ifx-dropdown');
|
330
|
+
const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');
|
331
|
+
dropdown.addEventListener('ifxOpen', action('ifxOpen'));
|
332
|
+
dropdown.addEventListener('ifxClose', action('ifxClose'));
|
333
|
+
dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));
|
334
|
+
return wrapper;
|
335
|
+
};
|
336
|
+
export const SearchField = SearchTemplate.bind({});
|
337
|
+
const SeparatorTemplate = args => {
|
338
|
+
const wrapper = document.createElement('div');
|
339
|
+
wrapper.innerHTML = `<ifx-dropdown
|
340
|
+
placement="${args.placement}"
|
341
|
+
default-open="${args.defaultOpen}"
|
342
|
+
no-close-on-outside-click="${args.noCloseOnOutsideClick}"
|
343
|
+
no-close-on-menu-click="${args.noCloseOnOutsideClick}"
|
344
|
+
no-append-to-body="${args.noAppendToBody}">
|
345
|
+
<ifx-dropdown-trigger-button variant="${args.variant}">
|
346
|
+
${args.label}
|
347
|
+
</ifx-dropdown-trigger-button>
|
348
|
+
<ifx-dropdown-menu size="${args.size}">
|
349
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
350
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
351
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
352
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
353
|
+
<ifx-dropdown-separator></ifx-dropdown-separator>
|
354
|
+
<ifx-dropdown-item icon="${args.icon === 'none' ? '' : args.icon}" target="${args.target}" href="${args.href !== '' ? args.href : ''}">Menu Item</ifx-dropdown-item>
|
355
|
+
</ifx-dropdown-menu>
|
356
|
+
</ifx-dropdown>`;
|
357
|
+
const dropdown = wrapper.querySelector('ifx-dropdown');
|
358
|
+
const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');
|
359
|
+
dropdown.addEventListener('ifxOpen', action('ifxOpen'));
|
360
|
+
dropdown.addEventListener('ifxClose', action('ifxClose'));
|
361
|
+
dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));
|
362
|
+
return wrapper;
|
363
|
+
};
|
364
|
+
export const Separator = SeparatorTemplate.bind({});
|
304
365
|
//# sourceMappingURL=dropdown.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dropdown.stories.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.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,qBAAqB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,KA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infineon-icons';\n\nexport default {\n title: 'Components/Dropdown',\n tags: ['autodocs'],\n args: {\n label: 'Dropdown',\n disabled: false,\n defaultOpen: false,\n noCloseOnOutsideClick: false,\n noCloseOnMenuClick: false,\n noAppendToBody: false,\n variant: 'primary',\n placement: 'bottom-start',\n size: 'm',\n searchField: false,\n header: false,\n separator: false,\n href: '',\n target: '_self',\n icon: 'c-info-16',\n },\n argTypes: {\n placement: {\n description: 'Specifies the position of the dropdown relative to its trigger element.',\n options: [\n 'auto',\n 'auto-start',\n 'auto-end',\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'right',\n 'right-start',\n 'right-end',\n 'left',\n 'left-start',\n 'left-end',\n ],\n control: 'select',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: 'bottom-start'\n }\n }\n },\n label: {\n name: 'Label of Dropdown',\n description: 'The visible name or label for the dropdown button.',\n table: {\n category: 'story controls',\n defaultValue: {\n summary: 'Dropdown'\n }\n }\n // if: { arg: 'Type', eq: 'Default' }\n },\n size: {\n description: 'Font Size options for menu items: s (14px) and m (16px) - default: m.',\n options: ['s', 'm'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-menu props',\n defaultValue: {\n summary: 'm'\n }\n }\n },\n disabled: {\n description: 'Determines if the dropdown button should be disabled.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n variant: {\n description: 'The visual style of the dropdown button. Accepted values are \"primary\", \"secondary\", \"tertiary\".',\n options: ['primary', 'secondary', 'tertiary'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-trigger-button props',\n defaultValue: {\n summary: 'primary'\n }\n }\n // if: { arg: 'Type', eq: 'Default' }\n },\n\n target: {\n description: 'Determines where to open the linked document when the dropdown item is clicked.',\n options: ['_self', '_blank'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-item props',\n defaultValue: {\n summary: '_self'\n }\n }\n },\n href: {\n description: 'href link to menu item.',\n table: {\n category: 'ifx-dropdown-item props'\n }\n },\n icon: {\n description: 'The icon to be displayed on the dropdown items.',\n options: ['none', ...Object.values(icons).map(i => i['name'])],\n control: 'select',\n table: {\n category: 'ifx-dropdown-item props',\n defaultValue: {\n summary: 'c-info-16'\n }\n }\n // if: { arg: 'Type', eq: 'Label Trigger' }\n },\n searchField: {\n description: 'Show Search Bar.',\n table: {\n category: 'ifx-dropdown-menu props',\n defaultValue: {\n summary: false\n }\n }\n },\n header: {\n description: 'Add Header Text.',\n table: {\n category: 'ifx-dropdown-menu props',\n defaultValue: {\n summary: false\n }\n }\n },\n separator: {\n description: 'Use separator in dropdown.',\n table: {\n category: 'ifx-dropdown-menu props',\n defaultValue: {\n summary: false\n }\n }\n },\n defaultOpen: {\n description: 'Determines if the dropdown should be open by default.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noCloseOnOutsideClick: {\n description: 'Determines if the dropdown should not close when a click outside the dropdown happens.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noCloseOnMenuClick: {\n description: 'Determines if the dropdown should not close when a click inside the dropdown menu happens.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noAppendToBody: {\n description: 'Determines if the dropdown should not be appended to the body.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n ifxOpen: {\n action: 'ifxOpen',\n description: 'Custom event that is emitted when the dropdown opens.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxOpen={handleChange}\\nVue:@ifxOpen=\"handleChange\"\\nAngular:(ifxOpen)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxOpen\", (event) => {//handle change});',\n },\n },\n },\n ifxClose: {\n action: 'ifxClose',\n description: 'Custom event emitted when dropdown closes.',\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 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 wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown placement=\"${args.placement}\" \n disabled=\"${args.disabled}\" \n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n no-append-to-body=\"${args.noAppendToBody}\">\n\n <ifx-dropdown-trigger-button variant=\"${args.variant}\">\n ${args.label}\n </ifx-dropdown-trigger-button>\n\n <ifx-dropdown-menu size=\"${args.size}\">\n ${args.header ? `<ifx-dropdown-header>Header Text</ifx-dropdown-header>` : ''}\n ${args.searchField ? `<ifx-search-field show-delete-icon=\"false\"></ifx-search-field>` : ''}\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n ${args.separator ? `<ifx-dropdown-separator></ifx-dropdown-separator>` : ''}\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n};\n\nexport const Default = DefaultTemplate.bind({});\n\n\nconst LabelTriggerTemplate = args => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown\n placement=\"${args.placement}\"\n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n disabled=\"${args.disabled}\"\n no-append-to-body=\"${args.noAppendToBody}\"\n >\n Hello World! Click on the text to open the dropdown\n <ifx-dropdown-trigger>\n <ifx-icon icon=\"${'c-check-16'}\"></ifx-icon>\n </ifx-dropdown-trigger>\n Some more text\n <ifx-dropdown-menu size=\"${args.size}\">\n ${args.header ? `<ifx-dropdown-header>Header Text</ifx-dropdown-header>` : ''}\n ${args.search ? `<ifx-search-field show-delete-icon=\"false\"></ifx-search-field>` : ''}\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n ${args.separator ? `<ifx-dropdown-separator></ifx-dropdown-separator>` : ''}\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n};\n\nexport const LabelTrigger = LabelTriggerTemplate.bind({});\nLabelTrigger.argTypes = {\n label: {\n table: {\n disable: true\n }\n },\n variant: {\n table: {\n disable: true\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"dropdown.stories.js","sourceRoot":"","sources":["../../../src/components/dropdown/dropdown.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,qBAAqB;IAC5B,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,IAAI,EAAE;QACJ,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,KAAK;QAClB,qBAAqB,EAAE,KAAK;QAC5B,kBAAkB,EAAE,KAAK;QACzB,cAAc,EAAE,K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AiB,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/Dropdown',\n tags: ['autodocs'],\n args: {\n label: 'Dropdown',\n disabled: false,\n defaultOpen: false,\n noCloseOnOutsideClick: false,\n noCloseOnMenuClick: false,\n noAppendToBody: false,\n variant: 'primary',\n placement: 'bottom-start',\n size: 'm',\n href: '',\n target: '_self',\n icon: 'c-info-16',\n },\n argTypes: {\n placement: {\n description: 'Specifies the position of the dropdown relative to its trigger element.',\n options: [\n 'auto',\n 'auto-start',\n 'auto-end',\n 'top',\n 'top-start',\n 'top-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'right',\n 'right-start',\n 'right-end',\n 'left',\n 'left-start',\n 'left-end',\n ],\n control: 'select',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: 'bottom-start'\n }\n }\n },\n label: {\n name: 'Label of Dropdown Trigger Button',\n description: 'Set the label displayed on the *<ifx-dropdown-trigger-button>*.',\n table: {\n category: 'story controls',\n defaultValue: {\n summary: 'Dropdown'\n }\n }\n // if: { arg: 'Type', eq: 'Default' }\n },\n size: {\n description: 'Font Size options for menu items: s (14px) and m (16px) - default: m.',\n options: ['s', 'm'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-menu props',\n defaultValue: {\n summary: 'm'\n }\n }\n },\n disabled: {\n description: 'Determines if the dropdown button should be disabled.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n variant: {\n description: 'The visual style of the dropdown button. Accepted values are \"primary\", \"secondary\", \"tertiary\".',\n options: ['primary', 'secondary', 'tertiary'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-trigger-button props',\n defaultValue: {\n summary: 'primary'\n }\n }\n // if: { arg: 'Type', eq: 'Default' }\n },\n\n target: {\n description: 'Determines where to open the linked document when the dropdown item is clicked.',\n options: ['_self', '_blank'],\n control: 'radio',\n table: {\n category: 'ifx-dropdown-item props',\n defaultValue: {\n summary: '_self'\n }\n }\n },\n href: {\n description: 'href link to menu item.',\n table: {\n category: 'ifx-dropdown-item props'\n }\n },\n icon: {\n description: 'The icon to be displayed on the dropdown items.',\n options: ['none', ...Object.values(icons).map(i => i['name'])],\n control: 'select',\n table: {\n category: 'ifx-dropdown-item props',\n defaultValue: {\n summary: 'c-info-16'\n }\n }\n // if: { arg: 'Type', eq: 'Label Trigger' }\n },\n defaultOpen: {\n description: 'Determines if the dropdown should be open by default.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noCloseOnOutsideClick: {\n description: 'Determines if the dropdown should not close when a click outside the dropdown happens.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noCloseOnMenuClick: {\n description: 'Determines if the dropdown should not close when a click inside the dropdown menu happens.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n noAppendToBody: {\n description: 'Determines if the dropdown should not be appended to the body.',\n control: 'boolean',\n table: {\n category: 'ifx-dropdown props',\n defaultValue: {\n summary: false\n }\n }\n },\n ifxOpen: {\n action: 'ifxOpen',\n description: 'Custom event that is emitted when the dropdown opens.',\n table: {\n category: 'custom events',\n type: {\n summary: 'Framework integration',\n detail:\n 'React: onIfxOpen={handleChange}\\nVue:@ifxOpen=\"handleChange\"\\nAngular:(ifxOpen)=\"handleChange()\"\\nVanillaJs:.addEventListener(\"ifxOpen\", (event) => {//handle change});',\n },\n },\n },\n ifxClose: {\n action: 'ifxClose',\n description: 'Custom event emitted when dropdown closes.',\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 ifxDropdownMenuItem: {\n action: 'ifxDropdownMenuItem',\n description: 'Custom event emitted by ifx-dropdown-menu 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 wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown placement=\"${args.placement}\" \n disabled=\"${args.disabled}\" \n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n no-append-to-body=\"${args.noAppendToBody}\">\n\n <ifx-dropdown-trigger-button variant=\"${args.variant}\">\n ${args.label}\n </ifx-dropdown-trigger-button>\n\n <ifx-dropdown-menu size=\"${args.size}\">\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n};\n\nexport const Default = DefaultTemplate.bind({});\n\n\nconst LabelTriggerTemplate = args => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown\n placement=\"${args.placement}\"\n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n disabled=\"${args.disabled}\"\n no-append-to-body=\"${args.noAppendToBody}\"\n >\n Hello World! Click on the text to open the dropdown\n <ifx-dropdown-trigger>\n <ifx-icon icon=\"${'c-check-16'}\"></ifx-icon>\n </ifx-dropdown-trigger>\n Some more text\n <ifx-dropdown-menu size=\"${args.size}\">\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n};\n\nexport const LabelTrigger = LabelTriggerTemplate.bind({});\nLabelTrigger.argTypes = {\n label: {\n table: {\n disable: true\n }\n },\n variant: {\n table: {\n disable: true\n }\n }\n}\n\nconst HeaderTemplate = args => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown\n placement=\"${args.placement}\"\n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n no-append-to-body=\"${args.noAppendToBody}\">\n <ifx-dropdown-header>Dropdown Header</ifx-dropdown-header>\n <ifx-dropdown-trigger-button variant=\"${args.variant}\">\n ${args.label}\n </ifx-dropdown-trigger-button>\n <ifx-dropdown-menu size=\"${args.size}\">\n <ifx-dropdown-header>Header Text</ifx-dropdown-header>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n}\n\nexport const Header = HeaderTemplate.bind({});\nHeader.argTypes = {\n label: {\n table: {\n disable: true\n }\n },\n variant: {\n table: {\n disable: true\n }\n },\n}\n\nconst SearchTemplate = args => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown\n placement=\"${args.placement}\"\n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n no-append-to-body=\"${args.noAppendToBody}\">\n <ifx-dropdown-trigger-button variant=\"${args.variant}\">\n ${args.label}\n </ifx-dropdown-trigger-button>\n <ifx-dropdown-menu size=\"${args.size}\">\n <ifx-search-field show-delete-icon=\"false\"></ifx-search-field>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n}\n\nexport const SearchField = SearchTemplate.bind({});\n\nconst SeparatorTemplate = args => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = `<ifx-dropdown\n placement=\"${args.placement}\"\n default-open=\"${args.defaultOpen}\"\n no-close-on-outside-click=\"${args.noCloseOnOutsideClick}\"\n no-close-on-menu-click=\"${args.noCloseOnOutsideClick}\"\n no-append-to-body=\"${args.noAppendToBody}\">\n <ifx-dropdown-trigger-button variant=\"${args.variant}\">\n ${args.label}\n </ifx-dropdown-trigger-button>\n <ifx-dropdown-menu size=\"${args.size}\">\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n <ifx-dropdown-separator></ifx-dropdown-separator>\n <ifx-dropdown-item icon=\"${args.icon === 'none' ? '' : args.icon}\" target=\"${args.target}\" href=\"${args.href !== '' ? args.href : ''}\">Menu Item</ifx-dropdown-item>\n </ifx-dropdown-menu>\n</ifx-dropdown>`;\n\n const dropdown = wrapper.querySelector('ifx-dropdown') as HTMLElement;\n const dropdownMenu = dropdown.querySelector('ifx-dropdown-menu');\n\n dropdown.addEventListener('ifxOpen', action('ifxOpen'));\n dropdown.addEventListener('ifxClose', action('ifxClose'));\n dropdownMenu.addEventListener('ifxDropdownMenuItem', action('ifxDropdownMenuItem'));\n\n return wrapper;\n}\n\nexport const Separator = SeparatorTemplate.bind({});\n\n"]}
|
@@ -12,12 +12,9 @@ export default {
|
|
12
12
|
argTypes: {
|
13
13
|
label: {
|
14
14
|
name: 'Label of Link',
|
15
|
-
description: '
|
15
|
+
description: 'Set the label of *<ifx-link>*.',
|
16
16
|
table: {
|
17
17
|
category: 'story controls',
|
18
|
-
type: {
|
19
|
-
summary: '<ifx-link> `label` </ifx-link>'
|
20
|
-
}
|
21
18
|
}
|
22
19
|
},
|
23
20
|
href: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"link.stories.js","sourceRoot":"","sources":["../../../src/components/link/link.stories.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,MAAM;KAChB;IAED,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"link.stories.js","sourceRoot":"","sources":["../../../src/components/link/link.stories.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,UAAU,CAAC;IAElB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,EA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OAAO,EAAE,MAAM,CAAC;YAChD,KAAK,EAAE;gBACL,QAAQ,EAAE,gBAAgB;gBAC1B,YAAY,EAAE;oBACZ,OAAO,EAAE,MAAM;iBAChB;aACF;SACF;KACF;CACF,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,EAAE,CAC7B,mBAAmB,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,MAAM,WAAW,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC,OAAO,eAAe,IAAI,CAAC,QAAQ;IAC5H,IAAI,CAAC,KAAK;cACA,CAAC;AAEf,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEhD,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAC9B,mBAAmB,IAAI,CAAC,IAAI,aAAa,IAAI,CAAC,MAAM,WAAW,IAAI,CAAC,IAAI,cAAc,IAAI,CAAC,OAAO;IAChG,IAAI,CAAC,KAAK;;cAEA,CAAC;AAEf,MAAM,CAAC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["export default {\n title: 'Components/Link',\n tags: ['autodocs'],\n\n args: {\n label: 'Link',\n href: '',\n target: '_blank',\n size: 'm',\n disabled: false,\n variant: 'bold',\n },\n\n argTypes: {\n label: {\n name: 'Label of Link',\n description: 'Set the label of *<ifx-link>*.',\n table: {\n category: 'story controls',\n }\n },\n href: {\n description: 'Specifies the URL of the link.',\n table: {\n category: 'ifx-link props',\n type: {\n summary: 'string'\n }\n }\n },\n target: {\n description: 'Determines where to open the linked URL when the link is clicked.',\n control: 'radio',\n options: ['_blank', '_self', '_parent'],\n table: {\n category: 'ifx-link props',\n defaultValue: {\n summary: '_blank'\n }\n }\n },\n disabled: {\n description: 'Disables the link.',\n control: 'boolean',\n table: {\n category: 'ifx-link props',\n defaultValue: {\n summary: 'false'\n }\n }\n },\n size: {\n description: 'Sets the Font Size of the link. Options: s (14px), m (16px), l (18px), xl (20px)',\n control: 'radio',\n options: ['s', 'm', 'l', 'xl'],\n table: {\n category: 'ifx-link props',\n defaultValue: {\n summary: 'm'\n },\n type: {\n summary: 's | m | l | xl'\n }\n }\n },\n variant: {\n description: 'Sets the style variant of the link.',\n control: 'radio',\n options: ['bold', 'underlined', 'title', 'menu'],\n table: {\n category: 'ifx-link props',\n defaultValue: {\n summary: 'bold'\n }\n }\n },\n },\n};\n\nconst DefaultTemplate = args =>\n `<ifx-link href=\"${args.href}\" target=\"${args.target}\" size=\"${args.size}\" variant=\"${args.variant}\" disabled=\"${args.disabled}\" >\n ${args.label}\n </ifx-link>`;\n\nexport const Default = DefaultTemplate.bind({});\n\nconst TemplateWithIcon = args =>\n `<ifx-link href=\"${args.href}\" target=\"${args.target}\" size=\"${args.size}\" variant=\"${args.variant}\" >\n ${args.label}\n <ifx-icon icon=\"arrow-right-16\"></ifx-icon>\n </ifx-link>`;\n\nexport const WithIcon = TemplateWithIcon.bind({});\n"]}
|
@@ -23,9 +23,9 @@ export default {
|
|
23
23
|
},
|
24
24
|
argTypes: {
|
25
25
|
profileLabel: {
|
26
|
-
name: 'Label',
|
26
|
+
name: 'Label of Profile',
|
27
27
|
control: { type: 'text' },
|
28
|
-
description: '
|
28
|
+
description: 'Set the label of *<ifx-navbar-profile>*.',
|
29
29
|
table: {
|
30
30
|
category: 'story controls',
|
31
31
|
},
|
@@ -183,45 +183,18 @@ export default {
|
|
183
183
|
},
|
184
184
|
},
|
185
185
|
searchBarPosition: {
|
186
|
-
|
186
|
+
name: 'search-bar-',
|
187
|
+
description: 'The position of the search-bar within the Navbar as specified in the slot name.',
|
187
188
|
options: ['left', 'right'],
|
188
189
|
control: { type: 'radio' },
|
189
190
|
table: {
|
190
191
|
defaultValue: { summary: 'left' },
|
191
|
-
category: 'ifx-search-bar
|
192
|
+
category: 'ifx-search-bar-slot',
|
192
193
|
type: {
|
193
194
|
summary: 'left | right',
|
194
195
|
},
|
195
196
|
},
|
196
197
|
},
|
197
|
-
ifxNavbarMobileMenuIsOpen: {
|
198
|
-
action: 'ifxNavbarMobileMenuIsOpen',
|
199
|
-
description: 'Event emitted when the mobile menu is opened.',
|
200
|
-
table: {
|
201
|
-
category: 'custom events',
|
202
|
-
type: {
|
203
|
-
summary: 'Framework integration',
|
204
|
-
detail: `React: onifxNavbarMobileMenuIsOpen={handleOpen}
|
205
|
-
Vue: @ifxNavbarMobileMenuIsOpen="handleOpen"
|
206
|
-
Angular: (ifxNavbarMobileMenuIsOpen)="handleOpen()"
|
207
|
-
VanillaJs: .addEventListener("ifxNavbarMobileMenuIsOpen", (event) => {/*handle open*/});`
|
208
|
-
},
|
209
|
-
},
|
210
|
-
},
|
211
|
-
ifxNavItem: {
|
212
|
-
action: 'ifxNavItem',
|
213
|
-
description: 'Event emitted when a navbar item is clicked.',
|
214
|
-
table: {
|
215
|
-
category: 'custom events',
|
216
|
-
type: {
|
217
|
-
summary: 'Framework integration',
|
218
|
-
detail: `React: onifxNavItem={handleClick}
|
219
|
-
Vue: @ifxNavItem="handleClick"
|
220
|
-
Angular: (ifxNavItem)="handleClick()"
|
221
|
-
VanillaJs: .addEventListener("ifxNavItem", (event) => {/*handle click*/});`
|
222
|
-
},
|
223
|
-
},
|
224
|
-
},
|
225
198
|
},
|
226
199
|
};
|
227
200
|
const DefaultTemplate = args => `<ifx-navbar show-logo-and-appname="${args.showLogoAndAppname}" application-name="${args.applicationName}" fixed="${args.navbarPositionFixed}" logo-href="${args.logoHref}" logo-href-target="${args.logoHrefTarget}">
|