@govtechsg/sgds-web-component 3.0.0-rc.6 → 3.0.1
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/Masthead/index.js +2 -2
- package/README.md +2 -2
- package/base/button.js +1 -1
- package/base/card-element.d.ts +0 -3
- package/base/card-element.js +0 -3
- package/base/card-element.js.map +1 -1
- package/base/card.js +1 -1
- package/base/sgds-element2.js +1 -1
- package/components/Accordion/accordion-item.js +1 -1
- package/components/Accordion/accordion.js +1 -1
- package/components/Accordion/index.umd.js +137 -145
- package/components/Accordion/index.umd.js.map +1 -1
- package/components/Accordion/sgds-accordion-item.js +1 -5
- package/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/components/Accordion/sgds-accordion.js +1 -6
- package/components/Accordion/sgds-accordion.js.map +1 -1
- package/components/Alert/alert.js +1 -1
- package/components/Alert/index.umd.js +3 -3
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.js +3 -3
- package/components/Breadcrumb/breadcrumb-item.js +1 -1
- package/components/Breadcrumb/index.umd.js +19 -7
- package/components/Breadcrumb/index.umd.js.map +1 -1
- package/components/Button/button.js +1 -1
- package/components/Button/index.umd.js +3 -3
- package/components/Card/card.js +1 -1
- package/components/Card/index.umd.js +6 -9
- package/components/Card/index.umd.js.map +1 -1
- package/components/Card/sgds-card.d.ts +3 -3
- package/components/Card/sgds-card.js +3 -3
- package/components/Card/sgds-card.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.js +3 -3
- package/components/ComboBox/combo-box-item2.js +1 -1
- package/components/ComboBox/combo-box.js +1 -1
- package/components/ComboBox/index.umd.js +14 -9
- package/components/ComboBox/index.umd.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +6 -1
- package/components/ComboBox/sgds-combo-box.js +6 -1
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker-calendar2.js +1 -1
- package/components/Datepicker/datepicker.js +1 -1
- package/components/Datepicker/index.umd.js +9 -9
- package/components/DescriptionList/description-list-group.js +1 -1
- package/components/DescriptionList/description-list.js +1 -1
- package/components/DescriptionList/index.umd.js +18 -20
- package/components/DescriptionList/index.umd.js.map +1 -1
- package/components/DescriptionList/sgds-description-list-group.d.ts +1 -1
- package/components/DescriptionList/sgds-description-list-group.js +11 -11
- package/components/DescriptionList/sgds-description-list-group.js.map +1 -1
- package/components/DescriptionList/sgds-description-list.js +4 -6
- package/components/DescriptionList/sgds-description-list.js.map +1 -1
- package/components/Divider/divider.js +1 -1
- package/components/Divider/index.umd.js +2 -2
- package/components/Drawer/drawer.js +1 -1
- package/components/Drawer/index.umd.js +31 -136
- package/components/Drawer/index.umd.js.map +1 -1
- package/components/Drawer/sgds-drawer.d.ts +3 -32
- package/components/Drawer/sgds-drawer.js +16 -73
- package/components/Drawer/sgds-drawer.js.map +1 -1
- package/components/Dropdown/dropdown-item.js +1 -1
- package/components/Dropdown/dropdown-menu.js +1 -1
- package/components/Dropdown/index.umd.js +3 -3
- package/components/Dropdown/index.umd.js.map +1 -1
- package/components/Dropdown/sgds-dropdown-item.d.ts +2 -1
- package/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/components/FileUpload/file-upload.js +1 -1
- package/components/FileUpload/index.umd.js +8 -8
- package/components/FileUpload/index.umd.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.js +2 -2
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Footer/footer-item.js +1 -1
- package/components/Footer/footer.js +1 -1
- package/components/Footer/index.umd.js +3 -3
- package/components/Icon/index.umd.js +1 -1
- package/components/IconButton/index.umd.js +2 -2
- package/components/IconList/index.umd.js +1 -1
- package/components/Input/index.umd.js +4 -4
- package/components/Input/input.js +1 -1
- package/components/Link/index.umd.js +15 -3
- package/components/Link/index.umd.js.map +1 -1
- package/components/Link/link.js +1 -1
- package/components/Link/sgds-link.d.ts +2 -1
- package/components/Link/sgds-link.js +13 -1
- package/components/Link/sgds-link.js.map +1 -1
- package/components/Mainnav/index.umd.js +74 -93
- package/components/Mainnav/index.umd.js.map +1 -1
- package/components/Mainnav/mainnav-dropdown.js +1 -1
- package/components/Mainnav/mainnav-item.js +1 -1
- package/components/Mainnav/mainnav.js +1 -1
- package/components/Mainnav/sgds-mainnav-dropdown.d.ts +1 -4
- package/components/Mainnav/sgds-mainnav-dropdown.js +24 -37
- package/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/components/Mainnav/sgds-mainnav-item.d.ts +9 -2
- package/components/Mainnav/sgds-mainnav-item.js +58 -3
- package/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.js +7 -6
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/Masthead/index.umd.js +2 -2
- package/components/Masthead/masthead.js +1 -1
- package/components/Modal/index.umd.js +3 -3
- package/components/Modal/modal.js +1 -1
- package/components/Pagination/index.umd.js +4 -4
- package/components/Pagination/pagination.js +1 -1
- package/components/ProgressBar/index.umd.js +3 -3
- package/components/ProgressBar/index.umd.js.map +1 -1
- package/components/ProgressBar/progress-bar.js +1 -1
- package/components/ProgressBar/sgds-progress-bar.d.ts +1 -1
- package/components/ProgressBar/sgds-progress-bar.js +1 -1
- package/components/ProgressBar/sgds-progress-bar.js.map +1 -1
- package/components/QuantityToggle/index.umd.js +5 -10
- package/components/QuantityToggle/index.umd.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +0 -2
- package/components/QuantityToggle/sgds-quantity-toggle.js +0 -5
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.js +3 -3
- package/components/Radio/radio.js +1 -1
- package/components/Sidenav/index.umd.js +40 -44
- package/components/Sidenav/index.umd.js.map +1 -1
- package/components/Sidenav/sgds-sidenav-item.d.ts +14 -16
- package/components/Sidenav/sgds-sidenav-item.js +39 -43
- package/components/Sidenav/sgds-sidenav-item.js.map +1 -1
- package/components/Sidenav/sidenav-item.js +1 -1
- package/components/Sidenav/sidenav-link.js +1 -1
- package/components/Skeleton/index.umd.js +2 -2
- package/components/Skeleton/skeleton.js +1 -1
- package/components/Spinner/index.umd.js +2 -2
- package/components/Spinner/spinner.js +1 -1
- package/components/Stepper/index.umd.js +2 -2
- package/components/Stepper/stepper.js +1 -1
- package/components/Switch/index.umd.js +2 -2
- package/components/Switch/switch.js +1 -1
- package/components/Tab/index.umd.js +2 -2
- package/components/Tab/tab.js +1 -1
- package/components/Table/index.umd.js +63 -205
- package/components/Table/index.umd.js.map +1 -1
- package/components/Table/sgds-table.d.ts +12 -55
- package/components/Table/sgds-table.js +59 -201
- package/components/Table/sgds-table.js.map +1 -1
- package/components/Table/table.js +1 -1
- package/components/TableOfContents/index.d.ts +6 -0
- package/components/TableOfContents/index.js +4 -0
- package/components/TableOfContents/index.js.map +1 -0
- package/components/TableOfContents/index.umd.js +3995 -0
- package/components/TableOfContents/index.umd.js.map +1 -0
- package/components/TableOfContents/sgds-table-of-contents.d.ts +13 -0
- package/components/TableOfContents/sgds-table-of-contents.js +25 -0
- package/components/TableOfContents/sgds-table-of-contents.js.map +1 -0
- package/components/TableOfContents/table-of-contents.js +6 -0
- package/components/TableOfContents/table-of-contents.js.map +1 -0
- package/components/Textarea/index.umd.js +3 -3
- package/components/Textarea/textarea.js +1 -1
- package/components/Toast/index.umd.js +3 -3
- package/components/Toast/toast.js +1 -1
- package/components/Tooltip/index.umd.js +2 -2
- package/components/Tooltip/tooltip.js +1 -1
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/index.umd.js +2694 -3016
- package/components/index.umd.js.map +1 -1
- package/css/grid.css +110 -0
- package/css/reboot.css +7 -7
- package/css/sgds.css +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.umd.js +2949 -3271
- package/index.umd.js.map +1 -1
- package/internals/CloseButton/close-button.js +1 -1
- package/internals/OverflowMenu/overflow-menu.js +1 -1
- package/package.json +1 -1
- package/react/base/button.cjs.js +1 -1
- package/react/base/button.js +1 -1
- package/react/base/card-element.cjs.js +0 -3
- package/react/base/card-element.cjs.js.map +1 -1
- package/react/base/card-element.js +0 -3
- package/react/base/card-element.js.map +1 -1
- package/react/base/card.cjs.js +1 -1
- package/react/base/card.js +1 -1
- package/react/base/sgds-element.cjs2.js +1 -1
- package/react/base/sgds-element2.js +1 -1
- package/react/components/Accordion/accordion-item.cjs.js +1 -1
- package/react/components/Accordion/accordion-item.js +1 -1
- package/react/components/Accordion/accordion.cjs.js +1 -1
- package/react/components/Accordion/accordion.js +1 -1
- package/react/components/Accordion/sgds-accordion-item.cjs.js +1 -5
- package/react/components/Accordion/sgds-accordion-item.cjs.js.map +1 -1
- package/react/components/Accordion/sgds-accordion-item.js +1 -5
- package/react/components/Accordion/sgds-accordion-item.js.map +1 -1
- package/react/components/Accordion/sgds-accordion.cjs.js +1 -6
- package/react/components/Accordion/sgds-accordion.cjs.js.map +1 -1
- package/react/components/Accordion/sgds-accordion.js +1 -6
- package/react/components/Accordion/sgds-accordion.js.map +1 -1
- package/react/components/Alert/alert.cjs.js +1 -1
- package/react/components/Alert/alert.js +1 -1
- package/react/components/Badge/badge.cjs.js +1 -1
- package/react/components/Badge/badge.js +1 -1
- package/react/components/Breadcrumb/breadcrumb-item.cjs.js +1 -1
- package/react/components/Breadcrumb/breadcrumb-item.js +1 -1
- package/react/components/Button/button.cjs.js +1 -1
- package/react/components/Button/button.js +1 -1
- package/react/components/Card/card.cjs.js +1 -1
- package/react/components/Card/card.js +1 -1
- package/react/components/Card/sgds-card.cjs.js +3 -3
- package/react/components/Card/sgds-card.cjs.js.map +1 -1
- package/react/components/Card/sgds-card.js +3 -3
- package/react/components/Card/sgds-card.js.map +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/ComboBox/combo-box-item.cjs2.js +1 -1
- package/react/components/ComboBox/combo-box-item2.js +1 -1
- package/react/components/ComboBox/combo-box.cjs.js +1 -1
- package/react/components/ComboBox/combo-box.js +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +6 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +6 -1
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Datepicker/datepicker-calendar.cjs2.js +1 -1
- package/react/components/Datepicker/datepicker-calendar2.js +1 -1
- package/react/components/Datepicker/datepicker.cjs.js +1 -1
- package/react/components/Datepicker/datepicker.js +1 -1
- package/react/components/DescriptionList/description-list-group.cjs.js +1 -1
- package/react/components/DescriptionList/description-list-group.js +1 -1
- package/react/components/DescriptionList/description-list.cjs.js +1 -1
- package/react/components/DescriptionList/description-list.js +1 -1
- package/react/components/DescriptionList/sgds-description-list-group.cjs.js +11 -11
- package/react/components/DescriptionList/sgds-description-list-group.cjs.js.map +1 -1
- package/react/components/DescriptionList/sgds-description-list-group.js +11 -11
- package/react/components/DescriptionList/sgds-description-list-group.js.map +1 -1
- package/react/components/DescriptionList/sgds-description-list.cjs.js +4 -6
- package/react/components/DescriptionList/sgds-description-list.cjs.js.map +1 -1
- package/react/components/DescriptionList/sgds-description-list.js +4 -6
- package/react/components/DescriptionList/sgds-description-list.js.map +1 -1
- package/react/components/Divider/divider.cjs.js +1 -1
- package/react/components/Divider/divider.js +1 -1
- package/react/components/Drawer/drawer.cjs.js +1 -1
- package/react/components/Drawer/drawer.js +1 -1
- package/react/components/Drawer/sgds-drawer.cjs.js +15 -72
- package/react/components/Drawer/sgds-drawer.cjs.js.map +1 -1
- package/react/components/Drawer/sgds-drawer.js +16 -73
- package/react/components/Drawer/sgds-drawer.js.map +1 -1
- package/react/components/Dropdown/dropdown-item.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-item.js +1 -1
- package/react/components/Dropdown/dropdown-menu.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-menu.js +1 -1
- package/react/components/Dropdown/sgds-dropdown-item.cjs.js.map +1 -1
- package/react/components/Dropdown/sgds-dropdown-item.js.map +1 -1
- package/react/components/FileUpload/file-upload.cjs.js +1 -1
- package/react/components/FileUpload/file-upload.js +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +2 -2
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +2 -2
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Footer/footer-item.cjs.js +1 -1
- package/react/components/Footer/footer-item.js +1 -1
- package/react/components/Footer/footer.cjs.js +1 -1
- package/react/components/Footer/footer.js +1 -1
- package/react/components/Input/input.cjs.js +1 -1
- package/react/components/Input/input.js +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Link/sgds-link.cjs.js +13 -1
- package/react/components/Link/sgds-link.cjs.js.map +1 -1
- package/react/components/Link/sgds-link.js +13 -1
- package/react/components/Link/sgds-link.js.map +1 -1
- package/react/components/Mainnav/mainnav-dropdown.cjs.js +1 -1
- package/react/components/Mainnav/mainnav-dropdown.js +1 -1
- package/react/components/Mainnav/mainnav-item.cjs.js +1 -1
- package/react/components/Mainnav/mainnav-item.js +1 -1
- package/react/components/Mainnav/mainnav.cjs.js +1 -1
- package/react/components/Mainnav/mainnav.js +1 -1
- package/react/components/Mainnav/sgds-mainnav-dropdown.cjs.js +23 -36
- package/react/components/Mainnav/sgds-mainnav-dropdown.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-dropdown.js +24 -37
- package/react/components/Mainnav/sgds-mainnav-dropdown.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-item.cjs.js +58 -3
- package/react/components/Mainnav/sgds-mainnav-item.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav-item.js +58 -3
- package/react/components/Mainnav/sgds-mainnav-item.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js +7 -6
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.js +7 -6
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/Modal/modal.cjs.js +1 -1
- package/react/components/Modal/modal.js +1 -1
- package/react/components/Pagination/pagination.cjs.js +1 -1
- package/react/components/Pagination/pagination.js +1 -1
- package/react/components/ProgressBar/progress-bar.cjs.js +1 -1
- package/react/components/ProgressBar/progress-bar.js +1 -1
- package/react/components/ProgressBar/sgds-progress-bar.cjs.js +1 -1
- package/react/components/ProgressBar/sgds-progress-bar.cjs.js.map +1 -1
- package/react/components/ProgressBar/sgds-progress-bar.js +1 -1
- package/react/components/ProgressBar/sgds-progress-bar.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +0 -5
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +0 -5
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Radio/radio.cjs.js +1 -1
- package/react/components/Radio/radio.js +1 -1
- package/react/components/Sidenav/sgds-sidenav-item.cjs.js +37 -41
- package/react/components/Sidenav/sgds-sidenav-item.cjs.js.map +1 -1
- package/react/components/Sidenav/sgds-sidenav-item.js +39 -43
- package/react/components/Sidenav/sgds-sidenav-item.js.map +1 -1
- package/react/components/Sidenav/sidenav-item.cjs.js +1 -1
- package/react/components/Sidenav/sidenav-item.js +1 -1
- package/react/components/Sidenav/sidenav-link.cjs.js +1 -1
- package/react/components/Sidenav/sidenav-link.js +1 -1
- package/react/components/Skeleton/skeleton.cjs.js +1 -1
- package/react/components/Skeleton/skeleton.js +1 -1
- package/react/components/Spinner/spinner.cjs.js +1 -1
- package/react/components/Spinner/spinner.js +1 -1
- package/react/components/Stepper/stepper.cjs.js +1 -1
- package/react/components/Stepper/stepper.js +1 -1
- package/react/components/Switch/switch.cjs.js +1 -1
- package/react/components/Switch/switch.js +1 -1
- package/react/components/Tab/tab.cjs.js +1 -1
- package/react/components/Tab/tab.js +1 -1
- package/react/components/Table/sgds-table.cjs.js +59 -201
- package/react/components/Table/sgds-table.cjs.js.map +1 -1
- package/react/components/Table/sgds-table.js +59 -201
- package/react/components/Table/sgds-table.js.map +1 -1
- package/react/components/Table/table.cjs.js +1 -1
- package/react/components/Table/table.js +1 -1
- package/react/components/TableOfContents/sgds-table-of-contents.cjs.js +31 -0
- package/react/components/TableOfContents/sgds-table-of-contents.cjs.js.map +1 -0
- package/react/components/TableOfContents/sgds-table-of-contents.js +26 -0
- package/react/components/TableOfContents/sgds-table-of-contents.js.map +1 -0
- package/react/components/TableOfContents/table-of-contents.cjs.js +11 -0
- package/react/components/TableOfContents/table-of-contents.cjs.js.map +1 -0
- package/react/components/TableOfContents/table-of-contents.js +7 -0
- package/react/components/TableOfContents/table-of-contents.js.map +1 -0
- package/react/components/Textarea/textarea.cjs.js +1 -1
- package/react/components/Textarea/textarea.js +1 -1
- package/react/components/Toast/toast.cjs.js +1 -1
- package/react/components/Toast/toast.js +1 -1
- package/react/components/Tooltip/tooltip.cjs.js +1 -1
- package/react/components/Tooltip/tooltip.js +1 -1
- package/react/index.cjs.js +94 -94
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/react/internals/CloseButton/close-button.cjs.js +1 -1
- package/react/internals/CloseButton/close-button.js +1 -1
- package/react/internals/OverflowMenu/overflow-menu.cjs.js +1 -1
- package/react/internals/OverflowMenu/overflow-menu.js +1 -1
- package/react/styles/feedback.cjs.js +1 -1
- package/react/styles/feedback.js +1 -1
- package/react/{action-card → table-of-contents}/index.cjs.js +5 -7
- package/react/table-of-contents/index.cjs.js.map +1 -0
- package/react/{action-card → table-of-contents}/index.js +5 -7
- package/react/table-of-contents/index.js.map +1 -0
- package/styles/feedback.js +1 -1
- package/themes/day.css +112 -104
- package/themes/night.css +117 -109
- package/themes/root.css +92 -85
- package/base/link-element.js +0 -55
- package/base/link-element.js.map +0 -1
- package/components/ActionCard/action-card.js +0 -6
- package/components/ActionCard/action-card.js.map +0 -1
- package/components/ActionCard/index.d.ts +0 -6
- package/components/ActionCard/index.js +0 -5
- package/components/ActionCard/index.js.map +0 -1
- package/components/ActionCard/index.umd.js +0 -5860
- package/components/ActionCard/index.umd.js.map +0 -1
- package/components/ActionCard/sgds-action-card.d.ts +0 -54
- package/components/ActionCard/sgds-action-card.js +0 -148
- package/components/ActionCard/sgds-action-card.js.map +0 -1
- package/react/action-card/index.cjs.js.map +0 -1
- package/react/action-card/index.js.map +0 -1
- package/react/base/link-element.cjs.js +0 -60
- package/react/base/link-element.cjs.js.map +0 -1
- package/react/base/link-element.js +0 -56
- package/react/base/link-element.js.map +0 -1
- package/react/components/ActionCard/action-card.cjs.js +0 -11
- package/react/components/ActionCard/action-card.cjs.js.map +0 -1
- package/react/components/ActionCard/action-card.js +0 -7
- package/react/components/ActionCard/action-card.js.map +0 -1
- package/react/components/ActionCard/sgds-action-card.cjs.js +0 -154
- package/react/components/ActionCard/sgds-action-card.cjs.js.map +0 -1
- package/react/components/ActionCard/sgds-action-card.js +0 -149
- package/react/components/ActionCard/sgds-action-card.js.map +0 -1
- /package/react/{action-card → table-of-contents}/index.d.ts +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Ref } from "lit/directives/ref.js";
|
|
2
|
-
import { CardElement } from "../../base/card-element";
|
|
3
|
-
import { SgdsCheckbox } from "../Checkbox/sgds-checkbox";
|
|
4
|
-
import { SgdsRadio } from "../Radio/sgds-radio";
|
|
5
|
-
/**
|
|
6
|
-
* @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.
|
|
7
|
-
* @slot icon - Icon content in the card-subtitile
|
|
8
|
-
* @slot card-subtitle - The subtitle of the card
|
|
9
|
-
* @slot card-title - The title of the card
|
|
10
|
-
* @slot card-text - The paragrapher text of the card
|
|
11
|
-
*
|
|
12
|
-
* @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed
|
|
13
|
-
*
|
|
14
|
-
* @csspart base - The action card base wrapper
|
|
15
|
-
* @csspart body - The action card body
|
|
16
|
-
* @csspart subtitle - The action card subtitle
|
|
17
|
-
* @csspart title - The action card title
|
|
18
|
-
* @csspart text - The action card text
|
|
19
|
-
*/
|
|
20
|
-
export declare class SgdsActionCard extends CardElement {
|
|
21
|
-
static styles: import("lit").CSSResult[];
|
|
22
|
-
static dependencies: {
|
|
23
|
-
"sgds-checkbox": typeof SgdsCheckbox;
|
|
24
|
-
"sgds-radio": typeof SgdsRadio;
|
|
25
|
-
};
|
|
26
|
-
/** @internal */
|
|
27
|
-
inputRef: Ref<SgdsCheckbox | SgdsRadio>;
|
|
28
|
-
/** Name of the HTML form control. Submitted with the form as part of a name/value pair. */
|
|
29
|
-
name: string;
|
|
30
|
-
/** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */
|
|
31
|
-
value: string;
|
|
32
|
-
/** Disables the input (so the user can't check / uncheck it). */
|
|
33
|
-
disabled: boolean;
|
|
34
|
-
/** Draws the input in a checked state. */
|
|
35
|
-
checked: boolean;
|
|
36
|
-
/** The type of input of the action card */
|
|
37
|
-
type: TypeVariant;
|
|
38
|
-
/** Controls the active styling of the action card */
|
|
39
|
-
active: boolean;
|
|
40
|
-
/** Simulates a click on the input control*/
|
|
41
|
-
click(): void;
|
|
42
|
-
/** @internal Declare the click event listener*/
|
|
43
|
-
handleInputChange(): Promise<void>;
|
|
44
|
-
/** @internal The input's id. */
|
|
45
|
-
private inputId;
|
|
46
|
-
/** @internal */
|
|
47
|
-
handleRadioCheckedChange(): Promise<void>;
|
|
48
|
-
/** @internal */
|
|
49
|
-
handleDisabledChange(): Promise<void>;
|
|
50
|
-
private _handleKeyDown;
|
|
51
|
-
render(): import("lit-html").TemplateResult;
|
|
52
|
-
}
|
|
53
|
-
export type TypeVariant = "checkbox" | "radio";
|
|
54
|
-
export default SgdsActionCard;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { __decorate } from 'tslib';
|
|
2
|
-
import { property } from 'lit/decorators.js';
|
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
-
import { live } from 'lit/directives/live.js';
|
|
5
|
-
import { createRef, ref } from 'lit/directives/ref.js';
|
|
6
|
-
import { html } from 'lit/static-html.js';
|
|
7
|
-
import { CardElement } from '../../base/card-element.js';
|
|
8
|
-
import genId from '../../utils/generateId.js';
|
|
9
|
-
import { watch } from '../../utils/watch.js';
|
|
10
|
-
import { SgdsCheckbox } from '../Checkbox/sgds-checkbox.js';
|
|
11
|
-
import { SgdsRadio } from '../Radio/sgds-radio.js';
|
|
12
|
-
import css_248z from './action-card.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.
|
|
16
|
-
* @slot icon - Icon content in the card-subtitile
|
|
17
|
-
* @slot card-subtitle - The subtitle of the card
|
|
18
|
-
* @slot card-title - The title of the card
|
|
19
|
-
* @slot card-text - The paragrapher text of the card
|
|
20
|
-
*
|
|
21
|
-
* @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed
|
|
22
|
-
*
|
|
23
|
-
* @csspart base - The action card base wrapper
|
|
24
|
-
* @csspart body - The action card body
|
|
25
|
-
* @csspart subtitle - The action card subtitle
|
|
26
|
-
* @csspart title - The action card title
|
|
27
|
-
* @csspart text - The action card text
|
|
28
|
-
*/
|
|
29
|
-
class SgdsActionCard extends CardElement {
|
|
30
|
-
constructor() {
|
|
31
|
-
super(...arguments);
|
|
32
|
-
/** @internal */
|
|
33
|
-
this.inputRef = createRef();
|
|
34
|
-
/** Disables the input (so the user can't check / uncheck it). */
|
|
35
|
-
this.disabled = false;
|
|
36
|
-
/** Draws the input in a checked state. */
|
|
37
|
-
this.checked = false;
|
|
38
|
-
/** The type of input of the action card */
|
|
39
|
-
this.type = "checkbox";
|
|
40
|
-
/** Controls the active styling of the action card */
|
|
41
|
-
this.active = false;
|
|
42
|
-
/** @internal The input's id. */
|
|
43
|
-
this.inputId = genId("action-card", "input");
|
|
44
|
-
}
|
|
45
|
-
/** Simulates a click on the input control*/
|
|
46
|
-
click() {
|
|
47
|
-
this.inputRef.value.click();
|
|
48
|
-
}
|
|
49
|
-
/** @internal Declare the click event listener*/
|
|
50
|
-
async handleInputChange() {
|
|
51
|
-
this.inputRef.value.click();
|
|
52
|
-
this.emit("sgds-change");
|
|
53
|
-
}
|
|
54
|
-
/** @internal */
|
|
55
|
-
async handleRadioCheckedChange() {
|
|
56
|
-
this.active = this.checked;
|
|
57
|
-
}
|
|
58
|
-
/** @internal */
|
|
59
|
-
async handleDisabledChange() {
|
|
60
|
-
this.active = !this.disabled;
|
|
61
|
-
}
|
|
62
|
-
_handleKeyDown(event) {
|
|
63
|
-
const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
64
|
-
if (event.key === "Enter" && !hasModifier) {
|
|
65
|
-
this.handleInputChange();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
render() {
|
|
69
|
-
const checkbox = html `<sgds-checkbox
|
|
70
|
-
${ref(this.inputRef)}
|
|
71
|
-
?disabled=${this.disabled}
|
|
72
|
-
id=${this.inputId}
|
|
73
|
-
@click=${this.handleInputChange}
|
|
74
|
-
@keydown=${this._handleKeyDown}
|
|
75
|
-
.value=${live(this.value)}
|
|
76
|
-
?checked=${live(this.checked)}
|
|
77
|
-
@sgds-change=${(e) => (this.checked = e.detail.checked)}
|
|
78
|
-
></sgds-checkbox>`;
|
|
79
|
-
const radio = html `<sgds-radio
|
|
80
|
-
${ref(this.inputRef)}
|
|
81
|
-
?disabled=${this.disabled}
|
|
82
|
-
id=${this.inputId}
|
|
83
|
-
@click=${this.handleInputChange}
|
|
84
|
-
@keydown=${this._handleKeyDown}
|
|
85
|
-
.value=${live(this.value)}
|
|
86
|
-
?checked=${live(this.checked)}
|
|
87
|
-
></sgds-radio>`;
|
|
88
|
-
return html `
|
|
89
|
-
<div
|
|
90
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
91
|
-
@click=${this.handleInputChange}
|
|
92
|
-
@keydown=${this._handleKeyDown}
|
|
93
|
-
variant="card-action"
|
|
94
|
-
class="sgds card
|
|
95
|
-
${classMap({
|
|
96
|
-
[`text-${this.textColor}`]: this.textColor,
|
|
97
|
-
["is-active"]: this.active
|
|
98
|
-
})}
|
|
99
|
-
"
|
|
100
|
-
part="base"
|
|
101
|
-
>
|
|
102
|
-
<div class="card-body" part="body">
|
|
103
|
-
<h6 class="card-subtitle" part="subtitle">
|
|
104
|
-
<div>
|
|
105
|
-
<slot name="icon"></slot>
|
|
106
|
-
<slot name="card-subtitle"></slot>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="card-input">${this.type === "checkbox" ? checkbox : radio}</div>
|
|
109
|
-
</h6>
|
|
110
|
-
<h5 class="card-title" part="title"><slot name="card-title"></slot></h5>
|
|
111
|
-
<p class="card-text" part="text"><slot name="card-text"></slot></p>
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
SgdsActionCard.styles = [...CardElement.styles, css_248z];
|
|
118
|
-
SgdsActionCard.dependencies = {
|
|
119
|
-
"sgds-checkbox": SgdsCheckbox,
|
|
120
|
-
"sgds-radio": SgdsRadio
|
|
121
|
-
};
|
|
122
|
-
__decorate([
|
|
123
|
-
property({ reflect: true })
|
|
124
|
-
], SgdsActionCard.prototype, "name", void 0);
|
|
125
|
-
__decorate([
|
|
126
|
-
property({ type: String })
|
|
127
|
-
], SgdsActionCard.prototype, "value", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
property({ type: Boolean, reflect: true })
|
|
130
|
-
], SgdsActionCard.prototype, "disabled", void 0);
|
|
131
|
-
__decorate([
|
|
132
|
-
property({ type: Boolean, reflect: true })
|
|
133
|
-
], SgdsActionCard.prototype, "checked", void 0);
|
|
134
|
-
__decorate([
|
|
135
|
-
property({ type: String, reflect: true })
|
|
136
|
-
], SgdsActionCard.prototype, "type", void 0);
|
|
137
|
-
__decorate([
|
|
138
|
-
property({ reflect: true, type: Boolean })
|
|
139
|
-
], SgdsActionCard.prototype, "active", void 0);
|
|
140
|
-
__decorate([
|
|
141
|
-
watch("checked")
|
|
142
|
-
], SgdsActionCard.prototype, "handleRadioCheckedChange", null);
|
|
143
|
-
__decorate([
|
|
144
|
-
watch("disabled")
|
|
145
|
-
], SgdsActionCard.prototype, "handleDisabledChange", null);
|
|
146
|
-
|
|
147
|
-
export { SgdsActionCard, SgdsActionCard as default };
|
|
148
|
-
//# sourceMappingURL=sgds-action-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-action-card.js","sources":["../../../src/components/ActionCard/sgds-action-card.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { Ref, createRef, ref } from \"lit/directives/ref.js\";\nimport { html } from \"lit/static-html.js\";\nimport { CardElement } from \"../../base/card-element\";\nimport genId from \"../../utils/generateId\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsCheckbox } from \"../Checkbox/sgds-checkbox\";\nimport { SgdsRadio } from \"../Radio/sgds-radio\";\nimport actionCardStyles from \"./action-card.css\";\n\n/**\n * @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.\n * @slot icon - Icon content in the card-subtitile\n * @slot card-subtitle - The subtitle of the card\n * @slot card-title - The title of the card\n * @slot card-text - The paragrapher text of the card\n *\n * @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed\n *\n * @csspart base - The action card base wrapper\n * @csspart body - The action card body\n * @csspart subtitle - The action card subtitle\n * @csspart title - The action card title\n * @csspart text - The action card text\n */\nexport class SgdsActionCard extends CardElement {\n static styles = [...CardElement.styles, actionCardStyles];\n static dependencies = {\n \"sgds-checkbox\": SgdsCheckbox,\n \"sgds-radio\": SgdsRadio\n };\n /** @internal */\n inputRef: Ref<SgdsCheckbox | SgdsRadio> = createRef();\n /** Name of the HTML form control. Submitted with the form as part of a name/value pair. */\n @property({ reflect: true }) name: string;\n /** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */\n @property({ type: String }) value: string;\n /** Disables the input (so the user can't check / uncheck it). */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /** Draws the input in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** The type of input of the action card */\n @property({ type: String, reflect: true }) type: TypeVariant = \"checkbox\";\n\n /** Controls the active styling of the action card */\n @property({ reflect: true, type: Boolean })\n active = false;\n\n /** Simulates a click on the input control*/\n public click() {\n this.inputRef.value.click();\n }\n /** @internal Declare the click event listener*/\n async handleInputChange() {\n this.inputRef.value.click();\n this.emit(\"sgds-change\");\n }\n /** @internal The input's id. */\n private inputId: string = genId(\"action-card\", \"input\");\n\n /** @internal */\n @watch(\"checked\")\n async handleRadioCheckedChange() {\n this.active = this.checked;\n }\n /** @internal */\n @watch(\"disabled\")\n async handleDisabledChange() {\n this.active = !this.disabled;\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === \"Enter\" && !hasModifier) {\n this.handleInputChange();\n }\n }\n\n render() {\n const checkbox = html`<sgds-checkbox\n ${ref(this.inputRef)}\n ?disabled=${this.disabled}\n id=${this.inputId}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n .value=${live(this.value)}\n ?checked=${live(this.checked)}\n @sgds-change=${(e: CustomEvent) => (this.checked = e.detail.checked)}\n ></sgds-checkbox>`;\n\n const radio = html`<sgds-radio\n ${ref(this.inputRef)}\n ?disabled=${this.disabled}\n id=${this.inputId}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n .value=${live(this.value)}\n ?checked=${live(this.checked)}\n ></sgds-radio>`;\n\n return html`\n <div\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n variant=\"card-action\"\n class=\"sgds card\n ${classMap({\n [`text-${this.textColor}`]: this.textColor,\n [\"is-active\"]: this.active\n })}\n \"\n part=\"base\"\n >\n <div class=\"card-body\" part=\"body\">\n <h6 class=\"card-subtitle\" part=\"subtitle\">\n <div>\n <slot name=\"icon\"></slot>\n <slot name=\"card-subtitle\"></slot>\n </div>\n <div class=\"card-input\">${this.type === \"checkbox\" ? checkbox : radio}</div>\n </h6>\n <h5 class=\"card-title\" part=\"title\"><slot name=\"card-title\"></slot></h5>\n <p class=\"card-text\" part=\"text\"><slot name=\"card-text\"></slot></p>\n </div>\n </div>\n `;\n }\n}\n\nexport type TypeVariant = \"checkbox\" | \"radio\";\n\nexport default SgdsActionCard;\n"],"names":["actionCardStyles"],"mappings":";;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;AAcG;AACG,MAAO,cAAe,SAAQ,WAAW,CAAA;AAA/C,IAAA,WAAA,GAAA;;;QAOE,IAAQ,CAAA,QAAA,GAAkC,SAAS,EAAE,CAAC;;QAMV,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAEjB,IAAO,CAAA,OAAA,GAAG,KAAK,CAAC;;QAGjB,IAAI,CAAA,IAAA,GAAgB,UAAU,CAAC;;QAI1E,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;AAYP,QAAA,IAAA,CAAA,OAAO,GAAW,KAAK,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;KAsEzD;;IA/EQ,KAAK,GAAA;AACV,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;KAC7B;;AAED,IAAA,MAAM,iBAAiB,GAAA;AACrB,QAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;AAC5B,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,C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AAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAkB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,UAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAEjB,UAAA,CAAA;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAiB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGjB,UAAA,CAAA;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAAgC,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAI1E,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAgBT,UAAA,CAAA;IADL,KAAK,CAAC,SAAS,CAAC;AAGhB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,0BAAA,EAAA,IAAA,CAAA,CAAA;AAGK,UAAA,CAAA;IADL,KAAK,CAAC,UAAU,CAAC;AAGjB,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../src/react/action-card/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport Component from \"../../components/ActionCard/sgds-action-card\";\nimport { register } from \"../../utils/ce-registry\";\n\nregister(\"sgds-action-card\", Component);\n\nexport default createComponent({\n react: React,\n tagName: \"sgds-action-card\",\n elementClass: Component,\n events: {\n onSgdsChange: \"sgds-change\"\n }\n});\n"],"names":["register","Component","createComponent","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,mBAAQ,CAAC,kBAAkB,EAAEC,6BAAS,CAAC,CAAC;AAExC,YAAeC,qBAAe,CAAC;AAC7B,IAAA,KAAK,EAAEC,gBAAK;AACZ,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,YAAY,EAAEF,6BAAS;AACvB,IAAA,MAAM,EAAE;AACN,QAAA,YAAY,EAAE,aAAa;AAC5B,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/react/action-card/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport { createComponent } from \"@lit/react\";\nimport Component from \"../../components/ActionCard/sgds-action-card\";\nimport { register } from \"../../utils/ce-registry\";\n\nregister(\"sgds-action-card\", Component);\n\nexport default createComponent({\n react: React,\n tagName: \"sgds-action-card\",\n elementClass: Component,\n events: {\n onSgdsChange: \"sgds-change\"\n }\n});\n"],"names":["Component"],"mappings":";;;;;;AAKA,QAAQ,CAAC,kBAAkB,EAAEA,cAAS,CAAC,CAAC;AAExC,YAAe,eAAe,CAAC;AAC7B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,YAAY,EAAEA,cAAS;AACvB,IAAA,MAAM,EAAE;AACN,QAAA,YAAY,EAAE,aAAa;AAC5B,KAAA;AACF,CAAA,CAAC;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var tslib = require('tslib');
|
|
7
|
-
var lit = require('lit');
|
|
8
|
-
var sgdsElement = require('./sgds-element.cjs.js');
|
|
9
|
-
var decorators_js = require('lit/decorators.js');
|
|
10
|
-
var classMap_js = require('lit/directives/class-map.js');
|
|
11
|
-
var ifDefined_js = require('lit/directives/if-defined.js');
|
|
12
|
-
var watch = require('../utils/watch.cjs.js');
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
16
|
-
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
17
|
-
*/
|
|
18
|
-
class LinkElement extends sgdsElement["default"] {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
/** when true, sets the active stylings of .nav-link */
|
|
22
|
-
this.active = false;
|
|
23
|
-
/** Disables the SgdsMainnavItem */
|
|
24
|
-
this.disabled = false;
|
|
25
|
-
}
|
|
26
|
-
_handleDisabled() {
|
|
27
|
-
this.setAttribute("aria-disabled", `${this.disabled}`);
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
return lit.html `
|
|
31
|
-
<a
|
|
32
|
-
href=${this.disabled ? "javascript:void(0)" : ifDefined_js.ifDefined(this.href)}
|
|
33
|
-
class="nav-link ${classMap_js.classMap({
|
|
34
|
-
disabled: this.disabled,
|
|
35
|
-
active: this.active
|
|
36
|
-
})} "
|
|
37
|
-
?disabled=${this.disabled}
|
|
38
|
-
aria-disabled=${this.disabled ? "true" : "false"}
|
|
39
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
40
|
-
>
|
|
41
|
-
<slot></slot>
|
|
42
|
-
</a>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
tslib.__decorate([
|
|
47
|
-
decorators_js.property({ type: Boolean })
|
|
48
|
-
], LinkElement.prototype, "active", void 0);
|
|
49
|
-
tslib.__decorate([
|
|
50
|
-
decorators_js.property({ type: String })
|
|
51
|
-
], LinkElement.prototype, "href", void 0);
|
|
52
|
-
tslib.__decorate([
|
|
53
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
54
|
-
], LinkElement.prototype, "disabled", void 0);
|
|
55
|
-
tslib.__decorate([
|
|
56
|
-
watch.watch("disabled")
|
|
57
|
-
], LinkElement.prototype, "_handleDisabled", null);
|
|
58
|
-
|
|
59
|
-
exports["default"] = LinkElement;
|
|
60
|
-
//# sourceMappingURL=link-element.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-element.cjs.js","sources":["../../../src/base/link-element.ts"],"sourcesContent":["import { html } from \"lit\";\nimport SgdsElement from \"./sgds-element\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { watch } from \"../utils/watch\";\n\n/**\n * @slot default - Default slot for SgdsMainnavItem anchor element\n * @slot default - Default slot for SgdsMainnavItem anchor element\n */\n\nexport default class LinkElement extends SgdsElement {\n /** when true, sets the active stylings of .nav-link */\n @property({ type: Boolean })\n active = false;\n\n /** Href attribute for anchor element in SgdsMainnavItem */\n @property({ type: String })\n href: string;\n /** Disables the SgdsMainnavItem */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @watch(\"disabled\")\n _handleDisabled() {\n this.setAttribute(\"aria-disabled\", `${this.disabled}`);\n }\n\n render() {\n return html`\n <a\n href=${this.disabled ? \"javascript:void(0)\" : ifDefined(this.href)}\n class=\"nav-link ${classMap({\n disabled: this.disabled,\n active: this.active\n })} \"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n >\n <slot></slot>\n </a>\n `;\n }\n}\n"],"names":["SgdsElement","html","ifDefined","classMap","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;AAOA;;;AAGG;AAEkB,MAAA,WAAY,SAAQA,sBAAW,CAAA;AAApD,IAAA,WAAA,GAAA;;;QAGE,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAOf,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;KAuBlB;IApBC,eAAe,GAAA;QACb,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAG,EAAA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3
|
-
import { html } from 'lit';
|
|
4
|
-
import SgdsElement from './sgds-element.js';
|
|
5
|
-
import { property } from 'lit/decorators.js';
|
|
6
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
7
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
|
-
import { watch } from '../utils/watch.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
12
|
-
* @slot default - Default slot for SgdsMainnavItem anchor element
|
|
13
|
-
*/
|
|
14
|
-
class LinkElement extends SgdsElement {
|
|
15
|
-
constructor() {
|
|
16
|
-
super(...arguments);
|
|
17
|
-
/** when true, sets the active stylings of .nav-link */
|
|
18
|
-
this.active = false;
|
|
19
|
-
/** Disables the SgdsMainnavItem */
|
|
20
|
-
this.disabled = false;
|
|
21
|
-
}
|
|
22
|
-
_handleDisabled() {
|
|
23
|
-
this.setAttribute("aria-disabled", `${this.disabled}`);
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
return html `
|
|
27
|
-
<a
|
|
28
|
-
href=${this.disabled ? "javascript:void(0)" : ifDefined(this.href)}
|
|
29
|
-
class="nav-link ${classMap({
|
|
30
|
-
disabled: this.disabled,
|
|
31
|
-
active: this.active
|
|
32
|
-
})} "
|
|
33
|
-
?disabled=${this.disabled}
|
|
34
|
-
aria-disabled=${this.disabled ? "true" : "false"}
|
|
35
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
36
|
-
>
|
|
37
|
-
<slot></slot>
|
|
38
|
-
</a>
|
|
39
|
-
`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
__decorate([
|
|
43
|
-
property({ type: Boolean })
|
|
44
|
-
], LinkElement.prototype, "active", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
property({ type: String })
|
|
47
|
-
], LinkElement.prototype, "href", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
property({ type: Boolean, reflect: true })
|
|
50
|
-
], LinkElement.prototype, "disabled", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
watch("disabled")
|
|
53
|
-
], LinkElement.prototype, "_handleDisabled", null);
|
|
54
|
-
|
|
55
|
-
export { LinkElement as default };
|
|
56
|
-
//# sourceMappingURL=link-element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-element.js","sources":["../../../src/base/link-element.ts"],"sourcesContent":["import { html } from \"lit\";\nimport SgdsElement from \"./sgds-element\";\nimport { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { watch } from \"../utils/watch\";\n\n/**\n * @slot default - Default slot for SgdsMainnavItem anchor element\n * @slot default - Default slot for SgdsMainnavItem anchor element\n */\n\nexport default class LinkElement extends SgdsElement {\n /** when true, sets the active stylings of .nav-link */\n @property({ type: Boolean })\n active = false;\n\n /** Href attribute for anchor element in SgdsMainnavItem */\n @property({ type: String })\n href: string;\n /** Disables the SgdsMainnavItem */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @watch(\"disabled\")\n _handleDisabled() {\n this.setAttribute(\"aria-disabled\", `${this.disabled}`);\n }\n\n render() {\n return html`\n <a\n href=${this.disabled ? \"javascript:void(0)\" : ifDefined(this.href)}\n class=\"nav-link ${classMap({\n disabled: this.disabled,\n active: this.active\n })} \"\n ?disabled=${this.disabled}\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n >\n <slot></slot>\n </a>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAOA;;;AAGG;AAEkB,MAAA,WAAY,SAAQ,WAAW,CAAA;AAApD,IAAA,WAAA,GAAA;;;QAGE,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;;QAOf,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;KAuBlB;IApBC,eAAe,GAAA;QACb,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,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ineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var lit = require('lit');
|
|
7
|
-
|
|
8
|
-
var css_248z = lit.css`.sgds.card[variant*=card-action]{transition-duration:.3s;transition-property:box-shadow,border-color;transition-timing-function:ease-in-out}.card-body{display:flex;flex-direction:column;gap:var(--sgds-spacer-3)}slot[name=icon]::slotted(*){margin-right:1rem}.sgds.card[variant*=card-action].is-active,.sgds.card[variant*=card-action]:hover{border-color:transparent;box-shadow:var(--sgds-box-shadow),inset 0 0 0 2.1px var(--sgds-link)}.sgds.card[variant*=card-action] .card-subtitle{align-items:center;display:flex;justify-content:space-between}.sgds.card[variant*=card-action] .card-title{color:var(--sgds-body-color);margin-bottom:0}`;
|
|
9
|
-
|
|
10
|
-
exports["default"] = css_248z;
|
|
11
|
-
//# sourceMappingURL=action-card.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-card.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { css } from 'lit';
|
|
3
|
-
|
|
4
|
-
var css_248z = css`.sgds.card[variant*=card-action]{transition-duration:.3s;transition-property:box-shadow,border-color;transition-timing-function:ease-in-out}.card-body{display:flex;flex-direction:column;gap:var(--sgds-spacer-3)}slot[name=icon]::slotted(*){margin-right:1rem}.sgds.card[variant*=card-action].is-active,.sgds.card[variant*=card-action]:hover{border-color:transparent;box-shadow:var(--sgds-box-shadow),inset 0 0 0 2.1px var(--sgds-link)}.sgds.card[variant*=card-action] .card-subtitle{align-items:center;display:flex;justify-content:space-between}.sgds.card[variant*=card-action] .card-title{color:var(--sgds-body-color);margin-bottom:0}`;
|
|
5
|
-
|
|
6
|
-
export { css_248z as default };
|
|
7
|
-
//# sourceMappingURL=action-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-card.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var tslib = require('tslib');
|
|
7
|
-
var decorators_js = require('lit/decorators.js');
|
|
8
|
-
var classMap_js = require('lit/directives/class-map.js');
|
|
9
|
-
var live_js = require('lit/directives/live.js');
|
|
10
|
-
var ref_js = require('lit/directives/ref.js');
|
|
11
|
-
var staticHtml_js = require('lit/static-html.js');
|
|
12
|
-
var cardElement = require('../../base/card-element.cjs.js');
|
|
13
|
-
var generateId = require('../../utils/generateId.cjs.js');
|
|
14
|
-
var watch = require('../../utils/watch.cjs.js');
|
|
15
|
-
var sgdsCheckbox = require('../Checkbox/sgds-checkbox.cjs.js');
|
|
16
|
-
var sgdsRadio = require('../Radio/sgds-radio.cjs.js');
|
|
17
|
-
var actionCard = require('./action-card.cjs.js');
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.
|
|
21
|
-
* @slot icon - Icon content in the card-subtitile
|
|
22
|
-
* @slot card-subtitle - The subtitle of the card
|
|
23
|
-
* @slot card-title - The title of the card
|
|
24
|
-
* @slot card-text - The paragrapher text of the card
|
|
25
|
-
*
|
|
26
|
-
* @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed
|
|
27
|
-
*
|
|
28
|
-
* @csspart base - The action card base wrapper
|
|
29
|
-
* @csspart body - The action card body
|
|
30
|
-
* @csspart subtitle - The action card subtitle
|
|
31
|
-
* @csspart title - The action card title
|
|
32
|
-
* @csspart text - The action card text
|
|
33
|
-
*/
|
|
34
|
-
class SgdsActionCard extends cardElement.CardElement {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
/** @internal */
|
|
38
|
-
this.inputRef = ref_js.createRef();
|
|
39
|
-
/** Disables the input (so the user can't check / uncheck it). */
|
|
40
|
-
this.disabled = false;
|
|
41
|
-
/** Draws the input in a checked state. */
|
|
42
|
-
this.checked = false;
|
|
43
|
-
/** The type of input of the action card */
|
|
44
|
-
this.type = "checkbox";
|
|
45
|
-
/** Controls the active styling of the action card */
|
|
46
|
-
this.active = false;
|
|
47
|
-
/** @internal The input's id. */
|
|
48
|
-
this.inputId = generateId["default"]("action-card", "input");
|
|
49
|
-
}
|
|
50
|
-
/** Simulates a click on the input control*/
|
|
51
|
-
click() {
|
|
52
|
-
this.inputRef.value.click();
|
|
53
|
-
}
|
|
54
|
-
/** @internal Declare the click event listener*/
|
|
55
|
-
async handleInputChange() {
|
|
56
|
-
this.inputRef.value.click();
|
|
57
|
-
this.emit("sgds-change");
|
|
58
|
-
}
|
|
59
|
-
/** @internal */
|
|
60
|
-
async handleRadioCheckedChange() {
|
|
61
|
-
this.active = this.checked;
|
|
62
|
-
}
|
|
63
|
-
/** @internal */
|
|
64
|
-
async handleDisabledChange() {
|
|
65
|
-
this.active = !this.disabled;
|
|
66
|
-
}
|
|
67
|
-
_handleKeyDown(event) {
|
|
68
|
-
const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
69
|
-
if (event.key === "Enter" && !hasModifier) {
|
|
70
|
-
this.handleInputChange();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
render() {
|
|
74
|
-
const checkbox = staticHtml_js.html `<sgds-checkbox
|
|
75
|
-
${ref_js.ref(this.inputRef)}
|
|
76
|
-
?disabled=${this.disabled}
|
|
77
|
-
id=${this.inputId}
|
|
78
|
-
@click=${this.handleInputChange}
|
|
79
|
-
@keydown=${this._handleKeyDown}
|
|
80
|
-
.value=${live_js.live(this.value)}
|
|
81
|
-
?checked=${live_js.live(this.checked)}
|
|
82
|
-
@sgds-change=${(e) => (this.checked = e.detail.checked)}
|
|
83
|
-
></sgds-checkbox>`;
|
|
84
|
-
const radio = staticHtml_js.html `<sgds-radio
|
|
85
|
-
${ref_js.ref(this.inputRef)}
|
|
86
|
-
?disabled=${this.disabled}
|
|
87
|
-
id=${this.inputId}
|
|
88
|
-
@click=${this.handleInputChange}
|
|
89
|
-
@keydown=${this._handleKeyDown}
|
|
90
|
-
.value=${live_js.live(this.value)}
|
|
91
|
-
?checked=${live_js.live(this.checked)}
|
|
92
|
-
></sgds-radio>`;
|
|
93
|
-
return staticHtml_js.html `
|
|
94
|
-
<div
|
|
95
|
-
tabindex=${this.disabled ? "-1" : "0"}
|
|
96
|
-
@click=${this.handleInputChange}
|
|
97
|
-
@keydown=${this._handleKeyDown}
|
|
98
|
-
variant="card-action"
|
|
99
|
-
class="sgds card
|
|
100
|
-
${classMap_js.classMap({
|
|
101
|
-
[`text-${this.textColor}`]: this.textColor,
|
|
102
|
-
["is-active"]: this.active
|
|
103
|
-
})}
|
|
104
|
-
"
|
|
105
|
-
part="base"
|
|
106
|
-
>
|
|
107
|
-
<div class="card-body" part="body">
|
|
108
|
-
<h6 class="card-subtitle" part="subtitle">
|
|
109
|
-
<div>
|
|
110
|
-
<slot name="icon"></slot>
|
|
111
|
-
<slot name="card-subtitle"></slot>
|
|
112
|
-
</div>
|
|
113
|
-
<div class="card-input">${this.type === "checkbox" ? checkbox : radio}</div>
|
|
114
|
-
</h6>
|
|
115
|
-
<h5 class="card-title" part="title"><slot name="card-title"></slot></h5>
|
|
116
|
-
<p class="card-text" part="text"><slot name="card-text"></slot></p>
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
SgdsActionCard.styles = [...cardElement.CardElement.styles, actionCard["default"]];
|
|
123
|
-
SgdsActionCard.dependencies = {
|
|
124
|
-
"sgds-checkbox": sgdsCheckbox.SgdsCheckbox,
|
|
125
|
-
"sgds-radio": sgdsRadio.SgdsRadio
|
|
126
|
-
};
|
|
127
|
-
tslib.__decorate([
|
|
128
|
-
decorators_js.property({ reflect: true })
|
|
129
|
-
], SgdsActionCard.prototype, "name", void 0);
|
|
130
|
-
tslib.__decorate([
|
|
131
|
-
decorators_js.property({ type: String })
|
|
132
|
-
], SgdsActionCard.prototype, "value", void 0);
|
|
133
|
-
tslib.__decorate([
|
|
134
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
135
|
-
], SgdsActionCard.prototype, "disabled", void 0);
|
|
136
|
-
tslib.__decorate([
|
|
137
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
138
|
-
], SgdsActionCard.prototype, "checked", void 0);
|
|
139
|
-
tslib.__decorate([
|
|
140
|
-
decorators_js.property({ type: String, reflect: true })
|
|
141
|
-
], SgdsActionCard.prototype, "type", void 0);
|
|
142
|
-
tslib.__decorate([
|
|
143
|
-
decorators_js.property({ reflect: true, type: Boolean })
|
|
144
|
-
], SgdsActionCard.prototype, "active", void 0);
|
|
145
|
-
tslib.__decorate([
|
|
146
|
-
watch.watch("checked")
|
|
147
|
-
], SgdsActionCard.prototype, "handleRadioCheckedChange", null);
|
|
148
|
-
tslib.__decorate([
|
|
149
|
-
watch.watch("disabled")
|
|
150
|
-
], SgdsActionCard.prototype, "handleDisabledChange", null);
|
|
151
|
-
|
|
152
|
-
exports.SgdsActionCard = SgdsActionCard;
|
|
153
|
-
exports["default"] = SgdsActionCard;
|
|
154
|
-
//# sourceMappingURL=sgds-action-card.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-action-card.cjs.js","sources":["../../../../src/components/ActionCard/sgds-action-card.ts"],"sourcesContent":["import { property } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { Ref, createRef, ref } from \"lit/directives/ref.js\";\nimport { html } from \"lit/static-html.js\";\nimport { CardElement } from \"../../base/card-element\";\nimport genId from \"../../utils/generateId\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsCheckbox } from \"../Checkbox/sgds-checkbox\";\nimport { SgdsRadio } from \"../Radio/sgds-radio\";\nimport actionCardStyles from \"./action-card.css\";\n\n/**\n * @summary Action Card are cards with built in checkbox or radio components. The ref of input is extended to the Card's body.\n * @slot icon - Icon content in the card-subtitile\n * @slot card-subtitle - The subtitle of the card\n * @slot card-title - The title of the card\n * @slot card-text - The paragrapher text of the card\n *\n * @event sgds-change - Emitted when the checked state of card's checkbox changes or when the selected card's radio has changed\n *\n * @csspart base - The action card base wrapper\n * @csspart body - The action card body\n * @csspart subtitle - The action card subtitle\n * @csspart title - The action card title\n * @csspart text - The action card text\n */\nexport class SgdsActionCard extends CardElement {\n static styles = [...CardElement.styles, actionCardStyles];\n static dependencies = {\n \"sgds-checkbox\": SgdsCheckbox,\n \"sgds-radio\": SgdsRadio\n };\n /** @internal */\n inputRef: Ref<SgdsCheckbox | SgdsRadio> = createRef();\n /** Name of the HTML form control. Submitted with the form as part of a name/value pair. */\n @property({ reflect: true }) name: string;\n /** Value of the HTML form control. Primarily used to differentiate a list of related checkboxes that have the same name. */\n @property({ type: String }) value: string;\n /** Disables the input (so the user can't check / uncheck it). */\n @property({ type: Boolean, reflect: true }) disabled = false;\n /** Draws the input in a checked state. */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** The type of input of the action card */\n @property({ type: String, reflect: true }) type: TypeVariant = \"checkbox\";\n\n /** Controls the active styling of the action card */\n @property({ reflect: true, type: Boolean })\n active = false;\n\n /** Simulates a click on the input control*/\n public click() {\n this.inputRef.value.click();\n }\n /** @internal Declare the click event listener*/\n async handleInputChange() {\n this.inputRef.value.click();\n this.emit(\"sgds-change\");\n }\n /** @internal The input's id. */\n private inputId: string = genId(\"action-card\", \"input\");\n\n /** @internal */\n @watch(\"checked\")\n async handleRadioCheckedChange() {\n this.active = this.checked;\n }\n /** @internal */\n @watch(\"disabled\")\n async handleDisabledChange() {\n this.active = !this.disabled;\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === \"Enter\" && !hasModifier) {\n this.handleInputChange();\n }\n }\n\n render() {\n const checkbox = html`<sgds-checkbox\n ${ref(this.inputRef)}\n ?disabled=${this.disabled}\n id=${this.inputId}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n .value=${live(this.value)}\n ?checked=${live(this.checked)}\n @sgds-change=${(e: CustomEvent) => (this.checked = e.detail.checked)}\n ></sgds-checkbox>`;\n\n const radio = html`<sgds-radio\n ${ref(this.inputRef)}\n ?disabled=${this.disabled}\n id=${this.inputId}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n .value=${live(this.value)}\n ?checked=${live(this.checked)}\n ></sgds-radio>`;\n\n return html`\n <div\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n @click=${this.handleInputChange}\n @keydown=${this._handleKeyDown}\n variant=\"card-action\"\n class=\"sgds card\n ${classMap({\n [`text-${this.textColor}`]: this.textColor,\n [\"is-active\"]: this.active\n })}\n \"\n part=\"base\"\n >\n <div class=\"card-body\" part=\"body\">\n <h6 class=\"card-subtitle\" part=\"subtitle\">\n <div>\n <slot name=\"icon\"></slot>\n <slot name=\"card-subtitle\"></slot>\n </div>\n <div class=\"card-input\">${this.type === \"checkbox\" ? checkbox : radio}</div>\n </h6>\n <h5 class=\"card-title\" part=\"title\"><slot name=\"card-title\"></slot></h5>\n <p class=\"card-text\" part=\"text\"><slot name=\"card-text\"></slot></p>\n </div>\n </div>\n `;\n }\n}\n\nexport type TypeVariant = \"checkbox\" | \"radio\";\n\nexport default SgdsActionCard;\n"],"names":["CardElement","createRef","genId","html","ref","live","classMap","actionCardStyles","SgdsCheckbox","SgdsRadio","__decorate","property","watch"],"mappings":";;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;AAcG;AACG,MAAO,cAAe,SAAQA,uBAAW,CAAA;AAA/C,IAAA,WAAA,GAAA;;;QAOE,IAAQ,CAAA,QAAA,GAAkCC,gBAAS,EAAE,CAAC;;QAMV,IAAQ,CAAA,QAAA,GA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