@g9tm/lynxcontrols 1.4.0 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +7 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/base/control.d.ts +24 -0
  4. package/dist/base/control.d.ts.map +1 -1
  5. package/dist/base/control.jsx +14 -2
  6. package/dist/base/control.jsx.map +1 -1
  7. package/dist/base/index.d.ts +1 -1
  8. package/dist/base/index.d.ts.map +1 -1
  9. package/dist/base/index.jsx +1 -1
  10. package/dist/base/pressable.d.ts.map +1 -1
  11. package/dist/base/pressable.jsx +1 -1
  12. package/dist/base/pressable.jsx.map +1 -1
  13. package/dist/button/button.d.ts.map +1 -1
  14. package/dist/button/button.jsx +4 -3
  15. package/dist/button/button.jsx.map +1 -1
  16. package/dist/button/header-action-button.d.ts.map +1 -1
  17. package/dist/button/header-action-button.jsx +1 -1
  18. package/dist/button/header-action-button.jsx.map +1 -1
  19. package/dist/button/icon-button.d.ts.map +1 -1
  20. package/dist/button/icon-button.jsx +1 -1
  21. package/dist/button/icon-button.jsx.map +1 -1
  22. package/dist/button/nav-card.d.ts.map +1 -1
  23. package/dist/button/nav-card.jsx +6 -5
  24. package/dist/button/nav-card.jsx.map +1 -1
  25. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  26. package/dist/button/vertical-icon-text-button.jsx +1 -1
  27. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  28. package/dist/display/culture-date-time-label.d.ts.map +1 -1
  29. package/dist/display/culture-date-time-label.jsx +3 -1
  30. package/dist/display/culture-date-time-label.jsx.map +1 -1
  31. package/dist/display/progress-bar.jsx +1 -1
  32. package/dist/display/progress-bar.jsx.map +1 -1
  33. package/dist/display/separator.jsx +2 -2
  34. package/dist/display/separator.jsx.map +1 -1
  35. package/dist/display/title-with-line.jsx +1 -1
  36. package/dist/display/title-with-line.jsx.map +1 -1
  37. package/dist/expander/expander.d.ts.map +1 -1
  38. package/dist/expander/expander.jsx +6 -4
  39. package/dist/expander/expander.jsx.map +1 -1
  40. package/dist/fields/fields.css +12 -4
  41. package/dist/fields/fields.css.map +1 -1
  42. package/dist/fields/index.d.ts +1 -0
  43. package/dist/fields/index.d.ts.map +1 -1
  44. package/dist/fields/index.jsx +1 -0
  45. package/dist/fields/notch.d.ts +10 -0
  46. package/dist/fields/notch.d.ts.map +1 -0
  47. package/dist/fields/notch.jsx +9 -0
  48. package/dist/fields/notch.jsx.map +1 -0
  49. package/dist/fields/outlined-field.d.ts +7 -1
  50. package/dist/fields/outlined-field.d.ts.map +1 -1
  51. package/dist/fields/outlined-field.jsx +8 -5
  52. package/dist/fields/outlined-field.jsx.map +1 -1
  53. package/dist/fields/pin-entry.d.ts +2 -0
  54. package/dist/fields/pin-entry.d.ts.map +1 -1
  55. package/dist/fields/pin-entry.jsx +2 -1
  56. package/dist/fields/pin-entry.jsx.map +1 -1
  57. package/dist/fields/text-entry.d.ts.map +1 -1
  58. package/dist/fields/text-entry.jsx +12 -2
  59. package/dist/fields/text-entry.jsx.map +1 -1
  60. package/dist/fields/use-text-input.d.ts.map +1 -1
  61. package/dist/fields/use-text-input.jsx +11 -1
  62. package/dist/fields/use-text-input.jsx.map +1 -1
  63. package/dist/host/hooks.d.ts +5 -0
  64. package/dist/host/hooks.d.ts.map +1 -1
  65. package/dist/host/hooks.jsx +4 -1
  66. package/dist/host/hooks.jsx.map +1 -1
  67. package/dist/host/index.d.ts +1 -1
  68. package/dist/host/index.d.ts.map +1 -1
  69. package/dist/host/index.jsx +1 -1
  70. package/dist/popup/frame.d.ts.map +1 -1
  71. package/dist/popup/frame.jsx +11 -3
  72. package/dist/popup/frame.jsx.map +1 -1
  73. package/dist/popup/index.d.ts +1 -1
  74. package/dist/popup/index.d.ts.map +1 -1
  75. package/dist/popup/popup.css +1 -1
  76. package/dist/popup/popup.css.map +1 -1
  77. package/dist/popup/service.d.ts.map +1 -1
  78. package/dist/popup/service.jsx +12 -4
  79. package/dist/popup/service.jsx.map +1 -1
  80. package/dist/popup/types.d.ts +11 -0
  81. package/dist/popup/types.d.ts.map +1 -1
  82. package/dist/popup/types.jsx.map +1 -1
  83. package/dist/selection/selection-sheet.d.ts.map +1 -1
  84. package/dist/selection/selection-sheet.jsx +7 -3
  85. package/dist/selection/selection-sheet.jsx.map +1 -1
  86. package/dist/selection/selection.css +1 -0
  87. package/dist/selection/selection.css.map +1 -1
  88. package/dist/sheet/frame.d.ts +2 -0
  89. package/dist/sheet/frame.d.ts.map +1 -1
  90. package/dist/sheet/frame.jsx +134 -69
  91. package/dist/sheet/frame.jsx.map +1 -1
  92. package/dist/sheet/gesture.d.ts +51 -0
  93. package/dist/sheet/gesture.d.ts.map +1 -0
  94. package/dist/sheet/gesture.jsx +107 -0
  95. package/dist/sheet/gesture.jsx.map +1 -0
  96. package/dist/sheet/handoff.d.ts +32 -0
  97. package/dist/sheet/handoff.d.ts.map +1 -0
  98. package/dist/sheet/handoff.jsx +33 -0
  99. package/dist/sheet/handoff.jsx.map +1 -0
  100. package/dist/sheet/header.d.ts +12 -1
  101. package/dist/sheet/header.d.ts.map +1 -1
  102. package/dist/sheet/header.jsx +42 -29
  103. package/dist/sheet/header.jsx.map +1 -1
  104. package/dist/sheet/index.d.ts +3 -2
  105. package/dist/sheet/index.d.ts.map +1 -1
  106. package/dist/sheet/index.jsx +3 -2
  107. package/dist/sheet/motion.d.ts +59 -0
  108. package/dist/sheet/motion.d.ts.map +1 -0
  109. package/dist/sheet/motion.jsx +59 -0
  110. package/dist/sheet/motion.jsx.map +1 -0
  111. package/dist/sheet/options.d.ts +34 -2
  112. package/dist/sheet/options.d.ts.map +1 -1
  113. package/dist/sheet/options.jsx +2 -1
  114. package/dist/sheet/options.jsx.map +1 -1
  115. package/dist/sheet/service.d.ts.map +1 -1
  116. package/dist/sheet/service.jsx +1 -1
  117. package/dist/sheet/service.jsx.map +1 -1
  118. package/dist/sheet/sheet.css +52 -1
  119. package/dist/sheet/sheet.css.map +1 -1
  120. package/dist/sheet/sizing.d.ts +27 -3
  121. package/dist/sheet/sizing.d.ts.map +1 -1
  122. package/dist/sheet/sizing.jsx +19 -4
  123. package/dist/sheet/sizing.jsx.map +1 -1
  124. package/dist/tab-bar/tab-bar.d.ts +5 -0
  125. package/dist/tab-bar/tab-bar.d.ts.map +1 -1
  126. package/dist/tab-bar/tab-bar.jsx +5 -2
  127. package/dist/tab-bar/tab-bar.jsx.map +1 -1
  128. package/dist/toast/service.d.ts.map +1 -1
  129. package/dist/toast/service.jsx +58 -21
  130. package/dist/toast/service.jsx.map +1 -1
  131. package/dist/toast/store.d.ts +2 -0
  132. package/dist/toast/store.d.ts.map +1 -1
  133. package/dist/toast/store.jsx +4 -2
  134. package/dist/toast/store.jsx.map +1 -1
  135. package/dist/toast/toast.css +20 -13
  136. package/dist/toast/toast.css.map +1 -1
  137. package/dist/toggle/checkbox.d.ts.map +1 -1
  138. package/dist/toggle/checkbox.jsx +1 -1
  139. package/dist/toggle/checkbox.jsx.map +1 -1
  140. package/dist/toggle/chip-group.d.ts.map +1 -1
  141. package/dist/toggle/chip-group.jsx +5 -5
  142. package/dist/toggle/chip-group.jsx.map +1 -1
  143. package/dist/toggle/switch.d.ts.map +1 -1
  144. package/dist/toggle/switch.jsx +2 -2
  145. package/dist/toggle/switch.jsx.map +1 -1
  146. package/dist/toggle/toggle.css +1 -2
  147. package/dist/toggle/toggle.css.map +1 -1
  148. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import "./toast.css";
2
- import { g9Token, toNativeDigits } from "@g9tm/lynxcontrols-foundation";
2
+ import { formatColor, toNativeDigits, withAlpha } from "@g9tm/lynxcontrols-foundation";
3
3
  import { useEffect, useState, useSyncExternalStore } from "@lynx-js/react";
4
4
  import { g9RowStyle } from "../base/control.jsx";
5
5
  import { useG9Press } from "../base/press.jsx";
@@ -8,7 +8,7 @@ import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
8
8
  import { useG9Host, useG9HostInsets } from "../host/hooks.jsx";
9
9
  import { g9Hosts } from "../host/registry.jsx";
10
10
  import { G9IconSlot } from "../icon/slot.jsx";
11
- import { useG9Culture, useG9Direction, useG9Executor, useG9Settings } from "../provider/hooks.jsx";
11
+ import { useG9Culture, useG9Direction, useG9Executor, useG9Settings, useG9Theme } from "../provider/hooks.jsx";
12
12
  import { G9ToastStore, g9ToastTimings } from "./store.jsx";
