@g9tm/lynxcontrols 1.4.0 → 1.4.3

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 (148) hide show
  1. package/README.md +7 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/base/control.d.ts +24 -0
  4. package/dist/base/control.d.ts.map +1 -1
  5. package/dist/base/control.jsx +14 -2
  6. package/dist/base/control.jsx.map +1 -1
  7. package/dist/base/index.d.ts +1 -1
  8. package/dist/base/index.d.ts.map +1 -1
  9. package/dist/base/index.jsx +1 -1
  10. package/dist/base/pressable.d.ts.map +1 -1
  11. package/dist/base/pressable.jsx +1 -1
  12. package/dist/base/pressable.jsx.map +1 -1
  13. package/dist/button/button.d.ts.map +1 -1
  14. package/dist/button/button.jsx +4 -3
  15. package/dist/button/button.jsx.map +1 -1
  16. package/dist/button/header-action-button.d.ts.map +1 -1
  17. package/dist/button/header-action-button.jsx +1 -1
  18. package/dist/button/header-action-button.jsx.map +1 -1
  19. package/dist/button/icon-button.d.ts.map +1 -1
  20. package/dist/button/icon-button.jsx +1 -1
  21. package/dist/button/icon-button.jsx.map +1 -1
  22. package/dist/button/nav-card.d.ts.map +1 -1
  23. package/dist/button/nav-card.jsx +6 -5
  24. package/dist/button/nav-card.jsx.map +1 -1
  25. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  26. package/dist/button/vertical-icon-text-button.jsx +1 -1
  27. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  28. package/dist/display/culture-date-time-label.d.ts.map +1 -1
  29. package/dist/display/culture-date-time-label.jsx +3 -1
  30. package/dist/display/culture-date-time-label.jsx.map +1 -1
  31. package/dist/display/progress-bar.jsx +1 -1
  32. package/dist/display/progress-bar.jsx.map +1 -1
  33. package/dist/display/separator.jsx +2 -2
  34. package/dist/display/separator.jsx.map +1 -1
  35. package/dist/display/title-with-line.jsx +1 -1
  36. package/dist/display/title-with-line.jsx.map +1 -1
  37. package/dist/expander/expander.d.ts.map +1 -1
  38. package/dist/expander/expander.jsx +6 -4
  39. package/dist/expander/expander.jsx.map +1 -1
  40. package/dist/fields/fields.css +12 -4
  41. package/dist/fields/fields.css.map +1 -1
  42. package/dist/fields/index.d.ts +1 -0
  43. package/dist/fields/index.d.ts.map +1 -1
  44. package/dist/fields/index.jsx +1 -0
  45. package/dist/fields/notch.d.ts +10 -0
  46. package/dist/fields/notch.d.ts.map +1 -0
  47. package/dist/fields/notch.jsx +9 -0
  48. package/dist/fields/notch.jsx.map +1 -0
  49. package/dist/fields/outlined-field.d.ts +7 -1
  50. package/dist/fields/outlined-field.d.ts.map +1 -1
  51. package/dist/fields/outlined-field.jsx +8 -5
  52. package/dist/fields/outlined-field.jsx.map +1 -1
  53. package/dist/fields/pin-entry.d.ts +2 -0
  54. package/dist/fields/pin-entry.d.ts.map +1 -1
  55. package/dist/fields/pin-entry.jsx +2 -1
  56. package/dist/fields/pin-entry.jsx.map +1 -1
  57. package/dist/fields/text-entry.d.ts.map +1 -1
  58. package/dist/fields/text-entry.jsx +12 -2
  59. package/dist/fields/text-entry.jsx.map +1 -1
  60. package/dist/fields/use-text-input.d.ts.map +1 -1
  61. package/dist/fields/use-text-input.jsx +11 -1
  62. package/dist/fields/use-text-input.jsx.map +1 -1
  63. package/dist/host/hooks.d.ts +5 -0
  64. package/dist/host/hooks.d.ts.map +1 -1
  65. package/dist/host/hooks.jsx +4 -1
  66. package/dist/host/hooks.jsx.map +1 -1
  67. package/dist/host/index.d.ts +1 -1
  68. package/dist/host/index.d.ts.map +1 -1
  69. package/dist/host/index.jsx +1 -1
  70. package/dist/popup/frame.d.ts.map +1 -1
  71. package/dist/popup/frame.jsx +11 -3
  72. package/dist/popup/frame.jsx.map +1 -1
  73. package/dist/popup/index.d.ts +1 -1
  74. package/dist/popup/index.d.ts.map +1 -1
  75. package/dist/popup/popup.css +1 -1
  76. package/dist/popup/popup.css.map +1 -1
  77. package/dist/popup/service.d.ts.map +1 -1
  78. package/dist/popup/service.jsx +12 -4
  79. package/dist/popup/service.jsx.map +1 -1
  80. package/dist/popup/types.d.ts +11 -0
  81. package/dist/popup/types.d.ts.map +1 -1
  82. package/dist/popup/types.jsx.map +1 -1
  83. package/dist/selection/selection-sheet.d.ts.map +1 -1
  84. package/dist/selection/selection-sheet.jsx +7 -3
  85. package/dist/selection/selection-sheet.jsx.map +1 -1
  86. package/dist/selection/selection.css +1 -0
  87. package/dist/selection/selection.css.map +1 -1
  88. package/dist/sheet/frame.d.ts +2 -0
  89. package/dist/sheet/frame.d.ts.map +1 -1
  90. package/dist/sheet/frame.jsx +134 -69
  91. package/dist/sheet/frame.jsx.map +1 -1
  92. package/dist/sheet/gesture.d.ts +51 -0
  93. package/dist/sheet/gesture.d.ts.map +1 -0
  94. package/dist/sheet/gesture.jsx +107 -0
  95. package/dist/sheet/gesture.jsx.map +1 -0
  96. package/dist/sheet/handoff.d.ts +32 -0
  97. package/dist/sheet/handoff.d.ts.map +1 -0
  98. package/dist/sheet/handoff.jsx +33 -0
  99. package/dist/sheet/handoff.jsx.map +1 -0
  100. package/dist/sheet/header.d.ts +12 -1
  101. package/dist/sheet/header.d.ts.map +1 -1
  102. package/dist/sheet/header.jsx +42 -29
  103. package/dist/sheet/header.jsx.map +1 -1
  104. package/dist/sheet/index.d.ts +3 -2
  105. package/dist/sheet/index.d.ts.map +1 -1
  106. package/dist/sheet/index.jsx +3 -2
  107. package/dist/sheet/motion.d.ts +59 -0
  108. package/dist/sheet/motion.d.ts.map +1 -0
  109. package/dist/sheet/motion.jsx +59 -0
  110. package/dist/sheet/motion.jsx.map +1 -0
  111. package/dist/sheet/options.d.ts +34 -2
  112. package/dist/sheet/options.d.ts.map +1 -1
  113. package/dist/sheet/options.jsx +2 -1
  114. package/dist/sheet/options.jsx.map +1 -1
  115. package/dist/sheet/service.d.ts.map +1 -1
  116. package/dist/sheet/service.jsx +1 -1
  117. package/dist/sheet/service.jsx.map +1 -1
  118. package/dist/sheet/sheet.css +52 -1
  119. package/dist/sheet/sheet.css.map +1 -1
  120. package/dist/sheet/sizing.d.ts +27 -3
  121. package/dist/sheet/sizing.d.ts.map +1 -1
  122. package/dist/sheet/sizing.jsx +19 -4
  123. package/dist/sheet/sizing.jsx.map +1 -1
  124. package/dist/tab-bar/tab-bar.d.ts +5 -0
  125. package/dist/tab-bar/tab-bar.d.ts.map +1 -1
  126. package/dist/tab-bar/tab-bar.jsx +5 -2
  127. package/dist/tab-bar/tab-bar.jsx.map +1 -1
  128. package/dist/toast/service.d.ts.map +1 -1
  129. package/dist/toast/service.jsx +58 -21
  130. package/dist/toast/service.jsx.map +1 -1
  131. package/dist/toast/store.d.ts +2 -0
  132. package/dist/toast/store.d.ts.map +1 -1
  133. package/dist/toast/store.jsx +4 -2
  134. package/dist/toast/store.jsx.map +1 -1
  135. package/dist/toast/toast.css +20 -13
  136. package/dist/toast/toast.css.map +1 -1
  137. package/dist/toggle/checkbox.d.ts.map +1 -1
  138. package/dist/toggle/checkbox.jsx +1 -1
  139. package/dist/toggle/checkbox.jsx.map +1 -1
  140. package/dist/toggle/chip-group.d.ts.map +1 -1
  141. package/dist/toggle/chip-group.jsx +5 -5
  142. package/dist/toggle/chip-group.jsx.map +1 -1
  143. package/dist/toggle/switch.d.ts.map +1 -1
  144. package/dist/toggle/switch.jsx +2 -2
  145. package/dist/toggle/switch.jsx.map +1 -1
  146. package/dist/toggle/toggle.css +1 -2
  147. package/dist/toggle/toggle.css.map +1 -1
  148. package/package.json +2 -2
@@ -1,5 +1,9 @@
1
1
  import "./popup.css";
2
+ import { resolveThemeColor } from "@g9tm/lynxcontrols-foundation";
2
3
  import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
4
+ import { g9SafeId } from "../base/control.jsx";
5
+ import { g9FieldNotchStyle } from "../fields/notch.jsx";
6
+ import { useG9Theme } from "../provider/hooks.jsx";
3
7
  import { popupScrimOpacity } from "./types.jsx";
