@multiplatform.one/forms 7.80.0 → 7.81.1

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 (221) hide show
  1. package/dist/cjs/AdaptivePopup/index.cjs +2 -1
  2. package/dist/cjs/AdaptivePopup/index.native.js +2 -1
  3. package/dist/cjs/AdaptivePopup/index.native.js.map +1 -1
  4. package/dist/cjs/Button/index.cjs +12 -5
  5. package/dist/cjs/Button/index.native.js +14 -6
  6. package/dist/cjs/Button/index.native.js.map +1 -1
  7. package/dist/cjs/FloatingPanel/PanelHeader.cjs +3 -8
  8. package/dist/cjs/FloatingPanel/PanelHeader.native.js +3 -8
  9. package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -1
  10. package/dist/cjs/FloatingPanel/coverRect.cjs +0 -8
  11. package/dist/cjs/FloatingPanel/coverRect.native.js +0 -8
  12. package/dist/cjs/FloatingPanel/coverRect.native.js.map +1 -1
  13. package/dist/cjs/FloatingPanel/echoContext.cjs +5 -27
  14. package/dist/cjs/FloatingPanel/echoContext.native.js +5 -28
  15. package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -1
  16. package/dist/cjs/FloatingPanel/index.cjs +49 -131
  17. package/dist/cjs/FloatingPanel/index.native.js +216 -135
  18. package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
  19. package/dist/cjs/fields/Combobox/index.cjs +3 -10
  20. package/dist/cjs/fields/Combobox/index.native.js +3 -10
  21. package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
  22. package/dist/cjs/fields/Select/InlineChoices.cjs +4 -8
  23. package/dist/cjs/fields/Select/InlineChoices.native.js +4 -8
  24. package/dist/cjs/fields/Select/InlineChoices.native.js.map +1 -1
  25. package/dist/cjs/fields/Select/index.cjs +65 -201
  26. package/dist/cjs/fields/Select/index.native.js +74 -209
  27. package/dist/cjs/fields/Select/index.native.js.map +1 -1
  28. package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.cjs +2 -2
  29. package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
  30. package/dist/cjs/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
  31. package/dist/cjs/index.cjs +4 -0
  32. package/dist/cjs/index.native.js +4 -0
  33. package/dist/cjs/index.native.js.map +1 -1
  34. package/dist/cjs/shared/CheckGlyph.cjs +40 -0
  35. package/dist/cjs/shared/CheckGlyph.native.js +44 -0
  36. package/dist/cjs/shared/CheckGlyph.native.js.map +1 -0
  37. package/dist/cjs/shared/checkedOnField.cjs +104 -0
  38. package/dist/cjs/shared/checkedOnField.native.js +117 -0
  39. package/dist/cjs/shared/checkedOnField.native.js.map +1 -0
  40. package/dist/cjs/shared/floatingList.cjs +12 -5
  41. package/dist/cjs/shared/floatingList.native.js +15 -7
  42. package/dist/cjs/shared/floatingList.native.js.map +1 -1
  43. package/dist/esm/AdaptivePopup/index.mjs +3 -2
  44. package/dist/esm/AdaptivePopup/index.mjs.map +1 -1
  45. package/dist/esm/AdaptivePopup/index.native.js +3 -2
  46. package/dist/esm/AdaptivePopup/index.native.js.map +1 -1
  47. package/dist/esm/Button/index.mjs +12 -5
  48. package/dist/esm/Button/index.mjs.map +1 -1
  49. package/dist/esm/Button/index.native.js +14 -6
  50. package/dist/esm/Button/index.native.js.map +1 -1
  51. package/dist/esm/FloatingPanel/PanelHeader.mjs +3 -8
  52. package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -1
  53. package/dist/esm/FloatingPanel/PanelHeader.native.js +3 -8
  54. package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -1
  55. package/dist/esm/FloatingPanel/coverRect.mjs +1 -8
  56. package/dist/esm/FloatingPanel/coverRect.mjs.map +1 -1
  57. package/dist/esm/FloatingPanel/coverRect.native.js +1 -8
  58. package/dist/esm/FloatingPanel/coverRect.native.js.map +1 -1
  59. package/dist/esm/FloatingPanel/echoContext.mjs +4 -24
  60. package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -1
  61. package/dist/esm/FloatingPanel/echoContext.native.js +4 -25
  62. package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -1
  63. package/dist/esm/FloatingPanel/index.mjs +53 -135
  64. package/dist/esm/FloatingPanel/index.mjs.map +1 -1
  65. package/dist/esm/FloatingPanel/index.native.js +180 -99
  66. package/dist/esm/FloatingPanel/index.native.js.map +1 -1
  67. package/dist/esm/fields/Combobox/index.mjs +4 -11
  68. package/dist/esm/fields/Combobox/index.mjs.map +1 -1
  69. package/dist/esm/fields/Combobox/index.native.js +4 -11
  70. package/dist/esm/fields/Combobox/index.native.js.map +1 -1
  71. package/dist/esm/fields/Select/InlineChoices.mjs +2 -6
  72. package/dist/esm/fields/Select/InlineChoices.mjs.map +1 -1
  73. package/dist/esm/fields/Select/InlineChoices.native.js +2 -6
  74. package/dist/esm/fields/Select/InlineChoices.native.js.map +1 -1
  75. package/dist/esm/fields/Select/index.mjs +68 -204
  76. package/dist/esm/fields/Select/index.mjs.map +1 -1
  77. package/dist/esm/fields/Select/index.native.js +77 -212
  78. package/dist/esm/fields/Select/index.native.js.map +1 -1
  79. package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
  80. package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
  81. package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js +3 -3
  82. package/dist/esm/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
  83. package/dist/esm/index.mjs +3 -1
  84. package/dist/esm/index.mjs.map +1 -1
  85. package/dist/esm/index.native.js +3 -1
  86. package/dist/esm/index.native.js.map +1 -1
  87. package/dist/esm/shared/CheckGlyph.mjs +15 -0
  88. package/dist/esm/shared/CheckGlyph.mjs.map +1 -0
  89. package/dist/esm/shared/CheckGlyph.native.js +16 -0
  90. package/dist/esm/shared/CheckGlyph.native.js.map +1 -0
  91. package/dist/esm/shared/checkedOnField.mjs +76 -0
  92. package/dist/esm/shared/checkedOnField.mjs.map +1 -0
  93. package/dist/esm/shared/checkedOnField.native.js +86 -0
  94. package/dist/esm/shared/checkedOnField.native.js.map +1 -0
  95. package/dist/esm/shared/floatingList.mjs +9 -5
  96. package/dist/esm/shared/floatingList.mjs.map +1 -1
  97. package/dist/esm/shared/floatingList.native.js +12 -7
  98. package/dist/esm/shared/floatingList.native.js.map +1 -1
  99. package/dist/jsx/AdaptivePopup/index.mjs +3 -2
  100. package/dist/jsx/AdaptivePopup/index.mjs.map +1 -1
  101. package/dist/jsx/AdaptivePopup/index.native.js +2 -1
  102. package/dist/jsx/AdaptivePopup/index.native.js.map +1 -1
  103. package/dist/jsx/Button/index.mjs +12 -5
  104. package/dist/jsx/Button/index.mjs.map +1 -1
  105. package/dist/jsx/Button/index.native.js +14 -6
  106. package/dist/jsx/Button/index.native.js.map +1 -1
  107. package/dist/jsx/FloatingPanel/PanelHeader.mjs +3 -8
  108. package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -1
  109. package/dist/jsx/FloatingPanel/PanelHeader.native.js +3 -8
  110. package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -1
  111. package/dist/jsx/FloatingPanel/coverRect.mjs +1 -8
  112. package/dist/jsx/FloatingPanel/coverRect.mjs.map +1 -1
  113. package/dist/jsx/FloatingPanel/coverRect.native.js +0 -8
  114. package/dist/jsx/FloatingPanel/coverRect.native.js.map +1 -1
  115. package/dist/jsx/FloatingPanel/echoContext.mjs +4 -24
  116. package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -1
  117. package/dist/jsx/FloatingPanel/echoContext.native.js +5 -28
  118. package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -1
  119. package/dist/jsx/FloatingPanel/index.mjs +53 -135
  120. package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
  121. package/dist/jsx/FloatingPanel/index.native.js +216 -135
  122. package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
  123. package/dist/jsx/fields/Combobox/index.mjs +4 -11
  124. package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
  125. package/dist/jsx/fields/Combobox/index.native.js +3 -10
  126. package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
  127. package/dist/jsx/fields/Select/InlineChoices.mjs +2 -6
  128. package/dist/jsx/fields/Select/InlineChoices.mjs.map +1 -1
  129. package/dist/jsx/fields/Select/InlineChoices.native.js +4 -8
  130. package/dist/jsx/fields/Select/InlineChoices.native.js.map +1 -1
  131. package/dist/jsx/fields/Select/index.mjs +68 -204
  132. package/dist/jsx/fields/Select/index.mjs.map +1 -1
  133. package/dist/jsx/fields/Select/index.native.js +74 -209
  134. package/dist/jsx/fields/Select/index.native.js.map +1 -1
  135. package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs +3 -3
  136. package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.mjs.map +1 -1
  137. package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js +2 -2
  138. package/dist/jsx/fields/nativeDateTime/OsDateTimeSheet.native.js.map +1 -1
  139. package/dist/jsx/index.js +3 -1
  140. package/dist/jsx/index.js.map +1 -1
  141. package/dist/jsx/index.mjs +3 -1
  142. package/dist/jsx/index.mjs.map +1 -1
  143. package/dist/jsx/index.native.js +4 -0
  144. package/dist/jsx/index.native.js.map +1 -1
  145. package/dist/jsx/shared/CheckGlyph.mjs +15 -0
  146. package/dist/jsx/shared/CheckGlyph.mjs.map +1 -0
  147. package/dist/jsx/shared/CheckGlyph.native.js +44 -0
  148. package/dist/jsx/shared/CheckGlyph.native.js.map +1 -0
  149. package/dist/jsx/shared/checkedOnField.mjs +76 -0
  150. package/dist/jsx/shared/checkedOnField.mjs.map +1 -0
  151. package/dist/jsx/shared/checkedOnField.native.js +117 -0
  152. package/dist/jsx/shared/checkedOnField.native.js.map +1 -0
  153. package/dist/jsx/shared/floatingList.mjs +9 -5
  154. package/dist/jsx/shared/floatingList.mjs.map +1 -1
  155. package/dist/jsx/shared/floatingList.native.js +15 -7
  156. package/dist/jsx/shared/floatingList.native.js.map +1 -1
  157. package/package.json +8 -8
  158. package/src/AdaptivePopup/index.tsx +6 -3
  159. package/src/Button/Button.iconButton.spec.tsx +39 -0
  160. package/src/Button/index.tsx +20 -8
  161. package/src/FloatingPanel/FloatingPanel.iconCover.spec.tsx +279 -0
  162. package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +78 -69
  163. package/src/FloatingPanel/FloatingPanel.seamlessCover.spec.tsx +12 -0
  164. package/src/FloatingPanel/PanelHeader.tsx +4 -12
  165. package/src/FloatingPanel/coverRect.ts +2 -15
  166. package/src/FloatingPanel/echoContext.ts +6 -40
  167. package/src/FloatingPanel/index.native.tsx +209 -144
  168. package/src/FloatingPanel/index.tsx +71 -187
  169. package/src/FloatingPanel/pointAnchor.spec.ts +1 -1
  170. package/src/FloatingPanel/pointAnchor.ts +4 -4
  171. package/src/FloatingPanel/sheetGrabber.spec.tsx +53 -0
  172. package/src/fields/Combobox/index.tsx +4 -9
  173. package/src/fields/Select/InlineChoices.tsx +2 -2
  174. package/src/fields/Select/Select.containingBlock.spec.tsx +131 -130
  175. package/src/fields/Select/Select.popUp.native.spec.tsx +276 -0
  176. package/src/fields/Select/Select.stories.tsx +26 -0
  177. package/src/fields/Select/index.tsx +84 -255
  178. package/src/fields/nativeDateTime/OsDateTimeSheet.tsx +3 -3
  179. package/src/index.ts +2 -1
  180. package/src/shared/CheckGlyph.tsx +12 -0
  181. package/src/shared/checkedOnField.ts +116 -0
  182. package/src/shared/floatingList.spec.tsx +154 -1
  183. package/src/shared/floatingList.tsx +18 -9
  184. package/types/AdaptivePopup/index.d.ts.map +1 -1
  185. package/types/Button/index.d.ts.map +1 -1
  186. package/types/FloatingPanel/PanelHeader.d.ts +1 -6
  187. package/types/FloatingPanel/PanelHeader.d.ts.map +1 -1
  188. package/types/FloatingPanel/coverRect.d.ts +2 -11
  189. package/types/FloatingPanel/coverRect.d.ts.map +1 -1
  190. package/types/FloatingPanel/echoContext.d.ts +5 -22
  191. package/types/FloatingPanel/echoContext.d.ts.map +1 -1
  192. package/types/FloatingPanel/index.d.ts +22 -9
  193. package/types/FloatingPanel/index.d.ts.map +1 -1
  194. package/types/FloatingPanel/index.native.d.ts +8 -1
  195. package/types/FloatingPanel/index.native.d.ts.map +1 -1
  196. package/types/FloatingPanel/pointAnchor.d.ts +4 -4
  197. package/types/fields/Combobox/index.d.ts.map +1 -1
  198. package/types/fields/Select/index.d.ts.map +1 -1
  199. package/types/index.d.ts +2 -1
  200. package/types/index.d.ts.map +1 -1
  201. package/types/shared/CheckGlyph.d.ts +10 -0
  202. package/types/shared/CheckGlyph.d.ts.map +1 -0
  203. package/types/shared/checkedOnField.d.ts +54 -0
  204. package/types/shared/checkedOnField.d.ts.map +1 -0
  205. package/types/shared/floatingList.d.ts +5 -2
  206. package/types/shared/floatingList.d.ts.map +1 -1
  207. package/dist/cjs/FloatingPanel/iconEcho.cjs +0 -106
  208. package/dist/cjs/FloatingPanel/iconEcho.native.js +0 -116
  209. package/dist/cjs/FloatingPanel/iconEcho.native.js.map +0 -1
  210. package/dist/esm/FloatingPanel/iconEcho.mjs +0 -79
  211. package/dist/esm/FloatingPanel/iconEcho.mjs.map +0 -1
  212. package/dist/esm/FloatingPanel/iconEcho.native.js +0 -86
  213. package/dist/esm/FloatingPanel/iconEcho.native.js.map +0 -1
  214. package/dist/jsx/FloatingPanel/iconEcho.mjs +0 -79
  215. package/dist/jsx/FloatingPanel/iconEcho.mjs.map +0 -1
  216. package/dist/jsx/FloatingPanel/iconEcho.native.js +0 -116
  217. package/dist/jsx/FloatingPanel/iconEcho.native.js.map +0 -1
  218. package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +0 -357
  219. package/src/FloatingPanel/iconEcho.tsx +0 -124
  220. package/types/FloatingPanel/iconEcho.d.ts +0 -29
  221. package/types/FloatingPanel/iconEcho.d.ts.map +0 -1
