@mozaic-ds/web-components 1.0.0-beta.7 → 1.0.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/README.md +36 -68
- package/dist/Cross20.js +1 -1
- package/dist/Cross20.js.map +1 -1
- package/dist/Cross24.js +1 -1
- package/dist/CrossCircleFilled24.js +1 -1
- package/dist/attributes.js +1 -1
- package/dist/attributes.js.map +1 -1
- package/dist/bundle.d.ts +24 -23
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +24 -23
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/Avatar.spec.js +17 -0
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +3 -29
- package/dist/components/avatar/Avatar.svelte +2 -0
- package/dist/components/avatar/Avatar.svelte.d.ts +2 -0
- package/dist/components/avatar/Avatar.svelte.d.ts.map +1 -1
- package/dist/components/avatar/README.md +16 -0
- package/dist/components/breadcrumb/Breadcrumb.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.spec.js +42 -0
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.js +6 -35
- package/dist/components/breadcrumb/Breadcrumb.svelte +11 -16
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/components/breadcrumb/README.md +11 -0
- package/dist/components/button/Button.js +2 -2
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.spec.js +74 -0
- package/dist/components/button/Button.stories.d.ts +9 -13
- package/dist/components/button/Button.stories.d.ts.map +1 -1
- package/dist/components/button/Button.stories.js +46 -146
- package/dist/components/button/Button.svelte +70 -53
- package/dist/components/button/Button.svelte.d.ts +36 -8
- package/dist/components/button/Button.svelte.d.ts.map +1 -1
- package/dist/components/button/README.md +26 -0
- package/dist/components/callout/Callout.js +1 -1
- package/dist/components/callout/Callout.js.map +1 -1
- package/dist/components/callout/Callout.spec.js +33 -0
- package/dist/components/callout/Callout.stories.d.ts.map +1 -1
- package/dist/components/callout/Callout.stories.js +2 -55
- package/dist/components/callout/Callout.svelte +4 -0
- package/dist/components/callout/Callout.svelte.d.ts +4 -0
- package/dist/components/callout/Callout.svelte.d.ts.map +1 -1
- package/dist/components/callout/README.md +20 -0
- package/dist/components/checkbox/Checkbox.js +3 -3
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.spec.js +70 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts +11 -16
- package/dist/components/checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.stories.js +67 -124
- package/dist/components/checkbox/Checkbox.svelte +42 -22
- package/dist/components/checkbox/Checkbox.svelte.d.ts +31 -6
- package/dist/components/checkbox/Checkbox.svelte.d.ts.map +1 -1
- package/dist/components/checkbox/README.md +17 -0
- package/dist/components/checkboxgroup/CheckboxGroup.js +3 -3
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.spec.js +113 -0
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts +5 -13
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.js +56 -140
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +56 -45
- package/dist/components/checkboxgroup/CheckboxGroup.svelte.d.ts +30 -6
- package/dist/components/checkboxgroup/CheckboxGroup.svelte.d.ts.map +1 -1
- package/dist/components/checkboxgroup/README.md +14 -0
- package/dist/components/circularprogressbar/CircularProgressbar.js +2 -2
- package/dist/components/circularprogressbar/CircularProgressbar.js.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.spec.js +74 -0
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts +6 -6
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.stories.js +29 -68
- package/dist/components/circularprogressbar/CircularProgressbar.svelte +25 -6
- package/dist/components/circularprogressbar/CircularProgressbar.svelte.d.ts +18 -0
- package/dist/components/circularprogressbar/CircularProgressbar.svelte.d.ts.map +1 -1
- package/dist/components/circularprogressbar/README.md +14 -0
- package/dist/components/datepicker/Datepicker.js +3 -3
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/Datepicker.spec.js +95 -0
- package/dist/components/datepicker/Datepicker.stories.d.ts +7 -6
- package/dist/components/datepicker/Datepicker.stories.d.ts.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.js +58 -75
- package/dist/components/datepicker/Datepicker.svelte +48 -25
- package/dist/components/datepicker/Datepicker.svelte.d.ts +30 -1
- package/dist/components/datepicker/Datepicker.svelte.d.ts.map +1 -1
- package/dist/components/datepicker/README.md +18 -0
- package/dist/components/drawer/Drawer.js +2 -2
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.spec.js +101 -0
- package/dist/components/drawer/Drawer.stories.d.ts +29 -8
- package/dist/components/drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.stories.js +86 -87
- package/dist/components/drawer/Drawer.svelte +61 -38
- package/dist/components/drawer/Drawer.svelte.d.ts +26 -3
- package/dist/components/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/drawer/README.md +29 -0
- package/dist/components/field/Field.js +2 -2
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/field/Field.spec.js +51 -0
- package/dist/components/field/Field.stories.d.ts +9 -15
- package/dist/components/field/Field.stories.d.ts.map +1 -1
- package/dist/components/field/Field.stories.js +86 -142
- package/dist/components/field/Field.svelte +48 -12
- package/dist/components/field/Field.svelte.d.ts +38 -7
- package/dist/components/field/Field.svelte.d.ts.map +1 -1
- package/dist/components/field/README.md +24 -0
- package/dist/components/flag/Flag.js +2 -2
- package/dist/components/flag/Flag.js.map +1 -1
- package/dist/components/flag/Flag.spec.js +30 -0
- package/dist/components/flag/Flag.stories.d.ts +8 -18
- package/dist/components/flag/Flag.stories.d.ts.map +1 -1
- package/dist/components/flag/Flag.stories.js +28 -106
- package/dist/components/flag/Flag.svelte +11 -9
- package/dist/components/flag/Flag.svelte.d.ts +10 -28
- package/dist/components/flag/Flag.svelte.d.ts.map +1 -1
- package/dist/components/flag/README.md +11 -0
- package/dist/components/iconbutton/IconButton.js +2 -2
- package/dist/components/iconbutton/IconButton.js.map +1 -1
- package/dist/components/iconbutton/IconButton.stories.d.ts +11 -11
- package/dist/components/iconbutton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/iconbutton/IconButton.stories.js +51 -67
- package/dist/components/iconbutton/IconButton.svelte +41 -37
- package/dist/components/iconbutton/IconButton.svelte.d.ts +28 -7
- package/dist/components/iconbutton/IconButton.svelte.d.ts.map +1 -1
- package/dist/components/iconbutton/README.md +21 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js +2 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.spec.js +28 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts +5 -7
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.js +18 -49
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte +15 -5
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte.d.ts +10 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte.d.ts.map +1 -1
- package/dist/components/linearprogressbarbuffer/README.md +11 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js +2 -2
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.spec.js +26 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts +4 -5
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.js +15 -33
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte +6 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte.d.ts +6 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte.d.ts.map +1 -1
- package/dist/components/linearprogressbarpercentage/README.md +10 -0
- package/dist/components/link/Link.js +2 -2
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/link/Link.spec.js +51 -0
- package/dist/components/link/Link.stories.d.ts +12 -12
- package/dist/components/link/Link.stories.d.ts.map +1 -1
- package/dist/components/link/Link.stories.js +61 -74
- package/dist/components/link/Link.svelte +45 -40
- package/dist/components/link/Link.svelte.d.ts +29 -8
- package/dist/components/link/Link.svelte.d.ts.map +1 -1
- package/dist/components/link/README.md +23 -0
- package/dist/components/loader/Loader.js +2 -2
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/loader/Loader.spec.js +54 -0
- package/dist/components/loader/Loader.stories.d.ts +8 -10
- package/dist/components/loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/loader/Loader.stories.js +27 -43
- package/dist/components/loader/Loader.svelte +31 -31
- package/dist/components/loader/Loader.svelte.d.ts +14 -3
- package/dist/components/loader/Loader.svelte.d.ts.map +1 -1
- package/dist/components/loader/README.md +12 -0
- package/dist/components/loadingoverlay/LoadingOverlay.js +4 -0
- package/dist/components/loadingoverlay/LoadingOverlay.js.map +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.spec.js +38 -0
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts +7 -0
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts.map +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.stories.js +39 -0
- package/dist/components/loadingoverlay/LoadingOverlay.svelte +50 -0
- package/dist/components/loadingoverlay/LoadingOverlay.svelte.d.ts +17 -0
- package/dist/components/loadingoverlay/LoadingOverlay.svelte.d.ts.map +1 -0
- package/dist/components/loadingoverlay/README.md +11 -0
- package/dist/components/modal/Modal.js +2 -2
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.spec.js +50 -0
- package/dist/components/modal/Modal.stories.d.ts +36 -9
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +54 -83
- package/dist/components/modal/Modal.svelte +42 -41
- package/dist/components/modal/Modal.svelte.d.ts +22 -5
- package/dist/components/modal/Modal.svelte.d.ts.map +1 -1
- package/dist/components/modal/README.md +28 -0
- package/dist/components/numberbadge/NumberBadge.js +2 -2
- package/dist/components/numberbadge/NumberBadge.js.map +1 -1
- package/dist/components/numberbadge/NumberBadge.spec.js +28 -0
- package/dist/components/numberbadge/NumberBadge.stories.d.ts +9 -13
- package/dist/components/numberbadge/NumberBadge.stories.d.ts.map +1 -1
- package/dist/components/numberbadge/NumberBadge.stories.js +28 -56
- package/dist/components/numberbadge/NumberBadge.svelte +24 -20
- package/dist/components/numberbadge/NumberBadge.svelte.d.ts +15 -4
- package/dist/components/numberbadge/NumberBadge.svelte.d.ts.map +1 -1
- package/dist/components/numberbadge/README.md +12 -0
- package/dist/components/overlay/Overlay.js +2 -2
- package/dist/components/overlay/Overlay.js.map +1 -1
- package/dist/components/overlay/Overlay.spec.js +29 -0
- package/dist/components/overlay/Overlay.stories.d.ts +5 -7
- package/dist/components/overlay/Overlay.stories.d.ts.map +1 -1
- package/dist/components/overlay/Overlay.stories.js +32 -40
- package/dist/components/overlay/Overlay.svelte +14 -4
- package/dist/components/overlay/Overlay.svelte.d.ts +11 -0
- package/dist/components/overlay/Overlay.svelte.d.ts.map +1 -1
- package/dist/components/overlay/README.md +17 -0
- package/dist/components/pagination/Pagination.js +6 -6
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/Pagination.spec.js +65 -0
- package/dist/components/pagination/Pagination.stories.d.ts +8 -11
- package/dist/components/pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.stories.js +37 -91
- package/dist/components/pagination/Pagination.svelte +33 -12
- package/dist/components/pagination/Pagination.svelte.d.ts +27 -4
- package/dist/components/pagination/Pagination.svelte.d.ts.map +1 -1
- package/dist/components/pagination/README.md +16 -0
- package/dist/components/passwordinput/PasswordInput.js +3 -4
- package/dist/components/passwordinput/PasswordInput.js.map +1 -1
- package/dist/components/passwordinput/PasswordInput.spec.js +84 -0
- package/dist/components/passwordinput/PasswordInput.stories.d.ts +10 -13
- package/dist/components/passwordinput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.js +67 -124
- package/dist/components/passwordinput/PasswordInput.svelte +387 -24
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts +34 -2
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/components/passwordinput/README.md +19 -0
- package/dist/components/pincode/Pincode.js +2 -2
- package/dist/components/pincode/Pincode.js.map +1 -1
- package/dist/components/pincode/Pincode.spec.js +99 -0
- package/dist/components/pincode/Pincode.stories.d.ts +9 -13
- package/dist/components/pincode/Pincode.stories.d.ts.map +1 -1
- package/dist/components/pincode/Pincode.stories.js +62 -127
- package/dist/components/pincode/Pincode.svelte +56 -41
- package/dist/components/pincode/Pincode.svelte.d.ts +30 -24
- package/dist/components/pincode/Pincode.svelte.d.ts.map +1 -1
- package/dist/components/pincode/README.md +22 -0
- package/dist/components/quantityselector/QuantitySelector.js +2 -2
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.spec.js +104 -0
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts +11 -15
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +77 -145
- package/dist/components/quantityselector/QuantitySelector.svelte +100 -77
- package/dist/components/quantityselector/QuantitySelector.svelte.d.ts +49 -17
- package/dist/components/quantityselector/QuantitySelector.svelte.d.ts.map +1 -1
- package/dist/components/quantityselector/README.md +21 -0
- package/dist/components/radio/README.md +15 -0
- package/dist/components/radio/Radio.js +2 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/Radio.spec.js +60 -0
- package/dist/components/radio/Radio.stories.d.ts +9 -13
- package/dist/components/radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/radio/Radio.stories.js +54 -70
- package/dist/components/radio/Radio.svelte +42 -20
- package/dist/components/radio/Radio.svelte.d.ts +27 -5
- package/dist/components/radio/Radio.svelte.d.ts.map +1 -1
- package/dist/components/radiogroup/README.md +14 -0
- package/dist/components/radiogroup/RadioGroup.js +3 -3
- package/dist/components/radiogroup/RadioGroup.js.map +1 -1
- package/dist/components/radiogroup/RadioGroup.spec.js +65 -0
- package/dist/components/radiogroup/RadioGroup.stories.d.ts +5 -12
- package/dist/components/radiogroup/RadioGroup.stories.d.ts.map +1 -1
- package/dist/components/radiogroup/RadioGroup.stories.js +56 -151
- package/dist/components/radiogroup/RadioGroup.svelte +50 -43
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts +28 -9
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts.map +1 -1
- package/dist/components/select/README.md +18 -0
- package/dist/components/select/Select.js +2 -2
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.spec.js +76 -0
- package/dist/components/select/Select.stories.d.ts +10 -14
- package/dist/components/select/Select.stories.d.ts.map +1 -1
- package/dist/components/select/Select.stories.js +87 -92
- package/dist/components/select/Select.svelte +57 -44
- package/dist/components/select/Select.svelte.d.ts +41 -10
- package/dist/components/select/Select.svelte.d.ts.map +1 -1
- package/dist/components/statusbadge/README.md +11 -0
- package/dist/components/statusbadge/StatusBadge.js +2 -2
- package/dist/components/statusbadge/StatusBadge.js.map +1 -1
- package/dist/components/statusbadge/StatusBadge.spec.js +31 -0
- package/dist/components/statusbadge/StatusBadge.stories.d.ts +9 -12
- package/dist/components/statusbadge/StatusBadge.stories.d.ts.map +1 -1
- package/dist/components/statusbadge/StatusBadge.stories.js +21 -44
- package/dist/components/statusbadge/StatusBadge.svelte +14 -6
- package/dist/components/statusbadge/StatusBadge.svelte.d.ts +13 -28
- package/dist/components/statusbadge/StatusBadge.svelte.d.ts.map +1 -1
- package/dist/components/statusdot/README.md +11 -0
- package/dist/components/statusdot/StatusDot.js +2 -2
- package/dist/components/statusdot/StatusDot.js.map +1 -1
- package/dist/components/statusdot/StatusDot.spec.js +42 -0
- package/dist/components/statusdot/StatusDot.stories.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.js +9 -37
- package/dist/components/statusdot/StatusDot.svelte +9 -7
- package/dist/components/statusdot/StatusDot.svelte.d.ts +2 -2
- package/dist/components/statusdot/StatusDot.svelte.d.ts.map +1 -1
- package/dist/components/statusnotification/README.md +25 -0
- package/dist/components/statusnotification/StatusNotification.js +3 -3
- package/dist/components/statusnotification/StatusNotification.js.map +1 -1
- package/dist/components/statusnotification/StatusNotification.spec.js +54 -0
- package/dist/components/statusnotification/StatusNotification.stories.d.ts +16 -14
- package/dist/components/statusnotification/StatusNotification.stories.d.ts.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.js +53 -86
- package/dist/components/statusnotification/StatusNotification.svelte +49 -51
- package/dist/components/statusnotification/StatusNotification.svelte.d.ts +21 -18
- package/dist/components/statusnotification/StatusNotification.svelte.d.ts.map +1 -1
- package/dist/components/tab/README.md +20 -0
- package/dist/components/tab/Tab.js +4 -0
- package/dist/components/tab/Tab.js.map +1 -0
- package/dist/components/tab/Tab.spec.js +58 -0
- package/dist/components/{tabs → tab}/Tab.svelte +46 -26
- package/dist/components/{tabs → tab}/Tab.svelte.d.ts +20 -3
- package/dist/components/tab/Tab.svelte.d.ts.map +1 -0
- package/dist/components/tabs/README.md +18 -0
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/Tabs.spec.js +51 -0
- package/dist/components/tabs/Tabs.stories.d.ts +9 -6
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +59 -115
- package/dist/components/tabs/Tabs.svelte +27 -7
- package/dist/components/tabs/Tabs.svelte.d.ts +21 -7
- package/dist/components/tabs/Tabs.svelte.d.ts.map +1 -1
- package/dist/components/tags/README.md +9 -0
- package/dist/components/tags/Tag.js +1 -1
- package/dist/components/tags/TagContextualised.js +2 -2
- package/dist/components/tags/TagInteractive.js +1 -1
- package/dist/components/tags/TagRemovable.js +2 -2
- package/dist/components/tags/TagSelectable.js +2 -2
- package/dist/components/tags/Tags.stories.d.ts.map +1 -1
- package/dist/components/tags/Tags.stories.js +7 -1
- package/dist/components/tags/TagsContextualised.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsContextualised.stories.js +7 -1
- package/dist/components/tags/TagsInteractive.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsInteractive.stories.js +7 -1
- package/dist/components/tags/TagsRemovable.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsRemovable.stories.js +7 -1
- package/dist/components/tags/TagsSelectable.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsSelectable.stories.js +7 -1
- package/dist/components/textarea/README.md +19 -0
- package/dist/components/textarea/Textarea.js +2 -5
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/Textarea.spec.js +67 -0
- package/dist/components/textarea/Textarea.stories.d.ts +9 -13
- package/dist/components/textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.stories.js +61 -92
- package/dist/components/textarea/Textarea.svelte +53 -97
- package/dist/components/textarea/Textarea.svelte.d.ts +43 -13
- package/dist/components/textarea/Textarea.svelte.d.ts.map +1 -1
- package/dist/components/textinput/README.md +26 -0
- package/dist/components/textinput/Textinput.js +2 -2
- package/dist/components/textinput/Textinput.js.map +1 -1
- package/dist/components/textinput/Textinput.spec.js +89 -0
- package/dist/components/textinput/Textinput.stories.d.ts +11 -12
- package/dist/components/textinput/Textinput.stories.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.stories.js +78 -137
- package/dist/components/textinput/Textinput.svelte +70 -112
- package/dist/components/textinput/Textinput.svelte.d.ts +46 -22
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/toaster/README.md +28 -0
- package/dist/components/toaster/Toaster.js +2 -2
- package/dist/components/toaster/Toaster.js.map +1 -1
- package/dist/components/toaster/Toaster.spec.js +100 -0
- package/dist/components/toaster/Toaster.stories.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.stories.js +5 -73
- package/dist/components/toaster/Toaster.svelte +17 -7
- package/dist/components/toaster/Toaster.svelte.d.ts +3 -0
- package/dist/components/toaster/Toaster.svelte.d.ts.map +1 -1
- package/dist/components/toggle/README.md +15 -0
- package/dist/components/toggle/Toggle.js +2 -2
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/Toggle.spec.js +69 -0
- package/dist/components/toggle/Toggle.stories.d.ts +9 -14
- package/dist/components/toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.stories.js +55 -64
- package/dist/components/toggle/Toggle.svelte +38 -24
- package/dist/components/toggle/Toggle.svelte.d.ts +26 -7
- package/dist/components/toggle/Toggle.svelte.d.ts.map +1 -1
- package/dist/components/togglegroup/README.md +13 -0
- package/dist/components/togglegroup/ToggleGroup.js +3 -3
- package/dist/components/togglegroup/ToggleGroup.js.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.spec.js +50 -0
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts +5 -13
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.stories.js +56 -104
- package/dist/components/togglegroup/ToggleGroup.svelte +55 -58
- package/dist/components/togglegroup/ToggleGroup.svelte.d.ts +25 -14
- package/dist/components/togglegroup/ToggleGroup.svelte.d.ts.map +1 -1
- package/dist/components/tooltip/README.md +19 -0
- package/dist/components/tooltip/Tooltip.js +2 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/Tooltip.spec.js +38 -0
- package/dist/components/tooltip/Tooltip.stories.d.ts +6 -7
- package/dist/components/tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +45 -59
- package/dist/components/tooltip/Tooltip.svelte +23 -14
- package/dist/components/tooltip/Tooltip.svelte.d.ts +17 -0
- package/dist/components/tooltip/Tooltip.svelte.d.ts.map +1 -1
- package/dist/custom-element.js +3 -3
- package/dist/custom-element.js.map +1 -1
- package/dist/documentation/Contributing.mdx +1 -1
- package/dist/documentation/Introduction.mdx +45 -11
- package/dist/documentation/SupportAndOnboarding.mdx +2 -2
- package/dist/each.js +1 -1
- package/dist/each.js.map +1 -1
- package/dist/if.js +1 -1
- package/dist/if.js.map +1 -1
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/main.d.ts +24 -23
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +24 -23
- package/dist/slot.js +1 -1
- package/dist/slot.js.map +1 -1
- package/dist/this.js +2 -0
- package/dist/this.js.map +1 -0
- package/package.json +11 -3
- package/dist/components/button/button.types.d.ts +0 -13
- package/dist/components/button/button.types.d.ts.map +0 -1
- package/dist/components/button/button.types.js +0 -1
- package/dist/components/checkboxgroup/checkboxgroup.types.d.ts +0 -9
- package/dist/components/checkboxgroup/checkboxgroup.types.d.ts.map +0 -1
- package/dist/components/checkboxgroup/checkboxgroup.types.js +0 -1
- package/dist/components/link/link.types.d.ts +0 -4
- package/dist/components/link/link.types.d.ts.map +0 -1
- package/dist/components/link/link.types.js +0 -1
- package/dist/components/loader/loader.types.d.ts +0 -3
- package/dist/components/loader/loader.types.d.ts.map +0 -1
- package/dist/components/loader/loader.types.js +0 -1
- package/dist/components/numberbadge/NumberBadge.types.d.ts +0 -3
- package/dist/components/numberbadge/NumberBadge.types.d.ts.map +0 -1
- package/dist/components/numberbadge/NumberBadge.types.js +0 -1
- package/dist/components/overlayloader/OverlayLoader.js +0 -27
- package/dist/components/overlayloader/OverlayLoader.js.map +0 -1
- package/dist/components/overlayloader/OverlayLoader.stories.d.ts +0 -8
- package/dist/components/overlayloader/OverlayLoader.stories.d.ts.map +0 -1
- package/dist/components/overlayloader/OverlayLoader.stories.js +0 -50
- package/dist/components/overlayloader/OverlayLoader.svelte +0 -160
- package/dist/components/overlayloader/OverlayLoader.svelte.d.ts +0 -9
- package/dist/components/overlayloader/OverlayLoader.svelte.d.ts.map +0 -1
- package/dist/components/quantityselector/quantitySelector.types.d.ts +0 -2
- package/dist/components/quantityselector/quantitySelector.types.d.ts.map +0 -1
- package/dist/components/quantityselector/quantitySelector.types.js +0 -1
- package/dist/components/radiogroup/radioGroup.types.d.ts +0 -9
- package/dist/components/radiogroup/radioGroup.types.d.ts.map +0 -1
- package/dist/components/radiogroup/radioGroup.types.js +0 -1
- package/dist/components/select/select.types.d.ts +0 -9
- package/dist/components/select/select.types.d.ts.map +0 -1
- package/dist/components/select/select.types.js +0 -1
- package/dist/components/statusbadge/StatusBadge.types.d.ts +0 -2
- package/dist/components/statusbadge/StatusBadge.types.d.ts.map +0 -1
- package/dist/components/statusbadge/StatusBadge.types.js +0 -1
- package/dist/components/statusdot/StatusDot.types.d.ts +0 -3
- package/dist/components/statusdot/StatusDot.types.d.ts.map +0 -1
- package/dist/components/statusdot/StatusDot.types.js +0 -1
- package/dist/components/tabs/Tab.js +0 -4
- package/dist/components/tabs/Tab.js.map +0 -1
- package/dist/components/tabs/Tab.svelte.d.ts.map +0 -1
- package/dist/components/textinput/textinput.types.d.ts +0 -3
- package/dist/components/textinput/textinput.types.d.ts.map +0 -1
- package/dist/components/textinput/textinput.types.js +0 -1
- package/dist/components/toggle/toggle.types.d.ts +0 -2
- package/dist/components/toggle/toggle.types.d.ts.map +0 -1
- package/dist/components/toggle/toggle.types.js +0 -1
- package/dist/index-client.js +0 -2
- package/dist/index-client.js.map +0 -1
- package/dist/snippet.js +0 -2
- package/dist/snippet.js.map +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/svelte';
|
|
3
|
+
import Button from './Button.svelte';
|
|
4
|
+
describe('m-button component', () => {
|
|
5
|
+
it('renders with default classes', () => {
|
|
6
|
+
const { container } = render(Button, {
|
|
7
|
+
props: {},
|
|
8
|
+
});
|
|
9
|
+
const button = container.querySelector('button');
|
|
10
|
+
expect(button).toBeTruthy();
|
|
11
|
+
expect(button.classList.contains('mc-button')).toBe(true);
|
|
12
|
+
expect(button.classList.contains('mc-button--m')).toBe(true);
|
|
13
|
+
expect(button.classList.contains('mc-button--standard')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('applies correct classes for props', () => {
|
|
16
|
+
const { container } = render(Button, {
|
|
17
|
+
props: {
|
|
18
|
+
appearance: 'accent',
|
|
19
|
+
size: 'l',
|
|
20
|
+
ghost: true,
|
|
21
|
+
outlined: true,
|
|
22
|
+
iconposition: 'only',
|
|
23
|
+
isloading: true,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const button = container.querySelector('button');
|
|
27
|
+
expect(button.classList.contains('mc-button--accent')).toBe(true);
|
|
28
|
+
expect(button.classList.contains('mc-button--l')).toBe(true);
|
|
29
|
+
expect(button.classList.contains('mc-button--ghost')).toBe(true);
|
|
30
|
+
expect(button.classList.contains('mc-button--outlined')).toBe(true);
|
|
31
|
+
expect(button.classList.contains('mc-button--loading')).toBe(true);
|
|
32
|
+
expect(button.classList.contains('mc-button--icon-only')).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
it('renders disabled button', () => {
|
|
35
|
+
const { container } = render(Button, {
|
|
36
|
+
props: {
|
|
37
|
+
disabled: true,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const button = container.querySelector('button');
|
|
41
|
+
expect(button.disabled).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
it('renders loading spinner when isloading is true', () => {
|
|
44
|
+
const { container } = render(Button, {
|
|
45
|
+
props: {
|
|
46
|
+
isloading: true,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const loaderIcon = container.querySelector('.mc-button__icon');
|
|
50
|
+
expect(loaderIcon).toBeTruthy();
|
|
51
|
+
expect(loaderIcon?.innerHTML).toContain('svg');
|
|
52
|
+
});
|
|
53
|
+
it('fires click event when clicked', async () => {
|
|
54
|
+
const { container } = render(Button);
|
|
55
|
+
const button = container.querySelector('button');
|
|
56
|
+
const clickHandler = vi.fn();
|
|
57
|
+
button.addEventListener('click', clickHandler);
|
|
58
|
+
await fireEvent.click(button);
|
|
59
|
+
expect(clickHandler).toHaveBeenCalledOnce();
|
|
60
|
+
});
|
|
61
|
+
it('passes additional attributes to button element', () => {
|
|
62
|
+
const { container } = render(Button, {
|
|
63
|
+
props: {
|
|
64
|
+
'aria-label': 'My button',
|
|
65
|
+
name: 'test-button',
|
|
66
|
+
type: 'submit',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
const button = container.querySelector('button');
|
|
70
|
+
expect(button.getAttribute('aria-label')).toBe('My button');
|
|
71
|
+
expect(button.getAttribute('name')).toBe('test-button');
|
|
72
|
+
expect(button.getAttribute('type')).toBe('submit');
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare const
|
|
9
|
-
export
|
|
10
|
-
export declare const Filled: any;
|
|
11
|
-
export declare const Outlined: any;
|
|
12
|
-
export declare const Ghost: any;
|
|
13
|
-
export declare const Icon: any;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Filled: Story;
|
|
6
|
+
export declare const Outline: Story;
|
|
7
|
+
export declare const Ghost: Story;
|
|
8
|
+
export declare const Icon: Story;
|
|
9
|
+
export declare const Loading: Story;
|
|
14
10
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAKrE,QAAA,MAAM,IAAI,EAAE,IAoCX,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,MAAM,EAAE,KAAU,CAAC;AAEhC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAKlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC"}
|
|
@@ -1,159 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
* Buttons are used to trigger actions. Their appearance depends on the type of action required from the user or the context.
|
|
6
|
-
*
|
|
7
|
-
* The `MButton` component is the **Svelte / WebComponent** implementation of the **Button** component of Mozaic Design System.
|
|
8
|
-
* The full specification of this component is available in [the associated documentation](https://mozaic.adeo.cloud/components/buttons/).
|
|
9
|
-
*/
|
|
10
|
-
export default {
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
4
|
+
const meta = {
|
|
11
5
|
title: 'Action/Button',
|
|
12
|
-
|
|
13
|
-
context: 'sidebar',
|
|
14
|
-
args: {
|
|
15
|
-
size: 'm',
|
|
16
|
-
},
|
|
6
|
+
component: 'm-button',
|
|
17
7
|
argTypes: {
|
|
8
|
+
iconposition: {
|
|
9
|
+
control: 'radio',
|
|
10
|
+
options: ['left', 'right', 'only'],
|
|
11
|
+
},
|
|
12
|
+
appearance: {
|
|
13
|
+
control: 'radio',
|
|
14
|
+
options: ['danger', 'accent', 'inverse', 'standard'],
|
|
15
|
+
},
|
|
18
16
|
size: {
|
|
19
|
-
|
|
20
|
-
control: { type: 'radio' },
|
|
17
|
+
control: 'radio',
|
|
21
18
|
options: ['s', 'm', 'l'],
|
|
22
19
|
},
|
|
23
20
|
type: {
|
|
24
|
-
|
|
25
|
-
control: { type: 'radio' },
|
|
21
|
+
control: 'radio',
|
|
26
22
|
options: ['button', 'reset', 'submit'],
|
|
27
23
|
},
|
|
28
|
-
appearance: {
|
|
29
|
-
control: { type: 'radio' },
|
|
30
|
-
options: ['standard', 'accent', 'danger', 'inverse'],
|
|
31
|
-
},
|
|
32
|
-
disabled: {
|
|
33
|
-
description: 'Specify whether the button is disabled',
|
|
34
|
-
control: 'boolean',
|
|
35
|
-
},
|
|
36
|
-
outlined: {
|
|
37
|
-
description: 'Specify whether the button is outlined',
|
|
38
|
-
control: 'boolean',
|
|
39
|
-
},
|
|
40
|
-
ghost: {
|
|
41
|
-
description: 'Specify whether the button is using ghost style',
|
|
42
|
-
control: 'boolean',
|
|
43
|
-
},
|
|
44
|
-
isloading: {
|
|
45
|
-
description: 'Specify whether the button is loading',
|
|
46
|
-
control: 'boolean',
|
|
47
|
-
},
|
|
48
|
-
label: {
|
|
49
|
-
description: 'Button Label',
|
|
50
|
-
table: {
|
|
51
|
-
category: 'Slots',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
icon: {
|
|
55
|
-
description: 'Icon that can be used ',
|
|
56
|
-
table: {
|
|
57
|
-
category: 'Slots',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
click: {
|
|
61
|
-
description: 'Event that occurs on the button click',
|
|
62
|
-
action: 'click',
|
|
63
|
-
table: {
|
|
64
|
-
category: 'Events',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
24
|
},
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
primary.setAttribute('isloading', args.isloading);
|
|
97
|
-
return primary;
|
|
98
|
-
};
|
|
99
|
-
export const Filled = Template.bind({});
|
|
100
|
-
Filled.args = {};
|
|
101
|
-
Filled.play = async ({ canvasElement }) => {
|
|
102
|
-
const MButton = canvasElement.querySelector('m-button');
|
|
103
|
-
const button = MButton?.shadowRoot.querySelector('button');
|
|
104
|
-
expect(button).not.toBeNull();
|
|
105
|
-
await userEvent.click(button);
|
|
106
|
-
expect(MButton).toHaveTextContent('Button Label');
|
|
107
|
-
};
|
|
108
|
-
export const Outlined = Template.bind({});
|
|
109
|
-
Outlined.args = {
|
|
110
|
-
outlined: 'true',
|
|
111
|
-
label: 'Button Label',
|
|
112
|
-
};
|
|
113
|
-
Outlined.play = async ({ canvasElement }) => {
|
|
114
|
-
const MButton = canvasElement.querySelector('m-button');
|
|
115
|
-
const button = MButton?.shadowRoot.querySelector('button');
|
|
116
|
-
expect(button).not.toBeNull();
|
|
117
|
-
await userEvent.click(button);
|
|
118
|
-
expect(MButton).toHaveTextContent('Button Label');
|
|
119
|
-
expect(MButton).toHaveAttribute('outlined', 'true');
|
|
120
|
-
};
|
|
121
|
-
export const Ghost = Template.bind({});
|
|
122
|
-
Ghost.args = {
|
|
123
|
-
ghost: true,
|
|
124
|
-
label: 'Button Label',
|
|
125
|
-
};
|
|
126
|
-
Ghost.argTypes = {
|
|
127
|
-
iconmode: {
|
|
128
|
-
table: {
|
|
129
|
-
disable: true,
|
|
130
|
-
},
|
|
25
|
+
args: { default: 'Button Label' },
|
|
26
|
+
render: (args) => html `
|
|
27
|
+
<m-button
|
|
28
|
+
iconposition=${ifDefined(args.iconposition)}
|
|
29
|
+
appearance=${ifDefined(args.appearance)}
|
|
30
|
+
size=${ifDefined(args.size)}
|
|
31
|
+
disabled=${ifDefined(args.disabled)}
|
|
32
|
+
ghost=${ifDefined(args.ghost)}
|
|
33
|
+
outlined=${ifDefined(args.outlined)}
|
|
34
|
+
type=${ifDefined(args.type)}
|
|
35
|
+
isloading=${ifDefined(args.isloading)}
|
|
36
|
+
>
|
|
37
|
+
${unsafeHTML(ifDefined(args.icon))} ${unsafeHTML(ifDefined(args.default))}
|
|
38
|
+
</m-button>
|
|
39
|
+
`,
|
|
40
|
+
};
|
|
41
|
+
export default meta;
|
|
42
|
+
export const Filled = {};
|
|
43
|
+
export const Outline = {
|
|
44
|
+
args: { outlined: true },
|
|
45
|
+
};
|
|
46
|
+
export const Ghost = {
|
|
47
|
+
args: { ghost: true },
|
|
48
|
+
};
|
|
49
|
+
export const Icon = {
|
|
50
|
+
args: {
|
|
51
|
+
iconposition: 'left',
|
|
52
|
+
icon: '<chevron-right-24 slot="icon"></chevron-right-24>',
|
|
131
53
|
},
|
|
132
54
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
expect(button).not.toBeNull();
|
|
137
|
-
await userEvent.click(button);
|
|
138
|
-
expect(MButton).toHaveTextContent('Button Label');
|
|
139
|
-
expect(MButton).toHaveAttribute('ghost', 'true');
|
|
140
|
-
};
|
|
141
|
-
export const Icon = Template.bind({});
|
|
142
|
-
Icon.args = {
|
|
143
|
-
hasiconslot: true,
|
|
144
|
-
iconmode: 'left',
|
|
145
|
-
};
|
|
146
|
-
Icon.argTypes = {
|
|
147
|
-
iconmode: {
|
|
148
|
-
table: {
|
|
149
|
-
disable: true,
|
|
150
|
-
},
|
|
55
|
+
export const Loading = {
|
|
56
|
+
args: {
|
|
57
|
+
isloading: true,
|
|
151
58
|
},
|
|
152
59
|
};
|
|
153
|
-
Icon.play = async ({ canvasElement }) => {
|
|
154
|
-
const canvas = within(canvasElement);
|
|
155
|
-
const MButton = canvasElement.querySelector('m-button');
|
|
156
|
-
const button = MButton?.shadowRoot.querySelector('button');
|
|
157
|
-
expect(button).not.toBeNull();
|
|
158
|
-
await userEvent.click(MButton);
|
|
159
|
-
};
|
|
@@ -1,80 +1,106 @@
|
|
|
1
1
|
<svelte:options customElement={{ tag: 'm-button' }} />
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
import type {
|
|
5
|
-
ButtonIconMode,
|
|
6
|
-
ButtonSize,
|
|
7
|
-
ButtonStyle,
|
|
8
|
-
ButtonType,
|
|
9
|
-
} from './button.types';
|
|
10
|
-
|
|
11
4
|
import Loader from '../loader/Loader.svelte';
|
|
12
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
7
|
+
*
|
|
8
|
+
* @slot default - The content displayed in the button.
|
|
9
|
+
* @slot icon - Use this slot to insert an icon for the Button.
|
|
10
|
+
*/
|
|
13
11
|
interface Props {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
/**
|
|
14
|
+
* Defines the visual style of the button.
|
|
15
|
+
*/
|
|
16
|
+
appearance?: 'standard' | 'accent' | 'danger' | 'inverse';
|
|
17
|
+
/**
|
|
18
|
+
* Determines the size of the button.
|
|
19
|
+
*/
|
|
20
|
+
size?: 's' | 'm' | 'l';
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, disables the button, making it non-interactive.
|
|
23
|
+
*/
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, applies a "ghost" style to the button, typically a transparent background with a border.
|
|
27
|
+
*/
|
|
16
28
|
ghost?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the button gets an outlined style, usually with just the border and no solid background.
|
|
31
|
+
*/
|
|
17
32
|
outlined?: boolean;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Controls the positioning of an icon in the button.
|
|
35
|
+
*/
|
|
36
|
+
iconposition?: 'left' | 'right' | 'only';
|
|
37
|
+
/**
|
|
38
|
+
* Specifies the button's HTML `type` attribute.
|
|
39
|
+
*/
|
|
40
|
+
type?: 'button' | 'reset' | 'submit';
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, a loading state is displayed.
|
|
43
|
+
*/
|
|
21
44
|
isloading?: boolean;
|
|
22
|
-
hasiconslot?: boolean;
|
|
23
|
-
[key: string]: any;
|
|
24
45
|
}
|
|
25
46
|
|
|
26
47
|
let {
|
|
27
48
|
appearance = 'standard',
|
|
28
49
|
size = 'm',
|
|
29
|
-
ghost = false,
|
|
30
|
-
outlined = false,
|
|
31
|
-
iconmode,
|
|
32
|
-
disabled = false,
|
|
33
50
|
type = 'button',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
ghost,
|
|
52
|
+
outlined,
|
|
53
|
+
disabled,
|
|
54
|
+
isloading,
|
|
55
|
+
iconposition,
|
|
56
|
+
...attrs
|
|
37
57
|
}: Props = $props();
|
|
38
58
|
</script>
|
|
39
59
|
|
|
40
60
|
<button
|
|
41
|
-
class={
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
class={[
|
|
62
|
+
'mc-button',
|
|
63
|
+
`mc-button--${size}`,
|
|
64
|
+
`mc-button--${appearance}`,
|
|
65
|
+
ghost && 'mc-button--ghost',
|
|
66
|
+
outlined && 'mc-button--outlined',
|
|
67
|
+
isloading && 'mc-button--loading',
|
|
68
|
+
iconposition === 'only' && 'mc-button--icon-only',
|
|
69
|
+
]}
|
|
46
70
|
{disabled}
|
|
47
71
|
{type}
|
|
48
|
-
{...
|
|
72
|
+
{...attrs}
|
|
49
73
|
>
|
|
74
|
+
{#if iconposition === 'left' && !isloading}
|
|
75
|
+
<span class="mc-button__icon">
|
|
76
|
+
<slot name="icon" />
|
|
77
|
+
</span>
|
|
78
|
+
{/if}
|
|
79
|
+
|
|
50
80
|
{#if isloading}
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
style="color: currentColor;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
81
|
+
<span
|
|
82
|
+
class="mc-button__icon"
|
|
83
|
+
style="color: currentColor;position: absolute; visibility: visible;"
|
|
84
|
+
>
|
|
85
|
+
<Loader appearance={'inverse'} size="s" />
|
|
86
|
+
</span>
|
|
57
87
|
{/if}
|
|
58
88
|
|
|
59
|
-
{#if
|
|
89
|
+
{#if iconposition === 'only'}
|
|
60
90
|
<span class="mc-button__icon">
|
|
61
|
-
|
|
62
|
-
<slot name="icon" />
|
|
63
|
-
{/if}
|
|
91
|
+
<slot name="icon" />
|
|
64
92
|
</span>
|
|
65
93
|
{/if}
|
|
66
94
|
|
|
67
|
-
{#if
|
|
68
|
-
<span class=
|
|
95
|
+
{#if iconposition !== 'only'}
|
|
96
|
+
<span class={['mc-button__label', isloading && 'hidden']}>
|
|
69
97
|
<slot />
|
|
70
98
|
</span>
|
|
71
99
|
{/if}
|
|
72
100
|
|
|
73
|
-
{#if
|
|
101
|
+
{#if iconposition === 'right'}
|
|
74
102
|
<span class="mc-button__icon">
|
|
75
|
-
|
|
76
|
-
<slot name="icon" />
|
|
77
|
-
{/if}
|
|
103
|
+
<slot name="icon" />
|
|
78
104
|
</span>
|
|
79
105
|
{/if}
|
|
80
106
|
</button>
|
|
@@ -421,15 +447,6 @@
|
|
|
421
447
|
cursor: not-allowed;
|
|
422
448
|
}
|
|
423
449
|
|
|
424
|
-
.mc-button__icon {
|
|
425
|
-
pointer-events: none;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
450
|
.hidden {
|
|
429
451
|
visibility: hidden;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
.loader-style {
|
|
433
|
-
color: currentColor;
|
|
434
|
-
position: absolute;
|
|
435
452
|
}</style>
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
3
|
+
*
|
|
4
|
+
* @slot default - The content displayed in the button.
|
|
5
|
+
* @slot icon - Use this slot to insert an icon for the Button.
|
|
6
|
+
*/
|
|
2
7
|
interface Props {
|
|
3
|
-
|
|
4
|
-
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
/**
|
|
10
|
+
* Defines the visual style of the button.
|
|
11
|
+
*/
|
|
12
|
+
appearance?: 'standard' | 'accent' | 'danger' | 'inverse';
|
|
13
|
+
/**
|
|
14
|
+
* Determines the size of the button.
|
|
15
|
+
*/
|
|
16
|
+
size?: 's' | 'm' | 'l';
|
|
17
|
+
/**
|
|
18
|
+
* If `true`, disables the button, making it non-interactive.
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, applies a "ghost" style to the button, typically a transparent background with a border.
|
|
23
|
+
*/
|
|
5
24
|
ghost?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, the button gets an outlined style, usually with just the border and no solid background.
|
|
27
|
+
*/
|
|
6
28
|
outlined?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Controls the positioning of an icon in the button.
|
|
31
|
+
*/
|
|
32
|
+
iconposition?: 'left' | 'right' | 'only';
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the button's HTML `type` attribute.
|
|
35
|
+
*/
|
|
36
|
+
type?: 'button' | 'reset' | 'submit';
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, a loading state is displayed.
|
|
39
|
+
*/
|
|
10
40
|
isloading?: boolean;
|
|
11
|
-
hasiconslot?: boolean;
|
|
12
|
-
[key: string]: any;
|
|
13
41
|
}
|
|
14
42
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
43
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/button/Button.svelte.ts"],"names":[],"mappings":"AAKE;;;;;GAKG;AACH,UAAU,KAAK;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC1D;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAgEH,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,MAAM;;;;;;;;UAAqF,CAAC;AAChF,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# `m-button`
|
|
2
|
+
|
|
3
|
+
Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Description | Type | Default |
|
|
8
|
+
|------|-------------|------|---------|
|
|
9
|
+
| `appearance` | Defines the visual style of the button. | `'standard'` `'accent'` `'danger'` `'inverse'` | `standard` |
|
|
10
|
+
| `size` | Determines the size of the button. | `'s'` `'m'` `'l'` | `m` |
|
|
11
|
+
| `disabled` | If `true`, disables the button, making it non-interactive. | `boolean` | |
|
|
12
|
+
| `ghost` | If `true`, applies a "ghost" style to the button, typically a transparent background with a border. | `boolean` | |
|
|
13
|
+
| `outlined` | If `true`, the button gets an outlined style, usually with just the border and no solid background. | `boolean` | |
|
|
14
|
+
| `iconposition` | Controls the positioning of an icon in the button. | `'left'` `'right'` `'only'` | |
|
|
15
|
+
| `type` | Specifies the button's HTML `type` attribute. | `'button'` `'reset'` `'submit'` | `button` |
|
|
16
|
+
| `isloading` | If `true`, a loading state is displayed. | `boolean` | |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
|------|-------------|
|
|
22
|
+
| `icon` | Use this slot to insert an icon for the Button. |
|
|
23
|
+
| `icon` | Use this slot to insert an icon for the Button. |
|
|
24
|
+
| `default` | The content displayed in the button. |
|
|
25
|
+
| `icon` | Use this slot to insert an icon for the Button. |
|
|
26
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as j,p as C,a as D,b as m,f as E,d as t,s as r,t as S,
|
|
1
|
+
import{c as j,p as C,a as D,b as m,f as E,d as t,s as r,t as S,i as q,j as A,k as u,r as l,e as B,g as F,h}from"../../custom-element.js";import{s as d}from"../../slot.js";var G=E('<section role="status"><div class="mc-callout__icon svelte-1pnlv3f"><!></div> <div class="mc-callout__content svelte-1pnlv3f"><h2 class="mc-callout__title svelte-1pnlv3f"> </h2> <p class="mc-callout__message svelte-1pnlv3f"> </p> <!> <div class="mc-callout__footer svelte-1pnlv3f"><!></div></div></section>');const H={hash:"svelte-1pnlv3f",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/
|
|
4
4
|
/* create columns */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.js","sources":["../../../src/components/callout/Callout.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-callout' }} />\n\n<script lang=\"ts\">\n /**\n * A callout is used to highlight additional information that can assist users with tips, extra details, or helpful guidance, without signaling a critical status or alert. Unlike notifications, callouts are not triggered by user actions and do not correspond to specific system states. They are designed to enhance the user experience by providing contextually relevant information that supports comprehension and usability.\n */\n interface Props {\n /**\n * Title of the callout.\n */\n title: string;\n /**\n * Description of the callout.\n */\n description: string;\n /**\n * Allows to define the callout appearance.\n */\n appearance?: 'standard' | 'accent' | 'tips' | 'inverse';\n }\n\n let {\n title,\n description,\n appearance = 'standard',\n }: Props = $props();\n</script>\n\n<section class={[\"mc-callout\", `mc-callout--${appearance}`]} role=\"status\">\n <div class=\"mc-callout__icon\">\n <slot name=\"icon\"/>\n </div>\n <div class=\"mc-callout__content\">\n <h2 class=\"mc-callout__title\">{ title }</h2>\n\n <p class=\"mc-callout__message\">\n { description }\n </p>\n\n <slot/>\n\n <div class=\"mc-callout__footer\">\n <slot name=\"footer\"/>\n </div>\n </div>\n</section>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/callout';\n\n .mc-callout__footer:empty {\n display: none;\n }\n</style>\n"],"names":["title","$.prop","$$props","description","appearance","$.set_class","section","$.clsx"],"mappings":";;;;;i6CAAA,
|
|
1
|
+
{"version":3,"file":"Callout.js","sources":["../../../src/components/callout/Callout.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-callout' }} />\n\n<script lang=\"ts\">\n /**\n * A callout is used to highlight additional information that can assist users with tips, extra details, or helpful guidance, without signaling a critical status or alert. Unlike notifications, callouts are not triggered by user actions and do not correspond to specific system states. They are designed to enhance the user experience by providing contextually relevant information that supports comprehension and usability.\n *\n * @slot icon - Use this slot to insert an icon.\n * @slot default - Use this slot to insert custom content.\n * @slot footer - Use this slot to insert a button or a link in the footer of the callout.\n */\n interface Props {\n /**\n * Title of the callout.\n */\n title: string;\n /**\n * Description of the callout.\n */\n description: string;\n /**\n * Allows to define the callout appearance.\n */\n appearance?: 'standard' | 'accent' | 'tips' | 'inverse';\n }\n\n let {\n title,\n description,\n appearance = 'standard',\n }: Props = $props();\n</script>\n\n<section class={[\"mc-callout\", `mc-callout--${appearance}`]} role=\"status\">\n <div class=\"mc-callout__icon\">\n <slot name=\"icon\"/>\n </div>\n <div class=\"mc-callout__content\">\n <h2 class=\"mc-callout__title\">{ title }</h2>\n\n <p class=\"mc-callout__message\">\n { description }\n </p>\n\n <slot/>\n\n <div class=\"mc-callout__footer\">\n <slot name=\"footer\"/>\n </div>\n </div>\n</section>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/callout';\n\n .mc-callout__footer:empty {\n display: none;\n }\n</style>\n"],"names":["title","$.prop","$$props","description","appearance","$.set_class","section","$.clsx"],"mappings":";;;;;i6CAAA,oBA0BIA,EAAKC,EAAAC,EAAA,QAAA,CAAA,EACLC,EAAWF,EAAAC,EAAA,cAAA,CAAA,EACXE,qBAAa,UAAU,iKAAV,WAAU,0NAIVC,EAAAC,EAAA,EAAAC,EAAA,CAAA,4BAA6BH,EAAU,CAAA,EAAA,CAAA,EAAA,gBAAA,MAKpBJ,GAAK,MAGjCG,GAAW,eAVnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import Callout from './Callout.svelte';
|
|
4
|
+
describe('m-callout component', () => {
|
|
5
|
+
const defaultProps = {
|
|
6
|
+
title: 'Helpful Tip',
|
|
7
|
+
description: 'This is a description for the callout.',
|
|
8
|
+
};
|
|
9
|
+
it('renders with default appearance "standard"', () => {
|
|
10
|
+
const { container, getByText } = render(Callout, { props: defaultProps });
|
|
11
|
+
const section = container.querySelector('section.mc-callout');
|
|
12
|
+
expect(section).toBeTruthy();
|
|
13
|
+
expect(section?.classList.contains('mc-callout--standard')).toBe(true);
|
|
14
|
+
expect(section).toHaveAttribute('role', 'status');
|
|
15
|
+
expect(getByText(defaultProps.title)).toBeTruthy();
|
|
16
|
+
expect(getByText(defaultProps.description)).toBeTruthy();
|
|
17
|
+
const footer = container.querySelector('.mc-callout__footer');
|
|
18
|
+
expect(footer).toBeTruthy();
|
|
19
|
+
expect(footer).toBeEmptyDOMElement();
|
|
20
|
+
expect(getComputedStyle(footer).display).toBe('none');
|
|
21
|
+
});
|
|
22
|
+
it('applies correct appearance class', () => {
|
|
23
|
+
const appearances = ['standard', 'accent', 'tips', 'inverse'];
|
|
24
|
+
appearances.forEach((appearance) => {
|
|
25
|
+
const { container, unmount } = render(Callout, {
|
|
26
|
+
props: { ...defaultProps, appearance },
|
|
27
|
+
});
|
|
28
|
+
const section = container.querySelector('section.mc-callout');
|
|
29
|
+
expect(section?.classList.contains(`mc-callout--${appearance}`)).toBe(true);
|
|
30
|
+
unmount();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/callout/Callout.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,kEAAkE,CAAC;AAC1E,OAAO,oEAAoE,CAAC;AAE5E,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Callout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/callout/Callout.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,kEAAkE,CAAC;AAC1E,OAAO,oEAAoE,CAAC;AAE5E,QAAA,MAAM,IAAI,EAAE,IA0BX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,QAAQ,EAAE,KAAU,CAAC;AAElC,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAIxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAUpB,CAAC"}
|