@fldr/ui 0.0.0-stage → 0.3.0
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 +2366 -0
- package/LICENSE +21 -0
- package/README.md +488 -2
- package/ai/USAGE.md +216 -0
- package/ai/component-registry.json +8694 -0
- package/ai/component-registry.md +11933 -0
- package/ai/schemas.ts +1239 -0
- package/bin/kumo.js +36 -0
- package/dist/.build-complete +1 -0
- package/dist/ai/schemas.d.ts +3229 -0
- package/dist/ai/schemas.js +5963 -0
- package/dist/blocks-source/delete-resource/delete-resource.test.tsx +21 -0
- package/dist/blocks-source/delete-resource/delete-resource.tsx +219 -0
- package/dist/blocks-source/page-header/page-header.tsx +99 -0
- package/dist/blocks-source/resource-list/resource-list.test.tsx +28 -0
- package/dist/blocks-source/resource-list/resource-list.tsx +66 -0
- package/dist/button-DzavLWXm.d.ts +227 -0
- package/dist/catalog.d.ts +380 -0
- package/dist/catalog.js +387 -0
- package/dist/chunks/AccordionPanelDataAttributes-mmrmkky28u1010l5.js +457 -0
- package/dist/chunks/AlertDialogTrigger-l1r1gbxcky1xq889.js +24 -0
- package/dist/chunks/AlertDialogTriggerDataAttributes-go49qon601catpgn.js +56 -0
- package/dist/chunks/AutocompleteItem-36ysm5nwbsd0snr6.js +70 -0
- package/dist/chunks/AutocompleteItemDataAttributes-n5rigpf0s9ylnwi3.js +232 -0
- package/dist/chunks/AutocompleteSeparator-bnqeqh7i983d92gx.js +12 -0
- package/dist/chunks/AvatarImageDataAttributes-jw70u384c83lhqfp.js +247 -0
- package/dist/chunks/ButtonDataAttributes-nceand1fi7lvnmkb.js +35 -0
- package/dist/chunks/CSPContext-iv67i0qqhihg8mur.js +11 -0
- package/dist/chunks/CSPProvider-finau3a8hnc9o2td.js +24 -0
- package/dist/chunks/CheckboxGroup-581mfftu99wvjb3a.js +190 -0
- package/dist/chunks/CheckboxGroupContext-jf1bt3znvqlhrql6.js +10 -0
- package/dist/chunks/CheckboxGroupDataAttributes-nskqcxts64symbvf.js +10 -0
- package/dist/chunks/CheckboxIndicator-i13dmhacfgqo328c.js +414 -0
- package/dist/chunks/CheckboxIndicatorDataAttributes-3p29ju7nkczz1l2y.js +85 -0
- package/dist/chunks/CollapsiblePanel-md5suzmtnsyz1kab.js +178 -0
- package/dist/chunks/CollapsibleRootDataAttributes-bynmgxmt4jikaoha.js +36 -0
- package/dist/chunks/ComboboxClear-ioejwvtnmqanph88.js +294 -0
- package/dist/chunks/ComboboxClearDataAttributes-lo0enstdmrqpywsy.js +402 -0
- package/dist/chunks/ComboboxEmpty-gkt1y5b81a4983v7.js +1950 -0
- package/dist/chunks/ComboboxItemIndicatorDataAttributes-iku7l9ig0ve09an4.js +259 -0
- package/dist/chunks/ComboboxPopup-n8cbgys9st446j1i.js +205 -0
- package/dist/chunks/CompositeItem-kepwg8jtvgap06o6.js +20 -0
- package/dist/chunks/CompositeList-gwuaf6d14s4da0j0.js +182 -0
- package/dist/chunks/CompositeListContext-bejvmlu39hsfjzgu.js +15 -0
- package/dist/chunks/CompositeRoot-dnlkb27uw4g5aocf.js +223 -0
- package/dist/chunks/CompositeRootContext-obm54j7y6s86qwhq.js +12 -0
- package/dist/chunks/ContextMenuTriggerDataAttributes-xwozccynxv6pk5s0.js +237 -0
- package/dist/chunks/DialogBackdropDataAttributes-jwqxd6jla03xh8ke.js +28 -0
- package/dist/chunks/DialogCloseDataAttributes-12m7gwh3i6fd7d05.js +76 -0
- package/dist/chunks/DialogPopup-n6w7b389e7bs0472.js +133 -0
- package/dist/chunks/DialogRoot-hkkqj7vcjpkx8qk8.js +16 -0
- package/dist/chunks/DialogTrigger-kpugfkbfswqrus4u.js +142 -0
- package/dist/chunks/DialogTriggerDataAttributes-bp9bu13cvwuddh5b.js +18 -0
- package/dist/chunks/DialogViewportDataAttributes-mma9emv1edsc1vuy.js +78 -0
- package/dist/chunks/DirectionContext-kpby968j030psajn.js +10 -0
- package/dist/chunks/DirectionProvider-cg0pwzgdyg6r73r6.js +21 -0
- package/dist/chunks/DrawerViewport-mzqpwvqtylnad8ib.js +1532 -0
- package/dist/chunks/DrawerViewportDataAttributes-dd9593zm9fl9vcsm.js +1072 -0
- package/dist/chunks/FieldControl-hjj2tcqruozadgdi.js +122 -0
- package/dist/chunks/FieldDescription-orix2gepowrp5ni4.js +122 -0
- package/dist/chunks/FieldItemContext-ohsf45im6xhpay40.js +10 -0
- package/dist/chunks/FieldItemDataAttributes-m52srx69pispz49i.js +283 -0
- package/dist/chunks/FieldLabel-fjc7tdis7rcbq8o4.js +353 -0
- package/dist/chunks/FieldsetLegend-gl9z9eezr0xg9zr7.js +61 -0
- package/dist/chunks/FieldsetLegendDataAttributes-fn20251jxjqkpkxm.js +17 -0
- package/dist/chunks/FieldsetRootContext-fphwizvcm55ydg94.js +12 -0
- package/dist/chunks/FloatingPortalLite-j7dsy7gokbxdoe1i.js +25 -0
- package/dist/chunks/FloatingRootStore-men6ufp3a2b296fh.js +840 -0
- package/dist/chunks/FloatingTree-kiyzavvaum442o1s.js +115 -0
- package/dist/chunks/Form-oz425k7r4abea8o4.js +113 -0
- package/dist/chunks/FormContext-jv19engyccpf6xcl.js +18 -0
- package/dist/chunks/Input-ozudotydd679ly63.js +20 -0
- package/dist/chunks/InputDataAttributes-oy8t6q5y5t8ik02j.js +42 -0
- package/dist/chunks/ItemIndicator-cvf8cw5fv5l3cd8j.js +37 -0
- package/dist/chunks/LabelableContext-dz4wz3lu3lgqusu7.js +135 -0
- package/dist/chunks/ListboxSeparator-skazx18vzzj7i9zp.js +21 -0
- package/dist/chunks/MenuClearDataAttributes-fo0pekd36n56mdxu.js +1645 -0
- package/dist/chunks/MenuSubmenuTrigger-hm5xbgik6aq95x35.js +1976 -0
- package/dist/chunks/MenuSubmenuTriggerDataAttributes-gdfxdjymgmnaxdds.js +372 -0
- package/dist/chunks/MenuTrigger-dlfvicsaggss0o9m.js +265 -0
- package/dist/chunks/Menubar-ja5int05ihjj0ra4.js +116 -0
- package/dist/chunks/MenubarContext-ooz0h08i55c8oip5.js +12 -0
- package/dist/chunks/MeterLabel-cykbkvqys5263z05.js +148 -0
- package/dist/chunks/NavigationMenuIconDataAttributes-l82pkpm61d0meqxf.js +1654 -0
- package/dist/chunks/NullStore-my62xo2vfcfkerri.js +110 -0
- package/dist/chunks/NumberFieldScrubAreaCursorDataAttributes-k2lsbk35svshnwf5.js +1493 -0
- package/dist/chunks/OTPFieldInputDataAttributes-gvgtu2gg85kgjzwr.js +683 -0
- package/dist/chunks/PopoverViewport-peh28i8q4hqfjy97.js +713 -0
- package/dist/chunks/PopoverViewportDataAttributes-gplhq9d7ffp9q8u3.js +329 -0
- package/dist/chunks/PrehydrationScript-hs2je3mndbxuts7w.js +78 -0
- package/dist/chunks/PreviewCardViewportDataAttributes-bgfwmyshey7fx6nr.js +914 -0
- package/dist/chunks/ProgressLabelDataAttributes-j8mutcz11ei0ohvj.js +287 -0
- package/dist/chunks/RadioGroup-kioqngmmuo7a1lfa.js +163 -0
- package/dist/chunks/RadioGroupContext-dr6uihsj7oky0eol.js +10 -0
- package/dist/chunks/RadioGroupDataAttributes-dpdr6xe4ve204qwb.js +10 -0
- package/dist/chunks/RadioIndicator-bhxqih8wzv7hyrec.js +299 -0
- package/dist/chunks/RadioIndicatorDataAttributes-n5yupp5psifu0d4f.js +80 -0
- package/dist/chunks/ScrollAreaThumb-hxig41yn4lrurd3o.js +928 -0
- package/dist/chunks/ScrollAreaThumbDataAttributes-gup5wfxvqye6jj27.js +137 -0
- package/dist/chunks/SelectScrollUpArrowDataAttributes-fce5i1afjkb0necr.js +473 -0
- package/dist/chunks/SelectSeparator-nnak70azojox8b2b.js +1632 -0
- package/dist/chunks/Separator-fhwve0tfny3tht3a.js +24 -0
- package/dist/chunks/SeparatorDataAttributes-ch6e63bas7zflw00.js +11 -0
- package/dist/chunks/SliderIndicator-h1o3qbrvr8x0t4t2.js +1171 -0
- package/dist/chunks/SliderIndicatorDataAttributes-ff2f1cjealif5nvo.js +240 -0
- package/dist/chunks/SwitchRoot-m4t2tq5zn5wibyxk.js +244 -0
- package/dist/chunks/SwitchThumbDataAttributes-f95ld864on9y6ptk.js +90 -0
- package/dist/chunks/TabsList-n5n93rxr4sy704u8.js +664 -0
- package/dist/chunks/TabsListDataAttributes-e03a7kbubuf02z1l.js +183 -0
- package/dist/chunks/ToastArrowDataAttributes-jbnvz3kp6a35slgj.js +136 -0
- package/dist/chunks/ToggleDataAttributes-jl9ojyvwgrvefke6.js +103 -0
- package/dist/chunks/ToggleGroupContext-hg8zbkgqpscqhz83.js +10 -0
- package/dist/chunks/ToggleGroupDataAttributes-n1dwona1alvabstl.js +102 -0
- package/dist/chunks/ToolbarGroupContext-eawva8xkxb4osbxb.js +10 -0
- package/dist/chunks/ToolbarInput-kyxl1be0p3cyuayp.js +174 -0
- package/dist/chunks/ToolbarInputDataAttributes-n4a18a4km735du04.js +150 -0
- package/dist/chunks/ToolbarRootContext-difqbj720teyt8lu.js +12 -0
- package/dist/chunks/TooltipPopup-furysmeyb68uycbz.js +839 -0
- package/dist/chunks/TooltipProvider-hyans0ens4axh1y8.js +61 -0
- package/dist/chunks/TooltipViewportDataAttributes-gkwbezdq40ssuevg.js +312 -0
- package/dist/chunks/adaptiveOriginMiddleware-m9tqzw58wya9sdds.js +51 -0
- package/dist/chunks/addEventListener-ku3x23446prmd1kz.js +13 -0
- package/dist/chunks/areArraysEqual-nnpg93s9g7aqcaoh.js +15 -0
- package/dist/chunks/autocomplete-gdd9aruremdgdvx7.js +152 -0
- package/dist/chunks/badge-gca8xfu79ne55d5k.js +165 -0
- package/dist/chunks/banner-mo1xl9ww734kgsqh.js +269 -0
- package/dist/chunks/breadcrumbs-z1jo40oxlw8e4eh4.js +159 -0
- package/dist/chunks/button-group-biv43ksvaipc3p5n.js +59 -0
- package/dist/chunks/button-hzvowfkbathmx8yg.js +274 -0
- package/dist/chunks/chart-dgh98nbzo2sux2bs.js +3985 -0
- package/dist/chunks/checkbox-eifiwbw34xwsikvf.js +211 -0
- package/dist/chunks/clamp-rcpupxvhqrn8uuyf.js +7 -0
- package/dist/chunks/clipboard-text-oukrnke1s3kebk3y.js +209 -0
- package/dist/chunks/cloudflare-logo-d8mid9xr190h78cu.js +186 -0
- package/dist/chunks/code-hp2x28uiufmk3elz.js +94 -0
- package/dist/chunks/collapsible-ic6813hc4yv5s5hv.js +185 -0
- package/dist/chunks/combobox-mzvobpvalz2gnpli.js +321 -0
- package/dist/chunks/command-palette-d45ueqbuxygu87ir.js +507 -0
- package/dist/chunks/composite-c11t1ok72s3cggjc.js +90 -0
- package/dist/chunks/constants-l10cgj6pyqg27jod.js +5 -0
- package/dist/chunks/createBaseUIEventDetails-nvee6bghv2reeqdb.js +50 -0
- package/dist/chunks/createItems-n07tfwx89cdoar18.js +323 -0
- package/dist/chunks/createToastManager-cxjmn4jx3ejh85fs.js +1225 -0
- package/dist/chunks/date-picker-ija2bz17ai6ypnao.js +6865 -0
- package/dist/chunks/date-range-picker-oivlshld01jbel29.js +336 -0
- package/dist/chunks/dialog-g7wavhkdv2gplwq9.js +173 -0
- package/dist/chunks/dropdown-m5a8nwer5hpvnkfk.js +384 -0
- package/dist/chunks/empty-e0onzpyokyl6h9bp.js +96 -0
- package/dist/chunks/engine-hzmefiqm63hu0c7i.js +10 -0
- package/dist/chunks/error-lbnic2b20qr3mukp.js +6 -0
- package/dist/chunks/field-fowmq5smvp17pnqe.js +75 -0
- package/dist/chunks/flow-fak0fyldoaozd32s.js +10290 -0
- package/dist/chunks/formatNumber-b4kjdsebslm2b3t0.js +21 -0
- package/dist/chunks/getCssDimensions-gckwdrp86f73cv51.js +21 -0
- package/dist/chunks/getElementTransform-cz3jyftv0x5io95f.js +38 -0
- package/dist/chunks/getFiniteAnimations-jwd833ybtz81j5f0.js +13 -0
- package/dist/chunks/getHighlightReason-fhc53kq6qakcct9s.js +15 -0
- package/dist/chunks/getPseudoElementBounds-csuw8kwsoeyxd5tv.js +37 -0
- package/dist/chunks/grid-nwiczrab3r4w0zr2.js +118 -0
- package/dist/chunks/highlighter-mouttug0tu8xg1i8.js +1364 -0
- package/dist/chunks/index.parts-db9pzsm9rrs9tp0t.js +200 -0
- package/dist/chunks/index.parts-ggacwr0yakuemead.js +24 -0
- package/dist/chunks/index.parts-pcg3pmf3yyro841t.js +13 -0
- package/dist/chunks/inertValue-n09gkjvwwa1kddov.js +9 -0
- package/dist/chunks/inline-copy-text-izxpvnrtebcqlquf.js +104 -0
- package/dist/chunks/input-group-h9fepskc84e1h11n.js +457 -0
- package/dist/chunks/input-kfi46426y22ocoo4.js +85 -0
- package/dist/chunks/input-m2tfec2viezoz9hh.js +146 -0
- package/dist/chunks/isElementDisabled-dyqutxpzdfppbohx.js +7 -0
- package/dist/chunks/itemEquality-ki3x4tzdhjlqjey6.js +56 -0
- package/dist/chunks/label-f18fnpbv85jddo4q.js +76 -0
- package/dist/chunks/layer-card-lsmeuqic9i1isv2b.js +74 -0
- package/dist/chunks/layer-dialog-ejtz9s7bbfhjk1md.js +414 -0
- package/dist/chunks/link-h84bkh8eem39p529.js +112 -0
- package/dist/chunks/link-provider-kbwllpbo24fvgioj.js +60 -0
- package/dist/chunks/loader-kv5nk8j8tsuesxqo.js +87 -0
- package/dist/chunks/locale-provider-j4ii538ntyok36r6.js +50 -0
- package/dist/chunks/menubar-gzlyhmmc4i24prn1.js +106 -0
- package/dist/chunks/mergeCleanups-nw73c6jfwl5tyhw4.js +15 -0
- package/dist/chunks/meter-poh8jpe0qtq6mvee.js +35 -0
- package/dist/chunks/pagination-lmogkvvtu19mnr7f.js +296 -0
- package/dist/chunks/popover-nqrt3ykqv6sic8pz.js +206 -0
- package/dist/chunks/popupHandle-dk3ixgc8flr7v971.js +177 -0
- package/dist/chunks/popupStoreUtils-czfnxn051xakask5.js +868 -0
- package/dist/chunks/portal-provider-eveknxf26oudn7pp.js +63 -0
- package/dist/chunks/radio-nf717i5ypsga9zdh.js +204 -0
- package/dist/chunks/reason-parts-hssx64rmlxyn6gw5.js +40 -0
- package/dist/chunks/resolve-variant-l6x5ksfrjtu4m66l.js +35 -0
- package/dist/chunks/resolveAriaLabelledBy-knaucrjrjwnk7tvs.js +10 -0
- package/dist/chunks/resolveValueLabel-ntacnb58mhka5gg0.js +70 -0
- package/dist/chunks/rolldown-runtime-hi7ti5xiuxsegr96.js +18 -0
- package/dist/chunks/safePolygon-ep4133qogeu5vjf3.js +661 -0
- package/dist/chunks/safeReact-ek77ilng4ekk7mgz.js +18 -0
- package/dist/chunks/scrollable-k784b35i80aolmvg.js +29 -0
- package/dist/chunks/select-lnekz415wm4v6d6m.js +279 -0
- package/dist/chunks/sensitive-input-dvwlnntm7rdudwp0.js +252 -0
- package/dist/chunks/serializeValue-d1otz2i7h5tygrwf.js +13 -0
- package/dist/chunks/sidebar-mhlgvpawixxoey2k.js +1466 -0
- package/dist/chunks/skeleton-line-kmhnp0lx3rxhioxa.js +74 -0
- package/dist/chunks/slider-e395gihi5cjd62ss.js +87 -0
- package/dist/chunks/stringifyLocale-gbxouqj7ol627jxh.js +9 -0
- package/dist/chunks/styles-eb8bvypmayf578jf.js +35 -0
- package/dist/chunks/surface-jr8x5hy0gucjk5ig.js +30 -0
- package/dist/chunks/switch-nc8thi7ogd51m3gi.js +202 -0
- package/dist/chunks/table-ngl1b5yc8mcur662.js +238 -0
- package/dist/chunks/table-of-contents-gkjv9ck8etbz64ej.js +234 -0
- package/dist/chunks/tabs-o59bv7348nh2gppm.js +280 -0
- package/dist/chunks/tag-input-lbx9yzt33d4wu07o.js +156 -0
- package/dist/chunks/text-nqum95flcp07ac9s.js +126 -0
- package/dist/chunks/toast-ljpenshot856xqq4.js +341 -0
- package/dist/chunks/toolbar-kh6pc12ii7b6dv1x.js +141 -0
- package/dist/chunks/tooltip-bcymn9bfyz29fvji.js +92 -0
- package/dist/chunks/unwrap-lazy-element-hzbdkmujhd7iksau.js +45 -0
- package/dist/chunks/use-copy-feedback-gl55ghst0csvpv4j.js +55 -0
- package/dist/chunks/useAnchoredPopupScrollLock-msm8tzkewysnunut.js +31 -0
- package/dist/chunks/useAnimationFrame-k9lqdj9quln3sd85.js +87 -0
- package/dist/chunks/useAriaLabelledBy-j3j9jqlr9ukyk08s.js +36 -0
- package/dist/chunks/useBaseUiId-nk4k7nj9h1cy76ny.js +13 -0
- package/dist/chunks/useButton-lklvdzuhvj22bx07.js +186 -0
- package/dist/chunks/useClick-pcbkcc7r620v1smu.js +87 -0
- package/dist/chunks/useCollapsiblePanel-lrfsgx21ds36cwlp.js +415 -0
- package/dist/chunks/useCompositeItem-2juex3zh9gyrs8e9.js +31 -0
- package/dist/chunks/useCompositeListItem-ekwo2j2rjkggg7xj.js +54 -0
- package/dist/chunks/useControlled-i3srnkxy598s0au9.js +52 -0
- package/dist/chunks/useFieldValidation-oe16jiigp971yrzr.js +224 -0
- package/dist/chunks/useFloatingRootContext-k676b6m7f80bdapd.js +51 -0
- package/dist/chunks/useFocus-mn7a9t9v6fnlb4mf.js +124 -0
- package/dist/chunks/useId-82z8yqlmc1hy1c5t.js +50 -0
- package/dist/chunks/useInitialLiveRegionTextMutation-nl2hus7zx1h7ggno.js +86 -0
- package/dist/chunks/useLabel-me6zzfvkypo458pi.js +58 -0
- package/dist/chunks/useLabelableId-bjeh6q3pgrqjb7er.js +56 -0
- package/dist/chunks/useListNavigation-hpddbd0cc9pvt461.js +441 -0
- package/dist/chunks/useOnMount-gxggz1m0n869s6r0.js +12 -0
- package/dist/chunks/useOpenChangeComplete-edtabjwqmechsyv6.js +129 -0
- package/dist/chunks/usePopupHandleStore-gawjmfjf1xdgiph3.js +27 -0
- package/dist/chunks/usePopupViewport-l6w01iohvzloghy8.js +367 -0
- package/dist/chunks/usePositioner-mzvgnazldqvy44z2.js +580 -0
- package/dist/chunks/usePressAndHold-k9ynk78pgf677kpx.js +179 -0
- package/dist/chunks/usePreviousValue-o6swt5tb7xhpdu4e.js +21 -0
- package/dist/chunks/useRegisterFieldControl-m1stc9l9y4cndf0k.js +40 -0
- package/dist/chunks/useRegisteredLabelId-b7u9ygya03448zzn.js +16 -0
- package/dist/chunks/useRender-h9ktka9xt4obdv6y.js +13 -0
- package/dist/chunks/useRenderDialogRoot-bsqrqpc1ddau7xg4.js +312 -0
- package/dist/chunks/useRenderElement-nkklxbq1rp7h2kw0.js +436 -0
- package/dist/chunks/useScrollLock-le7ajwlt7oh6fzxi.js +877 -0
- package/dist/chunks/useSetFieldFocused-fbvj7gcv67dqfkp0.js +35 -0
- package/dist/chunks/useStableCallback-le5qgj6p9l04729n.js +38 -0
- package/dist/chunks/useSwipeDismiss-e8tfxzlp05p86mgb.js +697 -0
- package/dist/chunks/useTimeout-f0ayn2l2l9aop4l8.js +43 -0
- package/dist/chunks/useTransitionStatus-disysoblzgk34w14.js +74 -0
- package/dist/chunks/useTriggerFocusGuards-dyd3hb1m8en8ct50.js +40 -0
- package/dist/chunks/useTriggerSwitchTransition-hk5j36hd5dq2ok6w.js +62 -0
- package/dist/chunks/useTypeahead-kfdsw1ksl5bgvvzl.js +111 -0
- package/dist/chunks/useValueAsRef-dv0tmfr1xlpzdlru.js +27 -0
- package/dist/chunks/useValueChanged-fjssa2v6d4w8y332.js +15 -0
- package/dist/chunks/utils-o44zfmzz9z7uyj1v.js +18 -0
- package/dist/chunks/valueToPercent-djk2mqnihth2uvf6.js +7 -0
- package/dist/chunks/vendor-floating-ui-fqblx3wa0r71mjoo.js +1458 -0
- package/dist/chunks/vendor-styling-gs32v7xt5znc8kg0.js +1167 -0
- package/dist/chunks/vendor-utils-io8z5lsfxq8m2dcc.js +660 -0
- package/dist/chunks/visuallyHidden-kzzs9hbe93is3rci.js +25 -0
- package/dist/code/server.d.ts +11 -0
- package/dist/code/server.js +18 -0
- package/dist/code.d.ts +65 -0
- package/dist/code.js +232 -0
- package/dist/command-line/cli.js +1705 -0
- package/dist/command-line/commands/add.js +282 -0
- package/dist/command-line/commands/ai.js +22 -0
- package/dist/command-line/commands/blocks.js +61 -0
- package/dist/command-line/commands/doc.js +167 -0
- package/dist/command-line/commands/init.js +95 -0
- package/dist/command-line/commands/ls.js +53 -0
- package/dist/command-line/commands/theme.js +850 -0
- package/dist/components/autocomplete.d.ts +2 -0
- package/dist/components/autocomplete.js +3 -0
- package/dist/components/badge.d.ts +2 -0
- package/dist/components/badge.js +3 -0
- package/dist/components/banner.d.ts +2 -0
- package/dist/components/banner.js +3 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +3 -0
- package/dist/components/button-group.d.ts +2 -0
- package/dist/components/button-group.js +3 -0
- package/dist/components/button.d.ts +3 -0
- package/dist/components/button.js +3 -0
- package/dist/components/chart.d.ts +2 -0
- package/dist/components/chart.js +3 -0
- package/dist/components/checkbox.d.ts +2 -0
- package/dist/components/checkbox.js +3 -0
- package/dist/components/clipboard-text.d.ts +2 -0
- package/dist/components/clipboard-text.js +3 -0
- package/dist/components/cloudflare-logo.d.ts +2 -0
- package/dist/components/cloudflare-logo.js +3 -0
- package/dist/components/code.d.ts +2 -0
- package/dist/components/code.js +3 -0
- package/dist/components/collapsible.d.ts +2 -0
- package/dist/components/collapsible.js +3 -0
- package/dist/components/combobox.d.ts +2 -0
- package/dist/components/combobox.js +3 -0
- package/dist/components/command-palette.d.ts +2 -0
- package/dist/components/command-palette.js +3 -0
- package/dist/components/date-picker.d.ts +2 -0
- package/dist/components/date-picker.js +3 -0
- package/dist/components/date-range-picker.d.ts +2 -0
- package/dist/components/date-range-picker.js +3 -0
- package/dist/components/dialog.d.ts +2 -0
- package/dist/components/dialog.js +3 -0
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +3 -0
- package/dist/components/empty.d.ts +2 -0
- package/dist/components/empty.js +3 -0
- package/dist/components/field.d.ts +2 -0
- package/dist/components/field.js +3 -0
- package/dist/components/flow.d.ts +2 -0
- package/dist/components/flow.js +3 -0
- package/dist/components/grid.d.ts +2 -0
- package/dist/components/grid.js +3 -0
- package/dist/components/inline-copy-text.d.ts +2 -0
- package/dist/components/inline-copy-text.js +3 -0
- package/dist/components/input-group.d.ts +2 -0
- package/dist/components/input-group.js +3 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.js +5 -0
- package/dist/components/label.d.ts +2 -0
- package/dist/components/label.js +3 -0
- package/dist/components/layer-card.d.ts +2 -0
- package/dist/components/layer-card.js +3 -0
- package/dist/components/layer-dialog.d.ts +2 -0
- package/dist/components/layer-dialog.js +3 -0
- package/dist/components/link.d.ts +67 -0
- package/dist/components/link.js +3 -0
- package/dist/components/loader.d.ts +2 -0
- package/dist/components/loader.js +4 -0
- package/dist/components/menubar.d.ts +2 -0
- package/dist/components/menubar.js +3 -0
- package/dist/components/meter.d.ts +2 -0
- package/dist/components/meter.js +3 -0
- package/dist/components/pagination.d.ts +2 -0
- package/dist/components/pagination.js +3 -0
- package/dist/components/popover.d.ts +2 -0
- package/dist/components/popover.js +3 -0
- package/dist/components/radio.d.ts +2 -0
- package/dist/components/radio.js +3 -0
- package/dist/components/select.d.ts +2 -0
- package/dist/components/select.js +3 -0
- package/dist/components/sensitive-input.d.ts +2 -0
- package/dist/components/sensitive-input.js +3 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +3 -0
- package/dist/components/slider.d.ts +2 -0
- package/dist/components/slider.js +3 -0
- package/dist/components/surface.d.ts +2 -0
- package/dist/components/surface.js +3 -0
- package/dist/components/switch.d.ts +2 -0
- package/dist/components/switch.js +3 -0
- package/dist/components/table-of-contents.d.ts +2 -0
- package/dist/components/table-of-contents.js +3 -0
- package/dist/components/table.d.ts +2 -0
- package/dist/components/table.js +3 -0
- package/dist/components/tabs.d.ts +2 -0
- package/dist/components/tabs.js +3 -0
- package/dist/components/tag-input.d.ts +2 -0
- package/dist/components/tag-input.js +3 -0
- package/dist/components/text.d.ts +2 -0
- package/dist/components/text.js +3 -0
- package/dist/components/toast.d.ts +2 -0
- package/dist/components/toast.js +4 -0
- package/dist/components/toolbar.d.ts +2 -0
- package/dist/components/toolbar.js +3 -0
- package/dist/components/tooltip.d.ts +2 -0
- package/dist/components/tooltip.js +3 -0
- package/dist/config-BKj6nyHa.d.ts +620 -0
- package/dist/field-DIjlHM8W.d.ts +91 -0
- package/dist/highlighter-BT3TakhJ.d.ts +13 -0
- package/dist/index-2jvVmJ8P.d.ts +46 -0
- package/dist/index-5PpauI_2.d.ts +85 -0
- package/dist/index-AMEc1MEg.d.ts +180 -0
- package/dist/index-AUC5xRcO.d.ts +236 -0
- package/dist/index-B7epkoHc.d.ts +72 -0
- package/dist/index-B9-RdY6D.d.ts +75 -0
- package/dist/index-BD-gTiEv.d.ts +71 -0
- package/dist/index-BK1tZgmP.d.ts +426 -0
- package/dist/index-BVgXnR1V.d.ts +137 -0
- package/dist/index-BW1HVU7T.d.ts +119 -0
- package/dist/index-BWe6haHU.d.ts +64 -0
- package/dist/index-BkTAB4wj.d.ts +673 -0
- package/dist/index-Bwhwpw_j.d.ts +189 -0
- package/dist/index-BzE0aNpx.d.ts +143 -0
- package/dist/index-C7RoG_CH.d.ts +57 -0
- package/dist/index-CE09bLNb.d.ts +72 -0
- package/dist/index-CJRe-8P-.d.ts +174 -0
- package/dist/index-CNL6VDYZ.d.ts +138 -0
- package/dist/index-CReGk3Dc.d.ts +91 -0
- package/dist/index-CU_lnxg7.d.ts +287 -0
- package/dist/index-CYoiniZ4.d.ts +135 -0
- package/dist/index-ClS-eFxE.d.ts +104 -0
- package/dist/index-CzIWigmH.d.ts +62 -0
- package/dist/index-CzTgKPh-.d.ts +105 -0
- package/dist/index-D2Gvly0i.d.ts +96 -0
- package/dist/index-DIV3riUd.d.ts +148 -0
- package/dist/index-DL1-uSuH.d.ts +1 -0
- package/dist/index-DYYiDxZs.d.ts +243 -0
- package/dist/index-DjSGDESy.d.ts +222 -0
- package/dist/index-Dmbgjww7.d.ts +157 -0
- package/dist/index-DwNMa4LN.d.ts +166 -0
- package/dist/index-Dx7hOWUc.d.ts +93 -0
- package/dist/index-DxOyYZaJ.d.ts +251 -0
- package/dist/index-NnHba-T1.d.ts +136 -0
- package/dist/index-RP_rt8vB.d.ts +140 -0
- package/dist/index-T1sSoiWG.d.ts +184 -0
- package/dist/index-aahL-0Zw.d.ts +60 -0
- package/dist/index-bBPKMepR.d.ts +73 -0
- package/dist/index-g-eFm1Bq.d.ts +877 -0
- package/dist/index-gYC6cQVO.d.ts +105 -0
- package/dist/index-lOWfpkxK.d.ts +118 -0
- package/dist/index-pjdgauIH.d.ts +170 -0
- package/dist/index-yK3Hayg_.d.ts +40 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.js +207 -0
- package/dist/input-BeWEb-jD.d.ts +122 -0
- package/dist/input-group-8gEtPiKw.d.ts +100 -0
- package/dist/layer-card-BNIn9pqy.d.ts +56 -0
- package/dist/link-provider-tz-NJp9x.d.ts +67 -0
- package/dist/locale-provider-CHMCQ0-J.d.ts +40 -0
- package/dist/panda.d.ts +25 -0
- package/dist/panda.js +32 -0
- package/dist/portal-provider-BAqPpq_a.d.ts +55 -0
- package/dist/primitives/accordion.d.ts +1 -0
- package/dist/primitives/accordion.js +3 -0
- package/dist/primitives/alert-dialog.d.ts +1 -0
- package/dist/primitives/alert-dialog.js +8 -0
- package/dist/primitives/autocomplete.d.ts +1 -0
- package/dist/primitives/autocomplete.js +6 -0
- package/dist/primitives/avatar.d.ts +1 -0
- package/dist/primitives/avatar.js +3 -0
- package/dist/primitives/button.d.ts +1 -0
- package/dist/primitives/button.js +3 -0
- package/dist/primitives/checkbox-group.d.ts +1 -0
- package/dist/primitives/checkbox-group.js +4 -0
- package/dist/primitives/checkbox.d.ts +1 -0
- package/dist/primitives/checkbox.js +4 -0
- package/dist/primitives/collapsible.d.ts +1 -0
- package/dist/primitives/collapsible.js +5 -0
- package/dist/primitives/combobox.d.ts +1 -0
- package/dist/primitives/combobox.js +6 -0
- package/dist/primitives/context-menu.d.ts +1 -0
- package/dist/primitives/context-menu.js +6 -0
- package/dist/primitives/csp-provider.d.ts +1 -0
- package/dist/primitives/csp-provider.js +3 -0
- package/dist/primitives/dialog.d.ts +1 -0
- package/dist/primitives/dialog.js +9 -0
- package/dist/primitives/direction-provider.d.ts +1 -0
- package/dist/primitives/direction-provider.js +4 -0
- package/dist/primitives/drawer.d.ts +1 -0
- package/dist/primitives/drawer.js +6 -0
- package/dist/primitives/field.d.ts +1 -0
- package/dist/primitives/field.js +4 -0
- package/dist/primitives/fieldset.d.ts +1 -0
- package/dist/primitives/fieldset.js +3 -0
- package/dist/primitives/form.d.ts +1 -0
- package/dist/primitives/form.js +3 -0
- package/dist/primitives/input.d.ts +1 -0
- package/dist/primitives/input.js +4 -0
- package/dist/primitives/menu.d.ts +1 -0
- package/dist/primitives/menu.js +6 -0
- package/dist/primitives/menubar.d.ts +1 -0
- package/dist/primitives/menubar.js +3 -0
- package/dist/primitives/meter.d.ts +1 -0
- package/dist/primitives/meter.js +3 -0
- package/dist/primitives/navigation-menu.d.ts +1 -0
- package/dist/primitives/navigation-menu.js +3 -0
- package/dist/primitives/number-field.d.ts +1 -0
- package/dist/primitives/number-field.js +3 -0
- package/dist/primitives/otp-field.d.ts +3 -0
- package/dist/primitives/otp-field.js +4 -0
- package/dist/primitives/popover.d.ts +1 -0
- package/dist/primitives/popover.js +3 -0
- package/dist/primitives/preview-card.d.ts +1 -0
- package/dist/primitives/preview-card.js +3 -0
- package/dist/primitives/progress.d.ts +1 -0
- package/dist/primitives/progress.js +3 -0
- package/dist/primitives/radio-group.d.ts +1 -0
- package/dist/primitives/radio-group.js +4 -0
- package/dist/primitives/radio.d.ts +1 -0
- package/dist/primitives/radio.js +4 -0
- package/dist/primitives/scroll-area.d.ts +1 -0
- package/dist/primitives/scroll-area.js +4 -0
- package/dist/primitives/select.d.ts +1 -0
- package/dist/primitives/select.js +5 -0
- package/dist/primitives/separator.d.ts +1 -0
- package/dist/primitives/separator.js +4 -0
- package/dist/primitives/slider.d.ts +1 -0
- package/dist/primitives/slider.js +4 -0
- package/dist/primitives/switch.d.ts +1 -0
- package/dist/primitives/switch.js +4 -0
- package/dist/primitives/tabs.d.ts +1 -0
- package/dist/primitives/tabs.js +4 -0
- package/dist/primitives/toast.d.ts +1 -0
- package/dist/primitives/toast.js +5 -0
- package/dist/primitives/toggle-group.d.ts +1 -0
- package/dist/primitives/toggle-group.js +3 -0
- package/dist/primitives/toggle.d.ts +1 -0
- package/dist/primitives/toggle.js +3 -0
- package/dist/primitives/toolbar.d.ts +1 -0
- package/dist/primitives/toolbar.js +3 -0
- package/dist/primitives/tooltip.d.ts +1 -0
- package/dist/primitives/tooltip.js +4 -0
- package/dist/primitives.d.ts +42 -0
- package/dist/primitives.js +71 -0
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +1 -0
- package/dist/scripts/theme-generator/config.d.ts +2 -0
- package/dist/scripts/theme-generator/config.js +487 -0
- package/dist/scripts/theme-generator/types.d.ts +2 -0
- package/dist/scripts/theme-generator/types.js +1 -0
- package/dist/styles/kumo-binding.css +491 -0
- package/dist/styles/kumo-standalone.css +2 -0
- package/dist/styles/kumo.css +135 -0
- package/dist/styles/theme-code.css +142 -0
- package/dist/styles/theme-fedramp.css +31 -0
- package/dist/styles/theme-fldr.css +481 -0
- package/dist/styles/theme-kumo.css +464 -0
- package/dist/text-CRRU2g-u.d.ts +183 -0
- package/dist/theming.d.ts +224 -0
- package/dist/theming.js +386 -0
- package/dist/tooltip-D_vhi1PN.d.ts +105 -0
- package/dist/types-CdzJnnIl.d.ts +193 -0
- package/dist/types-Cl4HuOrB.d.ts +84 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +7 -0
- package/package.json +481 -3
- package/scripts/component-registry/cache.ts +123 -0
- package/scripts/component-registry/discovery.ts +560 -0
- package/scripts/component-registry/example-cleanup.ts +168 -0
- package/scripts/component-registry/index.test.ts +1075 -0
- package/scripts/component-registry/index.ts +1065 -0
- package/scripts/component-registry/markdown-generator.ts +222 -0
- package/scripts/component-registry/metadata.ts +1030 -0
- package/scripts/component-registry/props-filter.ts +312 -0
- package/scripts/component-registry/schema-generator.ts +333 -0
- package/scripts/component-registry/sub-components.ts +393 -0
- package/scripts/component-registry/types.ts +158 -0
- package/scripts/component-registry/utils.ts +280 -0
- package/scripts/component-registry/variant-parser.ts +262 -0
- package/scripts/css-build.ts +107 -0
- package/scripts/format-generated.ts +12 -0
- package/scripts/generate-globe-land-mask.mjs +80 -0
- package/scripts/generate-primitives.ts +196 -0
- package/scripts/publish-fldr.ts +120 -0
- package/scripts/theme-generator/config.ts +666 -0
- package/scripts/theme-generator/generate-css.test.ts +30 -0
- package/scripts/theme-generator/generate-css.ts +352 -0
- package/scripts/theme-generator/index.ts +175 -0
- package/scripts/theme-generator/migrate.ts +560 -0
- package/scripts/theme-generator/types.ts +92 -0
|
@@ -0,0 +1,1493 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hi7ti5xiuxsegr96.js";
|
|
3
|
+
import { f as useMergedRefs, l as warn, n as useRenderElement } from "./useRenderElement-nkklxbq1rp7h2kw0.js";
|
|
4
|
+
import { n as useIsoLayoutEffect, t as SafeReact } from "./safeReact-ek77ilng4ekk7mgz.js";
|
|
5
|
+
import { n as useTimeout } from "./useTimeout-f0ayn2l2l9aop4l8.js";
|
|
6
|
+
import { $ as getTarget, X as activeElement, lt as ios, v as ownerDocument } from "./vendor-utils-io8z5lsfxq8m2dcc.js";
|
|
7
|
+
import { n as webkit, t as gecko } from "./engine-hzmefiqm63hu0c7i.js";
|
|
8
|
+
import { w as getWindow } from "./vendor-floating-ui-fqblx3wa0r71mjoo.js";
|
|
9
|
+
import { n as createGenericEventDetails, t as createChangeEventDetails } from "./createBaseUIEventDetails-nvee6bghv2reeqdb.js";
|
|
10
|
+
import { F as wheel, O as scrub, _ as inputPaste, b as keyboard, f as incrementPress, g as inputClear, h as inputChange, m as inputBlur, o as decrementPress, w as none } from "./reason-parts-hssx64rmlxyn6gw5.js";
|
|
11
|
+
import { t as addEventListener } from "./addEventListener-ku3x23446prmd1kz.js";
|
|
12
|
+
import { t as mergeCleanups } from "./mergeCleanups-nw73c6jfwl5tyhw4.js";
|
|
13
|
+
import { t as useValueAsRef } from "./useValueAsRef-dv0tmfr1xlpzdlru.js";
|
|
14
|
+
import { t as useStableCallback } from "./useStableCallback-le5qgj6p9l04729n.js";
|
|
15
|
+
import { n as visuallyHiddenInput, t as visuallyHidden } from "./visuallyHidden-kzzs9hbe93is3rci.js";
|
|
16
|
+
import { n as useForcedRerendering } from "./useId-82z8yqlmc1hy1c5t.js";
|
|
17
|
+
import { a as useFieldRootContext, c as fieldValidityMapping, n as useLabelableContext } from "./LabelableContext-dz4wz3lu3lgqusu7.js";
|
|
18
|
+
import { n as useFormContext } from "./FormContext-jv19engyccpf6xcl.js";
|
|
19
|
+
import { t as useLabelableId } from "./useLabelableId-bjeh6q3pgrqjb7er.js";
|
|
20
|
+
import { t as useSetFieldFocused } from "./useSetFieldFocused-fbvj7gcv67dqfkp0.js";
|
|
21
|
+
import { t as useRegisterFieldControl } from "./useRegisterFieldControl-m1stc9l9y4cndf0k.js";
|
|
22
|
+
import { t as useValueChanged } from "./useValueChanged-fjssa2v6d4w8y332.js";
|
|
23
|
+
import { t as useControlled } from "./useControlled-i3srnkxy598s0au9.js";
|
|
24
|
+
import { t as useButton } from "./useButton-lklvdzuhvj22bx07.js";
|
|
25
|
+
import { t as clamp } from "./clamp-rcpupxvhqrn8uuyf.js";
|
|
26
|
+
import { n as getFormatter, t as formatNumber } from "./formatNumber-b4kjdsebslm2b3t0.js";
|
|
27
|
+
import { n as usePressAndHold, t as isTouchLikePointerType } from "./usePressAndHold-k9ynk78pgf677kpx.js";
|
|
28
|
+
import * as React$1 from "react";
|
|
29
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
30
|
+
import * as ReactDOM from "react-dom";
|
|
31
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/root/NumberFieldRootContext.mjs
|
|
32
|
+
const NumberFieldRootContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
33
|
+
NumberFieldRootContext.displayName = "NumberFieldRootContext";
|
|
34
|
+
function useNumberFieldRootContext() {
|
|
35
|
+
const context = React$1.useContext(NumberFieldRootContext);
|
|
36
|
+
if (context === void 0) throw new Error("Base UI: NumberFieldRootContext is missing. NumberField parts must be placed within <NumberField.Root>.");
|
|
37
|
+
return context;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/utils/stateAttributesMapping.mjs
|
|
41
|
+
const stateAttributesMapping = {
|
|
42
|
+
inputValue: () => null,
|
|
43
|
+
value: () => null,
|
|
44
|
+
...fieldValidityMapping
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/utils/parse.mjs
|
|
48
|
+
const HAN_NUMERALS = "零〇一二三四五六七八九";
|
|
49
|
+
const NON_ASCII_DIGIT_RE = /[٠-٩۰-۹0-9]/g;
|
|
50
|
+
const HAN_RE = /[零〇一二三四五六七八九]/g;
|
|
51
|
+
const PERCENTAGES = [
|
|
52
|
+
"%",
|
|
53
|
+
"٪",
|
|
54
|
+
"%",
|
|
55
|
+
"﹪"
|
|
56
|
+
];
|
|
57
|
+
const PERMILLE = ["‰", "؉"];
|
|
58
|
+
const PERCENT_RE = /[%٪%﹪]/;
|
|
59
|
+
const PERMILLE_RE = /[‰؉]/;
|
|
60
|
+
const PERCENT_GLOBAL_RE = /[%٪%﹪]/g;
|
|
61
|
+
const PERMILLE_GLOBAL_RE = /[‰؉]/g;
|
|
62
|
+
const ARABIC_PERSIAN_DETECT_RE = /[٠-٩۰-۹]/;
|
|
63
|
+
const HAN_DETECT_RE = /[零〇一二三四五六七八九]/;
|
|
64
|
+
const ANY_NUMERAL_DETECT_RE = /[0-9٠-٩۰-۹0-9零〇一二三四五六七八九]/;
|
|
65
|
+
function isNumeralChar(char) {
|
|
66
|
+
return ANY_NUMERAL_DETECT_RE.test(char);
|
|
67
|
+
}
|
|
68
|
+
const BASE_NON_NUMERIC_SYMBOLS = [
|
|
69
|
+
".",
|
|
70
|
+
",",
|
|
71
|
+
".",
|
|
72
|
+
",",
|
|
73
|
+
"٫",
|
|
74
|
+
"٬"
|
|
75
|
+
];
|
|
76
|
+
const SPACE_SEPARATOR_RE = /\p{Zs}/u;
|
|
77
|
+
const FORMAT_CONTROL_DETECT_RE = /\p{Cf}/u;
|
|
78
|
+
const FORMAT_CONTROL_GLOBAL_RE = /\p{Cf}/gu;
|
|
79
|
+
const PLUS_SIGNS_WITH_ASCII = [
|
|
80
|
+
"+",
|
|
81
|
+
"+",
|
|
82
|
+
"﹢"
|
|
83
|
+
];
|
|
84
|
+
const MINUS_SIGNS_WITH_ASCII = [
|
|
85
|
+
"-",
|
|
86
|
+
"−",
|
|
87
|
+
"-",
|
|
88
|
+
"‒",
|
|
89
|
+
"–",
|
|
90
|
+
"—",
|
|
91
|
+
"﹣"
|
|
92
|
+
];
|
|
93
|
+
const escapeRegExp = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
94
|
+
function shiftDecimal(value, exponentDelta) {
|
|
95
|
+
const [coefficient, exponent = "0"] = String(value).split("e");
|
|
96
|
+
return Number(`${coefficient}e${Number(exponent) + exponentDelta}`);
|
|
97
|
+
}
|
|
98
|
+
const ANY_MINUS_RE = /[-−-‒–—﹣]/gu;
|
|
99
|
+
const ANY_PLUS_RE = /[++﹢]/gu;
|
|
100
|
+
const ANY_MINUS_DETECT_RE = /[-−-‒–—﹣]/;
|
|
101
|
+
const ANY_PLUS_DETECT_RE = /[++﹢]/;
|
|
102
|
+
const SAMPLE_FORMAT_NUMBER = 11111.1;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the `Intl.NumberFormat` parts of a representative number, which surface every
|
|
105
|
+
* non-numeric symbol a given locale/format renders.
|
|
106
|
+
*/
|
|
107
|
+
function getFormatParts(locale, options) {
|
|
108
|
+
return getFormatter(locale, options).formatToParts(SAMPLE_FORMAT_NUMBER);
|
|
109
|
+
}
|
|
110
|
+
function getNumberLocaleDetails(locale, options) {
|
|
111
|
+
const parts = getFormatParts(locale, options);
|
|
112
|
+
const result = {};
|
|
113
|
+
parts.forEach((part) => {
|
|
114
|
+
result[part.type] = part.value;
|
|
115
|
+
});
|
|
116
|
+
let decimal = ".";
|
|
117
|
+
getFormatter(locale).formatToParts(.1).forEach((part) => {
|
|
118
|
+
if (part.type === "decimal") decimal = part.value;
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
...result,
|
|
122
|
+
decimal
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function parseNumber(formattedNumber, locale, options) {
|
|
126
|
+
let input = formattedNumber.replace(FORMAT_CONTROL_GLOBAL_RE, "").trim();
|
|
127
|
+
input = input.replace(ANY_MINUS_RE, "-").replace(ANY_PLUS_RE, "+");
|
|
128
|
+
let isNegative = false;
|
|
129
|
+
const takeSign = (match, sign) => {
|
|
130
|
+
if (sign === "-") isNegative = true;
|
|
131
|
+
return "";
|
|
132
|
+
};
|
|
133
|
+
input = input.replace(/([+-])\s*$/, takeSign).replace(/^\s*([+-])/, takeSign);
|
|
134
|
+
let computedLocale = locale;
|
|
135
|
+
if (computedLocale === void 0) {
|
|
136
|
+
if (ARABIC_PERSIAN_DETECT_RE.test(input)) computedLocale = "ar";
|
|
137
|
+
else if (HAN_DETECT_RE.test(input)) computedLocale = "zh";
|
|
138
|
+
}
|
|
139
|
+
const { group, decimal, currency, exponentSeparator } = getNumberLocaleDetails(computedLocale, options);
|
|
140
|
+
const unitParts = getFormatter(computedLocale, options).formatToParts(1).filter((p) => p.type === "unit").map((p) => escapeRegExp(p.value));
|
|
141
|
+
const unitRegex = unitParts.length ? new RegExp(unitParts.join("|"), "g") : null;
|
|
142
|
+
let groupRegex = null;
|
|
143
|
+
if (group) {
|
|
144
|
+
const isSpaceGroup = /\p{Zs}/u.test(group);
|
|
145
|
+
const isApostropheGroup = group === "'" || group === "’";
|
|
146
|
+
if (isSpaceGroup) groupRegex = /\p{Zs}/gu;
|
|
147
|
+
else if (isApostropheGroup) groupRegex = /['’]/g;
|
|
148
|
+
else groupRegex = new RegExp(escapeRegExp(group), "g");
|
|
149
|
+
}
|
|
150
|
+
let unformatted = [
|
|
151
|
+
[groupRegex, ""],
|
|
152
|
+
[new RegExp(escapeRegExp(decimal), "g"), "."],
|
|
153
|
+
[/[.٫]/g, "."],
|
|
154
|
+
[/[,٬]/g, ""],
|
|
155
|
+
[currency ? new RegExp(escapeRegExp(currency), "g") : null, ""],
|
|
156
|
+
[unitRegex, ""],
|
|
157
|
+
[PERCENT_GLOBAL_RE, ""],
|
|
158
|
+
[PERMILLE_GLOBAL_RE, ""],
|
|
159
|
+
[exponentSeparator ? new RegExp(escapeRegExp(exponentSeparator), "g") : null, "e"],
|
|
160
|
+
[NON_ASCII_DIGIT_RE, (ch) => String(ch.charCodeAt(0) % 16)],
|
|
161
|
+
[HAN_RE, (ch) => String(Math.max(HAN_NUMERALS.indexOf(ch) - 1, 0))]
|
|
162
|
+
].reduce((acc, [regex, replacement]) => {
|
|
163
|
+
return regex ? acc.replace(regex, replacement) : acc;
|
|
164
|
+
}, input);
|
|
165
|
+
const lastDot = unformatted.lastIndexOf(".");
|
|
166
|
+
if (lastDot !== -1) unformatted = `${unformatted.slice(0, lastDot).replace(/\./g, "")}.${unformatted.slice(lastDot + 1).replace(/\./g, "")}`;
|
|
167
|
+
if (/^[-+]?Infinity$/i.test(input) || input.includes("∞")) return null;
|
|
168
|
+
const parseTarget = (isNegative ? "-" : "") + unformatted;
|
|
169
|
+
let num = parseFloat(parseTarget);
|
|
170
|
+
const style = options?.style;
|
|
171
|
+
const isUnitPercent = style === "unit" && options?.unit === "percent";
|
|
172
|
+
const hasPercentSymbol = PERCENT_RE.test(formattedNumber) || style === "percent";
|
|
173
|
+
if (PERMILLE_RE.test(formattedNumber)) num = shiftDecimal(num, -3);
|
|
174
|
+
else if (!isUnitPercent && hasPercentSymbol) num = shiftDecimal(num, -2);
|
|
175
|
+
if (!Number.isFinite(num)) return null;
|
|
176
|
+
return num;
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/utils/validate.mjs
|
|
180
|
+
const STEP_EPSILON_FACTOR = 1e-10;
|
|
181
|
+
const MAX_FLOATING_POINT_CLEANUP_DELTA = 1e-10;
|
|
182
|
+
function hasNumberFormatRoundingOptions(format) {
|
|
183
|
+
return format?.maximumFractionDigits != null || format?.minimumFractionDigits != null || format?.maximumSignificantDigits != null || format?.minimumSignificantDigits != null || format?.roundingIncrement != null || format?.roundingMode != null || format?.roundingPriority != null;
|
|
184
|
+
}
|
|
185
|
+
function removeFloatingPointErrors(value, format) {
|
|
186
|
+
if (!Number.isFinite(value)) return value;
|
|
187
|
+
if (!hasNumberFormatRoundingOptions(format)) {
|
|
188
|
+
const roundedValue = parseFloat(value.toPrecision(15));
|
|
189
|
+
return Math.abs(roundedValue - value) <= Math.min(Number.EPSILON * Math.max(1, Math.abs(value)), MAX_FLOATING_POINT_CLEANUP_DELTA) ? roundedValue : value;
|
|
190
|
+
}
|
|
191
|
+
const formatter = getFormatter("en-US", {
|
|
192
|
+
...format,
|
|
193
|
+
signDisplay: "auto",
|
|
194
|
+
currencySign: "standard",
|
|
195
|
+
notation: format.notation === "compact" ? "standard" : format.notation,
|
|
196
|
+
useGrouping: false
|
|
197
|
+
});
|
|
198
|
+
const roundedText = formatter.format(value);
|
|
199
|
+
const roundedValue = parseNumber(roundedText, "en-US", format);
|
|
200
|
+
if (roundedValue === null) return value;
|
|
201
|
+
return formatter.format(roundedValue) === roundedText ? roundedValue : value;
|
|
202
|
+
}
|
|
203
|
+
function snapToStep(value, base, step, nearest) {
|
|
204
|
+
const stepSize = Math.abs(step);
|
|
205
|
+
const direction = Math.sign(step);
|
|
206
|
+
const tolerance = stepSize * STEP_EPSILON_FACTOR * direction;
|
|
207
|
+
const rawSteps = value - base + tolerance;
|
|
208
|
+
if (nearest) return base + Math.round(rawSteps / step) * step;
|
|
209
|
+
return base + (direction > 0 ? Math.floor(rawSteps / stepSize) : Math.ceil(rawSteps / stepSize)) * stepSize;
|
|
210
|
+
}
|
|
211
|
+
function toValidatedNumber(value, step, minWithDefault, maxWithDefault, minWithZeroDefault, format, snapOnStep, small, shouldClamp) {
|
|
212
|
+
if (value === null) return value;
|
|
213
|
+
let nextValue = value;
|
|
214
|
+
if (step != null && snapOnStep && step !== 0) {
|
|
215
|
+
const base = small || minWithDefault === Number.MIN_SAFE_INTEGER ? minWithZeroDefault : minWithDefault;
|
|
216
|
+
nextValue = snapToStep(nextValue, base, step, small);
|
|
217
|
+
}
|
|
218
|
+
if (shouldClamp) nextValue = clamp(nextValue, minWithDefault, maxWithDefault);
|
|
219
|
+
if (step == null && !hasNumberFormatRoundingOptions(format)) return nextValue;
|
|
220
|
+
const roundedValue = removeFloatingPointErrors(nextValue, format);
|
|
221
|
+
return shouldClamp ? clamp(roundedValue, minWithDefault, maxWithDefault) : roundedValue;
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/root/NumberFieldRoot.mjs
|
|
225
|
+
/**
|
|
226
|
+
* Groups all parts of the number field and manages its state.
|
|
227
|
+
* Renders a `<div>` element.
|
|
228
|
+
*
|
|
229
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
230
|
+
*/
|
|
231
|
+
const NumberFieldRoot = /*#__PURE__*/ React$1.forwardRef(function NumberFieldRoot(componentProps, forwardedRef) {
|
|
232
|
+
const { id: idProp, min, max, smallStep = .1, step: stepProp = 1, largeStep = 10, required = false, disabled: disabledProp = false, readOnly = false, form, name: nameProp, defaultValue = null, value: valueProp, onValueChange: onValueChangeProp, onValueCommitted: onValueCommittedProp, allowWheelScrub = false, snapOnStep = false, allowOutOfRange = false, format, locale, render, className, inputRef: inputRefProp, style, ...elementProps } = componentProps;
|
|
233
|
+
const { setDirty, validityData, disabled: fieldDisabled, setFilled, name: fieldName, state: fieldState, validation } = useFieldRootContext();
|
|
234
|
+
const { clearErrors } = useFormContext();
|
|
235
|
+
const disabled = fieldDisabled || disabledProp;
|
|
236
|
+
const name = fieldName ?? nameProp;
|
|
237
|
+
const step = stepProp === "any" ? 1 : stepProp;
|
|
238
|
+
const [isScrubbing, setIsScrubbing] = React$1.useState(false);
|
|
239
|
+
const minWithDefault = min ?? Number.MIN_SAFE_INTEGER;
|
|
240
|
+
const maxWithDefault = max ?? Number.MAX_SAFE_INTEGER;
|
|
241
|
+
const minWithZeroDefault = min ?? 0;
|
|
242
|
+
const formatStyle = format?.style;
|
|
243
|
+
const inputRef = React$1.useRef(null);
|
|
244
|
+
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
245
|
+
const id = useLabelableId({ id: idProp });
|
|
246
|
+
const [value, setValueUnwrapped] = useControlled({
|
|
247
|
+
controlled: valueProp,
|
|
248
|
+
default: defaultValue,
|
|
249
|
+
name: "NumberField",
|
|
250
|
+
state: "value"
|
|
251
|
+
});
|
|
252
|
+
const valueRef = useValueAsRef(value);
|
|
253
|
+
useIsoLayoutEffect(() => {
|
|
254
|
+
setFilled(value !== null);
|
|
255
|
+
}, [setFilled, value]);
|
|
256
|
+
const forceRender = useForcedRerendering();
|
|
257
|
+
const formatOptionsRef = useValueAsRef(format);
|
|
258
|
+
const hasPendingCommitRef = React$1.useRef(false);
|
|
259
|
+
const onValueCommitted = useStableCallback((nextValue, eventDetails) => {
|
|
260
|
+
hasPendingCommitRef.current = false;
|
|
261
|
+
onValueCommittedProp?.(nextValue, eventDetails);
|
|
262
|
+
});
|
|
263
|
+
const allowInputSyncRef = React$1.useRef(true);
|
|
264
|
+
const lastChangedValueRef = React$1.useRef(null);
|
|
265
|
+
const [inputValue, setInputValue] = React$1.useState(() => formatNumber(value, locale, format));
|
|
266
|
+
const [inputMode, setInputMode] = React$1.useState("numeric");
|
|
267
|
+
const getAllowedNonNumericKeys = useStableCallback(() => {
|
|
268
|
+
const parts = getFormatParts(locale, format);
|
|
269
|
+
const keys = new Set(BASE_NON_NUMERIC_SYMBOLS);
|
|
270
|
+
const addAll = (chars) => chars.forEach((char) => keys.add(char));
|
|
271
|
+
const decimal = parts.find((part) => part.type === "decimal")?.value ?? getNumberLocaleDetails(locale, format).decimal;
|
|
272
|
+
keys.add(decimal);
|
|
273
|
+
parts.forEach((part) => {
|
|
274
|
+
if (part.type === "integer" || part.type === "fraction" || part.type === "exponentInteger" || part.type === "compact") return;
|
|
275
|
+
addAll(Array.from(part.value));
|
|
276
|
+
if (SPACE_SEPARATOR_RE.test(part.value)) keys.add(" ");
|
|
277
|
+
});
|
|
278
|
+
const allowPercentSymbols = formatStyle === "percent" || formatStyle === "unit" && format?.unit === "percent";
|
|
279
|
+
const allowPermilleSymbols = formatStyle === "percent" || formatStyle === "unit" && format?.unit === "permille";
|
|
280
|
+
if (allowPercentSymbols) addAll(PERCENTAGES);
|
|
281
|
+
if (allowPermilleSymbols) addAll(PERMILLE);
|
|
282
|
+
addAll(PLUS_SIGNS_WITH_ASCII);
|
|
283
|
+
if (minWithDefault < 0 || allowOutOfRange) addAll(MINUS_SIGNS_WITH_ASCII);
|
|
284
|
+
return keys;
|
|
285
|
+
});
|
|
286
|
+
const getStepAmount = useStableCallback((event) => {
|
|
287
|
+
if (event?.altKey) return smallStep;
|
|
288
|
+
if (event?.shiftKey) return largeStep;
|
|
289
|
+
return step;
|
|
290
|
+
});
|
|
291
|
+
const setValue = useStableCallback((unvalidatedValue, details) => {
|
|
292
|
+
const eventWithOptionalKeyState = details.event;
|
|
293
|
+
const dir = details.direction;
|
|
294
|
+
const isInputReason = details.reason.startsWith("input-") || details.reason === "none";
|
|
295
|
+
const shouldClampValue = !allowOutOfRange || !isInputReason;
|
|
296
|
+
const validatedValue = toValidatedNumber(unvalidatedValue, dir ? getStepAmount(eventWithOptionalKeyState) * dir : void 0, minWithDefault, maxWithDefault, minWithZeroDefault, formatOptionsRef.current, snapOnStep, eventWithOptionalKeyState?.altKey ?? false, shouldClampValue);
|
|
297
|
+
const shouldFireChange = validatedValue !== value || isInputReason && (unvalidatedValue !== value || allowInputSyncRef.current === false);
|
|
298
|
+
if (shouldFireChange) {
|
|
299
|
+
onValueChangeProp?.(validatedValue, details);
|
|
300
|
+
if (details.isCanceled) return false;
|
|
301
|
+
setValueUnwrapped(validatedValue);
|
|
302
|
+
setDirty(validatedValue !== validityData.initialValue);
|
|
303
|
+
hasPendingCommitRef.current = true;
|
|
304
|
+
}
|
|
305
|
+
lastChangedValueRef.current = validatedValue;
|
|
306
|
+
if (allowInputSyncRef.current) setInputValue(formatNumber(validatedValue, locale, format));
|
|
307
|
+
forceRender();
|
|
308
|
+
return shouldFireChange;
|
|
309
|
+
});
|
|
310
|
+
const incrementValue = useStableCallback((amount, { direction, currentValue, event, reason }) => {
|
|
311
|
+
const prevValue = currentValue == null ? valueRef.current : currentValue;
|
|
312
|
+
const nativeEvent = event;
|
|
313
|
+
if (typeof prevValue !== "number") return setValue(0, createChangeEventDetails(reason, nativeEvent));
|
|
314
|
+
return setValue(prevValue + amount * direction, createChangeEventDetails(reason, nativeEvent, void 0, { direction }));
|
|
315
|
+
});
|
|
316
|
+
useIsoLayoutEffect(function syncFormattedInputValueOnValueChange() {
|
|
317
|
+
if (!allowInputSyncRef.current) return;
|
|
318
|
+
const nextInputValue = formatNumber(value, locale, format);
|
|
319
|
+
if (nextInputValue !== inputValue) setInputValue(nextInputValue);
|
|
320
|
+
});
|
|
321
|
+
useIsoLayoutEffect(function setDynamicInputModeForIOS() {
|
|
322
|
+
if (!ios) return;
|
|
323
|
+
let computedInputMode = "text";
|
|
324
|
+
if (minWithDefault >= 0) computedInputMode = "decimal";
|
|
325
|
+
setInputMode(computedInputMode);
|
|
326
|
+
}, [minWithDefault]);
|
|
327
|
+
const focusInput = useStableCallback(() => {
|
|
328
|
+
const input = inputRef.current;
|
|
329
|
+
if (!input) return;
|
|
330
|
+
const length = input.value.length;
|
|
331
|
+
input.setSelectionRange(length, length);
|
|
332
|
+
input.focus();
|
|
333
|
+
});
|
|
334
|
+
React$1.useEffect(function registerElementWheelListener() {
|
|
335
|
+
const element = inputRef.current;
|
|
336
|
+
if (disabled || readOnly || !allowWheelScrub || !element) return;
|
|
337
|
+
function handleWheel(event) {
|
|
338
|
+
if (event.ctrlKey || activeElement(ownerDocument(inputRef.current)) !== inputRef.current) return;
|
|
339
|
+
const isHorizontal = Math.abs(event.deltaX) > Math.abs(event.deltaY);
|
|
340
|
+
const delta = event.shiftKey && isHorizontal ? event.deltaX : event.deltaY;
|
|
341
|
+
if (delta === 0 || !event.shiftKey && isHorizontal) return;
|
|
342
|
+
event.preventDefault();
|
|
343
|
+
allowInputSyncRef.current = true;
|
|
344
|
+
const amount = getStepAmount(event);
|
|
345
|
+
if (incrementValue(amount, {
|
|
346
|
+
direction: delta > 0 ? -1 : 1,
|
|
347
|
+
event,
|
|
348
|
+
reason: "wheel"
|
|
349
|
+
})) onValueCommitted(lastChangedValueRef.current, createGenericEventDetails(wheel, event));
|
|
350
|
+
}
|
|
351
|
+
return addEventListener(element, "wheel", handleWheel);
|
|
352
|
+
}, [
|
|
353
|
+
allowWheelScrub,
|
|
354
|
+
incrementValue,
|
|
355
|
+
disabled,
|
|
356
|
+
readOnly,
|
|
357
|
+
getStepAmount,
|
|
358
|
+
onValueCommitted,
|
|
359
|
+
lastChangedValueRef,
|
|
360
|
+
valueRef
|
|
361
|
+
]);
|
|
362
|
+
const state = React$1.useMemo(() => ({
|
|
363
|
+
...fieldState,
|
|
364
|
+
disabled,
|
|
365
|
+
readOnly,
|
|
366
|
+
required,
|
|
367
|
+
value,
|
|
368
|
+
inputValue,
|
|
369
|
+
scrubbing: isScrubbing
|
|
370
|
+
}), [
|
|
371
|
+
fieldState,
|
|
372
|
+
disabled,
|
|
373
|
+
readOnly,
|
|
374
|
+
required,
|
|
375
|
+
value,
|
|
376
|
+
inputValue,
|
|
377
|
+
isScrubbing
|
|
378
|
+
]);
|
|
379
|
+
const contextValue = React$1.useMemo(() => ({
|
|
380
|
+
inputRef,
|
|
381
|
+
focusInput,
|
|
382
|
+
minWithDefault,
|
|
383
|
+
maxWithDefault,
|
|
384
|
+
id,
|
|
385
|
+
setValue,
|
|
386
|
+
incrementValue,
|
|
387
|
+
getStepAmount,
|
|
388
|
+
allowInputSyncRef,
|
|
389
|
+
formatOptionsRef,
|
|
390
|
+
valueRef,
|
|
391
|
+
lastChangedValueRef,
|
|
392
|
+
hasPendingCommitRef,
|
|
393
|
+
name,
|
|
394
|
+
nameProp,
|
|
395
|
+
inputMode,
|
|
396
|
+
getAllowedNonNumericKeys,
|
|
397
|
+
min,
|
|
398
|
+
max,
|
|
399
|
+
setInputValue,
|
|
400
|
+
locale,
|
|
401
|
+
setIsScrubbing,
|
|
402
|
+
state,
|
|
403
|
+
onValueCommitted
|
|
404
|
+
}), [
|
|
405
|
+
inputRef,
|
|
406
|
+
focusInput,
|
|
407
|
+
minWithDefault,
|
|
408
|
+
maxWithDefault,
|
|
409
|
+
id,
|
|
410
|
+
setValue,
|
|
411
|
+
incrementValue,
|
|
412
|
+
getStepAmount,
|
|
413
|
+
formatOptionsRef,
|
|
414
|
+
valueRef,
|
|
415
|
+
name,
|
|
416
|
+
nameProp,
|
|
417
|
+
inputMode,
|
|
418
|
+
getAllowedNonNumericKeys,
|
|
419
|
+
min,
|
|
420
|
+
max,
|
|
421
|
+
setInputValue,
|
|
422
|
+
locale,
|
|
423
|
+
state,
|
|
424
|
+
onValueCommitted
|
|
425
|
+
]);
|
|
426
|
+
const element = useRenderElement("div", componentProps, {
|
|
427
|
+
ref: forwardedRef,
|
|
428
|
+
state,
|
|
429
|
+
props: elementProps,
|
|
430
|
+
stateAttributesMapping
|
|
431
|
+
});
|
|
432
|
+
return /*#__PURE__*/ jsxs(NumberFieldRootContext.Provider, {
|
|
433
|
+
value: contextValue,
|
|
434
|
+
children: [element, /*#__PURE__*/ jsx("input", {
|
|
435
|
+
...validation.getValidationProps(disabled, {
|
|
436
|
+
onFocus() {
|
|
437
|
+
focusInput();
|
|
438
|
+
},
|
|
439
|
+
onChange(event) {
|
|
440
|
+
if (event.nativeEvent.defaultPrevented || disabled || readOnly) return;
|
|
441
|
+
const nextValue = event.currentTarget.valueAsNumber;
|
|
442
|
+
const parsedValue = Number.isNaN(nextValue) ? null : nextValue;
|
|
443
|
+
const details = createChangeEventDetails(none, event.nativeEvent);
|
|
444
|
+
setValue(parsedValue, details);
|
|
445
|
+
clearErrors(name);
|
|
446
|
+
validation.change(lastChangedValueRef.current ?? parsedValue);
|
|
447
|
+
}
|
|
448
|
+
}),
|
|
449
|
+
ref: hiddenInputRef,
|
|
450
|
+
type: "number",
|
|
451
|
+
form,
|
|
452
|
+
name,
|
|
453
|
+
value: value ?? "",
|
|
454
|
+
min,
|
|
455
|
+
max,
|
|
456
|
+
step: stepProp,
|
|
457
|
+
disabled,
|
|
458
|
+
readOnly,
|
|
459
|
+
required,
|
|
460
|
+
"aria-hidden": true,
|
|
461
|
+
tabIndex: -1,
|
|
462
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
463
|
+
suppressHydrationWarning: true
|
|
464
|
+
})]
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
NumberFieldRoot.displayName = "NumberFieldRoot";
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/group/NumberFieldGroup.mjs
|
|
470
|
+
/**
|
|
471
|
+
* Groups the input with the increment and decrement buttons.
|
|
472
|
+
* Renders a `<div>` element.
|
|
473
|
+
*
|
|
474
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
475
|
+
*/
|
|
476
|
+
const NumberFieldGroup = /*#__PURE__*/ React$1.forwardRef(function NumberFieldGroup(componentProps, forwardedRef) {
|
|
477
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
478
|
+
const { state } = useNumberFieldRootContext();
|
|
479
|
+
return useRenderElement("div", componentProps, {
|
|
480
|
+
ref: forwardedRef,
|
|
481
|
+
state,
|
|
482
|
+
props: [{ role: "group" }, elementProps],
|
|
483
|
+
stateAttributesMapping
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
NumberFieldGroup.displayName = "NumberFieldGroup";
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/root/useNumberFieldStepperButton.mjs
|
|
489
|
+
const SELECT_NONE_STYLE = {
|
|
490
|
+
WebkitUserSelect: "none",
|
|
491
|
+
userSelect: "none"
|
|
492
|
+
};
|
|
493
|
+
/**
|
|
494
|
+
* Shared implementation for the increment and decrement stepper buttons. They differ only in the
|
|
495
|
+
* direction they step and the boundary (`max` vs `min`) at which they become disabled.
|
|
496
|
+
*/
|
|
497
|
+
function useNumberFieldStepperButton(componentProps, forwardedRef, isIncrement) {
|
|
498
|
+
const { render, className, disabled: disabledProp = false, nativeButton = true, style, ...elementProps } = componentProps;
|
|
499
|
+
const { allowInputSyncRef, formatOptionsRef, getStepAmount, id, incrementValue, inputRef, focusInput, maxWithDefault, minWithDefault, setValue, state, valueRef, locale, lastChangedValueRef, onValueCommitted } = useNumberFieldRootContext();
|
|
500
|
+
const { disabled: contextDisabled, readOnly, value, inputValue } = state;
|
|
501
|
+
const disabled = disabledProp || contextDisabled || value != null && (isIncrement ? value >= maxWithDefault : value <= minWithDefault);
|
|
502
|
+
const pressReason = isIncrement ? incrementPress : decrementPress;
|
|
503
|
+
function commitValue(nativeEvent) {
|
|
504
|
+
const shouldCommitInputValue = !allowInputSyncRef.current;
|
|
505
|
+
allowInputSyncRef.current = true;
|
|
506
|
+
if (!shouldCommitInputValue) {
|
|
507
|
+
lastChangedValueRef.current = valueRef.current;
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
const parsedValue = parseNumber(inputValue, locale, formatOptionsRef.current);
|
|
511
|
+
if (parsedValue !== null) {
|
|
512
|
+
const details = createChangeEventDetails(pressReason, nativeEvent);
|
|
513
|
+
setValue(parsedValue, details);
|
|
514
|
+
if (!details.isCanceled) valueRef.current = parsedValue;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
const { pointerHandlers, shouldSkipClick } = usePressAndHold({
|
|
518
|
+
disabled: disabled || readOnly,
|
|
519
|
+
elementRef: inputRef,
|
|
520
|
+
tick(triggerEvent) {
|
|
521
|
+
const amount = getStepAmount(triggerEvent);
|
|
522
|
+
return incrementValue(amount, {
|
|
523
|
+
direction: isIncrement ? 1 : -1,
|
|
524
|
+
event: triggerEvent,
|
|
525
|
+
reason: pressReason
|
|
526
|
+
});
|
|
527
|
+
},
|
|
528
|
+
onStop(nativeEvent) {
|
|
529
|
+
const committed = lastChangedValueRef.current ?? valueRef.current;
|
|
530
|
+
onValueCommitted(committed, createGenericEventDetails(pressReason, nativeEvent));
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
const props = {
|
|
534
|
+
disabled,
|
|
535
|
+
"aria-label": isIncrement ? "Increase" : "Decrease",
|
|
536
|
+
"aria-controls": id,
|
|
537
|
+
tabIndex: -1,
|
|
538
|
+
style: SELECT_NONE_STYLE,
|
|
539
|
+
...pointerHandlers,
|
|
540
|
+
onClick(event) {
|
|
541
|
+
const isDisabled = disabled || readOnly;
|
|
542
|
+
if (event.defaultPrevented || isDisabled || shouldSkipClick(event)) return;
|
|
543
|
+
commitValue(event.nativeEvent);
|
|
544
|
+
const amount = getStepAmount(event);
|
|
545
|
+
const prev = valueRef.current;
|
|
546
|
+
incrementValue(amount, {
|
|
547
|
+
direction: isIncrement ? 1 : -1,
|
|
548
|
+
event: event.nativeEvent,
|
|
549
|
+
reason: pressReason
|
|
550
|
+
});
|
|
551
|
+
const committed = lastChangedValueRef.current ?? valueRef.current;
|
|
552
|
+
if (committed !== prev) onValueCommitted(committed, createGenericEventDetails(pressReason, event.nativeEvent));
|
|
553
|
+
},
|
|
554
|
+
onPointerDown(event) {
|
|
555
|
+
if (event.defaultPrevented || readOnly || event.button || disabled) return;
|
|
556
|
+
commitValue(event.nativeEvent);
|
|
557
|
+
lastChangedValueRef.current = null;
|
|
558
|
+
if (!isTouchLikePointerType(event.pointerType)) focusInput();
|
|
559
|
+
pointerHandlers.onPointerDown(event);
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
563
|
+
disabled: disabled || readOnly,
|
|
564
|
+
native: nativeButton,
|
|
565
|
+
focusableWhenDisabled: true
|
|
566
|
+
});
|
|
567
|
+
const buttonState = {
|
|
568
|
+
...state,
|
|
569
|
+
disabled
|
|
570
|
+
};
|
|
571
|
+
return useRenderElement("button", componentProps, {
|
|
572
|
+
ref: [forwardedRef, buttonRef],
|
|
573
|
+
state: buttonState,
|
|
574
|
+
props: [
|
|
575
|
+
props,
|
|
576
|
+
elementProps,
|
|
577
|
+
getButtonProps
|
|
578
|
+
],
|
|
579
|
+
stateAttributesMapping
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/increment/NumberFieldIncrement.mjs
|
|
584
|
+
/**
|
|
585
|
+
* A stepper button that increases the field value when clicked.
|
|
586
|
+
* Renders a `<button>` element.
|
|
587
|
+
*
|
|
588
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
589
|
+
*/
|
|
590
|
+
const NumberFieldIncrement = /*#__PURE__*/ React$1.forwardRef(function NumberFieldIncrement(componentProps, forwardedRef) {
|
|
591
|
+
return useNumberFieldStepperButton(componentProps, forwardedRef, true);
|
|
592
|
+
});
|
|
593
|
+
NumberFieldIncrement.displayName = "NumberFieldIncrement";
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/decrement/NumberFieldDecrement.mjs
|
|
596
|
+
/**
|
|
597
|
+
* A stepper button that decreases the field value when clicked.
|
|
598
|
+
* Renders a `<button>` element.
|
|
599
|
+
*
|
|
600
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
601
|
+
*/
|
|
602
|
+
const NumberFieldDecrement = /*#__PURE__*/ React$1.forwardRef(function NumberFieldDecrement(componentProps, forwardedRef) {
|
|
603
|
+
return useNumberFieldStepperButton(componentProps, forwardedRef, false);
|
|
604
|
+
});
|
|
605
|
+
NumberFieldDecrement.displayName = "NumberFieldDecrement";
|
|
606
|
+
//#endregion
|
|
607
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/input/NumberFieldInput.mjs
|
|
608
|
+
const NAVIGATE_KEYS = /* @__PURE__ */ new Set([
|
|
609
|
+
"Backspace",
|
|
610
|
+
"Delete",
|
|
611
|
+
"ArrowLeft",
|
|
612
|
+
"ArrowRight",
|
|
613
|
+
"Tab",
|
|
614
|
+
"Enter",
|
|
615
|
+
"Escape"
|
|
616
|
+
]);
|
|
617
|
+
/**
|
|
618
|
+
* The native input control in the number field.
|
|
619
|
+
* Renders an `<input>` element.
|
|
620
|
+
*
|
|
621
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
622
|
+
*/
|
|
623
|
+
const NumberFieldInput = /*#__PURE__*/ React$1.forwardRef(function NumberFieldInput(componentProps, forwardedRef) {
|
|
624
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
625
|
+
const { allowInputSyncRef, formatOptionsRef, getAllowedNonNumericKeys, getStepAmount, id, incrementValue, inputMode, max, min, name, nameProp, setValue, state, setInputValue, locale, inputRef, onValueCommitted, lastChangedValueRef, hasPendingCommitRef, valueRef } = useNumberFieldRootContext();
|
|
626
|
+
const { disabled, readOnly, required, value, inputValue } = state;
|
|
627
|
+
const { clearErrors } = useFormContext();
|
|
628
|
+
const { validationMode, setTouched, invalid, shouldValidateOnChange, validation } = useFieldRootContext();
|
|
629
|
+
const { labelId } = useLabelableContext();
|
|
630
|
+
const setFocused = useSetFieldFocused(disabled, inputRef);
|
|
631
|
+
const blockRevalidationRef = React$1.useRef(false);
|
|
632
|
+
const pendingCaretRef = React$1.useRef(null);
|
|
633
|
+
useRegisterFieldControl(inputRef, id, value, void 0, !disabled, nameProp);
|
|
634
|
+
useIsoLayoutEffect(() => {
|
|
635
|
+
if (pendingCaretRef.current != null) {
|
|
636
|
+
const caret = pendingCaretRef.current;
|
|
637
|
+
pendingCaretRef.current = null;
|
|
638
|
+
inputRef.current?.setSelectionRange(caret, caret);
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
useValueChanged(value, () => {
|
|
642
|
+
clearErrors(name);
|
|
643
|
+
if (blockRevalidationRef.current && !shouldValidateOnChange()) {
|
|
644
|
+
blockRevalidationRef.current = false;
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
validation.change(value);
|
|
648
|
+
});
|
|
649
|
+
return useRenderElement("input", componentProps, {
|
|
650
|
+
ref: [forwardedRef, inputRef],
|
|
651
|
+
state,
|
|
652
|
+
props: [
|
|
653
|
+
{
|
|
654
|
+
id,
|
|
655
|
+
required,
|
|
656
|
+
disabled,
|
|
657
|
+
readOnly,
|
|
658
|
+
inputMode,
|
|
659
|
+
value: inputValue,
|
|
660
|
+
type: "text",
|
|
661
|
+
autoComplete: "off",
|
|
662
|
+
autoCorrect: "off",
|
|
663
|
+
spellCheck: "false",
|
|
664
|
+
"aria-roledescription": "Number field",
|
|
665
|
+
"aria-invalid": !disabled && invalid ? true : void 0,
|
|
666
|
+
"aria-labelledby": labelId,
|
|
667
|
+
suppressHydrationWarning: true,
|
|
668
|
+
onFocus(event) {
|
|
669
|
+
if (event.defaultPrevented || disabled) return;
|
|
670
|
+
setFocused(true);
|
|
671
|
+
},
|
|
672
|
+
onBlur(event) {
|
|
673
|
+
if (event.defaultPrevented || disabled) return;
|
|
674
|
+
setTouched(true);
|
|
675
|
+
setFocused(false);
|
|
676
|
+
if (readOnly) return;
|
|
677
|
+
const hadManualInput = !allowInputSyncRef.current;
|
|
678
|
+
const hadPendingProgrammaticChange = hasPendingCommitRef.current;
|
|
679
|
+
allowInputSyncRef.current = true;
|
|
680
|
+
if (inputValue.trim() === "") {
|
|
681
|
+
const clearDetails = createChangeEventDetails(inputClear, event.nativeEvent);
|
|
682
|
+
setValue(null, clearDetails);
|
|
683
|
+
if (clearDetails.isCanceled) return;
|
|
684
|
+
if (validationMode === "onBlur") validation.commit(null);
|
|
685
|
+
if (hadManualInput || hadPendingProgrammaticChange || value !== null) onValueCommitted(null, createGenericEventDetails(inputClear, event.nativeEvent));
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
const formatOptions = formatOptionsRef.current;
|
|
689
|
+
const parsedValue = parseNumber(inputValue, locale, formatOptions);
|
|
690
|
+
if (parsedValue === null) return;
|
|
691
|
+
const hasRoundingOptions = hasNumberFormatRoundingOptions(formatOptions);
|
|
692
|
+
let committed;
|
|
693
|
+
if (!hadManualInput && !hasRoundingOptions) committed = value;
|
|
694
|
+
else if (hasRoundingOptions) committed = removeFloatingPointErrors(parsedValue, formatOptions);
|
|
695
|
+
else committed = parsedValue;
|
|
696
|
+
const nextEventDetails = createGenericEventDetails(inputBlur, event.nativeEvent);
|
|
697
|
+
const shouldUpdateValue = value !== committed;
|
|
698
|
+
const shouldCommit = hadManualInput || shouldUpdateValue || hadPendingProgrammaticChange;
|
|
699
|
+
let committedValue = committed;
|
|
700
|
+
if (shouldUpdateValue) {
|
|
701
|
+
const changeDetails = createChangeEventDetails(inputBlur, event.nativeEvent);
|
|
702
|
+
blockRevalidationRef.current = true;
|
|
703
|
+
setValue(committed, changeDetails);
|
|
704
|
+
if (changeDetails.isCanceled) {
|
|
705
|
+
blockRevalidationRef.current = false;
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
committedValue = lastChangedValueRef.current;
|
|
709
|
+
if (committedValue === value) blockRevalidationRef.current = false;
|
|
710
|
+
}
|
|
711
|
+
if (validationMode === "onBlur") validation.commit(committedValue);
|
|
712
|
+
if (shouldCommit) onValueCommitted(committedValue, nextEventDetails);
|
|
713
|
+
const canonicalText = formatNumber(committedValue, locale, formatOptions);
|
|
714
|
+
if (inputValue !== canonicalText) setInputValue(canonicalText);
|
|
715
|
+
},
|
|
716
|
+
onChange(event) {
|
|
717
|
+
if (event.nativeEvent.defaultPrevented) return;
|
|
718
|
+
allowInputSyncRef.current = false;
|
|
719
|
+
const targetValue = event.currentTarget.value;
|
|
720
|
+
if (targetValue.trim() === "") {
|
|
721
|
+
setInputValue(targetValue);
|
|
722
|
+
setValue(null, createChangeEventDetails(inputClear, event.nativeEvent));
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
const allowedNonNumericKeys = getAllowedNonNumericKeys();
|
|
726
|
+
if (!Array.from(targetValue).every((ch) => isNumeralChar(ch) || ANY_MINUS_DETECT_RE.test(ch) || allowedNonNumericKeys.has(ch) || FORMAT_CONTROL_DETECT_RE.test(ch))) return;
|
|
727
|
+
const parsedValue = parseNumber(targetValue, locale, formatOptionsRef.current);
|
|
728
|
+
setInputValue(targetValue);
|
|
729
|
+
if (parsedValue !== null) setValue(parsedValue, createChangeEventDetails(inputChange, event.nativeEvent));
|
|
730
|
+
},
|
|
731
|
+
onKeyDown(event) {
|
|
732
|
+
if (event.defaultPrevented || readOnly || disabled) return;
|
|
733
|
+
const nativeEvent = event.nativeEvent;
|
|
734
|
+
const hadManualInput = !allowInputSyncRef.current;
|
|
735
|
+
const allowedNonNumericKeys = getAllowedNonNumericKeys();
|
|
736
|
+
let isAllowedNonNumericKey = allowedNonNumericKeys.has(event.key);
|
|
737
|
+
const { decimal, currency, percentSign } = getNumberLocaleDetails(locale, formatOptionsRef.current);
|
|
738
|
+
const selectionStart = event.currentTarget.selectionStart;
|
|
739
|
+
const selectionEnd = event.currentTarget.selectionEnd;
|
|
740
|
+
const isAllSelected = selectionStart === 0 && selectionEnd === inputValue.length;
|
|
741
|
+
const selectionContainsIndex = (index) => selectionStart != null && selectionEnd != null && index >= selectionStart && index < selectionEnd;
|
|
742
|
+
[[ANY_MINUS_DETECT_RE, ANY_MINUS_RE], [ANY_PLUS_DETECT_RE, ANY_PLUS_RE]].forEach(([detectRe, globalRe]) => {
|
|
743
|
+
if (detectRe.test(event.key) && Array.from(allowedNonNumericKeys).some((k) => detectRe.test(k))) {
|
|
744
|
+
const existingIndex = inputValue.search(globalRe);
|
|
745
|
+
const isReplacingExisting = existingIndex !== -1 && selectionContainsIndex(existingIndex);
|
|
746
|
+
isAllowedNonNumericKey = !(ANY_MINUS_DETECT_RE.test(inputValue) || ANY_PLUS_DETECT_RE.test(inputValue)) || isAllSelected || isReplacingExisting;
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
[
|
|
750
|
+
decimal,
|
|
751
|
+
currency,
|
|
752
|
+
percentSign
|
|
753
|
+
].forEach((symbol) => {
|
|
754
|
+
if (event.key === symbol) {
|
|
755
|
+
const symbolIndex = inputValue.indexOf(symbol);
|
|
756
|
+
const isSymbolHighlighted = selectionContainsIndex(symbolIndex);
|
|
757
|
+
isAllowedNonNumericKey = symbolIndex === -1 || isAllSelected || isSymbolHighlighted;
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
const isNavigateKey = NAVIGATE_KEYS.has(event.key);
|
|
761
|
+
const isStepKey = event.key === "ArrowUp" || event.key === "ArrowDown";
|
|
762
|
+
if (event.which === 229 || event.altKey && !isStepKey || event.ctrlKey || event.metaKey || isAllowedNonNumericKey || isNumeralChar(event.key) || isNavigateKey) return;
|
|
763
|
+
let boundaryValue = null;
|
|
764
|
+
if (event.key === "Home" && min != null) boundaryValue = min;
|
|
765
|
+
else if (event.key === "End" && max != null) boundaryValue = max;
|
|
766
|
+
if (event.key.length > 1 && !isStepKey && boundaryValue === null) return;
|
|
767
|
+
const currentValue = hadManualInput ? parseNumber(inputValue, locale, formatOptionsRef.current) : null;
|
|
768
|
+
const amount = getStepAmount(event);
|
|
769
|
+
event.preventDefault();
|
|
770
|
+
event.stopPropagation();
|
|
771
|
+
const commitDetails = createGenericEventDetails(keyboard, nativeEvent);
|
|
772
|
+
let changed = false;
|
|
773
|
+
if (isStepKey || boundaryValue !== null) allowInputSyncRef.current = true;
|
|
774
|
+
if (isStepKey) {
|
|
775
|
+
if (!hadManualInput) lastChangedValueRef.current = valueRef.current;
|
|
776
|
+
changed = incrementValue(amount, {
|
|
777
|
+
direction: event.key === "ArrowUp" ? 1 : -1,
|
|
778
|
+
currentValue,
|
|
779
|
+
event: nativeEvent,
|
|
780
|
+
reason: keyboard
|
|
781
|
+
});
|
|
782
|
+
} else if (boundaryValue !== null) changed = setValue(boundaryValue, createChangeEventDetails(keyboard, nativeEvent));
|
|
783
|
+
if (changed) onValueCommitted(lastChangedValueRef.current, commitDetails);
|
|
784
|
+
},
|
|
785
|
+
onPaste(event) {
|
|
786
|
+
if (event.defaultPrevented || readOnly || disabled) return;
|
|
787
|
+
let pastedData = "";
|
|
788
|
+
try {
|
|
789
|
+
pastedData = event.clipboardData?.getData("text/plain") ?? "";
|
|
790
|
+
} catch {
|
|
791
|
+
{
|
|
792
|
+
const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
|
|
793
|
+
warn("<NumberField.Input> could not read clipboard text during paste handling.", ownerStackMessage);
|
|
794
|
+
}
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
event.preventDefault();
|
|
798
|
+
const input = event.currentTarget;
|
|
799
|
+
const selectionStart = input.selectionStart;
|
|
800
|
+
const selectionEnd = input.selectionEnd;
|
|
801
|
+
const nextText = inputValue.slice(0, selectionStart) + pastedData + inputValue.slice(selectionEnd);
|
|
802
|
+
const parsedValue = parseNumber(nextText, locale, formatOptionsRef.current);
|
|
803
|
+
if (parsedValue !== null) {
|
|
804
|
+
allowInputSyncRef.current = false;
|
|
805
|
+
pendingCaretRef.current = selectionStart + pastedData.length;
|
|
806
|
+
setValue(parsedValue, createChangeEventDetails(inputPaste, event.nativeEvent));
|
|
807
|
+
setInputValue(nextText);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
},
|
|
811
|
+
elementProps,
|
|
812
|
+
(props) => validation.getValidationProps(disabled, props)
|
|
813
|
+
],
|
|
814
|
+
stateAttributesMapping
|
|
815
|
+
});
|
|
816
|
+
});
|
|
817
|
+
NumberFieldInput.displayName = "NumberFieldInput";
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/scrub-area/NumberFieldScrubAreaContext.mjs
|
|
820
|
+
const NumberFieldScrubAreaContext = /*#__PURE__*/ React$1.createContext(void 0);
|
|
821
|
+
NumberFieldScrubAreaContext.displayName = "NumberFieldScrubAreaContext";
|
|
822
|
+
function useNumberFieldScrubAreaContext() {
|
|
823
|
+
const context = React$1.useContext(NumberFieldScrubAreaContext);
|
|
824
|
+
if (context === void 0) throw new Error("Base UI: NumberFieldScrubAreaContext is missing. NumberFieldScrubArea parts must be placed within <NumberField.ScrubArea>.");
|
|
825
|
+
return context;
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/utils/getViewportRect.mjs
|
|
829
|
+
function getViewportRect(teleportDistance, scrubAreaEl) {
|
|
830
|
+
const win = getWindow(scrubAreaEl);
|
|
831
|
+
if (teleportDistance != null) {
|
|
832
|
+
const rect = scrubAreaEl.getBoundingClientRect();
|
|
833
|
+
return {
|
|
834
|
+
left: rect.left - teleportDistance / 2,
|
|
835
|
+
top: rect.top - teleportDistance / 2,
|
|
836
|
+
right: rect.right + teleportDistance / 2,
|
|
837
|
+
bottom: rect.bottom + teleportDistance / 2
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
const vV = win.visualViewport;
|
|
841
|
+
if (vV) return {
|
|
842
|
+
left: vV.offsetLeft,
|
|
843
|
+
top: vV.offsetTop,
|
|
844
|
+
right: vV.offsetLeft + vV.width,
|
|
845
|
+
bottom: vV.offsetTop + vV.height
|
|
846
|
+
};
|
|
847
|
+
return {
|
|
848
|
+
left: 0,
|
|
849
|
+
top: 0,
|
|
850
|
+
right: win.document.documentElement.clientWidth,
|
|
851
|
+
bottom: win.document.documentElement.clientHeight
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
//#endregion
|
|
855
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/scrub-area/NumberFieldScrubArea.mjs
|
|
856
|
+
const SCRUB_AREA_STYLE = {
|
|
857
|
+
touchAction: "none",
|
|
858
|
+
WebkitUserSelect: "none",
|
|
859
|
+
userSelect: "none"
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* An interactive area where the user can click and drag to change the field value.
|
|
863
|
+
* Renders a `<span>` element.
|
|
864
|
+
*
|
|
865
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
866
|
+
*/
|
|
867
|
+
const NumberFieldScrubArea = /*#__PURE__*/ React$1.forwardRef(function NumberFieldScrubArea(componentProps, forwardedRef) {
|
|
868
|
+
const { render, className, direction = "horizontal", pixelSensitivity = 2, teleportDistance, style, ...elementProps } = componentProps;
|
|
869
|
+
const { state, setIsScrubbing: setRootScrubbing, inputRef, focusInput, incrementValue, allowInputSyncRef, getStepAmount, onValueCommitted, lastChangedValueRef, valueRef } = useNumberFieldRootContext();
|
|
870
|
+
const { disabled, readOnly } = state;
|
|
871
|
+
const scrubAreaRef = React$1.useRef(null);
|
|
872
|
+
const isScrubbingRef = React$1.useRef(false);
|
|
873
|
+
const didMoveRef = React$1.useRef(false);
|
|
874
|
+
const pointerDownTargetRef = React$1.useRef(null);
|
|
875
|
+
const nativeClickReceivedRef = React$1.useRef(false);
|
|
876
|
+
const scrubAreaCursorRef = React$1.useRef(null);
|
|
877
|
+
const virtualCursorCoords = React$1.useRef({
|
|
878
|
+
x: 0,
|
|
879
|
+
y: 0
|
|
880
|
+
});
|
|
881
|
+
const exitPointerLockTimeout = useTimeout();
|
|
882
|
+
const syntheticClickTimeout = useTimeout();
|
|
883
|
+
const [isTouchInput, setIsTouchInput] = React$1.useState(false);
|
|
884
|
+
const [isPointerLockDenied, setIsPointerLockDenied] = React$1.useState(false);
|
|
885
|
+
const [isScrubbing, setIsScrubbing] = React$1.useState(false);
|
|
886
|
+
function updateCursorTransform(virtualCursor, x, y) {
|
|
887
|
+
const scale = getWindow(virtualCursor).visualViewport?.scale ?? 1;
|
|
888
|
+
virtualCursor.style.transform = `translate3d(${x}px,${y}px,0) scale(${1 / scale})`;
|
|
889
|
+
}
|
|
890
|
+
const onScrub = useStableCallback(({ movementX, movementY }) => {
|
|
891
|
+
const virtualCursor = scrubAreaCursorRef.current;
|
|
892
|
+
const scrubAreaEl = scrubAreaRef.current;
|
|
893
|
+
if (!virtualCursor || !scrubAreaEl) return;
|
|
894
|
+
const rect = getViewportRect(teleportDistance, scrubAreaEl);
|
|
895
|
+
const coords = virtualCursorCoords.current;
|
|
896
|
+
const wrap = (coord, halfSize, low, high) => {
|
|
897
|
+
if (coord + halfSize < low) return high - halfSize;
|
|
898
|
+
if (coord + halfSize > high) return low - halfSize;
|
|
899
|
+
return coord;
|
|
900
|
+
};
|
|
901
|
+
const newCoords = {
|
|
902
|
+
x: wrap(Math.round(coords.x + movementX), virtualCursor.offsetWidth / 2, rect.left, rect.right),
|
|
903
|
+
y: wrap(Math.round(coords.y + movementY), virtualCursor.offsetHeight / 2, rect.top, rect.bottom)
|
|
904
|
+
};
|
|
905
|
+
virtualCursorCoords.current = newCoords;
|
|
906
|
+
updateCursorTransform(virtualCursor, newCoords.x, newCoords.y);
|
|
907
|
+
});
|
|
908
|
+
const onScrubbingChange = useStableCallback((scrubbingValue, { clientX, clientY }) => {
|
|
909
|
+
ReactDOM.flushSync(() => {
|
|
910
|
+
setIsScrubbing(scrubbingValue);
|
|
911
|
+
setRootScrubbing(scrubbingValue);
|
|
912
|
+
});
|
|
913
|
+
const virtualCursor = scrubAreaCursorRef.current;
|
|
914
|
+
if (!virtualCursor || !scrubbingValue) return;
|
|
915
|
+
const initialCoords = {
|
|
916
|
+
x: clientX - virtualCursor.offsetWidth / 2,
|
|
917
|
+
y: clientY - virtualCursor.offsetHeight / 2
|
|
918
|
+
};
|
|
919
|
+
virtualCursorCoords.current = initialCoords;
|
|
920
|
+
updateCursorTransform(virtualCursor, initialCoords.x, initialCoords.y);
|
|
921
|
+
});
|
|
922
|
+
React$1.useEffect(function registerGlobalScrubbingEventListeners() {
|
|
923
|
+
if (!inputRef.current || disabled || readOnly || !isScrubbing) return;
|
|
924
|
+
let cumulativeDelta = 0;
|
|
925
|
+
function handleScrubPointerUp(event) {
|
|
926
|
+
function handler() {
|
|
927
|
+
try {
|
|
928
|
+
ownerDocument(scrubAreaRef.current).exitPointerLock();
|
|
929
|
+
} catch {} finally {
|
|
930
|
+
isScrubbingRef.current = false;
|
|
931
|
+
onScrubbingChange(false, event);
|
|
932
|
+
onValueCommitted(lastChangedValueRef.current ?? valueRef.current, createGenericEventDetails(scrub, event));
|
|
933
|
+
const pointerDownTarget = pointerDownTargetRef.current;
|
|
934
|
+
const input = inputRef.current;
|
|
935
|
+
if (!didMoveRef.current && pointerDownTarget != null && input) {
|
|
936
|
+
const MouseEventConstructor = getWindow(input).MouseEvent;
|
|
937
|
+
syntheticClickTimeout.start(0, () => {
|
|
938
|
+
if (nativeClickReceivedRef.current) return;
|
|
939
|
+
pointerDownTarget.dispatchEvent(new MouseEventConstructor("click", {
|
|
940
|
+
bubbles: true,
|
|
941
|
+
cancelable: true
|
|
942
|
+
}));
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
didMoveRef.current = false;
|
|
946
|
+
pointerDownTargetRef.current = null;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
if (gecko) exitPointerLockTimeout.start(20, handler);
|
|
950
|
+
else handler();
|
|
951
|
+
}
|
|
952
|
+
function handleScrubPointerMove(event) {
|
|
953
|
+
if (!isScrubbingRef.current) return;
|
|
954
|
+
event.preventDefault();
|
|
955
|
+
onScrub(event);
|
|
956
|
+
const { movementX, movementY } = event;
|
|
957
|
+
cumulativeDelta += direction === "vertical" ? movementY : movementX;
|
|
958
|
+
if (Math.abs(cumulativeDelta) >= pixelSensitivity) {
|
|
959
|
+
cumulativeDelta = 0;
|
|
960
|
+
didMoveRef.current = true;
|
|
961
|
+
const rawAmount = (direction === "vertical" ? -movementY : movementX) * getStepAmount(event);
|
|
962
|
+
if (rawAmount !== 0) {
|
|
963
|
+
allowInputSyncRef.current = true;
|
|
964
|
+
incrementValue(Math.abs(rawAmount), {
|
|
965
|
+
direction: rawAmount >= 0 ? 1 : -1,
|
|
966
|
+
event,
|
|
967
|
+
reason: scrub
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
const win = getWindow(inputRef.current);
|
|
973
|
+
const unsubscribe = mergeCleanups(addEventListener(win, "pointerup", handleScrubPointerUp, true), addEventListener(win, "pointermove", handleScrubPointerMove, true));
|
|
974
|
+
return () => {
|
|
975
|
+
exitPointerLockTimeout.clear();
|
|
976
|
+
unsubscribe();
|
|
977
|
+
};
|
|
978
|
+
}, [
|
|
979
|
+
disabled,
|
|
980
|
+
readOnly,
|
|
981
|
+
allowInputSyncRef,
|
|
982
|
+
incrementValue,
|
|
983
|
+
isScrubbing,
|
|
984
|
+
getStepAmount,
|
|
985
|
+
inputRef,
|
|
986
|
+
onScrubbingChange,
|
|
987
|
+
onScrub,
|
|
988
|
+
direction,
|
|
989
|
+
pixelSensitivity,
|
|
990
|
+
lastChangedValueRef,
|
|
991
|
+
onValueCommitted,
|
|
992
|
+
valueRef,
|
|
993
|
+
exitPointerLockTimeout,
|
|
994
|
+
syntheticClickTimeout
|
|
995
|
+
]);
|
|
996
|
+
React$1.useEffect(() => () => {
|
|
997
|
+
if (isScrubbingRef.current) {
|
|
998
|
+
isScrubbingRef.current = false;
|
|
999
|
+
setRootScrubbing(false);
|
|
1000
|
+
try {
|
|
1001
|
+
ownerDocument(scrubAreaRef.current).exitPointerLock();
|
|
1002
|
+
} catch {}
|
|
1003
|
+
}
|
|
1004
|
+
}, [setRootScrubbing]);
|
|
1005
|
+
React$1.useEffect(function registerScrubberTouchPreventListener() {
|
|
1006
|
+
const element = scrubAreaRef.current;
|
|
1007
|
+
if (!element || disabled || readOnly) return;
|
|
1008
|
+
function handleTouchStart(event) {
|
|
1009
|
+
if (event.touches.length === 1) event.preventDefault();
|
|
1010
|
+
}
|
|
1011
|
+
return addEventListener(element, "touchstart", handleTouchStart);
|
|
1012
|
+
}, [disabled, readOnly]);
|
|
1013
|
+
const element = useRenderElement("span", componentProps, {
|
|
1014
|
+
ref: [forwardedRef, scrubAreaRef],
|
|
1015
|
+
state,
|
|
1016
|
+
props: [{
|
|
1017
|
+
role: "presentation",
|
|
1018
|
+
style: SCRUB_AREA_STYLE,
|
|
1019
|
+
onClickCapture() {
|
|
1020
|
+
nativeClickReceivedRef.current = true;
|
|
1021
|
+
},
|
|
1022
|
+
async onPointerDown(event) {
|
|
1023
|
+
if (event.defaultPrevented || readOnly || event.button || disabled) return;
|
|
1024
|
+
const isTouch = event.pointerType === "touch";
|
|
1025
|
+
setIsTouchInput(isTouch);
|
|
1026
|
+
if (event.pointerType === "mouse") {
|
|
1027
|
+
event.preventDefault();
|
|
1028
|
+
focusInput();
|
|
1029
|
+
}
|
|
1030
|
+
isScrubbingRef.current = true;
|
|
1031
|
+
didMoveRef.current = false;
|
|
1032
|
+
nativeClickReceivedRef.current = false;
|
|
1033
|
+
syntheticClickTimeout.clear();
|
|
1034
|
+
pointerDownTargetRef.current = getTarget(event.nativeEvent);
|
|
1035
|
+
onScrubbingChange(true, event.nativeEvent);
|
|
1036
|
+
if (!isTouch && !webkit) try {
|
|
1037
|
+
await ownerDocument(scrubAreaRef.current).body.requestPointerLock();
|
|
1038
|
+
setIsPointerLockDenied(false);
|
|
1039
|
+
} catch (error) {
|
|
1040
|
+
setIsPointerLockDenied(true);
|
|
1041
|
+
} finally {
|
|
1042
|
+
if (isScrubbingRef.current) onScrubbingChange(true, event.nativeEvent);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
}, elementProps],
|
|
1046
|
+
stateAttributesMapping
|
|
1047
|
+
});
|
|
1048
|
+
const contextValue = React$1.useMemo(() => ({
|
|
1049
|
+
isScrubbing,
|
|
1050
|
+
isTouchInput,
|
|
1051
|
+
isPointerLockDenied,
|
|
1052
|
+
scrubAreaCursorRef
|
|
1053
|
+
}), [
|
|
1054
|
+
isScrubbing,
|
|
1055
|
+
isTouchInput,
|
|
1056
|
+
isPointerLockDenied
|
|
1057
|
+
]);
|
|
1058
|
+
return /*#__PURE__*/ jsx(NumberFieldScrubAreaContext.Provider, {
|
|
1059
|
+
value: contextValue,
|
|
1060
|
+
children: element
|
|
1061
|
+
});
|
|
1062
|
+
});
|
|
1063
|
+
NumberFieldScrubArea.displayName = "NumberFieldScrubArea";
|
|
1064
|
+
//#endregion
|
|
1065
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.mjs
|
|
1066
|
+
const CURSOR_STYLE = {
|
|
1067
|
+
position: "fixed",
|
|
1068
|
+
top: 0,
|
|
1069
|
+
left: 0,
|
|
1070
|
+
pointerEvents: "none"
|
|
1071
|
+
};
|
|
1072
|
+
/**
|
|
1073
|
+
* A custom element to display instead of the native cursor while using the scrub area.
|
|
1074
|
+
* Renders a `<span>` element.
|
|
1075
|
+
*
|
|
1076
|
+
* This component uses the [Pointer Lock API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API), which may prompt the browser to display a related notification. It is disabled
|
|
1077
|
+
* in Safari to avoid a layout shift that this notification causes there.
|
|
1078
|
+
*
|
|
1079
|
+
* Documentation: [Base UI Number Field](https://base-ui.com/react/components/number-field)
|
|
1080
|
+
*/
|
|
1081
|
+
const NumberFieldScrubAreaCursor = /*#__PURE__*/ React$1.forwardRef(function NumberFieldScrubAreaCursor(componentProps, forwardedRef) {
|
|
1082
|
+
const { render, className, style, ...elementProps } = componentProps;
|
|
1083
|
+
const { state } = useNumberFieldRootContext();
|
|
1084
|
+
const { isScrubbing, isTouchInput, isPointerLockDenied, scrubAreaCursorRef } = useNumberFieldScrubAreaContext();
|
|
1085
|
+
const [domElement, setDomElement] = React$1.useState(null);
|
|
1086
|
+
const element = useRenderElement("span", componentProps, {
|
|
1087
|
+
enabled: isScrubbing && !webkit && !isTouchInput && !isPointerLockDenied,
|
|
1088
|
+
ref: [
|
|
1089
|
+
forwardedRef,
|
|
1090
|
+
scrubAreaCursorRef,
|
|
1091
|
+
setDomElement
|
|
1092
|
+
],
|
|
1093
|
+
state,
|
|
1094
|
+
props: [{
|
|
1095
|
+
role: "presentation",
|
|
1096
|
+
style: CURSOR_STYLE
|
|
1097
|
+
}, elementProps],
|
|
1098
|
+
stateAttributesMapping
|
|
1099
|
+
});
|
|
1100
|
+
return element && /*#__PURE__*/ ReactDOM.createPortal(element, ownerDocument(domElement).body);
|
|
1101
|
+
});
|
|
1102
|
+
NumberFieldScrubAreaCursor.displayName = "NumberFieldScrubAreaCursor";
|
|
1103
|
+
//#endregion
|
|
1104
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/index.parts.mjs
|
|
1105
|
+
var index_parts_exports = /* @__PURE__ */ __exportAll({
|
|
1106
|
+
Decrement: () => NumberFieldDecrement,
|
|
1107
|
+
Group: () => NumberFieldGroup,
|
|
1108
|
+
Increment: () => NumberFieldIncrement,
|
|
1109
|
+
Input: () => NumberFieldInput,
|
|
1110
|
+
Root: () => NumberFieldRoot,
|
|
1111
|
+
ScrubArea: () => NumberFieldScrubArea,
|
|
1112
|
+
ScrubAreaCursor: () => NumberFieldScrubAreaCursor
|
|
1113
|
+
});
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/root/NumberFieldRootDataAttributes.mjs
|
|
1116
|
+
var NumberFieldRootDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1117
|
+
dirty: () => dirty$6,
|
|
1118
|
+
disabled: () => disabled$6,
|
|
1119
|
+
filled: () => filled$6,
|
|
1120
|
+
focused: () => focused$6,
|
|
1121
|
+
invalid: () => invalid$6,
|
|
1122
|
+
readonly: () => readonly$6,
|
|
1123
|
+
required: () => required$6,
|
|
1124
|
+
scrubbing: () => scrubbing$6,
|
|
1125
|
+
touched: () => touched$6,
|
|
1126
|
+
valid: () => valid$6
|
|
1127
|
+
});
|
|
1128
|
+
/**
|
|
1129
|
+
* Present while scrubbing.
|
|
1130
|
+
*/
|
|
1131
|
+
const scrubbing$6 = "data-scrubbing";
|
|
1132
|
+
/**
|
|
1133
|
+
* Present when the number field is disabled.
|
|
1134
|
+
*/
|
|
1135
|
+
const disabled$6 = "data-disabled";
|
|
1136
|
+
/**
|
|
1137
|
+
* Present when the number field is readonly.
|
|
1138
|
+
*/
|
|
1139
|
+
const readonly$6 = "data-readonly";
|
|
1140
|
+
/**
|
|
1141
|
+
* Present when the number field is required.
|
|
1142
|
+
*/
|
|
1143
|
+
const required$6 = "data-required";
|
|
1144
|
+
/**
|
|
1145
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1146
|
+
*/
|
|
1147
|
+
const valid$6 = "data-valid";
|
|
1148
|
+
/**
|
|
1149
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1150
|
+
*/
|
|
1151
|
+
const invalid$6 = "data-invalid";
|
|
1152
|
+
/**
|
|
1153
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1154
|
+
*/
|
|
1155
|
+
const touched$6 = "data-touched";
|
|
1156
|
+
/**
|
|
1157
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1158
|
+
*/
|
|
1159
|
+
const dirty$6 = "data-dirty";
|
|
1160
|
+
/**
|
|
1161
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1162
|
+
*/
|
|
1163
|
+
const filled$6 = "data-filled";
|
|
1164
|
+
/**
|
|
1165
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1166
|
+
*/
|
|
1167
|
+
const focused$6 = "data-focused";
|
|
1168
|
+
//#endregion
|
|
1169
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/group/NumberFieldGroupDataAttributes.mjs
|
|
1170
|
+
var NumberFieldGroupDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1171
|
+
dirty: () => dirty$5,
|
|
1172
|
+
disabled: () => disabled$5,
|
|
1173
|
+
filled: () => filled$5,
|
|
1174
|
+
focused: () => focused$5,
|
|
1175
|
+
invalid: () => invalid$5,
|
|
1176
|
+
readonly: () => readonly$5,
|
|
1177
|
+
required: () => required$5,
|
|
1178
|
+
scrubbing: () => scrubbing$5,
|
|
1179
|
+
touched: () => touched$5,
|
|
1180
|
+
valid: () => valid$5
|
|
1181
|
+
});
|
|
1182
|
+
/**
|
|
1183
|
+
* Present while scrubbing.
|
|
1184
|
+
*/
|
|
1185
|
+
const scrubbing$5 = "data-scrubbing";
|
|
1186
|
+
/**
|
|
1187
|
+
* Present when the number field is disabled.
|
|
1188
|
+
*/
|
|
1189
|
+
const disabled$5 = "data-disabled";
|
|
1190
|
+
/**
|
|
1191
|
+
* Present when the number field is readonly.
|
|
1192
|
+
*/
|
|
1193
|
+
const readonly$5 = "data-readonly";
|
|
1194
|
+
/**
|
|
1195
|
+
* Present when the number field is required.
|
|
1196
|
+
*/
|
|
1197
|
+
const required$5 = "data-required";
|
|
1198
|
+
/**
|
|
1199
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1200
|
+
*/
|
|
1201
|
+
const valid$5 = "data-valid";
|
|
1202
|
+
/**
|
|
1203
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1204
|
+
*/
|
|
1205
|
+
const invalid$5 = "data-invalid";
|
|
1206
|
+
/**
|
|
1207
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1208
|
+
*/
|
|
1209
|
+
const touched$5 = "data-touched";
|
|
1210
|
+
/**
|
|
1211
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1212
|
+
*/
|
|
1213
|
+
const dirty$5 = "data-dirty";
|
|
1214
|
+
/**
|
|
1215
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1216
|
+
*/
|
|
1217
|
+
const filled$5 = "data-filled";
|
|
1218
|
+
/**
|
|
1219
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1220
|
+
*/
|
|
1221
|
+
const focused$5 = "data-focused";
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/increment/NumberFieldIncrementDataAttributes.mjs
|
|
1224
|
+
var NumberFieldIncrementDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1225
|
+
dirty: () => dirty$4,
|
|
1226
|
+
disabled: () => disabled$4,
|
|
1227
|
+
filled: () => filled$4,
|
|
1228
|
+
focused: () => focused$4,
|
|
1229
|
+
invalid: () => invalid$4,
|
|
1230
|
+
readonly: () => readonly$4,
|
|
1231
|
+
required: () => required$4,
|
|
1232
|
+
scrubbing: () => scrubbing$4,
|
|
1233
|
+
touched: () => touched$4,
|
|
1234
|
+
valid: () => valid$4
|
|
1235
|
+
});
|
|
1236
|
+
/**
|
|
1237
|
+
* Present while scrubbing.
|
|
1238
|
+
*/
|
|
1239
|
+
const scrubbing$4 = "data-scrubbing";
|
|
1240
|
+
/**
|
|
1241
|
+
* Present when the number field is disabled.
|
|
1242
|
+
*/
|
|
1243
|
+
const disabled$4 = "data-disabled";
|
|
1244
|
+
/**
|
|
1245
|
+
* Present when the number field is readonly.
|
|
1246
|
+
*/
|
|
1247
|
+
const readonly$4 = "data-readonly";
|
|
1248
|
+
/**
|
|
1249
|
+
* Present when the number field is required.
|
|
1250
|
+
*/
|
|
1251
|
+
const required$4 = "data-required";
|
|
1252
|
+
/**
|
|
1253
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1254
|
+
*/
|
|
1255
|
+
const valid$4 = "data-valid";
|
|
1256
|
+
/**
|
|
1257
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1258
|
+
*/
|
|
1259
|
+
const invalid$4 = "data-invalid";
|
|
1260
|
+
/**
|
|
1261
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1262
|
+
*/
|
|
1263
|
+
const touched$4 = "data-touched";
|
|
1264
|
+
/**
|
|
1265
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1266
|
+
*/
|
|
1267
|
+
const dirty$4 = "data-dirty";
|
|
1268
|
+
/**
|
|
1269
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1270
|
+
*/
|
|
1271
|
+
const filled$4 = "data-filled";
|
|
1272
|
+
/**
|
|
1273
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1274
|
+
*/
|
|
1275
|
+
const focused$4 = "data-focused";
|
|
1276
|
+
//#endregion
|
|
1277
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/decrement/NumberFieldDecrementDataAttributes.mjs
|
|
1278
|
+
var NumberFieldDecrementDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1279
|
+
dirty: () => dirty$3,
|
|
1280
|
+
disabled: () => disabled$3,
|
|
1281
|
+
filled: () => filled$3,
|
|
1282
|
+
focused: () => focused$3,
|
|
1283
|
+
invalid: () => invalid$3,
|
|
1284
|
+
readonly: () => readonly$3,
|
|
1285
|
+
required: () => required$3,
|
|
1286
|
+
scrubbing: () => scrubbing$3,
|
|
1287
|
+
touched: () => touched$3,
|
|
1288
|
+
valid: () => valid$3
|
|
1289
|
+
});
|
|
1290
|
+
/**
|
|
1291
|
+
* Present while scrubbing.
|
|
1292
|
+
*/
|
|
1293
|
+
const scrubbing$3 = "data-scrubbing";
|
|
1294
|
+
/**
|
|
1295
|
+
* Present when the number field is disabled.
|
|
1296
|
+
*/
|
|
1297
|
+
const disabled$3 = "data-disabled";
|
|
1298
|
+
/**
|
|
1299
|
+
* Present when the number field is readonly.
|
|
1300
|
+
*/
|
|
1301
|
+
const readonly$3 = "data-readonly";
|
|
1302
|
+
/**
|
|
1303
|
+
* Present when the number field is required.
|
|
1304
|
+
*/
|
|
1305
|
+
const required$3 = "data-required";
|
|
1306
|
+
/**
|
|
1307
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1308
|
+
*/
|
|
1309
|
+
const valid$3 = "data-valid";
|
|
1310
|
+
/**
|
|
1311
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1312
|
+
*/
|
|
1313
|
+
const invalid$3 = "data-invalid";
|
|
1314
|
+
/**
|
|
1315
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1316
|
+
*/
|
|
1317
|
+
const touched$3 = "data-touched";
|
|
1318
|
+
/**
|
|
1319
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1320
|
+
*/
|
|
1321
|
+
const dirty$3 = "data-dirty";
|
|
1322
|
+
/**
|
|
1323
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1324
|
+
*/
|
|
1325
|
+
const filled$3 = "data-filled";
|
|
1326
|
+
/**
|
|
1327
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1328
|
+
*/
|
|
1329
|
+
const focused$3 = "data-focused";
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/input/NumberFieldInputDataAttributes.mjs
|
|
1332
|
+
var NumberFieldInputDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1333
|
+
dirty: () => dirty$2,
|
|
1334
|
+
disabled: () => disabled$2,
|
|
1335
|
+
filled: () => filled$2,
|
|
1336
|
+
focused: () => focused$2,
|
|
1337
|
+
invalid: () => invalid$2,
|
|
1338
|
+
readonly: () => readonly$2,
|
|
1339
|
+
required: () => required$2,
|
|
1340
|
+
scrubbing: () => scrubbing$2,
|
|
1341
|
+
touched: () => touched$2,
|
|
1342
|
+
valid: () => valid$2
|
|
1343
|
+
});
|
|
1344
|
+
/**
|
|
1345
|
+
* Present while scrubbing.
|
|
1346
|
+
*/
|
|
1347
|
+
const scrubbing$2 = "data-scrubbing";
|
|
1348
|
+
/**
|
|
1349
|
+
* Present when the number field is disabled.
|
|
1350
|
+
*/
|
|
1351
|
+
const disabled$2 = "data-disabled";
|
|
1352
|
+
/**
|
|
1353
|
+
* Present when the number field is readonly.
|
|
1354
|
+
*/
|
|
1355
|
+
const readonly$2 = "data-readonly";
|
|
1356
|
+
/**
|
|
1357
|
+
* Present when the number field is required.
|
|
1358
|
+
*/
|
|
1359
|
+
const required$2 = "data-required";
|
|
1360
|
+
/**
|
|
1361
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1362
|
+
*/
|
|
1363
|
+
const valid$2 = "data-valid";
|
|
1364
|
+
/**
|
|
1365
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1366
|
+
*/
|
|
1367
|
+
const invalid$2 = "data-invalid";
|
|
1368
|
+
/**
|
|
1369
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1370
|
+
*/
|
|
1371
|
+
const touched$2 = "data-touched";
|
|
1372
|
+
/**
|
|
1373
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1374
|
+
*/
|
|
1375
|
+
const dirty$2 = "data-dirty";
|
|
1376
|
+
/**
|
|
1377
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1378
|
+
*/
|
|
1379
|
+
const filled$2 = "data-filled";
|
|
1380
|
+
/**
|
|
1381
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1382
|
+
*/
|
|
1383
|
+
const focused$2 = "data-focused";
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.mjs
|
|
1386
|
+
var NumberFieldScrubAreaDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1387
|
+
dirty: () => dirty$1,
|
|
1388
|
+
disabled: () => disabled$1,
|
|
1389
|
+
filled: () => filled$1,
|
|
1390
|
+
focused: () => focused$1,
|
|
1391
|
+
invalid: () => invalid$1,
|
|
1392
|
+
readonly: () => readonly$1,
|
|
1393
|
+
required: () => required$1,
|
|
1394
|
+
scrubbing: () => scrubbing$1,
|
|
1395
|
+
touched: () => touched$1,
|
|
1396
|
+
valid: () => valid$1
|
|
1397
|
+
});
|
|
1398
|
+
/**
|
|
1399
|
+
* Present while scrubbing.
|
|
1400
|
+
*/
|
|
1401
|
+
const scrubbing$1 = "data-scrubbing";
|
|
1402
|
+
/**
|
|
1403
|
+
* Present when the number field is disabled.
|
|
1404
|
+
*/
|
|
1405
|
+
const disabled$1 = "data-disabled";
|
|
1406
|
+
/**
|
|
1407
|
+
* Present when the number field is readonly.
|
|
1408
|
+
*/
|
|
1409
|
+
const readonly$1 = "data-readonly";
|
|
1410
|
+
/**
|
|
1411
|
+
* Present when the number field is required.
|
|
1412
|
+
*/
|
|
1413
|
+
const required$1 = "data-required";
|
|
1414
|
+
/**
|
|
1415
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1416
|
+
*/
|
|
1417
|
+
const valid$1 = "data-valid";
|
|
1418
|
+
/**
|
|
1419
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1420
|
+
*/
|
|
1421
|
+
const invalid$1 = "data-invalid";
|
|
1422
|
+
/**
|
|
1423
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1424
|
+
*/
|
|
1425
|
+
const touched$1 = "data-touched";
|
|
1426
|
+
/**
|
|
1427
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1428
|
+
*/
|
|
1429
|
+
const dirty$1 = "data-dirty";
|
|
1430
|
+
/**
|
|
1431
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1432
|
+
*/
|
|
1433
|
+
const filled$1 = "data-filled";
|
|
1434
|
+
/**
|
|
1435
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1436
|
+
*/
|
|
1437
|
+
const focused$1 = "data-focused";
|
|
1438
|
+
//#endregion
|
|
1439
|
+
//#region ../../node_modules/.pnpm/@base-ui+react@1.9.0_@date-fns+tz@1.4.1_@types+react@19.2.4_date-fns@4.1.0_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@base-ui/react/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.mjs
|
|
1440
|
+
var NumberFieldScrubAreaCursorDataAttributes_exports = /* @__PURE__ */ __exportAll({
|
|
1441
|
+
dirty: () => dirty,
|
|
1442
|
+
disabled: () => disabled,
|
|
1443
|
+
filled: () => filled,
|
|
1444
|
+
focused: () => focused,
|
|
1445
|
+
invalid: () => invalid,
|
|
1446
|
+
readonly: () => readonly,
|
|
1447
|
+
required: () => required,
|
|
1448
|
+
scrubbing: () => scrubbing,
|
|
1449
|
+
touched: () => touched,
|
|
1450
|
+
valid: () => valid
|
|
1451
|
+
});
|
|
1452
|
+
/**
|
|
1453
|
+
* Present while scrubbing.
|
|
1454
|
+
*/
|
|
1455
|
+
const scrubbing = "data-scrubbing";
|
|
1456
|
+
/**
|
|
1457
|
+
* Present when the number field is disabled.
|
|
1458
|
+
*/
|
|
1459
|
+
const disabled = "data-disabled";
|
|
1460
|
+
/**
|
|
1461
|
+
* Present when the number field is readonly.
|
|
1462
|
+
*/
|
|
1463
|
+
const readonly = "data-readonly";
|
|
1464
|
+
/**
|
|
1465
|
+
* Present when the number field is required.
|
|
1466
|
+
*/
|
|
1467
|
+
const required = "data-required";
|
|
1468
|
+
/**
|
|
1469
|
+
* Present when the number field is in a valid state (when wrapped in Field.Root).
|
|
1470
|
+
*/
|
|
1471
|
+
const valid = "data-valid";
|
|
1472
|
+
/**
|
|
1473
|
+
* Present when the number field is in an invalid state (when wrapped in Field.Root).
|
|
1474
|
+
*/
|
|
1475
|
+
const invalid = "data-invalid";
|
|
1476
|
+
/**
|
|
1477
|
+
* Present when the number field has been touched (when wrapped in Field.Root).
|
|
1478
|
+
*/
|
|
1479
|
+
const touched = "data-touched";
|
|
1480
|
+
/**
|
|
1481
|
+
* Present when the number field's value has changed (when wrapped in Field.Root).
|
|
1482
|
+
*/
|
|
1483
|
+
const dirty = "data-dirty";
|
|
1484
|
+
/**
|
|
1485
|
+
* Present when the number field is filled (when wrapped in Field.Root).
|
|
1486
|
+
*/
|
|
1487
|
+
const filled = "data-filled";
|
|
1488
|
+
/**
|
|
1489
|
+
* Present when the number field is focused (when wrapped in Field.Root).
|
|
1490
|
+
*/
|
|
1491
|
+
const focused = "data-focused";
|
|
1492
|
+
//#endregion
|
|
1493
|
+
export { NumberFieldIncrementDataAttributes_exports as a, index_parts_exports as c, NumberFieldDecrementDataAttributes_exports as i, NumberFieldScrubAreaDataAttributes_exports as n, NumberFieldGroupDataAttributes_exports as o, NumberFieldInputDataAttributes_exports as r, NumberFieldRootDataAttributes_exports as s, NumberFieldScrubAreaCursorDataAttributes_exports as t };
|