@@ -1,10 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { nativeAnimationConfig } from "@multiplatform.one/theme";
2
+ import { CaretDownIcon, CaretUpIcon } from "@phosphor-icons/react";
3
+ import { nativeAnimationConfig, overlayScrim, sheetGrabber, sheetGrabberZone } from "@multiplatform.one/theme";
3
4
  import { isValidElement, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
4
5
  import { Animated, Easing, I18nManager, Modal, PanResponder, Platform, Pressable, ScrollView as RNScrollView, StyleSheet, useWindowDimensions, View as RNView } from "react-native";
5
6
  import { SafeAreaInsetsContext, initialWindowMetrics } from "react-native-safe-area-context";
6
- import { Surface, SurfaceContext, useResolvedKnobs, motionDurationMs } from "@multiplatform.one/theme";
7
- import { View, YStack } from "tamagui";
7
+ import { Surface, useGlyphColor, useResolvedKnobs, motionDurationMs } from "@multiplatform.one/theme";
8
+ import { getTokenValue, View, YStack } from "tamagui";
9
+ import { placeCheckedOnField, scrollArrowBand, scrollArrowThreshold } from "../shared/checkedOnField.native.js";
8
10
  import { useInsideOverlay, useOverlayZIndex } from "../shared/overlayStack.native.js";
9
11
  import { OverlayWindow } from "../shared/OverlayWindow.native.js";
10
12
  import { t } from "../shared/t.native.js";
@@ -12,13 +14,12 @@ import { overlaySizeClass } from "../shared/overlaySizeClass.native.js";
12
14
  import { useKeyboardInset } from "../shared/useKeyboardInset.native.js";
13
15
  import { MENU_MIN_WIDTH, resolveCompactFace } from "./compactFace.native.js";
14
16
  import { echoOffset, panelWidthBox, screenBounds } from "./panelWidth.native.js";
15
- import { echoHeaderBox, PanelEchoContext, PanelIconEchoBoxContext, PanelTriggerRadiusContext } from "./echoContext.native.js";
17
+ import { PanelEchoContext, PanelSheetContext, PanelTriggerRadiusContext } from "./echoContext.native.js";
16
18
  import { placeAtPoint, placeBesideTrigger, placeOverTrigger } from "./pointAnchor.native.js";
17
19
  import { RegularPanel } from "./RegularPanel.native.js";
18
20
  import { panelViewportPadding, resolvePanelWidthMode } from "./useFloatingPanel.native.js";
19
21
  import { TrailingActionOverlay, TriggerWithTrailingAction } from "./trailingAction.native.js";
20
- import { iconEchoElement, iconEchoOverlays } from "./iconEcho.native.js";
21
- import { echoInCover, iconCoverRect } from "./coverRect.native.js";
22
+ import { iconCoverRect } from "./coverRect.native.js";
22
23
  import { IconButtonGroupSurfaceContext, useIconButtonGroupSurface } from "../Button/iconButtonGroupContext.native.js";
23
24
  import { useFloatingPanel, panelAnimationDuration, panelGrowDuration, panelTransition, panelViewportPadding as panelViewportPadding2 } from "./useFloatingPanel.native.js";
24
25
  import { floatingPanelActionProps, isNestedPanelAction } from "./nestedAction.native.js";
@@ -52,7 +53,8 @@ function FloatingPanel(param) {
52
53
  triggerRow,
53
54
  triggerEcho = true,
54
55
  coverAlign = "start",
55
- iconEcho,
56
+ iconCover = false,
57
+ popUp,
56
58
  anchorMode,
57
59
  panelWidth = "content",
58
60
  sheet,
@@ -65,7 +67,6 @@ function FloatingPanel(param) {
65
67
  } = useResolvedKnobs({
66
68
  painted: false
67
69
  });
68
- var triggerSurface = SurfaceContext.useStyledContext();
69
70
  var windowZIndex = useOverlayZIndex("sheet");
70
71
  var children = /* @__PURE__ */_jsx(IconButtonGroupSurfaceContext.Provider, {
71
72
  value: null,
@@ -122,7 +123,7 @@ function FloatingPanel(param) {
122
123
  var regular = overlaySizeClass(windowWidth) === "regular";
123
124
  var atPoint = isContextMenu && pressPoint !== null && regular;
124
125
  var insideOverlay = useInsideOverlay();
125
- var asMenu = isContextMenu ? compactFace === "menu" : resolveCompactFace(compactFace, insideOverlay) === "menu";
126
+ var asMenu = isContextMenu ? compactFace === "menu" : resolveCompactFace(compactFace, insideOverlay) === "menu" || popUp != null && regular;
126
127
  var asRegular = regular && !asMenu && !isContextMenu && sheet !== true;
127
128
  var anchored = asMenu || asRegular;
128
129
  var triggerRef = useRef(null);
@@ -160,7 +161,7 @@ function FloatingPanel(param) {
160
161
  height: 0
161
162
  });
162
163
  }
163
- if (iconEcho && anchorMode !== "attach" && groupSurface) {
164
+ if (iconCover && anchorMode !== "attach" && groupSurface) {
164
165
  setGroup(void 0);
165
166
  groupSurface.measure(function (plate) {
166
167
  if (live) setGroup(plate);
@@ -171,7 +172,7 @@ function FloatingPanel(param) {
171
172
  return function () {
172
173
  live = false;
173
174
  };
174
- }, [anchored, open, iconEcho, anchorMode, groupSurface]);
175
+ }, [anchored, open, iconCover, anchorMode, groupSurface]);
175
176
  var handleBackdropPress = useCallback(function () {
176
177
  if (backdropArmed) close();
177
178
  }, [backdropArmed, close]);
@@ -495,11 +496,11 @@ function FloatingPanel(param) {
495
496
  right: windowWidth - ((_ref4 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.right) !== null && _ref4 !== void 0 ? _ref4 : 0) - panelViewportPadding,
496
497
  bottom: windowHeight - Math.max((_ref5 = safeArea === null || safeArea === void 0 ? void 0 : safeArea.bottom) !== null && _ref5 !== void 0 ? _ref5 : 0, keyboardInset) - panelViewportPadding
497
498
  },
498
- echo: triggerEcho && !iconEcho ? triggerRow !== null && triggerRow !== void 0 ? triggerRow : trigger : null,
499
+ echo: triggerEcho && !iconCover && !popUp ? triggerRow !== null && triggerRow !== void 0 ? triggerRow : trigger : null,
499
500
  echoLabel: triggerA11y === null || triggerA11y === void 0 ? void 0 : triggerA11y.label,
500
- iconEcho: iconEcho && anchorMode !== "attach" ? iconEchoElement(trigger, iconEcho, close, triggerSurface) : null,
501
- iconEchoKind: iconEcho,
502
- group: iconEcho && anchorMode !== "attach" ? group !== null && group !== void 0 ? group : null : null,
501
+ popUp,
502
+ iconCover: iconCover && anchorMode !== "attach",
503
+ group: iconCover && anchorMode !== "attach" ? group !== null && group !== void 0 ? group : null : null,
503
504
  coverAlign: anchorMode === "attach" ? "start" : coverAlign,
504
505
  panelWidth,
505
506
  triggerRadius: anchorMode === "attach" ? null : triggerRadius,
@@ -561,7 +562,7 @@ function FloatingPanel(param) {
561
562
  accessibilityLabel: t("Close"),
562
563
  children: /* @__PURE__ */_jsx(View, {
563
564
  flex: 1,
564
- backgroundColor: "$shadow6"
565
+ backgroundColor: overlayScrim
565
566
  })
566
567
  }),
567
568
  /*
@@ -594,6 +595,11 @@ function FloatingPanel(param) {
594
595
  ...knobProps.elevatedSurface,
595
596
  borderBottomLeftRadius: 0,
596
597
  borderBottomRightRadius: 0,
598
+ // A sheet spans the screen: only its top edge meets the page,
599
+ // so no side border gutters a full-width row (FZ-8557).
600
+ borderLeftWidth: 0,
601
+ borderRightWidth: 0,
602
+ borderBottomWidth: 0,
597
603
  maxHeight,
598
604
  flexShrink: 1,
599
605
  minHeight: 0,
@@ -602,13 +608,12 @@ function FloatingPanel(param) {
602
608
  ...(sheetFill ? {
603
609
  height: maxHeight
604
610
  } : void 0),
605
- paddingTop: "$2",
606
611
  paddingBottom: sheetBottomPadding,
607
612
  // VoiceOver escape gesture (two-finger Z) dismisses the sheet.
608
613
  onAccessibilityEscape: close,
609
614
  children: [
610
615
  /*
611
- The grab ZONE, not just the 4pt pill: a 4pt tall target is
616
+ The grab ZONE, not just the 5pt pill: a 5pt tall target is
612
617
  unhittable. The gesture lives here rather than on the whole
613
618
  sheet so it never fights the ScrollView inside it, which is the
614
619
  same division iOS uses.
@@ -618,17 +623,10 @@ function FloatingPanel(param) {
618
623
  ...panResponder.panHandlers,
619
624
  accessibilityRole: "adjustable",
620
625
  accessibilityLabel: t("Drag to resize"),
621
- style: {
622
- alignSelf: "stretch",
623
- alignItems: "center",
624
- paddingTop: 4,
625
- paddingBottom: 12
626
- },
626
+ testID: "floating-panel-grabber",
627
+ style: sheetGrabberZone,
627
628
  children: /* @__PURE__ */_jsx(View, {
628
- width: 40,
629
- height: 4,
630
- borderRadius: 2,
631
- backgroundColor: "$color8"
629
+ ...sheetGrabber
632
630
  })
633
631
  }), /* @__PURE__ */_jsx(YStack, {
634
632
  padding: framePadding,
@@ -638,9 +636,12 @@ function FloatingPanel(param) {
638
636
  flex: 1,
639
637
  minHeight: 0
640
638
  } : void 0),
641
- children: /* @__PURE__ */_jsxs(Surface, {
639
+ children: /* @__PURE__ */_jsx(Surface, {
642
640
  size: "$true",
643
- children: [header, content]
641
+ children: /* @__PURE__ */_jsxs(PanelSheetContext.Provider, {
642
+ value: true,
643
+ children: [header, content]
644
+ })
644
645
  })
645
646
  })]
646
647
  })
