@mozaic-ds/web-components 1.0.0-beta.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -68
- package/dist/Cross20.js +1 -1
- package/dist/Cross20.js.map +1 -1
- package/dist/Cross24.js +1 -1
- package/dist/Cross24.js.map +1 -1
- package/dist/CrossCircleFilled24.js +1 -1
- package/dist/CrossCircleFilled24.js.map +1 -1
- package/dist/attributes.js +1 -1
- package/dist/attributes.js.map +1 -1
- package/dist/bundle.d.ts +24 -23
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +24 -23
- package/dist/components/avatar/Avatar.js +2 -5
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/Avatar.spec.js +17 -0
- package/dist/components/avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.stories.js +3 -29
- package/dist/components/avatar/Avatar.svelte +9 -10
- 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 +6 -9
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.spec.js +42 -0
- package/dist/components/breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.stories.js +6 -35
- package/dist/components/breadcrumb/Breadcrumb.svelte +26 -34
- 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 +3 -6
- 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 +186 -168
- 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 +15 -14
- 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 -6
- 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 +75 -58
- 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 +4 -7
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.spec.js +113 -0
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts +5 -13
- package/dist/components/checkboxgroup/CheckboxGroup.stories.d.ts.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.stories.js +56 -140
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +89 -81
- 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 +4 -7
- 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 +46 -30
- 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 -6
- 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 +103 -79
- package/dist/components/datepicker/Datepicker.svelte.d.ts +30 -1
- package/dist/components/datepicker/Datepicker.svelte.d.ts.map +1 -1
- package/dist/components/datepicker/README.md +18 -0
- package/dist/components/drawer/Drawer.js +12 -15
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.spec.js +101 -0
- package/dist/components/drawer/Drawer.stories.d.ts +29 -8
- package/dist/components/drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.stories.js +86 -87
- package/dist/components/drawer/Drawer.svelte +185 -161
- package/dist/components/drawer/Drawer.svelte.d.ts +26 -3
- package/dist/components/drawer/Drawer.svelte.d.ts.map +1 -1
- package/dist/components/drawer/README.md +29 -0
- package/dist/components/field/Field.js +3 -6
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/field/Field.spec.js +51 -0
- package/dist/components/field/Field.stories.d.ts +9 -15
- package/dist/components/field/Field.stories.d.ts.map +1 -1
- package/dist/components/field/Field.stories.js +86 -142
- package/dist/components/field/Field.svelte +63 -30
- package/dist/components/field/Field.svelte.d.ts +38 -7
- package/dist/components/field/Field.svelte.d.ts.map +1 -1
- package/dist/components/field/README.md +24 -0
- package/dist/components/flag/Flag.js +2 -5
- package/dist/components/flag/Flag.js.map +1 -1
- package/dist/components/flag/Flag.spec.js +30 -0
- package/dist/components/flag/Flag.stories.d.ts +8 -18
- package/dist/components/flag/Flag.stories.d.ts.map +1 -1
- package/dist/components/flag/Flag.stories.js +28 -106
- package/dist/components/flag/Flag.svelte +23 -24
- 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 -5
- 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 +157 -152
- 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 -5
- 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 +19 -12
- 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 -5
- 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 +19 -16
- 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 -5
- 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 +54 -52
- 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 +7 -10
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/loader/Loader.spec.js +54 -0
- package/dist/components/loader/Loader.stories.d.ts +8 -10
- package/dist/components/loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/loader/Loader.stories.js +27 -43
- package/dist/components/loader/Loader.svelte +42 -43
- 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 +14 -17
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.spec.js +50 -0
- package/dist/components/modal/Modal.stories.d.ts +36 -9
- package/dist/components/modal/Modal.stories.d.ts.map +1 -1
- package/dist/components/modal/Modal.stories.js +54 -83
- package/dist/components/modal/Modal.svelte +167 -166
- 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 -5
- 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 +36 -35
- 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 -5
- package/dist/components/overlay/Overlay.js.map +1 -1
- package/dist/components/overlay/Overlay.spec.js +29 -0
- package/dist/components/overlay/Overlay.stories.d.ts +5 -7
- package/dist/components/overlay/Overlay.stories.d.ts.map +1 -1
- package/dist/components/overlay/Overlay.stories.js +32 -40
- package/dist/components/overlay/Overlay.svelte +21 -12
- 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 +8 -11
- 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 +53 -35
- 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 +4 -9
- 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 +424 -60
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts +34 -2
- package/dist/components/passwordinput/PasswordInput.svelte.d.ts.map +1 -1
- package/dist/components/passwordinput/README.md +19 -0
- package/dist/components/pincode/Pincode.js +4 -7
- 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 +72 -60
- 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 +3 -7
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.spec.js +104 -0
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts +11 -15
- package/dist/components/quantityselector/QuantitySelector.stories.d.ts.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +77 -145
- package/dist/components/quantityselector/QuantitySelector.svelte +136 -112
- 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 -5
- 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 +58 -39
- 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 +4 -7
- 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 +81 -77
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts +28 -9
- package/dist/components/radiogroup/RadioGroup.svelte.d.ts.map +1 -1
- package/dist/components/select/README.md +18 -0
- package/dist/components/select/Select.js +3 -6
- 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 +77 -67
- package/dist/components/select/Select.svelte.d.ts +41 -10
- package/dist/components/select/Select.svelte.d.ts.map +1 -1
- package/dist/components/statusbadge/README.md +11 -0
- package/dist/components/statusbadge/StatusBadge.js +2 -5
- 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 +34 -29
- 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 -5
- package/dist/components/statusdot/StatusDot.js.map +1 -1
- package/dist/components/statusdot/StatusDot.spec.js +42 -0
- package/dist/components/statusdot/StatusDot.stories.d.ts.map +1 -1
- package/dist/components/statusdot/StatusDot.stories.js +9 -37
- package/dist/components/statusdot/StatusDot.svelte +15 -16
- package/dist/components/statusdot/StatusDot.svelte.d.ts +2 -2
- package/dist/components/statusdot/StatusDot.svelte.d.ts.map +1 -1
- package/dist/components/statusnotification/README.md +25 -0
- package/dist/components/statusnotification/StatusNotification.js +3 -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 +186 -187
- 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/tab/Tab.svelte +154 -0
- 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 -5
- 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 +46 -29
- 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 +2 -5
- package/dist/components/tags/Tag.js.map +1 -1
- package/dist/components/tags/Tag.svelte +35 -38
- package/dist/components/tags/TagContextualised.js +2 -5
- package/dist/components/tags/TagContextualised.js.map +1 -1
- package/dist/components/tags/TagContextualised.svelte +35 -38
- package/dist/components/tags/TagInteractive.js +2 -5
- package/dist/components/tags/TagInteractive.js.map +1 -1
- package/dist/components/tags/TagInteractive.svelte +35 -38
- package/dist/components/tags/TagRemovable.js +2 -5
- package/dist/components/tags/TagRemovable.js.map +1 -1
- package/dist/components/tags/TagRemovable.svelte +35 -38
- package/dist/components/tags/TagSelectable.js +2 -5
- package/dist/components/tags/TagSelectable.js.map +1 -1
- package/dist/components/tags/TagSelectable.svelte +35 -38
- package/dist/components/tags/Tags.stories.d.ts.map +1 -1
- package/dist/components/tags/Tags.stories.js +7 -1
- package/dist/components/tags/TagsContextualised.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsContextualised.stories.js +7 -1
- package/dist/components/tags/TagsInteractive.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsInteractive.stories.js +7 -1
- package/dist/components/tags/TagsRemovable.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsRemovable.stories.js +7 -1
- package/dist/components/tags/TagsSelectable.stories.d.ts.map +1 -1
- package/dist/components/tags/TagsSelectable.stories.js +7 -1
- package/dist/components/textarea/README.md +19 -0
- package/dist/components/textarea/Textarea.js +2 -8
- 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 +70 -117
- 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 +5 -9
- 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 +107 -148
- package/dist/components/textinput/Textinput.svelte.d.ts +46 -22
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/toaster/README.md +28 -0
- package/dist/components/toaster/Toaster.js +5 -8
- 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 +157 -146
- package/dist/components/toaster/Toaster.svelte.d.ts +3 -0
- package/dist/components/toaster/Toaster.svelte.d.ts.map +1 -1
- package/dist/components/toggle/README.md +15 -0
- package/dist/components/toggle/Toggle.js +2 -5
- 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 +59 -48
- 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 -6
- 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 +91 -97
- 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 +4 -7
- 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 +31 -25
- 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 +45 -11
- package/dist/documentation/SupportAndOnboarding.mdx +2 -2
- package/dist/each.js +1 -1
- package/dist/each.js.map +1 -1
- package/dist/if.js +1 -1
- package/dist/if.js.map +1 -1
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/legacy.js +1 -1
- package/dist/legacy.js.map +1 -1
- package/dist/main.d.ts +24 -23
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +24 -23
- package/dist/slot.js +1 -1
- package/dist/slot.js.map +1 -1
- package/dist/this.js +2 -0
- package/dist/this.js.map +1 -0
- package/package.json +12 -4
- 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 -30
- 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 -159
- 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 -7
- package/dist/components/tabs/Tab.js.map +0 -1
- package/dist/components/tabs/Tab.svelte +0 -137
- package/dist/components/tabs/Tab.svelte.d.ts.map +0 -1
- package/dist/components/textinput/textinput.types.d.ts +0 -3
- package/dist/components/textinput/textinput.types.d.ts.map +0 -1
- package/dist/components/textinput/textinput.types.js +0 -1
- package/dist/components/toggle/toggle.types.d.ts +0 -2
- package/dist/components/toggle/toggle.types.d.ts.map +0 -1
- package/dist/components/toggle/toggle.types.js +0 -1
- package/dist/index-client.js +0 -2
- package/dist/index-client.js.map +0 -1
- package/dist/snippet.js +0 -2
- package/dist/snippet.js.map +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { render, fireEvent } from '@testing-library/svelte';
|
|
3
|
+
import CheckboxGroup from './CheckboxGroup.svelte';
|
|
4
|
+
const baseOptions = [
|
|
5
|
+
{ id: 'cb1', label: 'Option 1', value: 'opt1' },
|
|
6
|
+
{ id: 'cb2', label: 'Option 2', value: 'opt2' },
|
|
7
|
+
{ id: 'cb3', label: 'Option 3', value: 'opt3' },
|
|
8
|
+
];
|
|
9
|
+
describe('m-checkbox-group component', () => {
|
|
10
|
+
it('renders all checkbox options', () => {
|
|
11
|
+
const { getByLabelText } = render(CheckboxGroup, {
|
|
12
|
+
props: {
|
|
13
|
+
name: 'choices',
|
|
14
|
+
options: baseOptions,
|
|
15
|
+
value: [],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
baseOptions.forEach((opt) => {
|
|
19
|
+
const checkbox = getByLabelText(opt.label);
|
|
20
|
+
expect(checkbox).toBeTruthy();
|
|
21
|
+
expect(checkbox.name).toBe('choices');
|
|
22
|
+
expect(checkbox.value).toBe(opt.value);
|
|
23
|
+
expect(checkbox.checked).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
it('pre-selects values from the value prop', () => {
|
|
27
|
+
const { getByLabelText } = render(CheckboxGroup, {
|
|
28
|
+
props: {
|
|
29
|
+
name: 'choices',
|
|
30
|
+
options: baseOptions,
|
|
31
|
+
value: ['opt2'],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const cb1 = getByLabelText('Option 1');
|
|
35
|
+
const cb2 = getByLabelText('Option 2');
|
|
36
|
+
const cb3 = getByLabelText('Option 3');
|
|
37
|
+
expect(cb1.checked).toBe(false);
|
|
38
|
+
expect(cb2.checked).toBe(true);
|
|
39
|
+
expect(cb3.checked).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
it('updates value when user toggles checkboxes', async () => {
|
|
42
|
+
const { getByLabelText } = render(CheckboxGroup, {
|
|
43
|
+
props: {
|
|
44
|
+
name: 'choices',
|
|
45
|
+
options: baseOptions,
|
|
46
|
+
value: [],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const cb1 = getByLabelText('Option 1');
|
|
50
|
+
const cb2 = getByLabelText('Option 2');
|
|
51
|
+
await fireEvent.click(cb1);
|
|
52
|
+
expect(cb1.checked).toBe(true);
|
|
53
|
+
await fireEvent.click(cb2);
|
|
54
|
+
expect(cb2.checked).toBe(true);
|
|
55
|
+
await fireEvent.click(cb1);
|
|
56
|
+
expect(cb1.checked).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
it('applies invalid class and aria-invalid when isinvalid=true', () => {
|
|
59
|
+
const { container, getByLabelText } = render(CheckboxGroup, {
|
|
60
|
+
props: {
|
|
61
|
+
name: 'choices',
|
|
62
|
+
options: baseOptions,
|
|
63
|
+
isinvalid: true,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
const inputs = container.querySelectorAll('input[type="checkbox"]');
|
|
67
|
+
inputs.forEach((input) => {
|
|
68
|
+
expect(input).toHaveClass('is-invalid');
|
|
69
|
+
expect(input).toHaveAttribute('aria-invalid', 'true');
|
|
70
|
+
});
|
|
71
|
+
const cb1 = getByLabelText('Option 1');
|
|
72
|
+
expect(cb1).toHaveClass('is-invalid');
|
|
73
|
+
});
|
|
74
|
+
it('applies inline layout when inline=true', () => {
|
|
75
|
+
const { container } = render(CheckboxGroup, {
|
|
76
|
+
props: {
|
|
77
|
+
name: 'choices',
|
|
78
|
+
options: baseOptions,
|
|
79
|
+
inline: true,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
const wrapper = container.querySelector('.mc-field__content');
|
|
83
|
+
expect(wrapper).toHaveClass('mc-field__content--inline');
|
|
84
|
+
});
|
|
85
|
+
it('renders disabled checkboxes properly', () => {
|
|
86
|
+
const disabledOptions = [
|
|
87
|
+
{ id: 'cb1', label: 'Option 1', value: 'opt1', disabled: true },
|
|
88
|
+
{ id: 'cb2', label: 'Option 2', value: 'opt2' },
|
|
89
|
+
];
|
|
90
|
+
const { getByLabelText } = render(CheckboxGroup, {
|
|
91
|
+
props: {
|
|
92
|
+
name: 'choices',
|
|
93
|
+
options: disabledOptions,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
const cb1 = getByLabelText('Option 1');
|
|
97
|
+
const cb2 = getByLabelText('Option 2');
|
|
98
|
+
expect(cb1.disabled).toBe(true);
|
|
99
|
+
expect(cb2.disabled).toBe(false);
|
|
100
|
+
});
|
|
101
|
+
it('sets indeterminate checkboxes', () => {
|
|
102
|
+
const { container } = render(CheckboxGroup, {
|
|
103
|
+
props: {
|
|
104
|
+
name: 'choices',
|
|
105
|
+
options: [
|
|
106
|
+
{ id: 'cb1', label: 'Option 1', value: 'opt1', indeterminate: true },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
const input = container.querySelector('input[type="checkbox"]');
|
|
111
|
+
expect(input.indeterminate).toBe(true);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import type { Meta } from '@storybook/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* The `MCheckboxGroup` component is the **Svelte / WebComponent** implementation of the **Checkbox group** component of Mozaic Design System.
|
|
7
|
-
* The full specification of this component is available in [the associated documentation](https://mozaic.adeo.cloud/components/form/checkbox/#checkbox-group).
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: Meta;
|
|
10
|
-
export default _default;
|
|
11
|
-
export declare const Default: any;
|
|
12
|
-
export declare const AllChecked: any;
|
|
13
|
-
export declare const SomeDisabled: any;
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Default: Story;
|
|
14
6
|
//# sourceMappingURL=CheckboxGroup.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/components/checkboxgroup/CheckboxGroup.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/components/checkboxgroup/CheckboxGroup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAKrE,QAAA,MAAM,IAAI,EAAE,IAyDX,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,146 +1,62 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
1
3
|
import { action } from 'storybook/actions';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checkbox Groups are used to manage multiple checkbox selections within a group.
|
|
5
|
-
* They usually find their place in forms and allow users to choose multiple options.
|
|
6
|
-
*
|
|
7
|
-
* The `MCheckboxGroup` component is the **Svelte / WebComponent** implementation of the **Checkbox group** component of Mozaic Design System.
|
|
8
|
-
* The full specification of this component is available in [the associated documentation](https://mozaic.adeo.cloud/components/form/checkbox/#checkbox-group).
|
|
9
|
-
*/
|
|
10
|
-
export default {
|
|
4
|
+
const meta = {
|
|
11
5
|
title: 'Form Elements/Checkbox Group',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
options: {
|
|
23
|
-
description: 'Specify the checkbox options in JSON format. ```{ value: string; id?: string; label?: string; disabled?: boolean; indeterminate?: boolean; isinvalid?: boolean; }[]```',
|
|
24
|
-
control: { type: 'object' },
|
|
25
|
-
},
|
|
26
|
-
values: {
|
|
27
|
-
description: 'Specify the select items selected values in checkbox options',
|
|
28
|
-
control: { type: 'object' },
|
|
29
|
-
},
|
|
30
|
-
onChange: {
|
|
31
|
-
description: 'Event that occurs when the checkbox state changes',
|
|
32
|
-
action: 'change',
|
|
33
|
-
table: {
|
|
34
|
-
category: 'Events',
|
|
6
|
+
component: 'm-checkbox-group',
|
|
7
|
+
args: {
|
|
8
|
+
name: 'checkboxGroupName',
|
|
9
|
+
value: ['checkbox2'],
|
|
10
|
+
options: [
|
|
11
|
+
{
|
|
12
|
+
id: 'checkbox-01',
|
|
13
|
+
label: 'checkbox Label',
|
|
14
|
+
value: 'checkbox1',
|
|
35
15
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
table: {
|
|
41
|
-
category: 'Events',
|
|
16
|
+
{
|
|
17
|
+
id: 'checkbox-02',
|
|
18
|
+
label: 'checkbox Label',
|
|
19
|
+
value: 'checkbox2',
|
|
42
20
|
},
|
|
43
|
-
|
|
21
|
+
{
|
|
22
|
+
id: 'checkbox-03',
|
|
23
|
+
label: 'checkbox Label',
|
|
24
|
+
value: 'checkbox3',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'checkbox-04',
|
|
28
|
+
label: 'checkbox Label',
|
|
29
|
+
value: 'checkbox4',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
render: (args) => {
|
|
34
|
+
const onInput = action('input');
|
|
35
|
+
const onChange = action('change');
|
|
36
|
+
const onFocus = action('focus');
|
|
37
|
+
const onBlur = action('blur');
|
|
38
|
+
return html `
|
|
39
|
+
<m-checkbox-group
|
|
40
|
+
name=${ifDefined(args.name)}
|
|
41
|
+
.options=${ifDefined(args.options)}
|
|
42
|
+
value=${ifDefined(args.value)}
|
|
43
|
+
isinvalid=${ifDefined(args.isinvalid)}
|
|
44
|
+
inline=${ifDefined(args.inline)}
|
|
45
|
+
@input=${(event) => {
|
|
46
|
+
onInput(event);
|
|
47
|
+
}}
|
|
48
|
+
@change=${(event) => {
|
|
49
|
+
onChange(event);
|
|
50
|
+
}}
|
|
51
|
+
@focus=${(event) => {
|
|
52
|
+
onFocus(event);
|
|
53
|
+
}}
|
|
54
|
+
@blur=${(event) => {
|
|
55
|
+
onBlur(event);
|
|
56
|
+
}}
|
|
57
|
+
></m-checkbox-group>
|
|
58
|
+
`;
|
|
44
59
|
},
|
|
45
60
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
checkboxGroup.setAttribute('id', args.id || 'checkbox-group-id');
|
|
49
|
-
checkboxGroup.setAttribute('legend', args.legend || 'Checkbox Group Title');
|
|
50
|
-
checkboxGroup.setAttribute('options', JSON.stringify(args.options || []));
|
|
51
|
-
checkboxGroup.setAttribute('values', JSON.stringify(args.values || []));
|
|
52
|
-
checkboxGroup.onchange = action('onChange');
|
|
53
|
-
checkboxGroup.onblur = action('onBlur');
|
|
54
|
-
return checkboxGroup;
|
|
55
|
-
};
|
|
56
|
-
export const Default = Template.bind({});
|
|
57
|
-
Default.args = {
|
|
58
|
-
options: [
|
|
59
|
-
{
|
|
60
|
-
id: 'option1',
|
|
61
|
-
name: 'option1',
|
|
62
|
-
label: 'Option 1',
|
|
63
|
-
value: 'option1',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: 'option2',
|
|
67
|
-
name: 'option2',
|
|
68
|
-
label: 'Option 2',
|
|
69
|
-
value: 'option2',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: 'option3',
|
|
73
|
-
name: 'option3',
|
|
74
|
-
label: 'Option 3',
|
|
75
|
-
value: 'option3',
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
values: ['option2'],
|
|
79
|
-
};
|
|
80
|
-
Default.play = async ({ canvasElement }) => {
|
|
81
|
-
const group = canvasElement.querySelector('m-checkbox-group');
|
|
82
|
-
const checkboxGroup = group?.shadowRoot?.querySelectorAll('input');
|
|
83
|
-
expect(group).not.toBeNull();
|
|
84
|
-
expect(checkboxGroup?.length).toBe(3);
|
|
85
|
-
await userEvent.click(checkboxGroup[0]);
|
|
86
|
-
expect(checkboxGroup?.[0]).toBeChecked();
|
|
87
|
-
};
|
|
88
|
-
export const AllChecked = Template.bind({});
|
|
89
|
-
AllChecked.args = {
|
|
90
|
-
options: [
|
|
91
|
-
{
|
|
92
|
-
id: 'option1',
|
|
93
|
-
name: 'option1',
|
|
94
|
-
label: 'Option 1',
|
|
95
|
-
value: 'option1',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'option2',
|
|
99
|
-
name: 'option2',
|
|
100
|
-
label: 'Option 2',
|
|
101
|
-
value: 'option2',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'option3',
|
|
105
|
-
name: 'option3',
|
|
106
|
-
label: 'Option 3',
|
|
107
|
-
value: 'option3',
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
values: ['option1', 'option2', 'option3'],
|
|
111
|
-
};
|
|
112
|
-
AllChecked.play = async ({ canvasElement }) => {
|
|
113
|
-
const group = canvasElement.querySelector('m-checkbox-group');
|
|
114
|
-
const checkboxGroup = group?.shadowRoot?.querySelectorAll('input');
|
|
115
|
-
expect(checkboxGroup?.length).toBe(3);
|
|
116
|
-
checkboxGroup?.forEach((checkbox) => expect(checkbox).toBeChecked());
|
|
117
|
-
};
|
|
118
|
-
export const SomeDisabled = Template.bind({});
|
|
119
|
-
SomeDisabled.args = {
|
|
120
|
-
options: [
|
|
121
|
-
{
|
|
122
|
-
id: 'option1',
|
|
123
|
-
name: 'option1',
|
|
124
|
-
label: 'Option 1',
|
|
125
|
-
value: 'option1',
|
|
126
|
-
disabled: true,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: 'option2',
|
|
130
|
-
name: 'option2',
|
|
131
|
-
label: 'Option 2',
|
|
132
|
-
checked: true,
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: 'option3',
|
|
136
|
-
name: 'option3',
|
|
137
|
-
label: 'Option 3',
|
|
138
|
-
checked: false,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
};
|
|
142
|
-
SomeDisabled.play = async ({ canvasElement }) => {
|
|
143
|
-
const group = canvasElement.querySelector('m-checkbox-group');
|
|
144
|
-
const checkboxGroup = group?.shadowRoot?.querySelectorAll('input');
|
|
145
|
-
expect(checkboxGroup?.[0]).toBeDisabled();
|
|
146
|
-
};
|
|
61
|
+
export default meta;
|
|
62
|
+
export const Default = {};
|
|
@@ -9,70 +9,73 @@
|
|
|
9
9
|
/>
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import type { CheckboxGroupOption } from './checkboxgroup.types';
|
|
13
12
|
import { customElementForwardEvents } from '../../utils';
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A checkbox is an interactive component used to select or deselect an option, typically within a list of choices. It allows users to make multiple selections independently and is often accompanied by a label for clarity. Checkboxes are commonly used in forms, filters, settings, and preference selections to provide a simple and intuitive way to enable or disable specific options. <br><br> To put a label, requierement text, help text or to apply a valid or invalid message, the examples are available in the [Field section](/docs/form-elements-field--docs#input).
|
|
15
|
+
*/
|
|
15
16
|
interface Props {
|
|
16
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The name attribute for the checkbox element, typically used for form submission.
|
|
19
|
+
*/
|
|
17
20
|
name: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The current value of the checkbox group.
|
|
23
|
+
*/
|
|
24
|
+
value?: Array<string>;
|
|
25
|
+
/**
|
|
26
|
+
* list of properties of each checkbox button of the checkbox group
|
|
27
|
+
*/
|
|
28
|
+
options: Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
value: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
indeterminate?: boolean;
|
|
34
|
+
indented?: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* If `true`, applies an invalid state to the checkbox group.
|
|
38
|
+
*/
|
|
39
|
+
isinvalid?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* If `true`, make the form element of the group inline.
|
|
42
|
+
*/
|
|
43
|
+
inline?: boolean;
|
|
21
44
|
}
|
|
22
45
|
|
|
23
|
-
const uid = $props.id();
|
|
24
46
|
let {
|
|
25
47
|
name,
|
|
26
|
-
id = uid,
|
|
27
48
|
options,
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
value = $bindable([]),
|
|
50
|
+
inline,
|
|
51
|
+
isinvalid,
|
|
30
52
|
}: Props = $props();
|
|
31
|
-
|
|
32
|
-
function getOptionId(index: number): string {
|
|
33
|
-
return options[index]?.id ?? `${id}-${index}`;
|
|
34
|
-
}
|
|
35
53
|
</script>
|
|
36
54
|
|
|
37
|
-
<div class=
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
bind:indeterminate={opt.indeterminate}
|
|
55
|
-
aria-invalid={opt.isinvalid}
|
|
56
|
-
bind:group={values}
|
|
57
|
-
value={opt.value}
|
|
58
|
-
/>
|
|
59
|
-
{#if opt.label}
|
|
60
|
-
<label for={getOptionId(index)} class="mc-checkbox__label"
|
|
61
|
-
>{opt.label}</label
|
|
62
|
-
>
|
|
63
|
-
{/if}
|
|
64
|
-
</div>
|
|
65
|
-
{/each}
|
|
55
|
+
<div class={['mc-field__content', inline && 'mc-field__content--inline']}>
|
|
56
|
+
{#each options as option}
|
|
57
|
+
<div class="mc-checkbox mc-field__item">
|
|
58
|
+
<input
|
|
59
|
+
type="checkbox"
|
|
60
|
+
class={['mc-checkbox__input', isinvalid && 'is-invalid']}
|
|
61
|
+
id={option.id}
|
|
62
|
+
{name}
|
|
63
|
+
disabled={option.disabled}
|
|
64
|
+
indeterminate={option.indeterminate}
|
|
65
|
+
aria-invalid={isinvalid}
|
|
66
|
+
bind:group={value}
|
|
67
|
+
value={option.value}
|
|
68
|
+
/>
|
|
69
|
+
{#if option.label}
|
|
70
|
+
<label for={option.id} class="mc-checkbox__label">{option.label}</label>
|
|
71
|
+
{/if}
|
|
66
72
|
</div>
|
|
67
|
-
|
|
73
|
+
{/each}
|
|
68
74
|
</div>
|
|
69
75
|
|
|
70
76
|
<style>/**
|
|
71
77
|
* Do not edit directly, this file was auto-generated.
|
|
72
78
|
*/
|
|
73
|
-
/**
|
|
74
|
-
* Do not edit directly, this file was auto-generated.
|
|
75
|
-
*/
|
|
76
79
|
/* stylelint-disable string-no-newline */
|
|
77
80
|
.mc-checkbox {
|
|
78
81
|
align-items: center;
|
|
@@ -84,9 +87,9 @@
|
|
|
84
87
|
margin-left: 1.75rem;
|
|
85
88
|
}
|
|
86
89
|
.mc-checkbox__label {
|
|
87
|
-
font-size: 1rem;
|
|
88
|
-
line-height: 1.3;
|
|
89
|
-
color: #000000;
|
|
90
|
+
font-size: var(--font-size-150, 1rem);
|
|
91
|
+
line-height: var(--line-height-s, 1.3);
|
|
92
|
+
color: var(--forms-color-text-default, #000000);
|
|
90
93
|
cursor: pointer;
|
|
91
94
|
}
|
|
92
95
|
.mc-checkbox__input {
|
|
@@ -95,29 +98,29 @@
|
|
|
95
98
|
cursor: pointer;
|
|
96
99
|
flex-shrink: 0;
|
|
97
100
|
transition: box-shadow 200ms ease;
|
|
98
|
-
background-color: #ffffff;
|
|
99
|
-
border: 0.125rem solid #666666;
|
|
100
|
-
border-radius: 0.25rem;
|
|
101
|
+
background-color: var(--forms-color-background-default, #ffffff);
|
|
102
|
+
border: var(--border-m, 0.125rem) solid var(--forms-color-border-default, #666666);
|
|
103
|
+
border-radius: var(--forms-radius-border, 0.25rem);
|
|
101
104
|
transition: all ease 200ms;
|
|
102
105
|
height: 1.25rem;
|
|
103
106
|
width: 1.25rem;
|
|
104
107
|
}
|
|
105
108
|
.mc-checkbox__input:hover {
|
|
106
|
-
border-color: #4d4d4d;
|
|
109
|
+
border-color: var(--forms-color-border-hover, #4d4d4d);
|
|
107
110
|
}
|
|
108
111
|
.mc-checkbox__input:focus-visible {
|
|
109
|
-
box-shadow: 0 0 0 0.125rem var(--focus-color-mid, #ffffff), 0 0 0 0.25rem var(--focus-color-outer, #000000);
|
|
112
|
+
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));
|
|
110
113
|
outline: 0.125rem solid transparent;
|
|
111
114
|
outline-offset: 0.125rem;
|
|
112
115
|
}
|
|
113
116
|
.mc-checkbox__input:checked {
|
|
114
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");
|
|
117
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");
|
|
115
118
|
}
|
|
116
119
|
.mc-checkbox__input:indeterminate {
|
|
117
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E");
|
|
120
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-inverse, %23ffffff)' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E");
|
|
118
121
|
}
|
|
119
122
|
.mc-checkbox__input:checked, .mc-checkbox__input:indeterminate {
|
|
120
|
-
background-color: #117f03;
|
|
123
|
+
background-color: var(--forms-color-background-checked, #117f03);
|
|
121
124
|
background-size: 1rem 1rem;
|
|
122
125
|
background-position: center;
|
|
123
126
|
}
|
|
@@ -125,46 +128,46 @@
|
|
|
125
128
|
border-color: transparent;
|
|
126
129
|
}
|
|
127
130
|
.mc-checkbox__input:disabled {
|
|
128
|
-
background-color: #d9d9d9;
|
|
131
|
+
background-color: var(--forms-color-background-disabled, #d9d9d9);
|
|
129
132
|
cursor: not-allowed;
|
|
130
133
|
}
|
|
131
134
|
.mc-checkbox__input:disabled:checked {
|
|
132
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");
|
|
135
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-disabled, %23737373)' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");
|
|
133
136
|
}
|
|
134
137
|
.mc-checkbox__input:disabled:indeterminate {
|
|
135
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E");
|
|
138
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' fill='var(--forms-color-icon-disabled, %23737373)' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E");
|
|
136
139
|
}
|
|
137
140
|
.mc-checkbox__input:disabled + .mc-checkbox__label {
|
|
138
|
-
color: #737373;
|
|
141
|
+
color: var(--forms-color-text-disabled, #737373);
|
|
139
142
|
cursor: not-allowed;
|
|
140
143
|
}
|
|
141
144
|
.mc-checkbox__input:not(:disabled):checked:hover, .mc-checkbox__input:not(:disabled):indeterminate:hover {
|
|
142
|
-
background-color: #006902;
|
|
145
|
+
background-color: var(--forms-color-background-checked-hover, #006902);
|
|
143
146
|
}
|
|
144
147
|
.mc-checkbox__input.is-invalid:not(:checked, :indeterminate) {
|
|
145
|
-
border-color: #ea302d;
|
|
148
|
+
border-color: var(--forms-color-border-invalid, #ea302d);
|
|
146
149
|
}
|
|
147
150
|
.mc-checkbox__input.is-invalid:not(:checked, :indeterminate):hover {
|
|
148
|
-
border-color: #c61112;
|
|
151
|
+
border-color: var(--forms-color-border-invalid-hover, #c61112);
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
/* stylelint-enable string-no-newline */
|
|
152
155
|
/* stylelint-disable string-no-newline */
|
|
153
156
|
.mc-field__label, .mc-field__legend {
|
|
154
|
-
font-size: 0.875rem;
|
|
155
|
-
line-height: 1.3;
|
|
156
|
-
font-weight: 400;
|
|
157
|
-
color: #000000;
|
|
157
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
158
|
+
line-height: var(--line-height-s, 1.3);
|
|
159
|
+
font-weight: var(--font-weight-regular, 400);
|
|
160
|
+
color: var(--field-color-label, #000000);
|
|
158
161
|
}
|
|
159
162
|
.mc-field__legend {
|
|
160
163
|
padding-inline: 0;
|
|
161
164
|
}
|
|
162
165
|
.mc-field__requirement, .mc-field__help {
|
|
163
|
-
font-size: 0.75rem;
|
|
164
|
-
line-height: 1.5;
|
|
165
|
-
font-weight: 400;
|
|
166
|
+
font-size: var(--font-size-50, 0.75rem);
|
|
167
|
+
line-height: var(--line-height-m, 1.5);
|
|
168
|
+
font-weight: var(--font-weight-regular, 400);
|
|
166
169
|
vertical-align: top;
|
|
167
|
-
color: #666666;
|
|
170
|
+
color: var(--field-color-requirement, #666666);
|
|
168
171
|
}
|
|
169
172
|
.mc-field__help {
|
|
170
173
|
display: block;
|
|
@@ -174,8 +177,8 @@
|
|
|
174
177
|
margin-top: 0.5rem;
|
|
175
178
|
}
|
|
176
179
|
.mc-field__validation-message {
|
|
177
|
-
font-size: 0.875rem;
|
|
178
|
-
line-height: 1.5;
|
|
180
|
+
font-size: var(--font-size-100, 0.875rem);
|
|
181
|
+
line-height: var(--line-height-m, 1.5);
|
|
179
182
|
display: inline-flex;
|
|
180
183
|
gap: 0.25rem;
|
|
181
184
|
margin-top: 0.25rem;
|
|
@@ -186,19 +189,19 @@
|
|
|
186
189
|
width: 1.25rem;
|
|
187
190
|
}
|
|
188
191
|
.mc-field__validation-message.is-valid {
|
|
189
|
-
color: #117f03;
|
|
192
|
+
color: var(--field-color-validation-valid, #117f03);
|
|
190
193
|
}
|
|
191
194
|
.mc-field__validation-message.is-valid::before {
|
|
192
|
-
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='%23117f03' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M3.25 10c0-3.72792 3.02208-6.75 6.75-6.75 3.7279 0 6.75 3.02208 6.75 6.75 0 3.7279-3.0221 6.75-6.75 6.75-3.72792 0-6.75-3.0221-6.75-6.75ZM10 1.75c-4.55635 0-8.25 3.69365-8.25 8.25 0 4.5563 3.69365 8.25 8.25 8.25 4.5563 0 8.25-3.6937 8.25-8.25 0-4.55635-3.6937-8.25-8.25-8.25Zm4.2803 6.697c.2929-.2929.2929-.76777 0-1.06066-.2929-.2929-.7677-.2929-1.0606 0L9.16667 11.4393 7.197 9.46967c-.2929-.29289-.76777-.29289-1.06066 0-.2929.29289-.2929.76773 0 1.06063l2.5 2.5c.29289.2929.76776.2929 1.06066 0l4.5833-4.5833Z'/%3E%3C/svg%3E");
|
|
195
|
+
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(--field-color-validation-valid, %23117f03)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M3.25 10c0-3.72792 3.02208-6.75 6.75-6.75 3.7279 0 6.75 3.02208 6.75 6.75 0 3.7279-3.0221 6.75-6.75 6.75-3.72792 0-6.75-3.0221-6.75-6.75ZM10 1.75c-4.55635 0-8.25 3.69365-8.25 8.25 0 4.5563 3.69365 8.25 8.25 8.25 4.5563 0 8.25-3.6937 8.25-8.25 0-4.55635-3.6937-8.25-8.25-8.25Zm4.2803 6.697c.2929-.2929.2929-.76777 0-1.06066-.2929-.2929-.7677-.2929-1.0606 0L9.16667 11.4393 7.197 9.46967c-.2929-.29289-.76777-.29289-1.06066 0-.2929.29289-.2929.76773 0 1.06063l2.5 2.5c.29289.2929.76776.2929 1.06066 0l4.5833-4.5833Z'/%3E%3C/svg%3E");
|
|
193
196
|
}
|
|
194
197
|
.mc-field__validation-message.is-invalid {
|
|
195
|
-
color: #c61112;
|
|
198
|
+
color: var(--field-color-validation-invalid, #c61112);
|
|
196
199
|
}
|
|
197
200
|
.mc-field__validation-message.is-invalid::before {
|
|
198
|
-
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='%23c61112' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 3.25c-3.72792 0-6.75 3.02208-6.75 6.75 0 3.7279 3.02208 6.75 6.75 6.75 3.7279 0 6.75-3.0221 6.75-6.75 0-3.72792-3.0221-6.75-6.75-6.75ZM1.75 10c0-4.55635 3.69365-8.25 8.25-8.25 4.5563 0 8.25 3.69365 8.25 8.25 0 4.5563-3.6937 8.25-8.25 8.25-4.55635 0-8.25-3.6937-8.25-8.25ZM10 5.91667c.4142 0 .75.33578.75.75v4.16663c0 .4142-.3358.75-.75.75-.41421 0-.75-.3358-.75-.75V6.66667c0-.41422.33579-.75.75-.75Zm0 8.25003c.4602 0 .8333-.3731.8333-.8334 0-.4602-.3731-.8333-.8333-.8333-.46024 0-.83333.3731-.83333.8333 0 .4603.37309.8334.83333.8334Z'/%3E%3C/svg%3E");
|
|
201
|
+
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(--field-color-validation-invalid, %23c61112)' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 3.25c-3.72792 0-6.75 3.02208-6.75 6.75 0 3.7279 3.02208 6.75 6.75 6.75 3.7279 0 6.75-3.0221 6.75-6.75 0-3.72792-3.0221-6.75-6.75-6.75ZM1.75 10c0-4.55635 3.69365-8.25 8.25-8.25 4.5563 0 8.25 3.69365 8.25 8.25 0 4.5563-3.6937 8.25-8.25 8.25-4.55635 0-8.25-3.6937-8.25-8.25ZM10 5.91667c.4142 0 .75.33578.75.75v4.16663c0 .4142-.3358.75-.75.75-.41421 0-.75-.3358-.75-.75V6.66667c0-.41422.33579-.75.75-.75Zm0 8.25003c.4602 0 .8333-.3731.8333-.8334 0-.4602-.3731-.8333-.8333-.8333-.46024 0-.83333.3731-.83333.8333 0 .4603.37309.8334.83333.8334Z'/%3E%3C/svg%3E");
|
|
199
202
|
}
|
|
200
203
|
.mc-field__validation-message.is-loading {
|
|
201
|
-
color: #666666;
|
|
204
|
+
color: var(--field-color-validation-loading, #666666);
|
|
202
205
|
}
|
|
203
206
|
.mc-field--group {
|
|
204
207
|
border-width: 0;
|
|
@@ -216,4 +219,9 @@
|
|
|
216
219
|
gap: 0.25rem 1rem;
|
|
217
220
|
}
|
|
218
221
|
|
|
219
|
-
/* stylelint-enable string-no-newline
|
|
222
|
+
/* stylelint-enable string-no-newline */
|
|
223
|
+
.mc-field__content:where(.mc-field__content--inline) {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-flow: row wrap;
|
|
226
|
+
gap: 0.25rem 1rem;
|
|
227
|
+
}</style>
|
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A checkbox is an interactive component used to select or deselect an option, typically within a list of choices. It allows users to make multiple selections independently and is often accompanied by a label for clarity. Checkboxes are commonly used in forms, filters, settings, and preference selections to provide a simple and intuitive way to enable or disable specific options. <br><br> To put a label, requierement text, help text or to apply a valid or invalid message, the examples are available in the [Field section](/docs/form-elements-field--docs#input).
|
|
3
|
+
*/
|
|
2
4
|
interface Props {
|
|
3
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The name attribute for the checkbox element, typically used for form submission.
|
|
7
|
+
*/
|
|
4
8
|
name: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The current value of the checkbox group.
|
|
11
|
+
*/
|
|
12
|
+
value?: Array<string>;
|
|
13
|
+
/**
|
|
14
|
+
* list of properties of each checkbox button of the checkbox group
|
|
15
|
+
*/
|
|
16
|
+
options: Array<{
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
indeterminate?: boolean;
|
|
22
|
+
indented?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, applies an invalid state to the checkbox group.
|
|
26
|
+
*/
|
|
27
|
+
isinvalid?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If `true`, make the form element of the group inline.
|
|
30
|
+
*/
|
|
31
|
+
inline?: boolean;
|
|
8
32
|
}
|
|
9
|
-
declare const CheckboxGroup: import("svelte").Component<Props, {}, "
|
|
33
|
+
declare const CheckboxGroup: import("svelte").Component<Props, {}, "value">;
|
|
10
34
|
type CheckboxGroup = ReturnType<typeof CheckboxGroup>;
|
|
11
35
|
export default CheckboxGroup;
|
|
12
36
|
//# sourceMappingURL=CheckboxGroup.svelte.d.ts.map
|