@monimesl/dot-renderer-react 0.1.0-alpha.10

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.
Files changed (244) hide show
  1. package/README.md +43 -0
  2. package/dist/LICENSE-PHOSPHOR +21 -0
  3. package/dist/_virtual/_rolldown/runtime.js +14 -0
  4. package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
  5. package/dist/color.js +105 -0
  6. package/dist/components/amount-input.d.ts +6 -0
  7. package/dist/components/amount-input.js +106 -0
  8. package/dist/components/button.d.ts +6 -0
  9. package/dist/components/button.js +42 -0
  10. package/dist/components/carousel.d.ts +6 -0
  11. package/dist/components/carousel.js +254 -0
  12. package/dist/components/chip.d.ts +6 -0
  13. package/dist/components/chip.js +41 -0
  14. package/dist/components/code-input.d.ts +6 -0
  15. package/dist/components/code-input.js +97 -0
  16. package/dist/components/detail-row.d.ts +6 -0
  17. package/dist/components/detail-row.js +40 -0
  18. package/dist/components/divider.d.ts +6 -0
  19. package/dist/components/divider.js +18 -0
  20. package/dist/components/empty-state.d.ts +6 -0
  21. package/dist/components/empty-state.js +66 -0
  22. package/dist/components/feedback.d.ts +8 -0
  23. package/dist/components/feedback.js +85 -0
  24. package/dist/components/field-box.js +44 -0
  25. package/dist/components/field.js +43 -0
  26. package/dist/components/footer.d.ts +6 -0
  27. package/dist/components/footer.js +24 -0
  28. package/dist/components/grid.d.ts +7 -0
  29. package/dist/components/grid.js +98 -0
  30. package/dist/components/icon-artwork.js +74 -0
  31. package/dist/components/icon.d.ts +6 -0
  32. package/dist/components/icon.js +40 -0
  33. package/dist/components/image.d.ts +6 -0
  34. package/dist/components/image.js +40 -0
  35. package/dist/components/index.d.ts +30 -0
  36. package/dist/components/index.js +72 -0
  37. package/dist/components/input.d.ts +6 -0
  38. package/dist/components/input.js +86 -0
  39. package/dist/components/link.d.ts +6 -0
  40. package/dist/components/link.js +39 -0
  41. package/dist/components/list.d.ts +7 -0
  42. package/dist/components/list.js +143 -0
  43. package/dist/components/option-place.js +9 -0
  44. package/dist/components/option.d.ts +6 -0
  45. package/dist/components/option.js +43 -0
  46. package/dist/components/padding.d.ts +2 -0
  47. package/dist/components/padding.js +27 -0
  48. package/dist/components/pressable.js +17 -0
  49. package/dist/components/qr-code.d.ts +6 -0
  50. package/dist/components/qr-code.js +58 -0
  51. package/dist/components/scroll.d.ts +6 -0
  52. package/dist/components/scroll.js +55 -0
  53. package/dist/components/select.d.ts +6 -0
  54. package/dist/components/select.js +92 -0
  55. package/dist/components/sheet.d.ts +8 -0
  56. package/dist/components/sheet.js +105 -0
  57. package/dist/components/skeleton.d.ts +6 -0
  58. package/dist/components/skeleton.js +55 -0
  59. package/dist/components/spinner.d.ts +6 -0
  60. package/dist/components/spinner.js +48 -0
  61. package/dist/components/tabs.d.ts +7 -0
  62. package/dist/components/tabs.js +91 -0
  63. package/dist/components/text-area.d.ts +6 -0
  64. package/dist/components/text-area.js +42 -0
  65. package/dist/components/text.d.ts +6 -0
  66. package/dist/components/text.js +46 -0
  67. package/dist/components/toast.d.ts +6 -0
  68. package/dist/components/toast.js +56 -0
  69. package/dist/components/toggles.d.ts +9 -0
  70. package/dist/components/toggles.js +149 -0
  71. package/dist/components/tokens.js +37 -0
  72. package/dist/components/tones.js +24 -0
  73. package/dist/components/typed-text.js +28 -0
  74. package/dist/components/view.d.ts +6 -0
  75. package/dist/components/view.js +51 -0
  76. package/dist/index.d.ts +35 -0
  77. package/dist/index.js +35 -0
  78. package/dist/page-root.d.ts +2 -0
  79. package/dist/page-root.js +20 -0
  80. package/dist/portal.js +8 -0
  81. package/dist/react-host/19.3.0/react-dom-client.js +3 -0
  82. package/dist/react-host/19.3.0/react-dom.js +3 -0
  83. package/dist/react-host/19.3.0/react-host.js +59 -0
  84. package/dist/react-host/19.3.0/react-jsx-runtime.js +3 -0
  85. package/dist/react-host/19.3.0/react.js +3 -0
  86. package/dist/renderer.d.ts +17 -0
  87. package/dist/renderer.js +33 -0
  88. package/dist/root.d.ts +10 -0
  89. package/dist/root.js +51 -0
  90. package/dist/styles.css +95 -0
  91. package/dist/theme.d.ts +25 -0
  92. package/dist/theme.js +84 -0
  93. package/dist/types.d.ts +7 -0
  94. package/dist/vendor/@base-ui/react/checkbox/indicator/CheckboxIndicator.js +51 -0
  95. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRoot.js +265 -0
  96. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootContext.js +13 -0
  97. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootDataAttributes.js +11 -0
  98. package/dist/vendor/@base-ui/react/checkbox/utils/getCheckboxStateAttributesMapping.js +15 -0
  99. package/dist/vendor/@base-ui/react/checkbox-group/CheckboxGroupContext.js +10 -0
  100. package/dist/vendor/@base-ui/react/dialog/backdrop/DialogBackdrop.js +40 -0
  101. package/dist/vendor/@base-ui/react/dialog/close/DialogClose.js +39 -0
  102. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopup.js +92 -0
  103. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupCssVars.js +8 -0
  104. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupDataAttributes.js +7 -0
  105. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortal.js +38 -0
  106. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortalContext.js +13 -0
  107. package/dist/vendor/@base-ui/react/dialog/root/DialogRoot.js +16 -0
  108. package/dist/vendor/@base-ui/react/dialog/root/DialogRootContext.js +13 -0
  109. package/dist/vendor/@base-ui/react/dialog/root/useDialogRoot.js +77 -0
  110. package/dist/vendor/@base-ui/react/dialog/root/useRenderDialogRoot.js +65 -0
  111. package/dist/vendor/@base-ui/react/dialog/store/DialogStore.js +70 -0
  112. package/dist/vendor/@base-ui/react/dialog/title/DialogTitle.js +25 -0
  113. package/dist/vendor/@base-ui/react/dialog/utils/stateAttributesMapping.js +17 -0
  114. package/dist/vendor/@base-ui/react/field/control/FieldControlDataAttributes.js +11 -0
  115. package/dist/vendor/@base-ui/react/field/item/FieldItemContext.js +10 -0
  116. package/dist/vendor/@base-ui/react/field/root/useFieldValidation.js +18 -0
  117. package/dist/vendor/@base-ui/react/fieldset/root/FieldsetRootContext.js +13 -0
  118. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingFocusManager.js +477 -0
  119. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingPortal.js +165 -0
  120. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingRootStore.js +65 -0
  121. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingTree.js +22 -0
  122. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useDismiss.js +373 -0
  123. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.js +58 -0
  124. package/dist/vendor/@base-ui/react/floating-ui-react/utils/composite.js +40 -0
  125. package/dist/vendor/@base-ui/react/floating-ui-react/utils/constants.js +5 -0
  126. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createAttribute.js +6 -0
  127. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createEventEmitter.js +18 -0
  128. package/dist/vendor/@base-ui/react/floating-ui-react/utils/element.js +26 -0
  129. package/dist/vendor/@base-ui/react/floating-ui-react/utils/enqueueFocus.js +25 -0
  130. package/dist/vendor/@base-ui/react/floating-ui-react/utils/event.js +25 -0
  131. package/dist/vendor/@base-ui/react/floating-ui-react/utils/markOthers.js +116 -0
  132. package/dist/vendor/@base-ui/react/floating-ui-react/utils/nodes.js +16 -0
  133. package/dist/vendor/@base-ui/react/floating-ui-react/utils/tabbable.js +135 -0
  134. package/dist/vendor/@base-ui/react/internals/TransitionStatusDataAttributes.js +11 -0
  135. package/dist/vendor/@base-ui/react/internals/composite/composite.js +89 -0
  136. package/dist/vendor/@base-ui/react/internals/composite/constants.js +4 -0
  137. package/dist/vendor/@base-ui/react/internals/composite/item/CompositeItem.js +21 -0
  138. package/dist/vendor/@base-ui/react/internals/composite/item/useCompositeItem.js +31 -0
  139. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeList.js +180 -0
  140. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeListContext.js +15 -0
  141. package/dist/vendor/@base-ui/react/internals/composite/list/useCompositeListItem.js +54 -0
  142. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRoot.js +62 -0
  143. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRootContext.js +13 -0
  144. package/dist/vendor/@base-ui/react/internals/composite/root/useCompositeRoot.js +170 -0
  145. package/dist/vendor/@base-ui/react/internals/constants.js +18 -0
  146. package/dist/vendor/@base-ui/react/internals/createBaseUIEventDetails.js +40 -0
  147. package/dist/vendor/@base-ui/react/internals/direction-context/DirectionContext.js +10 -0
  148. package/dist/vendor/@base-ui/react/internals/field-constants/constants.js +33 -0
  149. package/dist/vendor/@base-ui/react/internals/field-register-control/useRegisterFieldControl.js +40 -0
  150. package/dist/vendor/@base-ui/react/internals/field-root-context/FieldRootContext.js +45 -0
  151. package/dist/vendor/@base-ui/react/internals/form-context/FormContext.js +18 -0
  152. package/dist/vendor/@base-ui/react/internals/getStateAttributesProps.js +17 -0
  153. package/dist/vendor/@base-ui/react/internals/labelable-provider/LabelableContext.js +24 -0
  154. package/dist/vendor/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.js +35 -0
  155. package/dist/vendor/@base-ui/react/internals/labelable-provider/useLabelableId.js +57 -0
  156. package/dist/vendor/@base-ui/react/internals/reason-parts.js +14 -0
  157. package/dist/vendor/@base-ui/react/internals/serializeValue.js +12 -0
  158. package/dist/vendor/@base-ui/react/internals/stateAttributesMapping.js +11 -0
  159. package/dist/vendor/@base-ui/react/internals/use-button/useButton.js +137 -0
  160. package/dist/vendor/@base-ui/react/internals/useAnimationsFinished.js +94 -0
  161. package/dist/vendor/@base-ui/react/internals/useBaseUiId.js +13 -0
  162. package/dist/vendor/@base-ui/react/internals/useOpenChangeComplete.js +28 -0
  163. package/dist/vendor/@base-ui/react/internals/useRenderElement.js +109 -0
  164. package/dist/vendor/@base-ui/react/internals/useTransitionStatus.js +70 -0
  165. package/dist/vendor/@base-ui/react/internals/useValueChanged.js +15 -0
  166. package/dist/vendor/@base-ui/react/merge-props/mergeProps.js +153 -0
  167. package/dist/vendor/@base-ui/react/radio/indicator/RadioIndicator.js +46 -0
  168. package/dist/vendor/@base-ui/react/radio/root/RadioRoot.js +179 -0
  169. package/dist/vendor/@base-ui/react/radio/root/RadioRootContext.js +13 -0
  170. package/dist/vendor/@base-ui/react/radio/root/RadioRootDataAttributes.js +11 -0
  171. package/dist/vendor/@base-ui/react/radio/utils/stateAttributesMapping.js +14 -0
  172. package/dist/vendor/@base-ui/react/radio-group/RadioGroup.js +170 -0
  173. package/dist/vendor/@base-ui/react/radio-group/RadioGroupContext.js +10 -0
  174. package/dist/vendor/@base-ui/react/switch/root/SwitchRoot.js +170 -0
  175. package/dist/vendor/@base-ui/react/switch/root/SwitchRootContext.js +13 -0
  176. package/dist/vendor/@base-ui/react/switch/root/SwitchRootDataAttributes.js +11 -0
  177. package/dist/vendor/@base-ui/react/switch/stateAttributesMapping.js +12 -0
  178. package/dist/vendor/@base-ui/react/switch/thumb/SwitchThumb.js +25 -0
  179. package/dist/vendor/@base-ui/react/tabs/list/TabsList.js +98 -0
  180. package/dist/vendor/@base-ui/react/tabs/list/TabsListContext.js +13 -0
  181. package/dist/vendor/@base-ui/react/tabs/root/TabsRoot.js +213 -0
  182. package/dist/vendor/@base-ui/react/tabs/root/TabsRootContext.js +16 -0
  183. package/dist/vendor/@base-ui/react/tabs/root/TabsRootDataAttributes.js +8 -0
  184. package/dist/vendor/@base-ui/react/tabs/root/stateAttributesMapping.js +5 -0
  185. package/dist/vendor/@base-ui/react/tabs/tab/TabsTab.js +137 -0
  186. package/dist/vendor/@base-ui/react/utils/CommonPopupDataAttributes.js +24 -0
  187. package/dist/vendor/@base-ui/react/utils/CommonTriggerDataAttributes.js +11 -0
  188. package/dist/vendor/@base-ui/react/utils/FocusGuard.js +32 -0
  189. package/dist/vendor/@base-ui/react/utils/InternalBackdrop.js +30 -0
  190. package/dist/vendor/@base-ui/react/utils/dispatchClickWithModifiers.js +25 -0
  191. package/dist/vendor/@base-ui/react/utils/popupStateMapping.js +22 -0
  192. package/dist/vendor/@base-ui/react/utils/popups/popupStoreUtils.js +247 -0
  193. package/dist/vendor/@base-ui/react/utils/popups/popupTriggerMap.js +96 -0
  194. package/dist/vendor/@base-ui/react/utils/popups/store.js +94 -0
  195. package/dist/vendor/@base-ui/react/utils/resolveClassName.js +13 -0
  196. package/dist/vendor/@base-ui/react/utils/resolveRef.js +11 -0
  197. package/dist/vendor/@base-ui/react/utils/resolveStyle.js +13 -0
  198. package/dist/vendor/@base-ui/react/utils/useFocusableWhenDisabled.js +30 -0
  199. package/dist/vendor/@base-ui/utils/addEventListener.js +12 -0
  200. package/dist/vendor/@base-ui/utils/createLogOnce.js +20 -0
  201. package/dist/vendor/@base-ui/utils/empty.js +6 -0
  202. package/dist/vendor/@base-ui/utils/error.js +5 -0
  203. package/dist/vendor/@base-ui/utils/fastHooks.js +68 -0
  204. package/dist/vendor/@base-ui/utils/formatErrorMessage.js +27 -0
  205. package/dist/vendor/@base-ui/utils/getDefaultFormSubmitter.js +25 -0
  206. package/dist/vendor/@base-ui/utils/getReactElementRef.js +14 -0
  207. package/dist/vendor/@base-ui/utils/inertValue.js +8 -0
  208. package/dist/vendor/@base-ui/utils/isElementDisabled.js +6 -0
  209. package/dist/vendor/@base-ui/utils/mergeCleanups.js +14 -0
  210. package/dist/vendor/@base-ui/utils/mergeObjects.js +11 -0
  211. package/dist/vendor/@base-ui/utils/owner.js +7 -0
  212. package/dist/vendor/@base-ui/utils/platform/engine.js +8 -0
  213. package/dist/vendor/@base-ui/utils/platform/env.js +6 -0
  214. package/dist/vendor/@base-ui/utils/platform/os.js +15 -0
  215. package/dist/vendor/@base-ui/utils/platform/screen-reader.js +9 -0
  216. package/dist/vendor/@base-ui/utils/platform/shared.js +36 -0
  217. package/dist/vendor/@base-ui/utils/reactVersion.js +8 -0
  218. package/dist/vendor/@base-ui/utils/safeReact.js +13 -0
  219. package/dist/vendor/@base-ui/utils/shadowDom.js +26 -0
  220. package/dist/vendor/@base-ui/utils/store/ReactStore.js +181 -0
  221. package/dist/vendor/@base-ui/utils/store/Store.js +102 -0
  222. package/dist/vendor/@base-ui/utils/store/useStore.js +97 -0
  223. package/dist/vendor/@base-ui/utils/useAnimationFrame.js +87 -0
  224. package/dist/vendor/@base-ui/utils/useControlled.js +52 -0
  225. package/dist/vendor/@base-ui/utils/useId.js +32 -0
  226. package/dist/vendor/@base-ui/utils/useIsoLayoutEffect.js +7 -0
  227. package/dist/vendor/@base-ui/utils/useMergedRefs.js +87 -0
  228. package/dist/vendor/@base-ui/utils/useOnMount.js +12 -0
  229. package/dist/vendor/@base-ui/utils/useRefWithInit.js +18 -0
  230. package/dist/vendor/@base-ui/utils/useScrollLock.js +206 -0
  231. package/dist/vendor/@base-ui/utils/useStableCallback.js +38 -0
  232. package/dist/vendor/@base-ui/utils/useTimeout.js +43 -0
  233. package/dist/vendor/@base-ui/utils/useValueAsRef.js +27 -0
  234. package/dist/vendor/@base-ui/utils/visuallyHidden.js +23 -0
  235. package/dist/vendor/@base-ui/utils/warn.js +5 -0
  236. package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +49 -0
  237. package/dist/vendor/uqr/dist/index.js +858 -0
  238. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +74 -0
  239. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +77 -0
  240. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +69 -0
  241. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +64 -0
  242. package/dist/vendor/use-sync-external-store/shim/index.js +11 -0
  243. package/dist/vendor/use-sync-external-store/shim/with-selector.js +11 -0
  244. package/package.json +61 -0
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { useIsoLayoutEffect } from "../../../../utils/useIsoLayoutEffect.js";
3
+ import { useCompositeListContext } from "./CompositeListContext.js";
4
+ import * as React from "react";
5
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
6
+ /**
7
+ * Used to register a list item and its index (DOM position) in the `CompositeList`.
8
+ */
9
+ function useCompositeListItem(params = {}) {
10
+ const { guess, label, metadata, textRef, index: externalIndex } = params;
11
+ const { register, unregister, subscribeMapChange, nextIndexRef } = useCompositeListContext();
12
+ const indexRef = React.useRef(-1);
13
+ const [internalIndex, setInternalIndex] = React.useState(externalIndex == null && guess ? () => {
14
+ if (indexRef.current === -1) {
15
+ const newIndex = nextIndexRef.current;
16
+ nextIndexRef.current += 1;
17
+ indexRef.current = newIndex;
18
+ }
19
+ return indexRef.current;
20
+ } : -1);
21
+ const index = externalIndex ?? internalIndex;
22
+ const componentRef = React.useRef(null);
23
+ const ref = React.useCallback((node) => {
24
+ const previousNode = componentRef.current;
25
+ if (previousNode) unregister(previousNode);
26
+ componentRef.current = node;
27
+ if (node) register(node, {
28
+ metadata: metadata ?? null,
29
+ index: externalIndex ?? null,
30
+ label,
31
+ textRef
32
+ });
33
+ }, [
34
+ externalIndex,
35
+ register,
36
+ unregister,
37
+ metadata,
38
+ label,
39
+ textRef
40
+ ]);
41
+ useIsoLayoutEffect(() => {
42
+ if (externalIndex != null) return;
43
+ return subscribeMapChange((map) => {
44
+ const i = componentRef.current ? map.get(componentRef.current)?.index : null;
45
+ if (i != null) setInternalIndex(i);
46
+ });
47
+ }, [externalIndex, subscribeMapChange]);
48
+ return {
49
+ ref,
50
+ index
51
+ };
52
+ }
53
+ //#endregion
54
+ export { useCompositeListItem };
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { EMPTY_ARRAY, EMPTY_OBJECT } from "../../../../utils/empty.js";
3
+ import { useRenderElement } from "../../useRenderElement.js";
4
+ import { CompositeRootContext } from "./CompositeRootContext.js";
5
+ import { CompositeList } from "../list/CompositeList.js";
6
+ import { useCompositeRoot } from "./useCompositeRoot.js";
7
+ import { useDirection } from "../../direction-context/DirectionContext.js";
8
+ import * as React from "react";
9
+ import { jsx } from "react/jsx-runtime";
10
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
11
+ function CompositeRoot(componentProps) {
12
+ const { render, className, style, refs = EMPTY_ARRAY, props = EMPTY_ARRAY, state = EMPTY_OBJECT, stateAttributesMapping, highlightedIndex: highlightedIndexProp, onHighlightedIndexChange: onHighlightedIndexChangeProp, orientation, grid, loopFocus, onLoop, enableHomeAndEndKeys, onMapChange: onMapChangeProp, stopEventPropagation = true, rootRef, disabledIndices, modifierKeys, highlightItemOnHover = false, tag = "div", ...elementProps } = componentProps;
13
+ const direction = useDirection();
14
+ const { props: defaultProps, highlightedIndex, onHighlightedIndexChange, elementsRef, onMapChange: onMapChangeUnwrapped, relayKeyboardEvent } = useCompositeRoot({
15
+ grid,
16
+ loopFocus,
17
+ onLoop,
18
+ orientation,
19
+ highlightedIndex: highlightedIndexProp,
20
+ onHighlightedIndexChange: onHighlightedIndexChangeProp,
21
+ rootRef,
22
+ stopEventPropagation,
23
+ enableHomeAndEndKeys,
24
+ direction,
25
+ disabledIndices,
26
+ modifierKeys
27
+ });
28
+ const element = useRenderElement(tag, componentProps, {
29
+ state,
30
+ ref: refs,
31
+ props: [
32
+ defaultProps,
33
+ ...props,
34
+ elementProps
35
+ ],
36
+ stateAttributesMapping
37
+ });
38
+ const contextValue = React.useMemo(() => ({
39
+ highlightedIndex,
40
+ onHighlightedIndexChange,
41
+ highlightItemOnHover,
42
+ relayKeyboardEvent
43
+ }), [
44
+ highlightedIndex,
45
+ onHighlightedIndexChange,
46
+ highlightItemOnHover,
47
+ relayKeyboardEvent
48
+ ]);
49
+ return /*#__PURE__*/ jsx(CompositeRootContext.Provider, {
50
+ value: contextValue,
51
+ children: /*#__PURE__*/ jsx(CompositeList, {
52
+ elementsRef,
53
+ onMapChange: (newMap) => {
54
+ onMapChangeProp?.(newMap);
55
+ onMapChangeUnwrapped(newMap);
56
+ },
57
+ children: element
58
+ })
59
+ });
60
+ }
61
+ //#endregion
62
+ export { CompositeRoot };
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import formatErrorMessage from "../../../../utils/formatErrorMessage.js";
3
+ import * as React from "react";
4
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
5
+ const CompositeRootContext = /*#__PURE__*/ React.createContext(void 0);
6
+ if (process.env.NODE_ENV !== "production") CompositeRootContext.displayName = "CompositeRootContext";
7
+ function useCompositeRootContext(optional = false) {
8
+ const context = React.useContext(CompositeRootContext);
9
+ if (context === void 0 && !optional) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage(16));
10
+ return context;
11
+ }
12
+ //#endregion
13
+ export { CompositeRootContext, useCompositeRootContext };
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ import { useMergedRefs } from "../../../../utils/useMergedRefs.js";
3
+ import { EMPTY_ARRAY } from "../../../../utils/empty.js";
4
+ import { useStableCallback } from "../../../../utils/useStableCallback.js";
5
+ import { useIsoLayoutEffect } from "../../../../utils/useIsoLayoutEffect.js";
6
+ import { getTarget } from "../../../../utils/shadowDom.js";
7
+ import { findNonDisabledListIndex, getMaxListIndex, getMinListIndex, isIndexOutOfListBounds, isListIndexDisabled } from "../../../floating-ui-react/utils/composite.js";
8
+ import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, COMPOSITE_KEYS, MODIFIER_KEYS, isNativeInput, scrollIntoViewIfNeeded } from "../composite.js";
9
+ import "../constants.js";
10
+ import { isElementDisabled } from "../../../../utils/isElementDisabled.js";
11
+ import * as React from "react";
12
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
13
+ function useCompositeRoot(params) {
14
+ const { loopFocus = true, orientation = "both", grid, onLoop, direction, highlightedIndex: externalHighlightedIndex, onHighlightedIndexChange: externalSetHighlightedIndex, rootRef: externalRef, enableHomeAndEndKeys = false, stopEventPropagation, disabledIndices, modifierKeys = EMPTY_ARRAY } = params;
15
+ const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);
16
+ const isGrid = grid != null;
17
+ const rootRef = React.useRef(null);
18
+ const mergedRef = useMergedRefs(rootRef, externalRef);
19
+ const elementsRef = React.useRef([]);
20
+ const hasSetDefaultIndexRef = React.useRef(false);
21
+ const highlightedElementRef = React.useRef(null);
22
+ const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
23
+ const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
24
+ highlightedElementRef.current = elementsRef.current[index] ?? null;
25
+ (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
26
+ if (shouldScrollIntoView) {
27
+ const newActiveItem = elementsRef.current[index];
28
+ scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
29
+ }
30
+ });
31
+ const onMapChange = useStableCallback((map) => {
32
+ if (map.size === 0) return;
33
+ if (hasSetDefaultIndexRef.current) {
34
+ const elements = elementsRef.current;
35
+ const nextIndex = elements.indexOf(highlightedElementRef.current);
36
+ if (nextIndex === -1) {
37
+ const replacement = elements[highlightedIndex];
38
+ if (!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices)) onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices));
39
+ else highlightedElementRef.current = replacement;
40
+ } else if (nextIndex !== highlightedIndex) onHighlightedIndexChange(nextIndex);
41
+ return;
42
+ }
43
+ hasSetDefaultIndexRef.current = true;
44
+ const sortedElements = Array.from(map.keys());
45
+ const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute("data-composite-item-active")) ?? null;
46
+ const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
47
+ if (activeIndex !== -1) onHighlightedIndexChange(activeIndex);
48
+ else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {
49
+ const firstEnabledIndex = findNonDisabledListIndex(sortedElements, { disabledIndices });
50
+ if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) onHighlightedIndexChange(firstEnabledIndex);
51
+ }
52
+ scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
53
+ });
54
+ useIsoLayoutEffect(() => {
55
+ if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) return;
56
+ const elements = elementsRef.current;
57
+ if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
58
+ const firstEnabledIndex = findNonDisabledListIndex(elements, { disabledIndices });
59
+ if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) onHighlightedIndexChange(firstEnabledIndex);
60
+ }
61
+ }, [
62
+ disabledIndices,
63
+ externalHighlightedIndex,
64
+ highlightedIndex,
65
+ elementsRef,
66
+ onHighlightedIndexChange
67
+ ]);
68
+ const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
69
+ if (!onLoop) return nextIndex;
70
+ return onLoop(event, prevIndex, nextIndex, elementsRef);
71
+ });
72
+ const onKeyDown = useStableCallback((event) => {
73
+ const isHomeOrEnd = event.key === "Home" || event.key === "End";
74
+ if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) return;
75
+ if (isModifierKeySet(event, modifierKeys)) return;
76
+ if (!rootRef.current) return;
77
+ const isRtl = direction === "rtl";
78
+ const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
79
+ const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
80
+ const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey;
81
+ const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey;
82
+ const target = getTarget(event.nativeEvent);
83
+ if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
84
+ const selectionStart = target.selectionStart;
85
+ const selectionEnd = target.selectionEnd;
86
+ const textContent = target.value;
87
+ if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) return;
88
+ if (event.key !== backwardKey && selectionStart < textContent.length) return;
89
+ if (event.key !== forwardKey && selectionStart > 0) return;
90
+ }
91
+ let nextIndex = highlightedIndex;
92
+ const minIndex = getMinListIndex(elementsRef, disabledIndices);
93
+ const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
94
+ if (grid != null) nextIndex = grid({
95
+ disabledIndices,
96
+ elementsRef,
97
+ event,
98
+ highlightedIndex,
99
+ loopFocus,
100
+ maxIndex,
101
+ minIndex,
102
+ onLoop: wrappedOnLoop,
103
+ orientation,
104
+ rtl: isRtl
105
+ });
106
+ const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === "ArrowDown";
107
+ const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === "ArrowUp";
108
+ if (enableHomeAndEndKeys) {
109
+ if (event.key === "Home") nextIndex = minIndex;
110
+ else if (event.key === "End") nextIndex = maxIndex;
111
+ }
112
+ if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {
113
+ if (loopFocus && nextIndex === maxIndex && isForwardKey) {
114
+ nextIndex = minIndex;
115
+ if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
116
+ } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {
117
+ nextIndex = maxIndex;
118
+ if (onLoop) nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
119
+ } else nextIndex = findNonDisabledListIndex(elementsRef.current, {
120
+ startingIndex: nextIndex,
121
+ decrement: isBackwardKey,
122
+ disabledIndices
123
+ });
124
+ }
125
+ if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
126
+ if (stopEventPropagation) event.stopPropagation();
127
+ if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) event.preventDefault();
128
+ onHighlightedIndexChange(nextIndex, true);
129
+ queueMicrotask(() => {
130
+ elementsRef.current[nextIndex]?.focus();
131
+ });
132
+ }
133
+ });
134
+ return {
135
+ props: {
136
+ ref: mergedRef,
137
+ onFocus(event) {
138
+ const element = rootRef.current;
139
+ const target = getTarget(event.nativeEvent);
140
+ if (!element || target == null || !isNativeInput(target)) return;
141
+ target.setSelectionRange(0, target.value.length);
142
+ },
143
+ onKeyDown
144
+ },
145
+ highlightedIndex,
146
+ onHighlightedIndexChange,
147
+ elementsRef,
148
+ onMapChange,
149
+ relayKeyboardEvent: onKeyDown
150
+ };
151
+ }
152
+ function getFallbackIndex(elements, disabledIndices) {
153
+ let fallbackIndex = -1;
154
+ for (let index = 0; index < elements.length; index += 1) {
155
+ const element = elements[index];
156
+ if (!element || isListIndexDisabled(elements, index, disabledIndices)) continue;
157
+ if (element.hasAttribute("data-composite-item-active")) return index;
158
+ if (fallbackIndex === -1) fallbackIndex = index;
159
+ }
160
+ return Math.max(fallbackIndex, 0);
161
+ }
162
+ function isModifierKeySet(event, ignoredModifierKeys) {
163
+ for (const key of MODIFIER_KEYS) {
164
+ if (ignoredModifierKeys.includes(key)) continue;
165
+ if (event.getModifierState(key)) return true;
166
+ }
167
+ return false;
168
+ }
169
+ //#endregion
170
+ export { useCompositeRoot };
@@ -0,0 +1,18 @@
1
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/constants.mjs
2
+ const CLICK_TRIGGER_IDENTIFIER = "data-base-ui-click-trigger";
3
+ const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
4
+ const LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
5
+ /**
6
+ * Special visually hidden styles for the aria-owns owner element to ensure owned element
7
+ * accessibility in iOS/Safari/VoiceControl.
8
+ * The owner element is an empty span, so most of the common visually hidden styles are not needed.
9
+ * @see https://github.com/floating-ui/floating-ui/issues/3403
10
+ */
11
+ const ownerVisuallyHidden = {
12
+ clipPath: "inset(50%)",
13
+ position: "fixed",
14
+ top: 0,
15
+ left: 0
16
+ };
17
+ //#endregion
18
+ export { BASE_UI_SWIPE_IGNORE_ATTRIBUTE, CLICK_TRIGGER_IDENTIFIER, LEGACY_SWIPE_IGNORE_ATTRIBUTE, ownerVisuallyHidden };
@@ -0,0 +1,40 @@
1
+ import { EMPTY_OBJECT } from "../../utils/empty.js";
2
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
3
+ /**
4
+ * Maps a change `reason` string to the corresponding native event type.
5
+ */
6
+ /**
7
+ * Details of custom change events emitted by Base UI components.
8
+ */
9
+ /**
10
+ * Details of custom generic events emitted by Base UI components.
11
+ */
12
+ /**
13
+ * Creates a Base UI event details object with the given reason and utilities
14
+ * for preventing Base UI's internal event handling.
15
+ */
16
+ function createChangeEventDetails(reason, event, trigger, customProperties) {
17
+ let canceled = false;
18
+ let allowPropagation = false;
19
+ const custom = customProperties ?? EMPTY_OBJECT;
20
+ return {
21
+ reason,
22
+ event: event ?? new Event("base-ui"),
23
+ cancel() {
24
+ canceled = true;
25
+ },
26
+ allowPropagation() {
27
+ allowPropagation = true;
28
+ },
29
+ get isCanceled() {
30
+ return canceled;
31
+ },
32
+ get isPropagationAllowed() {
33
+ return allowPropagation;
34
+ },
35
+ trigger,
36
+ ...custom
37
+ };
38
+ }
39
+ //#endregion
40
+ export { createChangeEventDetails };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
4
+ const DirectionContext = /*#__PURE__*/ React.createContext(void 0);
5
+ if (process.env.NODE_ENV !== "production") DirectionContext.displayName = "DirectionContext";
6
+ function useDirection() {
7
+ return React.useContext(DirectionContext)?.direction ?? "ltr";
8
+ }
9
+ //#endregion
10
+ export { DirectionContext, useDirection };
@@ -0,0 +1,33 @@
1
+ import { invalid, valid } from "../../field/control/FieldControlDataAttributes.js";
2
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-constants/constants.mjs
3
+ const DEFAULT_VALIDITY_STATE = {
4
+ badInput: false,
5
+ customError: false,
6
+ patternMismatch: false,
7
+ rangeOverflow: false,
8
+ rangeUnderflow: false,
9
+ stepMismatch: false,
10
+ tooLong: false,
11
+ tooShort: false,
12
+ typeMismatch: false,
13
+ valid: null,
14
+ valueMissing: false
15
+ };
16
+ const DEFAULT_FIELD_STATE_ATTRIBUTES = {
17
+ valid: null,
18
+ touched: false,
19
+ dirty: false,
20
+ filled: false,
21
+ focused: false
22
+ };
23
+ const DEFAULT_FIELD_ROOT_STATE = {
24
+ disabled: false,
25
+ ...DEFAULT_FIELD_STATE_ATTRIBUTES
26
+ };
27
+ const fieldValidityMapping = { valid(value) {
28
+ if (value === null) return null;
29
+ if (value) return { [valid]: "" };
30
+ return { [invalid]: "" };
31
+ } };
32
+ //#endregion
33
+ export { DEFAULT_FIELD_ROOT_STATE, DEFAULT_FIELD_STATE_ATTRIBUTES, DEFAULT_VALIDITY_STATE, fieldValidityMapping };
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { useRefWithInit } from "../../../utils/useRefWithInit.js";
3
+ import { useIsoLayoutEffect } from "../../../utils/useIsoLayoutEffect.js";
4
+ import { useFieldRootContext } from "../field-root-context/FieldRootContext.js";
5
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
6
+ function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name) {
7
+ const { registerFieldControl } = useFieldRootContext();
8
+ const sourceRef = useRefWithInit(() => Symbol());
9
+ useIsoLayoutEffect(() => {
10
+ const source = sourceRef.current;
11
+ if (!enabled) {
12
+ registerFieldControl(source, void 0);
13
+ return;
14
+ }
15
+ registerFieldControl(source, {
16
+ controlRef,
17
+ getValue: getFormValueOverride,
18
+ id,
19
+ name,
20
+ value
21
+ });
22
+ }, [
23
+ controlRef,
24
+ enabled,
25
+ getFormValueOverride,
26
+ id,
27
+ name,
28
+ registerFieldControl,
29
+ sourceRef,
30
+ value
31
+ ]);
32
+ useIsoLayoutEffect(() => {
33
+ const source = sourceRef.current;
34
+ return () => {
35
+ registerFieldControl(source, void 0);
36
+ };
37
+ }, [registerFieldControl, sourceRef]);
38
+ }
39
+ //#endregion
40
+ export { useRegisterFieldControl };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import formatErrorMessage from "../../../utils/formatErrorMessage.js";
3
+ import { EMPTY_OBJECT, NOOP } from "../../../utils/empty.js";
4
+ import { DEFAULT_FIELD_ROOT_STATE, DEFAULT_VALIDITY_STATE } from "../field-constants/constants.js";
5
+ import * as React from "react";
6
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
7
+ const DEFAULT_FIELD_ROOT_CONTEXT = {
8
+ invalid: void 0,
9
+ name: void 0,
10
+ validityData: {
11
+ state: DEFAULT_VALIDITY_STATE,
12
+ errors: [],
13
+ error: "",
14
+ value: "",
15
+ initialValue: null
16
+ },
17
+ setValidityData: NOOP,
18
+ disabled: void 0,
19
+ setTouched: NOOP,
20
+ setDirty: NOOP,
21
+ setFilled: NOOP,
22
+ setFocused: NOOP,
23
+ validationMode: "onSubmit",
24
+ shouldValidateOnChange: () => false,
25
+ state: DEFAULT_FIELD_ROOT_STATE,
26
+ registerFieldControl: NOOP,
27
+ validation: {
28
+ getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
29
+ inputRef: { current: null },
30
+ registeredInputs: /* @__PURE__ */ new Map(),
31
+ registerInput: NOOP,
32
+ getInputControl: () => null,
33
+ commit: async () => {},
34
+ change: NOOP
35
+ }
36
+ };
37
+ const FieldRootContext = /*#__PURE__*/ React.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
38
+ if (process.env.NODE_ENV !== "production") FieldRootContext.displayName = "FieldRootContext";
39
+ function useFieldRootContext(optional = true) {
40
+ const context = React.useContext(FieldRootContext);
41
+ if (context.setValidityData === NOOP && !optional) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage(28));
42
+ return context;
43
+ }
44
+ //#endregion
45
+ export { DEFAULT_FIELD_ROOT_CONTEXT, FieldRootContext, useFieldRootContext };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { NOOP } from "../../../utils/empty.js";
3
+ import * as React from "react";
4
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/form-context/FormContext.mjs
5
+ const FormContext = /*#__PURE__*/ React.createContext({
6
+ elementRef: { current: null },
7
+ formRef: { current: { fields: /* @__PURE__ */ new Map() } },
8
+ errors: {},
9
+ clearErrors: NOOP,
10
+ validationMode: "onSubmit",
11
+ submitCountRef: { current: 0 }
12
+ });
13
+ if (process.env.NODE_ENV !== "production") FormContext.displayName = "FormContext";
14
+ function useFormContext() {
15
+ return React.useContext(FormContext);
16
+ }
17
+ //#endregion
18
+ export { FormContext, useFormContext };
@@ -0,0 +1,17 @@
1
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
2
+ function getStateAttributesProps(state, customMapping) {
3
+ const props = {};
4
+ for (const key in state) {
5
+ const value = state[key];
6
+ if (customMapping?.hasOwnProperty(key)) {
7
+ const customProps = customMapping[key](value);
8
+ if (customProps != null) Object.assign(props, customProps);
9
+ continue;
10
+ }
11
+ if (value === true) props[`data-${key.toLowerCase()}`] = "";
12
+ else if (value) props[`data-${key.toLowerCase()}`] = value.toString();
13
+ }
14
+ return props;
15
+ }
16
+ //#endregion
17
+ export { getStateAttributesProps };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { NOOP } from "../../../utils/empty.js";
3
+ import * as React from "react";
4
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
5
+ /**
6
+ * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\
7
+ * with an accessible name (label) and description.
8
+ */
9
+ const LabelableContext = /*#__PURE__*/ React.createContext({
10
+ controlId: void 0,
11
+ registerControlId: NOOP,
12
+ resetControlId: NOOP,
13
+ labelId: void 0,
14
+ setLabelId: NOOP,
15
+ messageIds: [],
16
+ setMessageIds: NOOP,
17
+ getDescriptionProps: (externalProps) => externalProps
18
+ });
19
+ if (process.env.NODE_ENV !== "production") LabelableContext.displayName = "LabelableContext";
20
+ function useLabelableContext() {
21
+ return React.useContext(LabelableContext);
22
+ }
23
+ //#endregion
24
+ export { LabelableContext, useLabelableContext };
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useIsoLayoutEffect } from "../../../utils/useIsoLayoutEffect.js";
3
+ import { useBaseUiId } from "../useBaseUiId.js";
4
+ import * as React from "react";
5
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.mjs
6
+ function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {
7
+ const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();
8
+ const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : void 0);
9
+ const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;
10
+ useIsoLayoutEffect(() => {
11
+ const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? void 0 : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);
12
+ if (fallbackAriaLabelledBy !== nextAriaLabelledBy) setFallbackAriaLabelledBy(nextAriaLabelledBy);
13
+ });
14
+ return ariaLabelledBy;
15
+ }
16
+ function getAriaLabelledBy(labelSource, generatedLabelId) {
17
+ const label = findAssociatedLabel(labelSource);
18
+ if (!label) return;
19
+ if (!label.id && generatedLabelId) label.id = generatedLabelId;
20
+ return label.id || void 0;
21
+ }
22
+ function findAssociatedLabel(labelSource) {
23
+ if (!labelSource) return;
24
+ const parent = labelSource.parentElement;
25
+ if (parent && parent.tagName === "LABEL") return parent;
26
+ const controlId = labelSource.id;
27
+ if (controlId) {
28
+ const nextSibling = labelSource.nextElementSibling;
29
+ if (nextSibling && nextSibling.htmlFor === controlId) return nextSibling;
30
+ }
31
+ const labels = labelSource.labels;
32
+ return labels && labels[0];
33
+ }
34
+ //#endregion
35
+ export { useAriaLabelledBy };
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { useRefWithInit } from "../../../utils/useRefWithInit.js";
3
+ import { NOOP } from "../../../utils/empty.js";
4
+ import { useStableCallback } from "../../../utils/useStableCallback.js";
5
+ import { useIsoLayoutEffect } from "../../../utils/useIsoLayoutEffect.js";
6
+ import { useBaseUiId } from "../useBaseUiId.js";
7
+ import { useLabelableContext } from "./LabelableContext.js";
8
+ import * as React from "react";
9
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
10
+ function useLabelableId(params = {}) {
11
+ const { id, enabled = true } = params;
12
+ const { controlId, registerControlId, resetControlId } = useLabelableContext();
13
+ const defaultId = useBaseUiId();
14
+ const controlSourceRef = useRefWithInit(() => Symbol());
15
+ const hasRegisteredRef = React.useRef(false);
16
+ const hadExplicitIdRef = React.useRef(false);
17
+ const unregisterControlId = useStableCallback(() => {
18
+ if (!hasRegisteredRef.current || registerControlId === NOOP) return;
19
+ hasRegisteredRef.current = false;
20
+ registerControlId(controlSourceRef.current, void 0);
21
+ });
22
+ useIsoLayoutEffect(() => {
23
+ if (!enabled || registerControlId === NOOP) {
24
+ unregisterControlId();
25
+ return;
26
+ }
27
+ let nextId;
28
+ if (id !== void 0) {
29
+ hadExplicitIdRef.current = true;
30
+ nextId = id;
31
+ } else if (hadExplicitIdRef.current) nextId = defaultId;
32
+ else {
33
+ resetControlId();
34
+ return;
35
+ }
36
+ if (nextId === void 0) {
37
+ unregisterControlId();
38
+ return;
39
+ }
40
+ hasRegisteredRef.current = true;
41
+ registerControlId(controlSourceRef.current, nextId);
42
+ }, [
43
+ id,
44
+ enabled,
45
+ registerControlId,
46
+ resetControlId,
47
+ defaultId,
48
+ controlSourceRef,
49
+ unregisterControlId
50
+ ]);
51
+ useIsoLayoutEffect(() => {
52
+ return unregisterControlId;
53
+ }, [unregisterControlId]);
54
+ return (enabled ? controlId : void 0) ?? id ?? defaultId;
55
+ }
56
+ //#endregion
57
+ export { useLabelableId };
@@ -0,0 +1,14 @@
1
+ //#region ../../../node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/internals/reason-parts.mjs
2
+ const none = "none";
3
+ const triggerPress = "trigger-press";
4
+ const triggerHover = "trigger-hover";
5
+ const outsidePress = "outside-press";
6
+ const closePress = "close-press";
7
+ const focusOut = "focus-out";
8
+ const escapeKey = "escape-key";
9
+ const disabled = "disabled";
10
+ const missing = "missing";
11
+ const initial = "initial";
12
+ const imperativeAction = "imperative-action";
13
+ //#endregion
14
+ export { closePress, disabled, escapeKey, focusOut, imperativeAction, initial, missing, none, outsidePress, triggerHover, triggerPress };