@multiplatform.one/forms 7.72.0 → 7.74.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 (211) hide show
  1. package/dist/cjs/Button/IconButtonGroup.cjs +32 -0
  2. package/dist/cjs/Button/IconButtonGroup.native.js +32 -0
  3. package/dist/cjs/Button/IconButtonGroup.native.js.map +1 -1
  4. package/dist/cjs/Button/circleGlyph.cjs +28 -0
  5. package/dist/cjs/Button/circleGlyph.native.js +31 -0
  6. package/dist/cjs/Button/circleGlyph.native.js.map +1 -0
  7. package/dist/cjs/Button/glass.cjs +4 -1
  8. package/dist/cjs/Button/iconButtonGroupContext.native.js.map +1 -1
  9. package/dist/cjs/Button/index.cjs +44 -15
  10. package/dist/cjs/Button/index.native.js +52 -17
  11. package/dist/cjs/Button/index.native.js.map +1 -1
  12. package/dist/cjs/Button/webGlass.cjs +62 -0
  13. package/dist/cjs/Button/webGlass.native.js +68 -0
  14. package/dist/cjs/Button/webGlass.native.js.map +1 -0
  15. package/dist/cjs/FloatingPanel/PanelHeader.cjs +49 -0
  16. package/dist/cjs/FloatingPanel/PanelHeader.native.js +53 -0
  17. package/dist/cjs/FloatingPanel/PanelHeader.native.js.map +1 -0
  18. package/dist/cjs/FloatingPanel/echoContext.cjs +28 -0
  19. package/dist/cjs/FloatingPanel/echoContext.native.js +29 -0
  20. package/dist/cjs/FloatingPanel/echoContext.native.js.map +1 -1
  21. package/dist/cjs/FloatingPanel/iconEcho.cjs +104 -0
  22. package/dist/cjs/FloatingPanel/iconEcho.native.js +114 -0
  23. package/dist/cjs/FloatingPanel/iconEcho.native.js.map +1 -0
  24. package/dist/cjs/FloatingPanel/index.cjs +168 -15
  25. package/dist/cjs/FloatingPanel/index.native.js +77 -8
  26. package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
  27. package/dist/cjs/FloatingPanel/paintedBox.cjs +80 -0
  28. package/dist/cjs/FloatingPanel/paintedBox.native.js +85 -0
  29. package/dist/cjs/FloatingPanel/paintedBox.native.js.map +1 -0
  30. package/dist/cjs/FloatingPanel/pointAnchor.cjs +22 -3
  31. package/dist/cjs/FloatingPanel/pointAnchor.native.js +26 -7
  32. package/dist/cjs/FloatingPanel/pointAnchor.native.js.map +1 -1
  33. package/dist/cjs/FloatingPanel/useFloatingPanel.cjs +2 -1
  34. package/dist/cjs/FloatingPanel/useFloatingPanel.native.js +3 -1
  35. package/dist/cjs/FloatingPanel/useFloatingPanel.native.js.map +1 -1
  36. package/dist/cjs/fields/FileUpload/index.cjs +8 -3
  37. package/dist/cjs/fields/FileUpload/index.native.js +8 -3
  38. package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
  39. package/dist/cjs/index.cjs +2 -0
  40. package/dist/cjs/index.native.js +2 -0
  41. package/dist/cjs/index.native.js.map +1 -1
  42. package/dist/esm/Button/IconButtonGroup.mjs +32 -0
  43. package/dist/esm/Button/IconButtonGroup.mjs.map +1 -1
  44. package/dist/esm/Button/IconButtonGroup.native.js +32 -0
  45. package/dist/esm/Button/IconButtonGroup.native.js.map +1 -1
  46. package/dist/esm/Button/circleGlyph.mjs +3 -0
  47. package/dist/esm/Button/circleGlyph.mjs.map +1 -0
  48. package/dist/esm/Button/circleGlyph.native.js +3 -0
  49. package/dist/esm/Button/circleGlyph.native.js.map +1 -0
  50. package/dist/esm/Button/glass.mjs +4 -2
  51. package/dist/esm/Button/glass.mjs.map +1 -1
  52. package/dist/esm/Button/iconButtonGroupContext.mjs.map +1 -1
  53. package/dist/esm/Button/iconButtonGroupContext.native.js.map +1 -1
  54. package/dist/esm/Button/index.mjs +44 -16
  55. package/dist/esm/Button/index.mjs.map +1 -1
  56. package/dist/esm/Button/index.native.js +52 -18
  57. package/dist/esm/Button/index.native.js.map +1 -1
  58. package/dist/esm/Button/webGlass.mjs +36 -0
  59. package/dist/esm/Button/webGlass.mjs.map +1 -0
  60. package/dist/esm/Button/webGlass.native.js +39 -0
  61. package/dist/esm/Button/webGlass.native.js.map +1 -0
  62. package/dist/esm/FloatingPanel/PanelHeader.mjs +24 -0
  63. package/dist/esm/FloatingPanel/PanelHeader.mjs.map +1 -0
  64. package/dist/esm/FloatingPanel/PanelHeader.native.js +25 -0
  65. package/dist/esm/FloatingPanel/PanelHeader.native.js.map +1 -0
  66. package/dist/esm/FloatingPanel/echoContext.mjs +25 -1
  67. package/dist/esm/FloatingPanel/echoContext.mjs.map +1 -1
  68. package/dist/esm/FloatingPanel/echoContext.native.js +26 -1
  69. package/dist/esm/FloatingPanel/echoContext.native.js.map +1 -1
  70. package/dist/esm/FloatingPanel/iconEcho.mjs +77 -0
  71. package/dist/esm/FloatingPanel/iconEcho.mjs.map +1 -0
  72. package/dist/esm/FloatingPanel/iconEcho.native.js +84 -0
  73. package/dist/esm/FloatingPanel/iconEcho.native.js.map +1 -0
  74. package/dist/esm/FloatingPanel/index.mjs +169 -16
  75. package/dist/esm/FloatingPanel/index.mjs.map +1 -1
  76. package/dist/esm/FloatingPanel/index.native.js +79 -10
  77. package/dist/esm/FloatingPanel/index.native.js.map +1 -1
  78. package/dist/esm/FloatingPanel/paintedBox.mjs +52 -0
  79. package/dist/esm/FloatingPanel/paintedBox.mjs.map +1 -0
  80. package/dist/esm/FloatingPanel/paintedBox.native.js +54 -0
  81. package/dist/esm/FloatingPanel/paintedBox.native.js.map +1 -0
  82. package/dist/esm/FloatingPanel/pointAnchor.mjs +22 -3
  83. package/dist/esm/FloatingPanel/pointAnchor.mjs.map +1 -1
  84. package/dist/esm/FloatingPanel/pointAnchor.native.js +26 -7
  85. package/dist/esm/FloatingPanel/pointAnchor.native.js.map +1 -1
  86. package/dist/esm/FloatingPanel/useFloatingPanel.mjs +2 -1
  87. package/dist/esm/FloatingPanel/useFloatingPanel.mjs.map +1 -1
  88. package/dist/esm/FloatingPanel/useFloatingPanel.native.js +3 -1
  89. package/dist/esm/FloatingPanel/useFloatingPanel.native.js.map +1 -1
  90. package/dist/esm/fields/FileUpload/index.mjs +8 -3
  91. package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
  92. package/dist/esm/fields/FileUpload/index.native.js +8 -3
  93. package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
  94. package/dist/esm/index.mjs +2 -1
  95. package/dist/esm/index.mjs.map +1 -1
  96. package/dist/esm/index.native.js +2 -1
  97. package/dist/esm/index.native.js.map +1 -1
  98. package/dist/jsx/Button/IconButtonGroup.mjs +32 -0
  99. package/dist/jsx/Button/IconButtonGroup.mjs.map +1 -1
  100. package/dist/jsx/Button/IconButtonGroup.native.js +32 -0
  101. package/dist/jsx/Button/IconButtonGroup.native.js.map +1 -1
  102. package/dist/jsx/Button/circleGlyph.mjs +3 -0
  103. package/dist/jsx/Button/circleGlyph.mjs.map +1 -0
  104. package/dist/jsx/Button/circleGlyph.native.js +31 -0
  105. package/dist/jsx/Button/circleGlyph.native.js.map +1 -0
  106. package/dist/jsx/Button/glass.mjs +4 -2
  107. package/dist/jsx/Button/glass.mjs.map +1 -1
  108. package/dist/jsx/Button/iconButtonGroupContext.mjs.map +1 -1
  109. package/dist/jsx/Button/iconButtonGroupContext.native.js.map +1 -1
  110. package/dist/jsx/Button/index.mjs +44 -16
  111. package/dist/jsx/Button/index.mjs.map +1 -1
  112. package/dist/jsx/Button/index.native.js +52 -17
  113. package/dist/jsx/Button/index.native.js.map +1 -1
  114. package/dist/jsx/Button/webGlass.mjs +36 -0
  115. package/dist/jsx/Button/webGlass.mjs.map +1 -0
  116. package/dist/jsx/Button/webGlass.native.js +68 -0
  117. package/dist/jsx/Button/webGlass.native.js.map +1 -0
  118. package/dist/jsx/FloatingPanel/PanelHeader.mjs +24 -0
  119. package/dist/jsx/FloatingPanel/PanelHeader.mjs.map +1 -0
  120. package/dist/jsx/FloatingPanel/PanelHeader.native.js +53 -0
  121. package/dist/jsx/FloatingPanel/PanelHeader.native.js.map +1 -0
  122. package/dist/jsx/FloatingPanel/echoContext.mjs +25 -1
  123. package/dist/jsx/FloatingPanel/echoContext.mjs.map +1 -1
  124. package/dist/jsx/FloatingPanel/echoContext.native.js +29 -0
  125. package/dist/jsx/FloatingPanel/echoContext.native.js.map +1 -1
  126. package/dist/jsx/FloatingPanel/iconEcho.mjs +77 -0
  127. package/dist/jsx/FloatingPanel/iconEcho.mjs.map +1 -0
  128. package/dist/jsx/FloatingPanel/iconEcho.native.js +114 -0
  129. package/dist/jsx/FloatingPanel/iconEcho.native.js.map +1 -0
  130. package/dist/jsx/FloatingPanel/index.mjs +169 -16
  131. package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
  132. package/dist/jsx/FloatingPanel/index.native.js +77 -8
  133. package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
  134. package/dist/jsx/FloatingPanel/paintedBox.mjs +52 -0
  135. package/dist/jsx/FloatingPanel/paintedBox.mjs.map +1 -0
  136. package/dist/jsx/FloatingPanel/paintedBox.native.js +85 -0
  137. package/dist/jsx/FloatingPanel/paintedBox.native.js.map +1 -0
  138. package/dist/jsx/FloatingPanel/pointAnchor.mjs +22 -3
  139. package/dist/jsx/FloatingPanel/pointAnchor.mjs.map +1 -1
  140. package/dist/jsx/FloatingPanel/pointAnchor.native.js +26 -7
  141. package/dist/jsx/FloatingPanel/pointAnchor.native.js.map +1 -1
  142. package/dist/jsx/FloatingPanel/useFloatingPanel.mjs +2 -1
  143. package/dist/jsx/FloatingPanel/useFloatingPanel.mjs.map +1 -1
  144. package/dist/jsx/FloatingPanel/useFloatingPanel.native.js +3 -1
  145. package/dist/jsx/FloatingPanel/useFloatingPanel.native.js.map +1 -1
  146. package/dist/jsx/fields/FileUpload/index.mjs +8 -3
  147. package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
  148. package/dist/jsx/fields/FileUpload/index.native.js +8 -3
  149. package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
  150. package/dist/jsx/index.js +2 -1
  151. package/dist/jsx/index.js.map +1 -1
  152. package/dist/jsx/index.mjs +2 -1
  153. package/dist/jsx/index.mjs.map +1 -1
  154. package/dist/jsx/index.native.js +2 -0
  155. package/dist/jsx/index.native.js.map +1 -1
  156. package/package.json +8 -8
  157. package/src/Button/Button.accentInk.spec.tsx +39 -8
  158. package/src/Button/Button.iconButton.spec.tsx +143 -3
  159. package/src/Button/Button.stories.tsx +55 -38
  160. package/src/Button/IconButtonGroup.spec.tsx +26 -0
  161. package/src/Button/IconButtonGroup.tsx +39 -0
  162. package/src/Button/circleGlyph.ts +6 -0
  163. package/src/Button/glass.spec.ts +73 -0
  164. package/src/Button/glass.ts +8 -3
  165. package/src/Button/iconButtonGroupContext.ts +2 -1
  166. package/src/Button/index.tsx +68 -17
  167. package/src/Button/webGlass.ts +42 -0
  168. package/src/FloatingPanel/FloatingPanel.iconEcho.spec.tsx +297 -0
  169. package/src/FloatingPanel/FloatingPanel.menuFace.native.spec.tsx +87 -1
  170. package/src/FloatingPanel/PanelHeader.tsx +26 -0
  171. package/src/FloatingPanel/echoContext.ts +45 -0
  172. package/src/FloatingPanel/iconEcho.tsx +118 -0
  173. package/src/FloatingPanel/index.native.tsx +115 -4
  174. package/src/FloatingPanel/index.tsx +238 -16
  175. package/src/FloatingPanel/paintedBox.spec.ts +95 -0
  176. package/src/FloatingPanel/paintedBox.ts +75 -0
  177. package/src/FloatingPanel/pointAnchor.spec.ts +47 -0
  178. package/src/FloatingPanel/pointAnchor.ts +28 -0
  179. package/src/FloatingPanel/useFloatingPanel.ts +6 -1
  180. package/src/fields/FileUpload/FileUpload.spec.tsx +8 -0
  181. package/src/fields/FileUpload/index.tsx +12 -4
  182. package/src/index.ts +2 -0
  183. package/types/Button/IconButtonGroup.d.ts.map +1 -1
  184. package/types/Button/circleGlyph.d.ts +7 -0
  185. package/types/Button/circleGlyph.d.ts.map +1 -0
  186. package/types/Button/glass.d.ts +5 -2
  187. package/types/Button/glass.d.ts.map +1 -1
  188. package/types/Button/iconButtonGroupContext.d.ts +2 -1
  189. package/types/Button/iconButtonGroupContext.d.ts.map +1 -1
  190. package/types/Button/index.d.ts +7 -4
  191. package/types/Button/index.d.ts.map +1 -1
  192. package/types/Button/webGlass.d.ts +32 -0
  193. package/types/Button/webGlass.d.ts.map +1 -0
  194. package/types/FloatingPanel/PanelHeader.d.ts +9 -0
  195. package/types/FloatingPanel/PanelHeader.d.ts.map +1 -0
  196. package/types/FloatingPanel/echoContext.d.ts +24 -0
  197. package/types/FloatingPanel/echoContext.d.ts.map +1 -1
  198. package/types/FloatingPanel/iconEcho.d.ts +29 -0
  199. package/types/FloatingPanel/iconEcho.d.ts.map +1 -0
  200. package/types/FloatingPanel/index.d.ts +10 -0
  201. package/types/FloatingPanel/index.d.ts.map +1 -1
  202. package/types/FloatingPanel/index.native.d.ts +1 -1
  203. package/types/FloatingPanel/index.native.d.ts.map +1 -1
  204. package/types/FloatingPanel/paintedBox.d.ts +29 -0
  205. package/types/FloatingPanel/paintedBox.d.ts.map +1 -0
  206. package/types/FloatingPanel/pointAnchor.d.ts +10 -1
  207. package/types/FloatingPanel/pointAnchor.d.ts.map +1 -1
  208. package/types/FloatingPanel/useFloatingPanel.d.ts.map +1 -1
  209. package/types/fields/FileUpload/index.d.ts.map +1 -1
  210. package/types/index.d.ts +2 -0
  211. package/types/index.d.ts.map +1 -1
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
+ value: true
24
+ }), mod);
25
+ var iconEcho_exports = {};
26
+ __export(iconEcho_exports, {
27
+ ICON_ECHO_TEST_ID: () => ICON_ECHO_TEST_ID,
28
+ iconEchoElement: () => iconEchoElement,
29
+ iconEchoOverlays: () => iconEchoOverlays
30
+ });
31
+ module.exports = __toCommonJS(iconEcho_exports);
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var import_react = require("@phosphor-icons/react");
34
+ var import_react2 = require("react");
35
+ var import_theme = require("@multiplatform.one/theme");
36
+ var import_tamagui = require("tamagui");
37
+ var import_circleGlyph = require("../Button/circleGlyph.native.js");
38
+ var import_t = require("../shared/t.native.js");
39
+ var ICON_ECHO_TEST_ID = "floating-panel-icon-echo";
40
+ var DROPPED_PROPS = ["id", "onLongPress", "onKeyDown", "onContextMenu", "aria-haspopup", "aria-expanded", "aria-controls", "aria-describedby", "tooltip"];
41
+ function iconEchoOverlays(kind, up) {
42
+ return kind === "close" && !up;
43
+ }
44
+ function iconEchoElement(trigger, kind, onClose, surface) {
45
+ var echo = echoOf(trigger, kind, onClose);
46
+ if (echo == null || !surface) return echo;
47
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_theme.SurfaceContext.Provider, {
48
+ ...surface,
49
+ children: echo
50
+ });
51
+ }
52
+ function echoOf(trigger, _kind, onClose) {
53
+ if (! /* @__PURE__ */(0, import_react2.isValidElement)(trigger)) return null;
54
+ var props = trigger.props;
55
+ var label = (0, import_t.t)("Close");
56
+ var dropped = Object.fromEntries(DROPPED_PROPS.map(function (name) {
57
+ return [name, void 0];
58
+ }));
59
+ if (props.icon != null) {
60
+ return /* @__PURE__ */(0, import_react2.cloneElement)(trigger, {
61
+ ...dropped,
62
+ ref: null,
63
+ icon: import_react.XIcon,
64
+ "aria-label": label,
65
+ onPress: onClose,
66
+ testID: ICON_ECHO_TEST_ID,
67
+ "data-testid": ICON_ECHO_TEST_ID
68
+ });
69
+ }
70
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(CircleClose, {
71
+ label,
72
+ onClose
73
+ });
74
+ }
75
+ var avatarPlate = "$selectedBackground";
76
+ var circleGlyphFallbackPx = 18;
77
+ function CircleClose(param) {
78
+ var {
79
+ label,
80
+ onClose
81
+ } = param;
82
+ var _ref;
83
+ var _theme_selectedColor, _theme_color;
84
+ var theme = (0, import_tamagui.useTheme)();
85
+ var [side, setSide] = (0, import_react2.useState)(0);
86
+ return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_tamagui.View, {
87
+ role: "button",
88
+ "aria-label": label,
89
+ tabIndex: 0,
90
+ cursor: "pointer",
91
+ width: "100%",
92
+ height: "100%",
93
+ borderRadius: 1e5,
94
+ backgroundColor: avatarPlate,
95
+ alignItems: "center",
96
+ justifyContent: "center",
97
+ pressStyle: {
98
+ opacity: 0.6
99
+ },
100
+ onPress: onClose,
101
+ onLayout: function onLayout(event) {
102
+ return setSide(Math.min(event.nativeEvent.layout.width, event.nativeEvent.layout.height));
103
+ },
104
+ testID: ICON_ECHO_TEST_ID,
105
+ "data-testid": ICON_ECHO_TEST_ID,
106
+ children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.XIcon, {
107
+ size: side > 0 ? Math.round(side * import_circleGlyph.ICON_BUTTON_CIRCLE_GLYPH_RATIO) : circleGlyphFallbackPx,
108
+ weight: "bold",
109
+ color: (_ref = (_theme_selectedColor = theme.selectedColor) === null || _theme_selectedColor === void 0 ? void 0 : _theme_selectedColor.val) !== null && _ref !== void 0 ? _ref : (_theme_color = theme.color) === null || _theme_color === void 0 ? void 0 : _theme_color.val,
110
+ "aria-hidden": true
111
+ })
112
+ });
113
+ }
114
+ //# sourceMappingURL=iconEcho.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","iconEcho_exports","ICON_ECHO_TEST_ID","iconEchoElement","iconEchoOverlays","module","exports","import_jsx_runtime","require","import_react","import_react2","import_theme","import_tamagui","import_circleGlyph","import_t","DROPPED_PROPS","kind","up","trigger","onClose","surface","echo","echoOf","jsx","SurfaceContext","Provider","children","_kind","isValidElement","props","label","t","dropped","fromEntries","map","icon","cloneElement","ref","XIcon","onPress","testID","CircleClose"],"sources":["../../../src/FloatingPanel/iconEcho.tsx"],"sourcesContent":[null],"mappings":"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","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { transitionProps } from "@multiplatform.one/theme";
2
2
  import { cloneElement, isValidElement, useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
3
- import { OVERLAY_ANCHOR_GAP, OVERLAY_ATTACH_GAP, OVERLAY_BREAKPOINT, Surface, useResolvedKnobs, wasKeyboardFocus, ensureKeyboardModalityTracking, motionDurationMs } from "@multiplatform.one/theme";
3
+ import { OVERLAY_ANCHOR_GAP, OVERLAY_ATTACH_GAP, OVERLAY_BREAKPOINT, Surface, SurfaceContext, useResolvedKnobs, wasKeyboardFocus, ensureKeyboardModalityTracking, motionDurationMs } from "@multiplatform.one/theme";
4
4
  import { isWeb, Sheet, Theme, View, YStack } from "tamagui";
5
5
  import { useClick, useDismiss, useInteractions } from "@floating-ui/react";
6
6
  import { ScrollArrow } from "../shared/floatingList.mjs";
@@ -14,6 +14,9 @@ import { OverlayStackProvider, useInsideOverlay, useOverlayZIndex } from "../sha
14
14
  import { resolveCompactFace } from "./compactFace.mjs";
15
15
  import { isNestedPanelAction } from "./nestedAction.mjs";
16
16
  import { PanelPortal } from "./PanelPortal.mjs";
17
+ import { echoHeaderBox, PanelIconEchoBoxContext, sameEchoBox } from "./echoContext.mjs";
18
+ import { iconEchoElement, iconEchoOverlays } from "./iconEcho.mjs";
19
+ import { groupSurfaceOf, paintedTriggerBox } from "./paintedBox.mjs";
17
20
  import { contextMenuPoint, placeOverTrigger, pointOpensUp, pointPanelLeft, referenceCornerPoint } from "./pointAnchor.mjs";
18
21
  import { floatingPanelActionProps, isNestedPanelAction as isNestedPanelAction2 } from "./nestedAction.mjs";
19
22
  import { useFloatingPanel as useFloatingPanel2, panelAnimationDuration, panelGrowDuration, panelTransition, panelViewportPadding as panelViewportPadding2, panelAnchorOffset, resolvePanelWidthMode } from "./useFloatingPanel.mjs";
@@ -226,6 +229,76 @@ function placeEchoOverTrigger(panelElement, geometry, {
226
229
  }
227
230
  }
228
231
  }
