@rpcbase/ui 0.246.0 → 0.248.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.
Files changed (177) hide show
  1. package/dist/components/Notifications/NotificationsDrawer.d.ts.map +1 -1
  2. package/dist/index10.js +2 -2
  3. package/dist/index106.js +1 -1
  4. package/dist/index11.js +2 -2
  5. package/dist/index12.js +3 -3
  6. package/dist/index13.js +2 -2
  7. package/dist/index14.js +2 -2
  8. package/dist/index15.js +2 -2
  9. package/dist/index16.js +158 -158
  10. package/dist/index16.js.map +1 -1
  11. package/dist/index167.js +3 -3
  12. package/dist/index17.js +1 -1
  13. package/dist/index172.js +6 -6
  14. package/dist/index178.js +1 -1
  15. package/dist/index18.js +7 -7
  16. package/dist/index184.js +1 -1
  17. package/dist/index185.js +1 -1
  18. package/dist/index186.js +1 -1
  19. package/dist/index187.js +1 -1
  20. package/dist/index188.js +2 -2
  21. package/dist/index189.js +3 -3
  22. package/dist/index19.js +16 -16
  23. package/dist/index21.js +1 -1
  24. package/dist/index22.js +2 -2
  25. package/dist/index23.js +1 -1
  26. package/dist/index24.js +1 -1
  27. package/dist/index246.js +1 -1
  28. package/dist/index25.js +1 -1
  29. package/dist/index252.js +1 -1
  30. package/dist/index272.js +2 -2
  31. package/dist/index277.js +1 -1
  32. package/dist/index278.js +1 -1
  33. package/dist/index28.js +2 -2
  34. package/dist/index282.js +1 -1
  35. package/dist/index287.js +1 -1
  36. package/dist/index29.js +56 -3
  37. package/dist/index29.js.map +1 -1
  38. package/dist/index293.js +1 -1
  39. package/dist/index3.js +2 -2
  40. package/dist/index30.js +3 -242
  41. package/dist/index30.js.map +1 -1
  42. package/dist/index302.js +1 -1
  43. package/dist/index31.js +239 -21
  44. package/dist/index31.js.map +1 -1
  45. package/dist/index32.js +23 -4
  46. package/dist/index32.js.map +1 -1
  47. package/dist/index321.js +2 -2
  48. package/dist/index33.js +3 -6
  49. package/dist/index33.js.map +1 -1
  50. package/dist/index334.js +1 -1
  51. package/dist/index338.js +8 -24
  52. package/dist/index338.js.map +1 -1
  53. package/dist/index339.js +11 -28
  54. package/dist/index339.js.map +1 -1
  55. package/dist/index34.js +8 -38
  56. package/dist/index34.js.map +1 -1
  57. package/dist/index340.js +7 -15
  58. package/dist/index340.js.map +1 -1
  59. package/dist/index341.js +13 -8
  60. package/dist/index341.js.map +1 -1
  61. package/dist/index342.js +3 -11
  62. package/dist/index342.js.map +1 -1
  63. package/dist/index343.js +3 -8
  64. package/dist/index343.js.map +1 -1
  65. package/dist/index344.js +16 -12
  66. package/dist/index344.js.map +1 -1
  67. package/dist/index345.js +24 -3
  68. package/dist/index345.js.map +1 -1
  69. package/dist/index346.js +28 -3
  70. package/dist/index346.js.map +1 -1
  71. package/dist/index347.js +15 -16
  72. package/dist/index347.js.map +1 -1
  73. package/dist/index349.js +61 -5
  74. package/dist/index349.js.map +1 -1
  75. package/dist/index35.js +35 -74
  76. package/dist/index35.js.map +1 -1
  77. package/dist/index350.js +65 -60
  78. package/dist/index350.js.map +1 -1
  79. package/dist/index351.js +5 -66
  80. package/dist/index351.js.map +1 -1
  81. package/dist/index36.js +74 -20
  82. package/dist/index36.js.map +1 -1
  83. package/dist/index365.js +4 -12
  84. package/dist/index365.js.map +1 -1
  85. package/dist/index366.js +12 -4
  86. package/dist/index366.js.map +1 -1
  87. package/dist/index37.js +18 -33
  88. package/dist/index37.js.map +1 -1
  89. package/dist/index379.js +2 -2
  90. package/dist/index38.js +36 -26
  91. package/dist/index38.js.map +1 -1
  92. package/dist/index386.js +1 -1
  93. package/dist/index388.js +1 -1
  94. package/dist/index39.js +26 -21
  95. package/dist/index39.js.map +1 -1
  96. package/dist/index4.js +2 -2
  97. package/dist/index40.js +20 -56
  98. package/dist/index40.js.map +1 -1
  99. package/dist/index41.js +59 -51
  100. package/dist/index41.js.map +1 -1
  101. package/dist/index411.js +15 -3
  102. package/dist/index411.js.map +1 -1
  103. package/dist/index412.js +3 -15
  104. package/dist/index412.js.map +1 -1
  105. package/dist/index417.js +1 -1
  106. package/dist/index419.js +1 -1
  107. package/dist/index42.js +50 -21
  108. package/dist/index42.js.map +1 -1
  109. package/dist/index420.js +2 -2
  110. package/dist/index423.js +1 -1
  111. package/dist/index424.js +1 -1
  112. package/dist/index427.js +1 -1
  113. package/dist/index428.js +1 -1
  114. package/dist/index43.js +18 -127
  115. package/dist/index43.js.map +1 -1
  116. package/dist/index430.js +16 -2
  117. package/dist/index430.js.map +1 -1
  118. package/dist/index431.js +29 -2
  119. package/dist/index431.js.map +1 -1
  120. package/dist/index432.js +13 -2
  121. package/dist/index432.js.map +1 -1
  122. package/dist/index433.js +7 -2
  123. package/dist/index433.js.map +1 -1
  124. package/dist/index434.js +2 -16
  125. package/dist/index434.js.map +1 -1
  126. package/dist/index435.js +2 -29
  127. package/dist/index435.js.map +1 -1
  128. package/dist/index436.js +2 -13
  129. package/dist/index436.js.map +1 -1
  130. package/dist/index437.js +2 -7
  131. package/dist/index437.js.map +1 -1
  132. package/dist/index44.js +122 -39
  133. package/dist/index44.js.map +1 -1
  134. package/dist/index45.js +42 -85
  135. package/dist/index45.js.map +1 -1
  136. package/dist/index46.js +87 -123
  137. package/dist/index46.js.map +1 -1
  138. package/dist/index47.js +126 -5
  139. package/dist/index47.js.map +1 -1
  140. package/dist/index48.js +5 -332
  141. package/dist/index48.js.map +1 -1
  142. package/dist/index49.js +320 -245
  143. package/dist/index49.js.map +1 -1
  144. package/dist/index5.js +2 -2
  145. package/dist/index50.js +254 -23
  146. package/dist/index50.js.map +1 -1
  147. package/dist/index51.js +25 -129
  148. package/dist/index51.js.map +1 -1
  149. package/dist/index52.js +129 -24
  150. package/dist/index52.js.map +1 -1
  151. package/dist/index53.js +22 -19
  152. package/dist/index53.js.map +1 -1
  153. package/dist/index54.js +19 -134
  154. package/dist/index54.js.map +1 -1
  155. package/dist/index55.js +133 -30
  156. package/dist/index55.js.map +1 -1
  157. package/dist/index56.js +30 -24
  158. package/dist/index56.js.map +1 -1
  159. package/dist/index57.js +26 -38
  160. package/dist/index57.js.map +1 -1
  161. package/dist/index58.js +38 -18
  162. package/dist/index58.js.map +1 -1
  163. package/dist/index59.js +17 -132
  164. package/dist/index59.js.map +1 -1
  165. package/dist/index6.js +4 -4
  166. package/dist/index60.js +134 -49
  167. package/dist/index60.js.map +1 -1
  168. package/dist/index61.js +48 -25
  169. package/dist/index61.js.map +1 -1
  170. package/dist/index62.js +28 -57
  171. package/dist/index62.js.map +1 -1
  172. package/dist/index63.js +57 -56
  173. package/dist/index63.js.map +1 -1
  174. package/dist/index7.js +11 -11
  175. package/dist/index8.js +2 -2
  176. package/dist/index9.js +1 -1
  177. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index54.js","sources":["../../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nconst BOUNDARY_OFFSET = 2;\nconst SELECTED_DELAY = 400;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n setFocused,\n validationMode,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const {\n store,\n setOpen,\n selectionRef,\n validation,\n readOnly,\n required,\n alignItemWithTriggerActiveRef,\n disabled: selectDisabled\n } = useSelectRootContext();\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const value = useStore(store, selectors.value);\n const triggerProps = useStore(store, selectors.triggerProps);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const popupSideValue = useStore(store, selectors.popupSide);\n const rootId = useStore(store, selectors.id);\n const selectLabelId = useStore(store, selectors.labelId);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n // A mousedown on the trigger can open the popup under the cursor. Keep mouseup selection\n // disabled briefly so releasing over either the selected item or a neighboring item doesn't\n // commit an accidental selection. SelectItem can still opt into unselected mouseup sooner\n // after a real drag over the item.\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n selectionRef.current.allowSelectedMouseUp = true;\n });\n return () => {\n selectedDelayTimeout.clear();\n };\n }\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, selectionRef, timeoutMouseDown, selectedDelayTimeout]);\n const mergedProps = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && alignItemWithTriggerActiveRef.current) {\n setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Don't treat the release as an outside press when it lands on the trigger or inside\n // the popup positioner (or their children).\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerRef.current);\n if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {\n return;\n }\n setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, elementProps, getButtonProps);\n const props = validation.getValidationProps(disabled, mergedProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n popupSide,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef, buttonRef, setTriggerElement],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";"],"names":["BOUNDARY_OFFSET","SELECTED_DELAY","stateAttributesMapping","pressableTriggerOpenStateMapping","fieldValidityMapping","side","SelectTrigger","React","componentProps","forwardedRef","render","className","idProp","disabledProp","nativeButton","style","elementProps","setTouched","setFocused","validationMode","fieldState","fieldDisabled","useFieldRootContext","fieldLabelId","useLabelableContext","store","setOpen","selectionRef","validation","readOnly","required","alignItemWithTriggerActiveRef","selectDisabled","useSelectRootContext","disabled","open","useStore","selectors","mounted","value","triggerProps","positionerElement","listElement","popupSideValue","rootId","selectLabelId","hasSelectedValue","popupSide","id","ariaLabelledBy","resolveAriaLabelledBy","useLabelableId","positionerRef","useValueAsRef","triggerRef","getButtonProps","buttonRef","useButton","setTriggerElement","useStableCallback","element","timeoutFocus","useTimeout","timeoutMouseDown","selectedDelayTimeout","mergedProps","mergeProps","getFloatingFocusElement","event","createChangeEventDetails","REASONS.none","contains","doc","ownerDocument","handleMouseUp","mouseEvent","mouseUpTarget","bounds","getPseudoElementBounds","REASONS.cancelOpen","props","state","useRenderElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAkB,GAClBC,KAAiB,KACjBC,KAAyB;AAAA,EAC7B,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,WAAW,CAAAC,MAAQA,IAAO;AAAA,IACxB,mBAAmBA;AAAA,EACvB,IAAM;AAAA,EACJ,OAAO,MAAM;AACf,GAQaC,KAA6B,gBAAAC,EAAM,WAAW,SAAuBC,GAAgBC,GAAc;AAC9G,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,UAAUC,IAAe;AAAA,IACzB,cAAAC,IAAe;AAAA,IACf,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMR,GACE;AAAA,IACJ,YAAAS;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EACd,IAAMC,GAAmB,GACjB;AAAA,IACJ,SAASC;AAAA,EACb,IAAMC,GAAmB,GACjB;AAAA,IACJ,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,+BAAAC;AAAA,IACA,UAAUC;AAAA,EACd,IAAMC,GAAoB,GAClBC,IAAWb,KAAiBW,KAAkBnB,GAC9CsB,IAAOC,EAASX,GAAOY,EAAU,IAAI,GACrCC,IAAUF,EAASX,GAAOY,EAAU,OAAO,GAC3CE,IAAQH,EAASX,GAAOY,EAAU,KAAK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AiB,MAAM,GAAG,MAAM;AAC9B,QAAAS,GAAI,iBAAiB,WAAWE,IAAe;AAAA,UAC7C,MAAM;AAAA,QAChB,CAAS;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACJ,GAAK1D,GAAcuC,CAAc,GACzByB,IAAQpD,EAAW,mBAAmBM,GAAU+B,EAAW;AAIjE,EAAAe,EAAM,OAAO;AACb,QAAMC,KAAQ;AAAA,IACZ,GAAG7D;AAAA,IACH,MAAAe;AAAA,IACA,UAAAD;AAAA,IACA,OAAAK;AAAA,IACA,UAAAV;AAAA,IACA,WAAAkB;AAAA,IACA,aAAa,CAACD;AAAA,EAClB;AACE,SAAOoC,GAAiB,UAAU1E,GAAgB;AAAA,IAChD,KAAK,CAACC,GAAc6C,GAAYE,GAAWE,CAAiB;AAAA,IAC5D,OAAAuB;AAAA,IACA,wBAAA/E;AAAA,IACA,OAAA8E;AAAA,EACJ,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAc1E,GAAc,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index54.js","sources":["../../../node_modules/@base-ui/react/separator/Separator.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../internals/useRenderElement.mjs\";\n\n/**\n * A separator element accessible to screen readers.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)\n */\nexport const Separator = /*#__PURE__*/React.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {\n const {\n className,\n render,\n orientation = 'horizontal',\n style,\n ...elementProps\n } = componentProps;\n const state = {\n orientation\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'separator',\n 'aria-orientation': orientation\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") Separator.displayName = \"Separator\";"],"names":["Separator","React","componentProps","forwardedRef","className","render","orientation","style","elementProps","useRenderElement"],"mappings":";;AAWY,MAACA,IAAyB,gBAAAC,EAAM,WAAW,SAA4BC,GAAgBC,GAAc;AAC/G,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMN;AAYJ,SARgBO,EAAiB,OAAOP,GAAgB;AAAA,IACtD,OAJY;AAAA,MACZ,aAAAI;AAAA,IACJ;AAAA,IAGI,KAAKH;AAAA,IACL,OAAO,CAAC;AAAA,MACN,MAAM;AAAA,MACN,oBAAoBG;AAAA,IAC1B,GAAOE,CAAY;AAAA,EACnB,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcR,EAAU,cAAc;","x_google_ignoreList":[0]}
