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 e } from "../otp-field-
|
|
1
|
+
import { t as e } from "../otp-field-lsy2iGID.js";
|
|
2
2
|
export { e as OTPField };
|
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./useRender-CxZ8PI-g.js";
|
|
3
|
+
import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
|
|
4
|
+
import { _ as r, b as i, g as a, h as o } from "./reasons-Co5CzjKq.js";
|
|
5
|
+
import { n as s, t as c } from "./resolveStyle-XcgAuaKR.js";
|
|
6
|
+
import { createChangeEventDetails as l, createGenericEventDetails as u } from "./internals/createBaseUIEventDetails.js";
|
|
7
|
+
import { composeEventHandlers as d, liveEventHandler as f } from "./internals/composeEventHandlers.js";
|
|
8
|
+
import { n as p } from "./DirectionContext-BwMabICS.js";
|
|
9
|
+
import { fieldValidityMapping as m } from "./internals/field-constants.js";
|
|
10
|
+
import { r as h } from "./FieldRootContext-D3fuVjs3.js";
|
|
11
|
+
import { n as g } from "./FormContext-CwLBtm_d.js";
|
|
12
|
+
import { r as _ } from "./LabelableContext-CmQF-TX2.js";
|
|
13
|
+
import { t as ee } from "./Separator-D5oJzlA3.js";
|
|
14
|
+
import { createComponent as te, delegateEvents as v, effect as y, getNextElement as ne, memo as b, mergeProps as re, ref as x, runHydrationEvents as ie, setAttribute as S, setProperty as ae, spread as oe, style as se, template as C } from "@solidjs/web";
|
|
15
|
+
import { createContext as w, createEffect as T, createMemo as E, createSignal as D, createUniqueId as ce, omit as le, onCleanup as ue, onSettled as de, untrack as O, useContext as k } from "solid-js";
|
|
16
|
+
//#region src/otp-field/utils/otp.ts
|
|
17
|
+
var A = {
|
|
18
|
+
numeric: {
|
|
19
|
+
slotPattern: "\\d{1}",
|
|
20
|
+
getRootPattern: (e) => `\\d{${e}}`,
|
|
21
|
+
regexp: /[^\d]/g,
|
|
22
|
+
inputMode: "numeric"
|
|
23
|
+
},
|
|
24
|
+
alpha: {
|
|
25
|
+
slotPattern: "[a-zA-Z]{1}",
|
|
26
|
+
getRootPattern: (e) => `[a-zA-Z]{${e}}`,
|
|
27
|
+
regexp: /[^a-zA-Z]/g,
|
|
28
|
+
inputMode: "text"
|
|
29
|
+
},
|
|
30
|
+
alphanumeric: {
|
|
31
|
+
slotPattern: "[a-zA-Z0-9]{1}",
|
|
32
|
+
getRootPattern: (e) => `[a-zA-Z0-9]{${e}}`,
|
|
33
|
+
regexp: /[^a-zA-Z0-9]/g,
|
|
34
|
+
inputMode: "text"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
function fe(e) {
|
|
38
|
+
return e === "none" ? null : A[e];
|
|
39
|
+
}
|
|
40
|
+
function pe(e) {
|
|
41
|
+
return (e ?? "").replace(/\s/g, "");
|
|
42
|
+
}
|
|
43
|
+
function j(e, t) {
|
|
44
|
+
return t ? e.replace(t.regexp, "") : e;
|
|
45
|
+
}
|
|
46
|
+
function M(e, t, n, r) {
|
|
47
|
+
let i = pe(e), a = fe(n), o = j(i, a), s = i.length > o.length;
|
|
48
|
+
if (r) {
|
|
49
|
+
let e = r(o);
|
|
50
|
+
s ||= o.length > e.length, o = j(e, a), s ||= e.length > o.length;
|
|
51
|
+
}
|
|
52
|
+
let c = t < 0 ? 0 : t, l = Array.from(o);
|
|
53
|
+
return [l.slice(0, c).join(""), s || l.length > c];
|
|
54
|
+
}
|
|
55
|
+
function N(e, t, n, r) {
|
|
56
|
+
return M(e, t, n, r)[0];
|
|
57
|
+
}
|
|
58
|
+
function me(e, t, n, r, i, a) {
|
|
59
|
+
let o = N(n, r, i, a);
|
|
60
|
+
return N(`${e.slice(0, t)}${o}${e.slice(t + o.length)}`, r, i, a);
|
|
61
|
+
}
|
|
62
|
+
function P(e, t) {
|
|
63
|
+
return t < 0 || t >= e.length ? e : `${e.slice(0, t)}${e.slice(t + 1)}`;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/otp-field/utils/stateAttributesMapping.ts
|
|
67
|
+
var he = {
|
|
68
|
+
value: () => null,
|
|
69
|
+
length: () => null,
|
|
70
|
+
...m
|
|
71
|
+
}, ge = {
|
|
72
|
+
value: () => null,
|
|
73
|
+
index: () => null,
|
|
74
|
+
...m
|
|
75
|
+
}, F = Symbol("OTPFieldRootContext"), _e = w(F);
|
|
76
|
+
function ve() {
|
|
77
|
+
let e = k(_e);
|
|
78
|
+
if (e !== F) return e;
|
|
79
|
+
throw Error("Base UI: OTPFieldRootContext is missing. OTPField parts must be placed within <OTPField.Root>.");
|
|
80
|
+
}
|
|
81
|
+
function ye(e, t, n) {
|
|
82
|
+
return {
|
|
83
|
+
...e,
|
|
84
|
+
value: t,
|
|
85
|
+
index: n,
|
|
86
|
+
filled: t !== ""
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/otp-field/root/OTPFieldRoot.tsx
|
|
91
|
+
var be = /* @__PURE__ */ C("<div>"), xe = /* @__PURE__ */ C("<input type=text aria-hidden=true tabindex=-1>"), Se = {
|
|
92
|
+
"clip-path": "inset(50%)",
|
|
93
|
+
overflow: "hidden",
|
|
94
|
+
"white-space": "nowrap",
|
|
95
|
+
border: "0",
|
|
96
|
+
padding: "0",
|
|
97
|
+
width: "1px",
|
|
98
|
+
height: "1px",
|
|
99
|
+
margin: "-1px",
|
|
100
|
+
position: "fixed",
|
|
101
|
+
top: "0",
|
|
102
|
+
left: "0"
|
|
103
|
+
}, Ce = {
|
|
104
|
+
...Se,
|
|
105
|
+
position: "absolute"
|
|
106
|
+
};
|
|
107
|
+
function we(e) {
|
|
108
|
+
let r = h(!0), i = g(), a = _(), d = e, f = e, p = Symbol("OTPField"), m = Symbol("OTPFieldLabel"), ee = `base-ui-${ce()}`, v = `base-ui-${ce()}`, C = O(a.controlId), w = typeof C == "string" ? C : ee, k = O(() => d.value !== void 0), A = O(() => k ? d.value : d.defaultValue), pe = N(A, O(() => d.length), O(() => d.validationType ?? "numeric"), O(() => d.normalizeValue)), [j, me] = D(A), [P, ge] = D(), [F, ve] = D(), [ye, we] = D(Math.min(pe.length, O(() => d.length) - 1)), [I, Oe] = D(!1), [L, ke] = D(0), [Ae, je] = D(), R = /* @__PURE__ */ new Map(), Me = 0, Ne, z, B, Pe = !1, Fe = !1, Ie = 0, Le = le(f, "aria-describedby", "aria-labelledby", "render", "autoComplete", "autoSubmit", "class", "defaultValue", "disabled", "form", "id", "inputMode", "length", "mask", "name", "normalizeValue", "onChange", "onValueChange", "onValueComplete", "onValueInvalid", "readOnly", "ref", "required", "style", "validationType", "value"), V = E(() => d.length), H = E(() => d.validationType ?? "numeric"), U = () => d.normalizeValue, W = E(() => N(k ? d.value : j(), V(), H(), U())), G = E(() => r.disabled() || (d.disabled ?? !1)), K = E(() => d.readOnly ?? !1), Re = E(() => d.required ?? !1), q = E(() => r.name() ?? d.name), J = E(() => d.id ?? w), ze = () => d.autoComplete ?? "one-time-code", Be = () => d.form, Ve = () => d.mask ?? !1, He = E(() => fe(H())), Ue = E(() => He()?.slotPattern), We = E(() => He()?.getRootPattern(V())), Ge = E(() => d.inputMode ?? He()?.inputMode), Ke = E(() => Number.isInteger(V()) && V() > 0), Y = E(() => (L(), Q()[0]?.element)), qe = E(() => I() ? Math.min(ye(), Math.max(V() - 1, 0)) : Math.min(W().length, V() - 1)), X = E(() => ({
|
|
109
|
+
...r.state(),
|
|
110
|
+
complete: W().length === V(),
|
|
111
|
+
disabled: G(),
|
|
112
|
+
filled: W() !== "",
|
|
113
|
+
focused: I(),
|
|
114
|
+
length: V(),
|
|
115
|
+
readOnly: K(),
|
|
116
|
+
required: Re(),
|
|
117
|
+
value: W()
|
|
118
|
+
})), Je = E(() => s(e.class, X())), Ye = t(e, () => X(), (e) => (() => {
|
|
119
|
+
var t = ne(be);
|
|
120
|
+
return oe(t, e, !1), ie(), t;
|
|
121
|
+
})()), Xe = E(() => c(e.style, X())), Ze = E(() => n(X(), he)), Qe = E(() => d["aria-labelledby"] ?? a.labelId() ?? Ae()), $e = E(() => d["aria-labelledby"] == null ? Qe() : void 0), et = E(() => a.getAriaDescribedBy(d["aria-describedby"])), tt = E(() => a.getAriaDescribedBy(void 0)), nt = O(W), Z = {
|
|
122
|
+
id: O(J),
|
|
123
|
+
name: d.name,
|
|
124
|
+
value: () => B ?? W(),
|
|
125
|
+
getControl: () => Y() ?? null
|
|
126
|
+
};
|
|
127
|
+
function rt() {
|
|
128
|
+
let e = Symbol("OTPFieldInput"), [t, n] = D(R.size), r = {
|
|
129
|
+
element: void 0,
|
|
130
|
+
index: t,
|
|
131
|
+
setIndex: n,
|
|
132
|
+
order: Me
|
|
133
|
+
};
|
|
134
|
+
return Me += 1, R.set(e, r), at(), {
|
|
135
|
+
index: t,
|
|
136
|
+
setElement(e) {
|
|
137
|
+
r.element = e, it();
|
|
138
|
+
},
|
|
139
|
+
unregister() {
|
|
140
|
+
R.delete(e), it();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function Q() {
|
|
145
|
+
return Array.from(R.values()).sort(Te);
|
|
146
|
+
}
|
|
147
|
+
function it() {
|
|
148
|
+
let e = Q();
|
|
149
|
+
for (let t = 0; t < e.length; t += 1) e[t]?.setIndex(t);
|
|
150
|
+
at();
|
|
151
|
+
}
|
|
152
|
+
function at() {
|
|
153
|
+
Fe || (Fe = !0, queueMicrotask(() => {
|
|
154
|
+
Fe = !1, Pe || ke((e) => e + 1);
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
function $(e) {
|
|
158
|
+
let t = Q(), n = t[Math.min(Math.max(e, 0), Math.max(t.length - 1, 0))]?.element;
|
|
159
|
+
n?.focus(), n?.select();
|
|
160
|
+
}
|
|
161
|
+
function ot(e, t) {
|
|
162
|
+
Ne = {
|
|
163
|
+
index: e,
|
|
164
|
+
value: t
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function st(e) {
|
|
168
|
+
let t = J();
|
|
169
|
+
if (t) return e === 0 ? t : `${t}-${e + 1}`;
|
|
170
|
+
}
|
|
171
|
+
function ct(e, t) {
|
|
172
|
+
if (e > W().length) {
|
|
173
|
+
$(Math.min(W().length, V() - 1));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
we(e), Oe(!0), r.setFocused(!0), t.currentTarget.select();
|
|
177
|
+
}
|
|
178
|
+
function lt(e) {
|
|
179
|
+
O(() => {
|
|
180
|
+
let t = e.relatedTarget, n = P();
|
|
181
|
+
n && t instanceof Element && Ee(n, t) || (r.setTouched(!0), Oe(!1), r.setFocused(!1), r.validationMode() === "onBlur" && r.validation.commit(W()));
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function ut(e, t) {
|
|
185
|
+
d.onValueInvalid?.(e, t);
|
|
186
|
+
}
|
|
187
|
+
function dt(e, t, n, r, i) {
|
|
188
|
+
if (e || t || !n) {
|
|
189
|
+
je(void 0);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
let a = n.getRootNode(), o = "querySelectorAll" in a ? a : void 0, s = r && o ? Array.from(o.querySelectorAll("label")).find((e) => e.htmlFor === r) : void 0, c = n.closest("label") ?? n.labels?.[0] ?? s;
|
|
193
|
+
if (!c || !i || c.getRootNode() !== i.getRootNode()) {
|
|
194
|
+
je(void 0);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
c.id ||= v, je(c.id || void 0);
|
|
198
|
+
}
|
|
199
|
+
function ft(e, t) {
|
|
200
|
+
let n = N(e, V(), H(), U()), r = (t.reason === "input-change" || t.reason === "input-paste") && n.length === V() && (W().length !== V() || t.reason === "input-paste") ? u(t.reason, t.event) : null;
|
|
201
|
+
return n === W() ? (r && pt(n, r), null) : (d.onValueChange?.(n, t), t.isCanceled ? null : (k || me(n), r ? z = {
|
|
202
|
+
value: n,
|
|
203
|
+
details: r
|
|
204
|
+
} : n.length !== V() && (z = void 0), n));
|
|
205
|
+
}
|
|
206
|
+
function pt(e, t) {
|
|
207
|
+
let n = d.autoSubmit ?? !1, r = Be(), i = B;
|
|
208
|
+
B = e;
|
|
209
|
+
try {
|
|
210
|
+
d.onValueComplete?.(e, t), n && mt(r, e);
|
|
211
|
+
} finally {
|
|
212
|
+
B = i;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function mt(e, t) {
|
|
216
|
+
let n = F(), r = Q().flatMap((e) => e.element ?? []), i = n?.form ?? r[0]?.form ?? null;
|
|
217
|
+
if (e) {
|
|
218
|
+
let t = P()?.ownerDocument.getElementById(e);
|
|
219
|
+
t?.tagName === "FORM" && (i = t);
|
|
220
|
+
}
|
|
221
|
+
if (!i?.requestSubmit) return;
|
|
222
|
+
let a = r.map((e) => e.value), o = n?.value;
|
|
223
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
224
|
+
let n = r[e];
|
|
225
|
+
n && (n.value = t[e] ?? "");
|
|
226
|
+
}
|
|
227
|
+
n && (n.value = t);
|
|
228
|
+
try {
|
|
229
|
+
i.requestSubmit();
|
|
230
|
+
} finally {
|
|
231
|
+
for (let e = 0; e < r.length; e += 1) {
|
|
232
|
+
let t = r[e];
|
|
233
|
+
t && (t.value = a[e] ?? "");
|
|
234
|
+
}
|
|
235
|
+
n && (n.value = o ?? "");
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
function ht(e) {
|
|
239
|
+
if (e.defaultPrevented || G() || K()) {
|
|
240
|
+
e.currentTarget.value = W();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
let t = e.currentTarget.value, [n, r] = M(t, V(), H(), U());
|
|
244
|
+
r && ut(t, u(o, e));
|
|
245
|
+
let i = ft(n, l(o, e));
|
|
246
|
+
e.currentTarget.value !== W() && (e.currentTarget.value = W()), i != null && i !== "" && ot(i.length - 1, i);
|
|
247
|
+
}
|
|
248
|
+
let gt = {
|
|
249
|
+
activeIndex: qe,
|
|
250
|
+
autoComplete: ze,
|
|
251
|
+
disabled: G,
|
|
252
|
+
form: Be,
|
|
253
|
+
focusInput: $,
|
|
254
|
+
queueFocusInput: ot,
|
|
255
|
+
getInputId: st,
|
|
256
|
+
handleInputBlur: lt,
|
|
257
|
+
handleInputFocus: ct,
|
|
258
|
+
inputMode: Ge,
|
|
259
|
+
inputAriaLabelledBy: $e,
|
|
260
|
+
invalid: () => r.invalid(),
|
|
261
|
+
length: V,
|
|
262
|
+
mask: Ve,
|
|
263
|
+
normalizeValue: U,
|
|
264
|
+
pattern: Ue,
|
|
265
|
+
readOnly: K,
|
|
266
|
+
registerInput: rt,
|
|
267
|
+
reportValueInvalid: ut,
|
|
268
|
+
required: Re,
|
|
269
|
+
setValue: ft,
|
|
270
|
+
state: X,
|
|
271
|
+
validationType: H,
|
|
272
|
+
value: W
|
|
273
|
+
};
|
|
274
|
+
return T(() => ({
|
|
275
|
+
disabled: G(),
|
|
276
|
+
firstInput: Y(),
|
|
277
|
+
id: J(),
|
|
278
|
+
name: d.name
|
|
279
|
+
}), (e) => O(() => {
|
|
280
|
+
Z.id = e.id, Z.name = e.name, r.registerFieldControl(p, e.disabled || !e.firstInput ? void 0 : Z), a.registerControlId(m, e.firstInput ? e.id : void 0);
|
|
281
|
+
})), T(() => ({
|
|
282
|
+
disabled: G(),
|
|
283
|
+
input: F()
|
|
284
|
+
}), (e) => O(() => {
|
|
285
|
+
if (!(!e.input || e.disabled)) return r.validation.registerInput(p, e.input, () => O(() => Y() ?? null));
|
|
286
|
+
})), T(() => ({
|
|
287
|
+
explicit: d["aria-labelledby"],
|
|
288
|
+
fieldLabel: a.labelId(),
|
|
289
|
+
input: Y(),
|
|
290
|
+
inputId: J(),
|
|
291
|
+
group: P()
|
|
292
|
+
}), (e) => {
|
|
293
|
+
dt(e.explicit, e.fieldLabel, e.input, e.inputId, e.group);
|
|
294
|
+
}), T(() => ({
|
|
295
|
+
initialValue: r.validityData().initialValue,
|
|
296
|
+
name: q(),
|
|
297
|
+
value: W()
|
|
298
|
+
}), (e) => {
|
|
299
|
+
if (e.value === nt) return;
|
|
300
|
+
nt = e.value, O(() => {
|
|
301
|
+
i.clearError(e.name), r.setDirty(e.value !== e.initialValue), r.setFilled(e.value !== ""), r.validation.change(e.value);
|
|
302
|
+
});
|
|
303
|
+
let t = ++Ie;
|
|
304
|
+
queueMicrotask(() => {
|
|
305
|
+
if (Pe || t !== Ie) return;
|
|
306
|
+
let e = O(W), n = Ne;
|
|
307
|
+
Ne = void 0, n?.value === e && $(n.index);
|
|
308
|
+
let r = z;
|
|
309
|
+
z = void 0, r?.value === e && pt(e, r.details);
|
|
310
|
+
});
|
|
311
|
+
}), T(() => (L(), {
|
|
312
|
+
count: R.size,
|
|
313
|
+
length: V()
|
|
314
|
+
}), (e) => {
|
|
315
|
+
De() && Number.isInteger(e.length) && e.length > 0 && e.count !== 0 && e.count !== e.length && console.warn(`<OTPField.Root> \`length\` must match the number of rendered <OTPField.Input /> parts. Received \`length={${e.length}}\` but rendered ${e.count} input${e.count === 1 ? "" : "s"}.`);
|
|
316
|
+
}), T(() => V(), (e) => {
|
|
317
|
+
De() && (!Number.isInteger(e) || e <= 0) && console.warn(`<OTPField.Root> \`length\` must be a positive integer. Received \`length={${String(e)}}\`.`);
|
|
318
|
+
}), T(() => {
|
|
319
|
+
L();
|
|
320
|
+
let e = /* @__PURE__ */ new Set(), t = P();
|
|
321
|
+
t && e.add(t.getRootNode());
|
|
322
|
+
for (let t of R.values()) t.element && e.add(t.element.getRootNode());
|
|
323
|
+
return Array.from(e);
|
|
324
|
+
}, (e) => {
|
|
325
|
+
if (typeof MutationObserver > "u") return;
|
|
326
|
+
function t(e) {
|
|
327
|
+
return e.type === "attributes" ? e.target instanceof HTMLLabelElement || Array.from(R.values()).some((t) => t.element === e.target) : [...e.addedNodes, ...e.removedNodes].some((e) => e instanceof HTMLLabelElement ? !0 : e instanceof Element ? e.querySelector("label") ? !0 : Array.from(R.values()).some((t) => t.element === e || (t.element ? e.contains(t.element) : !1)) : !1);
|
|
328
|
+
}
|
|
329
|
+
let n = new MutationObserver((e) => {
|
|
330
|
+
e.some(t) && (it(), O(() => {
|
|
331
|
+
dt(d["aria-labelledby"], a.labelId(), Q()[0]?.element, J(), P());
|
|
332
|
+
}));
|
|
333
|
+
});
|
|
334
|
+
for (let t of e) n.observe(t, {
|
|
335
|
+
attributeFilter: ["for", "id"],
|
|
336
|
+
attributes: !0,
|
|
337
|
+
childList: !0,
|
|
338
|
+
subtree: !0
|
|
339
|
+
});
|
|
340
|
+
return () => n.disconnect();
|
|
341
|
+
}), de(() => O(() => {
|
|
342
|
+
r.setFilled(W() !== "");
|
|
343
|
+
let e = Q()[0]?.element;
|
|
344
|
+
Z.id = J(), Z.name = d.name, r.registerFieldControl(p, G() || !e ? void 0 : Z), a.registerControlId(m, e ? J() : void 0), dt(d["aria-labelledby"], a.labelId(), e, J(), P());
|
|
345
|
+
})), ue(() => {
|
|
346
|
+
Pe = !0, r.registerFieldControl(p, void 0), a.registerControlId(m, void 0);
|
|
347
|
+
}), te(_e, {
|
|
348
|
+
value: gt,
|
|
349
|
+
get children() {
|
|
350
|
+
return [te(Ye, re({
|
|
351
|
+
ref: [((e) => ge(e)), d.ref],
|
|
352
|
+
get class() {
|
|
353
|
+
return Je();
|
|
354
|
+
},
|
|
355
|
+
get style() {
|
|
356
|
+
return Xe();
|
|
357
|
+
},
|
|
358
|
+
role: "group",
|
|
359
|
+
get "aria-describedby"() {
|
|
360
|
+
return et();
|
|
361
|
+
},
|
|
362
|
+
get "aria-labelledby"() {
|
|
363
|
+
return Qe();
|
|
364
|
+
}
|
|
365
|
+
}, Ze, Le)), b(() => b(() => !!Ke())() ? (() => {
|
|
366
|
+
var e = ne(xe);
|
|
367
|
+
return e.$$input = ht, e.addEventListener("focus", () => $(0)), x(() => (e) => ve(e), e), y(() => ({
|
|
368
|
+
e: J() && q() == null ? `${J()}-hidden-input` : void 0,
|
|
369
|
+
t: Be(),
|
|
370
|
+
a: q(),
|
|
371
|
+
o: W(),
|
|
372
|
+
i: ze(),
|
|
373
|
+
n: Ge(),
|
|
374
|
+
s: V(),
|
|
375
|
+
h: V(),
|
|
376
|
+
r: We(),
|
|
377
|
+
d: G(),
|
|
378
|
+
l: K(),
|
|
379
|
+
u: Re(),
|
|
380
|
+
c: tt(),
|
|
381
|
+
w: X().valid === !1 && !G() ? "true" : void 0,
|
|
382
|
+
m: q() ? Ce : Se
|
|
383
|
+
}), ({ e: t, t: n, a: r, o: i, i: a, n: o, s, h: c, r: l, d: u, l: d, u: f, c: p, w: m, m: h }, g) => {
|
|
384
|
+
t !== g?.e && S(e, "id", t), n !== g?.t && S(e, "form", n), r !== g?.a && S(e, "name", r), ae(e, "value", i), a !== g?.i && S(e, "autocomplete", a), o !== g?.n && S(e, "inputmode", o), s !== g?.s && S(e, "minlength", s), c !== g?.h && S(e, "maxlength", c), l !== g?.r && S(e, "pattern", l), u !== g?.d && S(e, "disabled", u), d !== g?.l && S(e, "readonly", d), f !== g?.u && S(e, "required", f), p !== g?.c && S(e, "aria-describedby", p), m !== g?.w && S(e, "aria-invalid", m), se(e, h, g?.m);
|
|
385
|
+
}), ie(), e;
|
|
386
|
+
})() : Ke())];
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
function Te(e, t) {
|
|
391
|
+
if (!e.element || !t.element || e.element === t.element) return e.order - t.order;
|
|
392
|
+
let n = e.element.compareDocumentPosition(t.element);
|
|
393
|
+
return n & Node.DOCUMENT_POSITION_DISCONNECTED ? e.order - t.order : n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : e.order - t.order;
|
|
394
|
+
}
|
|
395
|
+
function Ee(e, t) {
|
|
396
|
+
if (e.contains(t)) return !0;
|
|
397
|
+
let n = t;
|
|
398
|
+
for (; n;) {
|
|
399
|
+
if (n === e) return !0;
|
|
400
|
+
n = n.parentNode ?? (n instanceof ShadowRoot ? n.host : null);
|
|
401
|
+
}
|
|
402
|
+
return !1;
|
|
403
|
+
}
|
|
404
|
+
function De() {
|
|
405
|
+
return !1;
|
|
406
|
+
}
|
|
407
|
+
v(["input"]);
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/otp-field/input/OTPFieldInput.tsx
|
|
410
|
+
var I = /* @__PURE__ */ C("<input>");
|
|
411
|
+
function Oe(e) {
|
|
412
|
+
let m = ve(), h = p(), g = m.registerInput(), _ = e, ee = le(e, "aria-label", "aria-labelledby", "render", "class", "defaultChecked", "defaultValue", "index", "onBlur", "onFocus", "onInput", "onKeyDown", "onMouseDown", "onPaste", "ref", "style"), v = g.index, y = E(() => m.value()[v()] ?? ""), x = E(() => ye(m.state(), y(), v())), S = E(() => s(e.class, x())), ae = t(e, () => x(), (e) => (() => {
|
|
413
|
+
var t = ne(I);
|
|
414
|
+
return oe(t, e, !1), ie(), t;
|
|
415
|
+
})()), se = E(() => c(e.style, x())), C = E(() => n(x(), ge)), w = E(() => v() === 0 ? void 0 : _["aria-label"]), ce = E(() => _["aria-labelledby"] ?? m.inputAriaLabelledBy()), [de, O] = D(), k = d(f(() => _.onMouseDown), he), A = d(f(() => _.onFocus), F), fe = d(f(() => _.onBlur), _e), pe = d(f(() => _.onInput), be), j = d(f(() => _.onKeyDown), xe), N = d(f(() => _.onPaste), Se);
|
|
416
|
+
function he(e) {
|
|
417
|
+
e.defaultPrevented || m.disabled() || (e.preventDefault(), m.focusInput(v()));
|
|
418
|
+
}
|
|
419
|
+
function F(e) {
|
|
420
|
+
e.defaultPrevented || m.disabled() || m.handleInputFocus(v(), e);
|
|
421
|
+
}
|
|
422
|
+
function _e(e) {
|
|
423
|
+
e.defaultPrevented || m.handleInputBlur(e);
|
|
424
|
+
}
|
|
425
|
+
function be(e) {
|
|
426
|
+
if (e.defaultPrevented || m.disabled() || m.readOnly()) {
|
|
427
|
+
e.currentTarget.value = y();
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
let t = e.currentTarget.value, [n, r] = M(t, m.length(), m.validationType(), m.normalizeValue());
|
|
431
|
+
if (r && m.reportValueInvalid(t, u(o, e)), n === "") {
|
|
432
|
+
t === "" ? (m.setValue(P(m.value(), v()), l(a, e)), e.currentTarget.value = y()) : (e.currentTarget.value = y(), y() !== "" && e.currentTarget.select());
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
let i = me(m.value(), v(), n, m.length(), m.validationType(), m.normalizeValue()), s = m.setValue(i, l(o, e));
|
|
436
|
+
e.currentTarget.value !== y() && (e.currentTarget.value = y()), s != null && m.queueFocusInput(Math.min(v() + n.length, m.length() - 1), s);
|
|
437
|
+
}
|
|
438
|
+
function xe(e) {
|
|
439
|
+
if (e.defaultPrevented || m.disabled()) return;
|
|
440
|
+
let t = Math.max(m.length() - 1, 0), n = Math.min(m.value().length, t), r = (e.ctrlKey || e.metaKey) && !e.altKey, a = h() === "rtl" ? "ArrowRight" : "ArrowLeft", o = h() === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
441
|
+
if (e.key === a) {
|
|
442
|
+
L(e), m.focusInput(r ? 0 : Math.max(0, v() - 1));
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (e.key === o) {
|
|
446
|
+
L(e), m.focusInput(r ? n : Math.min(t, v() + 1));
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (e.key === "Home" || e.key === "ArrowUp") {
|
|
450
|
+
L(e), m.focusInput(0);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
if (e.key === "End" || e.key === "ArrowDown") {
|
|
454
|
+
L(e), m.focusInput(n);
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
if (m.readOnly()) return;
|
|
458
|
+
let s = (t, n) => {
|
|
459
|
+
let r = m.setValue(t, l(i, e));
|
|
460
|
+
r != null && m.queueFocusInput(n, r);
|
|
461
|
+
};
|
|
462
|
+
if (e.key === "Backspace" && r) {
|
|
463
|
+
L(e), s("", 0);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (e.key === "Delete") {
|
|
467
|
+
L(e), s(P(m.value(), v()), v());
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
let c = e.currentTarget.value, u = e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === c.length;
|
|
471
|
+
if (e.key.length === 1 && u && y() === e.key) {
|
|
472
|
+
L(e), v() < m.length() - 1 && m.focusInput(v() + 1);
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (e.key === "Backspace") {
|
|
476
|
+
L(e);
|
|
477
|
+
let t = Math.max(0, v() - 1), n = y() === "" ? t : v();
|
|
478
|
+
s(P(m.value(), n), t);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function Se(e) {
|
|
482
|
+
if (e.defaultPrevented || m.disabled() || m.readOnly()) return;
|
|
483
|
+
let t = "";
|
|
484
|
+
try {
|
|
485
|
+
t = e.clipboardData?.getData("text/plain") ?? "";
|
|
486
|
+
} catch {
|
|
487
|
+
ke() && console.warn("<OTPField.Input> could not read clipboard text during paste handling.");
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
e.preventDefault();
|
|
491
|
+
let [n, i] = M(t, m.length(), m.validationType(), m.normalizeValue());
|
|
492
|
+
if (i && m.reportValueInvalid(t, u(r, e)), n === "") return;
|
|
493
|
+
let a = m.setValue(me(m.value(), v(), n, m.length(), m.validationType(), m.normalizeValue()), l(r, e));
|
|
494
|
+
a != null && m.queueFocusInput(Math.min(v() + n.length, m.length() - 1), a);
|
|
495
|
+
}
|
|
496
|
+
return T(() => ({
|
|
497
|
+
element: de(),
|
|
498
|
+
index: v(),
|
|
499
|
+
label: _["aria-label"]
|
|
500
|
+
}), (e) => {
|
|
501
|
+
ke() && e.element && e.index === 0 && e.label != null && !e.element.labels?.length && console.warn("<OTPField.Input> ignores `aria-label` on the first input. Use a `<label>` or `<Field.Label>` to label the OTP field.");
|
|
502
|
+
}), ue(g.unregister), te(ae, re({
|
|
503
|
+
ref: [((e) => {
|
|
504
|
+
O(e), g.setElement(e);
|
|
505
|
+
}), _.ref],
|
|
506
|
+
get id() {
|
|
507
|
+
return m.getInputId(v());
|
|
508
|
+
},
|
|
509
|
+
get value() {
|
|
510
|
+
return y();
|
|
511
|
+
},
|
|
512
|
+
get type() {
|
|
513
|
+
return m.mask() ? "password" : "text";
|
|
514
|
+
},
|
|
515
|
+
get inputmode() {
|
|
516
|
+
return m.inputMode();
|
|
517
|
+
},
|
|
518
|
+
get autocomplete() {
|
|
519
|
+
return b(() => v() === 0)() ? m.autoComplete() : "off";
|
|
520
|
+
},
|
|
521
|
+
autocorrect: "off",
|
|
522
|
+
spellcheck: !1,
|
|
523
|
+
get enterkeyhint() {
|
|
524
|
+
return v() === m.length() - 1 ? "done" : "next";
|
|
525
|
+
},
|
|
526
|
+
get maxlength() {
|
|
527
|
+
return b(() => v() === 0)() ? m.length() : void 0;
|
|
528
|
+
},
|
|
529
|
+
get tabindex() {
|
|
530
|
+
return m.activeIndex() === v() ? 0 : -1;
|
|
531
|
+
},
|
|
532
|
+
get disabled() {
|
|
533
|
+
return m.disabled();
|
|
534
|
+
},
|
|
535
|
+
get form() {
|
|
536
|
+
return m.form();
|
|
537
|
+
},
|
|
538
|
+
get pattern() {
|
|
539
|
+
return m.pattern();
|
|
540
|
+
},
|
|
541
|
+
get readonly() {
|
|
542
|
+
return m.readOnly();
|
|
543
|
+
},
|
|
544
|
+
get required() {
|
|
545
|
+
return m.required();
|
|
546
|
+
},
|
|
547
|
+
get "aria-labelledby"() {
|
|
548
|
+
return b(() => w() == null)() ? ce() : void 0;
|
|
549
|
+
},
|
|
550
|
+
get "aria-invalid"() {
|
|
551
|
+
return !m.disabled() && m.invalid() ? "true" : void 0;
|
|
552
|
+
},
|
|
553
|
+
get "aria-label"() {
|
|
554
|
+
return w();
|
|
555
|
+
},
|
|
556
|
+
get class() {
|
|
557
|
+
return S();
|
|
558
|
+
},
|
|
559
|
+
get style() {
|
|
560
|
+
return se();
|
|
561
|
+
},
|
|
562
|
+
onMouseDown: k,
|
|
563
|
+
onFocus: A,
|
|
564
|
+
onBlur: fe,
|
|
565
|
+
onInput: pe,
|
|
566
|
+
onKeyDown: j,
|
|
567
|
+
onPaste: N
|
|
568
|
+
}, C, ee));
|
|
569
|
+
}
|
|
570
|
+
function L(e) {
|
|
571
|
+
e.preventDefault(), e.stopPropagation();
|
|
572
|
+
}
|
|
573
|
+
function ke() {
|
|
574
|
+
return !1;
|
|
575
|
+
}
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/otp-field/index.parts.ts
|
|
578
|
+
var Ae = /* @__PURE__ */ e({
|
|
579
|
+
Input: () => Oe,
|
|
580
|
+
Root: () => we,
|
|
581
|
+
Separator: () => ee
|
|
582
|
+
});
|
|
583
|
+
//#endregion
|
|
584
|
+
export { Ae as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../popover-
|
|
1
|
+
import { t as e } from "../popover-Cmvmuf1L.js";
|
|
2
2
|
export { e as Popover };
|