@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
package/dist/index51.js CHANGED
@@ -1,134 +1,30 @@
1
- import * as s from "react";
2
- import { useIsoLayoutEffect as U } from "./index261.js";
3
- import { useSelectRootContext as Q } from "./index265.js";
4
- import { useCompositeListItem as X, IndexGuessBehavior as Z } from "./index311.js";
5
- import { useRenderElement as $ } from "./index172.js";
6
- import { SelectItemContext as ee } from "./index312.js";
7
- import { selectors as a } from "./index270.js";
8
- import { createChangeEventDetails as M } from "./index175.js";
9
- import { compareItemEquality as te, removeItem as re } from "./index273.js";
10
- import { isVirtualClick as oe } from "./index313.js";
11
- import { j as ne } from "./index28.js";
12
- import { useStore as f } from "./index277.js";
13
- import { useButton as se } from "./index176.js";
14
- import { itemPress as g } from "./index177.js";
15
- const ie = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(k, D) {
1
+ import * as r from "react";
2
+ import { SelectGroupContext as c } from "./index314.js";
3
+ import { useRenderElement as p } from "./index172.js";
4
+ import { j as m } from "./index30.js";
5
+ const u = /* @__PURE__ */ r.forwardRef(function(t, s) {
16
6
  const {
17
- render: ce,
18
- className: le,
19
- style: ae,
20
- value: n = null,
21
- label: B,
22
- disabled: m = !1,
23
- nativeButton: A = !1,
24
- ...N
25
- } = k, l = s.useRef(null), d = X({
26
- label: B,
27
- textRef: l,
28
- indexGuessBehavior: Z.GuessFromOrder
29
- }), {
30
- store: r,
31
- itemProps: O,
32
- setOpen: Y,
33
- setValue: S,
34
- selectionRef: p,
35
- typingRef: V,
36
- valuesRef: w,
37
- multiple: v,
38
- selectedItemTextRef: C,
39
- disabled: j,
40
- readOnly: q
41
- } = Q(), I = f(r, a.isActive, d.index), F = f(r, a.open), i = f(r, a.isSelected, n), b = f(r, a.isSelectedByFocus, d.index), h = f(r, a.isItemEqualToValue), o = d.index, u = o !== -1, P = s.useRef(null);
42
- U(() => {
43
- if (!u)
44
- return;
45
- const e = w.current;
46
- return e[o] = n, () => {
47
- delete e[o];
48
- };
49
- }, [u, o, n, w]), U(() => {
50
- if (!u)
51
- return;
52
- const e = r.state.value;
53
- let t = e;
54
- v && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && te(n, t, h) && (r.set("selectedIndex", o), l.current && (C.current = l.current));
55
- }, [u, o, v, h, r, n, C]);
56
- const y = s.useRef(null), R = s.useRef("mouse"), c = s.useRef(!1), {
57
- getButtonProps: G,
58
- buttonRef: K
59
- } = se({
60
- disabled: m,
61
- focusableWhenDisabled: !0,
62
- native: A,
63
- composite: !0
64
- }), L = {
65
- disabled: m,
66
- selected: i,
67
- highlighted: I
68
- };
69
- function W(e) {
70
- if (j || q)
71
- return;
72
- const t = r.state.value;
73
- if (v) {
74
- const x = Array.isArray(t) ? t : [], E = i ? re(x, n, h) : [...x, n];
75
- S(E, M(g, e));
76
- } else
77
- S(n, M(g, e)), Y(!1, M(g, e));
78
- }
79
- function T() {
80
- p.current.dragY = 0;
81
- }
82
- const _ = {
83
- role: "option",
84
- "aria-selected": i,
85
- tabIndex: F && I ? 0 : -1,
86
- onKeyDown(e) {
87
- y.current = e.key, r.set("activeIndex", o), e.key === " " && V.current && e.preventDefault();
88
- },
89
- onClick(e) {
90
- const t = e.type === "click" && R.current !== "touch", x = e.nativeEvent.pointerType, E = t && oe(e.nativeEvent) && // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual
91
- // clicks that carry browser pointer data, including an empty string from assistive
92
- // technology, can activate unhighlighted items.
93
- (x !== void 0 || I), J = t && !E && !c.current;
94
- c.current = !1, !(e.type === "keydown" && y.current === null) && (m || e.type === "keydown" && y.current === " " && V.current || J || (y.current = null, W(e.nativeEvent)));
95
- },
96
- onPointerEnter(e) {
97
- R.current = e.pointerType;
98
- },
99
- onPointerMove(e) {
100
- if (e.pointerType === "mouse" && e.buttons === 1) {
101
- const t = p.current;
102
- t.dragY += e.movementY, t.dragY ** 2 >= 64 && (t.allowUnselectedMouseUp = !0);
103
- }
104
- },
105
- onPointerDown(e) {
106
- R.current = e.pointerType, c.current = !0, T();
107
- },
108
- onMouseUp() {
109
- if (T(), m || R.current === "touch" || c.current)
110
- return;
111
- const e = !p.current.allowSelectedMouseUp && i, t = !p.current.allowUnselectedMouseUp && !i;
112
- e || t || (c.current = !0, P.current?.click(), c.current = !1);
113
- }
114
- }, z = $("div", k, {
115
- ref: [K, D, d.ref, P],
116
- state: L,
117
- props: [O, _, N, G]
118
- }), H = s.useMemo(() => ({
119
- selected: i,
120
- index: o,
121
- textRef: l,
122
- selectedByFocus: b,
123
- hasRegistered: u
124
- }), [i, o, l, b, u]);
125
- return /* @__PURE__ */ ne.jsx(ee.Provider, {
126
- value: H,
127
- children: z
7
+ render: d,
8
+ className: f,
9
+ style: x,
10
+ ...l
11
+ } = t, [e, o] = r.useState(), n = r.useMemo(() => ({
12
+ labelId: e,
13
+ setLabelId: o
14
+ }), [e, o]), a = p("div", t, {
15
+ ref: s,
16
+ props: [{
17
+ role: "group",
18
+ "aria-labelledby": e
19
+ }, l]
128
20
  });
129
- }));
130
- process.env.NODE_ENV !== "production" && (ie.displayName = "SelectItem");
21
+ return /* @__PURE__ */ m.jsx(c.Provider, {
22
+ value: n,
23
+ children: a
24
+ });
25
+ });
26
+ process.env.NODE_ENV !== "production" && (u.displayName = "SelectGroup");
131
27
  export {
132
- ie as SelectItem
28
+ u as SelectGroup
133
29
  };