@@ -657,8 +658,8 @@ function TriggerMenuPanel(param) {
657
658
  bounds,
658
659
  echo,
659
660
  echoLabel,
660
- iconEcho = null,
661
- iconEchoKind = "menu",
661
+ popUp,
662
+ iconCover = false,
662
663
  group = null,
663
664
  coverAlign,
664
665
  panelWidth,
@@ -669,15 +670,19 @@ function TriggerMenuPanel(param) {
669
670
  onClose,
670
671
  children
671
672
  } = param;
672
- var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
673
+ var _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
673
674
  var {
674
675
  knobProps
675
676
  } = useResolvedKnobs({
676
677
  painted: false
677
678
  });
679
+ var glyphColor = useGlyphColor();
678
680
  var [size, setSize] = useState(null);
679
- var cover = anchor && iconEcho != null ? iconCoverRect(anchor, group) : anchor;
680
- var echoCover = anchor && cover && iconEcho != null ? echoInCover(anchor, cover) : null;
681
+ var [contentHeight, setContentHeight] = useState(null);
682
+ var [scrolled, setScrolled] = useState(null);
683
+ var scrollRef = useRef(null);
684
+ var offsetRef = useRef(0);
685
+ var cover = anchor && iconCover ? iconCoverRect(anchor, group) : anchor;
681
686
  var room = panelWidth === "screen" && anchor ? {
682
687
  ...bounds,
683
688
  ...screenBounds({
@@ -694,19 +699,79 @@ function TriggerMenuPanel(param) {
694
699
  echo: echo != null,
695
700
  floor: Math.max(MENU_MIN_WIDTH, (_ref1 = cover === null || cover === void 0 ? void 0 : cover.width) !== null && _ref1 !== void 0 ? _ref1 : 0)
696
701
  });
697
- var placement = anchor && cover && size ? (attach ? placeBesideTrigger : placeOverTrigger)({
702
+ var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
703
+ var framePaddingToken = getTokenValue(framePadding, "space");
704
+ var framePaddingPx = typeof framePaddingToken === "number" ? framePaddingToken : 0;
705
+ var band = scrollArrowBand(knobProps.menuRow.minHeight);
706
+ var fit = anchor && (popUp === null || popUp === void 0 ? void 0 : popUp.row) && contentHeight != null ? placeCheckedOnField({
707
+ fieldTop: anchor.y,
708
+ fieldBottom: anchor.y + anchor.height,
709
+ rowTop: popUp.row.top + framePaddingPx,
710
+ rowHeight: popUp.row.height,
711
+ contentHeight,
712
+ boundsTop: bounds.top + borderWidth,
713
+ boundsBottom: bounds.bottom - borderWidth,
714
+ band
715
+ }) : null;
716
+ var scrollTop = (_ref2 = fit === null || fit === void 0 ? void 0 : fit.scrollTop) !== null && _ref2 !== void 0 ? _ref2 : 0;
717
+ var scrolls = fit != null && contentHeight != null && fit.height < contentHeight;
718
+ var placed = anchor && cover && size && (!popUp || fit) ? (attach ? placeBesideTrigger : placeOverTrigger)({
698
719
  trigger: cover,
699
720
  width: size.width,
700
721
  height: size.height,
701
722
  bounds: room,
702
723
  rtl: I18nManager.isRTL,
703
724
  align: coverAlign,
704
- pinned: iconEcho != null
725
+ pinned: iconCover
705
726
  }) : null;
727
+ var placement = placed && fit ? {
728
+ ...placed,
729
+ top: fit.top - borderWidth,
730
+ maxHeight: fit.height + 2 * borderWidth
731
+ } : placed;
732
+ useLayoutEffect(function () {
733
+ var _scrollRef_current;
734
+ offsetRef.current = scrollTop;
735
+ if (scrollTop > 0) (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
736
+ y: scrollTop,
737
+ animated: false
738
+ });
739
+ }, [scrollTop]);
740
+ var atRest = {
741
+ up: scrolls && scrollTop > scrollArrowThreshold,
742
+ down: scrolls && fit != null && contentHeight != null && contentHeight - scrollTop - fit.height > scrollArrowThreshold
743
+ };
744
+ var arrows = scrolled !== null && scrolled !== void 0 ? scrolled : atRest;
745
+ var handleScroll = function handleScroll2(event) {
746
+ if (!scrolls) return;
747
+ var {
748
+ contentOffset,
749
+ contentSize,
750
+ layoutMeasurement
751
+ } = event.nativeEvent;
752
+ offsetRef.current = contentOffset.y;
753
+ var up = contentOffset.y > scrollArrowThreshold;
754
+ var down = contentSize.height - contentOffset.y - layoutMeasurement.height > scrollArrowThreshold;
755
+ setScrolled(function (prev) {
756
+ return (prev === null || prev === void 0 ? void 0 : prev.up) === up && (prev === null || prev === void 0 ? void 0 : prev.down) === down ? prev : {
757
+ up,
758
+ down
759
+ };
760
+ });
761
+ };
762
+ var scrollPage = function scrollPage2(direction) {
763
+ var _ref6;
764
+ var _popUp_row, _scrollRef_current;
765
+ if (!fit) return;
766
+ var page = Math.max(band, fit.height - 2 * band - ((_ref6 = popUp === null || popUp === void 0 ? void 0 : (_popUp_row = popUp.row) === null || _popUp_row === void 0 ? void 0 : _popUp_row.height) !== null && _ref6 !== void 0 ? _ref6 : 0));
767
+ var next = offsetRef.current + (direction === "up" ? -page : page);
768
+ (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTo({
769
+ y: Math.max(0, next),
770
+ animated: true
771
+ });
772
+ };
706
773
  var half = cover ? Math.min(cover.width, cover.height) / 2 : void 0;
707
- var radius = group != null && iconEcho != null ? Math.min(group.radius, half !== null && half !== void 0 ? half : group.radius) : triggerRadius != null && half != null ? Math.min(triggerRadius, half) : coverAlign === "auto" && half ? half : void 0;
708
- var borderWidth = Number(knobProps.elevatedSurface.borderWidth) || 0;
709
- var echoOverlays = iconEchoOverlays(iconEchoKind, (_ref2 = placement === null || placement === void 0 ? void 0 : placement.up) !== null && _ref2 !== void 0 ? _ref2 : false);
774
+ var radius = group != null && iconCover ? Math.min(group.radius, half !== null && half !== void 0 ? half : group.radius) : triggerRadius != null && half != null ? Math.min(triggerRadius, half) : coverAlign === "auto" && half ? half : void 0;
710
775
  var echoShift = anchor && placement ? echoOffset({
711
776
  triggerLeft: anchor.x,
712
777
  triggerRight: anchor.x + anchor.width,
@@ -716,6 +781,8 @@ function TriggerMenuPanel(param) {
716
781
  }) : 0;
717
782
  return /* @__PURE__ */_jsxs(RNView, {
718
783
  style: StyleSheet.absoluteFill,
784
+ testID: "floating-panel-menu-layer",
785
+ accessibilityViewIsModal: true,
719
786
  children: [/* @__PURE__ */_jsx(Pressable, {
720
787
  style: StyleSheet.absoluteFill,
721
788
  onPress: onBackdropPress,
@@ -795,86 +862,98 @@ function TriggerMenuPanel(param) {
795
862
  children: echo
796
863
  })
797
864
  })
798
- }) : null, iconEcho != null && anchor && !(placement === null || placement === void 0 ? void 0 : placement.up) && !echoOverlays ? /* @__PURE__ */_jsx(IconEchoBand, {
799
- anchor,
800
- cover: echoCover,
801
- shift: echoShift,
802
- borderWidth,
803
- edge: "top",
804
- children: iconEcho
805
865
  }) : null, /* @__PURE__ */_jsx(RNScrollView, {
866
+ ref: scrollRef,
806
867
  style: {
807
868
  flexGrow: 0,
808
869
  flexShrink: 1
809
870
  },
810
871
  keyboardShouldPersistTaps: "handled",
811
- children: /* @__PURE__ */_jsx(YStack, {
812
- padding: framePadding,
813
- gap: frameGap,
814
- children: /* @__PURE__ */_jsx(PanelIconEchoBoxContext.Provider, {
815
- value: iconEcho != null && anchor && placement && echoOverlays ? echoHeaderBox({
816
- offset: echoShift,
817
- width: anchor.width,
818
- height: (_ref6 = echoCover === null || echoCover === void 0 ? void 0 : echoCover.height) !== null && _ref6 !== void 0 ? _ref6 : anchor.height,
819
- panelWidth: placement.width,
820
- rtl: I18nManager.isRTL
821
- }) : null,
872
+ ...(popUp ? {
873
+ contentOffset: {
874
+ x: 0,
875
+ y: scrollTop
876
+ },
877
+ scrollEnabled: scrolls,
878
+ bounces: scrolls,
879
+ onScroll: handleScroll,
880
+ scrollEventThrottle: 16
881
+ } : null),
882
+ children: /* @__PURE__ */_jsx(RNView, {
883
+ testID: "floating-panel-menu-content",
884
+ collapsable: false,
885
+ onLayout: popUp ? function (e) {
886
+ return setContentHeight(e.nativeEvent.layout.height);
887
+ } : void 0,
888
+ children: /* @__PURE__ */_jsx(YStack, {
889
+ padding: framePadding,
890
+ gap: frameGap,
822
891
  children
823
892
  })
824
893
  })
825
- }), iconEcho != null && anchor && ((placement === null || placement === void 0 ? void 0 : placement.up) || echoOverlays) ? /* @__PURE__ */_jsx(IconEchoBand, {
826
- anchor,
827
- cover: echoCover,
828
- shift: echoShift,
829
- borderWidth,
830
- edge: echoOverlays ? "overlay" : "bottom",
831
- children: iconEcho
894
+ }), scrolls ? /* @__PURE__ */_jsxs(_Fragment, {
895
+ children: [/* @__PURE__ */_jsx(ScrollBand, {
896
+ direction: "up",
897
+ band,
898
+ visible: arrows.up,
899
+ glyphColor,
900
+ onPress: scrollPage
901
+ }), /* @__PURE__ */_jsx(ScrollBand, {
902
+ direction: "down",
903
+ band,
904
+ visible: arrows.down,
905
+ glyphColor,
906
+ onPress: scrollPage
907
+ })]
832
908
  }) : null]
833
909
  })
834
910
  }))
835
911
  })]
836
912
  });
