solid-baseui 0.1.0-alpha.0 → 0.1.0-alpha.2
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 +72 -0
- package/README.md +133 -15
- package/dist/lib/client/DialogHandle-DluOK_7u.js +521 -0
- package/dist/lib/client/DialogPopup-CfEb3F54.js +138 -0
- package/dist/lib/client/FieldControl-eDe-Jnp9.js +142 -0
- package/dist/lib/client/{FieldRootContext-izCEh80D.js → FieldRootContext-D3fuVjs3.js} +1 -1
- package/dist/lib/client/{FocusManager-grSdNHqW.js → FocusManager-q7z7PMV1.js} +94 -91
- package/dist/lib/client/{FormContext-BB05lWOI.js → FormContext-CwLBtm_d.js} +1 -0
- package/dist/lib/client/{InternalBackdrop-cSK13gaM.js → InternalBackdrop-B8_lfUvf.js} +1 -1
- package/dist/lib/client/{LabelableContext-DKsB0fIx.js → LabelableContext-CmQF-TX2.js} +3 -6
- package/dist/lib/client/MenuSubmenuTrigger-DMb5CwTF.js +1584 -0
- package/dist/lib/client/{PopupHandle-CcJG4NMy.js → PopupHandle-DyX5gY1e.js} +17 -11
- package/dist/lib/client/{PopupStore-DjB-wO88.js → PopupStore-BjRwcvbG.js} +138 -115
- package/dist/lib/client/PopupViewport-BanYHrD-.js +154 -0
- package/dist/lib/client/Separator-D5oJzlA3.js +27 -0
- package/dist/lib/client/TriggerFocusGuards-Fzspp3Y1.js +51 -0
- package/dist/lib/client/accordion/index.js +1 -1
- package/dist/lib/client/accordion-CA2DfX67.js +381 -0
- package/dist/lib/client/alert-dialog/index.js +1 -1
- package/dist/lib/client/{alert-dialog-BH_3ndio.js → alert-dialog-Bup88Dpx.js} +2 -2
- package/dist/lib/client/autocomplete/index.js +1 -1
- package/dist/lib/client/{autocomplete-Cob_FZEP.js → autocomplete-oyy_uRpU.js} +30 -25
- package/dist/lib/client/avatar/index.js +1 -1
- package/dist/lib/client/avatar-DNZ4fnBd.js +191 -0
- package/dist/lib/client/button/index.js +1 -1
- package/dist/lib/client/button-BJZYmCVv.js +88 -0
- package/dist/lib/client/checkbox/index.js +1 -1
- package/dist/lib/client/checkbox-group/index.js +1 -1
- package/dist/lib/client/checkbox-group-DGyrciZJ.js +135 -0
- package/dist/lib/client/checkbox-sQHYTbpB.js +425 -0
- package/dist/lib/client/collapsible/index.js +1 -1
- package/dist/lib/client/collapsible-BENbFFCc.js +230 -0
- package/dist/lib/client/combobox/index.js +2 -2
- package/dist/lib/client/combobox-BGH8QLXH.js +401 -0
- package/dist/lib/client/compositeNavigation-DCt1sQon.js +82 -0
- package/dist/lib/client/{constants-BYjBUIIi.js → constants-ByOMFJAe.js} +105 -101
- package/dist/lib/client/context-menu/index.js +1 -1
- package/dist/lib/client/context-menu-xQ1sBCET.js +220 -0
- package/dist/lib/client/{createAnchorPositioning-DcxDXUgB.js → createAnchorPositioning-DCXIApS1.js} +149 -146
- package/dist/lib/client/{createAnchoredPopupScrollLock-Cx0cbh1_.js → createAnchoredPopupScrollLock-BxKpJbCE.js} +2 -2
- package/dist/lib/client/{createClickInteraction-CTaIFBiV.js → createClickInteraction-BeBsTqtY.js} +1 -1
- package/dist/lib/client/{createCollapsiblePanel-DeDu0O2t.js → createCollapsiblePanel-BQ8r4RTi.js} +1 -1
- package/dist/lib/client/createFocusInteraction-DQPWkZe2.js +60 -0
- package/dist/lib/client/createLabelableId-DxJRwMUJ.js +14 -0
- package/dist/lib/client/{createPopupAutoResize-CGNiLhGq.js → createPopupAutoResize-CSNpMz5v.js} +4 -4
- 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-C0EF0a5u.js} +2 -2
- package/dist/lib/client/{dom-BEAeQ9Eb.js → dom-lDdayFF_.js} +25 -15
- package/dist/lib/client/drawer/index.js +1 -1
- package/dist/lib/client/drawer-uKoNBwDU.js +1540 -0
- package/dist/lib/client/field/index.js +1 -1
- package/dist/lib/client/field-DIMrgpBW.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-Bqq8wSLY.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-YthuKwIE.js} +1 -1
- package/dist/lib/client/internals/composeEventHandlers.js +14 -8
- package/dist/lib/client/internals/field-root-context/index.js +2 -2
- 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/{mergeStyleValue-C4ITiiIV.js → isSolidAccessor-BH_FevwH.js} +8 -15
- package/dist/lib/client/menu/index.js +1 -1
- package/dist/lib/client/menu-4rNLN6aX.js +334 -0
- package/dist/lib/client/menubar/index.js +1 -1
- package/dist/lib/client/menubar-nFQGtNmY.js +163 -0
- package/dist/lib/client/mergeStyleValue-Dcd36yxZ.js +12 -0
- 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-BbRyun3a.js +1070 -0
- package/dist/lib/client/number-field/index.js +1 -1
- package/dist/lib/client/number-field-hT_H0hVu.js +1043 -0
- package/dist/lib/client/otp-field/index.js +1 -1
- package/dist/lib/client/otp-field-lsy2iGID.js +584 -0
- package/dist/lib/client/popover/index.js +1 -1
- package/dist/lib/client/popover-Cmvmuf1L.js +940 -0
- package/dist/lib/client/popupStateMapping-nhukB8NK.js +371 -0
- package/dist/lib/client/preview-card/index.js +1 -1
- package/dist/lib/client/preview-card-Dtu8AnBN.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-CeCU-Qqi.js +284 -0
- package/dist/lib/client/radio-group/index.js +1 -1
- package/dist/lib/client/radio-group-NbuJvjQe.js +195 -0
- package/dist/lib/client/runOnceAnimationsFinish-CFADb4CN.js +49 -0
- package/dist/lib/client/{safePolygon--bbKn0c8.js → safePolygon-DVAR5dQD.js} +74 -70
- package/dist/lib/client/scroll-area/index.js +1 -1
- package/dist/lib/client/scroll-area-DqbvoAd7.js +717 -0
- package/dist/lib/client/{scrollable-SRNYlhF7.js → scrollable-BVaDUXng.js} +12 -12
- package/dist/lib/client/select/index.js +1 -1
- package/dist/lib/client/select-Dad51Xbn.js +1934 -0
- package/dist/lib/client/separator/index.js +1 -1
- package/dist/lib/client/slider/index.js +1 -1
- package/dist/lib/client/slider-CLSKFq_M.js +927 -0
- package/dist/lib/client/switch/index.js +1 -1
- package/dist/lib/client/switch-Bzuu5EIg.js +306 -0
- package/dist/lib/client/tabs/index.js +1 -1
- package/dist/lib/client/tabs-DWiBDv8D.js +695 -0
- package/dist/lib/client/toast/index.js +1 -1
- package/dist/lib/client/toast-DmtPJW2k.js +1118 -0
- package/dist/lib/client/toggle/index.js +1 -1
- package/dist/lib/client/toggle-CAe-Z8Xn.js +142 -0
- package/dist/lib/client/toggle-group/index.js +1 -1
- package/dist/lib/client/toggle-group-BbQg5s-m.js +134 -0
- package/dist/lib/client/toolbar/index.js +1 -1
- package/dist/lib/client/toolbar-BXT_g-oX.js +504 -0
- package/dist/lib/client/tooltip/index.js +1 -1
- package/dist/lib/client/tooltip-h2r2_Xuo.js +850 -0
- package/dist/lib/client/use-render/index.js +2 -0
- package/dist/lib/client/useFilteredItems-BX0BEuSI.js +2301 -0
- package/dist/lib/client/useRender-CxZ8PI-g.js +12 -0
- package/dist/lib/server/{DialogHandle-ATZlm9RC.js → DialogHandle-BGIISmG7.js} +37 -46
- package/dist/lib/server/{DialogPopup-BebI-w5P.js → DialogPopup-C2ZDGf42.js} +12 -15
- package/dist/lib/server/{FieldControl-Y_kI7ARp.js → FieldControl-CDMMyvuj.js} +62 -26
- package/dist/lib/server/{FieldRootContext-IC-LWzVp.js → FieldRootContext-Bfpna6gA.js} +3 -3
- package/dist/lib/server/{FocusManager-BrbZVWME.js → FocusManager-D-xgblGs.js} +9 -5
- package/dist/lib/server/{FormContext-pvESt85v.js → FormContext-CYwo_ZnB.js} +1 -0
- package/dist/lib/server/{InternalBackdrop-C_iDPVR-.js → InternalBackdrop-D_2zAWnl.js} +1 -1
- package/dist/lib/server/{LabelableContext-DZP3rgAY.js → LabelableContext-BTeF0IWb.js} +4 -6
- package/dist/lib/server/{MenuSubmenuTrigger-DA4gsv6z.js → MenuSubmenuTrigger-BMQKlOvU.js} +177 -210
- package/dist/lib/server/{PopupHandle-DthPgNjy.js → PopupHandle-QNj4mED2.js} +14 -5
- package/dist/lib/server/{PopupStore-DEs3FAEe.js → PopupStore-evylvVnN.js} +42 -15
- package/dist/lib/server/{PopupViewport-3r_KTFwX.js → PopupViewport-BDttjORN.js} +38 -28
- package/dist/lib/server/{Separator-vhhYxWGr.js → Separator-DTvtnxzP.js} +4 -6
- package/dist/lib/server/TriggerFocusGuards-B9GNbLrL.js +61 -0
- package/dist/lib/server/accordion/index.js +39 -77
- 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 +14 -15
- package/dist/lib/server/checkbox/index.js +37 -64
- package/dist/lib/server/checkbox-group/index.js +21 -11
- package/dist/lib/server/collapsible/index.js +42 -49
- package/dist/lib/server/combobox/index.js +79 -50
- package/dist/lib/server/{compositeNavigation-BRVT1C38.js → compositeNavigation-D5jKM4yk.js} +32 -1
- package/dist/lib/server/{constants-9H__9xbS.js → constants-ByqXubhO.js} +10 -5
- package/dist/lib/server/context-menu/index.js +14 -16
- package/dist/lib/server/{createAnchorPositioning-C-cVOPwz.js → createAnchorPositioning-DrQYe7RS.js} +12 -7
- package/dist/lib/server/{createAnchoredPopupScrollLock-DFuUrykR.js → createAnchoredPopupScrollLock-q6gnOSmv.js} +2 -2
- package/dist/lib/server/{createClickInteraction-BYsMgvup.js → createClickInteraction-D7oc1Vco.js} +1 -1
- package/dist/lib/server/{createCollapsiblePanel-DTyVJz0G.js → createCollapsiblePanel-B45kTe6v.js} +1 -1
- package/dist/lib/server/{createFocusInteraction-EIS0QOel.js → createFocusInteraction-DFKr4G7a.js} +22 -2
- package/dist/lib/server/createLabelableId-WMUKtY6s.js +18 -0
- package/dist/lib/server/{createPopupAutoResize-DO50jjNX.js → createPopupAutoResize-Cg0-lLf4.js} +2 -2
- 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/{dom-Crg_2R-j.js → dom-D8_aB1yy.js} +14 -1
- package/dist/lib/server/drawer/index.js +96 -100
- package/dist/lib/server/field/index.js +110 -98
- package/dist/lib/server/fieldset/index.js +13 -16
- package/dist/lib/server/form/index.js +18 -14
- package/dist/lib/server/index.js +5 -3
- package/dist/lib/server/input/index.js +1 -1
- package/dist/lib/server/internals/composeEventHandlers.js +15 -9
- package/dist/lib/server/internals/field-root-context/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/{mergeStyleValue-Db8bRCM4.js → isSolidAccessor-CZpzAH5l.js} +7 -21
- package/dist/lib/server/menu/index.js +30 -29
- package/dist/lib/server/menubar/index.js +10 -35
- package/dist/lib/server/mergeStyleValue-DecVaoac.js +20 -0
- package/dist/lib/server/meter/index.js +20 -32
- package/dist/lib/server/navigation-menu/index.js +67 -138
- package/dist/lib/server/number-field/index.js +64 -62
- package/dist/lib/server/otp-field/index.js +19 -22
- package/dist/lib/server/popover/index.js +61 -77
- package/dist/lib/server/{popupStateMapping-nKoUwoke.js → popupStateMapping-VHqr6M4H.js} +19 -17
- package/dist/lib/server/preview-card/index.js +39 -50
- package/dist/lib/server/progress/index.js +21 -33
- package/dist/lib/server/radio/index.js +24 -45
- package/dist/lib/server/radio-group/index.js +12 -13
- package/dist/lib/server/{runOnceAnimationsFinish-DCHzXWZU.js → runOnceAnimationsFinish-CYq38H8J.js} +2 -1
- package/dist/lib/server/{safePolygon-CAm5RJGv.js → safePolygon-B8QtiIZ3.js} +6 -1
- package/dist/lib/server/scroll-area/index.js +40 -49
- package/dist/lib/server/{scrollable-CjsSxbGr.js → scrollable-C9Pgq8T5.js} +1 -1
- package/dist/lib/server/select/index.js +128 -213
- package/dist/lib/server/separator/index.js +1 -1
- package/dist/lib/server/slider/index.js +39 -52
- package/dist/lib/server/switch/index.js +22 -32
- package/dist/lib/server/tabs/index.js +197 -137
- package/dist/lib/server/toast/index.js +78 -95
- package/dist/lib/server/toggle/index.js +11 -13
- package/dist/lib/server/toggle-group/index.js +11 -9
- package/dist/lib/server/toolbar/index.js +76 -93
- package/dist/lib/server/tooltip/index.js +53 -57
- package/dist/lib/server/use-render/index.js +2 -0
- package/dist/lib/server/{useFilteredItems-DvuctLt3.js → useFilteredItems-BmhL0nf1.js} +335 -316
- 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 +7 -7
- 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/chip/ComboboxChip.d.ts +2 -0
- 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 +17 -8
- package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +2 -0
- package/dist/lib/types/combobox/store/ComboboxStore.d.ts +1 -0
- package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +1 -0
- package/dist/lib/types/combobox/utils/handleInputPress.d.ts +1 -1
- 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/control/FieldControl.d.ts +5 -5
- 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/composeEventHandlers.d.ts +9 -2
- package/dist/lib/types/internals/createTransitionStatus.d.ts +1 -1
- package/dist/lib/types/internals/field-root-context/FieldRootContext.d.ts +1 -0
- 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/internals/overlay/dom.d.ts +2 -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/input/NumberFieldInput.d.ts +5 -5
- 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/slider/track/SliderTrack.d.ts +2 -2
- 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 +10 -3
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +10 -4
- 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/PopupViewport-DgrIqQea.js +0 -152
- 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/compositeNavigation-sxniYTc7.js +0 -58
- 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
|
@@ -1,1108 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { getStateAttributesProps as t } from "./internals/getStateAttributesProps.js";
|
|
3
|
-
import { n, t as r } from "./resolveStyle-XcgAuaKR.js";
|
|
4
|
-
import { transitionStatusMapping as i } from "./internals/stateAttributesMapping.js";
|
|
5
|
-
import { composeEventHandlers as a } from "./internals/composeEventHandlers.js";
|
|
6
|
-
import { t as o } from "./runOnceAnimationsFinish-15EM-Z4l.js";
|
|
7
|
-
import { a as s, m as c, n as l, p as u, r as d, t as f } from "./dom-BEAeQ9Eb.js";
|
|
8
|
-
import { t as p } from "./createAnchorPositioning-DcxDXUgB.js";
|
|
9
|
-
import { _ as m, g as h, n as g, o as _ } from "./popupStateMapping-C9eZl19i.js";
|
|
10
|
-
import { a as v, i as y, n as b, r as x, t as S } from "./buttonSemantics-paljfpOX.js";
|
|
11
|
-
import { t as C } from "./setRef-fXF6OIo3.js";
|
|
12
|
-
import { n as w } from "./DirectionContext-BwMabICS.js";
|
|
13
|
-
import { a as ee, i as T, n as E, t as te } from "./constants-BYjBUIIi.js";
|
|
14
|
-
import { Dynamic as D, createComponent as O, effect as ne, getNextElement as k, insert as re, memo as A, mergeProps as j, style as ie, template as M } from "@solidjs/web";
|
|
15
|
-
import { For as ae, Show as N, children as P, createContext as F, createEffect as I, createMemo as L, createSignal as R, createUniqueId as z, flush as oe, omit as B, onCleanup as se, untrack as V, useContext as H } from "solid-js";
|
|
16
|
-
//#region src/toast/utils/focusVisible.ts
|
|
17
|
-
function U(e) {
|
|
18
|
-
if (!e) return !0;
|
|
19
|
-
try {
|
|
20
|
-
return e.matches(":focus-visible");
|
|
21
|
-
} catch {
|
|
22
|
-
return !0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/toast/utils/generateToastId.ts
|
|
27
|
-
var W = 0;
|
|
28
|
-
function G(e = "toast") {
|
|
29
|
-
return W += 1, `${e}-${Math.random().toString(36).slice(2, 6)}-${W}`;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region src/toast/utils/resolvePromiseOptions.ts
|
|
33
|
-
function K(e, t) {
|
|
34
|
-
if (typeof e == "string") return { description: e };
|
|
35
|
-
if (typeof e == "function") {
|
|
36
|
-
let n = e(t);
|
|
37
|
-
return typeof n == "string" ? { description: n } : n;
|
|
38
|
-
}
|
|
39
|
-
return e;
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/toast/store/ToastStore.ts
|
|
43
|
-
function q(e) {
|
|
44
|
-
let t = /* @__PURE__ */ new Map(), n = 0, r = 0;
|
|
45
|
-
return e.forEach((e, i) => {
|
|
46
|
-
let a = e.transitionStatus === "ending";
|
|
47
|
-
t.set(e.id, {
|
|
48
|
-
value: e,
|
|
49
|
-
domIndex: i,
|
|
50
|
-
visibleIndex: a ? -1 : n,
|
|
51
|
-
offsetY: r
|
|
52
|
-
}), r += e.height || 0, a || (n += 1);
|
|
53
|
-
}), t;
|
|
54
|
-
}
|
|
55
|
-
function J(e, t) {
|
|
56
|
-
let n = 0;
|
|
57
|
-
return e.map((e) => {
|
|
58
|
-
if (e.transitionStatus === "ending") return e;
|
|
59
|
-
let r = n >= t;
|
|
60
|
-
return n += 1, e.limited === r ? e : {
|
|
61
|
-
...e,
|
|
62
|
-
limited: r
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
var Y = {
|
|
67
|
-
toasts: (e) => e.toasts,
|
|
68
|
-
isEmpty: (e) => e.toasts.length === 0,
|
|
69
|
-
toast: (e, t) => e.toastMetadata.get(t)?.value,
|
|
70
|
-
toastIndex: (e, t) => e.toastMetadata.get(t)?.domIndex ?? -1,
|
|
71
|
-
toastOffsetY: (e, t) => e.toastMetadata.get(t)?.offsetY ?? 0,
|
|
72
|
-
toastVisibleIndex: (e, t) => e.toastMetadata.get(t)?.visibleIndex ?? -1,
|
|
73
|
-
focused: (e) => e.focused,
|
|
74
|
-
expanded: (e) => e.hovering || e.focused,
|
|
75
|
-
expandedOrOutOfFocus: (e) => e.hovering || e.focused || !e.isWindowFocused,
|
|
76
|
-
prevFocusElement: (e) => e.prevFocusElement
|
|
77
|
-
}, X = class extends m {
|
|
78
|
-
timers = /* @__PURE__ */ new Map();
|
|
79
|
-
areTimersPaused = !1;
|
|
80
|
-
constructor(e) {
|
|
81
|
-
super({
|
|
82
|
-
...e,
|
|
83
|
-
toastMetadata: q(e.toasts)
|
|
84
|
-
}, {});
|
|
85
|
-
}
|
|
86
|
-
setViewport = (e) => {
|
|
87
|
-
this.set("viewport", e);
|
|
88
|
-
};
|
|
89
|
-
syncProviderProps(e, t) {
|
|
90
|
-
let n = this.state.limit !== t;
|
|
91
|
-
if (this.state.timeout === e && !n) return;
|
|
92
|
-
let r = {
|
|
93
|
-
timeout: e,
|
|
94
|
-
limit: t
|
|
95
|
-
};
|
|
96
|
-
if (n) {
|
|
97
|
-
let e = J(this.state.toasts, t);
|
|
98
|
-
r.toasts = e, r.toastMetadata = q(e);
|
|
99
|
-
}
|
|
100
|
-
this.update(r);
|
|
101
|
-
}
|
|
102
|
-
dispose = () => {
|
|
103
|
-
this.timers.forEach((e) => this.stopTimer(e)), this.timers.clear();
|
|
104
|
-
};
|
|
105
|
-
removeToast(e, t = !1) {
|
|
106
|
-
let n = Y.toastIndex(this.state, e);
|
|
107
|
-
if (n === -1) return;
|
|
108
|
-
let r = this.state.toasts[n];
|
|
109
|
-
t || r?.onRemove?.();
|
|
110
|
-
let i = [...this.state.toasts];
|
|
111
|
-
i.splice(n, 1), this.setToasts(i);
|
|
112
|
-
}
|
|
113
|
-
addToast = (e) => {
|
|
114
|
-
let { timeout: t, limit: n } = this.state, r = e.id || G();
|
|
115
|
-
if (e.id) {
|
|
116
|
-
let t = Y.toast(this.state, e.id);
|
|
117
|
-
if (t) {
|
|
118
|
-
if (t.transitionStatus === "ending") this.removeToast(e.id, !0);
|
|
119
|
-
else {
|
|
120
|
-
let t = { ...e };
|
|
121
|
-
return delete t.id, delete t.transitionStatus, this.updateToastInternal(e.id, t, !0, !0), e.id;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
let i = {
|
|
126
|
-
...e,
|
|
127
|
-
id: r,
|
|
128
|
-
updateKey: 0,
|
|
129
|
-
transitionStatus: "starting"
|
|
130
|
-
}, a = [i, ...this.state.toasts];
|
|
131
|
-
this.setToasts(J(a, n));
|
|
132
|
-
let o = i.timeout ?? t;
|
|
133
|
-
return i.type !== "loading" && o > 0 && this.scheduleTimer(r, o, () => this.closeToast(r)), Y.expandedOrOutOfFocus(this.state) && this.pauseTimers(), r;
|
|
134
|
-
};
|
|
135
|
-
updateToast = (e, t) => {
|
|
136
|
-
this.updateToastInternal(e, t, !1, !0);
|
|
137
|
-
};
|
|
138
|
-
updateToastInternal = (e, t, n = !1, r = !1) => {
|
|
139
|
-
let { timeout: i, toasts: a } = this.state, o = Y.toast(this.state, e);
|
|
140
|
-
if (!o || o.transitionStatus === "ending") return;
|
|
141
|
-
let s = {
|
|
142
|
-
...o,
|
|
143
|
-
...t,
|
|
144
|
-
...r && { updateKey: o.updateKey + 1 }
|
|
145
|
-
};
|
|
146
|
-
this.setToasts(a.map((t) => t.id === e ? s : t));
|
|
147
|
-
let c = s.timeout ?? i, l = o.timeout ?? i, u = Object.hasOwn(t, "timeout"), d = s.transitionStatus !== "ending" && s.type !== "loading" && c > 0, f = this.timers.has(e), p = l !== c, m = o.type === "loading";
|
|
148
|
-
if (!d && f) {
|
|
149
|
-
this.clearTimer(e);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
d && (!f || p || u || m || n) && (this.clearTimer(e), this.scheduleTimer(e, c, () => this.closeToast(e)), Y.expandedOrOutOfFocus(this.state) && this.pauseTimers());
|
|
153
|
-
};
|
|
154
|
-
closeToast = (e) => {
|
|
155
|
-
let t = e === void 0, { limit: n, toasts: r } = this.state, i;
|
|
156
|
-
if (t) i = r, this.clearTimers();
|
|
157
|
-
else {
|
|
158
|
-
let t = Y.toast(this.state, e);
|
|
159
|
-
if (!t) return;
|
|
160
|
-
i = [t], this.clearTimer(e);
|
|
161
|
-
}
|
|
162
|
-
let a = J(r.map((n) => t || n.id === e ? {
|
|
163
|
-
...n,
|
|
164
|
-
transitionStatus: "ending",
|
|
165
|
-
height: 0
|
|
166
|
-
} : n), n);
|
|
167
|
-
this.setToasts(a, !a.some((e) => e.transitionStatus !== "ending")), i.forEach((e) => {
|
|
168
|
-
e.transitionStatus !== "ending" && e.onClose?.();
|
|
169
|
-
}), this.handleFocusManagement(e);
|
|
170
|
-
};
|
|
171
|
-
promiseToast = (e, t) => {
|
|
172
|
-
let n = K(t.loading), r = this.addToast({
|
|
173
|
-
...n,
|
|
174
|
-
type: "loading"
|
|
175
|
-
}), i = e.then((e) => {
|
|
176
|
-
let n = K(t.success, e);
|
|
177
|
-
return this.updateToast(r, {
|
|
178
|
-
...n,
|
|
179
|
-
type: "success",
|
|
180
|
-
timeout: n.timeout
|
|
181
|
-
}), e;
|
|
182
|
-
}).catch((e) => {
|
|
183
|
-
let n = K(t.error, e);
|
|
184
|
-
return this.updateToast(r, {
|
|
185
|
-
...n,
|
|
186
|
-
type: "error",
|
|
187
|
-
timeout: n.timeout
|
|
188
|
-
}), Promise.reject(e);
|
|
189
|
-
});
|
|
190
|
-
return Object.hasOwn(t, "setPromise") && t.setPromise(i), i;
|
|
191
|
-
};
|
|
192
|
-
pauseTimers() {
|
|
193
|
-
this.areTimersPaused || (this.areTimersPaused = !0, this.timers.forEach((e) => {
|
|
194
|
-
e.scheduled && (this.stopTimer(e), e.remaining = Math.max(e.remaining - (Date.now() - e.start), 0));
|
|
195
|
-
}));
|
|
196
|
-
}
|
|
197
|
-
resumeTimers() {
|
|
198
|
-
this.areTimersPaused && (this.areTimersPaused = !1, this.timers.forEach((e, t) => {
|
|
199
|
-
e.remaining = e.remaining > 0 ? e.remaining : e.delay, e.scheduled = !0, this.stopTimer(e), e.handle = setTimeout(() => {
|
|
200
|
-
e.handle = void 0, this.handleTimerFired(t), e.callback();
|
|
201
|
-
}, e.remaining), e.start = Date.now();
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
|
-
restoreFocusToPrevElement() {
|
|
205
|
-
this.state.prevFocusElement?.focus({ preventScroll: !0 });
|
|
206
|
-
}
|
|
207
|
-
handleDocumentPointerDown = (e) => {
|
|
208
|
-
if (e.pointerType !== "touch") return;
|
|
209
|
-
let t = d(e);
|
|
210
|
-
l(this.state.viewport, t) || (this.resumeTimers(), this.update({
|
|
211
|
-
hovering: !1,
|
|
212
|
-
focused: !1
|
|
213
|
-
}));
|
|
214
|
-
};
|
|
215
|
-
scheduleTimer(e, t, n) {
|
|
216
|
-
let r = Date.now(), i = !Y.expandedOrOutOfFocus(this.state), a = {
|
|
217
|
-
scheduled: i,
|
|
218
|
-
handle: void 0,
|
|
219
|
-
start: r,
|
|
220
|
-
delay: t,
|
|
221
|
-
remaining: t,
|
|
222
|
-
callback: n
|
|
223
|
-
};
|
|
224
|
-
i && (a.handle = setTimeout(() => {
|
|
225
|
-
a.handle = void 0, this.handleTimerFired(e), n();
|
|
226
|
-
}, t)), this.timers.set(e, a);
|
|
227
|
-
}
|
|
228
|
-
stopTimer(e) {
|
|
229
|
-
e.handle !== void 0 && (clearTimeout(e.handle), e.handle = void 0);
|
|
230
|
-
}
|
|
231
|
-
clearTimers() {
|
|
232
|
-
this.timers.forEach((e) => this.stopTimer(e)), this.timers.clear(), this.areTimersPaused = !1;
|
|
233
|
-
}
|
|
234
|
-
clearTimer(e) {
|
|
235
|
-
let t = this.timers.get(e);
|
|
236
|
-
t && this.stopTimer(t), this.timers.delete(e), this.resetPausedStateIfNoTimersRemain();
|
|
237
|
-
}
|
|
238
|
-
handleTimerFired(e) {
|
|
239
|
-
this.timers.delete(e), this.resetPausedStateIfNoTimersRemain();
|
|
240
|
-
}
|
|
241
|
-
resetPausedStateIfNoTimersRemain() {
|
|
242
|
-
this.timers.size === 0 && (this.areTimersPaused = !1);
|
|
243
|
-
}
|
|
244
|
-
setToasts(e, t = e.length === 0) {
|
|
245
|
-
let n = {
|
|
246
|
-
toasts: e,
|
|
247
|
-
toastMetadata: q(e)
|
|
248
|
-
};
|
|
249
|
-
t && (n.hovering = !1, n.focused = !1), this.update(n);
|
|
250
|
-
}
|
|
251
|
-
handleFocusManagement(e) {
|
|
252
|
-
let t = f(u(this.state.viewport));
|
|
253
|
-
if (!this.state.viewport || !l(this.state.viewport, t) || !U(t)) return;
|
|
254
|
-
if (e === void 0) {
|
|
255
|
-
this.restoreFocusToPrevElement();
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
let n = Y.toasts(this.state), r = Y.toastIndex(this.state, e), i = (e, t) => {
|
|
259
|
-
for (let r = e; r >= 0 && r < n.length; r += t) if (n[r].transitionStatus !== "ending") return n[r];
|
|
260
|
-
return null;
|
|
261
|
-
}, a = i(r + 1, 1) ?? i(r - 1, -1);
|
|
262
|
-
a ? a.element?.focus() : this.restoreFocusToPrevElement();
|
|
263
|
-
}
|
|
264
|
-
}, ce = Symbol("ToastProviderContext"), le = F(ce);
|
|
265
|
-
function ue() {
|
|
266
|
-
let e = H(le);
|
|
267
|
-
if (e === ce) throw Error("Base UI: useToastManager must be used within <Toast.Provider>.");
|
|
268
|
-
return e;
|
|
269
|
-
}
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/toast/provider/ToastProvider.tsx
|
|
272
|
-
function de(e) {
|
|
273
|
-
let t = new X({
|
|
274
|
-
timeout: V(() => e.timeout ?? 5e3),
|
|
275
|
-
limit: V(() => e.limit ?? 3),
|
|
276
|
-
viewport: null,
|
|
277
|
-
toasts: [],
|
|
278
|
-
hovering: !1,
|
|
279
|
-
focused: !1,
|
|
280
|
-
isWindowFocused: !0,
|
|
281
|
-
prevFocusElement: null
|
|
282
|
-
});
|
|
283
|
-
return se(t.dispose), I(() => ({
|
|
284
|
-
timeout: e.timeout ?? 5e3,
|
|
285
|
-
limit: e.limit ?? 3
|
|
286
|
-
}), ({ timeout: e, limit: n }) => {
|
|
287
|
-
t.syncProviderProps(e, n);
|
|
288
|
-
}), I(() => e.toastManager, (e) => {
|
|
289
|
-
if (e) return e[" subscribe"](({ action: e, options: n }) => {
|
|
290
|
-
let r = n.id;
|
|
291
|
-
e === "promise" && n.promise ? t.promiseToast(n.promise, n) : e === "update" && r ? t.updateToast(r, n) : e === "close" ? t.closeToast(r) : t.addToast(n);
|
|
292
|
-
});
|
|
293
|
-
}), O(le, {
|
|
294
|
-
value: t,
|
|
295
|
-
get children() {
|
|
296
|
-
return e.children;
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region src/toast/utils/mergeToastStyles.ts
|
|
302
|
-
function fe(e, t) {
|
|
303
|
-
if (typeof t == "string") {
|
|
304
|
-
let n = Object.entries(e).filter((e) => e[1] != null).map(([e, t]) => `${e}:${String(t)}`).join(";");
|
|
305
|
-
return n ? `${n};${t}` : t;
|
|
306
|
-
}
|
|
307
|
-
return {
|
|
308
|
-
...e,
|
|
309
|
-
...t || void 0
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region src/toast/viewport/ToastViewport.tsx
|
|
314
|
-
var pe = /* @__PURE__ */ M("<div>"), me = /* @__PURE__ */ M("<div role=alert aria-atomic=true><div></div><div>"), he = {
|
|
315
|
-
"clip-path": "inset(50%)",
|
|
316
|
-
overflow: "hidden",
|
|
317
|
-
"white-space": "nowrap",
|
|
318
|
-
border: 0,
|
|
319
|
-
padding: 0,
|
|
320
|
-
width: "1px",
|
|
321
|
-
height: "1px",
|
|
322
|
-
margin: "-1px",
|
|
323
|
-
position: "fixed",
|
|
324
|
-
top: 0,
|
|
325
|
-
left: 0
|
|
326
|
-
};
|
|
327
|
-
function ge(e) {
|
|
328
|
-
let i = ue(), o = e, s = e, p = !1, m = !1, g = !1, _, v = L(() => i.track().viewport), y = L(() => Y.isEmpty(i.track())), b = L(() => Y.toasts(i.track())), x = L(() => Y.focused(i.track())), S = L(() => Y.expanded(i.track())), C = L(() => Y.prevFocusElement(i.track())), w = L(() => b()[0]?.height), ee = L(() => b().some((e) => e.transitionStatus === "ending")), T = L(() => b().filter((e) => e.priority === "high"));
|
|
329
|
-
I(() => ({
|
|
330
|
-
empty: y(),
|
|
331
|
-
viewport: v()
|
|
332
|
-
}), ({ empty: e, viewport: t }) => {
|
|
333
|
-
if (!t || e) return;
|
|
334
|
-
let n = t, r = c(n), a = u(n);
|
|
335
|
-
function o(e) {
|
|
336
|
-
e.key === "F6" && d(e) !== n && (e.preventDefault(), i.set("prevFocusElement", f(a)), n.focus({ preventScroll: !0 }), i.pauseTimers(), i.set("focused", !0));
|
|
337
|
-
}
|
|
338
|
-
function s(e) {
|
|
339
|
-
d(e) === r && (i.set("isWindowFocused", !1), i.pauseTimers());
|
|
340
|
-
}
|
|
341
|
-
function p(e) {
|
|
342
|
-
if (e.relatedTarget) return;
|
|
343
|
-
let t = d(e), a = f(u(n));
|
|
344
|
-
(t === r || !l(n, t) || !U(a)) && i.resumeTimers(), clearTimeout(_), _ = setTimeout(() => i.set("isWindowFocused", !0), 0);
|
|
345
|
-
}
|
|
346
|
-
return r.addEventListener("keydown", o), r.addEventListener("blur", s, !0), r.addEventListener("focus", p, !0), a.addEventListener("pointerdown", i.handleDocumentPointerDown, !0), () => {
|
|
347
|
-
r.removeEventListener("keydown", o), r.removeEventListener("blur", s, !0), r.removeEventListener("focus", p, !0), a.removeEventListener("pointerdown", i.handleDocumentPointerDown, !0), clearTimeout(_);
|
|
348
|
-
};
|
|
349
|
-
});
|
|
350
|
-
function E(e) {
|
|
351
|
-
p = !0;
|
|
352
|
-
let t = e.relatedTarget === i.state.viewport ? V(b).find((e) => e.transitionStatus !== "ending" && !e.limited) : void 0;
|
|
353
|
-
t ? t.element?.focus() : i.restoreFocusToPrevElement();
|
|
354
|
-
}
|
|
355
|
-
function te(e) {
|
|
356
|
-
e.key === "Tab" && e.shiftKey && d(e) === i.state.viewport && (e.preventDefault(), i.restoreFocusToPrevElement());
|
|
357
|
-
}
|
|
358
|
-
function M() {
|
|
359
|
-
i.state.toasts.some((e) => e.transitionStatus === "ending") || g || !m || (i.state.isWindowFocused && i.resumeTimers(), i.set("hovering", !1), m = !1);
|
|
360
|
-
}
|
|
361
|
-
I(() => ee(), () => {
|
|
362
|
-
M();
|
|
363
|
-
});
|
|
364
|
-
function P() {
|
|
365
|
-
i.pauseTimers(), i.set("hovering", !0), m = !1;
|
|
366
|
-
}
|
|
367
|
-
function F() {
|
|
368
|
-
i.state.isWindowFocused && i.resumeTimers();
|
|
369
|
-
}
|
|
370
|
-
function R() {
|
|
371
|
-
m = !0, M();
|
|
372
|
-
}
|
|
373
|
-
function z(e) {
|
|
374
|
-
e.pointerType === "touch" && (g = !0);
|
|
375
|
-
}
|
|
376
|
-
function oe(e) {
|
|
377
|
-
e.pointerType === "touch" && (g = !1, M());
|
|
378
|
-
}
|
|
379
|
-
function se() {
|
|
380
|
-
if (p) {
|
|
381
|
-
p = !1;
|
|
382
|
-
return;
|
|
383
|
-
}
|
|
384
|
-
V(x) || U(f(u(i.state.viewport))) && (i.set("focused", !0), i.pauseTimers());
|
|
385
|
-
}
|
|
386
|
-
function H(e) {
|
|
387
|
-
!V(x) || l(i.state.viewport, e.relatedTarget) || (i.set("focused", !1), F());
|
|
388
|
-
}
|
|
389
|
-
let W = L(() => ({ expanded: S() })), G = L(() => n(e.class, W())), K = L(() => fe({ "--toast-frontmost-height": w() ? `${w()}px` : void 0 }, r(e.style, W()))), q = L(() => t(W())), J = L(() => !y() && !!C()), X = B(s, "as", "children", "class", "onBlur", "onClick", "onFocus", "onKeyDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onPointerCancel", "onPointerDown", "onPointerUp", "ref", "style"), ce = a(() => o.onBlur, () => H), le = a(() => o.onClick, () => se), de = a(() => o.onFocus, () => se), ge = a(() => o.onKeyDown, () => te), _e = a(() => o.onMouseEnter, () => P), ve = a(() => o.onMouseMove, () => P), Z = a(() => o.onMouseLeave, () => R), ye = a(() => o.onPointerDown, () => z), be = a(() => o.onPointerUp, () => oe), xe = a(() => o.onPointerCancel, () => oe);
|
|
390
|
-
return [
|
|
391
|
-
O(N, {
|
|
392
|
-
get when() {
|
|
393
|
-
return J();
|
|
394
|
-
},
|
|
395
|
-
get children() {
|
|
396
|
-
return O(h, { onFocus: E });
|
|
397
|
-
}
|
|
398
|
-
}),
|
|
399
|
-
O(D, j({
|
|
400
|
-
get component() {
|
|
401
|
-
return e.as ?? "div";
|
|
402
|
-
},
|
|
403
|
-
ref: [i.setViewport, o.ref],
|
|
404
|
-
tabIndex: -1,
|
|
405
|
-
role: "region",
|
|
406
|
-
"aria-live": "polite",
|
|
407
|
-
"aria-atomic": "false",
|
|
408
|
-
"aria-relevant": "additions text",
|
|
409
|
-
"aria-label": "Notifications",
|
|
410
|
-
get class() {
|
|
411
|
-
return G();
|
|
412
|
-
},
|
|
413
|
-
get style() {
|
|
414
|
-
return K();
|
|
415
|
-
},
|
|
416
|
-
onBlur: ce,
|
|
417
|
-
onClick: le,
|
|
418
|
-
onFocus: de,
|
|
419
|
-
onKeyDown: ge,
|
|
420
|
-
onMouseEnter: _e,
|
|
421
|
-
onMouseLeave: Z,
|
|
422
|
-
onMouseMove: ve,
|
|
423
|
-
onPointerCancel: xe,
|
|
424
|
-
onPointerDown: ye,
|
|
425
|
-
onPointerUp: be
|
|
426
|
-
}, q, X, { get children() {
|
|
427
|
-
return [
|
|
428
|
-
O(N, {
|
|
429
|
-
get when() {
|
|
430
|
-
return J();
|
|
431
|
-
},
|
|
432
|
-
get children() {
|
|
433
|
-
return O(h, { onFocus: E });
|
|
434
|
-
}
|
|
435
|
-
}),
|
|
436
|
-
A(() => e.children),
|
|
437
|
-
O(N, {
|
|
438
|
-
get when() {
|
|
439
|
-
return J();
|
|
440
|
-
},
|
|
441
|
-
get children() {
|
|
442
|
-
return O(h, { onFocus: E });
|
|
443
|
-
}
|
|
444
|
-
})
|
|
445
|
-
];
|
|
446
|
-
} })),
|
|
447
|
-
O(N, {
|
|
448
|
-
get when() {
|
|
449
|
-
return A(() => !x())() && T().length > 0;
|
|
450
|
-
},
|
|
451
|
-
get children() {
|
|
452
|
-
var e = k(pe);
|
|
453
|
-
return re(e, O(ae, {
|
|
454
|
-
get each() {
|
|
455
|
-
return T();
|
|
456
|
-
},
|
|
457
|
-
keyed: (e) => e.id,
|
|
458
|
-
children: (e) => (() => {
|
|
459
|
-
var t = k(me), n = t.firstChild, r = n.nextSibling;
|
|
460
|
-
return re(n, () => e().title), re(r, () => e().description), t;
|
|
461
|
-
})()
|
|
462
|
-
})), ne(() => he, (t, n) => {
|
|
463
|
-
ie(e, t, n);
|
|
464
|
-
}), e;
|
|
465
|
-
}
|
|
466
|
-
})
|
|
467
|
-
];
|
|
468
|
-
}
|
|
469
|
-
//#endregion
|
|
470
|
-
//#region src/toast/root/ToastRootContext.ts
|
|
471
|
-
var _e = Symbol("ToastRootContext"), ve = F(_e);
|
|
472
|
-
function Z() {
|
|
473
|
-
let e = H(ve);
|
|
474
|
-
if (e === _e) throw Error("Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.");
|
|
475
|
-
return e;
|
|
476
|
-
}
|
|
477
|
-
//#endregion
|
|
478
|
-
//#region src/toast/root/ToastRoot.tsx
|
|
479
|
-
var ye = {
|
|
480
|
-
...i,
|
|
481
|
-
swipeDirection(e) {
|
|
482
|
-
return e ? { "data-swipe-direction": e } : null;
|
|
483
|
-
}
|
|
484
|
-
}, be = 40, xe = 10, Se = .5, Ce = 1, we = `button,a,input,textarea,[role="button"],${`${te},${E}`}`, Te = ["down", "right"];
|
|
485
|
-
function Q(e) {
|
|
486
|
-
let i = ue(), s = e, c = e, p = () => s.toast, m = () => p().positionerProps?.anchor !== void 0, h = L(() => {
|
|
487
|
-
if (m()) return [];
|
|
488
|
-
let e = s.swipeDirection ?? Te;
|
|
489
|
-
return Array.isArray(e) ? e : [e];
|
|
490
|
-
}), g = L(() => h().length > 0), [_, v] = R(null, { ownedWrite: !0 }), [y, b] = R(void 0, { ownedWrite: !0 }), [x, S] = R(!1, { ownedWrite: !0 }), [C, w] = R(!1, { ownedWrite: !0 }), [E, te] = R({
|
|
491
|
-
x: 0,
|
|
492
|
-
y: 0
|
|
493
|
-
}, { ownedWrite: !0 }), [ne, k] = R({
|
|
494
|
-
x: 0,
|
|
495
|
-
y: 0,
|
|
496
|
-
scale: 1
|
|
497
|
-
}, { ownedWrite: !0 }), [re, A] = R(void 0, { ownedWrite: !0 }), [ie, M] = R(void 0, { ownedWrite: !0 }), [ae, N] = R(null, { ownedWrite: !0 }), P, F = {
|
|
498
|
-
x: 0,
|
|
499
|
-
y: 0
|
|
500
|
-
}, z = {
|
|
501
|
-
x: 0,
|
|
502
|
-
y: 0,
|
|
503
|
-
scale: 1
|
|
504
|
-
}, H, U = 0, W = !1, G = {
|
|
505
|
-
x: 0,
|
|
506
|
-
y: 0
|
|
507
|
-
}, K = !1, q = {
|
|
508
|
-
x: 0,
|
|
509
|
-
y: 0
|
|
510
|
-
}, J = null, X = null, ce = L(() => p().id), le = L(() => p().transitionStatus), de = L(() => le() !== "ending"), pe = L(() => Y.toastIndex(i.track(), p().id)), me = L(() => Y.toastVisibleIndex(i.track(), p().id)), he = L(() => Y.toastOffsetY(i.track(), p().id)), ge = L(() => Y.focused(i.track())), _e = L(() => Y.expanded(i.track()));
|
|
511
|
-
I(() => ({
|
|
512
|
-
open: de(),
|
|
513
|
-
element: _()
|
|
514
|
-
}), ({ open: e, element: t }) => {
|
|
515
|
-
if (!t) return;
|
|
516
|
-
let n = new AbortController();
|
|
517
|
-
return o(t, () => {
|
|
518
|
-
let e = V(p);
|
|
519
|
-
e.transitionStatus === "ending" && i.removeToast(e.id);
|
|
520
|
-
}, n.signal, { waitForStartingStyleRemoved: e }), () => n.abort();
|
|
521
|
-
});
|
|
522
|
-
function Z(e = !1) {
|
|
523
|
-
let t = V(_);
|
|
524
|
-
if (!t) return;
|
|
525
|
-
let n = t.style.height;
|
|
526
|
-
t.style.height = "auto";
|
|
527
|
-
let r = t.offsetHeight;
|
|
528
|
-
t.style.height = n, i.updateToastInternal(V(p).id, {
|
|
529
|
-
element: t,
|
|
530
|
-
height: r,
|
|
531
|
-
transitionStatus: void 0
|
|
532
|
-
}), e && oe();
|
|
533
|
-
}
|
|
534
|
-
I(() => ({
|
|
535
|
-
id: ce(),
|
|
536
|
-
status: le()
|
|
537
|
-
}), ({ id: e, status: t }) => {
|
|
538
|
-
let n = P;
|
|
539
|
-
(t === "starting" || n !== e) && (n !== void 0 && (b(void 0), k({
|
|
540
|
-
x: 0,
|
|
541
|
-
y: 0,
|
|
542
|
-
scale: 1
|
|
543
|
-
}), Q({
|
|
544
|
-
x: 0,
|
|
545
|
-
y: 0
|
|
546
|
-
})), P = e, Z());
|
|
547
|
-
}), se(() => {
|
|
548
|
-
X?.abort();
|
|
549
|
-
});
|
|
550
|
-
function Q(e) {
|
|
551
|
-
q = e, te(e);
|
|
552
|
-
}
|
|
553
|
-
function Ee(e, t) {
|
|
554
|
-
let n = V(h), r = (e) => e > 0 ? e ** Se : -(Math.abs(e) ** Se), i = e > 0 && !n.includes("right") || e < 0 && !n.includes("left"), a = t > 0 && !n.includes("down") || t < 0 && !n.includes("up");
|
|
555
|
-
return {
|
|
556
|
-
x: i ? r(e) : e,
|
|
557
|
-
y: a ? r(t) : t
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
function $(e) {
|
|
561
|
-
if (e.pointerId !== J) return;
|
|
562
|
-
J = null, X?.abort(), X = null, S(!1), w(!1), N(null);
|
|
563
|
-
let t = z;
|
|
564
|
-
if (e.type === "pointercancel" || W) {
|
|
565
|
-
Q({
|
|
566
|
-
x: t.x,
|
|
567
|
-
y: t.y
|
|
568
|
-
}), b(void 0);
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
let n = q, r = n.x - t.x, a = n.y - t.y, o;
|
|
572
|
-
for (let e of V(h)) if (T(e, r, a) > be) {
|
|
573
|
-
o = e;
|
|
574
|
-
break;
|
|
575
|
-
}
|
|
576
|
-
o ? (b(o), i.closeToast(V(p).id)) : (Q({
|
|
577
|
-
x: t.x,
|
|
578
|
-
y: t.y
|
|
579
|
-
}), b(void 0));
|
|
580
|
-
}
|
|
581
|
-
function De(e) {
|
|
582
|
-
if (e.button !== 0 || (e.pointerType === "touch" && i.pauseTimers(), d(e)?.closest(we))) return;
|
|
583
|
-
W = !1, H = void 0, U = 0, J = e.pointerId, F = {
|
|
584
|
-
x: e.clientX,
|
|
585
|
-
y: e.clientY
|
|
586
|
-
}, G = F;
|
|
587
|
-
let t = e.currentTarget, n = ee(t);
|
|
588
|
-
z = n, k(n), Q({
|
|
589
|
-
x: n.x,
|
|
590
|
-
y: n.y
|
|
591
|
-
}), i.set("hovering", !0), S(!0), w(!1), N(null), K = !0, X?.abort();
|
|
592
|
-
let r = new AbortController();
|
|
593
|
-
X = r;
|
|
594
|
-
let a = u(t);
|
|
595
|
-
a.addEventListener("pointerup", $, { signal: r.signal }), a.addEventListener("pointercancel", $, { signal: r.signal }), t.setPointerCapture?.(e.pointerId);
|
|
596
|
-
}
|
|
597
|
-
function Oe(e) {
|
|
598
|
-
if (e.pointerId !== J) return;
|
|
599
|
-
e.preventDefault(), K &&= (F = {
|
|
600
|
-
x: e.clientX,
|
|
601
|
-
y: e.clientY
|
|
602
|
-
}, !1);
|
|
603
|
-
let { clientY: t, clientX: n, movementX: r, movementY: i } = e, a = V(h);
|
|
604
|
-
(i < 0 && t > G.y || i > 0 && t < G.y) && (G = {
|
|
605
|
-
x: G.x,
|
|
606
|
-
y: t
|
|
607
|
-
}), (r < 0 && n > G.x || r > 0 && n < G.x) && (G = {
|
|
608
|
-
x: n,
|
|
609
|
-
y: G.y
|
|
610
|
-
});
|
|
611
|
-
let o = n - F.x, s = t - F.y, c = t - G.y, l = n - G.x, u = V(ae);
|
|
612
|
-
if (!V(C) && Math.sqrt(o * o + s * s) >= Ce) {
|
|
613
|
-
w(!0);
|
|
614
|
-
let e = a.includes("left") || a.includes("right"), t = a.includes("up") || a.includes("down");
|
|
615
|
-
e && t && (u = Math.abs(o) > Math.abs(s) ? "horizontal" : "vertical", N(u));
|
|
616
|
-
}
|
|
617
|
-
let d;
|
|
618
|
-
if (!H) u === "vertical" ? s > 0 ? d = "down" : s < 0 && (d = "up") : u === "horizontal" ? o > 0 ? d = "right" : o < 0 && (d = "left") : d = Math.abs(o) >= Math.abs(s) ? o > 0 ? "right" : "left" : s > 0 ? "down" : "up", d && a.includes(d) && (H = d, U = T(d, o, s), b(d));
|
|
619
|
-
else {
|
|
620
|
-
let e = H, t = T(e, l, c);
|
|
621
|
-
t > be ? (W = !1, b(e)) : !(a.includes("left") && a.includes("right")) && !(a.includes("up") && a.includes("down")) && U - t >= xe && (W = !0);
|
|
622
|
-
}
|
|
623
|
-
let f = Ee(o, s), p = z.x, m = z.y, g = a.includes("left") || a.includes("right"), _ = a.includes("up") || a.includes("down");
|
|
624
|
-
u !== "vertical" && g && (p += f.x), u !== "horizontal" && _ && (m += f.y), Q({
|
|
625
|
-
x: p,
|
|
626
|
-
y: m
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
function ke(e) {
|
|
630
|
-
if (e.key !== "Escape") return;
|
|
631
|
-
let t = V(_);
|
|
632
|
-
!t || !l(t, f(u(t))) || i.closeToast(V(p).id);
|
|
633
|
-
}
|
|
634
|
-
I(() => ({
|
|
635
|
-
enabled: g(),
|
|
636
|
-
element: _()
|
|
637
|
-
}), ({ enabled: e, element: t }) => {
|
|
638
|
-
if (!e || !t) return;
|
|
639
|
-
function n(e) {
|
|
640
|
-
J === null || !l(t, d(e)) || e.preventDefault();
|
|
641
|
-
}
|
|
642
|
-
return t.addEventListener("touchmove", n, { passive: !1 }), () => t.removeEventListener("touchmove", n);
|
|
643
|
-
});
|
|
644
|
-
function Ae() {
|
|
645
|
-
let e = E(), t = ne(), n = e.x - t.x, r = e.y - t.y;
|
|
646
|
-
return {
|
|
647
|
-
transition: x() ? "none" : void 0,
|
|
648
|
-
transform: x() ? `translateX(${e.x}px) translateY(${e.y}px) scale(${t.scale})` : void 0,
|
|
649
|
-
"--toast-swipe-movement-x": `${n}px`,
|
|
650
|
-
"--toast-swipe-movement-y": `${r}px`
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
|
-
let je = L(() => p().priority === "high"), Me = L(() => ({
|
|
654
|
-
transitionStatus: p().transitionStatus,
|
|
655
|
-
expanded: _e(),
|
|
656
|
-
limited: p().limited || !1,
|
|
657
|
-
type: p().type,
|
|
658
|
-
swiping: x(),
|
|
659
|
-
swipeDirection: y()
|
|
660
|
-
})), Ne = L(() => n(e.class, Me())), Pe = L(() => fe({
|
|
661
|
-
...Ae(),
|
|
662
|
-
"--toast-index": String(p().transitionStatus === "ending" ? pe() : me()),
|
|
663
|
-
"--toast-offset-y": `${he()}px`,
|
|
664
|
-
"--toast-height": p().height ? `${p().height}px` : void 0
|
|
665
|
-
}, r(e.style, Me()))), Fe = L(() => t(Me(), ye)), Ie = B(c, "as", "class", "onKeyDown", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "ref", "style", "swipeDirection", "toast"), Le = a(() => s.onKeyDown, () => ke), Re = a(() => s.onPointerDown, () => V(() => g() ? De : void 0)), ze = a(() => s.onPointerMove, () => V(() => g() ? Oe : void 0)), Be = a(() => s.onPointerUp, () => V(() => g() ? $ : void 0)), Ve = a(() => s.onPointerCancel, () => V(() => g() ? $ : void 0));
|
|
666
|
-
return O(ve, {
|
|
667
|
-
value: {
|
|
668
|
-
toast: p,
|
|
669
|
-
setTitleId: A,
|
|
670
|
-
setDescriptionId: M,
|
|
671
|
-
visibleIndex: me,
|
|
672
|
-
expanded: _e,
|
|
673
|
-
recalculateHeight: Z
|
|
674
|
-
},
|
|
675
|
-
get children() {
|
|
676
|
-
return O(D, j({
|
|
677
|
-
get component() {
|
|
678
|
-
return e.as ?? "div";
|
|
679
|
-
},
|
|
680
|
-
ref: [((e) => v(e)), s.ref],
|
|
681
|
-
get role() {
|
|
682
|
-
return je() ? "alertdialog" : "dialog";
|
|
683
|
-
},
|
|
684
|
-
tabIndex: 0,
|
|
685
|
-
"aria-modal": "false",
|
|
686
|
-
get "aria-labelledby"() {
|
|
687
|
-
return re();
|
|
688
|
-
},
|
|
689
|
-
get "aria-describedby"() {
|
|
690
|
-
return ie();
|
|
691
|
-
},
|
|
692
|
-
get "aria-hidden"() {
|
|
693
|
-
return je() && !ge() ? "true" : void 0;
|
|
694
|
-
},
|
|
695
|
-
get inert() {
|
|
696
|
-
return p().limited || void 0;
|
|
697
|
-
},
|
|
698
|
-
get class() {
|
|
699
|
-
return Ne();
|
|
700
|
-
},
|
|
701
|
-
get style() {
|
|
702
|
-
return Pe();
|
|
703
|
-
},
|
|
704
|
-
onKeyDown: Le,
|
|
705
|
-
onPointerDown: Re,
|
|
706
|
-
onPointerMove: ze,
|
|
707
|
-
onPointerUp: Be,
|
|
708
|
-
onPointerCancel: Ve
|
|
709
|
-
}, Fe, Ie));
|
|
710
|
-
}
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
//#endregion
|
|
714
|
-
//#region src/toast/content/ToastContent.tsx
|
|
715
|
-
function Ee(e) {
|
|
716
|
-
let i = Z(), a = e, o = e, [s, c] = R(null, { ownedWrite: !0 });
|
|
717
|
-
I(() => s(), (e) => {
|
|
718
|
-
if (i.recalculateHeight(), !e || typeof ResizeObserver != "function" || typeof MutationObserver != "function") return;
|
|
719
|
-
let t = new ResizeObserver(() => i.recalculateHeight(!0)), n = new MutationObserver(() => i.recalculateHeight(!0));
|
|
720
|
-
return t.observe(e), n.observe(e, {
|
|
721
|
-
childList: !0,
|
|
722
|
-
subtree: !0,
|
|
723
|
-
characterData: !0
|
|
724
|
-
}), () => {
|
|
725
|
-
t.disconnect(), n.disconnect();
|
|
726
|
-
};
|
|
727
|
-
});
|
|
728
|
-
let l = L(() => ({
|
|
729
|
-
expanded: i.expanded(),
|
|
730
|
-
behind: i.visibleIndex() > 0
|
|
731
|
-
})), u = L(() => n(e.class, l())), d = L(() => r(e.style, l())), f = L(() => t(l())), p = B(o, "as", "class", "ref", "style");
|
|
732
|
-
return O(D, j({
|
|
733
|
-
get component() {
|
|
734
|
-
return e.as ?? "div";
|
|
735
|
-
},
|
|
736
|
-
ref: [((e) => c(e)), a.ref],
|
|
737
|
-
get class() {
|
|
738
|
-
return u();
|
|
739
|
-
},
|
|
740
|
-
get style() {
|
|
741
|
-
return d();
|
|
742
|
-
}
|
|
743
|
-
}, f, p));
|
|
744
|
-
}
|
|
745
|
-
//#endregion
|
|
746
|
-
//#region src/toast/utils/isRenderableNode.ts
|
|
747
|
-
function $(e) {
|
|
748
|
-
return e == null || typeof e == "boolean" || e === "" ? !1 : !Array.isArray(e) || e.some($);
|
|
749
|
-
}
|
|
750
|
-
//#endregion
|
|
751
|
-
//#region src/toast/utils/createToastLabelPart.ts
|
|
752
|
-
function De(e, t) {
|
|
753
|
-
let n = Z(), r = t === "title" ? n.setTitleId : n.setDescriptionId, i = `base-ui-${z()}`, a = L(() => e.id || i), o = P(() => e.children ?? (t === "title" ? n.toast().title : n.toast().description)), s = L(() => $(o()));
|
|
754
|
-
return I(() => s() ? a() : void 0, (e) => {
|
|
755
|
-
if (e !== void 0) return r(e), () => r((t) => t === e ? void 0 : t);
|
|
756
|
-
}), {
|
|
757
|
-
id: a,
|
|
758
|
-
content: o,
|
|
759
|
-
shouldRender: s,
|
|
760
|
-
type: () => n.toast().type
|
|
761
|
-
};
|
|
762
|
-
}
|
|
763
|
-
//#endregion
|
|
764
|
-
//#region src/toast/description/ToastDescription.tsx
|
|
765
|
-
function Oe(e) {
|
|
766
|
-
let i = e, a = e, o = De(e, "description"), s = L(() => ({ type: o.type() })), c = L(() => n(e.class, s())), l = L(() => r(e.style, s())), u = L(() => t(s())), d = B(a, "as", "children", "class", "id", "ref", "style");
|
|
767
|
-
return O(N, {
|
|
768
|
-
get when() {
|
|
769
|
-
return o.shouldRender();
|
|
770
|
-
},
|
|
771
|
-
get children() {
|
|
772
|
-
return O(D, j({
|
|
773
|
-
get component() {
|
|
774
|
-
return e.as ?? "p";
|
|
775
|
-
},
|
|
776
|
-
ref: [i.ref],
|
|
777
|
-
get id() {
|
|
778
|
-
return o.id();
|
|
779
|
-
},
|
|
780
|
-
get class() {
|
|
781
|
-
return c();
|
|
782
|
-
},
|
|
783
|
-
get style() {
|
|
784
|
-
return l();
|
|
785
|
-
}
|
|
786
|
-
}, u, d, { get children() {
|
|
787
|
-
return o.content();
|
|
788
|
-
} }));
|
|
789
|
-
}
|
|
790
|
-
});
|
|
791
|
-
}
|
|
792
|
-
//#endregion
|
|
793
|
-
//#region src/toast/title/ToastTitle.tsx
|
|
794
|
-
function ke(e) {
|
|
795
|
-
let i = e, a = e, o = De(e, "title"), s = L(() => ({ type: o.type() })), c = L(() => n(e.class, s())), l = L(() => r(e.style, s())), u = L(() => t(s())), d = B(a, "as", "children", "class", "id", "ref", "style");
|
|
796
|
-
return O(N, {
|
|
797
|
-
get when() {
|
|
798
|
-
return o.shouldRender();
|
|
799
|
-
},
|
|
800
|
-
get children() {
|
|
801
|
-
return O(D, j({
|
|
802
|
-
get component() {
|
|
803
|
-
return e.as ?? "h2";
|
|
804
|
-
},
|
|
805
|
-
ref: [i.ref],
|
|
806
|
-
get id() {
|
|
807
|
-
return o.id();
|
|
808
|
-
},
|
|
809
|
-
get class() {
|
|
810
|
-
return c();
|
|
811
|
-
},
|
|
812
|
-
get style() {
|
|
813
|
-
return l();
|
|
814
|
-
}
|
|
815
|
-
}, u, d, { get children() {
|
|
816
|
-
return o.content();
|
|
817
|
-
} }));
|
|
818
|
-
}
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
//#endregion
|
|
822
|
-
//#region src/toast/close/ToastClose.tsx
|
|
823
|
-
function Ae(e) {
|
|
824
|
-
let i = ue(), o = Z(), s = e, c = e, [l, u] = R(!1, { ownedWrite: !0 }), d = L(() => s.disabled ?? !1), f = L(() => s.nativeButton ?? !0), p = L(() => ({ type: o.toast().type })), m = L(() => n(e.class, p())), h = L(() => r(e.style, p())), g = L(() => t(p())), _ = B(c, "as", "class", "disabled", "nativeButton", "onBlur", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style");
|
|
825
|
-
function C() {
|
|
826
|
-
i.closeToast(o.toast().id);
|
|
827
|
-
}
|
|
828
|
-
let w = a(() => V(() => d() ? x : void 0), () => s.onClick, () => C), ee = a(() => s.onFocus, () => () => u(!0)), T = a(() => s.onBlur, () => () => u(!1)), E = a(() => V(() => d() ? x : void 0), () => s.onPointerDown), te = a(() => V(() => d() ? v : void 0), () => s.onMouseDown), ne = a(() => V(() => d() ? y : void 0), () => s.onKeyDown, () => V(() => f() ? void 0 : S)), k = a(() => V(() => d() ? v : void 0), () => s.onKeyUp, () => V(() => f() ? void 0 : b));
|
|
829
|
-
return O(D, j({
|
|
830
|
-
get component() {
|
|
831
|
-
return e.as ?? "button";
|
|
832
|
-
},
|
|
833
|
-
ref: [s.ref],
|
|
834
|
-
get type() {
|
|
835
|
-
return f() ? "button" : void 0;
|
|
836
|
-
},
|
|
837
|
-
get role() {
|
|
838
|
-
return f() ? void 0 : "button";
|
|
839
|
-
},
|
|
840
|
-
get tabIndex() {
|
|
841
|
-
return !f() && d() ? -1 : 0;
|
|
842
|
-
},
|
|
843
|
-
get disabled() {
|
|
844
|
-
return (A(() => !!f())() ? d() : f()) || void 0;
|
|
845
|
-
},
|
|
846
|
-
get "aria-disabled"() {
|
|
847
|
-
return !f() && d() ? "true" : void 0;
|
|
848
|
-
},
|
|
849
|
-
get "aria-hidden"() {
|
|
850
|
-
return !o.expanded() && !l() ? "true" : "false";
|
|
851
|
-
},
|
|
852
|
-
get class() {
|
|
853
|
-
return m();
|
|
854
|
-
},
|
|
855
|
-
get style() {
|
|
856
|
-
return h();
|
|
857
|
-
},
|
|
858
|
-
onBlur: T,
|
|
859
|
-
onClick: w,
|
|
860
|
-
onFocus: ee,
|
|
861
|
-
onKeyDown: ne,
|
|
862
|
-
onKeyUp: k,
|
|
863
|
-
onMouseDown: te,
|
|
864
|
-
onPointerDown: E
|
|
865
|
-
}, g, _));
|
|
866
|
-
}
|
|
867
|
-
//#endregion
|
|
868
|
-
//#region src/toast/action/ToastAction.tsx
|
|
869
|
-
function je(e) {
|
|
870
|
-
let i = Z(), o = e, s = e, c = () => i.toast().actionProps, l = P(() => c()?.children ?? e.children), u = L(() => $(l())), d = L(() => o.disabled ?? !1), f = L(() => o.nativeButton ?? !0), p = L(() => ({ type: i.toast().type })), m = L(() => n(e.class, p())), h = L(() => r(e.style, p())), g = L(() => t(p())), _ = B(s, "as", "children", "class", "disabled", "nativeButton", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "ref", "style"), C = L(() => {
|
|
871
|
-
let e = c();
|
|
872
|
-
if (e) return B(e, "children", "onClick", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown");
|
|
873
|
-
}), w = a(() => V(() => d() ? x : void 0), () => o.onClick, () => c()?.onClick), ee = a(() => V(() => d() ? x : void 0), () => o.onPointerDown, () => c()?.onPointerDown), T = a(() => V(() => d() ? v : void 0), () => o.onMouseDown, () => c()?.onMouseDown), E = a(() => V(() => d() ? y : void 0), () => o.onKeyDown, () => c()?.onKeyDown, () => V(() => f() ? void 0 : S)), te = a(() => V(() => d() ? v : void 0), () => o.onKeyUp, () => c()?.onKeyUp, () => V(() => f() ? void 0 : b));
|
|
874
|
-
return O(N, {
|
|
875
|
-
get when() {
|
|
876
|
-
return u();
|
|
877
|
-
},
|
|
878
|
-
get children() {
|
|
879
|
-
return O(D, j({
|
|
880
|
-
get component() {
|
|
881
|
-
return e.as ?? "button";
|
|
882
|
-
},
|
|
883
|
-
ref: [o.ref],
|
|
884
|
-
get type() {
|
|
885
|
-
return f() ? "button" : void 0;
|
|
886
|
-
},
|
|
887
|
-
get role() {
|
|
888
|
-
return f() ? void 0 : "button";
|
|
889
|
-
},
|
|
890
|
-
get tabIndex() {
|
|
891
|
-
return !f() && d() ? -1 : 0;
|
|
892
|
-
},
|
|
893
|
-
get disabled() {
|
|
894
|
-
return (A(() => !!f())() ? d() : f()) || void 0;
|
|
895
|
-
},
|
|
896
|
-
get "aria-disabled"() {
|
|
897
|
-
return !f() && d() ? "true" : void 0;
|
|
898
|
-
},
|
|
899
|
-
get class() {
|
|
900
|
-
return m();
|
|
901
|
-
},
|
|
902
|
-
get style() {
|
|
903
|
-
return h();
|
|
904
|
-
},
|
|
905
|
-
onClick: w,
|
|
906
|
-
onKeyDown: E,
|
|
907
|
-
onKeyUp: te,
|
|
908
|
-
onMouseDown: T,
|
|
909
|
-
onPointerDown: ee
|
|
910
|
-
}, g, _, C, { get children() {
|
|
911
|
-
return l();
|
|
912
|
-
} }));
|
|
913
|
-
}
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
//#endregion
|
|
917
|
-
//#region src/toast/portal/ToastPortal.tsx
|
|
918
|
-
function Me(e) {
|
|
919
|
-
let t = e, i = e, a = {}, o = L(() => n(e.class, a)), s = L(() => r(e.style, a)), c = B(i, "as", "class", "container", "ref", "style");
|
|
920
|
-
return O(_, j({
|
|
921
|
-
get as() {
|
|
922
|
-
return e.as;
|
|
923
|
-
},
|
|
924
|
-
lite: !0,
|
|
925
|
-
get container() {
|
|
926
|
-
return t.container;
|
|
927
|
-
},
|
|
928
|
-
ref: (e) => {
|
|
929
|
-
t.ref && C(t.ref, e);
|
|
930
|
-
},
|
|
931
|
-
get class() {
|
|
932
|
-
return o();
|
|
933
|
-
},
|
|
934
|
-
get style() {
|
|
935
|
-
return s();
|
|
936
|
-
}
|
|
937
|
-
}, c, { get children() {
|
|
938
|
-
return e.children;
|
|
939
|
-
} }));
|
|
940
|
-
}
|
|
941
|
-
//#endregion
|
|
942
|
-
//#region src/toast/positioner/ToastPositionerContext.ts
|
|
943
|
-
var Ne = Symbol("ToastPositionerContext"), Pe = F(Ne);
|
|
944
|
-
function Fe() {
|
|
945
|
-
let e = H(Pe);
|
|
946
|
-
if (e === Ne) throw Error("Base UI: ToastPositionerContext is missing. ToastPositioner parts must be placed within <Toast.Positioner>.");
|
|
947
|
-
return e;
|
|
948
|
-
}
|
|
949
|
-
//#endregion
|
|
950
|
-
//#region src/toast/positioner/ToastPositioner.tsx
|
|
951
|
-
var Ie = {};
|
|
952
|
-
function Le(e) {
|
|
953
|
-
let i = ue(), a = w(), o = e, c = e, [l, u] = R(null, { ownedWrite: !0 }), d = () => o.toast, f = () => d().positionerProps ?? Ie, m = L(() => {
|
|
954
|
-
let e = o.anchor ?? f().anchor;
|
|
955
|
-
return s(e) ? e : null;
|
|
956
|
-
}), h = p({
|
|
957
|
-
reference: m,
|
|
958
|
-
floating: l,
|
|
959
|
-
mounted: () => !0,
|
|
960
|
-
direction: a,
|
|
961
|
-
positionMethod: () => o.positionMethod ?? f().positionMethod ?? "absolute",
|
|
962
|
-
side: () => o.side ?? f().side ?? "top",
|
|
963
|
-
sideOffset: () => o.sideOffset ?? f().sideOffset ?? 0,
|
|
964
|
-
align: () => o.align ?? f().align ?? "center",
|
|
965
|
-
alignOffset: () => o.alignOffset ?? f().alignOffset ?? 0,
|
|
966
|
-
collisionBoundary: () => o.collisionBoundary ?? f().collisionBoundary ?? "clipping-ancestors",
|
|
967
|
-
collisionPadding: () => o.collisionPadding ?? f().collisionPadding ?? 5,
|
|
968
|
-
arrowPadding: () => o.arrowPadding ?? f().arrowPadding ?? 5,
|
|
969
|
-
sticky: () => o.sticky ?? f().sticky ?? !1,
|
|
970
|
-
disableAnchorTracking: () => o.disableAnchorTracking ?? f().disableAnchorTracking ?? !1,
|
|
971
|
-
collisionAvoidance: () => o.collisionAvoidance ?? f().collisionAvoidance ?? { fallbackAxisSide: "end" }
|
|
972
|
-
}), _ = L(() => Y.toastIndex(i.track(), d().id)), v = L(() => Y.toastVisibleIndex(i.track(), d().id)), y = L(() => ({
|
|
973
|
-
side: h.renderedSide(),
|
|
974
|
-
align: h.renderedAlign(),
|
|
975
|
-
anchorHidden: h.anchorHidden()
|
|
976
|
-
})), b = L(() => n(e.class, y())), x = L(() => fe({
|
|
977
|
-
...h.styles(),
|
|
978
|
-
"--toast-index": String(d().transitionStatus === "ending" ? _() : v()),
|
|
979
|
-
...d().transitionStatus === "starting" ? { transition: "none" } : void 0
|
|
980
|
-
}, r(e.style, y()))), S = L(() => t(y(), g)), C = B(c, "align", "alignOffset", "anchor", "arrowPadding", "as", "class", "collisionAvoidance", "collisionBoundary", "collisionPadding", "disableAnchorTracking", "positionMethod", "ref", "side", "sideOffset", "sticky", "style", "toast");
|
|
981
|
-
return O(Pe, {
|
|
982
|
-
value: h,
|
|
983
|
-
get children() {
|
|
984
|
-
return O(D, j({
|
|
985
|
-
get component() {
|
|
986
|
-
return e.as ?? "div";
|
|
987
|
-
},
|
|
988
|
-
ref: [((e) => u(e)), o.ref],
|
|
989
|
-
role: "presentation",
|
|
990
|
-
get class() {
|
|
991
|
-
return b();
|
|
992
|
-
},
|
|
993
|
-
get style() {
|
|
994
|
-
return x();
|
|
995
|
-
}
|
|
996
|
-
}, S, C));
|
|
997
|
-
}
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
//#endregion
|
|
1001
|
-
//#region src/toast/arrow/ToastArrow.tsx
|
|
1002
|
-
function Re(e) {
|
|
1003
|
-
let i = Fe(), a = e, o = e, s = L(() => ({
|
|
1004
|
-
side: i.renderedSide(),
|
|
1005
|
-
align: i.renderedAlign(),
|
|
1006
|
-
uncentered: i.arrowUncentered()
|
|
1007
|
-
})), c = L(() => n(e.class, s())), l = L(() => fe(i.arrowStyles(), r(e.style, s()))), u = L(() => t(s())), d = B(o, "as", "class", "ref", "style"), f = null;
|
|
1008
|
-
return se(() => {
|
|
1009
|
-
f && i.setArrowElement(null);
|
|
1010
|
-
}), O(D, j({
|
|
1011
|
-
get component() {
|
|
1012
|
-
return e.as ?? "div";
|
|
1013
|
-
},
|
|
1014
|
-
ref: [((e) => {
|
|
1015
|
-
f = e, i.setArrowElement(e);
|
|
1016
|
-
}), a.ref],
|
|
1017
|
-
"aria-hidden": "true",
|
|
1018
|
-
get class() {
|
|
1019
|
-
return c();
|
|
1020
|
-
},
|
|
1021
|
-
get style() {
|
|
1022
|
-
return l();
|
|
1023
|
-
}
|
|
1024
|
-
}, u, d));
|
|
1025
|
-
}
|
|
1026
|
-
//#endregion
|
|
1027
|
-
//#region src/toast/index.parts.ts
|
|
1028
|
-
var ze = /* @__PURE__ */ e({
|
|
1029
|
-
Action: () => je,
|
|
1030
|
-
Arrow: () => Re,
|
|
1031
|
-
Close: () => Ae,
|
|
1032
|
-
Content: () => Ee,
|
|
1033
|
-
Description: () => Oe,
|
|
1034
|
-
Portal: () => Me,
|
|
1035
|
-
Positioner: () => Le,
|
|
1036
|
-
Provider: () => de,
|
|
1037
|
-
Root: () => Q,
|
|
1038
|
-
Title: () => ke,
|
|
1039
|
-
Viewport: () => ge
|
|
1040
|
-
});
|
|
1041
|
-
//#endregion
|
|
1042
|
-
//#region src/toast/useToastManager.ts
|
|
1043
|
-
function Be() {
|
|
1044
|
-
let e = ue();
|
|
1045
|
-
return {
|
|
1046
|
-
toasts: e.access(Y.toasts),
|
|
1047
|
-
add: e.addToast,
|
|
1048
|
-
close: e.closeToast,
|
|
1049
|
-
update: e.updateToast,
|
|
1050
|
-
promise: e.promiseToast
|
|
1051
|
-
};
|
|
1052
|
-
}
|
|
1053
|
-
//#endregion
|
|
1054
|
-
//#region src/toast/createToastManager.ts
|
|
1055
|
-
function Ve() {
|
|
1056
|
-
let e = /* @__PURE__ */ new Set();
|
|
1057
|
-
function t(t) {
|
|
1058
|
-
e.forEach((e) => e(t));
|
|
1059
|
-
}
|
|
1060
|
-
return {
|
|
1061
|
-
" subscribe": function(t) {
|
|
1062
|
-
return e.add(t), () => {
|
|
1063
|
-
e.delete(t);
|
|
1064
|
-
};
|
|
1065
|
-
},
|
|
1066
|
-
add(e) {
|
|
1067
|
-
let n = e.id || G();
|
|
1068
|
-
return t({
|
|
1069
|
-
action: "add",
|
|
1070
|
-
options: {
|
|
1071
|
-
...e,
|
|
1072
|
-
id: n,
|
|
1073
|
-
transitionStatus: "starting"
|
|
1074
|
-
}
|
|
1075
|
-
}), n;
|
|
1076
|
-
},
|
|
1077
|
-
close(e) {
|
|
1078
|
-
t({
|
|
1079
|
-
action: "close",
|
|
1080
|
-
options: { id: e }
|
|
1081
|
-
});
|
|
1082
|
-
},
|
|
1083
|
-
update(e, n) {
|
|
1084
|
-
t({
|
|
1085
|
-
action: "update",
|
|
1086
|
-
options: {
|
|
1087
|
-
...n,
|
|
1088
|
-
id: e
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
},
|
|
1092
|
-
promise(e, n) {
|
|
1093
|
-
let r = e;
|
|
1094
|
-
return t({
|
|
1095
|
-
action: "promise",
|
|
1096
|
-
options: {
|
|
1097
|
-
...n,
|
|
1098
|
-
promise: e,
|
|
1099
|
-
setPromise(e) {
|
|
1100
|
-
r = e;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
}), r;
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
//#endregion
|
|
1108
|
-
export { Be as n, ze as r, Ve as t };
|