134
30
  //# sourceMappingURL=index51.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index51.js","sources":["../../../node_modules/@base-ui/react/select/item/SelectItem.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useCompositeListItem, IndexGuessBehavior } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { SelectItemContext } from \"./SelectItemContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { compareItemEquality, removeItem } from \"../../internals/itemEquality.mjs\";\nimport { isVirtualClick } from \"../../floating-ui-react/utils/event.mjs\";\n\n/**\n * An individual option in the select popup.\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 SelectItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n value: itemValue = null,\n label,\n disabled = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n label,\n textRef,\n indexGuessBehavior: IndexGuessBehavior.GuessFromOrder\n });\n const {\n store,\n itemProps,\n setOpen,\n setValue,\n selectionRef,\n typingRef,\n valuesRef,\n multiple,\n selectedItemTextRef,\n disabled: selectDisabled,\n readOnly\n } = useSelectRootContext();\n const highlighted = useStore(store, selectors.isActive, listItem.index);\n const open = useStore(store, selectors.open);\n const selected = useStore(store, selectors.isSelected, itemValue);\n const selectedByFocus = useStore(store, selectors.isSelectedByFocus, listItem.index);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const index = listItem.index;\n const hasRegistered = index !== -1;\n const itemRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return undefined;\n }\n const values = valuesRef.current;\n values[index] = itemValue;\n return () => {\n delete values[index];\n };\n }, [hasRegistered, index, itemValue, valuesRef]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return;\n }\n const selectedValue = store.state.value;\n let selectedCandidate = selectedValue;\n if (multiple && Array.isArray(selectedValue)) {\n // Compare against the last selected item, or `undefined` when nothing is selected — never\n // the raw array, which a custom `isItemEqualToValue` isn't expected to receive.\n selectedCandidate = selectedValue.length > 0 ? selectedValue[selectedValue.length - 1] : undefined;\n }\n if (selectedCandidate !== undefined && compareItemEquality(itemValue, selectedCandidate, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n // Make sure SelectPopup can measure the selected item on first open.\n // SelectItemText can still update this ref later when focus moves.\n if (textRef.current) {\n selectedItemTextRef.current = textRef.current;\n }\n }\n }, [hasRegistered, index, multiple, isItemEqualToValue, store, itemValue, selectedItemTextRef]);\n const lastKeyRef = React.useRef(null);\n const pointerTypeRef = React.useRef('mouse');\n const allowMouseSelectionRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(event) {\n // A forced-open select (`open`/`defaultOpen`) can still receive item activations even\n // when the root is disabled or read-only, so guard the commit here too.\n if (selectDisabled || readOnly) {\n return;\n }\n const selectedValue = store.state.value;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];\n setValue(nextValue, createChangeEventDetails(REASONS.itemPress, event));\n } else {\n setValue(itemValue, createChangeEventDetails(REASONS.itemPress, event));\n setOpen(false, createChangeEventDetails(REASONS.itemPress, event));\n }\n }\n function resetDragMovement() {\n selectionRef.current.dragY = 0;\n }\n const defaultProps = {\n role: 'option',\n 'aria-selected': selected,\n tabIndex: open && highlighted ? 0 : -1,\n onKeyDown(event) {\n lastKeyRef.current = event.key;\n store.set('activeIndex', index);\n if (event.key === ' ' && typingRef.current) {\n event.preventDefault();\n }\n },\n onClick(event) {\n const isMouseClick = event.type === 'click' && pointerTypeRef.current !== 'touch';\n const clickPointerType = event.nativeEvent.pointerType;\n const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (\n // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual\n // clicks that carry browser pointer data, including an empty string from assistive\n // technology, can activate unhighlighted items.\n clickPointerType !== undefined || highlighted);\n // With alignItemWithTrigger, opening can place an item under the cursor. Real mouse\n // clicks must start on the item, while virtual clicks represent explicit keyboard or\n // assistive technology activation.\n const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;\n allowMouseSelectionRef.current = false;\n\n // Prevent double commit on {Enter}\n if (event.type === 'keydown' && lastKeyRef.current === null) {\n return;\n }\n if (disabled || event.type === 'keydown' && lastKeyRef.current === ' ' && typingRef.current || isInvalidMouseClick) {\n return;\n }\n lastKeyRef.current = null;\n commitSelection(event.nativeEvent);\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerMove(event) {\n if (event.pointerType === 'mouse' && event.buttons === 1) {\n const selection = selectionRef.current;\n selection.dragY += event.movementY;\n if (selection.dragY ** 2 >= 64) {\n selection.allowUnselectedMouseUp = true;\n }\n }\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n allowMouseSelectionRef.current = true;\n resetDragMovement();\n },\n onMouseUp() {\n resetDragMovement();\n if (disabled || pointerTypeRef.current === 'touch') {\n return;\n }\n\n // Regular clicks are committed by the click event.\n if (allowMouseSelectionRef.current) {\n return;\n }\n const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;\n const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;\n if (disallowSelectedMouseUp || disallowUnselectedMouseUp) {\n return;\n }\n allowMouseSelectionRef.current = true;\n itemRef.current?.click();\n allowMouseSelectionRef.current = false;\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n index,\n textRef,\n selectedByFocus,\n hasRegistered\n }), [selected, index, textRef, selectedByFocus, hasRegistered]);\n return /*#__PURE__*/_jsx(SelectItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItem.displayName = \"SelectItem\";"],"names":["SelectItem","React","componentProps","forwardedRef","render","className","style","itemValue","label","disabled","nativeButton","elementProps","textRef","listItem","useCompositeListItem","IndexGuessBehavior","store","itemProps","setOpen","setValue","selectionRef","typingRef","valuesRef","multiple","selectedItemTextRef","selectDisabled","readOnly","useSelectRootContext","highlighted","useStore","selectors","open","selected","selectedByFocus","isItemEqualToValue","index","hasRegistered","itemRef","useIsoLayoutEffect","values","selectedValue","selectedCandidate","compareItemEquality","lastKeyRef","pointerTypeRef","allowMouseSelectionRef","getButtonProps","buttonRef","useButton","state","commitSelection","event","currentValue","nextValue","removeItem","createChangeEventDetails","REASONS.itemPress","resetDragMovement","defaultProps","isMouseClick","clickPointerType","isVirtualMouseClick","isVirtualClick","isInvalidMouseClick","selection","disallowSelectedMouseUp","disallowUnselectedMouseUp","element","useRenderElement","contextValue","_jsx","SelectItemContext"],"mappings":";;;;;;;;;;;;;;AAuBY,MAACA,KAA0B,gBAAAC,EAAM,KAAkB,gBAAAA,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AAChI,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAOC,IAAY;AAAA,IACnB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K,GACtBQ,EAAuB,UAAU;AAAA,IACnC;AAAA,EACJ,GACQsB,IAAUC,EAAiB,OAAOlE,GAAgB;AAAA,IACtD,KAAK,CAAC6C,GAAW5C,GAAcU,EAAS,KAAKwB,CAAO;AAAA,IACpD,OAAAY;AAAA,IACA,OAAO,CAAChC,GAAWyC,GAAc/C,GAAcmC,CAAc;AAAA,EACjE,CAAG,GACKuB,IAAepE,EAAM,QAAQ,OAAO;AAAA,IACxC,UAAA+B;AAAA,IACA,OAAAG;AAAA,IACA,SAAAvB;AAAA,IACA,iBAAAqB;AAAA,IACA,eAAAG;AAAA,EACJ,IAAM,CAACJ,GAAUG,GAAOvB,GAASqB,GAAiBG,CAAa,CAAC;AAC9D,SAAoBkC,gBAAAA,GAAAA,IAAKC,GAAkB,UAAU;AAAA,IACnD,OAAOF;AAAA,IACP,UAAUF;AAAA,EACd,CAAG;AACH,CAAC,CAAC;AACE,QAAQ,IAAI,aAAa,iBAAcnE,GAAW,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index51.js","sources":["../../../node_modules/@base-ui/react/select/group/SelectGroup.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { SelectGroupContext } from \"./SelectGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * Groups related select items with the corresponding label.\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 SelectGroup = /*#__PURE__*/React.forwardRef(function SelectGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const contextValue = React.useMemo(() => ({\n labelId,\n setLabelId\n }), [labelId, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'group',\n 'aria-labelledby': labelId\n }, elementProps]\n });\n return /*#__PURE__*/_jsx(SelectGroupContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroup.displayName = \"SelectGroup\";"],"names":["SelectGroup","React","componentProps","forwardedRef","render","className","style","elementProps","labelId","setLabelId","contextValue","element","useRenderElement","_jsx","SelectGroupContext"],"mappings":";;;;AAaY,MAACA,IAA2B,gBAAAC,EAAM,WAAW,SAAqBC,GAAgBC,GAAc;AAC1G,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EACP,IAAML,GACE,CAACM,GAASC,CAAU,IAAIR,EAAM,SAAQ,GACtCS,IAAeT,EAAM,QAAQ,OAAO;AAAA,IACxC,SAAAO;AAAA,IACA,YAAAC;AAAA,EACJ,IAAM,CAACD,GAASC,CAAU,CAAC,GACnBE,IAAUC,EAAiB,OAAOV,GAAgB;AAAA,IACtD,KAAKC;AAAA,IACL,OAAO,CAAC;AAAA,MACN,MAAM;AAAA,MACN,mBAAmBK;AAAA,IACzB,GAAOD,CAAY;AAAA,EACnB,CAAG;AACD,SAAoBM,gBAAAA,EAAAA,IAAKC,EAAmB,UAAU;AAAA,IACpD,OAAOJ;AAAA,IACP,UAAUC;AAAA,EACd,CAAG;AACH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcX,EAAY,cAAc;","x_google_ignoreList":[0]}
