@g9tm/lynxcontrols 1.4.3 → 1.4.5

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 (73) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/button/button.css +1 -0
  3. package/dist/button/button.css.map +1 -1
  4. package/dist/button/button.d.ts +2 -0
  5. package/dist/button/button.d.ts.map +1 -1
  6. package/dist/button/button.jsx +3 -2
  7. package/dist/button/button.jsx.map +1 -1
  8. package/dist/fields/index.d.ts +1 -1
  9. package/dist/fields/index.d.ts.map +1 -1
  10. package/dist/fields/index.jsx +1 -1
  11. package/dist/fields/outlined-field.d.ts +1 -1
  12. package/dist/fields/outlined-field.d.ts.map +1 -1
  13. package/dist/fields/outlined-field.jsx +13 -3
  14. package/dist/fields/outlined-field.jsx.map +1 -1
  15. package/dist/fields/use-text-input.d.ts +14 -1
  16. package/dist/fields/use-text-input.d.ts.map +1 -1
  17. package/dist/fields/use-text-input.jsx +19 -5
  18. package/dist/fields/use-text-input.jsx.map +1 -1
  19. package/dist/pickers/date-time-picker.d.ts.map +1 -1
  20. package/dist/pickers/date-time-picker.jsx +13 -4
  21. package/dist/pickers/date-time-picker.jsx.map +1 -1
  22. package/dist/pickers/picker-sheet.d.ts +5 -1
  23. package/dist/pickers/picker-sheet.d.ts.map +1 -1
  24. package/dist/pickers/picker-sheet.jsx +3 -17
  25. package/dist/pickers/picker-sheet.jsx.map +1 -1
  26. package/dist/pickers/pickers.css +32 -43
  27. package/dist/pickers/pickers.css.map +1 -1
  28. package/dist/pickers/wheel-column.d.ts +3 -1
  29. package/dist/pickers/wheel-column.d.ts.map +1 -1
  30. package/dist/pickers/wheel-column.jsx +17 -3
  31. package/dist/pickers/wheel-column.jsx.map +1 -1
  32. package/dist/popup/frame.d.ts +6 -0
  33. package/dist/popup/frame.d.ts.map +1 -1
  34. package/dist/popup/frame.jsx +8 -6
  35. package/dist/popup/frame.jsx.map +1 -1
  36. package/dist/popup/popup.css +23 -16
  37. package/dist/popup/popup.css.map +1 -1
  38. package/dist/popup/service.d.ts.map +1 -1
  39. package/dist/popup/service.jsx +3 -2
  40. package/dist/popup/service.jsx.map +1 -1
  41. package/dist/range-slider/range-slider.css +5 -0
  42. package/dist/range-slider/range-slider.css.map +1 -1
  43. package/dist/range-slider/range-slider.jsx +1 -1
  44. package/dist/range-slider/range-slider.jsx.map +1 -1
  45. package/dist/selection/selection-sheet.d.ts.map +1 -1
  46. package/dist/selection/selection-sheet.jsx +4 -2
  47. package/dist/selection/selection-sheet.jsx.map +1 -1
  48. package/dist/selection/selection.css +15 -0
  49. package/dist/selection/selection.css.map +1 -1
  50. package/dist/sheet/frame.d.ts.map +1 -1
  51. package/dist/sheet/frame.jsx +26 -19
  52. package/dist/sheet/frame.jsx.map +1 -1
  53. package/dist/sheet/options.d.ts +7 -0
  54. package/dist/sheet/options.d.ts.map +1 -1
  55. package/dist/sheet/options.jsx.map +1 -1
  56. package/dist/sheet/sheet.css +10 -0
  57. package/dist/sheet/sheet.css.map +1 -1
  58. package/dist/sheet/sizing.d.ts +1 -1
  59. package/dist/sheet/sizing.d.ts.map +1 -1
  60. package/dist/sheet/sizing.jsx +2 -2
  61. package/dist/sheet/sizing.jsx.map +1 -1
  62. package/dist/tabs/model.d.ts +1 -1
  63. package/dist/tabs/model.d.ts.map +1 -1
  64. package/dist/tabs/model.jsx.map +1 -1
  65. package/dist/tabs/tab-view.jsx +1 -1
  66. package/dist/tabs/tab-view.jsx.map +1 -1
  67. package/dist/toggle/chip-group.jsx +8 -2
  68. package/dist/toggle/chip-group.jsx.map +1 -1
  69. package/dist/toggle/switch.jsx +2 -1
  70. package/dist/toggle/switch.jsx.map +1 -1
  71. package/dist/toggle/toggle.css +5 -2
  72. package/dist/toggle/toggle.css.map +1 -1
  73. package/package.json +2 -2