4
8
  function popupMotionPose(animation, phase) {
5
9
  switch(animation){
@@ -117,8 +121,10 @@ function G9PopupDragHandle(props) {
117
121
  </view>;
118
122
  }
119
123
  function PopupFrame(props) {
120
- var _o_animation, _o_animationDuration, _o_overlayMode, _o_animationEasing, _o_autoSizeMode, _o_absoluteX, _o_absoluteY, _o_relativeAbsoluteX, _o_relativeAbsoluteY, _o_padding, _o_overlayOpacity, _o_blurIntensity, _o_overlayColor, _o_cornerRadius, _o_cardBackground, _o_borderColor;
124
+ var _o_cardBackground, _o_animation, _o_animationDuration, _o_overlayMode, _o_animationEasing, _o_autoSizeMode, _o_absoluteX, _o_absoluteY, _o_relativeAbsoluteX, _o_relativeAbsoluteY, _o_padding, _o_overlayOpacity, _o_blurIntensity, _o_overlayColor, _o_cornerRadius, _o_cardBackground1, _o_borderColor;
121
125
  const o = props.options;
126
+ const palette = useG9Theme().palette;
127
+ const notch = g9FieldNotchStyle(resolveThemeColor(null != (_o_cardBackground = o.cardBackground) ? _o_cardBackground : 'var(--g9-surface)', palette));
122
128
  const animation = null != (_o_animation = o.animation) ? _o_animation : 'slideUp';
123
129
  const duration = null != (_o_animationDuration = o.animationDuration) ? _o_animationDuration : 240;
124
130
  const mode = null != (_o_overlayMode = o.overlayMode) ? _o_overlayMode : 'transparent';
@@ -196,7 +202,8 @@ function PopupFrame(props) {
196
202
  return null == (_props_onBackgroundTap = props.onBackgroundTap) ? void 0 : _props_onBackgroundTap.call(props);
197
203
  }}/> : null}
198
204
  <view className="g9-popup__card" {...props.testId ? {
199
- 'data-testid': props.testId
205
+ 'data-testid': props.testId,
206
+ id: g9SafeId(props.testId)
200
207
  } : {}} event-through={false} style={{
201
208
  ...placed ? {
202
209
  position: 'absolute',
@@ -210,9 +217,10 @@ function PopupFrame(props) {
210
217
  height
211
218
  } : {},
212
219
  borderRadius: `${null != (_o_cornerRadius = o.cornerRadius) ? _o_cornerRadius : 16}px`,
213
- backgroundColor: null != (_o_cardBackground = o.cardBackground) ? _o_cardBackground : 'var(--g9-surface)',
220
+ backgroundColor: null != (_o_cardBackground1 = o.cardBackground) ? _o_cardBackground1 : 'var(--g9-surface)',
214
221
  borderColor: null != (_o_borderColor = o.borderColor) ? _o_borderColor : 'var(--g9-surface)',
215
222
  padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,
223
+ ...notch,
216
224
  opacity: pose.opacity,
217
225
  transform: `${dragTranslate}${pose.transform}`,
218
226
  transition
@@ -1 +1 @@
1
- {"version":3,"file":"popup/frame.jsx","sources":["../../src/popup/frame.tsx"],"sourcesContent":["import './popup.css';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport type {\n G9PopupAnimationEasing,\n G9PopupAnimationType,\n G9PopupAutoSizeMode,\n G9PopupBlurIntensity,\n G9PopupOverlayMode,\n G9PopupRelativePosition,\n} from './types';\nimport { popupScrimOpacity } from './types';\n\n/** A rectangle in host coordinates (px), e.g. an anchor's `boundingClientRect`. */\nexport interface G9Rect {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** How one popup card opens (MAUI `G9PopupViewOpenOptions`). */\nexport interface G9PopupViewOpenOptions {\n /** Card width (px); unset = the auto-size mode decides (90 % of the host for centred `height` mode). */\n readonly width?: number | null;\n readonly height?: number | null;\n /** Default 16. */\n readonly cornerRadius?: number;\n /** `[left, top, right, bottom]`. Default `[20, 16, 20, 12]`. */\n readonly padding?: readonly [number, number, number, number];\n /** Default `'height'`. */\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly cardBackground?: string | null;\n readonly borderColor?: string | null;\n /** Default `'transparent'`; `'none'` = non-modal (no scrim, taps pass through). */\n readonly overlayMode?: G9PopupOverlayMode;\n readonly blurIntensity?: G9PopupBlurIntensity;\n /** Scrim colour (its opacity is `overlayOpacity`). Default the `Scrim` token. */\n readonly overlayColor?: string | null;\n /** Default 0.45. */\n readonly overlayOpacity?: number;\n /** Default false. */\n readonly closeOnBackgroundTap?: boolean;\n /** Default true. */\n readonly closeOnBackButton?: boolean;\n /** Default `'slideUp'`. */\n readonly animation?: G9PopupAnimationType;\n /** Default `'sinOut'`. */\n readonly animationEasing?: G9PopupAnimationEasing;\n /** Default 240 ms. */\n readonly animationDuration?: number;\n /** Close after this many ms; 0 = never. */\n readonly autoCloseDuration?: number;\n /** Anchor rectangle (MAUI `RelativeView`'s bounds); with `relativePosition`. */\n readonly relativeRect?: G9Rect | null;\n readonly relativePosition?: G9PopupRelativePosition | null;\n /** Extra offset added to the relative placement. */\n readonly relativeAbsoluteX?: number;\n readonly relativeAbsoluteY?: number;\n /** Absolute card position (host px). */\n readonly absoluteX?: number | null;\n readonly absoluteY?: number | null;\n /** The card can be dragged: by a `<G9PopupDragHandle>` inside it, or anywhere when there is none. */\n readonly isDraggable?: boolean;\n}\n\n/** The pose a card starts from / leaves to, per motion (MAUI `G9PopupView` animation table). */\nexport function popupMotionPose(\n animation: G9PopupAnimationType,\n phase: 'enter' | 'exit',\n): {\n opacity: number;\n transform: string;\n} {\n switch (animation) {\n case 'none':\n return { opacity: phase === 'enter' ? 1 : 0, transform: 'translateY(0px) scale(1)' };\n case 'fadeIn':\n return { opacity: 0, transform: 'translateY(0px) scale(1)' };\n case 'zoomIn':\n return { opacity: 0, transform: 'translateY(0px) scale(0.92)' };\n case 'dropIn':\n return { opacity: 0, transform: 'translateY(-40px) scale(1)' };\n case 'bounce':\n // Opens from 0.6 with the bounce easing; closes like ZoomIn (MAUI).\n return { opacity: 0, transform: `translateY(0px) scale(${phase === 'enter' ? 0.6 : 0.92})` };\n default:\n return { opacity: 0, transform: 'translateY(40px) scale(1)' };\n }\n}\n\n/** CSS timing function of an easing (bounce approximated with an overshoot curve; CSS has no bounce). */\nexport function popupEasingCss(easing: G9PopupAnimationEasing): string {\n switch (easing) {\n case 'linear':\n return 'linear';\n case 'sinIn':\n return 'cubic-bezier(0.47, 0, 0.745, 0.715)';\n case 'sinInOut':\n return 'cubic-bezier(0.445, 0.05, 0.55, 0.95)';\n case 'cubicOut':\n return 'cubic-bezier(0.215, 0.61, 0.355, 1)';\n case 'bounceOut':\n return 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n default:\n return 'cubic-bezier(0.39, 0.575, 0.565, 1)';\n }\n}\n\n/**\n * Where the card's top-left goes (host px) for a relative placement (MAUI `ShowRelativeToView`); `null` when the\n * anchor or the card has no size yet (the card is then centred, and the next layout corrects it).\n */\nexport function relativePopupPlacement(\n anchor: G9Rect | null | undefined,\n position: G9PopupRelativePosition | null | undefined,\n card: { width: number; height: number },\n offset: { x: number; y: number } = { x: 0, y: 0 },\n): { left: number; top: number } | null {\n if (!anchor || !position || anchor.width <= 0 || anchor.height <= 0 || card.width <= 0 || card.height <= 0)\n return null;\n const right = anchor.left + anchor.width;\n const bottom = anchor.top + anchor.height;\n const cx = anchor.left + (anchor.width - card.width) / 2;\n const cy = anchor.top + (anchor.height - card.height) / 2;\n const at = (left: number, top: number) => ({ left: left + offset.x, top: top + offset.y });\n switch (position) {\n case 'alignTop':\n return at(cx, anchor.top);\n case 'alignBottom':\n return at(cx, bottom - card.height);\n case 'alignLeft':\n return at(anchor.left, cy);\n case 'alignRight':\n return at(right - card.width, cy);\n case 'alignTopLeft':\n return at(anchor.left, anchor.top);\n case 'alignTopRight':\n return at(right - card.width, anchor.top);\n case 'alignBottomLeft':\n return at(anchor.left, bottom - card.height);\n case 'alignBottomRight':\n return at(right - card.width, bottom - card.height);\n case 'alignToLeftOf':\n return at(anchor.left - card.width, cy);\n case 'alignToRightOf':\n return at(right, cy);\n case 'alignToTopOf':\n return at(cx, anchor.top - card.height);\n default:\n return at(cx, bottom);\n }\n}\n\ninterface DragApi {\n readonly onStart: (x: number, y: number) => void;\n readonly onMove: (x: number, y: number) => void;\n readonly register: () => () => void;\n}\n\nconst DragContext = createContext<DragApi | null>(null);\n\ntype TouchEvent = { touches?: Array<{ clientX?: number; clientY?: number; pageX?: number; pageY?: number }> };\nconst point = (e: TouchEvent) => {\n const t = e.touches?.[0];\n return { x: t?.clientX ?? t?.pageX ?? 0, y: t?.clientY ?? t?.pageY ?? 0 };\n};\n\n/**\n * The grip of a draggable popup (MAUI `DragHandle`): put the header inside it so taps in the body keep working.\n * Without one, a draggable card drags from anywhere.\n */\nexport function G9PopupDragHandle(props: { readonly children?: ReactNode; readonly className?: string }): ReactNode {\n const drag = useContext(DragContext);\n useEffect(() => drag?.register(), [drag !== null]);\n return (\n <view\n className={`g9-popup__drag-handle${props.className ? ` ${props.className}` : ''}`}\n bindtouchstart={(e: TouchEvent) => {\n const p = point(e);\n drag?.onStart(p.x, p.y);\n }}\n bindtouchmove={(e: TouchEvent) => {\n const p = point(e);\n drag?.onMove(p.x, p.y);\n }}\n >\n {props.children}\n </view>\n );\n}\n\n/** Props of {@link PopupFrame}. */\nexport interface PopupFrameProps {\n readonly options: G9PopupViewOpenOptions;\n /** `enter` = start pose (no transition), `open` = in place, `leave` = exit pose. */\n readonly phase: 'enter' | 'open' | 'leave';\n readonly hostWidth: number;\n readonly onBackgroundTap?: () => void;\n readonly children?: ReactNode;\n readonly testId?: string;\n}\n\n/**\n * Scrim + card (MAUI `G9PopupView` visuals): the scrim fades on its own (also when the card has no motion); the card\n * runs one compound transition (opacity with transform) between its pose and identity; no shadow, the stroke\n * separates it. Placement: absolute, relative to an anchor, or centred (90 % wide in `height` mode). Non-modal\n * (`overlayMode: 'none'`): no scrim and the layer lets taps through.\n */\nexport function PopupFrame(props: PopupFrameProps): ReactNode {\n const o = props.options;\n const animation = o.animation ?? 'slideUp';\n const duration = o.animationDuration ?? 240;\n const mode = o.overlayMode ?? 'transparent';\n const [size, setSize] = useState({ width: 0, height: 0 });\n const [offset, setOffset] = useState({ x: 0, y: 0 });\n const drag = useRef({ x: 0, y: 0, ox: 0, oy: 0 });\n const [handles, setHandles] = useState(0);\n const dragApi: DragApi = {\n onStart: (x, y) => {\n drag.current = { ...drag.current, x, y, ox: offset.x, oy: offset.y };\n },\n onMove: (x, y) => {\n if (!o.isDraggable) return;\n setOffset({ x: drag.current.ox + x - drag.current.x, y: drag.current.oy + y - drag.current.y });\n },\n register: () => {\n setHandles((n) => n + 1);\n return () => setHandles((n) => n - 1);\n },\n };\n const pose =\n props.phase === 'open'\n ? { opacity: 1, transform: 'translateY(0px) scale(1)' }\n : popupMotionPose(animation, props.phase === 'enter' ? 'enter' : 'exit');\n const easing =\n animation === 'bounce' && props.phase !== 'leave'\n ? popupEasingCss('bounceOut')\n : popupEasingCss(o.animationEasing ?? 'sinOut');\n const transition =\n props.phase === 'enter' || animation === 'none'\n ? 'none'\n : `opacity ${duration}ms ${easing}, transform ${duration}ms ${easing}`;\n const autoSize = o.autoSizeMode ?? 'height';\n const placed =\n o.absoluteX != null || o.absoluteY != null\n ? { left: o.absoluteX ?? 0, top: o.absoluteY ?? 0 }\n : relativePopupPlacement(o.relativeRect, o.relativePosition, size, {\n x: o.relativeAbsoluteX ?? 0,\n y: o.relativeAbsoluteY ?? 0,\n });\n const width =\n o.width != null && autoSize !== 'both' && autoSize !== 'width'\n ? `${o.width}px`\n : !placed && autoSize === 'height'\n ? `${Math.round(props.hostWidth * 0.9)}px`\n : undefined;\n const height = o.height != null && (autoSize === 'none' || autoSize === 'width') ? `${o.height}px` : undefined;\n const pad = o.padding ?? [20, 16, 20, 12];\n const scrimOpacity = popupScrimOpacity(mode, o.overlayOpacity ?? 0.45, o.blurIntensity ?? 'none');\n const dragTranslate = o.isDraggable ? `translate(${offset.x}px, ${offset.y}px) ` : '';\n const wholeCardDrags = o.isDraggable === true && handles === 0;\n return (\n <view\n className={`g9-popup${mode === 'none' ? ' g9-popup--nonmodal' : ''}${placed ? ' g9-popup--placed' : ''}`}\n {...(mode === 'none' ? { 'event-through': true } : {})}\n >\n {mode !== 'none' ? (\n <view\n className=\"g9-popup__scrim\"\n style={{\n backgroundColor: o.overlayColor ?? 'var(--g9-scrim)',\n opacity: props.phase === 'open' ? scrimOpacity : 0,\n transition: props.phase === 'enter' ? 'none' : `opacity ${duration}ms`,\n }}\n bindtap={() => props.onBackgroundTap?.()}\n />\n ) : null}\n <view\n className=\"g9-popup__card\"\n {...(props.testId ? { 'data-testid': props.testId } : {})}\n event-through={false}\n style={{\n ...(placed ? { position: 'absolute', left: `${placed.left}px`, top: `${placed.top}px` } : {}),\n ...(width ? { width } : {}),\n ...(height ? { height } : {}),\n borderRadius: `${o.cornerRadius ?? 16}px`,\n backgroundColor: o.cardBackground ?? 'var(--g9-surface)',\n borderColor: o.borderColor ?? 'var(--g9-surface)',\n padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,\n opacity: pose.opacity,\n transform: `${dragTranslate}${pose.transform}`,\n transition,\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (w !== size.width || h !== size.height)) setSize({ width: w, height: h });\n }}\n {...(wholeCardDrags\n ? {\n bindtouchstart: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onStart(p.x, p.y);\n },\n bindtouchmove: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onMove(p.x, p.y);\n },\n }\n : {})}\n >\n <DragContext.Provider value={dragApi}>{props.children}</DragContext.Provider>\n </view>\n </view>\n );\n}\n"],"names":["popupMotionPose","animation","phase","popupEasingCss","easing","relativePopupPlacement","anchor","position","card","offset","right","bottom","cx","cy","at","left","top","DragContext","createContext","point","e","_ref","_ref2","_e_touches","t","G9PopupDragHandle","props","drag","useContext","useEffect","view","p","PopupFrame","_o_animation","_o_animationDuration","_o_overlayMode","_o_animationEasing","_o_autoSizeMode","_o_absoluteX","_o_absoluteY","_o_relativeAbsoluteX","_o_relativeAbsoluteY","_o_padding","_o_overlayOpacity","_o_blurIntensity","_o_overlayColor","_o_cornerRadius","_o_cardBackground","_o_borderColor","o","duration","mode","size","setSize","useState","setOffset","useRef","handles","setHandles","dragApi","x","y","n","pose","transition","autoSize","placed","width","undefined","Math","height","pad","scrimOpacity","popupScrimOpacity","dragTranslate","wholeCardDrags","_e_detail","_e_detail1","w","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.jsx","sources":["../../src/popup/frame.tsx"],"sourcesContent":["import './popup.css';\nimport { resolveThemeColor } from '@g9tm/lynxcontrols-foundation';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9SafeId } from '../base/control';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport type {\n G9PopupAnimationEasing,\n G9PopupAnimationType,\n G9PopupAutoSizeMode,\n G9PopupBlurIntensity,\n G9PopupOverlayMode,\n G9PopupRelativePosition,\n} from './types';\nimport { popupScrimOpacity } from './types';\n\n/** A rectangle in host coordinates (px), e.g. an anchor's `boundingClientRect`. */\nexport interface G9Rect {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** How one popup card opens (MAUI `G9PopupViewOpenOptions`). */\nexport interface G9PopupViewOpenOptions {\n /** Card width (px); unset = the auto-size mode decides (90 % of the host for centred `height` mode). */\n readonly width?: number | null;\n readonly height?: number | null;\n /** Default 16. */\n readonly cornerRadius?: number;\n /** `[left, top, right, bottom]`. Default `[20, 16, 20, 12]`. */\n readonly padding?: readonly [number, number, number, number];\n /** Default `'height'`. */\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly cardBackground?: string | null;\n readonly borderColor?: string | null;\n /** Default `'transparent'`; `'none'` = non-modal (no scrim, taps pass through). */\n readonly overlayMode?: G9PopupOverlayMode;\n readonly blurIntensity?: G9PopupBlurIntensity;\n /** Scrim colour (its opacity is `overlayOpacity`). Default the `Scrim` token. */\n readonly overlayColor?: string | null;\n /** Default 0.45. */\n readonly overlayOpacity?: number;\n /** Default false. */\n readonly closeOnBackgroundTap?: boolean;\n /** Default true. */\n readonly closeOnBackButton?: boolean;\n /** Default `'slideUp'`. */\n readonly animation?: G9PopupAnimationType;\n /** Default `'sinOut'`. */\n readonly animationEasing?: G9PopupAnimationEasing;\n /** Default 240 ms. */\n readonly animationDuration?: number;\n /** Close after this many ms; 0 = never. */\n readonly autoCloseDuration?: number;\n /** Anchor rectangle (MAUI `RelativeView`'s bounds); with `relativePosition`. */\n readonly relativeRect?: G9Rect | null;\n readonly relativePosition?: G9PopupRelativePosition | null;\n /** Extra offset added to the relative placement. */\n readonly relativeAbsoluteX?: number;\n readonly relativeAbsoluteY?: number;\n /** Absolute card position (host px). */\n readonly absoluteX?: number | null;\n readonly absoluteY?: number | null;\n /** The card can be dragged: by a `<G9PopupDragHandle>` inside it, or anywhere when there is none. */\n readonly isDraggable?: boolean;\n}\n\n/** The pose a card starts from / leaves to, per motion (MAUI `G9PopupView` animation table). */\nexport function popupMotionPose(\n animation: G9PopupAnimationType,\n phase: 'enter' | 'exit',\n): {\n opacity: number;\n transform: string;\n} {\n switch (animation) {\n case 'none':\n return { opacity: phase === 'enter' ? 1 : 0, transform: 'translateY(0px) scale(1)' };\n case 'fadeIn':\n return { opacity: 0, transform: 'translateY(0px) scale(1)' };\n case 'zoomIn':\n return { opacity: 0, transform: 'translateY(0px) scale(0.92)' };\n case 'dropIn':\n return { opacity: 0, transform: 'translateY(-40px) scale(1)' };\n case 'bounce':\n // Opens from 0.6 with the bounce easing; closes like ZoomIn (MAUI).\n return { opacity: 0, transform: `translateY(0px) scale(${phase === 'enter' ? 0.6 : 0.92})` };\n default:\n return { opacity: 0, transform: 'translateY(40px) scale(1)' };\n }\n}\n\n/** CSS timing function of an easing (bounce approximated with an overshoot curve; CSS has no bounce). */\nexport function popupEasingCss(easing: G9PopupAnimationEasing): string {\n switch (easing) {\n case 'linear':\n return 'linear';\n case 'sinIn':\n return 'cubic-bezier(0.47, 0, 0.745, 0.715)';\n case 'sinInOut':\n return 'cubic-bezier(0.445, 0.05, 0.55, 0.95)';\n case 'cubicOut':\n return 'cubic-bezier(0.215, 0.61, 0.355, 1)';\n case 'bounceOut':\n return 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n default:\n return 'cubic-bezier(0.39, 0.575, 0.565, 1)';\n }\n}\n\n/**\n * Where the card's top-left goes (host px) for a relative placement (MAUI `ShowRelativeToView`); `null` when the\n * anchor or the card has no size yet (the card is then centred, and the next layout corrects it).\n */\nexport function relativePopupPlacement(\n anchor: G9Rect | null | undefined,\n position: G9PopupRelativePosition | null | undefined,\n card: { width: number; height: number },\n offset: { x: number; y: number } = { x: 0, y: 0 },\n): { left: number; top: number } | null {\n if (!anchor || !position || anchor.width <= 0 || anchor.height <= 0 || card.width <= 0 || card.height <= 0)\n return null;\n const right = anchor.left + anchor.width;\n const bottom = anchor.top + anchor.height;\n const cx = anchor.left + (anchor.width - card.width) / 2;\n const cy = anchor.top + (anchor.height - card.height) / 2;\n const at = (left: number, top: number) => ({ left: left + offset.x, top: top + offset.y });\n switch (position) {\n case 'alignTop':\n return at(cx, anchor.top);\n case 'alignBottom':\n return at(cx, bottom - card.height);\n case 'alignLeft':\n return at(anchor.left, cy);\n case 'alignRight':\n return at(right - card.width, cy);\n case 'alignTopLeft':\n return at(anchor.left, anchor.top);\n case 'alignTopRight':\n return at(right - card.width, anchor.top);\n case 'alignBottomLeft':\n return at(anchor.left, bottom - card.height);\n case 'alignBottomRight':\n return at(right - card.width, bottom - card.height);\n case 'alignToLeftOf':\n return at(anchor.left - card.width, cy);\n case 'alignToRightOf':\n return at(right, cy);\n case 'alignToTopOf':\n return at(cx, anchor.top - card.height);\n default:\n return at(cx, bottom);\n }\n}\n\ninterface DragApi {\n readonly onStart: (x: number, y: number) => void;\n readonly onMove: (x: number, y: number) => void;\n readonly register: () => () => void;\n}\n\nconst DragContext = createContext<DragApi | null>(null);\n\ntype TouchEvent = { touches?: Array<{ clientX?: number; clientY?: number; pageX?: number; pageY?: number }> };\nconst point = (e: TouchEvent) => {\n const t = e.touches?.[0];\n return { x: t?.clientX ?? t?.pageX ?? 0, y: t?.clientY ?? t?.pageY ?? 0 };\n};\n\n/**\n * The grip of a draggable popup (MAUI `DragHandle`): put the header inside it so taps in the body keep working.\n * Without one, a draggable card drags from anywhere.\n */\nexport function G9PopupDragHandle(props: { readonly children?: ReactNode; readonly className?: string }): ReactNode {\n const drag = useContext(DragContext);\n useEffect(() => drag?.register(), [drag !== null]);\n return (\n <view\n className={`g9-popup__drag-handle${props.className ? ` ${props.className}` : ''}`}\n bindtouchstart={(e: TouchEvent) => {\n const p = point(e);\n drag?.onStart(p.x, p.y);\n }}\n bindtouchmove={(e: TouchEvent) => {\n const p = point(e);\n drag?.onMove(p.x, p.y);\n }}\n >\n {props.children}\n </view>\n );\n}\n\n/** Props of {@link PopupFrame}. */\nexport interface PopupFrameProps {\n readonly options: G9PopupViewOpenOptions;\n /** `enter` = start pose (no transition), `open` = in place, `leave` = exit pose. */\n readonly phase: 'enter' | 'open' | 'leave';\n readonly hostWidth: number;\n readonly onBackgroundTap?: () => void;\n readonly children?: ReactNode;\n readonly testId?: string;\n}\n\n/**\n * Scrim + card (MAUI `G9PopupView` visuals): the scrim fades on its own (also when the card has no motion); the card\n * runs one compound transition (opacity with transform) between its pose and identity; no shadow, the stroke\n * separates it. Placement: absolute, relative to an anchor, or centred (90 % wide in `height` mode). Non-modal\n * (`overlayMode: 'none'`): no scrim and the layer lets taps through.\n */\nexport function PopupFrame(props: PopupFrameProps): ReactNode {\n const o = props.options;\n // Fields on the card hide their outline under a floated label with the card's colour.\n const palette = useG9Theme().palette;\n const notch = g9FieldNotchStyle(resolveThemeColor(o.cardBackground ?? 'var(--g9-surface)', palette));\n const animation = o.animation ?? 'slideUp';\n const duration = o.animationDuration ?? 240;\n const mode = o.overlayMode ?? 'transparent';\n const [size, setSize] = useState({ width: 0, height: 0 });\n const [offset, setOffset] = useState({ x: 0, y: 0 });\n const drag = useRef({ x: 0, y: 0, ox: 0, oy: 0 });\n const [handles, setHandles] = useState(0);\n const dragApi: DragApi = {\n onStart: (x, y) => {\n drag.current = { ...drag.current, x, y, ox: offset.x, oy: offset.y };\n },\n onMove: (x, y) => {\n if (!o.isDraggable) return;\n setOffset({ x: drag.current.ox + x - drag.current.x, y: drag.current.oy + y - drag.current.y });\n },\n register: () => {\n setHandles((n) => n + 1);\n return () => setHandles((n) => n - 1);\n },\n };\n const pose =\n props.phase === 'open'\n ? { opacity: 1, transform: 'translateY(0px) scale(1)' }\n : popupMotionPose(animation, props.phase === 'enter' ? 'enter' : 'exit');\n const easing =\n animation === 'bounce' && props.phase !== 'leave'\n ? popupEasingCss('bounceOut')\n : popupEasingCss(o.animationEasing ?? 'sinOut');\n const transition =\n props.phase === 'enter' || animation === 'none'\n ? 'none'\n : `opacity ${duration}ms ${easing}, transform ${duration}ms ${easing}`;\n const autoSize = o.autoSizeMode ?? 'height';\n const placed =\n o.absoluteX != null || o.absoluteY != null\n ? { left: o.absoluteX ?? 0, top: o.absoluteY ?? 0 }\n : relativePopupPlacement(o.relativeRect, o.relativePosition, size, {\n x: o.relativeAbsoluteX ?? 0,\n y: o.relativeAbsoluteY ?? 0,\n });\n const width =\n o.width != null && autoSize !== 'both' && autoSize !== 'width'\n ? `${o.width}px`\n : !placed && autoSize === 'height'\n ? `${Math.round(props.hostWidth * 0.9)}px`\n : undefined;\n const height = o.height != null && (autoSize === 'none' || autoSize === 'width') ? `${o.height}px` : undefined;\n const pad = o.padding ?? [20, 16, 20, 12];\n const scrimOpacity = popupScrimOpacity(mode, o.overlayOpacity ?? 0.45, o.blurIntensity ?? 'none');\n const dragTranslate = o.isDraggable ? `translate(${offset.x}px, ${offset.y}px) ` : '';\n const wholeCardDrags = o.isDraggable === true && handles === 0;\n return (\n <view\n className={`g9-popup${mode === 'none' ? ' g9-popup--nonmodal' : ''}${placed ? ' g9-popup--placed' : ''}`}\n {...(mode === 'none' ? { 'event-through': true } : {})}\n >\n {mode !== 'none' ? (\n <view\n className=\"g9-popup__scrim\"\n style={{\n backgroundColor: o.overlayColor ?? 'var(--g9-scrim)',\n opacity: props.phase === 'open' ? scrimOpacity : 0,\n transition: props.phase === 'enter' ? 'none' : `opacity ${duration}ms`,\n }}\n bindtap={() => props.onBackgroundTap?.()}\n />\n ) : null}\n <view\n className=\"g9-popup__card\"\n {...(props.testId ? { 'data-testid': props.testId, id: g9SafeId(props.testId) } : {})}\n event-through={false}\n style={{\n ...(placed ? { position: 'absolute', left: `${placed.left}px`, top: `${placed.top}px` } : {}),\n ...(width ? { width } : {}),\n ...(height ? { height } : {}),\n borderRadius: `${o.cornerRadius ?? 16}px`,\n backgroundColor: o.cardBackground ?? 'var(--g9-surface)',\n borderColor: o.borderColor ?? 'var(--g9-surface)',\n padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,\n ...notch,\n opacity: pose.opacity,\n transform: `${dragTranslate}${pose.transform}`,\n transition,\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (w !== size.width || h !== size.height)) setSize({ width: w, height: h });\n }}\n {...(wholeCardDrags\n ? {\n bindtouchstart: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onStart(p.x, p.y);\n },\n bindtouchmove: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onMove(p.x, p.y);\n },\n }\n : {})}\n >\n <DragContext.Provider value={dragApi}>{props.children}</DragContext.Provider>\n </view>\n </view>\n );\n}\n"],"names":["popupMotionPose","animation","phase","popupEasingCss","easing","relativePopupPlacement","anchor","position","card","offset","right","bottom","cx","cy","at","left","top","DragContext","createContext","point","e","_ref","_ref2","_e_touches","t","G9PopupDragHandle","props","drag","useContext","useEffect","view","p","PopupFrame","_o_cardBackground","_o_animation","_o_animationDuration","_o_overlayMode","_o_animationEasing","_o_autoSizeMode","_o_absoluteX","_o_absoluteY","_o_relativeAbsoluteX","_o_relativeAbsoluteY","_o_padding","_o_overlayOpacity","_o_blurIntensity","_o_overlayColor","_o_cornerRadius","_o_cardBackground1","_o_borderColor","o","palette","useG9Theme","notch","g9FieldNotchStyle","resolveThemeColor","duration","mode","size","setSize","useState","setOffset","useRef","handles","setHandles","dragApi","x","y","n","pose","transition","autoSize","placed","width","undefined","Math","height","pad","scrimOpacity","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Ae,CAACX;YACd,MAAMW,IAAIZ,MAAMC;YAChB6C,QAAQ,MAAM,CAAClC,EAAE,CAAC,EAAEA,EAAE,CAAC;QACzB;IACF,IACA,CAAC,CAAC,EACP;QACC,CAACd,YAAY,SAAS,OAAOgD,UAAUvC,MAAM,QAAQ,GAAGT,YAAY,SAAS;MAC/E,EAAEa,KAAK;IACT,EAAEA;AAEN"}
@@ -4,5 +4,5 @@ export { createPopupFormStore, type G9PopupFormStore, PopupInputForm } from './i
4
4
  export { G9PopupView, type G9PopupViewProps } from './popup-view.js';
5
5
  export { type G9PopupEntry, type G9PopupExit, type G9PopupOutcome, type G9PopupPhase, G9PopupQueue, type G9PopupQueueConfig, } from './queue.js';
6
6
  export { type G9ConfirmOptions, type G9PopupService, g9PopupRowButtonLimit, g9Popups, popupServiceOf, presentErrorPopup, useG9Popups, } from './service.js';
7
- export { closePopupButton, createDefaultPopupSettings, createPopupVisualProfile, customPopup, G9PopupAnimationEasing, G9PopupAnimationType, G9PopupAutoSizeMode, G9PopupBlurIntensity, type G9PopupButton, type G9PopupCallbackContext, type G9PopupDescriptor, G9PopupFooterButtonLayout, G9PopupOverlayMode, G9PopupRelativePosition, type G9PopupResult, G9PopupResultAction, type G9PopupSettings, G9PopupType, type G9PopupVisualProfile, g9PopupResult, mergePopupSettings, popupScrimOpacity, presetPopup, resolvePopupSettings, } from './types.js';
7
+ export { closePopupButton, createDefaultPopupSettings, createPopupVisualProfile, customPopup, G9PopupAnimationEasing, G9PopupAnimationType, G9PopupAutoSizeMode, G9PopupBlurIntensity, type G9PopupButton, type G9PopupCallbackContext, type G9PopupDescriptor, G9PopupFooterButtonLayout, type G9PopupFormHandle, G9PopupOverlayMode, G9PopupRelativePosition, type G9PopupResult, G9PopupResultAction, type G9PopupSettings, G9PopupType, type G9PopupVisualProfile, g9PopupResult, mergePopupSettings, popupScrimOpacity, presetPopup, resolvePopupSettings, } from './types.js';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EACX,UAAU,EACV,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,EACf,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,oBAAoB,EACzB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EACX,UAAU,EACV,KAAK,eAAe,EACpB,cAAc,EACd,eAAe,EACf,sBAAsB,GACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,oBAAoB,EACzB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
@@ -2,7 +2,7 @@
2
2
  justify-content: center;
3
3
  align-items: center;
4
4
  display: flex;
5
- position: absolute;
5
+ position: fixed;
6
6
  top: 0;
7
7
  bottom: 0;
8
8
  left: 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/popup/popup.css"],"names":[],"mappings":"AAAA;EACE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;EACjB,sBAAsB;EACtB,eAAe;EACf,aAAa;AACf;;AAEA;EACE,sBAAsB;EACtB,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,eAAe;AACjB;;AAEA;EACE,YAAY;EACZ,mBAAmB;EACnB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;EACE,OAAO;EACP,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,eAAe;EACf,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAEA;EACE,sBAAsB;EACtB,oBAAoB;AACtB;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,OAAO;EACP,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,gBAAgB;EAChB,iBAAiB;EACjB,aAAa;AACf;;AAEA;EACE,UAAU;EACV,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;AACzC;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,sBAAsB;EACtB,aAAa;AACf;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,sBAAsB;EACtB,eAAe;EACf,eAAe;AACjB;;AAEA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;EACjB,+BAA+B;EAC/B,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;AACf;;AAEA;EACE,iBAAiB;EACjB,eAAe;AACjB;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAEA;EACE,2BAA2B;EAC3B,eAAe;AACjB","sourcesContent":[".g9-popup {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-popup--placed {\n display: block;\n}\n\n.g9-popup__scrim {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-popup__card {\n display: flex;\n flex-direction: column;\n border-width: 1px;\n border-style: solid;\n max-height: 90%;\n}\n\n.g9-popup__content {\n display: flex;\n flex-direction: column;\n}\n\n.g9-popup__header {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px;\n}\n\n.g9-popup__badge {\n width: 36px;\n height: 36px;\n border-radius: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n position: relative;\n}\n\n.g9-dir-rtl .g9-popup__badge {\n margin-right: 0px;\n margin-left: 10px;\n}\n\n.g9-popup__badge-tint {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border-radius: 18px;\n opacity: 0.14;\n}\n\n.g9-popup__title {\n flex: 1;\n font-size: 17px;\n font-weight: 700;\n}\n\n.g9-popup__close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-popup__message {\n font-size: 15px;\n line-height: 22px;\n margin-bottom: 12px;\n}\n\n.g9-popup__body {\n margin-bottom: 12px;\n}\n\n.g9-popup__footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-top: 4px;\n}\n\n.g9-popup__footer--stacked {\n flex-direction: column;\n align-items: stretch;\n}\n\n.g9-popup__button {\n flex: 1;\n height: 44px;\n border-radius: 12px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.g9-popup__button--stacked {\n flex: none;\n margin: 4px 0px;\n}\n\n.g9-popup__button--outline {\n border-width: 1.5px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-popup__button--busy {\n opacity: 0.7;\n}\n\n.g9-popup__button-text {\n font-size: 15px;\n font-weight: 700;\n}\n\n.g9-popup-input {\n display: flex;\n flex-direction: column;\n}\n\n.g9-popup-input__group {\n display: flex;\n flex-direction: column;\n margin-bottom: 10px;\n}\n\n.g9-popup-input__label {\n font-size: 14px;\n color: var(--g9-text-secondary);\n margin-bottom: 6px;\n}\n\n.g9-popup-input__error {\n font-size: 13px;\n color: var(--g9-error);\n margin-top: 4px;\n}\n\n.g9-popup-input__radio {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 40px;\n}\n\n.g9-popup-input__radio-ring {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n border-width: 2px;\n border-style: solid;\n border-color: var(--g9-outline);\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n}\n\n.g9-dir-rtl .g9-popup-input__radio-ring {\n margin-right: 0px;\n margin-left: 10px;\n}\n\n.g9-popup-input__radio--selected .g9-popup-input__radio-ring {\n border-color: var(--g9-primary);\n}\n\n.g9-popup-input__radio-dot {\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: var(--g9-primary);\n}\n\n.g9-popup-input__option-text {\n font-size: 15px;\n color: var(--g9-on-surface);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/popup/popup.css"],"names":[],"mappings":"AAGA;EAFE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,eAAe;EACf,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,cAAc;AAChB;;AAKA;EAFE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,mBAAmB;EACnB,iBAAiB;EACjB,sBAAsB;EACtB,eAAe;EACf,aAAa;AACf;;AAKA;EAFE,sBAAsB;EACtB,aAAa;AACf;;AAKA;EAFE,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AAKA;EAFE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,kBAAkB;AACpB;;AAKA;EAFE,iBAAiB;EACjB,eAAe;AACjB;;AAKA;EAFE,YAAY;EACZ,mBAAmB;EACnB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAA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heet is lynx-ui's `position: fixed` SheetView, which Lynx paints and hit-tests above\n every in-flow node, so an absolute popup over an open sheet was hidden and its buttons unreachable. The popup root\n is created per show, after the sheet, so it lands above it (2026-10-10). */\n.g9-popup {\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-popup--placed {\n display: block;\n}\n\n.g9-popup__scrim {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-popup__card {\n display: flex;\n flex-direction: column;\n border-width: 1px;\n border-style: solid;\n max-height: 90%;\n}\n\n.g9-popup__content {\n display: flex;\n flex-direction: column;\n}\n\n.g9-popup__header {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px;\n}\n\n.g9-popup__badge {\n width: 36px;\n height: 36px;\n border-radius: 18px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n position: relative;\n}\n\n.g9-dir-rtl .g9-popup__badge {\n margin-right: 0px;\n margin-left: 10px;\n}\n\n.g9-popup__badge-tint {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border-radius: 18px;\n opacity: 0.14;\n}\n\n.g9-popup__title {\n flex: 1;\n font-size: 17px;\n font-weight: 700;\n}\n\n.g9-popup__close {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-popup__message {\n font-size: 15px;\n line-height: 22px;\n margin-bottom: 12px;\n}\n\n.g9-popup__body {\n margin-bottom: 12px;\n}\n\n.g9-popup__footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-top: 4px;\n}\n\n.g9-popup__footer--stacked {\n flex-direction: column;\n align-items: stretch;\n}\n\n.g9-popup__button {\n flex: 1;\n height: 44px;\n border-radius: 12px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.g9-popup__button--stacked {\n flex: none;\n margin: 4px 0px;\n}\n\n.g9-popup__button--outline {\n border-width: 1.5px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-popup__button--busy {\n opacity: 0.7;\n}\n\n.g9-popup__button-text {\n font-size: 15px;\n font-weight: 700;\n}\n\n.g9-popup-input {\n display: flex;\n flex-direction: column;\n}\n\n.g9-popup-input__group {\n display: flex;\n flex-direction: column;\n margin-bottom: 10px;\n}\n\n.g9-popup-input__label {\n font-size: 14px;\n color: var(--g9-text-secondary);\n margin-bottom: 6px;\n}\n\n.g9-popup-input__error {\n font-size: 13px;\n color: var(--g9-error);\n margin-top: 4px;\n}\n\n.g9-popup-input__radio {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 40px;\n}\n\n.g9-popup-input__radio-ring {\n width: 20px;\n height: 20px;\n border-radius: 10px;\n border-width: 2px;\n border-style: solid;\n border-color: var(--g9-outline);\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n}\n\n.g9-dir-rtl .g9-popup-input__radio-ring {\n margin-right: 0px;\n margin-left: 10px;\n}\n\n.g9-popup-input__radio--selected .g9-popup-input__radio-ring {\n border-color: var(--g9-primary);\n}\n\n.g9-popup-input__radio-dot {\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: var(--g9-primary);\n}\n\n.g9-popup-input__option-text {\n font-size: 15px;\n color: var(--g9-on-surface);\n}\n"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/popup/service.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAgC,KAAK,mBAAmB,EAAe,MAAM,+BAA+B,CAAC;AACpH,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,gBAAgB,CAAC;AAMnG,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAsB,MAAM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BAAyB;IACzB,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAgVD,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAGjE;AAED,kHAAkH;AAClH,wBAAgB,WAAW,IAAI,cAAc,CAE5C;AAED,wGAAwG;AACxG,wBAAgB,QAAQ,IAAI,cAAc,CAEzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAWzF"}
@@ -1,7 +1,7 @@
1
1
  import "./popup.css";
2
2
  import { G9StringKey, createCulture, createStrings } from "@g9tm/lynxcontrols-foundation";
3
3
  import { useEffect, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
4
- import { g9RowStyle, g9TextStart } from "../base/control.jsx";
4
+ import { g9RowStyle, g9SafeId, g9TextStart } from "../base/control.jsx";
5
5
  import { useG9Press } from "../base/press.jsx";
6
6
  import { startTimer, stopTimer } from "../base/timers.jsx";
7
7
  import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
@@ -34,7 +34,7 @@ function PopupButtonView(props) {
34
34
  backgroundColor: background
35
35
  }} accessibility-element={true} accessibility-traits="button" accessibility-label={button.text} {...button.testId ? {
36
36
  'data-testid': button.testId
37
- } : {}} bindtap={press}>
37
+ } : {}} id={props.id} bindtap={press}>
38
38
  {button.icon || button.iconImage ? <G9IconSlot icon={button.icon} image={null != (_button_iconImage = button.iconImage) ? _button_iconImage : null} size={18} color={color}/> : null}
39
39
  <text className="g9-popup__button-text" style={{
40
40
  color
@@ -92,7 +92,7 @@ function PopupCardContent(props) {
92
92
  </text> : null}
93
93
  {null != content ? <view className="g9-popup__body">{content}</view> : null}
94
94
  {false !== settings.showFooter ? <view className={`g9-popup__footer${stacked ? ' g9-popup__footer--stacked' : ''}`} style={stacked ? {} : row}>
95
- {shown.map((button, i)=><PopupButtonView key={i} button={button} profile={profile} busy={entry.busy} stacked={stacked} onPress={()=>void state.service.queue.press(entry.id, i)}/>)}
95
+ {shown.map((button, i)=><PopupButtonView key={i} id={button.testId ? g9SafeId(button.testId) : `G9Popup_Button_${i}`} button={button} profile={profile} busy={entry.busy} stacked={stacked} onPress={()=>void state.service.queue.press(entry.id, i)}/>)}
96
96
  {entry.busy ? <G9ActivityIndicator running size={18}/> : null}
97
97
  </view> : null}
98
98
  </view>;
@@ -260,7 +260,15 @@ function createPopupService(host) {
260
260
  submit
261
261
  ],
262
262
  settings,
263
- animation: null != (_options_animation = options.animation) ? _options_animation : null
263
+ animation: null != (_options_animation = options.animation) ? _options_animation : null,
264
+ form: {
265
+ fieldKeys: options.fields.map((f)=>f.key),
266
+ setText: (key, value)=>store.setText(key, value),
267
+ getText: (key)=>{
268
+ var _store_getState_form_text_key;
269
+ return null != (_store_getState_form_text_key = store.getState().form.text[key]) ? _store_getState_form_text_key : null;
270
+ }
271
+ }
264
272
  });
265
273
  return result;
266
274
  },
@@ -1 +1 @@
1
- {"version":3,"file":"popup/service.jsx","sources":["../../src/popup/service.tsx"],"sourcesContent":["import './popup.css';\nimport { createCulture, createStrings, type G9ErrorPopupRequest, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Diagnostics, useG9Direction, useG9Settings, useG9Strings, useG9Window } from '../provider/hooks';\nimport { g9DefaultErrorPresenter } from '../provider/settings';\nimport { type G9PopupViewOpenOptions, PopupFrame } from './frame';\nimport { type G9PopupInputOptions, type G9PopupInputResult, g9PopupInputResult } from './input';\nimport { createPopupFormStore, PopupInputForm } from './input-form';\nimport { type G9PopupEntry, type G9PopupOutcome, G9PopupQueue } from './queue';\nimport {\n createPopupVisualProfile,\n customPopup,\n type G9PopupAnimationType,\n type G9PopupButton,\n type G9PopupDescriptor,\n type G9PopupResult,\n type G9PopupSettings,\n type G9PopupType,\n type G9PopupVisualProfile,\n g9PopupResult,\n presetPopup,\n resolvePopupSettings,\n} from './types';\n\n/** Most buttons a `row` footer shows (MAUI); more are dropped with a warning. */\nexport const g9PopupRowButtonLimit = 3;\n\n/** Options of `showConfirm` (MAUI `ShowConfirmAsync`). */\nexport interface G9ConfirmOptions {\n readonly title?: string | null;\n readonly okCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n readonly cancelCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n /** Default `'information'`; `'warning'` for a lossy confirm (sign out, discard). */\n readonly type?: G9PopupType;\n readonly okText?: string;\n readonly cancelText?: string;\n}\n\n/** The popups of a host (MAUI `G9PopupHelper`). */\nexport interface G9PopupService {\n /** Information popup (MAUI `ShowG9PopupAsync`); resolves the result of the button that closed it. */\n show(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showSuccess(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showWarning(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showError(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any content in the body (MAUI `ShowCustomG9PopupAsync`). */\n showCustom(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any descriptor; resolves how it ended. */\n showDescriptor(descriptor: G9PopupDescriptor): Promise<G9PopupOutcome>;\n /** A validated form (MAUI `ShowInputG9PopupAsync`). */\n showInput(options: G9PopupInputOptions): Promise<G9PopupInputResult>;\n /** OK/Cancel: `true` only for OK; every other exit is `false` (MAUI `ShowConfirmAsync`). */\n showConfirm(message: string, options?: G9ConfirmOptions): Promise<boolean>;\n /** Hardware back: `true` when a popup is on screen (closed unless `closeOnBackButton: false`). */\n handleHardwareBack(): boolean;\n /** Closes the popup on screen. */\n closeActive(): void;\n /** Drops waiting popups; the one on screen stays. */\n clearQueue(): void;\n /** Closes everything. */\n dismissAll(): void;\n readonly queue: G9PopupQueue;\n}\n\nconst FEATURE = 'g9.popups';\n\ninterface State {\n service: G9PopupService;\n defaults: G9PopupSettings;\n /** Strings and diagnostics of the provider; refreshed by the layer on every render. */\n strings: (key: G9StringKey) => string;\n warn?: (message: string) => void;\n report?: (error: unknown) => void;\n}\n\nconst fallbackStrings = createStrings({ culture: createCulture('en') });\n\nfunction PopupButtonView(props: {\n readonly button: G9PopupButton;\n readonly profile: G9PopupVisualProfile;\n readonly busy: boolean;\n readonly stacked: boolean;\n readonly onPress: () => void;\n}): ReactNode {\n const { button, profile } = props;\n const primary = button.isPrimary !== false;\n const press = useG9Press(props.onPress, { source: 'G9Popup', guardMs: 0 });\n const background = button.backgroundColor ?? (primary ? profile.buttonBackground : 'transparent');\n const color = button.textColor ?? (primary ? profile.buttonTextColor : 'var(--g9-on-surface)');\n return (\n <view\n className={`g9-popup__button${primary ? ' g9-popup__button--primary' : ' g9-popup__button--outline'}${props.stacked ? ' g9-popup__button--stacked' : ''}${props.busy ? ' g9-popup__button--busy' : ''}`}\n style={{ backgroundColor: background }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={button.text}\n {...(button.testId ? { 'data-testid': button.testId } : {})}\n bindtap={press}\n >\n {button.icon || button.iconImage ? (\n <G9IconSlot icon={button.icon} image={button.iconImage ?? null} size={18} color={color} />\n ) : null}\n <text className=\"g9-popup__button-text\" style={{ color }}>\n {button.text}\n </text>\n </view>\n );\n}\n\n/** Header, body and footer of a queued popup (MAUI helper templates). */\nfunction PopupCardContent(props: {\n readonly entry: G9PopupEntry;\n readonly settings: G9PopupSettings;\n readonly profile: G9PopupVisualProfile;\n readonly state: State;\n}): ReactNode {\n const { entry, settings, profile, state } = props;\n const strings = useG9Strings();\n const d = entry.descriptor;\n const close = useG9Press(() => state.service.queue.closeActive(), { source: 'G9Popup', guardMs: 0 });\n const glyphs = useG9Settings().glyphs;\n const buttons = d.buttons;\n const stacked = settings.footerButtonLayout === 'stacked';\n const shown = stacked ? buttons : buttons.slice(0, g9PopupRowButtonLimit);\n const warned = useRef(false);\n if (!stacked && buttons.length > g9PopupRowButtonLimit && !warned.current) {\n warned.current = true;\n state.warn?.(\n `A row footer shows at most ${g9PopupRowButtonLimit} buttons; ${buttons.length - g9PopupRowButtonLimit} dropped.`,\n );\n }\n const title = d.title?.trim()\n ? d.title\n : strings.get(\n d.type === 'success'\n ? G9StringKey.Success\n : d.type === 'warning'\n ? G9StringKey.Warning\n : d.type === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n );\n const content = typeof d.content === 'function' ? (d.content as () => ReactNode)() : d.content;\n const direction = useG9Direction();\n const row = g9RowStyle(direction);\n return (\n <view className=\"g9-popup__content\">\n {settings.showHeader !== false ? (\n <view className=\"g9-popup__header\" style={row}>\n <view className=\"g9-popup__badge\" accessibility-label={profile.semanticIconDescription}>\n <view className=\"g9-popup__badge-tint\" style={{ backgroundColor: profile.iconColor }} />\n <G9IconSlot icon={profile.icon} size={22} color={profile.iconColor} />\n </view>\n <text className=\"g9-popup__title\" style={{ color: profile.titleColor, ...g9TextStart(direction) }}>\n {title}\n </text>\n {settings.showCloseButton ? (\n <view\n className=\"g9-popup__close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={strings.get(G9StringKey.Close)}\n bindtap={close}\n >\n <G9IconSlot icon={glyphs.clear} size={20} color=\"var(--g9-on-surface-variant)\" />\n </view>\n ) : null}\n </view>\n ) : null}\n {d.message ? (\n <text className=\"g9-popup__message\" style={{ color: profile.messageColor, ...g9TextStart(direction) }}>\n {d.message}\n </text>\n ) : null}\n {content !== null && content !== undefined ? <view className=\"g9-popup__body\">{content}</view> : null}\n {settings.showFooter !== false ? (\n <view className={`g9-popup__footer${stacked ? ' g9-popup__footer--stacked' : ''}`} style={stacked ? {} : row}>\n {shown.map((button, i) => (\n <PopupButtonView\n key={i}\n button={button}\n profile={profile}\n busy={entry.busy}\n stacked={stacked}\n onPress={() => void state.service.queue.press(entry.id, i)}\n />\n ))}\n {entry.busy ? <G9ActivityIndicator running size={18} /> : null}\n </view>\n ) : null}\n </view>\n );\n}\n\n/** The popup layer: the active popup's frame; motion phases from the queue phase. */\nfunction PopupLayer(props: { readonly state: State }): ReactNode {\n const { state } = props;\n const settingsAll = useG9Settings();\n const diagnostics = useG9Diagnostics();\n state.defaults = settingsAll.popups;\n const glyphs = settingsAll.glyphs;\n const strings = useG9Strings();\n state.strings = (k) => strings.get(k);\n state.warn = (message) => diagnostics.log({ level: 'warning', message, source: 'G9Popup' });\n state.report = (error) =>\n diagnostics.log({ level: 'error', message: 'A popup callback failed.', source: 'G9Popup', error });\n const win = useG9Window();\n const queue = state.service.queue;\n const entry = useSyncExternalStore(\n (l) => queue.subscribe(l),\n () => queue.getSnapshot(),\n );\n // `enter` for one frame per show, then `open` (the transition runs), `leave` while closing.\n const [entered, setEntered] = useState<string | null>(null);\n const showKey = entry ? `${entry.id}:${entry.showCount}` : null;\n useEffect(() => {\n if (!showKey) return;\n const t = startTimer(() => setEntered(showKey), 16);\n return () => stopTimer(t);\n }, [showKey]);\n const settings = entry ? resolvePopupSettings(entry.descriptor, state.defaults) : null;\n const duration = settings?.animationDuration ?? 240;\n useEffect(() => {\n if (!entry || entered !== showKey || entry.phase !== 'opening') return;\n const t = startTimer(() => queue.markOpened(entry.id), duration);\n return () => stopTimer(t);\n }, [entered, showKey, entry?.phase]);\n useEffect(() => () => queue.dispose(), [queue]);\n if (!entry || !settings) return null;\n const profile = createPopupVisualProfile(entry.descriptor, settings, glyphs, (k) =>\n strings.get(\n k === 'success'\n ? G9StringKey.Success\n : k === 'warning'\n ? G9StringKey.Warning\n : k === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n ),\n );\n const options: G9PopupViewOpenOptions = {\n width: profile.width,\n height: profile.height,\n cornerRadius: profile.cornerRadius,\n padding: profile.padding,\n autoSizeMode: settings.autoSizeMode ?? 'height',\n cardBackground: profile.cardBackground,\n borderColor: profile.borderColor,\n overlayMode: settings.overlayMode ?? 'transparent',\n blurIntensity: settings.blurIntensity ?? 'none',\n overlayColor: profile.overlayColor,\n overlayOpacity: profile.overlayOpacity,\n animation: profile.animation,\n animationEasing: settings.animationEasing ?? 'sinOut',\n animationDuration: duration,\n };\n const phase = entry.phase === 'closing' ? 'leave' : entered === showKey ? 'open' : 'enter';\n return (\n <PopupFrame\n key={showKey as string}\n options={options}\n phase={phase}\n hostWidth={win.width}\n onBackgroundTap={() => queue.backgroundTap(entry.id)}\n >\n <PopupCardContent entry={entry} settings={settings} profile={profile} state={state} />\n </PopupFrame>\n );\n}\n\nfunction createPopupService(host: G9HostHandle): State {\n const state = { defaults: {}, strings: fallbackStrings.get } as unknown as State;\n const strings = (k: G9StringKey) => state.strings(k);\n const queue = new G9PopupQueue({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n closeDurationMs: (d) =>\n resolvePopupSettings(d, state.defaults).animation === 'none'\n ? 0\n : (resolvePopupSettings(d, state.defaults).animationDuration ?? 240),\n autoCloseMs: (d) => resolvePopupSettings(d, state.defaults).autoCloseDuration ?? 0,\n closesOnBack: (d) => resolvePopupSettings(d, state.defaults).closeOnBackButton !== false,\n closesOnBackgroundTap: (d) => resolvePopupSettings(d, state.defaults).closeOnBackgroundClick === true,\n onError: (error) => state.report?.(error),\n });\n // A popup without buttons gets an OK button (MAUI presets).\n const withOk = (d: G9PopupDescriptor): G9PopupDescriptor =>\n d.buttons.length > 0 ? d : { ...d, buttons: [{ text: strings(G9StringKey.Ok), isPrimary: true }] };\n const preset =\n (type: G9PopupType) =>\n (\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ) =>\n queue.show(withOk(presetPopup(type, message, title, buttons, settings, animation ?? null))).then((o) => o.result);\n const service: G9PopupService = {\n queue,\n show: preset('information'),\n showSuccess: preset('success'),\n showWarning: preset('warning'),\n showError: preset('error'),\n showCustom: (content, title, buttons, settings, animation) =>\n queue.show(withOk(customPopup(content, title, buttons, settings, animation ?? null))).then((o) => o.result),\n showDescriptor: (descriptor) => queue.show(withOk(descriptor)),\n async showInput(options) {\n const store = createPopupFormStore(options.fields);\n let result = g9PopupInputResult.cancel();\n const cancel: G9PopupButton = {\n ...(options.cancelButton ?? { text: options.cancelButtonText ?? strings(G9StringKey.Cancel) }),\n isPrimary: false,\n callback: () => {\n result = g9PopupInputResult.cancel();\n return g9PopupResult.close();\n },\n };\n const submit: G9PopupButton = {\n ...(options.submitButton ?? { text: options.submitButtonText ?? strings(G9StringKey.Save) }),\n isPrimary: true,\n callback: () => {\n const v = store.validate({\n requiredSuffix: strings(G9StringKey.RequiredSuffix),\n invalidEmail: strings(G9StringKey.InvalidEmail),\n });\n result = v.valid\n ? g9PopupInputResult.submit(v.values, v.arrayValues)\n : g9PopupInputResult.validationFailed(v.values, v.arrayValues, v.errors);\n return v.valid ? g9PopupResult.close() : g9PopupResult.noAction();\n },\n };\n const settings: G9PopupSettings = {\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n closeOnBackgroundClick: false,\n autoSizeMode: 'height',\n padding: [20, 12, 20, 8],\n ...Object.fromEntries(Object.entries(options.settings ?? {}).filter(([, v]) => v !== undefined && v !== null)),\n };\n await queue.show({\n type: options.type ?? 'information',\n title: options.title ?? null,\n message: options.message ?? null,\n content: () => <PopupInputForm store={store} focusFirst={options.focusFirstFieldOnOpen !== false} />,\n buttons: [cancel, submit],\n settings,\n animation: options.animation ?? null,\n });\n return result;\n },\n async showConfirm(message, options = {}) {\n let ok = false;\n await queue.show(\n presetPopup(options.type ?? 'information', message, options.title ?? null, [\n {\n text: options.cancelText ?? strings(G9StringKey.Cancel),\n isPrimary: false,\n callback: async (c) => {\n await options.cancelCallback?.(c);\n return g9PopupResult.close();\n },\n },\n {\n text: options.okText ?? strings(G9StringKey.Ok),\n isPrimary: true,\n callback: async (c) => {\n await options.okCallback?.(c);\n ok = true;\n return g9PopupResult.close();\n },\n },\n ]),\n );\n return ok;\n },\n handleHardwareBack: () => queue.handleBack(),\n closeActive: () => queue.closeActive(),\n clearQueue: () => queue.clearQueue(),\n dismissAll: () => queue.dismissAll(),\n };\n state.service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('popups', { key: FEATURE, element: <PopupLayer state={state} />, order: 0 });\n host.back.push(() => (queue.handleBack() ? 'handled' : 'pass'), { layer: 'popups' });\n return state;\n}\n\n/** The popup service of a host (created once as a host feature). */\nexport function popupServiceOf(host: G9HostHandle): G9PopupService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createPopupService(host)).service;\n}\n\n/** The popups of the nearest `G9Host` (MAUI `G9PopupHelper`): one card at a time, FIFO, in the `popups` layer. */\nexport function useG9Popups(): G9PopupService {\n return popupServiceOf(useG9Host());\n}\n\n/** The popups of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Popups(): G9PopupService {\n return popupServiceOf(g9Hosts.require());\n}\n\n/**\n * The default error presenter (installed when this module loads): the executor's error popup as an error-type popup\n * on the active host, with More details when diagnostics are available. Without a host it does nothing.\n */\nexport function presentErrorPopup(request: G9ErrorPopupRequest): Promise<void> | undefined {\n const host = g9Hosts.active();\n if (!host) return undefined;\n const popups = popupServiceOf(host);\n const buttons: G9PopupButton[] = [];\n if (request.moreDetails) {\n const more = request.moreDetails;\n buttons.push({ text: more.text, isPrimary: false, callback: async () => void (await more.open()) });\n }\n buttons.push({ text: request.okText, isPrimary: true });\n return popups.showError(request.message, request.title, buttons).then(() => undefined);\n}\n\ng9DefaultErrorPresenter.current = presentErrorPopup;\n"],"names":["g9PopupRowButtonLimit","FEATURE","fallbackStrings","createStrings","createCulture","PopupButtonView","props","_button_backgroundColor","_button_textColor","_button_iconImage","button","profile","primary","press","useG9Press","background","color","view","G9IconSlot","text","PopupCardContent","_d_title","entry","settings","state","strings","useG9Strings","d","close","glyphs","useG9Settings","buttons","stacked","shown","warned","useRef","title","G9StringKey","content","direction","useG9Direction","row","g9RowStyle","g9TextStart","i","G9ActivityIndicator","PopupLayer","_settings_autoSizeMode","_settings_overlayMode","_settings_blurIntensity","_settings_animationEasing","settingsAll","diagnostics","useG9Diagnostics","k","message","error","win","useG9Window","queue","useSyncExternalStore","l","entered","setEntered","useState","showKey","useEffect","t","startTimer","stopTimer","resolvePopupSettings","duration","createPopupVisualProfile","options","phase","PopupFrame","createPopupService","host","G9PopupQueue","cb","ms","h","_resolvePopupSettings_animationDuration","_resolvePopupSettings_autoCloseDuration","withOk","preset","type","animation","presetPopup","o","service","customPopup","descriptor","_options_cancelButton","_options_cancelButtonText","_options_submitButton","_options_submitButtonText","_options_settings","_options_type","_options_title","_options_message","_options_animation","store","createPopupFormStore","result","g9PopupInputResult","cancel","g9PopupResult","submit","v","Object","PopupInputForm","_options_cancelText","_options_okText","ok","c","popupServiceOf","existing","useG9Popups","useG9Host","g9Popups","g9Hosts","presentErrorPopup","request","popups","more","undefined","g9DefaultErrorPresenter"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,wBAAwB;AAqErC,MAAMC,UAAU;AAWhB,MAAMC,kBAAkBC,c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,WAAW,OAAOtB;QAAW,OAAO;IAAE;IACjGqD,KAAK,IAAI,CAAC,IAAI,CAAC,IAAOlB,MAAM,UAAU,KAAK,YAAY,QAAS;QAAE,OAAO;IAAS;IAClF,OAAOnC;AACT;AAGO,SAAS4F,eAAevC,IAAkB;IAC/C,MAAMwC,WAAWxC,KAAK,UAAU,CAAC5E;IACjC,OAAO,AAACoH,CAAAA,QAAAA,WAAAA,WAAYzC,mBAAmBC,KAAI,EAAG,OAAO;AACvD;AAGO,SAASyC;IACd,OAAOF,eAAeG;AACxB;AAGO,SAASC;IACd,OAAOJ,eAAeK,QAAQ,OAAO;AACvC;AAMO,SAASC,kBAAkBC,OAA4B;IAC5D,MAAM9C,OAAO4C,QAAQ,MAAM;IAC3B,IAAI,CAAC5C,MAAM;IACX,MAAM+C,SAASR,eAAevC;IAC9B,MAAM9C,UAA2B,EAAE;IACnC,IAAI4F,QAAQ,WAAW,EAAE;QACvB,MAAME,OAAOF,QAAQ,WAAW;QAChC5F,QAAQ,IAAI,CAAC;YAAE,MAAM8F,KAAK,IAAI;YAAE,WAAW;YAAO,UAAU,UAAY,KAAM,MAAMA,KAAK,IAAI;QAAI;IACnG;IACA9F,QAAQ,IAAI,CAAC;QAAE,MAAM4F,QAAQ,MAAM;QAAE,WAAW;IAAK;IACrD,OAAOC,OAAO,SAAS,CAACD,QAAQ,OAAO,EAAEA,QAAQ,KAAK,EAAE5F,SAAS,IAAI,CAAC,IAAM+F;AAC9E;AAEAC,wBAAwB,OAAO,GAAGL"}
1
+ {"version":3,"file":"popup/service.jsx","sources":["../../src/popup/service.tsx"],"sourcesContent":["import './popup.css';\nimport { createCulture, createStrings, type G9ErrorPopupRequest, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle, g9SafeId, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Diagnostics, useG9Direction, useG9Settings, useG9Strings, useG9Window } from '../provider/hooks';\nimport { g9DefaultErrorPresenter } from '../provider/settings';\nimport { type G9PopupViewOpenOptions, PopupFrame } from './frame';\nimport { type G9PopupInputOptions, type G9PopupInputResult, g9PopupInputResult } from './input';\nimport { createPopupFormStore, PopupInputForm } from './input-form';\nimport { type G9PopupEntry, type G9PopupOutcome, G9PopupQueue } from './queue';\nimport {\n createPopupVisualProfile,\n customPopup,\n type G9PopupAnimationType,\n type G9PopupButton,\n type G9PopupDescriptor,\n type G9PopupResult,\n type G9PopupSettings,\n type G9PopupType,\n type G9PopupVisualProfile,\n g9PopupResult,\n presetPopup,\n resolvePopupSettings,\n} from './types';\n\n/** Most buttons a `row` footer shows (MAUI); more are dropped with a warning. */\nexport const g9PopupRowButtonLimit = 3;\n\n/** Options of `showConfirm` (MAUI `ShowConfirmAsync`). */\nexport interface G9ConfirmOptions {\n readonly title?: string | null;\n readonly okCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n readonly cancelCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n /** Default `'information'`; `'warning'` for a lossy confirm (sign out, discard). */\n readonly type?: G9PopupType;\n readonly okText?: string;\n readonly cancelText?: string;\n}\n\n/** The popups of a host (MAUI `G9PopupHelper`). */\nexport interface G9PopupService {\n /** Information popup (MAUI `ShowG9PopupAsync`); resolves the result of the button that closed it. */\n show(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showSuccess(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showWarning(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showError(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any content in the body (MAUI `ShowCustomG9PopupAsync`). */\n showCustom(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any descriptor; resolves how it ended. */\n showDescriptor(descriptor: G9PopupDescriptor): Promise<G9PopupOutcome>;\n /** A validated form (MAUI `ShowInputG9PopupAsync`). */\n showInput(options: G9PopupInputOptions): Promise<G9PopupInputResult>;\n /** OK/Cancel: `true` only for OK; every other exit is `false` (MAUI `ShowConfirmAsync`). */\n showConfirm(message: string, options?: G9ConfirmOptions): Promise<boolean>;\n /** Hardware back: `true` when a popup is on screen (closed unless `closeOnBackButton: false`). */\n handleHardwareBack(): boolean;\n /** Closes the popup on screen. */\n closeActive(): void;\n /** Drops waiting popups; the one on screen stays. */\n clearQueue(): void;\n /** Closes everything. */\n dismissAll(): void;\n readonly queue: G9PopupQueue;\n}\n\nconst FEATURE = 'g9.popups';\n\ninterface State {\n service: G9PopupService;\n defaults: G9PopupSettings;\n /** Strings and diagnostics of the provider; refreshed by the layer on every render. */\n strings: (key: G9StringKey) => string;\n warn?: (message: string) => void;\n report?: (error: unknown) => void;\n}\n\nconst fallbackStrings = createStrings({ culture: createCulture('en') });\n\nfunction PopupButtonView(props: {\n readonly button: G9PopupButton;\n /** Element id: the button's `testId` made selector-safe, else `G9Popup_Button_<index>`. */\n readonly id: string;\n readonly profile: G9PopupVisualProfile;\n readonly busy: boolean;\n readonly stacked: boolean;\n readonly onPress: () => void;\n}): ReactNode {\n const { button, profile } = props;\n const primary = button.isPrimary !== false;\n const press = useG9Press(props.onPress, { source: 'G9Popup', guardMs: 0 });\n const background = button.backgroundColor ?? (primary ? profile.buttonBackground : 'transparent');\n const color = button.textColor ?? (primary ? profile.buttonTextColor : 'var(--g9-on-surface)');\n return (\n <view\n className={`g9-popup__button${primary ? ' g9-popup__button--primary' : ' g9-popup__button--outline'}${props.stacked ? ' g9-popup__button--stacked' : ''}${props.busy ? ' g9-popup__button--busy' : ''}`}\n style={{ backgroundColor: background }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={button.text}\n {...(button.testId ? { 'data-testid': button.testId } : {})}\n id={props.id}\n bindtap={press}\n >\n {button.icon || button.iconImage ? (\n <G9IconSlot icon={button.icon} image={button.iconImage ?? null} size={18} color={color} />\n ) : null}\n <text className=\"g9-popup__button-text\" style={{ color }}>\n {button.text}\n </text>\n </view>\n );\n}\n\n/** Header, body and footer of a queued popup (MAUI helper templates). */\nfunction PopupCardContent(props: {\n readonly entry: G9PopupEntry;\n readonly settings: G9PopupSettings;\n readonly profile: G9PopupVisualProfile;\n readonly state: State;\n}): ReactNode {\n const { entry, settings, profile, state } = props;\n const strings = useG9Strings();\n const d = entry.descriptor;\n const close = useG9Press(() => state.service.queue.closeActive(), { source: 'G9Popup', guardMs: 0 });\n const glyphs = useG9Settings().glyphs;\n const buttons = d.buttons;\n const stacked = settings.footerButtonLayout === 'stacked';\n const shown = stacked ? buttons : buttons.slice(0, g9PopupRowButtonLimit);\n const warned = useRef(false);\n if (!stacked && buttons.length > g9PopupRowButtonLimit && !warned.current) {\n warned.current = true;\n state.warn?.(\n `A row footer shows at most ${g9PopupRowButtonLimit} buttons; ${buttons.length - g9PopupRowButtonLimit} dropped.`,\n );\n }\n const title = d.title?.trim()\n ? d.title\n : strings.get(\n d.type === 'success'\n ? G9StringKey.Success\n : d.type === 'warning'\n ? G9StringKey.Warning\n : d.type === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n );\n const content = typeof d.content === 'function' ? (d.content as () => ReactNode)() : d.content;\n const direction = useG9Direction();\n const row = g9RowStyle(direction);\n return (\n <view className=\"g9-popup__content\">\n {settings.showHeader !== false ? (\n <view className=\"g9-popup__header\" style={row}>\n <view className=\"g9-popup__badge\" accessibility-label={profile.semanticIconDescription}>\n <view className=\"g9-popup__badge-tint\" style={{ backgroundColor: profile.iconColor }} />\n <G9IconSlot icon={profile.icon} size={22} color={profile.iconColor} />\n </view>\n <text className=\"g9-popup__title\" style={{ color: profile.titleColor, ...g9TextStart(direction) }}>\n {title}\n </text>\n {settings.showCloseButton ? (\n <view\n className=\"g9-popup__close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={strings.get(G9StringKey.Close)}\n bindtap={close}\n >\n <G9IconSlot icon={glyphs.clear} size={20} color=\"var(--g9-on-surface-variant)\" />\n </view>\n ) : null}\n </view>\n ) : null}\n {d.message ? (\n <text className=\"g9-popup__message\" style={{ color: profile.messageColor, ...g9TextStart(direction) }}>\n {d.message}\n </text>\n ) : null}\n {content !== null && content !== undefined ? <view className=\"g9-popup__body\">{content}</view> : null}\n {settings.showFooter !== false ? (\n <view className={`g9-popup__footer${stacked ? ' g9-popup__footer--stacked' : ''}`} style={stacked ? {} : row}>\n {shown.map((button, i) => (\n <PopupButtonView\n key={i}\n id={button.testId ? g9SafeId(button.testId) : `G9Popup_Button_${i}`}\n button={button}\n profile={profile}\n busy={entry.busy}\n stacked={stacked}\n onPress={() => void state.service.queue.press(entry.id, i)}\n />\n ))}\n {entry.busy ? <G9ActivityIndicator running size={18} /> : null}\n </view>\n ) : null}\n </view>\n );\n}\n\n/** The popup layer: the active popup's frame; motion phases from the queue phase. */\nfunction PopupLayer(props: { readonly state: State }): ReactNode {\n const { state } = props;\n const settingsAll = useG9Settings();\n const diagnostics = useG9Diagnostics();\n state.defaults = settingsAll.popups;\n const glyphs = settingsAll.glyphs;\n const strings = useG9Strings();\n state.strings = (k) => strings.get(k);\n state.warn = (message) => diagnostics.log({ level: 'warning', message, source: 'G9Popup' });\n state.report = (error) =>\n diagnostics.log({ level: 'error', message: 'A popup callback failed.', source: 'G9Popup', error });\n const win = useG9Window();\n const queue = state.service.queue;\n const entry = useSyncExternalStore(\n (l) => queue.subscribe(l),\n () => queue.getSnapshot(),\n );\n // `enter` for one frame per show, then `open` (the transition runs), `leave` while closing.\n const [entered, setEntered] = useState<string | null>(null);\n const showKey = entry ? `${entry.id}:${entry.showCount}` : null;\n useEffect(() => {\n if (!showKey) return;\n const t = startTimer(() => setEntered(showKey), 16);\n return () => stopTimer(t);\n }, [showKey]);\n const settings = entry ? resolvePopupSettings(entry.descriptor, state.defaults) : null;\n const duration = settings?.animationDuration ?? 240;\n useEffect(() => {\n if (!entry || entered !== showKey || entry.phase !== 'opening') return;\n const t = startTimer(() => queue.markOpened(entry.id), duration);\n return () => stopTimer(t);\n }, [entered, showKey, entry?.phase]);\n useEffect(() => () => queue.dispose(), [queue]);\n if (!entry || !settings) return null;\n const profile = createPopupVisualProfile(entry.descriptor, settings, glyphs, (k) =>\n strings.get(\n k === 'success'\n ? G9StringKey.Success\n : k === 'warning'\n ? G9StringKey.Warning\n : k === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n ),\n );\n const options: G9PopupViewOpenOptions = {\n width: profile.width,\n height: profile.height,\n cornerRadius: profile.cornerRadius,\n padding: profile.padding,\n autoSizeMode: settings.autoSizeMode ?? 'height',\n cardBackground: profile.cardBackground,\n borderColor: profile.borderColor,\n overlayMode: settings.overlayMode ?? 'transparent',\n blurIntensity: settings.blurIntensity ?? 'none',\n overlayColor: profile.overlayColor,\n overlayOpacity: profile.overlayOpacity,\n animation: profile.animation,\n animationEasing: settings.animationEasing ?? 'sinOut',\n animationDuration: duration,\n };\n const phase = entry.phase === 'closing' ? 'leave' : entered === showKey ? 'open' : 'enter';\n return (\n <PopupFrame\n key={showKey as string}\n options={options}\n phase={phase}\n hostWidth={win.width}\n onBackgroundTap={() => queue.backgroundTap(entry.id)}\n >\n <PopupCardContent entry={entry} settings={settings} profile={profile} state={state} />\n </PopupFrame>\n );\n}\n\nfunction createPopupService(host: G9HostHandle): State {\n const state = { defaults: {}, strings: fallbackStrings.get } as unknown as State;\n const strings = (k: G9StringKey) => state.strings(k);\n const queue = new G9PopupQueue({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n closeDurationMs: (d) =>\n resolvePopupSettings(d, state.defaults).animation === 'none'\n ? 0\n : (resolvePopupSettings(d, state.defaults).animationDuration ?? 240),\n autoCloseMs: (d) => resolvePopupSettings(d, state.defaults).autoCloseDuration ?? 0,\n closesOnBack: (d) => resolvePopupSettings(d, state.defaults).closeOnBackButton !== false,\n closesOnBackgroundTap: (d) => resolvePopupSettings(d, state.defaults).closeOnBackgroundClick === true,\n onError: (error) => state.report?.(error),\n });\n // A popup without buttons gets an OK button (MAUI presets).\n const withOk = (d: G9PopupDescriptor): G9PopupDescriptor =>\n d.buttons.length > 0 ? d : { ...d, buttons: [{ text: strings(G9StringKey.Ok), isPrimary: true }] };\n const preset =\n (type: G9PopupType) =>\n (\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ) =>\n queue.show(withOk(presetPopup(type, message, title, buttons, settings, animation ?? null))).then((o) => o.result);\n const service: G9PopupService = {\n queue,\n show: preset('information'),\n showSuccess: preset('success'),\n showWarning: preset('warning'),\n showError: preset('error'),\n showCustom: (content, title, buttons, settings, animation) =>\n queue.show(withOk(customPopup(content, title, buttons, settings, animation ?? null))).then((o) => o.result),\n showDescriptor: (descriptor) => queue.show(withOk(descriptor)),\n async showInput(options) {\n const store = createPopupFormStore(options.fields);\n let result = g9PopupInputResult.cancel();\n const cancel: G9PopupButton = {\n ...(options.cancelButton ?? { text: options.cancelButtonText ?? strings(G9StringKey.Cancel) }),\n isPrimary: false,\n callback: () => {\n result = g9PopupInputResult.cancel();\n return g9PopupResult.close();\n },\n };\n const submit: G9PopupButton = {\n ...(options.submitButton ?? { text: options.submitButtonText ?? strings(G9StringKey.Save) }),\n isPrimary: true,\n callback: () => {\n const v = store.validate({\n requiredSuffix: strings(G9StringKey.RequiredSuffix),\n invalidEmail: strings(G9StringKey.InvalidEmail),\n });\n result = v.valid\n ? g9PopupInputResult.submit(v.values, v.arrayValues)\n : g9PopupInputResult.validationFailed(v.values, v.arrayValues, v.errors);\n return v.valid ? g9PopupResult.close() : g9PopupResult.noAction();\n },\n };\n const settings: G9PopupSettings = {\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n closeOnBackgroundClick: false,\n autoSizeMode: 'height',\n padding: [20, 12, 20, 8],\n ...Object.fromEntries(Object.entries(options.settings ?? {}).filter(([, v]) => v !== undefined && v !== null)),\n };\n await queue.show({\n type: options.type ?? 'information',\n title: options.title ?? null,\n message: options.message ?? null,\n content: () => <PopupInputForm store={store} focusFirst={options.focusFirstFieldOnOpen !== false} />,\n buttons: [cancel, submit],\n settings,\n animation: options.animation ?? null,\n form: {\n fieldKeys: options.fields.map((f) => f.key),\n setText: (key, value) => store.setText(key, value),\n getText: (key) => store.getState().form.text[key] ?? null,\n },\n });\n return result;\n },\n async showConfirm(message, options = {}) {\n let ok = false;\n await queue.show(\n presetPopup(options.type ?? 'information', message, options.title ?? null, [\n {\n text: options.cancelText ?? strings(G9StringKey.Cancel),\n isPrimary: false,\n callback: async (c) => {\n await options.cancelCallback?.(c);\n return g9PopupResult.close();\n },\n },\n {\n text: options.okText ?? strings(G9StringKey.Ok),\n isPrimary: true,\n callback: async (c) => {\n await options.okCallback?.(c);\n ok = true;\n return g9PopupResult.close();\n },\n },\n ]),\n );\n return ok;\n },\n handleHardwareBack: () => queue.handleBack(),\n closeActive: () => queue.closeActive(),\n clearQueue: () => queue.clearQueue(),\n dismissAll: () => queue.dismissAll(),\n };\n state.service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('popups', { key: FEATURE, element: <PopupLayer state={state} />, order: 0 });\n host.back.push(() => (queue.handleBack() ? 'handled' : 'pass'), { layer: 'popups' });\n return state;\n}\n\n/** The popup service of a host (created once as a host feature). */\nexport function popupServiceOf(host: G9HostHandle): G9PopupService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createPopupService(host)).service;\n}\n\n/** The popups of the nearest `G9Host` (MAUI `G9PopupHelper`): one card at a time, FIFO, in the `popups` layer. */\nexport function useG9Popups(): G9PopupService {\n return popupServiceOf(useG9Host());\n}\n\n/** The popups of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Popups(): G9PopupService {\n return popupServiceOf(g9Hosts.require());\n}\n\n/**\n * The default error presenter (installed when this module loads): the executor's error popup as an error-type popup\n * on the active host, with More details when diagnostics are available. Without a host it does nothing.\n */\nexport function presentErrorPopup(request: G9ErrorPopupRequest): Promise<void> | undefined {\n const host = g9Hosts.active();\n if (!host) return undefined;\n const popups = popupServiceOf(host);\n const buttons: G9PopupButton[] = [];\n if (request.moreDetails) {\n const more = request.moreDetails;\n buttons.push({ text: more.text, isPrimary: false, callback: async () => void (await more.open()) });\n }\n buttons.push({ text: request.okText, isPrimary: true });\n return popups.showError(request.message, request.title, buttons).then(() => undefined);\n}\n\ng9DefaultErrorPresenter.current = presentErrorPopup;\n"],"names":["g9PopupRowButtonLimit","FEATURE","fallbackStrings","createStrings","createCulture","PopupButtonView","props","_button_backgroundColor","_button_textColor","_button_iconImage","button","profile","primary","press","useG9Press","background","color","view","G9IconSlot","text","PopupCardContent","_d_title","entry","settings","state","strings","useG9Strings","d","close","glyphs","useG9Settings","buttons","stacked","shown","warned","useRef","title","G9StringKey","content","direction","useG9Direction","row","g9RowStyle","g9TextStart","i","g9SafeId","G9ActivityIndicator","PopupLayer","_settings_autoSizeMode","_settings_overlayMode","_settings_blurIntensity","_settings_animationEasing","settingsAll","diagnostics","useG9Diagnostics","k","message","error","win","useG9Window","queue","useSyncExternalStore","l","entered","setEntered","useState","showKey","useEffect","t","startTimer","stopTimer","resolvePopupSettings","duration","createPopupVisualProfile","options","phase","PopupFrame","createPopupService","host","G9PopupQueue","cb","ms","h","_resolvePopupSettings_animationDuration","_resolvePopupSettings_autoCloseDuration","withOk","preset","type","animation","presetPopup","o","service","customPopup","descriptor","_options_cancelButton","_options_cancelButtonText","_options_submitButton","_options_submitButtonText","_options_settings","_options_type","_options_title","_options_message","_options_animation","store","createPopupFormStore","result","g9PopupInputResult","cancel","g9PopupResult","submit","v","Object","PopupInputForm","f","key","value","_store_getState_form_text_key","_options_cancelText","_options_okText","ok","c","popupServiceOf","existing","useG9Popups","useG9Host","g9Popups","g9Hosts","presentErrorPopup","request","popups","more","undefined","g9DefaultErrorPresenter"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,wBAAwB;AAqErC,MAAMC,UAAU;AAWhB,MAAMC,kBAAkBC,cAAc;IAAE,SAASC,cAAc;AAAM;AAErE,SAASC,gBAAgBC,KAQxB;QAIoBC,yBACLC,mBAa8BC;IAjB5C,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGL;IAC5B,MAAMM,UAAUF,AAAqB,UAArBA,OAAO,SAAS;IAChC,MAAMG,QAAQC,WAAWR,MAAM,OAAO,EAAE;QAAE,QAAQ;QAAW,SAAS;IAAE;IACxE,MAAMS,aAAa,QAAAR,CAAAA,0BAAAA,OAAO,eAAe,AAAD,IAArBA,0BAA2BK,UAAUD,QAAQ,gBAAgB,GAAG;IACnF,MAAMK,QAAQ,QAAAR,CAAAA,oBAAAA,OAAO,SAAS,AAAD,IAAfA,oBAAqBI,UAAUD,QAAQ,eAAe,GAAG;IACvE,QACGM,KACC,WAAW,CAAC,gBAAgB,EAAEL,UAAU,+BAA+B,+BAA+BN,MAAM,OAAO,GAAG,+BAA+B,KAAKA,MAAM,IAAI,GAAG,4BAA4B,IAAI,EACvM,OAAO;QAAE,iBAAiBS;IAAW,GACrC,uBAAuB,MACvB,qBAAqB,SACrB,qBAAqBL,OAAO,IAAI,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AGO,SAAS6C;IACd,OAAOF,eAAeG;AACxB;AAGO,SAASC;IACd,OAAOJ,eAAeK,QAAQ,OAAO;AACvC;AAMO,SAASC,kBAAkBC,OAA4B;IAC5D,MAAMlD,OAAOgD,QAAQ,MAAM;IAC3B,IAAI,CAAChD,MAAM;IACX,MAAMmD,SAASR,eAAe3C;IAC9B,MAAM/C,UAA2B,EAAE;IACnC,IAAIiG,QAAQ,WAAW,EAAE;QACvB,MAAME,OAAOF,QAAQ,WAAW;QAChCjG,QAAQ,IAAI,CAAC;YAAE,MAAMmG,KAAK,IAAI;YAAE,WAAW;YAAO,UAAU,UAAY,KAAM,MAAMA,KAAK,IAAI;QAAI;IACnG;IACAnG,QAAQ,IAAI,CAAC;QAAE,MAAMiG,QAAQ,MAAM;QAAE,WAAW;IAAK;IACrD,OAAOC,OAAO,SAAS,CAACD,QAAQ,OAAO,EAAEA,QAAQ,KAAK,EAAEjG,SAAS,IAAI,CAAC,IAAMoG;AAC9E;AAEAC,wBAAwB,OAAO,GAAGL"}
@@ -169,6 +169,17 @@ export interface G9PopupDescriptor {
169
169
  readonly settings: G9PopupSettings | null;
170
170
  /** Motion of this popup; `null` = the settings' (per call, then app default). */
171
171
  readonly animation: G9PopupAnimationType | null;
172
+ /**
173
+ * An input popup's live form (`showInput`): UI automation fills it like a user typing (`setText`), and the submit
174
+ * button validates it as usual. Absent on every other popup.
175
+ */
176
+ readonly form?: G9PopupFormHandle;
177
+ }
178
+ /** The part of an input popup's form store automation may drive. */
179
+ export interface G9PopupFormHandle {
180
+ readonly fieldKeys: ReadonlyArray<string>;
181
+ setText(key: string, value: string): void;
182
+ getText(key: string): string | null;
172
183
  }
173
184
  /** A preset popup (MAUI `G9PopupDescriptor.ForPreset`). */
174
185
  export declare function presetPopup(type: G9PopupType, message: string, title?: string | null, buttons?: ReadonlyArray<G9PopupButton> | null, settings?: G9PopupSettings | null, animation?: G9PopupAnimationType | null): G9PopupDescriptor;
@@ -1 +1 @@
1
- {"version":3,"file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S,GAAG,SAAS,GAAG,OAAO,KAAK,MAAM,GAC1E,oBAAoB,CA+BtB;AAED,0GAA0G;AAC1G,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAK/G"}
@@ -1 +1 @@
1
- {"version":3,"file":"popup/types.jsx","sources":["../../src/popup/types.ts"],"sourcesContent":["import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { type G9ColorToken, g9Token } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9IconInput } from '../icon/icon';\n\n// Popup data types (MAUI `G9PopupType`, `G9PopupButton`, `G9PopupResult`, `G9PopupDescriptor`, `G9PopupSettings`,\n// `G9PopupVisualProfile` and the G9PopupView enums).\n\n/** Popup kind (MAUI `G9PopupType`): the accent, icon and semantics. */\nexport const G9PopupType = {\n Information: 'information',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n Custom: 'custom',\n} as const;\nexport type G9PopupType = (typeof G9PopupType)[keyof typeof G9PopupType];\n\n/** Card motion (MAUI `G9PopupAnimationType`). */\nexport const G9PopupAnimationType = {\n None: 'none',\n FadeIn: 'fadeIn',\n SlideUp: 'slideUp',\n Bounce: 'bounce',\n ZoomIn: 'zoomIn',\n DropIn: 'dropIn',\n} as const;\nexport type G9PopupAnimationType = (typeof G9PopupAnimationType)[keyof typeof G9PopupAnimationType];\n\n/** Easing of the card motion (MAUI `G9PopupViewAnimationEasing`). */\nexport const G9PopupAnimationEasing = {\n Linear: 'linear',\n SinIn: 'sinIn',\n SinOut: 'sinOut',\n SinInOut: 'sinInOut',\n CubicOut: 'cubicOut',\n BounceOut: 'bounceOut',\n} as const;\nexport type G9PopupAnimationEasing = (typeof G9PopupAnimationEasing)[keyof typeof G9PopupAnimationEasing];\n\n/** Footer arrangement (MAUI `G9PopupFooterButtonLayout`). */\nexport const G9PopupFooterButtonLayout = { Row: 'row', Stacked: 'stacked' } as const;\nexport type G9PopupFooterButtonLayout = (typeof G9PopupFooterButtonLayout)[keyof typeof G9PopupFooterButtonLayout];\n\n/** Card sizing (MAUI `G9PopupViewAutoSizeMode`). */\nexport const G9PopupAutoSizeMode = { Both: 'both', Height: 'height', Width: 'width', None: 'none' } as const;\nexport type G9PopupAutoSizeMode = (typeof G9PopupAutoSizeMode)[keyof typeof G9PopupAutoSizeMode];\n\n/** Scrim (MAUI `G9PopupViewOverlayMode`); `'none'` = non-modal (taps pass through to the page). */\nexport const G9PopupOverlayMode = { Transparent: 'transparent', Blur: 'blur', None: 'none' } as const;\nexport type G9PopupOverlayMode = (typeof G9PopupOverlayMode)[keyof typeof G9PopupOverlayMode];\n\n/** Blur strength (MAUI `G9PopupViewBlurIntensity`); G9 has no blur: it darkens the scrim (MAUI's fallback). */\nexport const G9PopupBlurIntensity = {\n None: 'none',\n Light: 'light',\n ExtraLight: 'extraLight',\n Dark: 'dark',\n ExtraDark: 'extraDark',\n} as const;\nexport type G9PopupBlurIntensity = (typeof G9PopupBlurIntensity)[keyof typeof G9PopupBlurIntensity];\n\n/** Card placement against an anchor (MAUI `G9PopupViewRelativePosition`). */\nexport const G9PopupRelativePosition = {\n AlignTop: 'alignTop',\n AlignBottom: 'alignBottom',\n AlignLeft: 'alignLeft',\n AlignRight: 'alignRight',\n AlignTopLeft: 'alignTopLeft',\n AlignTopRight: 'alignTopRight',\n AlignBottomLeft: 'alignBottomLeft',\n AlignBottomRight: 'alignBottomRight',\n AlignToLeftOf: 'alignToLeftOf',\n AlignToRightOf: 'alignToRightOf',\n AlignToTopOf: 'alignToTopOf',\n AlignToBottomOf: 'alignToBottomOf',\n} as const;\nexport type G9PopupRelativePosition = (typeof G9PopupRelativePosition)[keyof typeof G9PopupRelativePosition];\n\n/** What happens after a button callback (MAUI `G9PopupResultAction`). */\nexport const G9PopupResultAction = { Close: 'close', DoNothing: 'doNothing', ShowNext: 'showNext' } as const;\nexport type G9PopupResultAction = (typeof G9PopupResultAction)[keyof typeof G9PopupResultAction];\n\n/** A button callback's answer (MAUI `G9PopupResult`). */\nexport interface G9PopupResult {\n readonly action: G9PopupResultAction;\n /** With `showNext`: the popup shown right after this one closes. */\n readonly nextPopup: G9PopupDescriptor | null;\n /** Runs after the close motion; the queue does not wait for it (a popup it requests shows at once). */\n readonly afterClose: (() => unknown) | null;\n}\n\n/** Builders of {@link G9PopupResult} (MAUI `G9PopupResult.Close/NoAction/ShowNext`). */\nexport const g9PopupResult = Object.freeze({\n close: (afterClose?: (() => unknown) | null): G9PopupResult => ({\n action: 'close',\n nextPopup: null,\n afterClose: afterClose ?? null,\n }),\n noAction: (): G9PopupResult => ({ action: 'doNothing', nextPopup: null, afterClose: null }),\n showNext: (descriptor: G9PopupDescriptor): G9PopupResult => ({\n action: 'showNext',\n nextPopup: descriptor,\n afterClose: null,\n }),\n});\n\n/** Abort state handed to a callback; `aborted` turns true when the popup was dismissed while it ran. */\nexport interface G9PopupCallbackContext {\n readonly aborted: boolean;\n}\n\n/** A footer button (MAUI `G9PopupButton`). */\nexport interface G9PopupButton {\n readonly text: string;\n /** Runs once per tap (the footer gate); returning nothing closes the popup. */\n readonly callback?: // biome-ignore lint/suspicious/noConfusingVoidType: a callback may return nothing (= close)\n ((context: G9PopupCallbackContext) => G9PopupResult | void | Promise<G9PopupResult | void>) | null;\n /** Filled accent button; false = outline. Default true (MAUI). */\n readonly isPrimary?: boolean;\n readonly icon?: G9IconInput;\n readonly iconImage?: G9ImageSource | null;\n readonly textColor?: string | null;\n readonly backgroundColor?: string | null;\n /** Test/automation id (MAUI `AutomationId`). */\n readonly testId?: string | null;\n}\n\n/** A plain close button (MAUI `G9PopupButton.CloseButton(text)`). */\nexport function closePopupButton(text: string): G9PopupButton {\n return { text, isPrimary: true };\n}\n\n/** Per-popup settings; every field optional, merged over the app defaults (MAUI `G9PopupSettings`). */\nexport interface G9PopupSettings {\n readonly closeOnBackgroundClick?: boolean;\n readonly closeOnBackButton?: boolean;\n readonly animationDuration?: number;\n readonly animation?: G9PopupAnimationType;\n readonly animationEasing?: G9PopupAnimationEasing;\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly overlayMode?: G9PopupOverlayMode;\n /** Close after this many ms (0 = never). */\n readonly autoCloseDuration?: number;\n readonly showHeader?: boolean;\n readonly showFooter?: boolean;\n readonly footerButtonLayout?: G9PopupFooterButtonLayout;\n /** × in the header corner. */\n readonly showCloseButton?: boolean;\n readonly width?: number | null;\n readonly height?: number | null;\n /** `[left, top, right, bottom]` (physical, like MAUI `Thickness`). */\n readonly padding?: readonly [number, number, number, number];\n readonly cornerRadius?: number;\n readonly overlayOpacity?: number;\n readonly overlayColor?: string | null;\n readonly cardBackgroundColor?: string | null;\n readonly borderColor?: string | null;\n readonly titleColor?: string | null;\n readonly messageColor?: string | null;\n readonly iconOverride?: G9IconInput;\n readonly blurIntensity?: G9PopupBlurIntensity;\n}\n\n/** The library defaults (MAUI `G9PopupSettings.CreateDefault`). */\nexport function createDefaultPopupSettings(): Required<\n Omit<\n G9PopupSettings,\n | 'width'\n | 'height'\n | 'overlayColor'\n | 'cardBackgroundColor'\n | 'borderColor'\n | 'titleColor'\n | 'messageColor'\n | 'iconOverride'\n | 'blurIntensity'\n >\n> &\n G9PopupSettings {\n return {\n closeOnBackgroundClick: false,\n closeOnBackButton: true,\n animationDuration: 240,\n animation: 'slideUp',\n animationEasing: 'sinOut',\n overlayMode: 'transparent',\n autoCloseDuration: 0,\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n footerButtonLayout: 'row',\n autoSizeMode: 'height',\n padding: [20, 16, 20, 12],\n cornerRadius: 16,\n overlayOpacity: 0.45,\n };\n}\n\n/** Field by field, `settings` wins over `defaults` (MAUI `WithDefaults`). */\nexport function mergePopupSettings(\n settings: G9PopupSettings | null | undefined,\n defaults: G9PopupSettings,\n): G9PopupSettings {\n const out: Record<string, unknown> = { ...defaults };\n for (const [k, v] of Object.entries(settings ?? {})) if (v !== undefined && v !== null) out[k] = v;\n return out as G9PopupSettings;\n}\n\n/**\n * The effective settings of a popup (MAUI `ResolveSettings`): per-call settings over the app defaults; the motion is\n * the per-call setting, else the descriptor's, else the app default (MAUI ignored a configured default animation\n * because every helper passed SlideUp explicitly; here it applies).\n */\nexport function resolvePopupSettings(descriptor: G9PopupDescriptor, defaults: G9PopupSettings): G9PopupSettings {\n const merged = mergePopupSettings(descriptor.settings, defaults);\n const animation = descriptor.settings?.animation ?? descriptor.animation ?? defaults.animation ?? 'slideUp';\n return { ...merged, animation };\n}\n\n/** Popup body: a message or any content (MAUI `CustomView`). */\nexport interface G9PopupDescriptor {\n readonly type: G9PopupType;\n readonly title: string | null;\n readonly message: string | null;\n /** Custom body (built once per show; a factory is called when the card mounts). */\n readonly content: ReactNode | (() => ReactNode) | null;\n readonly buttons: ReadonlyArray<G9PopupButton>;\n readonly settings: G9PopupSettings | null;\n /** Motion of this popup; `null` = the settings' (per call, then app default). */\n readonly animation: G9PopupAnimationType | null;\n}\n\n/** A preset popup (MAUI `G9PopupDescriptor.ForPreset`). */\nexport function presetPopup(\n type: G9PopupType,\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message,\n content: null,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** A custom-content popup (MAUI `G9PopupDescriptor.ForCustom`). */\nexport function customPopup(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n type: G9PopupType = 'custom',\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message: null,\n content,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** Resolved look of one popup (MAUI `G9PopupVisualProfile`). */\nexport interface G9PopupVisualProfile {\n readonly iconColor: string;\n readonly cardBackground: string;\n readonly borderColor: string;\n readonly titleColor: string;\n readonly messageColor: string;\n readonly buttonBackground: string;\n readonly buttonTextColor: string;\n readonly overlayColor: string;\n readonly overlayOpacity: number;\n readonly width: number | null;\n readonly height: number | null;\n readonly cornerRadius: number;\n readonly padding: readonly [number, number, number, number];\n readonly icon: G9IconInput;\n readonly animation: G9PopupAnimationType;\n readonly animationDuration: number;\n /** Localizable accessibility name of the type (`'Information'`, …). */\n readonly semanticIconDescription: string;\n}\n\nconst ACCENT: Record<G9PopupType, [G9ColorToken, G9ColorToken]> = {\n information: ['Info', 'OnInfo'],\n success: ['Success', 'OnSuccess'],\n warning: ['Warning', 'OnWarning'],\n error: ['Error', 'OnError'],\n custom: ['Info', 'OnInfo'],\n};\n\n/**\n * Resolves a popup's look (MAUI `G9PopupVisualProfile.Create`): each type takes its own semantic accent (never\n * Primary) for icon, title and the filled button, the button text takes the matching `On*` token, the scrim is the\n * `Scrim` token at `overlayOpacity`. Settings override colours, icon, size, radius, padding and motion.\n */\nexport function createPopupVisualProfile(\n descriptor: G9PopupDescriptor,\n settings: G9PopupSettings,\n glyphs: {\n readonly info: G9IconInput;\n readonly success: G9IconInput;\n readonly warning: G9IconInput;\n readonly error: G9IconInput;\n },\n semantic: (type: 'information' | 'success' | 'warning' | 'error') => string,\n): G9PopupVisualProfile {\n const [accent, onAccent] = ACCENT[descriptor.type];\n const icon =\n settings.iconOverride ??\n (descriptor.type === 'success'\n ? glyphs.success\n : descriptor.type === 'warning'\n ? glyphs.warning\n : descriptor.type === 'error'\n ? glyphs.error\n : glyphs.info);\n const kind = descriptor.type === 'custom' ? 'information' : descriptor.type;\n return {\n iconColor: g9Token(accent),\n cardBackground: settings.cardBackgroundColor ?? g9Token('Surface'),\n borderColor: settings.borderColor ?? g9Token('Surface'),\n titleColor: settings.titleColor ?? g9Token(accent),\n messageColor: settings.messageColor ?? g9Token('OnSurface'),\n buttonBackground: g9Token(accent),\n buttonTextColor: g9Token(onAccent),\n overlayColor: settings.overlayColor ?? g9Token('Scrim'),\n overlayOpacity: settings.overlayOpacity ?? 0.45,\n width: settings.width ?? null,\n height: settings.height ?? null,\n cornerRadius: settings.cornerRadius ?? 16,\n padding: settings.padding ?? [20, 16, 20, 12],\n icon,\n animation: settings.animation ?? descriptor.animation ?? 'slideUp',\n animationDuration: settings.animationDuration ?? 300,\n semanticIconDescription: semantic(kind),\n };\n}\n\n/** The scrim opacity of a mode (MAUI `Blur` fallback: a darker scrim by intensity; `none` = no scrim). */\nexport function popupScrimOpacity(mode: G9PopupOverlayMode, opacity: number, blur: G9PopupBlurIntensity): number {\n if (mode === 'none') return 0;\n if (mode !== 'blur') return opacity;\n const extra = { none: 0, light: 0.05, extraLight: 0.1, dark: 0.15, extraDark: 0.2 }[blur];\n return Math.min(1, opacity + extra);\n}\n"],"names":["G9PopupType","G9PopupAnimationType","G9PopupAnimationEasing","G9PopupFooterButtonLayout","G9PopupAutoSizeMode","G9PopupOverlayMode","G9PopupBlurIntensity","G9PopupRelativePosition","G9PopupResultAction","g9PopupResult","Object","afterClose","descriptor","closePopupButton","text","createDefaultPopupSettings","mergePopupSettings","settings","defaults","out","k","v","resolvePopupSettings","_ref","merged","animation","presetPopup","type","message","title","buttons","customPopup","content","ACCENT","createPopupVisualProfile","glyphs","semantic","_settings_iconOverride","_settings_cardBackgroundColor","_settings_borderColor","_settings_titleColor","_settings_messageColor","_settings_overlayColor","_settings_overlayOpacity","_settings_width","_settings_height","_settings_cornerRadius","_settings_padding","_settings_animationDuration","accent","onAccent","icon","kind","g9Token","popupScrimOpacity","mode","opacity","blur","extra","Math"],"mappings":";AASO,MAAMA,cAAc;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;AACV;AAIO,MAAMC,uBAAuB;IAClC,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;AACV;AAIO,MAAMC,yBAAyB;IACpC,QAAQ;IACR,OAA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2B;QAC3C,OAAO,QAAAC,CAAAA,kBAAAA,SAAS,KAAK,AAAD,IAAbA,kBAAkB;QACzB,QAAQ,QAAAC,CAAAA,mBAAAA,SAAS,MAAM,AAAD,IAAdA,mBAAmB;QAC3B,cAAc,QAAAC,CAAAA,yBAAAA,SAAS,YAAY,AAAD,IAApBA,yBAAyB;QACvC,SAAS,QAAAC,CAAAA,oBAAAA,SAAS,OAAO,AAAD,IAAfA,oBAAoB;YAAC;YAAI;YAAI;YAAI;SAAG;QAC7CI;QACA,WAAW,QAAA5B,CAAAA,OAAAA,QAAAA,CAAAA,sBAAAA,SAAS,SAAS,AAAD,IAAjBA,sBAAsBX,WAAW,SAAS,AAAD,IAAzCW,OAA8C;QACzD,mBAAmB,QAAAyB,CAAAA,8BAAAA,SAAS,iBAAiB,AAAD,IAAzBA,8BAA8B;QACjD,yBAAyBZ,SAASgB;IACpC;AACF;AAGO,SAASE,kBAAkBC,IAAwB,EAAEC,OAAe,EAAEC,IAA0B;IACrG,IAAIF,AAAS,WAATA,MAAiB,OAAO;IAC5B,IAAIA,AAAS,WAATA,MAAiB,OAAOC;IAC5B,MAAME,QAAQ;QAAE,MAAM;QAAG,OAAO;QAAM,YAAY;QAAK,MAAM;QAAM,WAAW;IAAI,CAAC,CAACD,KAAK;IACzF,OAAOE,KAAK,GAAG,CAAC,GAAGH,UAAUE;AAC/B"}
1
+ {"version":3,"file":"popup/types.jsx","sources":["../../src/popup/types.ts"],"sourcesContent":["import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { type G9ColorToken, g9Token } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport type { G9IconInput } from '../icon/icon';\n\n// Popup data types (MAUI `G9PopupType`, `G9PopupButton`, `G9PopupResult`, `G9PopupDescriptor`, `G9PopupSettings`,\n// `G9PopupVisualProfile` and the G9PopupView enums).\n\n/** Popup kind (MAUI `G9PopupType`): the accent, icon and semantics. */\nexport const G9PopupType = {\n Information: 'information',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n Custom: 'custom',\n} as const;\nexport type G9PopupType = (typeof G9PopupType)[keyof typeof G9PopupType];\n\n/** Card motion (MAUI `G9PopupAnimationType`). */\nexport const G9PopupAnimationType = {\n None: 'none',\n FadeIn: 'fadeIn',\n SlideUp: 'slideUp',\n Bounce: 'bounce',\n ZoomIn: 'zoomIn',\n DropIn: 'dropIn',\n} as const;\nexport type G9PopupAnimationType = (typeof G9PopupAnimationType)[keyof typeof G9PopupAnimationType];\n\n/** Easing of the card motion (MAUI `G9PopupViewAnimationEasing`). */\nexport const G9PopupAnimationEasing = {\n Linear: 'linear',\n SinIn: 'sinIn',\n SinOut: 'sinOut',\n SinInOut: 'sinInOut',\n CubicOut: 'cubicOut',\n BounceOut: 'bounceOut',\n} as const;\nexport type G9PopupAnimationEasing = (typeof G9PopupAnimationEasing)[keyof typeof G9PopupAnimationEasing];\n\n/** Footer arrangement (MAUI `G9PopupFooterButtonLayout`). */\nexport const G9PopupFooterButtonLayout = { Row: 'row', Stacked: 'stacked' } as const;\nexport type G9PopupFooterButtonLayout = (typeof G9PopupFooterButtonLayout)[keyof typeof G9PopupFooterButtonLayout];\n\n/** Card sizing (MAUI `G9PopupViewAutoSizeMode`). */\nexport const G9PopupAutoSizeMode = { Both: 'both', Height: 'height', Width: 'width', None: 'none' } as const;\nexport type G9PopupAutoSizeMode = (typeof G9PopupAutoSizeMode)[keyof typeof G9PopupAutoSizeMode];\n\n/** Scrim (MAUI `G9PopupViewOverlayMode`); `'none'` = non-modal (taps pass through to the page). */\nexport const G9PopupOverlayMode = { Transparent: 'transparent', Blur: 'blur', None: 'none' } as const;\nexport type G9PopupOverlayMode = (typeof G9PopupOverlayMode)[keyof typeof G9PopupOverlayMode];\n\n/** Blur strength (MAUI `G9PopupViewBlurIntensity`); G9 has no blur: it darkens the scrim (MAUI's fallback). */\nexport const G9PopupBlurIntensity = {\n None: 'none',\n Light: 'light',\n ExtraLight: 'extraLight',\n Dark: 'dark',\n ExtraDark: 'extraDark',\n} as const;\nexport type G9PopupBlurIntensity = (typeof G9PopupBlurIntensity)[keyof typeof G9PopupBlurIntensity];\n\n/** Card placement against an anchor (MAUI `G9PopupViewRelativePosition`). */\nexport const G9PopupRelativePosition = {\n AlignTop: 'alignTop',\n AlignBottom: 'alignBottom',\n AlignLeft: 'alignLeft',\n AlignRight: 'alignRight',\n AlignTopLeft: 'alignTopLeft',\n AlignTopRight: 'alignTopRight',\n AlignBottomLeft: 'alignBottomLeft',\n AlignBottomRight: 'alignBottomRight',\n AlignToLeftOf: 'alignToLeftOf',\n AlignToRightOf: 'alignToRightOf',\n AlignToTopOf: 'alignToTopOf',\n AlignToBottomOf: 'alignToBottomOf',\n} as const;\nexport type G9PopupRelativePosition = (typeof G9PopupRelativePosition)[keyof typeof G9PopupRelativePosition];\n\n/** What happens after a button callback (MAUI `G9PopupResultAction`). */\nexport const G9PopupResultAction = { Close: 'close', DoNothing: 'doNothing', ShowNext: 'showNext' } as const;\nexport type G9PopupResultAction = (typeof G9PopupResultAction)[keyof typeof G9PopupResultAction];\n\n/** A button callback's answer (MAUI `G9PopupResult`). */\nexport interface G9PopupResult {\n readonly action: G9PopupResultAction;\n /** With `showNext`: the popup shown right after this one closes. */\n readonly nextPopup: G9PopupDescriptor | null;\n /** Runs after the close motion; the queue does not wait for it (a popup it requests shows at once). */\n readonly afterClose: (() => unknown) | null;\n}\n\n/** Builders of {@link G9PopupResult} (MAUI `G9PopupResult.Close/NoAction/ShowNext`). */\nexport const g9PopupResult = Object.freeze({\n close: (afterClose?: (() => unknown) | null): G9PopupResult => ({\n action: 'close',\n nextPopup: null,\n afterClose: afterClose ?? null,\n }),\n noAction: (): G9PopupResult => ({ action: 'doNothing', nextPopup: null, afterClose: null }),\n showNext: (descriptor: G9PopupDescriptor): G9PopupResult => ({\n action: 'showNext',\n nextPopup: descriptor,\n afterClose: null,\n }),\n});\n\n/** Abort state handed to a callback; `aborted` turns true when the popup was dismissed while it ran. */\nexport interface G9PopupCallbackContext {\n readonly aborted: boolean;\n}\n\n/** A footer button (MAUI `G9PopupButton`). */\nexport interface G9PopupButton {\n readonly text: string;\n /** Runs once per tap (the footer gate); returning nothing closes the popup. */\n readonly callback?: // biome-ignore lint/suspicious/noConfusingVoidType: a callback may return nothing (= close)\n ((context: G9PopupCallbackContext) => G9PopupResult | void | Promise<G9PopupResult | void>) | null;\n /** Filled accent button; false = outline. Default true (MAUI). */\n readonly isPrimary?: boolean;\n readonly icon?: G9IconInput;\n readonly iconImage?: G9ImageSource | null;\n readonly textColor?: string | null;\n readonly backgroundColor?: string | null;\n /** Test/automation id (MAUI `AutomationId`). */\n readonly testId?: string | null;\n}\n\n/** A plain close button (MAUI `G9PopupButton.CloseButton(text)`). */\nexport function closePopupButton(text: string): G9PopupButton {\n return { text, isPrimary: true };\n}\n\n/** Per-popup settings; every field optional, merged over the app defaults (MAUI `G9PopupSettings`). */\nexport interface G9PopupSettings {\n readonly closeOnBackgroundClick?: boolean;\n readonly closeOnBackButton?: boolean;\n readonly animationDuration?: number;\n readonly animation?: G9PopupAnimationType;\n readonly animationEasing?: G9PopupAnimationEasing;\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly overlayMode?: G9PopupOverlayMode;\n /** Close after this many ms (0 = never). */\n readonly autoCloseDuration?: number;\n readonly showHeader?: boolean;\n readonly showFooter?: boolean;\n readonly footerButtonLayout?: G9PopupFooterButtonLayout;\n /** × in the header corner. */\n readonly showCloseButton?: boolean;\n readonly width?: number | null;\n readonly height?: number | null;\n /** `[left, top, right, bottom]` (physical, like MAUI `Thickness`). */\n readonly padding?: readonly [number, number, number, number];\n readonly cornerRadius?: number;\n readonly overlayOpacity?: number;\n readonly overlayColor?: string | null;\n readonly cardBackgroundColor?: string | null;\n readonly borderColor?: string | null;\n readonly titleColor?: string | null;\n readonly messageColor?: string | null;\n readonly iconOverride?: G9IconInput;\n readonly blurIntensity?: G9PopupBlurIntensity;\n}\n\n/** The library defaults (MAUI `G9PopupSettings.CreateDefault`). */\nexport function createDefaultPopupSettings(): Required<\n Omit<\n G9PopupSettings,\n | 'width'\n | 'height'\n | 'overlayColor'\n | 'cardBackgroundColor'\n | 'borderColor'\n | 'titleColor'\n | 'messageColor'\n | 'iconOverride'\n | 'blurIntensity'\n >\n> &\n G9PopupSettings {\n return {\n closeOnBackgroundClick: false,\n closeOnBackButton: true,\n animationDuration: 240,\n animation: 'slideUp',\n animationEasing: 'sinOut',\n overlayMode: 'transparent',\n autoCloseDuration: 0,\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n footerButtonLayout: 'row',\n autoSizeMode: 'height',\n padding: [20, 16, 20, 12],\n cornerRadius: 16,\n overlayOpacity: 0.45,\n };\n}\n\n/** Field by field, `settings` wins over `defaults` (MAUI `WithDefaults`). */\nexport function mergePopupSettings(\n settings: G9PopupSettings | null | undefined,\n defaults: G9PopupSettings,\n): G9PopupSettings {\n const out: Record<string, unknown> = { ...defaults };\n for (const [k, v] of Object.entries(settings ?? {})) if (v !== undefined && v !== null) out[k] = v;\n return out as G9PopupSettings;\n}\n\n/**\n * The effective settings of a popup (MAUI `ResolveSettings`): per-call settings over the app defaults; the motion is\n * the per-call setting, else the descriptor's, else the app default (MAUI ignored a configured default animation\n * because every helper passed SlideUp explicitly; here it applies).\n */\nexport function resolvePopupSettings(descriptor: G9PopupDescriptor, defaults: G9PopupSettings): G9PopupSettings {\n const merged = mergePopupSettings(descriptor.settings, defaults);\n const animation = descriptor.settings?.animation ?? descriptor.animation ?? defaults.animation ?? 'slideUp';\n return { ...merged, animation };\n}\n\n/** Popup body: a message or any content (MAUI `CustomView`). */\nexport interface G9PopupDescriptor {\n readonly type: G9PopupType;\n readonly title: string | null;\n readonly message: string | null;\n /** Custom body (built once per show; a factory is called when the card mounts). */\n readonly content: ReactNode | (() => ReactNode) | null;\n readonly buttons: ReadonlyArray<G9PopupButton>;\n readonly settings: G9PopupSettings | null;\n /** Motion of this popup; `null` = the settings' (per call, then app default). */\n readonly animation: G9PopupAnimationType | null;\n /**\n * An input popup's live form (`showInput`): UI automation fills it like a user typing (`setText`), and the submit\n * button validates it as usual. Absent on every other popup.\n */\n readonly form?: G9PopupFormHandle;\n}\n\n/** The part of an input popup's form store automation may drive. */\nexport interface G9PopupFormHandle {\n readonly fieldKeys: ReadonlyArray<string>;\n setText(key: string, value: string): void;\n getText(key: string): string | null;\n}\n\n/** A preset popup (MAUI `G9PopupDescriptor.ForPreset`). */\nexport function presetPopup(\n type: G9PopupType,\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message,\n content: null,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** A custom-content popup (MAUI `G9PopupDescriptor.ForCustom`). */\nexport function customPopup(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation: G9PopupAnimationType | null = null,\n type: G9PopupType = 'custom',\n): G9PopupDescriptor {\n return {\n type,\n title: title ?? null,\n message: null,\n content,\n buttons: buttons ?? [],\n settings: settings ?? null,\n animation,\n };\n}\n\n/** Resolved look of one popup (MAUI `G9PopupVisualProfile`). */\nexport interface G9PopupVisualProfile {\n readonly iconColor: string;\n readonly cardBackground: string;\n readonly borderColor: string;\n readonly titleColor: string;\n readonly messageColor: string;\n readonly buttonBackground: string;\n readonly buttonTextColor: string;\n readonly overlayColor: string;\n readonly overlayOpacity: number;\n readonly width: number | null;\n readonly height: number | null;\n readonly cornerRadius: number;\n readonly padding: readonly [number, number, number, number];\n readonly icon: G9IconInput;\n readonly animation: G9PopupAnimationType;\n readonly animationDuration: number;\n /** Localizable accessibility name of the type (`'Information'`, …). */\n readonly semanticIconDescription: string;\n}\n\nconst ACCENT: Record<G9PopupType, [G9ColorToken, G9ColorToken]> = {\n information: ['Info', 'OnInfo'],\n success: ['Success', 'OnSuccess'],\n warning: ['Warning', 'OnWarning'],\n error: ['Error', 'OnError'],\n custom: ['Info', 'OnInfo'],\n};\n\n/**\n * Resolves a popup's look (MAUI `G9PopupVisualProfile.Create`): each type takes its own semantic accent (never\n * Primary) for icon, title and the filled button, the button text takes the matching `On*` token, the scrim is the\n * `Scrim` token at `overlayOpacity`. Settings override colours, icon, size, radius, padding and motion.\n */\nexport function createPopupVisualProfile(\n descriptor: G9PopupDescriptor,\n settings: G9PopupSettings,\n glyphs: {\n readonly info: G9IconInput;\n readonly success: G9IconInput;\n readonly warning: G9IconInput;\n readonly error: G9IconInput;\n },\n semantic: (type: 'information' | 'success' | 'warning' | 'error') => string,\n): G9PopupVisualProfile {\n const [accent, onAccent] = ACCENT[descriptor.type];\n const icon =\n settings.iconOverride ??\n (descriptor.type === 'success'\n ? glyphs.success\n : descriptor.type === 'warning'\n ? glyphs.warning\n : descriptor.type === 'error'\n ? glyphs.error\n : glyphs.info);\n const kind = descriptor.type === 'custom' ? 'information' : descriptor.type;\n return {\n iconColor: g9Token(accent),\n cardBackground: settings.cardBackgroundColor ?? g9Token('Surface'),\n borderColor: settings.borderColor ?? g9Token('Surface'),\n titleColor: settings.titleColor ?? g9Token(accent),\n messageColor: settings.messageColor ?? g9Token('OnSurface'),\n buttonBackground: g9Token(accent),\n buttonTextColor: g9Token(onAccent),\n overlayColor: settings.overlayColor ?? g9Token('Scrim'),\n overlayOpacity: settings.overlayOpacity ?? 0.45,\n width: settings.width ?? null,\n height: settings.height ?? null,\n cornerRadius: settings.cornerRadius ?? 16,\n padding: settings.padding ?? [20, 16, 20, 12],\n icon,\n animation: settings.animation ?? descriptor.animation ?? 'slideUp',\n animationDuration: settings.animationDuration ?? 300,\n semanticIconDescription: semantic(kind),\n };\n}\n\n/** The scrim opacity of a mode (MAUI `Blur` fallback: a darker scrim by intensity; `none` = no scrim). */\nexport function popupScrimOpacity(mode: G9PopupOverlayMode, opacity: number, blur: G9PopupBlurIntensity): number {\n if (mode === 'none') return 0;\n if (mode !== 'blur') return opacity;\n const extra = { none: 0, light: 0.05, extraLight: 0.1, dark: 0.15, extraDark: 0.2 }[blur];\n return Math.min(1, opacity + extra);\n}\n"],"names":["G9PopupType","G9PopupAnimationType","G9PopupAnimationEasing","G9PopupFooterButtonLayout","G9PopupAutoSizeMode","G9PopupOverlayMode","G9PopupBlurIntensity","G9PopupRelativePosition","G9PopupResultAction","g9PopupResult","Object","afterClose","descriptor","closePopupButton","text","createDefaultPopupSettings","mergePopupSettings","settings","defaults","out","k","v","resolvePopupSettings","_ref","merged","animation","presetPopup","type","message","title","buttons","customPopup","content","ACCENT","createPopupVisualProfile","glyphs","semantic","_settings_iconOverride","_settings_cardBackgroundColor","_settings_borderColor","_settings_titleColor","_settings_messageColor","_settings_overlayColor","_settings_overlayOpacity","_settings_width","_settings_height","_settings_cornerRadius","_settings_padding","_settings_animationDuration","accent","onAccent","icon","kind","g9Token","popupScrimOpacity","mode","opacity","blur","extra","Math"],"mappings":";AASO,MAAMA,cAAc;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,OAAO;IACP,QAAQ;AACV;AAIO,MAAMC,uBAAuB;IAClC,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;AACV;AAIO,MAAMC,yBAAyB;IACpC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,WAAW;AACb;AAIO,MAAMC,4BAA4B;IAAE,KAAK;IAAO,SAAS;AAAU;AAInE,MAAMC,sBAAsB;IAAE,MAAM;IAAQ,QAAQ;IAAU,OAAO;IAAS,MAAM;AAAO;AAI3F,MAAMC,qBAAqB;IAAE,aAAa;IAAe,MAAM;IAAQ,MAAM;AAAO;AAIpF,MAAMC,uBAAuB;IAClC,MAAM;IACN,OAAO;IACP,YAAY;IACZ,MAAM;IACN,WAAW;AACb;AAIO,MAAMC,0BAA0B;IACrC,UAAU;IACV,aAA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