@g9tm/lynxcontrols 1.4.7 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/anchor/context.d.ts +15 -0
  3. package/dist/anchor/context.d.ts.map +1 -0
  4. package/dist/anchor/context.jsx +10 -0
  5. package/dist/anchor/context.jsx.map +1 -0
  6. package/dist/anchor/hooks.d.ts +72 -0
  7. package/dist/anchor/hooks.d.ts.map +1 -0
  8. package/dist/anchor/hooks.jsx +147 -0
  9. package/dist/anchor/hooks.jsx.map +1 -0
  10. package/dist/anchor/index.d.ts +6 -0
  11. package/dist/anchor/index.d.ts.map +1 -0
  12. package/dist/anchor/index.jsx +5 -0
  13. package/dist/anchor/measure.d.ts +22 -0
  14. package/dist/anchor/measure.d.ts.map +1 -0
  15. package/dist/anchor/measure.jsx +110 -0
  16. package/dist/anchor/measure.jsx.map +1 -0
  17. package/dist/anchor/registry.d.ts +108 -0
  18. package/dist/anchor/registry.d.ts.map +1 -0
  19. package/dist/anchor/registry.jsx +142 -0
  20. package/dist/anchor/registry.jsx.map +1 -0
  21. package/dist/anchor/scroll.d.ts +34 -0
  22. package/dist/anchor/scroll.d.ts.map +1 -0
  23. package/dist/anchor/scroll.jsx +255 -0
  24. package/dist/anchor/scroll.jsx.map +1 -0
  25. package/dist/base/control.d.ts +10 -3
  26. package/dist/base/control.d.ts.map +1 -1
  27. package/dist/base/control.jsx +17 -2
  28. package/dist/base/control.jsx.map +1 -1
  29. package/dist/base/index.d.ts +1 -1
  30. package/dist/base/index.d.ts.map +1 -1
  31. package/dist/base/index.jsx +1 -1
  32. package/dist/base/pressable.d.ts.map +1 -1
  33. package/dist/base/pressable.jsx +7 -1
  34. package/dist/base/pressable.jsx.map +1 -1
  35. package/dist/base/selection-item.d.ts +9 -1
  36. package/dist/base/selection-item.d.ts.map +1 -1
  37. package/dist/base/selection-item.jsx +10 -1
  38. package/dist/base/selection-item.jsx.map +1 -1
  39. package/dist/button/button.css +20 -0
  40. package/dist/button/button.css.map +1 -1
  41. package/dist/button/button.d.ts.map +1 -1
  42. package/dist/button/button.jsx +11 -1
  43. package/dist/button/button.jsx.map +1 -1
  44. package/dist/button/header-action-button.d.ts +5 -0
  45. package/dist/button/header-action-button.d.ts.map +1 -1
  46. package/dist/button/header-action-button.jsx +16 -2
  47. package/dist/button/header-action-button.jsx.map +1 -1
  48. package/dist/button/icon-button.d.ts.map +1 -1
  49. package/dist/button/icon-button.jsx +11 -1
  50. package/dist/button/icon-button.jsx.map +1 -1
  51. package/dist/button/nav-card.d.ts.map +1 -1
  52. package/dist/button/nav-card.jsx +10 -1
  53. package/dist/button/nav-card.jsx.map +1 -1
  54. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  55. package/dist/button/vertical-icon-text-button.jsx +10 -1
  56. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  57. package/dist/button/visuals.d.ts.map +1 -1
  58. package/dist/button/visuals.jsx +1 -1
  59. package/dist/button/visuals.jsx.map +1 -1
  60. package/dist/expander/expander.d.ts.map +1 -1
  61. package/dist/expander/expander.jsx +14 -1
  62. package/dist/expander/expander.jsx.map +1 -1
  63. package/dist/fields/editor.d.ts.map +1 -1
  64. package/dist/fields/editor.jsx +18 -2
  65. package/dist/fields/editor.jsx.map +1 -1
  66. package/dist/fields/fields.css +21 -0
  67. package/dist/fields/fields.css.map +1 -1
  68. package/dist/fields/index.d.ts +1 -1
  69. package/dist/fields/index.d.ts.map +1 -1
  70. package/dist/fields/index.jsx +1 -1
  71. package/dist/fields/outlined-field.d.ts +33 -1
  72. package/dist/fields/outlined-field.d.ts.map +1 -1
  73. package/dist/fields/outlined-field.jsx +43 -5
  74. package/dist/fields/outlined-field.jsx.map +1 -1
  75. package/dist/fields/text-entry.d.ts.map +1 -1
  76. package/dist/fields/text-entry.jsx +18 -2
  77. package/dist/fields/text-entry.jsx.map +1 -1
  78. package/dist/guide/guide.css +453 -0
  79. package/dist/guide/guide.css.map +1 -0
  80. package/dist/guide/index.d.ts +5 -0
  81. package/dist/guide/index.d.ts.map +1 -0
  82. package/dist/guide/index.jsx +4 -0
  83. package/dist/guide/journey.d.ts +46 -0
  84. package/dist/guide/journey.d.ts.map +1 -0
  85. package/dist/guide/journey.jsx +464 -0
  86. package/dist/guide/journey.jsx.map +1 -0
  87. package/dist/guide/placement.d.ts +44 -0
  88. package/dist/guide/placement.d.ts.map +1 -0
  89. package/dist/guide/placement.jsx +119 -0
  90. package/dist/guide/placement.jsx.map +1 -0
  91. package/dist/guide/service.d.ts +85 -0
  92. package/dist/guide/service.d.ts.map +1 -0
  93. package/dist/guide/service.jsx +620 -0
  94. package/dist/guide/service.jsx.map +1 -0
  95. package/dist/guide/settings.d.ts +50 -0
  96. package/dist/guide/settings.d.ts.map +1 -0
  97. package/dist/guide/settings.jsx +60 -0
  98. package/dist/guide/settings.jsx.map +1 -0
  99. package/dist/host/host.d.ts +5 -1
  100. package/dist/host/host.d.ts.map +1 -1
  101. package/dist/host/host.jsx +12 -0
  102. package/dist/host/host.jsx.map +1 -1
  103. package/dist/host/layers.d.ts +3 -1
  104. package/dist/host/layers.d.ts.map +1 -1
  105. package/dist/host/layers.jsx +4 -2
  106. package/dist/host/layers.jsx.map +1 -1
  107. package/dist/host/registry.d.ts +3 -0
  108. package/dist/host/registry.d.ts.map +1 -1
  109. package/dist/host/registry.jsx.map +1 -1
  110. package/dist/index.d.ts +3 -0
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/pickers/combo-box.d.ts +8 -0
  113. package/dist/pickers/combo-box.d.ts.map +1 -1
  114. package/dist/pickers/combo-box.jsx +51 -9
  115. package/dist/pickers/combo-box.jsx.map +1 -1
  116. package/dist/pickers/date-time-picker.d.ts +2 -2
  117. package/dist/pickers/date-time-picker.d.ts.map +1 -1
  118. package/dist/pickers/date-time-picker.jsx +4 -3
  119. package/dist/pickers/date-time-picker.jsx.map +1 -1
  120. package/dist/pickers/date-time.d.ts +5 -2
  121. package/dist/pickers/date-time.d.ts.map +1 -1
  122. package/dist/pickers/date-time.jsx +1 -1
  123. package/dist/pickers/date-time.jsx.map +1 -1
  124. package/dist/pickers/picker-sheet.d.ts +6 -2
  125. package/dist/pickers/picker-sheet.d.ts.map +1 -1
  126. package/dist/pickers/picker-sheet.jsx +2 -3
  127. package/dist/pickers/picker-sheet.jsx.map +1 -1
  128. package/dist/pickers/picker.d.ts.map +1 -1
  129. package/dist/pickers/picker.jsx +3 -2
  130. package/dist/pickers/picker.jsx.map +1 -1
  131. package/dist/pickers/pickers.css +27 -0
  132. package/dist/pickers/pickers.css.map +1 -1
  133. package/dist/pickers/timespan-picker.d.ts.map +1 -1
  134. package/dist/pickers/timespan-picker.jsx +3 -2
  135. package/dist/pickers/timespan-picker.jsx.map +1 -1
  136. package/dist/pickers/trigger.d.ts +3 -1
  137. package/dist/pickers/trigger.d.ts.map +1 -1
  138. package/dist/pickers/trigger.jsx +6 -1
  139. package/dist/pickers/trigger.jsx.map +1 -1
  140. package/dist/provider/contexts.d.ts +3 -0
  141. package/dist/provider/contexts.d.ts.map +1 -1
  142. package/dist/provider/contexts.jsx.map +1 -1
  143. package/dist/provider/provider.d.ts.map +1 -1
  144. package/dist/provider/provider.jsx +24 -17
  145. package/dist/provider/provider.jsx.map +1 -1
  146. package/dist/provider/settings.d.ts +16 -0
  147. package/dist/provider/settings.d.ts.map +1 -1
  148. package/dist/provider/settings.jsx +7 -3
  149. package/dist/provider/settings.jsx.map +1 -1
  150. package/dist/provider/theme.css +4 -0
  151. package/dist/provider/theme.css.map +1 -1
  152. package/dist/range-slider/math.d.ts +14 -4
  153. package/dist/range-slider/math.d.ts.map +1 -1
  154. package/dist/range-slider/math.jsx +16 -4
  155. package/dist/range-slider/math.jsx.map +1 -1
  156. package/dist/range-slider/range-slider.css +17 -0
  157. package/dist/range-slider/range-slider.css.map +1 -1
  158. package/dist/range-slider/range-slider.d.ts +11 -0
  159. package/dist/range-slider/range-slider.d.ts.map +1 -1
  160. package/dist/range-slider/range-slider.jsx +35 -13
  161. package/dist/range-slider/range-slider.jsx.map +1 -1
  162. package/dist/route/hooks.d.ts +34 -0
  163. package/dist/route/hooks.d.ts.map +1 -0
  164. package/dist/route/hooks.jsx +147 -0
  165. package/dist/route/hooks.jsx.map +1 -0
  166. package/dist/route/index.d.ts +3 -0
  167. package/dist/route/index.d.ts.map +1 -0
  168. package/dist/route/index.jsx +2 -0
  169. package/dist/route/router.d.ts +201 -0
  170. package/dist/route/router.d.ts.map +1 -0
  171. package/dist/route/router.jsx +810 -0
  172. package/dist/route/router.jsx.map +1 -0
  173. package/dist/selection/index.d.ts +2 -1
  174. package/dist/selection/index.d.ts.map +1 -1
  175. package/dist/selection/index.jsx +2 -1
  176. package/dist/selection/selection-sheet.d.ts +3 -1
  177. package/dist/selection/selection-sheet.d.ts.map +1 -1
  178. package/dist/selection/selection-sheet.jsx +57 -8
  179. package/dist/selection/selection-sheet.jsx.map +1 -1
  180. package/dist/selection/selection.css +7 -0
  181. package/dist/selection/selection.css.map +1 -1
  182. package/dist/selection/window.d.ts +29 -0
  183. package/dist/selection/window.d.ts.map +1 -0
  184. package/dist/selection/window.jsx +24 -0
  185. package/dist/selection/window.jsx.map +1 -0
  186. package/dist/sheet/frame.d.ts +3 -1
  187. package/dist/sheet/frame.d.ts.map +1 -1
  188. package/dist/sheet/frame.jsx +72 -26
  189. package/dist/sheet/frame.jsx.map +1 -1
  190. package/dist/sheet/header.d.ts.map +1 -1
  191. package/dist/sheet/header.jsx +3 -1
  192. package/dist/sheet/header.jsx.map +1 -1
  193. package/dist/sheet/index.d.ts +1 -1
  194. package/dist/sheet/index.d.ts.map +1 -1
  195. package/dist/sheet/index.jsx +1 -1
  196. package/dist/sheet/options.d.ts +30 -0
  197. package/dist/sheet/options.d.ts.map +1 -1
  198. package/dist/sheet/options.jsx +2 -1
  199. package/dist/sheet/options.jsx.map +1 -1
  200. package/dist/sheet/service.d.ts +13 -0
  201. package/dist/sheet/service.d.ts.map +1 -1
  202. package/dist/sheet/service.jsx +27 -4
  203. package/dist/sheet/service.jsx.map +1 -1
  204. package/dist/sheet/sheet.css +9 -0
  205. package/dist/sheet/sheet.css.map +1 -1
  206. package/dist/sheet/sizing.d.ts +2 -0
  207. package/dist/sheet/sizing.d.ts.map +1 -1
  208. package/dist/sheet/sizing.jsx +2 -1
  209. package/dist/sheet/sizing.jsx.map +1 -1
  210. package/dist/tabs/tab-view.d.ts +14 -0
  211. package/dist/tabs/tab-view.d.ts.map +1 -1
  212. package/dist/tabs/tab-view.jsx +59 -3
  213. package/dist/tabs/tab-view.jsx.map +1 -1
  214. package/dist/toggle/checkbox.d.ts.map +1 -1
  215. package/dist/toggle/checkbox.jsx +15 -1
  216. package/dist/toggle/checkbox.jsx.map +1 -1
  217. package/dist/toggle/chip-group.d.ts +9 -1
  218. package/dist/toggle/chip-group.d.ts.map +1 -1
  219. package/dist/toggle/chip-group.jsx +63 -13
  220. package/dist/toggle/chip-group.jsx.map +1 -1
  221. package/dist/toggle/switch.d.ts +1 -1
  222. package/dist/toggle/switch.d.ts.map +1 -1
  223. package/dist/toggle/switch.jsx +18 -3
  224. package/dist/toggle/switch.jsx.map +1 -1
  225. package/dist/toggle/toggle.css +20 -0
  226. package/dist/toggle/toggle.css.map +1 -1
  227. package/package.json +17 -2