package/dist/index55.js CHANGED
@@ -1,38 +1,141 @@
1
- import * as b from "react";
2
- import { useRenderElement as v } from "./index172.js";
3
- import { useSelectRootContext as L } from "./index265.js";
4
- import { resolveMultipleLabels as N, resolveSelectedLabel as V } from "./index272.js";
5
- import { selectors as s } from "./index270.js";
6
- import { useStore as r } from "./index277.js";
7
- const y = {
1
+ import * as g from "react";
2
+ import { ownerDocument as se } from "./index284.js";
3
+ import { useTimeout as b } from "./index285.js";
4
+ import { useStableCallback as ie } from "./index262.js";
5
+ import { useValueAsRef as le } from "./index263.js";
6
+ import { useSelectRootContext as ae } from "./index265.js";
7
+ import { useFieldRootContext as ue } from "./index266.js";
8
+ import { useLabelableContext as ce } from "./index286.js";
9
+ import { pressableTriggerOpenStateMapping as de } from "./index173.js";
10
+ import { fieldValidityMapping as pe } from "./index287.js";
11
+ import { useRenderElement as me } from "./index172.js";
12
+ import { selectors as t } from "./index270.js";
13
+ import { getPseudoElementBounds as fe } from "./index288.js";
14
+ import { createChangeEventDetails as B } from "./index175.js";
15
+ import { useLabelableId as ge } from "./index268.js";
16
+ import { resolveAriaLabelledBy as be } from "./index289.js";
17
+ import { useStore as o } from "./index277.js";
18
+ import { useButton as Se } from "./index176.js";
19
+ import { mergeProps as Ee } from "./index282.js";
20
+ import { getFloatingFocusElement as Te } from "./index290.js";
21
+ import { contains as S } from "./index291.js";
22
+ import { none as Re, cancelOpen as Me } from "./index177.js";
23
+ const d = 2, De = 400, he = {
24
+ ...de,
25
+ ...pe,
26
+ popupSide: (p) => p ? {
27
+ "data-popup-side": p
28
+ } : null,
8
29
  value: () => null
9
- }, R = /* @__PURE__ */ b.forwardRef(function(c, m) {
30
+ }, ve = /* @__PURE__ */ g.forwardRef(function(E, L) {
10
31
  const {
11
- className: A,
12
- render: E,
13
- children: l,
14
- placeholder: n,
15
- style: x,
16
- ...p
17
- } = c, {
18
- store: t,
19
- valueRef: f
20
- } = L(), o = r(t, s.value), i = r(t, s.items), u = r(t, s.itemToStringLabel), a = r(t, s.hasSelectedValue), d = !a && n != null && l == null, h = r(t, s.hasNullItemLabel, d), S = {
21
- value: o,
22
- placeholder: !a
32
+ render: xe,
33
+ className: ye,
34
+ id: P,
35
+ disabled: U = !1,
36
+ nativeButton: w = !0,
37
+ style: Be,
38
+ ...F
39
+ } = E, {
40
+ setTouched: I,
41
+ setFocused: T,
42
+ validationMode: O,
43
+ state: V,
44
+ disabled: A
45
+ } = ue(), {
46
+ labelId: C
47
+ } = ce(), {
48
+ store: e,
49
+ setOpen: R,
50
+ selectionRef: i,
51
+ validation: M,
52
+ readOnly: D,
53
+ required: N,
54
+ alignItemWithTriggerActiveRef: Y,
55
+ disabled: _
56
+ } = ae(), l = A || _ || U, r = o(e, t.open), q = o(e, t.mounted), h = o(e, t.value), X = o(e, t.triggerProps), a = o(e, t.positionerElement), k = o(e, t.listElement), W = o(e, t.popupSide), j = o(e, t.id), z = o(e, t.labelId), G = o(e, t.hasSelectedValue), H = q && a ? W : null, v = P ?? j, J = be(C, z);
57
+ ge({
58
+ id: v
59
+ });
60
+ const K = le(a), u = g.useRef(null), {
61
+ getButtonProps: Q,
62
+ buttonRef: Z
63
+ } = Se({
64
+ disabled: l,
65
+ native: w
66
+ }), $ = ie((n) => {
67
+ e.set("triggerElement", n);
68
+ }), ee = b(), m = b(), f = b();
69
+ g.useEffect(() => {
70
+ if (r)
71
+ return f.start(De, () => {
72
+ i.current.allowUnselectedMouseUp = !0, i.current.allowSelectedMouseUp = !0;
73
+ }), () => {
74
+ f.clear();
75
+ };
76
+ i.current = {
77
+ allowSelectedMouseUp: !1,
78
+ allowUnselectedMouseUp: !1,
79
+ dragY: 0
80
+ }, m.clear();
81
+ }, [r, i, m, f]);
82
+ const te = Ee(X, {
83
+ id: v,
84
+ role: "combobox",
85
+ "aria-expanded": r ? "true" : "false",
86
+ "aria-haspopup": "listbox",
87
+ "aria-controls": r ? k?.id ?? Te(a)?.id : void 0,
88
+ "aria-labelledby": J,
89
+ "aria-readonly": D || void 0,
90
+ "aria-required": N || void 0,
91
+ tabIndex: l ? -1 : 0,
92
+ onFocus(n) {
93
+ T(!0), r && Y.current && R(!1, B(Re, n.nativeEvent)), ee.start(0, () => {
94
+ e.set("forceMount", !0);
95
+ });
96
+ },
97
+ onBlur(n) {
98
+ S(a, n.relatedTarget) || (I(!0), T(!1), O === "onBlur" && M.commit(h));
99
+ },
100
+ onMouseDown(n) {
101
+ if (r)
102
+ return;
103
+ const re = se(n.currentTarget);
104
+ function ne(s) {
105
+ if (!u.current)
106
+ return;
107
+ const y = s.target;
108
+ if (S(u.current, y) || S(K.current, y))
109
+ return;
110
+ const c = fe(u.current);
111
+ s.clientX >= c.left - d && s.clientX <= c.right + d && s.clientY >= c.top - d && s.clientY <= c.bottom + d || R(!1, B(Me, s));
112
+ }
113
+ m.start(0, () => {
114
+ re.addEventListener("mouseup", ne, {
115
+ once: !0
116
+ });
117
+ });
118
+ }
119
+ }, F, Q), x = M.getValidationProps(l, te);
120
+ x.role = "combobox";
121
+ const oe = {
122
+ ...V,
123
+ open: r,
124
+ disabled: l,
125
+ value: h,
126
+ readOnly: D,
127
+ popupSide: H,
128
+ placeholder: !G
23
129
  };
24
- let e = null;
25
- return typeof l == "function" ? e = l(o) : l != null ? e = l : !a && n != null && !h ? e = n : Array.isArray(o) ? e = N(o, i, u) : e = V(o, i, u), v("span", c, {
26
- state: S,
27
- ref: [m, f],
28
- props: [{
29
- children: e
30
- }, p],
31
- stateAttributesMapping: y
130
+ return me("button", E, {
131
+ ref: [L, u, Z, $],
132
+ state: oe,
133
+ stateAttributesMapping: he,
134
+ props: x
32
135
  });
33
136
  });
34
- process.env.NODE_ENV !== "production" && (R.displayName = "SelectValue");
137
+ process.env.NODE_ENV !== "production" && (ve.displayName = "SelectTrigger");
35
138
  export {
36
- R as SelectValue
139
+ ve as SelectTrigger
37
140
  };
38
141
  //# sourceMappingURL=index55.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index55.js","sources":["../../../node_modules/@base-ui/react/select/value/SelectValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";"],"names":["stateAttributesMapping","SelectValue","React","componentProps","forwardedRef","className","render","childrenProp","placeholder","style","elementProps","store","valueRef","useSelectRootContext","value","useStore","selectors","items","itemToStringLabel","hasSelectedValue","shouldCheckNullItemLabel","hasNullLabel","state","children","resolveMultipleLabels","resolveSelectedLabel","useRenderElement"],"mappings":";;;;;;AAQA,MAAMA,IAAyB;AAAA,EAC7B,OAAO,MAAM;AACf,GAQaC,IAA2B,gBAAAC,EAAM,WAAW,SAAqBC,GAAgBC,GAAc;AAC1G,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC;AAAA,IACV,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMP,GACE;AAAA,IACJ,OAAAQ;AAAA,IACA,UAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClBC,IAAQC,EAASJ,GAAOK,EAAU,KAAK,GACvCC,IAAQF,EAASJ,GAAOK,EAAU,KAAK,GACvCE,IAAoBH,EAASJ,GAAOK,EAAU,iBAAiB,GAC/DG,IAAmBJ,EAASJ,GAAOK,EAAU,gBAAgB,GAC7DI,IAA2B,CAACD,KAAoBX,KAAe,QAAQD,KAAgB,MACvFc,IAAeN,EAASJ,GAAOK,EAAU,kBAAkBI,CAAwB,GACnFE,IAAQ;AAAA,IACZ,OAAAR;AAAA,IACA,aAAa,CAACK;AAAA,EAClB;AACE,MAAII,IAAW;AACf,SAAI,OAAOhB,KAAiB,aAC1BgB,IAAWhB,EAAaO,CAAK,IACpBP,KAAgB,OACzBgB,IAAWhB,IACF,CAACY,KAAoBX,KAAe,QAAQ,CAACa,IACtDE,IAAWf,IACF,MAAM,QAAQM,CAAK,IAC5BS,IAAWC,EAAsBV,GAAOG,GAAOC,CAAiB,IAEhEK,IAAWE,EAAqBX,GAAOG,GAAOC,CAAiB,GAEjDQ,EAAiB,QAAQvB,GAAgB;AAAA,IACvD,OAAAmB;AAAA,IACA,KAAK,CAAClB,GAAcQ,CAAQ;AAAA,IAC5B,OAAO,CAAC;AAAA,MACN,UAAAW;AAAA,IACN,GAAOb,CAAY;AAAA,IACf,wBAAAV;AAAA,EACJ,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcC,EAAY,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index55.js","sources":["../../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useFieldRootContext } from \"../../internals/field-root-context/FieldRootContext.mjs\";\nimport { useLabelableContext } from \"../../internals/labelable-provider/LabelableContext.mjs\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { fieldValidityMapping } from \"../../internals/field-constants/constants.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.mjs\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.mjs\";\nimport { mergeProps } from \"../../merge-props/index.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { useLabelableId } from \"../../internals/labelable-provider/useLabelableId.mjs\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.mjs\";\nconst BOUNDARY_OFFSET = 2;\nconst SELECTED_DELAY = 400;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n setFocused,\n validationMode,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const {\n store,\n setOpen,\n selectionRef,\n validation,\n readOnly,\n required,\n alignItemWithTriggerActiveRef,\n disabled: selectDisabled\n } = useSelectRootContext();\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const value = useStore(store, selectors.value);\n const triggerProps = useStore(store, selectors.triggerProps);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const popupSideValue = useStore(store, selectors.popupSide);\n const rootId = useStore(store, selectors.id);\n const selectLabelId = useStore(store, selectors.labelId);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n // A mousedown on the trigger can open the popup under the cursor. Keep mouseup selection\n // disabled briefly so releasing over either the selected item or a neighboring item doesn't\n // commit an accidental selection. SelectItem can still opt into unselected mouseup sooner\n // after a real drag over the item.\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n selectionRef.current.allowSelectedMouseUp = true;\n });\n return () => {\n selectedDelayTimeout.clear();\n };\n }\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false,\n dragY: 0\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, selectionRef, timeoutMouseDown, selectedDelayTimeout]);\n const mergedProps = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? listElement?.id ?? getFloatingFocusElement(positionerElement)?.id : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && alignItemWithTriggerActiveRef.current) {\n setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Don't treat the release as an outside press when it lands on the trigger or inside\n // the popup positioner (or their children).\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget)) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerRef.current);\n if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {\n return;\n }\n setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, elementProps, getButtonProps);\n const props = validation.getValidationProps(disabled, mergedProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n popupSide,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef, buttonRef, setTriggerElement],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";"],"names":["BOUNDARY_OFFSET","SELECTED_DELAY","stateAttributesMapping","pressableTriggerOpenStateMapping","fieldValidityMapping","side","SelectTrigger","React","componentProps","forwardedRef","render","className","idProp","disabledProp","nativeButton","style","elementProps","setTouched","setFocused","validationMode","fieldState","fieldDisabled","useFieldRootContext","fieldLabelId","useLabelableContext","store","setOpen","selectionRef","validation","readOnly","required","alignItemWithTriggerActiveRef","selectDisabled","useSelectRootContext","disabled","open","useStore","selectors","mounted","value","triggerProps","positionerElement","listElement","popupSideValue","rootId","selectLabelId","hasSelectedValue","popupSide","id","ariaLabelledBy","resolveAriaLabelledBy","useLabelableId","positionerRef","useValueAsRef","triggerRef","getButtonProps","buttonRef","useButton","setTriggerElement","useStableCallback","element","timeoutFocus","useTimeout","timeoutMouseDown","selectedDelayTimeout","mergedProps","mergeProps","getFloatingFocusElement","event","createChangeEventDetails","REASONS.none","contains","doc","ownerDocument","handleMouseUp","mouseEvent","mouseUpTarget","bounds","getPseudoElementBounds","REASONS.cancelOpen","props","state","useRenderElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAMA,IAAkB,GAClBC,KAAiB,KACjBC,KAAyB;AAAA,EAC7B,GAAGC;AAAA,EACH,GAAGC;AAAA,EACH,WAAW,CAAAC,MAAQA,IAAO;AAAA,IACxB,mBAAmBA;AAAA,EACvB,IAAM;AAAA,EACJ,OAAO,MAAM;AACf,GAQaC,KAA6B,gBAAAC,EAAM,WAAW,SAAuBC,GAAgBC,GAAc;AAC9G,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,UAAUC,IAAe;AAAA,IACzB,cAAAC,IAAe;AAAA,IACf,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMR,GACE;AAAA,IACJ,YAAAS;AAAA,IACA,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,OAAOC;AAAA,IACP,UAAUC;AAAA,EACd,IAAMC,GAAmB,GACjB;AAAA,IACJ,SAASC;AAAA,EACb,IAAMC,GAAmB,GACjB;AAAA,IACJ,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,+BAAAC;AAAA,IACA,UAAUC;AAAA,EACd,IAAMC,GAAoB,GAClBC,IAAWb,KAAiBW,KAAkBnB,GAC9CsB,IAAOC,EAASX,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EAAO,SAAS7E,KAG/M0B,EAAQ,IAAO2C,EAAyBU,IAAoBJ,CAAU,CAAC;AAAA,MACzE;AAGA,MAAAZ,EAAiB,MAAM,GAAG,MAAM;AAC9B,QAAAS,GAAI,iBAAiB,WAAWE,IAAe;AAAA,UAC7C,MAAM;AAAA,QAChB,CAAS;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACJ,GAAK1D,GAAcuC,CAAc,GACzByB,IAAQpD,EAAW,mBAAmBM,GAAU+B,EAAW;AAIjE,EAAAe,EAAM,OAAO;AACb,QAAMC,KAAQ;AAAA,IACZ,GAAG7D;AAAA,IACH,MAAAe;AAAA,IACA,UAAAD;AAAA,IACA,OAAAK;AAAA,IACA,UAAAV;AAAA,IACA,WAAAkB;AAAA,IACA,aAAa,CAACD;AAAA,EAClB;AACE,SAAOoC,GAAiB,UAAU1E,GAAgB;AAAA,IAChD,KAAK,CAACC,GAAc6C,GAAYE,GAAWE,CAAiB;AAAA,IAC5D,OAAAuB;AAAA,IACA,wBAAA/E;AAAA,IACA,OAAA8E;AAAA,EACJ,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAc1E,GAAc,cAAc;","x_google_ignoreList":[0]}
package/dist/index56.js CHANGED
@@ -1,32 +1,38 @@
1
- import * as s from "react";
2
- import { useRenderElement as p } from "./index172.js";
3
- import { useSelectRootContext as c } from "./index265.js";
4
- import { triggerOpenStateMapping as i } from "./index173.js";
5
- import { selectors as m } from "./index270.js";
6
- import { useStore as a } from "./index277.js";
7
- const l = /* @__PURE__ */ s.forwardRef(function(e, t) {
1
+ import * as b from "react";
2
+ import { useRenderElement as v } from "./index172.js";
3
+ import { useSelectRootContext as L } from "./index265.js";
4
+ import { resolveMultipleLabels as N, resolveSelectedLabel as V } from "./index272.js";
5
+ import { selectors as s } from "./index270.js";
6
+ import { useStore as r } from "./index277.js";
7
+ const y = {
8
+ value: () => null
9
+ }, R = /* @__PURE__ */ b.forwardRef(function(c, m) {
8
10
  const {
9
- render: d,
10
- className: u,
11
- style: S,
12
- ...o
13
- } = e, {
14
- store: r
15
- } = c(), n = {
16
- open: a(r, m.open)
11
+ className: A,
12
+ render: E,
13
+ children: l,
14
+ placeholder: n,
15
+ style: x,
16
+ ...p
17
+ } = c, {
18
+ store: t,
19
+ valueRef: f
20
+ } = L(), o = r(t, s.value), i = r(t, s.items), u = r(t, s.itemToStringLabel), a = r(t, s.hasSelectedValue), d = !a && n != null && l == null, h = r(t, s.hasNullItemLabel, d), S = {
21
+ value: o,
22
+ placeholder: !a
17
23
  };
18
- return p("span", e, {
19
- state: n,
20
- ref: t,
24
+ let e = null;
25
+ return typeof l == "function" ? e = l(o) : l != null ? e = l : !a && n != null && !h ? e = n : Array.isArray(o) ? e = N(o, i, u) : e = V(o, i, u), v("span", c, {
26
+ state: S,
27
+ ref: [m, f],
21
28
  props: [{
22
- "aria-hidden": !0,
23
- children: "▼"
24
- }, o],
25
- stateAttributesMapping: i
29
+ children: e
30
+ }, p],
31
+ stateAttributesMapping: y
26
32
  });
27
33
  });
28
- process.env.NODE_ENV !== "production" && (l.displayName = "SelectIcon");
34
+ process.env.NODE_ENV !== "production" && (R.displayName = "SelectValue");
29
35
  export {
30
- l as SelectIcon
36
+ R as SelectValue
31
37
  };
32
38
  //# sourceMappingURL=index56.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index56.js","sources":["../../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";"],"names":["SelectIcon","React","componentProps","forwardedRef","render","className","style","elementProps","store","useSelectRootContext","state","useStore","selectors","useRenderElement","triggerOpenStateMapping"],"mappings":";;;;;;AAeY,MAACA,IAA0B,gBAAAC,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AACxG,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAML,GACE;AAAA,IACJ,OAAAM;AAAA,EACJ,IAAMC,EAAoB,GAElBC,IAAQ;AAAA,IACZ,MAFWC,EAASH,GAAOI,EAAU,IAAI;AAAA,EAG7C;AAUE,SATgBC,EAAiB,QAAQX,GAAgB;AAAA,IACvD,OAAAQ;AAAA,IACA,KAAKP;AAAA,IACL,OAAO,CAAC;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA,IAChB,GAAOI,CAAY;AAAA,IACf,wBAAwBO;AAAA,EAC5B,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcd,EAAW,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index56.js","sources":["../../../node_modules/@base-ui/react/select/value/SelectValue.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../internals/resolveValueLabel.mjs\";\nimport { selectors } from \"../store.mjs\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";"],"names":["stateAttributesMapping","SelectValue","React","componentProps","forwardedRef","className","render","childrenProp","placeholder","style","elementProps","store","valueRef","useSelectRootContext","value","useStore","selectors","items","itemToStringLabel","hasSelectedValue","shouldCheckNullItemLabel","hasNullLabel","state","children","resolveMultipleLabels","resolveSelectedLabel","useRenderElement"],"mappings":";;;;;;AAQA,MAAMA,IAAyB;AAAA,EAC7B,OAAO,MAAM;AACf,GAQaC,IAA2B,gBAAAC,EAAM,WAAW,SAAqBC,GAAgBC,GAAc;AAC1G,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC;AAAA,IACV,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAMP,GACE;AAAA,IACJ,OAAAQ;AAAA,IACA,UAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClBC,IAAQC,EAASJ,GAAOK,EAAU,KAAK,GACvCC,IAAQF,EAASJ,GAAOK,EAAU,KAAK,GACvCE,IAAoBH,EAASJ,GAAOK,EAAU,iBAAiB,GAC/DG,IAAmBJ,EAASJ,GAAOK,EAAU,gBAAgB,GAC7DI,IAA2B,CAACD,KAAoBX,KAAe,QAAQD,KAAgB,MACvFc,IAAeN,EAASJ,GAAOK,EAAU,kBAAkBI,CAAwB,GACnFE,IAAQ;AAAA,IACZ,OAAAR;AAAA,IACA,aAAa,CAACK;AAAA,EAClB;AACE,MAAII,IAAW;AACf,SAAI,OAAOhB,KAAiB,aAC1BgB,IAAWhB,EAAaO,CAAK,IACpBP,KAAgB,OACzBgB,IAAWhB,IACF,CAACY,KAAoBX,KAAe,QAAQ,CAACa,IACtDE,IAAWf,IACF,MAAM,QAAQM,CAAK,IAC5BS,IAAWC,EAAsBV,GAAOG,GAAOC,CAAiB,IAEhEK,IAAWE,EAAqBX,GAAOG,GAAOC,CAAiB,GAEjDQ,EAAiB,QAAQvB,GAAgB;AAAA,IACvD,OAAAmB;AAAA,IACA,KAAK,CAAClB,GAAcQ,CAAQ;AAAA,IAC5B,OAAO,CAAC;AAAA,MACN,UAAAW;AAAA,IACN,GAAOb,CAAY;AAAA,IACf,wBAAAV;AAAA,EACJ,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcC,EAAY,cAAc;","x_google_ignoreList":[0]}
package/dist/index57.js CHANGED
@@ -1,44 +1,32 @@
1
- import * as u from "react";
2
- import { useStableCallback as S } from "./index262.js";
3
- import { useSelectRootContext as N } from "./index265.js";
4
- import { useSelectPositionerContext as L } from "./index295.js";
5
- import { useRenderElement as b } from "./index172.js";
6
- import { styleDisableScrollbar as h } from "./index302.js";
7
- import { LIST_FUNCTIONAL_STYLES as E } from "./index296.js";
8
- import { selectors as t } from "./index270.js";
9
- import { useStore as o } from "./index277.js";
10
- const R = /* @__PURE__ */ u.forwardRef(function(s, l) {
1
+ import * as s from "react";
2
+ import { useRenderElement as p } from "./index172.js";
3
+ import { useSelectRootContext as c } from "./index265.js";
4
+ import { triggerOpenStateMapping as i } from "./index173.js";
5
+ import { selectors as m } from "./index270.js";
6
+ import { useStore as a } from "./index277.js";
7
+ const l = /* @__PURE__ */ s.forwardRef(function(e, t) {
11
8
  const {
12
- render: g,
13
- className: x,
14
- style: y,
15
- ...i
16
- } = s, {
17
- store: e,
18
- scrollHandlerRef: c
19
- } = N(), {
20
- alignItemWithTriggerActive: n
21
- } = L(), m = o(e, t.hasScrollArrows), a = o(e, t.openMethod), p = o(e, t.multiple), d = {
22
- id: `${o(e, t.id)}-list`,
23
- role: "listbox",
24
- "aria-multiselectable": p || void 0,
25
- onScroll(r) {
26
- c.current?.(r.currentTarget);
27
- },
28
- ...n && {
29
- style: E
30
- },
31
- className: m && a !== "touch" ? h.className : void 0
32
- }, f = S((r) => {
33
- e.set("listElement", r);
34
- });
35
- return b("div", s, {
36
- ref: [l, f],
37
- props: [d, i]
9
+ render: d,
10
+ className: u,
11
+ style: S,
12
+ ...o
13
+ } = e, {
14
+ store: r
15
+ } = c(), n = {
16
+ open: a(r, m.open)
17
+ };
18
+ return p("span", e, {
19
+ state: n,
20
+ ref: t,
21
+ props: [{
22
+ "aria-hidden": !0,
23
+ children: "▼"
24
+ }, o],
25
+ stateAttributesMapping: i
38
26
  });
39
27
  });
40
- process.env.NODE_ENV !== "production" && (R.displayName = "SelectList");
28
+ process.env.NODE_ENV !== "production" && (l.displayName = "SelectIcon");
41
29
  export {
42
- R as SelectList
30
+ l as SelectIcon
43
31
  };
44
32
  //# sourceMappingURL=index57.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index57.js","sources":["../../../node_modules/@base-ui/react/select/list/SelectList.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n scrollHandlerRef\n } = useSelectRootContext();\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = useStore(store, selectors.hasScrollArrows);\n const openMethod = useStore(store, selectors.openMethod);\n const multiple = useStore(store, selectors.multiple);\n const id = useStore(store, selectors.id);\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n onScroll(event) {\n scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";"],"names":["SelectList","React","componentProps","forwardedRef","render","className","style","elementProps","store","scrollHandlerRef","useSelectRootContext","alignItemWithTriggerActive","useSelectPositionerContext","hasScrollArrows","useStore","selectors","openMethod","multiple","defaultProps","event","LIST_FUNCTIONAL_STYLES","styleDisableScrollbar","setListElement","useStableCallback","element","useRenderElement"],"mappings":";;;;;;;;;AAkBY,MAACA,IAA0B,gBAAAC,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AACxG,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAML,GACE;AAAA,IACJ,OAAAM;AAAA,IACA,kBAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClB;AAAA,IACJ,4BAAAC;AAAA,EACJ,IAAMC,EAA0B,GACxBC,IAAkBC,EAASN,GAAOO,EAAU,eAAe,GAC3DC,IAAaF,EAASN,GAAOO,EAAU,UAAU,GACjDE,IAAWH,EAASN,GAAOO,EAAU,QAAQ,GAE7CG,IAAe;AAAA,IACnB,IAAI,GAFKJ,EAASN,GAAOO,EAAU,EAAE,CAE5B;AAAA,IACT,MAAM;AAAA,IACN,wBAAwBE,KAAY;AAAA,IACpC,SAASE,GAAO;AACd,MAAAV,EAAiB,UAAUU,EAAM,aAAa;AAAA,IAChD;AAAA,IACA,GAAIR,KAA8B;AAAA,MAChC,OAAOS;AAAA,IACb;AAAA,IACI,WAAWP,KAAmBG,MAAe,UAAUK,EAAsB,YAAY;AAAA,EAC7F,GACQC,IAAiBC,EAAkB,CAAAC,MAAW;AAClD,IAAAhB,EAAM,IAAI,eAAegB,CAAO;AAAA,EAClC,CAAC;AACD,SAAOC,EAAiB,OAAOvB,GAAgB;AAAA,IAC7C,KAAK,CAACC,GAAcmB,CAAc;AAAA,IAClC,OAAO,CAACJ,GAAcX,CAAY;AAAA,EACtC,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcP,EAAW,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index57.js","sources":["../../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";"],"names":["SelectIcon","React","componentProps","forwardedRef","render","className","style","elementProps","store","useSelectRootContext","state","useStore","selectors","useRenderElement","triggerOpenStateMapping"],"mappings":";;;;;;AAeY,MAACA,IAA0B,gBAAAC,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AACxG,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAML,GACE;AAAA,IACJ,OAAAM;AAAA,EACJ,IAAMC,EAAoB,GAElBC,IAAQ;AAAA,IACZ,MAFWC,EAASH,GAAOI,EAAU,IAAI;AAAA,EAG7C;AAUE,SATgBC,EAAiB,QAAQX,GAAgB;AAAA,IACvD,OAAAQ;AAAA,IACA,KAAKP;AAAA,IACL,OAAO,CAAC;AAAA,MACN,eAAe;AAAA,MACf,UAAU;AAAA,IAChB,GAAOI,CAAY;AAAA,IACf,wBAAwBO;AAAA,EAC5B,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcd,EAAW,cAAc;","x_google_ignoreList":[0]}
package/dist/index58.js CHANGED
@@ -1,24 +1,44 @@
1
- import * as m from "react";
2
- import { SelectPortalContext as i } from "./index292.js";
3
- import { useSelectRootContext as u } from "./index265.js";
1
+ import * as u from "react";
2
+ import { useStableCallback as S } from "./index262.js";
3
+ import { useSelectRootContext as N } from "./index265.js";
4
+ import { useSelectPositionerContext as L } from "./index295.js";
5
+ import { useRenderElement as b } from "./index172.js";
6
+ import { styleDisableScrollbar as h } from "./index302.js";
7
+ import { LIST_FUNCTIONAL_STYLES as E } from "./index296.js";
4
8
  import { selectors as t } from "./index270.js";
5
- import { j as r } from "./index28.js";
6
- import { useStore as e } from "./index277.js";
7
- import { FloatingPortal as f } from "./index188.js";
8
- const a = /* @__PURE__ */ m.forwardRef(function(n, s) {
9
+ import { useStore as o } from "./index277.js";
10
+ const R = /* @__PURE__ */ u.forwardRef(function(s, l) {
9
11
  const {
10
- store: o
11
- } = u(), l = e(o, t.mounted), c = e(o, t.forceMount);
12
- return l || c ? /* @__PURE__ */ r.jsx(i.Provider, {
13
- value: !0,
14
- children: /* @__PURE__ */ r.jsx(f, {
15
- ref: s,
16
- ...n
17
- })
18
- }) : null;
12
+ render: g,
13
+ className: x,
14
+ style: y,
15
+ ...i
16
+ } = s, {
17
+ store: e,
18
+ scrollHandlerRef: c
19
+ } = N(), {
20
+ alignItemWithTriggerActive: n
21
+ } = L(), m = o(e, t.hasScrollArrows), a = o(e, t.openMethod), p = o(e, t.multiple), d = {
22
+ id: `${o(e, t.id)}-list`,
23
+ role: "listbox",
24
+ "aria-multiselectable": p || void 0,
25
+ onScroll(r) {
26
+ c.current?.(r.currentTarget);
27
+ },
28
+ ...n && {
29
+ style: E
30
+ },
31
+ className: m && a !== "touch" ? h.className : void 0
32
+ }, f = S((r) => {
33
+ e.set("listElement", r);
34
+ });
35
+ return b("div", s, {
36
+ ref: [l, f],
37
+ props: [d, i]
38
+ });
19
39
  });
20
- process.env.NODE_ENV !== "production" && (a.displayName = "SelectPortal");
40
+ process.env.NODE_ENV !== "production" && (R.displayName = "SelectList");
21
41
  export {
22
- a as SelectPortal
42
+ R as SelectList
23
43
  };
24
44
  //# sourceMappingURL=index58.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index58.js","sources":["../../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.mjs\";\nimport { SelectPortalContext } from \"./SelectPortalContext.mjs\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(SelectPortalContext.Provider, {\n value: true,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";"],"names":["SelectPortal","React","portalProps","forwardedRef","store","useSelectRootContext","mounted","useStore","selectors","forceMount","_jsx","SelectPortalContext","FloatingPortal"],"mappings":";;;;;;;AAiBY,MAACA,IAA4B,gBAAAC,EAAM,WAAW,SAAsBC,GAAaC,GAAc;AACzG,QAAM;AAAA,IACJ,OAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClBC,IAAUC,EAASH,GAAOI,EAAU,OAAO,GAC3CC,IAAaF,EAASH,GAAOI,EAAU,UAAU;AAEvD,SADqBF,KAAWG,IAIZC,gBAAAA,EAAAA,IAAKC,EAAoB,UAAU;AAAA,IACrD,OAAO;AAAA,IACP,UAAuBD,gBAAAA,EAAAA,IAAKE,GAAgB;AAAA,MAC1C,KAAKT;AAAA,MACL,GAAGD;AAAA,IACT,CAAK;AAAA,EACL,CAAG,IARQ;AASX,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcF,EAAa,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index58.js","sources":["../../../node_modules/@base-ui/react/select/list/SelectList.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { styleDisableScrollbar } from \"../../utils/styles.mjs\";\nimport { LIST_FUNCTIONAL_STYLES } from \"../popup/utils.mjs\";\nimport { selectors } from \"../store.mjs\";\n\n/**\n * A container for the select items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectList = /*#__PURE__*/React.forwardRef(function SelectList(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n scrollHandlerRef\n } = useSelectRootContext();\n const {\n alignItemWithTriggerActive\n } = useSelectPositionerContext();\n const hasScrollArrows = useStore(store, selectors.hasScrollArrows);\n const openMethod = useStore(store, selectors.openMethod);\n const multiple = useStore(store, selectors.multiple);\n const id = useStore(store, selectors.id);\n const defaultProps = {\n id: `${id}-list`,\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n onScroll(event) {\n scrollHandlerRef.current?.(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: LIST_FUNCTIONAL_STYLES\n }),\n className: hasScrollArrows && openMethod !== 'touch' ? styleDisableScrollbar.className : undefined\n };\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, setListElement],\n props: [defaultProps, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectList.displayName = \"SelectList\";"],"names":["SelectList","React","componentProps","forwardedRef","render","className","style","elementProps","store","scrollHandlerRef","useSelectRootContext","alignItemWithTriggerActive","useSelectPositionerContext","hasScrollArrows","useStore","selectors","openMethod","multiple","defaultProps","event","LIST_FUNCTIONAL_STYLES","styleDisableScrollbar","setListElement","useStableCallback","element","useRenderElement"],"mappings":";;;;;;;;;AAkBY,MAACA,IAA0B,gBAAAC,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AACxG,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAML,GACE;AAAA,IACJ,OAAAM;AAAA,IACA,kBAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClB;AAAA,IACJ,4BAAAC;AAAA,EACJ,IAAMC,EAA0B,GACxBC,IAAkBC,EAASN,GAAOO,EAAU,eAAe,GAC3DC,IAAaF,EAASN,GAAOO,EAAU,UAAU,GACjDE,IAAWH,EAASN,GAAOO,EAAU,QAAQ,GAE7CG,IAAe;AAAA,IACnB,IAAI,GAFKJ,EAASN,GAAOO,EAAU,EAAE,CAE5B;AAAA,IACT,MAAM;AAAA,IACN,wBAAwBE,KAAY;AAAA,IACpC,SAASE,GAAO;AACd,MAAAV,EAAiB,UAAUU,EAAM,aAAa;AAAA,IAChD;AAAA,IACA,GAAIR,KAA8B;AAAA,MAChC,OAAOS;AAAA,IACb;AAAA,IACI,WAAWP,KAAmBG,MAAe,UAAUK,EAAsB,YAAY;AAAA,EAC7F,GACQC,IAAiBC,EAAkB,CAAAC,MAAW;AAClD,IAAAhB,EAAM,IAAI,eAAegB,CAAO;AAAA,EAClC,CAAC;AACD,SAAOC,EAAiB,OAAOvB,GAAgB;AAAA,IAC7C,KAAK,CAACC,GAAcmB,CAAc;AAAA,IAClC,OAAO,CAACJ,GAAcX,CAAY;AAAA,EACtC,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcP,EAAW,cAAc;","x_google_ignoreList":[0]}