@mozaic-ds/web-components 1.0.0-beta.7 → 1.1.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 +38 -70
- 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 +25 -23
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +25 -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 +4 -32
- package/dist/components/avatar/Avatar.svelte +7 -5
- 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 +7 -39
- package/dist/components/breadcrumb/Breadcrumb.svelte +12 -20
- 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 +2 -5
- 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 +12 -15
- 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 +111 -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 +54 -49
- 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 +20 -10
- 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 +47 -33
- package/dist/components/datepicker/Datepicker.svelte.d.ts +31 -2
- 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 +85 -87
- package/dist/components/drawer/Drawer.svelte +74 -38
- package/dist/components/drawer/Drawer.svelte.d.ts +34 -3
- package/dist/components/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/drawer/README.md +31 -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 +98 -0
- package/dist/components/field/Field.stories.d.ts +10 -15
- package/dist/components/field/Field.stories.d.ts.map +1 -1
- package/dist/components/field/Field.stories.js +100 -141
- package/dist/components/field/Field.svelte +55 -13
- package/dist/components/field/Field.svelte.d.ts +42 -7
- package/dist/components/field/Field.svelte.d.ts.map +1 -1
- package/dist/components/field/README.md +25 -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 +22 -103
- 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 +12 -7
- 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 +73 -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 +26 -42
- package/dist/components/loader/Loader.svelte +37 -35
- 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 +52 -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 +18 -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 +29 -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 +37 -34
- 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 -28
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts +33 -1
- 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 -53
- 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 +10 -15
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +72 -146
- package/dist/components/quantityselector/QuantitySelector.svelte +94 -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 +35 -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 +48 -47
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts +28 -9
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts.map +1 -1
- package/dist/components/segmentedcontrol/README.md +19 -0
- package/dist/components/segmentedcontrol/SegmentedControl.js +4 -0
- package/dist/components/segmentedcontrol/SegmentedControl.js.map +1 -0
- package/dist/components/segmentedcontrol/SegmentedControl.spec.js +52 -0
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts +8 -0
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts.map +1 -0
- package/dist/components/segmentedcontrol/SegmentedControl.stories.js +54 -0
- package/dist/components/segmentedcontrol/SegmentedControl.svelte +125 -0
- package/dist/components/segmentedcontrol/SegmentedControl.svelte.d.ts +32 -0
- package/dist/components/segmentedcontrol/SegmentedControl.svelte.d.ts.map +1 -0
- 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 +42 -11
- 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 +36 -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 +5 -9
- 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 +2 -6
- 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 +53 -64
- 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 +44 -30
- 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/TagContextualised.js.map +1 -1
- package/dist/components/tags/TagContextualised.svelte +1 -5
- package/dist/components/tags/TagInteractive.js +1 -1
- package/dist/components/tags/TagRemovable.js +2 -2
- package/dist/components/tags/TagRemovable.js.map +1 -1
- package/dist/components/tags/TagRemovable.svelte +2 -12
- package/dist/components/tags/TagRemovable.svelte.d.ts.map +1 -1
- package/dist/components/tags/TagSelectable.js +2 -2
- package/dist/components/tags/TagSelectable.js.map +1 -1
- package/dist/components/tags/TagSelectable.svelte +1 -5
- 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 +8 -4
- 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 +51 -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 +68 -118
- package/dist/components/textinput/Textinput.svelte.d.ts +47 -23
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/toaster/README.md +29 -0
- package/dist/components/toaster/Toaster.js +3 -7
- 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 +21 -14
- package/dist/components/toaster/Toaster.svelte.d.ts +7 -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 +33 -33
- 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 +19 -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-forward-events.js.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 +54 -11
- package/dist/documentation/SupportAndOnboarding.mdx +2 -2
- package/dist/documentation/Svelte/Introduction.mdx +1 -1
- package/dist/documentation/Svelte/usingPresets.mdx +5 -6
- package/dist/documentation/WebComponents/Introduction.mdx +0 -1
- package/dist/documentation/WebComponents/usingIcons.mdx +2 -3
- package/dist/documentation/WebComponents/usingPresets.mdx +3 -4
- 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 +25 -23
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +25 -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/dist/utils/custom-element-forward-events.d.ts.map +1 -1
- package/package.json +32 -22
- 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
package/dist/bundle.d.ts
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
import './components/avatar/Avatar.js';
|
|
2
|
+
import './components/breadcrumb/Breadcrumb.js';
|
|
2
3
|
import './components/button/Button.js';
|
|
3
4
|
import './components/callout/Callout.js';
|
|
4
|
-
import './components/iconbutton/IconButton.js';
|
|
5
5
|
import './components/checkbox/Checkbox.js';
|
|
6
6
|
import './components/checkboxgroup/CheckboxGroup.js';
|
|
7
|
-
import './components/
|
|
8
|
-
import './components/
|
|
9
|
-
import './components/
|
|
10
|
-
import './components/toggle/Toggle.js';
|
|
7
|
+
import './components/circularprogressbar/CircularProgressbar.js';
|
|
8
|
+
import './components/datepicker/Datepicker.js';
|
|
9
|
+
import './components/drawer/Drawer.js';
|
|
11
10
|
import './components/field/Field.js';
|
|
11
|
+
import './components/flag/Flag.js';
|
|
12
|
+
import './components/iconbutton/IconButton.js';
|
|
13
|
+
import './components/linearprogressbarbuffer/LinearProgressbarBuffer.js';
|
|
14
|
+
import './components/linearprogressbarpercentage/LinearProgressbarPercentage.js';
|
|
12
15
|
import './components/link/Link.js';
|
|
13
16
|
import './components/loader/Loader.js';
|
|
14
|
-
import './components/
|
|
17
|
+
import './components/loadingoverlay/LoadingOverlay.js';
|
|
18
|
+
import './components/modal/Modal.js';
|
|
19
|
+
import './components/numberbadge/NumberBadge.js';
|
|
15
20
|
import './components/overlay/Overlay.js';
|
|
16
|
-
import './components/
|
|
21
|
+
import './components/pagination/Pagination.js';
|
|
22
|
+
import './components/passwordinput/PasswordInput.js';
|
|
23
|
+
import './components/pincode/Pincode.js';
|
|
24
|
+
import './components/quantityselector/QuantitySelector.js';
|
|
17
25
|
import './components/radio/Radio.js';
|
|
18
26
|
import './components/radiogroup/RadioGroup.js';
|
|
19
|
-
import './components/
|
|
20
|
-
import './components/numberbadge/NumberBadge.js';
|
|
27
|
+
import './components/select/Select.js';
|
|
21
28
|
import './components/statusbadge/StatusBadge.js';
|
|
22
|
-
import './components/
|
|
23
|
-
import './components/breadcrumb/Breadcrumb.js';
|
|
29
|
+
import './components/statusdot/StatusDot.js';
|
|
24
30
|
import './components/statusnotification/StatusNotification.js';
|
|
25
|
-
import './components/
|
|
26
|
-
import './components/
|
|
31
|
+
import './components/segmentedcontrol/SegmentedControl.js';
|
|
32
|
+
import './components/tab/Tab.js';
|
|
33
|
+
import './components/tabs/Tabs.js';
|
|
27
34
|
import './components/tags/Tag.js';
|
|
28
35
|
import './components/tags/TagContextualised.js';
|
|
29
36
|
import './components/tags/TagInteractive.js';
|
|
30
37
|
import './components/tags/TagRemovable.js';
|
|
31
38
|
import './components/tags/TagSelectable.js';
|
|
32
|
-
import './components/
|
|
33
|
-
import './components/
|
|
34
|
-
import './components/
|
|
35
|
-
import './components/
|
|
36
|
-
import './components/
|
|
37
|
-
import './components/pincode/Pincode.js';
|
|
38
|
-
import './components/datepicker/Datepicker.js';
|
|
39
|
+
import './components/textarea/Textarea.js';
|
|
40
|
+
import './components/textinput/Textinput.js';
|
|
41
|
+
import './components/toaster/Toaster.js';
|
|
42
|
+
import './components/toggle/Toggle.js';
|
|
43
|
+
import './components/togglegroup/ToggleGroup.js';
|
|
39
44
|
import './components/tooltip/Tooltip.js';
|
|
40
|
-
import './components/linearprogressbarpercentage/LinearProgressbarPercentage.js';
|
|
41
|
-
import './components/linearprogressbarbuffer/LinearProgressbarBuffer.js';
|
|
42
|
-
import './components/circularprogressbar/CircularProgressbar.js';
|
|
43
45
|
//# sourceMappingURL=bundle.d.ts.map
|
package/dist/bundle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,iCAAiC,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AACvC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,+BAA+B,CAAC;AACvC,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,6CAA6C,CAAC;AACrD,OAAO,yDAAyD,CAAC;AACjE,OAAO,uCAAuC,CAAC;AAC/C,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,2BAA2B,CAAC;AACnC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,iEAAiE,CAAC;AACzE,OAAO,yEAAyE,CAAC;AACjF,OAAO,2BAA2B,CAAC;AACnC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+CAA+C,CAAC;AACvD,OAAO,6BAA6B,CAAC;AACrC,OAAO,yCAAyC,CAAC;AACjD,OAAO,iCAAiC,CAAC;AACzC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,6CAA6C,CAAC;AACrD,OAAO,iCAAiC,CAAC;AACzC,OAAO,mDAAmD,CAAC;AAC3D,OAAO,6BAA6B,CAAC;AACrC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,+BAA+B,CAAC;AACvC,OAAO,yCAAyC,CAAC;AACjD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,uDAAuD,CAAC;AAC/D,OAAO,mDAAmD,CAAC;AAC3D,OAAO,yBAAyB,CAAC;AACjC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,wCAAwC,CAAC;AAChD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,iCAAiC,CAAC;AACzC,OAAO,+BAA+B,CAAC;AACvC,OAAO,yCAAyC,CAAC;AACjD,OAAO,iCAAiC,CAAC"}
|
package/dist/bundle.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import './components/avatar/Avatar.js';
|
|
2
|
+
import './components/breadcrumb/Breadcrumb.js';
|
|
2
3
|
import './components/button/Button.js';
|
|
3
4
|
import './components/callout/Callout.js';
|
|
4
|
-
import './components/iconbutton/IconButton.js';
|
|
5
5
|
import './components/checkbox/Checkbox.js';
|
|
6
6
|
import './components/checkboxgroup/CheckboxGroup.js';
|
|
7
|
-
import './components/
|
|
8
|
-
import './components/
|
|
9
|
-
import './components/
|
|
10
|
-
import './components/toggle/Toggle.js';
|
|
7
|
+
import './components/circularprogressbar/CircularProgressbar.js';
|
|
8
|
+
import './components/datepicker/Datepicker.js';
|
|
9
|
+
import './components/drawer/Drawer.js';
|
|
11
10
|
import './components/field/Field.js';
|
|
11
|
+
import './components/flag/Flag.js';
|
|
12
|
+
import './components/iconbutton/IconButton.js';
|
|
13
|
+
import './components/linearprogressbarbuffer/LinearProgressbarBuffer.js';
|
|
14
|
+
import './components/linearprogressbarpercentage/LinearProgressbarPercentage.js';
|
|
12
15
|
import './components/link/Link.js';
|
|
13
16
|
import './components/loader/Loader.js';
|
|
14
|
-
import './components/
|
|
17
|
+
import './components/loadingoverlay/LoadingOverlay.js';
|
|
18
|
+
import './components/modal/Modal.js';
|
|
19
|
+
import './components/numberbadge/NumberBadge.js';
|
|
15
20
|
import './components/overlay/Overlay.js';
|
|
16
|
-
import './components/
|
|
21
|
+
import './components/pagination/Pagination.js';
|
|
22
|
+
import './components/passwordinput/PasswordInput.js';
|
|
23
|
+
import './components/pincode/Pincode.js';
|
|
24
|
+
import './components/quantityselector/QuantitySelector.js';
|
|
17
25
|
import './components/radio/Radio.js';
|
|
18
26
|
import './components/radiogroup/RadioGroup.js';
|
|
19
|
-
import './components/
|
|
20
|
-
import './components/numberbadge/NumberBadge.js';
|
|
27
|
+
import './components/select/Select.js';
|
|
21
28
|
import './components/statusbadge/StatusBadge.js';
|
|
22
|
-
import './components/
|
|
23
|
-
import './components/breadcrumb/Breadcrumb.js';
|
|
29
|
+
import './components/statusdot/StatusDot.js';
|
|
24
30
|
import './components/statusnotification/StatusNotification.js';
|
|
25
|
-
import './components/
|
|
26
|
-
import './components/
|
|
31
|
+
import './components/segmentedcontrol/SegmentedControl.js';
|
|
32
|
+
import './components/tab/Tab.js';
|
|
33
|
+
import './components/tabs/Tabs.js';
|
|
27
34
|
import './components/tags/Tag.js';
|
|
28
35
|
import './components/tags/TagContextualised.js';
|
|
29
36
|
import './components/tags/TagInteractive.js';
|
|
30
37
|
import './components/tags/TagRemovable.js';
|
|
31
38
|
import './components/tags/TagSelectable.js';
|
|
32
|
-
import './components/
|
|
33
|
-
import './components/
|
|
34
|
-
import './components/
|
|
35
|
-
import './components/
|
|
36
|
-
import './components/
|
|
37
|
-
import './components/pincode/Pincode.js';
|
|
38
|
-
import './components/datepicker/Datepicker.js';
|
|
39
|
+
import './components/textarea/Textarea.js';
|
|
40
|
+
import './components/textinput/Textinput.js';
|
|
41
|
+
import './components/toaster/Toaster.js';
|
|
42
|
+
import './components/toggle/Toggle.js';
|
|
43
|
+
import './components/togglegroup/ToggleGroup.js';
|
|
39
44
|
import './components/tooltip/Tooltip.js';
|
|
40
|
-
import './components/linearprogressbarpercentage/LinearProgressbarPercentage.js';
|
|
41
|
-
import './components/linearprogressbarbuffer/LinearProgressbarBuffer.js';
|
|
42
|
-
import './components/circularprogressbar/CircularProgressbar.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as n,p as l,a as c,b as d,f as m,d as f,t as v,
|
|
1
|
+
import{c as n,p as l,a as c,b as d,f as m,d as f,t as v,i as h,j as g,k as u,r as p,e as w,g as b}from"../../custom-element.js";import{s as z}from"../../slot.js";var y=m("<div><!></div>");const _={hash:"svelte-1g4aw6b",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
*/.mc-avatar.svelte-1g4aw6b {display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;overflow:hidden;border-radius:var(--radius-full, 100%);background:var(--color-background-secondary, #eff1f6);color:var(--color-text-secondary, #404040);font-size:var(--font-size-50, 0.75rem);font-weight:var(--font-weight-semi-bold, 600);text-transform:uppercase;}.mc-avatar--m.svelte-1g4aw6b {width:3rem;height:3rem;font-size:var(--font-size-200, 1.125rem);}.mc-avatar--l.svelte-1g4aw6b {width:4rem;height:4rem;font-size:var(--font-size-300, 1.5rem);}.svelte-1g4aw6b::slotted(img) {display:block;width:100%;height:100%;object-fit:contain;}`};function x(s,a){l(a,!0),c(s,_);let e=d(a,"size",7,"s");var r={get size(){return e()},set size(o="s"){e(o),
|
|
3
|
+
*/.mc-avatar.svelte-1g4aw6b {display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;overflow:hidden;border-radius:var(--radius-full, 100%);background:var(--color-background-secondary, #eff1f6);color:var(--color-text-secondary, #404040);font-size:var(--font-size-50, 0.75rem);font-weight:var(--font-weight-semi-bold, 600);text-transform:uppercase;}.mc-avatar--m.svelte-1g4aw6b {width:3rem;height:3rem;font-size:var(--font-size-200, 1.125rem);}.mc-avatar--l.svelte-1g4aw6b {width:4rem;height:4rem;font-size:var(--font-size-300, 1.5rem);}.svelte-1g4aw6b::slotted(img) {display:block;width:100%;height:100%;object-fit:contain;}`};function x(s,a){l(a,!0),c(s,_);let e=d(a,"size",7,"s");var r={get size(){return e()},set size(o="s"){e(o),u()}},t=y(),i=f(t);return z(i,a,"default",{}),p(t),v(()=>w(t,1,b(["mc-avatar",e()&&`mc-avatar--${e()}`]),"svelte-1g4aw6b")),h(s,t),g(r)}customElements.define("m-avatar",n(x,{size:{}},["default"],[],!0));
|
|
4
4
|
//# sourceMappingURL=Avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.js","sources":["../../../src/components/avatar/Avatar.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-avatar' }} />\n\n<script lang=\"ts\">\n /**\n * An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.\n */\n interface Props {\n /**\n * Determines the size of the avatar.\n */\n
|
|
1
|
+
{"version":3,"file":"Avatar.js","sources":["../../../src/components/avatar/Avatar.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-avatar' }} />\n\n<script lang=\"ts\">\n /**\n * An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.\n *\n * @slot default - Use this slot to insert the image, icon or intials of the avatar.\n */\n interface Props {\n /**\n * Determines the size of the avatar.\n */\n size: 's' | 'm' | 'l';\n }\n\n let { size = 's' }: Props = $props();\n</script>\n\n<div class={['mc-avatar', size && `mc-avatar--${size}`]}>\n <slot />\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/avatar';\n\n ::slotted(img) {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n</style>\n"],"names":["size"],"mappings":";;ypBAAA,gBAeQ,IAAAA,eAAO,GAAG,2CAAH,IAAG,wEAGL,YAAaA,EAAI,GAAA,cAAkBA,EAAI,CAAA,EAAA,CAAA,EAAA,gBAAA,CAAA,aAFpD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import Avatar from './Avatar.svelte';
|
|
4
|
+
describe('m-avatar component', () => {
|
|
5
|
+
it('renders with default size "s"', () => {
|
|
6
|
+
const { container } = render(Avatar);
|
|
7
|
+
const div = container.querySelector('div.mc-avatar');
|
|
8
|
+
expect(div).toBeTruthy();
|
|
9
|
+
expect(div?.classList.contains('mc-avatar--s')).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
it('applies correct size class for size "l"', () => {
|
|
12
|
+
const { container } = render(Avatar, { props: { size: 'l' } });
|
|
13
|
+
const div = container.querySelector('div.mc-avatar');
|
|
14
|
+
expect(div).toBeTruthy();
|
|
15
|
+
expect(div?.classList.contains('mc-avatar--l')).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,gEAAgE,CAAC;AAExE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,gEAAgE,CAAC;AAExE,QAAA,MAAM,IAAI,EAAE,IAkBX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC"}
|
|
@@ -4,38 +4,12 @@ import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
|
4
4
|
import '@mozaic-ds/icons-svelte/custom-elements/Profile24/Profile24.js';
|
|
5
5
|
const meta = {
|
|
6
6
|
title: 'Content/Avatar',
|
|
7
|
-
component: 'm-
|
|
8
|
-
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component: 'An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
7
|
+
component: 'm-avatar',
|
|
8
|
+
tags: ['v2'],
|
|
15
9
|
argTypes: {
|
|
16
10
|
size: {
|
|
17
|
-
|
|
18
|
-
control: { type: 'radio' },
|
|
11
|
+
control: 'inline-radio',
|
|
19
12
|
options: ['s', 'm', 'l'],
|
|
20
|
-
table: {
|
|
21
|
-
type: {
|
|
22
|
-
summary: 's | m | l',
|
|
23
|
-
},
|
|
24
|
-
defaultValue: {
|
|
25
|
-
summary: 's',
|
|
26
|
-
},
|
|
27
|
-
category: 'attributes',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
default: {
|
|
31
|
-
description: 'Use this slot to insert the image, icon or intials of the avatar.',
|
|
32
|
-
control: { type: 'text' },
|
|
33
|
-
table: {
|
|
34
|
-
type: {
|
|
35
|
-
summary: 'any',
|
|
36
|
-
},
|
|
37
|
-
category: 'slots',
|
|
38
|
-
},
|
|
39
13
|
},
|
|
40
14
|
},
|
|
41
15
|
args: {
|
|
@@ -44,9 +18,7 @@ const meta = {
|
|
|
44
18
|
`,
|
|
45
19
|
},
|
|
46
20
|
render: (args) => html `
|
|
47
|
-
<m-avatar size=${ifDefined(args.size)}>
|
|
48
|
-
${unsafeHTML(ifDefined(args.default))}
|
|
49
|
-
</m-avatar>
|
|
21
|
+
<m-avatar size=${ifDefined(args.size)}> ${unsafeHTML(ifDefined(args.default))} </m-avatar>
|
|
50
22
|
`,
|
|
51
23
|
};
|
|
52
24
|
export default meta;
|
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
<script lang="ts">
|
|
4
4
|
/**
|
|
5
5
|
* An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.
|
|
6
|
+
*
|
|
7
|
+
* @slot default - Use this slot to insert the image, icon or intials of the avatar.
|
|
6
8
|
*/
|
|
7
9
|
interface Props {
|
|
8
10
|
/**
|
|
9
11
|
* Determines the size of the avatar.
|
|
10
12
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
size: 's' | 'm' | 'l';
|
|
14
|
+
}
|
|
13
15
|
|
|
14
|
-
let { size = 's'}: Props = $props();
|
|
16
|
+
let { size = 's' }: Props = $props();
|
|
15
17
|
</script>
|
|
16
18
|
|
|
17
|
-
<div class={[
|
|
18
|
-
<slot/>
|
|
19
|
+
<div class={['mc-avatar', size && `mc-avatar--${size}`]}>
|
|
20
|
+
<slot />
|
|
19
21
|
</div>
|
|
20
22
|
|
|
21
23
|
<style>/**
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.
|
|
3
|
+
*
|
|
4
|
+
* @slot default - Use this slot to insert the image, icon or intials of the avatar.
|
|
3
5
|
*/
|
|
4
6
|
interface Props {
|
|
5
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.svelte.ts"],"names":[],"mappings":"AAGE
|
|
1
|
+
{"version":3,"file":"Avatar.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/Avatar.svelte.ts"],"names":[],"mappings":"AAGE;;;;GAIG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CACvB;AAiBH,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,MAAM;;;;;;UAAqF,CAAC;AAChF,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# `m-avatar`
|
|
2
|
+
|
|
3
|
+
An avatar is a graphical representation of a user, entity, or group, commonly displayed as an image, initials, or an icon. It helps identify individuals or accounts in profiles, comments, chat interfaces, and user lists. Avatars can be customized with different styles, sizes, and fallback options (such as initials or placeholders) to ensure consistency and recognition across interfaces. When multiple users are represented, Avatar groups provide a compact way to display them collectively.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Description | Type | Default |
|
|
8
|
+
|------|-------------|------|---------|
|
|
9
|
+
| `size*` | Determines the size of the avatar. | `'s'` `'m'` `'l'` | `s` |
|
|
10
|
+
|
|
11
|
+
## Slots
|
|
12
|
+
|
|
13
|
+
| Name | Description |
|
|
14
|
+
|------|-------------|
|
|
15
|
+
| `default` | Use this slot to insert the image, icon or intials of the avatar. |
|
|
16
|
+
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as L,p as B,a as M,b as u,f as g,d as n,t as b,i as x,j,k as f,r as t,e as _,g as z,m,h as D}from"../../custom-element.js";import{e as S,i as q}from"../../each.js";import{s as p}from"../../attributes.js";var A=g('<li class="mc-breadcrumb__item svelte-1ihiex7"><a><span class="mc-link__label svelte-1ihiex7"> </span></a></li>'),F=g('<nav aria-label="Breadcrumb"><ol class="mc-breadcrumb__container svelte-1ihiex7"></ol></nav>');const G={hash:"svelte-1ihiex7",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/.mc-breadcrumb.svelte-1ihiex7 {color:var(--breadcrumb-color-text-standard, #000000);}.mc-breadcrumb__container.svelte-1ihiex7 {list-style-type:none;padding-inline-start:0;margin-block:0;display:flex;flex-wrap:wrap;gap:0.25rem;}.mc-breadcrumb__item.svelte-1ihiex7 {background-position:left center;background-repeat:no-repeat;}.mc-breadcrumb__item.svelte-1ihiex7:not(:first-child) {padding-inline-start:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='var(--breadcrumb-color-icon-standard, %23000000)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M8.22 5.303a.75.75 0 0 1 1.06 0l4.167 4.167a.75.75 0 0 1 0 1.06L9.28 14.698a.75.75 0 1 1-1.06-1.06L11.856 10 8.22 6.364a.75.75 0 0 1 0-1.06'/%3E%3C/svg%3E");}
|
|
4
4
|
@media screen and (max-width: 679px) {.mc-breadcrumb__item.svelte-1ihiex7:nth-last-child(2) {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='var(--breadcrumb-color-icon-standard, %23000000)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M11.78 5.303a.75.75 0 0 1 0 1.06L8.144 10l3.636 3.637a.75.75 0 0 1-1.06 1.06l-4.167-4.166a.75.75 0 0 1 0-1.061l4.166-4.167a.75.75 0 0 1 1.061 0'/%3E%3C/svg%3E");}.mc-breadcrumb__item.svelte-1ihiex7:not(:nth-last-child(2)) {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}
|
|
5
5
|
}.mc-breadcrumb__current.svelte-1ihiex7, .mc-breadcrumb__current.mc-link.svelte-1ihiex7 {cursor:default;text-decoration:none;}.mc-breadcrumb__current.svelte-1ihiex7, .mc-breadcrumb__current.svelte-1ihiex7:active, .mc-breadcrumb__current.svelte-1ihiex7:focus, .mc-breadcrumb__current.svelte-1ihiex7:hover, .mc-breadcrumb__current.svelte-1ihiex7:visited, .mc-breadcrumb__current.mc-link.svelte-1ihiex7, .mc-breadcrumb__current.mc-link.svelte-1ihiex7:active, .mc-breadcrumb__current.mc-link.svelte-1ihiex7:focus, .mc-breadcrumb__current.mc-link.svelte-1ihiex7:hover, .mc-breadcrumb__current.mc-link.svelte-1ihiex7:visited {color:currentcolor;}.mc-breadcrumb--inverse.svelte-1ihiex7 {color:var(--breadcrumb-color-text-inverse, #ffffff);}.mc-breadcrumb--inverse.svelte-1ihiex7 .mc-breadcrumb__item:where(.svelte-1ihiex7):not(:first-child) {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='var(--breadcrumb-color-icon-inverse, %23ffffff)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M8.22 5.303a.75.75 0 0 1 1.06 0l4.167 4.167a.75.75 0 0 1 0 1.06L9.28 14.698a.75.75 0 1 1-1.06-1.06L11.856 10 8.22 6.364a.75.75 0 0 1 0-1.06'/%3E%3C/svg%3E");}
|
|
6
6
|
@media screen and (max-width: 679px) {.mc-breadcrumb--inverse.svelte-1ihiex7 .mc-breadcrumb__item:where(.svelte-1ihiex7):nth-last-child(2) {background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1.25rem' width='1.25rem' fill='var(--breadcrumb-color-icon-inverse, %23ffffff)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M11.78 5.303a.75.75 0 0 1 0 1.06L8.144 10l3.636 3.637a.75.75 0 0 1-1.06 1.06l-4.167-4.166a.75.75 0 0 1 0-1.061l4.166-4.167a.75.75 0 0 1 1.061 0'/%3E%3C/svg%3E");}
|
|
7
|
-
}.mc-link.svelte-1ihiex7 {transition:box-shadow 200ms ease;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;min-height:1.5rem;text-decoration:none;color:var(--link-color-text-primary, #000000);font-size:0.875rem;}.mc-link__label.svelte-1ihiex7 {line-height:1.3;}.mc-link__icon.svelte-1ihiex7 {display:block;height:1.25rem;width:1.25rem;flex-shrink:0;fill:currentcolor;}.mc-link.svelte-1ihiex7:hover:not(.mc-link--stand-alone, .mc-link--inline) .mc-link__label:where(.svelte-1ihiex7) {text-decoration:underline;}.mc-link.svelte-1ihiex7:focus {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-link--m.svelte-1ihiex7 {min-height:2rem;font-size:1rem;}.mc-link--secondary.svelte-1ihiex7 {color:var(--link-color-text-secondary, #666666);}.mc-link--accent.svelte-1ihiex7 {color:var(--link-color-text-accent, #117f03);}.mc-link--inverse.svelte-1ihiex7 {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--link-color-text-inverse, #ffffff);}.mc-link--stand-alone.svelte-1ihiex7 {min-height:2rem;font-weight:var(--link-font-weight, 600);}.mc-link--stand-alone.svelte-1ihiex7 .mc-link__label:where(.svelte-1ihiex7) {border-bottom:var(--border-s, 1px) solid currentColor;}.mc-link--stand-alone.svelte-1ihiex7:hover .mc-link__label:where(.svelte-1ihiex7) {border-color:transparent;}.mc-link--inline.svelte-1ihiex7 {font-weight:inherit;text-decoration:underline;}.mc-link--inline.svelte-1ihiex7 .mc-link__label:where(.svelte-1ihiex7) {line-height:1;}.mc-link--inline.svelte-1ihiex7:hover {text-decoration:none;}`};function
|
|
7
|
+
}.mc-link.svelte-1ihiex7 {transition:box-shadow 200ms ease;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;min-height:1.5rem;text-decoration:none;color:var(--link-color-text-primary, #000000);font-size:0.875rem;}.mc-link__label.svelte-1ihiex7 {line-height:1.3;}.mc-link__icon.svelte-1ihiex7 {display:block;height:1.25rem;width:1.25rem;flex-shrink:0;fill:currentcolor;}.mc-link.svelte-1ihiex7:hover:not(.mc-link--stand-alone, .mc-link--inline) .mc-link__label:where(.svelte-1ihiex7) {text-decoration:underline;}.mc-link.svelte-1ihiex7:focus {box-shadow:0 0 0 0.125rem var(--focus-color-mid, var(--focus-color-outline-mid, #ffffff)), 0 0 0 0.25rem var(--focus-color-outer, var(--focus-color-outline-outer, #000000));outline:0.125rem solid transparent;outline-offset:0.125rem;}.mc-link--m.svelte-1ihiex7 {min-height:2rem;font-size:1rem;}.mc-link--secondary.svelte-1ihiex7 {color:var(--link-color-text-secondary, #666666);}.mc-link--accent.svelte-1ihiex7 {color:var(--link-color-text-accent, #117f03);}.mc-link--inverse.svelte-1ihiex7 {--focus-color-mid: var(--focus-color-outline-outer, #000000);--focus-color-outer: var(--focus-color-outline-mid, #ffffff);color:var(--link-color-text-inverse, #ffffff);}.mc-link--stand-alone.svelte-1ihiex7 {min-height:2rem;font-weight:var(--link-font-weight, 600);}.mc-link--stand-alone.svelte-1ihiex7 .mc-link__label:where(.svelte-1ihiex7) {border-bottom:var(--border-s, 1px) solid currentColor;}.mc-link--stand-alone.svelte-1ihiex7:hover .mc-link__label:where(.svelte-1ihiex7) {border-color:transparent;}.mc-link--inline.svelte-1ihiex7 {font-weight:inherit;text-decoration:underline;}.mc-link--inline.svelte-1ihiex7 .mc-link__label:where(.svelte-1ihiex7) {line-height:1;}.mc-link--inline.svelte-1ihiex7:hover {text-decoration:none;}`};function H(d,c){B(c,!0),M(d,G);let r=u(c,"appearance",7,"standard"),a=u(c,"links",7);const k=e=>e===a().length-1;var w={get appearance(){return r()},set appearance(e="standard"){r(e),f()},get links(){return a()},set links(e){a(e),f()}},l=F(),h=n(l);return S(h,21,a,q,(e,s,C)=>{var o=A(),i=n(o),v=n(i),E=n(v,!0);t(v),t(i),t(o),b(y=>{p(i,"href",m(s).href),p(i,"target",m(s).target),_(i,1,y,"svelte-1ihiex7"),D(E,m(s).label)},[()=>z(["mc-link","mc-link--m","mc-link--inline",r()&&`mc-link--${r()}`,k(C)&&"mc-breadcrumb__current"])]),x(e,o)}),t(h),t(l),b(()=>_(l,1,`mc-breadcrumb mc-breadcrumb--${r()}`,"svelte-1ihiex7")),x(d,l),j(w)}customElements.define("m-breadcrumb",L(H,{appearance:{},links:{}},[],[],!0));
|
|
8
8
|
//# sourceMappingURL=Breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/breadcrumb/Breadcrumb.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-breadcrumb'
|
|
1
|
+
{"version":3,"file":"Breadcrumb.js","sources":["../../../src/components/breadcrumb/Breadcrumb.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-breadcrumb',\n }}\n/>\n\n<script lang=\"ts\">\n /**\n * A breadcrumb is a navigation help that displays the hierarchical path of the current page within a website or application. It helps users understand their location and allows them to navigate back to previous levels easily. Breadcrumbs improve usability and accessibility, especially in multi-level websites, dashboards, and e-commerce platforms.\n */\n interface Props {\n /**\n * Allows to define the breadcrumb appearance.\n */\n appearance: 'standard' | 'inverse';\n /**\n * Links of the breadcrumb.\n */\n links: Array<{\n /**\n * The label displayed for the link.\n */\n label: string;\n /**\n * URL for the link.\n */\n href: string;\n /**\n * Where to open the link.\n */\n target?: '_blank' | '_self' | '_parent' | '_top';\n }>;\n }\n\n let { appearance = 'standard', links }: Props = $props();\n\n const isLastLink = (index: number) => index === links.length - 1;\n</script>\n\n<nav class={`mc-breadcrumb mc-breadcrumb--${appearance}`} aria-label=\"Breadcrumb\">\n <ol class=\"mc-breadcrumb__container\">\n {#each links as link, index (index)}\n <li class=\"mc-breadcrumb__item\">\n <a\n href={link.href}\n target={link.target}\n class={[\n 'mc-link',\n 'mc-link--m',\n 'mc-link--inline',\n appearance && `mc-link--${appearance}`,\n isLastLink(index) && 'mc-breadcrumb__current',\n ]}\n >\n <span class=\"mc-link__label\">{link.label}</span>\n </a>\n </li>\n {/each}\n </ol>\n</nav>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/breadcrumb';\n @use '@mozaic-ds/styles/components/link';\n</style>\n"],"names":["appearance","links","$.prop","$$props","isLastLink","index","$.each","ol","link","$.set_attribute","a","$.get","$.set_text","text"],"mappings":";;;;;;kxDAAA,gBAkCQ,IAAAA,qBAAa,UAAU,EAAEC,EAAKC,EAAAC,EAAA,QAAA,CAAA,QAE9BC,EAAcC,GAAkBA,IAAUJ,EAAK,EAAC,OAAS,uDAF5C,WAAU,wEAOpBK,OAAAA,EAAAC,EAAA,GAAAN,OAASO,EAAIH,IAAA,wDAGRI,EAAAC,EAAA,OAAAC,EAAAH,CAAI,EAAC,IAAI,EACPC,EAAAC,EAAA,SAAAC,EAAAH,CAAI,EAAC,MAAM,4BASWI,EAAAC,EAAAF,EAAAH,CAAI,EAAC,KAAK,WAPtC,UACA,aACA,kBACAR,iBAA0BA,EAAU,CAAA,GACpCI,EAAWC,CAAK,GAAK,4FAZWL,EAAU,CAAA,GAAA,gBAAA,CAAA,aAFtD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render } from '@testing-library/svelte';
|
|
3
|
+
import Breadcrumb from './Breadcrumb.svelte';
|
|
4
|
+
describe('m-breadcrumb component', () => {
|
|
5
|
+
const links = [
|
|
6
|
+
{ label: 'Home', href: '/' },
|
|
7
|
+
{ label: 'Category', href: '/category' },
|
|
8
|
+
{ label: 'Item', href: '/category/item', target: '_blank' },
|
|
9
|
+
];
|
|
10
|
+
it('renders with default appearance "standard"', () => {
|
|
11
|
+
const { container } = render(Breadcrumb, { props: { links } });
|
|
12
|
+
const nav = container.querySelector('nav.mc-breadcrumb');
|
|
13
|
+
expect(nav).toBeTruthy();
|
|
14
|
+
expect(nav?.classList.contains('mc-breadcrumb--standard')).toBe(true);
|
|
15
|
+
const items = container.querySelectorAll('li.mc-breadcrumb__item');
|
|
16
|
+
expect(items.length).toBe(links.length);
|
|
17
|
+
const anchors = container.querySelectorAll('a.mc-link');
|
|
18
|
+
expect(anchors[anchors.length - 1].classList.contains('mc-breadcrumb__current')).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
it('renders with "inverse" appearance when set', () => {
|
|
21
|
+
const { container } = render(Breadcrumb, {
|
|
22
|
+
props: { links, appearance: 'inverse' },
|
|
23
|
+
});
|
|
24
|
+
const nav = container.querySelector('nav.mc-breadcrumb');
|
|
25
|
+
expect(nav?.classList.contains('mc-breadcrumb--inverse')).toBe(true);
|
|
26
|
+
const anchors = container.querySelectorAll('a.mc-link--inverse');
|
|
27
|
+
expect(anchors.length).toBe(links.length);
|
|
28
|
+
});
|
|
29
|
+
it('applies href and target attributes on links correctly', () => {
|
|
30
|
+
const { container } = render(Breadcrumb, { props: { links } });
|
|
31
|
+
links.forEach((link, i) => {
|
|
32
|
+
const anchor = container.querySelectorAll('a.mc-link')[i];
|
|
33
|
+
expect(anchor).toHaveAttribute('href', link.href);
|
|
34
|
+
if (link.target) {
|
|
35
|
+
expect(anchor).toHaveAttribute('target', link.target);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
expect(anchor).not.toHaveAttribute('target');
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.stories.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Breadcrumb.stories.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,QAAA,MAAM,IAAI,EAAE,IAgCX,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
|
|
@@ -3,39 +3,6 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
|
|
3
3
|
const meta = {
|
|
4
4
|
title: 'Navigation/Breadcrumb',
|
|
5
5
|
component: 'm-breadcrumb',
|
|
6
|
-
parameters: {
|
|
7
|
-
docs: {
|
|
8
|
-
description: {
|
|
9
|
-
component: 'A breadcrumb is a navigation help that displays the hierarchical path of the current page within a website or application. It helps users understand their location and allows them to navigate back to previous levels easily. Breadcrumbs improve usability and accessibility, especially in multi-level websites, dashboards, and e-commerce platforms.',
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
appearance: {
|
|
15
|
-
description: 'Define the visual appearance of the breadcrumb',
|
|
16
|
-
control: { type: 'radio' },
|
|
17
|
-
options: ['standard', 'inverse'],
|
|
18
|
-
table: {
|
|
19
|
-
type: {
|
|
20
|
-
summary: 'standard | inverse',
|
|
21
|
-
},
|
|
22
|
-
defaultValue: {
|
|
23
|
-
summary: 'standard',
|
|
24
|
-
},
|
|
25
|
-
category: 'attributes',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
links: {
|
|
29
|
-
description: 'List of breadcrumb links (label + href)',
|
|
30
|
-
control: 'object',
|
|
31
|
-
table: {
|
|
32
|
-
type: {
|
|
33
|
-
summary: '{ label: string; href: string; target?: _blank | _self | _parent | _top; }[]',
|
|
34
|
-
},
|
|
35
|
-
category: 'attributes',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
6
|
args: {
|
|
40
7
|
links: [
|
|
41
8
|
{
|
|
@@ -55,14 +22,15 @@ const meta = {
|
|
|
55
22
|
href: '#',
|
|
56
23
|
},
|
|
57
24
|
],
|
|
58
|
-
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
appearance: {
|
|
28
|
+
control: 'radio',
|
|
29
|
+
options: ['standard', 'inverse'],
|
|
30
|
+
},
|
|
59
31
|
},
|
|
60
32
|
render: (args) => html `
|
|
61
|
-
<m-breadcrumb
|
|
62
|
-
appearance=${ifDefined(args.appearance)}
|
|
63
|
-
aria-label=${args.ariaLabel}
|
|
64
|
-
.links=${args.links}
|
|
65
|
-
></m-breadcrumb>
|
|
33
|
+
<m-breadcrumb appearance=${ifDefined(args.appearance)} .links=${args.links}></m-breadcrumb>
|
|
66
34
|
`,
|
|
67
35
|
};
|
|
68
36
|
export default meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<svelte:options
|
|
2
2
|
customElement={{
|
|
3
|
-
tag: 'm-breadcrumb'
|
|
3
|
+
tag: 'm-breadcrumb',
|
|
4
4
|
}}
|
|
5
5
|
/>
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* Links of the breadcrumb.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
links: Array<{
|
|
20
20
|
/**
|
|
21
21
|
* The label displayed for the link.
|
|
22
22
|
*/
|
|
@@ -30,35 +30,27 @@
|
|
|
30
30
|
*/
|
|
31
31
|
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
32
32
|
}>;
|
|
33
|
-
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
let { appearance = 'standard', links
|
|
35
|
+
let { appearance = 'standard', links }: Props = $props();
|
|
36
36
|
|
|
37
37
|
const isLastLink = (index: number) => index === links.length - 1;
|
|
38
|
-
|
|
39
|
-
function setClasses(isCurrent: boolean): string {
|
|
40
|
-
const classes = ['mc-link', 'mc-link--m', 'mc-link--inline'];
|
|
41
|
-
if (appearance) {
|
|
42
|
-
classes.push(`mc-link--${appearance}`);
|
|
43
|
-
}
|
|
44
|
-
if (isCurrent) {
|
|
45
|
-
classes.push('mc-breadcrumb__current');
|
|
46
|
-
}
|
|
47
|
-
return classes.join(' ');
|
|
48
|
-
}
|
|
49
38
|
</script>
|
|
50
39
|
|
|
51
|
-
<nav
|
|
52
|
-
class={`mc-breadcrumb mc-breadcrumb--${appearance}`}
|
|
53
|
-
aria-label="Breadcrumb"
|
|
54
|
-
>
|
|
40
|
+
<nav class={`mc-breadcrumb mc-breadcrumb--${appearance}`} aria-label="Breadcrumb">
|
|
55
41
|
<ol class="mc-breadcrumb__container">
|
|
56
42
|
{#each links as link, index (index)}
|
|
57
43
|
<li class="mc-breadcrumb__item">
|
|
58
44
|
<a
|
|
59
45
|
href={link.href}
|
|
60
46
|
target={link.target}
|
|
61
|
-
class={
|
|
47
|
+
class={[
|
|
48
|
+
'mc-link',
|
|
49
|
+
'mc-link--m',
|
|
50
|
+
'mc-link--inline',
|
|
51
|
+
appearance && `mc-link--${appearance}`,
|
|
52
|
+
isLastLink(index) && 'mc-breadcrumb__current',
|
|
53
|
+
]}
|
|
62
54
|
>
|
|
63
55
|
<span class="mc-link__label">{link.label}</span>
|
|
64
56
|
</a>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.svelte.ts"],"names":[],"mappings":"AAGE;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC;;OAEG;
|
|
1
|
+
{"version":3,"file":"Breadcrumb.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.svelte.ts"],"names":[],"mappings":"AAGE;;GAEG;AACH,UAAU,KAAK;IACb;;OAEG;IACH,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;QACX;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;KAClD,CAAC,CAAC;CACJ;AAmCH,QAAA,MAAM,UAAU,2CAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `m-breadcrumb`
|
|
2
|
+
|
|
3
|
+
A breadcrumb is a navigation help that displays the hierarchical path of the current page within a website or application. It helps users understand their location and allows them to navigate back to previous levels easily. Breadcrumbs improve usability and accessibility, especially in multi-level websites, dashboards, and e-commerce platforms.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
| Name | Description | Type | Default |
|
|
8
|
+
|------|-------------|------|---------|
|
|
9
|
+
| `appearance*` | Allows to define the breadcrumb appearance. | `'standard'` `'inverse'` | `standard` |
|
|
10
|
+
| `links*` | Links of the breadcrumb. | `Array<{ label: string; href: string; target?: '_blank'` `'_self'` `'_parent'` `'_top'; }>` | |
|
|
11
|
+
|