@@ -1 +1 @@
1
- {"version":3,"file":"sheet/sizing.jsx","sources":["../../src/sheet/sizing.ts"],"sourcesContent":["import type { G9SheetDetent, G9SheetOptions } from './options';\n\n// Pure sizing rules of the G9 sheet (MAUI G9SheetView + G9BottomSheetHelper sizing; guide 650–980, ADR-0019/0026).\n\n/** MAUI `G9SheetView.MinimizedHeight`: default peek height. */\nexport const g9SheetDefaultPeekHeight = 100;\n/** Absolute minimum of an authoritative fit height (MAUI helper :81). */\nexport const g9SheetFitMinHeight = 80;\n/** Floor while the height is unknown (loading window). */\nexport const g9SheetFitLoadingMinHeight = 180;\n/** Finger travel at release that requests a close (MAUI `DragCloseThreshold`). */\nexport const g9SheetDragCloseThreshold = 72;\n/**\n * Gap between the top safe-area inset and a full-screen sheet's header. MAUI reserves the inset alone\n * (`ResolveFullScreenSheetTopPadding`), but its Android inset is the status-bar band, a few dp below the cutout an\n * immersive Lynx host reports: measured side by side on a Pixel 9 Pro XL (2026-10-10), MAUI's header sat 3 dp lower.\n * (It was 8, which put every full-screen header 5 dp below MAUI's.)\n */\nexport const g9SheetTopSafeAreaBaseGap = 3;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\n\n/** The platform the app runs on (Lynx `SystemInfo.platform`), lower-cased; `'unknown'` outside Lynx. */\nexport function currentPlatform(): 'android' | 'ios' | 'windows' | 'macos' | 'unknown' {\n const info = (globalThis as { SystemInfo?: { platform?: string } }).SystemInfo;\n const p = (info?.platform ?? '').toLowerCase();\n if (p === 'android') return 'android';\n if (p === 'ios') return 'ios';\n if (p.startsWith('win')) return 'windows';\n if (p === 'macos' || p === 'mac' || p === 'osx') return 'macos';\n return 'unknown';\n}\n\n/** What the adapter passes to lynx-ui `SheetRoot` and how the frame behaves. */\nexport interface G9SheetLayout {\n /** lynx-ui snap points, small to large: pixels, `'NN%'` of the host, or `'fit'`. */\n readonly snapPoints: Array<number | string>;\n readonly initialSnap: number;\n /** One detent, or fit-to-content (MAUI \"fixed\"): no grabber, no detent dragging. */\n readonly fixed: boolean;\n readonly fit: boolean;\n /** Grabber visible (`hasHandle && isDraggable && (!fixed || handleOnSingleDetent)`). */\n readonly showHandle: boolean;\n readonly dragDisabled: boolean;\n /** Drag past the lowest detent may request a close. */\n readonly enableDragToClose: boolean;\n /** Backdrop tap requests a close. */\n readonly closeOnOverlayTap: boolean;\n /** The resting body cap for a fit sheet (`maxFitToContentHeightRatio × host`), else `null`. */\n readonly fitMaxHeight: number | null;\n /** Whether the sheet's largest detent is full screen. */\n readonly fullScreen: boolean;\n /**\n * The body fills the surface, so the footer rests at the sheet's bottom edge: a full-screen sheet, or one fixed detent\n * (`states: ['large']` with `fullExpandedRatio: 0.9`) — its surface has a definite height. A sheet that can move between\n * detents or fits its content keeps a body as tall as the content.\n */\n readonly fillBody: boolean;\n}\n\nconst pct = (ratio: number) => `${Math.round(ratio * 10000) / 100}%`;\n\n/**\n * Maps G9 options to a lynx-ui layout (the agreed mapping of MAUI `ApplyOptions`): fit → `['fit']` capped at\n * `maxFitToContentHeightRatio`; states → peek pixels / half ratio / full ratio for the allowed detents, the initial\n * detent from `currentState`. The MAUI quirks (a hidden 100 dp detent under `[medium, large]`, a peek-only sheet that\n * may expand) are not carried over: the detents are exactly `states` (docs/sheets.md \"deliberate differences\").\n */\nexport function resolveSheetLayout(\n options: G9SheetOptions,\n hostHeight: number,\n platform = currentPlatform(),\n): G9SheetLayout {\n const fit = options.sizeMode === 'fitToContent';\n const draggable = options.isDraggable !== false;\n const cancelable = options.isCancelable !== false;\n const intercepted = options.onBackRequested != null;\n if (fit) {\n const ratio = clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1);\n return {\n snapPoints: ['fit'],\n initialSnap: 0,\n fixed: true,\n fit: true,\n showHandle: false,\n dragDisabled: true,\n enableDragToClose: false,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: Math.max(g9SheetFitMinHeight, Math.floor(hostHeight * ratio)),\n fullScreen: false,\n fillBody: false,\n };\n }\n const order: G9SheetDetent[] = ['peek', 'medium', 'large'];\n const requested = options.states && options.states.length > 0 ? options.states : ['medium', 'large'];\n const states = order.filter((d) => requested.includes(d));\n const androidHalf = platform === 'android' ? options.androidHalfExpandedRatio : null;\n const half = clamp(androidHalf ?? options.halfExpandedRatio ?? 0.5, 0.1, 0.9);\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const peek = Math.max(1, options.collapsedHeight ?? options.peekHeight ?? g9SheetDefaultPeekHeight);\n const snap = (d: G9SheetDetent): number | string =>\n d === 'peek' ? Math.min(peek, Math.max(1, hostHeight)) : d === 'medium' ? pct(half) : pct(full);\n const snapPoints = states.map(snap);\n if (options.expandedFitsContent && snapPoints.length > 0) snapPoints[snapPoints.length - 1] = 'fit';\n const current = options.currentState ?? 'medium';\n const index = states.indexOf(current);\n const fixed = states.length <= 1;\n return {\n snapPoints,\n initialSnap: index >= 0 ? index : 0,\n fixed,\n fit: false,\n showHandle: options.hasHandle !== false && draggable && (!fixed || options.handleOnSingleDetent === true),\n dragDisabled: !draggable || intercepted,\n enableDragToClose: cancelable && draggable && !intercepted,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: options.expandedFitsContent\n ? Math.max(\n g9SheetFitMinHeight,\n Math.floor(hostHeight * clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1)),\n )\n : null,\n // One 'large' detent sized to its content is not full screen (no status-bar padding above a short sheet).\n fullScreen: states.length === 1 && states[0] === 'large' && full >= 1 && options.expandedFitsContent !== true,\n fillBody: fixed && !options.expandedFitsContent,\n };\n}\n\n/** Clamps a measured fit body height: `[80, cap]`, or `[180, cap]` while loading (MAUI fit engine). */\nexport function clampFitHeight(natural: number, cap: number, loading: boolean): number {\n const min = loading ? g9SheetFitLoadingMinHeight : g9SheetFitMinHeight;\n if (!(natural > 0)) return Math.min(min, cap);\n return clamp(natural, Math.min(min, cap), cap);\n}\n\n/**\n * Scrim opacity for a visible ratio (MAUI helper overlay rule): between the smallest and the largest detent it runs\n * from `min` to `max`; a single detent uses `max`; below the smallest detent it fades with the ratio.\n */\nexport function sheetOverlayOpacity(\n visibleRatio: number,\n detentRatios: ReadonlyArray<number>,\n min: number,\n max: number,\n): number {\n if (detentRatios.length === 0) return max;\n const lo = Math.min(...detentRatios);\n const hi = Math.max(...detentRatios);\n if (visibleRatio < lo) return (detentRatios.length === 1 ? max : min) * clamp(visibleRatio / lo, 0, 1);\n if (hi === lo) return max;\n return min + (max - min) * clamp((visibleRatio - lo) / (hi - lo), 0, 1);\n}\n\n/** The page recede behind a tall primary sheet (MAUI backdrop card): scale 1 → 0.93, translateY 0 → 12. */\nexport function backdropCardTransform(visibleRatio: number, threshold = 0.75): { scale: number; translateY: number } {\n const raw = clamp((visibleRatio - threshold) / Math.max(1e-6, 1 - threshold), 0, 1);\n const progress = raw <= 0 ? 0 : 1 - (1 - raw) ** (1 / 3);\n return { scale: 1 - 0.07 * progress, translateY: 12 * progress };\n}\n\n/**\n * The visible share of the host a detent sheet covers: its resting height when known, else its opening detent\n * (peek = peek height, medium = half ratio, large = full ratio; `expandedFitsContent` large counts as the fit cap).\n */\nexport function sheetVisibleRatio(\n options: G9SheetOptions,\n hostHeight: number,\n restingHeightPx: number | null,\n platform = currentPlatform(),\n): number {\n const host = Math.max(1, hostHeight);\n if (restingHeightPx != null) return clamp(restingHeightPx / host, 0, 1);\n const layout = resolveSheetLayout(options, host, platform);\n const point = layout.snapPoints[layout.initialSnap];\n if (typeof point === 'number') return clamp(point / host, 0, 1);\n if (point === 'fit' || point === undefined) return (layout.fitMaxHeight ?? 0) / host;\n return clamp(Number.parseFloat(point) / 100, 0, 1);\n}\n\n/** How far a receded parent sheet sinks: `max(24, visible × 0.25)` (MAUI stack recede). */\nexport function parentRecedeOffset(visibleHeight: number): number {\n return Math.max(24, visibleHeight * 0.25);\n}\n\n/** Top padding of a full-screen sheet (MAUI safe-area rule). */\nexport function sheetTopPadding(options: G9SheetOptions, topInset: number): number {\n if (options.topSafeAreaPaddingOverride != null) return Math.max(0, options.topSafeAreaPaddingOverride);\n const inset = options.useTopSafeAreaPadding === false ? 0 : Math.max(0, topInset);\n return inset + g9SheetTopSafeAreaBaseGap + Math.max(0, options.additionalTopSafeAreaPadding ?? 0);\n}\n\n/**\n * Top padding of the sheet surface where it rests. A full-screen sheet always reserves {@link sheetTopPadding}. A\n * detent sheet resting at its `large` detent reserves it too when that detent reaches under the top inset (MAUI\n * state-aware top padding, `G9BottomSheetHelper.ApplyStateAwareTopPadding`): its content never sits under the status\n * bar or the camera cutout. Opted out like MAUI: `useTopSafeAreaPadding: false` with no additional/override padding.\n */\nexport function sheetSurfaceTopPadding(\n options: G9SheetOptions,\n layout: Pick<G9SheetLayout, 'fullScreen' | 'fit'>,\n resting: G9SheetDetent | 'fit',\n topInset: number,\n hostHeight: number,\n): number {\n if (layout.fullScreen) return sheetTopPadding(options, topInset);\n if (layout.fit || resting !== 'large') return 0;\n const opted =\n options.useTopSafeAreaPadding !== false ||\n (options.additionalTopSafeAreaPadding ?? 0) > 0 ||\n (options.topSafeAreaPaddingOverride ?? 0) > 0;\n if (!opted) return 0;\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const top = Math.max(0, hostHeight) * (1 - full);\n return top < Math.max(0, topInset) + g9SheetTopSafeAreaBaseGap ? sheetTopPadding(options, topInset) : 0;\n}\n\n/**\n * Bottom padding of the sheet surface: the host's bottom safe inset (a visible navigation bar or gesture handle), so\n * the last row and the footer stay above it. `useBottomSafeAreaPadding: false` lets content run under it. An\n * immersive host (system bars hidden, as the AgriPad MAUI app) reports 0 and nothing changes.\n */\nexport function sheetSurfaceBottomPadding(options: G9SheetOptions, bottomInset: number): number {\n return options.useBottomSafeAreaPadding === false ? 0 : Math.max(0, bottomInset);\n}\n\n/**\n * Size-scaled animation duration (MAUI `SizeScaledAnimationDuration`): a partial traversal takes the matching slice\n * of the full duration (at least 1 ms unless the duration is 0).\n */\nexport function scaledSheetDuration(durationMs: number, traversedRatio: number, sizeScaled: boolean): number {\n if (durationMs <= 0) return 0;\n if (!sizeScaled) return durationMs;\n return Math.max(1, Math.round(durationMs * clamp(traversedRatio, 0, 1)));\n}\n\n/** Platform size constraints of the sheet surface (MAUI Android/Windows options, applied where they belong). */\nexport function platformSheetConstraints(\n options: G9SheetOptions,\n platform = currentPlatform(),\n): Record<string, string> {\n const px = (n: number) => `${n}px`;\n const style: Record<string, string> = {};\n if (platform === 'android') {\n if (options.androidMaxWidth != null) style.maxWidth = px(options.androidMaxWidth);\n if (options.androidMaxHeight != null) style.maxHeight = px(options.androidMaxHeight);\n if (options.androidMargin) {\n const [l, t, r, b] = options.androidMargin;\n style.margin = `${t}px ${r}px ${b}px ${l}px`;\n }\n }\n if (platform === 'windows') {\n if (options.windowsMaxWidth != null) style.maxWidth = px(options.windowsMaxWidth);\n if (options.windowsMaxHeight != null) style.maxHeight = px(options.windowsMaxHeight);\n if (options.windowsMinWidth != null) style.minWidth = px(options.windowsMinWidth);\n if (options.windowsMinHeight != null) style.minHeight = px(options.windowsMinHeight);\n }\n if (options.contentWidthMode === 'custom') {\n style.width = px(options.contentWidth ?? 300);\n style.alignSelf = 'center';\n }\n return style;\n}\n"],"names":["g9SheetDefaultPeekHeight","g9SheetFitMinHeight","g9SheetFitLoadingMinHeight","g9SheetDragCloseThreshold","g9SheetTopSafeAreaBaseGap","clamp","v","lo","hi","Math","currentPlatform","info","globalThis","p","pct","ratio","resolveSheetLayout","options","hostHeight","platform","_ref","_options_fullExpandedRatio","_ref1","_options_currentState","_options_maxFitToContentHeightRatio","fit","draggable","cancelable","intercepted","_options_maxFitToContentHeightRatio1","order","requested","states","d","androidHalf","half","full","peek","snap","snapPoints","current","index","fixed","clampFitHeight","natural","cap","loading","min","sheetOverlayOpacity","visibleRatio","detentRatios","max","backdropCardTransform","threshold","raw","progress","sheetVisibleRatio","restingHeightPx","_layout_fitMaxHeight","host","layout","point","undefined","Number","parentRecedeOffset","visibleHeight","sheetTopPadding","topInset","_options_additionalTopSafeAreaPadding","inset","sheetSurfaceTopPadding","resting","_options_topSafeAreaPaddingOverride","opted","top","sheetSurfaceBottomPadding","bottomInset","scaledSheetDuration","durationMs","traversedRatio","sizeScaled","platformSheetConstraints","px","n","style","l","t","r","b","_options_contentWidth"],"mappings":"AAKO,MAAMA,2BAA2B;AAEjC,MAAMC,sBAAsB;AAE5B,MAAMC,6BAA6B;AAEnC,MAAMC,4BAA4B;AAOlC,MAAMC,4BAA4B;AAEzC,MAAMC,QAAQ,CAACC,GAAWC,IAAYC,KAAeC,KAAK,GAAG,CAACD,IAAIC,KAAK,GAAG,CAACF,IAAID;AAGxE,SAASI;;I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"],"sourcesContent":["import type { G9SheetDetent, G9SheetOptions } from './options';\n\n// Pure sizing rules of the G9 sheet (MAUI G9SheetView + G9BottomSheetHelper sizing; guide 650–980, ADR-0019/0026).\n\n/** MAUI `G9SheetView.MinimizedHeight`: default peek height. */\nexport const g9SheetDefaultPeekHeight = 100;\n/** Absolute minimum of an authoritative fit height (MAUI helper :81). */\nexport const g9SheetFitMinHeight = 80;\n/** Default `scrollToEndThreshold`: four 52 px rows from the end (MAUI 1.4.8 selection sheet, `OnItemsScrolled`). */\nexport const g9SheetScrollToEndThreshold = 208;\n/** Floor while the height is unknown (loading window). */\nexport const g9SheetFitLoadingMinHeight = 180;\n/** Finger travel at release that requests a close (MAUI `DragCloseThreshold`). */\nexport const g9SheetDragCloseThreshold = 72;\n/**\n * Gap between the top safe-area inset and a full-screen sheet's header. MAUI reserves the inset alone\n * (`ResolveFullScreenSheetTopPadding`), but its Android inset is the status-bar band, a few dp below the cutout an\n * immersive Lynx host reports: measured side by side on a Pixel 9 Pro XL (2026-10-10), MAUI's header sat 3 dp lower.\n * (It was 8, which put every full-screen header 5 dp below MAUI's.)\n */\nexport const g9SheetTopSafeAreaBaseGap = 3;\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\n\n/** The platform the app runs on (Lynx `SystemInfo.platform`), lower-cased; `'unknown'` outside Lynx. */\nexport function currentPlatform(): 'android' | 'ios' | 'windows' | 'macos' | 'unknown' {\n const info = (globalThis as { SystemInfo?: { platform?: string } }).SystemInfo;\n const p = (info?.platform ?? '').toLowerCase();\n if (p === 'android') return 'android';\n if (p === 'ios') return 'ios';\n if (p.startsWith('win')) return 'windows';\n if (p === 'macos' || p === 'mac' || p === 'osx') return 'macos';\n return 'unknown';\n}\n\n/** What the adapter passes to lynx-ui `SheetRoot` and how the frame behaves. */\nexport interface G9SheetLayout {\n /** lynx-ui snap points, small to large: pixels, `'NN%'` of the host, or `'fit'`. */\n readonly snapPoints: Array<number | string>;\n readonly initialSnap: number;\n /** One detent, or fit-to-content (MAUI \"fixed\"): no grabber, no detent dragging. */\n readonly fixed: boolean;\n readonly fit: boolean;\n /** Grabber visible (`hasHandle && isDraggable && (!fixed || handleOnSingleDetent)`). */\n readonly showHandle: boolean;\n readonly dragDisabled: boolean;\n /** Drag past the lowest detent may request a close. */\n readonly enableDragToClose: boolean;\n /** Backdrop tap requests a close. */\n readonly closeOnOverlayTap: boolean;\n /** The resting body cap for a fit sheet (`maxFitToContentHeightRatio × host`), else `null`. */\n readonly fitMaxHeight: number | null;\n /** Whether the sheet's largest detent is full screen. */\n readonly fullScreen: boolean;\n /**\n * The body fills the surface, so the footer rests at the sheet's bottom edge: a full-screen sheet, or one fixed detent\n * (`states: ['large']` with `fullExpandedRatio: 0.9`) — its surface has a definite height. A sheet that can move between\n * detents or fits its content keeps a body as tall as the content.\n */\n readonly fillBody: boolean;\n}\n\nconst pct = (ratio: number) => `${Math.round(ratio * 10000) / 100}%`;\n\n/**\n * Maps G9 options to a lynx-ui layout (the agreed mapping of MAUI `ApplyOptions`): fit → `['fit']` capped at\n * `maxFitToContentHeightRatio`; states → peek pixels / half ratio / full ratio for the allowed detents, the initial\n * detent from `currentState`. The MAUI quirks (a hidden 100 dp detent under `[medium, large]`, a peek-only sheet that\n * may expand) are not carried over: the detents are exactly `states` (docs/sheets.md \"deliberate differences\").\n */\nexport function resolveSheetLayout(\n options: G9SheetOptions,\n hostHeight: number,\n platform = currentPlatform(),\n): G9SheetLayout {\n const fit = options.sizeMode === 'fitToContent';\n const draggable = options.isDraggable !== false;\n const cancelable = options.isCancelable !== false;\n const intercepted = options.onBackRequested != null;\n if (fit) {\n const ratio = clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1);\n return {\n snapPoints: ['fit'],\n initialSnap: 0,\n fixed: true,\n fit: true,\n showHandle: false,\n dragDisabled: true,\n enableDragToClose: false,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: Math.max(g9SheetFitMinHeight, Math.floor(hostHeight * ratio)),\n fullScreen: false,\n fillBody: false,\n };\n }\n const order: G9SheetDetent[] = ['peek', 'medium', 'large'];\n const requested = options.states && options.states.length > 0 ? options.states : ['medium', 'large'];\n const states = order.filter((d) => requested.includes(d));\n const androidHalf = platform === 'android' ? options.androidHalfExpandedRatio : null;\n const half = clamp(androidHalf ?? options.halfExpandedRatio ?? 0.5, 0.1, 0.9);\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const peek = Math.max(1, options.collapsedHeight ?? options.peekHeight ?? g9SheetDefaultPeekHeight);\n const snap = (d: G9SheetDetent): number | string =>\n d === 'peek' ? Math.min(peek, Math.max(1, hostHeight)) : d === 'medium' ? pct(half) : pct(full);\n const snapPoints = states.map(snap);\n if (options.expandedFitsContent && snapPoints.length > 0) snapPoints[snapPoints.length - 1] = 'fit';\n const current = options.currentState ?? 'medium';\n const index = states.indexOf(current);\n const fixed = states.length <= 1;\n return {\n snapPoints,\n initialSnap: index >= 0 ? index : 0,\n fixed,\n fit: false,\n showHandle: options.hasHandle !== false && draggable && (!fixed || options.handleOnSingleDetent === true),\n dragDisabled: !draggable || intercepted,\n enableDragToClose: cancelable && draggable && !intercepted,\n closeOnOverlayTap: cancelable,\n fitMaxHeight: options.expandedFitsContent\n ? Math.max(\n g9SheetFitMinHeight,\n Math.floor(hostHeight * clamp(options.maxFitToContentHeightRatio ?? 0.75, 0.2, 1)),\n )\n : null,\n // One 'large' detent sized to its content is not full screen (no status-bar padding above a short sheet).\n fullScreen: states.length === 1 && states[0] === 'large' && full >= 1 && options.expandedFitsContent !== true,\n fillBody: fixed && !options.expandedFitsContent,\n };\n}\n\n/** Clamps a measured fit body height: `[80, cap]`, or `[180, cap]` while loading (MAUI fit engine). */\nexport function clampFitHeight(natural: number, cap: number, loading: boolean): number {\n const min = loading ? g9SheetFitLoadingMinHeight : g9SheetFitMinHeight;\n if (!(natural > 0)) return Math.min(min, cap);\n return clamp(natural, Math.min(min, cap), cap);\n}\n\n/**\n * Scrim opacity for a visible ratio (MAUI helper overlay rule): between the smallest and the largest detent it runs\n * from `min` to `max`; a single detent uses `max`; below the smallest detent it fades with the ratio.\n */\nexport function sheetOverlayOpacity(\n visibleRatio: number,\n detentRatios: ReadonlyArray<number>,\n min: number,\n max: number,\n): number {\n if (detentRatios.length === 0) return max;\n const lo = Math.min(...detentRatios);\n const hi = Math.max(...detentRatios);\n if (visibleRatio < lo) return (detentRatios.length === 1 ? max : min) * clamp(visibleRatio / lo, 0, 1);\n if (hi === lo) return max;\n return min + (max - min) * clamp((visibleRatio - lo) / (hi - lo), 0, 1);\n}\n\n/** The page recede behind a tall primary sheet (MAUI backdrop card): scale 1 → 0.93, translateY 0 → 12. */\nexport function backdropCardTransform(visibleRatio: number, threshold = 0.75): { scale: number; translateY: number } {\n const raw = clamp((visibleRatio - threshold) / Math.max(1e-6, 1 - threshold), 0, 1);\n const progress = raw <= 0 ? 0 : 1 - (1 - raw) ** (1 / 3);\n return { scale: 1 - 0.07 * progress, translateY: 12 * progress };\n}\n\n/**\n * The visible share of the host a detent sheet covers: its resting height when known, else its opening detent\n * (peek = peek height, medium = half ratio, large = full ratio; `expandedFitsContent` large counts as the fit cap).\n */\nexport function sheetVisibleRatio(\n options: G9SheetOptions,\n hostHeight: number,\n restingHeightPx: number | null,\n platform = currentPlatform(),\n): number {\n const host = Math.max(1, hostHeight);\n if (restingHeightPx != null) return clamp(restingHeightPx / host, 0, 1);\n const layout = resolveSheetLayout(options, host, platform);\n const point = layout.snapPoints[layout.initialSnap];\n if (typeof point === 'number') return clamp(point / host, 0, 1);\n if (point === 'fit' || point === undefined) return (layout.fitMaxHeight ?? 0) / host;\n return clamp(Number.parseFloat(point) / 100, 0, 1);\n}\n\n/** How far a receded parent sheet sinks: `max(24, visible × 0.25)` (MAUI stack recede). */\nexport function parentRecedeOffset(visibleHeight: number): number {\n return Math.max(24, visibleHeight * 0.25);\n}\n\n/** Top padding of a full-screen sheet (MAUI safe-area rule). */\nexport function sheetTopPadding(options: G9SheetOptions, topInset: number): number {\n if (options.topSafeAreaPaddingOverride != null) return Math.max(0, options.topSafeAreaPaddingOverride);\n const inset = options.useTopSafeAreaPadding === false ? 0 : Math.max(0, topInset);\n return inset + g9SheetTopSafeAreaBaseGap + Math.max(0, options.additionalTopSafeAreaPadding ?? 0);\n}\n\n/**\n * Top padding of the sheet surface where it rests. A full-screen sheet always reserves {@link sheetTopPadding}. A\n * detent sheet resting at its `large` detent reserves it too when that detent reaches under the top inset (MAUI\n * state-aware top padding, `G9BottomSheetHelper.ApplyStateAwareTopPadding`): its content never sits under the status\n * bar or the camera cutout. Opted out like MAUI: `useTopSafeAreaPadding: false` with no additional/override padding.\n */\nexport function sheetSurfaceTopPadding(\n options: G9SheetOptions,\n layout: Pick<G9SheetLayout, 'fullScreen' | 'fit'>,\n resting: G9SheetDetent | 'fit',\n topInset: number,\n hostHeight: number,\n): number {\n if (layout.fullScreen) return sheetTopPadding(options, topInset);\n if (layout.fit || resting !== 'large') return 0;\n const opted =\n options.useTopSafeAreaPadding !== false ||\n (options.additionalTopSafeAreaPadding ?? 0) > 0 ||\n (options.topSafeAreaPaddingOverride ?? 0) > 0;\n if (!opted) return 0;\n const full = clamp(options.fullExpandedRatio ?? 1, 0.1, 1);\n const top = Math.max(0, hostHeight) * (1 - full);\n return top < Math.max(0, topInset) + g9SheetTopSafeAreaBaseGap ? sheetTopPadding(options, topInset) : 0;\n}\n\n/**\n * Bottom padding of the sheet surface: the host's bottom safe inset (a visible navigation bar or gesture handle), so\n * the last row and the footer stay above it. `useBottomSafeAreaPadding: false` lets content run under it. An\n * immersive host (system bars hidden, as the AgriPad MAUI app) reports 0 and nothing changes.\n */\nexport function sheetSurfaceBottomPadding(options: G9SheetOptions, bottomInset: number): number {\n return options.useBottomSafeAreaPadding === false ? 0 : Math.max(0, bottomInset);\n}\n\n/**\n * Size-scaled animation duration (MAUI `SizeScaledAnimationDuration`): a partial traversal takes the matching slice\n * of the full duration (at least 1 ms unless the duration is 0).\n */\nexport function scaledSheetDuration(durationMs: number, traversedRatio: number, sizeScaled: boolean): number {\n if (durationMs <= 0) return 0;\n if (!sizeScaled) return durationMs;\n return Math.max(1, Math.round(durationMs * clamp(traversedRatio, 0, 1)));\n}\n\n/** Platform size constraints of the sheet surface (MAUI Android/Windows options, applied where they belong). */\nexport function platformSheetConstraints(\n options: G9SheetOptions,\n platform = currentPlatform(),\n): Record<string, string> {\n const px = (n: number) => `${n}px`;\n const style: Record<string, string> = {};\n if (platform === 'android') {\n if (options.androidMaxWidth != null) style.maxWidth = px(options.androidMaxWidth);\n if (options.androidMaxHeight != null) style.maxHeight = px(options.androidMaxHeight);\n if (options.androidMargin) {\n const [l, t, r, b] = options.androidMargin;\n style.margin = `${t}px ${r}px ${b}px ${l}px`;\n }\n }\n if (platform === 'windows') {\n if (options.windowsMaxWidth != null) style.maxWidth = px(options.windowsMaxWidth);\n if (options.windowsMaxHeight != null) style.maxHeight = px(options.windowsMaxHeight);\n if (options.windowsMinWidth != null) style.minWidth = px(options.windowsMinWidth);\n if (options.windowsMinHeight != null) style.minHeight = px(options.windowsMinHeight);\n }\n if (options.contentWidthMode === 'custom') {\n style.width = px(options.contentWidth ?? 300);\n style.alignSelf = 'center';\n }\n return style;\n}\n"],"names":["g9SheetDefaultPeekHeight","g9SheetFitMinHeight","g9SheetScrollToEndThreshold","g9SheetFitLoadingMinHeight","g9SheetDragCloseThreshold","g9SheetTopSafeAreaBaseGap","clamp","v","lo","hi","Math","currentPlatform","info","globalThis","p","pct","ratio","resolveSheetLayout","options","hostHeight","platform","_ref","_options_fullExpandedRatio","_ref1","_options_currentState","_options_maxFitToContentHeightRatio","fit","draggable","cancelable","intercepted","_options_maxFitToContentHeightRatio1","order","requested","states","d","androidHalf","half","full","peek","snap","snapPoints","current","index","fixed","clampFitHeight","natural","cap","loading","min","sheetOverlayOpacity","visibleRatio","detentRatios","max","backdropCardTransform","threshold","raw","progress","sheetVisibleRatio","restingHeightPx","_layout_fitMaxHeight","host","layout","point","undefined","Number","parentRecedeOffset","visibleHeight","sheetTopPadding","topInset","_options_additionalTopSafeAreaPadding","inset","sheetSurfaceTopPadding","resting","_options_topSafeAreaPaddingOverride","opted","top","sheetSurfaceBottomPadding","bottomInset","scaledSheetDuration","durationMs","traversedRatio","sizeScaled","platformSheetConstraints","px","n","style","l","t","r","b","_options_contentWidth"],"mappings":"AAKO,MAAMA,2BAA2B;AAEjC,MAAMC,sBAAsB;AAE5B,MAAMC,8BAA8B;AAEpC,MAAMC,6BAA6B;AAEnC,MAAMC,4BAA4B;AAOlC,MAAMC,4BAA4B;AAEzC,MAAMC,QAAQ,CAACC,GAAWC,IAAYC,KAAeC,KAAK,GAAG,CAACD,IAAIC,KAAK,GAAG,CAACF,IAAID;AAGxE,SAASI;;IACd,MAAMC,OAAQC,WAAsD,UAAU;IAC9E,MAAMC,IAAI,AAAC,SAAD,QAACF,QAAAA,OAAAA,KAAAA,IAAAA,KAAM,QAAQ,AAAD,IAAC,OAAI,EAAC,EAAG,WAAW;IAC5C,IAAIE,AAAM,cAANA,GAAiB,OAAO;IAC5B,IAAIA,AAAM,UAANA,GAAa,OAAO;IACxB,IAAIA,EAAE,UAAU,CAAC,QAAQ,OAAO;IAChC,IAAIA,AAAM,YAANA,KAAiBA,AAAM,UAANA,KAAeA,AAAM,UAANA,GAAa,OAAO;IACxD,OAAO;AACT;AA6BA,MAAMC,MAAM,CAACC,QAAkB,GAAGN,KAAK,KAAK,CAACM,AAAQ,QAARA,SAAiB,IAAI,CAAC,CAAC;AAQ7D,SAASC,mBACdC,OAAuB,EACvBC,UAAkB,EAClBC,WAAWT,iBAAiB;QA0BTU,MACAC,4BACMC,OAAAA,0BAKTC,uBAesBC;IA9CtC,MAAMC,MAAMR,AAAqB,mBAArBA,QAAQ,QAAQ;IAC5B,MAAMS,YAAYT,AAAwB,UAAxBA,QAAQ,WAAW;IACrC,MAAMU,aAAaV,AAAyB,UAAzBA,QAAQ,YAAY;IACvC,MAAMW,cAAcX,AAA2B,QAA3BA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jE,QAAQ,gBAAgB;QACnF,IAAIA,AAA2B,QAA3BA,QAAQ,eAAe,EAAUmE,MAAM,QAAQ,GAAGF,GAAGjE,QAAQ,eAAe;QAChF,IAAIA,AAA4B,QAA5BA,QAAQ,gBAAgB,EAAUmE,MAAM,SAAS,GAAGF,GAAGjE,QAAQ,gBAAgB;IACrF;IACA,IAAIA,AAA6B,aAA7BA,QAAQ,gBAAgB,EAAe;YACxBwE;QAAjBL,MAAM,KAAK,GAAGF,GAAG,QAAAO,CAAAA,wBAAAA,QAAQ,YAAY,AAAD,IAAnBA,wBAAwB;QACzCL,MAAM,SAAS,GAAG;IACpB;IACA,OAAOA;AACT"}
@@ -1,8 +1,22 @@
1
1
  import './tabs.css';