837
913
  }
838
- function IconEchoBand(param) {
914
+ function ScrollBand(param) {
839
915
  var {
840
- anchor,
841
- cover = null,
842
- shift,
843
- borderWidth,
844
- edge,
845
- children
916
+ direction,
917
+ band,
918
+ visible,
919
+ glyphColor,
920
+ onPress
846
921
  } = param;
847
- var _ref, _ref1;
848
- var bandHeight = (_ref = cover === null || cover === void 0 ? void 0 : cover.height) !== null && _ref !== void 0 ? _ref : anchor.height;
849
- return /* @__PURE__ */_jsx(RNView, {
850
- testID: "floating-panel-icon-echo-band",
851
- pointerEvents: "box-none",
852
- style: edge === "overlay" ? {
922
+ var {
923
+ knobProps
924
+ } = useResolvedKnobs({
925
+ painted: false
926
+ });
927
+ var Icon = direction === "up" ? CaretUpIcon : CaretDownIcon;
928
+ if (!visible) return null;
929
+ return /* @__PURE__ */_jsx(Pressable, {
930
+ testID: `floating-panel-scroll-${direction}`,
931
+ onPress: function onPress1() {
932
+ return onPress(direction);
933
+ },
934
+ accessibilityElementsHidden: true,
935
+ importantForAccessibility: "no-hide-descendants",
936
+ style: {
853
937
  position: "absolute",
854
- top: -borderWidth,
855
- start: -borderWidth,
856
- end: -borderWidth,
857
- height: bandHeight,
858
- zIndex: 1
859
- } : {
860
- height: bandHeight,
861
- marginHorizontal: -borderWidth,
862
- ...(edge === "top" ? {
863
- marginTop: -borderWidth
938
+ start: 0,
939
+ end: 0,
940
+ height: band,
941
+ zIndex: 1,
942
+ ...(direction === "up" ? {
943
+ top: 0
864
944
  } : {
865
- marginBottom: -borderWidth
945
+ bottom: 0
866
946
  })
867
947
  },
868
- children: /* @__PURE__ */_jsx(RNView, {
869
- style: {
870
- width: anchor.width,
871
- height: anchor.height,
872
- marginStart: shift,
873
- marginTop: (_ref1 = cover === null || cover === void 0 ? void 0 : cover.top) !== null && _ref1 !== void 0 ? _ref1 : 0,
874
- alignItems: "flex-start",
875
- justifyContent: "flex-start"
876
- },
877
- children
948
+ children: /* @__PURE__ */_jsx(View, {
949
+ flex: 1,
950
+ alignItems: "center",
951
+ justifyContent: "center",
952
+ backgroundColor: knobProps.elevatedSurface.backgroundColor,
953
+ children: /* @__PURE__ */_jsx(Icon, {
954
+ size: knobProps.controlIcon.width,
955
+ color: glyphColor
956
+ })
878
957
  })
879
958
  });
880
959
  }
@@ -904,6 +983,8 @@ function PointPanel(param) {
904
983
  }) : null;
905
984
  return /* @__PURE__ */_jsxs(RNView, {
906
985
  style: StyleSheet.absoluteFill,
986
+ testID: "floating-panel-point-layer",
987
+ accessibilityViewIsModal: true,
907
988
  children: [/* @__PURE__ */_jsx(Pressable, {
908
989
  style: StyleSheet.absoluteFill,
909
990
  onPress: onBackdropPress,