@g9tm/lynxcontrols 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +7 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/base/control.d.ts +24 -0
  4. package/dist/base/control.d.ts.map +1 -1
  5. package/dist/base/control.jsx +14 -2
  6. package/dist/base/control.jsx.map +1 -1
  7. package/dist/base/index.d.ts +1 -1
  8. package/dist/base/index.d.ts.map +1 -1
  9. package/dist/base/index.jsx +1 -1
  10. package/dist/base/pressable.d.ts.map +1 -1
  11. package/dist/base/pressable.jsx +1 -1
  12. package/dist/base/pressable.jsx.map +1 -1
  13. package/dist/button/button.d.ts.map +1 -1
  14. package/dist/button/button.jsx +4 -3
  15. package/dist/button/button.jsx.map +1 -1
  16. package/dist/button/header-action-button.d.ts.map +1 -1
  17. package/dist/button/header-action-button.jsx +1 -1
  18. package/dist/button/header-action-button.jsx.map +1 -1
  19. package/dist/button/icon-button.d.ts.map +1 -1
  20. package/dist/button/icon-button.jsx +1 -1
  21. package/dist/button/icon-button.jsx.map +1 -1
  22. package/dist/button/nav-card.d.ts.map +1 -1
  23. package/dist/button/nav-card.jsx +6 -5
  24. package/dist/button/nav-card.jsx.map +1 -1
  25. package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
  26. package/dist/button/vertical-icon-text-button.jsx +1 -1
  27. package/dist/button/vertical-icon-text-button.jsx.map +1 -1
  28. package/dist/display/culture-date-time-label.d.ts.map +1 -1
  29. package/dist/display/culture-date-time-label.jsx +3 -1
  30. package/dist/display/culture-date-time-label.jsx.map +1 -1
  31. package/dist/display/progress-bar.jsx +1 -1
  32. package/dist/display/progress-bar.jsx.map +1 -1
  33. package/dist/display/separator.jsx +2 -2
  34. package/dist/display/separator.jsx.map +1 -1
  35. package/dist/display/title-with-line.jsx +1 -1
  36. package/dist/display/title-with-line.jsx.map +1 -1
  37. package/dist/expander/expander.d.ts.map +1 -1
  38. package/dist/expander/expander.jsx +6 -4
  39. package/dist/expander/expander.jsx.map +1 -1
  40. package/dist/fields/fields.css +12 -4
  41. package/dist/fields/fields.css.map +1 -1
  42. package/dist/fields/index.d.ts +1 -0
  43. package/dist/fields/index.d.ts.map +1 -1
  44. package/dist/fields/index.jsx +1 -0
  45. package/dist/fields/notch.d.ts +10 -0
  46. package/dist/fields/notch.d.ts.map +1 -0
  47. package/dist/fields/notch.jsx +9 -0
  48. package/dist/fields/notch.jsx.map +1 -0
  49. package/dist/fields/outlined-field.d.ts +7 -1
  50. package/dist/fields/outlined-field.d.ts.map +1 -1
  51. package/dist/fields/outlined-field.jsx +8 -5
  52. package/dist/fields/outlined-field.jsx.map +1 -1
  53. package/dist/fields/pin-entry.d.ts +2 -0
  54. package/dist/fields/pin-entry.d.ts.map +1 -1
  55. package/dist/fields/pin-entry.jsx +2 -1
  56. package/dist/fields/pin-entry.jsx.map +1 -1
  57. package/dist/fields/text-entry.d.ts.map +1 -1
  58. package/dist/fields/text-entry.jsx +12 -2
  59. package/dist/fields/text-entry.jsx.map +1 -1
  60. package/dist/fields/use-text-input.d.ts.map +1 -1
  61. package/dist/fields/use-text-input.jsx +11 -1
  62. package/dist/fields/use-text-input.jsx.map +1 -1
  63. package/dist/host/hooks.d.ts +5 -0
  64. package/dist/host/hooks.d.ts.map +1 -1
  65. package/dist/host/hooks.jsx +4 -1
  66. package/dist/host/hooks.jsx.map +1 -1
  67. package/dist/host/index.d.ts +1 -1
  68. package/dist/host/index.d.ts.map +1 -1
  69. package/dist/host/index.jsx +1 -1
  70. package/dist/popup/frame.d.ts.map +1 -1
  71. package/dist/popup/frame.jsx +11 -3
  72. package/dist/popup/frame.jsx.map +1 -1
  73. package/dist/popup/index.d.ts +1 -1
  74. package/dist/popup/index.d.ts.map +1 -1
  75. package/dist/popup/popup.css +1 -1
  76. package/dist/popup/popup.css.map +1 -1
  77. package/dist/popup/service.d.ts.map +1 -1
  78. package/dist/popup/service.jsx +12 -4
  79. package/dist/popup/service.jsx.map +1 -1
  80. package/dist/popup/types.d.ts +11 -0
  81. package/dist/popup/types.d.ts.map +1 -1
  82. package/dist/popup/types.jsx.map +1 -1
  83. package/dist/selection/selection-sheet.d.ts.map +1 -1
  84. package/dist/selection/selection-sheet.jsx +7 -3
  85. package/dist/selection/selection-sheet.jsx.map +1 -1
  86. package/dist/selection/selection.css +1 -0
  87. package/dist/selection/selection.css.map +1 -1
  88. package/dist/sheet/frame.d.ts +2 -0
  89. package/dist/sheet/frame.d.ts.map +1 -1
  90. package/dist/sheet/frame.jsx +134 -69
  91. package/dist/sheet/frame.jsx.map +1 -1
  92. package/dist/sheet/gesture.d.ts +51 -0
  93. package/dist/sheet/gesture.d.ts.map +1 -0
  94. package/dist/sheet/gesture.jsx +107 -0
  95. package/dist/sheet/gesture.jsx.map +1 -0
  96. package/dist/sheet/handoff.d.ts +32 -0
  97. package/dist/sheet/handoff.d.ts.map +1 -0
  98. package/dist/sheet/handoff.jsx +33 -0
  99. package/dist/sheet/handoff.jsx.map +1 -0
  100. package/dist/sheet/header.d.ts +12 -1
  101. package/dist/sheet/header.d.ts.map +1 -1
  102. package/dist/sheet/header.jsx +42 -29
  103. package/dist/sheet/header.jsx.map +1 -1
  104. package/dist/sheet/index.d.ts +3 -2
  105. package/dist/sheet/index.d.ts.map +1 -1
  106. package/dist/sheet/index.jsx +3 -2
  107. package/dist/sheet/motion.d.ts +59 -0
  108. package/dist/sheet/motion.d.ts.map +1 -0
  109. package/dist/sheet/motion.jsx +59 -0
  110. package/dist/sheet/motion.jsx.map +1 -0
  111. package/dist/sheet/options.d.ts +34 -2
  112. package/dist/sheet/options.d.ts.map +1 -1
  113. package/dist/sheet/options.jsx +2 -1
  114. package/dist/sheet/options.jsx.map +1 -1
  115. package/dist/sheet/service.d.ts.map +1 -1
  116. package/dist/sheet/service.jsx +1 -1
  117. package/dist/sheet/service.jsx.map +1 -1
  118. package/dist/sheet/sheet.css +52 -1
  119. package/dist/sheet/sheet.css.map +1 -1
  120. package/dist/sheet/sizing.d.ts +21 -3
  121. package/dist/sheet/sizing.d.ts.map +1 -1
  122. package/dist/sheet/sizing.jsx +15 -2
  123. package/dist/sheet/sizing.jsx.map +1 -1
  124. package/dist/tab-bar/tab-bar.d.ts +5 -0
  125. package/dist/tab-bar/tab-bar.d.ts.map +1 -1
  126. package/dist/tab-bar/tab-bar.jsx +5 -2
  127. package/dist/tab-bar/tab-bar.jsx.map +1 -1
  128. package/dist/toast/service.d.ts.map +1 -1
  129. package/dist/toast/service.jsx +58 -21
  130. package/dist/toast/service.jsx.map +1 -1
  131. package/dist/toast/store.d.ts +2 -0
  132. package/dist/toast/store.d.ts.map +1 -1
  133. package/dist/toast/store.jsx +4 -2
  134. package/dist/toast/store.jsx.map +1 -1
  135. package/dist/toast/toast.css +20 -13
  136. package/dist/toast/toast.css.map +1 -1
  137. package/dist/toggle/checkbox.d.ts.map +1 -1
  138. package/dist/toggle/checkbox.jsx +1 -1
  139. package/dist/toggle/checkbox.jsx.map +1 -1
  140. package/dist/toggle/chip-group.d.ts.map +1 -1
  141. package/dist/toggle/chip-group.jsx +5 -5
  142. package/dist/toggle/chip-group.jsx.map +1 -1
  143. package/dist/toggle/switch.d.ts.map +1 -1
  144. package/dist/toggle/switch.jsx +2 -2
  145. package/dist/toggle/switch.jsx.map +1 -1
  146. package/dist/toggle/toggle.css +1 -2
  147. package/dist/toggle/toggle.css.map +1 -1
  148. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/base/control.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM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O,EAAE,QAAQ,CAAC;QAAE,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,GAAG,cAAc,CASzF;AAED,gHAAgH;AAChH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAElF;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAElG;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG;IAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAErF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,GAAG;IAAE,aAAa,EAAE,KAAK,GAAG,aAAa,CAAC;IAAC,SAAS,EAAE,KAAK,CAAA;CAAE,CAE/G"}
@@ -5,9 +5,21 @@ function useG9Control(props, baseClass) {
5
5
  return {
6
6
  direction,
7
7
  disabled,
8
- className: `${baseClass} g9-dir-${direction}${disabled ? ' g9-disabled' : ''}${props.className ? ` ${props.className}` : ''}`
8
+ className: `${baseClass} g9-dir-${direction}${disabled ? ' g9-disabled' : ''}${props.className ? ` ${props.className}` : ''}`,
9
+ idProps: g9IdProps(props.id)
9
10
  };
10
11
  }