13
13
  const g9ToastMetrics = Object.freeze({
14
14
  edgeMargin: 16,
@@ -17,11 +17,37 @@ const g9ToastMetrics = Object.freeze({
17
17
  });
18
18
  const FEATURE = 'g9.toasts';
19
19
  const ACCENT = {
20
- information: 'Info',
21
- success: 'Success',
22
- warning: 'Warning',
23
- error: 'Error'
20
+ information: [
21
+ 'Info',
22
+ 'OnInfo'
23
+ ],
24
+ success: [
25
+ 'Success',
26
+ 'OnSuccess'
27
+ ],
28
+ warning: [
29
+ 'Warning',
30
+ 'OnWarning'
31
+ ],
32
+ error: [
33
+ 'Error',
34
+ 'OnError'
35
+ ]
24
36
  };
37
+ const paletteColor = (palette, token, alpha = 1)=>formatColor(withAlpha(palette[token], alpha));
38
+ function ToastCountdown(props) {
39
+ const [run, setRun] = useState(false);
40
+ useEffect(()=>{
41
+ const t = setTimeout(()=>setRun(true), 16);
42
+ return ()=>clearTimeout(t);
43
+ }, []);
44
+ return <view className="g9-toast__countdown" style={{
45
+ backgroundColor: props.color,
46
+ transformOrigin: props.rtl ? 'right center' : 'left center',
47
+ transform: `scaleX(${run ? 1 : 0})`,
48
+ transition: run ? `transform ${props.durationMs}ms linear` : 'none'
49
+ }}/>;
50
+ }
25
51
  function ToastCard(props) {
26
52
  var _entry_icon;
27
53
  const { entry, store } = props;
@@ -30,22 +56,33 @@ function ToastCard(props) {
30
56
  source: 'G9Toast',
31
57
  guardMs: 0
32
58
  });
33
- const accent = g9Token(ACCENT[entry.type]);
59
+ const palette = useG9Theme().palette;
60
+ const [fillToken, onToken] = ACCENT[entry.type];
61
+ const fill = paletteColor(palette, fillToken);
62
+ const on = paletteColor(palette, onToken);
34
63
  const icon = null != (_entry_icon = entry.icon) ? _entry_icon : 'success' === entry.type ? glyphs.success : 'warning' === entry.type ? glyphs.warning : 'error' === entry.type ? glyphs.error : glyphs.info;
35
64
  const offset = props.bottom ? '12px' : '-12px';
36
65
  const direction = useG9Direction();
37
66
  return <view className={`g9-toast g9-toast--${entry.type} g9-toast--${entry.status}`} accessibility-element={true} accessibility-label={entry.message} style={{
38
67
  ...g9RowStyle(direction),
39
- borderColor: accent,
68
+ backgroundColor: fill,
69
+ borderColor: paletteColor(palette, onToken, 0.35),
40
70
  opacity: 'shown' === entry.status || 'entering' === entry.status ? 1 : 0,
41
71
  transform: `translateY(${'leaving' === entry.status ? offset : '0px'})`,
42
72
  transition: `opacity ${'leaving' === entry.status ? g9ToastTimings.exitMs : g9ToastTimings.enterMs}ms, transform ${g9ToastTimings.enterMs}ms`
43
73
  }}>
44
- <G9IconSlot icon={icon} size={20} color={accent}/>
45
- <text className="g9-toast__message">{entry.message}</text>
46
- {entry.actionText ? <view className="g9-toast__action" accessibility-element={true} accessibility-traits="button" bindtap={action}>
74
+ {entry.durationMs > 0 ? <ToastCountdown key={entry.refreshes} durationMs={entry.durationMs} color={paletteColor(palette, onToken, 0.14)} rtl={'rtl' === direction}/> : null}
75
+ <G9IconSlot icon={icon} size={20} color={on}/>
76
+ <text className="g9-toast__message" style={{
77
+ color: on
78
+ }}>
79
+ {entry.message}
80
+ </text>
81
+ {entry.actionText ? <view className="g9-toast__action" accessibility-element={true} accessibility-traits="button" bindtap={action} style={{
82
+ backgroundColor: paletteColor(palette, onToken, 0.16)
83
+ }}>
47
84
  <text className="g9-toast__action-text" style={{
48
- color: accent
85
+ color: on
49
86
  }}>
50
87
  {entry.actionText}
51
88
  </text>
@@ -61,16 +98,16 @@ function anchorStyle(position, top, bottom) {
61
98
  style.top = '0px';
62
99
  style.bottom = '0px';
63
100
  }
64
- if (position.endsWith('Left')) style.left = m;
65
- else if (position.endsWith('Right')) style.right = m;
66
- else {
67
- style.left = m;
68
- style.right = m;
69
- }
101
+ style.left = m;
102
+ style.right = m;
70
103
  return style;
71
104
  }
72
105
  function ToastLayer(props) {
73
- const { state } = props;
106
+ var _ref;
107
+ var _sheets_service;
108
+ const { state, host } = props;
109
+ const sheets = host.getFeature('g9.sheets');
110
+ const sheetOpen = (null != (_ref = null == sheets ? void 0 : null == (_sheets_service = sheets.service) ? void 0 : _sheets_service.getOpenCount()) ? _ref : 0) > 0;
74
111
  const store = state.service.store;
75
112
  const snap = useSyncExternalStore((l)=>store.subscribe(l), ()=>store.getSnapshot());
76
113
  const insets = useG9HostInsets();
@@ -95,7 +132,7 @@ function ToastLayer(props) {
95
132
  store
96
133
  ]);
97
134
  const top = insets.top + g9ToastMetrics.edgeMargin;
98
- const bottom = insets.bottom + clearance + snap.bottomOverlayHeight + g9ToastMetrics.edgeMargin;
135
+ const bottom = insets.bottom + (sheetOpen ? 0 : clearance) + snap.bottomOverlayHeight + g9ToastMetrics.edgeMargin;
99
136
  const positions = new Set(snap.toasts.map((t)=>t.position));
100
137
  if (snap.loadingToast) positions.add(snap.loadingToast.position);
101
138
  if (snap.progress) positions.add(snap.progress.position);
@@ -181,7 +218,7 @@ function createToastService(host) {
181
218
  host.attachFeature(FEATURE, state);
182
219
  host.registerLayerItem('feedback', {
183
220
  key: FEATURE,
184
- element: <ToastLayer state={state}/>,
221
+ element: <ToastLayer state={state} host={host}/>,
185
222
  order: 0
186
223
  });
187
224
  return state;
@@ -1 +1 @@
1
- {"version":3,"file":"toast/service.jsx","sources":["../../src/toast/service.tsx"],"sourcesContent":["import './toast.css';\nimport { type G9ColorToken, g9Token, toNativeDigits } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host, useG9HostInsets } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Direction, useG9Executor, useG9Settings } from '../provider/hooks';\nimport {\n type G9LoadingLease,\n type G9ToastEntry,\n type G9ToastHandle,\n type G9ToastOptions,\n type G9ToastPosition,\n G9ToastStore,\n type G9ToastType,\n g9ToastTimings,\n} from './store';\n\n/** Margin between a toast stack and the screen edge (MAUI 16 dp) and between toasts (8 dp). */\nexport const g9ToastMetrics = Object.freeze({ edgeMargin: 16, gap: 8, loaderScrimOpacity: 0.55 });\n\n/** The toasts of a host (MAUI `G9ToastHelper`). */\nexport interface G9ToastService {\n /** A typed, auto-dismissing toast (MAUI `ShowToastAsync`). */\n showToast(message: string, type?: G9ToastType, options?: G9ToastOptions): G9ToastHandle;\n /** Dismisses one toast or every typed toast (MAUI `DismissToastAsync`). */\n dismissToast(id?: number): void;\n /** Full-screen blocking loader, reference-counted (MAUI `ShowLoadingAsync`). */\n showLoading(text?: string): void;\n /** Lease form of `showLoading` (MAUI `BeginLoadingAsync`). */\n beginLoading(text?: string): G9LoadingLease;\n /** Releases one anonymous hold (MAUI `DismissLoadingAsync`). */\n dismissLoading(): void;\n /** Compact non-blocking loading toast (MAUI `ShowLoadingToastAsync`). */\n showLoadingToast(text?: string, position?: G9ToastPosition | null): void;\n dismissLoadingToast(): void;\n /** Progress toast (MAUI `ShowProgressToastAsync`). */\n showProgressToast(title: string, detail?: string | null, progress?: number, position?: G9ToastPosition | null): void;\n updateProgressToast(title?: string | null, detail?: string | null, progress?: number | null): void;\n dismissProgressToast(): void;\n /**\n * Re-anchors live toasts after the bottom clearance changed (MAUI `RefreshBottomInsetsAsync`, ADR-0027: an explicit\n * call, not a subscription). `animate` glides 220 ms; false snaps.\n */\n refreshBottomInsets(animate?: boolean): void;\n /** The space a bottom bar (tab bar) takes above the safe area; call `refreshBottomInsets` after changing it. */\n setBottomClearance(px: number): void;\n /** A bottom-anchored overlay (MAUI `IG9BottomAnchoredOverlay`): bottom stacks sit above its height. */\n setBottomOverlay(key: string, heightPx: number | null): void;\n /** Clears every toast, loader and progress (MAUI `DismissAllAsync`). */\n dismissAll(): void;\n readonly store: G9ToastStore;\n}\n\nconst FEATURE = 'g9.toasts';\n\ninterface State {\n service: G9ToastService;\n clearance: number;\n committedClearance: number;\n rtl: boolean;\n /** Set by the layer (the provider's safe executor); a toast cannot show before the layer renders. */\n run?: (action: () => unknown) => void;\n}\n\nconst ACCENT: Record<G9ToastType, G9ColorToken> = {\n information: 'Info',\n success: 'Success',\n warning: 'Warning',\n error: 'Error',\n};\n\nfunction ToastCard(props: {\n readonly entry: G9ToastEntry;\n readonly store: G9ToastStore;\n readonly bottom: boolean;\n}): ReactNode {\n const { entry, store } = props;\n const glyphs = useG9Settings().glyphs;\n const action = useG9Press(() => store.pressAction(entry.id), { source: 'G9Toast', guardMs: 0 });\n const accent = g9Token(ACCENT[entry.type]);\n const icon =\n entry.icon ??\n (entry.type === 'success'\n ? glyphs.success\n : entry.type === 'warning'\n ? glyphs.warning\n : entry.type === 'error'\n ? glyphs.error\n : glyphs.info);\n const offset = props.bottom ? '12px' : '-12px';\n const direction = useG9Direction();\n return (\n <view\n className={`g9-toast g9-toast--${entry.type} g9-toast--${entry.status}`}\n accessibility-element={true}\n accessibility-label={entry.message}\n style={{\n ...g9RowStyle(direction),\n borderColor: accent,\n opacity: entry.status === 'shown' || entry.status === 'entering' ? 1 : 0,\n transform: `translateY(${entry.status === 'leaving' ? offset : '0px'})`,\n transition: `opacity ${entry.status === 'leaving' ? g9ToastTimings.exitMs : g9ToastTimings.enterMs}ms, transform ${g9ToastTimings.enterMs}ms`,\n }}\n >\n <G9IconSlot icon={icon} size={20} color={accent} />\n <text className=\"g9-toast__message\">{entry.message}</text>\n {entry.actionText ? (\n <view className=\"g9-toast__action\" accessibility-element={true} accessibility-traits=\"button\" bindtap={action}>\n <text className=\"g9-toast__action-text\" style={{ color: accent }}>\n {entry.actionText}\n </text>\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction anchorStyle(position: G9ToastPosition, top: number, bottom: number): Record<string, string> {\n const m = `${g9ToastMetrics.edgeMargin}px`;\n const style: Record<string, string> = {};\n if (position.startsWith('top')) style.top = `${top}px`;\n else if (position.startsWith('bottom')) style.bottom = `${bottom}px`;\n else {\n style.top = '0px';\n style.bottom = '0px';\n }\n if (position.endsWith('Left')) style.left = m;\n else if (position.endsWith('Right')) style.right = m;\n else {\n style.left = m;\n style.right = m;\n }\n return style;\n}\n\n/** The feedback layer: stacks per position, the compact loading toast, the progress toast, the full-screen loader. */\nfunction ToastLayer(props: { readonly state: State }): ReactNode {\n const { state } = props;\n const store = state.service.store;\n const snap = useSyncExternalStore(\n (l) => store.subscribe(l),\n () => store.getSnapshot(),\n );\n const insets = useG9HostInsets();\n const culture = useG9Culture();\n const rtl = useG9Direction() === 'rtl';\n state.rtl = rtl;\n const executor = useG9Executor();\n state.run = (action) =>\n void executor.run(() => action(), { source: 'G9Toast', enableThrottle: false, preventConcurrentExecution: false });\n // The clearance is read when insets are refreshed (or a toast shows): a change alone does not move live toasts.\n const [clearance, setClearance] = useState(state.committedClearance);\n useEffect(() => {\n state.committedClearance = state.clearance;\n setClearance(state.clearance);\n }, [snap.insetVersion, snap.toasts.length]);\n useEffect(() => () => store.dispose(), [store]);\n const top = insets.top + g9ToastMetrics.edgeMargin;\n const bottom = insets.bottom + clearance + snap.bottomOverlayHeight + g9ToastMetrics.edgeMargin;\n const positions = new Set<G9ToastPosition>(snap.toasts.map((t) => t.position));\n if (snap.loadingToast) positions.add(snap.loadingToast.position);\n if (snap.progress) positions.add(snap.progress.position);\n const glide = snap.reanchorAnimated\n ? `top ${g9ToastTimings.reanchorMs}ms cubic-bezier(0.215, 0.61, 0.355, 1), bottom ${g9ToastTimings.reanchorMs}ms cubic-bezier(0.215, 0.61, 0.355, 1)`\n : 'none';\n const percent = (p: number) => toNativeDigits(`${Math.round(p * 100)}%`, culture.numberingSystem);\n return (\n <view className={`g9-toast-layer g9-dir-${rtl ? 'rtl' : 'ltr'}`} event-through={true}>\n {[...positions].map((position) => {\n const bottomStack = position.startsWith('bottom');\n return (\n <view\n key={position}\n className={`g9-toast-stack g9-toast-stack--${position}${bottomStack ? ' g9-toast-stack--bottom' : ''}`}\n event-through={true}\n style={{ ...anchorStyle(position, top, bottom), transition: glide }}\n >\n {snap.toasts\n .filter((t) => t.position === position)\n .map((t) => (\n <ToastCard key={t.id} entry={t} store={store} bottom={bottomStack} />\n ))}\n {snap.loadingToast && snap.loadingToast.position === position ? (\n <view className=\"g9-toast g9-toast--loading\" accessibility-label={snap.loadingToast.text}>\n <G9ActivityIndicator running size={18} />\n <text className=\"g9-toast__message\">{snap.loadingToast.text}</text>\n </view>\n ) : null}\n {snap.progress && snap.progress.position === position ? (\n <view className=\"g9-toast g9-toast--progress\" accessibility-value={percent(snap.progress.progress)}>\n <view\n className=\"g9-toast__fill\"\n style={{\n transform: `scaleX(${snap.progress.progress})`,\n transformOrigin: rtl ? 'right center' : 'left center',\n }}\n />\n <view className=\"g9-toast__progress-text\">\n <text className=\"g9-toast__message\">{snap.progress.title}</text>\n {snap.progress.detail ? <text className=\"g9-toast__detail\">{snap.progress.detail}</text> : null}\n </view>\n <view className=\"g9-toast__pill\">\n <text className=\"g9-toast__pill-text\">{percent(snap.progress.progress)}</text>\n </view>\n </view>\n ) : null}\n </view>\n );\n })}\n {snap.loader ? (\n <view\n className={`g9-loader g9-loader--${snap.loader.status}`}\n style={{\n opacity: snap.loader.status === 'leaving' ? 0 : 1,\n transition: `opacity ${snap.loader.status === 'leaving' ? g9ToastTimings.loaderFadeOutMs : g9ToastTimings.loaderFadeInMs}ms`,\n }}\n event-through={false}\n bindtap={() => {}}\n >\n <view className=\"g9-loader__scrim\" style={{ opacity: g9ToastMetrics.loaderScrimOpacity }} />\n <view className=\"g9-loader__card\">\n <G9ActivityIndicator running size={36} color=\"var(--g9-inverse-on-surface)\" />\n {snap.loader.text ? <text className=\"g9-loader__text\">{snap.loader.text}</text> : null}\n </view>\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction createToastService(host: G9HostHandle): State {\n const state = { clearance: 0, committedClearance: 0, rtl: false } as State;\n const store = new G9ToastStore({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n runAction: (action) => state.run?.(action),\n defaultPosition: () => (state.rtl ? 'bottomLeft' : 'bottomRight'),\n });\n state.service = {\n store,\n showToast: (message, type, options) => store.show(message, type, options),\n dismissToast: (id) => store.dismissToast(id),\n showLoading: (text) => store.showLoading(text),\n beginLoading: (text) => store.beginLoading(text),\n dismissLoading: () => store.dismissLoading(),\n showLoadingToast: (text, position) => store.showLoadingToast(text, position ?? null),\n dismissLoadingToast: () => store.dismissLoadingToast(),\n showProgressToast: (title, detail, progress, position) =>\n store.showProgress(title, detail ?? null, progress ?? 0, position ?? null),\n updateProgressToast: (title, detail, progress) => store.updateProgress(title, detail, progress),\n dismissProgressToast: () => store.dismissProgress(),\n refreshBottomInsets: (animate = true) => store.refreshBottomInsets(animate),\n setBottomClearance: (px) => {\n state.clearance = Math.max(0, px);\n },\n setBottomOverlay: (key, height) => store.setBottomOverlay(key, height),\n dismissAll: () => store.dismissAll(),\n };\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('feedback', { key: FEATURE, element: <ToastLayer state={state} />, order: 0 });\n return state;\n}\n\n/** The toast service of a host (created once as a host feature). */\nexport function toastServiceOf(host: G9HostHandle): G9ToastService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createToastService(host)).service;\n}\n\n/** The toasts of the nearest `G9Host` (MAUI `G9ToastHelper`), in its `feedback` layer above popups and sheets. */\nexport function useG9Toasts(): G9ToastService {\n return toastServiceOf(useG9Host());\n}\n\n/** The toasts of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Toasts(): G9ToastService {\n return toastServiceOf(g9Hosts.require());\n}\n"],"names":["g9ToastMetrics","Object","FEATURE","ACCENT","ToastCard","props","_entry_icon","entry","store","glyphs","useG9Settings","action","useG9Press","accent","g9Token","icon","offset","direction","useG9Direction","view","g9RowStyle","g9ToastTimings","G9IconSlot","text","anchorStyle","position","top","bottom","m","style","ToastLayer","state","snap","useSyncExternalStore","l","insets","useG9HostInsets","culture","useG9Culture","rtl","executor","useG9Executor","clearance","setClearance","useState","useEffect","positions","Set","t","glide","percent","p","toNativeDigits","Math","bottomStack","G9ActivityIndicator","createToastService","host","G9ToastStore","cb","ms","startTimer","h","stopTimer","message","type","options","id","text1","title","detail","progress","animate","px","key","height","toastServiceOf","existing","useG9Toasts","useG9Host","g9Toasts","g9Hosts"],"mappings":";;;;;;;;;;;;AAuBO,MAAMA,iBAAiBC,OAAO,MAAM,CAAC;IAAE,YAAY;IAAI,KAAK;IAAG,oBAAoB;AAAK;AAmC/F,MAAMC,UAAU;AAWhB,MAAMC,SAA4C;IAChD,aAAa;IACb,SAAS;IACT,SAAS;IACT,OAAO;AACT;AAEA,SAASC,UAAUC,KAIlB;QAMGC;IALF,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH;IACzB,MAAMI,SAASC,gBAAgB,MAAM;IACrC,MAAMC,SAASC,WAAW,IAAMJ,MAAM,WAAW,CAACD,MAAM,EAAE,GAAG;QAAE,QAAQ;QAAW,SAAS;IAAE;IAC7F,MAAMM,SAASC,QAAQX,MAAM,CAACI,MAAM,IAAI,CAAC;IACzC,MAAMQ,OAAAA,QACJT,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cACCC,AAAe,cAAfA,MAAM,IAAI,GACPE,OAAO,OAAO,GACdF,AAAe,cAAfA,MAAM,IAAI,GACRE,OAAO,OAAO,GACdF,AAAe,YAAfA,MAAM,IAAI,GACRE,OAAO,KAAK,GACZA,OAAO,IAAI;IACrB,MAAMO,SAASX,MAAM,MAAM,GAAG,SAAS;IACvC,MAAMY,YAAYC;IAClB,QACGC,KACC,WAAW,CA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E;QACnE,oBAAoB,CAACC;YACnB1C,MAAM,SAAS,GAAGsB,KAAK,GAAG,CAAC,GAAGoB;QAChC;QACA,kBAAkB,CAACC,KAAKC,SAAWnE,MAAM,gBAAgB,CAACkE,KAAKC;QAC/D,YAAY,IAAMnE,MAAM,UAAU;IACpC;IACAiD,KAAK,aAAa,CAACvD,SAAS6B;IAC5B0B,KAAK,iBAAiB,CAAC,YAAY;QAAE,KAAKvD;QAAS,UAAU4B,WAAW,OAAOC;QAAW,OAAO;IAAE;IACnG,OAAOA;AACT;AAGO,SAAS6C,eAAenB,IAAkB;IAC/C,MAAMoB,WAAWpB,KAAK,UAAU,CAACvD;IACjC,OAAO,AAAC2E,CAAAA,QAAAA,WAAAA,WAAYrB,mBAAmBC,KAAI,EAAG,OAAO;AACvD;AAGO,SAASqB;IACd,OAAOF,eAAeG;AACxB;AAGO,SAASC;IACd,OAAOJ,eAAeK,QAAQ,OAAO;AACvC"}
1
+ {"version":3,"file":"toast/service.jsx","sources":["../../src/toast/service.tsx"],"sourcesContent":["import './toast.css';\nimport { formatColor, type G9ColorToken, toNativeDigits, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host, useG9HostInsets } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Direction, useG9Executor, useG9Settings, useG9Theme } from '../provider/hooks';\nimport {\n type G9LoadingLease,\n type G9ToastEntry,\n type G9ToastHandle,\n type G9ToastOptions,\n type G9ToastPosition,\n G9ToastStore,\n type G9ToastType,\n g9ToastTimings,\n} from './store';\n\n/** Margin between a toast stack and the screen edge (MAUI 16 dp) and between toasts (8 dp). */\nexport const g9ToastMetrics = Object.freeze({ edgeMargin: 16, gap: 8, loaderScrimOpacity: 0.55 });\n\n/** The toasts of a host (MAUI `G9ToastHelper`). */\nexport interface G9ToastService {\n /** A typed, auto-dismissing toast (MAUI `ShowToastAsync`). */\n showToast(message: string, type?: G9ToastType, options?: G9ToastOptions): G9ToastHandle;\n /** Dismisses one toast or every typed toast (MAUI `DismissToastAsync`). */\n dismissToast(id?: number): void;\n /** Full-screen blocking loader, reference-counted (MAUI `ShowLoadingAsync`). */\n showLoading(text?: string): void;\n /** Lease form of `showLoading` (MAUI `BeginLoadingAsync`). */\n beginLoading(text?: string): G9LoadingLease;\n /** Releases one anonymous hold (MAUI `DismissLoadingAsync`). */\n dismissLoading(): void;\n /** Compact non-blocking loading toast (MAUI `ShowLoadingToastAsync`). */\n showLoadingToast(text?: string, position?: G9ToastPosition | null): void;\n dismissLoadingToast(): void;\n /** Progress toast (MAUI `ShowProgressToastAsync`). */\n showProgressToast(title: string, detail?: string | null, progress?: number, position?: G9ToastPosition | null): void;\n updateProgressToast(title?: string | null, detail?: string | null, progress?: number | null): void;\n dismissProgressToast(): void;\n /**\n * Re-anchors live toasts after the bottom clearance changed (MAUI `RefreshBottomInsetsAsync`, ADR-0027: an explicit\n * call, not a subscription). `animate` glides 220 ms; false snaps.\n */\n refreshBottomInsets(animate?: boolean): void;\n /** The space a bottom bar (tab bar) takes above the safe area; call `refreshBottomInsets` after changing it. */\n setBottomClearance(px: number): void;\n /** A bottom-anchored overlay (MAUI `IG9BottomAnchoredOverlay`): bottom stacks sit above its height. */\n setBottomOverlay(key: string, heightPx: number | null): void;\n /** Clears every toast, loader and progress (MAUI `DismissAllAsync`). */\n dismissAll(): void;\n readonly store: G9ToastStore;\n}\n\nconst FEATURE = 'g9.toasts';\n\ninterface State {\n service: G9ToastService;\n clearance: number;\n committedClearance: number;\n rtl: boolean;\n /** Set by the layer (the provider's safe executor); a toast cannot show before the layer renders. */\n run?: (action: () => unknown) => void;\n}\n\n/** MAUI G9ToastHelper.ResolveTypeVisuals: the card is filled with the type's colour, its text and glyph in the On colour. */\nconst ACCENT: Record<G9ToastType, readonly [G9ColorToken, G9ColorToken]> = {\n information: ['Info', 'OnInfo'],\n success: ['Success', 'OnSuccess'],\n warning: ['Warning', 'OnWarning'],\n error: ['Error', 'OnError'],\n};\n\ntype Palette = ReturnType<typeof useG9Theme>['palette'];\n\nconst paletteColor = (palette: Palette, token: G9ColorToken, alpha = 1): string =>\n formatColor(withAlpha(palette[token], alpha));\n\n/**\n * MAUI's countdown: a layer in the On colour at 14 % grows from the reading start over the toast's lifetime (a refresh\n * restarts it). Mounted at scale 0, then the transition to 1 starts on the next frame.\n */\nfunction ToastCountdown(props: {\n readonly durationMs: number;\n readonly color: string;\n readonly rtl: boolean;\n}): ReactNode {\n const [run, setRun] = useState(false);\n useEffect(() => {\n const t = setTimeout(() => setRun(true), 16);\n return () => clearTimeout(t);\n }, []);\n return (\n <view\n className=\"g9-toast__countdown\"\n style={{\n backgroundColor: props.color,\n transformOrigin: props.rtl ? 'right center' : 'left center',\n transform: `scaleX(${run ? 1 : 0})`,\n transition: run ? `transform ${props.durationMs}ms linear` : 'none',\n }}\n />\n );\n}\n\nfunction ToastCard(props: {\n readonly entry: G9ToastEntry;\n readonly store: G9ToastStore;\n readonly bottom: boolean;\n}): ReactNode {\n const { entry, store } = props;\n const glyphs = useG9Settings().glyphs;\n const action = useG9Press(() => store.pressAction(entry.id), { source: 'G9Toast', guardMs: 0 });\n const palette = useG9Theme().palette;\n const [fillToken, onToken] = ACCENT[entry.type];\n const fill = paletteColor(palette, fillToken);\n const on = paletteColor(palette, onToken);\n const icon =\n entry.icon ??\n (entry.type === 'success'\n ? glyphs.success\n : entry.type === 'warning'\n ? glyphs.warning\n : entry.type === 'error'\n ? glyphs.error\n : glyphs.info);\n const offset = props.bottom ? '12px' : '-12px';\n const direction = useG9Direction();\n return (\n <view\n className={`g9-toast g9-toast--${entry.type} g9-toast--${entry.status}`}\n accessibility-element={true}\n accessibility-label={entry.message}\n style={{\n ...g9RowStyle(direction),\n backgroundColor: fill,\n borderColor: paletteColor(palette, onToken, 0.35),\n opacity: entry.status === 'shown' || entry.status === 'entering' ? 1 : 0,\n transform: `translateY(${entry.status === 'leaving' ? offset : '0px'})`,\n transition: `opacity ${entry.status === 'leaving' ? g9ToastTimings.exitMs : g9ToastTimings.enterMs}ms, transform ${g9ToastTimings.enterMs}ms`,\n }}\n >\n {entry.durationMs > 0 ? (\n <ToastCountdown\n key={entry.refreshes}\n durationMs={entry.durationMs}\n color={paletteColor(palette, onToken, 0.14)}\n rtl={direction === 'rtl'}\n />\n ) : null}\n <G9IconSlot icon={icon} size={20} color={on} />\n <text className=\"g9-toast__message\" style={{ color: on }}>\n {entry.message}\n </text>\n {entry.actionText ? (\n <view\n className=\"g9-toast__action\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n bindtap={action}\n style={{ backgroundColor: paletteColor(palette, onToken, 0.16) }}\n >\n <text className=\"g9-toast__action-text\" style={{ color: on }}>\n {entry.actionText}\n </text>\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction anchorStyle(position: G9ToastPosition, top: number, bottom: number): Record<string, string> {\n const m = `${g9ToastMetrics.edgeMargin}px`;\n const style: Record<string, string> = {};\n if (position.startsWith('top')) style.top = `${top}px`;\n else if (position.startsWith('bottom')) style.bottom = `${bottom}px`;\n else {\n style.top = '0px';\n style.bottom = '0px';\n }\n // MAUI: every inline toast fills the width between the margins, whatever the horizontal part of its position.\n style.left = m;\n style.right = m;\n return style;\n}\n\n/** The feedback layer: stacks per position, the compact loading toast, the progress toast, the full-screen loader. */\nfunction ToastLayer(props: { readonly state: State; readonly host: G9HostHandle }): ReactNode {\n const { state, host } = props;\n // MAUI ResolveBottomInset: the tab-bar clearance applies only while no sheet is open — a sheet covers the bar, so a\n // toast then falls back to the plain safe-area gap instead of floating over the sheet's middle. Read when the\n // toasts render (a toast shows), like MAUI's GetOpenSheetCount at show time; a closing sheet no longer counts.\n const sheets = host.getFeature('g9.sheets') as { readonly service?: { getOpenCount(): number } } | undefined;\n const sheetOpen = (sheets?.service?.getOpenCount() ?? 0) > 0;\n const store = state.service.store;\n const snap = useSyncExternalStore(\n (l) => store.subscribe(l),\n () => store.getSnapshot(),\n );\n const insets = useG9HostInsets();\n const culture = useG9Culture();\n const rtl = useG9Direction() === 'rtl';\n state.rtl = rtl;\n const executor = useG9Executor();\n state.run = (action) =>\n void executor.run(() => action(), { source: 'G9Toast', enableThrottle: false, preventConcurrentExecution: false });\n // The clearance is read when insets are refreshed (or a toast shows): a change alone does not move live toasts.\n const [clearance, setClearance] = useState(state.committedClearance);\n useEffect(() => {\n state.committedClearance = state.clearance;\n setClearance(state.clearance);\n }, [snap.insetVersion, snap.toasts.length]);\n useEffect(() => () => store.dispose(), [store]);\n const top = insets.top + g9ToastMetrics.edgeMargin;\n const bottom = insets.bottom + (sheetOpen ? 0 : clearance) + snap.bottomOverlayHeight + g9ToastMetrics.edgeMargin;\n const positions = new Set<G9ToastPosition>(snap.toasts.map((t) => t.position));\n if (snap.loadingToast) positions.add(snap.loadingToast.position);\n if (snap.progress) positions.add(snap.progress.position);\n const glide = snap.reanchorAnimated\n ? `top ${g9ToastTimings.reanchorMs}ms cubic-bezier(0.215, 0.61, 0.355, 1), bottom ${g9ToastTimings.reanchorMs}ms cubic-bezier(0.215, 0.61, 0.355, 1)`\n : 'none';\n const percent = (p: number) => toNativeDigits(`${Math.round(p * 100)}%`, culture.numberingSystem);\n return (\n <view className={`g9-toast-layer g9-dir-${rtl ? 'rtl' : 'ltr'}`} event-through={true}>\n {[...positions].map((position) => {\n const bottomStack = position.startsWith('bottom');\n return (\n <view\n key={position}\n className={`g9-toast-stack g9-toast-stack--${position}${bottomStack ? ' g9-toast-stack--bottom' : ''}`}\n event-through={true}\n style={{ ...anchorStyle(position, top, bottom), transition: glide }}\n >\n {snap.toasts\n .filter((t) => t.position === position)\n .map((t) => (\n <ToastCard key={t.id} entry={t} store={store} bottom={bottomStack} />\n ))}\n {snap.loadingToast && snap.loadingToast.position === position ? (\n <view className=\"g9-toast g9-toast--loading\" accessibility-label={snap.loadingToast.text}>\n <G9ActivityIndicator running size={18} />\n <text className=\"g9-toast__message\">{snap.loadingToast.text}</text>\n </view>\n ) : null}\n {snap.progress && snap.progress.position === position ? (\n <view className=\"g9-toast g9-toast--progress\" accessibility-value={percent(snap.progress.progress)}>\n <view\n className=\"g9-toast__fill\"\n style={{\n transform: `scaleX(${snap.progress.progress})`,\n transformOrigin: rtl ? 'right center' : 'left center',\n }}\n />\n <view className=\"g9-toast__progress-text\">\n <text className=\"g9-toast__message\">{snap.progress.title}</text>\n {snap.progress.detail ? <text className=\"g9-toast__detail\">{snap.progress.detail}</text> : null}\n </view>\n <view className=\"g9-toast__pill\">\n <text className=\"g9-toast__pill-text\">{percent(snap.progress.progress)}</text>\n </view>\n </view>\n ) : null}\n </view>\n );\n })}\n {snap.loader ? (\n <view\n className={`g9-loader g9-loader--${snap.loader.status}`}\n style={{\n opacity: snap.loader.status === 'leaving' ? 0 : 1,\n transition: `opacity ${snap.loader.status === 'leaving' ? g9ToastTimings.loaderFadeOutMs : g9ToastTimings.loaderFadeInMs}ms`,\n }}\n event-through={false}\n bindtap={() => {}}\n >\n <view className=\"g9-loader__scrim\" style={{ opacity: g9ToastMetrics.loaderScrimOpacity }} />\n <view className=\"g9-loader__card\">\n <G9ActivityIndicator running size={36} color=\"var(--g9-inverse-on-surface)\" />\n {snap.loader.text ? <text className=\"g9-loader__text\">{snap.loader.text}</text> : null}\n </view>\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction createToastService(host: G9HostHandle): State {\n const state = { clearance: 0, committedClearance: 0, rtl: false } as State;\n const store = new G9ToastStore({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n runAction: (action) => state.run?.(action),\n defaultPosition: () => (state.rtl ? 'bottomLeft' : 'bottomRight'),\n });\n state.service = {\n store,\n showToast: (message, type, options) => store.show(message, type, options),\n dismissToast: (id) => store.dismissToast(id),\n showLoading: (text) => store.showLoading(text),\n beginLoading: (text) => store.beginLoading(text),\n dismissLoading: () => store.dismissLoading(),\n showLoadingToast: (text, position) => store.showLoadingToast(text, position ?? null),\n dismissLoadingToast: () => store.dismissLoadingToast(),\n showProgressToast: (title, detail, progress, position) =>\n store.showProgress(title, detail ?? null, progress ?? 0, position ?? null),\n updateProgressToast: (title, detail, progress) => store.updateProgress(title, detail, progress),\n dismissProgressToast: () => store.dismissProgress(),\n refreshBottomInsets: (animate = true) => store.refreshBottomInsets(animate),\n setBottomClearance: (px) => {\n state.clearance = Math.max(0, px);\n },\n setBottomOverlay: (key, height) => store.setBottomOverlay(key, height),\n dismissAll: () => store.dismissAll(),\n };\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('feedback', { key: FEATURE, element: <ToastLayer state={state} host={host} />, order: 0 });\n return state;\n}\n\n/** The toast service of a host (created once as a host feature). */\nexport function toastServiceOf(host: G9HostHandle): G9ToastService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createToastService(host)).service;\n}\n\n/** The toasts of the nearest `G9Host` (MAUI `G9ToastHelper`), in its `feedback` layer above popups and sheets. */\nexport function useG9Toasts(): G9ToastService {\n return toastServiceOf(useG9Host());\n}\n\n/** The toasts of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Toasts(): G9ToastService {\n return toastServiceOf(g9Hosts.require());\n}\n"],"names":["g9ToastMetrics","Object","FEATURE","ACCENT","paletteColor","palette","token","alpha","formatColor","withAlpha","ToastCountdown","props","run","setRun","useState","useEffect","t","setTimeout","clearTimeout","view","ToastCard","_entry_icon","entry","store","glyphs","useG9Settings","action","useG9Press","useG9Theme","fillToken","onToken","fill","on","icon","offset","direction","useG9Direction","g9RowStyle","g9ToastTimings","G9IconSlot","text","anchorStyle","position","top","bottom","m","style","ToastLayer","_sheets_service","state","host","sheets","sheetOpen","snap","useSyncExternalStore","l","insets","useG9HostInsets","culture","useG9Culture","rtl","executor","useG9Executor","clearance","setClearance","positions","Set","glide","percent","p","toNativeDigits","Math","bottomStack","G9ActivityIndicator","createToastService","G9ToastStore","cb","ms","startTimer","h","stopTimer","message","type","options","id","text1","title","detail","progress","animate","px","key","height","toastServiceOf","existing","useG9Toasts","useG9Host","g9Toasts","g9Hosts"],"mappings":";;;;;;;;;;;;AAuBO,MAAMA,iBAAiBC,OAAO,MAAM,CAAC;IAAE,YAAY;IAAI,KAAK;IAAG,oBAAoB;AAAK;AAmC/F,MAAMC,UAAU;AAYhB,MAAMC,SAAqE;IACzE,aAAa;QAAC;QAAQ;KAAS;IAC/B,SAAS;QAAC;QAAW;KAAY;IACjC,SAAS;QAAC;QAAW;KAAY;IACjC,OAAO;QAAC;QAAS;KAAU;AAC7B;AAIA,MAAMC,eAAe,CAACC,SAAkBC,OAAqBC,QAAQ,CAAC,GACpEC,YAAYC,UAAUJ,OAAO,CAACC,MAAM,EAAEC;AAMxC,SAASG,eAAeC,KAIvB;IACC,MAAM,CAACC,KAAKC,OAAO,GAAGC,SAAS;IAC/BC,UAAU;QACR,MAAMC,IAAIC,WAAW,IAAMJ,OAAO,OAAO;QACzC,OAAO,IAAMK,aAAaF;IAC5B,GAAG,EAAE;IACL,QACGG,KACC,UAAU,sBACV,OAAO;QACL,iBAAiBR,MAAM,KAAK;QAC5B,iBAAiBA,MAAM,GAAG,GAAG,iBAAiB;QAC9C,WAAW,CAAC,OAAO,EAAEC,MAAM,IAAI,EAAE,CAAC,CAAC;QACnC,YAAYA,MAAM,CAAC,UAAU,EAAED,MAAM,UAAU,CAAC,SAAS,CAAC,GAAG;IAC/D;AAGN;AAEA,SAASS,UAAUT,KAIlB;QASGU;IARF,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGZ;IACzB,MAAMa,SAASC,gBAAgB,MAAM;IACrC,MAAMC,SAASC,WAAW,IAAMJ,MAAM,WAAW,CAACD,MAAM,EAAE,GAAG;QAAE,QAAQ;QAAW,SAAS;IAAE;IAC7F,MAAMjB,UAAU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OAAO,MAAMC;QAAU,OAAO;IAAE;IAC/G,OAAOD;AACT;AAGO,SAAS4C,eAAe3C,IAAkB;IAC/C,MAAM4C,WAAW5C,KAAK,UAAU,CAAChD;IACjC,OAAO,AAAC4F,CAAAA,QAAAA,WAAAA,WAAYpB,mBAAmBxB,KAAI,EAAG,OAAO;AACvD;AAGO,SAAS6C;IACd,OAAOF,eAAeG;AACxB;AAGO,SAASC;IACd,OAAOJ,eAAeK,QAAQ,OAAO;AACvC"}
@@ -57,6 +57,8 @@ export interface G9ToastEntry {
57
57
  readonly status: 'entering' | 'shown' | 'leaving';
58
58
  /** Bumped when an identical toast collapsed into this one (its lifetime restarted). */
59
59
  readonly refreshes: number;
60
+ /** Its lifetime (the countdown fill runs over it; 0 or less = sticky, no fill). */
61
+ readonly durationMs: number;
60
62
  }
61
63
  /** The full-screen loader (visible while at least one hold is open). */
62
64
  export interface G9LoaderState {
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/toast/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD,uCAAuC;AACvC,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,6CAA6C;AAC7C,eAAO,MAAM,eAAe;;;;;;;;;;CAUlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3C,qDAAqD;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,CAAC,E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,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,OAAO,GAAG,eAAe,CAEhH"}
@@ -55,7 +55,8 @@ class G9ToastStore {
55
55
  if (!this.disposed && newest && !hasAction && isPlain(newest) && newest.entry.message === message && newest.entry.type === type) {
56
56
  newest.entry = {
57
57
  ...newest.entry,
58
- refreshes: newest.entry.refreshes + 1
58
+ refreshes: newest.entry.refreshes + 1,
59
+ durationMs: duration
59
60
  };
60
61
  newest.durationMs = duration;
61
62
  this.arm(newest);
@@ -74,7 +75,8 @@ class G9ToastStore {
74
75
  actionText: hasAction ? options.actionText : null,
75
76
  hasAction,
76
77
  status: 'entering',
77
- refreshes: 0
78
+ refreshes: 0,
79
+ durationMs: duration
78
80
  },
79
81
  action: hasAction ? options.action : null,
80
82
  durationMs: duration,
@@ -1 +1 @@
1
- {"version":3,"file":"toast/store.jsx","sources":["../../src/toast/store.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n// Toast state (MAUI `G9ToastHelper`): typed toasts in per-position stacks, the reference-counted full-screen loader,\n// the compact loading toast and the progress toast, as a pure store. The view renders `getSnapshot()`; timers come\n// from the caller so tests drive time.\n\n/** Toast kind (MAUI `G9ToastType`). */\nexport const G9ToastType = {\n Information: 'information',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n} as const;\nexport type G9ToastType = (typeof G9ToastType)[keyof typeof G9ToastType];\n\n/** Nine anchors (MAUI `G9ToastPosition`). */\nexport const G9ToastPosition = {\n TopLeft: 'topLeft',\n TopCenter: 'topCenter',\n TopRight: 'topRight',\n MiddleLeft: 'middleLeft',\n MiddleCenter: 'middleCenter',\n MiddleRight: 'middleRight',\n BottomLeft: 'bottomLeft',\n BottomCenter: 'bottomCenter',\n BottomRight: 'bottomRight',\n} as const;\nexport type G9ToastPosition = (typeof G9ToastPosition)[keyof typeof G9ToastPosition];\n\n/** Options of one toast (MAUI `G9ToastOptions`). */\nexport interface G9ToastOptions {\n /** Default: bottom right (LTR) / bottom left (RTL). */\n readonly position?: G9ToastPosition | null;\n /** Auto-dismiss after this many ms. Default 3000. */\n readonly durationMs?: number;\n /** Icon override; default the type's glyph. */\n readonly icon?: G9IconInput;\n /** Action button text (e.g. \"Undo\"); with `action`. */\n readonly actionText?: string | null;\n /** Runs once when the action button is tapped (through the provider's safe executor). */\n readonly action?: (() => unknown) | null;\n}\n\n/** Default toast options (MAUI `G9ToastOptions.Default`). */\nexport const g9DefaultToastOptions: Readonly<Required<Pick<G9ToastOptions, 'durationMs'>>> = Object.freeze({\n durationMs: 3000,\n});\n\n/** Timings (MAUI toast guide). */\nexport const g9ToastTimings = Object.freeze({\n enterMs: 250,\n exitMs: 200,\n loaderFadeInMs: 200,\n loaderFadeOutMs: 180,\n reanchorMs: 220,\n});\n/** Most toasts per stack (MAUI `MaxToastsPerStack`). */\nexport const g9MaxToastsPerStack = 4;\n\n/** One live toast. */\nexport interface G9ToastEntry {\n readonly id: number;\n readonly message: string;\n readonly type: G9ToastType;\n readonly position: G9ToastPosition;\n readonly icon: G9IconInput;\n readonly actionText: string | null;\n readonly hasAction: boolean;\n readonly status: 'entering' | 'shown' | 'leaving';\n /** Bumped when an identical toast collapsed into this one (its lifetime restarted). */\n readonly refreshes: number;\n}\n\n/** The full-screen loader (visible while at least one hold is open). */\nexport interface G9LoaderState {\n readonly text: string;\n readonly status: 'entering' | 'shown' | 'leaving';\n}\n\n/** The compact loading toast. */\nexport interface G9LoadingToastState {\n readonly text: string;\n readonly position: G9ToastPosition;\n}\n\n/** The progress toast. */\nexport interface G9ProgressToastState {\n readonly title: string;\n readonly detail: string | null;\n /** 0…1. */\n readonly progress: number;\n readonly position: G9ToastPosition;\n}\n\n/** What the view renders. */\nexport interface G9ToastSnapshot {\n readonly toasts: ReadonlyArray<G9ToastEntry>;\n readonly loader: G9LoaderState | null;\n readonly loadingToast: G9LoadingToastState | null;\n readonly progress: G9ProgressToastState | null;\n /** Bumped by `refreshBottomInsets`; `reanchorAnimated` says whether the move glides. */\n readonly insetVersion: number;\n readonly reanchorAnimated: boolean;\n /** Heights of bottom-anchored overlays the bottom stacks sit above (MAUI `IG9BottomAnchoredOverlay`). */\n readonly bottomOverlayHeight: number;\n}\n\n/** A hold on the full-screen loader (MAUI `BeginLoadingAsync` lease); disposing twice is harmless. */\nexport interface G9LoadingLease {\n dispose(): void;\n}\n\n/** A shown toast. */\nexport interface G9ToastHandle {\n readonly id: number;\n dismiss(): void;\n /** Settles when the toast left the screen. */\n readonly closed: Promise<void>;\n}\n\n/** Timing and action plumbing of the store. */\nexport interface G9ToastStoreConfig {\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n /** Runs a toast action (once per tap is the store's job; errors are the runner's). */\n runAction(action: () => unknown): void;\n /** Where a toast without a position goes (bottom right in LTR, bottom left in RTL). */\n defaultPosition(): G9ToastPosition;\n}\n\ninterface ToastRecord {\n entry: G9ToastEntry;\n action: (() => unknown) | null;\n durationMs: number;\n timer: unknown;\n actionRan: boolean;\n closed: () => void;\n}\n\ninterface Hold {\n readonly token: number;\n readonly text: string;\n readonly lease: boolean;\n}\n\nconst isPlain = (r: ToastRecord) => !r.entry.hasAction;\n\n/** The toast store. */\nexport class G9ToastStore {\n private records: ToastRecord[] = [];\n private holds: Hold[] = [];\n private loaderStatus: G9LoaderState['status'] | null = null;\n private loaderText = '';\n private loaderTimer: unknown = null;\n private loadingToast: G9LoadingToastState | null = null;\n private progress: G9ProgressToastState | null = null;\n private insetVersion = 0;\n private reanchorAnimated = true;\n private readonly overlays = new Map<string, number>();\n private nextId = 1;\n private readonly listeners = new Set<() => void>();\n private snapshot: G9ToastSnapshot;\n private disposed = false;\n\n constructor(private readonly config: G9ToastStoreConfig) {\n this.snapshot = this.build();\n }\n\n getSnapshot(): G9ToastSnapshot {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Shows a toast (MAUI `ShowToastAsync`). An identical newest toast of the same stack (same message and type, no\n * action on either) is refreshed instead (lifetime restarted). Past four per stack the oldest leaves.\n */\n show(message: string, type: G9ToastType = 'information', options: G9ToastOptions = {}): G9ToastHandle {\n const position = options.position ?? this.config.defaultPosition();\n const hasAction = !!options.actionText && !!options.action;\n const duration = options.durationMs ?? g9DefaultToastOptions.durationMs;\n const stack = this.records.filter((r) => r.entry.position === position && r.entry.status !== 'leaving');\n const newest = stack[stack.length - 1];\n if (\n !this.disposed &&\n newest &&\n !hasAction &&\n isPlain(newest) &&\n newest.entry.message === message &&\n newest.entry.type === type\n ) {\n newest.entry = { ...newest.entry, refreshes: newest.entry.refreshes + 1 };\n newest.durationMs = duration;\n this.arm(newest);\n this.emit();\n return this.handle(newest);\n }\n let closed!: () => void;\n const done = new Promise<void>((r) => (closed = r));\n const record: ToastRecord = {\n entry: {\n id: this.nextId++,\n message,\n type,\n position,\n icon: options.icon,\n actionText: hasAction ? (options.actionText as string) : null,\n hasAction,\n status: 'entering',\n refreshes: 0,\n },\n action: hasAction ? (options.action as () => unknown) : null,\n durationMs: duration,\n timer: null,\n actionRan: false,\n closed,\n };\n if (this.disposed) {\n closed();\n return { id: record.entry.id, dismiss: () => {}, closed: done };\n }\n this.records.push(record);\n for (const extra of stack.slice(0, Math.max(0, stack.length + 1 - g9MaxToastsPerStack))) this.leave(extra);\n this.later(() => {\n if (record.entry.status === 'entering') {\n record.entry = { ...record.entry, status: 'shown' };\n this.emit();\n }\n }, g9ToastTimings.enterMs);\n this.arm(record);\n this.emit();\n return { ...this.handle(record), closed: done };\n }\n\n /** Dismisses one toast, or every typed toast (MAUI `DismissToastAsync`). */\n dismissToast(id?: number): void {\n for (const r of [...this.records]) if (id === undefined || r.entry.id === id) this.leave(r);\n }\n\n /** The action button: runs the action once (a second tap during the exit does nothing) and dismisses. */\n pressAction(id: number): void {\n const r = this.records.find((x) => x.entry.id === id);\n if (!r || r.actionRan || !r.action) return;\n r.actionRan = true;\n this.config.runAction(r.action);\n this.leave(r);\n }\n\n /** Raises the full-screen loader (reference-counted; the newest text wins) (MAUI `ShowLoadingAsync`). */\n showLoading(text = ''): void {\n this.hold({ token: this.nextId++, text, lease: false });\n }\n\n /** A lease on the loader (MAUI `BeginLoadingAsync`). */\n beginLoading(text = ''): G9LoadingLease {\n const hold = { token: this.nextId++, text, lease: true };\n this.hold(hold);\n let released = false;\n return {\n dispose: () => {\n if (released) return;\n released = true;\n this.release(hold.token);\n },\n };\n }\n\n /** Releases the newest anonymous hold; a lease's hold is never released here (MAUI `DismissLoadingAsync`). */\n dismissLoading(): void {\n const anonymous = [...this.holds].reverse().find((h) => !h.lease);\n if (anonymous) this.release(anonymous.token);\n }\n\n /** Shows (or relabels) the compact loading toast (MAUI `ShowLoadingToastAsync`); it never auto-dismisses. */\n showLoadingToast(text = '', position: G9ToastPosition | null = null): void {\n this.loadingToast = { text, position: position ?? this.config.defaultPosition() };\n this.emit();\n }\n\n dismissLoadingToast(): void {\n if (!this.loadingToast) return;\n this.loadingToast = null;\n this.emit();\n }\n\n /** Shows the progress toast, replacing an active one (MAUI `ShowProgressToastAsync`). */\n showProgress(\n title: string,\n detail: string | null = null,\n progress = 0,\n position: G9ToastPosition | null = null,\n ): void {\n this.progress = { title, detail, progress: clamp01(progress), position: position ?? this.config.defaultPosition() };\n this.emit();\n }\n\n /** Updates the progress toast; omitted parts stay (MAUI `UpdateProgressToastAsync`). No-op without one. */\n updateProgress(title?: string | null, detail?: string | null, progress?: number | null): void {\n if (!this.progress) return;\n this.progress = {\n ...this.progress,\n ...(title != null ? { title } : {}),\n ...(detail !== undefined && detail !== null ? { detail } : {}),\n ...(progress != null ? { progress: clamp01(progress) } : {}),\n };\n this.emit();\n }\n\n dismissProgress(): void {\n if (!this.progress) return;\n this.progress = null;\n this.emit();\n }\n\n /** Re-anchors every live toast to the current insets; `animate` glides (220 ms) (MAUI `RefreshBottomInsetsAsync`). */\n refreshBottomInsets(animate = true): void {\n this.insetVersion += 1;\n this.reanchorAnimated = animate;\n this.emit();\n }\n\n /** Registers (or clears with `null`) a bottom-anchored overlay the bottom stacks must sit above. */\n setBottomOverlay(key: string, heightPx: number | null): void {\n if (heightPx === null || heightPx <= 0) this.overlays.delete(key);\n else this.overlays.set(key, heightPx);\n this.emit();\n }\n\n /** Clears everything, the loader regardless of its count (MAUI `DismissAllAsync`). */\n dismissAll(): void {\n this.dismissToast();\n this.holds = [];\n this.updateLoader();\n this.loadingToast = null;\n this.progress = null;\n this.emit();\n }\n\n /** The host unmounted. */\n dispose(): void {\n this.disposed = true;\n for (const r of this.records) {\n if (r.timer !== null) this.config.clearTimer(r.timer);\n r.closed();\n }\n this.records = [];\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.holds = [];\n this.loaderStatus = null;\n this.emit();\n }\n\n private handle(record: ToastRecord): G9ToastHandle {\n return {\n id: record.entry.id,\n dismiss: () => this.leave(record),\n closed: Promise.resolve(),\n };\n }\n\n private arm(record: ToastRecord): void {\n if (record.timer !== null) this.config.clearTimer(record.timer);\n record.timer = this.config.setTimer(() => {\n record.timer = null;\n this.leave(record);\n }, record.durationMs);\n }\n\n private leave(record: ToastRecord): void {\n if (record.entry.status === 'leaving' || !this.records.includes(record)) return;\n if (record.timer !== null) this.config.clearTimer(record.timer);\n record.timer = null;\n record.entry = { ...record.entry, status: 'leaving' };\n this.emit();\n this.later(() => {\n this.records = this.records.filter((r) => r !== record);\n record.closed();\n this.emit();\n }, g9ToastTimings.exitMs);\n }\n\n private hold(hold: Hold): void {\n this.holds.push(hold);\n this.updateLoader();\n this.emit();\n }\n\n private release(token: number): void {\n this.holds = this.holds.filter((h) => h.token !== token);\n this.updateLoader();\n this.emit();\n }\n\n private updateLoader(): void {\n const top = this.holds[this.holds.length - 1];\n if (top) {\n this.loaderText = top.text;\n if (this.loaderStatus === null || this.loaderStatus === 'leaving') {\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.loaderStatus = 'entering';\n this.loaderTimer = this.config.setTimer(() => {\n this.loaderTimer = null;\n this.loaderStatus = 'shown';\n this.emit();\n }, g9ToastTimings.loaderFadeInMs);\n }\n return;\n }\n if (this.loaderStatus === null || this.loaderStatus === 'leaving') return;\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.loaderStatus = 'leaving';\n this.loaderTimer = this.config.setTimer(() => {\n this.loaderTimer = null;\n this.loaderStatus = null;\n this.emit();\n }, g9ToastTimings.loaderFadeOutMs);\n }\n\n private later(callback: () => void, ms: number): void {\n this.config.setTimer(() => {\n if (!this.disposed) callback();\n }, ms);\n }\n\n private build(): G9ToastSnapshot {\n return {\n toasts: this.records.map((r) => r.entry),\n loader: this.loaderStatus ? { text: this.loaderText, status: this.loaderStatus } : null,\n loadingToast: this.loadingToast,\n progress: this.progress,\n insetVersion: this.insetVersion,\n reanchorAnimated: this.reanchorAnimated,\n bottomOverlayHeight: [...this.overlays.values()].reduce((a, b) => a + b, 0),\n };\n }\n\n private emit(): void {\n this.snapshot = this.build();\n for (const l of this.listeners) l();\n }\n}\n\nfunction clamp01(v: number): number {\n return Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : 0;\n}\n\n/** The culture default position: bottom right in LTR, bottom left in RTL. */\nexport function resolveToastPosition(position: G9ToastPosition | null | undefined, rtl: boolean): G9ToastPosition {\n return position ?? (rtl ? 'bottomLeft' : 'bottomRight');\n}\n"],"names":["G9ToastType","G9ToastPosition","g9DefaultToastOptions","Object","g9ToastTimings","g9MaxToastsPerStack","isPlain","r","G9ToastStore","listener","message","type","options","_options_position","_options_durationMs","position","hasAction","duration","stack","newest","closed","done","Promise","record","extra","Math","id","undefined","x","text","hold","released","anonymous","h","title","detail","progress","clamp01","animate","key","heightPx","token","top","callback","ms","a","b","l","config","Map","Set","v","Number","resolveToastPosition","rtl"],"mappings":";;;;;;;;;;AAOO,MAAMA,cAAc;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,OAAO;AACT;AAIO,MAAMC,kBA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AMC,KAAK,IAAI,CAAC,SAAS,CAAEA;IAClC;IAvRA,YAA6BC,MAA0B,CAAE;;QAfzD,uBAAQ,WAAR;QACA,uBAAQ,SAAR;QACA,uBAAQ,gBAAR;QACA,uBAAQ,cAAR;QACA,uBAAQ,eAAR;QACA,uBAAQ,gBAAR;QACA,uBAAQ,YAAR;QACA,uBAAQ,gBAAR;QACA,uBAAQ,oBAAR;QACA,uBAAiB,YAAjB;QACA,uBAAQ,UAAR;QACA,uBAAiB,aAAjB;QACA,uBAAQ,YAAR;QACA,uBAAQ,YAAR;aAE6BA,MAAM,GAANA;aAfrB,OAAO,GAAkB,EAAE;aAC3B,KAAK,GAAW,EAAE;aAClB,YAAY,GAAmC;aAC/C,UAAU,GAAG;aACb,WAAW,GAAY;aACvB,YAAY,GAA+B;aAC3C,QAAQ,GAAgC;aACxC,YAAY,GAAG;aACf,gBAAgB,GAAG;aACV,QAAQ,GAAG,IAAIC;aACxB,MAAM,GAAG;aACA,SAAS,GAAG,IAAIC;aAEzB,QAAQ,GAAG;QAGjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK;IAC5B;AAsRF;AAEA,SAASb,QAAQc,CAAS;IACxB,OAAOC,OAAO,QAAQ,CAACD,KAAK1B,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAG0B,MAAM;AAC5D;AAGO,SAASE,qBAAqBtC,QAA4C,EAAEuC,GAAY;IAC7F,OAAOvC,QAAAA,WAAAA,WAAauC,MAAM,eAAe;AAC3C"}
1
+ {"version":3,"file":"toast/store.jsx","sources":["../../src/toast/store.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n// Toast state (MAUI `G9ToastHelper`): typed toasts in per-position stacks, the reference-counted full-screen loader,\n// the compact loading toast and the progress toast, as a pure store. The view renders `getSnapshot()`; timers come\n// from the caller so tests drive time.\n\n/** Toast kind (MAUI `G9ToastType`). */\nexport const G9ToastType = {\n Information: 'information',\n Success: 'success',\n Warning: 'warning',\n Error: 'error',\n} as const;\nexport type G9ToastType = (typeof G9ToastType)[keyof typeof G9ToastType];\n\n/** Nine anchors (MAUI `G9ToastPosition`). */\nexport const G9ToastPosition = {\n TopLeft: 'topLeft',\n TopCenter: 'topCenter',\n TopRight: 'topRight',\n MiddleLeft: 'middleLeft',\n MiddleCenter: 'middleCenter',\n MiddleRight: 'middleRight',\n BottomLeft: 'bottomLeft',\n BottomCenter: 'bottomCenter',\n BottomRight: 'bottomRight',\n} as const;\nexport type G9ToastPosition = (typeof G9ToastPosition)[keyof typeof G9ToastPosition];\n\n/** Options of one toast (MAUI `G9ToastOptions`). */\nexport interface G9ToastOptions {\n /** Default: bottom right (LTR) / bottom left (RTL). */\n readonly position?: G9ToastPosition | null;\n /** Auto-dismiss after this many ms. Default 3000. */\n readonly durationMs?: number;\n /** Icon override; default the type's glyph. */\n readonly icon?: G9IconInput;\n /** Action button text (e.g. \"Undo\"); with `action`. */\n readonly actionText?: string | null;\n /** Runs once when the action button is tapped (through the provider's safe executor). */\n readonly action?: (() => unknown) | null;\n}\n\n/** Default toast options (MAUI `G9ToastOptions.Default`). */\nexport const g9DefaultToastOptions: Readonly<Required<Pick<G9ToastOptions, 'durationMs'>>> = Object.freeze({\n durationMs: 3000,\n});\n\n/** Timings (MAUI toast guide). */\nexport const g9ToastTimings = Object.freeze({\n enterMs: 250,\n exitMs: 200,\n loaderFadeInMs: 200,\n loaderFadeOutMs: 180,\n reanchorMs: 220,\n});\n/** Most toasts per stack (MAUI `MaxToastsPerStack`). */\nexport const g9MaxToastsPerStack = 4;\n\n/** One live toast. */\nexport interface G9ToastEntry {\n readonly id: number;\n readonly message: string;\n readonly type: G9ToastType;\n readonly position: G9ToastPosition;\n readonly icon: G9IconInput;\n readonly actionText: string | null;\n readonly hasAction: boolean;\n readonly status: 'entering' | 'shown' | 'leaving';\n /** Bumped when an identical toast collapsed into this one (its lifetime restarted). */\n readonly refreshes: number;\n /** Its lifetime (the countdown fill runs over it; 0 or less = sticky, no fill). */\n readonly durationMs: number;\n}\n\n/** The full-screen loader (visible while at least one hold is open). */\nexport interface G9LoaderState {\n readonly text: string;\n readonly status: 'entering' | 'shown' | 'leaving';\n}\n\n/** The compact loading toast. */\nexport interface G9LoadingToastState {\n readonly text: string;\n readonly position: G9ToastPosition;\n}\n\n/** The progress toast. */\nexport interface G9ProgressToastState {\n readonly title: string;\n readonly detail: string | null;\n /** 0…1. */\n readonly progress: number;\n readonly position: G9ToastPosition;\n}\n\n/** What the view renders. */\nexport interface G9ToastSnapshot {\n readonly toasts: ReadonlyArray<G9ToastEntry>;\n readonly loader: G9LoaderState | null;\n readonly loadingToast: G9LoadingToastState | null;\n readonly progress: G9ProgressToastState | null;\n /** Bumped by `refreshBottomInsets`; `reanchorAnimated` says whether the move glides. */\n readonly insetVersion: number;\n readonly reanchorAnimated: boolean;\n /** Heights of bottom-anchored overlays the bottom stacks sit above (MAUI `IG9BottomAnchoredOverlay`). */\n readonly bottomOverlayHeight: number;\n}\n\n/** A hold on the full-screen loader (MAUI `BeginLoadingAsync` lease); disposing twice is harmless. */\nexport interface G9LoadingLease {\n dispose(): void;\n}\n\n/** A shown toast. */\nexport interface G9ToastHandle {\n readonly id: number;\n dismiss(): void;\n /** Settles when the toast left the screen. */\n readonly closed: Promise<void>;\n}\n\n/** Timing and action plumbing of the store. */\nexport interface G9ToastStoreConfig {\n setTimer(callback: () => void, ms: number): unknown;\n clearTimer(handle: unknown): void;\n /** Runs a toast action (once per tap is the store's job; errors are the runner's). */\n runAction(action: () => unknown): void;\n /** Where a toast without a position goes (bottom right in LTR, bottom left in RTL). */\n defaultPosition(): G9ToastPosition;\n}\n\ninterface ToastRecord {\n entry: G9ToastEntry;\n action: (() => unknown) | null;\n durationMs: number;\n timer: unknown;\n actionRan: boolean;\n closed: () => void;\n}\n\ninterface Hold {\n readonly token: number;\n readonly text: string;\n readonly lease: boolean;\n}\n\nconst isPlain = (r: ToastRecord) => !r.entry.hasAction;\n\n/** The toast store. */\nexport class G9ToastStore {\n private records: ToastRecord[] = [];\n private holds: Hold[] = [];\n private loaderStatus: G9LoaderState['status'] | null = null;\n private loaderText = '';\n private loaderTimer: unknown = null;\n private loadingToast: G9LoadingToastState | null = null;\n private progress: G9ProgressToastState | null = null;\n private insetVersion = 0;\n private reanchorAnimated = true;\n private readonly overlays = new Map<string, number>();\n private nextId = 1;\n private readonly listeners = new Set<() => void>();\n private snapshot: G9ToastSnapshot;\n private disposed = false;\n\n constructor(private readonly config: G9ToastStoreConfig) {\n this.snapshot = this.build();\n }\n\n getSnapshot(): G9ToastSnapshot {\n return this.snapshot;\n }\n\n subscribe(listener: () => void): () => void {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n }\n\n /**\n * Shows a toast (MAUI `ShowToastAsync`). An identical newest toast of the same stack (same message and type, no\n * action on either) is refreshed instead (lifetime restarted). Past four per stack the oldest leaves.\n */\n show(message: string, type: G9ToastType = 'information', options: G9ToastOptions = {}): G9ToastHandle {\n const position = options.position ?? this.config.defaultPosition();\n const hasAction = !!options.actionText && !!options.action;\n const duration = options.durationMs ?? g9DefaultToastOptions.durationMs;\n const stack = this.records.filter((r) => r.entry.position === position && r.entry.status !== 'leaving');\n const newest = stack[stack.length - 1];\n if (\n !this.disposed &&\n newest &&\n !hasAction &&\n isPlain(newest) &&\n newest.entry.message === message &&\n newest.entry.type === type\n ) {\n newest.entry = { ...newest.entry, refreshes: newest.entry.refreshes + 1, durationMs: duration };\n newest.durationMs = duration;\n this.arm(newest);\n this.emit();\n return this.handle(newest);\n }\n let closed!: () => void;\n const done = new Promise<void>((r) => (closed = r));\n const record: ToastRecord = {\n entry: {\n id: this.nextId++,\n message,\n type,\n position,\n icon: options.icon,\n actionText: hasAction ? (options.actionText as string) : null,\n hasAction,\n status: 'entering',\n refreshes: 0,\n durationMs: duration,\n },\n action: hasAction ? (options.action as () => unknown) : null,\n durationMs: duration,\n timer: null,\n actionRan: false,\n closed,\n };\n if (this.disposed) {\n closed();\n return { id: record.entry.id, dismiss: () => {}, closed: done };\n }\n this.records.push(record);\n for (const extra of stack.slice(0, Math.max(0, stack.length + 1 - g9MaxToastsPerStack))) this.leave(extra);\n this.later(() => {\n if (record.entry.status === 'entering') {\n record.entry = { ...record.entry, status: 'shown' };\n this.emit();\n }\n }, g9ToastTimings.enterMs);\n this.arm(record);\n this.emit();\n return { ...this.handle(record), closed: done };\n }\n\n /** Dismisses one toast, or every typed toast (MAUI `DismissToastAsync`). */\n dismissToast(id?: number): void {\n for (const r of [...this.records]) if (id === undefined || r.entry.id === id) this.leave(r);\n }\n\n /** The action button: runs the action once (a second tap during the exit does nothing) and dismisses. */\n pressAction(id: number): void {\n const r = this.records.find((x) => x.entry.id === id);\n if (!r || r.actionRan || !r.action) return;\n r.actionRan = true;\n this.config.runAction(r.action);\n this.leave(r);\n }\n\n /** Raises the full-screen loader (reference-counted; the newest text wins) (MAUI `ShowLoadingAsync`). */\n showLoading(text = ''): void {\n this.hold({ token: this.nextId++, text, lease: false });\n }\n\n /** A lease on the loader (MAUI `BeginLoadingAsync`). */\n beginLoading(text = ''): G9LoadingLease {\n const hold = { token: this.nextId++, text, lease: true };\n this.hold(hold);\n let released = false;\n return {\n dispose: () => {\n if (released) return;\n released = true;\n this.release(hold.token);\n },\n };\n }\n\n /** Releases the newest anonymous hold; a lease's hold is never released here (MAUI `DismissLoadingAsync`). */\n dismissLoading(): void {\n const anonymous = [...this.holds].reverse().find((h) => !h.lease);\n if (anonymous) this.release(anonymous.token);\n }\n\n /** Shows (or relabels) the compact loading toast (MAUI `ShowLoadingToastAsync`); it never auto-dismisses. */\n showLoadingToast(text = '', position: G9ToastPosition | null = null): void {\n this.loadingToast = { text, position: position ?? this.config.defaultPosition() };\n this.emit();\n }\n\n dismissLoadingToast(): void {\n if (!this.loadingToast) return;\n this.loadingToast = null;\n this.emit();\n }\n\n /** Shows the progress toast, replacing an active one (MAUI `ShowProgressToastAsync`). */\n showProgress(\n title: string,\n detail: string | null = null,\n progress = 0,\n position: G9ToastPosition | null = null,\n ): void {\n this.progress = { title, detail, progress: clamp01(progress), position: position ?? this.config.defaultPosition() };\n this.emit();\n }\n\n /** Updates the progress toast; omitted parts stay (MAUI `UpdateProgressToastAsync`). No-op without one. */\n updateProgress(title?: string | null, detail?: string | null, progress?: number | null): void {\n if (!this.progress) return;\n this.progress = {\n ...this.progress,\n ...(title != null ? { title } : {}),\n ...(detail !== undefined && detail !== null ? { detail } : {}),\n ...(progress != null ? { progress: clamp01(progress) } : {}),\n };\n this.emit();\n }\n\n dismissProgress(): void {\n if (!this.progress) return;\n this.progress = null;\n this.emit();\n }\n\n /** Re-anchors every live toast to the current insets; `animate` glides (220 ms) (MAUI `RefreshBottomInsetsAsync`). */\n refreshBottomInsets(animate = true): void {\n this.insetVersion += 1;\n this.reanchorAnimated = animate;\n this.emit();\n }\n\n /** Registers (or clears with `null`) a bottom-anchored overlay the bottom stacks must sit above. */\n setBottomOverlay(key: string, heightPx: number | null): void {\n if (heightPx === null || heightPx <= 0) this.overlays.delete(key);\n else this.overlays.set(key, heightPx);\n this.emit();\n }\n\n /** Clears everything, the loader regardless of its count (MAUI `DismissAllAsync`). */\n dismissAll(): void {\n this.dismissToast();\n this.holds = [];\n this.updateLoader();\n this.loadingToast = null;\n this.progress = null;\n this.emit();\n }\n\n /** The host unmounted. */\n dispose(): void {\n this.disposed = true;\n for (const r of this.records) {\n if (r.timer !== null) this.config.clearTimer(r.timer);\n r.closed();\n }\n this.records = [];\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.holds = [];\n this.loaderStatus = null;\n this.emit();\n }\n\n private handle(record: ToastRecord): G9ToastHandle {\n return {\n id: record.entry.id,\n dismiss: () => this.leave(record),\n closed: Promise.resolve(),\n };\n }\n\n private arm(record: ToastRecord): void {\n if (record.timer !== null) this.config.clearTimer(record.timer);\n record.timer = this.config.setTimer(() => {\n record.timer = null;\n this.leave(record);\n }, record.durationMs);\n }\n\n private leave(record: ToastRecord): void {\n if (record.entry.status === 'leaving' || !this.records.includes(record)) return;\n if (record.timer !== null) this.config.clearTimer(record.timer);\n record.timer = null;\n record.entry = { ...record.entry, status: 'leaving' };\n this.emit();\n this.later(() => {\n this.records = this.records.filter((r) => r !== record);\n record.closed();\n this.emit();\n }, g9ToastTimings.exitMs);\n }\n\n private hold(hold: Hold): void {\n this.holds.push(hold);\n this.updateLoader();\n this.emit();\n }\n\n private release(token: number): void {\n this.holds = this.holds.filter((h) => h.token !== token);\n this.updateLoader();\n this.emit();\n }\n\n private updateLoader(): void {\n const top = this.holds[this.holds.length - 1];\n if (top) {\n this.loaderText = top.text;\n if (this.loaderStatus === null || this.loaderStatus === 'leaving') {\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.loaderStatus = 'entering';\n this.loaderTimer = this.config.setTimer(() => {\n this.loaderTimer = null;\n this.loaderStatus = 'shown';\n this.emit();\n }, g9ToastTimings.loaderFadeInMs);\n }\n return;\n }\n if (this.loaderStatus === null || this.loaderStatus === 'leaving') return;\n if (this.loaderTimer !== null) this.config.clearTimer(this.loaderTimer);\n this.loaderStatus = 'leaving';\n this.loaderTimer = this.config.setTimer(() => {\n this.loaderTimer = null;\n this.loaderStatus = null;\n this.emit();\n }, g9ToastTimings.loaderFadeOutMs);\n }\n\n private later(callback: () => void, ms: number): void {\n this.config.setTimer(() => {\n if (!this.disposed) callback();\n }, ms);\n }\n\n private build(): G9ToastSnapshot {\n return {\n toasts: this.records.map((r) => r.entry),\n loader: this.loaderStatus ? { text: this.loaderText, status: this.loaderStatus } : null,\n loadingToast: this.loadingToast,\n progress: this.progress,\n insetVersion: this.insetVersion,\n reanchorAnimated: this.reanchorAnimated,\n bottomOverlayHeight: [...this.overlays.values()].reduce((a, b) => a + b, 0),\n };\n }\n\n private emit(): void {\n this.snapshot = this.build();\n for (const l of this.listeners) l();\n }\n}\n\nfunction clamp01(v: number): number {\n return Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : 0;\n}\n\n/** The culture default position: bottom right in LTR, bottom left in RTL. */\nexport function resolveToastPosition(position: G9ToastPosition | null | undefined, rtl: boolean): G9ToastPosition {\n return position ?? (rtl ? 'bottomLeft' : 'bottomRight');\n}\n"],"names":["G9ToastType","G9ToastPosition","g9DefaultToastOptions","Object","g9ToastTimings","g9MaxToastsPerStack","isPlain","r","G9ToastStore","listener","message","type","options","_options_position","_options_durationMs","position","hasAction","duration","stack","newest","closed","done","Promise","record","extra","Math","id","undefined","x","text","hold","released","anonymous","h","title","detail","progress","clamp01","animate","key","heightPx","token","top","callback","ms","a","b","l","config","Map","Set","v","Number","resolveToastPosition","rtl"],"mappings":";;;;;;;;;;AAOO,MAAMA,cAAc;IACzB,aAAa;IACb,SAAS;IACT,SAAS;IACT,OAAO;AACT;AAIO,MAAMC,kBAAkB;IAC7B,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;IACb,YAAY;IACZ,cAAc;IACd,aAAa;AACf;AAkBO,MAAMC,wBAAgFC,OAAO,MAAM,CAAC;IACzG,YAAY;AACd;AAGO,MAAMC,iBAAiBD,OAAO,MAAM,CAAC;IAC1C,SAAS;IACT,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,YAAY;AACd;AAEO,MAAME,sBAAsB;AA0FnC,MAAMC,UAAU,CAACC,IAAmB,CAACA,EAAE,KAAK,CAAC,SAAS;AAG/C,MAAMC;IAoBX,cAA+B;QAC7B,OAAO,IAAI,CAAC,QAAQ;IACtB;IAEA,UAAUC,QAAoB,EAAc;QAC1C,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;QACnB,OAAO,IAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAACA;IACrC;IAMA,KAAKC,OAAe,EAAEC,OAAoB,aAAa,EAAEC,UAA0B,CAAC,CAAC,EAAiB;YACnFC,mBAEAC;QAFjB,MAAMC,WAAW,QAAAF,CAAAA,oBAAAA,QAAQ,QAAQ,AAAD,IAAfA,oBAAoB,IAAI,CAAC,MAAM,C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AAQc,CAAS;IACxB,OAAOC,OAAO,QAAQ,CAACD,KAAK1B,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAG0B,MAAM;AAC5D;AAGO,SAASE,qBAAqBtC,QAA4C,EAAEuC,GAAY;IAC7F,OAAOvC,QAAAA,WAAAA,WAAauC,MAAM,eAAe;AAC3C"}
@@ -9,40 +9,35 @@
9
9
  .g9-toast-stack {
10
10
  flex-direction: column;
11
11
  justify-content: flex-start;
12
- align-items: flex-end;
12
+ align-items: stretch;
13
13
  display: flex;
14
- position: absolute;
14
+ position: fixed;
15
15
  }
16
16
 
17
17
  .g9-toast-stack--bottom {
18
18
  flex-direction: column-reverse;
19
19
  }
20
20
 
21
- .g9-toast-stack--topLeft, .g9-toast-stack--middleLeft, .g9-toast-stack--bottomLeft {
22
- align-items: flex-start;
23
- }
24
-
25
- .g9-toast-stack--topCenter, .g9-toast-stack--middleCenter, .g9-toast-stack--bottomCenter {
26
- align-items: center;
27
- }
28
-
29
21
  .g9-toast-stack--middleLeft, .g9-toast-stack--middleCenter, .g9-toast-stack--middleRight {
30
22
  justify-content: center;
31
23
  }
32
24
 
25
+ .g9-toast--loading {
26
+ align-self: center;
27
+ }
28
+
33
29
  .g9-toast {
34
30
  border-style: solid;
35
31
  border-width: 1px;
36
32
  border-color: var(--g9-outline-variant);
37
33
  background-color: var(--g9-surface);
38
- border-radius: 14px;
34
+ border-radius: 10px;
39
35
  flex-direction: row;
40
36
  align-items: center;
41
- max-width: 420px;
42
37
  min-height: 48px;
43
38
  margin-top: 4px;
44
39
  margin-bottom: 4px;
45
- padding: 10px 14px;
40
+ padding: 12px 14px;
46
41
  display: flex;
47
42
  position: relative;
48
43
  overflow: hidden;
@@ -63,9 +58,21 @@
63
58
  font-size: 12px;
64
59
  }
65
60
 
61
+ .g9-toast__countdown {
62
+ border-radius: 10px;
63
+ position: absolute;
64
+ top: 0;
65
+ bottom: 0;
66
+ left: 0;
67
+ right: 0;
68
+ }
69
+
66
70
  .g9-toast__action {
71
+ border-radius: 6px;
67
72
  align-items: center;
68
73
  height: 32px;
74
+ margin-left: 10px;
75
+ margin-right: 10px;
69
76
  padding-left: 8px;
70
77
  padding-right: 8px;
71
78
  display: flex;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/toast/toast.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAEA;EACE,sBAAsB;EACtB,2BAA2B;EAC3B,qBAAqB;EACrB,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,8BAA8B;AAChC;;AAEA;EACE,uBAAuB;AACzB;;AAIA;EADE,mBAAmB;AACrB;;AAMA;EAHE,uBAAuB;AACzB;;AAQA;EALE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,mCAAmC;EACnC,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,kBAAkB;EAClB,kBAAkB;EAClB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAQA;EALE,2BAA2B;EAC3B,cAAc;EACd,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;AACjB;;AAQA;EALE,+BAA+B;EAC/B,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;AACjB;;AAQA;EALE,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAQA;EALE,eAAe;EACf,gBAAgB;AAClB;;AAQA;EALE,gBAAgB;AAClB;;AAQA;EALE,mCAAmC;EACnC,YAAY;EACZ,0BAA0B;EAC1B,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAQA;EALE,6CAA6C;EAC7C,mBAAmB;EACnB,gBAAgB;AAClB;;AAQA;EALE,qCAAqC;EACrC,eAAe;EACf,gBAAgB;AAClB;;AAQA;EALE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,iCAAiC;EACjC,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAQA;EALE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,2CAA2C;EAC3C,mBAAmB;EACnB,sBAAsB;EACtB,mBAAmB;EACnB,kBAAkB;EAClB,aAAa;AACf;;AAQA;EALE,kBAAkB;EAClB,mCAAmC;EACnC,gBAAgB;EAChB,eAAe;AACjB","sourcesContent":[".g9-toast-layer {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-toast-stack {\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: flex-start;\n}\n\n.g9-toast-stack--bottom {\n flex-direction: column-reverse;\n}\n\n.g9-toast-stack--topLeft,\n.g9-toast-stack--middleLeft,\n.g9-toast-stack--bottomLeft {\n align-items: flex-start;\n}\n\n.g9-toast-stack--topCenter,\n.g9-toast-stack--middleCenter,\n.g9-toast-stack--bottomCenter {\n align-items: center;\n}\n\n.g9-toast-stack--middleLeft,\n.g9-toast-stack--middleCenter,\n.g9-toast-stack--middleRight {\n justify-content: center;\n}\n\n.g9-toast {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n max-width: 420px;\n padding: 10px 14px;\n margin-top: 4px;\n margin-bottom: 4px;\n border-radius: 14px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n overflow: hidden;\n position: relative;\n}\n\n.g9-toast__message {\n flex-shrink: 1;\n font-size: 14px;\n color: var(--g9-on-surface);\n margin-left: 10px;\n margin-right: 10px;\n}\n\n.g9-toast__detail {\n font-size: 12px;\n color: var(--g9-text-secondary);\n margin-left: 10px;\n margin-right: 10px;\n}\n\n.g9-toast__action {\n height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n display: flex;\n align-items: center;\n}\n\n.g9-toast__action-text {\n font-size: 14px;\n font-weight: 700;\n}\n\n.g9-toast--progress {\n min-width: 240px;\n}\n\n.g9-toast__fill {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n background-color: var(--g9-primary);\n opacity: 0.34;\n transition: transform 250ms;\n}\n\n.g9-toast__progress-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.g9-toast__pill {\n padding: 2px 8px;\n border-radius: 10px;\n background-color: var(--g9-primary-container);\n}\n\n.g9-toast__pill-text {\n font-size: 12px;\n font-weight: 700;\n color: var(--g9-on-primary-container);\n}\n\n.g9-loader {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-loader__scrim {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: var(--g9-scrim);\n}\n\n.g9-loader__card {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 20px 24px;\n border-radius: 14px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-loader__text {\n margin-top: 12px;\n font-size: 14px;\n text-align: center;\n color: var(--g9-inverse-on-surface);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/toast/toast.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAMA;EAHE,sBAAsB;EACtB,2BAA2B;EAC3B,oBAAoB;EACpB,aAAa;EACb,eAAe;AACjB;;AAMA;EAHE,8BAA8B;AAChC;;AAMA;EAHE,uBAAuB;AACzB;;AAQA;EALE,kBAAkB;AACpB;;AASA;EANE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,mCAA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EAChB,eAAe;AACjB","sourcesContent":[".g9-toast-layer {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n/* Fixed (like .g9-popup): a stack exists only while it holds toasts, so it is created after any open sheet — lynx-ui's\n `position: fixed` SheetView — and lands above it instead of under it. Every stack spans the width between the edge\n margins and its toasts FILL it (MAUI ApplyInlineG9ToastPosition: HorizontalOptions = Fill; the position only picks\n top / middle / bottom). The compact loading toast stays centred (MAUI: Center). */\n.g9-toast-stack {\n position: fixed;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n}\n\n.g9-toast-stack--bottom {\n flex-direction: column-reverse;\n}\n\n.g9-toast-stack--middleLeft,\n.g9-toast-stack--middleCenter,\n.g9-toast-stack--middleRight {\n justify-content: center;\n}\n\n.g9-toast--loading {\n align-self: center;\n}\n\n/* MAUI G9ToastHelper.BuildInlineToastView: radius 10, padding 14 / 12, filled with the type's colour (inline style). */\n.g9-toast {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 48px;\n padding: 12px 14px;\n margin-top: 4px;\n margin-bottom: 4px;\n border-radius: 10px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n overflow: hidden;\n position: relative;\n}\n\n.g9-toast__message {\n flex-shrink: 1;\n font-size: 14px;\n color: var(--g9-on-surface);\n margin-left: 10px;\n margin-right: 10px;\n}\n\n.g9-toast__detail {\n font-size: 12px;\n color: var(--g9-text-secondary);\n margin-left: 10px;\n margin-right: 10px;\n}\n\n/* The lifetime countdown (MAUI's fill layer): grows from the reading start, behind the content. */\n.g9-toast__countdown {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n border-radius: 10px;\n}\n\n.g9-toast__action {\n border-radius: 6px;\n margin-left: 10px;\n margin-right: 10px;\n height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n display: flex;\n align-items: center;\n}\n\n.g9-toast__action-text {\n font-size: 14px;\n font-weight: 700;\n}\n\n.g9-toast--progress {\n min-width: 240px;\n}\n\n.g9-toast__fill {\n position: absolute;\n top: 0px;\n bottom: 0px;\n left: 0px;\n right: 0px;\n background-color: var(--g9-primary);\n opacity: 0.34;\n transition: transform 250ms;\n}\n\n.g9-toast__progress-text {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n.g9-toast__pill {\n padding: 2px 8px;\n border-radius: 10px;\n background-color: var(--g9-primary-container);\n}\n\n.g9-toast__pill-text {\n font-size: 12px;\n font-weight: 700;\n color: var(--g9-on-primary-container);\n}\n\n.g9-loader {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-loader__scrim {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n background-color: var(--g9-scrim);\n}\n\n.g9-loader__card {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 20px 24px;\n border-radius: 14px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-inverse-surface);\n}\n\n.g9-loader__text {\n margin-top: 12px;\n font-size: 14px;\n text-align: center;\n color: var(--g9-inverse-on-surface);\n}\n"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/toggle/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAe,KAAK,eAAe,EAA0B,MAAM,+BAA+B,CAAC;AAG1G,OAAO,EAAE,KAAK,kBAAkB,EAAyC,MAAM,iBAAiB,CAAC;AAOjG,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;EAO5B,CAAC;AAEH,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IA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AAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,gGAAgG;IAChG,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,8GAwHrB,CAAC"}
@@ -129,7 +129,7 @@ const checkbox_G9CheckBox = forwardRef(function(props, ref) {
129
129
  const reserve = false !== props.reserveTouchTarget;
130
130
  const text1 = props.text && '' !== props.text.trim() ? props.text : null;
131
131
  const state = indeterminate ? strings.get(G9StringKey.PartiallyChecked) : checked ? strings.get(G9StringKey.Checked) : strings.get(G9StringKey.NotChecked);
132
- return <view className={`${control.className}${text1 ? ' g9-checkbox--labelled' : ''}`} style={g9RowStyle(control.direction)} accessibility-element={true} accessibility-traits="button" accessibility-value={state} {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : text1) ? {
132
+ return <view className={`${control.className}${text1 ? ' g9-checkbox--labelled' : ''}`} {...control.idProps} style={g9RowStyle(control.direction)} accessibility-element={true} accessibility-traits="button" accessibility-value={state} {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : text1) ? {
133
133
  'accessibility-label': null != (_ref = null != (_props_accessibilityLabel1 = props.accessibilityLabel) ? _props_accessibilityLabel1 : text1) ? _ref : ''
134
134
  } : {}} bindtap={press}>
135
135
  <view className={`g9-checkbox__slot${reserve ? ' g9-checkbox__slot--reserve' : ''}`} style={{