232
+ function IconEchoRow({
233
+ children
234
+ }) {
235
+ return /* @__PURE__ */jsx(View, {
236
+ "data-fp-icon-echo": "",
237
+ flexShrink: 0,
238
+ alignSelf: "stretch",
239
+ pointerEvents: "box-none",
240
+ style: {
241
+ order: -1,
242
+ position: "sticky",
243
+ zIndex: 1
244
+ },
245
+ children: /* @__PURE__ */jsx(View, {
246
+ "data-fp-icon-echo-box": "",
247
+ alignItems: "flex-start",
248
+ justifyContent: "flex-start",
249
+ children
250
+ })
251
+ });
252
+ }
253
+ function placeIconEcho(panelElement, {
254
+ offset,
255
+ width,
256
+ height,
257
+ up,
258
+ overlay,
259
+ group = null
260
+ }) {
261
+ const row = panelElement.querySelector("[data-fp-icon-echo]");
262
+ const box = row?.querySelector("[data-fp-icon-echo-box]");
263
+ if (!row || !box) return;
264
+ const frame = getComputedStyle(panelElement);
265
+ const border = side => parseFloat(frame[`border${side}Width`] || "0") || 0;
266
+ const rtl = panelElement.dir === "rtl";
267
+ row.style.order = up ? "1" : "-1";
268
+ row.style.height = `${height}px`;
269
+ row.style.backgroundColor = overlay ? "transparent" : frame.backgroundColor;
270
+ if (up) {
271
+ row.style.top = "";
272
+ row.style.marginTop = "";
273
+ row.style.marginBottom = `${-border("Bottom")}px`;
274
+ row.style.bottom = row.style.marginBottom;
275
+ } else {
276
+ row.style.bottom = "";
277
+ row.style.marginTop = `${-border("Top")}px`;
278
+ row.style.marginBottom = overlay ? `${-(height - border("Top"))}px` : "";
279
+ row.style.top = row.style.marginTop;
280
+ }
281
+ row.setAttribute("data-fp-icon-echo", overlay ? "overlay" : "band");
282
+ if (group) {
283
+ row.style.height = `${group.height}px`;
284
+ if (!up && overlay) row.style.marginBottom = `${-(group.height - border("Top"))}px`;
285
+ }
286
+ row.style.marginLeft = `${-border("Left")}px`;
287
+ row.style.marginRight = `${-border("Right")}px`;
288
+ box.style.width = `${width}px`;
289
+ box.style.height = `${height}px`;
290
+ box.style.marginLeft = rtl ? "" : `${offset}px`;
291
+ box.style.marginRight = rtl ? `${offset}px` : "";
292
+ box.style.alignSelf = "flex-start";
293
+ box.style.marginTop = group ? `${group.top}px` : "";
294
+ box.style.position = "relative";
295
+ box.style.zIndex = "1";
296
+ }
297
+ function layoutParentOf(element) {
298
+ let parent = element?.parentElement ?? null;
299
+ while (parent && getComputedStyle(parent).display === "contents") parent = parent.parentElement;
300
+ return parent;
301
+ }
229
302
  const overlayFloatBreakpoint = OVERLAY_BREAKPOINT;