12
+ function g9IdProps(id) {
13
+ return id ? {
14
+ id
15
+ } : {};
16
+ }
17
+ function g9SafeId(id) {
18
+ return id.replace(/[^A-Za-z0-9_-]/g, '_');
19
+ }
20
+ function g9ChildId(id, part) {
21
+ return id ? g9SafeId(`${id}_${String(part)}`) : void 0;
22
+ }
11
23
  function g9TextStart(direction) {
12
24
  return {
13
25
  textAlign: 'rtl' === direction ? 'right' : 'left'
@@ -19,6 +31,6 @@ function g9RowStyle(direction) {
19
31
  direction: 'ltr'
20
32
  };
21
33
  }
22
- export { g9RowStyle, g9TextStart, useG9Control };
34
+ export { g9ChildId, g9IdProps, g9RowStyle, g9SafeId, g9TextStart, useG9Control };
23
35
 
24
36
  //# sourceMappingURL=control.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"base/control.jsx","sources":["../../src/base/control.ts"],"sourcesContent":["import { useG9Direction } from '../provider/hooks';\n\n/**\n * Props every G9 control shares (MAUI `G9ControlBase` + `IsEnabled`): plan/specs/03 §5. The MAUI lifecycle hooks\n * (`OnApplyVisuals`, `OnPaletteChanged`, `OnCultureChangedHook`, `OnAttachedToLiveTree`, `OnDetachedFromLiveTree`,\n * `OnVisibilityLost`) are React itself: render from props/theme/culture context, effects for attach/detach.\n */\nexport interface G9ControlBaseProps {\n /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */\n readonly disabled?: boolean;\n /** Extra class on the control root. */\n readonly className?: string;\n /** Accessibility label of the control root. */\n readonly accessibilityLabel?: string;\n}\n\n/** What {@link useG9Control} resolves for a control root. */\nexport interface G9ControlState {\n readonly direction: 'ltr' | 'rtl';\n readonly disabled: boolean;\n /** `g9-dir-<dir>`, the disabled class and the caller's class. */\n readonly className: string;\n}\n\n/**\n * The shared control base (MAUI `G9ControlBase`): direction from the culture (set explicitly on every root, specs/02\n * §2), the disabled flag and the root class list.\n */\nexport function useG9Control(props: G9ControlBaseProps, baseClass: string): G9ControlState {\n const direction = useG9Direction();\n const disabled = props.disabled === true;\n return {\n direction,\n disabled,\n className: `${baseClass} g9-dir-${direction}${disabled ? ' g9-disabled' : ''}${props.className ? ` ${props.className}` : ''}`,\n };\n}\n\n/**\n * Inline text alignment at the reading start: stretched text in a mirrored row or column cannot rely on\n * `text-align: start`, which follows the `direction` Lynxtron ignores (E22).\n */\nexport function g9TextStart(direction: 'ltr' | 'rtl'): { textAlign: 'left' | 'right' } {\n return { textAlign: direction === 'rtl' ? 'right' : 'left' };\n}\n\n/**\n * Inline style of a horizontal flex row laid out in reading order, the same on every Lynx engine (MAUI mirrors every\n * horizontal layout under an RTL `FlowDirection`). Lynxtron ignores CSS `direction` (it neither reverses a row nor\n * aligns text), while Android/iOS document that they honour it, so a row never relies on it: RTL reverses the row\n * explicitly and pins the row's own `direction` to `ltr`, so an engine that honours `direction` does not reverse it a\n * second time (plan/specs/02 §2, troubleshooting E22).\n */\nexport function g9RowStyle(direction: 'ltr' | 'rtl'): { flexDirection: 'row' | 'row-reverse'; direction: 'ltr' } {\n return { flexDirection: direction === 'rtl' ? 'row-reverse' : 'row', direction: 'ltr' };\n}\n"],"names":["useG9Control","props","baseClass","direction","useG9Direction","disabled","g9TextStart","g9RowStyle"],"mappings":";AA4BO,SAASA,aAAaC,KAAyB,EAAEC,SAAiB;IACvE,MAAMC,YAAYC;IAClB,MAAMC,WAAWJ,AAAmB,SAAnBA,MAAM,QAAQ;IAC/B,OAAO;QACLE;QACAE;QACA,WAAW,GAAGH,UAAU,QAAQ,EAAEC,YAAYE,WAAW,iBAAiB,KAAKJ,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI;IAC/H;AACF;AAMO,SAASK,YAAYH,SAAwB;IAClD,OAAO;QAAE,WAAWA,AAAc,UAAdA,YAAsB,UAAU;IAAO;AAC7D;AASO,SAASI,WAAWJ,SAAwB;IACjD,OAAO;QAAE,eAAeA,AAAc,UAAdA,YAAsB,gBAAgB;QAAO,WAAW;IAAM;AACxF"}
1
+ {"version":3,"file":"base/control.jsx","sources":["../../src/base/control.ts"],"sourcesContent":["import { useG9Direction } from '../provider/hooks';\n\n/**\n * Props every G9 control shares (MAUI `G9ControlBase` + `IsEnabled`): plan/specs/03 §5. The MAUI lifecycle hooks\n * (`OnApplyVisuals`, `OnPaletteChanged`, `OnCultureChangedHook`, `OnAttachedToLiveTree`, `OnDetachedFromLiveTree`,\n * `OnVisibilityLost`) are React itself: render from props/theme/culture context, effects for attach/detach.\n */\nexport interface G9ControlBaseProps {\n /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */\n readonly disabled?: boolean;\n /** Extra class on the control root. */\n readonly className?: string;\n /** Accessibility label of the control root. */\n readonly accessibilityLabel?: string;\n /**\n * Element `id` of the control root (MAUI `AutomationId`): automation finds it with a selector query (`#id`) and taps\n * its bounds. Used verbatim, so keep it to `[A-Za-z0-9_-]` (a selector reads `.` as a class); parts a control derives\n * from it (`${id}_Header`, a chip's `${id}_${key}`) follow {@link g9ChildId}.\n */\n readonly id?: string;\n}\n\n/** What {@link useG9Control} resolves for a control root. */\nexport interface G9ControlState {\n readonly direction: 'ltr' | 'rtl';\n readonly disabled: boolean;\n /** `g9-dir-<dir>`, the disabled class and the caller's class. */\n readonly className: string;\n /** `{ id }` for the root when the caller set one, else `{}` (spread it onto the root element). */\n readonly idProps: Readonly<{ id?: string }>;\n}\n\n/**\n * The shared control base (MAUI `G9ControlBase`): direction from the culture (set explicitly on every root, specs/02\n * §2), the disabled flag and the root class list.\n */\nexport function useG9Control(props: G9ControlBaseProps, baseClass: string): G9ControlState {\n const direction = useG9Direction();\n const disabled = props.disabled === true;\n return {\n direction,\n disabled,\n className: `${baseClass} g9-dir-${direction}${disabled ? ' g9-disabled' : ''}${props.className ? ` ${props.className}` : ''}`,\n idProps: g9IdProps(props.id),\n };\n}\n\n/** `{ id }` when `id` is set (non-empty), else `{}`: spread onto an element that may carry an automation id. */\nexport function g9IdProps(id: string | null | undefined): Readonly<{ id?: string }> {\n return id ? { id } : {};\n}\n\n/**\n * An element id a Lynx selector can address (`#id`): every character outside `[A-Za-z0-9_-]` becomes `_`\n * (`'Popup.Ok'` → `'Popup_Ok'`; a selector reads `.` as a class).\n */\nexport function g9SafeId(id: string): string {\n return id.replace(/[^A-Za-z0-9_-]/g, '_');\n}\n\n/**\n * The id of a part derived from a control's id: {@link g9SafeId} of `${id}_${part}`. `undefined` when the control has\n * no id.\n */\nexport function g9ChildId(id: string | null | undefined, part: string | number): string | undefined {\n return id ? g9SafeId(`${id}_${String(part)}`) : undefined;\n}\n\n/**\n * Inline text alignment at the reading start: stretched text in a mirrored row or column cannot rely on\n * `text-align: start`, which follows the `direction` Lynxtron ignores (E22).\n */\nexport function g9TextStart(direction: 'ltr' | 'rtl'): { textAlign: 'left' | 'right' } {\n return { textAlign: direction === 'rtl' ? 'right' : 'left' };\n}\n\n/**\n * Inline style of a horizontal flex row laid out in reading order, the same on every Lynx engine (MAUI mirrors every\n * horizontal layout under an RTL `FlowDirection`). Lynxtron ignores CSS `direction` (it neither reverses a row nor\n * aligns text), while Android/iOS document that they honour it, so a row never relies on it: RTL reverses the row\n * explicitly and pins the row's own `direction` to `ltr`, so an engine that honours `direction` does not reverse it a\n * second time (plan/specs/02 §2, troubleshooting E22).\n */\nexport function g9RowStyle(direction: 'ltr' | 'rtl'): { flexDirection: 'row' | 'row-reverse'; direction: 'ltr' } {\n return { flexDirection: direction === 'rtl' ? 'row-reverse' : 'row', direction: 'ltr' };\n}\n"],"names":["useG9Control","props","baseClass","direction","useG9Direction","disabled","g9IdProps","id","g9SafeId","g9ChildId","part","String","undefined","g9TextStart","g9RowStyle"],"mappings":";AAoCO,SAASA,aAAaC,KAAyB,EAAEC,SAAiB;IACvE,MAAMC,YAAYC;IAClB,MAAMC,WAAWJ,AAAmB,SAAnBA,MAAM,QAAQ;IAC/B,OAAO;QACLE;QACAE;QACA,WAAW,GAAGH,UAAU,QAAQ,EAAEC,YAAYE,WAAW,iBAAiB,KAAKJ,MAAM,SAAS,GAAG,CAAC,CAAC,EAAEA,MAAM,SAAS,EAAE,GAAG,IAAI;QAC7H,SAASK,UAAUL,MAAM,EAAE;IAC7B;AACF;AAGO,SAASK,UAAUC,EAA6B;IACrD,OAAOA,KAAK;QAAEA;IAAG,IAAI,CAAC;AACxB;AAMO,SAASC,SAASD,EAAU;IACjC,OAAOA,GAAG,OAAO,CAAC,mBAAmB;AACvC;AAMO,SAASE,UAAUF,EAA6B,EAAEG,IAAqB;IAC5E,OAAOH,KAAKC,SAAS,GAAGD,GAAG,CAAC,EAAEI,OAAOD,OAAO,IAAIE;AAClD;AAMO,SAASC,YAAYV,SAAwB;IAClD,OAAO;QAAE,WAAWA,AAAc,UAAdA,YAAsB,UAAU;IAAO;AAC7D;AASO,SAASW,WAAWX,SAAwB;IACjD,OAAO;QAAE,eAAeA,AAAc,UAAdA,YAAsB,gBAAgB;QAAO,WAAW;IAAM;AACxF"}
@@ -1,4 +1,4 @@
1
- export { type G9ControlBaseProps, type G9ControlState, g9RowStyle, g9TextStart, useG9Control, } from './control.js';
1
+ export { type G9ControlBaseProps, type G9ControlState, g9ChildId, g9IdProps, g9RowStyle, g9SafeId, g9TextStart, useG9Control, } from './control.js';
2
2
  export { cornerBadgeWidth, G9CornerBadge, type G9CornerBadgeProps, g9CornerBadgeMetrics, hasCornerBadge, } from './corner-badge.js';
3
3
  export { createDisposer, type G9Disposer, useDisposer } from './disposer.js';
4
4
  export { type G9PressOptions, type G9PressVisual, g9PressGuardMs, useG9Press, usePressVisual } from './press.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/base/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,UAAU,EACV,WAAW,EACX,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,KAAK,cAAc,EAAE,KA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BAA0B,EAC/B,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { g9RowStyle, g9TextStart, useG9Control } from "./control.jsx";
1
+ export { g9ChildId, g9IdProps, g9RowStyle, g9SafeId, g9TextStart, useG9Control } from "./control.jsx";
2
2
  export { G9CornerBadge, cornerBadgeWidth, g9CornerBadgeMetrics, hasCornerBadge } from "./corner-badge.jsx";
3
3
  export { createDisposer, useDisposer } from "./disposer.jsx";
4
4
  export { g9PressGuardMs, useG9Press, usePressVisual } from "./press.jsx";
@@ -1 +1 @@
1
- {"version":3,"file":"pressable.d.ts","sourceRoot":"","sources":["../../src/base/pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,SAAS,CAAC;AAEzE,gHAAgH;AAChH,eAAO,MAAM,uBAAuB,EAAE,aAOpC,CAAC;AAEH,oCAAoC;AACpC,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CA4B9D"}
1
+ {"version":3,"file":"pressable.d.ts","sourceRoot":"","sources":["../../src/base/pressable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,SAAS,CAAC;AAEzE,gHAAgH;AAChH,eAAO,MAAM,uBAAuB,EAAE,aAOpC,CAAC;AAEH,oCAAoC;AACpC,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,2CAA2C;IAC3C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CA6B9D"}
@@ -24,7 +24,7 @@ function G9Pressable(props) {
24
24
  inMs: ms,
25
25
  outMs: ms
26
26
  }, control.disabled);
27
- return <view className={control.className} style={{
27
+ return <view className={control.className} {...control.idProps} style={{
28
28
  opacity: null != (_props_restOpacity1 = props.restOpacity) ? _props_restOpacity1 : 1
29
29
  }} {...props.accessibilityLabel ? {
30
30
  'accessibility-element': true,
@@ -1 +1 @@
1
- {"version":3,"file":"base/pressable.jsx","sources":["../../src/base/pressable.tsx"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from './control';\nimport { type G9PressVisual, useG9Press, usePressVisual } from './press';\n\n/** The standard press feedback curve (MAUI `G9PressFeedbackBehavior` defaults: 1 / 0.86 / 0.78 over 110 ms). */\nexport const g9PressFeedbackDefaults: G9PressVisual = Object.freeze({\n property: 'opacity',\n rest: 1,\n hovered: 0.86,\n pressed: 0.78,\n inMs: 110,\n outMs: 110,\n});\n\n/** Props of {@link G9Pressable}. */\nexport interface G9PressableProps extends G9ControlBaseProps {\n /** The press (MAUI `Command` + `CommandParameter`); one handler on the root, children never take the touch. */\n readonly onPress?: () => void;\n /** Opacity at rest. Default 1. */\n readonly restOpacity?: number;\n /** Opacity under a desktop pointer. Default 0.86. */\n readonly hoveredOpacity?: number;\n /** Opacity while pressed. Default 0.78. */\n readonly pressedOpacity?: number;\n /** Each tween's length. Default 110 ms. */\n readonly animationDurationMs?: number;\n readonly children?: ReactNode;\n}\n\n/**\n * Opacity press feedback around any content (MAUI `G9PressFeedbackBehavior` attached to a view; `.For(command)` is\n * `<G9Pressable onPress={…}>`). The feedback runs on the main thread; the press goes through `useG9Press`.\n */\nexport function G9Pressable(props: G9PressableProps): ReactNode {\n const control = useG9Control(props, 'g9-pressable');\n const press = useG9Press(props.onPress, { blocked: control.disabled, source: 'G9Pressable' });\n const ms = props.animationDurationMs ?? g9PressFeedbackDefaults.inMs;\n const visual = usePressVisual(\n {\n property: 'opacity',\n rest: props.restOpacity ?? g9PressFeedbackDefaults.rest,\n hovered: props.hoveredOpacity ?? (g9PressFeedbackDefaults.hovered as number),\n pressed: props.pressedOpacity ?? g9PressFeedbackDefaults.pressed,\n inMs: ms,\n outMs: ms,\n },\n control.disabled,\n );\n return (\n <view\n className={control.className}\n style={{ opacity: props.restOpacity ?? 1 }}\n {...(props.accessibilityLabel\n ? { 'accessibility-element': true, 'accessibility-label': props.accessibilityLabel }\n : {})}\n bindtap={press}\n {...visual}\n >\n {props.children}\n </view>\n );\n}\n"],"names":["g9PressFeedbackDefaults","Object","G9Pressable","props","_props_animationDurationMs","_props_restOpacity","_props_hoveredOpacity","_props_pressedOpacity","_props_restOpacity1","control","useG9Control","press","useG9Press","ms","visual","usePressVisual","view"],"mappings":";;AAKO,MAAMA,0BAAyCC,OAAO,MAAM,CAAC;IAClE,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;AACT;AAqBO,SAASC,YAAYC,KAAuB;QAGtCC,4BAIDC,oBACGC,uBACAC,uBASSC;IAjBtB,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,QAAQC,WAAWT,MAAM,OAAO,EAAE;QAAE,SAASM,QAAQ,QAAQ;QAAE,QAAQ;IAAc;IAC3F,MAAMI,KAAK,QAAAT,CAAAA,6BAAAA,MAAM,mBAAmB,AAAD,IAAxBA,6BAA6BJ,wBAAwB,IAAI;IACpE,MAAMc,SAASC,eACb;QACE,UAAU;QACV,MAAM,QAAAV,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqBL,wBAAwB,IAAI;QACvD,SAAS,QAAAM,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAyBN,wBAAwB,OAAO;QACjE,SAAS,QAAAO,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwBP,wBAAwB,OAAO;QAChE,MAAMa;QACN,OAAOA;IACT,GACAJ,QAAQ,QAAQ;IAElB,QACGO,KACC,WAAWP,QAAQ,SAAS,EAC5B,OAAO;QAAE,SAAS,QAAAD,CAAAA,sBAAAA,MAAM,WAAW,AAAD,IAAhBA,sBAAqB;IAAE,IACxC,GAAIL,MAAM,kBAAkB,GACzB;QAAE,yBAAyB;QAAM,uBAAuBA,MAAM,kBAAkB;IAAC,IACjF,CAAC,CAAC,EACN,SAASQ,QACR,GAAGG,MAAM,EACX;MACC,CAACX,MAAM,QAAQ,CAAC;IAClB,EAAEa;AAEN"}
1
+ {"version":3,"file":"base/pressable.jsx","sources":["../../src/base/pressable.tsx"],"sourcesContent":["import type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from './control';\nimport { type G9PressVisual, useG9Press, usePressVisual } from './press';\n\n/** The standard press feedback curve (MAUI `G9PressFeedbackBehavior` defaults: 1 / 0.86 / 0.78 over 110 ms). */\nexport const g9PressFeedbackDefaults: G9PressVisual = Object.freeze({\n property: 'opacity',\n rest: 1,\n hovered: 0.86,\n pressed: 0.78,\n inMs: 110,\n outMs: 110,\n});\n\n/** Props of {@link G9Pressable}. */\nexport interface G9PressableProps extends G9ControlBaseProps {\n /** The press (MAUI `Command` + `CommandParameter`); one handler on the root, children never take the touch. */\n readonly onPress?: () => void;\n /** Opacity at rest. Default 1. */\n readonly restOpacity?: number;\n /** Opacity under a desktop pointer. Default 0.86. */\n readonly hoveredOpacity?: number;\n /** Opacity while pressed. Default 0.78. */\n readonly pressedOpacity?: number;\n /** Each tween's length. Default 110 ms. */\n readonly animationDurationMs?: number;\n readonly children?: ReactNode;\n}\n\n/**\n * Opacity press feedback around any content (MAUI `G9PressFeedbackBehavior` attached to a view; `.For(command)` is\n * `<G9Pressable onPress={…}>`). The feedback runs on the main thread; the press goes through `useG9Press`.\n */\nexport function G9Pressable(props: G9PressableProps): ReactNode {\n const control = useG9Control(props, 'g9-pressable');\n const press = useG9Press(props.onPress, { blocked: control.disabled, source: 'G9Pressable' });\n const ms = props.animationDurationMs ?? g9PressFeedbackDefaults.inMs;\n const visual = usePressVisual(\n {\n property: 'opacity',\n rest: props.restOpacity ?? g9PressFeedbackDefaults.rest,\n hovered: props.hoveredOpacity ?? (g9PressFeedbackDefaults.hovered as number),\n pressed: props.pressedOpacity ?? g9PressFeedbackDefaults.pressed,\n inMs: ms,\n outMs: ms,\n },\n control.disabled,\n );\n return (\n <view\n className={control.className}\n {...control.idProps}\n style={{ opacity: props.restOpacity ?? 1 }}\n {...(props.accessibilityLabel\n ? { 'accessibility-element': true, 'accessibility-label': props.accessibilityLabel }\n : {})}\n bindtap={press}\n {...visual}\n >\n {props.children}\n </view>\n );\n}\n"],"names":["g9PressFeedbackDefaults","Object","G9Pressable","props","_props_animationDurationMs","_props_restOpacity","_props_hoveredOpacity","_props_pressedOpacity","_props_restOpacity1","control","useG9Control","press","useG9Press","ms","visual","usePressVisual","view"],"mappings":";;AAKO,MAAMA,0BAAyCC,OAAO,MAAM,CAAC;IAClE,UAAU;IACV,MAAM;IACN,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;AACT;AAqBO,SAASC,YAAYC,KAAuB;QAGtCC,4BAIDC,oBACGC,uBACAC,uBAUSC;IAlBtB,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,QAAQC,WAAWT,MAAM,OAAO,EAAE;QAAE,SAASM,QAAQ,QAAQ;QAAE,QAAQ;IAAc;IAC3F,MAAMI,KAAK,QAAAT,CAAAA,6BAAAA,MAAM,mBAAmB,AAAD,IAAxBA,6BAA6BJ,wBAAwB,IAAI;IACpE,MAAMc,SAASC,eACb;QACE,UAAU;QACV,MAAM,QAAAV,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqBL,wBAAwB,IAAI;QACvD,SAAS,QAAAM,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAyBN,wBAAwB,OAAO;QACjE,SAAS,QAAAO,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwBP,wBAAwB,OAAO;QAChE,MAAMa;QACN,OAAOA;IACT,GACAJ,QAAQ,QAAQ;IAElB,QACGO,KACC,WAAWP,QAAQ,SAAS,GAC3B,GAAGA,QAAQ,OAAO,EACnB,OAAO;QAAE,SAAS,QAAAD,CAAAA,sBAAAA,MAAM,WAAW,AAAD,IAAhBA,sBAAqB;IAAE,IACxC,GAAIL,MAAM,kBAAkB,GACzB;QAAE,yBAAyB;QAAM,uBAAuBA,MAAM,kBAAkB;IAAC,IACjF,CAAC,CAAC,EACN,SAASQ,QACR,GAAGG,MAAM,EACX;MACC,CAACX,MAAM,QAAQ,CAAC;IAClB,EAAEa;AA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EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qGAAqG;IACrG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,sGAAsG;IACtG,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,wGAAwG;IACxG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAqFxD"}
@@ -48,11 +48,12 @@ function G9Button(props) {
48
48
  };
49
49
  const label = loading ? null != (_props_loadingText = props.loadingText) ? _props_loadingText : '' : null != (_props_text = props.text) ? _props_text : '';
50
50
  const truncate = false !== props.textTruncation;
51
- return <view className={`${control.className}${preset.fill ? ' g9-button--fill' : ''}`} accessibility-element={true} accessibility-traits="button" {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.text) ? {
51
+ return <view className={`${control.className}${preset.fill ? ' g9-button--fill' : ''}`} {...control.idProps} accessibility-element={true} accessibility-traits="button" {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.text) ? {
52
52
  'accessibility-label': null != (_ref = null != (_props_accessibilityLabel1 = props.accessibilityLabel) ? _props_accessibilityLabel1 : props.text) ? _ref : ''
53
53
  } : {}} style={{
54
54
  ...g9RowStyle(control.direction),
55
55
  minHeight: `${preset.height}px`,
56
+ height: `${preset.height}px`,
56
57
  background: paint.background,
57
58
  borderColor: paint.stroke,
58
59
  borderWidth: `${paint.strokeWidth}px`,
@@ -60,8 +61,8 @@ function G9Button(props) {
60
61
  opacity: paint.opacity,
61
62
  paddingLeft: `${preset.paddingHorizontal}px`,
62
63
  paddingRight: `${preset.paddingHorizontal}px`,
63
- paddingTop: `${preset.paddingVertical}px`,
64
- paddingBottom: `${preset.paddingVertical}px`
64
+ paddingTop: '0px',
65
+ paddingBottom: '0px'
65
66
  }} bindtap={press} {...visual}>
66
67
  {loading ? <G9ActivityIndicator running size={iconSize} color={null != (_props_spinnerColor = props.spinnerColor) ? _props_spinnerColor : paint.text}/> : hasIconSlot(leading) ? <G9IconSlot {...leading} size={iconSize} color={paint.text}/> : null}
67
68
  {'' !== label.trim() ? <text className="g9-button__label" {...truncate ? {
@@ -1 +1 @@
1
- {"version":3,"file":"button/button.jsx","sources":["../../src/button/button.tsx"],"sourcesContent":["import './button.css';\nimport { type G9ButtonVariant, type G9ControlSize, type G9ImageSource, G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9RowStyle, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Theme } from '../provider/hooks';\nimport { buttonSizePreset, fontAttributesStyle, type G9FontAttributes, resolveButtonPaint } from './visuals';\n\n/** Props of {@link G9Button} (MAUI `G9Button`). */\nexport interface G9ButtonProps extends G9ControlBaseProps {\n readonly text?: string | null;\n /** Text next to the spinner while loading; empty shows the spinner only. */\n readonly loadingText?: string | null;\n /** Colour recipe. Default `'primary'`. */\n readonly variant?: G9ButtonVariant;\n /** Height, padding and font preset. Default `'medium'` (44). */\n readonly size?: G9ControlSize;\n readonly leadingEmoji?: string | null;\n readonly leadingIcon?: G9IconInput;\n readonly leadingImagePath?: string | null;\n readonly leadingImage?: G9ImageSource | null;\n readonly trailingEmoji?: string | null;\n readonly trailingIcon?: G9IconInput;\n readonly trailingImagePath?: string | null;\n readonly trailingImage?: G9ImageSource | null;\n /** Spinner instead of the icons, presses blocked, opacity 0.7, flat fill. Default false. */\n readonly isLoading?: boolean;\n /** One line with a tail ellipsis; false keeps the text on one line at its natural width. Default true. */\n readonly textTruncation?: boolean;\n /** Icon slot and spinner size. Default 20. */\n readonly iconSize?: number;\n /** Font size; default the size preset's (12/14/15/16). */\n readonly fontSize?: number;\n /** Default `'bold'`. */\n readonly fontAttributes?: G9FontAttributes;\n /** Overrides the variant fill (transparent → no fill and no border). */\n readonly baseBackgroundColor?: string | null;\n /** Overrides the text, icon and spinner colour. */\n readonly textColor?: string | null;\n /** The press (MAUI `Clicked` + `Command`): exactly once per tap, never while disabled or loading. */\n readonly onPress?: () => void;\n /** Spinner colour; default the text colour (MAUI `G9SafeButton.SpinnerColor`, which MAUI ignored). */\n readonly spinnerColor?: string;\n /** Blocks presses like `disabled` (dims to 0.38) without being `disabled` (safe buttons while busy). */\n readonly blocked?: boolean;\n}\n\n/**\n * Text button (MAUI `G9Button`): variant fill (gradient for the solid variants), 12 px corners, no shadow, optional\n * leading/trailing icons, loading state with a spinner. One press handler on the root: a tap on the icon or the label\n * fires `onPress` once (MAUI \"press must fire\"); a second tap within 300 ms is dropped; a throwing handler is\n * reported to diagnostics. Press feedback: scale 0.96 (80 ms) → 1 (150 ms) on the main thread.\n */\nexport function G9Button(props: G9ButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-button');\n const theme = useG9Theme();\n const loading = props.isLoading === true;\n const enabled = !control.disabled && props.blocked !== true;\n const preset = buttonSizePreset(props.size ?? 'medium');\n const paint = resolveButtonPaint({\n variant: props.variant ?? 'primary',\n palette: theme.palette,\n enabled,\n loading,\n baseBackgroundColor: props.baseBackgroundColor,\n textColor: props.textColor,\n kind: 'button',\n });\n const iconSize = props.iconSize && props.iconSize > 0 ? props.iconSize : G9Metrics.InputIconSize;\n const press = useG9Press(props.onPress, { blocked: !enabled || loading, source: 'G9Button' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.96, inMs: 80, outMs: 150 },\n !enabled || loading,\n );\n const leading = {\n emoji: props.leadingEmoji,\n icon: props.leadingIcon,\n imagePath: props.leadingImagePath,\n image: props.leadingImage,\n };\n const trailing = {\n emoji: props.trailingEmoji,\n icon: props.trailingIcon,\n imagePath: props.trailingImagePath,\n image: props.trailingImage,\n };\n const label = loading ? (props.loadingText ?? '') : (props.text ?? '');\n const truncate = props.textTruncation !== false;\n return (\n <view\n className={`${control.className}${preset.fill ? ' g9-button--fill' : ''}`}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? props.text)\n ? { 'accessibility-label': props.accessibilityLabel ?? props.text ?? '' }\n : {})}\n style={{\n ...g9RowStyle(control.direction),\n minHeight: `${preset.height}px`,\n background: paint.background,\n borderColor: paint.stroke,\n borderWidth: `${paint.strokeWidth}px`,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n opacity: paint.opacity,\n paddingLeft: `${preset.paddingHorizontal}px`,\n paddingRight: `${preset.paddingHorizontal}px`,\n paddingTop: `${preset.paddingVertical}px`,\n paddingBottom: `${preset.paddingVertical}px`,\n }}\n bindtap={press}\n {...visual}\n >\n {loading ? (\n <G9ActivityIndicator running size={iconSize} color={props.spinnerColor ?? paint.text} />\n ) : hasIconSlot(leading) ? (\n <G9IconSlot {...leading} size={iconSize} color={paint.text} />\n ) : null}\n {label.trim() !== '' ? (\n <text\n className=\"g9-button__label\"\n {...(truncate ? { 'text-maxline': '1' } : {})}\n style={{\n color: paint.text,\n fontSize: `${props.fontSize && props.fontSize > 0 ? props.fontSize : preset.fontSize}px`,\n ...fontAttributesStyle(props.fontAttributes ?? 'bold'),\n ...(truncate ? { textOverflow: 'ellipsis', overflow: 'hidden' } : { whiteSpace: 'nowrap' }),\n }}\n >\n {label}\n </text>\n ) : null}\n {!loading && hasIconSlot(trailing) ? <G9IconSlot {...trailing} size={iconSize} color={paint.text} /> : null}\n </view>\n );\n}\n"],"names":["G9Button","props","_props_size","_props_variant","_props_loadingText","_props_text","_props_accessibilityLabel","_ref","_props_spinnerColor","_props_fontAttributes","control","useG9Control","theme","useG9Theme","loading","enabled","preset","buttonSizePreset","paint","resolveButtonPaint","iconSize","G9Metrics","press","useG9Press","visual","usePressVisual","leading","trailing","label","truncate","view","g9RowStyle","G9ActivityIndicator","hasIconSlot","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AI,MACxD,KAAK;MACT,CAACU,AAAiB,OAAjBA,MAAM,IAAI,MACRO,KACC,UAAU,oBACT,GAAIN,WAAW;QAAE,gBAAgB;IAAI,IAAI,CAAC,CAAC,EAC5C,OAAO;QACL,OAAOX,MAAM,IAAI;QACjB,UAAU,GAAGjB,MAAM,QAAQ,IAAIA,MAAM,QAAQ,GAAG,IAAIA,MAAM,QAAQ,GAAGe,OAAO,QAAQ,CAAC,EAAE,CAAC;QACxF,GAAGoB,oBAAoB,QAAA3B,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwB,OAAO;QACtD,GAAIoB,WAAW;YAAE,cAAc;YAAY,UAAU;QAAS,IAAI;YAAE,YAAY;QAAS,CAAC;IAC5F,GACD;UACC,CAACD,MAAM;QACT,EAAEO,QACA,KAAK;MACT,CAAC,CAACrB,WAAWmB,YAAYN,aAAaO,YAAY,GAAGP,QAAQ,EAAE,MAAMP,UAAU,OAAOF,MAAM,IAAI,MAAO,KAAK;IAC9G,EAAEY;AAEN"}
1
+ {"version":3,"file":"button/button.jsx","sources":["../../src/button/button.tsx"],"sourcesContent":["import './button.css';\nimport { type G9ButtonVariant, type G9ControlSize, type G9ImageSource, G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9RowStyle, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Theme } from '../provider/hooks';\nimport { buttonSizePreset, fontAttributesStyle, type G9FontAttributes, resolveButtonPaint } from './visuals';\n\n/** Props of {@link G9Button} (MAUI `G9Button`). */\nexport interface G9ButtonProps extends G9ControlBaseProps {\n readonly text?: string | null;\n /** Text next to the spinner while loading; empty shows the spinner only. */\n readonly loadingText?: string | null;\n /** Colour recipe. Default `'primary'`. */\n readonly variant?: G9ButtonVariant;\n /** Height, padding and font preset. Default `'medium'` (44). */\n readonly size?: G9ControlSize;\n readonly leadingEmoji?: string | null;\n readonly leadingIcon?: G9IconInput;\n readonly leadingImagePath?: string | null;\n readonly leadingImage?: G9ImageSource | null;\n readonly trailingEmoji?: string | null;\n readonly trailingIcon?: G9IconInput;\n readonly trailingImagePath?: string | null;\n readonly trailingImage?: G9ImageSource | null;\n /** Spinner instead of the icons, presses blocked, opacity 0.7, flat fill. Default false. */\n readonly isLoading?: boolean;\n /** One line with a tail ellipsis; false keeps the text on one line at its natural width. Default true. */\n readonly textTruncation?: boolean;\n /** Icon slot and spinner size. Default 20. */\n readonly iconSize?: number;\n /** Font size; default the size preset's (12/14/15/16). */\n readonly fontSize?: number;\n /** Default `'bold'`. */\n readonly fontAttributes?: G9FontAttributes;\n /** Overrides the variant fill (transparent → no fill and no border). */\n readonly baseBackgroundColor?: string | null;\n /** Overrides the text, icon and spinner colour. */\n readonly textColor?: string | null;\n /** The press (MAUI `Clicked` + `Command`): exactly once per tap, never while disabled or loading. */\n readonly onPress?: () => void;\n /** Spinner colour; default the text colour (MAUI `G9SafeButton.SpinnerColor`, which MAUI ignored). */\n readonly spinnerColor?: string;\n /** Blocks presses like `disabled` (dims to 0.38) without being `disabled` (safe buttons while busy). */\n readonly blocked?: boolean;\n}\n\n/**\n * Text button (MAUI `G9Button`): variant fill (gradient for the solid variants), 12 px corners, no shadow, optional\n * leading/trailing icons, loading state with a spinner. One press handler on the root: a tap on the icon or the label\n * fires `onPress` once (MAUI \"press must fire\"); a second tap within 300 ms is dropped; a throwing handler is\n * reported to diagnostics. Press feedback: scale 0.96 (80 ms) → 1 (150 ms) on the main thread.\n */\nexport function G9Button(props: G9ButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-button');\n const theme = useG9Theme();\n const loading = props.isLoading === true;\n const enabled = !control.disabled && props.blocked !== true;\n const preset = buttonSizePreset(props.size ?? 'medium');\n const paint = resolveButtonPaint({\n variant: props.variant ?? 'primary',\n palette: theme.palette,\n enabled,\n loading,\n baseBackgroundColor: props.baseBackgroundColor,\n textColor: props.textColor,\n kind: 'button',\n });\n const iconSize = props.iconSize && props.iconSize > 0 ? props.iconSize : G9Metrics.InputIconSize;\n const press = useG9Press(props.onPress, { blocked: !enabled || loading, source: 'G9Button' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.96, inMs: 80, outMs: 150 },\n !enabled || loading,\n );\n const leading = {\n emoji: props.leadingEmoji,\n icon: props.leadingIcon,\n imagePath: props.leadingImagePath,\n image: props.leadingImage,\n };\n const trailing = {\n emoji: props.trailingEmoji,\n icon: props.trailingIcon,\n imagePath: props.trailingImagePath,\n image: props.trailingImage,\n };\n const label = loading ? (props.loadingText ?? '') : (props.text ?? '');\n const truncate = props.textTruncation !== false;\n return (\n <view\n className={`${control.className}${preset.fill ? ' g9-button--fill' : ''}`}\n {...control.idProps}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? props.text)\n ? { 'accessibility-label': props.accessibilityLabel ?? props.text ?? '' }\n : {})}\n style={{\n ...g9RowStyle(control.direction),\n // MAUI ApplySize: HeightRequest = the preset (52 hero, 44 medium…), the padding a margin around the row — the\n // button never grows with its label (a min-height let hero buttons grow to ~57 dp from the 16 px padding).\n minHeight: `${preset.height}px`,\n height: `${preset.height}px`,\n background: paint.background,\n borderColor: paint.stroke,\n borderWidth: `${paint.strokeWidth}px`,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n opacity: paint.opacity,\n paddingLeft: `${preset.paddingHorizontal}px`,\n paddingRight: `${preset.paddingHorizontal}px`,\n paddingTop: '0px',\n paddingBottom: '0px',\n }}\n bindtap={press}\n {...visual}\n >\n {loading ? (\n <G9ActivityIndicator running size={iconSize} color={props.spinnerColor ?? paint.text} />\n ) : hasIconSlot(leading) ? (\n <G9IconSlot {...leading} size={iconSize} color={paint.text} />\n ) : null}\n {label.trim() !== '' ? (\n <text\n className=\"g9-button__label\"\n {...(truncate ? { 'text-maxline': '1' } : {})}\n style={{\n color: paint.text,\n fontSize: `${props.fontSize && props.fontSize > 0 ? props.fontSize : preset.fontSize}px`,\n ...fontAttributesStyle(props.fontAttributes ?? 'bold'),\n ...(truncate ? { textOverflow: 'ellipsis', overflow: 'hidden' } : { whiteSpace: 'nowrap' }),\n }}\n >\n {label}\n </text>\n ) : null}\n {!loading && hasIconSlot(trailing) ? <G9IconSlot {...trailing} size={iconSize} color={paint.text} /> : null}\n </view>\n );\n}\n"],"names":["G9Button","props","_props_size","_props_variant","_props_loadingText","_props_text","_props_accessibilityLabel","_ref","_props_spinnerColor","_props_fontAttributes","control","useG9Control","theme","useG9Theme","loading","enabled","preset","buttonSizePreset","paint","resolveButtonPaint","iconSize","G9Metrics","press","useG9Press","visual","usePressVisual","leading","trailing","label","truncate","view","g9RowStyle","G9ActivityIndicator","hasIconSlot","G9IconSlot","text","fontAttributesStyle"],"mappings":";;;;;;;;AAwDO,SAASA,SAASC,KAAoB;QAKXC,aAErBC,gBA0BcC,oBAA4BC,aAQ3CC,2BACuBC,MAAAA,4BAsByBC,qBAWzBC;IA1EjC,MAAMC,UAAUC,aAAaV,OAAO;IACpC,MAAMW,QAAQC;IACd,MAAMC,UAAUb,AAAoB,SAApBA,MAAM,SAAS;IAC/B,MAAMc,UAAU,CAACL,QAAQ,QAAQ,IAAIT,AAAkB,SAAlBA,MAAM,OAAO;IAClD,MAAMe,SAASC,iBAAiB,QAAAf,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAc;IAC9C,MAAMgB,QAAQC,mBAAmB;QAC/B,SAAS,QAAAhB,CAAAA,iBAAAA,MAAM,OAAO,AAAD,IAAZA,iBAAiB;QAC1B,SAASS,MAAM,OAAO;QACtBG;QACAD;QACA,qBAAqBb,MAAM,mBAAmB;QAC9C,WAAWA,MAAM,SAAS;QAC1B,MAAM;IACR;IACA,MAAMmB,WAAWnB,MAAM,QAAQ,IAAIA,MAAM,QAAQ,GAAG,IAAIA,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E,yBAAyB,GAAG,SAAS,CA+ChF"}
@@ -29,7 +29,7 @@ function G9HeaderActionButton(props) {
29
29
  const text1 = null != (_props_buttonText = props.buttonText) ? _props_buttonText : '';
30
30
  let content;
31
31
  content = busy ? <G9ActivityIndicator running size={20} color="var(--g9-on-surface-variant)"/> : props.iconImage ? <G9IconSlot image={props.iconImage} size={iconSize}/> : '' !== text1.trim() ? <text className="g9-header-action__text">{text1}</text> : <G9IconSlot icon={null != (_props_icon = props.icon) ? _props_icon : G9Glyph.Menu} size={iconSize} color="var(--g9-on-surface-variant)"/>;
32
- return <view className={control.className} style={{
32
+ return <view className={control.className} {...control.idProps} style={{
33
33
  width: `${size}px`,
34
34
  height: `${size}px`,
35
35
  opacity: control.disabled || busy ? 0.5 : 1,
@@ -1 +1 @@
1
- {"version":3,"file":"button/header-action-button.jsx","sources":["../../src/button/header-action-button.tsx"],"sourcesContent":["import './button.css';\nimport { formatColor, G9Glyph, type G9ImageSource, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Theme } from '../provider/hooks';\n\n/** MAUI `G9LayoutMetrics.ToolbarIconSize` / `ToolbarButtonSize`. */\nexport const g9ToolbarIconSize = 24;\n/** Touch box of a toolbar / header action button (MAUI `G9LayoutMetrics.ToolbarButtonSize`). */\nexport const g9ToolbarButtonSize = 42;\n\n/** Props of {@link G9HeaderActionButton} (MAUI `G9HeaderActionButton`). */\nexport interface G9HeaderActionButtonProps extends G9ControlBaseProps {\n /** Glyph shown when there is no image and no text. Default `G9Glyph.Menu`. */\n readonly icon?: G9IconInput;\n /** Image; wins over text and glyph. */\n readonly iconImage?: G9ImageSource | null;\n /** Bold 13 label (wins over the glyph). */\n readonly buttonText?: string | null;\n /** Spinner instead of the content; presses blocked. Default false. */\n readonly isBusy?: boolean;\n /** Tinted active state. Default false. */\n readonly isActive?: boolean;\n /** The 8 px dot while active. Default true. */\n readonly showActiveBadge?: boolean;\n /** Scale 0.92 (70 ms) → 1 (90 ms) on press. Default true. */\n readonly animatePress?: boolean;\n /** Default 24. */\n readonly iconSize?: number;\n /** Square size; ≤ 0 → 42 (MAUI `ToolbarButtonSize`). Default 0. */\n readonly buttonSize?: number;\n readonly onPress?: () => void;\n}\n\n/** Toolbar/header action (MAUI `G9HeaderActionButton`): bordered square with a glyph, image or short text. */\nexport function G9HeaderActionButton(props: G9HeaderActionButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-header-action');\n const palette = useG9Theme().palette;\n const busy = props.isBusy === true;\n const active = props.isActive === true;\n const size = props.buttonSize && props.buttonSize > 0 ? props.buttonSize : g9ToolbarButtonSize;\n const iconSize = props.iconSize ?? g9ToolbarIconSize;\n const press = useG9Press(props.onPress, { blocked: control.disabled || busy, source: 'G9HeaderActionButton' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.92, inMs: 70, outMs: 90 },\n control.disabled || busy || props.animatePress === false,\n );\n const text = props.buttonText ?? '';\n let content: ReactNode;\n if (busy) content = <G9ActivityIndicator running size={20} color=\"var(--g9-on-surface-variant)\" />;\n else if (props.iconImage) content = <G9IconSlot image={props.iconImage} size={iconSize} />;\n else if (text.trim() !== '') content = <text className=\"g9-header-action__text\">{text}</text>;\n else content = <G9IconSlot icon={props.icon ?? G9Glyph.Menu} size={iconSize} color=\"var(--g9-on-surface-variant)\" />;\n return (\n <view\n className={control.className}\n style={{\n width: `${size}px`,\n height: `${size}px`,\n opacity: control.disabled || busy ? 0.5 : 1,\n ...(active\n ? {\n backgroundColor: formatColor(withAlpha(palette.Primary, 0.12)),\n borderColor: formatColor(withAlpha(palette.Primary, 0.38)),\n }\n : {}),\n }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? (text || undefined))\n ? { 'accessibility-label': props.accessibilityLabel ?? text }\n : {})}\n bindtap={press}\n {...visual}\n >\n {content}\n {active && props.showActiveBadge !== false ? (\n <view className=\"g9-header-action__badge\" style={{ [control.direction === 'rtl' ? 'left' : 'right']: '6px' }} />\n ) : null}\n </view>\n );\n}\n"],"names":["g9ToolbarIconSize","g9ToolbarButtonSize","G9HeaderActionButton","props","_props_iconSize","_props_buttonText","_props_icon","_props_accessibilityLabel","_props_accessibilityLabel1","control","useG9Control","palette","useG9Theme","busy","active","size","iconSize","press","useG9Press","visual","usePressVisual","text1","content","G9ActivityIndicator","G9IconSlot","text","G9Glyph","view","formatColor","withAlpha","undefined"],"mappings":";;;;;;;AAWO,MAAMA,oBAAoB;AAE1B,MAAMC,sBAAsB;AA0B5B,SAASC,qBAAqBC,KAAgC;QAMlDC,iBAMJC,mBAKoBC,aAiBvBC,2BACuBC;IAlCjC,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,UAAUC,aAAa,OAAO;IACpC,MAAMC,OAAOV,AAAiB,SAAjBA,MAAM,MAAM;IACzB,MAAMW,SAASX,AAAmB,SAAnBA,MAAM,QAAQ;IAC7B,MAAMY,OAAOZ,MAAM,UAAU,IAAIA,MAAM,UAAU,GAAG,IAAIA,MAAM,UAAU,GAAGF;IAC3E,MAAMe,WAAW,QAAAZ,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,kBAAkBJ;IACnC,MAAMiB,QAAQC,WAAWf,MAAM,OAAO,EAAE;QAAE,SAASM,QAAQ,QAAQ,IAAII;QAAM,QAAQ;IAAuB;IAC5G,MAAMM,SAASC,eACb;QAAE,UAAU;QAAS,MAAM;QAAG,SAAS;QAAM,MAAM;QAAI,OAAO;IAAG,GACjEX,QAAQ,QAAQ,IAAII,QAAQV,AAAuB,UAAvBA,MAAM,YAAY;IAEhD,MAAMkB,QAAAA,QAAOhB,CAAAA,oBAAAA,MAAM,UAAU,AAAD,IAAfA,oBAAoB;IACjC,IAAIiB;IACMA,UAANT,QAAiBU,oBAAoB,QAAQ,MAAM,IAAI,MAAM,mCACxDpB,MAAM,SAAS,IAAaqB,WAAW,OAAOrB,MAAM,SAAS,EAAE,MAAMa,cACrEK,AAAgB,OAAhBA,MAAK,IAAI,MAAsBI,KAAK,UAAU,0BAA0BJ,QAAOI,SACxED,WAAW,MAAM,QAAAlB,CAAAA,cAAAA,MAAM,IAAI,AAAD,IAATA,cAAcoB,QAAQ,IAAI,EAAE,MAAMV,UAAU,MAAM;IACnF,QACGW,KACC,WAAWlB,QAAQ,SAAS,EAC5B,OAAO;QACL,OAAO,GAAGM,KAAK,EAAE,CAAC;QAClB,QAAQ,GAAGA,KAAK,EAAE,CAAC;QACnB,SAASN,QAAQ,QAAQ,IAAII,OAAO,MAAM;QAC1C,GAAIC,SACA;YACE,iBAAiBc,YAAYC,UAAUlB,QAAQ,OAAO,EAAE;YACxD,aAAaiB,YAAYC,UAAUlB,QAAQ,OAAO,EAAE;QACtD,IACA,CAAC,CAAC;IACR,GACA,uBAAuB,MACvB,qBAAqB,UACpB,GAAI,AAAC,SAAAJ,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA6Bc,SAAQS,MAAQ,IAC/C;QAAE,uBAAuB,QAAAtB,CAAAA,6BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,6BAA4Ba;IAAK,IAC1D,CAAC,CAAC,EACN,SAASJ,QACR,GAAGE,MAAM,EACX;MACC,CAACG,QAAQ;MACT,CAACR,UAAUX,AAA0B,UAA1BA,MAAM,eAAe,IAC7BwB,KAAK,UAAU,0BAA0B,OAAO;QAAE,CAAClB,AAAsB,UAAtBA,QAAQ,SAAS,GAAa,SAAS,QAAQ,EAAE;IAAM,OACzG,KAAK;IACX,EAAEkB;AAEN"}
1
+ {"version":3,"file":"button/header-action-button.jsx","sources":["../../src/button/header-action-button.tsx"],"sourcesContent":["import './button.css';\nimport { formatColor, G9Glyph, type G9ImageSource, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Theme } from '../provider/hooks';\n\n/** MAUI `G9LayoutMetrics.ToolbarIconSize` / `ToolbarButtonSize`. */\nexport const g9ToolbarIconSize = 24;\n/** Touch box of a toolbar / header action button (MAUI `G9LayoutMetrics.ToolbarButtonSize`). */\nexport const g9ToolbarButtonSize = 42;\n\n/** Props of {@link G9HeaderActionButton} (MAUI `G9HeaderActionButton`). */\nexport interface G9HeaderActionButtonProps extends G9ControlBaseProps {\n /** Glyph shown when there is no image and no text. Default `G9Glyph.Menu`. */\n readonly icon?: G9IconInput;\n /** Image; wins over text and glyph. */\n readonly iconImage?: G9ImageSource | null;\n /** Bold 13 label (wins over the glyph). */\n readonly buttonText?: string | null;\n /** Spinner instead of the content; presses blocked. Default false. */\n readonly isBusy?: boolean;\n /** Tinted active state. Default false. */\n readonly isActive?: boolean;\n /** The 8 px dot while active. Default true. */\n readonly showActiveBadge?: boolean;\n /** Scale 0.92 (70 ms) → 1 (90 ms) on press. Default true. */\n readonly animatePress?: boolean;\n /** Default 24. */\n readonly iconSize?: number;\n /** Square size; ≤ 0 → 42 (MAUI `ToolbarButtonSize`). Default 0. */\n readonly buttonSize?: number;\n readonly onPress?: () => void;\n}\n\n/** Toolbar/header action (MAUI `G9HeaderActionButton`): bordered square with a glyph, image or short text. */\nexport function G9HeaderActionButton(props: G9HeaderActionButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-header-action');\n const palette = useG9Theme().palette;\n const busy = props.isBusy === true;\n const active = props.isActive === true;\n const size = props.buttonSize && props.buttonSize > 0 ? props.buttonSize : g9ToolbarButtonSize;\n const iconSize = props.iconSize ?? g9ToolbarIconSize;\n const press = useG9Press(props.onPress, { blocked: control.disabled || busy, source: 'G9HeaderActionButton' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.92, inMs: 70, outMs: 90 },\n control.disabled || busy || props.animatePress === false,\n );\n const text = props.buttonText ?? '';\n let content: ReactNode;\n if (busy) content = <G9ActivityIndicator running size={20} color=\"var(--g9-on-surface-variant)\" />;\n else if (props.iconImage) content = <G9IconSlot image={props.iconImage} size={iconSize} />;\n else if (text.trim() !== '') content = <text className=\"g9-header-action__text\">{text}</text>;\n else content = <G9IconSlot icon={props.icon ?? G9Glyph.Menu} size={iconSize} color=\"var(--g9-on-surface-variant)\" />;\n return (\n <view\n className={control.className}\n {...control.idProps}\n style={{\n width: `${size}px`,\n height: `${size}px`,\n opacity: control.disabled || busy ? 0.5 : 1,\n ...(active\n ? {\n backgroundColor: formatColor(withAlpha(palette.Primary, 0.12)),\n borderColor: formatColor(withAlpha(palette.Primary, 0.38)),\n }\n : {}),\n }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? (text || undefined))\n ? { 'accessibility-label': props.accessibilityLabel ?? text }\n : {})}\n bindtap={press}\n {...visual}\n >\n {content}\n {active && props.showActiveBadge !== false ? (\n <view className=\"g9-header-action__badge\" style={{ [control.direction === 'rtl' ? 'left' : 'right']: '6px' }} />\n ) : null}\n </view>\n );\n}\n"],"names":["g9ToolbarIconSize","g9ToolbarButtonSize","G9HeaderActionButton","props","_props_iconSize","_props_buttonText","_props_icon","_props_accessibilityLabel","_props_accessibilityLabel1","control","useG9Control","palette","useG9Theme","busy","active","size","iconSize","press","useG9Press","visual","usePressVisual","text1","content","G9ActivityIndicator","G9IconSlot","text","G9Glyph","view","formatColor","withAlpha","undefined"],"mappings":";;;;;;;AAWO,MAAMA,oBAAoB;AAE1B,MAAMC,sBAAsB;AA0B5B,SAASC,qBAAqBC,KAAgC;QAMlDC,iBAMJC,mBAKoBC,aAkBvBC,2BACuBC;IAnCjC,MAAMC,UAAUC,aAAaP,OAAO;IAC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AiC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,oBAAoB;IACpB,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,uFAAuF;IACvF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA2EhE"}
@@ -40,7 +40,7 @@ function G9IconButton(props) {
40
40
  const touch = Math.max(null != (_props_minimumTouchTarget = props.minimumTouchTarget) ? _props_minimumTouchTarget : 0, size);
41
41
  const name = null != (_props_accessibilityText = props.accessibilityText) ? _props_accessibilityText : props.accessibilityLabel;
42
42
  const hint = loading ? strings.get(G9StringKey.Loading) : null != (_props_badgeText = props.badgeText) ? _props_badgeText : void 0;
43
- return <view className={control.className} style={{
43
+ return <view className={control.className} {...control.idProps} style={{
44
44
  minWidth: `${touch}px`,
45
45
  minHeight: `${touch}px`
46
46
  }} accessibility-element={true} accessibility-traits="button" {...name ? {
@@ -1 +1 @@
1
- {"version":3,"file":"button/icon-button.jsx","sources":["../../src/button/icon-button.tsx"],"sourcesContent":["import './button.css';\nimport { type G9ButtonVariant, type G9ImageSource, G9Metrics, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { G9CornerBadge } from '../base/corner-badge';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Strings, useG9Theme } from '../provider/hooks';\nimport { resolveButtonPaint } from './visuals';\n\n/** Props of {@link G9IconButton} (MAUI `G9IconButton`). */\nexport interface G9IconButtonProps extends G9ControlBaseProps {\n readonly emoji?: string | null;\n readonly icon?: G9IconInput;\n readonly imagePath?: string | null;\n readonly image?: G9ImageSource | null;\n /** Icon and spinner size; ≤ 0 → 20. Default 20. */\n readonly iconSize?: number;\n /** Square frame size; ≤ 0 → 40. Default 40. */\n readonly buttonSize?: number;\n /** Transparent, no stroke, icon in `textSecondary`. Default false. */\n readonly isGhost?: boolean;\n /** Default `'surface'`. */\n readonly variant?: G9ButtonVariant;\n /** Fully round instead of 12 px corners. Default false. */\n readonly isCircular?: boolean;\n /** Measured (touch) size when larger than the drawn frame; the frame stays centred. Default 0. */\n readonly minimumTouchTarget?: number;\n readonly baseBackgroundColor?: string | null;\n /** Icon colour override. */\n readonly textColor?: string | null;\n readonly isLoading?: boolean;\n /** Count badge on the top-trailing corner; wins over the dot. */\n readonly badgeText?: string | null;\n readonly showBadgeDot?: boolean;\n /** Default `var(--g9-error)`. */\n readonly badgeColor?: string | null;\n /** Default true. */\n readonly mirrorBadgeTextInRtl?: boolean;\n /** Accessibility name (MAUI `AccessibilityText`); `accessibilityLabel` is an alias. */\n readonly accessibilityText?: string | null;\n readonly onPress?: () => void;\n readonly blocked?: boolean;\n}\n\n/**\n * Square icon button (MAUI `G9IconButton`): one icon, variant/ghost fill, optional circle, corner badge that is never\n * dimmed (opacity applies to the frame only), loading spinner, minimum touch target. Press: one handler on the root,\n * scale 0.82 (80 ms) → 1 (150 ms). Accessibility hint: \"Loading\" while loading, else the badge text.\n */\nexport function G9IconButton(props: G9IconButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-icon-button');\n const theme = useG9Theme();\n const strings = useG9Strings();\n const loading = props.isLoading === true;\n const enabled = !control.disabled && props.blocked !== true;\n const size = props.buttonSize && props.buttonSize > 0 ? props.buttonSize : 40;\n const iconSize = props.iconSize && props.iconSize > 0 ? props.iconSize : G9Metrics.InputIconSize;\n const ghost = props.isGhost === true;\n const paint = resolveButtonPaint({\n variant: props.variant ?? 'surface',\n palette: theme.palette,\n enabled,\n loading,\n baseBackgroundColor: ghost ? 'rgba(0,0,0,0)' : props.baseBackgroundColor,\n textColor: props.textColor ?? (ghost ? theme.palette.TextSecondary : null),\n kind: 'icon',\n });\n const press = useG9Press(props.onPress, { blocked: !enabled || loading, source: 'G9IconButton' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.82, inMs: 80, outMs: 150 },\n !enabled || loading,\n );\n const touch = Math.max(props.minimumTouchTarget ?? 0, size);\n const name = props.accessibilityText ?? props.accessibilityLabel;\n const hint = loading ? strings.get(G9StringKey.Loading) : (props.badgeText ?? undefined);\n return (\n <view\n className={control.className}\n style={{ minWidth: `${touch}px`, minHeight: `${touch}px` }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...(name ? { 'accessibility-label': name } : {})}\n {...(hint ? { 'accessibility-value': hint } : {})}\n bindtap={press}\n {...visual}\n >\n <view className=\"g9-icon-button__host\">\n <view\n className=\"g9-icon-button__frame\"\n style={{\n width: `${size}px`,\n height: `${size}px`,\n background: paint.background,\n borderColor: paint.stroke,\n borderWidth: `${paint.strokeWidth}px`,\n borderRadius: `${props.isCircular ? size / 2 : G9Metrics.RadiusMd}px`,\n opacity: paint.opacity,\n }}\n >\n {loading ? (\n <G9ActivityIndicator running size={iconSize} color={paint.text} />\n ) : (\n <G9IconSlot\n emoji={props.emoji}\n icon={props.icon}\n imagePath={props.imagePath}\n image={props.image}\n size={iconSize}\n color={paint.text}\n />\n )}\n </view>\n <G9CornerBadge\n text={props.badgeText}\n dot={props.showBadgeDot === true}\n color={props.badgeColor}\n textColor=\"#FFFFFF\"\n ringColor={ghost ? 'var(--g9-background)' : 'var(--g9-surface)'}\n mirrorTextInRtl={props.mirrorBadgeTextInRtl !== false}\n />\n </view>\n </view>\n );\n}\n"],"names":["G9IconButton","props","_props_variant","_props_textColor","_props_minimumTouchTarget","_props_accessibilityText","_props_badgeText","control","useG9Control","theme","useG9Theme","strings","useG9Strings","loading","enabled","size","iconSize","G9Metrics","ghost","paint","resolveButtonPaint","press","useG9Press","visual","usePressVisual","touch","Math","name","hint","G9StringKey","undefined","view","G9ActivityIndicator","G9IconSlot","G9CornerBadge"],"mappings":";;;;;;;;;AAoDO,SAASA,aAAaC,KAAwB;QAUxCC,gBAKEC,kBAQUC,2BACVC,0BAC8CC;IAxB3D,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,QAAQC;IACd,MAAMC,UAAUC;IAChB,MAAMC,UAAUZ,AAAoB,SAApBA,MAAM,SAAS;IAC/B,MAAMa,UAAU,CAACP,QAAQ,QAAQ,IAAIN,AAAkB,SAAlBA,MAAM,OAAO;IAClD,MAAMc,OAAOd,MAAM,UAAU,IAAIA,MAAM,UAAU,GAAG,IAAIA,MAAM,UAAU,GAAG;IAC3E,MAAMe,WAAWf,MAAM,QAAQ,IAAIA,MAAM,QAAQ,GAAG,IAAIA,MAAM,QAAQ,GAAGgB,UAAU,aAAa;IAChG,MAAMC,QAAQjB,AAAkB,SAAlBA,MAAM,OAAO;IAC3B,MAAMkB,QAAQC,mBAAmB;QAC/B,SAAS,QAAAlB,CAAAA,iBAAAA,MAAM,OAAO,AAAD,IAAZA,iBAAiB;QAC1B,SAASO,MAAM,OAAO;QACtBK;QACAD;QACA,qBAAqBK,QAAQ,kBAAkBjB,MAAM,mBAAmB;QACxE,WAAW,QAAAE,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAoBe,QAAQT,MAAM,OAAO,CAAC,aAAa,GAAG;QACrE,MAAM;IACR;IACA,MAAMY,QAAQC,WAAWrB,MAAM,OAAO,EAAE;QAAE,SAAS,CAACa,WAAWD;QAAS,QAAQ;IAAe;IAC/F,MAAMU,SAASC,eACb;QAAE,UAAU;QAAS,MAAM;QAAG,SAAS;QAAM,MAAM;QAAI,OAAO;IAAI,GAClE,CAACV,WAAWD;IAEd,MAAMY,QAAQC,KAAK,GAAG,CAAC,QAAAtB,CAAAA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SAAS,EACrB,KAAKA,AAAuB,SAAvBA,MAAM,YAAY,EACvB,OAAOA,MAAM,UAAU,EACvB,UAAU,UACV,WAAWiB,QAAQ,yBAAyB,qBAC5C,iBAAiBjB,AAA+B,UAA/BA,MAAM,oBAAoB,GAC3C;MACJ,EAAE8B,KAAK;IACT,EAAEA;AAEN"}
1
+ {"version":3,"file":"button/icon-button.jsx","sources":["../../src/button/icon-button.tsx"],"sourcesContent":["import './button.css';\nimport { type G9ButtonVariant, type G9ImageSource, G9Metrics, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { G9CornerBadge } from '../base/corner-badge';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Strings, useG9Theme } from '../provider/hooks';\nimport { resolveButtonPaint } from './visuals';\n\n/** Props of {@link G9IconButton} (MAUI `G9IconButton`). */\nexport interface G9IconButtonProps extends G9ControlBaseProps {\n readonly emoji?: string | null;\n readonly icon?: G9IconInput;\n readonly imagePath?: string | null;\n readonly image?: G9ImageSource | null;\n /** Icon and spinner size; ≤ 0 → 20. Default 20. */\n readonly iconSize?: number;\n /** Square frame size; ≤ 0 → 40. Default 40. */\n readonly buttonSize?: number;\n /** Transparent, no stroke, icon in `textSecondary`. Default false. */\n readonly isGhost?: boolean;\n /** Default `'surface'`. */\n readonly variant?: G9ButtonVariant;\n /** Fully round instead of 12 px corners. Default false. */\n readonly isCircular?: boolean;\n /** Measured (touch) size when larger than the drawn frame; the frame stays centred. Default 0. */\n readonly minimumTouchTarget?: number;\n readonly baseBackgroundColor?: string | null;\n /** Icon colour override. */\n readonly textColor?: string | null;\n readonly isLoading?: boolean;\n /** Count badge on the top-trailing corner; wins over the dot. */\n readonly badgeText?: string | null;\n readonly showBadgeDot?: boolean;\n /** Default `var(--g9-error)`. */\n readonly badgeColor?: string | null;\n /** Default true. */\n readonly mirrorBadgeTextInRtl?: boolean;\n /** Accessibility name (MAUI `AccessibilityText`); `accessibilityLabel` is an alias. */\n readonly accessibilityText?: string | null;\n readonly onPress?: () => void;\n readonly blocked?: boolean;\n}\n\n/**\n * Square icon button (MAUI `G9IconButton`): one icon, variant/ghost fill, optional circle, corner badge that is never\n * dimmed (opacity applies to the frame only), loading spinner, minimum touch target. Press: one handler on the root,\n * scale 0.82 (80 ms) → 1 (150 ms). Accessibility hint: \"Loading\" while loading, else the badge text.\n */\nexport function G9IconButton(props: G9IconButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-icon-button');\n const theme = useG9Theme();\n const strings = useG9Strings();\n const loading = props.isLoading === true;\n const enabled = !control.disabled && props.blocked !== true;\n const size = props.buttonSize && props.buttonSize > 0 ? props.buttonSize : 40;\n const iconSize = props.iconSize && props.iconSize > 0 ? props.iconSize : G9Metrics.InputIconSize;\n const ghost = props.isGhost === true;\n const paint = resolveButtonPaint({\n variant: props.variant ?? 'surface',\n palette: theme.palette,\n enabled,\n loading,\n baseBackgroundColor: ghost ? 'rgba(0,0,0,0)' : props.baseBackgroundColor,\n textColor: props.textColor ?? (ghost ? theme.palette.TextSecondary : null),\n kind: 'icon',\n });\n const press = useG9Press(props.onPress, { blocked: !enabled || loading, source: 'G9IconButton' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.82, inMs: 80, outMs: 150 },\n !enabled || loading,\n );\n const touch = Math.max(props.minimumTouchTarget ?? 0, size);\n const name = props.accessibilityText ?? props.accessibilityLabel;\n const hint = loading ? strings.get(G9StringKey.Loading) : (props.badgeText ?? undefined);\n return (\n <view\n className={control.className}\n {...control.idProps}\n style={{ minWidth: `${touch}px`, minHeight: `${touch}px` }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...(name ? { 'accessibility-label': name } : {})}\n {...(hint ? { 'accessibility-value': hint } : {})}\n bindtap={press}\n {...visual}\n >\n <view className=\"g9-icon-button__host\">\n <view\n className=\"g9-icon-button__frame\"\n style={{\n width: `${size}px`,\n height: `${size}px`,\n background: paint.background,\n borderColor: paint.stroke,\n borderWidth: `${paint.strokeWidth}px`,\n borderRadius: `${props.isCircular ? size / 2 : G9Metrics.RadiusMd}px`,\n opacity: paint.opacity,\n }}\n >\n {loading ? (\n <G9ActivityIndicator running size={iconSize} color={paint.text} />\n ) : (\n <G9IconSlot\n emoji={props.emoji}\n icon={props.icon}\n imagePath={props.imagePath}\n image={props.image}\n size={iconSize}\n color={paint.text}\n />\n )}\n </view>\n <G9CornerBadge\n text={props.badgeText}\n dot={props.showBadgeDot === true}\n color={props.badgeColor}\n textColor=\"#FFFFFF\"\n ringColor={ghost ? 'var(--g9-background)' : 'var(--g9-surface)'}\n mirrorTextInRtl={props.mirrorBadgeTextInRtl !== false}\n />\n </view>\n </view>\n );\n}\n"],"names":["G9IconButton","props","_props_variant","_props_textColor","_props_minimumTouchTarget","_props_accessibilityText","_props_badgeText","control","useG9Control","theme","useG9Theme","strings","useG9Strings","loading","enabled","size","iconSize","G9Metrics","ghost","paint","resolveButtonPaint","press","useG9Press","visual","usePressVisual","touch","Math","name","hint","G9StringKey","undefined","view","G9ActivityIndicator","G9IconSlot","G9CornerBadge"],"mappings":";;;;;;;;;AAoDO,SAASA,aAAaC,KAAwB;QAUxCC,gBAKEC,kBAQUC,2BACVC,0BAC8CC;IAxB3D,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,QAAQC;IACd,MAAMC,UAAUC;IAChB,MAAMC,UAAUZ,AAAoB,SAApBA,MAAM,SAAS;IAC/B,MAAMa,UAAU,CAACP,QAAQ,QAAQ,IAAIN,AAAkB,SAAlBA,MAAM,OAAO;IAClD,MAAMc,OAAOd,MAAM,UAAU,IAAIA,MAAM,UAAU,GAAG,IAAIA,MAAM,UAAU,GAAG;IAC3E,MAAMe,WAAWf,MAAM,QAAQ,IAAIA,MAAM,QAAQ,GAAG,IAAIA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G9StringKey, formatColor, mix, resolveThemeColor } from "@g9tm/lynxcontrols-foundation";
3
3
  import { g9RowStyle, g9TextStart, useG9Control } from "../base/control.jsx";
4
4
  import { G9CornerBadge } from "../base/corner-badge.jsx";
5
5
  import { useG9Press, usePressVisual } from "../base/press.jsx";
6
6
  import { G9IconSlot, hasIconSlot } from "../icon/slot.jsx";
7
7
  import { useG9Settings, useG9Strings, useG9Theme } from "../provider/hooks.jsx";
8
8
  function G9NavCard(props) {
9
- var _props_accentColor, _ref, _props_cardAccentColor, _props_accessibilityLabel, _props_accessibilityLabel1, _props_valueColor;
9
+ var _props_accessibilityLabel, _props_accessibilityLabel1, _props_valueColor;
10
10
  const control = useG9Control(props, 'g9-nav-card');
11
11
  const palette = useG9Theme().palette;
12
12
  const glyphs = useG9Settings().glyphs;
13
13
  const strings = useG9Strings();
14
14
  const soon = true === props.isComingSoon;
15
15
  const destructive = true === props.isDestructive;
16
- const accent = null != (_props_accentColor = props.accentColor) ? _props_accentColor : palette.Primary;
17
- const surface = props.useAccentSurface ? formatColor(mix(null != (_ref = null != (_props_cardAccentColor = props.cardAccentColor) ? _props_cardAccentColor : props.accentColor) ? _ref : palette.Primary, palette.Surface, 0.88)) : palette.Surface;
16
+ const accent = props.accentColor ? resolveThemeColor(props.accentColor, palette) : palette.Primary;
17
+ const cardAccent = props.cardAccentColor ? resolveThemeColor(props.cardAccentColor, palette) : accent;
18
+ const surface = props.useAccentSurface ? formatColor(mix(cardAccent, palette.Surface, 0.88)) : palette.Surface;
18
19
  const press = useG9Press(props.onPress, {
19
20
  blocked: control.disabled || soon,
20
21
  source: 'G9NavCard'
@@ -46,7 +47,7 @@ function G9NavCard(props) {
46
47
  }}>
47
48
  {props.title}
48
49
  </text> : null;
49
- return <view className={control.className} style={{
50
+ return <view className={control.className} {...control.idProps} style={{
50
51
  backgroundColor: surface,
51
52
  ...g9RowStyle(control.direction)
52
53
  }} {...void 0 === props.trailing ? {
@@ -1 +1 @@
1
- {"version":3,"file":"button/nav-card.jsx","sources":["../../src/button/nav-card.tsx"],"sourcesContent":["import './button.css';\nimport { formatColor, type G9ImageSource, G9StringKey, mix } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9RowStyle, g9TextStart, useG9Control } from '../base/control';\nimport { G9CornerBadge } from '../base/corner-badge';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\n\n/** Props of {@link G9NavCard} (MAUI `G9NavCard`). */\nexport interface G9NavCardProps extends G9ControlBaseProps {\n readonly title?: string | null;\n readonly subtitle?: string | null;\n /** Icon and icon-tile tint. Default the primary colour. Must be a colour literal (it is mixed). */\n readonly accentColor?: string | null;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n /** Trailing chevron (forward in LTR, back in RTL). Default true. */\n readonly showChevron?: boolean;\n readonly valueText?: string | null;\n /** Value colour; default error when destructive, else tertiary text. */\n readonly valueColor?: string | null;\n /** Coming-soon badge instead of value and chevron; presses do nothing. Default false. */\n readonly isComingSoon?: boolean;\n /** Badge text; default the localized `comingSoon`. */\n readonly comingSoonText?: string | null;\n readonly iconBadgeText?: string | null;\n readonly showIconBadgeDot?: boolean;\n readonly iconBadgeColor?: string | null;\n /** Default true. */\n readonly mirrorBadgeTextInRtl?: boolean;\n /** Replaces the whole trailing area (value, chevron, coming-soon badge). */\n readonly trailing?: ReactNode;\n /**\n * A small node on the title's line, right after the title (a count pill, an unread dot, a \"6/10\"; MAUI 1.4.0\n * `TitleAccessoryView`). It does not take over the trailing area, so the chevron, value and coming-soon badge keep\n * working beside it. A long title truncates; the accessory never does. Unset keeps the title layout as it was.\n */\n readonly titleAccessory?: ReactNode;\n /** Title (and default value colour) in the error colour. Default false. */\n readonly isDestructive?: boolean;\n /** Tint the card background with the accent (88 % surface). Default false. */\n readonly useAccentSurface?: boolean;\n /** Accent used only for the background tint. */\n readonly cardAccentColor?: string | null;\n /**\n * Paint the icon tile solid in the accent with an `OnPrimary` icon instead of the pastel tile with an accent icon\n * (MAUI 1.4.0 `UseFilledIconChip`): the one primary row of a list. Pair with `useAccentSurface`. Default false.\n */\n readonly useFilledIconChip?: boolean;\n /** The press (MAUI `Tapped` + `Command`); not while disabled or coming soon. */\n readonly onPress?: () => void;\n}\n\n/**\n * Navigation row card (MAUI `G9NavCard`): icon tile (pastel, or filled with `useFilledIconChip`) with optional corner\n * badge, title (with an optional `titleAccessory` after it)/subtitle, value text, chevron or coming-soon badge, or a\n * custom trailing node. Press: scale 0.985 (70 ms) → 1 (120 ms); hover on desktop.\n */\nexport function G9NavCard(props: G9NavCardProps): ReactNode {\n const control = useG9Control(props, 'g9-nav-card');\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const soon = props.isComingSoon === true;\n const destructive = props.isDestructive === true;\n const accent = props.accentColor ?? palette.Primary;\n const surface = props.useAccentSurface\n ? formatColor(mix(props.cardAccentColor ?? props.accentColor ?? palette.Primary, palette.Surface, 0.88))\n : palette.Surface;\n const press = useG9Press(props.onPress, { blocked: control.disabled || soon, source: 'G9NavCard' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.985, inMs: 70, outMs: 120 },\n control.disabled || soon,\n );\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const subtitle = props.subtitle && props.subtitle.trim() !== '' ? props.subtitle : null;\n const value = props.valueText && props.valueText.trim() !== '' ? props.valueText : null;\n const soonText =\n props.comingSoonText && props.comingSoonText.trim() !== ''\n ? props.comingSoonText\n : strings.get(G9StringKey.ComingSoon);\n const label = [props.title, subtitle].filter(Boolean).join(', ');\n const filledChip = props.useFilledIconChip === true;\n const title = props.title ? (\n <text\n className=\"g9-nav-card__title\"\n text-maxline=\"1\"\n style={{ color: destructive ? palette.Error : palette.TextPrimary, ...g9TextStart(control.direction) }}\n >\n {props.title}\n </text>\n ) : null;\n return (\n <view\n className={control.className}\n style={{ backgroundColor: surface, ...g9RowStyle(control.direction) }}\n {...(props.trailing === undefined\n ? {\n 'accessibility-element': true,\n 'accessibility-traits': 'button',\n ...((props.accessibilityLabel ?? label)\n ? { 'accessibility-label': props.accessibilityLabel ?? label }\n : {}),\n ...(soon ? { 'accessibility-value': soonText } : value ? { 'accessibility-value': value } : {}),\n }\n : {})}\n bindtap={press}\n {...visual}\n >\n {hasIconSlot(icon) ? (\n <view\n className=\"g9-nav-card__tile\"\n style={{ backgroundColor: filledChip ? accent : formatColor(mix(accent, palette.Surface, 0.82)) }}\n >\n <G9IconSlot {...icon} size={props.iconEmoji ? 22 : 18} color={filledChip ? palette.OnPrimary : accent} />\n <G9CornerBadge\n text={props.iconBadgeText}\n dot={props.showIconBadgeDot === true}\n color={props.iconBadgeColor}\n mirrorTextInRtl={props.mirrorBadgeTextInRtl !== false}\n />\n </view>\n ) : null}\n <view className=\"g9-nav-card__text\">\n {props.titleAccessory === undefined || props.titleAccessory === null ? (\n title\n ) : (\n <view className=\"g9-nav-card__title-row\" style={g9RowStyle(control.direction)}>\n {title}\n <view className=\"g9-nav-card__title-accessory\">{props.titleAccessory}</view>\n </view>\n )}\n {subtitle ? (\n <text className=\"g9-nav-card__subtitle\" text-maxline=\"1\" style={g9TextStart(control.direction)}>\n {subtitle}\n </text>\n ) : null}\n </view>\n {props.trailing !== undefined ? (\n <view className=\"g9-nav-card__trailing\" style={g9RowStyle(control.direction)}>\n {props.trailing}\n </view>\n ) : (\n <view className=\"g9-nav-card__trailing\" style={g9RowStyle(control.direction)}>\n {value && !soon ? (\n <text\n className=\"g9-nav-card__value\"\n text-maxline=\"1\"\n style={{ color: props.valueColor ?? (destructive ? palette.Error : palette.TextTertiary) }}\n >\n {value}\n </text>\n ) : null}\n {soon ? (\n <view className=\"g9-nav-card__soon\">\n <text className=\"g9-nav-card__soon-text\">{soonText}</text>\n </view>\n ) : props.showChevron !== false ? (\n <G9IconSlot\n icon={control.direction === 'rtl' ? glyphs.chevronBack : glyphs.chevronForward}\n size={24}\n color={palette.TextTertiary}\n />\n ) : null}\n </view>\n )}\n </view>\n );\n}\n"],"names":["G9NavCard","props","_props_accentColor","_ref","_props_accessibilityLabel","_props_accessibilityLabel1","_props_valueColor","control","useG9Control","palette","useG9Theme","glyphs","useG9Settings","strings","useG9Strings","soon","destructive","accent","surface","formatColor","mix","press","useG9Press","visual","usePressVisual","icon","subtitle","value","soonText","G9StringKey","label","Boolean","filledChip","title","text","g9TextStart","view","g9RowStyle","undefined","hasIconSlot","G9IconSlot","G9CornerBadge"],"mappings":";;;;;;;AA8DO,SAASA,UAAUC,KAAqB;QAO9BC,oBAEKC,MAAAA,wBAiCLC,2BACwBC,4BA+CXC;IAzF5B,MAAMC,UAAUC,aAAaP,OAAO;IACpC,MAAMQ,UAAUC,aAAa,OAAO;IACpC,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,OAAOd,AAAuB,SAAvBA,MAAM,YAAY;IAC/B,MAAMe,cAAcf,AAAwB,SAAxBA,MAAM,aAAa;IACvC,MAAMgB,SAAS,QAAAf,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqBO,QAAQ,OAAO;IACnD,MAAMS,UAAUjB,MAAM,gBAAgB,GAClCkB,YAAYC,IAAI,QAAAjB,CAAAA,OAAAA,QAAAA,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyBF,MAAM,WAAW,AAAD,IAAzCE,OAA8CM,QAAQ,OAAO,EAAEA,QAAQ,OAAO,EAAE,SAChGA,QAAQ,OAAO;IACnB,MAAMY,QAAQC,WAAWrB,MAAM,OAAO,EAAE;QAAE,SAASM,QAAQ,QAAQ,IAAIQ;QAAM,QAAQ;IAAY;IACjG,MAAMQ,SAASC,eACb;Q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,QAAQ,SAAS,GAAG;UAC5E,CAACN,MAAM,QAAQ,CAAC;QAClB,EAAEmC,SAEDA,KAAK,UAAU,wBAAwB,OAAOC,WAAW9B,QAAQ,SAAS,GAAG;UAC5E,CAACoB,SAAS,CAACZ,QACRmB,KACC,UAAU,qBACV,aAAa,IACb,OAAO;QAAE,OAAO,QAAA5B,CAAAA,oBAAAA,MAAM,UAAU,AAAD,IAAfA,oBAAqBU,cAAcP,QAAQ,KAAK,GAAGA,QAAQ,YAAY;IAAE,GAC1F;cACC,CAACkB,MAAM;YACT,EAAEO,QACA,KAAK;UACT,CAACnB,QACEqB,KAAK,UAAU,oBAAoB;cAClC,CAACF,KAAK,UAAU,0BAA0BN,WAAWM,KAAK;YAC5D,EAAEE,QACAnC,AAAsB,UAAtBA,MAAM,WAAW,IAClBuC,WACC,MAAMjC,AAAsB,UAAtBA,QAAQ,SAAS,GAAaI,OAAO,WAAW,GAAGA,OAAO,cAAc,EAC9E,MAAM,IACN,OAAOF,QAAQ,YAAY,MAE3B,KAAK;QACX,EAAE2B,MACF;IACJ,EAAEA;AAEN"}
1
+ {"version":3,"file":"button/nav-card.jsx","sources":["../../src/button/nav-card.tsx"],"sourcesContent":["import './button.css';\nimport { formatColor, type G9ImageSource, G9StringKey, mix, resolveThemeColor } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9RowStyle, g9TextStart, useG9Control } from '../base/control';\nimport { G9CornerBadge } from '../base/corner-badge';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\n\n/** Props of {@link G9NavCard} (MAUI `G9NavCard`). */\nexport interface G9NavCardProps extends G9ControlBaseProps {\n readonly title?: string | null;\n readonly subtitle?: string | null;\n /** Icon and icon-tile tint. Default the primary colour. Must be a colour literal (it is mixed). */\n readonly accentColor?: string | null;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n /** Trailing chevron (forward in LTR, back in RTL). Default true. */\n readonly showChevron?: boolean;\n readonly valueText?: string | null;\n /** Value colour; default error when destructive, else tertiary text. */\n readonly valueColor?: string | null;\n /** Coming-soon badge instead of value and chevron; presses do nothing. Default false. */\n readonly isComingSoon?: boolean;\n /** Badge text; default the localized `comingSoon`. */\n readonly comingSoonText?: string | null;\n readonly iconBadgeText?: string | null;\n readonly showIconBadgeDot?: boolean;\n readonly iconBadgeColor?: string | null;\n /** Default true. */\n readonly mirrorBadgeTextInRtl?: boolean;\n /** Replaces the whole trailing area (value, chevron, coming-soon badge). */\n readonly trailing?: ReactNode;\n /**\n * A small node on the title's line, right after the title (a count pill, an unread dot, a \"6/10\"; MAUI 1.4.0\n * `TitleAccessoryView`). It does not take over the trailing area, so the chevron, value and coming-soon badge keep\n * working beside it. A long title truncates; the accessory never does. Unset keeps the title layout as it was.\n */\n readonly titleAccessory?: ReactNode;\n /** Title (and default value colour) in the error colour. Default false. */\n readonly isDestructive?: boolean;\n /** Tint the card background with the accent (88 % surface). Default false. */\n readonly useAccentSurface?: boolean;\n /** Accent used only for the background tint. */\n readonly cardAccentColor?: string | null;\n /**\n * Paint the icon tile solid in the accent with an `OnPrimary` icon instead of the pastel tile with an accent icon\n * (MAUI 1.4.0 `UseFilledIconChip`): the one primary row of a list. Pair with `useAccentSurface`. Default false.\n */\n readonly useFilledIconChip?: boolean;\n /** The press (MAUI `Tapped` + `Command`); not while disabled or coming soon. */\n readonly onPress?: () => void;\n}\n\n/**\n * Navigation row card (MAUI `G9NavCard`): icon tile (pastel, or filled with `useFilledIconChip`) with optional corner\n * badge, title (with an optional `titleAccessory` after it)/subtitle, value text, chevron or coming-soon badge, or a\n * custom trailing node. Press: scale 0.985 (70 ms) → 1 (120 ms); hover on desktop.\n */\nexport function G9NavCard(props: G9NavCardProps): ReactNode {\n const control = useG9Control(props, 'g9-nav-card');\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const soon = props.isComingSoon === true;\n const destructive = props.isDestructive === true;\n // A theme reference (`var(--g9-success)`) is resolved against the live palette: the accent is mixed below, and a\n // CSS variable cannot be mixed.\n const accent = props.accentColor ? resolveThemeColor(props.accentColor, palette) : palette.Primary;\n const cardAccent = props.cardAccentColor ? resolveThemeColor(props.cardAccentColor, palette) : accent;\n const surface = props.useAccentSurface ? formatColor(mix(cardAccent, palette.Surface, 0.88)) : palette.Surface;\n const press = useG9Press(props.onPress, { blocked: control.disabled || soon, source: 'G9NavCard' });\n const visual = usePressVisual(\n { property: 'scale', rest: 1, pressed: 0.985, inMs: 70, outMs: 120 },\n control.disabled || soon,\n );\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const subtitle = props.subtitle && props.subtitle.trim() !== '' ? props.subtitle : null;\n const value = props.valueText && props.valueText.trim() !== '' ? props.valueText : null;\n const soonText =\n props.comingSoonText && props.comingSoonText.trim() !== ''\n ? props.comingSoonText\n : strings.get(G9StringKey.ComingSoon);\n const label = [props.title, subtitle].filter(Boolean).join(', ');\n const filledChip = props.useFilledIconChip === true;\n const title = props.title ? (\n <text\n className=\"g9-nav-card__title\"\n text-maxline=\"1\"\n style={{ color: destructive ? palette.Error : palette.TextPrimary, ...g9TextStart(control.direction) }}\n >\n {props.title}\n </text>\n ) : null;\n return (\n <view\n className={control.className}\n {...control.idProps}\n style={{ backgroundColor: surface, ...g9RowStyle(control.direction) }}\n {...(props.trailing === undefined\n ? {\n 'accessibility-element': true,\n 'accessibility-traits': 'button',\n ...((props.accessibilityLabel ?? label)\n ? { 'accessibility-label': props.accessibilityLabel ?? label }\n : {}),\n ...(soon ? { 'accessibility-value': soonText } : value ? { 'accessibility-value': value } : {}),\n }\n : {})}\n bindtap={press}\n {...visual}\n >\n {hasIconSlot(icon) ? (\n <view\n className=\"g9-nav-card__tile\"\n style={{ backgroundColor: filledChip ? accent : formatColor(mix(accent, palette.Surface, 0.82)) }}\n >\n <G9IconSlot {...icon} size={props.iconEmoji ? 22 : 18} color={filledChip ? palette.OnPrimary : accent} />\n <G9CornerBadge\n text={props.iconBadgeText}\n dot={props.showIconBadgeDot === true}\n color={props.iconBadgeColor}\n mirrorTextInRtl={props.mirrorBadgeTextInRtl !== false}\n />\n </view>\n ) : null}\n <view className=\"g9-nav-card__text\">\n {props.titleAccessory === undefined || props.titleAccessory === null ? (\n title\n ) : (\n <view className=\"g9-nav-card__title-row\" style={g9RowStyle(control.direction)}>\n {title}\n <view className=\"g9-nav-card__title-accessory\">{props.titleAccessory}</view>\n </view>\n )}\n {subtitle ? (\n <text className=\"g9-nav-card__subtitle\" text-maxline=\"1\" style={g9TextStart(control.direction)}>\n {subtitle}\n </text>\n ) : null}\n </view>\n {props.trailing !== undefined ? (\n <view className=\"g9-nav-card__trailing\" style={g9RowStyle(control.direction)}>\n {props.trailing}\n </view>\n ) : (\n <view className=\"g9-nav-card__trailing\" style={g9RowStyle(control.direction)}>\n {value && !soon ? (\n <text\n className=\"g9-nav-card__value\"\n text-maxline=\"1\"\n style={{ color: props.valueColor ?? (destructive ? palette.Error : palette.TextTertiary) }}\n >\n {value}\n </text>\n ) : null}\n {soon ? (\n <view className=\"g9-nav-card__soon\">\n <text className=\"g9-nav-card__soon-text\">{soonText}</text>\n </view>\n ) : props.showChevron !== false ? (\n <G9IconSlot\n icon={control.direction === 'rtl' ? glyphs.chevronBack : glyphs.chevronForward}\n size={24}\n color={palette.TextTertiary}\n />\n ) : null}\n </view>\n )}\n </view>\n );\n}\n"],"names":["G9NavCard","props","_props_accessibilityLabel","_props_accessibilityLabel1","_props_valueColor","control","useG9Control","palette","useG9Theme","glyphs","useG9Settings","strings","useG9Strings","soon","destructive","accent","resolveThemeColor","cardAccent","surface","formatColor","mix","press","useG9Press","visual","usePressVisual","icon","subtitle","value","soonText","G9StringKey","label","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WAAWM,KAAK;YAC5D,EAAEE,QACAnC,AAAsB,UAAtBA,MAAM,WAAW,IAClBuC,WACC,MAAMnC,AAAsB,UAAtBA,QAAQ,SAAS,GAAaI,OAAO,WAAW,GAAGA,OAAO,cAAc,EAC9E,MAAM,IACN,OAAOF,QAAQ,YAAY,MAE3B,KAAK;QACX,EAAE6B,MACF;IACJ,EAAEA;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"vertical-icon-text-button.d.ts","sourceRoot":"","sources":["../../src/button/vertical-icon-text-button.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,iBAAiB,CAAC;AAIxE,mFAAmF;AACnF,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,GAAG,SAAS,CAiBxF"}
1
+ {"version":3,"file":"vertical-icon-text-button.d.ts","sourceRoot":"","sources":["../../src/button/vertical-icon-text-button.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,iBAAiB,CAAC;AAIxE,mFAAmF;AACnF,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,GAAG,SAAS,CAkBxF"}
@@ -9,7 +9,7 @@ function G9VerticalIconTextButton(props) {
9
9
  blocked: control.disabled,
10
10
  source: 'G9VerticalIconTextButton'
11
11
  });
12
- return <view className={control.className} accessibility-element={true} accessibility-traits="button" {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.text) ? {
12
+ return <view className={control.className} {...control.idProps} accessibility-element={true} accessibility-traits="button" {...(null != (_props_accessibilityLabel = props.accessibilityLabel) ? _props_accessibilityLabel : props.text) ? {
13
13
  'accessibility-label': null != (_ref = null != (_props_accessibilityLabel1 = props.accessibilityLabel) ? _props_accessibilityLabel1 : props.text) ? _ref : ''
14
14
  } : {}} bindtap={press}>
15
15
  {props.image ? <G9IconSlot image={props.image} size={null != (_props_imageSize = props.imageSize) ? _props_imageSize : 32}/> : null}
@@ -1 +1 @@
1
- {"version":3,"file":"button/vertical-icon-text-button.jsx","sources":["../../src/button/vertical-icon-text-button.tsx"],"sourcesContent":["import './button.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9IconSlot } from '../icon/slot';\n\n/** Props of {@link G9VerticalIconTextButton} (MAUI `G9VerticalIconTextButton`). */\nexport interface G9VerticalIconTextButtonProps extends G9ControlBaseProps {\n readonly image?: G9ImageSource | null;\n readonly text?: string | null;\n /** Image box size. Default 32. */\n readonly imageSize?: number;\n readonly onPress?: () => void;\n}\n\n/**\n * Image over a centred label in a bordered tile (MAUI `G9VerticalIconTextButton`). Unlike MAUI (its image and label\n * took the touch), the press is on the root and honours `disabled` and the 300 ms guard.\n */\nexport function G9VerticalIconTextButton(props: G9VerticalIconTextButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-vertical-button');\n const press = useG9Press(props.onPress, { blocked: control.disabled, source: 'G9VerticalIconTextButton' });\n return (\n <view\n className={control.className}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? props.text)\n ? { 'accessibility-label': props.accessibilityLabel ?? props.text ?? '' }\n : {})}\n bindtap={press}\n >\n {props.image ? <G9IconSlot image={props.image} size={props.imageSize ?? 32} /> : null}\n {props.text ? <text className=\"g9-vertical-button__text\">{props.text}</text> : null}\n </view>\n );\n}\n"],"names":["G9VerticalIconTextButton","props","_props_accessibilityLabel","_ref","_props_imageSize","control","useG9Control","press","useG9Press","view","G9IconSlot","text"],"mappings":";;;;AAoBO,SAASA,yBAAyBC,KAAoC;QAQjEC,2BACuBC,MAAAA,4BAIwBC;IAZzD,MAAMC,UAAUC,aAAaL,OAAO;IACpC,MAAMM,QAAQC,WAAWP,MAAM,OAAO,EAAE;QAAE,SAASI,QAAQ,QAAQ;QAAE,QAAQ;IAA2B;IACxG,QACGI,KACC,WAAWJ,QAAQ,SAAS,EAC5B,uBAAuB,MACvB,qBAAqB,UACpB,GAAI,AAAC,SAAAH,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4BD,MAAM,IAAI,AAAD,IACvC;QAAE,uBAAuB,QAAAE,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,6BAA4BF,MAAM,IAAI,AAAD,IAArCE,OAA0C;IAAG,IACtE,CAAC,CAAC,EACN,SAASI,OACV;MACC,CAACN,MAAM,KAAK,IAAIS,WAAW,OAAOT,MAAM,KAAK,EAAE,MAAM,QAAAG,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB,QAAS,KAAK;MACtF,CAACH,MAAM,IAAI,IAAIU,KAAK,UAAU,4BAA4BV,MAAM,IAAI,GAAGU,QAAQ,KAAK;IACtF,EAAEF;AAEN"}
1
+ {"version":3,"file":"button/vertical-icon-text-button.jsx","sources":["../../src/button/vertical-icon-text-button.tsx"],"sourcesContent":["import './button.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { G9IconSlot } from '../icon/slot';\n\n/** Props of {@link G9VerticalIconTextButton} (MAUI `G9VerticalIconTextButton`). */\nexport interface G9VerticalIconTextButtonProps extends G9ControlBaseProps {\n readonly image?: G9ImageSource | null;\n readonly text?: string | null;\n /** Image box size. Default 32. */\n readonly imageSize?: number;\n readonly onPress?: () => void;\n}\n\n/**\n * Image over a centred label in a bordered tile (MAUI `G9VerticalIconTextButton`). Unlike MAUI (its image and label\n * took the touch), the press is on the root and honours `disabled` and the 300 ms guard.\n */\nexport function G9VerticalIconTextButton(props: G9VerticalIconTextButtonProps): ReactNode {\n const control = useG9Control(props, 'g9-vertical-button');\n const press = useG9Press(props.onPress, { blocked: control.disabled, source: 'G9VerticalIconTextButton' });\n return (\n <view\n className={control.className}\n {...control.idProps}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...((props.accessibilityLabel ?? props.text)\n ? { 'accessibility-label': props.accessibilityLabel ?? props.text ?? '' }\n : {})}\n bindtap={press}\n >\n {props.image ? <G9IconSlot image={props.image} size={props.imageSize ?? 32} /> : null}\n {props.text ? <text className=\"g9-vertical-button__text\">{props.text}</text> : null}\n </view>\n );\n}\n"],"names":["G9VerticalIconTextButton","props","_props_accessibilityLabel","_ref","_props_imageSize","control","useG9Control","press","useG9Press","view","G9IconSlot","text"],"mappings":";;;;AAoBO,SAASA,yBAAyBC,KAAoC;QASjEC,2BACuBC,MAAAA,4BAIwBC;IAbzD,MAAMC,UAAUC,aAAaL,OAAO;IACpC,MAAMM,QAAQC,WAAWP,MAAM,OAAO,EAAE;QAAE,SAASI,QAAQ,QAAQ;QAAE,QAAQ;IAA2B;IACxG,QACGI,KACC,WAAWJ,QAAQ,SAAS,GAC3B,GAAGA,QAAQ,OAAO,EACnB,uBAAuB,MACvB,qBAAqB,UACpB,GAAI,AAAC,SAAAH,CAAAA,4BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,4BAA4BD,MAAM,IAAI,AAAD,IACvC;QAAE,uBAAuB,QAAAE,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,kBAAkB,AAAD,IAAvBA,6BAA4BF,MAAM,IAAI,AAAD,IAArCE,OAA0C;IAAG,IACtE,CAAC,CAAC,EACN,SAASI,OACV;MACC,CAACN,MAAM,KAAK,IAAIS,WAAW,OAAOT,MAAM,KAAK,EAAE,MAAM,QAAAG,CAAAA,mBAAAA,MAAM,SAAS,AAAD,IAAdA,mBAAmB,QAAS,KAAK;MACtF,CAACH,MAAM,IAAI,IAAIU,KAAK,UAAU,4BAA4BV,MAAM,IAAI,GAAGU,QAAQ,KAAK;IACtF,EAAEF;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"culture-date-time-label.d.ts","sourceRoot":"","sources":["../../src/display/culture-date-time-label.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,eAAe,EAEpB,KAAK,SAAS,EAMf,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,iBAAiB,CAAC;AAGxE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;CAM/B,CAAC;AAC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,MAAM,eAAe,CAAC;CACjD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,GAAG,SAAS,CAwBpF"}
@@ -64,7 +64,9 @@ function G9CultureDateTimeLabel(props) {
64
64
  relativeDayNow: props.relativeDayNow()
65
65
  } : {}
66
66
  });
67
- return <text className={control.className}>{text1}</text>;
67
+ return <text className={control.className} {...control.idProps}>
68
+ {text1}
69
+ </text>;
68
70
  }
69
71
  export { G9CultureDateTimeDisplayMode, G9CultureDateTimeLabel, formatCultureDateTime };
70
72
 
@@ -1 +1 @@
1
- {"version":3,"file":"display/culture-date-time-label.jsx","sources":["../../src/display/culture-date-time-label.tsx"],"sourcesContent":["import './display.css';\nimport {\n formatAgo,\n formatLocalDateTime,\n type G9Culture,\n type G9LocalDateTime,\n G9StringKey,\n type G9Strings,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTimeFromEpochMs,\n localDateTimeToEpochMs,\n toEpochDays,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Core, useG9Culture, useG9Strings } from '../provider/hooks';\n\n/**\n * What the label shows (MAUI `G9CultureDateTimeDisplayMode`). `relativeDay` (MAUI 1.4.0) is a due-date style: «امروز،\n * 18:00» / \"Today, 18:00\", and the `tomorrow` / `yesterday` words, when the value falls on one of those three days;\n * otherwise exactly `dateTime` (`date` for a midnight value, which almost always means \"a date with no time\").\n */\nexport const G9CultureDateTimeDisplayMode = {\n DateTime: 'dateTime',\n Date: 'date',\n Time: 'time',\n Relative: 'relative',\n RelativeDay: 'relativeDay',\n} as const;\nexport type G9CultureDateTimeDisplayMode =\n (typeof G9CultureDateTimeDisplayMode)[keyof typeof G9CultureDateTimeDisplayMode];\n\n/** Inputs of {@link formatCultureDateTime}. */\nexport interface G9CultureDateTimeFormatInput {\n readonly value: G9LocalDateTime;\n readonly mode: G9CultureDateTimeDisplayMode;\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n /** Now (epoch ms), for the relative mode. */\n readonly nowMs: number;\n /** UTC offset of `value`'s wall clock, for the relative modes. */\n readonly utcOffsetMinutes: number;\n /**\n * The wall-clock \"now\" `relativeDay` measures today against (MAUI `G9CultureDateTimeLabel.RelativeDayNow()`).\n * Default: `nowMs` at `utcOffsetMinutes`, i.e. today in the value's own zone.\n */\n readonly relativeDayNow?: G9LocalDateTime;\n}\n\nconst dayWords: Readonly<Record<string, G9StringKey>> = Object.freeze({\n '0': G9StringKey.Today,\n '1': G9StringKey.Tomorrow,\n '-1': G9StringKey.Yesterday,\n});\n\nconst isMidnight = (value: G9LocalDateTime) =>\n value.hour === 0 && value.minute === 0 && value.second === 0 && value.millisecond === 0;\n\n/**\n * MAUI `G9CultureDateTimeLabel.Format`: Jalali for `fa` cultures (Gregorian outside the Persian range), else\n * Gregorian; `yyyy/MM/dd`, `HH:mm`, `date - time`, or `ago - HH:mm`; Latin digits (as the MAUI code). Absolute text in\n * an RTL culture is wrapped in LRE…PDF so it reads left to right. `relativeDay` writes the day word («امروز، 18:00»,\n * \"Today, 18:00\", the word alone at midnight) in the culture's own direction, never embedded, and falls back to the\n * absolute date (with its time only when it has one) outside today, tomorrow and yesterday.\n */\nexport function formatCultureDateTime(input: G9CultureDateTimeFormatInput): string {\n const { value, culture } = input;\n const time = formatLocalDateTime(value, 'HH:mm', culture, { calendar: 'gregorian', numberingSystem: 'latin' });\n let mode = input.mode;\n if (mode === 'relativeDay') {\n const now = input.relativeDayNow ?? localDateTimeFromEpochMs(input.nowMs, input.utcOffsetMinutes);\n const word = dayWords[String(toEpochDays(value) - toEpochDays(now))];\n if (word !== undefined) {\n const text = input.strings.get(word);\n // The Persian comma under fa (the design's «امروز، ۱۸:۰۰»), a Latin one elsewhere.\n return isMidnight(value) ? text : `${text}${isPersianLanguage(culture) ? '، ' : ', '}${time}`;\n }\n mode = isMidnight(value) ? 'date' : 'dateTime';\n }\n if (mode === 'relative') {\n const ago = formatAgo(localDateTimeToEpochMs(value, input.utcOffsetMinutes), {\n now: input.nowMs,\n strings: input.strings,\n });\n return `${ago} - ${time}`;\n }\n const calendar = culture.language === 'fa' && isSupportedByPersianCalendar(value) ? 'persian' : 'gregorian';\n const date = formatLocalDateTime(value, 'yyyy/MM/dd', culture, { calendar, numberingSystem: 'latin' });\n const text = mode === 'date' ? date : mode === 'time' ? time : `${date} - ${time}`;\n return culture.direction === 'rtl' ? `‪${text}‬` : text;\n}\n\n/** Props of {@link G9CultureDateTimeLabel}. */\nexport interface G9CultureDateTimeLabelProps extends G9ControlBaseProps {\n /** The wall-clock value; `null` shows `emptyText`. */\n readonly value?: G9LocalDateTime | null;\n /** Default `'dateTime'`. */\n readonly displayMode?: G9CultureDateTimeDisplayMode;\n /** Default `''`. */\n readonly emptyText?: string | null;\n /** UTC offset of `value` (relative modes). Default 0. */\n readonly utcOffsetMinutes?: number;\n /**\n * The clock `relativeDay` measures \"today\" against (MAUI static `G9CultureDateTimeLabel.RelativeDayNow`, here per\n * label). Default: the provider's clock at `utcOffsetMinutes`. Point it at a fixed wall clock (a server zone) so a\n * value stamped \"today\" there never reads as \"yesterday\" on a device in another zone.\n */\n readonly relativeDayNow?: () => G9LocalDateTime;\n}\n\n/**\n * A culture-aware date/time text (MAUI `G9CultureDateTimeLabel`); re-renders on culture changes. The relative texts\n * (`relative`, `relativeDay`) do not refresh by themselves (as MAUI); re-render to update them.\n */\nexport function G9CultureDateTimeLabel(props: G9CultureDateTimeLabelProps): ReactNode {\n const control = useG9Control(props, 'g9-date-label');\n const culture = useG9Culture();\n const strings = useG9Strings();\n const clock = useG9Core().services.clock;\n const text =\n props.value == null\n ? (props.emptyText ?? '')\n : formatCultureDateTime({\n value: props.value,\n mode: props.displayMode ?? 'dateTime',\n culture,\n strings,\n nowMs: clock.now(),\n utcOffsetMinutes: props.utcOffsetMinutes ?? 0,\n ...(props.displayMode === 'relativeDay' && props.relativeDayNow\n ? { relativeDayNow: props.relativeDayNow() }\n : {}),\n });\n return <text className={control.className}>{text}</text>;\n}\n"],"names":["G9CultureDateTimeDisplayMode","dayWords","Object","G9StringKey","isMidnight","value","formatCultureDateTime","input","culture","time","formatLocalDateTime","mode","_input_relativeDayNow","now","localDateTimeFromEpochMs","word","String","toEpochDays","undefined","text1","isPersianLanguage","ago","formatAgo","localDateTimeToEpochMs","calendar","isSupportedByPersianCalendar","date","G9CultureDateTimeLabel","props","_props_emptyText","_props_displayMode","_props_utcOffsetMinutes","control","useG9Control","useG9Culture","strings","useG9Strings","clock","useG9Core","text"],"mappings":";;;;AAuBO,MAAMA,+BAA+B;IAC1C,UAAU;IACV,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;AACf;AAqBA,MAAMC,WAAkDC,OAAO,MAAM,CAAC;IACpE,GAAKC,YAAY,KAAK;IACtB,GAAKA,YAAY,QAAQ;IACzB,MAAMA,YAAY,SAAS;AAC7B;AAEA,MAAMC,aAAa,CAACC,QAClBA,AAAe,MAAfA,MAAM,IAAI,IAAUA,AAAiB,MAAjBA,MAAM,MAAM,IAAUA,AAAiB,MAAjBA,MAAM,MAAM,IAAUA,AAAsB,MAAtBA,MAAM,WAAW;AAS5E,SAASC,sBAAsBC,KAAmC;IACvE,MAAM,EAAEF,KAAK,EAAEG,OAAO,EAAE,GAAGD;IAC3B,MAAME,OAAOC,oBAAoBL,OAAO,SAASG,SAAS;QAAE,UAAU;QAAa,iBAAiB;IAAQ;IAC5G,IAAIG,OAAOJ,MAAM,IAAI;IACrB,IAAII,AAAS,kBAATA,MAAwB;YACdC;QAAZ,MAAMC,MAAM,QAAAD,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwBE,yBAAyBP,MAAM,KAAK,EAAEA,MAAM,gBAAgB;QAChG,MAAMQ,OAAOd,QAAQ,CAACe,OAAOC,YAAYZ,SAASY,YAAYJ,MAAM;QACpE,IAAIE,AAASG,WAATH,MAAoB;YACtB,MAAMI,QAAOZ,MAAM,OA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A,0BAA0B;QAC5C,GAAIH,AAAsB,kBAAtBA,MAAM,WAAW,IAAsBA,MAAM,cAAc,GAC3D;YAAE,gBAAgBA,MAAM,cAAc;QAAG,IACzC,CAAC,CAAC;IACR;IACN,QAAQW,KAAK,WAAWP,QAAQ,SAAS,GAAGb,QAAOoB;AACrD"}
1
+ {"version":3,"file":"display/culture-date-time-label.jsx","sources":["../../src/display/culture-date-time-label.tsx"],"sourcesContent":["import './display.css';\nimport {\n formatAgo,\n formatLocalDateTime,\n type G9Culture,\n type G9LocalDateTime,\n G9StringKey,\n type G9Strings,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTimeFromEpochMs,\n localDateTimeToEpochMs,\n toEpochDays,\n} from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { type G9ControlBaseProps, useG9Control } from '../base/control';\nimport { useG9Core, useG9Culture, useG9Strings } from '../provider/hooks';\n\n/**\n * What the label shows (MAUI `G9CultureDateTimeDisplayMode`). `relativeDay` (MAUI 1.4.0) is a due-date style: «امروز،\n * 18:00» / \"Today, 18:00\", and the `tomorrow` / `yesterday` words, when the value falls on one of those three days;\n * otherwise exactly `dateTime` (`date` for a midnight value, which almost always means \"a date with no time\").\n */\nexport const G9CultureDateTimeDisplayMode = {\n DateTime: 'dateTime',\n Date: 'date',\n Time: 'time',\n Relative: 'relative',\n RelativeDay: 'relativeDay',\n} as const;\nexport type G9CultureDateTimeDisplayMode =\n (typeof G9CultureDateTimeDisplayMode)[keyof typeof G9CultureDateTimeDisplayMode];\n\n/** Inputs of {@link formatCultureDateTime}. */\nexport interface G9CultureDateTimeFormatInput {\n readonly value: G9LocalDateTime;\n readonly mode: G9CultureDateTimeDisplayMode;\n readonly culture: G9Culture;\n readonly strings: G9Strings;\n /** Now (epoch ms), for the relative mode. */\n readonly nowMs: number;\n /** UTC offset of `value`'s wall clock, for the relative modes. */\n readonly utcOffsetMinutes: number;\n /**\n * The wall-clock \"now\" `relativeDay` measures today against (MAUI `G9CultureDateTimeLabel.RelativeDayNow()`).\n * Default: `nowMs` at `utcOffsetMinutes`, i.e. today in the value's own zone.\n */\n readonly relativeDayNow?: G9LocalDateTime;\n}\n\nconst dayWords: Readonly<Record<string, G9StringKey>> = Object.freeze({\n '0': G9StringKey.Today,\n '1': G9StringKey.Tomorrow,\n '-1': G9StringKey.Yesterday,\n});\n\nconst isMidnight = (value: G9LocalDateTime) =>\n value.hour === 0 && value.minute === 0 && value.second === 0 && value.millisecond === 0;\n\n/**\n * MAUI `G9CultureDateTimeLabel.Format`: Jalali for `fa` cultures (Gregorian outside the Persian range), else\n * Gregorian; `yyyy/MM/dd`, `HH:mm`, `date - time`, or `ago - HH:mm`; Latin digits (as the MAUI code). Absolute text in\n * an RTL culture is wrapped in LRE…PDF so it reads left to right. `relativeDay` writes the day word («امروز، 18:00»,\n * \"Today, 18:00\", the word alone at midnight) in the culture's own direction, never embedded, and falls back to the\n * absolute date (with its time only when it has one) outside today, tomorrow and yesterday.\n */\nexport function formatCultureDateTime(input: G9CultureDateTimeFormatInput): string {\n const { value, culture } = input;\n const time = formatLocalDateTime(value, 'HH:mm', culture, { calendar: 'gregorian', numberingSystem: 'latin' });\n let mode = input.mode;\n if (mode === 'relativeDay') {\n const now = input.relativeDayNow ?? localDateTimeFromEpochMs(input.nowMs, input.utcOffsetMinutes);\n const word = dayWords[String(toEpochDays(value) - toEpochDays(now))];\n if (word !== undefined) {\n const text = input.strings.get(word);\n // The Persian comma under fa (the design's «امروز، ۱۸:۰۰»), a Latin one elsewhere.\n return isMidnight(value) ? text : `${text}${isPersianLanguage(culture) ? '، ' : ', '}${time}`;\n }\n mode = isMidnight(value) ? 'date' : 'dateTime';\n }\n if (mode === 'relative') {\n const ago = formatAgo(localDateTimeToEpochMs(value, input.utcOffsetMinutes), {\n now: input.nowMs,\n strings: input.strings,\n });\n return `${ago} - ${time}`;\n }\n const calendar = culture.language === 'fa' && isSupportedByPersianCalendar(value) ? 'persian' : 'gregorian';\n const date = formatLocalDateTime(value, 'yyyy/MM/dd', culture, { calendar, numberingSystem: 'latin' });\n const text = mode === 'date' ? date : mode === 'time' ? time : `${date} - ${time}`;\n return culture.direction === 'rtl' ? `‪${text}‬` : text;\n}\n\n/** Props of {@link G9CultureDateTimeLabel}. */\nexport interface G9CultureDateTimeLabelProps extends G9ControlBaseProps {\n /** The wall-clock value; `null` shows `emptyText`. */\n readonly value?: G9LocalDateTime | null;\n /** Default `'dateTime'`. */\n readonly displayMode?: G9CultureDateTimeDisplayMode;\n /** Default `''`. */\n readonly emptyText?: string | null;\n /** UTC offset of `value` (relative modes). Default 0. */\n readonly utcOffsetMinutes?: number;\n /**\n * The clock `relativeDay` measures \"today\" against (MAUI static `G9CultureDateTimeLabel.RelativeDayNow`, here per\n * label). Default: the provider's clock at `utcOffsetMinutes`. Point it at a fixed wall clock (a server zone) so a\n * value stamped \"today\" there never reads as \"yesterday\" on a device in another zone.\n */\n readonly relativeDayNow?: () => G9LocalDateTime;\n}\n\n/**\n * A culture-aware date/time text (MAUI `G9CultureDateTimeLabel`); re-renders on culture changes. The relative texts\n * (`relative`, `relativeDay`) do not refresh by themselves (as MAUI); re-render to update them.\n */\nexport function G9CultureDateTimeLabel(props: G9CultureDateTimeLabelProps): ReactNode {\n const control = useG9Control(props, 'g9-date-label');\n const culture = useG9Culture();\n const strings = useG9Strings();\n const clock = useG9Core().services.clock;\n const text =\n props.value == null\n ? (props.emptyText ?? '')\n : formatCultureDateTime({\n value: props.value,\n mode: props.displayMode ?? 'dateTime',\n culture,\n strings,\n nowMs: clock.now(),\n utcOffsetMinutes: props.utcOffsetMinutes ?? 0,\n ...(props.displayMode === 'relativeDay' && props.relativeDayNow\n ? { relativeDayNow: props.relativeDayNow() }\n : {}),\n });\n return (\n <text className={control.className} {...control.idProps}>\n {text}\n </text>\n );\n}\n"],"names":["G9CultureDateTimeDisplayMode","dayWords","Object","G9StringKey","isMidnight","value","formatCultureDateTime","input","culture","time","formatLocalDateTime","mode","_input_relativeDayNow","now","localDateTimeFromEpochMs","word","String","toEpochDays","undefined","text1","isPersianLanguage","ago","formatAgo","localDateTimeToEpochMs","calendar","isSupportedByPersianCalendar","date","G9CultureDateTimeLabel","props","_props_emptyText","_props_displayMode","_props_utcOffsetMinutes","control","useG9Control","useG9Culture","strings","useG9Strings","clock","useG9Core","text"],"mappings":";;;;AAuBO,MAAMA,+BAA+B;IAC1C,UAAU;IACV,MAAM;IACN,MAAM;IACN,UAAU;IACV,aAAa;AACf;AAqBA,MAAMC,WAAkDC,OAAO,MAAM,CAAC;IACpE,GAAKC,YAAY,KAAK;IACtB,GAAKA,YAAY,QAAQ;IACzB,MAAMA,YAAY,SAAS;AAC7B;AAEA,MAAMC,aAAa,CAACC,QAClBA,AAAe,MAAfA,MAAM,IAAI,IAAUA,AAAiB,MAAjBA,MAAM,MAAM,IAAUA,AAAiB,MAAjBA,MAAM,MAAM,IAAUA,AAAsB,MAAtBA,MAAM,WAAW;AAS5E,SAASC,sBAAsBC,KAAmC;IACvE,MAAM,EAAEF,KAAK,EAAEG,OAAO,EAAE,GAAGD;IAC3B,MAAME,OAAOC,oBAAoBL,OAAO,SAASG,SAAS;QAAE,UAAU;QAAa,iBAAiB;IAAQ;IAC5G,IAAIG,OAAOJ,MAAM,IAAI;IACrB,IAAII,AAAS,kBAATA,MAAwB;YACdC;QAAZ,MAAMC,MAAM,QAAAD,CAAAA,wBAAAA,MAAM,cAAc,AAAD,IAAnBA,wBAAwBE,yBAAyBP,MAAM,KAAK,EAAEA,MAAM,gBAAgB;QAChG,MAAMQ,OAAOd,QAAQ,CAACe,OAAOC,YAAYZ,SAASY,YAAYJ,MAAM;QACpE,IAAIE,AAASG,WAATH,MAAoB;YACtB,MAAMI,QAAOZ,MAAM,OAAO,CAAC,GAAG,CAACQ;YAE/B,OAAOX,WAAWC,SAASc,QAAO,GAAGA,QAAOC,kBAAkBZ,WAAW,OAAO,OAAOC,MAAM;QAC/F;QACAE,OAAOP,WAAWC,SAAS,SA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QACGW,KAAK,WAAWP,QAAQ,SAAS,GAAG,GAAGA,QAAQ,OAAO,EAAE;MACvD,CAACb,MAAK;IACR,EAAEoB;AAEN"}
@@ -21,7 +21,7 @@ function G9ProgressBar(props) {
21
21
  const indeterminate = true === props.isIndeterminate;
22
22
  const placement = null != (_props_labelPlacement = props.labelPlacement) ? _props_labelPlacement : 'none';
23
23
  const value = clampProgress(null != (_props_value = props.value) ? _props_value : 0);
24
- return <view className={control.className}>
24
+ return <view className={control.className} {...control.idProps}>
25
25
  {'none' !== placement ? <text className="g9-progress__label" style={{
26
26
  color
27
27
  }}>