2
+ import type { G9SegmentInput } from '@g9tm/lynxcontrols-foundation';
2
3
  import { type ReactNode } from '@lynx-js/react';
3
4
  import { type G9TabBarPosition, type G9TabItem, type G9TabMode, type G9TabStyle } from './model.js';
4
5
  /** Props of {@link G9TabView}. */
5
6
  export interface G9TabViewProps {
7
+ /**
8
+ * Element `id` of the tab view: it registers as an anchor (`@g9tm/lynxcontrols/anchor`) that lists and selects its tabs,
9
+ * and each tab cell as `${id}_Tab_${key}` (a guide can point at a tab, an automation can press it).
10
+ */
11
+ readonly id?: string;
12
+ /**
13
+ * The navigation place of the selected tab (`@g9tm/lynxcontrols/route`): a segment for its key, or null when the tab is
14
+ * not a place of its own (the first tab of a header strip is often the page itself). Declared as an inner place; the
15
+ * router leaves it by selecting the first tab.
16
+ */
17
+ readonly routeSegment?: (key: string) => G9SegmentInput | null;
18
+ /** The tab view is on screen (a kept-alive page passes its own `active`). Default true. */
19
+ readonly routeActive?: boolean;
6
20
  /** The tabs (MAUI `Items`). Add, remove or reorder freely; give tabs a `key` so their bodies follow them. */
7
21
  readonly items: readonly G9TabItem[];
8
22
  /** Controlled selection (MAUI `SelectedIndex`, two-way). Out-of-range values show the nearest tab. */
@@ -1 +1 @@
1
- {"version":3,"file":"tab-view.d.ts","source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DAAiD;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,iHAAiH;IACjH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,2GAA2G;IAC3G,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,iGAAiG;IACjG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAC/B,wGAAwG;IACxG,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,uHAAuH;IACvH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACrD,4GAA4G;IAC5G,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CA2L1D"}
@@ -1,6 +1,7 @@
1
1
  import "./tabs.css";
2
2
  import { ViewPager } from "@lynx-js/lynx-ui-view-pager";
3
3
  import { useEffect, useMemo, useRef, useState } from "@lynx-js/react";
4
+ import { useG9Anchor, useG9AnchorRegistry } from "../anchor/hooks.jsx";
4
5
  import { g9RowStyle } from "../base/control.jsx";
5
6
  import { startTimer, stopTimer } from "../base/timers.jsx";
6
7
  import { useControllableState } from "../base/use-controllable-state.jsx";
@@ -8,9 +9,10 @@ import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
8
9
  import { invokeNodeWhenReady } from "../fields/use-text-input.jsx";
9
10
  import { G9IconSlot } from "../icon/slot.jsx";
10
11
  import { useG9Culture, useG9Direction } from "../provider/hooks.jsx";
12
+ import { useG9Place } from "../route/hooks.jsx";
11
13
  import { G9TabRealizer, effectiveTabIndex, g9TabViewMetrics, tabBadge, tabContentSlideFrom, tabKey, tabVisualOrder, thicknessCss } from "./model.jsx";
12
14
  function G9TabView(props) {
13
- var _props_tabStyle, _props_mode, _props_barPosition, _props_tabHeight, _props_defaultSelectedIndex, _props_tabBarBackground, _props_indicatorColor, _props_frameCornerRadius, _props_contentPadding, _props_className;
15
+ var _props_tabStyle, _props_mode, _props_barPosition, _props_tabHeight, _props_defaultSelectedIndex, _props_routeActive, _props_tabBarBackground, _props_indicatorColor, _props_id, _props_frameCornerRadius, _props_contentPadding, _props_className;
14
16
  const items = props.items;
15
17
  const tabStyle = null != (_props_tabStyle = props.tabStyle) ? _props_tabStyle : 'underlined';
16
18
  const mode = null != (_props_mode = props.mode) ? _props_mode : 'fixed';
@@ -77,6 +79,27 @@ function G9TabView(props) {
77
79
  const select = (index)=>{
78
80
  if (index !== effective) setSelected(index);
79
81
  };
82
+ const anchor = useG9Anchor(props.id, {
83
+ kind: 'tab-view',
84
+ capabilities: {
85
+ itemKeys: ()=>keys,
86
+ getValue: ()=>activeKey,
87
+ selectItem: (key)=>{
88
+ const at = keys.indexOf(key);
89
+ if (at >= 0) select(at);
90
+ }
91
+ }
92
+ }, props.id ? {
93
+ domId: props.id
94
+ } : {});
95
+ const routeSegment = null !== activeKey && props.routeSegment ? props.routeSegment(activeKey) : null;
96
+ useG9Place(routeSegment ? {
97
+ segment: routeSegment,
98
+ layer: 'inner',
99
+ close: ()=>select(0)
100
+ } : null, {
101
+ active: null != (_props_routeActive = props.routeActive) ? _props_routeActive : true
102
+ });
80
103
  const pager = useRef(null);
81
104
  const swipe = true === props.swipeEnabled && !props.headerOnly;
82
105
  const order = tabVisualOrder(count, rtl);
@@ -91,7 +114,7 @@ function G9TabView(props) {
91
114
  visualIndex,
92
115
  swipe
93
116
  ]);
94
- const bar = <TabBarStrip items={items} order={order} effective={effective} tabStyle={tabStyle} mode={mode} tabHeight={tabHeight} background={null != (_props_tabBarBackground = props.tabBarBackground) ? _props_tabBarBackground : null} indicatorColor={null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : null} numbering={culture.numberingSystem} onSelect={select}/>;
117
+ const bar = <TabBarStrip items={items} order={order} effective={effective} tabStyle={tabStyle} mode={mode} tabHeight={tabHeight} background={null != (_props_tabBarBackground = props.tabBarBackground) ? _props_tabBarBackground : null} indicatorColor={null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : null} numbering={culture.numberingSystem} onSelect={select} anchorId={null != (_props_id = props.id) ? _props_id : null}/>;
95
118
  const bodyOf = (index)=>{
96
119
  const item = items[index];
97
120
  const key = keys[index];
@@ -129,7 +152,7 @@ function G9TabView(props) {
129
152
  {null !== pending && pending === activeKey ? <Spinner/> : null}
130
153
  </>}
131
154
  </view>;
132
- return <view className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`}>
155
+ return <view {...anchor.props} className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${null != (_props_className = props.className) ? _props_className : ''}`}>
133
156
  {'bottom' === barPosition ? content : null}
134
157
  {bar}
135
158
  {'top' === barPosition ? content : null}
@@ -149,6 +172,39 @@ function TabBarStrip(props) {
149
172
  const indicator = null != (_props_indicatorColor = props.indicatorColor) ? _props_indicatorColor : 'var(--g9-primary)';
150
173
  const fixed = 'fixed' === mode;
151
174
  const cellRefs = useRef([]);
175
+ const registry = useG9AnchorRegistry();
176
+ const latest = useRef(props);
177
+ latest.current = props;
178
+ const cellKeys = items.map((item, i)=>tabKey(item, i)).join('|');
179
+ useEffect(()=>{
180
+ const base = props.anchorId;
181
+ if (!registry || !base) return;
182
+ const offs = latest.current.items.map((item, index)=>registry.register(`${base}_Tab_${tabKey(item, index)}`, ()=>({
183
+ kind: 'tab',
184
+ label: ()=>{
185
+ var _ref;
186
+ var _latest_current_items_index;
187
+ return null != (_ref = null == (_latest_current_items_index = latest.current.items[index]) ? void 0 : _latest_current_items_index.text) ? _ref : null;
188
+ },
189
+ capabilities: {
190
+ activate: ()=>latest.current.onSelect(index)
191
+ }
192
+ }), {
193
+ node: ()=>{
194
+ var _cellRefs_current_index;
195
+ return null != (_cellRefs_current_index = cellRefs.current[index]) ? _cellRefs_current_index : null;
196
+ },
197
+ scrollerId: null,
198
+ layer: 'page'
199
+ }));
200
+ return ()=>{
201
+ for (const off of offs)off();
202
+ };
203
+ }, [
204
+ registry,
205
+ props.anchorId,
206
+ cellKeys
207
+ ]);
152
208
  useEffect(()=>{
153
209
  var _cellRefs_current_effective;
154
210
  if (fixed || effective < 0) return;
@@ -1 +1 @@
1
- {"version":3,"file":"tabs/tab-view.jsx","sources":["../../src/tabs/tab-view.tsx"],"sourcesContent":["import './tabs.css';\nimport { ViewPager, type ViewPagerRef } from '@lynx-js/lynx-ui-view-pager';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { type G9NodeRef, invokeNodeWhenReady } from '../fields/use-text-input';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Direction } from '../provider/hooks';\nimport {\n effectiveTabIndex,\n type G9TabBarPosition,\n type G9TabItem,\n type G9TabMode,\n G9TabRealizer,\n type G9TabStyle,\n g9TabViewMetrics,\n tabBadge,\n tabContentSlideFrom,\n tabKey,\n tabVisualOrder,\n thicknessCss,\n} from './model';\n\n/** Props of {@link G9TabView}. */\nexport interface G9TabViewProps {\n /** The tabs (MAUI `Items`). Add, remove or reorder freely; give tabs a `key` so their bodies follow them. */\n readonly items: readonly G9TabItem[];\n /** Controlled selection (MAUI `SelectedIndex`, two-way). Out-of-range values show the nearest tab. */\n readonly selectedIndex?: number;\n /** Initial selection while uncontrolled. Default 0. */\n readonly defaultSelectedIndex?: number;\n /** A tab was chosen by a tap or a swipe (MAUI `SelectionChanged`). */\n readonly onSelectionChange?: (index: number) => void;\n /** Bar height (MAUI `TabHeight`). Default 52. */\n readonly tabHeight?: number;\n /** Bar background (MAUI `TabBarBackground`). Default transparent (underlined) / surface-container-low (pill). */\n readonly tabBarBackground?: string | null;\n /** Underline colour (underlined) or active text colour (pill) (MAUI `IndicatorColor`). Default primary. */\n readonly indicatorColor?: string | null;\n /** `'fixed'` (default): equal full-width cells. `'scrollable'`: auto-width cells that scroll. */\n readonly mode?: G9TabMode;\n /** `'top'` (default) or `'bottom'`. */\n readonly barPosition?: G9TabBarPosition;\n /** `'underlined'` (default) or `'pill'` (MAUI `Style`). */\n readonly tabStyle?: G9TabStyle;\n /** Only the bar: no content panel; drive your own host from `onSelectionChange` (MAUI `HeaderOnly`). */\n readonly headerOnly?: boolean;\n /** Border and rounded corners around the content (MAUI `ShowFrame`). Default false. */\n readonly showFrame?: boolean;\n /** Content border radius when `showFrame` (MAUI `FrameCornerRadius`). Default 0. */\n readonly frameCornerRadius?: number;\n /** Inset around the active body (MAUI `ContentPadding`): one value, `[h, v]` or `[l, t, r, b]`. Default 10,10,10,0. */\n readonly contentPadding?: number | readonly number[];\n /** Build every body up front instead of lazily on first activation (MAUI `EagerContent`). Default false. */\n readonly eagerContent?: boolean;\n /** Swipe between bodies (lynx-ui ViewPager). A Lynx addition; default false, as in MAUI. */\n readonly swipeEnabled?: boolean;\n readonly className?: string;\n}\n\n/**\n * Tabs with a bar and lazily realized bodies (MAUI `G9TabView`). Underlined (default) or pill style, fixed or\n * scrollable cells, bar on top or bottom, header-only; the indicator slides between cells; bodies are built on first\n * activation (spinner, then {@link g9TabViewMetrics} `lazyRealizeDelayMs`) and kept, hidden, so scroll and form state\n * survive; RTL reverses the cell order. With `swipeEnabled` the bodies sit in a lynx-ui ViewPager.\n */\nexport function G9TabView(props: G9TabViewProps): ReactNode {\n const items = props.items;\n const tabStyle = props.tabStyle ?? 'underlined';\n const mode = props.mode ?? 'fixed';\n const barPosition = props.barPosition ?? 'top';\n const tabHeight = props.tabHeight ?? g9TabViewMetrics.tabHeight;\n const rtl = useG9Direction() === 'rtl';\n const culture = useG9Culture();\n const [selected, setSelected] = useControllableState<number>({\n value: props.selectedIndex,\n defaultValue: props.defaultSelectedIndex ?? 0,\n onChange: props.onSelectionChange,\n name: 'G9TabView.selectedIndex',\n });\n const count = items.length;\n const effective = effectiveTabIndex(selected, count);\n const keys = items.map((item, i) => tabKey(item, i));\n const activeKey = effective >= 0 ? (keys[effective] as string) : null;\n\n const eager = props.eagerContent === true;\n const eagerRef = useRef(eager);\n eagerRef.current = eager;\n const realizer = useMemo(() => new G9TabRealizer(() => eagerRef.current), []);\n realizer.retain(keys);\n const [, setVersion] = useState(0);\n const [pending, setPending] = useState<string | null>(null);\n\n // Lazy-once realization of the active body; rapid switches realize only the latest.\n useEffect(() => {\n if (activeKey === null || props.headerOnly) {\n setPending(null);\n return;\n }\n const token = realizer.activate(activeKey);\n if (token === 'shown') {\n setPending(null);\n return;\n }\n setPending(activeKey);\n const t = startTimer(() => {\n if (realizer.realize(token)) {\n setPending(null);\n setVersion((v) => v + 1);\n }\n }, g9TabViewMetrics.lazyRealizeDelayMs);\n return () => stopTimer(t);\n }, [activeKey, props.headerOnly]);\n\n // Directional reveal of the newly active body (6 px slide + fade, 160 ms CubicOut).\n const previous = useRef(-1);\n const [reveal, setReveal] = useState<{ key: string | null; from: number; settled: boolean }>({\n key: activeKey,\n from: 0,\n settled: true,\n });\n useEffect(() => {\n const prev = previous.current;\n previous.current = effective;\n if (prev === effective || prev < 0) return;\n setReveal({ key: activeKey, from: tabContentSlideFrom(prev, effective, rtl), settled: false });\n const t = startTimer(() => setReveal((r) => ({ ...r, settled: true })), 16);\n return () => stopTimer(t);\n }, [effective]);\n\n const select = (index: number) => {\n if (index !== effective) setSelected(index);\n };\n\n const pager = useRef<ViewPagerRef | null>(null);\n const swipe = props.swipeEnabled === true && !props.headerOnly;\n const order = tabVisualOrder(count, rtl);\n const visualIndex = order.indexOf(effective);\n useEffect(() => {\n if (!swipe || visualIndex < 0) return;\n try {\n pager.current?.scrollToPage(visualIndex, true);\n } catch {\n // The pager is gone (unmounted mid-switch).\n }\n }, [visualIndex, swipe]);\n\n const bar = (\n <TabBarStrip\n items={items}\n order={order}\n effective={effective}\n tabStyle={tabStyle}\n mode={mode}\n tabHeight={tabHeight}\n background={props.tabBarBackground ?? null}\n indicatorColor={props.indicatorColor ?? null}\n numbering={culture.numberingSystem}\n onSelect={select}\n />\n );\n\n const bodyOf = (index: number): ReactNode => {\n const item = items[index] as G9TabItem;\n const key = keys[index] as string;\n const active = index === effective;\n if (!realizer.isRealized(key)) {\n return active && pending === key ? <Spinner /> : null;\n }\n const revealing = active && reveal.key === key && !reveal.settled;\n const style = {\n display: (active || swipe ? 'flex' : 'none') as 'flex' | 'none',\n transform: `translateX(${revealing ? reveal.from : 0}px)`,\n opacity: revealing ? 0 : 1,\n transition:\n revealing || swipe\n ? 'none'\n : `transform ${g9TabViewMetrics.contentTransitionMs}ms ease-out, opacity ${g9TabViewMetrics.contentTransitionMs}ms ease-out`,\n };\n const content = typeof item.content === 'function' ? (item.content as () => ReactNode)() : item.content;\n return (\n <view key={key} className={`g9-tabs__panel${active ? ' g9-tabs__panel--active' : ''}`} style={style}>\n {content}\n </view>\n );\n };\n\n const frame = props.showFrame\n ? {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'var(--g9-outline-variant)',\n borderRadius: `${props.frameCornerRadius ?? 0}px`,\n }\n : {};\n const content = props.headerOnly ? null : (\n <view\n className=\"g9-tabs__content\"\n style={{ padding: thicknessCss(props.contentPadding ?? g9TabViewMetrics.contentPadding), ...frame }}\n >\n {swipe ? (\n <ViewPager\n ref={pager}\n className=\"g9-tabs__pager\"\n data={order}\n getItemKey={(index: number) => keys[index] as string}\n initialSelectIndex={Math.max(visualIndex, 0)}\n onPageChange={(event) => {\n const next = order[Number(event.detail.index)];\n if (next !== undefined) select(next);\n }}\n >\n {(index: number) => <view className=\"g9-tabs__page\">{bodyOf(index)}</view>}\n </ViewPager>\n ) : (\n <>\n {items.map((_, i) => bodyOf(i))}\n {pending !== null && pending === activeKey ? <Spinner /> : null}\n </>\n )}\n </view>\n );\n\n return (\n <view\n className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${props.className ?? ''}`}\n >\n {barPosition === 'bottom' ? content : null}\n {bar}\n {barPosition === 'top' ? content : null}\n </view>\n );\n}\n\nfunction Spinner(): ReactNode {\n return (\n <view className=\"g9-tabs__spinner\">\n <G9ActivityIndicator running size={24} />\n </view>\n );\n}\n\ninterface StripProps {\n readonly items: readonly G9TabItem[];\n readonly order: readonly number[];\n readonly effective: number;\n readonly tabStyle: G9TabStyle;\n readonly mode: G9TabMode;\n readonly tabHeight: number;\n readonly background: string | null;\n readonly indicatorColor: string | null;\n readonly numbering: Parameters<typeof tabBadge>[1];\n readonly onSelect: (index: number) => void;\n}\n\nfunction TabBarStrip(props: StripProps): ReactNode {\n const { items, order, effective, tabStyle, mode } = props;\n const count = order.length;\n const pill = tabStyle === 'pill';\n const direction = useG9Direction();\n const indicator = props.indicatorColor ?? 'var(--g9-primary)';\n const fixed = mode === 'fixed';\n const cellRefs = useRef<Array<G9NodeRef | null>>([]);\n useEffect(() => {\n if (fixed || effective < 0) return;\n invokeNodeWhenReady({ current: cellRefs.current[effective] ?? null }, 'scrollIntoView', {\n scrollIntoViewOptions: { behavior: 'smooth', block: 'center', inline: 'center' },\n });\n }, [effective, fixed]);\n\n const cells = order.map((index, position) => {\n const item = items[index] as G9TabItem;\n const active = index === effective;\n const badge = tabBadge(item, props.numbering);\n const textColor = active\n ? pill\n ? (props.indicatorColor ?? 'var(--g9-on-primary-container)')\n : 'var(--g9-on-surface)'\n : 'var(--g9-on-surface-variant)';\n return (\n <view\n key={tabKey(item, index)}\n ref={(node: G9NodeRef | null) => {\n cellRefs.current[index] = node;\n }}\n className={`g9-tabs__cell${active ? ' g9-tabs__cell--active' : ''}`}\n style={fixed ? { flex: '1' } : {}}\n accessibility-element\n accessibility-traits=\"button\"\n accessibility-label={item.text ?? ''}\n bindtap={() => props.onSelect(index)}\n >\n {/* Sibling order is paint order in Lynx: the active pill goes first, behind the label. */}\n {!fixed && active ? (\n <view\n className={pill ? 'g9-tabs__cell-pill' : 'g9-tabs__cell-underline'}\n style={pill ? {} : { backgroundColor: indicator }}\n />\n ) : null}\n {position > 0 && !pill ? <view className=\"g9-tabs__separator\" /> : null}\n <view className=\"g9-tabs__cell-row\" style={g9RowStyle(direction)}>\n <G9IconSlot\n emoji={item.emoji}\n icon={item.icon}\n imagePath={item.imagePath}\n image={item.image}\n size={18}\n color={textColor}\n />\n {item.text ? (\n <text className=\"g9-tabs__label\" style={{ color: textColor, fontWeight: active ? '600' : '400' }}>\n {item.text}\n </text>\n ) : null}\n {badge === 'dot' ? (\n <view className=\"g9-tabs__badge-dot\" style={{ backgroundColor: item.badgeColor ?? 'var(--g9-error)' }} />\n ) : badge !== null ? (\n // MAUI CreateBadge: `badgeColor ?? palette.Primary` (only the dot defaults to Error).\n <view className=\"g9-tabs__badge\" style={{ backgroundColor: item.badgeColor ?? 'var(--g9-primary)' }}>\n <text className=\"g9-tabs__badge-text\">{badge}</text>\n </view>\n ) : null}\n </view>\n </view>\n );\n });\n\n const position = order.indexOf(effective);\n const slider =\n fixed && position >= 0 ? (\n <view\n className={pill ? 'g9-tabs__pill' : 'g9-tabs__underline'}\n style={{\n left: `${(position * 100) / count}%`,\n width: `${100 / count}%`,\n transition: `left ${g9TabViewMetrics.indicatorMoveMs}ms cubic-bezier(0.215, 0.61, 0.355, 1)`,\n }}\n >\n <view\n className={pill ? 'g9-tabs__pill-fill' : 'g9-tabs__underline-fill'}\n style={pill ? {} : { backgroundColor: indicator }}\n />\n </view>\n ) : null;\n\n const barStyle = {\n height: `${props.tabHeight}px`,\n backgroundColor: props.background ?? (pill ? 'var(--g9-surface-container-low)' : 'transparent'),\n };\n return (\n <view className=\"g9-tabs__bar\" style={barStyle}>\n {fixed ? (\n <view className=\"g9-tabs__cells\">\n {slider}\n {cells}\n </view>\n ) : (\n <scroll-view className=\"g9-tabs__scroller\" scroll-orientation=\"horizontal\">\n <view className=\"g9-tabs__cells g9-tabs__cells--scrollable\">{cells}</view>\n </scroll-view>\n )}\n </view>\n );\n}\n"],"names":["G9TabView","props","_props_tabStyle","_props_mode","_props_barPosition","_props_tabHeight","_props_defaultSelectedIndex","_props_tabBarBackground","_props_indicatorColor","_props_frameCornerRadius","_props_contentPadding","_props_className","items","tabStyle","mode","barPosition","tabHeight","g9TabViewMetrics","rtl","useG9Direction","culture","useG9Culture","selected","setSelected","useControllableState","count","effective","effectiveTabIndex","keys","item","i","tabKey","activeKey","eager","eagerRef","useRef","realizer","useMemo","G9TabRealizer","setVersion","useState","pending","setPending","useEffect","token","t","startTimer","v","stopTimer","previous","reveal","setReveal","prev","tabContentSlideFrom","r","select","index","pager","swipe","order","tabVisualOrder","visualIndex","_pager_current","bar","TabBarStrip","bodyOf","key","active","Spinner","revealing","style","content","view","frame","thicknessCss","ViewPager","Math","event","next","Number","undefined","_","G9ActivityIndicator","_props_background","pill","direction","indicator","fixed","cellRefs","_cellRefs_current_effective","invokeNodeWhenReady","cells","position","_item_text","_item_badgeColor","_item_badgeColor1","badge","tabBadge","textColor","node","g9RowStyle","G9IconSlot","text","slider","barStyle","scroll-view"],"mappings":";;;;;;;;;;;AAoEO,SAASA,UAAUC,KAAqB;QAE5BC,iBACJC,aACOC,oB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CAAC,CAAC;QACpC,OAAO,GAAG,MAAMA,MAAM,CAAC,CAAC;QACxB,YAAY,CAAC,KAAK,EAAER,iBAAiB,eAAe,CAAC,sCAAsC,CAAC;IAC9F,GACD;QACC,CAACuD,KACC,WAAWY,OAAO,uBAAuB,2BACzC,OAAOA,OAAO,CAAC,IAAI;QAAE,iBAAiBE;IAAU,IAChD;MACJ,EAAEd,QACA;IAEN,MAAMgC,WAAW;QACf,QAAQ,GAAGvG,MAAM,SAAS,CAAC,EAAE,CAAC;QAC9B,iBAAiB,QAAAkF,CAAAA,oBAAAA,MAAM,UAAU,AAAD,IAAfA,oBAAqBC,OAAO,oCAAoC;IACnF;IACA,QACGZ,KAAK,UAAU,eAAe,OAAOgC,UAAU;MAC9C,CAACjB,SACEf,KAAK,UAAU,iBAAiB;UAC/B,CAAC+B,OAAO;UACR,CAACZ,MAAM;QACT,EAAEnB,SAEDiC,YAAY,UAAU,oBAAoB,mBAAmB,aAAa;UACzE,CAACjC,KAAK,UAAU,6CAA6CmB,QAAQnB,KAAK;QAC5E,EAAEiC,aACF;IACJ,EAAEjC;AAEN"}
1
+ {"version":3,"file":"tabs/tab-view.jsx","sources":["../../src/tabs/tab-view.tsx"],"sourcesContent":["import './tabs.css';\nimport type { G9SegmentInput } from '@g9tm/lynxcontrols-foundation';\nimport { ViewPager, type ViewPagerRef } from '@lynx-js/lynx-ui-view-pager';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { useG9Anchor, useG9AnchorRegistry } from '../anchor/hooks';\nimport { g9RowStyle } from '../base/control';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { type G9NodeRef, invokeNodeWhenReady } from '../fields/use-text-input';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Direction } from '../provider/hooks';\nimport { useG9Place } from '../route/hooks';\nimport {\n effectiveTabIndex,\n type G9TabBarPosition,\n type G9TabItem,\n type G9TabMode,\n G9TabRealizer,\n type G9TabStyle,\n g9TabViewMetrics,\n tabBadge,\n tabContentSlideFrom,\n tabKey,\n tabVisualOrder,\n thicknessCss,\n} from './model';\n\n/** Props of {@link G9TabView}. */\nexport interface G9TabViewProps {\n /**\n * Element `id` of the tab view: it registers as an anchor (`@g9tm/lynxcontrols/anchor`) that lists and selects its tabs,\n * and each tab cell as `${id}_Tab_${key}` (a guide can point at a tab, an automation can press it).\n */\n readonly id?: string;\n /**\n * The navigation place of the selected tab (`@g9tm/lynxcontrols/route`): a segment for its key, or null when the tab is\n * not a place of its own (the first tab of a header strip is often the page itself). Declared as an inner place; the\n * router leaves it by selecting the first tab.\n */\n readonly routeSegment?: (key: string) => G9SegmentInput | null;\n /** The tab view is on screen (a kept-alive page passes its own `active`). Default true. */\n readonly routeActive?: boolean;\n /** The tabs (MAUI `Items`). Add, remove or reorder freely; give tabs a `key` so their bodies follow them. */\n readonly items: readonly G9TabItem[];\n /** Controlled selection (MAUI `SelectedIndex`, two-way). Out-of-range values show the nearest tab. */\n readonly selectedIndex?: number;\n /** Initial selection while uncontrolled. Default 0. */\n readonly defaultSelectedIndex?: number;\n /** A tab was chosen by a tap or a swipe (MAUI `SelectionChanged`). */\n readonly onSelectionChange?: (index: number) => void;\n /** Bar height (MAUI `TabHeight`). Default 52. */\n readonly tabHeight?: number;\n /** Bar background (MAUI `TabBarBackground`). Default transparent (underlined) / surface-container-low (pill). */\n readonly tabBarBackground?: string | null;\n /** Underline colour (underlined) or active text colour (pill) (MAUI `IndicatorColor`). Default primary. */\n readonly indicatorColor?: string | null;\n /** `'fixed'` (default): equal full-width cells. `'scrollable'`: auto-width cells that scroll. */\n readonly mode?: G9TabMode;\n /** `'top'` (default) or `'bottom'`. */\n readonly barPosition?: G9TabBarPosition;\n /** `'underlined'` (default) or `'pill'` (MAUI `Style`). */\n readonly tabStyle?: G9TabStyle;\n /** Only the bar: no content panel; drive your own host from `onSelectionChange` (MAUI `HeaderOnly`). */\n readonly headerOnly?: boolean;\n /** Border and rounded corners around the content (MAUI `ShowFrame`). Default false. */\n readonly showFrame?: boolean;\n /** Content border radius when `showFrame` (MAUI `FrameCornerRadius`). Default 0. */\n readonly frameCornerRadius?: number;\n /** Inset around the active body (MAUI `ContentPadding`): one value, `[h, v]` or `[l, t, r, b]`. Default 10,10,10,0. */\n readonly contentPadding?: number | readonly number[];\n /** Build every body up front instead of lazily on first activation (MAUI `EagerContent`). Default false. */\n readonly eagerContent?: boolean;\n /** Swipe between bodies (lynx-ui ViewPager). A Lynx addition; default false, as in MAUI. */\n readonly swipeEnabled?: boolean;\n readonly className?: string;\n}\n\n/**\n * Tabs with a bar and lazily realized bodies (MAUI `G9TabView`). Underlined (default) or pill style, fixed or\n * scrollable cells, bar on top or bottom, header-only; the indicator slides between cells; bodies are built on first\n * activation (spinner, then {@link g9TabViewMetrics} `lazyRealizeDelayMs`) and kept, hidden, so scroll and form state\n * survive; RTL reverses the cell order. With `swipeEnabled` the bodies sit in a lynx-ui ViewPager.\n */\nexport function G9TabView(props: G9TabViewProps): ReactNode {\n const items = props.items;\n const tabStyle = props.tabStyle ?? 'underlined';\n const mode = props.mode ?? 'fixed';\n const barPosition = props.barPosition ?? 'top';\n const tabHeight = props.tabHeight ?? g9TabViewMetrics.tabHeight;\n const rtl = useG9Direction() === 'rtl';\n const culture = useG9Culture();\n const [selected, setSelected] = useControllableState<number>({\n value: props.selectedIndex,\n defaultValue: props.defaultSelectedIndex ?? 0,\n onChange: props.onSelectionChange,\n name: 'G9TabView.selectedIndex',\n });\n const count = items.length;\n const effective = effectiveTabIndex(selected, count);\n const keys = items.map((item, i) => tabKey(item, i));\n const activeKey = effective >= 0 ? (keys[effective] as string) : null;\n\n const eager = props.eagerContent === true;\n const eagerRef = useRef(eager);\n eagerRef.current = eager;\n const realizer = useMemo(() => new G9TabRealizer(() => eagerRef.current), []);\n realizer.retain(keys);\n const [, setVersion] = useState(0);\n const [pending, setPending] = useState<string | null>(null);\n\n // Lazy-once realization of the active body; rapid switches realize only the latest.\n useEffect(() => {\n if (activeKey === null || props.headerOnly) {\n setPending(null);\n return;\n }\n const token = realizer.activate(activeKey);\n if (token === 'shown') {\n setPending(null);\n return;\n }\n setPending(activeKey);\n const t = startTimer(() => {\n if (realizer.realize(token)) {\n setPending(null);\n setVersion((v) => v + 1);\n }\n }, g9TabViewMetrics.lazyRealizeDelayMs);\n return () => stopTimer(t);\n }, [activeKey, props.headerOnly]);\n\n // Directional reveal of the newly active body (6 px slide + fade, 160 ms CubicOut).\n const previous = useRef(-1);\n const [reveal, setReveal] = useState<{ key: string | null; from: number; settled: boolean }>({\n key: activeKey,\n from: 0,\n settled: true,\n });\n useEffect(() => {\n const prev = previous.current;\n previous.current = effective;\n if (prev === effective || prev < 0) return;\n setReveal({ key: activeKey, from: tabContentSlideFrom(prev, effective, rtl), settled: false });\n const t = startTimer(() => setReveal((r) => ({ ...r, settled: true })), 16);\n return () => stopTimer(t);\n }, [effective]);\n\n const select = (index: number) => {\n if (index !== effective) setSelected(index);\n };\n const anchor = useG9Anchor(\n props.id,\n {\n kind: 'tab-view',\n capabilities: {\n itemKeys: () => keys,\n getValue: () => activeKey,\n selectItem: (key) => {\n const at = keys.indexOf(key);\n if (at >= 0) select(at);\n },\n },\n },\n props.id ? { domId: props.id } : {},\n );\n const routeSegment = activeKey !== null && props.routeSegment ? props.routeSegment(activeKey) : null;\n useG9Place(routeSegment ? { segment: routeSegment, layer: 'inner', close: () => select(0) } : null, {\n active: props.routeActive ?? true,\n });\n\n const pager = useRef<ViewPagerRef | null>(null);\n const swipe = props.swipeEnabled === true && !props.headerOnly;\n const order = tabVisualOrder(count, rtl);\n const visualIndex = order.indexOf(effective);\n useEffect(() => {\n if (!swipe || visualIndex < 0) return;\n try {\n pager.current?.scrollToPage(visualIndex, true);\n } catch {\n // The pager is gone (unmounted mid-switch).\n }\n }, [visualIndex, swipe]);\n\n const bar = (\n <TabBarStrip\n items={items}\n order={order}\n effective={effective}\n tabStyle={tabStyle}\n mode={mode}\n tabHeight={tabHeight}\n background={props.tabBarBackground ?? null}\n indicatorColor={props.indicatorColor ?? null}\n numbering={culture.numberingSystem}\n onSelect={select}\n anchorId={props.id ?? null}\n />\n );\n\n const bodyOf = (index: number): ReactNode => {\n const item = items[index] as G9TabItem;\n const key = keys[index] as string;\n const active = index === effective;\n if (!realizer.isRealized(key)) {\n return active && pending === key ? <Spinner /> : null;\n }\n const revealing = active && reveal.key === key && !reveal.settled;\n const style = {\n display: (active || swipe ? 'flex' : 'none') as 'flex' | 'none',\n transform: `translateX(${revealing ? reveal.from : 0}px)`,\n opacity: revealing ? 0 : 1,\n transition:\n revealing || swipe\n ? 'none'\n : `transform ${g9TabViewMetrics.contentTransitionMs}ms ease-out, opacity ${g9TabViewMetrics.contentTransitionMs}ms ease-out`,\n };\n const content = typeof item.content === 'function' ? (item.content as () => ReactNode)() : item.content;\n return (\n <view key={key} className={`g9-tabs__panel${active ? ' g9-tabs__panel--active' : ''}`} style={style}>\n {content}\n </view>\n );\n };\n\n const frame = props.showFrame\n ? {\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: 'var(--g9-outline-variant)',\n borderRadius: `${props.frameCornerRadius ?? 0}px`,\n }\n : {};\n const content = props.headerOnly ? null : (\n <view\n className=\"g9-tabs__content\"\n style={{ padding: thicknessCss(props.contentPadding ?? g9TabViewMetrics.contentPadding), ...frame }}\n >\n {swipe ? (\n <ViewPager\n ref={pager}\n className=\"g9-tabs__pager\"\n data={order}\n getItemKey={(index: number) => keys[index] as string}\n initialSelectIndex={Math.max(visualIndex, 0)}\n onPageChange={(event) => {\n const next = order[Number(event.detail.index)];\n if (next !== undefined) select(next);\n }}\n >\n {(index: number) => <view className=\"g9-tabs__page\">{bodyOf(index)}</view>}\n </ViewPager>\n ) : (\n <>\n {items.map((_, i) => bodyOf(i))}\n {pending !== null && pending === activeKey ? <Spinner /> : null}\n </>\n )}\n </view>\n );\n\n return (\n <view\n {...anchor.props}\n className={`g9-tabs g9-tabs--${tabStyle} g9-tabs--${barPosition}${props.headerOnly ? ' g9-tabs--header-only' : ''} ${props.className ?? ''}`}\n >\n {barPosition === 'bottom' ? content : null}\n {bar}\n {barPosition === 'top' ? content : null}\n </view>\n );\n}\n\nfunction Spinner(): ReactNode {\n return (\n <view className=\"g9-tabs__spinner\">\n <G9ActivityIndicator running size={24} />\n </view>\n );\n}\n\ninterface StripProps {\n readonly items: readonly G9TabItem[];\n readonly order: readonly number[];\n readonly effective: number;\n readonly tabStyle: G9TabStyle;\n readonly mode: G9TabMode;\n readonly tabHeight: number;\n readonly background: string | null;\n readonly indicatorColor: string | null;\n readonly numbering: Parameters<typeof tabBadge>[1];\n readonly onSelect: (index: number) => void;\n /** The tab view's anchor id: each cell registers as `${anchorId}_Tab_${key}`. */\n readonly anchorId: string | null;\n}\n\nfunction TabBarStrip(props: StripProps): ReactNode {\n const { items, order, effective, tabStyle, mode } = props;\n const count = order.length;\n const pill = tabStyle === 'pill';\n const direction = useG9Direction();\n const indicator = props.indicatorColor ?? 'var(--g9-primary)';\n const fixed = mode === 'fixed';\n const cellRefs = useRef<Array<G9NodeRef | null>>([]);\n const registry = useG9AnchorRegistry();\n const latest = useRef(props);\n latest.current = props;\n const cellKeys = items.map((item, i) => tabKey(item, i)).join('|');\n useEffect(() => {\n const base = props.anchorId;\n if (!registry || !base) return undefined;\n const offs = latest.current.items.map((item, index) =>\n registry.register(\n `${base}_Tab_${tabKey(item, index)}`,\n () => ({\n kind: 'tab',\n label: () => latest.current.items[index]?.text ?? null,\n capabilities: { activate: () => latest.current.onSelect(index) },\n }),\n { node: () => cellRefs.current[index] ?? null, scrollerId: null, layer: 'page' },\n ),\n );\n return () => {\n for (const off of offs) off();\n };\n }, [registry, props.anchorId, cellKeys]);\n useEffect(() => {\n if (fixed || effective < 0) return;\n invokeNodeWhenReady({ current: cellRefs.current[effective] ?? null }, 'scrollIntoView', {\n scrollIntoViewOptions: { behavior: 'smooth', block: 'center', inline: 'center' },\n });\n }, [effective, fixed]);\n\n const cells = order.map((index, position) => {\n const item = items[index] as G9TabItem;\n const active = index === effective;\n const badge = tabBadge(item, props.numbering);\n const textColor = active\n ? pill\n ? (props.indicatorColor ?? 'var(--g9-on-primary-container)')\n : 'var(--g9-on-surface)'\n : 'var(--g9-on-surface-variant)';\n return (\n <view\n key={tabKey(item, index)}\n ref={(node: G9NodeRef | null) => {\n cellRefs.current[index] = node;\n }}\n className={`g9-tabs__cell${active ? ' g9-tabs__cell--active' : ''}`}\n style={fixed ? { flex: '1' } : {}}\n accessibility-element\n accessibility-traits=\"button\"\n accessibility-label={item.text ?? ''}\n bindtap={() => props.onSelect(index)}\n >\n {/* Sibling order is paint order in Lynx: the active pill goes first, behind the label. */}\n {!fixed && active ? (\n <view\n className={pill ? 'g9-tabs__cell-pill' : 'g9-tabs__cell-underline'}\n style={pill ? {} : { backgroundColor: indicator }}\n />\n ) : null}\n {position > 0 && !pill ? <view className=\"g9-tabs__separator\" /> : null}\n <view className=\"g9-tabs__cell-row\" style={g9RowStyle(direction)}>\n <G9IconSlot\n emoji={item.emoji}\n icon={item.icon}\n imagePath={item.imagePath}\n image={item.image}\n size={18}\n color={textColor}\n />\n {item.text ? (\n <text className=\"g9-tabs__label\" style={{ color: textColor, fontWeight: active ? '600' : '400' }}>\n {item.text}\n </text>\n ) : null}\n {badge === 'dot' ? (\n <view className=\"g9-tabs__badge-dot\" style={{ backgroundColor: item.badgeColor ?? 'var(--g9-error)' }} />\n ) : badge !== null ? (\n // MAUI CreateBadge: `badgeColor ?? palette.Primary` (only the dot defaults to Error).\n <view className=\"g9-tabs__badge\" style={{ backgroundColor: item.badgeColor ?? 'var(--g9-primary)' }}>\n <text className=\"g9-tabs__badge-text\">{badge}</text>\n </view>\n ) : null}\n </view>\n </view>\n );\n });\n\n const position = order.indexOf(effective);\n const slider =\n fixed && position >= 0 ? (\n <view\n className={pill ? 'g9-tabs__pill' : 'g9-tabs__underline'}\n style={{\n left: `${(position * 100) / count}%`,\n width: `${100 / count}%`,\n transition: `left ${g9TabViewMetrics.indicatorMoveMs}ms cubic-bezier(0.215, 0.61, 0.355, 1)`,\n }}\n >\n <view\n className={pill ? 'g9-tabs__pill-fill' : 'g9-tabs__underline-fill'}\n style={pill ? {} : { backgroundColor: indicator }}\n />\n </view>\n ) : null;\n\n const barStyle = {\n height: `${props.tabHeight}px`,\n backgroundColor: props.background ?? (pill ? 'var(--g9-surface-container-low)' : 'transparent'),\n };\n return (\n <view className=\"g9-tabs__bar\" style={barStyle}>\n {fixed ? (\n <view className=\"g9-tabs__cells\">\n {slider}\n {cells}\n </view>\n ) : (\n <scroll-view className=\"g9-tabs__scroller\" scroll-orientation=\"horizontal\">\n <view className=\"g9-tabs__cells g9-tabs__cells--scrollable\">{cells}</view>\n </scroll-view>\n )}\n </view>\n );\n}\n"],"names":["G9TabView","props","_props_tabStyle","_props_mode","_props_barPosition","_props_tabHeight","_props_defaultSelectedIndex","_props_routeActive","_props_tabBarBackground","_props_indicatorColor","_props_id","_props_frameCornerRadius","_props_contentPadding","_props_className","items","tabStyle","mode","barPosition","tabHeight","g9TabViewMetrics","rtl","useG9Direction","culture","useG9Culture","selected","setSelected","useControllableState","count","effective","effectiveTabIndex","keys","item","i","tabKey","activeKey","eager","eagerRef","useRef","realizer","useMemo","G9TabRealizer","setVersion","useState","pending","setPending","useEffect","token","t","startTimer","v","stopTimer","previous","reveal","setReveal","prev","tabContentSlideFrom","r","select","index","anchor","useG9Anchor","key","at","routeSegment","useG9Place","pager","swipe","order","tabVisualOrder","visualIndex","_pager_current","bar","TabBarStrip","bodyOf","active","Spinner","revealing","style","content","view","frame","thicknessCss","ViewPager","Math","event","next","Number","undefined","_","G9ActivityIndicator","_props_background","pill","direction","indicator","fixed","cellRefs","registry","useG9AnchorRegistry","latest","cellKeys","base","offs","_latest_current_items_index","_cellRefs_current_index","off","_cellRefs_current_effective","invokeNodeWhenReady","cells","position","_item_text","_item_badgeColor","_item_badgeColor1","badge","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AAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IAClE,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,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,8GAmIrB,CAAC"}
@@ -42,7 +42,21 @@ function checkBoxSvg(progress, morph, colors, disabled) {
42
42
  }
43
43
  const checkbox_G9CheckBox = forwardRef(function(props, ref) {
44
44
  var _props_defaultChecked, _props_defaultIndeterminate, _props_accessibilityLabel, _ref, _props_accessibilityLabel1;
45
- const control = useG9Control(props, 'g9-checkbox');
45
+ const control = useG9Control(props, 'g9-checkbox', {
46
+ kind: 'toggle',
47
+ label: ()=>{
48
+ var _props_accessibilityLabel;
49
+ return null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.text;
50
+ },
51
+ capabilities: {
52
+ activate: ()=>press(),
53
+ getValue: ()=>String(checked),
54
+ setValue: (v)=>{
55
+ if ('true' === v !== checked) press();
56
+ return String('true' === v);
57
+ }
58
+ }
59
+ });
46
60
  const palette = useG9Theme().palette;
47
61
  const strings = useG9Strings();
48
62
  const [checked, setChecked] = useControllableState({
@@ -1 +1 @@
1
- {"version":3,"file":"toggle/checkbox.jsx","sources":["../../src/toggle/checkbox.tsx"],"sourcesContent":["import './toggle.css';\nimport { formatColor, type G9PaletteValues, G9StringKey, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { type G9ControlBaseProps, g9RowStyle, g9TextStart, useG9Control } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Strings, useG9Theme } from '../provider/hooks';\nimport { checkMarkPath, fillAmount, nextOnTap, targetMorph, targetProgress } from './checkbox-math';\n\n/** Box size, corner and stroke (MAUI `G9Metrics` check-box values, ADR-0028). */\nexport const g9CheckBoxMetrics = Object.freeze({\n box: 20,\n corner: 6,\n stroke: 2,\n touchTarget: 48,\n progressMs: 200,\n morphMs: 150,\n});\n\n/** Colours the box is drawn with. */\nexport interface G9CheckBoxColors {\n readonly outline: string;\n readonly fill: string;\n readonly mark: string;\n}\n\n/** The palette colours of a check box (outline, fill, mark; disabled variants). */\nexport function checkBoxColors(palette: G9PaletteValues, disabled: boolean): G9CheckBoxColors {\n return {\n outline: palette.Outline,\n fill: disabled ? palette.TextDisabled : palette.Primary,\n mark: disabled ? palette.Surface : palette.OnPrimary,\n };\n}\n\n/**\n * The SVG of the box at an animation state (MAUI `G9CheckBoxDrawable`): the outline fades with `1 − fill`\n * (× 0.55 disabled), the fill grows from 78 % to 100 % with its alpha, the mark (tick → dash by `morph`) is trimmed by\n * the golden phase functions. Never mirrored in RTL.\n */\nexport function checkBoxSvg(progress: number, morph: number, colors: G9CheckBoxColors, disabled: boolean): string {\n const m = g9CheckBoxMetrics;\n const fill = fillAmount(progress);\n const outlineAlpha = (1 - fill) * (disabled ? 0.55 : 1);\n const scale = 0.78 + 0.22 * fill;\n const side = m.box * scale;\n const offset = (m.box - side) / 2;\n const r = (n: number) => Math.round(n * 1000) / 1000;\n const parts = [\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${m.box}\" height=\"${m.box}\" viewBox=\"0 0 ${m.box} ${m.box}\">`,\n ];\n if (outlineAlpha > 0.001) {\n parts.push(\n `<rect x=\"1\" y=\"1\" width=\"${m.box - 2}\" height=\"${m.box - 2}\" rx=\"${m.corner - 1}\" fill=\"none\" stroke=\"${formatColor(withAlpha(colors.outline, outlineAlpha))}\" stroke-width=\"${m.stroke}\"/>`,\n );\n }\n if (fill > 0.001) {\n parts.push(\n `<rect x=\"${r(offset)}\" y=\"${r(offset)}\" width=\"${r(side)}\" height=\"${r(side)}\" rx=\"${r(m.corner * scale)}\" fill=\"${formatColor(withAlpha(colors.fill, fill))}\"/>`,\n );\n }\n const path = checkMarkPath(progress, morph, m.box);\n if (path) {\n parts.push(\n `<path d=\"${path}\" fill=\"none\" stroke=\"${formatColor(colors.mark)}\" stroke-width=\"${m.stroke}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n );\n }\n parts.push('</svg>');\n return parts.join('');\n}\n\n/** Props of {@link G9CheckBox} (MAUI `G9CheckBox`). */\nexport interface G9CheckBoxProps extends G9ControlBaseProps {\n /** Controlled checked state (MAUI `IsChecked`). */\n readonly checked?: boolean;\n readonly defaultChecked?: boolean;\n /** Once per change of `checked` caused by the control (MAUI `CheckedChanged`); never for pushed values. */\n readonly onCheckedChange?: (checked: boolean) => void;\n /** Controlled third state (MAUI `IsIndeterminate`); a tap clears it. */\n readonly indeterminate?: boolean;\n readonly defaultIndeterminate?: boolean;\n readonly onIndeterminateChange?: (indeterminate: boolean) => void;\n /** Label at the end side; also the accessibility name. */\n readonly text?: string | null;\n /** After every user toggle, with the new state (MAUI `Command`). */\n readonly onPress?: (checked: boolean) => void;\n /** 48 px touch slot with the box at the top; false: a 20 px slot, box centred. Default true. */\n readonly reserveTouchTarget?: boolean;\n}\n\n/** Imperative handle of {@link G9CheckBox}. */\nexport interface G9CheckBoxHandle {\n /** Same as a tap (MAUI `Toggle`); ignored while disabled. */\n toggle(): void;\n}\n\n/**\n * Tri-state check box (MAUI `G9CheckBox`, ADR-0028): tap toggles, indeterminate → checked, never into\n * indeterminate. The box animates (200 ms fill/tick, 150 ms tick↔dash) by updating the SVG attribute directly\n * (`setNativeProps`), never by re-rendering per frame; the first render does not animate.\n */\nexport const G9CheckBox = forwardRef<G9CheckBoxHandle, G9CheckBoxProps>(function G9CheckBox(props, ref): ReactNode {\n const control = useG9Control(props, 'g9-checkbox');\n const palette = useG9Theme().palette;\n const strings = useG9Strings();\n const [checked, setChecked] = useControllableState<boolean>({\n value: props.checked,\n defaultValue: props.defaultChecked ?? false,\n onChange: props.onCheckedChange,\n name: 'G9CheckBox.checked',\n });\n const [indeterminate, setIndeterminate] = useControllableState<boolean>({\n value: props.indeterminate,\n defaultValue: props.defaultIndeterminate ?? false,\n onChange: props.onIndeterminateChange,\n name: 'G9CheckBox.indeterminate',\n });\n const colors = checkBoxColors(palette, control.disabled);\n const progressTarget = targetProgress(checked, indeterminate);\n const morphTarget = targetMorph(indeterminate);\n\n // Animation state lives outside React: the drawn progress/morph and the frame timer.\n const svgRef = useRef<NodesRef | null>(null);\n const drawn = useRef({ progress: progressTarget, morph: morphTarget });\n const frame = useRef<G9TimerHandle | null>(null);\n const latest = useRef({ colors, disabled: control.disabled });\n latest.current = { colors, disabled: control.disabled };\n useEffect(() => {\n const from = { ...drawn.current };\n if (from.progress === progressTarget && from.morph === morphTarget) return;\n // Unchecked → indeterminate draws the dash directly; a fade-out keeps the current mark shape.\n const morphFrom = from.progress < 0.01 ? morphTarget : from.morph;\n const morphTo = progressTarget === 0 ? morphFrom : morphTarget;\n const started = Date.now();\n const step = () => {\n const t = Date.now() - started;\n const p = Math.min(1, t / g9CheckBoxMetrics.progressMs);\n const q = Math.min(1, t / g9CheckBoxMetrics.morphMs);\n const easeOut = 1 - (1 - p) ** 3;\n const easeInOut = q < 0.5 ? 4 * q * q * q : 1 - (-2 * q + 2) ** 3 / 2;\n drawn.current = {\n progress: from.progress + (progressTarget - from.progress) * easeOut,\n morph: morphFrom + (morphTo - morphFrom) * easeInOut,\n };\n try {\n svgRef.current\n ?.setNativeProps({\n content: checkBoxSvg(\n drawn.current.progress,\n drawn.current.morph,\n latest.current.colors,\n latest.current.disabled,\n ),\n })\n .exec();\n } catch {\n // Unmounted between frames.\n }\n frame.current = p < 1 || q < 1 ? startTimer(step, 16) : null;\n };\n if (frame.current !== null) stopTimer(frame.current);\n step();\n return () => {\n if (frame.current !== null) stopTimer(frame.current);\n frame.current = null;\n };\n }, [progressTarget, morphTarget]);\n\n const toggle = () => {\n if (control.disabled) return;\n const next = nextOnTap(checked, indeterminate);\n setIndeterminate(next.indeterminate);\n setChecked(next.checked);\n props.onPress?.(next.checked);\n };\n useImperativeHandle(ref, () => ({ toggle }));\n const press = useG9Press(toggle, { blocked: control.disabled, source: 'G9CheckBox', guardMs: 0 });\n\n const reserve = props.reserveTouchTarget !== false;\n const text = props.text && props.text.trim() !== '' ? props.text : null;\n const state = indeterminate\n ? strings.get(G9StringKey.PartiallyChecked)\n : checked\n ? strings.get(G9StringKey.Checked)\n : strings.get(G9StringKey.NotChecked);\n return (\n <view\n className={`${control.className}${text ? ' g9-checkbox--labelled' : ''}`}\n {...control.idProps}\n style={g9RowStyle(control.direction)}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-value={state}\n {...((props.accessibilityLabel ?? text) ? { 'accessibility-label': props.accessibilityLabel ?? text ?? '' } : {})}\n bindtap={press}\n >\n <view\n className={`g9-checkbox__slot${reserve ? ' g9-checkbox__slot--reserve' : ''}`}\n style={{ width: `${reserve ? g9CheckBoxMetrics.touchTarget : g9CheckBoxMetrics.box}px` }}\n >\n <svg\n ref={svgRef}\n className=\"g9-checkbox__box\"\n content={checkBoxSvg(drawn.current.progress, drawn.current.morph, colors, control.disabled)}\n />\n </view>\n {text ? (\n <text\n className=\"g9-checkbox__text\"\n style={{\n ...g9TextStart(control.direction),\n color: control.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n paddingTop: reserve ? '12px' : '0px',\n paddingBottom: reserve ? '12px' : '0px',\n }}\n >\n {text}\n </text>\n ) : null}\n </view>\n );\n});\n"],"names":["g9CheckBoxMetrics","Object","checkBoxColors","palette","disabled","checkBoxSvg","progress","morph","colors","m","fill","fillAmount","outlineAlpha","scale","side","offset","r","n","Math","parts","formatColor","withAlpha","path","checkMarkPath","G9CheckBox","forwardRef","props","ref","_props_defaultChecked","_props_defaultIndeterminate","_props_accessibilityLabel","_ref","control","useG9Control","useG9Theme","strings","useG9Strings","checked","setChecked","useControllableState","indeterminate","setIndeterminate","progressTarget","targetProgress","morphTarget","targetMorph","svgRef","useRef","drawn","frame","latest","useEffect","from","morphFrom","morphTo","started","Date","step","t","p","q","easeOut","easeInOut","_svgRef_current","startTimer","stopTimer","toggle","next","nextOnTap","useImperativeHandle","press","useG9Press","reserve","text1","state","G9StringKey","view","g9RowStyle","svg","text","g9TextStart"],"mappings":";;;;;;;;;AAYO,MAAMA,oBAAoBC,OAAO,MAAM,CAAC;IAC7C,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS;AACX;AAUO,SAASC,eAAeC,OAAwB,EAAEC,QAAiB;IACxE,OAAO;QACL,SAASD,QAAQ,OAAO;QACxB,MAAMC,WAAWD,QAAQ,YAAY,GAAGA,QAAQ,OAAO;QACvD,MAAMC,WAAWD,QAAQ,OAAO,GAAGA,QAAQ,SAAS;IACtD;AACF;AAOO,SAASE,YAAYC,QAAgB,EAAEC,KAAa,EAAEC,MAAwB,EAAEJ,QAAiB;IACtG,MAAMK,IAAIT;IACV,MAAMU,OAAOC,WAAWL;IACxB,MAAMM,eAAgB,KAAIF,IAAG,IAAMN,CAAAA,WAAW,OAAO;IACrD,MAAMS,QAAQ,OAAO,OAAOH;IAC5B,MAAMI,OAAOL,EAAE,GAAG,GAAGI;IACrB,MAAME,SAAUN,A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OAAO;QACL,GAAGC,YAAYhD,QAAQ,SAAS,CAAC;QACjC,OAAOA,QAAQ,QAAQ,GAAG,4BAA4B;QACtD,YAAYwC,UAAU,SAAS;QAC/B,eAAeA,UAAU,SAAS;IACpC,GACD;UACC,CAACC,MAAK;QACR,EAAEM,QACA,KAAK;IACX,EAAEH;AAEN"}
1
+ {"version":3,"file":"toggle/checkbox.jsx","sources":["../../src/toggle/checkbox.tsx"],"sourcesContent":["import './toggle.css';\nimport { formatColor, type G9PaletteValues, G9StringKey, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef } from '@lynx-js/react';\nimport type { NodesRef } from '@lynx-js/types';\nimport { type G9ControlBaseProps, g9RowStyle, g9TextStart, useG9Control } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Strings, useG9Theme } from '../provider/hooks';\nimport { checkMarkPath, fillAmount, nextOnTap, targetMorph, targetProgress } from './checkbox-math';\n\n/** Box size, corner and stroke (MAUI `G9Metrics` check-box values, ADR-0028). */\nexport const g9CheckBoxMetrics = Object.freeze({\n box: 20,\n corner: 6,\n stroke: 2,\n touchTarget: 48,\n progressMs: 200,\n morphMs: 150,\n});\n\n/** Colours the box is drawn with. */\nexport interface G9CheckBoxColors {\n readonly outline: string;\n readonly fill: string;\n readonly mark: string;\n}\n\n/** The palette colours of a check box (outline, fill, mark; disabled variants). */\nexport function checkBoxColors(palette: G9PaletteValues, disabled: boolean): G9CheckBoxColors {\n return {\n outline: palette.Outline,\n fill: disabled ? palette.TextDisabled : palette.Primary,\n mark: disabled ? palette.Surface : palette.OnPrimary,\n };\n}\n\n/**\n * The SVG of the box at an animation state (MAUI `G9CheckBoxDrawable`): the outline fades with `1 − fill`\n * (× 0.55 disabled), the fill grows from 78 % to 100 % with its alpha, the mark (tick → dash by `morph`) is trimmed by\n * the golden phase functions. Never mirrored in RTL.\n */\nexport function checkBoxSvg(progress: number, morph: number, colors: G9CheckBoxColors, disabled: boolean): string {\n const m = g9CheckBoxMetrics;\n const fill = fillAmount(progress);\n const outlineAlpha = (1 - fill) * (disabled ? 0.55 : 1);\n const scale = 0.78 + 0.22 * fill;\n const side = m.box * scale;\n const offset = (m.box - side) / 2;\n const r = (n: number) => Math.round(n * 1000) / 1000;\n const parts = [\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${m.box}\" height=\"${m.box}\" viewBox=\"0 0 ${m.box} ${m.box}\">`,\n ];\n if (outlineAlpha > 0.001) {\n parts.push(\n `<rect x=\"1\" y=\"1\" width=\"${m.box - 2}\" height=\"${m.box - 2}\" rx=\"${m.corner - 1}\" fill=\"none\" stroke=\"${formatColor(withAlpha(colors.outline, outlineAlpha))}\" stroke-width=\"${m.stroke}\"/>`,\n );\n }\n if (fill > 0.001) {\n parts.push(\n `<rect x=\"${r(offset)}\" y=\"${r(offset)}\" width=\"${r(side)}\" height=\"${r(side)}\" rx=\"${r(m.corner * scale)}\" fill=\"${formatColor(withAlpha(colors.fill, fill))}\"/>`,\n );\n }\n const path = checkMarkPath(progress, morph, m.box);\n if (path) {\n parts.push(\n `<path d=\"${path}\" fill=\"none\" stroke=\"${formatColor(colors.mark)}\" stroke-width=\"${m.stroke}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n );\n }\n parts.push('</svg>');\n return parts.join('');\n}\n\n/** Props of {@link G9CheckBox} (MAUI `G9CheckBox`). */\nexport interface G9CheckBoxProps extends G9ControlBaseProps {\n /** Controlled checked state (MAUI `IsChecked`). */\n readonly checked?: boolean;\n readonly defaultChecked?: boolean;\n /** Once per change of `checked` caused by the control (MAUI `CheckedChanged`); never for pushed values. */\n readonly onCheckedChange?: (checked: boolean) => void;\n /** Controlled third state (MAUI `IsIndeterminate`); a tap clears it. */\n readonly indeterminate?: boolean;\n readonly defaultIndeterminate?: boolean;\n readonly onIndeterminateChange?: (indeterminate: boolean) => void;\n /** Label at the end side; also the accessibility name. */\n readonly text?: string | null;\n /** After every user toggle, with the new state (MAUI `Command`). */\n readonly onPress?: (checked: boolean) => void;\n /** 48 px touch slot with the box at the top; false: a 20 px slot, box centred. Default true. */\n readonly reserveTouchTarget?: boolean;\n}\n\n/** Imperative handle of {@link G9CheckBox}. */\nexport interface G9CheckBoxHandle {\n /** Same as a tap (MAUI `Toggle`); ignored while disabled. */\n toggle(): void;\n}\n\n/**\n * Tri-state check box (MAUI `G9CheckBox`, ADR-0028): tap toggles, indeterminate → checked, never into\n * indeterminate. The box animates (200 ms fill/tick, 150 ms tick↔dash) by updating the SVG attribute directly\n * (`setNativeProps`), never by re-rendering per frame; the first render does not animate.\n */\nexport const G9CheckBox = forwardRef<G9CheckBoxHandle, G9CheckBoxProps>(function G9CheckBox(props, ref): ReactNode {\n const control = useG9Control(props, 'g9-checkbox', {\n kind: 'toggle',\n label: () => props.accessibilityLabel ?? props.text,\n capabilities: {\n activate: () => press(),\n getValue: () => String(checked),\n setValue: (v) => {\n if ((v === 'true') !== checked) press();\n return String(v === 'true');\n },\n },\n });\n const palette = useG9Theme().palette;\n const strings = useG9Strings();\n const [checked, setChecked] = useControllableState<boolean>({\n value: props.checked,\n defaultValue: props.defaultChecked ?? false,\n onChange: props.onCheckedChange,\n name: 'G9CheckBox.checked',\n });\n const [indeterminate, setIndeterminate] = useControllableState<boolean>({\n value: props.indeterminate,\n defaultValue: props.defaultIndeterminate ?? false,\n onChange: props.onIndeterminateChange,\n name: 'G9CheckBox.indeterminate',\n });\n const colors = checkBoxColors(palette, control.disabled);\n const progressTarget = targetProgress(checked, indeterminate);\n const morphTarget = targetMorph(indeterminate);\n\n // Animation state lives outside React: the drawn progress/morph and the frame timer.\n const svgRef = useRef<NodesRef | null>(null);\n const drawn = useRef({ progress: progressTarget, morph: morphTarget });\n const frame = useRef<G9TimerHandle | null>(null);\n const latest = useRef({ colors, disabled: control.disabled });\n latest.current = { colors, disabled: control.disabled };\n useEffect(() => {\n const from = { ...drawn.current };\n if (from.progress === progressTarget && from.morph === morphTarget) return;\n // Unchecked → indeterminate draws the dash directly; a fade-out keeps the current mark shape.\n const morphFrom = from.progress < 0.01 ? morphTarget : from.morph;\n const morphTo = progressTarget === 0 ? morphFrom : morphTarget;\n const started = Date.now();\n const step = () => {\n const t = Date.now() - started;\n const p = Math.min(1, t / g9CheckBoxMetrics.progressMs);\n const q = Math.min(1, t / g9CheckBoxMetrics.morphMs);\n const easeOut = 1 - (1 - p) ** 3;\n const easeInOut = q < 0.5 ? 4 * q * q * q : 1 - (-2 * q + 2) ** 3 / 2;\n drawn.current = {\n progress: from.progress + (progressTarget - from.progress) * easeOut,\n morph: morphFrom + (morphTo - morphFrom) * easeInOut,\n };\n try {\n svgRef.current\n ?.setNativeProps({\n content: checkBoxSvg(\n drawn.current.progress,\n drawn.current.morph,\n latest.current.colors,\n latest.current.disabled,\n ),\n })\n .exec();\n } catch {\n // Unmounted between frames.\n }\n frame.current = p < 1 || q < 1 ? startTimer(step, 16) : null;\n };\n if (frame.current !== null) stopTimer(frame.current);\n step();\n return () => {\n if (frame.current !== null) stopTimer(frame.current);\n frame.current = null;\n };\n }, [progressTarget, morphTarget]);\n\n const toggle = () => {\n if (control.disabled) return;\n const next = nextOnTap(checked, indeterminate);\n setIndeterminate(next.indeterminate);\n setChecked(next.checked);\n props.onPress?.(next.checked);\n };\n useImperativeHandle(ref, () => ({ toggle }));\n const press = useG9Press(toggle, { blocked: control.disabled, source: 'G9CheckBox', guardMs: 0 });\n\n const reserve = props.reserveTouchTarget !== false;\n const text = props.text && props.text.trim() !== '' ? props.text : null;\n const state = indeterminate\n ? strings.get(G9StringKey.PartiallyChecked)\n : checked\n ? strings.get(G9StringKey.Checked)\n : strings.get(G9StringKey.NotChecked);\n return (\n <view\n className={`${control.className}${text ? ' g9-checkbox--labelled' : ''}`}\n {...control.idProps}\n style={g9RowStyle(control.direction)}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-value={state}\n {...((props.accessibilityLabel ?? text) ? { 'accessibility-label': props.accessibilityLabel ?? text ?? '' } : {})}\n bindtap={press}\n >\n <view\n className={`g9-checkbox__slot${reserve ? ' g9-checkbox__slot--reserve' : ''}`}\n style={{ width: `${reserve ? g9CheckBoxMetrics.touchTarget : g9CheckBoxMetrics.box}px` }}\n >\n <svg\n ref={svgRef}\n className=\"g9-checkbox__box\"\n content={checkBoxSvg(drawn.current.progress, drawn.current.morph, colors, control.disabled)}\n />\n </view>\n {text ? (\n <text\n className=\"g9-checkbox__text\"\n style={{\n ...g9TextStart(control.direction),\n color: control.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n paddingTop: reserve ? '12px' : '0px',\n paddingBottom: reserve ? '12px' : '0px',\n }}\n >\n {text}\n </text>\n ) : null}\n </view>\n );\n});\n"],"names":["g9CheckBoxMetrics","Object","checkBoxColors","palette","disabled","checkBoxSvg","progress","morph","colors","m","fill","fillAmount","outlineAlpha","scale","side","offset","r","n","Math","parts","formatColor","withAlpha","path","checkMarkPath","G9CheckBox","forwardRef","props","ref","_props_defaultChecked","_props_defaultIndeterminate","_props_accessibilityLabel","_ref","control","useG9Control","press","String","checked","v","useG9Theme","strings","useG9Strings","setChecked","useControllableState","indeterminate","setIndeterminate","progressTarget","targetProgress","morphTarget","targetMorph","svgRef","useRef","drawn","frame","latest","useEffect","from","morphFrom","morphTo","started","Date","step","t","p","q","easeOut","easeInOut","_svgRef_current","startTimer","stopTimer","toggle","next","nextOnTap","useImperativeHandle","useG9Press","reserve","text1","state","G9StringKey","view","g9RowStyle","svg","text","g9TextStart"],"mappings":";;;;;;;;;AAYO,MAAMA,oBAAoBC,OAAO,MAAM,CAAC;IAC7C,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,aAAa;IACb,YAAY;IACZ,SAAS;AACX;AAUO,SAASC,eAAeC,OAAwB,EAAEC,QAAiB;IACxE,OAAO;QACL,SAASD,QAAQ,OAAO;QACxB,MAAMC,WAAW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,qBAAqB,SACrB,qBAAqB4C,QACpB,GAAI,AAAC,SAAA9C,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4B6C,KAAI,IAAI;QAAE,uBAAuB,QAAA5C,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,6BAA4B4C,KAAI,IAAhC5C,OAAoC;IAAG,IAAI,CAAC,CAAC,EAChH,SAASG,OACV;MACC,CAAC4C,KACC,WAAW,CAAC,iBAAiB,EAAEJ,UAAU,gCAAgC,IAAI,EAC7E,OAAO;QAAE,OAAO,GAAGA,UAAU1E,kBAAkB,WAAW,GAAGA,kBAAkB,GAAG,CAAC,EAAE,CAAC;IAAC,GACxF;QACC,CAACgF,IACC,KAAK/B,QACL,UAAU,mBACV,SAAS5C,YAAY8C,MAAM,OAAO,CAAC,QAAQ,EAAEA,MAAM,OAAO,CAAC,KAAK,EAAE3C,QAAQwB,QAAQ,QAAQ,IAC1F;MACJ,EAAE8C,KAAK;MACP,CAACH,SACEM,KACC,UAAU,oBACV,OAAO;QACL,GAAGC,YAAYlD,QAAQ,SAAS,CAAC;QACjC,OAAOA,QAAQ,QAAQ,GAAG,4BAA4B;QACtD,YAAY0C,UAAU,SAAS;QAC/B,eAAeA,UAAU,SAAS;IACpC,GACD;UACC,CAACC,MAAK;QACR,EAAEM,QACA,KAAK;IACX,EAAEH;AAEN"}
@@ -29,8 +29,16 @@ export interface G9ChipGroupProps extends G9ControlBaseProps {
29
29
  readonly selectedBackground?: string | null;
30
30
  /** Group-wide selected text colour. Default on-primary. */
31
31
  readonly selectedTextColor?: string | null;
32
- /** `'wrap'` (default) or one horizontally scrolling line. */
32
+ /**
33
+ * `'wrap'` (default), one horizontally scrolling line, or (MAUI 1.4.9) `'segmented'`: equal flat cells that share each
34
+ * row — AgriPad's design for short exclusive choices.
35
+ */
33
36
  readonly layoutMode?: G9ChipGroupLayoutMode;
37
+ /**
38
+ * `'segmented'` only: how many equal cells one row holds; more items wrap onto the next row in the same columns (the
39
+ * design's «مرتب‌سازی بر اساس», three a row). `0` (default) = every item on one row.
40
+ */
41
+ readonly segmentColumns?: number;
34
42
  /** Default 9 (`G9LayoutMetrics.ControlCornerRadius`). */
35
43
  readonly chipCornerRadius?: number;
36
44
  /** Check mark at the trailing edge of selected chips. Default true. */
@@ -1 +1 @@
1
- {"version":3,"file":"chip-group.d.ts","sourceRoot":"","sources":["../../src/toggle/chip-group.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAIL,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAI9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAkD,MAAM,iBAAiB,CAAC;AAE1G,OAAO,EAAE,KAAK,eAAe,EAAgB,MAAM,wBAAwB,CAAC;AAK5E,yDAAyD;AACzD,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,iHAAiH;IACjH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC/C,kCAAkC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,wBAAwB,CAAC;IAClD,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACtE,iFAAiF;IACjF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,GAA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