230
303
  function subscribeViewport(listener) {
231
304
  if (!isWeb || typeof window === "undefined") return () => {};
@@ -418,6 +491,7 @@ function FloatingPanelWeb({
418
491
  cover = true,
419
492
  triggerEcho = true,
420
493
  coverAlign = "start",
494
+ iconEcho,
421
495
  triggerRow,
422
496
  anchorRect,
423
497
  clampCollisions = false,
@@ -427,6 +501,11 @@ function FloatingPanelWeb({
427
501
  const [collisionSheet, setCollisionSheet] = useState(false);
428
502
  const isFill = sizing === "fill";
429
503
  const isContextMenu = openOn === "contextmenu";
504
+ const pointMenu = isContextMenu && sheetProps.anchorMode !== "cover-trigger";
505
+ const showIconEcho = cover && !pointMenu && iconEcho != null;
506
+ const triggerSurface = SurfaceContext.useStyledContext();
507
+ const iconEchoUpRef = useRef(false);
508
+ const [echoBox, setEchoBox] = useState(null);
430
509
  const overlayStyleRef = useRef(null);
431
510
  const pinnedTopRef = useRef(0);
432
511
  const pinnedHeightRef = useRef(0);
@@ -458,10 +537,10 @@ function FloatingPanelWeb({
458
537
  wheelGrowRef: isFill ? void 0 : grownRef,
459
538
  widthMode: widthMode ?? (isContextMenu && fitContent === void 0 ? "fit-content" : void 0),
460
539
  fitContent,
461
- freeOverlay: isContextMenu,
540
+ freeOverlay: pointMenu,
462
541
  cover,
463
542
  panelWidth,
464
- echo: cover && triggerEcho && !isContextMenu,
543
+ echo: cover && triggerEcho && !pointMenu,
465
544
  onBeforeOpen: resetPosition
466
545
  });
467
546
  useReturnFocusOnClose(open, skipReturnFocusRef, panel.refs.floating);
@@ -485,7 +564,7 @@ function FloatingPanelWeb({
485
564
  if (pinnedTopRef.current === 0 && pinnedHeightRef.current === 0) {
486
565
  dropdownElement.scrollTop = 0;
487
566
  }
488
- const point = isContextMenu ? anchorPointRef.current ?? referenceCornerPoint(trig, isRtl()) : null;
567
+ const point = pointMenu ? anchorPointRef.current ?? referenceCornerPoint(trig, isRtl()) : null;
489
568
  const measured = anchorRect ? {
490
569
  ...anchorRect,
491
570
  top: anchorRect.y,
@@ -514,6 +593,9 @@ function FloatingPanelWeb({
514
593
  const viewportRight = viewportLeft + (viewport?.width ?? (document.documentElement.clientWidth || window.innerWidth));
515
594
  const viewportBottom = viewportTop + (viewport?.height ?? window.innerHeight);
516
595
  dropdownElement.style.left = `${viewportLeft - containingBlock.left}px`;
596
+ const groupSurface = showIconEcho ? groupSurfaceOf(trig) : null;
597
+ const groupBox = groupSurface?.getBoundingClientRect() ?? null;
598
+ if (showIconEcho) dropdownElement.style.minWidth = groupBox ? `${groupBox.width}px` : "";
517
599
  const layoutStyle = getComputedStyle(dropdownElement);
518
600
  const scale = layoutStyle.transform && layoutStyle.transform !== "none" && typeof DOMMatrixReadOnly !== "undefined" ? Math.abs(new DOMMatrixReadOnly(layoutStyle.transform).a) : 1;
519
601
  const layoutWidth = dropdownElement.getBoundingClientRect().width / (scale || 1);
@@ -552,7 +634,35 @@ function FloatingPanelWeb({
552
634
  const neededHeight = sheetProps.scrollable ? Math.min(totalContentHeight, measured.height + firstActionHeight + bodyPadding + totalBorderWidth) : totalContentHeight;
553
635
  let placedTop = measured.top;
554
636
  let placedLeft = left;
555
- if (measured.width > 0 && measured.height > 0 && (!slides && (left < viewportLeft || left + width > Math.max(measured.right, viewportRight - panelViewportPadding)) || measured.right > viewportRight || measured.top < viewportTop || measured.top + Math.max(neededHeight, measured.height) > viewportBottom - panelViewportPadding)) {
637
+ let placedMaxHeight = null;
638
+ iconEchoUpRef.current = false;
639
+ if (showIconEcho && measured.width > 0 && measured.height > 0) {
640
+ const painted = groupBox ?? paintedTriggerBox(trig, measured);
641
+ const placed = placeOverTrigger({
642
+ trigger: {
643
+ x: painted.left,
644
+ y: groupBox ? groupBox.top : measured.top,
645
+ width: painted.right - painted.left,
646
+ height: groupBox ? groupBox.height : measured.height
647
+ },
648
+ width,
649
+ height: totalContentHeight,
650
+ bounds: {
651
+ top: viewportTop + panelViewportPadding,
652
+ left: viewportLeft + panelViewportPadding,
653
+ right: viewportRight - panelViewportPadding,
654
+ bottom: viewportBottom - panelViewportPadding
655
+ },
656
+ rtl,
657
+ align: coverAlign,
658
+ pinned: true
659
+ });
660
+ placedTop = placed.top;
661
+ if (!slides) placedLeft = placed.left;
662
+ alignEnd = placed.end;
663
+ placedMaxHeight = placed.maxHeight;
664
+ iconEchoUpRef.current = placed.up;
665
+ } else if (measured.width > 0 && measured.height > 0 && (!slides && (left < viewportLeft || left + width > Math.max(measured.right, viewportRight - panelViewportPadding)) || measured.right > viewportRight || measured.top < viewportTop || measured.top + Math.max(neededHeight, measured.height) > viewportBottom - panelViewportPadding)) {
556
666
  if (!clampCollisions && !iconCover) {
557
667
  dropdownElement.style.visibility = "hidden";
558
668
  setCollisionSheet(true);
@@ -581,6 +691,33 @@ function FloatingPanelWeb({
581
691
  alignEnd = placed.end;
582
692
  }
583
693
  coverAlignEndRef.current = alignEnd;
694
+ const echoStart = echoOffset({
695
+ triggerLeft: measured.left,
696
+ triggerRight: measured.right,
697
+ panelLeft: placedLeft,
698
+ panelWidth: width,
699
+ rtl
700
+ });
701
+ const echoOverlays = iconEcho != null && iconEchoOverlays(iconEcho, iconEchoUpRef.current);
702
+ const nextEchoBox = showIconEcho && echoOverlays ? echoHeaderBox({
703
+ offset: echoStart,
704
+ width: measured.width,
705
+ height: measured.height,
706
+ panelWidth: width,
707
+ rtl
708
+ }) : null;
709
+ setEchoBox(previous => sameEchoBox(previous, nextEchoBox) ? previous : nextEchoBox);
710
+ placeIconEcho(dropdownElement, {
711
+ offset: echoStart,
712
+ width: measured.width,
713
+ height: measured.height,
714
+ up: iconEchoUpRef.current,
715
+ overlay: echoOverlays,
716
+ group: groupSurface && groupBox ? {
717
+ top: measured.top - groupBox.top,
718
+ height: groupBox.height
719
+ } : null
720
+ });
584
721
  placeEchoOverTrigger(dropdownElement, {
585
722
  triggerLeft: measured.left,
586
723
  triggerRight: measured.right,
@@ -592,12 +729,12 @@ function FloatingPanelWeb({
592
729
  });
593
730
  const top2 = placedTop - containingBlock.top;
594
731
  const cssLeft2 = placedLeft - containingBlock.left;
595
- const maxHeight = Math.max(0, viewportBottom - panelViewportPadding - placedTop);
732
+ const maxHeight = placedMaxHeight ?? Math.max(0, viewportBottom - panelViewportPadding - placedTop);
596
733
  dropdownElement.style.top = `${top2}px`;
597
734
  dropdownElement.style.left = `${cssLeft2}px`;
598
735
  dropdownElement.style.maxHeight = `${maxHeight}px`;
599
736
  dropdownElement.dir = rtl ? "rtl" : "ltr";
600
- dropdownElement.style.transformOrigin = rtl !== alignEnd ? "top right" : "top left";
737
+ dropdownElement.style.transformOrigin = `${iconEchoUpRef.current ? "bottom" : "top"} ${rtl !== alignEnd ? "right" : "left"}`;
601
738
  dropdownElement.style.visibility = "visible";
602
739
  overlayStyleRef.current = {
603
740
  top: top2,
@@ -728,7 +865,7 @@ function FloatingPanelWeb({
728
865
  });
729
866
  }
730
867
  });
731
- }, [isFill, isContextMenu, cover, anchorRect, clampCollisions, sheetProps.scrollable, triggerEcho, coverAlign, panel.placement, panel.refs, panel.triggerRef, panel.updateArrows, panel.panelTransition]);
868
+ }, [isFill, isContextMenu, pointMenu, showIconEcho, cover, anchorRect, clampCollisions, sheetProps.scrollable, triggerEcho, coverAlign, panel.placement, panel.refs, panel.triggerRef, panel.updateArrows, panel.panelTransition]);
732
869
  repositionFnRef.current = repositionOverlay;
733
870
  const click = useClick(panel.context, {
734
871
  event: "mousedown",
@@ -774,7 +911,7 @@ function FloatingPanelWeb({
774
911
  const handleScroll = useCallback(event => {
775
912
  const el = event.target;
776
913
  panel.updateArrows(el);
777
- if (isFill || cover && !isContextMenu) return;
914
+ if (isFill || cover && !pointMenu) return;
778
915
  if (panel.initializingRef.current) {
779
916
  lastScrollTopRef.current = el.scrollTop;
780
917
  return;
@@ -797,7 +934,7 @@ function FloatingPanelWeb({
797
934
  grownRef.current = true;
798
935
  repositionFnRef.current?.();
799
936
  }
800
- }, [isFill, cover, isContextMenu, panel.updateArrows]);
937
+ }, [isFill, cover, pointMenu, panel.updateArrows]);
801
938
  const webTransition = panel.panelTransition;
802
939
  const {
803
940
  style: elevatedSurfaceStyle,
@@ -839,6 +976,17 @@ function FloatingPanelWeb({
839
976
  onContextMenu: openFromContextMenu
840
977
  } : {})
841
978
  });
979
+ const contentSized = sheetProps.triggerSizing === "content";
980
+ const [hugSelf, setHugSelf] = useState(contentSized ? "flex-start" : void 0);
981
+ useLayoutEffect(() => {
982
+ if (!contentSized) {
983
+ setHugSelf(void 0);
984
+ return;
985
+ }
986
+ const parent = layoutParentOf(panel.triggerRef.current);
987
+ const align = parent ? getComputedStyle(parent).alignItems : "stretch";
988
+ setHugSelf(align === "stretch" || align === "normal" ? "flex-start" : void 0);
989
+ }, [contentSized, panel.triggerRef]);
842
990
  for (const name of ["onMouseDown", "onClick", "onKeyDown", "onKeyUp"]) {
843
991
  const handler = referenceProps[name];
844
992
  if (typeof handler === "function") {
@@ -852,7 +1000,7 @@ function FloatingPanelWeb({
852
1000
  return /* @__PURE__ */jsxs(Fragment, {
853
1001
  children: [/* @__PURE__ */jsx(View, {
854
1002
  ...referenceProps,
855
- alignSelf: sheetProps.triggerSizing === "content" ? "flex-start" : void 0,
1003
+ alignSelf: hugSelf,
856
1004
  cursor: disabled ? "not-allowed" : "pointer",
857
1005
  opacity: disabled ? 0.5 : 1,
858
1006
  "data-fp-reference": "",
@@ -881,7 +1029,7 @@ function FloatingPanelWeb({
881
1029
  scrollbarWidth: "none",
882
1030
  zIndex: panelZIndex,
883
1031
  overflow: "auto",
884
- ...(cover && !isContextMenu ? {
1032
+ ...(cover && !pointMenu ? {
885
1033
  overflowX: "hidden"
886
1034
  } : {}),
887
1035
  ...panel.floatingStyleRef.current,
@@ -894,7 +1042,7 @@ function FloatingPanelWeb({
894
1042
  // then positions against this box and is clipped by its scroll.
895
1043
  transform: panel.visible ? "none" : "scale(0.96)",
896
1044
  transition: webTransition,
897
- transformOrigin: cover && !isContextMenu ? isRtl(panel.triggerRef.current) !== coverAlignEndRef.current ? "top right" : "top left" : panelTransformOrigin(pointPlacementRef.current ? `${pointPlacementRef.current.dropup ? "top" : "bottom"}-${pointPlacementRef.current.alignEnd ? "end" : "start"}` : panel.placement)
1045
+ transformOrigin: cover && !pointMenu ? `${iconEchoUpRef.current ? "bottom" : "top"} ${isRtl(panel.triggerRef.current) !== coverAlignEndRef.current ? "right" : "left"}` : panelTransformOrigin(pointPlacementRef.current ? `${pointPlacementRef.current.dropup ? "top" : "bottom"}-${pointPlacementRef.current.alignEnd ? "end" : "start"}` : panel.placement)
898
1046
  },
899
1047
  onScroll: handleScroll,
900
1048
  onTransitionEnd: event => {
@@ -911,7 +1059,7 @@ function FloatingPanelWeb({
911
1059
  borderRadius: panel.dropdownRadius,
912
1060
  paddingVertical: 0,
913
1061
  paddingBottom: panel.coverCornerInset || 0,
914
- children: [isContextMenu || !cover || !triggerEcho ? null : /* @__PURE__ */jsx(TriggerEchoRow, {
1062
+ children: [pointMenu || !cover || !triggerEcho || showIconEcho ? null : /* @__PURE__ */jsx(TriggerEchoRow, {
915
1063
  sourceRef: panel.triggerRef,
916
1064
  source: trigger,
917
1065
  anchorRect,
@@ -928,14 +1076,19 @@ function FloatingPanelWeb({
928
1076
  ...(contentPadding !== "none" ? panel.knobProps.gapLg : void 0),
929
1077
  children: /* @__PURE__ */jsx(OverlayStackProvider, {
930
1078
  zIndex: panelZIndex,
931
- children
1079
+ children: /* @__PURE__ */jsx(PanelIconEchoBoxContext.Provider, {
1080
+ value: echoBox,
1081
+ children
1082
+ })
932
1083
  })
933
1084
  }), /* @__PURE__ */jsx(ScrollArrow, {
934
1085
  direction: "down",
935
1086
  scrollRef: panel.refs.floating,
936
1087
  visible: panel.arrowDown,
937
1088
  arrowScrollDirRef: panel.arrowScrollDirRef
938
- })]
1089
+ }), showIconEcho && iconEcho ? /* @__PURE__ */jsx(IconEchoRow, {
1090
+ children: iconEchoElement(trigger, iconEcho, () => onOpenChange(false), triggerSurface)
1091
+ }) : null]
939
1092
  })
940
1093
  })
941
1094
  })]