@g9tm/lynxcontrols 1.4.7 → 1.4.11

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 (121) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/base/index.d.ts +1 -1
  3. package/dist/base/index.d.ts.map +1 -1
  4. package/dist/base/index.jsx +1 -1
  5. package/dist/base/selection-item.d.ts +9 -1
  6. package/dist/base/selection-item.d.ts.map +1 -1
  7. package/dist/base/selection-item.jsx +10 -1
  8. package/dist/base/selection-item.jsx.map +1 -1
  9. package/dist/button/button.css +20 -0
  10. package/dist/button/button.css.map +1 -1
  11. package/dist/button/header-action-button.d.ts +5 -0
  12. package/dist/button/header-action-button.d.ts.map +1 -1
  13. package/dist/button/header-action-button.jsx +6 -1
  14. package/dist/button/header-action-button.jsx.map +1 -1
  15. package/dist/button/visuals.d.ts.map +1 -1
  16. package/dist/button/visuals.jsx +1 -1
  17. package/dist/button/visuals.jsx.map +1 -1
  18. package/dist/fields/editor.d.ts.map +1 -1
  19. package/dist/fields/editor.jsx +2 -2
  20. package/dist/fields/editor.jsx.map +1 -1
  21. package/dist/fields/fields.css +21 -0
  22. package/dist/fields/fields.css.map +1 -1
  23. package/dist/fields/index.d.ts +1 -1
  24. package/dist/fields/index.d.ts.map +1 -1
  25. package/dist/fields/index.jsx +1 -1
  26. package/dist/fields/outlined-field.d.ts +27 -1
  27. package/dist/fields/outlined-field.d.ts.map +1 -1
  28. package/dist/fields/outlined-field.jsx +29 -2
  29. package/dist/fields/outlined-field.jsx.map +1 -1
  30. package/dist/fields/text-entry.d.ts.map +1 -1
  31. package/dist/fields/text-entry.jsx +2 -2
  32. package/dist/fields/text-entry.jsx.map +1 -1
  33. package/dist/pickers/combo-box.d.ts +8 -0
  34. package/dist/pickers/combo-box.d.ts.map +1 -1
  35. package/dist/pickers/combo-box.jsx +51 -9
  36. package/dist/pickers/combo-box.jsx.map +1 -1
  37. package/dist/pickers/date-time-picker.d.ts +2 -2
  38. package/dist/pickers/date-time-picker.d.ts.map +1 -1
  39. package/dist/pickers/date-time-picker.jsx +4 -3
  40. package/dist/pickers/date-time-picker.jsx.map +1 -1
  41. package/dist/pickers/date-time.d.ts +5 -2
  42. package/dist/pickers/date-time.d.ts.map +1 -1
  43. package/dist/pickers/date-time.jsx +1 -1
  44. package/dist/pickers/date-time.jsx.map +1 -1
  45. package/dist/pickers/picker-sheet.d.ts +6 -2
  46. package/dist/pickers/picker-sheet.d.ts.map +1 -1
  47. package/dist/pickers/picker-sheet.jsx +2 -3
  48. package/dist/pickers/picker-sheet.jsx.map +1 -1
  49. package/dist/pickers/picker.d.ts.map +1 -1
  50. package/dist/pickers/picker.jsx +3 -2
  51. package/dist/pickers/picker.jsx.map +1 -1
  52. package/dist/pickers/pickers.css +27 -0
  53. package/dist/pickers/pickers.css.map +1 -1
  54. package/dist/pickers/timespan-picker.d.ts.map +1 -1
  55. package/dist/pickers/timespan-picker.jsx +3 -2
  56. package/dist/pickers/timespan-picker.jsx.map +1 -1
  57. package/dist/pickers/trigger.d.ts +3 -1
  58. package/dist/pickers/trigger.d.ts.map +1 -1
  59. package/dist/pickers/trigger.jsx +6 -1
  60. package/dist/pickers/trigger.jsx.map +1 -1
  61. package/dist/provider/settings.d.ts +12 -0
  62. package/dist/provider/settings.d.ts.map +1 -1
  63. package/dist/provider/settings.jsx +6 -3
  64. package/dist/provider/settings.jsx.map +1 -1
  65. package/dist/provider/theme.css +4 -0
  66. package/dist/provider/theme.css.map +1 -1
  67. package/dist/range-slider/math.d.ts +14 -4
  68. package/dist/range-slider/math.d.ts.map +1 -1
  69. package/dist/range-slider/math.jsx +16 -4
  70. package/dist/range-slider/math.jsx.map +1 -1
  71. package/dist/range-slider/range-slider.css +17 -0
  72. package/dist/range-slider/range-slider.css.map +1 -1
  73. package/dist/range-slider/range-slider.d.ts +11 -0
  74. package/dist/range-slider/range-slider.d.ts.map +1 -1
  75. package/dist/range-slider/range-slider.jsx +35 -13
  76. package/dist/range-slider/range-slider.jsx.map +1 -1
  77. package/dist/selection/index.d.ts +2 -1
  78. package/dist/selection/index.d.ts.map +1 -1
  79. package/dist/selection/index.jsx +2 -1
  80. package/dist/selection/selection-sheet.d.ts +3 -1
  81. package/dist/selection/selection-sheet.d.ts.map +1 -1
  82. package/dist/selection/selection-sheet.jsx +57 -8
  83. package/dist/selection/selection-sheet.jsx.map +1 -1
  84. package/dist/selection/selection.css +7 -0
  85. package/dist/selection/selection.css.map +1 -1
  86. package/dist/selection/window.d.ts +29 -0
  87. package/dist/selection/window.d.ts.map +1 -0
  88. package/dist/selection/window.jsx +24 -0
  89. package/dist/selection/window.jsx.map +1 -0
  90. package/dist/sheet/frame.d.ts.map +1 -1
  91. package/dist/sheet/frame.jsx +8 -4
  92. package/dist/sheet/frame.jsx.map +1 -1
  93. package/dist/sheet/header.d.ts.map +1 -1
  94. package/dist/sheet/header.jsx +3 -1
  95. package/dist/sheet/header.jsx.map +1 -1
  96. package/dist/sheet/index.d.ts +1 -1
  97. package/dist/sheet/index.d.ts.map +1 -1
  98. package/dist/sheet/index.jsx +1 -1
  99. package/dist/sheet/options.d.ts +20 -0
  100. package/dist/sheet/options.d.ts.map +1 -1
  101. package/dist/sheet/options.jsx +2 -1
  102. package/dist/sheet/options.jsx.map +1 -1
  103. package/dist/sheet/service.d.ts +8 -0
  104. package/dist/sheet/service.d.ts.map +1 -1
  105. package/dist/sheet/service.jsx +15 -4
  106. package/dist/sheet/service.jsx.map +1 -1
  107. package/dist/sheet/sizing.d.ts +2 -0
  108. package/dist/sheet/sizing.d.ts.map +1 -1
  109. package/dist/sheet/sizing.jsx +2 -1
  110. package/dist/sheet/sizing.jsx.map +1 -1
  111. package/dist/toggle/chip-group.d.ts +9 -1
  112. package/dist/toggle/chip-group.d.ts.map +1 -1
  113. package/dist/toggle/chip-group.jsx +51 -12
  114. package/dist/toggle/chip-group.jsx.map +1 -1
  115. package/dist/toggle/switch.d.ts +1 -1
  116. package/dist/toggle/switch.d.ts.map +1 -1
  117. package/dist/toggle/switch.jsx +3 -2
  118. package/dist/toggle/switch.jsx.map +1 -1
  119. package/dist/toggle/toggle.css +20 -0
  120. package/dist/toggle/toggle.css.map +1 -1
  121. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';
1
+ import { type G9ImageSource } from '@g9tm/lynxcontrols-foundation';
2
2
  import type { G9IconInput } from '../icon/icon.js';
3
3
  /**
4
4
  * One selectable item (MAUI `G9SelectionItem`), shared by the chip group (WP04), the selection sheet and the pickers
@@ -23,7 +23,15 @@ export interface G9SelectionItem<TValue = unknown> {
23
23
  /** Selected fill override (wins over the group's). */
24
24
  readonly selectedColor?: string | null | undefined;
25
25
  readonly selectedTextColor?: string | null | undefined;
26
+ /**
27
+ * The image (`iconPath` / `iconImage`) is a person's picture (MAUI 1.4.10 `IsAvatar`): drawn ROUND, at
28
+ * `G9Metrics.SelectionAvatarSize` (28) in the selection sheet's rows and round at the icon size as a single combo-box
29
+ * value; multi-select chips show the name only. Ignored for an emoji or a glyph.
30
+ */
31
+ readonly isAvatar?: boolean | undefined;
26
32
  }
33
+ /** The item's icon is a person's picture: `isAvatar` on an image, not an emoji or a glyph (MAUI `IsAvatarImage`). */
34
+ export declare function isAvatarImage(item: G9SelectionItem): boolean;
27
35
  /** The identity of an item: `key` unless blank, else `text` (MAUI `G9SelectionItem.SelectionIdentity`). */
28
36
  export declare function selectionKey(item: Pick<G9SelectionItem, 'key' | 'text'>): string;
29
37
  //# sourceMappingURL=selection-item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"selection-item.d.ts","sourceRoot":"","sources":["../../src/base/selection-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,MAAM,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AI,EAAE,eAAe,GAAG,OAAO,CAQ5D;AAED,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,GAAG,MAAM,CAAC,GAAG,MAAM,CAEhF"}