@@ -1,10 +1,11 @@
1
1
  import "./popup.css";
2
- import { resolveThemeColor } from "@g9tm/lynxcontrols-foundation";
2
+ import { formatColor, resolveThemeColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
3
3
  import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
4
4
  import { g9SafeId } from "../base/control.jsx";
5
5
  import { g9FieldNotchStyle } from "../fields/notch.jsx";
6
6
  import { useG9Theme } from "../provider/hooks.jsx";
7
7
  import { popupScrimOpacity } from "./types.jsx";
8
+ const g9PopupRestingScale = 0.92;
8
9
  function popupMotionPose(animation, phase) {
9
10
  switch(animation){
10
11
  case 'none':
@@ -121,10 +122,11 @@ function G9PopupDragHandle(props) {
121
122
  </view>;
122
123
  }
123
124
  function PopupFrame(props) {
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;
125
+ var _o_cardBackground, _o_overlayColor, _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_cornerRadius, _o_cardBackground1, _o_borderColor;
125
126
  const o = props.options;
126
127
  const palette = useG9Theme().palette;
127
128
  const notch = g9FieldNotchStyle(resolveThemeColor(null != (_o_cardBackground = o.cardBackground) ? _o_cardBackground : 'var(--g9-surface)', palette));
129
+ const scrimColor = formatColor(withAlpha(resolveThemeColor(null != (_o_overlayColor = o.overlayColor) ? _o_overlayColor : 'var(--g9-scrim)', palette), 1));
128
130
  const animation = null != (_o_animation = o.animation) ? _o_animation : 'slideUp';
129
131
  const duration = null != (_o_animationDuration = o.animationDuration) ? _o_animationDuration : 240;
130
132
  const mode = null != (_o_overlayMode = o.overlayMode) ? _o_overlayMode : 'transparent';
@@ -193,8 +195,8 @@ function PopupFrame(props) {
193
195
  return <view className={`g9-popup${'none' === mode ? ' g9-popup--nonmodal' : ''}${placed ? ' g9-popup--placed' : ''}`} {...'none' === mode ? {
194
196
  'event-through': true
195
197
  } : {}}>
196
- {'none' !== mode ? <view className="g9-popup__scrim" style={{
197
- backgroundColor: null != (_o_overlayColor = o.overlayColor) ? _o_overlayColor : 'var(--g9-scrim)',
198
+ {'none' !== mode ? <view flatten={false} className="g9-popup__scrim" style={{
199
+ backgroundColor: scrimColor,
198
200
  opacity: 'open' === props.phase ? scrimOpacity : 0,
199
201
  transition: 'enter' === props.phase ? 'none' : `opacity ${duration}ms`
200
202
  }} bindtap={()=>{
@@ -222,7 +224,7 @@ function PopupFrame(props) {
222
224
  padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,
223
225
  ...notch,
224
226
  opacity: pose.opacity,
225
- transform: `${dragTranslate}${pose.transform}`,
227
+ transform: `${dragTranslate}${pose.transform} scale(${g9PopupRestingScale})`,
226
228
  transition
227
229
  }} bindlayoutchange={(e)=>{
228
230
  var _ref, _ref1;
@@ -247,6 +249,6 @@ function PopupFrame(props) {
247
249
  </view>
248
250
  </view>;
249
251
  }
250
- export { G9PopupDragHandle, PopupFrame, popupEasingCss, popupMotionPose, relativePopupPlacement };
252
+ export { G9PopupDragHandle, PopupFrame, g9PopupRestingScale, popupEasingCss, popupMotionPose, relativePopupPlacement };
251
253
 
252
254
  //# sourceMappingURL=frame.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"popup/frame.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","popupScrimOpacity","dragTranslate","wholeCardDrags","g9SafeId","_e_detail","_e_detail1","w","h"],"mappings":";;;;;;;AAsEO,SAASA,gBACdC,SAA+B,EAC/BC,KAAuB;IAKvB,OAAQD;QACN,KAAK;YACH,OAAO;gBAAE,SAASC,AAAU,YAAVA,QAAoB,IAAI;gBAAG,WAAW;YAA2B;QACrF,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA2B;QAC7D,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WA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{ formatColor, resolveThemeColor, withAlpha } 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/**\n * The size every MAUI popup RESTS at: `G9PopupView` builds its card container with `ScaleX = ScaleY = 0.92` and its\n * open animations only ever set `Scale` (which multiplies them), so the card, its text and its buttons all show at\n * 92 % — a 403 dp card measures 371 dp on screen (MAUI 6.2.36, Pixel 9 Pro XL). The port reproduces what users see.\n */\nexport const g9PopupRestingScale = 0.92;\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 // MAUI ResolveOverlayColor: the colour's hue with the overlay opacity as its alpha (Colors.Black.WithAlpha by default) —\n // the Scrim token's own alpha (0.6) does not multiply in, or the 0.45 dim reads as 0.27.\n const scrimColor = formatColor(withAlpha(resolveThemeColor(o.overlayColor ?? 'var(--g9-scrim)', palette), 1));\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 // Never flattened (see the sheet scrim): over a native SurfaceView a flattened dim is painted underneath it.\n flatten={false}\n className=\"g9-popup__scrim\"\n style={{\n backgroundColor: scrimColor,\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} scale(${g9PopupRestingScale})`,\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":["g9PopupRestingScale","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_overlayColor","_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_cornerRadius","_o_cardBackground1","_o_borderColor","o","palette","useG9Theme","notch","g9FieldNotchStyle","resolveThemeColor","scrimColor","formatColor","withAlpha","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","g9SafeId","_e_detail","_e_detail1","w","h"],"mappings":";;;;;;;AA0EO,MAAMA,sBAAsB;AAG5B,SAASC,gBACdC,SAA+B,EAC/BC,KAAuB;IAKvB,OAAQD;QACN,KAAK;YACH,OAAO;gBAAE,SAASC,AAAU,YAAVA,QAAoB,IAAI;gBAAG,WAAW;YAA2B;QACrF,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA2B;QAC7D,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA8B;QAChE,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA6B;QAC/D,KAAK;YAEH,OAAO;gBAAE,SAAS;gBAAG,WAAW,CAAC,sBAAsB,EAAEA,AAAU,YAAVA,QAAoB,MAAM,KAAK,CAAC,CAAC;YAAC;QAC7F;YACE,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA4B;IAChE;AACF;AAGO,SAASC,eAAeC,MAA8B;IAC3D,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAMO,SA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A,kBAAkB,CAACrD;;YACPkE,WACAC;QADV,MAAMC,IAAI,QAAJA,CAAAA,OAAAA,QAAIF,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,KAAK,AAAD,IAAC,OAAI;QAC7B,MAAMG,IAAI,QAAJA,CAAAA,QAAAA,QAAIF,CAAAA,aAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,WAAU,MAAM,AAAD,IAAC,QAAI;QAC9B,IAAIC,IAAI,KAAKC,IAAI,KAAMD,CAAAA,MAAM3B,KAAK,KAAK,IAAI4B,MAAM5B,KAAK,MAAK,GAAIC,QAAQ;YAAE,OAAO0B;YAAG,QAAQC;QAAE;IAC/F,IACC,GAAIL,iBACD;QACE,gBAAgB,CAAChE;YACf,MAAMW,IAAIZ,MAAMC;YAChBgD,QAAQ,OAAO,CAACrC,EAAE,CAAC,EAAEA,EAAE,CAAC;QAC1B;QACA,eAAe,CAACX;YACd,MAAMW,IAAIZ,MAAMC;YAChBgD,QAAQ,MAAM,CAACrC,EAAE,CAAC,EAAEA,EAAE,CAAC;QACzB;IACF,IACA,CAAC,CAAC,EACP;QACC,CAACd,YAAY,SAAS,OAAOmD,UAAU1C,MAAM,QAAQ,GAAGT,YAAY,SAAS;MAC/E,EAAEa,KAAK;IACT,EAAEA;AAEN"}
@@ -37,16 +37,22 @@
37
37
  .g9-popup__header {
38
38
  flex-direction: row;
39
39
  align-items: center;
40
- margin-bottom: 10px;
40
+ padding-bottom: 10px;
41
41
  display: flex;
42
42
  }
43
43
 
44
+ .g9-popup__divider {
45
+ background-color: var(--g9-outline-variant);
46
+ opacity: .5;
47
+ height: 1px;
48
+ }
49
+
44
50
  .g9-popup__badge {
45
- border-radius: 18px;
51
+ border-radius: 8px;
46
52
  justify-content: center;
47
53
  align-items: center;
48
- width: 36px;
49
- height: 36px;
54
+ width: 30px;
55
+ height: 30px;
50
56
  margin-right: 10px;
51
57
  display: flex;
52
58
  position: relative;
@@ -58,8 +64,8 @@
58
64
  }
59
65
 
60
66
  .g9-popup__badge-tint {
61
- opacity: .14;
62
- border-radius: 18px;
67
+ opacity: .18;
68
+ border-radius: 8px;
63
69
  position: absolute;
64
70
  top: 0;
65
71
  bottom: 0;
@@ -68,7 +74,8 @@
68
74
  }
69
75
 
70
76
  .g9-popup__title {
71
- flex: 1;
77
+ text-overflow: ellipsis;
78
+ flex: 1 1 0;
72
79
  font-size: 17px;
73
80
  font-weight: 700;
74
81
  }
@@ -82,42 +89,42 @@
82
89
  }
83
90
 
84
91
  .g9-popup__message {
85
- margin-bottom: 12px;
92
+ padding: 12px 0;
86
93
  font-size: 15px;
87
94
  line-height: 22px;
88
95
  }
89
96
 
90
97
  .g9-popup__body {
91
- margin-bottom: 12px;
98
+ padding: 12px 0;
92
99
  }
93
100
 
94
101
  .g9-popup__footer {
95
102
  flex-direction: row;
96
103
  align-items: center;
97
- margin-top: 4px;
104
+ column-gap: 8px;
105
+ padding-top: 8px;
98
106
  display: flex;
99
107
  }
100
108
 
101
109
  .g9-popup__footer--stacked {
102
110
  flex-direction: column;
103
111
  align-items: stretch;
112
+ gap: 8px 0;
104
113
  }
105
114
 
106
115
  .g9-popup__button {
107
116
  border-radius: 12px;
108
117
  flex-direction: row;
109
- flex: 1;
118
+ flex: 1 1 0;
110
119
  justify-content: center;
111
120
  align-items: center;
112
- height: 44px;
113
- margin-left: 4px;
114
- margin-right: 4px;
121
+ min-height: 48px;
115
122
  display: flex;
116
123
  }
117
124
 
118
125
  .g9-popup__button--stacked {
119
- flex: none;
120
- margin: 4px 0;
126
+ flex-grow: 0;
127
+ flex-basis: auto;
121
128
  }
122
129
 
123
130
  .g9-popup__button--outline {
@@ -1 +1 @@
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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BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAKA;EAFE,sBAAsB;EACtB,eAAe;EACf,eAAe;AACjB;;AAKA;EAFE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAKA;EAFE,mBAAmB;EACnB,iBAAiB;EACjB,+BAA+B;EAC/B,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;AACf;;AAKA;EAFE,iBAAiB;EACjB,eAAe;AACjB;;AAKA;EAFE,+BAA+B;AACjC;;AAKA;EAFE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAKA;EAFE,2BAA2B;EAC3B,eAAe;AACjB","sourcesContent":["/* Fixed, not absolute: a G9 sheet 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
+ {"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;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,oBAAoB;EACpB,aAAa;AACf;;AAMA;EAHE,2CAA2C;EAC3C,WAAW;EACX,WAAW;AACb;;AAOA;EAJE,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;EACb,kBAAkB;AACpB;;AAOA;EAJE,iBAAiB;EACjB,eAAe;AACjB;;AAOA;EAJE,YAAY;EACZ,kBAAkB;EAClB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAOA;EAJE,uBAAuB;EACvB,WAAW;EACX,eAAe;EACf,gBAAgB;AAClB;;AASA;EANE,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAUA;EAPE,eAAe;EACf,eAAe;EACf,iBAAiB;AACnB;;AAUA;EAPE,eAAe;AACjB;;AAWA;EARE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,gBAAgB;EAChB,aAAa;AACf;;AAWA;EARE,sBAAsB;EACtB,oBAAoB;EACpB,UAAU;AACZ;;AAaA;EAVE,mBAAmB;EACnB,mBAAmB;EACnB,WAAW;EACX,uBAAuB;EACvB,mBAAmB;EACnB,gBAAgB;EAChB,aAAa;AACf;;AAeA;EAZE,YAAY;EACZ,gBAAgB;AAClB;;AAeA;EAZE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;AACzC;;AAeA;EAZE,WAAW;AACb;;AAeA;EAZE,eAAe;EACf,gBAAgB;AAClB;;AAeA;EAZE,sBAAsB;EACtB,aAAa;AACf;;AAeA;EAZE,sBAAsB;EACtB,mBAAmB;EACnB,aAAa;AACf;;AAeA;EAZE,+BAA+B;EAC/B,kBAAkB;EAClB,eAAe;AACjB;;AAeA;EAZE,sBAAsB;EACtB,eAAe;EACf,eAAe;AACjB;;AAeA;EAZE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAeA;EAZE,mBAAmB;EACnB,iBAAiB;EACjB,+BAA+B;EAC/B,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,aAAa;AACf;;AAeA;EAZE,iBAAiB;EACjB,eAAe;AACjB;;AAeA;EAZE,+BAA+B;AACjC;;AAeA;EAZE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,YAAY;AACd;;AAeA;EAZE,2BAA2B;EAC3B,eAAe;AACjB","sourcesContent":["/* Fixed, not absolute: a G9 sheet 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/* MAUI BuildG9PopupHeader: a row (icon tile, title; ColumnSpacing 10, 10 under it), then a 1 dp divider. */\n.g9-popup__header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-bottom: 10px;\n}\n\n.g9-popup__divider {\n height: 1px;\n background-color: var(--g9-outline-variant);\n opacity: 0.5;\n}\n\n/* MAUI: a 30 dp tile, corner 8, the accent at 18 % behind a 17 dp icon. */\n.g9-popup__badge {\n width: 30px;\n height: 30px;\n border-radius: 8px;\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: 8px;\n opacity: 0.18;\n}\n\n.g9-popup__title {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n font-size: 17px;\n font-weight: 700;\n text-overflow: ellipsis;\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/* MAUI BuildG9PopupBody: the message (or a custom body) inside Padding (0, 12, 0, 12). */\n.g9-popup__message {\n font-size: 15px;\n line-height: 22px;\n padding: 12px 0px;\n}\n\n.g9-popup__body {\n padding: 12px 0px;\n}\n\n/* MAUI BuildG9PopupFooter: Padding (0, 8, 0, 0), ColumnSpacing 8 (stacked: Spacing 8), buttons flush with the card. */\n.g9-popup__footer {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding-top: 8px;\n column-gap: 8px;\n}\n\n.g9-popup__footer--stacked {\n flex-direction: column;\n align-items: stretch;\n column-gap: 0px;\n row-gap: 8px;\n}\n\n/* MAUI CreateFooterButton: MinimumHeightRequest 48, corner 12. */\n.g9-popup__button {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n min-height: 48px;\n border-radius: 12px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n}\n\n.g9-popup__button--stacked {\n flex-grow: 0;\n flex-basis: auto;\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,CA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ClG,kBAAkB,IAAI,OAAO,CAAC;IAC9B,kCAAkC;IAClC,WAAW,IAAI,IAAI,CAAC;IACpB,qDAAqD;IACrD,UAAU,IAAI,IAAI,CAAC;IACnB,yBAAyB;IACzB,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAqVD,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"}
@@ -72,9 +72,9 @@ function PopupCardContent(props) {
72
72
  <view className="g9-popup__badge-tint" style={{
73
73
  backgroundColor: profile.iconColor
74
74
  }}/>
75
- <G9IconSlot icon={profile.icon} size={22} color={profile.iconColor}/>
75
+ <G9IconSlot icon={profile.icon} size={17} color={profile.iconColor}/>
76
76
  </view>
77
- <text className="g9-popup__title" style={{
77
+ <text className="g9-popup__title" text-maxline="1" style={{
78
78
  color: profile.titleColor,
79
79
  ...g9TextStart(direction)
80
80
  }}>
@@ -84,6 +84,7 @@ function PopupCardContent(props) {
84
84
  <G9IconSlot icon={glyphs.clear} size={20} color="var(--g9-on-surface-variant)"/>
85
85
  </view> : null}
86
86
  </view> : null}
87
+ {false !== settings.showHeader ? <view className="g9-popup__divider"/> : null}
87
88
  {d.message ? <text className="g9-popup__message" style={{
88
89
  color: profile.messageColor,
89
90
  ...g9TextStart(direction)
@@ -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, 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,+BA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AAkB;IAC/C,MAAM4C,WAAW5C,KAAK,UAAU,CAAC7E;IACjC,OAAO,AAACyH,CAAAA,QAAAA,WAAAA,WAAY7C,mBAAmBC,KAAI,EAAG,OAAO;AACvD;AAGO,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"}
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={17} color={profile.iconColor} />\n </view>\n <text\n className=\"g9-popup__title\"\n text-maxline=\"1\"\n style={{ color: profile.titleColor, ...g9TextStart(direction) }}\n >\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 {settings.showHeader !== false ? <view className=\"g9-popup__divider\" /> : 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,GAC/B,GAAIA,OAAO,MAAM,GAAG;QAAE,eAAeA,OAAO,MAAM;IAAC,IAAI,CAAC,CAAC,EAC1D,IAAIJ,MAAM,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OF,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"}
@@ -7,6 +7,11 @@
7
7
  position: relative;
8
8
  }
9
9
 
10
+ .g9-slider--labels {
11
+ justify-content: flex-start;
12
+ padding-top: 38px;
13
+ }
14
+
10
15
  .g9-slider--disabled {
11
16
  opacity: .38;
12
17
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/range-slider/range-slider.css"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,uBAAuB;EACvB,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,2CAA2C;EAC3C,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,kBAAkB;AACpB;;AAIA;EADE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,WAAW;EACX,YAAY;AACd;;AAKA;EAFE,mBAAmB;EACnB,mBAAmB;EACnB,+BAA+B;EAC/B,mCAAmC;EACnC,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AAKA;EAFE,iBAAiB;AACnB;;AAKA;EAFE,2CAA2C;EAC3C,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,QAAQ;AACV;;AAKA;EAFE,mCAAmC;EACnC,eAAe;AACjB;;AAKA;EAFE,mBAAmB;EACnB,8BAA8B;EAC9B,gBAAgB;EAChB,aAAa;AACf;;AAKA;EAFE,+BAA+B;EAC/B,eAAe;AACjB","sourcesContent":[".g9-slider {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding-left: 16px;\n padding-right: 16px;\n}\n\n.g9-slider--disabled {\n opacity: 0.38;\n}\n\n.g9-slider__root {\n height: 28px;\n display: flex;\n justify-content: center;\n}\n\n/* lynx-ui SliderTrack: a 28 px flex row holding this view (the visible track) next to the fill and the thumbs, which\n position against the 28 px row. The track takes the row's width; the fill is the 8 px band at its centre. */\n.g9-slider__track {\n position: relative;\n flex: 1;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-surface-variant);\n}\n\n.g9-slider__fill {\n position: absolute;\n top: 10px;\n left: 0px;\n right: 0px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n/* lynx-ui SliderThumb centres this view on the value (top 50 %, translate -50 %). */\n.g9-slider__thumb {\n width: 28px;\n height: 28px;\n}\n\n.g9-slider__thumb-dot {\n width: 28px;\n height: 28px;\n border-radius: 14px;\n border-width: 2.5px;\n border-style: solid;\n border-color: var(--g9-primary);\n background-color: var(--g9-surface);\n}\n\n.g9-slider__thumb-dot--active {\n border-width: 3px;\n}\n\n.g9-slider__tooltip {\n position: absolute;\n top: 4px;\n height: 26px;\n margin-left: -21px;\n min-width: 42px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 13px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-slider__tooltip-text {\n font-size: 12px;\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-slider__labels {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 18px;\n}\n\n.g9-slider__label {\n font-size: 12px;\n color: var(--g9-text-secondary);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/range-slider/range-slider.css"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAKA;EAFE,2BAA2B;EAC3B,iBAAiB;AACnB;;AAKA;EAFE,YAAY;AACd;;AAKA;EAFE,uBAAuB;EACvB,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,2CAA2C;EAC3C,kBAAkB;EAClB,OAAO;EACP,WAAW;EACX,kBAAkB;AACpB;;AAOA;EAJE,mCAAmC;EACnC,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,WAAW;EACX,YAAY;AACd;;AAQA;EALE,mBAAmB;EACnB,mBAAmB;EACnB,+BAA+B;EAC/B,mCAAmC;EACnC,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AAQA;EALE,iBAAiB;AACnB;;AAQA;EALE,2CAA2C;EAC3C,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,kBAAkB;EAClB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,QAAQ;AACV;;AAQA;EALE,mCAAmC;EACnC,eAAe;AACjB;;AAQA;EALE,mBAAmB;EACnB,8BAA8B;EAC9B,gBAAgB;EAChB,aAAa;AACf;;AAQA;EALE,+BAA+B;EAC/B,eAAe;AACjB","sourcesContent":[".g9-slider {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding-left: 16px;\n padding-right: 16px;\n}\n\n/* MAUI G9RangeSliderDrawable with labels: the track's centre at SliderTrackY (52) of the 104 dp canvas — the room above\n is the drag tooltip's — and the end labels SliderLabelGap (18) under the thumb. Centring the column put the track at\n ~34 dp, 18 dp higher than MAUI's. */\n.g9-slider--labels {\n justify-content: flex-start;\n padding-top: 38px;\n}\n\n.g9-slider--disabled {\n opacity: 0.38;\n}\n\n.g9-slider__root {\n height: 28px;\n display: flex;\n justify-content: center;\n}\n\n/* lynx-ui SliderTrack: a 28 px flex row holding this view (the visible track) next to the fill and the thumbs, which\n position against the 28 px row. The track takes the row's width; the fill is the 8 px band at its centre. */\n.g9-slider__track {\n position: relative;\n flex: 1;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-surface-variant);\n}\n\n.g9-slider__fill {\n position: absolute;\n top: 10px;\n left: 0px;\n right: 0px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n/* lynx-ui SliderThumb centres this view on the value (top 50 %, translate -50 %). */\n.g9-slider__thumb {\n width: 28px;\n height: 28px;\n}\n\n.g9-slider__thumb-dot {\n width: 28px;\n height: 28px;\n border-radius: 14px;\n border-width: 2.5px;\n border-style: solid;\n border-color: var(--g9-primary);\n background-color: var(--g9-surface);\n}\n\n.g9-slider__thumb-dot--active {\n border-width: 3px;\n}\n\n.g9-slider__tooltip {\n position: absolute;\n top: 4px;\n height: 26px;\n margin-left: -21px;\n min-width: 42px;\n padding-left: 8px;\n padding-right: 8px;\n border-radius: 13px;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-slider__tooltip-text {\n font-size: 12px;\n color: var(--g9-inverse-on-surface);\n}\n\n.g9-slider__labels {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n margin-top: 18px;\n}\n\n.g9-slider__label {\n font-size: 12px;\n color: var(--g9-text-secondary);\n}\n"],"sourceRoot":""}
@@ -127,7 +127,7 @@ function G9RangeSlider(props) {
127
127
  const thumb = (index)=><SliderThumb key={index} index={index} className="g9-slider__thumb">
128
128
  <view className={`g9-slider__thumb-dot${dragging && dragging.index === index ? ' g9-slider__thumb-dot--active' : ''}`}/>
129
129
  </SliderThumb>;
130
- return <view className={`g9-slider${labels ? '' : ' g9-slider--compact'}${props.disabled ? ' g9-slider--disabled' : ''}${props.className ? ` ${props.className}` : ''}`} style={{
130
+ return <view className={`g9-slider${labels ? ' g9-slider--labels' : ' g9-slider--compact'}${props.disabled ? ' g9-slider--disabled' : ''}${props.className ? ` ${props.className}` : ''}`} style={{
131
131
  height: `${labels ? g9SliderMetrics.height : g9SliderMetrics.heightCompact}px`
132
132
  }} accessibility-element={true} accessibility-label={null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : ''} accessibility-value={single ? fmt(shown) : `${fmt(shownRange[0])} – ${fmt(shownRange[1])}`} bindkeydown={onKey}>
133
133
  {labels && dragging ? <view className="g9-slider__tooltip" style={{