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,2 +1,2 @@
|
|
|
1
|
-
import { t as Separator } from "../Separator-
|
|
1
|
+
import { t as Separator } from "../Separator-DTvtnxzP.js";
|
|
2
2
|
export { Separator };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { t as useRender } from "../useRender-CryVdCjs.js";
|
|
2
3
|
import { getStateAttributesProps } from "../internals/getStateAttributesProps.js";
|
|
3
4
|
import { A as trackPress, b as keyboard, c as drag, h as inputChange, w as none } from "../internals/reasons.js";
|
|
4
5
|
import { n as resolveClass, t as resolveStyle } from "../resolveStyle-XCSFDHAL.js";
|
|
5
6
|
import { createChangeEventDetails, createGenericEventDetails } from "../internals/createBaseUIEventDetails.js";
|
|
6
|
-
import { composeEventHandlers } from "../internals/composeEventHandlers.js";
|
|
7
|
+
import { composeEventHandlers, liveEventHandler } from "../internals/composeEventHandlers.js";
|
|
7
8
|
import { n as useDirection } from "../DirectionContext-YORWLF08.js";
|
|
8
9
|
import { fieldStateAttributesMapping } from "../internals/field-constants.js";
|
|
9
|
-
import {
|
|
10
|
-
import { n as useFormContext } from "../FormContext-
|
|
11
|
-
import { r as useLabelableContext } from "../LabelableContext-
|
|
10
|
+
import { r as useFieldRootContext } from "../FieldRootContext-Bfpna6gA.js";
|
|
11
|
+
import { n as useFormContext } from "../FormContext-CYwo_ZnB.js";
|
|
12
|
+
import { r as useLabelableContext } from "../LabelableContext-BTeF0IWb.js";
|
|
13
|
+
import { t as mergeStyleValue } from "../mergeStyleValue-DecVaoac.js";
|
|
12
14
|
import { n as useCSPContext } from "../CSPContext-DOxR0PO7.js";
|
|
13
|
-
import {
|
|
14
|
-
import { Dynamic, escape, isServer, memo, mergeProps, ssr, ssrAttribute, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle } from "@solidjs/web";
|
|
15
|
+
import { escape, isServer, memo, mergeProps, ssr, ssrAttribute, ssrElement, ssrGroup, ssrHydrationKey, ssrStyle } from "@solidjs/web";
|
|
15
16
|
import { createContext, createEffect, createMemo, createSignal, createUniqueId, flush, omit, onCleanup, onSettled, sharedConfig, untrack, useContext } from "solid-js";
|
|
16
17
|
//#region src/slider/stateAttributesMapping.ts
|
|
17
18
|
var omitStateAttribute = () => null;
|
|
@@ -122,7 +123,7 @@ function SliderRoot(props) {
|
|
|
122
123
|
pressedValues: null,
|
|
123
124
|
lastChangeReason: none
|
|
124
125
|
};
|
|
125
|
-
const others = omit(allProps, "aria-describedby", "aria-labelledby", "
|
|
126
|
+
const others = omit(allProps, "aria-describedby", "aria-labelledby", "render", "class", "defaultValue", "disabled", "format", "form", "id", "largeStep", "locale", "max", "min", "minStepsBetweenValues", "name", "onValueChange", "onValueCommitted", "orientation", "ref", "step", "style", "thumbAlignment", "thumbCollisionBehavior", "value");
|
|
126
127
|
const id = createMemo(() => internalProps.id ?? generatedId);
|
|
127
128
|
const min = createMemo(() => internalProps.min ?? 0);
|
|
128
129
|
const max = createMemo(() => internalProps.max ?? 100);
|
|
@@ -157,6 +158,7 @@ function SliderRoot(props) {
|
|
|
157
158
|
values: values()
|
|
158
159
|
}));
|
|
159
160
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
161
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
160
162
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
161
163
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
162
164
|
const ariaDescribedBy = createMemo(() => labelable.getAriaDescribedBy(internalProps["aria-describedby"]));
|
|
@@ -335,10 +337,7 @@ function SliderRoot(props) {
|
|
|
335
337
|
return SliderRootContext({
|
|
336
338
|
value: context,
|
|
337
339
|
get children() {
|
|
338
|
-
return
|
|
339
|
-
get component() {
|
|
340
|
-
return props.as ?? "div";
|
|
341
|
-
},
|
|
340
|
+
return Render(mergeProps({
|
|
342
341
|
ref: [((element) => setRootElement(element)), internalProps.ref],
|
|
343
342
|
get id() {
|
|
344
343
|
return id();
|
|
@@ -400,9 +399,10 @@ function SliderLabel(props) {
|
|
|
400
399
|
const context = useSliderRootContext();
|
|
401
400
|
const labelable = useLabelableContext();
|
|
402
401
|
const internalProps = props;
|
|
403
|
-
const others = omit(props, "
|
|
402
|
+
const others = omit(props, "render", "class", "id", "onClick", "onPointerDown", "ref", "style");
|
|
404
403
|
const state = createMemo(() => context.state());
|
|
405
404
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
405
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
406
406
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
407
407
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
408
408
|
function focusControl(event) {
|
|
@@ -422,8 +422,8 @@ function SliderLabel(props) {
|
|
|
422
422
|
function preventPointerFocus(event) {
|
|
423
423
|
event.preventDefault();
|
|
424
424
|
}
|
|
425
|
-
const onClick = composeEventHandlers(() => internalProps.onClick,
|
|
426
|
-
const onPointerDown = composeEventHandlers(() => internalProps.onPointerDown,
|
|
425
|
+
const onClick = composeEventHandlers(liveEventHandler(() => internalProps.onClick), focusControl);
|
|
426
|
+
const onPointerDown = composeEventHandlers(liveEventHandler(() => internalProps.onPointerDown), preventPointerFocus);
|
|
427
427
|
createEffect(context.rootLabelId, (id) => {
|
|
428
428
|
context.setLocalLabelId(id);
|
|
429
429
|
const unregister = labelable.registerLabelId(id);
|
|
@@ -432,10 +432,7 @@ function SliderLabel(props) {
|
|
|
432
432
|
if (untrack(context.labelId) === id) context.setLocalLabelId(void 0);
|
|
433
433
|
};
|
|
434
434
|
});
|
|
435
|
-
return
|
|
436
|
-
get component() {
|
|
437
|
-
return props.as ?? "div";
|
|
438
|
-
},
|
|
435
|
+
return Render(mergeProps({
|
|
439
436
|
ref: [internalProps.ref],
|
|
440
437
|
get id() {
|
|
441
438
|
return context.rootLabelId();
|
|
@@ -456,18 +453,16 @@ function SliderLabel(props) {
|
|
|
456
453
|
function SliderValue(props) {
|
|
457
454
|
const context = useSliderRootContext();
|
|
458
455
|
const internalProps = props;
|
|
459
|
-
const others = omit(props, "aria-live", "
|
|
456
|
+
const others = omit(props, "aria-live", "render", "children", "class", "ref", "style");
|
|
460
457
|
const state = createMemo(() => context.state());
|
|
461
458
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
459
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("output", props, void 0, true));
|
|
462
460
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
463
461
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
464
462
|
const formattedValues = createMemo(() => context.values().map((value) => formatNumber(value, context.locale(), context.format())));
|
|
465
463
|
const content = createMemo(() => typeof internalProps.children === "function" ? internalProps.children(formattedValues(), context.values()) : formattedValues().join(" – "));
|
|
466
464
|
const outputFor = createMemo(() => context.orderedThumbs().map((thumb) => thumb.inputId()).join(" ").trim() || void 0);
|
|
467
|
-
return
|
|
468
|
-
get component() {
|
|
469
|
-
return props.as ?? "output";
|
|
470
|
-
},
|
|
465
|
+
return Render(mergeProps({
|
|
471
466
|
ref: [internalProps.ref],
|
|
472
467
|
get ["class"]() {
|
|
473
468
|
return classValue();
|
|
@@ -588,9 +583,10 @@ function SliderControl(props) {
|
|
|
588
583
|
const internalProps = props;
|
|
589
584
|
const allProps = props;
|
|
590
585
|
const [element, setElement] = createSignal();
|
|
591
|
-
const others = omit(allProps, "
|
|
586
|
+
const others = omit(allProps, "render", "class", "onPointerDown", "onTouchStart", "ref", "style");
|
|
592
587
|
const state = createMemo(() => context.state());
|
|
593
588
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
589
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
594
590
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
595
591
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
596
592
|
let touchId = null;
|
|
@@ -804,8 +800,8 @@ function SliderControl(props) {
|
|
|
804
800
|
}
|
|
805
801
|
listeningDocument = null;
|
|
806
802
|
}
|
|
807
|
-
const onPointerDown = composeEventHandlers(() => internalProps.onPointerDown,
|
|
808
|
-
const onTouchStart = composeEventHandlers(() => internalProps.onTouchStart,
|
|
803
|
+
const onPointerDown = composeEventHandlers(liveEventHandler(() => internalProps.onPointerDown), handlePointerDown);
|
|
804
|
+
const onTouchStart = composeEventHandlers(liveEventHandler(() => internalProps.onTouchStart), handleTouchStart);
|
|
809
805
|
createEffect(element, (control) => {
|
|
810
806
|
context.setControlElement(control);
|
|
811
807
|
if (!control) return;
|
|
@@ -831,10 +827,7 @@ function SliderControl(props) {
|
|
|
831
827
|
} catch {}
|
|
832
828
|
stopListening();
|
|
833
829
|
});
|
|
834
|
-
return
|
|
835
|
-
get component() {
|
|
836
|
-
return props.as ?? "div";
|
|
837
|
-
},
|
|
830
|
+
return Render(mergeProps({
|
|
838
831
|
ref: [((control) => setElement(control)), internalProps.ref],
|
|
839
832
|
get ["class"]() {
|
|
840
833
|
return classValue();
|
|
@@ -893,15 +886,13 @@ function getDeepActiveElement(document) {
|
|
|
893
886
|
function SliderTrack(props) {
|
|
894
887
|
const context = useSliderRootContext();
|
|
895
888
|
const internalProps = props;
|
|
896
|
-
const others = omit(props, "
|
|
889
|
+
const others = omit(props, "render", "class", "ref", "style");
|
|
897
890
|
const state = createMemo(() => context.state());
|
|
898
891
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
899
|
-
const
|
|
892
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
893
|
+
const styleValue = createMemo(() => mergeStyleValue({ position: "relative" }, resolveStyle(props.style, state())));
|
|
900
894
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
901
|
-
return
|
|
902
|
-
get component() {
|
|
903
|
-
return props.as ?? "div";
|
|
904
|
-
},
|
|
895
|
+
return Render(mergeProps({
|
|
905
896
|
ref: [internalProps.ref],
|
|
906
897
|
get ["class"]() {
|
|
907
898
|
return classValue();
|
|
@@ -1013,7 +1004,7 @@ function SliderThumb(props) {
|
|
|
1013
1004
|
const automaticIndex = createMemo(() => context.orderedThumbs().indexOf(registration));
|
|
1014
1005
|
const index = createMemo(() => !context.range() ? 0 : internalProps.index ?? automaticIndex());
|
|
1015
1006
|
indexAccessor = index;
|
|
1016
|
-
const others = omit(allProps, "aria-describedby", "aria-label", "aria-labelledby", "aria-valuetext", "
|
|
1007
|
+
const others = omit(allProps, "aria-describedby", "aria-label", "aria-labelledby", "aria-valuetext", "render", "children", "class", "disabled", "getAriaLabel", "getAriaValueText", "id", "index", "inputRef", "onBlur", "onFocus", "onKeyDown", "onPointerDown", "ref", "style", "tabIndex");
|
|
1017
1008
|
const thumbValue = createMemo(() => context.values()[index()]);
|
|
1018
1009
|
const thumbValuePercent = createMemo(() => valueToPercent(thumbValue(), context.min(), context.max()));
|
|
1019
1010
|
const range = context.range;
|
|
@@ -1022,6 +1013,7 @@ function SliderThumb(props) {
|
|
|
1022
1013
|
const last = createMemo(() => index() === context.values().length - 1);
|
|
1023
1014
|
const state = createMemo(() => context.state());
|
|
1024
1015
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
1016
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
1025
1017
|
const internalStyle = createMemo(() => {
|
|
1026
1018
|
const percent = thumbValuePercent();
|
|
1027
1019
|
if (!context.inset() && !Number.isFinite(percent)) return VISUALLY_HIDDEN_STYLE;
|
|
@@ -1043,7 +1035,7 @@ function SliderThumb(props) {
|
|
|
1043
1035
|
} : {}
|
|
1044
1036
|
};
|
|
1045
1037
|
});
|
|
1046
|
-
const styleValue = createMemo(() =>
|
|
1038
|
+
const styleValue = createMemo(() => mergeStyleValue(internalStyle(), resolveStyle(props.style, state())));
|
|
1047
1039
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
1048
1040
|
const indexAttribute = createMemo(() => ({ [SliderThumbDataAttributes.index]: String(index()) }));
|
|
1049
1041
|
const formattedValue = createMemo(() => formatNumber(thumbValue(), context.locale(), context.format()));
|
|
@@ -1155,10 +1147,10 @@ function SliderThumb(props) {
|
|
|
1155
1147
|
context.interaction.pressedThumbIndex = index();
|
|
1156
1148
|
context.interaction.pressedThumbCenterOffset = (vertical() ? event.clientY : event.clientX) - getMidpoint(event.currentTarget, vertical());
|
|
1157
1149
|
}
|
|
1158
|
-
composeEventHandlers(() => restoringFocusVisible ? void 0 : internalProps.onFocus,
|
|
1159
|
-
composeEventHandlers(() => restoringFocusVisible ? void 0 : internalProps.onBlur,
|
|
1160
|
-
composeEventHandlers(() => internalProps.onKeyDown,
|
|
1161
|
-
const onPointerDown = composeEventHandlers(() => internalProps.onPointerDown,
|
|
1150
|
+
composeEventHandlers(liveEventHandler(() => restoringFocusVisible ? void 0 : internalProps.onFocus), handleFocus);
|
|
1151
|
+
composeEventHandlers(liveEventHandler(() => restoringFocusVisible ? void 0 : internalProps.onBlur), handleBlur);
|
|
1152
|
+
composeEventHandlers(liveEventHandler(() => internalProps.onKeyDown), handleKeyDown);
|
|
1153
|
+
const onPointerDown = composeEventHandlers(liveEventHandler(() => internalProps.onPointerDown), handlePointerDown);
|
|
1162
1154
|
createEffect(() => ({
|
|
1163
1155
|
control: context.controlElement(),
|
|
1164
1156
|
inset: context.inset(),
|
|
@@ -1183,10 +1175,7 @@ function SliderThumb(props) {
|
|
|
1183
1175
|
setHydrating(false);
|
|
1184
1176
|
});
|
|
1185
1177
|
onCleanup(unregisterThumb);
|
|
1186
|
-
return
|
|
1187
|
-
get component() {
|
|
1188
|
-
return props.as ?? "div";
|
|
1189
|
-
},
|
|
1178
|
+
return Render(mergeProps({
|
|
1190
1179
|
ref: [((thumb) => {
|
|
1191
1180
|
setElement(thumb);
|
|
1192
1181
|
const prehydratedPosition = Number.parseFloat(thumb.style.getPropertyValue("--position"));
|
|
@@ -1263,9 +1252,10 @@ function SliderIndicator(props) {
|
|
|
1263
1252
|
const internalProps = props;
|
|
1264
1253
|
const allProps = props;
|
|
1265
1254
|
const [hydrating, setHydrating] = createSignal(isServer || sharedConfig.hydrating);
|
|
1266
|
-
const others = omit(allProps, "
|
|
1255
|
+
const others = omit(allProps, "render", "class", "ref", "style");
|
|
1267
1256
|
const state = createMemo(() => context.state());
|
|
1268
1257
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
1258
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("div", props, void 0, true));
|
|
1269
1259
|
const indicatorStyle = createMemo(() => {
|
|
1270
1260
|
const values = context.values();
|
|
1271
1261
|
const vertical = context.orientation() === "vertical";
|
|
@@ -1292,15 +1282,12 @@ function SliderIndicator(props) {
|
|
|
1292
1282
|
style[vertical ? "height" : "width"] = range ? sizeValue : startValue;
|
|
1293
1283
|
return style;
|
|
1294
1284
|
});
|
|
1295
|
-
const styleValue = createMemo(() =>
|
|
1285
|
+
const styleValue = createMemo(() => mergeStyleValue(indicatorStyle(), resolveStyle(props.style, state())));
|
|
1296
1286
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), sliderStateAttributesMapping));
|
|
1297
1287
|
onSettled(() => {
|
|
1298
1288
|
setHydrating(false);
|
|
1299
1289
|
});
|
|
1300
|
-
return
|
|
1301
|
-
get component() {
|
|
1302
|
-
return props.as ?? "div";
|
|
1303
|
-
},
|
|
1290
|
+
return Render(mergeProps({
|
|
1304
1291
|
ref: [((indicator) => {
|
|
1305
1292
|
const start = Number.parseFloat(indicator.style.getPropertyValue("--start-position"));
|
|
1306
1293
|
const relative = Number.parseFloat(indicator.style.getPropertyValue("--relative-size"));
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { t as useRender } from "../useRender-CryVdCjs.js";
|
|
2
3
|
import { getStateAttributesProps } from "../internals/getStateAttributesProps.js";
|
|
3
4
|
import { n as resolveClass, t as resolveStyle } from "../resolveStyle-XCSFDHAL.js";
|
|
4
|
-
import { composeEventHandlers } from "../internals/composeEventHandlers.js";
|
|
5
|
+
import { composeEventHandlers, liveEventHandler } from "../internals/composeEventHandlers.js";
|
|
5
6
|
import { fieldStateAttributesMapping } from "../internals/field-constants.js";
|
|
6
|
-
import {
|
|
7
|
-
import { n as useFormContext } from "../FormContext-
|
|
8
|
-
import { r as useLabelableContext } from "../LabelableContext-
|
|
9
|
-
import {
|
|
7
|
+
import { r as useFieldRootContext } from "../FieldRootContext-Bfpna6gA.js";
|
|
8
|
+
import { n as useFormContext } from "../FormContext-CYwo_ZnB.js";
|
|
9
|
+
import { r as useLabelableContext } from "../LabelableContext-BTeF0IWb.js";
|
|
10
|
+
import { t as createLabelableId } from "../createLabelableId-WMUKtY6s.js";
|
|
11
|
+
import { escape, memo, mergeProps, ssr, ssrAttribute, ssrElement, ssrGroup, ssrHydrationKey } from "@solidjs/web";
|
|
10
12
|
import { createContext, createEffect, createMemo, createSignal, createUniqueId, omit, onCleanup, onSettled, untrack, useContext } from "solid-js";
|
|
11
13
|
//#region src/switch/stateAttributesMapping.ts
|
|
12
14
|
var switchStateAttributesMapping = {
|
|
@@ -59,25 +61,24 @@ function SwitchRoot(props) {
|
|
|
59
61
|
const internalProps = props;
|
|
60
62
|
const allProps = props;
|
|
61
63
|
const source = Symbol("Switch");
|
|
62
|
-
const labelSource = Symbol("SwitchLabelSource");
|
|
63
64
|
const ownInputId = `base-ui-${createUniqueId()}`;
|
|
64
65
|
const ownRootId = `base-ui-${createUniqueId()}`;
|
|
65
66
|
const ownLabelId = `base-ui-${createUniqueId()}`;
|
|
66
|
-
const inheritedControlId =
|
|
67
|
+
const inheritedControlId = labelable.defaultControlId;
|
|
67
68
|
const fallbackInputId = typeof inheritedControlId === "string" ? inheritedControlId : ownInputId;
|
|
68
69
|
const controlled = untrack(() => internalProps.checked !== void 0);
|
|
69
70
|
const [uncontrolledChecked, setUncontrolledChecked] = createSignal(() => Boolean(untrack(() => internalProps.defaultChecked)));
|
|
70
71
|
const [rootElement, setRootElement] = createSignal();
|
|
71
72
|
const [inputElement, setInputElement] = createSignal();
|
|
72
73
|
const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = createSignal();
|
|
73
|
-
const others = omit(allProps, "aria-describedby", "aria-labelledby", "
|
|
74
|
+
const others = omit(allProps, "aria-describedby", "aria-labelledby", "render", "checked", "class", "defaultChecked", "disabled", "form", "id", "inputRef", "name", "nativeButton", "onBlur", "onChange", "onCheckedChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "onMouseDown", "onPointerDown", "readOnly", "ref", "required", "style", "uncheckedValue", "value");
|
|
74
75
|
const checked = createMemo(() => controlled ? Boolean(internalProps.checked) : uncontrolledChecked());
|
|
75
76
|
const nativeButton = createMemo(() => internalProps.nativeButton ?? false);
|
|
76
77
|
const disabled = createMemo(() => field.disabled() || (internalProps.disabled ?? false));
|
|
77
78
|
const readOnly = createMemo(() => internalProps.readOnly ?? false);
|
|
78
79
|
const required = createMemo(() => internalProps.required ?? false);
|
|
79
80
|
const name = createMemo(() => field.name() ?? internalProps.name);
|
|
80
|
-
const inputId =
|
|
81
|
+
const inputId = createLabelableId(() => internalProps.id, fallbackInputId);
|
|
81
82
|
const rootId = createMemo(() => nativeButton() ? inputId() : ownRootId);
|
|
82
83
|
const state = createMemo(() => ({
|
|
83
84
|
...field.state(),
|
|
@@ -87,6 +88,7 @@ function SwitchRoot(props) {
|
|
|
87
88
|
required: required()
|
|
88
89
|
}));
|
|
89
90
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
91
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("span", props, void 0, true));
|
|
90
92
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
91
93
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), switchStateAttributesMapping));
|
|
92
94
|
const ariaLabelledBy = createMemo(() => internalProps["aria-labelledby"] ?? labelable.labelId() ?? fallbackAriaLabelledBy());
|
|
@@ -99,13 +101,13 @@ function SwitchRoot(props) {
|
|
|
99
101
|
value: checked,
|
|
100
102
|
getControl: () => rootElement() ?? null
|
|
101
103
|
};
|
|
102
|
-
const onClick = composeEventHandlers(() => untrack(() => disabled() ? preventInteraction : void 0), () => internalProps.onClick,
|
|
103
|
-
const onFocus = composeEventHandlers(() => internalProps.onFocus,
|
|
104
|
-
const onBlur = composeEventHandlers(() => internalProps.onBlur,
|
|
105
|
-
const onKeyDown = composeEventHandlers(() => untrack(() => disabled() ? stopInteraction : void 0), () => internalProps.onKeyDown, () => untrack(() => nativeButton() ? void 0 : handleNonNativeKeyDown));
|
|
106
|
-
const onKeyUp = composeEventHandlers(() => untrack(() => disabled() ? stopInteraction : void 0), () => internalProps.onKeyUp, () => untrack(() => nativeButton() ? void 0 : handleNonNativeKeyUp));
|
|
107
|
-
const onMouseDown = composeEventHandlers(() => untrack(() => disabled() ? stopInteraction : void 0), () => internalProps.onMouseDown);
|
|
108
|
-
const onPointerDown = composeEventHandlers(() => untrack(() => disabled() ? preventInteraction : void 0), () => internalProps.onPointerDown);
|
|
104
|
+
const onClick = composeEventHandlers(liveEventHandler(() => untrack(() => disabled() ? preventInteraction : void 0)), liveEventHandler(() => internalProps.onClick), handleRootClick);
|
|
105
|
+
const onFocus = composeEventHandlers(liveEventHandler(() => internalProps.onFocus), handleRootFocus);
|
|
106
|
+
const onBlur = composeEventHandlers(liveEventHandler(() => internalProps.onBlur), handleRootBlur);
|
|
107
|
+
const onKeyDown = composeEventHandlers(liveEventHandler(() => untrack(() => disabled() ? stopInteraction : void 0)), liveEventHandler(() => internalProps.onKeyDown), liveEventHandler(() => untrack(() => nativeButton() ? void 0 : handleNonNativeKeyDown)));
|
|
108
|
+
const onKeyUp = composeEventHandlers(liveEventHandler(() => untrack(() => disabled() ? stopInteraction : void 0)), liveEventHandler(() => internalProps.onKeyUp), liveEventHandler(() => untrack(() => nativeButton() ? void 0 : handleNonNativeKeyUp)));
|
|
109
|
+
const onMouseDown = composeEventHandlers(liveEventHandler(() => untrack(() => disabled() ? stopInteraction : void 0)), liveEventHandler(() => internalProps.onMouseDown));
|
|
110
|
+
const onPointerDown = composeEventHandlers(liveEventHandler(() => untrack(() => disabled() ? preventInteraction : void 0)), liveEventHandler(() => internalProps.onPointerDown));
|
|
109
111
|
function handleRootClick(event) {
|
|
110
112
|
if (readOnly() || disabled()) return;
|
|
111
113
|
event.preventDefault();
|
|
@@ -133,12 +135,6 @@ function SwitchRoot(props) {
|
|
|
133
135
|
registration.name = current.name;
|
|
134
136
|
field.registerFieldControl(source, current.disabled || !current.element ? void 0 : registration);
|
|
135
137
|
});
|
|
136
|
-
createEffect(() => ({
|
|
137
|
-
input: inputElement(),
|
|
138
|
-
id: inputId()
|
|
139
|
-
}), (current) => {
|
|
140
|
-
labelable.registerControlId(labelSource, current.input ? current.id : void 0);
|
|
141
|
-
});
|
|
142
138
|
createEffect(() => ({
|
|
143
139
|
input: inputElement(),
|
|
144
140
|
disabled: disabled()
|
|
@@ -189,16 +185,12 @@ function SwitchRoot(props) {
|
|
|
189
185
|
});
|
|
190
186
|
onCleanup(() => {
|
|
191
187
|
field.registerFieldControl(source, void 0);
|
|
192
|
-
labelable.registerControlId(labelSource, void 0);
|
|
193
188
|
});
|
|
194
189
|
return SwitchRootContext({
|
|
195
190
|
value: state,
|
|
196
191
|
get children() {
|
|
197
192
|
return [
|
|
198
|
-
|
|
199
|
-
get component() {
|
|
200
|
-
return props.as ?? "span";
|
|
201
|
-
},
|
|
193
|
+
Render(mergeProps({
|
|
202
194
|
ref: [((element) => setRootElement(element)), internalProps.ref],
|
|
203
195
|
get id() {
|
|
204
196
|
return rootId();
|
|
@@ -362,15 +354,13 @@ function listenForFormReset(input, syncChecked) {
|
|
|
362
354
|
/** The movable part that indicates whether the enclosing switch is on or off. */
|
|
363
355
|
function SwitchThumb(props) {
|
|
364
356
|
const rootState = useSwitchRootContext();
|
|
365
|
-
const others = omit(props, "
|
|
357
|
+
const others = omit(props, "render", "class", "style");
|
|
366
358
|
const state = createMemo(() => rootState());
|
|
367
359
|
const classValue = createMemo(() => resolveClass(props.class, state()));
|
|
360
|
+
const Render = useRender(props, () => state(), (props) => ssrElement("span", props, void 0, true));
|
|
368
361
|
const styleValue = createMemo(() => resolveStyle(props.style, state()));
|
|
369
362
|
const stateAttributes = createMemo(() => getStateAttributesProps(state(), switchStateAttributesMapping));
|
|
370
|
-
return
|
|
371
|
-
get component() {
|
|
372
|
-
return props.as ?? "span";
|
|
373
|
-
},
|
|
363
|
+
return Render(mergeProps({
|
|
374
364
|
get ["class"]() {
|
|
375
365
|
return classValue();
|
|
376
366
|
},
|