@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
|
@@ -1,104 +1,99 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* The `MSelect` component is the **Svelte / WebComponent** implementation of the **Select** component of Mozaic Design System.
|
|
6
|
-
* The full specification of this component is available in [the associated documentation](https://mozaic.adeo.cloud/components/form/select/).
|
|
7
|
-
*/
|
|
8
|
-
export default {
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
import { action } from 'storybook/actions';
|
|
4
|
+
const meta = {
|
|
9
5
|
title: 'Form Elements/Select',
|
|
10
|
-
|
|
6
|
+
component: 'm-select',
|
|
11
7
|
argTypes: {
|
|
12
|
-
placeholder: {
|
|
13
|
-
description: 'Specify the select placeholder',
|
|
14
|
-
control: 'text',
|
|
15
|
-
},
|
|
16
|
-
name: {
|
|
17
|
-
description: 'Specify the name attribut for the select element',
|
|
18
|
-
control: 'text',
|
|
19
|
-
type: 'string',
|
|
20
|
-
},
|
|
21
|
-
options: {
|
|
22
|
-
description: 'Specify the select options as an array of objects. <b />```{ id?: string; text: string; value: string | number; disabled?: boolean; }[]```',
|
|
23
|
-
control: 'object',
|
|
24
|
-
},
|
|
25
8
|
size: {
|
|
26
|
-
|
|
27
|
-
control: { type: 'radio' },
|
|
9
|
+
control: 'radio',
|
|
28
10
|
options: ['s', 'm'],
|
|
29
11
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
id: 'selectId',
|
|
15
|
+
placeholder: 'Choose an option',
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
text: 'Option 1',
|
|
19
|
+
value: 'option1',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
text: 'Option 2',
|
|
23
|
+
value: 'option2',
|
|
24
|
+
disabled: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
text: 'Option 3',
|
|
28
|
+
value: 'option3',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
text: 'Option 4',
|
|
32
|
+
value: 'option4',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
render: (args) => {
|
|
37
|
+
const onInput = action('input');
|
|
38
|
+
const onChange = action('change');
|
|
39
|
+
const onFocus = action('focus');
|
|
40
|
+
const onBlur = action('blur');
|
|
41
|
+
return html `
|
|
42
|
+
<m-select
|
|
43
|
+
id=${ifDefined(args.id)}
|
|
44
|
+
name=${ifDefined(args.name)}
|
|
45
|
+
value=${ifDefined(args.value)}
|
|
46
|
+
.options=${ifDefined(args.options)}
|
|
47
|
+
placeholder=${ifDefined(args.placeholder)}
|
|
48
|
+
isinvalid=${ifDefined(args.isinvalid)}
|
|
49
|
+
disabled=${ifDefined(args.disabled)}
|
|
50
|
+
size=${ifDefined(args.size)}
|
|
51
|
+
readonly=${ifDefined(args.readonly)}
|
|
52
|
+
@input=${(event) => {
|
|
53
|
+
onInput(event);
|
|
54
|
+
}}
|
|
55
|
+
@change=${(event) => {
|
|
56
|
+
onChange(event);
|
|
57
|
+
}}
|
|
58
|
+
@focus=${(event) => {
|
|
59
|
+
onFocus(event);
|
|
60
|
+
}}
|
|
61
|
+
@blur=${(event) => {
|
|
62
|
+
onBlur(event);
|
|
63
|
+
}}
|
|
64
|
+
></m-select>
|
|
65
|
+
`;
|
|
46
66
|
},
|
|
47
67
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const MSelect = document.createElement('m-select');
|
|
55
|
-
MSelect.setAttribute('placeholder', args.placeholder || 'Primary');
|
|
56
|
-
MSelect.setAttribute('valueselected', args.valueselected || '');
|
|
57
|
-
if (args.options)
|
|
58
|
-
MSelect.setAttribute('options', JSON.stringify(args.options));
|
|
59
|
-
if (args.size)
|
|
60
|
-
MSelect.setAttribute('size', args.size);
|
|
61
|
-
if (args.isinvalid)
|
|
62
|
-
MSelect.setAttribute('isinvalid', 'true');
|
|
63
|
-
if (args.disabled)
|
|
64
|
-
MSelect.setAttribute('disabled', 'true');
|
|
65
|
-
if (args.required)
|
|
66
|
-
MSelect.setAttribute('required', 'true');
|
|
67
|
-
return MSelect;
|
|
68
|
-
};
|
|
69
|
-
export const Default = Template.bind({});
|
|
70
|
-
Default.args = { options: opts };
|
|
71
|
-
Default.play = async ({ canvasElement }) => {
|
|
72
|
-
const select = canvasElement.querySelector('m-select');
|
|
73
|
-
const input = select?.shadowRoot?.querySelector('select');
|
|
74
|
-
expect(select).not.toBeNull();
|
|
75
|
-
await userEvent.selectOptions(input, 'option1');
|
|
76
|
-
expect(input).toHaveValue('option1');
|
|
68
|
+
export default meta;
|
|
69
|
+
export const WithValue = {
|
|
70
|
+
args: {
|
|
71
|
+
id: 'withValueId',
|
|
72
|
+
value: 'option1',
|
|
73
|
+
},
|
|
77
74
|
};
|
|
78
|
-
export const
|
|
79
|
-
Small
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
export const Default = {};
|
|
76
|
+
export const Small = {
|
|
77
|
+
args: {
|
|
78
|
+
id: 'smallId',
|
|
79
|
+
size: 's',
|
|
80
|
+
},
|
|
83
81
|
};
|
|
84
|
-
export const Disabled =
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
expect(input).toBeDisabled();
|
|
82
|
+
export const Disabled = {
|
|
83
|
+
args: {
|
|
84
|
+
id: 'disabledId',
|
|
85
|
+
disabled: true,
|
|
86
|
+
},
|
|
90
87
|
};
|
|
91
|
-
export const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
expect(input).toHaveAttribute('required');
|
|
88
|
+
export const ReadOnly = {
|
|
89
|
+
args: {
|
|
90
|
+
id: 'readonlyId',
|
|
91
|
+
readonly: true,
|
|
92
|
+
},
|
|
97
93
|
};
|
|
98
|
-
export const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
expect(input).toHaveValue('option3');
|
|
94
|
+
export const Invalid = {
|
|
95
|
+
args: {
|
|
96
|
+
id: 'invalidId',
|
|
97
|
+
isinvalid: true,
|
|
98
|
+
},
|
|
104
99
|
};
|
|
@@ -10,64 +10,77 @@
|
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
12
|
import { customElementForwardEvents } from '../../utils';
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A select component allows users to choose a single option from a predefined list within a native dropdown menu. It helps simplify input by displaying only relevant choices, reducing the need for manual text entry. Select components are commonly used in forms, settings, and filters where structured selection is required.
|
|
15
|
+
*/
|
|
15
16
|
interface Props {
|
|
17
|
+
/**
|
|
18
|
+
* A unique identifier for the select, used to associate the label with the form element.
|
|
19
|
+
*/
|
|
16
20
|
id: string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The name attribute for the select element, used for form submission.
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Define the available choices for the select element.
|
|
27
|
+
*/
|
|
28
|
+
options: Array<{
|
|
29
|
+
id?: string;
|
|
30
|
+
text: string;
|
|
31
|
+
value: string | number;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* The current value of the select.
|
|
36
|
+
*/
|
|
37
|
+
value?: string | number;
|
|
38
|
+
/**
|
|
39
|
+
* Text displayed when the select has no selected value.
|
|
40
|
+
*/
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, the select is marked as invalid.
|
|
44
|
+
*/
|
|
22
45
|
isinvalid?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, the select is disabled and non-interactive.
|
|
48
|
+
*/
|
|
23
49
|
disabled?: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Determines the size of the select.
|
|
52
|
+
*/
|
|
53
|
+
size?: 's' | 'm';
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, the select is read-only (cannot be edited).
|
|
56
|
+
*/
|
|
57
|
+
readonly?: boolean;
|
|
28
58
|
}
|
|
29
59
|
|
|
30
60
|
let {
|
|
31
61
|
id,
|
|
32
|
-
|
|
62
|
+
name,
|
|
63
|
+
value,
|
|
33
64
|
placeholder,
|
|
34
65
|
size = 'm',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
required = false,
|
|
66
|
+
isinvalid,
|
|
67
|
+
disabled,
|
|
68
|
+
readonly,
|
|
39
69
|
options,
|
|
40
|
-
onchange,
|
|
41
|
-
onblur,
|
|
42
70
|
}: Props = $props();
|
|
43
|
-
let valueSelected = $state(valueselected);
|
|
44
|
-
|
|
45
|
-
function setClasses(isvalid: boolean, isinvalid: boolean, size: SelectSize): string {
|
|
46
|
-
const classes = ['mc-select'];
|
|
47
|
-
|
|
48
|
-
if(isvalid) {
|
|
49
|
-
classes.push('is-valid');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (isinvalid) {
|
|
53
|
-
classes.push('is-invalid');
|
|
54
|
-
}
|
|
55
|
-
if (size) {
|
|
56
|
-
classes.push(`mc-select--${size}`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return classes.join(' ');
|
|
60
|
-
}
|
|
61
71
|
</script>
|
|
62
72
|
|
|
63
73
|
<select
|
|
64
74
|
{id}
|
|
65
|
-
class={
|
|
75
|
+
class={[
|
|
76
|
+
'mc-select',
|
|
77
|
+
`mc-select--${size}`,
|
|
78
|
+
readonly && 'mc-select--readonly',
|
|
79
|
+
isinvalid && 'is-invalid',
|
|
80
|
+
]}
|
|
81
|
+
{name}
|
|
66
82
|
{disabled}
|
|
67
|
-
|
|
68
|
-
bind:value={valueSelected}
|
|
69
|
-
{onchange}
|
|
70
|
-
{onblur}
|
|
83
|
+
bind:value
|
|
71
84
|
>
|
|
72
85
|
{#if placeholder}
|
|
73
86
|
<option value="" disabled selected>
|
|
@@ -75,9 +88,9 @@
|
|
|
75
88
|
</option>
|
|
76
89
|
{/if}
|
|
77
90
|
|
|
78
|
-
{#each options as
|
|
79
|
-
<option disabled={
|
|
80
|
-
{
|
|
91
|
+
{#each options as option}
|
|
92
|
+
<option disabled={option.disabled} value={option.value}>
|
|
93
|
+
{option.text}
|
|
81
94
|
</option>
|
|
82
95
|
{/each}
|
|
83
96
|
</select>
|
|
@@ -1,17 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A select component allows users to choose a single option from a predefined list within a native dropdown menu. It helps simplify input by displaying only relevant choices, reducing the need for manual text entry. Select components are commonly used in forms, settings, and filters where structured selection is required.
|
|
3
|
+
*/
|
|
2
4
|
interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* A unique identifier for the select, used to associate the label with the form element.
|
|
7
|
+
*/
|
|
3
8
|
id: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The name attribute for the select element, used for form submission.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Define the available choices for the select element.
|
|
15
|
+
*/
|
|
16
|
+
options: Array<{
|
|
17
|
+
id?: string;
|
|
18
|
+
text: string;
|
|
19
|
+
value: string | number;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* The current value of the select.
|
|
24
|
+
*/
|
|
25
|
+
value?: string | number;
|
|
26
|
+
/**
|
|
27
|
+
* Text displayed when the select has no selected value.
|
|
28
|
+
*/
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* If `true`, the select is marked as invalid.
|
|
32
|
+
*/
|
|
9
33
|
isinvalid?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, the select is disabled and non-interactive.
|
|
36
|
+
*/
|
|
10
37
|
disabled?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Determines the size of the select.
|
|
40
|
+
*/
|
|
41
|
+
size?: 's' | 'm';
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, the select is read-only (cannot be edited).
|
|
44
|
+
*/
|
|
45
|
+
readonly?: boolean;
|
|
15
46
|
}
|
|
16
47
|
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
17
48
|
type Select = ReturnType<typeof Select>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.svelte.ts"],"names":[],"mappings":"AAKE;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;IACH;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiDH,QAAA,MAAM,MAAM,2CAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `m-status-badge`
|
|
2
|
+
|
|
3
|
+
A Status Badge is used to indicate the current status of an element, providing a clear and concise visual cue. The status can change dynamically based on updates, events, or conditions within the system. Status Badges help users quickly identify the state of an item, such as an order status, system health, or process completion. They are often color-coded to enhance readability and recognition.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Description | Type | Default |
|
|
8
|
+
|------|-------------|------|---------|
|
|
9
|
+
| `label*` | Content of the status badge. | `string` | |
|
|
10
|
+
| `status` | Allows to define the status badge type. | `'info'` `'success'` `'warning'` `'error'` `'neutral'` | `info` |
|
|
11
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as f,p as v,a as m,b as l,f as p,d as u,s as h,t as k,i as y,j as w,k as n,r as b,e as _,g as x,h as S}from"../../custom-element.js";import{S as z}from"../statusdot/StatusDot.js";var D=p('<div><!> <span class="mc-status-badge__label svelte-1oceydf"> </span></div>');const j={hash:"svelte-1oceydf",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
*/.mc-status-badge.svelte-1oceydf {background-color:var(--status-badge-color-background-information, #e1f3f9);border:var(--border-s, 1px) solid var(--status-badge-color-border-information, #a7d9ed);border-radius:var(--radius-s, 0.25rem);font-weight:var(--font-weight-regular, 400);font-size:var(--font-size-100, 0.875rem);display:inline-flex;align-items:center;gap:0.25rem;padding-right:0.5rem;padding-left:0.5rem;text-transform:lowercase;white-space:nowrap;min-height:1.5rem;}.mc-status-badge__label.svelte-1oceydf {color:var(--status-badge-color-label, #000000);}.mc-status-badge__label.svelte-1oceydf::first-letter {text-transform:uppercase;}.mc-status-badge--success.svelte-1oceydf {background-color:var(--status-badge-color-background-success, #ebf5de);border:var(--border-s, 1px) solid var(--status-badge-color-border-success, #c5e39e);}.mc-status-badge--error.svelte-1oceydf {background-color:var(--status-badge-color-background-error, #fdeaea);border:var(--border-s, 1px) solid var(--status-badge-color-border-error, #f8bcbb);}.mc-status-badge--warning.svelte-1oceydf {background-color:var(--status-badge-color-background-warning, #fdf1e8);border:var(--border-s, 1px) solid var(--status-badge-color-border-warning, #f8d2b3);}.mc-status-badge--neutral.svelte-1oceydf {background-color:var(--status-badge-color-background-neutral, #f2f2f2);border:var(--border-s, 1px) solid var(--status-badge-color-border-neutral, #cccccc);}.mc-status-dot.svelte-1oceydf {background-color:var(--status-dot-color-background-information, #0b96cc);height:0.5rem;width:0.5rem;border-radius:var(--radius-full, 100%);display:inline-block;}.mc-status-dot--s.svelte-1oceydf {height:0.25rem;width:0.25rem;}.mc-status-dot--l.svelte-1oceydf {height:1rem;width:1rem;}.mc-status-dot--success.svelte-1oceydf {background-color:var(--status-dot-color-background-success, #3f9e10);}.mc-status-dot--error.svelte-1oceydf {background-color:var(--status-dot-color-background-error, #ea302d);}.mc-status-dot--warning.svelte-1oceydf {background-color:var(--status-dot-color-background-warning, #ea7315);}.mc-status-dot--neutral.svelte-1oceydf {background-color:var(--status-dot-color-background-neutral, #808080);}`};function
|
|
3
|
+
*/.mc-status-badge.svelte-1oceydf {background-color:var(--status-badge-color-background-information, #e1f3f9);border:var(--border-s, 1px) solid var(--status-badge-color-border-information, #a7d9ed);border-radius:var(--radius-s, 0.25rem);font-weight:var(--font-weight-regular, 400);font-size:var(--font-size-100, 0.875rem);display:inline-flex;align-items:center;gap:0.25rem;padding-right:0.5rem;padding-left:0.5rem;text-transform:lowercase;white-space:nowrap;min-height:1.5rem;}.mc-status-badge__label.svelte-1oceydf {color:var(--status-badge-color-label, #000000);}.mc-status-badge__label.svelte-1oceydf::first-letter {text-transform:uppercase;}.mc-status-badge--success.svelte-1oceydf {background-color:var(--status-badge-color-background-success, #ebf5de);border:var(--border-s, 1px) solid var(--status-badge-color-border-success, #c5e39e);}.mc-status-badge--error.svelte-1oceydf {background-color:var(--status-badge-color-background-error, #fdeaea);border:var(--border-s, 1px) solid var(--status-badge-color-border-error, #f8bcbb);}.mc-status-badge--warning.svelte-1oceydf {background-color:var(--status-badge-color-background-warning, #fdf1e8);border:var(--border-s, 1px) solid var(--status-badge-color-border-warning, #f8d2b3);}.mc-status-badge--neutral.svelte-1oceydf {background-color:var(--status-badge-color-background-neutral, #f2f2f2);border:var(--border-s, 1px) solid var(--status-badge-color-border-neutral, #cccccc);}.mc-status-dot.svelte-1oceydf {background-color:var(--status-dot-color-background-information, #0b96cc);height:0.5rem;width:0.5rem;border-radius:var(--radius-full, 100%);display:inline-block;}.mc-status-dot--s.svelte-1oceydf {height:0.25rem;width:0.25rem;}.mc-status-dot--l.svelte-1oceydf {height:1rem;width:1rem;}.mc-status-dot--success.svelte-1oceydf {background-color:var(--status-dot-color-background-success, #3f9e10);}.mc-status-dot--error.svelte-1oceydf {background-color:var(--status-dot-color-background-error, #ea302d);}.mc-status-dot--warning.svelte-1oceydf {background-color:var(--status-dot-color-background-warning, #ea7315);}.mc-status-dot--neutral.svelte-1oceydf {background-color:var(--status-dot-color-background-neutral, #808080);}`};function B(o,r){v(r,!0),m(o,j);let e=l(r,"status",7,"info"),a=l(r,"label",7);var g={get status(){return e()},set status(s="info"){e(s),n()},get label(){return a()},set label(s){a(s),n()}},t=D(),d=u(t);z(d,{get status(){return e()},size:"m"});var c=h(d,2),i=u(c,!0);return b(c),b(t),k(()=>{_(t,1,x(["mc-status-badge",`mc-status-badge--${e()}`]),"svelte-1oceydf"),S(i,a())}),y(o,t),w(g)}customElements.define("m-status-badge",f(B,{status:{},label:{}},[],[],!0));
|
|
4
4
|
//# sourceMappingURL=StatusBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","sources":["../../../src/components/statusbadge/StatusBadge.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-status-badge' }} />\n\n<script lang=\"ts\">\n import
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","sources":["../../../src/components/statusbadge/StatusBadge.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-status-badge' }} />\n\n<script lang=\"ts\">\n import StatusDot from '../statusdot/StatusDot.svelte';\n /**\n * A Status Badge is used to indicate the current status of an element, providing a clear and concise visual cue. The status can change dynamically based on updates, events, or conditions within the system. Status Badges help users quickly identify the state of an item, such as an order status, system health, or process completion. They are often color-coded to enhance readability and recognition.\n */\n interface Props {\n /**\n * Content of the status badge.\n */\n label: string;\n /**\n * Allows to define the status badge type.\n */\n status?: 'info' | 'success' | 'warning' | 'error' | 'neutral';\n }\n\n let { status = 'info', label }: Props = $props();\n</script>\n\n<div class={['mc-status-badge', `mc-status-badge--${status}`]}>\n <StatusDot {status} size=\"m\" />\n <span class=\"mc-status-badge__label\">{label}</span>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/status-badge';\n @use '@mozaic-ds/styles/components/status-dot';\n</style>\n"],"names":["status","label","$.prop","$$props","$.set_class","div","$.clsx"],"mappings":";;wpEAAA,gBAkBQ,IAAAA,iBAAS,MAAM,EAAEC,EAAKC,EAAAC,EAAA,QAAA,CAAA,+CAAb,OAAM,gKAGVC,EAAAC,EAAA,EAAAC,EAAA,CAAA,sCAAuCN,EAAM,CAAA,EAAA,CAAA,EAAA,gBAAA,MAElBC,GAAK,eAJ7C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import StatusBadge from './StatusBadge.svelte';
|
|
4
|
+
describe('m-status-badge component', () => {
|
|
5
|
+
it('renders with required label and default status "info"', () => {
|
|
6
|
+
const { container, getByText } = render(StatusBadge, {
|
|
7
|
+
props: { label: 'Test Label' },
|
|
8
|
+
});
|
|
9
|
+
const badge = container.querySelector('.mc-status-badge');
|
|
10
|
+
expect(badge).toBeTruthy();
|
|
11
|
+
expect(badge?.classList.contains('mc-status-badge--info')).toBe(true);
|
|
12
|
+
expect(getByText('Test Label')).toBeTruthy();
|
|
13
|
+
const statusDot = container.querySelector('.mc-status-dot');
|
|
14
|
+
expect(statusDot).toBeTruthy();
|
|
15
|
+
expect(statusDot?.classList.contains('mc-status-dot--info')).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
it('applies correct status class when status prop is set', () => {
|
|
18
|
+
const { container } = render(StatusBadge, {
|
|
19
|
+
props: { label: 'Status Test', status: 'error' },
|
|
20
|
+
});
|
|
21
|
+
const badge = container.querySelector('.mc-status-badge');
|
|
22
|
+
expect(badge?.classList.contains('mc-status-badge--error')).toBe(true);
|
|
23
|
+
const statusDot = container.querySelector('.mc-status-dot');
|
|
24
|
+
expect(statusDot?.classList.contains('mc-status-dot--error')).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('renders the label text properly', () => {
|
|
27
|
+
const testLabel = 'Dynamic Label';
|
|
28
|
+
const { getByText } = render(StatusBadge, { props: { label: testLabel } });
|
|
29
|
+
expect(getByText(testLabel)).toBeTruthy();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const
|
|
8
|
-
export
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const Warning: any;
|
|
11
|
-
export declare const Error: any;
|
|
12
|
-
export declare const Success: 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 Info: Story;
|
|
6
|
+
export declare const Success: Story;
|
|
7
|
+
export declare const Warning: Story;
|
|
8
|
+
export declare const Error: Story;
|
|
9
|
+
export declare const Neutral: Story;
|
|
13
10
|
//# sourceMappingURL=StatusBadge.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.stories.d.ts","sourceRoot":"","sources":["../../../src/components/statusbadge/StatusBadge.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"StatusBadge.stories.d.ts","sourceRoot":"","sources":["../../../src/components/statusbadge/StatusBadge.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,QAAA,MAAM,IAAI,EAAE,IAeX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,IAAI,EAAE,KAAU,CAAC;AAE9B,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -1,54 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* The `MStatusBadge` component is the **Svelte / WebComponent** implementation of the **Status Badge** component of Mozaic Design System.
|
|
6
|
-
*/
|
|
7
|
-
export default {
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
const meta = {
|
|
8
4
|
title: 'Status/Status Badge',
|
|
9
|
-
|
|
5
|
+
component: 'm-status-badge',
|
|
10
6
|
argTypes: {
|
|
11
|
-
label: {
|
|
12
|
-
description: 'Specify the badge label',
|
|
13
|
-
control: 'text',
|
|
14
|
-
},
|
|
15
7
|
status: {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
options: ['neutral', 'warning', 'error', 'success', 'info'],
|
|
8
|
+
control: 'radio',
|
|
9
|
+
options: ['info', 'success', 'warning', 'error'],
|
|
19
10
|
},
|
|
20
11
|
},
|
|
12
|
+
args: { label: 'Badge label' },
|
|
13
|
+
render: (args) => html ` <m-status-badge
|
|
14
|
+
label=${ifDefined(args.label)}
|
|
15
|
+
status=${ifDefined(args.status)}
|
|
16
|
+
></m-status-badge>`,
|
|
21
17
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
primary.appendChild(label);
|
|
27
|
-
if (args.status)
|
|
28
|
-
primary.setAttribute('status', args.status);
|
|
29
|
-
return primary;
|
|
30
|
-
};
|
|
31
|
-
export const Default = Template.bind({});
|
|
32
|
-
Default.args = {};
|
|
33
|
-
Default.play = async ({ canvasElement }) => {
|
|
34
|
-
const badge = within(canvasElement).getByText('Status');
|
|
35
|
-
expect(badge).not.toBeNull();
|
|
18
|
+
export default meta;
|
|
19
|
+
export const Info = {};
|
|
20
|
+
export const Success = {
|
|
21
|
+
args: { status: 'success' },
|
|
36
22
|
};
|
|
37
|
-
export const Warning =
|
|
38
|
-
|
|
39
|
-
Warning.play = async ({ canvasElement }) => {
|
|
40
|
-
const badge = canvasElement.querySelector('m-status-badge');
|
|
41
|
-
expect(badge).toHaveAttribute('status', 'warning');
|
|
23
|
+
export const Warning = {
|
|
24
|
+
args: { status: 'warning' },
|
|
42
25
|
};
|
|
43
|
-
export const Error =
|
|
44
|
-
|
|
45
|
-
Error.play = async ({ canvasElement }) => {
|
|
46
|
-
const badge = canvasElement.querySelector('m-status-badge');
|
|
47
|
-
expect(badge).toHaveAttribute('status', 'error');
|
|
26
|
+
export const Error = {
|
|
27
|
+
args: { status: 'error' },
|
|
48
28
|
};
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
Success.play = async ({ canvasElement }) => {
|
|
52
|
-
const badge = canvasElement.querySelector('m-status-badge');
|
|
53
|
-
expect(badge).toHaveAttribute('status', 'success');
|
|
29
|
+
export const Neutral = {
|
|
30
|
+
args: { status: 'neutral' },
|
|
54
31
|
};
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
<svelte:options customElement={{ tag: 'm-status-badge' }} />
|
|
2
2
|
|
|
3
3
|
<script lang="ts">
|
|
4
|
-
import type { StatusBadgeStyle } from './StatusBadge.types';
|
|
5
4
|
import StatusDot from '../statusdot/StatusDot.svelte';
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* A Status Badge is used to indicate the current status of an element, providing a clear and concise visual cue. The status can change dynamically based on updates, events, or conditions within the system. Status Badges help users quickly identify the state of an item, such as an order status, system health, or process completion. They are often color-coded to enhance readability and recognition.
|
|
7
|
+
*/
|
|
7
8
|
interface Props {
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Content of the status badge.
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Allows to define the status badge type.
|
|
15
|
+
*/
|
|
16
|
+
status?: 'info' | 'success' | 'warning' | 'error' | 'neutral';
|
|
9
17
|
}
|
|
10
18
|
|
|
11
|
-
let { status }: Props = $props();
|
|
19
|
+
let { status = 'info', label }: Props = $props();
|
|
12
20
|
</script>
|
|
13
21
|
|
|
14
|
-
<div class=
|
|
22
|
+
<div class={['mc-status-badge', `mc-status-badge--${status}`]}>
|
|
15
23
|
<StatusDot {status} size="m" />
|
|
16
|
-
<span class="mc-status-badge__label"
|
|
24
|
+
<span class="mc-status-badge__label">{label}</span>
|
|
17
25
|
</div>
|
|
18
26
|
|
|
19
27
|
<style>/**
|