@mozaic-ds/web-components 1.1.0 → 1.3.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 +26 -104
- 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/Less24.js +2 -0
- package/dist/Less24.js.map +1 -0
- package/dist/attributes.js +1 -1
- package/dist/attributes.js.map +1 -1
- package/dist/bundle.d.ts +8 -5
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +8 -5
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/Avatar.stories.d.ts +2 -1
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +2 -1
- package/dist/components/avatar/Avatar.svelte +3 -3
- package/dist/components/breadcrumb/Breadcrumb.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts +1 -0
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.js +1 -0
- package/dist/components/breadcrumb/Breadcrumb.svelte +3 -3
- package/dist/components/button/Button.js +3 -3
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.stories.d.ts +2 -0
- package/dist/components/button/Button.stories.d.ts.map +1 -1
- package/dist/components/button/Button.stories.js +2 -0
- package/dist/components/button/Button.svelte +2 -3
- package/dist/components/button/Button.svelte.d.ts +0 -1
- package/dist/components/button/Button.svelte.d.ts.map +1 -1
- package/dist/components/callout/Callout.js +2 -2
- package/dist/components/callout/Callout.js.map +1 -1
- package/dist/components/callout/Callout.stories.d.ts +5 -2
- package/dist/components/callout/Callout.stories.d.ts.map +1 -1
- package/dist/components/callout/Callout.stories.js +5 -2
- package/dist/components/callout/Callout.svelte +3 -3
- package/dist/components/carousel/Carousel.js +4 -0
- package/dist/components/carousel/Carousel.js.map +1 -0
- package/dist/components/carousel/Carousel.spec.js +49 -0
- package/dist/components/carousel/Carousel.stories.d.ts +9 -0
- package/dist/components/carousel/Carousel.stories.d.ts.map +1 -0
- package/dist/components/carousel/Carousel.stories.js +72 -0
- package/dist/components/carousel/Carousel.svelte +187 -0
- package/dist/components/carousel/Carousel.svelte.d.ts +46 -0
- package/dist/components/carousel/Carousel.svelte.d.ts.map +1 -0
- package/dist/components/carousel/README.md +18 -0
- package/dist/components/checkbox/Checkbox.js +4 -4
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.stories.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/checkbox/Checkbox.stories.js +1 -0
- package/dist/components/checkbox/Checkbox.svelte +4 -2
- package/dist/components/checkbox/Checkbox.svelte.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.js +4 -4
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts +1 -0
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.js +1 -0
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +4 -4
- package/dist/components/circularprogressbar/CircularProgressbar.js +2 -2
- package/dist/components/circularprogressbar/CircularProgressbar.js.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts +1 -0
- package/dist/components/circularprogressbar/CircularProgressbar.stories.d.ts.map +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.stories.js +3 -2
- package/dist/components/circularprogressbar/CircularProgressbar.svelte +9 -1
- package/dist/components/circularprogressbar/CircularProgressbar.svelte.d.ts.map +1 -1
- package/dist/components/container/Container.js +14 -0
- package/dist/components/container/Container.js.map +1 -0
- package/dist/components/container/Container.spec.js +26 -0
- package/dist/components/container/Container.stories.d.ts +8 -0
- package/dist/components/container/Container.stories.d.ts.map +1 -0
- package/dist/components/container/Container.stories.js +24 -0
- package/dist/components/container/Container.svelte +60 -0
- package/dist/components/container/Container.svelte.d.ts +39 -0
- package/dist/components/container/Container.svelte.d.ts.map +1 -0
- package/dist/components/container/README.md +16 -0
- package/dist/components/datepicker/Datepicker.js +3 -3
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.d.ts +1 -0
- package/dist/components/datepicker/Datepicker.stories.d.ts.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.js +1 -0
- package/dist/components/datepicker/Datepicker.svelte +11 -9
- package/dist/components/datepicker/Datepicker.svelte.d.ts.map +1 -1
- package/dist/components/divider/Divider.js +4 -0
- package/dist/components/divider/Divider.js.map +1 -0
- package/dist/components/divider/Divider.spec.js +50 -0
- package/dist/components/divider/Divider.stories.d.ts +10 -0
- package/dist/components/divider/Divider.stories.d.ts.map +1 -0
- package/dist/components/divider/Divider.stories.js +58 -0
- package/dist/components/divider/Divider.svelte +90 -0
- package/dist/components/divider/Divider.svelte.d.ts +47 -0
- package/dist/components/divider/Divider.svelte.d.ts.map +1 -0
- package/dist/components/divider/README.md +18 -0
- package/dist/components/drawer/Drawer.js +4 -4
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.stories.d.ts +2 -0
- package/dist/components/drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.stories.js +2 -0
- package/dist/components/drawer/Drawer.svelte +16 -6
- package/dist/components/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/field/Field.js +2 -2
- package/dist/components/field/Field.stories.d.ts +2 -0
- package/dist/components/field/Field.stories.d.ts.map +1 -1
- package/dist/components/field/Field.stories.js +2 -0
- package/dist/components/flag/Flag.js +2 -2
- package/dist/components/flag/Flag.js.map +1 -1
- package/dist/components/flag/Flag.stories.d.ts +1 -0
- package/dist/components/flag/Flag.stories.d.ts.map +1 -1
- package/dist/components/flag/Flag.stories.js +1 -0
- package/dist/components/flag/Flag.svelte +3 -3
- 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 +4 -2
- package/dist/components/iconbutton/IconButton.stories.d.ts.map +1 -1
- package/dist/components/iconbutton/IconButton.stories.js +4 -2
- package/dist/components/iconbutton/IconButton.svelte +2 -3
- package/dist/components/iconbutton/IconButton.svelte.d.ts +0 -1
- package/dist/components/iconbutton/IconButton.svelte.d.ts.map +1 -1
- package/dist/components/kpiitem/KpiItem.js +5 -0
- package/dist/components/kpiitem/KpiItem.js.map +1 -0
- package/dist/components/kpiitem/KpiItem.spec.js +60 -0
- package/dist/components/kpiitem/KpiItem.stories.d.ts +9 -0
- package/dist/components/kpiitem/KpiItem.stories.d.ts.map +1 -0
- package/dist/components/kpiitem/KpiItem.stories.js +57 -0
- package/dist/components/kpiitem/KpiItem.svelte +231 -0
- package/dist/components/kpiitem/KpiItem.svelte.d.ts +34 -0
- package/dist/components/kpiitem/KpiItem.svelte.d.ts.map +1 -0
- package/dist/components/kpiitem/README.md +15 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js +2 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts +1 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.stories.js +1 -0
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.svelte +4 -3
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js +2 -2
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts +1 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.d.ts.map +1 -1
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.stories.js +1 -0
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.svelte +5 -4
- package/dist/components/link/Link.js +2 -2
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/link/Link.stories.d.ts +3 -0
- package/dist/components/link/Link.stories.d.ts.map +1 -1
- package/dist/components/link/Link.stories.js +3 -0
- package/dist/components/link/Link.svelte +3 -1
- package/dist/components/link/Link.svelte.d.ts.map +1 -1
- package/dist/components/loader/Loader.js +2 -2
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/loader/Loader.stories.d.ts +1 -0
- package/dist/components/loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/loader/Loader.stories.js +1 -0
- package/dist/components/loader/Loader.svelte +2 -1
- package/dist/components/loadingoverlay/LoadingOverlay.js +2 -2
- package/dist/components/loadingoverlay/LoadingOverlay.js.map +1 -1
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.stories.d.ts.map +1 -1
- package/dist/components/loadingoverlay/LoadingOverlay.stories.js +1 -0
- package/dist/components/loadingoverlay/LoadingOverlay.svelte +2 -2
- package/dist/components/modal/Modal.js +4 -4
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.stories.d.ts +5 -2
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +5 -2
- package/dist/components/modal/Modal.svelte +6 -5
- package/dist/components/numberbadge/NumberBadge.js +2 -2
- package/dist/components/numberbadge/NumberBadge.js.map +1 -1
- package/dist/components/numberbadge/NumberBadge.stories.d.ts +1 -0
- package/dist/components/numberbadge/NumberBadge.stories.d.ts.map +1 -1
- package/dist/components/numberbadge/NumberBadge.stories.js +1 -0
- package/dist/components/numberbadge/NumberBadge.svelte +6 -3
- package/dist/components/overlay/Overlay.js +2 -2
- package/dist/components/overlay/Overlay.stories.d.ts +1 -0
- package/dist/components/overlay/Overlay.stories.d.ts.map +1 -1
- package/dist/components/overlay/Overlay.stories.js +1 -0
- package/dist/components/pagination/Pagination.js +6 -6
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/Pagination.stories.d.ts +1 -0
- package/dist/components/pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.stories.js +1 -0
- package/dist/components/pagination/Pagination.svelte +5 -5
- package/dist/components/passwordinput/PasswordInput.js +4 -3
- package/dist/components/passwordinput/PasswordInput.js.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.d.ts +1 -0
- package/dist/components/passwordinput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.js +1 -0
- package/dist/components/passwordinput/PasswordInput.svelte +10 -8
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/components/phonenumber/PhoneNumber.js +22 -0
- package/dist/components/phonenumber/PhoneNumber.js.map +1 -0
- package/dist/components/phonenumber/PhoneNumber.spec.js +103 -0
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts +14 -0
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts.map +1 -0
- package/dist/components/phonenumber/PhoneNumber.stories.js +116 -0
- package/dist/components/phonenumber/PhoneNumber.svelte +896 -0
- package/dist/components/phonenumber/PhoneNumber.svelte.d.ts +60 -0
- package/dist/components/phonenumber/PhoneNumber.svelte.d.ts.map +1 -0
- package/dist/components/phonenumber/README.md +27 -0
- package/dist/components/pincode/Pincode.js +2 -2
- package/dist/components/pincode/Pincode.js.map +1 -1
- package/dist/components/pincode/Pincode.stories.d.ts +1 -0
- package/dist/components/pincode/Pincode.stories.d.ts.map +1 -1
- package/dist/components/pincode/Pincode.stories.js +1 -0
- package/dist/components/pincode/Pincode.svelte +5 -5
- package/dist/components/quantityselector/QuantitySelector.js +3 -3
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts +1 -0
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +1 -0
- package/dist/components/quantityselector/QuantitySelector.svelte +11 -9
- package/dist/components/quantityselector/QuantitySelector.svelte.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +2 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radio/Radio.stories.d.ts +1 -0
- package/dist/components/radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/radio/Radio.stories.js +1 -0
- package/dist/components/radio/Radio.svelte +12 -3
- package/dist/components/radio/Radio.svelte.d.ts.map +1 -1
- package/dist/components/radiogroup/RadioGroup.js +2 -2
- package/dist/components/radiogroup/RadioGroup.stories.d.ts +1 -0
- package/dist/components/radiogroup/RadioGroup.stories.d.ts.map +1 -1
- package/dist/components/radiogroup/RadioGroup.stories.js +1 -0
- package/dist/components/radiogroup/RadioGroup.svelte +2 -2
- package/dist/components/segmentedcontrol/SegmentedControl.js +2 -2
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts +1 -0
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/segmentedcontrol/SegmentedControl.stories.js +1 -0
- package/dist/components/select/Select.js +3 -3
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.stories.d.ts +1 -0
- package/dist/components/select/Select.stories.d.ts.map +1 -1
- package/dist/components/select/Select.stories.js +1 -0
- package/dist/components/select/Select.svelte +7 -5
- package/dist/components/select/Select.svelte.d.ts.map +1 -1
- package/dist/components/starrating/README.md +22 -0
- package/dist/components/starrating/StarRating.js +4 -0
- package/dist/components/starrating/StarRating.js.map +1 -0
- package/dist/components/starrating/StarRating.spec.js +108 -0
- package/dist/components/starrating/StarRating.stories.d.ts +13 -0
- package/dist/components/starrating/StarRating.stories.d.ts.map +1 -0
- package/dist/components/starrating/StarRating.stories.js +82 -0
- package/dist/components/starrating/StarRating.svelte +227 -0
- package/dist/components/starrating/StarRating.svelte.d.ts +46 -0
- package/dist/components/starrating/StarRating.svelte.d.ts.map +1 -0
- package/dist/components/statusbadge/StatusBadge.js +2 -2
- package/dist/components/statusbadge/StatusBadge.js.map +1 -1
- package/dist/components/statusbadge/StatusBadge.stories.d.ts +1 -0
- package/dist/components/statusbadge/StatusBadge.stories.d.ts.map +1 -1
- package/dist/components/statusbadge/StatusBadge.stories.js +1 -0
- package/dist/components/statusbadge/StatusBadge.svelte +11 -11
- package/dist/components/statusdot/StatusDot.js +2 -2
- package/dist/components/statusdot/StatusDot.js.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.d.ts +1 -0
- package/dist/components/statusdot/StatusDot.stories.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.js +1 -0
- package/dist/components/statusdot/StatusDot.svelte +7 -4
- package/dist/components/statusmessage/README.md +11 -0
- package/dist/components/statusmessage/StatusMessage.js +4 -0
- package/dist/components/statusmessage/StatusMessage.js.map +1 -0
- package/dist/components/statusmessage/StatusMessage.spec.js +47 -0
- package/dist/components/statusmessage/StatusMessage.stories.d.ts +12 -0
- package/dist/components/statusmessage/StatusMessage.stories.d.ts.map +1 -0
- package/dist/components/statusmessage/StatusMessage.stories.js +38 -0
- package/dist/components/statusmessage/StatusMessage.svelte +84 -0
- package/dist/components/statusmessage/StatusMessage.svelte.d.ts +17 -0
- package/dist/components/statusmessage/StatusMessage.svelte.d.ts.map +1 -0
- package/dist/components/statusnotification/StatusNotification.js +2 -2
- package/dist/components/statusnotification/StatusNotification.js.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.d.ts +4 -0
- package/dist/components/statusnotification/StatusNotification.stories.d.ts.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.js +4 -0
- package/dist/components/statusnotification/StatusNotification.svelte +14 -13
- package/dist/components/steppercompact/README.md +13 -0
- package/dist/components/steppercompact/StepperCompact.js +4 -0
- package/dist/components/steppercompact/StepperCompact.js.map +1 -0
- package/dist/components/steppercompact/StepperCompact.spec.js +119 -0
- package/dist/components/steppercompact/StepperCompact.stories.d.ts +7 -0
- package/dist/components/steppercompact/StepperCompact.stories.d.ts.map +1 -0
- package/dist/components/steppercompact/StepperCompact.stories.js +29 -0
- package/dist/components/steppercompact/StepperCompact.svelte +123 -0
- package/dist/components/steppercompact/StepperCompact.svelte.d.ts +25 -0
- package/dist/components/steppercompact/StepperCompact.svelte.d.ts.map +1 -0
- package/dist/components/tab/Tab.js +2 -2
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/tab/Tab.svelte +1 -2
- package/dist/components/tab/Tab.svelte.d.ts +0 -1
- package/dist/components/tab/Tab.svelte.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.stories.d.ts +3 -0
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +3 -0
- package/dist/components/tabs/Tabs.svelte +1 -1
- package/dist/components/tag/README.md +30 -0
- package/dist/components/tag/Tag.js +4 -0
- package/dist/components/tag/Tag.js.map +1 -0
- package/dist/components/tag/Tag.stories.d.ts +13 -0
- package/dist/components/tag/Tag.stories.d.ts.map +1 -0
- package/dist/components/tag/Tag.stories.js +71 -0
- package/dist/components/{tags/TagRemovable.svelte → tag/Tag.svelte} +122 -26
- package/dist/components/tag/Tag.svelte.d.ts +65 -0
- package/dist/components/tag/Tag.svelte.d.ts.map +1 -0
- package/dist/components/textarea/Textarea.js +2 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/Textarea.stories.d.ts +1 -0
- package/dist/components/textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.stories.js +1 -0
- package/dist/components/textarea/Textarea.svelte +7 -5
- package/dist/components/textarea/Textarea.svelte.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.js +5 -5
- package/dist/components/textinput/Textinput.js.map +1 -1
- package/dist/components/textinput/Textinput.stories.d.ts +1 -0
- package/dist/components/textinput/Textinput.stories.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.stories.js +1 -0
- package/dist/components/textinput/Textinput.svelte +8 -6
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.js +3 -3
- package/dist/components/toaster/Toaster.js.map +1 -1
- package/dist/components/toaster/Toaster.stories.d.ts +3 -0
- package/dist/components/toaster/Toaster.stories.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.stories.js +3 -0
- package/dist/components/toaster/Toaster.svelte +13 -11
- package/dist/components/toaster/Toaster.svelte.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.js +2 -2
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/Toggle.stories.d.ts +1 -0
- package/dist/components/toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/toggle/Toggle.stories.js +1 -0
- package/dist/components/toggle/Toggle.svelte +20 -4
- package/dist/components/toggle/Toggle.svelte.d.ts.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.js +2 -2
- package/dist/components/togglegroup/ToggleGroup.js.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts +1 -0
- package/dist/components/togglegroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.stories.js +1 -0
- package/dist/components/togglegroup/ToggleGroup.svelte +2 -2
- package/dist/components/tooltip/Tooltip.js +3 -3
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.stories.js +1 -0
- package/dist/components/tooltip/Tooltip.svelte +4 -3
- package/dist/custom-element-forward-events.js +1 -1
- package/dist/custom-element-forward-events.js.map +1 -1
- package/dist/custom-element.js +3 -3
- package/dist/custom-element.js.map +1 -1
- package/dist/documentation/Svelte/usingPresets.mdx +2 -3
- package/dist/documentation/WebComponents/usingPresets.mdx +2 -3
- 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 +10 -6
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -6
- package/dist/slot.js +1 -1
- package/dist/slot.js.map +1 -1
- package/dist/svelte-component.js +2 -0
- package/dist/svelte-component.js.map +1 -0
- package/dist/this.js +1 -1
- package/dist/this.js.map +1 -1
- package/package.json +16 -18
- package/dist/components/tags/README.md +0 -9
- package/dist/components/tags/Tag.js +0 -4
- package/dist/components/tags/Tag.js.map +0 -1
- package/dist/components/tags/Tag.svelte +0 -218
- package/dist/components/tags/Tag.svelte.d.ts +0 -9
- package/dist/components/tags/Tag.svelte.d.ts.map +0 -1
- package/dist/components/tags/TagContextualised.js +0 -4
- package/dist/components/tags/TagContextualised.js.map +0 -1
- package/dist/components/tags/TagContextualised.svelte +0 -235
- package/dist/components/tags/TagContextualised.svelte.d.ts +0 -11
- package/dist/components/tags/TagContextualised.svelte.d.ts.map +0 -1
- package/dist/components/tags/TagInteractive.js +0 -4
- package/dist/components/tags/TagInteractive.js.map +0 -1
- package/dist/components/tags/TagInteractive.svelte +0 -223
- package/dist/components/tags/TagInteractive.svelte.d.ts +0 -10
- package/dist/components/tags/TagInteractive.svelte.d.ts.map +0 -1
- package/dist/components/tags/TagRemovable.js +0 -4
- package/dist/components/tags/TagRemovable.js.map +0 -1
- package/dist/components/tags/TagRemovable.svelte.d.ts +0 -11
- package/dist/components/tags/TagRemovable.svelte.d.ts.map +0 -1
- package/dist/components/tags/TagSelectable.js +0 -4
- package/dist/components/tags/TagSelectable.js.map +0 -1
- package/dist/components/tags/TagSelectable.svelte +0 -243
- package/dist/components/tags/TagSelectable.svelte.d.ts +0 -13
- package/dist/components/tags/TagSelectable.svelte.d.ts.map +0 -1
- package/dist/components/tags/Tags.stories.d.ts +0 -5
- package/dist/components/tags/Tags.stories.d.ts.map +0 -1
- package/dist/components/tags/Tags.stories.js +0 -41
- package/dist/components/tags/TagsContextualised.stories.d.ts +0 -5
- package/dist/components/tags/TagsContextualised.stories.d.ts.map +0 -1
- package/dist/components/tags/TagsContextualised.stories.js +0 -57
- package/dist/components/tags/TagsInteractive.stories.d.ts +0 -5
- package/dist/components/tags/TagsInteractive.stories.d.ts.map +0 -1
- package/dist/components/tags/TagsInteractive.stories.js +0 -61
- package/dist/components/tags/TagsRemovable.stories.d.ts +0 -5
- package/dist/components/tags/TagsRemovable.stories.d.ts.map +0 -1
- package/dist/components/tags/TagsRemovable.stories.js +0 -60
- package/dist/components/tags/TagsSelectable.stories.d.ts +0 -5
- package/dist/components/tags/TagsSelectable.stories.d.ts.map +0 -1
- package/dist/components/tags/TagsSelectable.stories.js +0 -76
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<svelte:options
|
|
2
|
+
customElement={{
|
|
3
|
+
tag: 'm-star-rating',
|
|
4
|
+
extend: customElementForwardEvents,
|
|
5
|
+
}}
|
|
6
|
+
/>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { customElementForwardEvents } from '../../utils';
|
|
10
|
+
import Star24 from '@mozaic-ds/icons-svelte/svelte/Star24/Star24.svelte';
|
|
11
|
+
import StarFilled24 from '@mozaic-ds/icons-svelte/svelte/StarFilled24/StarFilled24.svelte';
|
|
12
|
+
import StarHalf24 from '@mozaic-ds/icons-svelte/svelte/StarHalf24/StarHalf24.svelte';
|
|
13
|
+
/**
|
|
14
|
+
* A Star rating visually represents a score or evaluation and can be used to display a rating or allow users to rate an item, such as a product or service. It serves two main purposes: collecting user feedback by enabling individuals to express their experience and providing social proof by displaying ratings from other users to assist decision-making. Rating Stars are commonly found in e-commerce, review systems, and feedback interfaces, offering a quick and intuitive way to assess quality or satisfaction.
|
|
15
|
+
*/
|
|
16
|
+
interface Props {
|
|
17
|
+
/**
|
|
18
|
+
* The current rating value of the component.
|
|
19
|
+
*/
|
|
20
|
+
rating: number;
|
|
21
|
+
/**
|
|
22
|
+
* Determines whether the rating is interactive or read-only.
|
|
23
|
+
* When true, all user interactions (click, hover, keyboard) are disabled.
|
|
24
|
+
* Automatically set to true when `compact`, `href`, or `information` are provided.
|
|
25
|
+
*/
|
|
26
|
+
readonly?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the visual size of the star icons and the accompanying text.
|
|
29
|
+
*/
|
|
30
|
+
size?: 's' | 'm' | 'l';
|
|
31
|
+
/**
|
|
32
|
+
* Enables a compact display mode that shows only one star instead of five.
|
|
33
|
+
* Typically used for summaries or quick visual cues.
|
|
34
|
+
* When enabled, the component automatically becomes read-only.
|
|
35
|
+
*/
|
|
36
|
+
compact?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Specifies the color scheme of the stars.
|
|
39
|
+
*/
|
|
40
|
+
appearance?: 'standard' | 'accent';
|
|
41
|
+
/**
|
|
42
|
+
* Optional text displayed next to the star rating.
|
|
43
|
+
* If provided, the component automatically becomes read-only.
|
|
44
|
+
*/
|
|
45
|
+
text?: string;
|
|
46
|
+
/**
|
|
47
|
+
* URL for the link.
|
|
48
|
+
*/
|
|
49
|
+
href?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Where to open the link.
|
|
52
|
+
*/
|
|
53
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let {
|
|
57
|
+
rating = $bindable(),
|
|
58
|
+
readonly,
|
|
59
|
+
size = 'm',
|
|
60
|
+
compact,
|
|
61
|
+
appearance = 'standard',
|
|
62
|
+
text,
|
|
63
|
+
href,
|
|
64
|
+
target,
|
|
65
|
+
}: Props = $props();
|
|
66
|
+
|
|
67
|
+
let hoverValue: number | null = $state(null);
|
|
68
|
+
const rootTag = $derived(href ? 'a' : 'div');
|
|
69
|
+
|
|
70
|
+
const isReadonly = $derived([readonly, compact, href, text].some(Boolean));
|
|
71
|
+
|
|
72
|
+
const classObject = $derived({
|
|
73
|
+
'mc-star-rating': true,
|
|
74
|
+
'mc-star-rating--link': href,
|
|
75
|
+
'mc-star-rating--slider': !isReadonly,
|
|
76
|
+
[`mc-star-rating--${size}`]: size,
|
|
77
|
+
[`mc-star-rating--${appearance}`]: appearance,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const displayValue = $derived(hoverValue ?? rating);
|
|
81
|
+
const maxValue = $derived(compact ? 1 : 5);
|
|
82
|
+
|
|
83
|
+
function getStarComponent(index: number) {
|
|
84
|
+
if (compact || displayValue >= index + 1) {
|
|
85
|
+
return StarFilled24;
|
|
86
|
+
} else if (isReadonly && displayValue >= index + 0.5) {
|
|
87
|
+
return StarHalf24;
|
|
88
|
+
} else {
|
|
89
|
+
return Star24;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function onHover(index: number) {
|
|
94
|
+
hoverValue = index + 1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function clearHover() {
|
|
98
|
+
hoverValue = null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function onClick(index: number) {
|
|
102
|
+
rating = index + 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function onKeydown(e: KeyboardEvent) {
|
|
106
|
+
const key = e.key;
|
|
107
|
+
let newValue = Math.floor(rating);
|
|
108
|
+
|
|
109
|
+
if (key === 'ArrowRight') {
|
|
110
|
+
newValue = Math.min(maxValue, newValue + 1);
|
|
111
|
+
} else if (key === 'ArrowLeft') {
|
|
112
|
+
newValue = Math.max(1, newValue - 1);
|
|
113
|
+
} else return;
|
|
114
|
+
|
|
115
|
+
rating = newValue;
|
|
116
|
+
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const wrapperAttrs = $derived(
|
|
121
|
+
isReadonly
|
|
122
|
+
? {
|
|
123
|
+
tabindex: -1,
|
|
124
|
+
}
|
|
125
|
+
: {
|
|
126
|
+
onkeydown: onKeydown,
|
|
127
|
+
onmouseleave: clearHover,
|
|
128
|
+
onblur: clearHover,
|
|
129
|
+
tabindex: 0,
|
|
130
|
+
'aria-valuemin': 0,
|
|
131
|
+
'aria-valuemax': maxValue,
|
|
132
|
+
'aria-valuenow': rating,
|
|
133
|
+
'aria-readonly': false,
|
|
134
|
+
},
|
|
135
|
+
);
|
|
136
|
+
</script>
|
|
137
|
+
|
|
138
|
+
<svelte:element this={rootTag} {href} {target} class={classObject}>
|
|
139
|
+
<div
|
|
140
|
+
class="mc-star-rating__wrapper"
|
|
141
|
+
role={isReadonly ? 'img' : 'slider'}
|
|
142
|
+
aria-label={`Note ${displayValue} sur ${maxValue}`}
|
|
143
|
+
{...wrapperAttrs}
|
|
144
|
+
>
|
|
145
|
+
{#each Array.from({ length: maxValue }).keys() as index (index)}
|
|
146
|
+
{@const Star = getStarComponent(index)}
|
|
147
|
+
|
|
148
|
+
<span
|
|
149
|
+
class="mc-star-rating__icon"
|
|
150
|
+
{...!isReadonly
|
|
151
|
+
? {
|
|
152
|
+
onmousemove: () => onHover(index),
|
|
153
|
+
onclick: () => onClick(index),
|
|
154
|
+
}
|
|
155
|
+
: {}}
|
|
156
|
+
>
|
|
157
|
+
<Star />
|
|
158
|
+
</span>
|
|
159
|
+
{/each}
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
{#if text || href}
|
|
163
|
+
<span class="mc-star-rating__info">
|
|
164
|
+
{text || href}
|
|
165
|
+
</span>
|
|
166
|
+
{/if}
|
|
167
|
+
</svelte:element>
|
|
168
|
+
|
|
169
|
+
<style>/**
|
|
170
|
+
* Do not edit directly, this file was auto-generated.
|
|
171
|
+
*/
|
|
172
|
+
.mc-star-rating {
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: 0.5rem;
|
|
176
|
+
}
|
|
177
|
+
.mc-star-rating--standard .mc-star-rating__icon {
|
|
178
|
+
fill: var(--star-rating-color-icon-standard, #000000);
|
|
179
|
+
}
|
|
180
|
+
.mc-star-rating--accent .mc-star-rating__icon {
|
|
181
|
+
fill: var(--star-rating-color-icon-accent, #ea7315);
|
|
182
|
+
}
|
|
183
|
+
.mc-star-rating--slider {
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
}
|
|
186
|
+
.mc-star-rating--link {
|
|
187
|
+
text-decoration: none;
|
|
188
|
+
cursor: pointer;
|
|
189
|
+
}
|
|
190
|
+
.mc-star-rating--link:not(:hover) .mc-star-rating__info {
|
|
191
|
+
text-decoration: underline;
|
|
192
|
+
}
|
|
193
|
+
.mc-star-rating--s .mc-star-rating__icon {
|
|
194
|
+
width: 1.25rem;
|
|
195
|
+
height: 1.25rem;
|
|
196
|
+
}
|
|
197
|
+
.mc-star-rating--s .mc-star-rating__info {
|
|
198
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
199
|
+
}
|
|
200
|
+
.mc-star-rating--m .mc-star-rating__icon {
|
|
201
|
+
width: 1.5rem;
|
|
202
|
+
height: 1.5rem;
|
|
203
|
+
}
|
|
204
|
+
.mc-star-rating--m .mc-star-rating__info {
|
|
205
|
+
font-size: var(--font-size-150, 1rem);
|
|
206
|
+
}
|
|
207
|
+
.mc-star-rating--l .mc-star-rating__icon {
|
|
208
|
+
width: 2rem;
|
|
209
|
+
height: 2rem;
|
|
210
|
+
}
|
|
211
|
+
.mc-star-rating--l .mc-star-rating__info {
|
|
212
|
+
font-size: var(--font-size-200, 1.125rem);
|
|
213
|
+
}
|
|
214
|
+
.mc-star-rating__wrapper {
|
|
215
|
+
display: flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
}
|
|
218
|
+
.mc-star-rating__info {
|
|
219
|
+
font-weight: var(--font-weight-medium, 600);
|
|
220
|
+
line-height: var(--line-height-s, 1.3);
|
|
221
|
+
color: var(--star-rating-color-text, #000000);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.mc-star-rating__icon :global(svg) {
|
|
225
|
+
height: 100%;
|
|
226
|
+
width: 100%;
|
|
227
|
+
}</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Star rating visually represents a score or evaluation and can be used to display a rating or allow users to rate an item, such as a product or service. It serves two main purposes: collecting user feedback by enabling individuals to express their experience and providing social proof by displaying ratings from other users to assist decision-making. Rating Stars are commonly found in e-commerce, review systems, and feedback interfaces, offering a quick and intuitive way to assess quality or satisfaction.
|
|
3
|
+
*/
|
|
4
|
+
interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* The current rating value of the component.
|
|
7
|
+
*/
|
|
8
|
+
rating: number;
|
|
9
|
+
/**
|
|
10
|
+
* Determines whether the rating is interactive or read-only.
|
|
11
|
+
* When true, all user interactions (click, hover, keyboard) are disabled.
|
|
12
|
+
* Automatically set to true when `compact`, `href`, or `information` are provided.
|
|
13
|
+
*/
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Defines the visual size of the star icons and the accompanying text.
|
|
17
|
+
*/
|
|
18
|
+
size?: 's' | 'm' | 'l';
|
|
19
|
+
/**
|
|
20
|
+
* Enables a compact display mode that shows only one star instead of five.
|
|
21
|
+
* Typically used for summaries or quick visual cues.
|
|
22
|
+
* When enabled, the component automatically becomes read-only.
|
|
23
|
+
*/
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the color scheme of the stars.
|
|
27
|
+
*/
|
|
28
|
+
appearance?: 'standard' | 'accent';
|
|
29
|
+
/**
|
|
30
|
+
* Optional text displayed next to the star rating.
|
|
31
|
+
* If provided, the component automatically becomes read-only.
|
|
32
|
+
*/
|
|
33
|
+
text?: string;
|
|
34
|
+
/**
|
|
35
|
+
* URL for the link.
|
|
36
|
+
*/
|
|
37
|
+
href?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Where to open the link.
|
|
40
|
+
*/
|
|
41
|
+
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
42
|
+
}
|
|
43
|
+
declare const StarRating: import("svelte").Component<Props, {}, "rating">;
|
|
44
|
+
type StarRating = ReturnType<typeof StarRating>;
|
|
45
|
+
export default StarRating;
|
|
46
|
+
//# sourceMappingURL=StarRating.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StarRating.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/starrating/StarRating.svelte.ts"],"names":[],"mappings":"AAQE;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;IACnC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;CAClD;AA0HH,QAAA,MAAM,UAAU,iDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as v,p as m,a as h,b as l,f as p,r as y,d as u,s as k,t as w,h as _,i as x,j as b,e as n,g as $}from"../../custom-element.js";import{a as S}from"../../attributes.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-
|
|
3
|
+
*/.mc-status-badge.svelte-1oceydf {background-color:var(--status-badge-color-background-info, #e1f3f9);border:var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-info, #a7d9ed);font-weight:var(--font-weight-regular, 400);font-size:var(--font-size-100, 0.875rem);display:inline-flex;align-items:center;gap:0.25rem;border-radius:var(--border-radius-s, 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-width-s, 0.0625rem) 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-width-s, 0.0625rem) 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-width-s, 0.0625rem) 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-width-s, 0.0625rem) solid var(--status-badge-color-border-neutral, #cccccc);}.mc-status-dot.svelte-1oceydf {background-color:var(--status-dot-color-background-info, #0b96cc);height:0.5rem;width:0.5rem;border-radius:var(--border-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,e){m(e,!0),h(o,j);let t=l(e,"status",7,"info"),a=l(e,"label",7),i=y(e,["$$slots","$$events","$$legacy","$$host","status","label"]);var g={get status(){return t()},set status(s="info"){t(s),b()},get label(){return a()},set label(s){a(s),b()}},r=D();S(r,()=>({class:["mc-status-badge",`mc-status-badge--${t()}`],...i}),void 0,void 0,void 0,"svelte-1oceydf");var d=u(r);z(d,{get status(){return t()},size:"m"});var c=k(d,2),f=u(c,!0);return n(c),n(r),w(()=>$(f,a())),_(o,r),x(g)}customElements.define("m-status-badge",v(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 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","
|
|
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, ...attrs }: Props = $props();\n</script>\n\n<div class={['mc-status-badge', `mc-status-badge--${status}`]} {...attrs}>\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","attrs","$.rest_props"],"mappings":";;6sEAAA,gBAkBQ,IAAAA,iBAAS,MAAM,EAAEC,EAAKC,EAAAC,EAAA,QAAA,CAAA,EAAKC,EAAKC,EAAAF,EAAA,0GAAvB,OAAM,2EAGV,MAAA,CAAA,sCAAuCH,EAAM,CAAA,EAAA,KAASI,iJAE3BH,EAAK,CAAA,CAAA,aAJ7C"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAGrE,OAAO,sBAAsB,CAAC;AAE9B,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"}
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
status?: 'info' | 'success' | 'warning' | 'error' | 'neutral';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
let { status = 'info', label }: Props = $props();
|
|
19
|
+
let { status = 'info', label, ...attrs }: Props = $props();
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<div class={['mc-status-badge', `mc-status-badge--${status}`]}>
|
|
22
|
+
<div class={['mc-status-badge', `mc-status-badge--${status}`]} {...attrs}>
|
|
23
23
|
<StatusDot {status} size="m" />
|
|
24
24
|
<span class="mc-status-badge__label">{label}</span>
|
|
25
25
|
</div>
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
* Do not edit directly, this file was auto-generated.
|
|
29
29
|
*/
|
|
30
30
|
.mc-status-badge {
|
|
31
|
-
background-color: var(--status-badge-color-background-
|
|
32
|
-
border: var(--border-s,
|
|
33
|
-
border-radius: var(--radius-s, 0.25rem);
|
|
31
|
+
background-color: var(--status-badge-color-background-info, #e1f3f9);
|
|
32
|
+
border: var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-info, #a7d9ed);
|
|
34
33
|
font-weight: var(--font-weight-regular, 400);
|
|
35
34
|
font-size: var(--font-size-100, 0.875rem);
|
|
36
35
|
display: inline-flex;
|
|
37
36
|
align-items: center;
|
|
38
37
|
gap: 0.25rem;
|
|
38
|
+
border-radius: var(--border-radius-s, 0.25rem);
|
|
39
39
|
padding-right: 0.5rem;
|
|
40
40
|
padding-left: 0.5rem;
|
|
41
41
|
text-transform: lowercase;
|
|
@@ -50,26 +50,26 @@
|
|
|
50
50
|
}
|
|
51
51
|
.mc-status-badge--success {
|
|
52
52
|
background-color: var(--status-badge-color-background-success, #ebf5de);
|
|
53
|
-
border: var(--border-s,
|
|
53
|
+
border: var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-success, #c5e39e);
|
|
54
54
|
}
|
|
55
55
|
.mc-status-badge--error {
|
|
56
56
|
background-color: var(--status-badge-color-background-error, #fdeaea);
|
|
57
|
-
border: var(--border-s,
|
|
57
|
+
border: var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-error, #f8bcbb);
|
|
58
58
|
}
|
|
59
59
|
.mc-status-badge--warning {
|
|
60
60
|
background-color: var(--status-badge-color-background-warning, #fdf1e8);
|
|
61
|
-
border: var(--border-s,
|
|
61
|
+
border: var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-warning, #f8d2b3);
|
|
62
62
|
}
|
|
63
63
|
.mc-status-badge--neutral {
|
|
64
64
|
background-color: var(--status-badge-color-background-neutral, #f2f2f2);
|
|
65
|
-
border: var(--border-s,
|
|
65
|
+
border: var(--border-width-s, 0.0625rem) solid var(--status-badge-color-border-neutral, #cccccc);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.mc-status-dot {
|
|
69
|
-
background-color: var(--status-dot-color-background-
|
|
69
|
+
background-color: var(--status-dot-color-background-info, #0b96cc);
|
|
70
70
|
height: 0.5rem;
|
|
71
71
|
width: 0.5rem;
|
|
72
|
-
border-radius: var(--radius-full, 100%);
|
|
72
|
+
border-radius: var(--border-radius-full, 100%);
|
|
73
73
|
display: inline-block;
|
|
74
74
|
}
|
|
75
75
|
.mc-status-dot--s {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as l,p as n,a as
|
|
1
|
+
import{c as l,p as n,a as m,b as c,f as v,r as p,h as g,i as b,j as u}from"../../custom-element.js";import{a as h}from"../../attributes.js";var f=v("<div></div>");const k={hash:"svelte-14acsp3",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
*/.mc-status-dot.svelte-14acsp3 {background-color:var(--status-dot-color-background-
|
|
3
|
+
*/.mc-status-dot.svelte-14acsp3 {background-color:var(--status-dot-color-background-info, #0b96cc);height:0.5rem;width:0.5rem;border-radius:var(--border-radius-full, 100%);display:inline-block;}.mc-status-dot--s.svelte-14acsp3 {height:0.25rem;width:0.25rem;}.mc-status-dot--l.svelte-14acsp3 {height:1rem;width:1rem;}.mc-status-dot--success.svelte-14acsp3 {background-color:var(--status-dot-color-background-success, #3f9e10);}.mc-status-dot--error.svelte-14acsp3 {background-color:var(--status-dot-color-background-error, #ea302d);}.mc-status-dot--warning.svelte-14acsp3 {background-color:var(--status-dot-color-background-warning, #ea7315);}.mc-status-dot--neutral.svelte-14acsp3 {background-color:var(--status-dot-color-background-neutral, #808080);}`};function w(o,t){n(t,!0),m(o,k);let s=c(t,"size",7,"m"),a=c(t,"status",7,"info"),d=p(t,["$$slots","$$events","$$legacy","$$host","size","status"]);var i={get size(){return s()},set size(e="m"){s(e),u()},get status(){return a()},set status(e="info"){a(e),u()}},r=f();return h(r,()=>({class:["mc-status-dot",`mc-status-dot--${s()}`,`mc-status-dot--${a()}`],...d}),void 0,void 0,void 0,"svelte-14acsp3"),g(o,r),b(i)}customElements.define("m-status-dot",l(w,{size:{},status:{}},[],[],!0));export{w as S};
|
|
4
4
|
//# sourceMappingURL=StatusDot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.js","sources":["../../../src/components/statusdot/StatusDot.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-status-dot' }} />\n\n<script lang=\"ts\">\n /**\n * A Status dot is a small visual indicator used to represent the state or condition of an element. It is often color-coded to convey different statuses at a glance, such as availability, activity, or urgency. Status Dots are commonly found in user presence indicators, system statuses, or process tracking to provide quick, unobtrusive feedback.\n */\n interface Props {\n /**\n * Allows to define the status dot type.\n */\n status?: 'info' | 'success' | 'warning' | 'error' | 'neutral';\n /**\n * Determines the size of the status dot.\n */\n size?: 's' | 'm' | 'l';\n }\n\n let { size = 'm', status = 'info' }: Props = $props();\n</script>\n\n<div
|
|
1
|
+
{"version":3,"file":"StatusDot.js","sources":["../../../src/components/statusdot/StatusDot.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-status-dot' }} />\n\n<script lang=\"ts\">\n /**\n * A Status dot is a small visual indicator used to represent the state or condition of an element. It is often color-coded to convey different statuses at a glance, such as availability, activity, or urgency. Status Dots are commonly found in user presence indicators, system statuses, or process tracking to provide quick, unobtrusive feedback.\n */\n interface Props {\n /**\n * Allows to define the status dot type.\n */\n status?: 'info' | 'success' | 'warning' | 'error' | 'neutral';\n /**\n * Determines the size of the status dot.\n */\n size?: 's' | 'm' | 'l';\n }\n\n let { size = 'm', status = 'info', ...attrs }: Props = $props();\n</script>\n\n<div\n class={['mc-status-dot', `mc-status-dot--${size}`, `mc-status-dot--${status}`]}\n {...attrs}\n></div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/status-dot';\n</style>\n"],"names":["size","status","attrs","$.rest_props","$$props"],"mappings":";;mwBAAA,gBAiBQ,IAAAA,eAAO,GAAG,EAAEC,iBAAS,MAAM,EAAKC,EAAKC,EAAAC,EAAA,qGAA9B,IAAG,iDAAW,OAAM,0CAIzB,kCAAmCJ,EAAI,CAAA,qBAAsBC,GAAM,OACvEC,sDAJN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.stories.d.ts","sourceRoot":"","sources":["../../../src/components/statusdot/StatusDot.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"StatusDot.stories.d.ts","sourceRoot":"","sources":["../../../src/components/statusdot/StatusDot.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,oBAAoB,CAAC;AAE5B,QAAA,MAAM,IAAI,EAAE,IAmBX,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;AAEF,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC"}
|
|
@@ -15,19 +15,22 @@
|
|
|
15
15
|
size?: 's' | 'm' | 'l';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
let { size = 'm', status = 'info' }: Props = $props();
|
|
18
|
+
let { size = 'm', status = 'info', ...attrs }: Props = $props();
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<div
|
|
21
|
+
<div
|
|
22
|
+
class={['mc-status-dot', `mc-status-dot--${size}`, `mc-status-dot--${status}`]}
|
|
23
|
+
{...attrs}
|
|
24
|
+
></div>
|
|
22
25
|
|
|
23
26
|
<style>/**
|
|
24
27
|
* Do not edit directly, this file was auto-generated.
|
|
25
28
|
*/
|
|
26
29
|
.mc-status-dot {
|
|
27
|
-
background-color: var(--status-dot-color-background-
|
|
30
|
+
background-color: var(--status-dot-color-background-info, #0b96cc);
|
|
28
31
|
height: 0.5rem;
|
|
29
32
|
width: 0.5rem;
|
|
30
|
-
border-radius: var(--radius-full, 100%);
|
|
33
|
+
border-radius: var(--border-radius-full, 100%);
|
|
31
34
|
display: inline-block;
|
|
32
35
|
}
|
|
33
36
|
.mc-status-dot--s {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `m-status-message`
|
|
2
|
+
|
|
3
|
+
A Status Message is a compact component that combines an icon and concise text to communicate system states or user feedback in limited interface space. The icon and message work together as a unified structure to provide clear, immediate understanding of the current status. Status Messages are designed for contexts where space is constrained but clear communication is essential, offering quick recognition through color-coded icons paired with brief, actionable text.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Description | Type | Default |
|
|
8
|
+
|------|-------------|------|---------|
|
|
9
|
+
| `status` | Allows to define the status message style. | `'info'` `'success'` `'warning'` `'error'` `'neutral'` `'inprogress'` | `info` |
|
|
10
|
+
| `label*` | Label of the status message. | `string` | |
|
|
11
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as w,p as h,b as l,A as j,t as _,h as v,i as p,j as i,l as b,m as N,a as q,x as G,k as H,f as k,r as J,d as x,s as K,n as O,e as y,g as P}from"../../custom-element.js";import{i as Q}from"../../if.js";import{c as R}from"../../svelte-component.js";import{s as f,b as C,a as T}from"../../attributes.js";import"../../legacy.js";import{C as U}from"../../CrossCircleFilled24.js";import{L as V}from"../loader/Loader.js";var X=j('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px" height="24px"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2m1 2a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0z"></path></svg>');function z(u,s){h(s,!1);let n=l(s,"id",12,void 0),a=l(s,"style",12,void 0),o=l(s,"className",12,void 0),r=l(s,"fill",12,void 0),m=l(s,"size",12,"1.5rem");var d={get id(){return n()},set id(e){n(e),i()},get style(){return a()},set style(e){a(e),i()},get className(){return o()},set className(e){o(e),i()},get fill(){return r()},set fill(e){r(e),i()},get size(){return m()},set size(e){m(e),i()}},t=X();return _(()=>{f(t,"id",n()),C(t,a()),b(t,0,N(o())),f(t,"fill",r())}),v(u,t),p(d)}customElements.define("info-circle-filled-24",w(z,{id:{},style:{},className:{},fill:{},size:{}},[],[],!1));var Y=j('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px" height="24px"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m1 6a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0zm-1 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"></path></svg>');function E(u,s){h(s,!1);let n=l(s,"id",12,void 0),a=l(s,"style",12,void 0),o=l(s,"className",12,void 0),r=l(s,"fill",12,void 0),m=l(s,"size",12,"1.5rem");var d={get id(){return n()},set id(e){n(e),i()},get style(){return a()},set style(e){a(e),i()},get className(){return o()},set className(e){o(e),i()},get fill(){return r()},set fill(e){r(e),i()},get size(){return m()},set size(e){m(e),i()}},t=Y();return _(()=>{f(t,"id",n()),C(t,a()),b(t,0,N(o())),f(t,"fill",r())}),v(u,t),p(d)}customElements.define("warning-circle-filled-24",w(E,{id:{},style:{},className:{},fill:{},size:{}},[],[],!1));var Z=j('<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24px" height="24px"><path fill-rule="evenodd" d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m5.207 6.793a1 1 0 0 1 0 1.414l-5.5 5.5a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L11 13.586l4.793-4.793a1 1 0 0 1 1.414 0"></path></svg>');function F(u,s){h(s,!1);let n=l(s,"id",12,void 0),a=l(s,"style",12,void 0),o=l(s,"className",12,void 0),r=l(s,"fill",12,void 0),m=l(s,"size",12,"1.5rem");var d={get id(){return n()},set id(e){n(e),i()},get style(){return a()},set style(e){a(e),i()},get className(){return o()},set className(e){o(e),i()},get fill(){return r()},set fill(e){r(e),i()},get size(){return m()},set size(e){m(e),i()}},t=Z();return _(()=>{f(t,"id",n()),C(t,a()),b(t,0,N(o())),f(t,"fill",r())}),v(u,t),p(d)}customElements.define("check-circle-filled-24",w(F,{id:{},style:{},className:{},fill:{},size:{}},[],[],!1));var $=k('<span class="mc-status-message__icon svelte-o2wjin"><!></span>'),ee=k('<div><!> <p class="mc-status-message__description svelte-o2wjin"> </p></div>');const se={hash:"svelte-o2wjin",code:`/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/.mc-status-message.svelte-o2wjin .mc-status-message__icon:where(.svelte-o2wjin) {fill:var(--status-message-color-icon-info, #0b96cc);}.mc-status-message.svelte-o2wjin {display:inline-flex;gap:0.25rem;align-items:center;}.mc-status-message__icon.svelte-o2wjin {width:1.5rem;height:1.5rem;}.mc-status-message__description.svelte-o2wjin {margin:0;font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);color:var(--action-bottom-bar-color-status-item-text, #404040);}.mc-status-message--success.svelte-o2wjin .mc-status-message__icon:where(.svelte-o2wjin) {fill:var(--status-message-color-icon-success, #3f9e10);}.mc-status-message--error.svelte-o2wjin .mc-status-message__icon:where(.svelte-o2wjin) {fill:var(--status-message-color-icon-error, #ea302d);}.mc-status-message--warning.svelte-o2wjin .mc-status-message__icon:where(.svelte-o2wjin) {fill:var(--status-message-color-icon-warning, #ea7315);}.mc-status-message--neutral.svelte-o2wjin .mc-status-message__icon:where(.svelte-o2wjin) {fill:var(--status-message-color-icon-neutral, #808080);}`};function te(u,s){h(s,!0),q(u,se);let n=l(s,"label",7),a=l(s,"status",7,"info"),o=J(s,["$$slots","$$events","$$legacy","$$host","label","status"]);const r=[{status:"info",component:z},{status:"success",component:F},{status:"warning",component:E},{status:"error",component:U},{status:"neutral",component:z}];function m(c){return r.find(g=>g.status===c)||r[0]}let d=G(H(m(a())));var t={get label(){return n()},set label(c){n(c),i()},get status(){return a()},set status(c="info"){a(c),i()}},e=ee();T(e,()=>({class:["mc-status-message",`mc-status-message--${a()}`],...o}),void 0,void 0,void 0,"svelte-o2wjin");var S=x(e);{var B=c=>{var g=$(),D=x(g);R(D,()=>O(d).component,(I,W)=>{W(I,{"aria-hidden":"true"})}),y(g),v(c,g)},L=c=>{V(c,{size:"s"})};Q(S,c=>{a()!=="inprogress"?c(B):c(L,!1)})}var M=K(S,2),A=x(M,!0);return y(M),y(e),_(()=>P(A,n())),v(u,e),p(t)}customElements.define("m-status-message",w(te,{label:{},status:{}},[],[],!0));
|
|
4
|
+
//# sourceMappingURL=StatusMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusMessage.js","sources":["../../../node_modules/@mozaic-ds/icons-svelte/dist/components/InfoCircleFilled24/InfoCircleFilled24.svelte","../../../node_modules/@mozaic-ds/icons-svelte/dist/components/WarningCircleFilled24/WarningCircleFilled24.svelte","../../../node_modules/@mozaic-ds/icons-svelte/dist/components/CheckCircleFilled24/CheckCircleFilled24.svelte","../../../src/components/statusmessage/StatusMessage.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'info-circle-filled-24', shadow: 'none' }} />\n<script>\n export let id = undefined;\n export let style = undefined;\n export let className = undefined;\n export let fill = undefined;\n export let size = \"1.5rem\";\n</script>\n\n<svg aria-hidden=\"true\" id={id} style={style} class={className} fill={fill} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\"><path fill-rule=\"evenodd\" d=\"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2m1 2a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0z\"/></svg>","<svelte:options customElement={{ tag: 'warning-circle-filled-24', shadow: 'none' }} />\n<script>\n export let id = undefined;\n export let style = undefined;\n export let className = undefined;\n export let fill = undefined;\n export let size = \"1.5rem\";\n</script>\n\n<svg aria-hidden=\"true\" id={id} style={style} class={className} fill={fill} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\"><path fill-rule=\"evenodd\" d=\"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m1 6a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0zm-1 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2\"/></svg>","<svelte:options customElement={{ tag: 'check-circle-filled-24', shadow: 'none' }} />\n<script>\n export let id = undefined;\n export let style = undefined;\n export let className = undefined;\n export let fill = undefined;\n export let size = \"1.5rem\";\n</script>\n\n<svg aria-hidden=\"true\" id={id} style={style} class={className} fill={fill} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\"><path fill-rule=\"evenodd\" d=\"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m5.207 6.793a1 1 0 0 1 0 1.414l-5.5 5.5a1 1 0 0 1-1.414 0l-3-3a1 1 0 1 1 1.414-1.414L11 13.586l4.793-4.793a1 1 0 0 1 1.414 0\"/></svg>","<svelte:options customElement={{ tag: 'm-status-message' }} />\n\n<script lang=\"ts\">\n import InfoCircleFilled24 from '@mozaic-ds/icons-svelte/svelte/InfoCircleFilled24/InfoCircleFilled24.svelte';\n import WarningCircleFilled24 from '@mozaic-ds/icons-svelte/svelte/WarningCircleFilled24/WarningCircleFilled24.svelte';\n import CrossCircleFilled24 from '@mozaic-ds/icons-svelte/svelte/CrossCircleFilled24/CrossCircleFilled24.svelte';\n import CheckCircleFilled24 from '@mozaic-ds/icons-svelte/svelte/CheckCircleFilled24/CheckCircleFilled24.svelte';\n import Loader from '../loader/Loader.svelte';\n /**\n * A Status Message is a compact component that combines an icon and concise text to communicate system states or user feedback in limited interface space. The icon and message work together as a unified structure to provide clear, immediate understanding of the current status. Status Messages are designed for contexts where space is constrained but clear communication is essential, offering quick recognition through color-coded icons paired with brief, actionable text.\n */\n interface Props {\n /**\n * Allows to define the status message style.\n */\n status?: 'info' | 'success' | 'warning' | 'error' | 'neutral' | 'inprogress';\n /**\n * Label of the status message.\n */\n label: string;\n }\n\n let { label, status = 'info', ...attrs }: Props = $props();\n\n const iconMap = [\n { status: 'info', component: InfoCircleFilled24 },\n { status: 'success', component: CheckCircleFilled24 },\n { status: 'warning', component: WarningCircleFilled24 },\n { status: 'error', component: CrossCircleFilled24 },\n { status: 'neutral', component: InfoCircleFilled24 },\n ];\n\n function getSelected(status: string) {\n return iconMap.find((icon) => icon.status === status) || iconMap[0];\n }\n\n let selected = $state(getSelected(status));\n</script>\n\n<div class={['mc-status-message', `mc-status-message--${status}`]} {...attrs}>\n {#if status !== 'inprogress'}\n <span class=\"mc-status-message__icon\">\n <selected.component aria-hidden=\"true\" />\n </span>\n {:else}\n <Loader size=\"s\" />\n {/if}\n <p class=\"mc-status-message__description\">{label}</p>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/status-message';\n</style>\n"],"names":["id","style","className","fill","size","label","$.prop","$$props","status","attrs","$.rest_props","iconMap","InfoCircleFilled24","CheckCircleFilled24","WarningCircleFilled24","CrossCircleFilled24","getSelected","icon","selected","$.state","$.proxy","$$render","consequent","alternate"],"mappings":"guBAAA,SAEa,IAAAA,cAAK,MAAS,EACdC,iBAAQ,MAAS,EACjBC,qBAAY,MAAS,EACrBC,gBAAO,MAAS,EAChBC,gBAAO,QAAQ,gRAGAJ,GAAE,MAAUC,GAAK,UAASC,EAAS,CAAA,CAAA,aAAQC,GAAI,eAF3E,uaCPA,SAEa,IAAAH,cAAK,MAAS,EACdC,iBAAQ,MAAS,EACjBC,qBAAY,MAAS,EACrBC,gBAAO,MAAS,EAChBC,gBAAO,QAAQ,gRAGAJ,GAAE,MAAUC,GAAK,UAASC,EAAS,CAAA,CAAA,aAAQC,GAAI,eAF3E,keCPA,SAEa,IAAAH,cAAK,MAAS,EACdC,iBAAQ,MAAS,EACjBC,qBAAY,MAAS,EACrBC,gBAAO,MAAS,EAChBC,gBAAO,QAAQ,gRAGAJ,GAAE,MAAUC,GAAK,UAASC,EAAS,CAAA,CAAA,aAAQC,GAAI,eAF3E;;6mCCPA,qBAsBQE,EAAKC,EAAAC,EAAA,QAAA,CAAA,EAAEC,iBAAS,MAAM,EAAKC,EAAKC,EAAAH,EAAA,mEAEhCI,EAAO,CACT,CAAA,OAAQ,OAAQ,UAAWC,CAAkB,EAC7C,CAAA,OAAQ,UAAW,UAAWC,CAAmB,EACjD,CAAA,OAAQ,UAAW,UAAWC,CAAqB,EACnD,CAAA,OAAQ,QAAS,UAAWC,CAAmB,EAC/C,CAAA,OAAQ,UAAW,UAAWH,CAAkB,YAG3CI,EAAYR,EAAgB,CAC5B,OAAAG,EAAQ,KAAMM,GAASA,EAAK,SAAWT,CAAM,GAAKG,EAAQ,CAAC,CACpE,KAEIO,EAAQC,EAAAC,EAAUJ,EAAYR,EAAM,CAAA,CAAA,CAAA,8FAdlB,OAAM,6BAiBjB,MAAA,CAAA,0CAA2CA,EAAM,CAAA,EAAA,KAASC,0LAChED,EAAM,IAAK,aAAYa,EAAAC,CAAA,EAAAD,EAAAE,EAAA,EAAA,sDAOelB,EAAK,CAAA,CAAA,aAVlD","x_google_ignoreList":[0,1,2]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import StatusMessage from './StatusMessage.svelte';
|
|
4
|
+
describe('m-status-message component', () => {
|
|
5
|
+
const baseProps = {
|
|
6
|
+
label: 'Test message',
|
|
7
|
+
};
|
|
8
|
+
it('renders with default status "info" and displays label', () => {
|
|
9
|
+
const { container, getByText } = render(StatusMessage, {
|
|
10
|
+
props: baseProps,
|
|
11
|
+
});
|
|
12
|
+
const wrapper = container.querySelector('.mc-status-message');
|
|
13
|
+
expect(wrapper).toBeTruthy();
|
|
14
|
+
expect(wrapper?.classList.contains('mc-status-message--info')).toBe(true);
|
|
15
|
+
expect(getByText(baseProps.label)).toBeTruthy();
|
|
16
|
+
const icon = container.querySelector('.mc-status-message__icon > svg');
|
|
17
|
+
expect(icon).toBeTruthy();
|
|
18
|
+
});
|
|
19
|
+
it('renders correct icon for each status except "inprogress"', () => {
|
|
20
|
+
const statuses = ['info', 'success', 'warning', 'error', 'neutral'];
|
|
21
|
+
statuses.forEach((status) => {
|
|
22
|
+
const { container } = render(StatusMessage, {
|
|
23
|
+
props: { ...baseProps, status },
|
|
24
|
+
});
|
|
25
|
+
const wrapper = container.querySelector('.mc-status-message');
|
|
26
|
+
expect(wrapper?.classList.contains(`mc-status-message--${status}`)).toBe(true);
|
|
27
|
+
const icon = container.querySelector('.mc-status-message__icon > svg');
|
|
28
|
+
expect(icon).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
it('renders Loader instead of icon when status is "inprogress"', () => {
|
|
32
|
+
const { container } = render(StatusMessage, {
|
|
33
|
+
props: { ...baseProps, status: 'inprogress' },
|
|
34
|
+
});
|
|
35
|
+
const wrapper = container.querySelector('.mc-status-message');
|
|
36
|
+
expect(wrapper?.classList.contains('mc-status-message--inprogress')).toBe(true);
|
|
37
|
+
expect(container.querySelector('.mc-status-message__icon')).toBeNull();
|
|
38
|
+
const loader = container.querySelector('m-loader, loader, .mc-loader, [data-testid="loader"]');
|
|
39
|
+
expect(loader).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
it('displays the provided label', () => {
|
|
42
|
+
const { getByText } = render(StatusMessage, {
|
|
43
|
+
props: { label: 'Hello world', status: 'success' },
|
|
44
|
+
});
|
|
45
|
+
expect(getByText('Hello world')).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import './StatusMessage.svelte';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj;
|
|
6
|
+
export declare const Info: Story;
|
|
7
|
+
export declare const Success: Story;
|
|
8
|
+
export declare const Warning: Story;
|
|
9
|
+
export declare const Error: Story;
|
|
10
|
+
export declare const Neutral: Story;
|
|
11
|
+
export declare const InProgress: Story;
|
|
12
|
+
//# sourceMappingURL=StatusMessage.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/components/statusmessage/StatusMessage.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,wBAAwB,CAAC;AAEhC,QAAA,MAAM,IAAI,EAAE,IAkBX,CAAC;AACF,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;AAEF,eAAO,MAAM,UAAU,EAAE,KAExB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
3
|
+
import './StatusMessage.svelte';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Status/Status Message',
|
|
6
|
+
component: 'm-status-message',
|
|
7
|
+
tags: ['v2'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
status: {
|
|
10
|
+
control: 'radio',
|
|
11
|
+
options: ['info', 'success', 'warning', 'error', 'neutral', 'inprogress'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
label: 'Brief status message',
|
|
16
|
+
},
|
|
17
|
+
render: (args) => html `<m-status-message
|
|
18
|
+
label=${ifDefined(args.label)}
|
|
19
|
+
status=${ifDefined(args.status)}
|
|
20
|
+
></m-status-message>`,
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
export const Info = {};
|
|
24
|
+
export const Success = {
|
|
25
|
+
args: { status: 'success' },
|
|
26
|
+
};
|
|
27
|
+
export const Warning = {
|
|
28
|
+
args: { status: 'warning' },
|
|
29
|
+
};
|
|
30
|
+
export const Error = {
|
|
31
|
+
args: { status: 'error' },
|
|
32
|
+
};
|
|
33
|
+
export const Neutral = {
|
|
34
|
+
args: { status: 'neutral' },
|
|
35
|
+
};
|
|
36
|
+
export const InProgress = {
|
|
37
|
+
args: { status: 'inprogress' },
|
|
38
|
+
};
|