@infineon/infineon-design-system-stencil 35.0.0--canary.1896.f36a40bc0d982c4500e7faefcf706a95e2eb4507.0 → 35.0.0--canary.1896.5e3c0f0ec2f461ac1cddbfc154df175c0737d94c.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-overview-table.cjs.entry.js +1 -1
- package/dist/cjs/ifx-overview-table.cjs.entry.js.map +1 -1
- package/dist/collection/components/modal/modal.stories.js +1 -1
- package/dist/collection/components/modal/modal.stories.js.map +1 -1
- package/dist/collection/components/overview-table/overview-table.js +1 -1
- package/dist/collection/components/overview-table/overview-table.js.map +1 -1
- package/dist/components/ifx-overview-table.js +1 -1
- package/dist/components/ifx-overview-table.js.map +1 -1
- package/dist/esm/ifx-overview-table.entry.js +1 -1
- package/dist/esm/ifx-overview-table.entry.js.map +1 -1
- package/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js +1 -1
- package/dist/infineon-design-system-stencil/{p-813f56d7.entry.js → p-d63456d5.entry.js} +2 -2
- package/dist/infineon-design-system-stencil/{p-813f56d7.entry.js.map → p-d63456d5.entry.js.map} +1 -1
- package/package.json +1 -1
@@ -204,7 +204,7 @@ export const Alert = Template.bind({});
|
|
204
204
|
Alert.args = {
|
205
205
|
caption: 'Alert-Brand Modal Title',
|
206
206
|
closeOnOverlayClick: true,
|
207
|
-
alertIcon: '
|
207
|
+
alertIcon: 'arrowdoen16',
|
208
208
|
size: 's',
|
209
209
|
variant: 'alert-brand',
|
210
210
|
cancelButtonLabel: 'Cancel',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modal.stories.js","sourceRoot":"","sources":["../../../src/components/modal/modal.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,kBAAkB;IAC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IAAI,CAAC;QACtB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnD,YAAY,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAChC,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAErC,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE,aAAa;IACtB,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,KAAK;IAC1B,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,SAAS;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACX,OAAO,EAAE,yBAAyB;IAClC,mBAAmB,EAAE,IAAI;IACzB,SAAS,EAAE,aAAa;IACxB,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,aAAa;IACtB,iBAAiB,EAAE,QAAQ;IAC3B,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,KAAK;CACvB,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Modal',\n component: 'ifx-modal',\n // tags: ['autodocs'],\n\n args: {\n opened: false,\n cancelButtonLabel: 'Cancel',\n okButtonLabel: 'OK',\n },\n argTypes: {\n caption: {\n control: 'text',\n description: 'Title for the modal.',\n table: {\n category: 'ifx-modal props',\n },\n },\n opened: {\n control: {\n disable: true,\n },\n description: 'Default state of the modal.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'false',\n },\n type: {\n summary: 'Example (in VanillaJs)',\n detail:\n \"const modal = document.getElementById('modal'); \\nconst openButton = document.getElementById('open'); \\n//add DOM event listeners (e.g. click and/or keypress)\\n\\nfunction openModal() { \\nmodal.opened=true;\\n\\nfunction closeModal() { \\nmodal.opened = false; \\n}\",\n },\n },\n },\n closeOnOverlayClick: {\n control: 'boolean',\n description: 'Close the modal when clicking outside the window.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'false',\n }\n }\n },\n showCloseButton: {\n control: 'boolean',\n description: \"Show or hide close button in the modal's header.\",\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'true',\n },\n },\n },\n alertIcon: {\n options: Object.keys(icons),\n control: { type: 'select' },\n description: 'Icon to be displayed in the alert modal.',\n table: {\n category: 'ifx-modal props',\n type: {\n summary: 'string',\n },\n },\n },\n size: {\n options: ['s', 'm', 'l'],\n control: { type: 'radio' },\n description: 'Usable only when screen width is more than 1024px.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 's',\n },\n type: {\n summary: 's | m | l',\n }\n }\n },\n variant: {\n options: ['default', 'alert-brand', 'alert-danger'],\n control: { type: 'radio' },\n description: 'Variant of the modal.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'default',\n },\n type: {\n summary: 'default | alert-brand | alert-danger',\n },\n },\n },\n cancelButtonLabel: {\n control: 'text',\n description: 'Label for the cancel button.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'Cancel',\n },\n type: {\n summary: 'string',\n },\n },\n },\n okButtonLabel: {\n control: 'text',\n description: 'Label for the OK button.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'OK',\n },\n type: {\n summary: 'string',\n },\n },\n },\n\n ifxOpen: {\n action: 'ifxOpen',\n description: 'Custom event emitted when modal 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 modal 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 },\n};\n\nconst Template = ({ caption, showCloseButton, closeOnOverlayClick, variant, size, alertIcon, cancelButtonLabel, okButtonLabel }) => {\n const modal = document.createElement('ifx-modal');\n modal.setAttribute('caption', caption);\n modal.setAttribute('variant', variant);\n\n if (alertIcon) {\n modal.setAttribute('alert-icon', alertIcon);\n }\n modal.setAttribute('close-on-overlay-click', closeOnOverlayClick);\n modal.setAttribute('show-close-button', showCloseButton);\n modal.setAttribute('size', size)\n\n modal.addEventListener('ifxOpen', action('ifxOpen'));\n modal.addEventListener('ifxClose', action('ifxClose'));\n\n const content = document.createElement('div');\n content.setAttribute('slot', 'content');\n content.innerHTML = `\n <span>Modal content</span>\n `;\n modal.appendChild(content);\n const buttons = document.createElement('div');\n buttons.setAttribute('slot', 'buttons');\n\n const cancelButton = document.createElement('ifx-button');\n cancelButton.setAttribute('variant', 'secondary');\n cancelButton.textContent = cancelButtonLabel;\n cancelButton.addEventListener('click', () => {\n console.log('Button 1 clicked');\n });\n\n const primaryButton = document.createElement('ifx-button');\n primaryButton.textContent = okButtonLabel;\n primaryButton.addEventListener('click', () => {\n console.log('Button 2 clicked');\n });\n\n buttons.appendChild(cancelButton);\n buttons.appendChild(primaryButton);\n modal.appendChild(buttons);\n\n const openButton = document.createElement('ifx-button');\n openButton.id = 'open';\n openButton.textContent = 'Open Modal';\n openButton.addEventListener('click', () => {\n modal.opened = true;\n });\n openButton.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n modal.opened = true;\n }\n });\n\n const storyElement = document.createElement('div');\n storyElement.appendChild(modal);\n storyElement.appendChild(openButton);\n\n return storyElement;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n caption: 'Modal Title',\n showCloseButton: true,\n closeOnOverlayClick: false,\n size: 's',\n variant: 'default',\n};\n\nexport const Alert = Template.bind({});\nAlert.args = {\n caption: 'Alert-Brand Modal Title',\n closeOnOverlayClick: true,\n alertIcon: 'arrowdoen24',\n size: 's',\n variant: 'alert-brand',\n cancelButtonLabel: 'Cancel',\n okButtonLabel: 'OK',\n showCloseButton: false,\n};\n"]}
|
1
|
+
{"version":3,"file":"modal.stories.js","sourceRoot":"","sources":["../../../src/components/modal/modal.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,kBAAkB;IACzB,SAAS,EAAE,WAAW;IACtB,sBAAsB;IAEtB,IAAI,EAAE;QACJ,MAAM,EAAE,KAAK;QACb,iBAAiB,EAAE,QAAQ;QAC3B,aAAa,EAAE,IAAI;KACpB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,sBAAsB;YACnC,KAAK,EAAE;gBACL,QAAQ,EAAE,iBAAiB;aAC5B;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,OAAO,EAAE,IAAI;aACd;YACD,WAAW,EAAE,6BAA6B;YAC1C,KAAK,EAAE;gBACL,QAAQ,EAAE,iBAAiB;gBAC3B,YAAY,EAAE;oBACZ,OAAO,EAAE,OAAO;iBACjB;gBACD,IAAI,EAAE;oBACJ,OAAO,EAAE,wBAAwB;oBACjC,MAAM,EACJ,sQAAsQ;iBACzQ;aACF;SACF;QACD,mBAAmB,EAAE;YACnB,OAAO,EAAE,SAAS;YAClB,WAAW,EAAE,mDAAmD;YAChE,KAAK,EAAE;gBACL,QAAQ,EAAE,iBAAiB;gBAC3B,YAAY,EAAE;oBACZ,OAAO,EAAE,OAAO;iBACjB;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;IACtB,iBAAiB,EAAE,QAAQ;IAC3B,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,KAAK;CACvB,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport { icons } from '@infineon/infineon-icons';\n\nexport default {\n title: 'Components/Modal',\n component: 'ifx-modal',\n // tags: ['autodocs'],\n\n args: {\n opened: false,\n cancelButtonLabel: 'Cancel',\n okButtonLabel: 'OK',\n },\n argTypes: {\n caption: {\n control: 'text',\n description: 'Title for the modal.',\n table: {\n category: 'ifx-modal props',\n },\n },\n opened: {\n control: {\n disable: true,\n },\n description: 'Default state of the modal.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'false',\n },\n type: {\n summary: 'Example (in VanillaJs)',\n detail:\n \"const modal = document.getElementById('modal'); \\nconst openButton = document.getElementById('open'); \\n//add DOM event listeners (e.g. click and/or keypress)\\n\\nfunction openModal() { \\nmodal.opened=true;\\n\\nfunction closeModal() { \\nmodal.opened = false; \\n}\",\n },\n },\n },\n closeOnOverlayClick: {\n control: 'boolean',\n description: 'Close the modal when clicking outside the window.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'false',\n }\n }\n },\n showCloseButton: {\n control: 'boolean',\n description: \"Show or hide close button in the modal's header.\",\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'true',\n },\n },\n },\n alertIcon: {\n options: Object.keys(icons),\n control: { type: 'select' },\n description: 'Icon to be displayed in the alert modal.',\n table: {\n category: 'ifx-modal props',\n type: {\n summary: 'string',\n },\n },\n },\n size: {\n options: ['s', 'm', 'l'],\n control: { type: 'radio' },\n description: 'Usable only when screen width is more than 1024px.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 's',\n },\n type: {\n summary: 's | m | l',\n }\n }\n },\n variant: {\n options: ['default', 'alert-brand', 'alert-danger'],\n control: { type: 'radio' },\n description: 'Variant of the modal.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'default',\n },\n type: {\n summary: 'default | alert-brand | alert-danger',\n },\n },\n },\n cancelButtonLabel: {\n control: 'text',\n description: 'Label for the cancel button.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'Cancel',\n },\n type: {\n summary: 'string',\n },\n },\n },\n okButtonLabel: {\n control: 'text',\n description: 'Label for the OK button.',\n table: {\n category: 'ifx-modal props',\n defaultValue: {\n summary: 'OK',\n },\n type: {\n summary: 'string',\n },\n },\n },\n\n ifxOpen: {\n action: 'ifxOpen',\n description: 'Custom event emitted when modal 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 modal 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 },\n};\n\nconst Template = ({ caption, showCloseButton, closeOnOverlayClick, variant, size, alertIcon, cancelButtonLabel, okButtonLabel }) => {\n const modal = document.createElement('ifx-modal');\n modal.setAttribute('caption', caption);\n modal.setAttribute('variant', variant);\n\n if (alertIcon) {\n modal.setAttribute('alert-icon', alertIcon);\n }\n modal.setAttribute('close-on-overlay-click', closeOnOverlayClick);\n modal.setAttribute('show-close-button', showCloseButton);\n modal.setAttribute('size', size)\n\n modal.addEventListener('ifxOpen', action('ifxOpen'));\n modal.addEventListener('ifxClose', action('ifxClose'));\n\n const content = document.createElement('div');\n content.setAttribute('slot', 'content');\n content.innerHTML = `\n <span>Modal content</span>\n `;\n modal.appendChild(content);\n const buttons = document.createElement('div');\n buttons.setAttribute('slot', 'buttons');\n\n const cancelButton = document.createElement('ifx-button');\n cancelButton.setAttribute('variant', 'secondary');\n cancelButton.textContent = cancelButtonLabel;\n cancelButton.addEventListener('click', () => {\n console.log('Button 1 clicked');\n });\n\n const primaryButton = document.createElement('ifx-button');\n primaryButton.textContent = okButtonLabel;\n primaryButton.addEventListener('click', () => {\n console.log('Button 2 clicked');\n });\n\n buttons.appendChild(cancelButton);\n buttons.appendChild(primaryButton);\n modal.appendChild(buttons);\n\n const openButton = document.createElement('ifx-button');\n openButton.id = 'open';\n openButton.textContent = 'Open Modal';\n openButton.addEventListener('click', () => {\n modal.opened = true;\n });\n openButton.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n modal.opened = true;\n }\n });\n\n const storyElement = document.createElement('div');\n storyElement.appendChild(modal);\n storyElement.appendChild(openButton);\n\n return storyElement;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n caption: 'Modal Title',\n showCloseButton: true,\n closeOnOverlayClick: false,\n size: 's',\n variant: 'default',\n};\n\nexport const Alert = Template.bind({});\nAlert.args = {\n caption: 'Alert-Brand Modal Title',\n closeOnOverlayClick: true,\n alertIcon: 'arrowdoen16',\n size: 's',\n variant: 'alert-brand',\n cancelButtonLabel: 'Cancel',\n okButtonLabel: 'OK',\n showCloseButton: false,\n};\n"]}
|