@@ -1,6 +1,15 @@
1
+ import { isIconEmpty } from "@g9tm/lynxcontrols-foundation";
2
+ function isAvatarImage(item) {
3
+ if (true !== item.isAvatar) return false;
4
+ if (null != item.emoji && '' !== item.emoji.trim()) return false;
5
+ const icon = item.icon;
6
+ const glyph = void 0 !== icon && ('string' == typeof icon ? '' !== icon.trim() && 'none' !== icon : !isIconEmpty(icon));
7
+ if (glyph) return false;
8
+ return null != item.iconPath && '' !== item.iconPath.trim() || null != item.iconImage;
9
+ }
1
10
  function selectionKey(item) {
2
11
  return null != item.key && '' !== item.key.trim() ? item.key : item.text;
3
12
  }
4
- export { selectionKey };
13
+ export { isAvatarImage, selectionKey };
5
14
 
6
15
  //# sourceMappingURL=selection-item.jsx.map
@@ -1 +1 @@
1
- {"version":3,"file":"base/selection-item.jsx","sources":["../../src/base/selection-item.ts"],"sourcesContent":["import type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport type { G9IconInput } from '../icon/icon';\n\n/**\n * One selectable item (MAUI `G9SelectionItem`), shared by the chip group (WP04), the selection sheet and the pickers\n * (WP05/WP06). Plain data: create it inline or map your own objects to it.\n */\nexport interface G9SelectionItem<TValue = unknown> {\n readonly text: string;\n /** Stable identity; when blank, `text` is the identity (MAUI `SelectionIdentity`). */\n readonly key?: string | null | undefined;\n readonly emoji?: string | null | undefined;\n readonly icon?: G9IconInput | undefined;\n readonly iconPath?: string | null | undefined;\n readonly iconImage?: G9ImageSource | null | undefined;\n readonly iconTintColor?: string | null | undefined;\n /** Colour swatch (one colour = circle, two = split circle). */\n readonly swatchFirstColor?: string | null | undefined;\n readonly swatchSecondColor?: string | null | undefined;\n /** App payload, never read by the controls. */\n readonly value?: TValue | undefined;\n /** Default true. */\n readonly isEnabled?: boolean | undefined;\n /** Selected fill override (wins over the group's). */\n readonly selectedColor?: string | null | undefined;\n readonly selectedTextColor?: string | null | undefined;\n}\n\n/** The identity of an item: `key` unless blank, else `text` (MAUI `G9SelectionItem.SelectionIdentity`). */\nexport function selectionKey(item: Pick<G9SelectionItem, 'key' | 'text'>): string {\n return item.key != null && item.key.trim() !== '' ? item.key : item.text;\n}\n"],"names":["selectionKey","item"],"mappings":"AA6BO,SAASA,aAAaC,IAA2C;IACtE,OAAOA,AAAY,QAAZA,KAAK,GAAG,IAAYA,AAAoB,OAApBA,KAAK,GAAG,CAAC,IAAI,KAAYA,KAAK,GAAG,GAAGA,KAAK,IAAI;AAC1E"}
1
+ {"version":3,"file":"base/selection-item.jsx","sources":["../../src/base/selection-item.ts"],"sourcesContent":["import { type G9ImageSource, isIconEmpty } from '@g9tm/lynxcontrols-foundation';\nimport type { G9IconInput } from '../icon/icon';\n\n/**\n * One selectable item (MAUI `G9SelectionItem`), shared by the chip group (WP04), the selection sheet and the pickers\n * (WP05/WP06). Plain data: create it inline or map your own objects to it.\n */\nexport interface G9SelectionItem<TValue = unknown> {\n readonly text: string;\n /** Stable identity; when blank, `text` is the identity (MAUI `SelectionIdentity`). */\n readonly key?: string | null | undefined;\n readonly emoji?: string | null | undefined;\n readonly icon?: G9IconInput | undefined;\n readonly iconPath?: string | null | undefined;\n readonly iconImage?: G9ImageSource | null | undefined;\n readonly iconTintColor?: string | null | undefined;\n /** Colour swatch (one colour = circle, two = split circle). */\n readonly swatchFirstColor?: string | null | undefined;\n readonly swatchSecondColor?: string | null | undefined;\n /** App payload, never read by the controls. */\n readonly value?: TValue | undefined;\n /** Default true. */\n readonly isEnabled?: boolean | undefined;\n /** Selected fill override (wins over the group's). */\n readonly selectedColor?: string | null | undefined;\n readonly selectedTextColor?: string | null | undefined;\n /**\n * The image (`iconPath` / `iconImage`) is a person's picture (MAUI 1.4.10 `IsAvatar`): drawn ROUND, at\n * `G9Metrics.SelectionAvatarSize` (28) in the selection sheet's rows and round at the icon size as a single combo-box\n * value; multi-select chips show the name only. Ignored for an emoji or a glyph.\n */\n readonly isAvatar?: boolean | undefined;\n}\n\n/** The item's icon is a person's picture: `isAvatar` on an image, not an emoji or a glyph (MAUI `IsAvatarImage`). */\nexport function isAvatarImage(item: G9SelectionItem): boolean {\n if (item.isAvatar !== true) return false;\n if (item.emoji != null && item.emoji.trim() !== '') return false;\n const icon = item.icon;\n const glyph =\n icon !== undefined && (typeof icon === 'string' ? icon.trim() !== '' && icon !== 'none' : !isIconEmpty(icon));\n if (glyph) return false;\n return (item.iconPath != null && item.iconPath.trim() !== '') || item.iconImage != null;\n}\n\n/** The identity of an item: `key` unless blank, else `text` (MAUI `G9SelectionItem.SelectionIdentity`). */\nexport function selectionKey(item: Pick<G9SelectionItem, 'key' | 'text'>): string {\n return item.key != null && item.key.trim() !== '' ? item.key : item.text;\n}\n"],"names":["isAvatarImage","item","icon","glyph","undefined","isIconEmpty","selectionKey"],"mappings":";AAmCO,SAASA,cAAcC,IAAqB;IACjD,IAAIA,AAAkB,SAAlBA,KAAK,QAAQ,EAAW,OAAO;IACnC,IAAIA,AAAc,QAAdA,KAAK,KAAK,IAAYA,AAAsB,OAAtBA,KAAK,KAAK,CAAC,IAAI,IAAW,OAAO;IAC3D,MAAMC,OAAOD,KAAK,IAAI;IACtB,MAAME,QACJD,AAASE,WAATF,QAAuB,CAAgB,YAAhB,OAAOA,OAAoBA,AAAgB,OAAhBA,KAAK,IAAI,MAAaA,AAAS,WAATA,OAAkB,CAACG,YAAYH,KAAI;IAC7G,IAAIC,OAAO,OAAO;IAClB,OAAQF,AAAiB,QAAjBA,KAAK,QAAQ,IAAYA,AAAyB,OAAzBA,KAAK,QAAQ,CAAC,IAAI,MAAcA,AAAkB,QAAlBA,KAAK,SAAS;AACjF;AAGO,SAASK,aAAaL,IAA2C;IACtE,OAAOA,AAAY,QAAZA,KAAK,GAAG,IAAYA,AAAoB,OAApBA,KAAK,GAAG,CAAC,IAAI,KAAYA,KAAK,GAAG,GAAGA,KAAK,IAAI;AAC1E"}
@@ -60,6 +60,26 @@
60
60
  top: 6px;
61
61
  }
62
62
 
