solid-baseui 0.1.0-alpha.0 → 0.1.0-alpha.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/CHANGELOG.md +30 -0
- package/README.md +95 -8
- package/dist/lib/client/DialogHandle-BGyIbcvg.js +521 -0
- package/dist/lib/client/DialogPopup-Df7MC358.js +138 -0
- package/dist/lib/client/FieldControl-C0PATyKV.js +142 -0
- package/dist/lib/client/{FocusManager-grSdNHqW.js → FocusManager-NP1uPXTi.js} +5 -5
- package/dist/lib/client/{FormContext-BB05lWOI.js → FormContext-CwLBtm_d.js} +1 -0
- package/dist/lib/client/{LabelableContext-DKsB0fIx.js → LabelableContext-CmQF-TX2.js} +3 -6
- package/dist/lib/client/MenuSubmenuTrigger-yfncqM-D.js +1584 -0
- package/dist/lib/client/{PopupHandle-CcJG4NMy.js → PopupHandle-CQI6Om1Z.js} +1 -1
- package/dist/lib/client/{PopupStore-DjB-wO88.js → PopupStore-Du0O57fL.js} +118 -98
- package/dist/lib/client/{PopupViewport-DgrIqQea.js → PopupViewport-IS4XU03s.js} +2 -2
- package/dist/lib/client/Separator-D5oJzlA3.js +27 -0
- package/dist/lib/client/TriggerFocusGuards-Cs8LVBj5.js +51 -0
- package/dist/lib/client/accordion/index.js +1 -1
- package/dist/lib/client/accordion-BFeZFpJZ.js +381 -0
- package/dist/lib/client/alert-dialog/index.js +1 -1
- package/dist/lib/client/{alert-dialog-BH_3ndio.js → alert-dialog-BxGUF8_Q.js} +2 -2
- package/dist/lib/client/autocomplete/index.js +1 -1
- package/dist/lib/client/{autocomplete-Cob_FZEP.js → autocomplete-C9QA98XD.js} +30 -25
- package/dist/lib/client/avatar/index.js +1 -1
- package/dist/lib/client/avatar-BQoEzzav.js +191 -0
- package/dist/lib/client/button/index.js +1 -1
- package/dist/lib/client/button-akYS6FyY.js +88 -0
- package/dist/lib/client/checkbox/index.js +1 -1
- package/dist/lib/client/checkbox-DOXtzBhA.js +425 -0
- package/dist/lib/client/checkbox-group/index.js +1 -1
- package/dist/lib/client/checkbox-group-CwMDoSTK.js +135 -0
- package/dist/lib/client/collapsible/index.js +1 -1
- package/dist/lib/client/collapsible-t8YReaIp.js +230 -0
- package/dist/lib/client/combobox/index.js +2 -2
- package/dist/lib/client/combobox-6DhOdzit.js +399 -0
- package/dist/lib/client/{constants-BYjBUIIi.js → constants-cOVxAoxB.js} +5 -1
- package/dist/lib/client/context-menu/index.js +1 -1
- package/dist/lib/client/context-menu-CplDpqmi.js +220 -0
- package/dist/lib/client/{createAnchorPositioning-DcxDXUgB.js → createAnchorPositioning-D96gu-Dz.js} +148 -145
- package/dist/lib/client/{createCollapsiblePanel-DeDu0O2t.js → createCollapsiblePanel-BQ8r4RTi.js} +1 -1
- package/dist/lib/client/createFocusInteraction--s9_qBf3.js +60 -0
- package/dist/lib/client/createLabelableId-DxJRwMUJ.js +14 -0
- package/dist/lib/client/{createPopupAutoResize-CGNiLhGq.js → createPopupAutoResize-Dn-stj-8.js} +1 -1
- package/dist/lib/client/{createTransitionStatus-B1L-whed.js → createTransitionStatus-BL_cPSEA.js} +12 -12
- package/dist/lib/client/dialog/index.js +1 -1
- package/dist/lib/client/{dialog-DkaQwIgP.js → dialog-B9tR9X48.js} +2 -2
- package/dist/lib/client/drawer/index.js +1 -1
- package/dist/lib/client/drawer-dyr3_sKQ.js +1539 -0
- package/dist/lib/client/field/index.js +1 -1
- package/dist/lib/client/field-CjUAjp1m.js +483 -0
- package/dist/lib/client/fieldset/index.js +1 -1
- package/dist/lib/client/fieldset-Byqk3noT.js +70 -0
- package/dist/lib/client/form/index.js +1 -1
- package/dist/lib/client/form-6Ne_bWQX.js +109 -0
- package/dist/lib/client/index.js +44 -42
- package/dist/lib/client/input/index.js +1 -1
- package/dist/lib/client/{input-gb0ejxkm.js → input-_QHvSSqM.js} +1 -1
- package/dist/lib/client/internals/form-context/index.js +1 -1
- package/dist/lib/client/internals/labelable-provider/index.js +1 -1
- package/dist/lib/client/menu/index.js +1 -1
- package/dist/lib/client/menu-DLqUBmMK.js +334 -0
- package/dist/lib/client/menubar/index.js +1 -1
- package/dist/lib/client/menubar-DhPRUQZ6.js +163 -0
- package/dist/lib/client/{mergeStyleValue-C4ITiiIV.js → mergeStyleValue-DhTA9Nwe.js} +7 -3
- package/dist/lib/client/meter/index.js +1 -1
- package/dist/lib/client/meter-BvWdppcx.js +178 -0
- package/dist/lib/client/navigation-menu/index.js +1 -1
- package/dist/lib/client/navigation-menu-mVHV41Ky.js +1070 -0
- package/dist/lib/client/number-field/index.js +1 -1
- package/dist/lib/client/number-field-DusLw_0X.js +1043 -0
- package/dist/lib/client/otp-field/index.js +1 -1
- package/dist/lib/client/otp-field-D-B9tZzF.js +584 -0
- package/dist/lib/client/popover/index.js +1 -1
- package/dist/lib/client/popover-Cv7xn0nW.js +938 -0
- package/dist/lib/client/popupStateMapping-C6jQ_LKo.js +371 -0
- package/dist/lib/client/preview-card/index.js +1 -1
- package/dist/lib/client/preview-card-FTN_aafM.js +632 -0
- package/dist/lib/client/progress/index.js +1 -1
- package/dist/lib/client/progress-AVKxvgpc.js +195 -0
- package/dist/lib/client/radio/index.js +1 -1
- package/dist/lib/client/radio-DA_oZhQT.js +284 -0
- package/dist/lib/client/radio-group/index.js +1 -1
- package/dist/lib/client/radio-group-CWtQxWDl.js +195 -0
- package/dist/lib/client/runOnceAnimationsFinish-CFADb4CN.js +49 -0
- package/dist/lib/client/{safePolygon--bbKn0c8.js → safePolygon-DJG0VIVo.js} +4 -0
- package/dist/lib/client/scroll-area/index.js +1 -1
- package/dist/lib/client/scroll-area-NCr49LkD.js +717 -0
- package/dist/lib/client/select/index.js +1 -1
- package/dist/lib/client/select-DSPJt7Rk.js +1933 -0
- package/dist/lib/client/separator/index.js +1 -1
- package/dist/lib/client/slider/index.js +1 -1
- package/dist/lib/client/slider-CWq9hxFf.js +927 -0
- package/dist/lib/client/switch/index.js +1 -1
- package/dist/lib/client/switch-CPl7QHKI.js +306 -0
- package/dist/lib/client/tabs/index.js +1 -1
- package/dist/lib/client/tabs-Bn4rZDyZ.js +692 -0
- package/dist/lib/client/toast/index.js +1 -1
- package/dist/lib/client/toast-7LdqZWOs.js +1118 -0
- package/dist/lib/client/toggle/index.js +1 -1
- package/dist/lib/client/toggle-CsC37e3e.js +142 -0
- package/dist/lib/client/toggle-group/index.js +1 -1
- package/dist/lib/client/toggle-group-DSWb9HxN.js +134 -0
- package/dist/lib/client/toolbar/index.js +1 -1
- package/dist/lib/client/toolbar-DcCi3HNp.js +504 -0
- package/dist/lib/client/tooltip/index.js +1 -1
- package/dist/lib/client/tooltip-D-PkGco9.js +849 -0
- package/dist/lib/client/use-render/index.js +2 -0
- package/dist/lib/client/useFilteredItems-B7z2CGMV.js +2270 -0
- package/dist/lib/client/useRender-CxZ8PI-g.js +12 -0
- package/dist/lib/server/{DialogHandle-ATZlm9RC.js → DialogHandle-nJSSy_jM.js} +24 -33
- package/dist/lib/server/{DialogPopup-BebI-w5P.js → DialogPopup-Da1aIxVA.js} +10 -13
- package/dist/lib/server/{FieldControl-Y_kI7ARp.js → FieldControl-BDeNR3ug.js} +56 -20
- package/dist/lib/server/{FocusManager-BrbZVWME.js → FocusManager-1LfoCsya.js} +1 -3
- package/dist/lib/server/{FormContext-pvESt85v.js → FormContext-CYwo_ZnB.js} +1 -0
- package/dist/lib/server/{LabelableContext-DZP3rgAY.js → LabelableContext-BTeF0IWb.js} +4 -6
- package/dist/lib/server/{MenuSubmenuTrigger-DA4gsv6z.js → MenuSubmenuTrigger-rR8ZN7YR.js} +133 -166
- package/dist/lib/server/{PopupHandle-DthPgNjy.js → PopupHandle-Ct6wywmP.js} +1 -1
- package/dist/lib/server/{PopupStore-DEs3FAEe.js → PopupStore-kHjFPiQ5.js} +38 -14
- package/dist/lib/server/{PopupViewport-3r_KTFwX.js → PopupViewport-DftN5VUp.js} +2 -2
- package/dist/lib/server/{Separator-vhhYxWGr.js → Separator-DTvtnxzP.js} +4 -6
- package/dist/lib/server/TriggerFocusGuards-CvoGfft9.js +61 -0
- package/dist/lib/server/accordion/index.js +32 -70
- package/dist/lib/server/alert-dialog/index.js +2 -2
- package/dist/lib/server/autocomplete/index.js +14 -5
- package/dist/lib/server/avatar/index.js +90 -51
- package/dist/lib/server/button/index.js +8 -9
- package/dist/lib/server/checkbox/index.js +30 -57
- package/dist/lib/server/checkbox-group/index.js +20 -10
- package/dist/lib/server/collapsible/index.js +36 -43
- package/dist/lib/server/combobox/index.js +64 -35
- package/dist/lib/server/{constants-9H__9xbS.js → constants-D7ciIzsV.js} +8 -3
- package/dist/lib/server/context-menu/index.js +7 -9
- package/dist/lib/server/{createAnchorPositioning-C-cVOPwz.js → createAnchorPositioning-B5Y0WEev.js} +11 -6
- package/dist/lib/server/{createCollapsiblePanel-DTyVJz0G.js → createCollapsiblePanel-B45kTe6v.js} +1 -1
- package/dist/lib/server/{createFocusInteraction-EIS0QOel.js → createFocusInteraction-DMyKsniI.js} +22 -2
- package/dist/lib/server/createLabelableId-WMUKtY6s.js +18 -0
- package/dist/lib/server/{createPopupAutoResize-DO50jjNX.js → createPopupAutoResize-ImBjwdj_.js} +1 -1
- package/dist/lib/server/{createTransitionStatus-BTlrerSS.js → createTransitionStatus-184v7j3-.js} +2 -2
- package/dist/lib/server/dialog/index.js +2 -2
- package/dist/lib/server/drawer/index.js +63 -71
- package/dist/lib/server/field/index.js +105 -93
- package/dist/lib/server/fieldset/index.js +13 -16
- package/dist/lib/server/form/index.js +16 -12
- package/dist/lib/server/index.js +5 -3
- package/dist/lib/server/input/index.js +1 -1
- package/dist/lib/server/internals/form-context/index.js +1 -1
- package/dist/lib/server/internals/labelable-provider/index.js +1 -1
- package/dist/lib/server/menu/index.js +21 -20
- package/dist/lib/server/menubar/index.js +6 -31
- package/dist/lib/server/{mergeStyleValue-Db8bRCM4.js → mergeStyleValue-BwJ10_X2.js} +6 -1
- package/dist/lib/server/meter/index.js +20 -32
- package/dist/lib/server/navigation-menu/index.js +53 -124
- package/dist/lib/server/number-field/index.js +44 -42
- package/dist/lib/server/otp-field/index.js +11 -14
- package/dist/lib/server/popover/index.js +42 -59
- package/dist/lib/server/{popupStateMapping-nKoUwoke.js → popupStateMapping-B2KsiiLb.js} +18 -16
- package/dist/lib/server/preview-card/index.js +30 -41
- package/dist/lib/server/progress/index.js +21 -33
- package/dist/lib/server/radio/index.js +18 -39
- package/dist/lib/server/radio-group/index.js +7 -8
- package/dist/lib/server/{runOnceAnimationsFinish-DCHzXWZU.js → runOnceAnimationsFinish-CYq38H8J.js} +2 -1
- package/dist/lib/server/{safePolygon-CAm5RJGv.js → safePolygon-C1GNJbKR.js} +5 -0
- package/dist/lib/server/scroll-area/index.js +23 -32
- package/dist/lib/server/select/index.js +95 -181
- package/dist/lib/server/separator/index.js +1 -1
- package/dist/lib/server/slider/index.js +25 -38
- package/dist/lib/server/switch/index.js +13 -23
- package/dist/lib/server/tabs/index.js +185 -129
- package/dist/lib/server/toast/index.js +49 -66
- package/dist/lib/server/toggle/index.js +4 -6
- package/dist/lib/server/toggle-group/index.js +9 -7
- package/dist/lib/server/toolbar/index.js +62 -79
- package/dist/lib/server/tooltip/index.js +28 -37
- package/dist/lib/server/use-render/index.js +2 -0
- package/dist/lib/server/{useFilteredItems-DvuctLt3.js → useFilteredItems-DCxq20Is.js} +164 -189
- package/dist/lib/server/useRender-CryVdCjs.js +16 -0
- package/dist/lib/types/accordion/header/AccordionHeader.d.ts +1 -1
- package/dist/lib/types/accordion/item/AccordionItem.d.ts +1 -1
- package/dist/lib/types/accordion/panel/AccordionPanel.d.ts +1 -1
- package/dist/lib/types/accordion/root/AccordionRoot.d.ts +2 -7
- package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/dist/lib/types/alert-dialog/trigger/AlertDialogTrigger.d.ts +1 -2
- package/dist/lib/types/autocomplete/trigger/AutocompleteTrigger.d.ts +1 -0
- package/dist/lib/types/avatar/fallback/AvatarFallback.d.ts +2 -2
- package/dist/lib/types/avatar/image/AvatarImage.d.ts +9 -3
- package/dist/lib/types/avatar/image/createImageLoadingStatus.d.ts +3 -2
- package/dist/lib/types/avatar/root/AvatarRoot.d.ts +1 -1
- package/dist/lib/types/button/Button.d.ts +1 -1
- package/dist/lib/types/checkbox-group/CheckboxGroupContext.d.ts +4 -1
- package/dist/lib/types/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/dist/lib/types/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/dist/lib/types/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/dist/lib/types/combobox/index.d.ts +2 -0
- package/dist/lib/types/combobox/index.parts.d.ts +1 -0
- package/dist/lib/types/combobox/items/createItems.d.ts +42 -0
- package/dist/lib/types/combobox/root/AriaCombobox.d.ts +4 -0
- package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +12 -8
- package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +2 -0
- package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +1 -0
- package/dist/lib/types/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dist/lib/types/dialog/description/DialogDescription.d.ts +1 -1
- package/dist/lib/types/dialog/title/DialogTitle.d.ts +1 -1
- package/dist/lib/types/dialog/viewport/DialogViewport.d.ts +1 -1
- package/dist/lib/types/drawer/backdrop/DrawerBackdrop.d.ts +1 -1
- package/dist/lib/types/drawer/content/DrawerContent.d.ts +1 -1
- package/dist/lib/types/drawer/indent/DrawerIndent.d.ts +1 -1
- package/dist/lib/types/drawer/indent-background/DrawerIndentBackground.d.ts +1 -1
- package/dist/lib/types/field/root/FieldRoot.d.ts +1 -1
- package/dist/lib/types/field/root/createFieldValidation.d.ts +3 -2
- package/dist/lib/types/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/dist/lib/types/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/internals/createTransitionStatus.d.ts +1 -1
- package/dist/lib/types/internals/form-context/FormContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/LabelableContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/createLabelableId.d.ts +3 -0
- package/dist/lib/types/internals/overlay/PopupPortal.d.ts +4 -2
- package/dist/lib/types/internals/overlay/createPopupPresence.d.ts +1 -0
- package/dist/lib/types/menu/root/MenuRootContext.d.ts +1 -0
- package/dist/lib/types/meter/indicator/MeterIndicator.d.ts +1 -1
- package/dist/lib/types/meter/label/MeterLabel.d.ts +1 -1
- package/dist/lib/types/meter/root/MeterRoot.d.ts +1 -1
- package/dist/lib/types/meter/track/MeterTrack.d.ts +1 -1
- package/dist/lib/types/meter/value/MeterValue.d.ts +1 -1
- package/dist/lib/types/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -0
- package/dist/lib/types/number-field/root/NumberFieldRootContext.d.ts +1 -0
- package/dist/lib/types/popover/arrow/PopoverArrow.d.ts +1 -1
- package/dist/lib/types/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/dist/lib/types/popover/description/PopoverDescription.d.ts +1 -1
- package/dist/lib/types/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/dist/lib/types/popover/title/PopoverTitle.d.ts +1 -1
- package/dist/lib/types/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/dist/lib/types/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/dist/lib/types/preview-card/positioner/PreviewCardPositioner.d.ts +1 -1
- package/dist/lib/types/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/dist/lib/types/progress/label/ProgressLabel.d.ts +1 -1
- package/dist/lib/types/progress/root/ProgressRoot.d.ts +1 -1
- package/dist/lib/types/progress/track/ProgressTrack.d.ts +1 -1
- package/dist/lib/types/progress/value/ProgressValue.d.ts +1 -1
- package/dist/lib/types/radio/indicator/RadioIndicator.d.ts +2 -2
- package/dist/lib/types/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/dist/lib/types/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/dist/lib/types/scroll-area/root/ScrollAreaRoot.d.ts +1 -1
- package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -1
- package/dist/lib/types/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/dist/lib/types/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/dist/lib/types/separator/Separator.d.ts +1 -1
- package/dist/lib/types/tabs/indicator/prehydrationScript.d.ts +1 -1
- package/dist/lib/types/tabs/list/TabsList.d.ts +1 -1
- package/dist/lib/types/tabs/panel/TabsPanel.d.ts +1 -1
- package/dist/lib/types/tabs/root/TabsRoot.d.ts +1 -1
- package/dist/lib/types/tabs/tab/TabsTab.d.ts +1 -1
- package/dist/lib/types/toast/createToastManager.d.ts +2 -2
- package/dist/lib/types/toast/store/ToastStore.d.ts +1 -1
- package/dist/lib/types/toast/useToastManager.d.ts +1 -1
- package/dist/lib/types/toggle/Toggle.d.ts +1 -1
- package/dist/lib/types/toggle-group/ToggleGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +1 -1
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/dist/lib/types/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/dist/lib/types/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/dist/lib/types/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/dist/lib/types/types/index.d.ts +7 -3
- package/dist/lib/types/use-render/index.d.ts +2 -0
- package/dist/lib/types/use-render/useRender.d.ts +10 -0
- package/package.json +24 -11
- package/dist/lib/client/DialogHandle-DrN2YWCv.js +0 -518
- package/dist/lib/client/DialogPopup-ZlqmGfdk.js +0 -136
- package/dist/lib/client/FieldControl-Bc-z2og6.js +0 -116
- package/dist/lib/client/MenuSubmenuTrigger-QZkQ0F2v.js +0 -1570
- package/dist/lib/client/Separator-9DboD_Si.js +0 -25
- package/dist/lib/client/TriggerFocusGuards-CQ-JuASy.js +0 -56
- package/dist/lib/client/accordion-sOXt9AlG.js +0 -399
- package/dist/lib/client/avatar-AF9vyD4q.js +0 -146
- package/dist/lib/client/button-DpUi-2g8.js +0 -82
- package/dist/lib/client/checkbox-BbAwOptH.js +0 -441
- package/dist/lib/client/checkbox-group-CSSp_805.js +0 -128
- package/dist/lib/client/collapsible-BIbje_ub.js +0 -232
- package/dist/lib/client/combobox-8O-vgTLL.js +0 -352
- package/dist/lib/client/context-menu-BTMkXtrs.js +0 -217
- package/dist/lib/client/createFocusInteraction-D4w1-235.js +0 -50
- package/dist/lib/client/drawer-Ce2cChLt.js +0 -1550
- package/dist/lib/client/field-C-o7jzKW.js +0 -469
- package/dist/lib/client/fieldset-BQTAWv2L.js +0 -65
- package/dist/lib/client/form-BINBiW5L.js +0 -106
- package/dist/lib/client/menu-DeMT08oD.js +0 -326
- package/dist/lib/client/menubar-C4aomSYv.js +0 -185
- package/dist/lib/client/meter-xSU37Q0m.js +0 -171
- package/dist/lib/client/navigation-menu-ZILQmdn6.js +0 -1083
- package/dist/lib/client/number-field-B8CsTb_8.js +0 -1035
- package/dist/lib/client/otp-field-DBkMcnog.js +0 -582
- package/dist/lib/client/popover-CQwyp-fs.js +0 -929
- package/dist/lib/client/popupStateMapping-C9eZl19i.js +0 -367
- package/dist/lib/client/preview-card-D_2Q8lpC.js +0 -625
- package/dist/lib/client/progress-D7r0xAC9.js +0 -188
- package/dist/lib/client/radio-CzGQ81z1.js +0 -299
- package/dist/lib/client/radio-group-DpHlBKA6.js +0 -193
- package/dist/lib/client/runOnceAnimationsFinish-15EM-Z4l.js +0 -48
- package/dist/lib/client/scroll-area-CffM4U0R.js +0 -701
- package/dist/lib/client/select-IFhiEg73.js +0 -1940
- package/dist/lib/client/slider-BCagYmGp.js +0 -921
- package/dist/lib/client/switch-RIJeDnvS.js +0 -308
- package/dist/lib/client/tabs-fOAKs7r3.js +0 -696
- package/dist/lib/client/toast-D2P8UqUs.js +0 -1108
- package/dist/lib/client/toggle-group-0Aue0owJ.js +0 -129
- package/dist/lib/client/toggle-momVEIBL.js +0 -138
- package/dist/lib/client/toolbar-Du22aKCv.js +0 -492
- package/dist/lib/client/tooltip-CyK61fl1.js +0 -844
- package/dist/lib/client/useFilteredItems-DTekHz39.js +0 -2223
- package/dist/lib/client/withoutComponentBinding-CcCW7fSc.js +0 -13
- package/dist/lib/server/TriggerFocusGuards-sbGwf45f.js +0 -63
- package/dist/lib/server/withoutComponentBinding-BHaWr5kU.js +0 -20
- package/dist/lib/types/internals/withoutComponentBinding.d.ts +0 -7
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./useRender-CxZ8PI-g.js";
|
|
3
|
+
import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
|
|
4
|
+
import { S as r, x as i } from "./reasons-Co5CzjKq.js";
|
|
5
|
+
import { n as a, t as o } from "./resolveStyle-XcgAuaKR.js";
|
|
6
|
+
import { createChangeEventDetails as s } from "./internals/createBaseUIEventDetails.js";
|
|
7
|
+
import { composeEventHandlers as c } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { t as l } from "./runOnceAnimationsFinish-CFADb4CN.js";
|
|
9
|
+
import { n as u } from "./dom-BEAeQ9Eb.js";
|
|
10
|
+
import { t as d } from "./createAnchorPositioning-D96gu-Dz.js";
|
|
11
|
+
import { t as f } from "./createClickInteraction-CTaIFBiV.js";
|
|
12
|
+
import { c as p, i as m, n as h, r as g, s as _, t as v } from "./FloatingTree-23B7KKPD.js";
|
|
13
|
+
import { a as y, o as b, t as x } from "./PopupStore-Du0O57fL.js";
|
|
14
|
+
import { n as S, r as C, t as w } from "./safePolygon-DJG0VIVo.js";
|
|
15
|
+
import { n as T } from "./createPopupAutoResize-Dn-stj-8.js";
|
|
16
|
+
import { t as E } from "./createTransitionStatus-BL_cPSEA.js";
|
|
17
|
+
import { a as ee, d as te, g as D, h as ne, i as re, n as ie, o as O, r as k } from "./popupStateMapping-C6jQ_LKo.js";
|
|
18
|
+
import { t as A } from "./FocusManager-NP1uPXTi.js";
|
|
19
|
+
import { t as j } from "./setRef-fXF6OIo3.js";
|
|
20
|
+
import { t as ae } from "./TriggerFocusGuards-Cs8LVBj5.js";
|
|
21
|
+
import { a as M, i as oe, n as se, r as ce, t as le } from "./buttonSemantics-paljfpOX.js";
|
|
22
|
+
import { n as N } from "./DirectionContext-BwMabICS.js";
|
|
23
|
+
import { Portal as P, claimElement as F, createComponent as I, getNextElement as L, insert as ue, memo as R, mergeProps as z, ref as de, runHydrationEvents as B, scope as fe, spread as V, template as H } from "@solidjs/web";
|
|
24
|
+
import { Show as U, createContext as W, createEffect as G, createMemo as K, createSignal as q, createUniqueId as pe, omit as J, onCleanup as Y, untrack as X, useContext as Z } from "solid-js";
|
|
25
|
+
//#region src/navigation-menu/store/NavigationMenuStore.ts
|
|
26
|
+
var me = class extends x {
|
|
27
|
+
tree;
|
|
28
|
+
parentStore;
|
|
29
|
+
orientation;
|
|
30
|
+
delay;
|
|
31
|
+
closeDelay;
|
|
32
|
+
controlled;
|
|
33
|
+
controlledValue;
|
|
34
|
+
onValueChange;
|
|
35
|
+
valueAccessor;
|
|
36
|
+
setValueSignal;
|
|
37
|
+
reasonAccessor;
|
|
38
|
+
setReasonSignal;
|
|
39
|
+
openMethodAccessor;
|
|
40
|
+
setOpenMethodSignal;
|
|
41
|
+
activationDirectionAccessor;
|
|
42
|
+
setActivationDirectionSignal;
|
|
43
|
+
viewportElementAccessor;
|
|
44
|
+
setViewportElementSignal;
|
|
45
|
+
viewportTargetAccessor;
|
|
46
|
+
setViewportTargetSignal;
|
|
47
|
+
contentVersionAccessor;
|
|
48
|
+
setContentVersionSignal;
|
|
49
|
+
valueTriggers = /* @__PURE__ */ new Map();
|
|
50
|
+
previousTrigger = null;
|
|
51
|
+
returnFocusTarget = null;
|
|
52
|
+
constructor(e) {
|
|
53
|
+
super(e), this.tree = e.tree, this.parentStore = e.parentStore, this.orientation = e.orientation, this.delay = e.delay, this.closeDelay = e.closeDelay, this.controlled = e.controlled, this.controlledValue = e.value, this.onValueChange = e.onValueChange;
|
|
54
|
+
let [t, n] = q(() => e.defaultValue, { ownedWrite: !0 });
|
|
55
|
+
this.valueAccessor = t, this.setValueSignal = n;
|
|
56
|
+
let [r, i] = q(null, { ownedWrite: !0 });
|
|
57
|
+
this.reasonAccessor = r, this.setReasonSignal = i;
|
|
58
|
+
let [a, o] = q(null, { ownedWrite: !0 });
|
|
59
|
+
this.openMethodAccessor = a, this.setOpenMethodSignal = o;
|
|
60
|
+
let [s, c] = q(null, { ownedWrite: !0 });
|
|
61
|
+
this.activationDirectionAccessor = s, this.setActivationDirectionSignal = c;
|
|
62
|
+
let [l, u] = q(null, { ownedWrite: !0 });
|
|
63
|
+
this.viewportElementAccessor = l, this.setViewportElementSignal = u;
|
|
64
|
+
let [d, f] = q(null, { ownedWrite: !0 });
|
|
65
|
+
this.viewportTargetAccessor = d, this.setViewportTargetSignal = f;
|
|
66
|
+
let [p, m] = q(0, { ownedWrite: !0 });
|
|
67
|
+
this.contentVersionAccessor = p, this.setContentVersionSignal = m;
|
|
68
|
+
}
|
|
69
|
+
value() {
|
|
70
|
+
return this.controlled ? this.controlledValue() ?? null : this.valueAccessor();
|
|
71
|
+
}
|
|
72
|
+
openChangeReason() {
|
|
73
|
+
return this.reasonAccessor();
|
|
74
|
+
}
|
|
75
|
+
openMethod() {
|
|
76
|
+
return this.openMethodAccessor();
|
|
77
|
+
}
|
|
78
|
+
setOpenMethod(e) {
|
|
79
|
+
this.setOpenMethodSignal(e);
|
|
80
|
+
}
|
|
81
|
+
activationDirection() {
|
|
82
|
+
return this.open() ? this.activationDirectionAccessor() : null;
|
|
83
|
+
}
|
|
84
|
+
viewportElement() {
|
|
85
|
+
return this.viewportElementAccessor();
|
|
86
|
+
}
|
|
87
|
+
setViewportElement(e) {
|
|
88
|
+
this.setViewportElementSignal(e);
|
|
89
|
+
}
|
|
90
|
+
viewportTarget() {
|
|
91
|
+
return this.viewportTargetAccessor();
|
|
92
|
+
}
|
|
93
|
+
setViewportTarget(e) {
|
|
94
|
+
this.setViewportTargetSignal(e);
|
|
95
|
+
}
|
|
96
|
+
contentVersion() {
|
|
97
|
+
return this.contentVersionAccessor();
|
|
98
|
+
}
|
|
99
|
+
returnFocusElement() {
|
|
100
|
+
return this.returnFocusTarget?.isConnected ? this.returnFocusTarget : null;
|
|
101
|
+
}
|
|
102
|
+
touchContent() {
|
|
103
|
+
this.setContentVersionSignal((e) => e + 1);
|
|
104
|
+
}
|
|
105
|
+
registerValueTrigger(e, t, n, r) {
|
|
106
|
+
return this.valueTriggers.set(e, {
|
|
107
|
+
id: t,
|
|
108
|
+
element: n,
|
|
109
|
+
value: r
|
|
110
|
+
}), this.syncValue(), () => {
|
|
111
|
+
this.valueTriggers.delete(e), this.syncValue();
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
updateValueTrigger(e, t, n, r) {
|
|
115
|
+
this.valueTriggers.set(e, {
|
|
116
|
+
id: t,
|
|
117
|
+
element: n,
|
|
118
|
+
value: r
|
|
119
|
+
}), this.syncValue();
|
|
120
|
+
}
|
|
121
|
+
syncValue() {
|
|
122
|
+
let e = this.value(), t = e != null, n = t ? Array.from(this.valueTriggers.values()).find((t) => Object.is(t.value, e)) : void 0;
|
|
123
|
+
this.update({
|
|
124
|
+
open: t,
|
|
125
|
+
activeTriggerId: n?.id ?? (t ? this.state.activeTriggerId : null),
|
|
126
|
+
activeTriggerElement: n?.element ?? (t ? this.state.activeTriggerElement : null)
|
|
127
|
+
}), t ? n && this.updateActivationDirection(n.element) : (this.setActivationDirectionSignal(null), this.previousTrigger = null, this.setOpenMethodSignal(null)), this.reconcileTriggers();
|
|
128
|
+
}
|
|
129
|
+
setValue(e, t) {
|
|
130
|
+
let n = this.value();
|
|
131
|
+
if (Object.is(e, n) || this.onValueChange()?.(e, t), t.isCanceled) return !1;
|
|
132
|
+
let r = e == null ? void 0 : Array.from(this.valueTriggers.values()).find((t) => Object.is(t.value, e));
|
|
133
|
+
r && !t.trigger && (t.trigger = r.element), this.controlled || this.setValueSignal(() => e), this.setReasonSignal(t.reason), e != null && t.trigger instanceof HTMLElement && (this.returnFocusTarget = t.trigger, this.updateActivationDirection(t.trigger));
|
|
134
|
+
let i = super.setOpen(e != null, t);
|
|
135
|
+
return i && !this.controlled && this.syncValue(), i && e == null && t.reason === "link-press" && this.parentStore && this.parentStore.setValue(null, t), i;
|
|
136
|
+
}
|
|
137
|
+
setOpen(e, t) {
|
|
138
|
+
if (!e) return this.setValue(null, t);
|
|
139
|
+
let n = t.trigger, r = Array.from(this.valueTriggers.values()).find((e) => e.element === n || e.id === n?.id);
|
|
140
|
+
return r ? this.setValue(r.value, t) : !1;
|
|
141
|
+
}
|
|
142
|
+
updateActivationDirection(e) {
|
|
143
|
+
let t = this.previousTrigger;
|
|
144
|
+
if (this.previousTrigger = e, !t || t === e || !t.isConnected) return;
|
|
145
|
+
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
146
|
+
this.orientation() === "horizontal" && r.left !== n.left ? this.setActivationDirectionSignal(r.left > n.left ? "right" : "left") : this.orientation() === "vertical" && r.top !== n.top && this.setActivationDirectionSignal(r.top > n.top ? "down" : "up");
|
|
147
|
+
}
|
|
148
|
+
}, he = Symbol("NavigationMenuRootContext"), ge = W(he);
|
|
149
|
+
function Q(e = !1) {
|
|
150
|
+
let t = Z(ge);
|
|
151
|
+
if (t === he) {
|
|
152
|
+
if (e) return;
|
|
153
|
+
throw Error("Base UI: NavigationMenuRootContext is missing. Navigation Menu parts must be placed within <NavigationMenu.Root>.");
|
|
154
|
+
}
|
|
155
|
+
return t;
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
//#region src/navigation-menu/root/NavigationMenuRoot.tsx
|
|
159
|
+
var _e = /* @__PURE__ */ H("<div>"), ve = /* @__PURE__ */ H("<nav>");
|
|
160
|
+
function ye(e) {
|
|
161
|
+
let r = Q(!0), i = p(), s = _(), c = e, l = e, u = X(() => c.value !== void 0), d = s !== null && r !== void 0, f = i ?? new g(), x = pe(), S = pe(), C = K(() => c.orientation ?? "horizontal"), w = K(() => c.delay ?? 50), T = K(() => c.closeDelay ?? 50), E = new me({
|
|
162
|
+
controlled: u,
|
|
163
|
+
value: () => c.value,
|
|
164
|
+
defaultValue: X(() => c.defaultValue ?? null),
|
|
165
|
+
onValueChange: () => c.onValueChange,
|
|
166
|
+
controlledOpen: () => u ? c.value != null : void 0,
|
|
167
|
+
floatingId: S,
|
|
168
|
+
nested: d,
|
|
169
|
+
nodeId: x,
|
|
170
|
+
onOpenChangeComplete: () => c.onOpenChangeComplete,
|
|
171
|
+
orientation: C,
|
|
172
|
+
delay: w,
|
|
173
|
+
closeDelay: T,
|
|
174
|
+
tree: f,
|
|
175
|
+
parentStore: r?.store
|
|
176
|
+
});
|
|
177
|
+
E.update({ open: X(() => E.value() != null) });
|
|
178
|
+
let ee = m({
|
|
179
|
+
tree: f,
|
|
180
|
+
id: x,
|
|
181
|
+
parentId: s,
|
|
182
|
+
context: () => E.context.floatingRoot
|
|
183
|
+
}), [te, D] = q(null, { ownedWrite: !0 }), [ne, re] = q(null, { ownedWrite: !0 }), [ie, O] = q(null, { ownedWrite: !0 }), [k, A] = q(null, { ownedWrite: !0 }), j = y(E, () => E.track().popupElement), ae = {
|
|
184
|
+
store: E,
|
|
185
|
+
nested: d,
|
|
186
|
+
presence: j,
|
|
187
|
+
rootElement: te,
|
|
188
|
+
beforeContentGuard: ne,
|
|
189
|
+
setBeforeContentGuard: re,
|
|
190
|
+
afterTriggerGuard: ie,
|
|
191
|
+
setAfterTriggerGuard: O,
|
|
192
|
+
backdropElement: k,
|
|
193
|
+
setBackdropElement: A
|
|
194
|
+
}, M = K(() => ({
|
|
195
|
+
open: E.open(),
|
|
196
|
+
nested: d
|
|
197
|
+
})), oe = K(() => a(e.class, M())), se = K(() => o(e.style, M())), ce = K(() => n(M())), le = J(l, "actionsRef", "render", "class", "closeDelay", "defaultValue", "delay", "onOpenChangeComplete", "onValueChange", "orientation", "ref", "style", "value");
|
|
198
|
+
E.context.floatingRoot.context.data.insideElements = () => [k()];
|
|
199
|
+
let N = b({
|
|
200
|
+
context: E.context.floatingRoot,
|
|
201
|
+
tree: () => f,
|
|
202
|
+
outsidePressEvent: () => "intentional"
|
|
203
|
+
});
|
|
204
|
+
E.setInteractionProps({
|
|
205
|
+
activeTriggerProps: { onKeyDown: N.onKeyDown },
|
|
206
|
+
inactiveTriggerProps: { onKeyDown: N.onKeyDown },
|
|
207
|
+
popupProps: { onKeyDown: N.onKeyDown }
|
|
208
|
+
}), G(() => ({
|
|
209
|
+
value: E.value(),
|
|
210
|
+
manualUnmount: c.actionsRef !== void 0
|
|
211
|
+
}), (e) => X(() => {
|
|
212
|
+
e.value == null && e.manualUnmount && E.set("preventUnmountingOnClose", !0), E.syncValue();
|
|
213
|
+
}));
|
|
214
|
+
let P = { unmount: j.forceUnmount };
|
|
215
|
+
G(() => c.actionsRef, (e) => {
|
|
216
|
+
e?.(P);
|
|
217
|
+
});
|
|
218
|
+
let F = 0;
|
|
219
|
+
G(() => ({
|
|
220
|
+
mounted: j.mounted(),
|
|
221
|
+
open: E.open(),
|
|
222
|
+
reason: E.openChangeReason()
|
|
223
|
+
}), (e) => {
|
|
224
|
+
if (!(e.open || e.mounted || e.reason == null || e.reason === "trigger-hover" || e.reason === "outside-press" || e.reason === "focus-out")) return F = requestAnimationFrame(() => {
|
|
225
|
+
X(() => E.returnFocusElement())?.focus({ preventScroll: !0 });
|
|
226
|
+
}), () => {
|
|
227
|
+
typeof cancelAnimationFrame == "function" && cancelAnimationFrame(F);
|
|
228
|
+
};
|
|
229
|
+
}), Y(() => {
|
|
230
|
+
typeof cancelAnimationFrame == "function" && cancelAnimationFrame(F), E.clearInteractionProps(), delete E.context.floatingRoot.context.data.insideElements;
|
|
231
|
+
});
|
|
232
|
+
let ue = t(e, () => M(), (e) => d ? (() => {
|
|
233
|
+
var t = L(_e);
|
|
234
|
+
return V(t, e, !1), B(), t;
|
|
235
|
+
})() : (() => {
|
|
236
|
+
var t = L(ve);
|
|
237
|
+
return V(t, e, !1), B(), t;
|
|
238
|
+
})());
|
|
239
|
+
return I(ge, {
|
|
240
|
+
value: ae,
|
|
241
|
+
get children() {
|
|
242
|
+
return I(h, {
|
|
243
|
+
value: f,
|
|
244
|
+
get children() {
|
|
245
|
+
return I(v, {
|
|
246
|
+
get value() {
|
|
247
|
+
return ee.id ?? null;
|
|
248
|
+
},
|
|
249
|
+
get children() {
|
|
250
|
+
return I(ue, z({
|
|
251
|
+
ref: [((e) => D(e)), c.ref],
|
|
252
|
+
get class() {
|
|
253
|
+
return oe();
|
|
254
|
+
},
|
|
255
|
+
get style() {
|
|
256
|
+
return se();
|
|
257
|
+
}
|
|
258
|
+
}, ce, le));
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/navigation-menu/composite/NavigationMenuCompositeContext.ts
|
|
268
|
+
var be = Symbol("NavigationMenuCompositeContext"), xe = W(be);
|
|
269
|
+
function Se() {
|
|
270
|
+
let e = Z(xe);
|
|
271
|
+
return e === be ? void 0 : e;
|
|
272
|
+
}
|
|
273
|
+
function Ce(e) {
|
|
274
|
+
let [t, n] = q(), [r, i] = q(0), a = /* @__PURE__ */ new Map(), o = 0, s = !1;
|
|
275
|
+
function c() {
|
|
276
|
+
s || (s = !0, queueMicrotask(() => {
|
|
277
|
+
s = !1, i((e) => e + 1);
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
280
|
+
function l(e) {
|
|
281
|
+
return e.order = o, o += 1, a.set(e.token, e), c(), () => {
|
|
282
|
+
a.delete(e.token), c();
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
function u() {
|
|
286
|
+
return r(), Array.from(a.values()).filter((e) => {
|
|
287
|
+
let t = e.element();
|
|
288
|
+
return !!(t?.isConnected && !e.disabled() && !t.matches(":disabled"));
|
|
289
|
+
}).sort((e, t) => {
|
|
290
|
+
let n = e.element(), r = t.element();
|
|
291
|
+
if (n && r && n !== r) {
|
|
292
|
+
let e = n.compareDocumentPosition(r);
|
|
293
|
+
if ((e & Node.DOCUMENT_POSITION_DISCONNECTED) === 0) {
|
|
294
|
+
if (e & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
295
|
+
if (e & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
return e.order - t.order;
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
function d(e) {
|
|
302
|
+
let t = e.composedPath();
|
|
303
|
+
return u().find((e) => {
|
|
304
|
+
let n = e.element();
|
|
305
|
+
return !!(n && t.includes(n));
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
return {
|
|
309
|
+
isTabStop(e) {
|
|
310
|
+
let n = u();
|
|
311
|
+
return (n.find((e) => e.token === t()) ?? n[0])?.token === e.token;
|
|
312
|
+
},
|
|
313
|
+
notifyItemChange: c,
|
|
314
|
+
registerItem: l,
|
|
315
|
+
setActiveItem(e) {
|
|
316
|
+
e.disabled() || n(e.token);
|
|
317
|
+
},
|
|
318
|
+
handleKeyDown(t) {
|
|
319
|
+
if (t.shiftKey || t.ctrlKey || t.altKey || t.metaKey) return !1;
|
|
320
|
+
let r = e.orientation() === "vertical" ? "ArrowDown" : e.direction() === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
321
|
+
if (![
|
|
322
|
+
r,
|
|
323
|
+
e.orientation() === "vertical" ? "ArrowUp" : e.direction() === "rtl" ? "ArrowRight" : "ArrowLeft",
|
|
324
|
+
"Home",
|
|
325
|
+
"End"
|
|
326
|
+
].includes(t.key)) return !1;
|
|
327
|
+
let i = u();
|
|
328
|
+
if (i.length === 0) return !0;
|
|
329
|
+
let a = d(t), o = a ? i.indexOf(a) : -1;
|
|
330
|
+
o = t.key === "Home" ? 0 : t.key === "End" ? i.length - 1 : Math.max(0, Math.min(i.length - 1, o + (t.key === r ? 1 : -1)));
|
|
331
|
+
let s = i[o];
|
|
332
|
+
return t.preventDefault(), t.stopPropagation(), s && (n(s.token), queueMicrotask(() => s.element()?.focus({ preventScroll: !0 }))), !0;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region src/navigation-menu/list/NavigationMenuList.tsx
|
|
338
|
+
var we = /* @__PURE__ */ H("<ul>");
|
|
339
|
+
function Te(e) {
|
|
340
|
+
let r = Q(), i = N(), s = e, l = e, u = K(() => ({ open: r.store.open() })), d = K(() => a(e.class, u())), f = K(() => o(e.style, u())), p = K(() => n(u())), m = J(l, "render", "class", "onKeyDown", "ref", "style"), h = Ce({
|
|
341
|
+
orientation: r.store.orientation,
|
|
342
|
+
direction: i
|
|
343
|
+
}), g = c(() => s.onKeyDown, () => (e) => {
|
|
344
|
+
r.nested || h.handleKeyDown(e);
|
|
345
|
+
}), _ = t(e, () => u(), (e) => (() => {
|
|
346
|
+
var t = L(we);
|
|
347
|
+
return V(t, e, !1), B(), t;
|
|
348
|
+
})());
|
|
349
|
+
function v() {
|
|
350
|
+
return I(_, z({
|
|
351
|
+
ref: [s.ref],
|
|
352
|
+
get class() {
|
|
353
|
+
return d();
|
|
354
|
+
},
|
|
355
|
+
get style() {
|
|
356
|
+
return f();
|
|
357
|
+
},
|
|
358
|
+
onKeyDown: g
|
|
359
|
+
}, p, m));
|
|
360
|
+
}
|
|
361
|
+
return r.nested ? I(v, {}) : I(xe, {
|
|
362
|
+
value: h,
|
|
363
|
+
get children() {
|
|
364
|
+
return I(v, {});
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/navigation-menu/item/NavigationMenuItemContext.ts
|
|
370
|
+
var Ee = Symbol("NavigationMenuItemContext"), De = W(Ee);
|
|
371
|
+
function Oe() {
|
|
372
|
+
let e = Z(De);
|
|
373
|
+
if (e === Ee) throw Error("Base UI: NavigationMenuItem parts must be used within a <NavigationMenu.Item>.");
|
|
374
|
+
return e;
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
//#region src/navigation-menu/item/NavigationMenuItem.tsx
|
|
378
|
+
var ke = /* @__PURE__ */ H("<li>");
|
|
379
|
+
function Ae(e) {
|
|
380
|
+
let n = `base-ui-${pe()}`, r = e, i = e, s = K(() => r.value ?? n), c = {}, l = K(() => a(e.class, c)), u = K(() => o(e.style, c)), d = J(i, "render", "class", "ref", "style", "value"), f = { value: s }, p = t(e, () => c, (e) => (() => {
|
|
381
|
+
var t = L(ke);
|
|
382
|
+
return V(t, e, !1), B(), t;
|
|
383
|
+
})());
|
|
384
|
+
return I(De, {
|
|
385
|
+
value: f,
|
|
386
|
+
get children() {
|
|
387
|
+
return I(p, z({
|
|
388
|
+
ref: [r.ref],
|
|
389
|
+
get class() {
|
|
390
|
+
return l();
|
|
391
|
+
},
|
|
392
|
+
get style() {
|
|
393
|
+
return u();
|
|
394
|
+
}
|
|
395
|
+
}, d));
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/navigation-menu/trigger/NavigationMenuTrigger.tsx
|
|
401
|
+
var je = /* @__PURE__ */ H("<button>");
|
|
402
|
+
function Me(e) {
|
|
403
|
+
let i = Q(), l = Oe(), u = Se(), d = N(), p = e, m = e, h = `base-ui-${pe()}`, g = K(() => p.id ?? h), _ = K(() => p.disabled ?? !1), v = K(() => p.nativeButton ?? !0), [y, b] = q(null, { ownedWrite: !0 }), x = K(() => i.store.open() && Object.is(i.store.value(), l.value())), S = K(() => ({
|
|
404
|
+
open: x(),
|
|
405
|
+
disabled: _()
|
|
406
|
+
})), T = K(() => a(e.class, S())), E = K(() => o(e.style, S())), ee = K(() => n(S(), re)), te = J(m, "render", "class", "disabled", "id", "nativeButton", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style"), D = {
|
|
407
|
+
token: Symbol("NavigationMenuTrigger"),
|
|
408
|
+
order: 0,
|
|
409
|
+
element: y,
|
|
410
|
+
disabled: _
|
|
411
|
+
}, ne = Symbol("NavigationMenuValueTrigger"), ie = u?.registerItem(D), O, k, A, j = "", P = !0, F;
|
|
412
|
+
G(() => ({
|
|
413
|
+
element: y(),
|
|
414
|
+
id: g(),
|
|
415
|
+
value: l.value()
|
|
416
|
+
}), (e) => {
|
|
417
|
+
if (O?.(), k?.(), e.element) return X(() => {
|
|
418
|
+
O = i.store.registerTrigger(e.id, e.element), k = i.store.registerValueTrigger(ne, e.id, e.element, e.value);
|
|
419
|
+
}), () => {
|
|
420
|
+
X(() => {
|
|
421
|
+
O?.(), k?.();
|
|
422
|
+
}), O = void 0, k = void 0;
|
|
423
|
+
};
|
|
424
|
+
}), G(() => ({
|
|
425
|
+
open: x(),
|
|
426
|
+
reason: i.store.openChangeReason()
|
|
427
|
+
}), (e) => {
|
|
428
|
+
clearTimeout(F), P = e.open && e.reason === "trigger-hover", P && (F = setTimeout(() => {
|
|
429
|
+
P = !1;
|
|
430
|
+
}, 500));
|
|
431
|
+
}), G(() => ({
|
|
432
|
+
element: y(),
|
|
433
|
+
disabled: _()
|
|
434
|
+
}), () => u?.notifyItemChange()), A = f({
|
|
435
|
+
context: i.store.context.floatingRoot,
|
|
436
|
+
enabled: () => !_(),
|
|
437
|
+
stickIfOpen: () => P
|
|
438
|
+
}), C({
|
|
439
|
+
context: i.store.context.floatingRoot,
|
|
440
|
+
reference: y,
|
|
441
|
+
floating: () => i.store.track().positionerElement ?? i.store.viewportElement(),
|
|
442
|
+
tree: () => i.store.tree,
|
|
443
|
+
enabled: () => !_(),
|
|
444
|
+
floatingEnabled: () => !_(),
|
|
445
|
+
delay: () => ({ close: i.store.closeDelay() }),
|
|
446
|
+
restMs: () => i.store.open() ? 0 : i.store.delay(),
|
|
447
|
+
restOnly: () => !0,
|
|
448
|
+
handleClose: () => w({ blockPointerEvents: !0 }),
|
|
449
|
+
mouseOnly: () => !0,
|
|
450
|
+
blockPointerEventsScope: () => (i.nested && i.store.track().positionerElement, y()?.closest("ul"))
|
|
451
|
+
});
|
|
452
|
+
function ue(e) {
|
|
453
|
+
j = e.pointerType, A?.onPointerDown(e);
|
|
454
|
+
}
|
|
455
|
+
function de(e) {
|
|
456
|
+
A?.onMouseDown(e);
|
|
457
|
+
}
|
|
458
|
+
function fe(e) {
|
|
459
|
+
i.store.setOpenMethod(j || (e.detail === 0 ? "keyboard" : "mouse")), A?.onClick(e), j = "";
|
|
460
|
+
}
|
|
461
|
+
function H() {
|
|
462
|
+
u?.setActiveItem(D);
|
|
463
|
+
}
|
|
464
|
+
function U(e) {
|
|
465
|
+
let t = i.store.state[x() ? "activeTriggerProps" : "inactiveTriggerProps"].onKeyDown;
|
|
466
|
+
if (typeof t == "function" && t(e), e.defaultPrevented || _() || u?.handleKeyDown(e) || i.nested) return;
|
|
467
|
+
let n = i.store.orientation() === "horizontal" ? "ArrowDown" : d() === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
468
|
+
e.key === n && (e.preventDefault(), e.stopPropagation(), i.store.setOpenMethod("keyboard"), i.store.setValue(l.value(), s(r, e, y() ?? void 0)));
|
|
469
|
+
}
|
|
470
|
+
let W = c(() => X(() => _() ? ce : void 0), () => p.onClick, () => fe), Z = c(() => p.onFocus, () => H), me = c(() => X(() => _() ? ce : void 0), () => p.onPointerDown, () => ue), he = c(() => X(() => _() ? M : void 0), () => p.onMouseDown, () => de), ge = c(() => X(() => _() ? oe : void 0), () => p.onKeyDown, () => U, () => X(() => v() ? void 0 : le)), _e = c(() => X(() => _() ? M : void 0), () => p.onKeyUp, () => X(() => v() ? void 0 : se)), ve = t(e, () => S(), (e) => (() => {
|
|
471
|
+
var t = L(je);
|
|
472
|
+
return V(t, e, !1), B(), t;
|
|
473
|
+
})()), ye = I(ve, z({
|
|
474
|
+
ref: [((e) => b(e)), p.ref],
|
|
475
|
+
get id() {
|
|
476
|
+
return g();
|
|
477
|
+
},
|
|
478
|
+
get type() {
|
|
479
|
+
return v() ? "button" : void 0;
|
|
480
|
+
},
|
|
481
|
+
get role() {
|
|
482
|
+
return v() ? void 0 : "button";
|
|
483
|
+
},
|
|
484
|
+
get tabIndex() {
|
|
485
|
+
return u ? u.isTabStop(D) ? 0 : -1 : 0;
|
|
486
|
+
},
|
|
487
|
+
get disabled() {
|
|
488
|
+
return (R(() => !!v())() ? _() : v()) || void 0;
|
|
489
|
+
},
|
|
490
|
+
get "aria-disabled"() {
|
|
491
|
+
return !v() && _() ? "true" : void 0;
|
|
492
|
+
},
|
|
493
|
+
get "aria-expanded"() {
|
|
494
|
+
return x() ? "true" : "false";
|
|
495
|
+
},
|
|
496
|
+
get "aria-controls"() {
|
|
497
|
+
return R(() => !!x())() ? i.store.popupId() : void 0;
|
|
498
|
+
},
|
|
499
|
+
"data-base-ui-navigation-menu-trigger": "",
|
|
500
|
+
get "data-trigger-disabled"() {
|
|
501
|
+
return _() ? "" : void 0;
|
|
502
|
+
},
|
|
503
|
+
get class() {
|
|
504
|
+
return T();
|
|
505
|
+
},
|
|
506
|
+
get style() {
|
|
507
|
+
return E();
|
|
508
|
+
},
|
|
509
|
+
onClick: W,
|
|
510
|
+
onFocus: Z,
|
|
511
|
+
onKeyDown: ge,
|
|
512
|
+
onKeyUp: _e,
|
|
513
|
+
onMouseDown: he,
|
|
514
|
+
onPointerDown: me
|
|
515
|
+
}, ee, te));
|
|
516
|
+
return Y(() => {
|
|
517
|
+
clearTimeout(F), ie?.(), O?.(), k?.();
|
|
518
|
+
}), I(ae, {
|
|
519
|
+
get context() {
|
|
520
|
+
return i.store.context.floatingRoot;
|
|
521
|
+
},
|
|
522
|
+
get enabled() {
|
|
523
|
+
return R(() => !!x())() ? i.presence.mounted() : x();
|
|
524
|
+
},
|
|
525
|
+
trigger: y,
|
|
526
|
+
positioner: () => i.store.track().positionerElement ?? i.store.viewportElement(),
|
|
527
|
+
get beforeContentGuard() {
|
|
528
|
+
return i.beforeContentGuard;
|
|
529
|
+
},
|
|
530
|
+
get afterGuardRef() {
|
|
531
|
+
return i.setAfterTriggerGuard;
|
|
532
|
+
},
|
|
533
|
+
children: ye
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/navigation-menu/icon/NavigationMenuIcon.tsx
|
|
538
|
+
var Ne = /* @__PURE__ */ H("<span>");
|
|
539
|
+
function Pe(e) {
|
|
540
|
+
let r = Q(), i = Oe(), s = e, c = e, l = K(() => ({ open: r.store.open() && Object.is(r.store.value(), i.value()) })), u = K(() => a(e.class, l())), d = K(() => o(e.style, l())), f = K(() => n(l(), ee)), p = J(c, "render", "class", "ref", "style"), m = t(e, () => l(), (e) => (() => {
|
|
541
|
+
var t = L(Ne);
|
|
542
|
+
return V(t, e, !1), B(), t;
|
|
543
|
+
})());
|
|
544
|
+
return I(m, z({
|
|
545
|
+
ref: [s.ref],
|
|
546
|
+
"aria-hidden": "true",
|
|
547
|
+
get class() {
|
|
548
|
+
return u();
|
|
549
|
+
},
|
|
550
|
+
get style() {
|
|
551
|
+
return d();
|
|
552
|
+
}
|
|
553
|
+
}, f, p, { get children() {
|
|
554
|
+
return e.children ?? "▼";
|
|
555
|
+
} }));
|
|
556
|
+
}
|
|
557
|
+
//#endregion
|
|
558
|
+
//#region src/navigation-menu/utils/mergeNavigationMenuStyles.ts
|
|
559
|
+
function $(e, t) {
|
|
560
|
+
if (typeof t == "string") {
|
|
561
|
+
let n = Object.entries(e).filter((e) => e[1] != null).map(([e, t]) => `${e}:${String(t)}`).join(";");
|
|
562
|
+
return n ? `${n};${t}` : t;
|
|
563
|
+
}
|
|
564
|
+
return {
|
|
565
|
+
...e,
|
|
566
|
+
...t || void 0
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/navigation-menu/content/NavigationMenuContent.tsx
|
|
571
|
+
var Fe = /* @__PURE__ */ H("<div>"), Ie = {
|
|
572
|
+
...k,
|
|
573
|
+
activationDirection: (e) => e ? { "data-activation-direction": e } : null
|
|
574
|
+
};
|
|
575
|
+
function Le(e) {
|
|
576
|
+
let r = Q(), i = Oe(), s = N(), u = e, d = e, f = K(() => r.presence.mounted() && Object.is(r.store.value(), i.value())), p = E(f), [m, h] = q(null, { ownedWrite: !0 }), [g, _] = q(!1, { ownedWrite: !0 }), v = Ce({
|
|
577
|
+
orientation: () => "vertical",
|
|
578
|
+
direction: s
|
|
579
|
+
}), y = K(() => ({
|
|
580
|
+
open: f(),
|
|
581
|
+
transitionStatus: p.transitionStatus(),
|
|
582
|
+
activationDirection: r.store.activationDirection()
|
|
583
|
+
})), b = K(() => a(e.class, y())), x = K(() => $(!f() && p.mounted() ? {
|
|
584
|
+
position: "absolute",
|
|
585
|
+
top: 0,
|
|
586
|
+
left: 0
|
|
587
|
+
} : {}, o(e.style, y()))), S = K(() => n(y(), Ie)), C = J(d, "render", "class", "keepMounted", "onKeyDown", "ref", "style"), w = c(() => u.onKeyDown, () => (e) => v.handleKeyDown(e));
|
|
588
|
+
G(() => ({
|
|
589
|
+
open: f(),
|
|
590
|
+
mounted: p.mounted(),
|
|
591
|
+
element: m()
|
|
592
|
+
}), (e) => {
|
|
593
|
+
if (!e.mounted || e.open) return;
|
|
594
|
+
if (!e.element) {
|
|
595
|
+
queueMicrotask(() => p.setMounted(!1));
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
let t = new AbortController();
|
|
599
|
+
return l(e.element, () => p.setMounted(!1), t.signal), () => t.abort();
|
|
600
|
+
}), G(() => r.presence.mounted(), (e) => {
|
|
601
|
+
e || p.setMounted(!1);
|
|
602
|
+
}), G(() => ({
|
|
603
|
+
target: r.store.viewportTarget(),
|
|
604
|
+
open: f()
|
|
605
|
+
}), (e) => {
|
|
606
|
+
e.target && _(!0), e.open && X(() => r.store.touchContent());
|
|
607
|
+
}), G(() => m(), (e) => {
|
|
608
|
+
if (!e || typeof MutationObserver > "u") return;
|
|
609
|
+
let t = new MutationObserver(() => r.store.touchContent());
|
|
610
|
+
return t.observe(e, {
|
|
611
|
+
attributes: !0,
|
|
612
|
+
childList: !0,
|
|
613
|
+
subtree: !0,
|
|
614
|
+
characterData: !0,
|
|
615
|
+
attributeFilter: ["hidden"]
|
|
616
|
+
}), () => t.disconnect();
|
|
617
|
+
}), Y(() => {
|
|
618
|
+
X(m) && h(null);
|
|
619
|
+
});
|
|
620
|
+
function T() {
|
|
621
|
+
return I(xe, {
|
|
622
|
+
value: v,
|
|
623
|
+
get children() {
|
|
624
|
+
return I(ee, z({
|
|
625
|
+
ref: [((e) => h(e)), u.ref],
|
|
626
|
+
get hidden() {
|
|
627
|
+
return (R(() => !!(u.keepMounted ?? !1))() ? !p.mounted() : u.keepMounted ?? !1) || void 0;
|
|
628
|
+
},
|
|
629
|
+
get inert() {
|
|
630
|
+
return R(() => !f())() && p.mounted() || void 0;
|
|
631
|
+
},
|
|
632
|
+
get class() {
|
|
633
|
+
return b();
|
|
634
|
+
},
|
|
635
|
+
get style() {
|
|
636
|
+
return x();
|
|
637
|
+
},
|
|
638
|
+
onKeyDown: w
|
|
639
|
+
}, S, C));
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
let ee = t(e, () => y(), (e) => (() => {
|
|
644
|
+
var t = L(Fe);
|
|
645
|
+
return V(t, e, !1), B(), t;
|
|
646
|
+
})());
|
|
647
|
+
return I(U, {
|
|
648
|
+
get when() {
|
|
649
|
+
return R(() => !!r.store.viewportTarget())() ? p.mounted() || u.keepMounted : r.store.viewportTarget();
|
|
650
|
+
},
|
|
651
|
+
get fallback() {
|
|
652
|
+
return I(U, {
|
|
653
|
+
get when() {
|
|
654
|
+
return R(() => !!u.keepMounted)() ? !g() : u.keepMounted;
|
|
655
|
+
},
|
|
656
|
+
get children() {
|
|
657
|
+
return I(T, {});
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
},
|
|
661
|
+
get children() {
|
|
662
|
+
return I(P, {
|
|
663
|
+
get mount() {
|
|
664
|
+
return r.store.viewportTarget();
|
|
665
|
+
},
|
|
666
|
+
get children() {
|
|
667
|
+
return I(T, {});
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
//#endregion
|
|
674
|
+
//#region src/navigation-menu/link/NavigationMenuLink.tsx
|
|
675
|
+
var Re = /* @__PURE__ */ H("<a>");
|
|
676
|
+
function ze(e) {
|
|
677
|
+
let r = Q(), l = Se(), u = e, d = e, [f, p] = q(null, { ownedWrite: !0 }), m = {
|
|
678
|
+
token: Symbol("NavigationMenuLink"),
|
|
679
|
+
order: 0,
|
|
680
|
+
element: f,
|
|
681
|
+
disabled: () => !1
|
|
682
|
+
}, h = l?.registerItem(m), g = K(() => ({ active: u.active ?? !1 })), _ = K(() => a(e.class, g())), v = K(() => o(e.style, g())), y = K(() => n(g())), b = J(d, "active", "render", "class", "closeOnClick", "onClick", "onFocus", "ref", "style");
|
|
683
|
+
G(f, () => l?.notifyItemChange());
|
|
684
|
+
let x = c(() => u.onFocus, () => () => l?.setActiveItem(m)), S = c(() => u.onClick, () => (e) => {
|
|
685
|
+
u.closeOnClick && r.store.setValue(null, s(i, e));
|
|
686
|
+
});
|
|
687
|
+
Y(() => h?.());
|
|
688
|
+
let C = t(e, () => g(), (e) => (() => {
|
|
689
|
+
var t = L(Re);
|
|
690
|
+
return F(t), V(t, e, !1), B(), t;
|
|
691
|
+
})());
|
|
692
|
+
return I(C, z({
|
|
693
|
+
ref: [((e) => p(e)), u.ref],
|
|
694
|
+
get "aria-current"() {
|
|
695
|
+
return g().active ? "page" : void 0;
|
|
696
|
+
},
|
|
697
|
+
get tabIndex() {
|
|
698
|
+
return l ? l.isTabStop(m) ? 0 : -1 : void 0;
|
|
699
|
+
},
|
|
700
|
+
get class() {
|
|
701
|
+
return _();
|
|
702
|
+
},
|
|
703
|
+
get style() {
|
|
704
|
+
return v();
|
|
705
|
+
},
|
|
706
|
+
onClick: S,
|
|
707
|
+
onFocus: x
|
|
708
|
+
}, y, b));
|
|
709
|
+
}
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/navigation-menu/portal/NavigationMenuPortalContext.ts
|
|
712
|
+
var Be = Symbol("NavigationMenuPortalContext"), Ve = W(Be);
|
|
713
|
+
function He() {
|
|
714
|
+
let e = Z(Ve);
|
|
715
|
+
if (e === Be) throw Error("Base UI: <NavigationMenu.Portal> is missing.");
|
|
716
|
+
return e;
|
|
717
|
+
}
|
|
718
|
+
//#endregion
|
|
719
|
+
//#region src/navigation-menu/portal/NavigationMenuPortal.tsx
|
|
720
|
+
function Ue(e) {
|
|
721
|
+
let t = Q(), n = e, r = e, i = K(() => n.keepMounted ?? !1), s = K(() => t.presence.mounted() || i()), c = {}, l = K(() => a(e.class, c)), u = K(() => o(e.style, c)), d = J(r, "render", "class", "container", "keepMounted", "ref", "style"), f = { keepMounted: i };
|
|
722
|
+
return I(U, {
|
|
723
|
+
get when() {
|
|
724
|
+
return s();
|
|
725
|
+
},
|
|
726
|
+
get children() {
|
|
727
|
+
return I(Ve, {
|
|
728
|
+
value: f,
|
|
729
|
+
get children() {
|
|
730
|
+
return I(O, z({
|
|
731
|
+
get render() {
|
|
732
|
+
return e.render;
|
|
733
|
+
},
|
|
734
|
+
get container() {
|
|
735
|
+
return n.container;
|
|
736
|
+
},
|
|
737
|
+
ref: (e) => j(n.ref, e),
|
|
738
|
+
get class() {
|
|
739
|
+
return l();
|
|
740
|
+
},
|
|
741
|
+
get style() {
|
|
742
|
+
return u();
|
|
743
|
+
}
|
|
744
|
+
}, d, { get children() {
|
|
745
|
+
return e.children;
|
|
746
|
+
} }));
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/navigation-menu/backdrop/NavigationMenuBackdrop.tsx
|
|
754
|
+
var We = /* @__PURE__ */ H("<div>");
|
|
755
|
+
function Ge(e) {
|
|
756
|
+
let r = Q(), i = e, s = e, c = K(() => ({
|
|
757
|
+
open: r.store.open(),
|
|
758
|
+
transitionStatus: r.store.track().transitionStatus
|
|
759
|
+
})), l = K(() => a(e.class, c())), u = K(() => $({
|
|
760
|
+
"user-select": "none",
|
|
761
|
+
"-webkit-user-select": "none"
|
|
762
|
+
}, o(e.style, c()))), d = K(() => n(c(), k)), f = J(s, "render", "class", "ref", "style"), p = null;
|
|
763
|
+
Y(() => {
|
|
764
|
+
r.backdropElement() === p && r.setBackdropElement(null);
|
|
765
|
+
});
|
|
766
|
+
let m = t(e, () => c(), (e) => (() => {
|
|
767
|
+
var t = L(We);
|
|
768
|
+
return V(t, e, !1), B(), t;
|
|
769
|
+
})());
|
|
770
|
+
return I(m, z({
|
|
771
|
+
ref: [((e) => {
|
|
772
|
+
p = e, r.setBackdropElement(e);
|
|
773
|
+
}), i.ref],
|
|
774
|
+
role: "presentation",
|
|
775
|
+
get hidden() {
|
|
776
|
+
return !r.presence.mounted();
|
|
777
|
+
},
|
|
778
|
+
get class() {
|
|
779
|
+
return l();
|
|
780
|
+
},
|
|
781
|
+
get style() {
|
|
782
|
+
return u();
|
|
783
|
+
}
|
|
784
|
+
}, d, f));
|
|
785
|
+
}
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/navigation-menu/positioner/NavigationMenuPositionerContext.ts
|
|
788
|
+
var Ke = Symbol("NavigationMenuPositionerContext"), qe = W(Ke);
|
|
789
|
+
function Je(e = !1) {
|
|
790
|
+
let t = Z(qe);
|
|
791
|
+
if (t === Ke) {
|
|
792
|
+
if (e) return;
|
|
793
|
+
throw Error("Base UI: NavigationMenuPositionerContext is missing. NavigationMenuPositioner parts must be placed within <NavigationMenu.Positioner>.");
|
|
794
|
+
}
|
|
795
|
+
return t;
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/navigation-menu/positioner/NavigationMenuPositioner.tsx
|
|
799
|
+
var Ye = /* @__PURE__ */ H("<div>");
|
|
800
|
+
function Xe(e) {
|
|
801
|
+
He();
|
|
802
|
+
let r = Q(), i = N(), s = e, c = e, [l, u] = q(null, { ownedWrite: !0 }), [f, p] = q(!1, { ownedWrite: !0 }), m = K(() => Ze(s.anchor) ?? r.store.context.floatingRoot.referenceElement()), h = d({
|
|
803
|
+
reference: m,
|
|
804
|
+
floating: l,
|
|
805
|
+
mounted: r.presence.mounted,
|
|
806
|
+
direction: i,
|
|
807
|
+
positionMethod: () => s.positionMethod ?? "absolute",
|
|
808
|
+
side: () => s.side ?? (r.nested ? "inline-end" : "bottom"),
|
|
809
|
+
sideOffset: () => s.sideOffset ?? 0,
|
|
810
|
+
align: () => s.align ?? (r.nested ? "start" : "center"),
|
|
811
|
+
alignOffset: () => s.alignOffset ?? 0,
|
|
812
|
+
collisionBoundary: () => s.collisionBoundary ?? "clipping-ancestors",
|
|
813
|
+
collisionPadding: () => s.collisionPadding ?? 5,
|
|
814
|
+
arrowPadding: () => s.arrowPadding ?? 5,
|
|
815
|
+
sticky: () => s.sticky ?? !1,
|
|
816
|
+
disableAnchorTracking: () => s.disableAnchorTracking ?? !1,
|
|
817
|
+
collisionAvoidance: () => s.collisionAvoidance ?? { fallbackAxisSide: r.nested ? "end" : "none" },
|
|
818
|
+
shiftRootBoundary: () => "layoutViewport",
|
|
819
|
+
adaptiveOriginMiddleware: () => r.store.track().adaptiveOriginMiddleware
|
|
820
|
+
}), g = S(() => r.store.open(), () => h.state().isPositioned), _ = K(() => ({
|
|
821
|
+
open: r.store.open(),
|
|
822
|
+
side: h.renderedSide(),
|
|
823
|
+
align: h.renderedAlign(),
|
|
824
|
+
anchorHidden: h.anchorHidden(),
|
|
825
|
+
instant: f() ? "resize" : g() ? "initial" : void 0
|
|
826
|
+
})), v = K(() => a(e.class, _())), y = K(() => $({
|
|
827
|
+
...h.styles(),
|
|
828
|
+
"pointer-events": r.store.open() ? void 0 : "none"
|
|
829
|
+
}, o(e.style, _()))), b = K(() => n(_(), ie)), x = J(c, "align", "alignOffset", "anchor", "arrowPadding", "render", "class", "collisionAvoidance", "collisionBoundary", "collisionPadding", "disableAnchorTracking", "positionMethod", "ref", "side", "sideOffset", "sticky", "style"), C;
|
|
830
|
+
T({
|
|
831
|
+
popup: () => r.store.track().popupElement,
|
|
832
|
+
positioner: l,
|
|
833
|
+
mounted: r.presence.mounted,
|
|
834
|
+
content: () => ({
|
|
835
|
+
value: r.store.value(),
|
|
836
|
+
version: r.store.contentVersion()
|
|
837
|
+
}),
|
|
838
|
+
side: h.renderedSide,
|
|
839
|
+
direction: i
|
|
840
|
+
}), G(() => h.state().placement, (e) => {
|
|
841
|
+
r.store.context.floatingRoot.context.data.placement = e;
|
|
842
|
+
}), G(() => ({
|
|
843
|
+
element: l(),
|
|
844
|
+
open: r.store.open()
|
|
845
|
+
}), (e) => {
|
|
846
|
+
if (!e.element || !e.open) return;
|
|
847
|
+
let t = () => {
|
|
848
|
+
p(!0), clearTimeout(C), C = setTimeout(() => p(!1), 100), r.store.touchContent();
|
|
849
|
+
};
|
|
850
|
+
return e.element.ownerDocument.defaultView?.addEventListener("resize", t), () => e.element?.ownerDocument.defaultView?.removeEventListener("resize", t);
|
|
851
|
+
}), Y(() => {
|
|
852
|
+
clearTimeout(C), delete r.store.context.floatingRoot.context.data.placement, r.store.state.positionerElement === X(l) && r.store.setPositionerElement(null);
|
|
853
|
+
});
|
|
854
|
+
let w = t(e, () => _(), (e) => (() => {
|
|
855
|
+
var t = L(Ye);
|
|
856
|
+
return V(t, e, !1), B(), t;
|
|
857
|
+
})());
|
|
858
|
+
return I(qe, {
|
|
859
|
+
value: h,
|
|
860
|
+
get children() {
|
|
861
|
+
return I(w, z({
|
|
862
|
+
ref: [((e) => {
|
|
863
|
+
u(e), r.store.setPositionerElement(e);
|
|
864
|
+
}), s.ref],
|
|
865
|
+
role: "presentation",
|
|
866
|
+
get hidden() {
|
|
867
|
+
return !r.presence.mounted();
|
|
868
|
+
},
|
|
869
|
+
get inert() {
|
|
870
|
+
return !r.store.open() || void 0;
|
|
871
|
+
},
|
|
872
|
+
get class() {
|
|
873
|
+
return v();
|
|
874
|
+
},
|
|
875
|
+
get style() {
|
|
876
|
+
return y();
|
|
877
|
+
}
|
|
878
|
+
}, b, x));
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
function Ze(e) {
|
|
883
|
+
return typeof e == "function" ? e() : e && "current" in e ? e.current : e;
|
|
884
|
+
}
|
|
885
|
+
//#endregion
|
|
886
|
+
//#region src/navigation-menu/popup/NavigationMenuPopup.tsx
|
|
887
|
+
var Qe = /* @__PURE__ */ H("<nav>");
|
|
888
|
+
function $e(e) {
|
|
889
|
+
let r = Q(), i = Je(), s = e, l = e, u = K(() => s.id ?? r.store.context.floatingId), d = K(() => ({
|
|
890
|
+
open: r.store.open(),
|
|
891
|
+
transitionStatus: r.store.track().transitionStatus,
|
|
892
|
+
side: i.renderedSide(),
|
|
893
|
+
align: i.renderedAlign(),
|
|
894
|
+
anchorHidden: i.anchorHidden()
|
|
895
|
+
})), f = K(() => a(e.class, d())), p = K(() => {
|
|
896
|
+
let e = i.renderedSide(), t = e === "left" || e === "inline-start";
|
|
897
|
+
return e === "top" || t ? {
|
|
898
|
+
position: "absolute",
|
|
899
|
+
[e === "top" ? "bottom" : "top"]: "0",
|
|
900
|
+
[t ? "right" : "left"]: "0"
|
|
901
|
+
} : {};
|
|
902
|
+
}), m = K(() => $(p(), o(e.style, d()))), h = K(() => n(d(), k)), g = J(l, "render", "class", "id", "onKeyDown", "ref", "style"), _ = c(() => s.onKeyDown, () => (e) => {
|
|
903
|
+
let t = r.store.state.popupProps.onKeyDown;
|
|
904
|
+
typeof t == "function" && t(e);
|
|
905
|
+
}), v = null;
|
|
906
|
+
G(() => u(), (e) => r.store.setPopupId(e)), Y(() => {
|
|
907
|
+
r.store.state.popupElement === v && r.store.setPopupElement(null);
|
|
908
|
+
});
|
|
909
|
+
let y = () => X(() => {
|
|
910
|
+
let e = r.store.openChangeReason();
|
|
911
|
+
return e !== "trigger-hover" && e !== "outside-press" && e !== "focus-out";
|
|
912
|
+
}), b = t(e, () => d(), (e) => (() => {
|
|
913
|
+
var t = L(Qe);
|
|
914
|
+
return V(t, e, !1), B(), t;
|
|
915
|
+
})());
|
|
916
|
+
return I(A, {
|
|
917
|
+
get context() {
|
|
918
|
+
return r.store.context.floatingRoot;
|
|
919
|
+
},
|
|
920
|
+
get tree() {
|
|
921
|
+
return r.store.tree;
|
|
922
|
+
},
|
|
923
|
+
get disabled() {
|
|
924
|
+
return !r.presence.mounted();
|
|
925
|
+
},
|
|
926
|
+
initialFocus: !1,
|
|
927
|
+
returnFocus: y,
|
|
928
|
+
restoreFocus: "popup",
|
|
929
|
+
modal: !1,
|
|
930
|
+
get openInteractionType() {
|
|
931
|
+
return r.store.openMethod();
|
|
932
|
+
},
|
|
933
|
+
get previousFocusableElement() {
|
|
934
|
+
return r.store.track().activeTriggerElement;
|
|
935
|
+
},
|
|
936
|
+
get nextFocusableElement() {
|
|
937
|
+
return r.afterTriggerGuard;
|
|
938
|
+
},
|
|
939
|
+
get beforeContentGuardRef() {
|
|
940
|
+
return r.setBeforeContentGuard;
|
|
941
|
+
},
|
|
942
|
+
get children() {
|
|
943
|
+
return I(b, z({
|
|
944
|
+
ref: [((e) => {
|
|
945
|
+
v = e, r.store.setPopupElement(e);
|
|
946
|
+
}), s.ref],
|
|
947
|
+
get id() {
|
|
948
|
+
return u();
|
|
949
|
+
},
|
|
950
|
+
tabIndex: -1,
|
|
951
|
+
"data-base-ui-focusable": "",
|
|
952
|
+
get class() {
|
|
953
|
+
return f();
|
|
954
|
+
},
|
|
955
|
+
get style() {
|
|
956
|
+
return m();
|
|
957
|
+
},
|
|
958
|
+
onKeyDown: _
|
|
959
|
+
}, h, g));
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
}
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/navigation-menu/viewport/NavigationMenuViewport.tsx
|
|
965
|
+
var et = /* @__PURE__ */ H("<div>");
|
|
966
|
+
function tt(e) {
|
|
967
|
+
let n = Q(), r = Je(!0) !== void 0, i = e, s = e, c = {}, l = K(() => a(e.class, c)), d = K(() => o(e.style, c)), f = J(s, "render", "children", "class", "ref", "style"), p = null, m = null, h = null, g = (e) => {
|
|
968
|
+
p = e, n.store.setViewportElement(e), r && (m = e, n.store.setViewportTarget(e));
|
|
969
|
+
};
|
|
970
|
+
Y(() => {
|
|
971
|
+
n.store.viewportElement() === p && n.store.setViewportElement(null), n.store.viewportTarget() === m && n.store.setViewportTarget(null), !r && n.beforeContentGuard() && n.setBeforeContentGuard(null);
|
|
972
|
+
});
|
|
973
|
+
let _ = t(e, () => c, (e) => (() => {
|
|
974
|
+
var t = L(et);
|
|
975
|
+
return V(t, e, !1), B(), t;
|
|
976
|
+
})()), v = I(_, z({
|
|
977
|
+
ref: [g, i.ref],
|
|
978
|
+
get class() {
|
|
979
|
+
return l();
|
|
980
|
+
},
|
|
981
|
+
get style() {
|
|
982
|
+
return d();
|
|
983
|
+
}
|
|
984
|
+
}, f, { get children() {
|
|
985
|
+
return I(U, {
|
|
986
|
+
when: !r,
|
|
987
|
+
get fallback() {
|
|
988
|
+
return e.children;
|
|
989
|
+
},
|
|
990
|
+
get children() {
|
|
991
|
+
var t = L(et);
|
|
992
|
+
return de(() => (e) => {
|
|
993
|
+
m = e, n.store.setViewportTarget(e);
|
|
994
|
+
}, t), ue(t, fe(() => e.children)), t;
|
|
995
|
+
}
|
|
996
|
+
});
|
|
997
|
+
} }));
|
|
998
|
+
return r ? v : [
|
|
999
|
+
I(D, {
|
|
1000
|
+
ref: (e) => n.setBeforeContentGuard(e),
|
|
1001
|
+
onFocus: (e) => {
|
|
1002
|
+
let t = n.store.viewportTarget();
|
|
1003
|
+
t && (u(t, e.relatedTarget) ? n.store.track().activeTriggerElement?.focus() : ne(t)[0]?.focus());
|
|
1004
|
+
}
|
|
1005
|
+
}),
|
|
1006
|
+
v,
|
|
1007
|
+
I(D, {
|
|
1008
|
+
ref: (e) => h = e,
|
|
1009
|
+
onFocus: (e) => {
|
|
1010
|
+
let t = n.store.viewportTarget();
|
|
1011
|
+
if (t) {
|
|
1012
|
+
if (u(t, e.relatedTarget)) te(h)?.focus();
|
|
1013
|
+
else {
|
|
1014
|
+
let e = ne(t);
|
|
1015
|
+
e[e.length - 1]?.focus();
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
})
|
|
1020
|
+
];
|
|
1021
|
+
}
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/navigation-menu/arrow/NavigationMenuArrow.tsx
|
|
1024
|
+
var nt = /* @__PURE__ */ H("<div>");
|
|
1025
|
+
function rt(e) {
|
|
1026
|
+
let r = Q(), i = Je(), s = e, c = e, l = K(() => ({
|
|
1027
|
+
open: r.store.open(),
|
|
1028
|
+
side: i.renderedSide(),
|
|
1029
|
+
align: i.renderedAlign(),
|
|
1030
|
+
uncentered: i.arrowUncentered()
|
|
1031
|
+
})), u = K(() => a(e.class, l())), d = K(() => $(i.arrowStyles(), o(e.style, l()))), f = K(() => n(l(), ie)), p = J(c, "render", "class", "ref", "style"), m = null;
|
|
1032
|
+
Y(() => {
|
|
1033
|
+
m && i.setArrowElement(null);
|
|
1034
|
+
});
|
|
1035
|
+
let h = t(e, () => l(), (e) => (() => {
|
|
1036
|
+
var t = L(nt);
|
|
1037
|
+
return V(t, e, !1), B(), t;
|
|
1038
|
+
})());
|
|
1039
|
+
return I(h, z({
|
|
1040
|
+
ref: [((e) => {
|
|
1041
|
+
m = e, i.setArrowElement(e);
|
|
1042
|
+
}), s.ref],
|
|
1043
|
+
"aria-hidden": "true",
|
|
1044
|
+
get class() {
|
|
1045
|
+
return u();
|
|
1046
|
+
},
|
|
1047
|
+
get style() {
|
|
1048
|
+
return d();
|
|
1049
|
+
}
|
|
1050
|
+
}, f, p));
|
|
1051
|
+
}
|
|
1052
|
+
//#endregion
|
|
1053
|
+
//#region src/navigation-menu/index.parts.ts
|
|
1054
|
+
var it = /* @__PURE__ */ e({
|
|
1055
|
+
Arrow: () => rt,
|
|
1056
|
+
Backdrop: () => Ge,
|
|
1057
|
+
Content: () => Le,
|
|
1058
|
+
Icon: () => Pe,
|
|
1059
|
+
Item: () => Ae,
|
|
1060
|
+
Link: () => ze,
|
|
1061
|
+
List: () => Te,
|
|
1062
|
+
Popup: () => $e,
|
|
1063
|
+
Portal: () => Ue,
|
|
1064
|
+
Positioner: () => Xe,
|
|
1065
|
+
Root: () => ye,
|
|
1066
|
+
Trigger: () => Me,
|
|
1067
|
+
Viewport: () => tt
|
|
1068
|
+
});
|
|
1069
|
+
//#endregion
|
|
1070
|
+
export { it as t };
|