@mozaic-ds/web-components 1.5.1 → 1.7.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/dist/Condition20.js +1 -1
- package/dist/Condition20.js.map +1 -1
- package/dist/accordion-list.state.svelte.js +1 -1
- package/dist/attributes.js +1 -1
- package/dist/attributes.js.map +1 -1
- package/dist/branches.js +1 -1
- package/dist/branches.js.map +1 -1
- package/dist/bundle.d.ts +16 -0
- package/dist/bundle.d.ts.map +1 -1
- package/dist/bundle.js +16 -0
- package/dist/components/accordionlist/AccordionList.js +4 -4
- package/dist/components/accordionlist/AccordionList.js.map +1 -1
- package/dist/components/accordionlist/AccordionList.stories.js +2 -2
- package/dist/components/accordionlist/AccordionList.svelte +19 -17
- package/dist/components/accordionlistItem/AccordionListItem.js +4 -4
- package/dist/components/accordionlistItem/AccordionListItem.js.map +1 -1
- package/dist/components/accordionlistItem/AccordionListItem.svelte +19 -17
- package/dist/components/actionbottombar/ActionBottomBar.js +2 -2
- package/dist/components/actionlistbox/ActionListbox.js +6 -4
- package/dist/components/actionlistbox/ActionListbox.js.map +1 -1
- package/dist/components/actionlistbox/ActionListbox.spec.js +73 -16
- package/dist/components/actionlistbox/ActionListbox.stories.d.ts +2 -0
- package/dist/components/actionlistbox/ActionListbox.stories.d.ts.map +1 -1
- package/dist/components/actionlistbox/ActionListbox.stories.js +73 -2
- package/dist/components/actionlistbox/ActionListbox.svelte +158 -12
- package/dist/components/actionlistbox/ActionListbox.svelte.d.ts +11 -1
- package/dist/components/actionlistbox/ActionListbox.svelte.d.ts.map +1 -1
- package/dist/components/actionlistbox/README.md +3 -0
- package/dist/components/actionlistboxitem/ActionListboxItem.js +2 -2
- package/dist/components/actionlistboxitem/ActionListboxItem.js.map +1 -1
- package/dist/components/actionlistboxitem/ActionListboxItem.svelte +21 -5
- package/dist/components/actionlistboxitem/ActionListboxItem.svelte.d.ts +6 -1
- package/dist/components/actionlistboxitem/ActionListboxItem.svelte.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +2 -2
- package/dist/components/breadcrumb/Breadcrumb.js +4 -6
- package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.svelte +7 -14
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts.map +1 -1
- package/dist/components/builtinmenu/BuiltInMenu.js +2 -2
- package/dist/components/builtinmenu/BuiltInMenu.stories.d.ts +1 -1
- package/dist/components/builtinmenu/BuiltInMenu.stories.d.ts.map +1 -1
- package/dist/components/builtinmenu/BuiltInMenu.stories.js +2 -2
- package/dist/components/builtinmenu/BuiltInMenu.svelte +1 -1
- package/dist/components/builtinmenuitem/BuiltInMenuItem.js +3 -3
- package/dist/components/builtinmenuitem/BuiltInMenuItem.svelte +1 -1
- package/dist/components/button/Button.js +3 -3
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.svelte +16 -1
- package/dist/components/button/Button.svelte.d.ts +6 -1
- package/dist/components/button/Button.svelte.d.ts.map +1 -1
- package/dist/components/callout/Callout.js +2 -2
- package/dist/components/callout/Callout.stories.d.ts +3 -3
- package/dist/components/callout/Callout.stories.d.ts.map +1 -1
- package/dist/components/callout/Callout.stories.js +3 -3
- package/dist/components/carousel/Carousel.js +2 -2
- package/dist/components/carousel/Carousel.js.map +1 -1
- package/dist/components/carousel/Carousel.svelte +1 -0
- package/dist/components/checkbox/Checkbox.js +4 -4
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox/Checkbox.svelte +30 -10
- package/dist/components/checkboxgroup/CheckboxGroup.js +4 -4
- package/dist/components/checkboxgroup/CheckboxGroup.js.map +1 -1
- package/dist/components/checkboxgroup/CheckboxGroup.svelte +30 -10
- package/dist/components/checklistmenu/CheckListMenu.js +2 -2
- package/dist/components/checklistmenu/CheckListMenu.js.map +1 -1
- package/dist/components/checklistmenu/CheckListMenu.stories.js +1 -1
- package/dist/components/circularprogressbar/CircularProgressbar.js +2 -2
- package/dist/components/combobox/Combobox.js +4 -0
- package/dist/components/combobox/Combobox.js.map +1 -0
- package/dist/components/combobox/Combobox.spec.js +186 -0
- package/dist/components/combobox/Combobox.stories.d.ts +17 -0
- package/dist/components/combobox/Combobox.stories.d.ts.map +1 -0
- package/dist/components/combobox/Combobox.stories.js +126 -0
- package/dist/components/combobox/Combobox.svelte +415 -0
- package/dist/components/combobox/Combobox.svelte.d.ts +99 -0
- package/dist/components/combobox/Combobox.svelte.d.ts.map +1 -0
- package/dist/components/combobox/README.md +38 -0
- package/dist/components/container/Container.js +2 -2
- package/dist/components/datepicker/Datepicker.js +3 -3
- package/dist/components/datepicker/Datepicker.js.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.d.ts +1 -1
- package/dist/components/datepicker/Datepicker.stories.d.ts.map +1 -1
- package/dist/components/datepicker/Datepicker.stories.js +2 -2
- package/dist/components/datepicker/Datepicker.svelte +34 -9
- package/dist/components/divider/Divider.js +2 -2
- package/dist/components/divider/Divider.js.map +1 -1
- package/dist/components/divider/Divider.svelte +6 -1
- package/dist/components/divider/Divider.svelte.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +4 -4
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/Drawer.svelte +6 -2
- package/dist/components/field/Field.js +3 -3
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/field/Field.spec.js +1 -1
- package/dist/components/field/Field.svelte +7 -3
- package/dist/components/fileuploader/FileUploader.js +2 -2
- package/dist/components/fileuploader/FileUploader.js.map +1 -1
- package/dist/components/fileuploader/FileUploader.stories.js +3 -3
- package/dist/components/fileuploader/FileUploader.svelte +5 -5
- package/dist/components/fileuploaderitem/FileUploaderItem.js +3 -3
- package/dist/components/fileuploaderitem/FileUploaderItem.svelte +1 -4
- package/dist/components/flag/Flag.js +2 -2
- package/dist/components/iconbutton/IconButton.js +2 -2
- package/dist/components/iconbutton/IconButton.js.map +1 -1
- package/dist/components/iconbutton/IconButton.svelte +11 -1
- package/dist/components/iconbutton/IconButton.svelte.d.ts +3 -1
- package/dist/components/iconbutton/IconButton.svelte.d.ts.map +1 -1
- package/dist/components/kpiitem/KpiItem.js +2 -2
- package/dist/components/linearprogressbarbuffer/LinearProgressbarBuffer.js +2 -2
- package/dist/components/linearprogressbarpercentage/LinearProgressbarPercentage.js +2 -2
- package/dist/components/link/Link.js +2 -2
- package/dist/components/link/Link.stories.js +2 -2
- package/dist/components/loader/Loader.js +2 -2
- package/dist/components/loadingoverlay/LoadingOverlay.js +2 -2
- package/dist/components/loadingoverlay/LoadingOverlay.svelte +1 -1
- package/dist/components/modal/Modal.js +5 -5
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/modal/Modal.spec.js +3 -1
- package/dist/components/modal/Modal.svelte +14 -4
- package/dist/components/modal/Modal.svelte.d.ts +4 -0
- package/dist/components/modal/Modal.svelte.d.ts.map +1 -1
- package/dist/components/modal/README.md +1 -0
- package/dist/components/navigationindicator/NavigationIndicator.js +4 -0
- package/dist/components/navigationindicator/NavigationIndicator.js.map +1 -0
- package/dist/components/navigationindicator/NavigationIndicator.spec.js +130 -0
- package/dist/components/navigationindicator/NavigationIndicator.stories.d.ts +8 -0
- package/dist/components/navigationindicator/NavigationIndicator.stories.d.ts.map +1 -0
- package/dist/components/navigationindicator/NavigationIndicator.stories.js +40 -0
- package/dist/components/navigationindicator/NavigationIndicator.svelte +156 -0
- package/dist/components/navigationindicator/NavigationIndicator.svelte.d.ts +34 -0
- package/dist/components/navigationindicator/NavigationIndicator.svelte.d.ts.map +1 -0
- package/dist/components/navigationindicator/README.md +21 -0
- package/dist/components/numberbadge/NumberBadge.js +2 -2
- package/dist/components/optionlistbox/OptionListbox.js +23 -0
- package/dist/components/optionlistbox/OptionListbox.js.map +1 -0
- package/dist/components/optionlistbox/OptionListbox.spec.js +350 -0
- package/dist/components/optionlistbox/OptionListbox.svelte +566 -0
- package/dist/components/optionlistbox/OptionListbox.svelte.d.ts +92 -0
- package/dist/components/optionlistbox/OptionListbox.svelte.d.ts.map +1 -0
- package/dist/components/optionlistbox/README.md +38 -0
- package/dist/components/overlay/Overlay.js +2 -2
- package/dist/components/overlay/Overlay.svelte +2 -2
- package/dist/components/pageheader/PageHeader.js +24 -0
- package/dist/components/pageheader/PageHeader.js.map +1 -0
- package/dist/components/pageheader/PageHeader.spec.js +75 -0
- package/dist/components/pageheader/PageHeader.stories.d.ts +12 -0
- package/dist/components/pageheader/PageHeader.stories.d.ts.map +1 -0
- package/dist/components/pageheader/PageHeader.stories.js +82 -0
- package/dist/components/pageheader/PageHeader.svelte +268 -0
- package/dist/components/pageheader/PageHeader.svelte.d.ts +66 -0
- package/dist/components/pageheader/PageHeader.svelte.d.ts.map +1 -0
- package/dist/components/pageheader/README.md +32 -0
- package/dist/components/pagination/Pagination.js +8 -8
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/Pagination.svelte +44 -28
- package/dist/components/pagination/Pagination.svelte.d.ts.map +1 -1
- package/dist/components/passwordinput/PasswordInput.js +4 -4
- package/dist/components/passwordinput/PasswordInput.js.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.d.ts +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/passwordinput/PasswordInput.stories.js +2 -2
- package/dist/components/passwordinput/PasswordInput.svelte +16 -6
- package/dist/components/phonenumber/PhoneNumber.js +13 -11
- package/dist/components/phonenumber/PhoneNumber.js.map +1 -1
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts +1 -1
- package/dist/components/phonenumber/PhoneNumber.stories.d.ts.map +1 -1
- package/dist/components/phonenumber/PhoneNumber.stories.js +2 -2
- package/dist/components/phonenumber/PhoneNumber.svelte +87 -39
- package/dist/components/phonenumber/PhoneNumber.svelte.d.ts.map +1 -1
- package/dist/components/pincode/Pincode.js +2 -2
- package/dist/components/pincode/Pincode.js.map +1 -1
- package/dist/components/pincode/Pincode.stories.d.ts +1 -1
- package/dist/components/pincode/Pincode.stories.d.ts.map +1 -1
- package/dist/components/pincode/Pincode.stories.js +2 -2
- package/dist/components/popover/Popover.js +6 -0
- package/dist/components/popover/Popover.js.map +1 -0
- package/dist/components/popover/Popover.spec.js +69 -0
- package/dist/components/popover/Popover.stories.d.ts +36 -0
- package/dist/components/popover/Popover.stories.d.ts.map +1 -0
- package/dist/components/popover/Popover.stories.js +124 -0
- package/dist/components/popover/Popover.svelte +348 -0
- package/dist/components/popover/Popover.svelte.d.ts +79 -0
- package/dist/components/popover/Popover.svelte.d.ts.map +1 -0
- package/dist/components/popover/README.md +25 -0
- package/dist/components/quantityselector/QuantitySelector.js +3 -3
- package/dist/components/quantityselector/QuantitySelector.js.map +1 -1
- package/dist/components/quantityselector/QuantitySelector.stories.js +1 -1
- package/dist/components/quantityselector/QuantitySelector.svelte +4 -4
- package/dist/components/radio/Radio.js +2 -2
- package/dist/components/radio/Radio.js.map +1 -1
- package/dist/components/radiogroup/RadioGroup.js +2 -2
- package/dist/components/radiogroup/RadioGroup.js.map +1 -1
- package/dist/components/radiogroup/RadioGroup.svelte +6 -2
- package/dist/components/segmentedcontrol/README.md +6 -3
- package/dist/components/segmentedcontrol/SegmentedControl.js +2 -2
- package/dist/components/segmentedcontrol/SegmentedControl.js.map +1 -1
- package/dist/components/segmentedcontrol/SegmentedControl.spec.js +60 -23
- package/dist/components/segmentedcontrol/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/segmentedcontrol/SegmentedControl.stories.js +6 -1
- package/dist/components/segmentedcontrol/SegmentedControl.svelte +23 -10
- package/dist/components/segmentedcontrol/SegmentedControl.svelte.d.ts +10 -3
- package/dist/components/segmentedcontrol/SegmentedControl.svelte.d.ts.map +1 -1
- package/dist/components/select/Select.js +3 -3
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.spec.js +2 -2
- package/dist/components/select/Select.stories.d.ts +1 -1
- package/dist/components/select/Select.stories.d.ts.map +1 -1
- package/dist/components/select/Select.stories.js +2 -2
- package/dist/components/select/Select.svelte +50 -31
- package/dist/components/select/Select.svelte.d.ts.map +1 -1
- package/dist/components/sidebar/README.md +28 -0
- package/dist/components/sidebar/Sidebar.js +18 -0
- package/dist/components/sidebar/Sidebar.js.map +1 -0
- package/dist/components/sidebar/Sidebar.spec.js +74 -0
- package/dist/components/sidebar/Sidebar.stories.d.ts +23 -0
- package/dist/components/sidebar/Sidebar.stories.d.ts.map +1 -0
- package/dist/components/sidebar/Sidebar.stories.js +333 -0
- package/dist/components/sidebar/Sidebar.svelte +570 -0
- package/dist/components/sidebar/Sidebar.svelte.d.ts +47 -0
- package/dist/components/sidebar/Sidebar.svelte.d.ts.map +1 -0
- package/dist/components/sidebar/floating-item.spec.js +96 -0
- package/dist/components/sidebar/floating-item.svelte.d.ts +13 -0
- package/dist/components/sidebar/floating-item.svelte.d.ts.map +1 -0
- package/dist/components/sidebar/floating-item.svelte.js +95 -0
- package/dist/components/sidebar/sidebar-state.spec.js +112 -0
- package/dist/components/sidebar/sidebar-state.svelte.d.ts +9 -0
- package/dist/components/sidebar/sidebar-state.svelte.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar-state.svelte.js +36 -0
- package/dist/components/sidebarexpandableitem/README.md +19 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.js +18 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.js.map +1 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.spec.js +85 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.svelte +578 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.svelte.d.ts +49 -0
- package/dist/components/sidebarexpandableitem/SidebarExpandableItem.svelte.d.ts.map +1 -0
- package/dist/components/sidebarfooter/README.md +29 -0
- package/dist/components/sidebarfooter/SidebarFooter.js +18 -0
- package/dist/components/sidebarfooter/SidebarFooter.js.map +1 -0
- package/dist/components/sidebarfooter/SidebarFooter.spec.js +132 -0
- package/dist/components/sidebarfooter/SidebarFooter.svelte +1018 -0
- package/dist/components/sidebarfooter/SidebarFooter.svelte.d.ts +60 -0
- package/dist/components/sidebarfooter/SidebarFooter.svelte.d.ts.map +1 -0
- package/dist/components/sidebarfooter/_SidebarFooterMenu.js +18 -0
- package/dist/components/sidebarfooter/_SidebarFooterMenu.js.map +1 -0
- package/dist/components/sidebarfooter/_SidebarFooterMenu.svelte +517 -0
- package/dist/components/sidebarfooter/_SidebarFooterMenu.svelte.d.ts +36 -0
- package/dist/components/sidebarfooter/_SidebarFooterMenu.svelte.d.ts.map +1 -0
- package/dist/components/sidebarheader/README.md +11 -0
- package/dist/components/sidebarheader/SidebarHeader.js +18 -0
- package/dist/components/sidebarheader/SidebarHeader.js.map +1 -0
- package/dist/components/sidebarheader/SidebarHeader.spec.js +37 -0
- package/dist/components/sidebarheader/SidebarHeader.svelte +499 -0
- package/dist/components/sidebarheader/SidebarHeader.svelte.d.ts +17 -0
- package/dist/components/sidebarheader/SidebarHeader.svelte.d.ts.map +1 -0
- package/dist/components/sidebarnavitem/README.md +30 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.js +18 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.js.map +1 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.spec.js +95 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.svelte +617 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.svelte.d.ts +58 -0
- package/dist/components/sidebarnavitem/SidebarNavItem.svelte.d.ts.map +1 -0
- package/dist/components/sidebarshortcutitem/README.md +17 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.js +18 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.js.map +1 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.spec.js +34 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.svelte +509 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.svelte.d.ts +35 -0
- package/dist/components/sidebarshortcutitem/SidebarShortcutItem.svelte.d.ts.map +1 -0
- package/dist/components/sidebarshortcuts/README.md +23 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.js +18 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.js.map +1 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.spec.js +82 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.svelte +583 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.svelte.d.ts +42 -0
- package/dist/components/sidebarshortcuts/SidebarShortcuts.svelte.d.ts.map +1 -0
- package/dist/components/starrating/StarRating.js +2 -2
- package/dist/components/starrating/StarRating.js.map +1 -1
- package/dist/components/starrating/StarRating.stories.d.ts +5 -5
- package/dist/components/starrating/StarRating.stories.d.ts.map +1 -1
- package/dist/components/starrating/StarRating.stories.js +5 -5
- package/dist/components/statusbadge/StatusBadge.js +2 -2
- package/dist/components/statusdot/StatusDot.js +2 -2
- package/dist/components/statusmessage/StatusMessage.js +2 -2
- package/dist/components/statusmessage/StatusMessage.js.map +1 -1
- package/dist/components/statusmessage/StatusMessage.svelte +5 -0
- package/dist/components/statusnotification/StatusNotification.js +2 -2
- package/dist/components/statusnotification/StatusNotification.js.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.d.ts +3 -3
- package/dist/components/statusnotification/StatusNotification.stories.d.ts.map +1 -1
- package/dist/components/statusnotification/StatusNotification.stories.js +3 -3
- package/dist/components/statusnotification/StatusNotification.svelte +9 -1
- package/dist/components/stepperbottombar/StepperBottomBar.js +3 -3
- package/dist/components/stepperbottombar/StepperBottomBar.svelte +5 -1
- package/dist/components/stepperbottombar/StepperBottomBar.svelte.d.ts +1 -1
- package/dist/components/steppercompact/StepperCompact.js +2 -2
- package/dist/components/stepperinline/README.md +6 -2
- package/dist/components/stepperinline/StepperInline.js +3 -3
- package/dist/components/stepperinline/StepperInline.js.map +1 -1
- package/dist/components/stepperinline/StepperInline.spec.js +57 -23
- package/dist/components/stepperinline/StepperInline.stories.d.ts.map +1 -1
- package/dist/components/stepperinline/StepperInline.stories.js +6 -11
- package/dist/components/stepperinline/StepperInline.svelte +24 -11
- package/dist/components/stepperinline/StepperInline.svelte.d.ts +11 -3
- package/dist/components/stepperinline/StepperInline.svelte.d.ts.map +1 -1
- package/dist/components/stepperstacked/README.md +15 -0
- package/dist/components/stepperstacked/StepperStacked.js +18 -0
- package/dist/components/stepperstacked/StepperStacked.js.map +1 -0
- package/dist/components/stepperstacked/StepperStacked.spec.js +138 -0
- package/dist/components/stepperstacked/StepperStacked.stories.d.ts +8 -0
- package/dist/components/stepperstacked/StepperStacked.stories.d.ts.map +1 -0
- package/dist/components/stepperstacked/StepperStacked.stories.js +33 -0
- package/dist/components/stepperstacked/StepperStacked.svelte +214 -0
- package/dist/components/stepperstacked/StepperStacked.svelte.d.ts +35 -0
- package/dist/components/stepperstacked/StepperStacked.svelte.d.ts.map +1 -0
- package/dist/components/tab/README.md +1 -0
- package/dist/components/tab/Tab.js +2 -2
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/tab/Tab.svelte +17 -1
- package/dist/components/tab/Tab.svelte.d.ts +4 -0
- package/dist/components/tab/Tab.svelte.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +2 -2
- package/dist/components/tabs/Tabs.stories.d.ts +1 -0
- package/dist/components/tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.stories.js +11 -1
- package/dist/components/tag/README.md +1 -0
- package/dist/components/tag/Tag.js +2 -2
- package/dist/components/tag/Tag.js.map +1 -1
- package/dist/components/tag/Tag.svelte +15 -5
- package/dist/components/tag/Tag.svelte.d.ts +4 -0
- package/dist/components/tag/Tag.svelte.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +2 -2
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/Textarea.stories.d.ts +1 -1
- package/dist/components/textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.stories.js +2 -2
- package/dist/components/textarea/Textarea.svelte +1 -0
- package/dist/components/textinput/README.md +3 -0
- package/dist/components/textinput/Textinput.js +5 -5
- package/dist/components/textinput/Textinput.js.map +1 -1
- package/dist/components/textinput/Textinput.stories.d.ts +11 -1
- package/dist/components/textinput/Textinput.stories.d.ts.map +1 -1
- package/dist/components/textinput/Textinput.stories.js +21 -29
- package/dist/components/textinput/Textinput.svelte +33 -5
- package/dist/components/textinput/Textinput.svelte.d.ts +10 -1
- package/dist/components/textinput/Textinput.svelte.d.ts.map +1 -1
- package/dist/components/tile/README.md +19 -0
- package/dist/components/tile/Tile.js +111 -0
- package/dist/components/tile/Tile.js.map +1 -0
- package/dist/components/tile/Tile.spec.js +21 -0
- package/dist/components/tile/Tile.stories.d.ts +10 -0
- package/dist/components/tile/Tile.stories.d.ts.map +1 -0
- package/dist/components/tile/Tile.stories.js +37 -0
- package/dist/components/tile/Tile.svelte +894 -0
- package/dist/components/tile/Tile.svelte.d.ts +48 -0
- package/dist/components/tile/Tile.svelte.d.ts.map +1 -0
- package/dist/components/tileclickable/README.md +31 -0
- package/dist/components/tileclickable/TileClickable.js +114 -0
- package/dist/components/tileclickable/TileClickable.js.map +1 -0
- package/dist/components/tileclickable/TileClickable.spec.js +62 -0
- package/dist/components/tileclickable/TileClickable.stories.d.ts +10 -0
- package/dist/components/tileclickable/TileClickable.stories.d.ts.map +1 -0
- package/dist/components/tileclickable/TileClickable.stories.js +52 -0
- package/dist/components/tileclickable/TileClickable.svelte +954 -0
- package/dist/components/tileclickable/TileClickable.svelte.d.ts +65 -0
- package/dist/components/tileclickable/TileClickable.svelte.d.ts.map +1 -0
- package/dist/components/tileexpandable/README.md +20 -0
- package/dist/components/tileexpandable/TileExpandable.js +114 -0
- package/dist/components/tileexpandable/TileExpandable.js.map +1 -0
- package/dist/components/tileexpandable/TileExpandable.spec.js +65 -0
- package/dist/components/tileexpandable/TileExpandable.stories.d.ts +7 -0
- package/dist/components/tileexpandable/TileExpandable.stories.d.ts.map +1 -0
- package/dist/components/tileexpandable/TileExpandable.stories.js +38 -0
- package/dist/components/tileexpandable/TileExpandable.svelte +956 -0
- package/dist/components/tileexpandable/TileExpandable.svelte.d.ts +53 -0
- package/dist/components/tileexpandable/TileExpandable.svelte.d.ts.map +1 -0
- package/dist/components/tileselectable/README.md +21 -0
- package/dist/components/tileselectable/TileSelectable.js +108 -0
- package/dist/components/tileselectable/TileSelectable.js.map +1 -0
- package/dist/components/tileselectable/TileSelectable.spec.js +57 -0
- package/dist/components/tileselectable/TileSelectable.stories.d.ts +9 -0
- package/dist/components/tileselectable/TileSelectable.stories.d.ts.map +1 -0
- package/dist/components/tileselectable/TileSelectable.stories.js +44 -0
- package/dist/components/tileselectable/TileSelectable.svelte +939 -0
- package/dist/components/tileselectable/TileSelectable.svelte.d.ts +57 -0
- package/dist/components/tileselectable/TileSelectable.svelte.d.ts.map +1 -0
- package/dist/components/toaster/Toaster.js +3 -3
- package/dist/components/toaster/Toaster.js.map +1 -1
- package/dist/components/toaster/Toaster.stories.d.ts +2 -2
- package/dist/components/toaster/Toaster.stories.d.ts.map +1 -1
- package/dist/components/toaster/Toaster.stories.js +2 -2
- package/dist/components/toaster/Toaster.svelte +11 -3
- package/dist/components/toggle/Toggle.js +2 -2
- package/dist/components/toggle/Toggle.js.map +1 -1
- package/dist/components/toggle/Toggle.svelte +0 -14
- package/dist/components/togglegroup/ToggleGroup.js +2 -2
- package/dist/components/togglegroup/ToggleGroup.js.map +1 -1
- package/dist/components/togglegroup/ToggleGroup.svelte +6 -16
- package/dist/components/tooltip/README.md +1 -0
- package/dist/components/tooltip/Tooltip.js +2 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/Tooltip.svelte +18 -10
- package/dist/components/tooltip/Tooltip.svelte.d.ts +4 -0
- package/dist/components/tooltip/Tooltip.svelte.d.ts.map +1 -1
- package/dist/custom-element.js +3 -3
- package/dist/custom-element.js.map +1 -1
- package/dist/documentation/DarkMode.mdx +115 -0
- package/dist/each.js +1 -1
- package/dist/each.js.map +1 -1
- package/dist/floating-item.svelte.js +2 -0
- package/dist/floating-item.svelte.js.map +1 -0
- package/dist/if.js +1 -1
- package/dist/if.js.map +1 -1
- package/dist/index-client.js +1 -1
- package/dist/index-client.js.map +1 -1
- package/dist/input.js +1 -1
- package/dist/main.d.ts +17 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -1
- package/dist/media-query.js +2 -0
- package/dist/media-query.js.map +1 -0
- package/dist/sidebar-state.svelte.js +2 -0
- package/dist/sidebar-state.svelte.js.map +1 -0
- package/dist/slot.js +1 -1
- package/dist/svelte-component.js +1 -1
- package/dist/svelte-component.js.map +1 -1
- package/dist/svelte-element.js +1 -1
- package/dist/svelte-element.js.map +1 -1
- package/dist/this.js +1 -1
- package/package.json +3 -2
|
@@ -161,7 +161,8 @@
|
|
|
161
161
|
}
|
|
162
162
|
.mc-accordion__header:is(summary)::after {
|
|
163
163
|
transform: translateY(-50%) rotateX(0deg);
|
|
164
|
-
|
|
164
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
165
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
165
166
|
content: "";
|
|
166
167
|
position: absolute;
|
|
167
168
|
right: 0.75rem;
|
|
@@ -169,22 +170,22 @@
|
|
|
169
170
|
flex-shrink: 0;
|
|
170
171
|
width: 1rem;
|
|
171
172
|
height: 1rem;
|
|
172
|
-
background-
|
|
173
|
-
background-position: center;
|
|
174
|
-
background-size: 1rem;
|
|
173
|
+
background-color: var(--accordion-list-color-text-title, #000000);
|
|
175
174
|
z-index: 1;
|
|
176
175
|
}
|
|
177
176
|
.mc-accordion__header:is(summary):hover .mc-accordion__trigger::before {
|
|
178
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
177
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
179
178
|
}
|
|
180
179
|
.mc-accordion__header:is(summary):hover::after {
|
|
181
|
-
|
|
180
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
181
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
182
182
|
}
|
|
183
183
|
.mc-accordion__header:is(summary):active .mc-accordion__trigger::before {
|
|
184
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
184
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
185
185
|
}
|
|
186
186
|
.mc-accordion__header:is(summary):active::after {
|
|
187
|
-
|
|
187
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
188
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
188
189
|
}
|
|
189
190
|
.mc-accordion__header:is(summary):focus-visible {
|
|
190
191
|
outline: none;
|
|
@@ -315,7 +316,8 @@
|
|
|
315
316
|
}
|
|
316
317
|
.mc-accordion__trigger:not(.mc-accordion__header:is(summary) .mc-accordion__trigger)::after {
|
|
317
318
|
transform: translateY(-50%) rotateX(0deg);
|
|
318
|
-
|
|
319
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
320
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
319
321
|
content: "";
|
|
320
322
|
position: absolute;
|
|
321
323
|
right: 1rem;
|
|
@@ -323,9 +325,7 @@
|
|
|
323
325
|
flex-shrink: 0;
|
|
324
326
|
width: 1rem;
|
|
325
327
|
height: 1rem;
|
|
326
|
-
background-
|
|
327
|
-
background-position: center;
|
|
328
|
-
background-size: 1rem;
|
|
328
|
+
background-color: var(--accordion-list-color-text-title, #000000);
|
|
329
329
|
z-index: 1;
|
|
330
330
|
}
|
|
331
331
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -348,16 +348,18 @@
|
|
|
348
348
|
width: 100%;
|
|
349
349
|
}
|
|
350
350
|
.mc-accordion__trigger:hover::before {
|
|
351
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
351
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
352
352
|
}
|
|
353
353
|
.mc-accordion__trigger:hover::after {
|
|
354
|
-
|
|
354
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
355
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
355
356
|
}
|
|
356
357
|
.mc-accordion__trigger:active::before {
|
|
357
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
358
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
358
359
|
}
|
|
359
360
|
.mc-accordion__trigger:active::after {
|
|
360
|
-
|
|
361
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
362
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
361
363
|
}
|
|
362
364
|
.mc-accordion__icon {
|
|
363
365
|
flex-shrink: 0;
|
|
@@ -437,5 +439,5 @@
|
|
|
437
439
|
background-color: var(--accordion-list-color-background-ghost, rgba(255, 255, 255, 0.01));
|
|
438
440
|
}
|
|
439
441
|
.mc-accordion--ghost .mc-accordion__trigger:hover::before, .mc-accordion--ghost .mc-accordion__trigger:active::before {
|
|
440
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
442
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
441
443
|
}</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as H,c as J,
|
|
1
|
+
import{o as H,c as J,e as K,a as N,p as u,s as x,t as z,u as O,b as v,d as P,f as w,h as t,i as y,m as g,w as Q,r as n,k as E}from"../../custom-element.js";import{i as I}from"../../if.js";import{a as R,s as X}from"../../slot.js";import{s as c}from"../../attributes.js";import{b as T}from"../../this.js";import{a as U}from"../../accordion-list.state.svelte.js";import"../../branches.js";var V=w('<span class="mc-accordion__icon svelte-k06wun"><!></span>'),W=w('<span class="mc-accordion__subtitle svelte-k06wun"> </span>'),Z=w('<p class="svelte-k06wun"> </p>'),$=w('<div class="mc-accordion__item svelte-k06wun"><div class="mc-accordion__header svelte-k06wun"><h2 class="mc-accordion__title svelte-k06wun"><button class="mc-accordion__trigger svelte-k06wun"><!> <div class="mc-accordion__title-wrapper svelte-k06wun"><span class="svelte-k06wun"> </span> <!></div></button></h2></div> <div class="mc-accordion__content svelte-k06wun" role="region"><!></div></div>');const ee={hash:"svelte-k06wun",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/
|
|
4
4
|
@supports (interpolate-size: allow-keywords) {
|
|
@@ -32,11 +32,11 @@ import{o as H,c as J,p as K,a as N,b as u,s as x,t as z,f as v,g as O,h as _,d a
|
|
|
32
32
|
@media (prefers-reduced-motion: no-preference) {.mc-accordion__trigger.svelte-k06wun:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))::after {transition:transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);}
|
|
33
33
|
}
|
|
34
34
|
@media (prefers-reduced-motion: reduce) {.mc-accordion__trigger.svelte-k06wun:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))::after {transition:none;}
|
|
35
|
-
}.mc-accordion__trigger.svelte-k06wun:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))::after {transform:translateY(-50%) rotateX(0deg);
|
|
35
|
+
}.mc-accordion__trigger.svelte-k06wun:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))::after {transform:translateY(-50%) rotateX(0deg);mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;content:"";position:absolute;right:1rem;top:50%;flex-shrink:0;width:1rem;height:1rem;background-color:var(--accordion-list-color-text-title, #000000);z-index:1;}
|
|
36
36
|
@media (prefers-reduced-motion: no-preference) {.mc-accordion__trigger:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))[aria-expanded=true].svelte-k06wun::after {transition:transform 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);}
|
|
37
37
|
}
|
|
38
38
|
@media (prefers-reduced-motion: reduce) {.mc-accordion__trigger:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))[aria-expanded=true].svelte-k06wun::after {transition:none;}
|
|
39
|
-
}.mc-accordion__trigger:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))[aria-expanded=true].svelte-k06wun::after {transform:translateY(-50%) rotateX(180deg);}.mc-accordion__trigger.svelte-k06wun:is(button:where(.svelte-k06wun)) {width:100%;}.mc-accordion__trigger.svelte-k06wun:hover::before {background-color:var(--accordion-list-color-background-hover, rgba(
|
|
39
|
+
}.mc-accordion__trigger:not(.mc-accordion__header:where(.svelte-k06wun):is(summary) .mc-accordion__trigger:where(.svelte-k06wun))[aria-expanded=true].svelte-k06wun::after {transform:translateY(-50%) rotateX(180deg);}.mc-accordion__trigger.svelte-k06wun:is(button:where(.svelte-k06wun)) {width:100%;}.mc-accordion__trigger.svelte-k06wun:hover::before {background-color:var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));}.mc-accordion__trigger.svelte-k06wun:hover::after {mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;}.mc-accordion__trigger.svelte-k06wun:active::before {background-color:var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));}.mc-accordion__trigger.svelte-k06wun:active::after {mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;}.mc-accordion__icon.svelte-k06wun {flex-shrink:0;width:2rem;height:2rem;fill:currentcolor;}.mc-accordion__content.svelte-k06wun {font-size:var(--font-size-100, 0.875rem);font-weight:var(--font-weight-regular, 400);line-height:var(--line-height-m, 1.5);background-color:var(--accordion-list-color-background-standard, #ffffff);overflow:hidden;padding:0 0.75rem;max-height:0;}.mc-accordion__content.svelte-k06wun > :where(.svelte-k06wun):first-child {margin-top:0;}.mc-accordion__content.svelte-k06wun > :where(.svelte-k06wun):last-child {margin-bottom:0;}
|
|
40
40
|
@media (prefers-reduced-motion: no-preference) {.mc-accordion__content.svelte-k06wun {transition:max-height 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67), padding 0.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);}
|
|
41
41
|
}
|
|
42
42
|
@media (prefers-reduced-motion: reduce) {.mc-accordion__content.svelte-k06wun {transition:none;}
|
|
@@ -46,5 +46,5 @@ import{o as H,c as J,p as K,a as N,b as u,s as x,t as z,f as v,g as O,h as _,d a
|
|
|
46
46
|
}
|
|
47
47
|
@media (prefers-reduced-motion: reduce) {.mc-accordion__content.svelte-k06wun {transition:none;}
|
|
48
48
|
}.mc-accordion__content.svelte-k06wun {height:0;max-height:none;padding-top:0;padding-bottom:0;}.mc-accordion__content[aria-hidden=false].svelte-k06wun {height:auto;padding-top:0.125rem;padding-bottom:1rem;}
|
|
49
|
-
}`};function
|
|
49
|
+
}`};function re(C,o){const Y=R(o);K(o,!0),N(C,ee);let i=u(o,"id",7),_=u(o,"title",7),l=u(o,"subtitle",7),h=u(o,"content",7),p;const f=Q(()=>U.openIds.includes(i()));function A(){const e=new CustomEvent("update:open",{detail:{id:i(),open:y(f)},bubbles:!0,composed:!0});p.dispatchEvent(e)}var D={get id(){return i()},set id(e){i(e),g()},get title(){return _()},set title(e){_(e),g()},get subtitle(){return l()},set subtitle(e){l(e),g()},get content(){return h()},set content(e){h(e),g()}},m=$(),k=t(m),L=t(k),a=t(L),B=t(a);{var S=e=>{var r=V(),d=t(r);X(d,o,"icon",{},null),n(r),v(e,r)};I(B,e=>{Y.icon&&e(S)})}var M=x(B,2),b=t(M),j=t(b,!0);n(b);var q=x(b,2);{var F=e=>{var r=W(),d=t(r,!0);n(r),z(()=>E(d,l())),v(e,r)};I(q,e=>{l()&&e(F)})}n(M),n(a),n(L),n(k);var s=x(k,2),G=t(s);return X(G,o,"content",{},e=>{var r=Z(),d=t(r,!0);n(r),z(()=>E(d,h()||"")),v(e,r)}),n(s),n(m),T(m,e=>p=e,()=>p),z(()=>{c(a,"id",`accordion-${i()}`),c(a,"aria-controls",`content-${i()}`),c(a,"aria-expanded",y(f)),E(j,_()),c(s,"id",`content-${i()}`),c(s,"aria-hidden",!y(f)),c(s,"aria-labelledby",`accordion-${i()}`)}),O("click",a,()=>A()),v(C,m),P(D)}H(["click"]);customElements.define("m-accordion-list-item",J(re,{id:{},title:{},subtitle:{},content:{}},["icon","content"],[],{mode:"open"}));
|
|
50
50
|
//# sourceMappingURL=AccordionListItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionListItem.js","sources":["../../../src/components/accordionlistItem/AccordionListItem.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-accordion-list-item' }} />\n\n<script lang=\"ts\">\n import { accordion } from '../accordionlist/accordion-list.state.svelte';\n /**\n * An Accordion List is a component that organizes content into collapsible sections, allowing users to show or hide related information within a vertically stacked layout. This structure helps optimize space and improve readability by displaying only relevant content when needed. Accordion Lists are commonly used in FAQs, settings menus, and structured content navigation to enhance user experience and reduce visual clutter.\n *\n * @slot icon - Use this slot to display an icon before the title.\n * @slot content - Use this slot to display custom content.\n * @event update:open {CustomEvent<boolean>} - Emits when the component state changes.\n */\n\n interface Props {\n /**\n * A unique identifier for the accordion item.\n * It links the trigger button (`aria-controls`) to its associated content (`aria-labelledby`),\n * ensuring accessibility and tracking the open/closed state.\n * If no ID is provided, a unique one is generated automatically.\n */\n id: string;\n /**\n * The main heading of the accordion item. This is the primary text visible to users in the collapsed state and acts as the trigger for expanding or collapsing the content.\n */\n title: string;\n /**\n * An optional secondary heading displayed below the title. It provides additional context or detail about the content of the accordion item.\n */\n subtitle?: string;\n /**\n * The main content of the accordion item. This is the information revealed when the accordion is expanded, typically containing text, HTML, or other elements.\n */\n content?: string;\n }\n\n let { id, title, subtitle, content }: Props = $props();\n\n let element: HTMLElement;\n\n const open = $derived(accordion.openIds.includes(id));\n\n function toggleItem() {\n const event = new CustomEvent('update:open', {\n detail: { id, open },\n bubbles: true,\n composed: true,\n });\n element.dispatchEvent(event);\n }\n</script>\n\n<div bind:this={element} class=\"mc-accordion__item\">\n <div class=\"mc-accordion__header\">\n <h2 class=\"mc-accordion__title\">\n <button\n id={`accordion-${id}`}\n class=\"mc-accordion__trigger\"\n aria-controls={`content-${id}`}\n aria-expanded={open}\n onclick={() => toggleItem()}\n >\n {#if $$slots.icon}\n <span class=\"mc-accordion__icon\">\n <slot name=\"icon\" />\n </span>\n {/if}\n\n <div class=\"mc-accordion__title-wrapper\">\n <span>{title}</span>\n\n {#if subtitle}\n <span class=\"mc-accordion__subtitle\">\n {subtitle}\n </span>\n {/if}\n </div>\n </button>\n </h2>\n </div>\n <div\n id={`content-${id}`}\n class=\"mc-accordion__content\"\n aria-hidden={!open}\n aria-labelledby={`accordion-${id}`}\n role=\"region\"\n >\n <slot name=\"content\">\n <p>{content || ''}</p>\n </slot>\n </div>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/accordion-list';\n</style>\n"],"names":["id","$.prop","$$props","title","subtitle","content","element","open","accordion","toggleItem","event","div","root","div_1","h2","button","$.child","node","span","root_1","$$slots","$$render","consequent","div_2","$.sibling","span_1","span_2","root_2","consequent_1","$.reset","div_3","node_3","p","root_3","$.template_effect","$.set_text","text_2","$$value","$.set_attribute","$.get"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEA,
|
|
1
|
+
{"version":3,"file":"AccordionListItem.js","sources":["../../../src/components/accordionlistItem/AccordionListItem.svelte"],"sourcesContent":["<svelte:options customElement={{ tag: 'm-accordion-list-item' }} />\n\n<script lang=\"ts\">\n import { accordion } from '../accordionlist/accordion-list.state.svelte';\n /**\n * An Accordion List is a component that organizes content into collapsible sections, allowing users to show or hide related information within a vertically stacked layout. This structure helps optimize space and improve readability by displaying only relevant content when needed. Accordion Lists are commonly used in FAQs, settings menus, and structured content navigation to enhance user experience and reduce visual clutter.\n *\n * @slot icon - Use this slot to display an icon before the title.\n * @slot content - Use this slot to display custom content.\n * @event update:open {CustomEvent<boolean>} - Emits when the component state changes.\n */\n\n interface Props {\n /**\n * A unique identifier for the accordion item.\n * It links the trigger button (`aria-controls`) to its associated content (`aria-labelledby`),\n * ensuring accessibility and tracking the open/closed state.\n * If no ID is provided, a unique one is generated automatically.\n */\n id: string;\n /**\n * The main heading of the accordion item. This is the primary text visible to users in the collapsed state and acts as the trigger for expanding or collapsing the content.\n */\n title: string;\n /**\n * An optional secondary heading displayed below the title. It provides additional context or detail about the content of the accordion item.\n */\n subtitle?: string;\n /**\n * The main content of the accordion item. This is the information revealed when the accordion is expanded, typically containing text, HTML, or other elements.\n */\n content?: string;\n }\n\n let { id, title, subtitle, content }: Props = $props();\n\n let element: HTMLElement;\n\n const open = $derived(accordion.openIds.includes(id));\n\n function toggleItem() {\n const event = new CustomEvent('update:open', {\n detail: { id, open },\n bubbles: true,\n composed: true,\n });\n element.dispatchEvent(event);\n }\n</script>\n\n<div bind:this={element} class=\"mc-accordion__item\">\n <div class=\"mc-accordion__header\">\n <h2 class=\"mc-accordion__title\">\n <button\n id={`accordion-${id}`}\n class=\"mc-accordion__trigger\"\n aria-controls={`content-${id}`}\n aria-expanded={open}\n onclick={() => toggleItem()}\n >\n {#if $$slots.icon}\n <span class=\"mc-accordion__icon\">\n <slot name=\"icon\" />\n </span>\n {/if}\n\n <div class=\"mc-accordion__title-wrapper\">\n <span>{title}</span>\n\n {#if subtitle}\n <span class=\"mc-accordion__subtitle\">\n {subtitle}\n </span>\n {/if}\n </div>\n </button>\n </h2>\n </div>\n <div\n id={`content-${id}`}\n class=\"mc-accordion__content\"\n aria-hidden={!open}\n aria-labelledby={`accordion-${id}`}\n role=\"region\"\n >\n <slot name=\"content\">\n <p>{content || ''}</p>\n </slot>\n </div>\n</div>\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/accordion-list';\n</style>\n"],"names":["id","$.prop","$$props","title","subtitle","content","element","open","accordion","toggleItem","event","div","root","div_1","h2","button","$.child","node","span","root_1","$$slots","$$render","consequent","div_2","$.sibling","span_1","span_2","root_2","consequent_1","$.reset","div_3","node_3","p","root_3","$.template_effect","$.set_text","text_2","$$value","$.set_attribute","$.get","$.delegated"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEA,kCAgCQA,EAAEC,EAAAC,EAAA,KAAA,CAAA,EAAEC,EAAKF,EAAAC,EAAA,QAAA,CAAA,EAAEE,EAAQH,EAAAC,EAAA,WAAA,CAAA,EAAEG,EAAOJ,EAAAC,EAAA,UAAA,CAAA,EAE9BI,EAEE,MAAAC,QAAgBC,EAAU,QAAQ,SAASR,EAAE,CAAA,CAAA,EAE1C,SAAAS,GAAa,OACdC,EAAK,IAAO,YAAY,cAAa,CACzC,QAAU,GAAAV,EAAE,EAAE,OAAAO,CAAI,CAAA,EAClB,QAAS,GACT,SAAU,KAEZD,EAAQ,cAAcI,CAAK,CAC7B,yMAGDC,EAAGC,EAAA,EACDC,IADFF,CAAG,EAECG,IADFD,CAAG,EAECE,EAAAC,EADFF,CAAE,EACAG,EAAAD,EAAAD,CAAA,iBAQIG,EAAIC,EAAA,MAAJD,CAAI,0BAAJA,CAAI,MAAJA,CAAI,WADFE,EAAQ,MAAIC,EAAAC,CAAA,QAMhBC,EAAGC,EAAAP,EAAA,CAAA,EACDQ,IADFF,CAAG,MACDE,EAAI,EAAA,IAAJA,CAAI,UAAJA,EAAI,CAAA,iBAGFC,EAAIC,EAAA,MAAJD,EAAI,EAAA,IAAJA,CAAI,YACFtB,EAAQ,CAAA,CAAA,MADVsB,CAAI,WADFtB,EAAQ,GAAAiB,EAAAO,CAAA,MAHdL,CAAG,EAbLM,EAAAd,CAAA,IADFD,CAAE,IADJD,CAAG,EA2BH,IAAAiB,EAAAN,EA3BAX,EAAG,CAAA,EA2BHkB,EAAAf,EAAAc,CAAA,oCAQIE,EAACC,EAAA,MAADD,EAAC,EAAA,IAADA,CAAC,EAAEE,EAAA,IAAAC,EAAAC,EAAA/B,EAAO,GAAI,EAAE,CAAA,MAAhB2B,CAAC,IARLH,EAAAC,CAAA,IA5BFnB,CAAG,IAAHA,EAAG0B,GAAY/B,EAAO+B,EAAA,IAAP/B,CAAO,SAGhBgC,EAAAvB,EAAA,KAAA,aACkBf,EAAE,CAAA,EAAA,EADpBsC,EAAAvB,EAAA,gBAAA,WAG2Bf,EAAE,CAAA,EAAA,EAH7BsC,EAAAvB,EAAA,gBAAAwB,EAIgBhC,CAAI,CAAA,MAUVJ,GAAK,EAWnBmC,EAAAR,EAAA,KAAA,WACgB9B,EAAE,CAAA,EAAA,EADlBsC,EAAAR,EAAA,cAAA,CAAAS,EAGehC,CAAI,CAAA,EAHnB+B,EAAAR,EAAA,kBAAA,aAI+B9B,EAAE,CAAA,EAAA,IA7B7BwC,EAAA,QAAAzB,EAAA,IAKgBN,EAAU,CAAA,MARhCE,CAAG,MAFI"}
|
|
@@ -183,7 +183,8 @@
|
|
|
183
183
|
}
|
|
184
184
|
.mc-accordion__header:is(summary)::after {
|
|
185
185
|
transform: translateY(-50%) rotateX(0deg);
|
|
186
|
-
|
|
186
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
187
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
187
188
|
content: "";
|
|
188
189
|
position: absolute;
|
|
189
190
|
right: 0.75rem;
|
|
@@ -191,22 +192,22 @@
|
|
|
191
192
|
flex-shrink: 0;
|
|
192
193
|
width: 1rem;
|
|
193
194
|
height: 1rem;
|
|
194
|
-
background-
|
|
195
|
-
background-position: center;
|
|
196
|
-
background-size: 1rem;
|
|
195
|
+
background-color: var(--accordion-list-color-text-title, #000000);
|
|
197
196
|
z-index: 1;
|
|
198
197
|
}
|
|
199
198
|
.mc-accordion__header:is(summary):hover .mc-accordion__trigger::before {
|
|
200
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
199
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
201
200
|
}
|
|
202
201
|
.mc-accordion__header:is(summary):hover::after {
|
|
203
|
-
|
|
202
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
203
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
204
204
|
}
|
|
205
205
|
.mc-accordion__header:is(summary):active .mc-accordion__trigger::before {
|
|
206
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
206
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
207
207
|
}
|
|
208
208
|
.mc-accordion__header:is(summary):active::after {
|
|
209
|
-
|
|
209
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
210
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
210
211
|
}
|
|
211
212
|
.mc-accordion__header:is(summary):focus-visible {
|
|
212
213
|
outline: none;
|
|
@@ -337,7 +338,8 @@
|
|
|
337
338
|
}
|
|
338
339
|
.mc-accordion__trigger:not(.mc-accordion__header:is(summary) .mc-accordion__trigger)::after {
|
|
339
340
|
transform: translateY(-50%) rotateX(0deg);
|
|
340
|
-
|
|
341
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
342
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
341
343
|
content: "";
|
|
342
344
|
position: absolute;
|
|
343
345
|
right: 1rem;
|
|
@@ -345,9 +347,7 @@
|
|
|
345
347
|
flex-shrink: 0;
|
|
346
348
|
width: 1rem;
|
|
347
349
|
height: 1rem;
|
|
348
|
-
background-
|
|
349
|
-
background-position: center;
|
|
350
|
-
background-size: 1rem;
|
|
350
|
+
background-color: var(--accordion-list-color-text-title, #000000);
|
|
351
351
|
z-index: 1;
|
|
352
352
|
}
|
|
353
353
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -370,16 +370,18 @@
|
|
|
370
370
|
width: 100%;
|
|
371
371
|
}
|
|
372
372
|
.mc-accordion__trigger:hover::before {
|
|
373
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
373
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
374
374
|
}
|
|
375
375
|
.mc-accordion__trigger:hover::after {
|
|
376
|
-
|
|
376
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
377
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
377
378
|
}
|
|
378
379
|
.mc-accordion__trigger:active::before {
|
|
379
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
380
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
380
381
|
}
|
|
381
382
|
.mc-accordion__trigger:active::after {
|
|
382
|
-
|
|
383
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
384
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' aria-hidden='true' height='1rem' width='1rem' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5a1 1 0 01-.71-.29l-5-5a1 1 0 011.42-1.42L8 9.09l4.29-4.3a1 1 0 111.42 1.42l-5 5a1 1 0 01-.71.29z'/%3E%3C/svg%3E") no-repeat center/contain;
|
|
383
385
|
}
|
|
384
386
|
.mc-accordion__icon {
|
|
385
387
|
flex-shrink: 0;
|
|
@@ -459,5 +461,5 @@
|
|
|
459
461
|
background-color: var(--accordion-list-color-background-ghost, rgba(255, 255, 255, 0.01));
|
|
460
462
|
}
|
|
461
463
|
.mc-accordion--ghost .mc-accordion__trigger:hover::before, .mc-accordion--ghost .mc-accordion__trigger:active::before {
|
|
462
|
-
background-color: var(--accordion-list-color-background-hover, rgba(
|
|
464
|
+
background-color: var(--accordion-list-color-background-hover, rgba(0, 0, 0, 0.05));
|
|
463
465
|
}</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _,
|
|
1
|
+
import{c as p,e as _,a as h,p as u,s as m,t as w,b as j,d as x,f as q,h as a,m as y,r as i,j as B,l as D}from"../../custom-element.js";import{s as c}from"../../slot.js";import{D as k}from"../divider/Divider.js";import"../../attributes.js";var z=q('<div><div class="mc-action-bottom-bar__divider svelte-qg1igj"><!></div> <div class="mc-action-bottom-bar__left svelte-qg1igj"><!></div> <div class="mc-action-bottom-bar__right svelte-qg1igj"><!></div></div>');const A={hash:"svelte-qg1igj",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
3
|
*/.mc-action-bottom-bar.svelte-qg1igj {position:fixed;box-sizing:border-box;bottom:0;left:0;width:100%;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;background-color:var(--action-bottom-bar-color-background, #ffffff);}.mc-action-bottom-bar__divider.svelte-qg1igj {width:100%;}
|
|
4
4
|
@media screen and (min-width: 679px) {
|
|
@@ -8,5 +8,5 @@ import{c as _,p,a as h,b as u,s as m,t as w,f as j,g as x,h as q,d as a,j as y,r
|
|
|
8
8
|
@media screen and (min-width: 679px) {.mc-action-bottom-bar__left.svelte-qg1igj {padding-left:2rem;}
|
|
9
9
|
}.mc-action-bottom-bar__right.svelte-qg1igj {margin-left:auto;padding:0.5rem 1rem 0.5rem 0;display:flex;gap:1rem;}
|
|
10
10
|
@media screen and (min-width: 679px) {.mc-action-bottom-bar__right.svelte-qg1igj {padding:1rem 2rem 1rem 0;}
|
|
11
|
-
}`};function E(n,t){
|
|
11
|
+
}`};function E(n,t){_(t,!0),h(n,A);let o=u(t,"shadow",7);var l={get shadow(){return o()},set shadow(f){o(f),y()}},e=z(),r=a(e),g=a(r);k(g,{}),i(r);var s=m(r,2),b=a(s);c(b,t,"left",{},null),i(s);var d=m(s,2),v=a(d);return c(v,t,"right",{},null),i(d),i(e),w(()=>B(e,1,D(["mc-action-bottom-bar",o()&&"mc-action-bottom-bar--shadow"]),"svelte-qg1igj")),j(n,e),x(l)}customElements.define("m-action-bottom-bar",p(E,{shadow:{attribute:"shadow",reflect:!0,type:"Boolean"}},["left","right"],[],{mode:"open"}));
|
|
12
12
|
//# sourceMappingURL=ActionBottomBar.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import{c as
|
|
1
|
+
import{c as V,e as W,a as X,p as f,B as Y,x as Z,s as g,t as A,b as w,d as $,f as k,i as a,h as s,m as p,v as ee,r as n,k as te,q as oe,j as ie,l as se}from"../../custom-element.js";import{o as ne}from"../../index-client.js";import{i as D}from"../../if.js";import{a as re,s as S}from"../../slot.js";import{a as le}from"../../attributes.js";import{b as y}from"../../this.js";import{I as ce}from"../iconbutton/IconButton.js";import{q as ae}from"../../Condition20.js";import{c as be}from"../../custom-element-forward-events.js";import"../../branches.js";import"../loader/Loader.js";var me=k('<h3 class="mc-listbox__title svelte-cf5eub"> </h3>'),ve=k("<div><!></div>"),ue=k('<div><div><div class="mc-listbox__header svelte-cf5eub"><!> <span class="mc-listbox__close svelte-cf5eub"><!></span></div> <div class="mc-listbox__body svelte-cf5eub"><ul class="mc-action-list svelte-cf5eub" role="menu"><!></ul></div></div></div> <!>',1);const de={hash:"svelte-cf5eub",code:`/**
|
|
2
2
|
* Do not edit directly, this file was auto-generated.
|
|
3
|
-
*/.mc-listbox.svelte-cf5eub {position:fixed;inset:0;display:flex;align-items:flex-end;justify-content:center;z-index:1;padding:0.5rem;background-color:var(--overlay-color-background, rgba(0, 0, 0, 0.5));inset:0;opacity:0;position:fixed;pointer-events:none;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:var(--overlay-z-index,
|
|
4
|
-
@media (width >= 680px) {.mc-listbox.svelte-cf5eub {position:relative;display:block;padding:0;background-color:transparent;}
|
|
3
|
+
*/.mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):not([popover])), .mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):popover-open) {position:fixed;inset:0;display:flex;align-items:flex-end;justify-content:center;z-index:1;padding:0.5rem;background-color:var(--overlay-color-background, rgba(0, 0, 0, 0.5));inset:0;opacity:0;position:fixed;pointer-events:none;transition:opacity 0.4s ease, visibility 0ms 0.4s;z-index:var(--overlay-z-index, 4);}.mc-listbox:has(.mc-listbox__content:where(.svelte-cf5eub):not([popover])).is-visible.svelte-cf5eub, .mc-listbox:has(.mc-listbox__content:where(.svelte-cf5eub):popover-open).is-visible.svelte-cf5eub {opacity:1;pointer-events:all;transition:opacity 0.4s ease, visibility 0ms;visibility:visible;}.mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):not([popover])), .mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):popover-open) {opacity:1;}
|
|
4
|
+
@media (width >= 680px) {.mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):not([popover])), .mc-listbox.svelte-cf5eub:has(.mc-listbox__content:where(.svelte-cf5eub):popover-open) {position:relative;display:block;padding:0;background-color:transparent;}
|
|
5
5
|
}.mc-listbox__content.svelte-cf5eub {border:var(--border-width-s, 0.0625rem) solid var(--color-border-primary, #cccccc);border-radius:var(--border-radius-m, 0.5rem);width:100%;z-index:10;background-color:var(--color-background-primary, #ffffff);pointer-events:all;}
|
|
6
6
|
@media (width >= 680px) {.mc-listbox__content.svelte-cf5eub {width:18.75rem;}
|
|
7
7
|
}.mc-listbox__header.svelte-cf5eub {display:flex;align-items:center;justify-content:center;position:relative;height:4rem;}
|
|
8
8
|
@media (width >= 680px) {.mc-listbox__header.svelte-cf5eub {display:none;}
|
|
9
|
-
}.mc-listbox__title.svelte-cf5eub {line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);font-size:var(--font-size-100, 0.875rem);color:var(--color-text-tertiary, #666666);text-align:center;margin:0;}.mc-listbox__close.svelte-cf5eub {position:absolute;right:1.25rem;width:1.5rem;height:1.5rem;}.mc-listbox__body.svelte-cf5eub {overflow:hidden;}
|
|
9
|
+
}.mc-listbox__title.svelte-cf5eub {line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);font-size:var(--font-size-100, 0.875rem);color:var(--color-text-tertiary, #666666);text-align:center;margin:0;}.mc-listbox__close.svelte-cf5eub {position:absolute;right:1.25rem;width:1.5rem;height:1.5rem;}.mc-listbox__body.svelte-cf5eub {overflow:hidden;}
|
|
10
|
+
@media (width >= 680px) {.mc-listbox--top.svelte-cf5eub .mc-listbox__content:where(.svelte-cf5eub) {margin:0 0 8px;inset:auto;position-area:span-right top;}.mc-listbox--bottom.svelte-cf5eub .mc-listbox__content:where(.svelte-cf5eub) {margin:8px 0 0;inset:auto;position-area:span-right bottom;}.mc-listbox--left.svelte-cf5eub .mc-listbox__content:where(.svelte-cf5eub) {margin:0 8px 0 0;inset:auto;position-area:span-bottom left;}.mc-listbox--right.svelte-cf5eub .mc-listbox__content:where(.svelte-cf5eub) {margin:0 0 0 8px;inset:auto;position-area:span-bottom right;}
|
|
11
|
+
}.mc-action-list.svelte-cf5eub {padding:0.5rem 0.5rem;margin:0;}.mc-action-list__element.svelte-cf5eub {height:2.5rem;cursor:pointer;border-radius:var(--border-radius-s, 0.25rem);flex-grow:1;}.mc-action-list__element.svelte-cf5eub:hover {background-color:var(--action-listbox-color-background-hover, rgba(0, 0, 0, 0.05));}.mc-action-list__element--danger.svelte-cf5eub .mc-action-list__text:where(.svelte-cf5eub) {color:var(--action-listbox-color-text-danger, #c61112);}.mc-action-list__element--danger.svelte-cf5eub .mc-action-list__icon:where(.svelte-cf5eub) {fill:var(--action-listbox-color-text-danger, #c61112);}.mc-action-list__element--danger.svelte-cf5eub:hover {background-color:var(--action-listbox-color-background-danger-hover, rgba(198, 17, 18, 0.1));}.mc-action-list__element--disabled.svelte-cf5eub .mc-action-list__text:where(.svelte-cf5eub) {color:var(--action-listbox-color-text-disabled, #b3b3b3);}.mc-action-list__element--disabled.svelte-cf5eub .mc-action-list__icon:where(.svelte-cf5eub) {fill:var(--action-listbox-color-text-disabled, #b3b3b3);}.mc-action-list__element--disabled.svelte-cf5eub:hover {background-color:transparent;}.mc-action-list__button.svelte-cf5eub {background-color:transparent;color:var(--action-listbox-color-text-default, #000000);border:none;display:flex;align-items:center;gap:0.25rem;padding:0;padding:0 0.25rem;cursor:pointer;width:100%;height:100%;}.mc-action-list__button.svelte-cf5eub:focus-visible {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-action-list__text.svelte-cf5eub {font-size:var(--font-size-150, 1rem);font-weight:var(--font-weight-regular, 400);line-height:var(--line-height-s, 1.3);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;}.mc-action-list__icon.svelte-cf5eub {width:1.25rem;height:1.25rem;}.mc-action-list__divider.svelte-cf5eub {margin:0.5rem 0;}.mc-listbox__close.svelte-cf5eub {display:flex;align-items:center;justify-content:center;}`};function fe(E,i){const z=re(i);W(i,!0),X(E,de);let r=f(i,"open",15),m=f(i,"title",7),_=f(i,"position",7,"bottom"),h=f(i,"onclose",7);const F=crypto.randomUUID();let v,c,l=ee(null);function U(){h()?.();const e=new CustomEvent("close",{bubbles:!0,composed:!0});v.dispatchEvent(e),r(!1)}function K(){const e=c?.querySelector('slot[name="item"]');return e?e.assignedElements().filter(o=>!o.hasAttribute("disabled")&&o.getAttribute("disabled")!=="true"):[]}function I(e){const t=K();if(!t.length)return;let o=0;if(!e){const d=t.findIndex(R=>R===document.activeElement);o=d===-1?0:(d+1)%t.length}t[o]?.focus()}function M(){!c||!a(l)||(r()?(c.showPopover({source:a(l)}),I(!0)):c.hidePopover({source:a(l)}))}function B(e){if(!r())return;const t=e.composedPath?e.composedPath():[];!t.includes(v)&&!t.includes(a(l))&&r(!1)}function O(e){e.preventDefault(),e.key==="Tab"&&I(),e.key==="Escape"&&(r(!1),(a(l)?.querySelector('slot[name="activator"]')).assignedElements()[0].focus())}Y(M),ne(()=>(document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}));var T={get open(){return r()},set open(e){r(e),p()},get title(){return m()},set title(e){m(e),p()},get position(){return _()},set position(e="bottom"){_(e),p()},get onclose(){return h()},set onclose(e){h(e),p()}},C=ue(),b=Z(C),u=s(b);le(u,()=>({class:"mc-listbox__content",...z.activator?{id:F,popover:"manual",role:"dialog",tabindex:0,onkeydown:O}:{}}),void 0,void 0,void 0,"svelte-cf5eub");var x=s(u),L=s(x);{var G=e=>{var t=me(),o=s(t,!0);n(t),A(()=>te(o,m())),w(e,t)};D(L,e=>{m()&&e(G)})}var P=g(L,2),H=s(P);ce(H,{ghost:!0,"aria-label":"Close",onclick:U,$$slots:{icon:(e,t)=>{ae(e,{slot:"icon"})}}}),n(P),n(x);var j=g(x,2),q=s(j),J=s(q);S(J,i,"item",{},null),n(q),n(j),n(u),y(u,e=>c=e,()=>c),n(b),y(b,e=>v=e,()=>v);var N=g(b,2);{var Q=e=>{var t=ve(),o=s(t);S(o,i,"activator",{},null),n(t),y(t,d=>oe(l,d),()=>a(l)),w(e,t)};D(N,e=>{z.activator&&e(Q)})}return A(()=>ie(b,1,se({"mc-listbox":!0,[`mc-listbox--${_()}`]:!0}),"svelte-cf5eub")),w(E,C),$(T)}customElements.define("m-action-listbox",V(fe,{open:{attribute:"open",reflect:!0,type:"Boolean"},title:{},position:{},onclose:{}},["item","activator"],[],{mode:"open"},be));
|
|
10
12
|
//# sourceMappingURL=ActionListbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListbox.js","sources":["../../../src/components/actionlistbox/ActionListbox.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-action-listbox',\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import IconButton from '../iconbutton/IconButton.svelte';\n import { Cross24 } from '@mozaic-ds/icons-svelte';\n import { customElementForwardEvents } from '../../utils';\n\n /**\n * An action list is a contextual menu that presents a list of available actions related to a specific element or interface area. It allows users to quickly access functions such as editing, sharing, deleting, or navigating to sub-actions. Action Lists are commonly triggered by buttons, icons (e.g., three-dot menus), or right-click interactions, ensuring a clean and efficient UI.\n *\n * @slot item - The content displayed in the listbox item.\n * @event close {CustomEvent<void>} - Emits when the close button is clicked.\n */\n interface Props {\n /**\n * title displayed in mobile version.\n */\n title?: string;\n /**\n * Callback to trigger on close button click.\n */\n onclose?: () => void;\n }\n\n let { title, onclose }: Props = $props();\n\n let element: HTMLElement;\n\n function handleClose() {\n onclose?.();\n\n const event = new CustomEvent('close', {\n bubbles: true,\n composed: true,\n });\n element.dispatchEvent(event);\n }\n</script>\n\n<div
|
|
1
|
+
{"version":3,"file":"ActionListbox.js","sources":["../../../src/components/actionlistbox/ActionListbox.svelte"],"sourcesContent":["<svelte:options\n customElement={{\n tag: 'm-action-listbox',\n props: {\n open: { reflect: true, type: 'Boolean', attribute: 'open' },\n },\n extend: customElementForwardEvents,\n }}\n/>\n\n<script lang=\"ts\">\n import IconButton from '../iconbutton/IconButton.svelte';\n import { Cross24 } from '@mozaic-ds/icons-svelte';\n import { customElementForwardEvents } from '../../utils';\n import { onMount } from 'svelte';\n import type { ActionListboxItem } from '../actionlistboxitem/ActionListboxItem.svelte';\n import type { Button } from '../button/Button.svelte';\n\n /**\n * An action list is a contextual menu that presents a list of available actions related to a specific element or interface area. It allows users to quickly access functions such as editing, sharing, deleting, or navigating to sub-actions. Action Lists are commonly triggered by buttons, icons (e.g., three-dot menus), or right-click interactions, ensuring a clean and efficient UI.\n *\n * @slot item - The content displayed in the listbox item.\n * @slot activator - The trigger used to toggle the listbox. It should contain one Button or IconButton.\n * @event close {CustomEvent<void>} - Emits when the close button is clicked.\n */\n interface Props {\n /**\n * If `true`, displays the listbox when using the activator slot.\n */\n open?: boolean;\n /**\n * title displayed in mobile version.\n */\n title?: string;\n /**\n * Defines the position of the listbox relative to its trigger or container.\n */\n position?: 'top' | 'bottom' | 'left' | 'right';\n /**\n * Callback to trigger on close button click.\n */\n onclose?: () => void;\n }\n\n let { open = $bindable(), title, position = 'bottom', onclose }: Props = $props();\n\n // TODO: Remove when typescript is up to date\n type PopoverOptions = {\n source: HTMLElement;\n };\n\n type Popover = {\n showPopover: (options?: PopoverOptions) => void;\n hidePopover: (options?: PopoverOptions) => void;\n };\n\n const id = crypto.randomUUID();\n\n let element: HTMLElement;\n let listbox: HTMLElement;\n let activator: HTMLElement | null = $state(null);\n\n function handleClose() {\n onclose?.();\n\n const event = new CustomEvent('close', {\n bubbles: true,\n composed: true,\n });\n element.dispatchEvent(event);\n\n open = false;\n }\n\n function getFocusableElements(): HTMLElement[] {\n const slot = listbox?.querySelector('slot[name=\"item\"]') as HTMLSlotElement;\n if (!slot) return [];\n\n const assignedElements = slot.assignedElements() as HTMLElement[];\n return assignedElements.filter((el) => {\n return !el.hasAttribute('disabled') && el.getAttribute('disabled') !== 'true';\n });\n }\n\n function focusListItem(first?: boolean) {\n const items = getFocusableElements();\n if (!items.length) return;\n\n let focusedIndex = 0;\n\n if (!first) {\n const currentIndex = items.findIndex((item) => item === document.activeElement);\n\n focusedIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;\n }\n\n (items[focusedIndex] as ActionListboxItem)?.focus();\n }\n\n function toggleListbox() {\n if (!listbox || !activator) return;\n\n if (open) {\n (listbox as Popover).showPopover({ source: activator });\n focusListItem(true);\n } else {\n (listbox as Popover).hidePopover({ source: activator });\n }\n }\n\n function handleClickOutside(event: MouseEvent) {\n if (!open) return;\n\n const path = event.composedPath ? event.composedPath() : [];\n if (!path.includes(element) && !path.includes(activator!)) {\n open = false;\n }\n }\n\n function onKeydown(event: KeyboardEvent) {\n event.preventDefault();\n if (event.key === 'Tab') {\n focusListItem();\n }\n\n if (event.key === 'Escape') {\n open = false;\n const slot = activator?.querySelector('slot[name=\"activator\"]') as HTMLSlotElement;\n const activatorBtn = slot.assignedElements()[0];\n (activatorBtn as Element & Button).focus();\n }\n }\n\n $effect(toggleListbox);\n\n onMount(() => {\n document.addEventListener('mousedown', handleClickOutside);\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside);\n };\n });\n</script>\n\n<div\n bind:this={element}\n class={{\n 'mc-listbox': true,\n [`mc-listbox--${position}`]: true,\n }}\n>\n <div\n bind:this={listbox}\n class=\"mc-listbox__content\"\n {...$$slots.activator\n ? { id, popover: 'manual', role: 'dialog', tabindex: 0, onkeydown: onKeydown }\n : {}}\n >\n <div class=\"mc-listbox__header\">\n {#if title}\n <h3 class=\"mc-listbox__title\">{title}</h3>\n {/if}\n\n <span class=\"mc-listbox__close\">\n <IconButton ghost aria-label=\"Close\" onclick={handleClose}>\n <Cross24 slot=\"icon\" />\n </IconButton>\n </span>\n </div>\n <div class=\"mc-listbox__body\">\n <ul class=\"mc-action-list\" role=\"menu\">\n <slot name=\"item\" />\n </ul>\n </div>\n </div>\n</div>\n\n{#if $$slots.activator}\n <div bind:this={activator}>\n <slot name=\"activator\" />\n </div>\n{/if}\n\n<style lang=\"scss\">\n @use '@mozaic-ds/styles/components/listbox';\n @use '@mozaic-ds/styles/components/action-list';\n\n .mc-listbox__close {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n</style>\n"],"names":["open","$.prop","$$props","title","position","onclose","id","element","listbox","activator","$.state","handleClose","event","getFocusableElements","slot","el","focusListItem","first","items","focusedIndex","currentIndex","item","toggleListbox","handleClickOutside","path","$.get","onKeydown","$.user_effect","onMount","div","$.first_child","fragment","div_1","$.child","$$slots","div_2","h3","root_1","$$render","consequent","span","$.sibling","node","IconButton","node_1","Cross24","$$anchor","div_3","ul","$.reset","$$value","node_3","div_4","root_3","$.set","consequent_1","$.template_effect","$.set_class","$.clsx","customElementForwardEvents"],"mappings":";;;;;;;;;;qnEAUA,mCAkCQA,EAAIC,EAAAC,EAAA,OAAA,EAAA,EAAgBC,EAAKF,EAAAC,EAAA,QAAA,CAAA,EAAEE,mBAAW,QAAQ,EAAEC,EAAOJ,EAAAC,EAAA,UAAA,CAAA,QAYvDI,EAAK,OAAO,WAAU,MAExBC,EACAC,EACAC,EAAgCC,GAAO,IAAI,EAEtC,SAAAC,GAAc,CACrBN,MAAO,QAEDO,EAAK,IAAO,YAAY,QAAO,CACnC,QAAS,GACT,SAAU,GAAI,EAEhBL,EAAQ,cAAcK,CAAK,EAE3BZ,EAAO,EAAK,CACd,CAES,SAAAa,GAAsC,CACvC,MAAAC,EAAON,GAAS,cAAc,mBAAmB,SAClDM,EAEoBA,EAAK,iBAAgB,EACtB,OAAQC,IACtBA,EAAG,aAAa,UAAU,GAAKA,EAAG,aAAa,UAAU,IAAM,MACxE,EALQ,CAAA,CAMX,UAESC,EAAcC,EAAiB,CAChC,MAAAC,EAAQL,EAAoB,EAC7B,GAAA,CAAAK,EAAM,OAAM,OAEb,IAAAC,EAAe,EAEd,GAAA,CAAAF,EAAO,OACJG,EAAeF,EAAM,UAAWG,GAASA,IAAS,SAAS,aAAa,EAE9EF,EAAeC,IAAY,GAAU,GAAKA,EAAe,GAAKF,EAAM,MACtE,CAECA,EAAMC,CAAY,GAAyB,MAAK,CACnD,CAES,SAAAG,GAAgB,CAClB,CAAAd,MAAYC,CAAS,IAEtBT,EAAI,GACLQ,EAAoB,YAAW,CAAG,SAAQC,CAAS,CAAA,CAAA,EACpDO,EAAc,EAAI,GAEjBR,EAAoB,YAAW,CAAG,SAAQC,CAAS,CAAA,CAAA,EAExD,UAESc,EAAmBX,EAAmB,KACxCZ,EAAI,EAAA,OAEH,MAAAwB,EAAOZ,EAAM,aAAeA,EAAM,aAAY,EAAA,CAAA,GAC/CY,EAAK,SAASjB,CAAO,GAAA,CAAMiB,EAAK,SAAQC,EAAChB,CAAS,CAAA,GACrDT,EAAO,EAAK,CAEhB,UAES0B,EAAUd,EAAsB,CACvCA,EAAM,eAAc,EAChBA,EAAM,MAAQ,OAChBI,EAAa,EAGXJ,EAAM,MAAQ,WAChBZ,EAAO,EAAK,GACFyB,EAAGhB,CAAS,GAAE,cAAc,wBAAwB,GACpC,iBAAgB,EAAG,CAAC,EACX,MAAK,EAE5C,CAEAkB,EAAQL,CAAa,EAErBM,GAAO,KACL,SAAS,iBAAiB,YAAaL,CAAkB,EAE5C,IAAA,CACX,SAAS,oBAAoB,YAAaA,CAAkB,CAC9D,EACD,+IAjG2C,SAAQ,sEAoGrDM,EAAAC,EAAAC,CAAA,EAOEC,EAAAC,EAPFJ,CAAA,KAOEG,oCAGK,GAAAE,EAAQ,WACN,GAAA5B,EAAI,QAAS,SAAU,KAAM,SAAU,SAAU,EAAG,UAAWoB,8CAGpE,IAAAS,EAAGF,EAPLD,CAAA,MAOEG,CAAG,iBAECC,EAAEC,GAAA,MAAFD,EAAE,EAAA,IAAFA,CAAE,aAA4BjC,EAAK,CAAA,CAAA,MAAnCiC,CAAE,WADAjC,EAAK,GAAAmC,EAAAC,CAAA,QAITC,EAAIC,EAAAC,EAAA,CAAA,MAAJF,CAAI,EACFG,GAAUC,EAAA,uCAAmCjC,wBAC3CkC,GAAOC,EAAA,CAAA,KAAA,MAAA,CAAA,QAFXN,CAAI,IALNL,CAAG,EAWH,IAAAY,IAXAZ,EAAG,CAAA,EAYDa,IADFD,CAAG,MACDC,CAAE,0BAAFA,CAAE,IADJD,CAAG,EAlBLE,EAAAjB,CAAA,IAAAA,EAAAkB,GACY1C,QAAAA,CAAO,EARrByC,EAAApB,CAAA,IAAAA,EAAAqB,GACY3C,QAAAA,CAAO,EADnB,IAAA4C,EAAAV,EAAAZ,EAAA,CAAA,iBAkCEuB,EAAGC,GAAA,MAAHD,CAAG,+BAAHA,CAAG,IAAHA,EAAGF,GAAAI,GAAY7C,EAASyC,CAAA,EAAA,IAAAzB,EAAThB,CAAS,CAAA,MAAxB2C,CAAG,WADDlB,EAAQ,WAASI,EAAAiB,CAAA,IAjCrBC,OAAAA,EAAA,IAAAC,GAAA5B,EAAA,EAAA6B,GAAA,CAGG,aAAc,GAAI,CAAA,eACFtD,OAAa,EAAI,CAAA,EAAA,eAAA,CAAA,aAN7B,yKAxIIuD"}
|
|
@@ -1,20 +1,77 @@
|
|
|
1
|
-
import { render, fireEvent } from '@testing-library/svelte';
|
|
2
|
-
import { describe, it, expect, vi } from 'vitest';
|
|
1
|
+
import { render, fireEvent, screen } from '@testing-library/svelte';
|
|
2
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
3
3
|
import ActionListbox from './ActionListbox.svelte';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
HTMLElement.prototype.showPopover = vi.fn();
|
|
6
|
+
HTMLElement.prototype.hidePopover = vi.fn();
|
|
7
|
+
Object.defineProperty(global, 'crypto', {
|
|
8
|
+
value: {
|
|
9
|
+
randomUUID: () => '123-test-id',
|
|
10
|
+
},
|
|
8
11
|
});
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
});
|
|
13
|
+
describe('ActionListbox Component', () => {
|
|
14
|
+
it('should render the title when provided', () => {
|
|
15
|
+
const title = 'Menu Options';
|
|
16
|
+
render(ActionListbox, { title });
|
|
17
|
+
expect(screen.getByText(title)).toBeTruthy();
|
|
18
|
+
expect(screen.getByRole('heading', { level: 3 }).classList.contains('mc-listbox__title')).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
it('should not render the title if not provided', () => {
|
|
21
|
+
const { container } = render(ActionListbox);
|
|
22
|
+
const titleElement = container.querySelector('.mc-listbox__title');
|
|
23
|
+
expect(titleElement).toBeNull();
|
|
24
|
+
});
|
|
25
|
+
describe('Positioning Classes', () => {
|
|
26
|
+
it('should apply the default position class (bottom)', () => {
|
|
27
|
+
const { container } = render(ActionListbox);
|
|
28
|
+
const mainDiv = container.querySelector('.mc-listbox');
|
|
29
|
+
expect(mainDiv?.classList.contains('mc-listbox--bottom')).toBeTruthy();
|
|
30
|
+
});
|
|
31
|
+
it('should apply correct classes based on position prop', () => {
|
|
32
|
+
const { container } = render(ActionListbox, { position: 'left' });
|
|
33
|
+
const mainDiv = container.querySelector('.mc-listbox');
|
|
34
|
+
expect(mainDiv?.classList.contains('mc-listbox--left')).toBeTruthy();
|
|
35
|
+
});
|
|
36
|
+
it('should handle single position value', () => {
|
|
37
|
+
const { container } = render(ActionListbox, { position: 'top' });
|
|
38
|
+
const mainDiv = container.querySelector('.mc-listbox');
|
|
39
|
+
expect(mainDiv?.classList.contains('mc-listbox--top')).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('Events and Callbacks', () => {
|
|
43
|
+
it('should call onclose prop and dispatch close event when clicking the close button', async () => {
|
|
44
|
+
const onclose = vi.fn();
|
|
45
|
+
const { container } = render(ActionListbox, { onclose });
|
|
46
|
+
const closeEventSpy = vi.fn();
|
|
47
|
+
const element = container.querySelector('.mc-listbox');
|
|
48
|
+
element?.addEventListener('close', closeEventSpy);
|
|
49
|
+
const closeButton = screen.getByLabelText('Close');
|
|
50
|
+
await fireEvent.click(closeButton);
|
|
51
|
+
expect(onclose).toHaveBeenCalledTimes(1);
|
|
52
|
+
expect(closeEventSpy).toHaveBeenCalled();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('Open state logic', () => {
|
|
56
|
+
it('should set the popover attributes correctly', () => {
|
|
57
|
+
const { container } = render(ActionListbox);
|
|
58
|
+
const popoverContent = container.querySelector('.mc-listbox__content');
|
|
59
|
+
expect(popoverContent?.hasAttribute('popover')).toBe(false);
|
|
60
|
+
});
|
|
61
|
+
it('should reflect the open state if possible', async () => {
|
|
62
|
+
const { component } = render(ActionListbox, { open: true });
|
|
63
|
+
expect(component.open).toBe(true);
|
|
64
|
+
});
|
|
65
|
+
it('should close when clicking outside the component', async () => {
|
|
66
|
+
const { component } = render(ActionListbox, { open: true });
|
|
67
|
+
await fireEvent.mouseDown(document.body);
|
|
68
|
+
expect(component.open).toBe(false);
|
|
69
|
+
});
|
|
70
|
+
it('should NOT close when clicking inside the component', async () => {
|
|
71
|
+
const { component, container } = render(ActionListbox, { open: true });
|
|
72
|
+
const innerDiv = container.querySelector('.mc-listbox__content');
|
|
73
|
+
await fireEvent.mouseDown(innerDiv);
|
|
74
|
+
expect(component.open).toBe(true);
|
|
75
|
+
});
|
|
19
76
|
});
|
|
20
77
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import '../button/Button.svelte';
|
|
2
3
|
import './ActionListbox.svelte';
|
|
3
4
|
import '../actionlistboxitem/ActionListboxItem.svelte';
|
|
4
5
|
import '@mozaic-ds/icons-svelte/components/Copy20/Copy20.svelte';
|
|
@@ -9,4 +10,5 @@ declare const meta: Meta;
|
|
|
9
10
|
export default meta;
|
|
10
11
|
type Story = StoryObj;
|
|
11
12
|
export declare const Default: Story;
|
|
13
|
+
export declare const Activator: Story;
|
|
12
14
|
//# sourceMappingURL=ActionListbox.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/actionlistbox/ActionListbox.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,wBAAwB,CAAC;AAChC,OAAO,+CAA+C,CAAC;AACvD,OAAO,yDAAyD,CAAC;AACjE,OAAO,2EAA2E,CAAC;AACnF,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AAEnE,QAAA,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionListbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/actionlistbox/ActionListbox.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,+CAA+C,CAAC;AACvD,OAAO,yDAAyD,CAAC;AACjE,OAAO,2EAA2E,CAAC;AACnF,OAAO,iEAAiE,CAAC;AACzE,OAAO,2DAA2D,CAAC;AAEnE,QAAA,MAAM,IAAI,EAAE,IAsDX,CAAC;AACF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAqDvB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { action } from 'storybook/actions';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import '../button/Button.svelte';
|
|
4
5
|
import './ActionListbox.svelte';
|
|
5
6
|
import '../actionlistboxitem/ActionListboxItem.svelte';
|
|
6
7
|
import '@mozaic-ds/icons-svelte/components/Copy20/Copy20.svelte';
|
|
@@ -10,12 +11,29 @@ import '@mozaic-ds/icons-svelte/components/Trash20/Trash20.svelte';
|
|
|
10
11
|
const meta = {
|
|
11
12
|
title: 'Overlay/ Action Listbox',
|
|
12
13
|
component: 'm-action-listbox',
|
|
13
|
-
subcomponents: { '
|
|
14
|
+
subcomponents: { 'm-action-listbox-item': 'm-action-listbox-item' },
|
|
15
|
+
argTypes: {
|
|
16
|
+
position: {
|
|
17
|
+
control: 'radio',
|
|
18
|
+
options: ['top', 'bottom', 'left', 'right'],
|
|
19
|
+
table: {
|
|
20
|
+
defaultValue: {
|
|
21
|
+
summary: 'bottom',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
14
26
|
args: {
|
|
15
27
|
title: 'Listbox title (optional)',
|
|
28
|
+
position: 'bottom',
|
|
16
29
|
},
|
|
17
30
|
render: (args) => html `
|
|
18
|
-
<m-action-listbox
|
|
31
|
+
<m-action-listbox
|
|
32
|
+
title="${ifDefined(args.title)}"
|
|
33
|
+
position="${ifDefined(args.position)}"
|
|
34
|
+
?open="${args.open}"
|
|
35
|
+
@close="${action('close')}"
|
|
36
|
+
>
|
|
19
37
|
<m-action-listbox-item
|
|
20
38
|
slot="item"
|
|
21
39
|
label="Duplicate"
|
|
@@ -47,3 +65,56 @@ const meta = {
|
|
|
47
65
|
};
|
|
48
66
|
export default meta;
|
|
49
67
|
export const Default = {};
|
|
68
|
+
export const Activator = {
|
|
69
|
+
parameters: {
|
|
70
|
+
layout: 'centered',
|
|
71
|
+
},
|
|
72
|
+
args: {
|
|
73
|
+
open: false,
|
|
74
|
+
},
|
|
75
|
+
render: (args) => html `
|
|
76
|
+
<m-action-listbox
|
|
77
|
+
title="${ifDefined(args.title)}"
|
|
78
|
+
position="${ifDefined(args.position)}"
|
|
79
|
+
?open="${args.open}"
|
|
80
|
+
@close="${action('close')}"
|
|
81
|
+
>
|
|
82
|
+
<m-action-listbox-item
|
|
83
|
+
slot="item"
|
|
84
|
+
label="Duplicate"
|
|
85
|
+
disabled="true"
|
|
86
|
+
@click="${action('click')}"
|
|
87
|
+
>
|
|
88
|
+
<copy-20 slot="icon"></copy-20>
|
|
89
|
+
</m-action-listbox-item>
|
|
90
|
+
|
|
91
|
+
<m-action-listbox-item slot="item" label="Move to..." @click="${action('click')}">
|
|
92
|
+
<arrow-top-right-20 slot="icon"></arrow-top-right-20>
|
|
93
|
+
</m-action-listbox-item>
|
|
94
|
+
|
|
95
|
+
<m-action-listbox-item slot="item" label="Download" @click="${action('click')}">
|
|
96
|
+
<download-20 slot="icon"></download-20>
|
|
97
|
+
</m-action-listbox-item>
|
|
98
|
+
|
|
99
|
+
<m-action-listbox-item
|
|
100
|
+
slot="item"
|
|
101
|
+
label="Delete"
|
|
102
|
+
appearance="danger"
|
|
103
|
+
divider="true"
|
|
104
|
+
@click="${action('click')}"
|
|
105
|
+
>
|
|
106
|
+
<trash-20 slot="icon"></trash-20>
|
|
107
|
+
</m-action-listbox-item>
|
|
108
|
+
|
|
109
|
+
<m-button
|
|
110
|
+
slot="activator"
|
|
111
|
+
@click="${() => {
|
|
112
|
+
const listbox = document.querySelector('m-action-listbox');
|
|
113
|
+
listbox.open = !listbox.open;
|
|
114
|
+
}}"
|
|
115
|
+
>
|
|
116
|
+
Activator
|
|
117
|
+
</m-button>
|
|
118
|
+
</m-action-listbox>
|
|
119
|
+
`,
|
|
120
|
+
};
|