package/dist/index52.js CHANGED
@@ -1,29 +1,134 @@
1
- import * as m from "react";
2
- import { useIsoLayoutEffect as n } from "./index261.js";
3
- import { useBaseUiId as p } from "./index178.js";
4
- import { useSelectGroupContext as c } from "./index314.js";
5
- import { useRenderElement as i } from "./index172.js";
6
- const a = /* @__PURE__ */ m.forwardRef(function(o, r) {
1
+ import * as s from "react";
2
+ import { useIsoLayoutEffect as U } from "./index261.js";
3
+ import { useSelectRootContext as Q } from "./index265.js";
4
+ import { useCompositeListItem as X, IndexGuessBehavior as Z } from "./index311.js";
5
+ import { useRenderElement as $ } from "./index172.js";
6
+ import { SelectItemContext as ee } from "./index312.js";
7
+ import { selectors as a } from "./index270.js";
8
+ import { createChangeEventDetails as M } from "./index175.js";
9
+ import { compareItemEquality as te, removeItem as re } from "./index273.js";
10
+ import { isVirtualClick as oe } from "./index313.js";
11
+ import { j as ne } from "./index30.js";
12
+ import { useStore as f } from "./index277.js";
13
+ import { useButton as se } from "./index176.js";
14
+ import { itemPress as g } from "./index177.js";
15
+ const ie = /* @__PURE__ */ s.memo(/* @__PURE__ */ s.forwardRef(function(k, D) {
7
16
  const {
8
- render: u,
9
- className: d,
10
- style: L,
11
- id: s,
12
- ...l
13
- } = o, {
14
- setLabelId: t
15
- } = c(), e = p(s);
16
- return n(() => {
17
- t(e);
18
- }, [e, t]), i("div", o, {
19
- ref: r,
20
- props: [{
21
- id: e
22
- }, l]
17
+ render: ce,
18
+ className: le,
19
+ style: ae,
20
+ value: n = null,
21
+ label: B,
22
+ disabled: m = !1,
23
+ nativeButton: A = !1,
24
+ ...N
25
+ } = k, l = s.useRef(null), d = X({
26
+ label: B,
27
+ textRef: l,
28
+ indexGuessBehavior: Z.GuessFromOrder
29
+ }), {
30
+ store: r,
31
+ itemProps: O,
32
+ setOpen: Y,
33
+ setValue: S,
34
+ selectionRef: p,
35
+ typingRef: V,
36
+ valuesRef: w,
37
+ multiple: v,
38
+ selectedItemTextRef: C,
39
+ disabled: j,
40
+ readOnly: q
41
+ } = Q(), I = f(r, a.isActive, d.index), F = f(r, a.open), i = f(r, a.isSelected, n), b = f(r, a.isSelectedByFocus, d.index), h = f(r, a.isItemEqualToValue), o = d.index, u = o !== -1, P = s.useRef(null);
42
+ U(() => {
43
+ if (!u)
44
+ return;
45
+ const e = w.current;
46
+ return e[o] = n, () => {
47
+ delete e[o];
48
+ };
49
+ }, [u, o, n, w]), U(() => {
50
+ if (!u)
51
+ return;
52
+ const e = r.state.value;
53
+ let t = e;
54
+ v && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && te(n, t, h) && (r.set("selectedIndex", o), l.current && (C.current = l.current));
55
+ }, [u, o, v, h, r, n, C]);
56
+ const y = s.useRef(null), R = s.useRef("mouse"), c = s.useRef(!1), {
57
+ getButtonProps: G,
58
+ buttonRef: K
59
+ } = se({
60
+ disabled: m,
61
+ focusableWhenDisabled: !0,
62
+ native: A,
63
+ composite: !0
64
+ }), L = {
65
+ disabled: m,
66
+ selected: i,
67
+ highlighted: I
68
+ };
69
+ function W(e) {
70
+ if (j || q)
71
+ return;
72
+ const t = r.state.value;
73
+ if (v) {
74
+ const x = Array.isArray(t) ? t : [], E = i ? re(x, n, h) : [...x, n];
75
+ S(E, M(g, e));
76
+ } else
77
+ S(n, M(g, e)), Y(!1, M(g, e));
78
+ }
79
+ function T() {
80
+ p.current.dragY = 0;
81
+ }
82
+ const _ = {
83
+ role: "option",
84
+ "aria-selected": i,
85
+ tabIndex: F && I ? 0 : -1,
86
+ onKeyDown(e) {
87
+ y.current = e.key, r.set("activeIndex", o), e.key === " " && V.current && e.preventDefault();
88
+ },
89
+ onClick(e) {
90
+ const t = e.type === "click" && R.current !== "touch", x = e.nativeEvent.pointerType, E = t && oe(e.nativeEvent) && // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual
91
+ // clicks that carry browser pointer data, including an empty string from assistive
92
+ // technology, can activate unhighlighted items.
93
+ (x !== void 0 || I), J = t && !E && !c.current;
94
+ c.current = !1, !(e.type === "keydown" && y.current === null) && (m || e.type === "keydown" && y.current === " " && V.current || J || (y.current = null, W(e.nativeEvent)));
95
+ },
96
+ onPointerEnter(e) {
97
+ R.current = e.pointerType;
98
+ },
99
+ onPointerMove(e) {
100
+ if (e.pointerType === "mouse" && e.buttons === 1) {
101
+ const t = p.current;
102
+ t.dragY += e.movementY, t.dragY ** 2 >= 64 && (t.allowUnselectedMouseUp = !0);
103
+ }
104
+ },
105
+ onPointerDown(e) {
106
+ R.current = e.pointerType, c.current = !0, T();
107
+ },
108
+ onMouseUp() {
109
+ if (T(), m || R.current === "touch" || c.current)
110
+ return;
111
+ const e = !p.current.allowSelectedMouseUp && i, t = !p.current.allowUnselectedMouseUp && !i;
112
+ e || t || (c.current = !0, P.current?.click(), c.current = !1);
113
+ }
114
+ }, z = $("div", k, {
115
+ ref: [K, D, d.ref, P],
116
+ state: L,
117
+ props: [O, _, N, G]
118
+ }), H = s.useMemo(() => ({
119
+ selected: i,
120
+ index: o,
121
+ textRef: l,
122
+ selectedByFocus: b,
123
+ hasRegistered: u
124
+ }), [i, o, l, b, u]);
125
+ return /* @__PURE__ */ ne.jsx(ee.Provider, {
126
+ value: H,
127
+ children: z
23
128
  });
24
- });
25
- process.env.NODE_ENV !== "production" && (a.displayName = "SelectGroupLabel");
129
+ }));
130
+ process.env.NODE_ENV !== "production" && (ie.displayName = "SelectItem");
26
131
  export {
27
- a as SelectGroupLabel
132
+ ie as SelectItem
28
133
  };
29
134
  //# sourceMappingURL=index52.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index52.js","sources":["../../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useSelectGroupContext } from \"../group/SelectGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectGroupLabel = /*#__PURE__*/React.forwardRef(function SelectGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useSelectGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroupLabel.displayName = \"SelectGroupLabel\";"],"names":["SelectGroupLabel","React","componentProps","forwardedRef","render","className","style","idProp","elementProps","setLabelId","useSelectGroupContext","id","useBaseUiId","useIsoLayoutEffect","useRenderElement"],"mappings":";;;;;AAcY,MAACA,IAAgC,gBAAAC,EAAM,WAAW,SAA0BC,GAAgBC,GAAc;AACpH,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,GAAGC;AAAA,EACP,IAAMN,GACE;AAAA,IACJ,YAAAO;AAAA,EACJ,IAAMC,EAAqB,GACnBC,IAAKC,EAAYL,CAAM;AAC7B,SAAAM,EAAmB,MAAM;AACvB,IAAAJ,EAAWE,CAAE;AAAA,EACf,GAAG,CAACA,GAAIF,CAAU,CAAC,GACHK,EAAiB,OAAOZ,GAAgB;AAAA,IACtD,KAAKC;AAAA,IACL,OAAO,CAAC;AAAA,MACN,IAAAQ;AAAA,IACN,GAAOH,CAAY;AAAA,EACnB,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcR,EAAiB,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index52.js","sources":["../../../node_modules/@base-ui/react/select/item/SelectItem.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.mjs\";\nimport { useCompositeListItem, IndexGuessBehavior } from \"../../internals/composite/list/useCompositeListItem.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { SelectItemContext } from \"./SelectItemContext.mjs\";\nimport { selectors } from \"../store.mjs\";\nimport { useButton } from \"../../internals/use-button/index.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { compareItemEquality, removeItem } from \"../../internals/itemEquality.mjs\";\nimport { isVirtualClick } from \"../../floating-ui-react/utils/event.mjs\";\n\n/**\n * An individual option in the select popup.\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 SelectItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n value: itemValue = null,\n label,\n disabled = false,\n nativeButton = false,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n label,\n textRef,\n indexGuessBehavior: IndexGuessBehavior.GuessFromOrder\n });\n const {\n store,\n itemProps,\n setOpen,\n setValue,\n selectionRef,\n typingRef,\n valuesRef,\n multiple,\n selectedItemTextRef,\n disabled: selectDisabled,\n readOnly\n } = useSelectRootContext();\n const highlighted = useStore(store, selectors.isActive, listItem.index);\n const open = useStore(store, selectors.open);\n const selected = useStore(store, selectors.isSelected, itemValue);\n const selectedByFocus = useStore(store, selectors.isSelectedByFocus, listItem.index);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const index = listItem.index;\n const hasRegistered = index !== -1;\n const itemRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return undefined;\n }\n const values = valuesRef.current;\n values[index] = itemValue;\n return () => {\n delete values[index];\n };\n }, [hasRegistered, index, itemValue, valuesRef]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return;\n }\n const selectedValue = store.state.value;\n let selectedCandidate = selectedValue;\n if (multiple && Array.isArray(selectedValue)) {\n // Compare against the last selected item, or `undefined` when nothing is selected — never\n // the raw array, which a custom `isItemEqualToValue` isn't expected to receive.\n selectedCandidate = selectedValue.length > 0 ? selectedValue[selectedValue.length - 1] : undefined;\n }\n if (selectedCandidate !== undefined && compareItemEquality(itemValue, selectedCandidate, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n // Make sure SelectPopup can measure the selected item on first open.\n // SelectItemText can still update this ref later when focus moves.\n if (textRef.current) {\n selectedItemTextRef.current = textRef.current;\n }\n }\n }, [hasRegistered, index, multiple, isItemEqualToValue, store, itemValue, selectedItemTextRef]);\n const lastKeyRef = React.useRef(null);\n const pointerTypeRef = React.useRef('mouse');\n const allowMouseSelectionRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const state = {\n disabled,\n selected,\n highlighted\n };\n function commitSelection(event) {\n // A forced-open select (`open`/`defaultOpen`) can still receive item activations even\n // when the root is disabled or read-only, so guard the commit here too.\n if (selectDisabled || readOnly) {\n return;\n }\n const selectedValue = store.state.value;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];\n setValue(nextValue, createChangeEventDetails(REASONS.itemPress, event));\n } else {\n setValue(itemValue, createChangeEventDetails(REASONS.itemPress, event));\n setOpen(false, createChangeEventDetails(REASONS.itemPress, event));\n }\n }\n function resetDragMovement() {\n selectionRef.current.dragY = 0;\n }\n const defaultProps = {\n role: 'option',\n 'aria-selected': selected,\n tabIndex: open && highlighted ? 0 : -1,\n onKeyDown(event) {\n lastKeyRef.current = event.key;\n store.set('activeIndex', index);\n if (event.key === ' ' && typingRef.current) {\n event.preventDefault();\n }\n },\n onClick(event) {\n const isMouseClick = event.type === 'click' && pointerTypeRef.current !== 'touch';\n const clickPointerType = event.nativeEvent.pointerType;\n const isVirtualMouseClick = isMouseClick && isVirtualClick(event.nativeEvent) && (\n // Generic no-pointer `detail === 0` clicks stay tied to highlight state. Virtual\n // clicks that carry browser pointer data, including an empty string from assistive\n // technology, can activate unhighlighted items.\n clickPointerType !== undefined || highlighted);\n // With alignItemWithTrigger, opening can place an item under the cursor. Real mouse\n // clicks must start on the item, while virtual clicks represent explicit keyboard or\n // assistive technology activation.\n const isInvalidMouseClick = isMouseClick && !isVirtualMouseClick && !allowMouseSelectionRef.current;\n allowMouseSelectionRef.current = false;\n\n // Prevent double commit on {Enter}\n if (event.type === 'keydown' && lastKeyRef.current === null) {\n return;\n }\n if (disabled || event.type === 'keydown' && lastKeyRef.current === ' ' && typingRef.current || isInvalidMouseClick) {\n return;\n }\n lastKeyRef.current = null;\n commitSelection(event.nativeEvent);\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerMove(event) {\n if (event.pointerType === 'mouse' && event.buttons === 1) {\n const selection = selectionRef.current;\n selection.dragY += event.movementY;\n if (selection.dragY ** 2 >= 64) {\n selection.allowUnselectedMouseUp = true;\n }\n }\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n allowMouseSelectionRef.current = true;\n resetDragMovement();\n },\n onMouseUp() {\n resetDragMovement();\n if (disabled || pointerTypeRef.current === 'touch') {\n return;\n }\n\n // Regular clicks are committed by the click event.\n if (allowMouseSelectionRef.current) {\n return;\n }\n const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;\n const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;\n if (disallowSelectedMouseUp || disallowUnselectedMouseUp) {\n return;\n }\n allowMouseSelectionRef.current = true;\n itemRef.current?.click();\n allowMouseSelectionRef.current = false;\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [itemProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n index,\n textRef,\n selectedByFocus,\n hasRegistered\n }), [selected, index, textRef, selectedByFocus, hasRegistered]);\n return /*#__PURE__*/_jsx(SelectItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItem.displayName = \"SelectItem\";"],"names":["SelectItem","React","componentProps","forwardedRef","render","className","style","itemValue","label","disabled","nativeButton","elementProps","textRef","listItem","useCompositeListItem","IndexGuessBehavior","store","itemProps","setOpen","setValue","selectionRef","typingRef","valuesRef","multiple","selectedItemTextRef","selectDisabled","readOnly","useSelectRootContext","highlighted","useStore","selectors","open","selected","selectedByFocus","isItemEqualToValue","index","hasRegistered","itemRef","useIsoLayoutEffect","values","selectedValue","selectedCandidate","compareItemEquality","lastKeyRef","pointerTypeRef","allowMouseSelectionRef","getButtonProps","buttonRef","useButton","state","commitSelection","event","currentValue","nextValue","removeItem","createChangeEventDetails","REASONS.itemPress","resetDragMovement","defaultProps","isMouseClick","clickPointerType","isVirtualMouseClick","isVirtualClick","isInvalidMouseClick","selection","disallowSelectedMouseUp","disallowUnselectedMouseUp","element","useRenderElement","contextValue","_jsx","SelectItemContext"],"mappings":";;;;;;;;;;;;;;AAuBY,MAACA,KAA0B,gBAAAC,EAAM,KAAkB,gBAAAA,EAAM,WAAW,SAAoBC,GAAgBC,GAAc;AAChI,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAOC,IAAY;AAAA,IACnB,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,cAAAC,IAAe;AAAA,IACf,GAAGC;AAAA,EACP,IAAMT,GACEU,IAAUX,EAAM,OAAO,IAAI,GAC3BY,IAAWC,EAAqB;AAAA,IACpC,OAAAN;AAAA,IACA,SAAAI;AAAA,IACA,oBAAoBG,EAAmB;AAAA,EAC3C,CAAG,GACK;AAAA,IACJ,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,UAAUC;AAAA,IACV,UAAAC;AAAA,EACJ,IAAMC,EAAoB,GAClBC,IAAcC,EAASb,GAAOc,EAAU,UAAUjB,EAAS,KAAK,GAChEkB,IAAOF,EA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EACd,CAAG;AACH,CAAC,CAAC;AACE,QAAQ,IAAI,aAAa,iBAAcnE,GAAW,cAAc;","x_google_ignoreList":[0]}
package/dist/index53.js CHANGED
@@ -1,26 +1,29 @@
1
- import * as a from "react";
2
- import { useRenderElement as n } from "./index172.js";
3
- const s = /* @__PURE__ */ a.forwardRef(function(e, t) {
1
+ import * as m from "react";
2
+ import { useIsoLayoutEffect as n } from "./index261.js";
3
+ import { useBaseUiId as p } from "./index178.js";
4
+ import { useSelectGroupContext as c } from "./index314.js";
5
+ import { useRenderElement as i } from "./index172.js";
6
+ const a = /* @__PURE__ */ m.forwardRef(function(o, r) {
4
7
  const {
5
- className: p,
6
- render: m,
7
- orientation: r = "horizontal",
8
- style: l,
9
- ...o
10
- } = e;
11
- return n("div", e, {
12
- state: {
13
- orientation: r
14
- },
15
- ref: t,
8
+ render: u,
9
+ className: d,
10
+ style: L,
11
+ id: s,
12
+ ...l
13
+ } = o, {
14
+ setLabelId: t
15
+ } = c(), e = p(s);
16
+ return n(() => {
17
+ t(e);
18
+ }, [e, t]), i("div", o, {
19
+ ref: r,
16
20
  props: [{
17
- role: "separator",
18
- "aria-orientation": r
19
- }, o]
21
+ id: e
22
+ }, l]
20
23
  });
21
24
  });
22
- process.env.NODE_ENV !== "production" && (s.displayName = "Separator");
25
+ process.env.NODE_ENV !== "production" && (a.displayName = "SelectGroupLabel");
23
26
  export {
24
- s as Separator
27
+ a as SelectGroupLabel
25
28
  };
26
29
  //# sourceMappingURL=index53.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index53.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]}
1
+ {"version":3,"file":"index53.js","sources":["../../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../internals/useBaseUiId.mjs\";\nimport { useSelectGroupContext } from \"../group/SelectGroupContext.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectGroupLabel = /*#__PURE__*/React.forwardRef(function SelectGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useSelectGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroupLabel.displayName = \"SelectGroupLabel\";"],"names":["SelectGroupLabel","React","componentProps","forwardedRef","render","className","style","idProp","elementProps","setLabelId","useSelectGroupContext","id","useBaseUiId","useIsoLayoutEffect","useRenderElement"],"mappings":";;;;;AAcY,MAACA,IAAgC,gBAAAC,EAAM,WAAW,SAA0BC,GAAgBC,GAAc;AACpH,QAAM;AAAA,IACJ,QAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,IAAIC;AAAA,IACJ,GAAGC;AAAA,EACP,IAAMN,GACE;AAAA,IACJ,YAAAO;AAAA,EACJ,IAAMC,EAAqB,GACnBC,IAAKC,EAAYL,CAAM;AAC7B,SAAAM,EAAmB,MAAM;AACvB,IAAAJ,EAAWE,CAAE;AAAA,EACf,GAAG,CAACA,GAAIF,CAAU,CAAC,GACHK,EAAiB,OAAOZ,GAAgB;AAAA,IACtD,KAAKC;AAAA,IACL,OAAO,CAAC;AAAA,MACN,IAAAQ;AAAA,IACN,GAAOH,CAAY;AAAA,EACnB,CAAG;AAEH,CAAC;AACG,QAAQ,IAAI,aAAa,iBAAcR,EAAiB,cAAc;","x_google_ignoreList":[0]}
package/dist/index54.js CHANGED
@@ -1,141 +1,26 @@
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,
29
- value: () => null
30
- }, ve = /* @__PURE__ */ g.forwardRef(function(E, L) {
1
+ import * as a from "react";
2
+ import { useRenderElement as n } from "./index172.js";
3
+ const s = /* @__PURE__ */ a.forwardRef(function(e, t) {
31
4
  const {
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));
5
+ className: p,
6
+ render: m,
7
+ orientation: r = "horizontal",
8
+ style: l,
9
+ ...o
10
+ } = e;
11
+ return n("div", e, {
12
+ state: {
13
+ orientation: r
99
14
  },
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
129
- };
130
- return me("button", E, {
131
- ref: [L, u, Z, $],
132
- state: oe,
133
- stateAttributesMapping: he,
134
- props: x
15
+ ref: t,
16
+ props: [{
17
+ role: "separator",
18
+ "aria-orientation": r
19
+ }, o]
135
20
  });
136
21
  });
137
- process.env.NODE_ENV !== "production" && (ve.displayName = "SelectTrigger");
22
+ process.env.NODE_ENV !== "production" && (s.displayName = "Separator");
138
23
  export {
139
- ve as SelectTrigger
24
+ s as Separator
140
25
  };
141
26
  //# sourceMappingURL=index54.js.map