monobill-mintui 0.6.612 → 0.6.613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -302
- package/bin/component-dependencies.json +131 -0
- package/bin/mint-ui.js +446 -0
- package/dist/alert.css +3 -0
- package/dist/back-button.css +3 -0
- package/dist/bottom-navigation.css +3 -0
- package/dist/button.css +3 -0
- package/dist/card.css +3 -0
- package/dist/chart.css +3 -0
- package/dist/checkbox.css +3 -0
- package/dist/chip.css +3 -0
- package/dist/choice.css +3 -0
- package/dist/clickable.css +3 -0
- package/dist/collapsible.css +3 -0
- package/dist/components/alert/Alert.d.ts +1 -32
- package/dist/components/alert/Alert.d.ts.map +10 -1
- package/dist/components/alert/browser.js +167 -0
- package/dist/components/alert/index.cjs +1 -0
- package/dist/components/alert/index.d.ts +1 -3
- package/dist/components/alert/index.d.ts.map +10 -1
- package/dist/components/alert/index.js +155 -0
- package/dist/components/back-button/BackButton.d.ts +1 -18
- package/dist/components/back-button/BackButton.d.ts.map +10 -1
- package/dist/components/back-button/browser.js +241 -0
- package/dist/components/back-button/index.cjs +1 -0
- package/dist/components/back-button/index.d.ts +1 -3
- package/dist/components/back-button/index.d.ts.map +10 -1
- package/dist/components/back-button/index.js +229 -0
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +1 -10
- package/dist/components/bottom-navigation/BottomNavigation.d.ts.map +10 -1
- package/dist/components/bottom-navigation/browser.js +97 -0
- package/dist/components/bottom-navigation/index.cjs +1 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -5
- package/dist/components/bottom-navigation/index.d.ts.map +10 -1
- package/dist/components/bottom-navigation/index.js +85 -0
- package/dist/components/button/Button.d.ts +1 -57
- package/dist/components/button/Button.d.ts.map +10 -1
- package/dist/components/button/browser.js +18 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.d.ts +1 -3
- package/dist/components/button/index.d.ts.map +10 -1
- package/dist/components/button/index.js +6 -0
- package/dist/components/card/Card.d.ts +1 -17
- package/dist/components/card/Card.d.ts.map +10 -1
- package/dist/components/card/browser.js +25 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.d.ts +1 -3
- package/dist/components/card/index.d.ts.map +10 -1
- package/dist/components/card/index.js +13 -0
- package/dist/components/chart/Chart.d.ts +1 -291
- package/dist/components/chart/Chart.d.ts.map +10 -1
- package/dist/components/chart/browser.js +1331 -0
- package/dist/components/chart/index.cjs +37 -0
- package/dist/components/chart/index.d.ts +1 -3
- package/dist/components/chart/index.d.ts.map +10 -1
- package/dist/components/chart/index.js +1319 -0
- package/dist/components/checkbox/Checkbox.d.ts +1 -41
- package/dist/components/checkbox/Checkbox.d.ts.map +10 -1
- package/dist/components/checkbox/browser.js +162 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.d.ts +1 -3
- package/dist/components/checkbox/index.d.ts.map +10 -1
- package/dist/components/checkbox/index.js +150 -0
- package/dist/components/chip/Chip.d.ts +1 -16
- package/dist/components/chip/Chip.d.ts.map +10 -1
- package/dist/components/chip/browser.js +17 -0
- package/dist/components/chip/index.cjs +1 -0
- package/dist/components/chip/index.d.ts +1 -3
- package/dist/components/chip/index.d.ts.map +10 -1
- package/dist/components/chip/index.js +5 -0
- package/dist/components/choice/Choice.d.ts +1 -27
- package/dist/components/choice/Choice.d.ts.map +10 -1
- package/dist/components/choice/browser.js +272 -0
- package/dist/components/choice/index.cjs +1 -0
- package/dist/components/choice/index.d.ts +1 -5
- package/dist/components/choice/index.d.ts.map +10 -1
- package/dist/components/choice/index.js +260 -0
- package/dist/components/chunks/button-B0Yt0MX1.js +380 -0
- package/dist/components/chunks/button-BlbLHMts.js +1 -0
- package/dist/components/chunks/caret-down-BN9cl4o4.js +1 -0
- package/dist/components/chunks/caret-down-Ch6IfR7r.js +9 -0
- package/dist/components/chunks/caret-right-CDUwqoen.js +1 -0
- package/dist/components/chunks/caret-right-CVOgr4nk.js +9 -0
- package/dist/components/chunks/caret-up-3XCuTXSE.js +1 -0
- package/dist/components/chunks/caret-up-D_6oa7o1.js +9 -0
- package/dist/components/chunks/chip-B04bJM4r.js +1 -0
- package/dist/components/chunks/chip-B9whjEvW.js +54 -0
- package/dist/components/chunks/close-5tYlQdkk.js +1 -0
- package/dist/components/chunks/close-Dg6U0IjZ.js +10 -0
- package/dist/components/chunks/icon-C0OLmjDY.js +1 -0
- package/dist/components/chunks/icon-CyzR9aVl.js +1 -0
- package/dist/components/chunks/icon-dG8sLTBn.js +27 -0
- package/dist/components/chunks/icon-gQAtsERy.js +1324 -0
- package/dist/components/chunks/input-8bbXzpa5.js +334 -0
- package/dist/components/chunks/input-BoiREc6Y.js +1 -0
- package/dist/components/chunks/link-BxhPnVaz.js +1 -0
- package/dist/components/chunks/link-DKgtBYK6.js +38 -0
- package/dist/components/chunks/modal-B8gNdwEl.js +153 -0
- package/dist/components/chunks/modal-WYWvk2lZ.js +1 -0
- package/dist/components/chunks/popover-BeaGf_JC.js +1 -0
- package/dist/components/chunks/popover-gviDCspV.js +188 -0
- package/dist/components/chunks/register-element-BFYmIynH.js +53 -0
- package/dist/components/chunks/register-element-tCL_F1YI.js +1 -0
- package/dist/components/chunks/search-ANUKQi0r.js +9 -0
- package/dist/components/chunks/search-B3egXuw4.js +1 -0
- package/dist/components/chunks/spinner-BsaFHuS6.js +108 -0
- package/dist/components/chunks/spinner-DbTohC6i.js +63 -0
- package/dist/components/chunks/stack-D1uh4L79.js +1 -0
- package/dist/components/chunks/stack-DyQfjPDh.js +53 -0
- package/dist/components/chunks/table-BgboosRK.js +65 -0
- package/dist/components/chunks/table-DDUNUwGd.js +1 -0
- package/dist/components/chunks/text-BHkEs8U5.js +67 -0
- package/dist/components/chunks/text-BmHZbBMo.js +1 -0
- package/dist/components/clickable/Clickable.d.ts +1 -14
- package/dist/components/clickable/Clickable.d.ts.map +10 -1
- package/dist/components/clickable/browser.js +78 -0
- package/dist/components/clickable/index.cjs +1 -0
- package/dist/components/clickable/index.d.ts +1 -3
- package/dist/components/clickable/index.d.ts.map +10 -1
- package/dist/components/clickable/index.js +66 -0
- package/dist/components/collapsible/Collapsible.d.ts +1 -28
- package/dist/components/collapsible/Collapsible.d.ts.map +10 -1
- package/dist/components/collapsible/browser.js +170 -0
- package/dist/components/collapsible/index.cjs +1 -0
- package/dist/components/collapsible/index.d.ts +1 -3
- package/dist/components/collapsible/index.d.ts.map +10 -1
- package/dist/components/collapsible/index.js +158 -0
- package/dist/components/confirm-action/ConfirmAction.d.ts +1 -27
- package/dist/components/confirm-action/ConfirmAction.d.ts.map +10 -1
- package/dist/components/confirm-action/browser.js +130 -0
- package/dist/components/confirm-action/index.cjs +1 -0
- package/dist/components/confirm-action/index.d.ts +2 -3
- package/dist/components/confirm-action/index.d.ts.map +10 -1
- package/dist/components/confirm-action/index.js +118 -0
- package/dist/components/date-picker/DatePicker.d.ts +1 -130
- package/dist/components/date-picker/DatePicker.d.ts.map +10 -1
- package/dist/components/date-picker/browser.js +1288 -0
- package/dist/components/date-picker/index.cjs +1 -0
- package/dist/components/date-picker/index.d.ts +1 -3
- package/dist/components/date-picker/index.d.ts.map +10 -1
- package/dist/components/date-picker/index.js +1276 -0
- package/dist/components/dropzone/Dropzone.d.ts +1 -59
- package/dist/components/dropzone/Dropzone.d.ts.map +10 -1
- package/dist/components/dropzone/browser.js +355 -0
- package/dist/components/dropzone/index.cjs +1 -0
- package/dist/components/dropzone/index.d.ts +1 -3
- package/dist/components/dropzone/index.d.ts.map +10 -1
- package/dist/components/dropzone/index.js +343 -0
- package/dist/components/form/Form.d.ts +1 -133
- package/dist/components/form/Form.d.ts.map +10 -1
- package/dist/components/form/browser.js +1002 -0
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.d.ts +1 -3
- package/dist/components/form/index.d.ts.map +10 -1
- package/dist/components/form/index.js +990 -0
- package/dist/components/grid/Grid.d.ts +1 -16
- package/dist/components/grid/Grid.d.ts.map +10 -1
- package/dist/components/grid/browser.js +24 -0
- package/dist/components/grid/index.cjs +1 -0
- package/dist/components/grid/index.d.ts +1 -3
- package/dist/components/grid/index.d.ts.map +10 -1
- package/dist/components/grid/index.js +12 -0
- package/dist/components/icon/Icon.d.ts +1 -16
- package/dist/components/icon/Icon.d.ts.map +10 -1
- package/dist/components/icon/browser.js +16 -0
- package/dist/components/icon/index.cjs +1 -0
- package/dist/components/icon/index.d.ts +2 -3
- package/dist/components/icon/index.d.ts.map +10 -1
- package/dist/components/icon/index.js +4 -0
- package/dist/components/input/Input.d.ts +1 -68
- package/dist/components/input/Input.d.ts.map +10 -1
- package/dist/components/input/browser.js +17 -0
- package/dist/components/input/index.cjs +1 -0
- package/dist/components/input/index.d.ts +1 -3
- package/dist/components/input/index.d.ts.map +10 -1
- package/dist/components/input/index.js +5 -0
- package/dist/components/link/Link.d.ts +1 -16
- package/dist/components/link/Link.d.ts.map +10 -1
- package/dist/components/link/browser.js +16 -0
- package/dist/components/link/index.cjs +1 -0
- package/dist/components/link/index.d.ts +1 -3
- package/dist/components/link/index.d.ts.map +10 -1
- package/dist/components/link/index.js +4 -0
- package/dist/components/modal/Modal.d.ts +1 -38
- package/dist/components/modal/Modal.d.ts.map +10 -1
- package/dist/components/modal/browser.js +21 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.d.ts +1 -3
- package/dist/components/modal/index.d.ts.map +10 -1
- package/dist/components/modal/index.js +9 -0
- package/dist/components/navigation/Navigation.d.ts +1 -0
- package/dist/components/navigation/Navigation.d.ts.map +10 -0
- package/dist/components/navigation/browser.js +198 -0
- package/dist/components/navigation/index.cjs +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.d.ts.map +10 -0
- package/dist/components/navigation/index.js +186 -0
- package/dist/components/off-canvas/OffCanvas.d.ts +1 -46
- package/dist/components/off-canvas/OffCanvas.d.ts.map +10 -1
- package/dist/components/off-canvas/browser.js +192 -0
- package/dist/components/off-canvas/index.cjs +1 -0
- package/dist/components/off-canvas/index.d.ts +1 -3
- package/dist/components/off-canvas/index.d.ts.map +10 -1
- package/dist/components/off-canvas/index.js +180 -0
- package/dist/components/page/Page.d.ts +1 -37
- package/dist/components/page/Page.d.ts.map +10 -1
- package/dist/components/page/browser.js +74 -0
- package/dist/components/page/index.cjs +16 -0
- package/dist/components/page/index.d.ts +1 -3
- package/dist/components/page/index.d.ts.map +10 -1
- package/dist/components/page/index.js +62 -0
- package/dist/components/popover/Popover.d.ts +1 -64
- package/dist/components/popover/Popover.d.ts.map +10 -1
- package/dist/components/popover/browser.js +17 -0
- package/dist/components/popover/index.cjs +1 -0
- package/dist/components/popover/index.d.ts +1 -3
- package/dist/components/popover/index.d.ts.map +10 -1
- package/dist/components/popover/index.js +5 -0
- package/dist/components/resource-table/ResourceTable.d.ts +1 -327
- package/dist/components/resource-table/ResourceTable.d.ts.map +10 -1
- package/dist/components/resource-table/browser.js +1457 -0
- package/dist/components/resource-table/index.cjs +2 -0
- package/dist/components/resource-table/index.d.ts +1 -4
- package/dist/components/resource-table/index.d.ts.map +10 -1
- package/dist/components/resource-table/index.js +1445 -0
- package/dist/components/search/Search.d.ts +1 -151
- package/dist/components/search/Search.d.ts.map +10 -1
- package/dist/components/search/browser.js +681 -0
- package/dist/components/search/index.cjs +1 -0
- package/dist/components/search/index.d.ts +1 -3
- package/dist/components/search/index.d.ts.map +10 -1
- package/dist/components/search/index.js +669 -0
- package/dist/components/select/Select.d.ts +1 -37
- package/dist/components/select/Select.d.ts.map +10 -1
- package/dist/components/select/browser.js +285 -0
- package/dist/components/select/index.cjs +1 -0
- package/dist/components/select/index.d.ts +1 -3
- package/dist/components/select/index.d.ts.map +10 -1
- package/dist/components/select/index.js +273 -0
- package/dist/components/side-navigation/SideNavigation.d.ts +1 -52
- package/dist/components/side-navigation/SideNavigation.d.ts.map +10 -1
- package/dist/components/side-navigation/browser.js +466 -0
- package/dist/components/side-navigation/index.cjs +1 -0
- package/dist/components/side-navigation/index.d.ts +5 -8
- package/dist/components/side-navigation/index.d.ts.map +10 -1
- package/dist/components/side-navigation/index.js +454 -0
- package/dist/components/sortable/Sortable.d.ts +1 -62
- package/dist/components/sortable/Sortable.d.ts.map +10 -1
- package/dist/components/sortable/browser.js +340 -0
- package/dist/components/sortable/index.cjs +1 -0
- package/dist/components/sortable/index.d.ts +1 -3
- package/dist/components/sortable/index.d.ts.map +10 -1
- package/dist/components/sortable/index.js +328 -0
- package/dist/components/spinner/Spinner.d.ts +1 -13
- package/dist/components/spinner/Spinner.d.ts.map +10 -1
- package/dist/components/spinner/browser.js +16 -0
- package/dist/components/spinner/index.cjs +1 -0
- package/dist/components/spinner/index.d.ts +1 -3
- package/dist/components/spinner/index.d.ts.map +10 -1
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/stack/Stack.d.ts +1 -23
- package/dist/components/stack/Stack.d.ts.map +10 -1
- package/dist/components/stack/browser.js +16 -0
- package/dist/components/stack/index.cjs +1 -0
- package/dist/components/stack/index.d.ts +1 -3
- package/dist/components/stack/index.d.ts.map +10 -1
- package/dist/components/stack/index.js +4 -0
- package/dist/components/switch/Switch.d.ts +1 -33
- package/dist/components/switch/Switch.d.ts.map +10 -1
- package/dist/components/switch/browser.js +203 -0
- package/dist/components/switch/index.cjs +1 -0
- package/dist/components/switch/index.d.ts +1 -3
- package/dist/components/switch/index.d.ts.map +10 -1
- package/dist/components/switch/index.js +191 -0
- package/dist/components/table/Table.d.ts +1 -11
- package/dist/components/table/Table.d.ts.map +10 -1
- package/dist/components/table/browser.js +16 -0
- package/dist/components/table/index.cjs +1 -0
- package/dist/components/table/index.d.ts +1 -3
- package/dist/components/table/index.d.ts.map +10 -1
- package/dist/components/table/index.js +4 -0
- package/dist/components/tabs/Tabs.d.ts +1 -20
- package/dist/components/tabs/Tabs.d.ts.map +10 -1
- package/dist/components/tabs/browser.js +251 -0
- package/dist/components/tabs/index.cjs +1 -0
- package/dist/components/tabs/index.d.ts +4 -9
- package/dist/components/tabs/index.d.ts.map +10 -1
- package/dist/components/tabs/index.js +239 -0
- package/dist/components/tags/Tags.d.ts +1 -82
- package/dist/components/tags/Tags.d.ts.map +10 -1
- package/dist/components/tags/browser.js +416 -0
- package/dist/components/tags/index.cjs +1 -0
- package/dist/components/tags/index.d.ts +1 -3
- package/dist/components/tags/index.d.ts.map +10 -1
- package/dist/components/tags/index.js +404 -0
- package/dist/components/text/Text.d.ts +1 -25
- package/dist/components/text/Text.d.ts.map +10 -1
- package/dist/components/text/browser.js +16 -0
- package/dist/components/text/index.cjs +1 -0
- package/dist/components/text/index.d.ts +1 -3
- package/dist/components/text/index.d.ts.map +10 -1
- package/dist/components/text/index.js +4 -0
- package/dist/components/time-picker/TimePicker.d.ts +1 -61
- package/dist/components/time-picker/TimePicker.d.ts.map +10 -1
- package/dist/components/time-picker/browser.js +366 -0
- package/dist/components/time-picker/index.cjs +1 -0
- package/dist/components/time-picker/index.d.ts +1 -3
- package/dist/components/time-picker/index.d.ts.map +10 -1
- package/dist/components/time-picker/index.js +354 -0
- package/dist/components/toast/Toast.d.ts +1 -21
- package/dist/components/toast/Toast.d.ts.map +10 -1
- package/dist/components/toast/browser.js +147 -0
- package/dist/components/toast/index.cjs +3 -0
- package/dist/components/toast/index.d.ts +3 -3
- package/dist/components/toast/index.d.ts.map +10 -1
- package/dist/components/toast/index.js +135 -0
- package/dist/confirm-action.css +3 -0
- package/dist/date-picker.css +3 -0
- package/dist/dropzone.css +3 -0
- package/dist/form.css +3 -0
- package/dist/grid.css +3 -0
- package/dist/icon.css +3 -0
- package/dist/icons/ai.svg +5 -6
- package/dist/icons/bank.svg +1 -1
- package/dist/icons/barcode.svg +1 -1
- package/dist/icons/basket.svg +1 -1
- package/dist/icons/building.svg +1 -1
- package/dist/icons/buildings.svg +1 -1
- package/dist/icons/calendar.svg +1 -1
- package/dist/icons/cash.svg +3 -0
- package/dist/icons/check.svg +1 -1
- package/dist/icons/close.svg +1 -1
- package/dist/icons/coupon.svg +3 -0
- package/dist/icons/delivery-location.svg +3 -0
- package/dist/icons/desktop.svg +3 -0
- package/dist/icons/dollar-sign.svg +1 -1
- package/dist/icons/edit.svg +1 -1
- package/dist/icons/gift.svg +3 -0
- package/dist/icons/grip-lines.svg +2 -2
- package/dist/icons/heart.svg +3 -0
- package/dist/icons/installments.svg +3 -0
- package/dist/icons/inventory.svg +3 -0
- package/dist/icons/invoice.svg +3 -0
- package/dist/icons/loyalty-points.svg +3 -0
- package/dist/icons/membership.svg +3 -0
- package/dist/icons/mobile.svg +3 -0
- package/dist/icons/order-tracking.svg +7 -0
- package/dist/icons/out-of-stock.svg +3 -0
- package/dist/icons/package.svg +3 -0
- package/dist/icons/percent-discount.svg +3 -0
- package/dist/icons/pickup.svg +3 -0
- package/dist/icons/plus.svg +1 -1
- package/dist/icons/price-label.svg +3 -0
- package/dist/icons/product-review.svg +3 -0
- package/dist/icons/receipt.svg +3 -0
- package/dist/icons/refund.svg +3 -0
- package/dist/icons/remove.svg +1 -1
- package/dist/icons/return.svg +3 -0
- package/dist/icons/sale-burst.svg +3 -0
- package/dist/icons/secure-checkout.svg +3 -0
- package/dist/icons/shopping-bag.svg +3 -0
- package/dist/icons/shopping-cart.svg +3 -0
- package/dist/icons/storefront.svg +3 -0
- package/dist/icons/support.svg +3 -0
- package/dist/icons/tablet.svg +3 -0
- package/dist/icons/wallet.svg +3 -0
- package/dist/icons/warehouse.svg +3 -0
- package/dist/index.cjs +83 -79
- package/dist/index.css +253 -0
- package/dist/index.d.ts +94 -91
- package/dist/index.d.ts.map +10 -1
- package/dist/index.js +10695 -10239
- package/dist/input.css +3 -0
- package/dist/link.css +3 -0
- package/dist/mintui-elements.d.ts +156 -0
- package/dist/mintui-elements.d.ts.map +10 -0
- package/dist/modal.css +3 -0
- package/dist/navigation.css +3 -0
- package/dist/off-canvas.css +3 -0
- package/dist/page.css +3 -0
- package/dist/popover.css +3 -0
- package/dist/resource-table.css +3 -0
- package/dist/search.css +3 -0
- package/dist/select.css +3 -0
- package/dist/side-navigation.css +3 -0
- package/dist/sortable.css +3 -0
- package/dist/spinner.css +3 -0
- package/dist/stack.css +3 -0
- package/dist/switch.css +3 -0
- package/dist/table.css +3 -0
- package/dist/tabs.css +3 -0
- package/dist/tags.css +3 -0
- package/dist/text.css +3 -0
- package/dist/theme.css +101 -0
- package/dist/time-picker.css +3 -0
- package/dist/toast.css +3 -0
- package/package.json +379 -30
- package/dist/components/bottom-navigation/BottomNavItem.d.ts +0 -14
- package/dist/components/bottom-navigation/BottomNavItem.d.ts.map +0 -1
- package/dist/components/choice/ChoiceOption.d.ts +0 -30
- package/dist/components/choice/ChoiceOption.d.ts.map +0 -1
- package/dist/components/confirm-action/ConfirmActionApi.d.ts +0 -17
- package/dist/components/confirm-action/ConfirmActionApi.d.ts.map +0 -1
- package/dist/components/icon/build-icons.d.ts +0 -2
- package/dist/components/icon/build-icons.d.ts.map +0 -1
- package/dist/components/icon/icons/ai.d.ts +0 -3
- package/dist/components/icon/icons/ai.d.ts.map +0 -1
- package/dist/components/icon/icons/archive.d.ts +0 -3
- package/dist/components/icon/icons/archive.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-down.d.ts +0 -3
- package/dist/components/icon/icons/arrow-down.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-left.d.ts +0 -3
- package/dist/components/icon/icons/arrow-left.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-right.d.ts +0 -3
- package/dist/components/icon/icons/arrow-right.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-up.d.ts +0 -3
- package/dist/components/icon/icons/arrow-up.d.ts.map +0 -1
- package/dist/components/icon/icons/attach.d.ts +0 -3
- package/dist/components/icon/icons/attach.d.ts.map +0 -1
- package/dist/components/icon/icons/bank.d.ts +0 -3
- package/dist/components/icon/icons/bank.d.ts.map +0 -1
- package/dist/components/icon/icons/barcode.d.ts +0 -3
- package/dist/components/icon/icons/barcode.d.ts.map +0 -1
- package/dist/components/icon/icons/basket.d.ts +0 -3
- package/dist/components/icon/icons/basket.d.ts.map +0 -1
- package/dist/components/icon/icons/bookmark.d.ts +0 -3
- package/dist/components/icon/icons/bookmark.d.ts.map +0 -1
- package/dist/components/icon/icons/building.d.ts +0 -3
- package/dist/components/icon/icons/building.d.ts.map +0 -1
- package/dist/components/icon/icons/buildings.d.ts +0 -3
- package/dist/components/icon/icons/buildings.d.ts.map +0 -1
- package/dist/components/icon/icons/bullhorn.d.ts +0 -3
- package/dist/components/icon/icons/bullhorn.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-day.d.ts +0 -3
- package/dist/components/icon/icons/calendar-day.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-empty.d.ts +0 -3
- package/dist/components/icon/icons/calendar-empty.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-week.d.ts +0 -3
- package/dist/components/icon/icons/calendar-week.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar.d.ts +0 -3
- package/dist/components/icon/icons/calendar.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-down.d.ts +0 -3
- package/dist/components/icon/icons/caret-down.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-left.d.ts +0 -3
- package/dist/components/icon/icons/caret-left.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-right.d.ts +0 -3
- package/dist/components/icon/icons/caret-right.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-up.d.ts +0 -3
- package/dist/components/icon/icons/caret-up.d.ts.map +0 -1
- package/dist/components/icon/icons/chart-bar.d.ts +0 -3
- package/dist/components/icon/icons/chart-bar.d.ts.map +0 -1
- package/dist/components/icon/icons/chart-line.d.ts +0 -3
- package/dist/components/icon/icons/chart-line.d.ts.map +0 -1
- package/dist/components/icon/icons/chat.d.ts +0 -3
- package/dist/components/icon/icons/chat.d.ts.map +0 -1
- package/dist/components/icon/icons/check.d.ts +0 -3
- package/dist/components/icon/icons/check.d.ts.map +0 -1
- package/dist/components/icon/icons/clock.d.ts +0 -3
- package/dist/components/icon/icons/clock.d.ts.map +0 -1
- package/dist/components/icon/icons/close.d.ts +0 -3
- package/dist/components/icon/icons/close.d.ts.map +0 -1
- package/dist/components/icon/icons/copy.d.ts +0 -3
- package/dist/components/icon/icons/copy.d.ts.map +0 -1
- package/dist/components/icon/icons/credit-card.d.ts +0 -3
- package/dist/components/icon/icons/credit-card.d.ts.map +0 -1
- package/dist/components/icon/icons/delete.d.ts +0 -3
- package/dist/components/icon/icons/delete.d.ts.map +0 -1
- package/dist/components/icon/icons/desktop-screen.d.ts +0 -3
- package/dist/components/icon/icons/desktop-screen.d.ts.map +0 -1
- package/dist/components/icon/icons/documentation.d.ts +0 -3
- package/dist/components/icon/icons/documentation.d.ts.map +0 -1
- package/dist/components/icon/icons/dollar-sign.d.ts +0 -3
- package/dist/components/icon/icons/dollar-sign.d.ts.map +0 -1
- package/dist/components/icon/icons/download.d.ts +0 -3
- package/dist/components/icon/icons/download.d.ts.map +0 -1
- package/dist/components/icon/icons/duplicate.d.ts +0 -3
- package/dist/components/icon/icons/duplicate.d.ts.map +0 -1
- package/dist/components/icon/icons/edit.d.ts +0 -3
- package/dist/components/icon/icons/edit.d.ts.map +0 -1
- package/dist/components/icon/icons/ellipsis.d.ts +0 -3
- package/dist/components/icon/icons/ellipsis.d.ts.map +0 -1
- package/dist/components/icon/icons/error.d.ts +0 -3
- package/dist/components/icon/icons/error.d.ts.map +0 -1
- package/dist/components/icon/icons/external-link.d.ts +0 -3
- package/dist/components/icon/icons/external-link.d.ts.map +0 -1
- package/dist/components/icon/icons/eye.d.ts +0 -3
- package/dist/components/icon/icons/eye.d.ts.map +0 -1
- package/dist/components/icon/icons/file.d.ts +0 -3
- package/dist/components/icon/icons/file.d.ts.map +0 -1
- package/dist/components/icon/icons/filter.d.ts +0 -3
- package/dist/components/icon/icons/filter.d.ts.map +0 -1
- package/dist/components/icon/icons/folder.d.ts +0 -3
- package/dist/components/icon/icons/folder.d.ts.map +0 -1
- package/dist/components/icon/icons/gavel.d.ts +0 -3
- package/dist/components/icon/icons/gavel.d.ts.map +0 -1
- package/dist/components/icon/icons/globe.d.ts +0 -3
- package/dist/components/icon/icons/globe.d.ts.map +0 -1
- package/dist/components/icon/icons/grid.d.ts +0 -3
- package/dist/components/icon/icons/grid.d.ts.map +0 -1
- package/dist/components/icon/icons/grip-lines.d.ts +0 -3
- package/dist/components/icon/icons/grip-lines.d.ts.map +0 -1
- package/dist/components/icon/icons/help.d.ts +0 -3
- package/dist/components/icon/icons/help.d.ts.map +0 -1
- package/dist/components/icon/icons/home.d.ts +0 -3
- package/dist/components/icon/icons/home.d.ts.map +0 -1
- package/dist/components/icon/icons/image.d.ts +0 -3
- package/dist/components/icon/icons/image.d.ts.map +0 -1
- package/dist/components/icon/icons/index.cjs +0 -34
- package/dist/components/icon/icons/index.d.ts +0 -92
- package/dist/components/icon/icons/index.d.ts.map +0 -1
- package/dist/components/icon/icons/index.js +0 -752
- package/dist/components/icon/icons/info.d.ts +0 -3
- package/dist/components/icon/icons/info.d.ts.map +0 -1
- package/dist/components/icon/icons/language.d.ts +0 -3
- package/dist/components/icon/icons/language.d.ts.map +0 -1
- package/dist/components/icon/icons/line-chart.d.ts +0 -3
- package/dist/components/icon/icons/line-chart.d.ts.map +0 -1
- package/dist/components/icon/icons/link.d.ts +0 -3
- package/dist/components/icon/icons/link.d.ts.map +0 -1
- package/dist/components/icon/icons/list.d.ts +0 -3
- package/dist/components/icon/icons/list.d.ts.map +0 -1
- package/dist/components/icon/icons/location.d.ts +0 -3
- package/dist/components/icon/icons/location.d.ts.map +0 -1
- package/dist/components/icon/icons/lock.d.ts +0 -3
- package/dist/components/icon/icons/lock.d.ts.map +0 -1
- package/dist/components/icon/icons/login.d.ts +0 -3
- package/dist/components/icon/icons/login.d.ts.map +0 -1
- package/dist/components/icon/icons/logout.d.ts +0 -3
- package/dist/components/icon/icons/logout.d.ts.map +0 -1
- package/dist/components/icon/icons/mail.d.ts +0 -3
- package/dist/components/icon/icons/mail.d.ts.map +0 -1
- package/dist/components/icon/icons/map.d.ts +0 -3
- package/dist/components/icon/icons/map.d.ts.map +0 -1
- package/dist/components/icon/icons/menu.d.ts +0 -3
- package/dist/components/icon/icons/menu.d.ts.map +0 -1
- package/dist/components/icon/icons/moon.d.ts +0 -3
- package/dist/components/icon/icons/moon.d.ts.map +0 -1
- package/dist/components/icon/icons/notifications.d.ts +0 -3
- package/dist/components/icon/icons/notifications.d.ts.map +0 -1
- package/dist/components/icon/icons/paste.d.ts +0 -3
- package/dist/components/icon/icons/paste.d.ts.map +0 -1
- package/dist/components/icon/icons/pin.d.ts +0 -3
- package/dist/components/icon/icons/pin.d.ts.map +0 -1
- package/dist/components/icon/icons/plus.d.ts +0 -3
- package/dist/components/icon/icons/plus.d.ts.map +0 -1
- package/dist/components/icon/icons/print.d.ts +0 -3
- package/dist/components/icon/icons/print.d.ts.map +0 -1
- package/dist/components/icon/icons/refresh.d.ts +0 -3
- package/dist/components/icon/icons/refresh.d.ts.map +0 -1
- package/dist/components/icon/icons/remove.d.ts +0 -3
- package/dist/components/icon/icons/remove.d.ts.map +0 -1
- package/dist/components/icon/icons/save.d.ts +0 -3
- package/dist/components/icon/icons/save.d.ts.map +0 -1
- package/dist/components/icon/icons/search.d.ts +0 -3
- package/dist/components/icon/icons/search.d.ts.map +0 -1
- package/dist/components/icon/icons/settings.d.ts +0 -3
- package/dist/components/icon/icons/settings.d.ts.map +0 -1
- package/dist/components/icon/icons/share.d.ts +0 -3
- package/dist/components/icon/icons/share.d.ts.map +0 -1
- package/dist/components/icon/icons/sort-arrows.d.ts +0 -3
- package/dist/components/icon/icons/sort-arrows.d.ts.map +0 -1
- package/dist/components/icon/icons/sort.d.ts +0 -3
- package/dist/components/icon/icons/sort.d.ts.map +0 -1
- package/dist/components/icon/icons/star.d.ts +0 -3
- package/dist/components/icon/icons/star.d.ts.map +0 -1
- package/dist/components/icon/icons/success.d.ts +0 -3
- package/dist/components/icon/icons/success.d.ts.map +0 -1
- package/dist/components/icon/icons/sun.d.ts +0 -3
- package/dist/components/icon/icons/sun.d.ts.map +0 -1
- package/dist/components/icon/icons/table.d.ts +0 -3
- package/dist/components/icon/icons/table.d.ts.map +0 -1
- package/dist/components/icon/icons/tag.d.ts +0 -3
- package/dist/components/icon/icons/tag.d.ts.map +0 -1
- package/dist/components/icon/icons/trash.d.ts +0 -3
- package/dist/components/icon/icons/trash.d.ts.map +0 -1
- package/dist/components/icon/icons/truck.d.ts +0 -3
- package/dist/components/icon/icons/truck.d.ts.map +0 -1
- package/dist/components/icon/icons/unlock.d.ts +0 -3
- package/dist/components/icon/icons/unlock.d.ts.map +0 -1
- package/dist/components/icon/icons/upload.d.ts +0 -3
- package/dist/components/icon/icons/upload.d.ts.map +0 -1
- package/dist/components/icon/icons/user-add.d.ts +0 -3
- package/dist/components/icon/icons/user-add.d.ts.map +0 -1
- package/dist/components/icon/icons/user.d.ts +0 -3
- package/dist/components/icon/icons/user.d.ts.map +0 -1
- package/dist/components/icon/icons/users.d.ts +0 -3
- package/dist/components/icon/icons/users.d.ts.map +0 -1
- package/dist/components/icon/icons/video.d.ts +0 -3
- package/dist/components/icon/icons/video.d.ts.map +0 -1
- package/dist/components/icon/icons/warning.d.ts +0 -3
- package/dist/components/icon/icons/warning.d.ts.map +0 -1
- package/dist/components/icon/registry.d.ts +0 -15
- package/dist/components/icon/registry.d.ts.map +0 -1
- package/dist/components/resource-table/ResourceTableContextMenu.d.ts +0 -40
- package/dist/components/resource-table/ResourceTableContextMenu.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionHeader.d.ts +0 -2
- package/dist/components/side-navigation/SideNavigationActionHeader.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionLinks.d.ts +0 -9
- package/dist/components/side-navigation/SideNavigationActionLinks.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionMenu.d.ts +0 -26
- package/dist/components/side-navigation/SideNavigationActionMenu.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationLink.d.ts +0 -38
- package/dist/components/side-navigation/SideNavigationLink.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationLinks.d.ts +0 -38
- package/dist/components/side-navigation/SideNavigationLinks.d.ts.map +0 -1
- package/dist/components/tabs/Tab.d.ts +0 -19
- package/dist/components/tabs/Tab.d.ts.map +0 -1
- package/dist/components/tabs/TabContent.d.ts +0 -13
- package/dist/components/tabs/TabContent.d.ts.map +0 -1
- package/dist/components/tabs/TabList.d.ts +0 -12
- package/dist/components/tabs/TabList.d.ts.map +0 -1
- package/dist/components/toast/ToastApi.d.ts +0 -21
- package/dist/components/toast/ToastApi.d.ts.map +0 -1
- package/dist/components/top-navigation/TopNavigation.d.ts +0 -65
- package/dist/components/top-navigation/TopNavigation.d.ts.map +0 -1
- package/dist/components/top-navigation/index.d.ts +0 -4
- package/dist/components/top-navigation/index.d.ts.map +0 -1
- package/dist/icons/truck.svg +0 -13
- package/dist/search-CM-OgatF.js +0 -179
- package/dist/search-C_vLUsm7.cjs +0 -1
- package/dist/styles.css +0 -3
- package/tailwind.preset.cjs +0 -75
- package/tailwind.preset.js +0 -97
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
|
|
2
|
+
const __mintLoadStyle = (key, url) => {
|
|
3
|
+
if (typeof document === 'undefined') return
|
|
4
|
+
const href = new URL(url, import.meta.url).href
|
|
5
|
+
if ([...document.querySelectorAll('link[rel="stylesheet"]')].some(link => link.href === href)) return
|
|
6
|
+
if (document.querySelector('style[data-mint-ui-style="' + key + '"]') || document.querySelector('link[data-mint-ui-style="' + key + '"]')) return
|
|
7
|
+
const link = document.createElement('link')
|
|
8
|
+
link.rel = 'stylesheet'
|
|
9
|
+
link.href = href
|
|
10
|
+
link.dataset.mintUiStyle = key
|
|
11
|
+
document.head.append(link)
|
|
12
|
+
}
|
|
13
|
+
__mintLoadStyle('theme', '../../theme.css')
|
|
14
|
+
__mintLoadStyle('button', '../../button.css')
|
|
15
|
+
__mintLoadStyle('spinner', '../../spinner.css')
|
|
16
|
+
__mintLoadStyle('icon', '../../icon.css')
|
|
17
|
+
__mintLoadStyle('link', '../../link.css')
|
|
18
|
+
__mintLoadStyle('popover', '../../popover.css')
|
|
19
|
+
__mintLoadStyle('stack', '../../stack.css')
|
|
20
|
+
__mintLoadStyle('navigation', '../../navigation.css')
|
|
21
|
+
import "../chunks/icon-gQAtsERy.js";
|
|
22
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
23
|
+
import "../chunks/button-B0Yt0MX1.js";
|
|
24
|
+
import "../chunks/popover-gviDCspV.js";
|
|
25
|
+
import "../chunks/link-DKgtBYK6.js";
|
|
26
|
+
//#region src/components/navigation/Navigation.js
|
|
27
|
+
var t = 0, n = class extends HTMLElement {
|
|
28
|
+
static get observedAttributes() {
|
|
29
|
+
return [
|
|
30
|
+
"brand",
|
|
31
|
+
"brand-href",
|
|
32
|
+
"direction",
|
|
33
|
+
"label",
|
|
34
|
+
"open"
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
constructor() {
|
|
38
|
+
super(), this._built = !1, this._brand = null, this._brandLink = null, this._items = null, this._toggle = null, this._toggleLabel = null, this._mobileActions = null, this._mobileActionNodes = [], this._instanceId = ++t, this._dropdowns = [], this._content = null, this._actions = null, this._activeDropdown = null, this._layoutObserver = null;
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
this._built || this._build(), this._observeDropdowns(), this._syncResponsiveDropdowns(), this._syncMobileActions(), typeof ResizeObserver < "u" && (this._layoutObserver = new ResizeObserver(() => {
|
|
42
|
+
this._syncResponsiveDropdowns(), this._syncMobileActions();
|
|
43
|
+
}), this._layoutObserver.observe(this)), this._syncAttributes();
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
for (let e of this._dropdowns) e.observer?.disconnect();
|
|
47
|
+
this._layoutObserver?.disconnect(), this._layoutObserver = null;
|
|
48
|
+
}
|
|
49
|
+
attributeChangedCallback(e, t, n) {
|
|
50
|
+
t === n || !this._built || (e === "open" ? this._syncOpenState() : this._syncAttributes());
|
|
51
|
+
}
|
|
52
|
+
getDirection() {
|
|
53
|
+
return this.getAttribute("direction") === "vertical" ? "vertical" : "horizontal";
|
|
54
|
+
}
|
|
55
|
+
getBrand() {
|
|
56
|
+
return this.getAttribute("brand") || "";
|
|
57
|
+
}
|
|
58
|
+
getBrandHref() {
|
|
59
|
+
return this.getAttribute("brand-href") || "/";
|
|
60
|
+
}
|
|
61
|
+
getLabel() {
|
|
62
|
+
return this.getAttribute("label") || "Primary navigation";
|
|
63
|
+
}
|
|
64
|
+
_build() {
|
|
65
|
+
let e = Array.from(this.childNodes), t = e.find((e) => e.nodeType === Node.ELEMENT_NODE && e.getAttribute("slot") === "brand"), n = e.filter((e) => e.nodeType === Node.ELEMENT_NODE && ["actions", "mobile-actions"].includes(e.getAttribute("slot")));
|
|
66
|
+
this._mobileActionNodes = n.filter((e) => e.getAttribute("slot") === "mobile-actions");
|
|
67
|
+
let r = e.filter((e) => e !== t && !n.includes(e));
|
|
68
|
+
this.replaceChildren();
|
|
69
|
+
let i = document.createElement("div");
|
|
70
|
+
i.className = "mint-navigation-shell";
|
|
71
|
+
let a = document.createElement("div");
|
|
72
|
+
a.className = "mint-navigation-bar", this._brand = document.createElement("div"), this._brand.className = "mint-navigation-brand", t ? (t.removeAttribute("slot"), this._brand.appendChild(t)) : this.getBrand() && (this._brandLink = document.createElement("mint-link"), this._brandLink.className = "mint-navigation-brand-link", this._brandLink.textContent = this.getBrand(), this._brandLink.setAttribute("href", this.getBrandHref()), this._brand.appendChild(this._brandLink)), this._toggle = document.createElement("mint-button"), this._toggle.className = "mint-navigation-toggle", this._toggle.setAttribute("aria-expanded", "false"), this._toggle.addEventListener("click", () => this.toggleMenu()), this._toggleLabel = document.createElement("span"), this._toggleLabel.className = "mint-navigation-visually-hidden", this._toggleLabel.textContent = "Open navigation menu", this._toggle.append(this._toggleLabel), this._toggle.setAttribute("variant", "ghost"), this._toggle.setAttribute("tone", "action"), this._toggle.setAttribute("button-type", "button"), this._toggle.setAttribute("icon", "menu"), this._mobileActions = document.createElement("div"), this._mobileActions.className = "mint-navigation-mobile-actions", a.append(this._brand, this._mobileActions, this._toggle);
|
|
73
|
+
let o = document.createElement("div");
|
|
74
|
+
this._content = o, o.className = "mint-navigation-content", this._items = document.createElement("nav"), this._items.className = "mint-navigation-items", this._items.setAttribute("aria-label", this.getLabel()), this._items.addEventListener("click", (e) => {
|
|
75
|
+
e.target.closest("a, mint-link") && this.closeMenu();
|
|
76
|
+
});
|
|
77
|
+
let s = 0;
|
|
78
|
+
for (let e of r) if (e.nodeType !== Node.ELEMENT_NODE) this._items.appendChild(e);
|
|
79
|
+
else if (e.tagName === "DETAILS") {
|
|
80
|
+
let t = this._createDropdown(e, s++);
|
|
81
|
+
this._items.append(t.trigger, t.popover), this._registerDropdown(t.trigger, t.popover);
|
|
82
|
+
} else {
|
|
83
|
+
let t = this._toMintLink(e);
|
|
84
|
+
if (this._items.appendChild(t), t.nodeType === Node.ELEMENT_NODE && t.tagName === "MINT-POPOVER") {
|
|
85
|
+
let e = t.getAttribute("trigger-id"), n = Array.from(this._items.querySelectorAll("mint-button")).find((t) => t.id === e);
|
|
86
|
+
this._registerDropdown(n, t);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
let c = document.createElement("div");
|
|
90
|
+
this._actions = c, c.className = "mint-navigation-actions";
|
|
91
|
+
for (let e of n) e.removeAttribute("slot"), c.appendChild(e);
|
|
92
|
+
let l = document.createElement("section");
|
|
93
|
+
l.className = "mint-navigation-submenu", l.setAttribute("aria-label", "Navigation submenu");
|
|
94
|
+
let u = document.createElement("div");
|
|
95
|
+
u.className = "mint-navigation-submenu-header";
|
|
96
|
+
let d = document.createElement("mint-button");
|
|
97
|
+
d.className = "mint-navigation-submenu-back", d.setAttribute("variant", "ghost"), d.setAttribute("tone", "action"), d.setAttribute("button-type", "button"), d.setAttribute("icon", "arrow-left"), d.setAttribute("aria-label", "Back to main navigation"), d.addEventListener("click", () => this._closeSubmenu());
|
|
98
|
+
let f = document.createElement("h3");
|
|
99
|
+
f.className = "mint-navigation-submenu-title", u.append(d, f);
|
|
100
|
+
let p = document.createElement("nav");
|
|
101
|
+
p.className = "mint-navigation-submenu-items", p.addEventListener("click", (e) => {
|
|
102
|
+
e.target.closest("a, mint-link") && this.closeMenu();
|
|
103
|
+
}), l.append(u, p), this._submenu = l, this._submenuTitle = f, this._submenuItems = p;
|
|
104
|
+
for (let e of this._dropdowns) p.append(...e.submenuItems);
|
|
105
|
+
o.append(this._items, c, l), i.append(a, o), this.appendChild(i), this._built = !0, this._syncMobileActions();
|
|
106
|
+
}
|
|
107
|
+
_syncMobileActions() {
|
|
108
|
+
if (!this._mobileActions || !this._actions) return;
|
|
109
|
+
let e = this._isMobileLayout() ? this._mobileActions : this._actions;
|
|
110
|
+
for (let t of this._mobileActionNodes) e.appendChild(t);
|
|
111
|
+
}
|
|
112
|
+
_toMintLink(e) {
|
|
113
|
+
if (e.nodeType !== Node.ELEMENT_NODE || e.tagName !== "A") return e;
|
|
114
|
+
let t = document.createElement("mint-link");
|
|
115
|
+
for (; e.firstChild;) t.appendChild(e.firstChild);
|
|
116
|
+
for (let n of Array.from(e.attributes)) n.name !== "slot" && t.setAttribute(n.name, n.value);
|
|
117
|
+
return t;
|
|
118
|
+
}
|
|
119
|
+
_createDropdown(e, t) {
|
|
120
|
+
let n = e.querySelector(":scope > summary"), r = document.createElement("mint-button"), i = `mint-navigation-${this._instanceId}-dropdown-${t}`, a = `${i}-popover`;
|
|
121
|
+
if (r.id = i, r.className = "mint-navigation-dropdown-trigger", r.setAttribute("aria-haspopup", "dialog"), r.setAttribute("aria-expanded", "false"), r.setAttribute("aria-controls", a), n) {
|
|
122
|
+
for (; n.firstChild;) r.appendChild(n.firstChild);
|
|
123
|
+
n.remove();
|
|
124
|
+
} else r.textContent = e.getAttribute("label") || "More";
|
|
125
|
+
r.setAttribute("variant", "ghost"), r.setAttribute("tone", "action"), r.setAttribute("button-type", "button"), r.setAttribute("icon-position", "right");
|
|
126
|
+
let o = document.createElement("mint-popover");
|
|
127
|
+
o.id = a, o.className = "mint-navigation-dropdown", o.setAttribute("trigger-id", i), o.setAttribute("direction", "down"), o.setAttribute("aria-label", `${r.textContent.trim()} links`);
|
|
128
|
+
for (let t of Array.from(e.childNodes)) o.appendChild(this._toMintLink(t));
|
|
129
|
+
return {
|
|
130
|
+
trigger: r,
|
|
131
|
+
popover: o,
|
|
132
|
+
observer: null
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
_registerDropdown(e, t) {
|
|
136
|
+
if (!e || !t) return;
|
|
137
|
+
t.id ||= `mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`, e.classList.add("mint-navigation-dropdown-trigger"), e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", String(t.hasAttribute("open"))), e.setAttribute("aria-controls", t.id), t.classList.add("mint-navigation-dropdown"), t.hasAttribute("role") || t.setAttribute("role", "group"), t.hasAttribute("aria-label") || t.setAttribute("aria-label", `${e.textContent.trim()} links`);
|
|
138
|
+
let n = Array.from(t.querySelectorAll("mint-link")).map((e) => e.cloneNode(!0)), r = {
|
|
139
|
+
trigger: e,
|
|
140
|
+
popover: t,
|
|
141
|
+
observer: null,
|
|
142
|
+
triggerId: t.getAttribute("trigger-id") || e.id,
|
|
143
|
+
submenuItems: n
|
|
144
|
+
};
|
|
145
|
+
e.addEventListener("click", () => {
|
|
146
|
+
this._isMobileLayout() && this._openSubmenu(r);
|
|
147
|
+
}), this._dropdowns.push(r);
|
|
148
|
+
}
|
|
149
|
+
_observeDropdowns() {
|
|
150
|
+
for (let e of this._dropdowns) e.observer || (e.observer = new MutationObserver(() => {
|
|
151
|
+
e.trigger.setAttribute("aria-expanded", String(e.popover.hasAttribute("open")));
|
|
152
|
+
}), e.observer.observe(e.popover, {
|
|
153
|
+
attributes: !0,
|
|
154
|
+
attributeFilter: ["open"]
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
_isMobileLayout() {
|
|
158
|
+
return this.getBoundingClientRect().width <= 640;
|
|
159
|
+
}
|
|
160
|
+
_syncResponsiveDropdowns() {
|
|
161
|
+
let e = this._isMobileLayout();
|
|
162
|
+
for (let t of this._dropdowns) e ? (t.popover.hasAttribute("open") && t.popover.close(), t.popover.getAttribute("trigger-id") && t.popover.setAttribute("trigger-id", "")) : t.triggerId && t.popover.getAttribute("trigger-id") !== t.triggerId && t.popover.setAttribute("trigger-id", t.triggerId);
|
|
163
|
+
!e && this._activeDropdown && this._closeSubmenu();
|
|
164
|
+
}
|
|
165
|
+
_openSubmenu(e) {
|
|
166
|
+
this._isMobileLayout() && (this._activeDropdown && this._activeDropdown !== e && this._activeDropdown.trigger.setAttribute("aria-expanded", "false"), this._activeDropdown = e, e.trigger.setAttribute("aria-expanded", "true"), this._submenuTitle.textContent = e.trigger.textContent.trim(), this._submenuItems.replaceChildren(...e.submenuItems), this._content.setAttribute("data-submenu-open", ""));
|
|
167
|
+
}
|
|
168
|
+
_closeSubmenu() {
|
|
169
|
+
this._activeDropdown?.trigger.setAttribute("aria-expanded", "false"), this._activeDropdown = null, this._content?.removeAttribute("data-submenu-open");
|
|
170
|
+
}
|
|
171
|
+
_syncAttributes() {
|
|
172
|
+
if (this._brandLink) {
|
|
173
|
+
this._brandLink.setAttribute("href", this.getBrandHref());
|
|
174
|
+
let e = this._brandLink.querySelector("a");
|
|
175
|
+
e ? e.textContent = this.getBrand() : this._brandLink.textContent = this.getBrand();
|
|
176
|
+
}
|
|
177
|
+
this._items && this._items.setAttribute("aria-label", this.getLabel()), this._syncOpenState();
|
|
178
|
+
}
|
|
179
|
+
_syncOpenState() {
|
|
180
|
+
if (!this._toggle) return;
|
|
181
|
+
let e = this.hasAttribute("open");
|
|
182
|
+
this._toggle.setAttribute("aria-expanded", String(e));
|
|
183
|
+
let t = e ? "Close navigation menu" : "Open navigation menu";
|
|
184
|
+
this._toggle.setAttribute("aria-label", t), this._toggleLabel && (this._toggleLabel.textContent = t), this._toggle.setAttribute("icon", e ? "close" : "menu");
|
|
185
|
+
}
|
|
186
|
+
openMenu() {
|
|
187
|
+
this.setAttribute("open", "");
|
|
188
|
+
}
|
|
189
|
+
closeMenu() {
|
|
190
|
+
this._closeSubmenu(), this.removeAttribute("open");
|
|
191
|
+
}
|
|
192
|
+
toggleMenu() {
|
|
193
|
+
this.hasAttribute("open") ? this.closeMenu() : this.openMenu();
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
typeof customElements < "u" && !customElements.get("mint-navigation") && e("mint-navigation", n);
|
|
197
|
+
//#endregion
|
|
198
|
+
export { n as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../chunks/icon-dG8sLTBn.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/button-BlbLHMts.js`),require(`../chunks/popover-BeaGf_JC.js`),require(`../chunks/link-BxhPnVaz.js`);var t=0,n=class extends HTMLElement{static get observedAttributes(){return[`brand`,`brand-href`,`direction`,`label`,`open`]}constructor(){super(),this._built=!1,this._brand=null,this._brandLink=null,this._items=null,this._toggle=null,this._toggleLabel=null,this._mobileActions=null,this._mobileActionNodes=[],this._instanceId=++t,this._dropdowns=[],this._content=null,this._actions=null,this._activeDropdown=null,this._layoutObserver=null}connectedCallback(){this._built||this._build(),this._observeDropdowns(),this._syncResponsiveDropdowns(),this._syncMobileActions(),typeof ResizeObserver<`u`&&(this._layoutObserver=new ResizeObserver(()=>{this._syncResponsiveDropdowns(),this._syncMobileActions()}),this._layoutObserver.observe(this)),this._syncAttributes()}disconnectedCallback(){for(let e of this._dropdowns)e.observer?.disconnect();this._layoutObserver?.disconnect(),this._layoutObserver=null}attributeChangedCallback(e,t,n){t===n||!this._built||(e===`open`?this._syncOpenState():this._syncAttributes())}getDirection(){return this.getAttribute(`direction`)===`vertical`?`vertical`:`horizontal`}getBrand(){return this.getAttribute(`brand`)||``}getBrandHref(){return this.getAttribute(`brand-href`)||`/`}getLabel(){return this.getAttribute(`label`)||`Primary navigation`}_build(){let e=Array.from(this.childNodes),t=e.find(e=>e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`slot`)===`brand`),n=e.filter(e=>e.nodeType===Node.ELEMENT_NODE&&[`actions`,`mobile-actions`].includes(e.getAttribute(`slot`)));this._mobileActionNodes=n.filter(e=>e.getAttribute(`slot`)===`mobile-actions`);let r=e.filter(e=>e!==t&&!n.includes(e));this.replaceChildren();let i=document.createElement(`div`);i.className=`mint-navigation-shell`;let a=document.createElement(`div`);a.className=`mint-navigation-bar`,this._brand=document.createElement(`div`),this._brand.className=`mint-navigation-brand`,t?(t.removeAttribute(`slot`),this._brand.appendChild(t)):this.getBrand()&&(this._brandLink=document.createElement(`mint-link`),this._brandLink.className=`mint-navigation-brand-link`,this._brandLink.textContent=this.getBrand(),this._brandLink.setAttribute(`href`,this.getBrandHref()),this._brand.appendChild(this._brandLink)),this._toggle=document.createElement(`mint-button`),this._toggle.className=`mint-navigation-toggle`,this._toggle.setAttribute(`aria-expanded`,`false`),this._toggle.addEventListener(`click`,()=>this.toggleMenu()),this._toggleLabel=document.createElement(`span`),this._toggleLabel.className=`mint-navigation-visually-hidden`,this._toggleLabel.textContent=`Open navigation menu`,this._toggle.append(this._toggleLabel),this._toggle.setAttribute(`variant`,`ghost`),this._toggle.setAttribute(`tone`,`action`),this._toggle.setAttribute(`button-type`,`button`),this._toggle.setAttribute(`icon`,`menu`),this._mobileActions=document.createElement(`div`),this._mobileActions.className=`mint-navigation-mobile-actions`,a.append(this._brand,this._mobileActions,this._toggle);let o=document.createElement(`div`);this._content=o,o.className=`mint-navigation-content`,this._items=document.createElement(`nav`),this._items.className=`mint-navigation-items`,this._items.setAttribute(`aria-label`,this.getLabel()),this._items.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()});let s=0;for(let e of r)if(e.nodeType!==Node.ELEMENT_NODE)this._items.appendChild(e);else if(e.tagName===`DETAILS`){let t=this._createDropdown(e,s++);this._items.append(t.trigger,t.popover),this._registerDropdown(t.trigger,t.popover)}else{let t=this._toMintLink(e);if(this._items.appendChild(t),t.nodeType===Node.ELEMENT_NODE&&t.tagName===`MINT-POPOVER`){let e=t.getAttribute(`trigger-id`),n=Array.from(this._items.querySelectorAll(`mint-button`)).find(t=>t.id===e);this._registerDropdown(n,t)}}let c=document.createElement(`div`);this._actions=c,c.className=`mint-navigation-actions`;for(let e of n)e.removeAttribute(`slot`),c.appendChild(e);let l=document.createElement(`section`);l.className=`mint-navigation-submenu`,l.setAttribute(`aria-label`,`Navigation submenu`);let u=document.createElement(`div`);u.className=`mint-navigation-submenu-header`;let d=document.createElement(`mint-button`);d.className=`mint-navigation-submenu-back`,d.setAttribute(`variant`,`ghost`),d.setAttribute(`tone`,`action`),d.setAttribute(`button-type`,`button`),d.setAttribute(`icon`,`arrow-left`),d.setAttribute(`aria-label`,`Back to main navigation`),d.addEventListener(`click`,()=>this._closeSubmenu());let f=document.createElement(`h3`);f.className=`mint-navigation-submenu-title`,u.append(d,f);let p=document.createElement(`nav`);p.className=`mint-navigation-submenu-items`,p.addEventListener(`click`,e=>{e.target.closest(`a, mint-link`)&&this.closeMenu()}),l.append(u,p),this._submenu=l,this._submenuTitle=f,this._submenuItems=p;for(let e of this._dropdowns)p.append(...e.submenuItems);o.append(this._items,c,l),i.append(a,o),this.appendChild(i),this._built=!0,this._syncMobileActions()}_syncMobileActions(){if(!this._mobileActions||!this._actions)return;let e=this._isMobileLayout()?this._mobileActions:this._actions;for(let t of this._mobileActionNodes)e.appendChild(t)}_toMintLink(e){if(e.nodeType!==Node.ELEMENT_NODE||e.tagName!==`A`)return e;let t=document.createElement(`mint-link`);for(;e.firstChild;)t.appendChild(e.firstChild);for(let n of Array.from(e.attributes))n.name!==`slot`&&t.setAttribute(n.name,n.value);return t}_createDropdown(e,t){let n=e.querySelector(`:scope > summary`),r=document.createElement(`mint-button`),i=`mint-navigation-${this._instanceId}-dropdown-${t}`,a=`${i}-popover`;if(r.id=i,r.className=`mint-navigation-dropdown-trigger`,r.setAttribute(`aria-haspopup`,`dialog`),r.setAttribute(`aria-expanded`,`false`),r.setAttribute(`aria-controls`,a),n){for(;n.firstChild;)r.appendChild(n.firstChild);n.remove()}else r.textContent=e.getAttribute(`label`)||`More`;r.setAttribute(`variant`,`ghost`),r.setAttribute(`tone`,`action`),r.setAttribute(`button-type`,`button`),r.setAttribute(`icon-position`,`right`);let o=document.createElement(`mint-popover`);o.id=a,o.className=`mint-navigation-dropdown`,o.setAttribute(`trigger-id`,i),o.setAttribute(`direction`,`down`),o.setAttribute(`aria-label`,`${r.textContent.trim()} links`);for(let t of Array.from(e.childNodes))o.appendChild(this._toMintLink(t));return{trigger:r,popover:o,observer:null}}_registerDropdown(e,t){if(!e||!t)return;t.id||=`mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`,e.classList.add(`mint-navigation-dropdown-trigger`),e.setAttribute(`aria-haspopup`,`dialog`),e.setAttribute(`aria-expanded`,String(t.hasAttribute(`open`))),e.setAttribute(`aria-controls`,t.id),t.classList.add(`mint-navigation-dropdown`),t.hasAttribute(`role`)||t.setAttribute(`role`,`group`),t.hasAttribute(`aria-label`)||t.setAttribute(`aria-label`,`${e.textContent.trim()} links`);let n=Array.from(t.querySelectorAll(`mint-link`)).map(e=>e.cloneNode(!0)),r={trigger:e,popover:t,observer:null,triggerId:t.getAttribute(`trigger-id`)||e.id,submenuItems:n};e.addEventListener(`click`,()=>{this._isMobileLayout()&&this._openSubmenu(r)}),this._dropdowns.push(r)}_observeDropdowns(){for(let e of this._dropdowns)e.observer||(e.observer=new MutationObserver(()=>{e.trigger.setAttribute(`aria-expanded`,String(e.popover.hasAttribute(`open`)))}),e.observer.observe(e.popover,{attributes:!0,attributeFilter:[`open`]}))}_isMobileLayout(){return this.getBoundingClientRect().width<=640}_syncResponsiveDropdowns(){let e=this._isMobileLayout();for(let t of this._dropdowns)e?(t.popover.hasAttribute(`open`)&&t.popover.close(),t.popover.getAttribute(`trigger-id`)&&t.popover.setAttribute(`trigger-id`,``)):t.triggerId&&t.popover.getAttribute(`trigger-id`)!==t.triggerId&&t.popover.setAttribute(`trigger-id`,t.triggerId);!e&&this._activeDropdown&&this._closeSubmenu()}_openSubmenu(e){this._isMobileLayout()&&(this._activeDropdown&&this._activeDropdown!==e&&this._activeDropdown.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=e,e.trigger.setAttribute(`aria-expanded`,`true`),this._submenuTitle.textContent=e.trigger.textContent.trim(),this._submenuItems.replaceChildren(...e.submenuItems),this._content.setAttribute(`data-submenu-open`,``))}_closeSubmenu(){this._activeDropdown?.trigger.setAttribute(`aria-expanded`,`false`),this._activeDropdown=null,this._content?.removeAttribute(`data-submenu-open`)}_syncAttributes(){if(this._brandLink){this._brandLink.setAttribute(`href`,this.getBrandHref());let e=this._brandLink.querySelector(`a`);e?e.textContent=this.getBrand():this._brandLink.textContent=this.getBrand()}this._items&&this._items.setAttribute(`aria-label`,this.getLabel()),this._syncOpenState()}_syncOpenState(){if(!this._toggle)return;let e=this.hasAttribute(`open`);this._toggle.setAttribute(`aria-expanded`,String(e));let t=e?`Close navigation menu`:`Open navigation menu`;this._toggle.setAttribute(`aria-label`,t),this._toggleLabel&&(this._toggleLabel.textContent=t),this._toggle.setAttribute(`icon`,e?`close`:`menu`)}openMenu(){this.setAttribute(`open`,``)}closeMenu(){this._closeSubmenu(),this.removeAttribute(`open`)}toggleMenu(){this.hasAttribute(`open`)?this.closeMenu():this.openMenu()}};typeof customElements<`u`&&!customElements.get(`mint-navigation`)&&e.t(`mint-navigation`,n),module.exports=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, MintNavigation } from './Navigation'
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import '../../theme.css'
|
|
2
|
+
import '../../button.css'
|
|
3
|
+
import '../../spinner.css'
|
|
4
|
+
import '../../icon.css'
|
|
5
|
+
import '../../link.css'
|
|
6
|
+
import '../../popover.css'
|
|
7
|
+
import '../../stack.css'
|
|
8
|
+
import '../../navigation.css'
|
|
9
|
+
import "../chunks/icon-gQAtsERy.js";
|
|
10
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
11
|
+
import "../chunks/button-B0Yt0MX1.js";
|
|
12
|
+
import "../chunks/popover-gviDCspV.js";
|
|
13
|
+
import "../chunks/link-DKgtBYK6.js";
|
|
14
|
+
//#region src/components/navigation/Navigation.js
|
|
15
|
+
var t = 0, n = class extends HTMLElement {
|
|
16
|
+
static get observedAttributes() {
|
|
17
|
+
return [
|
|
18
|
+
"brand",
|
|
19
|
+
"brand-href",
|
|
20
|
+
"direction",
|
|
21
|
+
"label",
|
|
22
|
+
"open"
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
constructor() {
|
|
26
|
+
super(), this._built = !1, this._brand = null, this._brandLink = null, this._items = null, this._toggle = null, this._toggleLabel = null, this._mobileActions = null, this._mobileActionNodes = [], this._instanceId = ++t, this._dropdowns = [], this._content = null, this._actions = null, this._activeDropdown = null, this._layoutObserver = null;
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this._built || this._build(), this._observeDropdowns(), this._syncResponsiveDropdowns(), this._syncMobileActions(), typeof ResizeObserver < "u" && (this._layoutObserver = new ResizeObserver(() => {
|
|
30
|
+
this._syncResponsiveDropdowns(), this._syncMobileActions();
|
|
31
|
+
}), this._layoutObserver.observe(this)), this._syncAttributes();
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
for (let e of this._dropdowns) e.observer?.disconnect();
|
|
35
|
+
this._layoutObserver?.disconnect(), this._layoutObserver = null;
|
|
36
|
+
}
|
|
37
|
+
attributeChangedCallback(e, t, n) {
|
|
38
|
+
t === n || !this._built || (e === "open" ? this._syncOpenState() : this._syncAttributes());
|
|
39
|
+
}
|
|
40
|
+
getDirection() {
|
|
41
|
+
return this.getAttribute("direction") === "vertical" ? "vertical" : "horizontal";
|
|
42
|
+
}
|
|
43
|
+
getBrand() {
|
|
44
|
+
return this.getAttribute("brand") || "";
|
|
45
|
+
}
|
|
46
|
+
getBrandHref() {
|
|
47
|
+
return this.getAttribute("brand-href") || "/";
|
|
48
|
+
}
|
|
49
|
+
getLabel() {
|
|
50
|
+
return this.getAttribute("label") || "Primary navigation";
|
|
51
|
+
}
|
|
52
|
+
_build() {
|
|
53
|
+
let e = Array.from(this.childNodes), t = e.find((e) => e.nodeType === Node.ELEMENT_NODE && e.getAttribute("slot") === "brand"), n = e.filter((e) => e.nodeType === Node.ELEMENT_NODE && ["actions", "mobile-actions"].includes(e.getAttribute("slot")));
|
|
54
|
+
this._mobileActionNodes = n.filter((e) => e.getAttribute("slot") === "mobile-actions");
|
|
55
|
+
let r = e.filter((e) => e !== t && !n.includes(e));
|
|
56
|
+
this.replaceChildren();
|
|
57
|
+
let i = document.createElement("div");
|
|
58
|
+
i.className = "mint-navigation-shell";
|
|
59
|
+
let a = document.createElement("div");
|
|
60
|
+
a.className = "mint-navigation-bar", this._brand = document.createElement("div"), this._brand.className = "mint-navigation-brand", t ? (t.removeAttribute("slot"), this._brand.appendChild(t)) : this.getBrand() && (this._brandLink = document.createElement("mint-link"), this._brandLink.className = "mint-navigation-brand-link", this._brandLink.textContent = this.getBrand(), this._brandLink.setAttribute("href", this.getBrandHref()), this._brand.appendChild(this._brandLink)), this._toggle = document.createElement("mint-button"), this._toggle.className = "mint-navigation-toggle", this._toggle.setAttribute("aria-expanded", "false"), this._toggle.addEventListener("click", () => this.toggleMenu()), this._toggleLabel = document.createElement("span"), this._toggleLabel.className = "mint-navigation-visually-hidden", this._toggleLabel.textContent = "Open navigation menu", this._toggle.append(this._toggleLabel), this._toggle.setAttribute("variant", "ghost"), this._toggle.setAttribute("tone", "action"), this._toggle.setAttribute("button-type", "button"), this._toggle.setAttribute("icon", "menu"), this._mobileActions = document.createElement("div"), this._mobileActions.className = "mint-navigation-mobile-actions", a.append(this._brand, this._mobileActions, this._toggle);
|
|
61
|
+
let o = document.createElement("div");
|
|
62
|
+
this._content = o, o.className = "mint-navigation-content", this._items = document.createElement("nav"), this._items.className = "mint-navigation-items", this._items.setAttribute("aria-label", this.getLabel()), this._items.addEventListener("click", (e) => {
|
|
63
|
+
e.target.closest("a, mint-link") && this.closeMenu();
|
|
64
|
+
});
|
|
65
|
+
let s = 0;
|
|
66
|
+
for (let e of r) if (e.nodeType !== Node.ELEMENT_NODE) this._items.appendChild(e);
|
|
67
|
+
else if (e.tagName === "DETAILS") {
|
|
68
|
+
let t = this._createDropdown(e, s++);
|
|
69
|
+
this._items.append(t.trigger, t.popover), this._registerDropdown(t.trigger, t.popover);
|
|
70
|
+
} else {
|
|
71
|
+
let t = this._toMintLink(e);
|
|
72
|
+
if (this._items.appendChild(t), t.nodeType === Node.ELEMENT_NODE && t.tagName === "MINT-POPOVER") {
|
|
73
|
+
let e = t.getAttribute("trigger-id"), n = Array.from(this._items.querySelectorAll("mint-button")).find((t) => t.id === e);
|
|
74
|
+
this._registerDropdown(n, t);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
let c = document.createElement("div");
|
|
78
|
+
this._actions = c, c.className = "mint-navigation-actions";
|
|
79
|
+
for (let e of n) e.removeAttribute("slot"), c.appendChild(e);
|
|
80
|
+
let l = document.createElement("section");
|
|
81
|
+
l.className = "mint-navigation-submenu", l.setAttribute("aria-label", "Navigation submenu");
|
|
82
|
+
let u = document.createElement("div");
|
|
83
|
+
u.className = "mint-navigation-submenu-header";
|
|
84
|
+
let d = document.createElement("mint-button");
|
|
85
|
+
d.className = "mint-navigation-submenu-back", d.setAttribute("variant", "ghost"), d.setAttribute("tone", "action"), d.setAttribute("button-type", "button"), d.setAttribute("icon", "arrow-left"), d.setAttribute("aria-label", "Back to main navigation"), d.addEventListener("click", () => this._closeSubmenu());
|
|
86
|
+
let f = document.createElement("h3");
|
|
87
|
+
f.className = "mint-navigation-submenu-title", u.append(d, f);
|
|
88
|
+
let p = document.createElement("nav");
|
|
89
|
+
p.className = "mint-navigation-submenu-items", p.addEventListener("click", (e) => {
|
|
90
|
+
e.target.closest("a, mint-link") && this.closeMenu();
|
|
91
|
+
}), l.append(u, p), this._submenu = l, this._submenuTitle = f, this._submenuItems = p;
|
|
92
|
+
for (let e of this._dropdowns) p.append(...e.submenuItems);
|
|
93
|
+
o.append(this._items, c, l), i.append(a, o), this.appendChild(i), this._built = !0, this._syncMobileActions();
|
|
94
|
+
}
|
|
95
|
+
_syncMobileActions() {
|
|
96
|
+
if (!this._mobileActions || !this._actions) return;
|
|
97
|
+
let e = this._isMobileLayout() ? this._mobileActions : this._actions;
|
|
98
|
+
for (let t of this._mobileActionNodes) e.appendChild(t);
|
|
99
|
+
}
|
|
100
|
+
_toMintLink(e) {
|
|
101
|
+
if (e.nodeType !== Node.ELEMENT_NODE || e.tagName !== "A") return e;
|
|
102
|
+
let t = document.createElement("mint-link");
|
|
103
|
+
for (; e.firstChild;) t.appendChild(e.firstChild);
|
|
104
|
+
for (let n of Array.from(e.attributes)) n.name !== "slot" && t.setAttribute(n.name, n.value);
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
_createDropdown(e, t) {
|
|
108
|
+
let n = e.querySelector(":scope > summary"), r = document.createElement("mint-button"), i = `mint-navigation-${this._instanceId}-dropdown-${t}`, a = `${i}-popover`;
|
|
109
|
+
if (r.id = i, r.className = "mint-navigation-dropdown-trigger", r.setAttribute("aria-haspopup", "dialog"), r.setAttribute("aria-expanded", "false"), r.setAttribute("aria-controls", a), n) {
|
|
110
|
+
for (; n.firstChild;) r.appendChild(n.firstChild);
|
|
111
|
+
n.remove();
|
|
112
|
+
} else r.textContent = e.getAttribute("label") || "More";
|
|
113
|
+
r.setAttribute("variant", "ghost"), r.setAttribute("tone", "action"), r.setAttribute("button-type", "button"), r.setAttribute("icon-position", "right");
|
|
114
|
+
let o = document.createElement("mint-popover");
|
|
115
|
+
o.id = a, o.className = "mint-navigation-dropdown", o.setAttribute("trigger-id", i), o.setAttribute("direction", "down"), o.setAttribute("aria-label", `${r.textContent.trim()} links`);
|
|
116
|
+
for (let t of Array.from(e.childNodes)) o.appendChild(this._toMintLink(t));
|
|
117
|
+
return {
|
|
118
|
+
trigger: r,
|
|
119
|
+
popover: o,
|
|
120
|
+
observer: null
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
_registerDropdown(e, t) {
|
|
124
|
+
if (!e || !t) return;
|
|
125
|
+
t.id ||= `mint-navigation-${this._instanceId}-popover-${this._dropdowns.length}`, e.classList.add("mint-navigation-dropdown-trigger"), e.setAttribute("aria-haspopup", "dialog"), e.setAttribute("aria-expanded", String(t.hasAttribute("open"))), e.setAttribute("aria-controls", t.id), t.classList.add("mint-navigation-dropdown"), t.hasAttribute("role") || t.setAttribute("role", "group"), t.hasAttribute("aria-label") || t.setAttribute("aria-label", `${e.textContent.trim()} links`);
|
|
126
|
+
let n = Array.from(t.querySelectorAll("mint-link")).map((e) => e.cloneNode(!0)), r = {
|
|
127
|
+
trigger: e,
|
|
128
|
+
popover: t,
|
|
129
|
+
observer: null,
|
|
130
|
+
triggerId: t.getAttribute("trigger-id") || e.id,
|
|
131
|
+
submenuItems: n
|
|
132
|
+
};
|
|
133
|
+
e.addEventListener("click", () => {
|
|
134
|
+
this._isMobileLayout() && this._openSubmenu(r);
|
|
135
|
+
}), this._dropdowns.push(r);
|
|
136
|
+
}
|
|
137
|
+
_observeDropdowns() {
|
|
138
|
+
for (let e of this._dropdowns) e.observer || (e.observer = new MutationObserver(() => {
|
|
139
|
+
e.trigger.setAttribute("aria-expanded", String(e.popover.hasAttribute("open")));
|
|
140
|
+
}), e.observer.observe(e.popover, {
|
|
141
|
+
attributes: !0,
|
|
142
|
+
attributeFilter: ["open"]
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
_isMobileLayout() {
|
|
146
|
+
return this.getBoundingClientRect().width <= 640;
|
|
147
|
+
}
|
|
148
|
+
_syncResponsiveDropdowns() {
|
|
149
|
+
let e = this._isMobileLayout();
|
|
150
|
+
for (let t of this._dropdowns) e ? (t.popover.hasAttribute("open") && t.popover.close(), t.popover.getAttribute("trigger-id") && t.popover.setAttribute("trigger-id", "")) : t.triggerId && t.popover.getAttribute("trigger-id") !== t.triggerId && t.popover.setAttribute("trigger-id", t.triggerId);
|
|
151
|
+
!e && this._activeDropdown && this._closeSubmenu();
|
|
152
|
+
}
|
|
153
|
+
_openSubmenu(e) {
|
|
154
|
+
this._isMobileLayout() && (this._activeDropdown && this._activeDropdown !== e && this._activeDropdown.trigger.setAttribute("aria-expanded", "false"), this._activeDropdown = e, e.trigger.setAttribute("aria-expanded", "true"), this._submenuTitle.textContent = e.trigger.textContent.trim(), this._submenuItems.replaceChildren(...e.submenuItems), this._content.setAttribute("data-submenu-open", ""));
|
|
155
|
+
}
|
|
156
|
+
_closeSubmenu() {
|
|
157
|
+
this._activeDropdown?.trigger.setAttribute("aria-expanded", "false"), this._activeDropdown = null, this._content?.removeAttribute("data-submenu-open");
|
|
158
|
+
}
|
|
159
|
+
_syncAttributes() {
|
|
160
|
+
if (this._brandLink) {
|
|
161
|
+
this._brandLink.setAttribute("href", this.getBrandHref());
|
|
162
|
+
let e = this._brandLink.querySelector("a");
|
|
163
|
+
e ? e.textContent = this.getBrand() : this._brandLink.textContent = this.getBrand();
|
|
164
|
+
}
|
|
165
|
+
this._items && this._items.setAttribute("aria-label", this.getLabel()), this._syncOpenState();
|
|
166
|
+
}
|
|
167
|
+
_syncOpenState() {
|
|
168
|
+
if (!this._toggle) return;
|
|
169
|
+
let e = this.hasAttribute("open");
|
|
170
|
+
this._toggle.setAttribute("aria-expanded", String(e));
|
|
171
|
+
let t = e ? "Close navigation menu" : "Open navigation menu";
|
|
172
|
+
this._toggle.setAttribute("aria-label", t), this._toggleLabel && (this._toggleLabel.textContent = t), this._toggle.setAttribute("icon", e ? "close" : "menu");
|
|
173
|
+
}
|
|
174
|
+
openMenu() {
|
|
175
|
+
this.setAttribute("open", "");
|
|
176
|
+
}
|
|
177
|
+
closeMenu() {
|
|
178
|
+
this._closeSubmenu(), this.removeAttribute("open");
|
|
179
|
+
}
|
|
180
|
+
toggleMenu() {
|
|
181
|
+
this.hasAttribute("open") ? this.closeMenu() : this.openMenu();
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
typeof customElements < "u" && !customElements.get("mint-navigation") && e("mint-navigation", n);
|
|
185
|
+
//#endregion
|
|
186
|
+
export { n as default };
|
|
@@ -1,46 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import '../icon/index';
|
|
3
|
-
import '../icon/icons/close';
|
|
4
|
-
import '../text/index';
|
|
5
|
-
import '../stack/index';
|
|
6
|
-
type OffCanvasPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
-
declare class MintOffCanvas extends HTMLElement {
|
|
8
|
-
static get observedAttributes(): string[];
|
|
9
|
-
private _overlay;
|
|
10
|
-
private _offCanvas;
|
|
11
|
-
private _header;
|
|
12
|
-
private _headingSlot;
|
|
13
|
-
private _bodySlot;
|
|
14
|
-
private _actionsSlot;
|
|
15
|
-
private _closeButton;
|
|
16
|
-
private _darkModeObserver;
|
|
17
|
-
private _contentObserver;
|
|
18
|
-
private _renderFrame;
|
|
19
|
-
constructor();
|
|
20
|
-
connectedCallback(): void;
|
|
21
|
-
disconnectedCallback(): void;
|
|
22
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
23
|
-
private _scheduleRender;
|
|
24
|
-
getId(): string;
|
|
25
|
-
getHeading(): string;
|
|
26
|
-
getPosition(): OffCanvasPosition;
|
|
27
|
-
isFullPage(): boolean;
|
|
28
|
-
getWidth(): string;
|
|
29
|
-
getHeight(): string;
|
|
30
|
-
private _normalizeCssValue;
|
|
31
|
-
isOpen(): boolean;
|
|
32
|
-
open(): void;
|
|
33
|
-
close(): void;
|
|
34
|
-
render(): void;
|
|
35
|
-
private _getPositionClasses;
|
|
36
|
-
private _getTransformValue;
|
|
37
|
-
private _updateBackgroundColor;
|
|
38
|
-
private _observeDarkMode;
|
|
39
|
-
private _observeContentMutations;
|
|
40
|
-
private _animateEnter;
|
|
41
|
-
private _animateExit;
|
|
42
|
-
private _ensureWidthStyle;
|
|
43
|
-
private _ensureHeightStyle;
|
|
44
|
-
}
|
|
45
|
-
export default MintOffCanvas;
|
|
46
|
-
//# sourceMappingURL=OffCanvas.d.ts.map
|
|
1
|
+
export { MintOffCanvas as default, MintOffCanvas } from '../../mintui-elements'
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "OffCanvas.d.ts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"OffCanvas.d.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA"
|
|
10
|
+
}
|