63
+ .g9-header-action__count {
64
+ background-color: var(--g9-primary);
65
+ border-radius: 8px;
66
+ justify-content: center;
67
+ align-items: center;
68
+ min-width: 16px;
69
+ height: 16px;
70
+ padding: 0 4px;
71
+ display: flex;
72
+ position: absolute;
73
+ top: 2px;
74
+ }
75
+
76
+ .g9-header-action__count-text {
77
+ text-align: center;
78
+ color: var(--g9-on-primary);
79
+ font-size: 10px;
80
+ font-weight: bold;
81
+ }
82
+
63
83
  .g9-vertical-button {
64
84
  border-style: solid;
65
85
  border-width: 1px;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/button/button.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,aAAa;EACb,gBAAgB;AAClB;;AAGA;EAAE,mBAAmB;AACrB;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,mCAAmC;EACnC,oDAAoD;EACpD,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,mCAAmC;EACnC,eAAe;EACf,iBAAiB;AACnB;;AAGA;EAAE,mCAAmC;EACnC,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,QAAQ;AACV;;AAGA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,iDAAiD;EACjD,6CAA6C;EAC7C,kBAAkB;EAClB,sBAAsB;EACtB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,kBAAkB;EAClB,0BAA0B;AAC5B;;AAGA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,kBAAkB;EAClB,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,eAAe;EACf,iBAAiB;AACnB;;AAIA;EADE,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAIA;EADE,cAAc;EACd,YAAY;AACd;;AAIA;EADE,cAAc;EACd,mBAAmB;EACnB,aAAa;AACf;;AAKA;EAFE,uBAAuB;EACvB,8BAA8B;EAC9B,iBAAiB;AACnB;;AAKA;EAFE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAKA;EAFE,eAAe;EACf,iBAAiB;AACnB;;AAKA;EAFE,2CAA2C;EAC3C,mBAAmB;EACnB,kBAAkB;AACpB;;AAKA;EAFE,sBAAsB;EACtB,eAAe;EACf,iBAAiB;AACnB","sourcesContent":["/* Buttons (MAUI G9Button, G9IconButton, G9HeaderActionButton, G9VerticalIconTextButton, G9NavCard). No shadows. */\n.g9-button {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-style: solid;\n overflow: hidden;\n column-gap: 8px;\n}\n\n.g9-button--fill {\n align-self: stretch;\n}\n\n.g9-button__label {\n text-align: center;\n}\n\n.g9-icon-button {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-icon-button__host {\n position: relative;\n}\n\n.g9-icon-button__frame {\n display: flex;\n align-items: center;\n justify-content: center;\n border-style: solid;\n}\n\n.g9-header-action {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 9px;\n border-color: var(--g9-card-border);\n background-color: var(--g9-surface-container-lowest);\n}\n\n.g9-header-action__text {\n font-size: 13px;\n font-weight: bold;\n color: var(--g9-on-surface-variant);\n}\n\n.g9-header-action__badge {\n position: absolute;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n.g9-vertical-button {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 5px;\n border-style: solid;\n border-width: 1px;\n border-radius: 9px;\n border-color: var(--g9-surface-container-highest);\n background-color: var(--g9-surface-container);\n}\n\n.g9-vertical-button__text {\n text-align: center;\n color: var(--g9-secondary);\n}\n\n.g9-nav-card {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 12px;\n padding: 12px 14px;\n border-style: solid;\n border-width: 1px;\n border-radius: 16px;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-nav-card__tile {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 12px;\n}\n\n.g9-nav-card__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n row-gap: 2px;\n}\n\n.g9-nav-card__title {\n font-size: 14px;\n font-weight: bold;\n text-overflow: ellipsis;\n}\n\n/* Only while a titleAccessory is set: the title shrinks (and truncates), the accessory keeps its size. */\n.g9-nav-card__title-row {\n display: flex;\n align-items: center;\n column-gap: 8px;\n}\n\n.g9-nav-card__title-row .g9-nav-card__title {\n flex-shrink: 1;\n min-width: 0;\n}\n\n.g9-nav-card__title-accessory {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n}\n\n/* One line with an ellipsis (MAUI MaxLines 1, TailTruncation): text-maxline alone let a long subtitle wrap. */\n.g9-nav-card__subtitle {\n text-overflow: ellipsis;\n font-size: 11.5px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-nav-card__trailing {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 8px;\n}\n\n.g9-nav-card__value {\n font-size: 13px;\n font-weight: bold;\n}\n\n.g9-nav-card__soon {\n padding: 3.5px 7px;\n border-radius: 11px;\n background-color: var(--g9-error-container);\n}\n\n.g9-nav-card__soon-text {\n font-size: 10px;\n font-weight: bold;\n color: var(--g9-error);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/button/button.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,aAAa;EACb,gBAAgB;AAClB;;AAGA;EAAE,mBAAmB;AACrB;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,kBAAkB;AACpB;;AAGA;EAAE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,mCAAmC;EACnC,oDAAoD;EACpD,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,mCAAmC;EACnC,eAAe;EACf,iBAAiB;AACnB;;AAGA;EAAE,mCAAmC;EACnC,kBAAkB;EAClB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,QAAQ;AACV;;AAIA;EADE,mCAAmC;EACnC,kBAAkB;EAClB,uBAAuB;EACvB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,QAAQ;AACV;;AAIA;EADE,kBAAkB;EAClB,2BAA2B;EAC3B,eAAe;EACf,iBAAiB;AACnB;;AAIA;EADE,mBAAmB;EACnB,iBAAiB;EACjB,iDAAiD;EACjD,6CAA6C;EAC7C,kBAAkB;EAClB,sBAAsB;EACtB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,kBAAkB;EAClB,0BAA0B;AAC5B;;AAIA;EADE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,kBAAkB;EAClB,aAAa;AACf;;AAIA;EADE,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;EACb,kBAAkB;AACpB;;AAIA;EADE,sBAAsB;EACtB,OAAO;EACP,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,uBAAuB;EACvB,eAAe;EACf,iBAAiB;AACnB;;AAKA;EAFE,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAKA;EAFE,cAAc;EACd,YAAY;AACd;;AAKA;EAFE,cAAc;EACd,mBAAmB;EACnB,aAAa;AACf;;AAMA;EAHE,uBAAuB;EACvB,8BAA8B;EAC9B,iBAAiB;AACnB;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,eAAe;EACf,iBAAiB;AACnB;;AAMA;EAHE,2CAA2C;EAC3C,mBAAmB;EACnB,kBAAkB;AACpB;;AAMA;EAHE,sBAAsB;EACtB,eAAe;EACf,iBAAiB;AACnB","sourcesContent":["/* Buttons (MAUI G9Button, G9IconButton, G9HeaderActionButton, G9VerticalIconTextButton, G9NavCard). No shadows. */\n.g9-button {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-style: solid;\n overflow: hidden;\n column-gap: 8px;\n}\n\n.g9-button--fill {\n align-self: stretch;\n}\n\n.g9-button__label {\n text-align: center;\n}\n\n.g9-icon-button {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-icon-button__host {\n position: relative;\n}\n\n.g9-icon-button__frame {\n display: flex;\n align-items: center;\n justify-content: center;\n border-style: solid;\n}\n\n.g9-header-action {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 9px;\n border-color: var(--g9-card-border);\n background-color: var(--g9-surface-container-lowest);\n}\n\n.g9-header-action__text {\n font-size: 13px;\n font-weight: bold;\n color: var(--g9-on-surface-variant);\n}\n\n.g9-header-action__badge {\n position: absolute;\n top: 6px;\n width: 8px;\n height: 8px;\n border-radius: 4px;\n background-color: var(--g9-primary);\n}\n\n/* MAUI 1.4.9 CountBadge: a 16 px pill (min width 16, 4 px side padding, corner 8) over the top end corner, 2 px in. */\n.g9-header-action__count {\n position: absolute;\n top: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 16px;\n height: 16px;\n padding: 0 4px;\n border-radius: 8px;\n background-color: var(--g9-primary);\n}\n\n.g9-header-action__count-text {\n font-size: 10px;\n font-weight: bold;\n text-align: center;\n color: var(--g9-on-primary);\n}\n\n.g9-vertical-button {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 5px;\n border-style: solid;\n border-width: 1px;\n border-radius: 9px;\n border-color: var(--g9-surface-container-highest);\n background-color: var(--g9-surface-container);\n}\n\n.g9-vertical-button__text {\n text-align: center;\n color: var(--g9-secondary);\n}\n\n.g9-nav-card {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 12px;\n padding: 12px 14px;\n border-style: solid;\n border-width: 1px;\n border-radius: 16px;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-nav-card__tile {\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 12px;\n}\n\n.g9-nav-card__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n row-gap: 2px;\n}\n\n.g9-nav-card__title {\n font-size: 14px;\n font-weight: bold;\n text-overflow: ellipsis;\n}\n\n/* Only while a titleAccessory is set: the title shrinks (and truncates), the accessory keeps its size. */\n.g9-nav-card__title-row {\n display: flex;\n align-items: center;\n column-gap: 8px;\n}\n\n.g9-nav-card__title-row .g9-nav-card__title {\n flex-shrink: 1;\n min-width: 0;\n}\n\n.g9-nav-card__title-accessory {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n}\n\n/* One line with an ellipsis (MAUI MaxLines 1, TailTruncation): text-maxline alone let a long subtitle wrap. */\n.g9-nav-card__subtitle {\n text-overflow: ellipsis;\n font-size: 11.5px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-nav-card__trailing {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 8px;\n}\n\n.g9-nav-card__value {\n font-size: 13px;\n font-weight: bold;\n}\n\n.g9-nav-card__soon {\n padding: 3.5px 7px;\n border-radius: 11px;\n background-color: var(--g9-error-container);\n}\n\n.g9-nav-card__soon-text {\n font-size: 10px;\n font-weight: bold;\n color: var(--g9-error);\n}\n"],"sourceRoot":""}
@@ -21,6 +21,11 @@ export interface G9HeaderActionButtonProps extends G9ControlBaseProps {
21
21
  readonly isActive?: boolean;
22
22
  /** The 8 px dot while active. Default true. */
23
23
  readonly showActiveBadge?: boolean;
24
+ /**
25
+ * A COUNT on the action (MAUI 1.4.9 `BadgeText`, AgriPad's «۲» active filters): a 16 px Primary pill with this text
26
+ * over the icon's top end corner, shown whenever it is set — the active dot gives way to it. Null / empty: the dot rules.
27
+ */
28
+ readonly badgeText?: string | null;
24
29
  /** Scale 0.92 (70 ms) → 1 (90 ms) on press. Default true. */
25
30
  readonly animatePress?: boolean;
26
31
  /** Default 24. */
@@ -1 +1 @@
1
- {"version":3,"file":"header-action-button.d.ts","sourceRoot":"","sources":["../../src/button/header-action-button.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAwB,KAAK,aAAa,EAAa,MAAM,+BAA+B,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,KAAK,kBAAkB,EAAgB,MAAM,iBAAiB,CAAC;AAGxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,2EA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BAAmB,KAAK,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,uCAAuC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,SAAS,CAwDhF"}
@@ -27,6 +27,7 @@ function G9HeaderActionButton(props) {
27
27
  outMs: 90
28
28
  }, control.disabled || busy || false === props.animatePress);
29
29
  const text1 = null != (_props_buttonText = props.buttonText) ? _props_buttonText : '';
30
+ const badge = null != props.badgeText && '' !== props.badgeText ? props.badgeText : null;
30
31
  let content;
31
32
  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
33
  return <view className={control.className} {...control.idProps} style={{
@@ -41,7 +42,11 @@ function G9HeaderActionButton(props) {
41
42
  'accessibility-label': null != (_props_accessibilityLabel1 = props.accessibilityLabel) ? _props_accessibilityLabel1 : text1
42
43
  } : {}} bindtap={press} {...visual}>
43
44
  {content}
44
- {active && false !== props.showActiveBadge ? <view className="g9-header-action__badge" style={{
45
+ {badge ? <view className="g9-header-action__count" user-interaction-enabled={false} style={{
46
+ ['rtl' === control.direction ? 'left' : 'right']: '2px'
47
+ }}>
48
+ <text className="g9-header-action__count-text">{badge}</text>
49
+ </view> : active && false !== props.showActiveBadge ? <view className="g9-header-action__badge" style={{
45
50
  ['rtl' === control.direction ? 'left' : 'right']: '6px'
46
51
  }}/> : null}
47
52
  </view>;
@@ -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 {...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;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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EkB;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 /**\n * A COUNT on the action (MAUI 1.4.9 `BadgeText`, AgriPad's «۲» active filters): a 16 px Primary pill with this text\n * over the icon's top end corner, shown whenever it is set — the active dot gives way to it. Null / empty: the dot rules.\n */\n readonly badgeText?: string | null;\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 const badge = props.badgeText != null && props.badgeText !== '' ? props.badgeText : null;\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 {badge ? (\n <view\n className=\"g9-header-action__count\"\n user-interaction-enabled={false}\n style={{ [control.direction === 'rtl' ? 'left' : 'right']: '2px' }}\n >\n <text className=\"g9-header-action__count-text\">{badge}</text>\n </view>\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","badge","content","G9ActivityIndicator","G9IconSlot","text","G9Glyph","view","formatColor","withAlpha","undefined"],"mappings":";;;;;;;AAWO,MAAMA,oBAAoB;AAE1B,MAAMC,sBAAsB;AA+B5B,SAASC,qBAAqBC,KAAgC;QAMlDC,iBAMJC,mBAMoBC,aAkBvBC,2BACuBC;IApCjC,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,MAAMiB,QAAQnB,AAAmB,QAAnBA,MAAM,SAAS,IAAYA,AAAoB,OAApBA,MAAM,SAAS,GAAUA,MAAM,SAAS,GAAG;IACpF,IAAIoB;IACMA,UAANV,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C,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CA4C3E;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,GAAG,kBAAkB,CAqCxE;AAED,6BAA6B;AAC7B,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,CAAC;AAEzE,wCAAwC;AACxC,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,gBAAgB,GAAG;IACjE,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC9B,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAChC,CAKA"}
@@ -67,7 +67,7 @@ function buttonSizePreset(size) {
67
67
  return {
68
68
  height: G9Metrics.ButtonHeightHero,
69
69
  paddingHorizontal: 16,
70
- paddingVertical: 16,
70
+ paddingVertical: 12,
71
71
  fontSize: G9Metrics.ButtonFontHero,
72
72
  fill: true
73
73
  };
@@ -1 +1 @@
1
- {"version":3,"file":"button/visuals.jsx","sources":["../../src/button/visuals.ts"],"sourcesContent":["import {\n buildSolidOrGradient,\n createBorderColor,\n fillToCss,\n formatColor,\n type G9ButtonVariant,\n type G9ControlSize,\n G9Metrics,\n type G9PaletteValues,\n getContrastingTextColor,\n resolveButtonVariant,\n toRgba,\n tryParseColor,\n} from '@g9tm/lynxcontrols-foundation';\n\n/** What a button paints (MAUI `G9Visuals.ButtonVisualResult` + the stroke/opacity rules of G9Button/G9IconButton). */\nexport interface G9ButtonPaint {\n /** CSS `background` (a colour or a vertical gradient). */\n readonly background: string;\n readonly text: string;\n readonly stroke: string;\n readonly strokeWidth: number;\n /** 0.38 when not effectively enabled, 0.70 while loading, else 1. */\n readonly opacity: number;\n}\n\n/** Inputs of {@link resolveButtonPaint}. */\nexport interface G9ButtonPaintInput {\n readonly variant: G9ButtonVariant;\n readonly palette: G9PaletteValues;\n /** `IsEnabled && !blocked`. */\n readonly enabled: boolean;\n readonly loading: boolean;\n readonly baseBackgroundColor?: string | null | undefined;\n readonly textColor?: string | null | undefined;\n /** `'button'`: tonal has a 1.5 stroke; `'icon'`: only outline/text do (MAUI G9IconButton). */\n readonly kind: 'button' | 'icon';\n}\n\n/**\n * Resolves the paint of a button (MAUI `G9Button.OnApplyVisuals` / `G9IconButton.OnApplyVisuals`):\n * - variant colours from `resolveButtonVariant`; the gradient only while enabled and not loading;\n * - `baseBackgroundColor`: fully transparent → no fill, no border; otherwise a flat fill, contrasting text and a\n * darkened border (stroke 1 when visible);\n * - `textColor` always wins for text/icon/spinner;\n * - stroke 1.5 for outline/text (and tonal on `G9Button`), else 0.\n * A colour that is not a parseable literal (e.g. a `var(--…)` token) is used as given: flat fill, the variant's text\n * colour unless `textColor` is set, and no derived border.\n */\nexport function resolveButtonPaint(input: G9ButtonPaintInput): G9ButtonPaint {\n const variant = resolveButtonVariant(input.variant, input.palette);\n const opacity = !input.enabled ? 0.38 : input.loading ? 0.7 : 1;\n const base = input.baseBackgroundColor;\n if (base != null) {\n const parsed = tryParseColor(base);\n if (parsed && parsed.a === 0) {\n return {\n background: 'transparent',\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n if (!parsed) {\n return {\n background: base,\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n const stroke = createBorderColor(parsed);\n return {\n background: formatColor(parsed),\n text: input.textColor ?? formatColor(getContrastingTextColor(parsed)),\n stroke: formatColor(stroke),\n strokeWidth: toRgba(stroke).a > 0 ? 1 : 0,\n opacity,\n };\n }\n const outlined =\n input.variant === 'outline' || input.variant === 'text' || (input.kind === 'button' && input.variant === 'tonal');\n return {\n background: fillToCss(\n buildSolidOrGradient(variant.background, variant.usesGradient && input.enabled && !input.loading),\n ),\n text: input.textColor ?? variant.text,\n stroke: variant.stroke,\n strokeWidth: outlined ? 1.5 : 0,\n opacity,\n };\n}\n\n/** Size preset of `G9Button` (MAUI `ApplySizePreset`). */\nexport interface G9ButtonSizePreset {\n readonly height: number;\n readonly paddingHorizontal: number;\n readonly paddingVertical: number;\n readonly fontSize: number;\n /** Hero buttons fill the width. */\n readonly fill: boolean;\n}\n\n/** MAUI G9Button size presets: small 36 / medium 44 / large 48 / hero 52. */\nexport function buttonSizePreset(size: G9ControlSize): G9ButtonSizePreset {\n switch (size) {\n case 'small':\n return {\n height: G9Metrics.ButtonHeightSmall,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: G9Metrics.ButtonFontSmall,\n fill: false,\n };\n case 'large':\n return {\n height: G9Metrics.ButtonHeightLarge,\n paddingHorizontal: 20,\n paddingVertical: 14,\n fontSize: G9Metrics.ButtonFontLarge,\n fill: false,\n };\n case 'hero':\n return {\n height: G9Metrics.ButtonHeightHero,\n paddingHorizontal: 16,\n paddingVertical: 16,\n fontSize: G9Metrics.ButtonFontHero,\n fill: true,\n };\n default:\n return {\n height: G9Metrics.ButtonHeightMedium,\n paddingHorizontal: 16,\n paddingVertical: 12,\n fontSize: G9Metrics.ButtonFontMedium,\n fill: false,\n };\n }\n}\n\n/** MAUI `FontAttributes`. */\nexport type G9FontAttributes = 'none' | 'bold' | 'italic' | 'boldItalic';\n\n/** CSS for {@link G9FontAttributes}. */\nexport function fontAttributesStyle(attributes: G9FontAttributes): {\n fontWeight: 'bold' | 'normal';\n fontStyle: 'italic' | 'normal';\n} {\n return {\n fontWeight: attributes === 'bold' || attributes === 'boldItalic' ? 'bold' : 'normal',\n fontStyle: attributes === 'italic' || attributes === 'boldItalic' ? 'italic' : 'normal',\n };\n}\n"],"names":["resolveButtonPaint","input","_input_textColor","variant","resolveButtonVariant","opacity","base","_input_textColor1","parsed","tryParseColor","_input_textColor2","_input_textColor3","stroke","createBorderColor","formatColor","getContrastingTextColor","toRgba","outlined","fillToCss","buildSolidOrGradient","buttonSizePreset","size","G9Metrics","fontAttributesStyle","attributes"],"mappings":";AAiDO,SAASA,mBAAmBC,KAAyB;QAuClDC;IAtCR,MAAMC,UAAUC,qBAAqBH,MAAM,OAAO,EAAEA,MAAM,OAAO;IACjE,MAAMI,UAAU,AAACJ,MAAM,OAAO,GAAUA,MAAM,OAAO,GAAG,MAAM,IAA7B;IACjC,MAAMK,OAAOL,MAAM,mBAAmB;IACtC,IAAIK,AAAQ,QAARA,MAAc;YAuBRC;QAtBR,MAAMC,SAASC,cAAcH;QAC7B,IAAIE,UAAUA,AAAa,MAAbA,OAAO,CAAC,EAAQ;gBAGpBE;YAFR,OAAO;gBACL,YAAY;gBACZ,MAAM,QAAAA,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBP,QAAQ,IAAI;gBACrC,QAAQ;gBACR,aAAa;gBACbE;YACF;QACF;QACA,IAAI,CAACG,QAAQ;gBAGHG;YAFR,OAAO;gBACL,YAAYL;gBACZ,MAAM,QAAAK,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBR,QAAQ,IAAI;gBACrC,QAAQ;gBACR,aAAa;gBACbE;YACF;QACF;QACA,MAAMO,SAASC,kBAAkBL;QACjC,OAAO;YACL,YAAYM,YAAYN;YACxB,MAAM,QAAAD,CAAAA,oBAAA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AAWA,AAAe,aAAfA,cAA2BA,AAAe,iBAAfA,aAA8B,WAAW;IACjF;AACF"}
1
+ {"version":3,"file":"button/visuals.jsx","sources":["../../src/button/visuals.ts"],"sourcesContent":["import {\n buildSolidOrGradient,\n createBorderColor,\n fillToCss,\n formatColor,\n type G9ButtonVariant,\n type G9ControlSize,\n G9Metrics,\n type G9PaletteValues,\n getContrastingTextColor,\n resolveButtonVariant,\n toRgba,\n tryParseColor,\n} from '@g9tm/lynxcontrols-foundation';\n\n/** What a button paints (MAUI `G9Visuals.ButtonVisualResult` + the stroke/opacity rules of G9Button/G9IconButton). */\nexport interface G9ButtonPaint {\n /** CSS `background` (a colour or a vertical gradient). */\n readonly background: string;\n readonly text: string;\n readonly stroke: string;\n readonly strokeWidth: number;\n /** 0.38 when not effectively enabled, 0.70 while loading, else 1. */\n readonly opacity: number;\n}\n\n/** Inputs of {@link resolveButtonPaint}. */\nexport interface G9ButtonPaintInput {\n readonly variant: G9ButtonVariant;\n readonly palette: G9PaletteValues;\n /** `IsEnabled && !blocked`. */\n readonly enabled: boolean;\n readonly loading: boolean;\n readonly baseBackgroundColor?: string | null | undefined;\n readonly textColor?: string | null | undefined;\n /** `'button'`: tonal has a 1.5 stroke; `'icon'`: only outline/text do (MAUI G9IconButton). */\n readonly kind: 'button' | 'icon';\n}\n\n/**\n * Resolves the paint of a button (MAUI `G9Button.OnApplyVisuals` / `G9IconButton.OnApplyVisuals`):\n * - variant colours from `resolveButtonVariant`; the gradient only while enabled and not loading;\n * - `baseBackgroundColor`: fully transparent → no fill, no border; otherwise a flat fill, contrasting text and a\n * darkened border (stroke 1 when visible);\n * - `textColor` always wins for text/icon/spinner;\n * - stroke 1.5 for outline/text (and tonal on `G9Button`), else 0.\n * A colour that is not a parseable literal (e.g. a `var(--…)` token) is used as given: flat fill, the variant's text\n * colour unless `textColor` is set, and no derived border.\n */\nexport function resolveButtonPaint(input: G9ButtonPaintInput): G9ButtonPaint {\n const variant = resolveButtonVariant(input.variant, input.palette);\n const opacity = !input.enabled ? 0.38 : input.loading ? 0.7 : 1;\n const base = input.baseBackgroundColor;\n if (base != null) {\n const parsed = tryParseColor(base);\n if (parsed && parsed.a === 0) {\n return {\n background: 'transparent',\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n if (!parsed) {\n return {\n background: base,\n text: input.textColor ?? variant.text,\n stroke: 'transparent',\n strokeWidth: 0,\n opacity,\n };\n }\n const stroke = createBorderColor(parsed);\n return {\n background: formatColor(parsed),\n text: input.textColor ?? formatColor(getContrastingTextColor(parsed)),\n stroke: formatColor(stroke),\n strokeWidth: toRgba(stroke).a > 0 ? 1 : 0,\n opacity,\n };\n }\n const outlined =\n input.variant === 'outline' || input.variant === 'text' || (input.kind === 'button' && input.variant === 'tonal');\n return {\n background: fillToCss(\n buildSolidOrGradient(variant.background, variant.usesGradient && input.enabled && !input.loading),\n ),\n text: input.textColor ?? variant.text,\n stroke: variant.stroke,\n strokeWidth: outlined ? 1.5 : 0,\n opacity,\n };\n}\n\n/** Size preset of `G9Button` (MAUI `ApplySizePreset`). */\nexport interface G9ButtonSizePreset {\n readonly height: number;\n readonly paddingHorizontal: number;\n readonly paddingVertical: number;\n readonly fontSize: number;\n /** Hero buttons fill the width. */\n readonly fill: boolean;\n}\n\n/** MAUI G9Button size presets: small 36 / medium 44 / large 48 / hero 52. */\nexport function buttonSizePreset(size: G9ControlSize): G9ButtonSizePreset {\n switch (size) {\n case 'small':\n return {\n height: G9Metrics.ButtonHeightSmall,\n paddingHorizontal: 12,\n paddingVertical: 8,\n fontSize: G9Metrics.ButtonFontSmall,\n fill: false,\n };\n case 'large':\n return {\n height: G9Metrics.ButtonHeightLarge,\n paddingHorizontal: 20,\n paddingVertical: 14,\n fontSize: G9Metrics.ButtonFontLarge,\n fill: false,\n };\n case 'hero':\n // 52 tall with 12 above and below the text row, not 16 (MAUI 1.4.11): 16 left a 16 px label 20 px of height and cut\n // a Persian descender off («ج» of «خروج» on AgriPad's sign-out button, TR-0035).\n return {\n height: G9Metrics.ButtonHeightHero,\n paddingHorizontal: 16,\n paddingVertical: 12,\n fontSize: G9Metrics.ButtonFontHero,\n fill: true,\n };\n default:\n return {\n height: G9Metrics.ButtonHeightMedium,\n paddingHorizontal: 16,\n paddingVertical: 12,\n fontSize: G9Metrics.ButtonFontMedium,\n fill: false,\n };\n }\n}\n\n/** MAUI `FontAttributes`. */\nexport type G9FontAttributes = 'none' | 'bold' | 'italic' | 'boldItalic';\n\n/** CSS for {@link G9FontAttributes}. */\nexport function fontAttributesStyle(attributes: G9FontAttributes): {\n fontWeight: 'bold' | 'normal';\n fontStyle: 'italic' | 'normal';\n} {\n return {\n fontWeight: attributes === 'bold' || attributes === 'boldItalic' ? 'bold' : 'normal',\n fontStyle: attributes === 'italic' || attributes === 'boldItalic' ? 'italic' : 'normal',\n };\n}\n"],"names":["resolveButtonPaint","input","_input_textColor","variant","resolveButtonVariant","opacity","base","_input_textColor1","parsed","tryParseColor","_input_textColor2","_input_textColor3","stroke","createBorderColor","formatColor","getContrastingTextColor","toRgba","outlined","fillToCss","buildSolidOrGradient","buttonSizePreset","size","G9Metrics","fontAttributesStyle","attributes"],"mappings":";AAiDO,SAASA,mBAAmBC,KAAyB;QAuClDC;IAtCR,MAAMC,UAAUC,qBAAqBH,MAAM,OAAO,EAAEA,MAAM,OAAO;IACjE,MAAMI,UAAU,AAACJ,MAAM,OAAO,GAAUA,MAAM,OAAO,GAAG,MAAM,IAA7B;IACjC,MAAMK,OAAOL,MAAM,mBAAmB;IACtC,IAAIK,AAAQ,QAARA,MAAc;YAuBRC;QAtBR,MAAMC,SAASC,cAAcH;QAC7B,IAAIE,UAAUA,AAAa,MAAbA,OAAO,CAAC,EAAQ;gBAGpBE;YAFR,OAAO;gBACL,YAAY;gBACZ,MAAM,QAAAA,CAAAA,oBAAAA,MAAM,SAAS,AAAD,IAAdA,oBAAmBP,QAAQ,IAAI;gBACrC,QAAQ;gBACR,aAAa;gB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iB;gBACjB,UAAUA,UAAU,cAAc;gBAClC,MAAM;YACR;QACF;YACE,OAAO;gBACL,QAAQA,UAAU,kBAAkB;gBACpC,mBAAmB;gBACnB,iBAAiB;gBACjB,UAAUA,UAAU,gBAAgB;gBACpC,MAAM;YACR;IACJ;AACF;AAMO,SAASC,oBAAoBC,UAA4B;IAI9D,OAAO;QACL,YAAYA,AAAe,WAAfA,cAAyBA,AAAe,iBAAfA,aAA8B,SAAS;QAC5E,WAAWA,AAAe,aAAfA,cAA2BA,AAAe,iBAAfA,aAA8B,WAAW;IACjF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAE/F,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,6GA8CnB,CAAC"}
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAE/F,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,6GA+CnB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { G9Metrics } from "@g9tm/lynxcontrols-foundation";
2
2
  import { forwardRef, useImperativeHandle } from "@lynx-js/react";
3
3
  import { useG9Settings } from "../provider/hooks.jsx";
4
- import { G9OutlinedField } from "./outlined-field.jsx";
4
+ import { G9OutlinedField, resolveInnerHint } from "./outlined-field.jsx";
5
5
  import { useTextInput } from "./use-text-input.jsx";
6
6
  const editor_G9Editor = forwardRef(function(props, ref) {
7
7
  var _props_minimumEditorHeight, _props_maxEditorHeight, _props_autoSize, _core_errorText;
@@ -20,7 +20,7 @@ const editor_G9Editor = forwardRef(function(props, ref) {
20
20
  const min = null != (_props_minimumEditorHeight = props.minimumEditorHeight) ? _props_minimumEditorHeight : 96;
21
21
  const max = null != (_props_maxEditorHeight = props.maxEditorHeight) ? _props_maxEditorHeight : 0;
22
22
  const autoSize = null != (_props_autoSize = props.autoSize) ? _props_autoSize : 'textChanges';
23
- return <G9OutlinedField {...props} multiline hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} onFocusRequest={core.focus}>
23
+ return <G9OutlinedField {...props} hint={resolveInnerHint(props)} multiline hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} onFocusRequest={core.focus}>
24
24
  <textarea {...core.elementProps} className="g9-field__textarea" ios-spell-check={false !== props.isSpellCheckEnabled} ios-auto-correct={false !== props.isTextPredictionEnabled} style={{
25
25
  direction: core.textDirection,
26
26
  textAlign: 'rtl' === core.textDirection ? 'right' : 'left',
@@ -1 +1 @@
1
- {"version":3,"file":"fields/editor.jsx","sources":["../../src/fields/editor.tsx"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings } from '../provider/hooks';\nimport { G9OutlinedField, type G9TrailingAffordance } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\n\n/** How the editor grows (MAUI `EditorAutoSizeOption`). */\nexport type G9EditorAutoSize = 'disabled' | 'textChanges';\n\n/** Props of {@link G9Editor} (MAUI `G9Editor`). */\nexport interface G9EditorProps extends G9TextInputProps {\n /** Minimum height of the text area. Default 96. */\n readonly minimumEditorHeight?: number;\n /** Maximum height while growing; `0` (default) means unbounded. */\n readonly maxEditorHeight?: number;\n /** `'textChanges'` (default) grows with the text; `'disabled'` keeps `minimumEditorHeight`. */\n readonly autoSize?: G9EditorAutoSize;\n /** Spell checking (iOS `ios-spell-check`). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9Editor}. */\nexport type G9EditorHandle = G9TextInputHandle;\n\n/**\n * Multi-line outlined text area (MAUI `G9Editor`): the text-entry behaviour on a `<textarea>`, a microphone pinned to\n * the bottom-end corner whenever dictation is available, height from `minimumEditorHeight`/`maxEditorHeight`/\n * `autoSize`. Validates on blur only for email/url/custom types (no `validator`, as in MAUI). Requires the host's\n * `xelement-input` registration.\n */\nexport const G9Editor = forwardRef<G9EditorHandle, G9EditorProps>(function G9Editor(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const core = useTextInput(props, { name: 'G9Editor.value', showMic: (s) => s.available });\n useImperativeHandle(ref, () => core.handle);\n const affordance: G9TrailingAffordance | null = core.showMic\n ? {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n }\n : null;\n const min = props.minimumEditorHeight ?? 96;\n const max = props.maxEditorHeight ?? 0;\n const autoSize = props.autoSize ?? 'textChanges';\n return (\n <G9OutlinedField\n {...props}\n multiline\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n onFocusRequest={core.focus}\n >\n <textarea\n {...core.elementProps}\n className=\"g9-field__textarea\"\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n ...(autoSize === 'disabled'\n ? { height: `${min}px` }\n : { minHeight: `${min}px`, ...(max > 0 ? { maxHeight: `${Math.max(min, max)}px` } : {}) }),\n paddingTop: `${G9Metrics.FloatingLabelClearance + 8}px`,\n paddingBottom: '8px',\n }}\n />\n </G9OutlinedField>\n );\n});\n"],"names":["G9Editor","forwardRef","props","ref","_props_minimumEditorHeight","_props_maxEditorHeight","_props_autoSize","_core_errorText","glyphs","useG9Settings","core","useTextInput","s","useImperativeHandle","affordance","min","max","autoSize","G9OutlinedField","textarea","Math","G9Metrics"],"mappings":";;;;;AAgCO,MAAMA,kBAAWC,WAA0C,SAAkBC,KAAK,EAAEC,GAAG;QAYhFC,4BACAC,wBACKC,iBAMFC;IAnBf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC,aAAaT,OAAO;QAAE,MAAM;QAAkB,SAAS,CAACU,IAAMA,EAAE,SAAS;IAAC;IACvFC,oBAAoBV,KAAK,IAAMO,KAAK,MAAM;IAC1C,MAAMI,aAA0CJ,KAAK,OAAO,GACxD;QACE,MAAMA,KAAK,SAAS,CAAC,SAAS,GAAGF,OAAO,MAAM,GAAGA,OAAO,GAAG;QAC3D,OAAOE,KAAK,SAAS,CAAC,SAAS,GAAG,oBAAoB;QACtD,WAAW;QACX,SAASA,KAAK,QAAQ;IACxB,IACA;IACJ,MAAMK,MAAM,QAAAX,CAAAA,6BAAAA,MAAM,mBAAmB,AAAD,IAAxBA,6BAA6B;IACzC,MAAMY,MAAM,QAAAX,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;IACrC,MAAMY,WAAW,QAAAX,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,kBAAkB;IACnC,QACGY,iBACE,GAAGhB,KAAK,EACT,UACA,UAAUQ,KAAK,QAAQ,EACvB,WAAW,QAAAH,CAAAA,kBAAAA,KAAK,SAAS,AAAD,IAAbA,kBAAkB,MAC7B,SAASG,KAAK,OAAO,EACrB,UAAUA,KAAK,QAAQ,EACvB,YAAYA,KAAK,IAAI,CAAC,MAAM,EAC5B,oBAAoBI,YACpB,gBAAgBJ,KAAK,KAAK,EAC3B;MACC,CAACS,UACE,GAAGT,KAAK,YAAY,EACrB,UAAU,qBACV,iBAAiBR,AAA8B,UAA9BA,MAAM,mBAAmB,EAC1C,kBAAkBA,AAAkC,UAAlCA,MAAM,uBAAuB,EAC/C,OAAO;QACL,WAAWQ,KAAK,aAAa;QAC7B,WAAWA,AAAuB,UAAvBA,KAAK,aAAa,GAAa,UAAU;QACpD,GAAIA,KAAK,IAAI,GAAG;YAAE,YAAYA,KAAK,IAAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOR,MAAM,QAAQ,GAAG,4BAA4B;QACpD,GAAIe,AAAa,eAAbA,WACA;YAAE,QAAQ,GAAGF,IAAI,EAAE,CAAC;QAAC,IACrB;YAAE,WAAW,GAAGA,IAAI,EAAE,CAAC;YAAE,GAAIC,MAAM,IAAI;gBAAE,WAAW,GAAGI,KAAK,GAAG,CAACL,KAAKC,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,CAAC;QAAE,CAAC;QAC3F,YAAY,GAAGK,UAAU,sBAAsB,GAAG,EAAE,EAAE,CAAC;QACvD,eAAe;IACjB,IACA;IACJ,EAAEH;AAEN"}
1
+ {"version":3,"file":"fields/editor.jsx","sources":["../../src/fields/editor.tsx"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings } from '../provider/hooks';\nimport { G9OutlinedField, type G9TrailingAffordance, resolveInnerHint } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\n\n/** How the editor grows (MAUI `EditorAutoSizeOption`). */\nexport type G9EditorAutoSize = 'disabled' | 'textChanges';\n\n/** Props of {@link G9Editor} (MAUI `G9Editor`). */\nexport interface G9EditorProps extends G9TextInputProps {\n /** Minimum height of the text area. Default 96. */\n readonly minimumEditorHeight?: number;\n /** Maximum height while growing; `0` (default) means unbounded. */\n readonly maxEditorHeight?: number;\n /** `'textChanges'` (default) grows with the text; `'disabled'` keeps `minimumEditorHeight`. */\n readonly autoSize?: G9EditorAutoSize;\n /** Spell checking (iOS `ios-spell-check`). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9Editor}. */\nexport type G9EditorHandle = G9TextInputHandle;\n\n/**\n * Multi-line outlined text area (MAUI `G9Editor`): the text-entry behaviour on a `<textarea>`, a microphone pinned to\n * the bottom-end corner whenever dictation is available, height from `minimumEditorHeight`/`maxEditorHeight`/\n * `autoSize`. Validates on blur only for email/url/custom types (no `validator`, as in MAUI). Requires the host's\n * `xelement-input` registration.\n */\nexport const G9Editor = forwardRef<G9EditorHandle, G9EditorProps>(function G9Editor(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const core = useTextInput(props, { name: 'G9Editor.value', showMic: (s) => s.available });\n useImperativeHandle(ref, () => core.handle);\n const affordance: G9TrailingAffordance | null = core.showMic\n ? {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n }\n : null;\n const min = props.minimumEditorHeight ?? 96;\n const max = props.maxEditorHeight ?? 0;\n const autoSize = props.autoSize ?? 'textChanges';\n return (\n <G9OutlinedField\n {...props}\n hint={resolveInnerHint(props)}\n multiline\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n onFocusRequest={core.focus}\n >\n <textarea\n {...core.elementProps}\n className=\"g9-field__textarea\"\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n ...(autoSize === 'disabled'\n ? { height: `${min}px` }\n : { minHeight: `${min}px`, ...(max > 0 ? { maxHeight: `${Math.max(min, max)}px` } : {}) }),\n paddingTop: `${G9Metrics.FloatingLabelClearance + 8}px`,\n paddingBottom: '8px',\n }}\n />\n </G9OutlinedField>\n );\n});\n"],"names":["G9Editor","forwardRef","props","ref","_props_minimumEditorHeight","_props_maxEditorHeight","_props_autoSize","_core_errorText","glyphs","useG9Settings","core","useTextInput","s","useImperativeHandle","affordance","min","max","autoSize","G9OutlinedField","resolveInnerHint","textarea","Math","G9Metrics"],"mappings":";;;;;AAgCO,MAAMA,kBAAWC,WAA0C,SAAkBC,KAAK,EAAEC,GAAG;QAYhFC,4BACAC,wBACKC,iBAOFC;IApBf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC,aAAaT,OAAO;QAAE,MAAM;QAAkB,SAAS,CAACU,IAAMA,EAAE,SAAS;IAAC;IACvFC,oBAAoBV,KAAK,IAAMO,KAAK,MAAM;IAC1C,MAAMI,aAA0CJ,KAAK,OAAO,GACxD;QACE,MAAMA,KAAK,SAAS,CAAC,SAAS,GAAGF,OAAO,MAAM,GAAGA,OAAO,GAAG;QAC3D,OAAOE,KAAK,SAAS,CAAC,SAAS,GAAG,oBAAoB;QACtD,WAAW;QACX,SAASA,KAAK,QAAQ;IACxB,IACA;IACJ,MAAMK,MAAM,QAAAX,CAAAA,6BAAAA,MAAM,mBAAmB,AAAD,IAAxBA,6BAA6B;IACzC,MAAMY,MAAM,QAAAX,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;IACrC,MAAMY,WAAW,QAAAX,CAAAA,kBAAAA,MAAM,QAAQ,AAAD,IAAbA,kBAAkB;IACnC,QACGY,iBACE,GAAGhB,KAAK,EACT,MAAMiB,iBAAiBjB,QACvB,UACA,UAAUQ,KAAK,QAAQ,EACvB,WAAW,QAAAH,CAAAA,kBAAAA,KAAK,SAAS,AAAD,IAAbA,kBAAkB,MAC7B,SAASG,KAAK,OAAO,EACrB,UAAUA,KAAK,QAAQ,EACvB,YAAYA,KAAK,IAAI,CAAC,MAAM,EAC5B,oBAAoBI,YACpB,gBAAgBJ,KAAK,KAAK,EAC3B;MACC,CAACU,UACE,GAAGV,KAAK,YAAY,EACrB,UAAU,qBACV,iBAAiBR,AAA8B,UAA9BA,MAAM,mBAAmB,EAC1C,kBAAkBA,AAAkC,UAAlCA,MAAM,uBAAuB,EAC/C,OAAO;QACL,WAAWQ,KAAK,aAAa;QAC7B,WAAWA,AAAuB,UAAvBA,KAAK,aAAa,GAAa,UAAU;QACpD,GAAIA,KAAK,IAAI,GAAG;YAAE,YAAYA,KAAK,IAAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOR,MAAM,QAAQ,GAAG,4BAA4B;QACpD,GAAIe,AAAa,eAAbA,WACA;YAAE,QAAQ,GAAGF,IAAI,EAAE,CAAC;QAAC,IACrB;YAAE,WAAW,GAAGA,IAAI,EAAE,CAAC;YAAE,GAAIC,MAAM,IAAI;gBAAE,WAAW,GAAGK,KAAK,GAAG,CAACN,KAAKC,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,CAAC;QAAE,CAAC;QAC3F,YAAY,GAAGM,UAAU,sBAAsB,GAAG,EAAE,EAAE,CAAC;QACvD,eAAe;IACjB,IACA;IACJ,EAAEJ;AAEN"}
@@ -40,6 +40,27 @@
40
40
  height: auto;
41
41
  }
42
42
 
43
+ .g9-field__hint {
44
+ pointer-events: none;
45
+ flex-direction: column;
46
+ justify-content: center;
47
+ display: flex;
48
+ position: absolute;
49
+ top: 0;
50
+ bottom: 0;
51
+ }
52
+
53
+ .g9-field__hint--multiline {
54
+ justify-content: flex-start;
55
+ bottom: auto;
56
+ }
57
+
58
+ .g9-field__hint-text {
59
+ text-overflow: ellipsis;
60
+ width: 100%;
61
+ font-size: 15px;
62
+ }
63
+
43
64
  .g9-field__textarea {
44
65
  background-color: #0000;
45
66
  width: 100%;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,sBAAsB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,+BAA+B;AACjC;;AAuBA;EApBE,6BAA6B;EAC7B,eAAe;AACjB;;AAuBA;EApBE,8BAA8B;AAChC;;AAuBA;EApBE,8BAA8B;EAC9B,eAAe;AACjB;;AAuBA;EApBE,mCAAmC;EACnC,iBAAiB;EACjB,eAAe;AACjB","sourcesContent":["/* Outlined fields (MAUI G9OutlinedFieldBase). Colours come from the theme variables; sizes from G9Metrics. */\n.g9-field {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-field__box {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: transparent;\n}\n\n.g9-field__outline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__halo {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex: 1;\n}\n\n.g9-field__input {\n width: 100%;\n height: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n/* The read-only value: a text line centred like the input's. */\n.g9-field__input--readonly {\n height: auto;\n text-overflow: ellipsis;\n}\n\n.g9-field__textarea {\n width: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n.g9-field__slot {\n display: flex;\n position: absolute;\n align-items: center;\n justify-content: center;\n}\n\n.g9-field__label {\n position: absolute;\n height: 22px;\n line-height: 22px;\n padding-left: 4px;\n padding-right: 4px;\n background-color: transparent;\n transition-property: top, font-size, transform, color;\n transition-duration: 160ms;\n pointer-events: none;\n}\n\n/* Only a floated label sits on the outline: its notch paints the colour behind the field (a container that is not\n --g9-background sets --g9-field-notch-background; G9 sheets and popups do). At rest it paints nothing. */\n.g9-field__label--floated {\n background-color: var(--g9-field-notch-background, var(--g9-background));\n}\n\n.g9-field__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 4px;\n padding-left: 14px;\n padding-right: 14px;\n}\n\n.g9-field__helper {\n flex: 1;\n font-size: 11.5px;\n}\n\n.g9-field__counter {\n font-size: 11px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-field__busy {\n width: 18px;\n height: 18px;\n border-width: 2px;\n border-style: solid;\n border-radius: 9px;\n animation: g9-field-spin 800ms linear infinite;\n}\n\n@keyframes g9-field-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Disabled dims the field (MAUI DisabledDimAlpha) part by part: an opacity on the box itself renders it into a layer\n the size of the box on Android, which cut the floated label above it in half. The label takes the disabled colour\n instead, so its notch still hides the outline. */\n.g9-field--disabled .g9-field__outline,\n.g9-field--disabled .g9-field__halo,\n.g9-field--disabled .g9-field__content,\n.g9-field--disabled .g9-field__slot,\n.g9-field--disabled .g9-field__footer {\n opacity: 0.45;\n}\n\n/* PIN entry (MAUI G9PinEntry): the row is always left-to-right. */\n.g9-pin {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n direction: ltr;\n}\n\n.g9-pin__cell {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n border-style: solid;\n border-width: 1.4px;\n border-radius: 10px;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-pin__cell--filled {\n border-color: var(--g9-primary-border);\n}\n\n.g9-pin__cell--active {\n border-width: 2px;\n border-color: var(--g9-primary);\n}\n\n.g9-pin__char {\n font-size: 22px;\n color: var(--g9-text-primary);\n}\n\n.g9-pin--disabled .g9-pin__char {\n color: var(--g9-text-disabled);\n}\n\n.g9-pin__placeholder {\n font-size: 22px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-pin__separator {\n font-size: 22px;\n margin-right: 6px;\n color: var(--g9-on-surface-variant);\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,sBAAsB;EACtB,aA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yBA;EAtBE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;EACvC,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;EACjB,aAAa;AACf;;AAyBA;EAtBE,sCAAsC;AACxC;;AAyBA;EAtBE,iBAAiB;EACjB,+BAA+B;AACjC;;AAyBA;EAtBE,6BAA6B;EAC7B,eAAe;AACjB;;AAyBA;EAtBE,8BAA8B;AAChC;;AAyBA;EAtBE,8BAA8B;EAC9B,eAAe;AACjB;;AAyBA;EAtBE,mCAAmC;EACnC,iBAAiB;EACjB,eAAe;AACjB","sourcesContent":["/* Outlined fields (MAUI G9OutlinedFieldBase). Colours come from the theme variables; sizes from G9Metrics. */\n.g9-field {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-field__box {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: transparent;\n}\n\n.g9-field__outline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__halo {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex: 1;\n}\n\n.g9-field__input {\n width: 100%;\n height: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n/* The read-only value: a text line centred like the input's. */\n.g9-field__input--readonly {\n height: auto;\n text-overflow: ellipsis;\n}\n\n/* MAUI 1.4.9 RestingPlaceholder: the hint inside an empty box (under an always-floated label, or placeholderInside),\n over the input where its text starts — the input's 15 px in TextTertiary; it never takes a touch. */\n.g9-field__hint {\n position: absolute;\n top: 0px;\n bottom: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n pointer-events: none;\n}\n\n.g9-field__hint--multiline {\n bottom: auto;\n justify-content: flex-start;\n}\n\n.g9-field__hint-text {\n width: 100%;\n font-size: 15px;\n text-overflow: ellipsis;\n}\n\n.g9-field__textarea {\n width: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n.g9-field__slot {\n display: flex;\n position: absolute;\n align-items: center;\n justify-content: center;\n}\n\n.g9-field__label {\n position: absolute;\n height: 22px;\n line-height: 22px;\n padding-left: 4px;\n padding-right: 4px;\n background-color: transparent;\n transition-property: top, font-size, transform, color;\n transition-duration: 160ms;\n pointer-events: none;\n}\n\n/* Only a floated label sits on the outline: its notch paints the colour behind the field (a container that is not\n --g9-background sets --g9-field-notch-background; G9 sheets and popups do). At rest it paints nothing. */\n.g9-field__label--floated {\n background-color: var(--g9-field-notch-background, var(--g9-background));\n}\n\n.g9-field__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 4px;\n padding-left: 14px;\n padding-right: 14px;\n}\n\n.g9-field__helper {\n flex: 1;\n font-size: 11.5px;\n}\n\n.g9-field__counter {\n font-size: 11px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-field__busy {\n width: 18px;\n height: 18px;\n border-width: 2px;\n border-style: solid;\n border-radius: 9px;\n animation: g9-field-spin 800ms linear infinite;\n}\n\n@keyframes g9-field-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Disabled dims the field (MAUI DisabledDimAlpha) part by part: an opacity on the box itself renders it into a layer\n the size of the box on Android, which cut the floated label above it in half. The label takes the disabled colour\n instead, so its notch still hides the outline. */\n.g9-field--disabled .g9-field__outline,\n.g9-field--disabled .g9-field__halo,\n.g9-field--disabled .g9-field__content,\n.g9-field--disabled .g9-field__slot,\n.g9-field--disabled .g9-field__footer {\n opacity: 0.45;\n}\n\n/* PIN entry (MAUI G9PinEntry): the row is always left-to-right. */\n.g9-pin {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n direction: ltr;\n}\n\n.g9-pin__cell {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n border-style: solid;\n border-width: 1.4px;\n border-radius: 10px;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-pin__cell--filled {\n border-color: var(--g9-primary-border);\n}\n\n.g9-pin__cell--active {\n border-width: 2px;\n border-color: var(--g9-primary);\n}\n\n.g9-pin__char {\n font-size: 22px;\n color: var(--g9-text-primary);\n}\n\n.g9-pin--disabled .g9-pin__char {\n color: var(--g9-text-disabled);\n}\n\n.g9-pin__placeholder {\n font-size: 22px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-pin__separator {\n font-size: 22px;\n margin-right: 6px;\n color: var(--g9-on-surface-variant);\n}\n"],"sourceRoot":""}
@@ -2,7 +2,7 @@ export { G9VoiceDictation, type G9VoiceDictationOptions, } from './dictation.js'
2
2
  export { G9Editor, type G9EditorAutoSize, type G9EditorHandle, type G9EditorProps } from './editor.js';
3
3
  export { customPatternCacheSize, decimalSeparatorFor, type G9LynxInputElementType, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText, } from './input-policy.js';
4
4
  export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from './notch.js';
5
- export { G9OutlinedField, type G9OutlinedFieldFrameProps, type G9OutlinedFieldProps, type G9OutlinedFieldState, type G9OutlinedFieldStateInput, type G9TrailingAffordance, resolveOutlinedFieldState, useOutlinedField, } from './outlined-field.js';
5
+ export { G9OutlinedField, type G9OutlinedFieldFrameProps, type G9OutlinedFieldProps, type G9OutlinedFieldState, type G9OutlinedFieldStateInput, type G9TrailingAffordance, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField, } from './outlined-field.js';
6
6
  export { filterPin, G9PinEntry, type G9PinEntryHandle, type G9PinEntryProps, isPinCharAllowed, parsePinGroupSizes, pinCellCount, } from './pin-entry.js';
7
7
  export { type G9SearchContext, G9SearchEntry, type G9SearchEntryHandle, type G9SearchEntryProps, } from './search-entry.js';
8
8
  export { type G9FieldSlotLayout, type G9FieldSlotLayoutInput, type G9PhysicalPadding, resolveFieldSlotLayout, } from './slot-layout.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACpG,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,kBAAk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EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
@@ -2,7 +2,7 @@ export { G9VoiceDictation } from "./dictation.jsx";
2
2
  export { G9Editor } from "./editor.jsx";
3
3
  export { customPatternCacheSize, decimalSeparatorFor, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText } from "./input-policy.jsx";
4
4
  export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from "./notch.jsx";
5
- export { G9OutlinedField, resolveOutlinedFieldState, useOutlinedField } from "./outlined-field.jsx";
5
+ export { G9OutlinedField, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField } from "./outlined-field.jsx";
6
6
  export { G9PinEntry, filterPin, isPinCharAllowed, parsePinGroupSizes, pinCellCount } from "./pin-entry.jsx";
7
7
  export { G9SearchEntry } from "./search-entry.jsx";
8
8
  export { resolveFieldSlotLayout } from "./slot-layout.jsx";
@@ -20,8 +20,18 @@ export interface G9OutlinedFieldProps {
20
20
  readonly errorText?: string | null;
21
21
  /** Error state: error outline, label and helper colour. Validation can also set it (`validate()`). Default false. */
22
22
  readonly hasError?: boolean;
23
- /** Keep the label floated even when empty and unfocused. Default false. */
23
+ /**
24
+ * Keep the label floated even when empty and unfocused. Default false. With a `label` AND a `placeholder` the
25
+ * placeholder is then drawn inside the empty box under the floated label (MAUI 1.4.9: «عنوان» floated with «عنوان کار
26
+ * را وارد کنید» inside).
27
+ */
24
28
  readonly alwaysFloat?: boolean;
29
+ /**
30
+ * The `placeholder` is the box's own hint (MAUI 1.4.9 `PlaceholderInside`): inside while the field is empty, gone with
31
+ * a value, never lifted into the notch as a label — a chat composer's «یادداشت خود را بنویسید...». A `label`, if set,
32
+ * still floats as usual. Default false: without a label the placeholder is the floating label's text.
33
+ */
34
+ readonly placeholderInside?: boolean;
25
35
  /** Value visible and selectable but not editable (MAUI `IsReadOnly`). Default false. */
26
36
  readonly readOnly?: boolean;
27
37
  /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */
@@ -98,6 +108,17 @@ export interface G9OutlinedFieldState {
98
108
  readonly haloWidth: number;
99
109
  readonly fieldHeight: number;
100
110
  }
111
+ /**
112
+ * The hint a field draws INSIDE its box while it is empty, or `null` (MAUI 1.4.9 `RestingPlaceholder`). Without a `label`
113
+ * (or with `placeholderInside`) it is the `placeholder`. With a label it is drawn only when `alwaysFloat` keeps the label
114
+ * up in the notch — otherwise the resting label sits where the hint would be — and never when it repeats the label.
115
+ */
116
+ export declare function resolveRestingPlaceholder(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>): string | null;
117
+ /**
118
+ * The hint a TEXT input draws itself (MAUI 1.4.9 `G9TextEntry` / `G9Editor`): only while the field owns it — a label is
119
+ * set, or `placeholderInside` — since without a label the floating label already is the placeholder.
120
+ */
121
+ export declare function resolveInnerHint(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>): string | null;
101
122
  /**
102
123
  * Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer
103
124
  * part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.
@@ -135,6 +156,11 @@ export interface G9OutlinedFieldFrameProps extends G9OutlinedFieldProps {
135
156
  readonly multiline?: boolean;
136
157
  /** Accessibility label of the box (defaults to the label text). */
137
158
  readonly accessibilityLabel?: string;
159
+ /**
160
+ * A hint the frame draws over the content while the field is empty (`resolveInnerHint`, MAUI 1.4.9): text inputs pass
161
+ * it; the pickers draw their own value text. TextTertiary, the input's 15 px, never taking a touch.
162
+ */
163
+ readonly hint?: string | null;
138
164
  }
139
165
  /**
140
166
  * The outlined field frame (MAUI `G9OutlinedFieldBase`): outline with a notched floating label, leading and
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-field.d.ts","sourceRoot":"","sources":["../../src/fields/outlined-field.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAa,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,eAAe,CAAC;AAM/E,4FAA4F;AAC5F,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,C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ot, hasIconSlot } from "../icon/slot.jsx";
7
7
  import { useG9Direction, useG9Settings } from "../provider/hooks.jsx";
8
8
  import { resolveFieldSlotLayout } from "./slot-layout.jsx";
9
9
  const v = (token)=>`var(--g9-${token})`;
10
+ const blank = (s)=>null == s || '' === s.trim();
11
+ function resolveRestingPlaceholder(props) {
12
+ if (blank(props.placeholder)) return null;
13
+ const placeholder = props.placeholder;
14
+ if (true === props.placeholderInside || blank(props.label)) return placeholder;
15
+ return true === props.alwaysFloat && props.label !== placeholder ? placeholder : null;
16
+ }
17
+ function resolveInnerHint(props) {
18
+ const owns = true === props.placeholderInside || !blank(props.label);
19
+ return owns ? resolveRestingPlaceholder(props) : null;
20
+ }
10
21
  function resolveOutlinedFieldState(props, input) {
11
22
  var _props_filledValueHighlight, _props_statusColor, _props_errorText, _props_helperText, _props_maxLength, _ref, _props_label;
12
23
  const hasError = true === props.hasError;
@@ -28,7 +39,7 @@ function resolveOutlinedFieldState(props, input) {
28
39
  const counterText = true === props.showCharacterCounter && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';
29
40
  const emphasis = input.focused || hasError || useStatus;
30
41
  const halo = true === props.showFocusHalo && input.focused && !hasError && !useStatus;
31
- const labelRaw = null != (_ref = null != (_props_label = props.label) ? _props_label : props.placeholder) ? _ref : '';
42
+ const labelRaw = null != (_ref = null != (_props_label = props.label) ? _props_label : true === props.placeholderInside ? null : props.placeholder) ? _ref : '';
32
43
  return {
33
44
  floated,
34
45
  stateColor,
@@ -166,6 +177,22 @@ function G9OutlinedField(props) {
166
177
  paddingBottom: `${slot.innerPadding.bottom}px`
167
178
  }}>
168
179
  {props.children}
180
+ {props.hint && !props.hasValue && true !== props.valueFloated ? <view className={`g9-field__hint${multiline ? ' g9-field__hint--multiline' : ''}`} user-interaction-enabled={false} style={{
181
+ left: `${slot.innerPadding.left + (hasLeading && 0 === slot.leadingColumn ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && 0 === slot.trailingColumn ? G9Metrics.TrailingIconSlotWidth : 0)}px`,
182
+ right: `${slot.innerPadding.right + (hasLeading && 2 === slot.leadingColumn ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && 2 === slot.trailingColumn ? G9Metrics.TrailingIconSlotWidth : 0)}px`,
183
+ ...multiline ? {
184
+ top: `${slot.innerPadding.top}px`
185
+ } : {}
186
+ }}>
187
+ <text className="g9-field__hint-text" {...multiline ? {} : {
188
+ 'text-maxline': '1'
189
+ }} style={{
190
+ textAlign: isRtl ? 'right' : 'left',
191
+ color: disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-tertiary)'
192
+ }}>
193
+ {props.hint}
194
+ </text>
195
+ </view> : null}
169
196
  </view>
170
197
  {hasLeading ? <view className="g9-field__slot g9-field__slot--leading" style={slotStyle(slot.leadingColumn, G9Metrics.LeadingIconSlotWidth, false)} catchtap={onLeadingTap} {...leadingActionable ? {
171
198
  'accessibility-element': true,
@@ -204,6 +231,6 @@ function G9OutlinedField(props) {
204
231
  </view> : null}
205
232
  </view>;
206
233
  }
207
- export { G9OutlinedField, resolveOutlinedFieldState, useOutlinedField };
234
+ export { G9OutlinedField, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField };
208
235
 
209
236
  //# sourceMappingURL=outlined-field.jsx.map