@4sh/ui-kit 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -953
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2039
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -130
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -246
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -291
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -194
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -131
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +723 -596
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -0,0 +1,325 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { BaseFormField, FieldLevel } from "@4sh/ui-kit/forms";
5
+ import { UiIconSize } from "@4sh/ui-kit/base/ui-icon";
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Pure geometry of `ui-field-sign`: how a stroke is smoothed, and how a set of strokes
9
+ * becomes an SVG. No DOM, no canvas — the component and the tests share this one path
10
+ * builder, so what is drawn on screen and what is exported cannot drift apart.
11
+ */
12
+ /** A point of a stroke, in CSS pixels from the top-left corner of the drawing area. */
13
+ interface SignPoint {
14
+ readonly x: number;
15
+ readonly y: number;
16
+ }
17
+ /** One continuous stroke: everything between a pointer going down and coming back up. */
18
+ type SignStroke = readonly SignPoint[];
19
+ /** Image format of the emitted value. */
20
+ export type FieldSignFormat = 'png' | 'svg';
21
+ /** Value carried by the field: a data URL, or `null` while nothing is signed. */
22
+ export type FieldSignValue = string | null;
23
+ /** A previous signature received from the form, kept underneath the new strokes. */
24
+ interface SignBackground {
25
+ readonly src: string;
26
+ /** `null` until the image has loaded — it is drawn from then on. */
27
+ readonly image: HTMLImageElement | null;
28
+ }
29
+ /**
30
+ * ui-field-sign — handwritten signature field on the `ui-field` shell (label + box +
31
+ * helper). **The box is the drawing area**: finger, stylus or mouse, through Pointer
32
+ * Events, on a `<canvas>`.
33
+ *
34
+ * Four choices shape it:
35
+ *
36
+ * 1. **The value is an image, emitted once a stroke ends** — a data URL (`format`: PNG or
37
+ * SVG), `null` when empty, so `required` works as is. Never mid-stroke: a form bound to
38
+ * an autosave would otherwise receive an image per pointer move.
39
+ * 2. **The screen and the export use two inks.** On screen the ink follows the tokens, dark
40
+ * theme included; the export is painted with `exportColor` on a transparent background.
41
+ * A signature drawn in dark mode would otherwise come out white — invisible on the PDF it
42
+ * is meant for.
43
+ * 3. **What is on screen is what is exported.** The box at the first stroke is the
44
+ * signature's region; the exported frame is that region grown to every stroke. A resized
45
+ * box (a phone rotated) refits the frame, scaled and centred — and a stroke drawn in the
46
+ * room this leaves around it grows the frame instead of falling outside the value. Points
47
+ * are clamped to the box: nothing drawn can be invisible, nothing visible can be lost.
48
+ * 4. **The page does not scroll under the pen.** `touch-action: none` on the drawing area,
49
+ * pointer capture for the whole stroke.
50
+ *
51
+ * A value written by the form must be an image data URL — what this field emits. It is shown
52
+ * in the box and kept underneath any new stroke until cleared; on screen it is redrawn as a
53
+ * silhouette in the current ink, so that a black signature stays legible on a dark field.
54
+ *
55
+ * Standalone, `[(ngModel)]`, reactive forms or Signal Forms (ControlValueAccessor via
56
+ * BaseFormField).
57
+ */
58
+ export declare class UiFieldSign extends BaseFormField<FieldSignValue> {
59
+ /**
60
+ * Ink colour of the **export**: any CSS colour, `var(--token)` included — resolved to
61
+ * `rgb()` where the field sits. `black` when it is not a colour or does not resolve. The
62
+ * screen ink follows the tokens.
63
+ */
64
+ exportColor: import("@angular/core").InputSignal<string>;
65
+ /** Image format of the emitted data URL. */
66
+ format: import("@angular/core").InputSignal<FieldSignFormat>;
67
+ /** Hint shown in the empty box. */
68
+ placeholder: import("@angular/core").InputSignal<string>;
69
+ /** Renders the button that clears the signature. */
70
+ clearable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
71
+ /** Accessible name of the clear button. */
72
+ clearAriaLabel: import("@angular/core").InputSignal<string>;
73
+ /** State announced once the box holds a signature (the placeholder is announced while empty). */
74
+ signedLabel: import("@angular/core").InputSignal<string>;
75
+ /** Announced after the state when the field is `required` (the visual `*` is hidden from assistive tech). */
76
+ requiredLabel: import("@angular/core").InputSignal<string>;
77
+ /** Shown and announced in place of a signature from the form that cannot be loaded. */
78
+ unreadableLabel: import("@angular/core").InputSignal<string>;
79
+ /** Emitted when a stroke ends, and when the signature is cleared or undone — never mid-stroke. */
80
+ valueChange: import("@angular/core").OutputEmitterRef<FieldSignValue>;
81
+ /** Emitted when the drawing area receives focus. */
82
+ padFocus: import("@angular/core").OutputEmitterRef<FocusEvent>;
83
+ /** Emitted when the drawing area loses focus. */
84
+ padBlur: import("@angular/core").OutputEmitterRef<FocusEvent>;
85
+ /**
86
+ * Emitted when the signature written by the form cannot be loaded. The field shows it as
87
+ * unreadable (`unreadableLabel`, error level) and keeps it as its value until it is
88
+ * cleared or signed over — it never drops what it could not read on its own.
89
+ */
90
+ imageError: import("@angular/core").OutputEmitterRef<Event>;
91
+ /** @ignore */
92
+ private readonly canvasEl;
93
+ /** @ignore */
94
+ private readonly host;
95
+ /** @ignore */
96
+ private readonly document;
97
+ /** @ignore Finished strokes, oldest first, in drawing space — `undo()` pops from the end. */
98
+ protected readonly strokes: import("@angular/core").WritableSignal<readonly SignStroke[]>;
99
+ /** @ignore A value received from the form, drawn underneath the strokes. */
100
+ protected readonly background: import("@angular/core").WritableSignal<SignBackground | null>;
101
+ /** @ignore A stroke is in progress. */
102
+ protected readonly drawing: import("@angular/core").WritableSignal<boolean>;
103
+ /**
104
+ * @ignore The value received from the form, when it could not be loaded: still the field's
105
+ * value until cleared or signed over, shown as unreadable meanwhile.
106
+ */
107
+ protected readonly unreadable: import("@angular/core").WritableSignal<string | null>;
108
+ /** @ignore Nothing signed: no stroke, no previous signature, no stroke under way. */
109
+ protected readonly isEmpty: import("@angular/core").Signal<boolean>;
110
+ /** @ignore An unreadable value is all the field holds: no stroke drawn over it yet. */
111
+ protected readonly showUnreadable: import("@angular/core").Signal<boolean>;
112
+ /** @ignore Something to clear: a signature, or an unreadable value. */
113
+ protected readonly canClear: import("@angular/core").Signal<boolean>;
114
+ /** @ignore The shell's level: `error` while an unreadable value stands. */
115
+ protected readonly fieldLevel: import("@angular/core").Signal<FieldLevel>;
116
+ /** @ignore */
117
+ protected readonly isInteractive: import("@angular/core").Signal<boolean>;
118
+ /** @ignore */
119
+ protected readonly iconSize: import("@angular/core").Signal<UiIconSize>;
120
+ /** @ignore */
121
+ protected readonly statusId: import("@angular/core").Signal<string>;
122
+ /** @ignore The state, then "required" — `role="img"` takes no `aria-required`. */
123
+ protected readonly statusText: import("@angular/core").Signal<string>;
124
+ /** @ignore The state first, then the helper/error message when one is rendered. */
125
+ protected readonly describedByIds: import("@angular/core").Signal<string>;
126
+ /**
127
+ * @ignore The box at the first stroke: where the previous signature is fitted, and the
128
+ * smallest frame the export can have. `null` until a stroke (the box stands in).
129
+ */
130
+ private region;
131
+ /** @ignore Drawing space → box. Changes on resize only, never under the pen. */
132
+ private view;
133
+ /** @ignore What the last `clear()` removed, for `undo()`. */
134
+ private cleared;
135
+ /** @ignore The stroke under the pen — plain array, mutated per pointer move. */
136
+ private current;
137
+ /** @ignore Pointer that owns {@link current}: a second finger does not draw. */
138
+ private activePointerId;
139
+ /** @ignore Drawing area at stroke start, so a move does not force a layout. */
140
+ private padRect;
141
+ /** @ignore Size of the drawing area, in CSS pixels, as last observed. */
142
+ private boxWidth;
143
+ private boxHeight;
144
+ /** @ignore `undefined` = not asked yet; `null` = no 2D canvas here (tests, old engines). */
145
+ private context;
146
+ /** @ignore Previous signature recoloured in the screen ink, rebuilt only when its inputs change. */
147
+ private silhouette;
148
+ /** @ignore Last value this field emitted — see {@link writeValue}. */
149
+ private lastEmitted;
150
+ /** @ignore A stroke ended while the previous signature was still loading (PNG export). */
151
+ private commitPending;
152
+ /**
153
+ * @ignore The last value emitted embeds a previous signature not loaded yet (SVG export):
154
+ * should it turn out unreadable, the value is emitted again without it.
155
+ */
156
+ private embedsUnloaded;
157
+ /** @ignore The box was resized under the pen: the view is refitted once the stroke ends. */
158
+ private viewStale;
159
+ /** @ignore Half the ink width, in box pixels, at stroke start — how far points stay from the edge. */
160
+ private edgeMargin;
161
+ /** @ignore The previous signature read back as one of this field's exports, per source. */
162
+ private readBack;
163
+ /** @ignore */
164
+ private animationFrame;
165
+ constructor();
166
+ writeValue(value: FieldSignValue): void;
167
+ /** Removes the whole signature, previous one included, and emits `null`. `undo()` brings it back. */
168
+ clear(): void;
169
+ /**
170
+ * Removes the last stroke drawn in this field; with none left, brings back what the last
171
+ * `clear()` removed. A signature received from the form is not a stroke: only `clear()`
172
+ * removes it.
173
+ */
174
+ undo(): void;
175
+ /** @ignore Drops the stroke under the pen, if any, without committing it. */
176
+ private abandonStroke;
177
+ /** Focuses the drawing area. */
178
+ focus(options?: FocusOptions): void;
179
+ /**
180
+ * Whether the field holds a signature — an unreadable one included, it is still the value.
181
+ * A stroke under way does not count until it ends.
182
+ */
183
+ hasSignature(): boolean;
184
+ /** @ignore */
185
+ protected uidPrefix(): string;
186
+ /** @ignore */
187
+ protected onPointerDown(event: PointerEvent): void;
188
+ /** @ignore */
189
+ protected onPointerMove(event: PointerEvent): void;
190
+ /** @ignore `pointerup`, `pointercancel` and a lost capture alike: what was drawn is kept. */
191
+ protected onPointerEnd(event: PointerEvent): void;
192
+ /**
193
+ * @ignore Disabled or made read-only under the pen: the stroke is dropped. Checked on the
194
+ * pointer events themselves — the effect that does the same only runs at the next change
195
+ * detection, and a `pointerup` may land before it.
196
+ */
197
+ private dropIfLocked;
198
+ /** @ignore Refits the view the box changed size for while a stroke was drawn. */
199
+ private refitIfStale;
200
+ /** @ignore `Backspace` / `Ctrl`+`Z` undo, `Delete` clears (undoable too). */
201
+ protected onKeydown(event: KeyboardEvent): void;
202
+ /** @ignore */
203
+ protected onBlur(event: FocusEvent): void;
204
+ /** @ignore The clear button hands focus back to the drawing area it just emptied. */
205
+ protected onClearClick(): void;
206
+ /** @ignore Current picture → value, pushed to the form and to `valueChange`. */
207
+ private commit;
208
+ /** @ignore */
209
+ private export;
210
+ /**
211
+ * @ignore The previous signature as one of this field's own SVG exports, read once per
212
+ * value. Never throws: on the commit path, a value it cannot read is kept as an image.
213
+ */
214
+ private readBackground;
215
+ /** @ignore Repaints on a detached canvas, in the export ink and without the tint. */
216
+ private exportPng;
217
+ /**
218
+ * @ignore `exportColor` resolved where the field sits — a `var(--token)` included — into
219
+ * an `rgb()` an image can carry: a `var()` in an SVG served as an image resolves to nothing,
220
+ * and the stroke would not be painted at all. `black` when the value is not a colour or
221
+ * does not resolve.
222
+ */
223
+ private resolveExportColor;
224
+ /** @ignore */
225
+ private loadBackground;
226
+ /** @ignore The whole box, in box coordinates. */
227
+ private boxRect;
228
+ /** @ignore Sets the region and fits the view on it: identity when it is the box itself. */
229
+ private setRegion;
230
+ /**
231
+ * @ignore The exported frame: the region grown to every stroke (half the ink width around
232
+ * them, so round caps are not shaved). The box until a first stroke.
233
+ */
234
+ private frame;
235
+ /** @ignore Where the previous signature is fitted: the region, or the box until a stroke. */
236
+ private backgroundSlot;
237
+ /** @ignore Fits the frame into the box, scaled and centred. Called on resize, never mid-stroke. */
238
+ private fitView;
239
+ /**
240
+ * @ignore Pointer position → drawing space, clamped to the box: a captured pointer dragged
241
+ * past the edge draws along it, never somewhere the screen does not show.
242
+ */
243
+ private toPoint;
244
+ /**
245
+ * @ignore Keeps a coordinate half the ink width inside the box: a stroke along the edge then
246
+ * fits the frame cap included, and the frame does not grow — nor the previous signature
247
+ * shrink — edit after edit.
248
+ */
249
+ private clamp;
250
+ /** @ignore Size the bitmap on the CSS box × device pixel ratio, and refit the view. */
251
+ private measure;
252
+ /** @ignore One repaint per frame, however many pointer moves arrive in it. */
253
+ private scheduleRedraw;
254
+ /** @ignore */
255
+ private redraw;
256
+ /** @ignore */
257
+ private paintStrokes;
258
+ /**
259
+ * @ignore The previous signature, recoloured in the screen ink: drawn on a scratch canvas,
260
+ * then `source-in` keeps its shape and replaces its colour. A black export stays legible on
261
+ * a dark field this way. The scratch canvas is cached — rebuilt only when the image (by
262
+ * identity: each value gets its own element), the ink or the pixel size changes, never per
263
+ * frame while a stroke is drawn over it.
264
+ */
265
+ private paintSilhouette;
266
+ /** @ignore */
267
+ private ctx;
268
+ /** @ignore Screen ink: the canvas `color`, which the stylesheet binds to the ink token. */
269
+ private inkColor;
270
+ /**
271
+ * @ignore Ink width, in CSS pixels. `--_field-sign-ink-width` is registered as a
272
+ * `<length>` (`@property`), so the browser hands back an absolute `px` value whatever unit
273
+ * the hook was set in.
274
+ */
275
+ private inkWidth;
276
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiFieldSign, never>;
277
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiFieldSign, "ui-field-sign", never, {
278
+ "exportColor": {
279
+ "alias": "exportColor";
280
+ "required": false;
281
+ "isSignal": true;
282
+ };
283
+ "format": {
284
+ "alias": "format";
285
+ "required": false;
286
+ "isSignal": true;
287
+ };
288
+ "placeholder": {
289
+ "alias": "placeholder";
290
+ "required": false;
291
+ "isSignal": true;
292
+ };
293
+ "clearable": {
294
+ "alias": "clearable";
295
+ "required": false;
296
+ "isSignal": true;
297
+ };
298
+ "clearAriaLabel": {
299
+ "alias": "clearAriaLabel";
300
+ "required": false;
301
+ "isSignal": true;
302
+ };
303
+ "signedLabel": {
304
+ "alias": "signedLabel";
305
+ "required": false;
306
+ "isSignal": true;
307
+ };
308
+ "requiredLabel": {
309
+ "alias": "requiredLabel";
310
+ "required": false;
311
+ "isSignal": true;
312
+ };
313
+ "unreadableLabel": {
314
+ "alias": "unreadableLabel";
315
+ "required": false;
316
+ "isSignal": true;
317
+ };
318
+ }, {
319
+ "valueChange": "valueChange";
320
+ "padFocus": "padFocus";
321
+ "padBlur": "padBlur";
322
+ "imageError": "imageError";
323
+ }, never, never, true, never>;
324
+ }
325
+ export {};
@@ -1,6 +1,8 @@
1
- import * as _angular_core from '@angular/core';
2
- import { FieldSize, FieldLevel, FieldFloatLabel } from '@4sh/ui-kit/forms';
3
-
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import { FieldFloatLabel, FieldLevel, FieldSize } from "@4sh/ui-kit/forms";
5
+ import * as i0 from "@angular/core";
4
6
  /**
5
7
  * ui-field — shared presentational shell for "box" fields.
6
8
  *
@@ -20,64 +22,148 @@ import { FieldSize, FieldLevel, FieldFloatLabel } from '@4sh/ui-kit/forms';
20
22
  * expressed in CSS for every control (a `<button>` trigger has no `value`), so
21
23
  * the concrete component reports it through `filled`.
22
24
  */
23
- declare class UiField {
24
- /** Label (rendered via `ui-label`). */
25
- label: _angular_core.InputSignal<string | undefined>;
26
- /** Label `for` = id of the projected input. */
27
- for: _angular_core.InputSignal<string | undefined>;
28
- /** Required marker (*). */
29
- required: _angular_core.InputSignalWithTransform<boolean, unknown>;
30
- /** Size. */
31
- size: _angular_core.InputSignal<FieldSize>;
32
- /** Effective level (drives the border + message color). */
33
- level: _angular_core.InputSignal<FieldLevel>;
34
- /** Floating label placement (`over` | `in` | `on`). Unset = classic label above the box. */
35
- floatLabel: _angular_core.InputSignal<FieldFloatLabel | undefined>;
36
- /** The control holds a value: keeps the floating label raised once focus leaves. */
37
- filled: _angular_core.InputSignalWithTransform<boolean, unknown>;
38
- /** Disabled state (visual). */
39
- disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
40
- /** Read-only state (visual). */
41
- readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
42
- /** Multiline box (top-aligned, auto-height with min-height) — used by `ui-textarea`. */
43
- multiline: _angular_core.InputSignalWithTransform<boolean, unknown>;
44
- /**
45
- * Auto-height box (grows with wrapping content, keeps padding + centering) —
46
- * used by `ui-select` in `multiple` mode so chips/values can wrap.
47
- */
48
- autoHeight: _angular_core.InputSignalWithTransform<boolean, unknown>;
49
- /** Message under the field (helper or error, already resolved by the component). */
50
- message: _angular_core.InputSignal<string | undefined>;
51
- /** id of the message (for `aria-describedby`, set by the component on the input). */
52
- messageId: _angular_core.InputSignal<string | undefined>;
53
- /**
54
- * Prefixes the message with an icon (rendered by `ui-helper`, decorative).
55
- *
56
- * Off by default: a field states its status through the border and the text.
57
- * `messageIcon` only picks *which* glyph — it never turns the icon on.
58
- */
59
- showMessageIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
60
- /**
61
- * Overrides the glyph shown by `showMessageIcon`. Unset = the icon
62
- * `ui-helper` derives from the level (question / check / times).
63
- */
64
- messageIcon: _angular_core.InputSignal<string | undefined>;
65
- /** Renders the footer row even without a message (e.g. to host a `[uiFieldFooter]` counter). */
66
- hasFooter: _angular_core.InputSignalWithTransform<boolean, unknown>;
67
- /**
68
- * An affix is projected into `[uiFieldPrefix]` (left icon…). Only read in
69
- * `floatLabel` mode, to indent the floating label past it: the prefix is
70
- * projected content, so no scoped selector here can see it.
71
- */
72
- hasPrefix: _angular_core.InputSignalWithTransform<boolean, unknown>;
73
- /** @ignore */
74
- protected onBoxMouseDown(event: MouseEvent): void;
75
- /** @ignore The label is rendered inside the box, as a floating label. */
76
- protected readonly isFloating: _angular_core.Signal<boolean>;
77
- /** @ignore */
78
- protected readonly classes: _angular_core.Signal<string>;
79
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiField, never>;
80
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiField, "ui-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "for": { "alias": "for"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "floatLabel": { "alias": "floatLabel"; "required": false; "isSignal": true; }; "filled": { "alias": "filled"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "multiline": { "alias": "multiline"; "required": false; "isSignal": true; }; "autoHeight": { "alias": "autoHeight"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "messageId": { "alias": "messageId"; "required": false; "isSignal": true; }; "showMessageIcon": { "alias": "showMessageIcon"; "required": false; "isSignal": true; }; "messageIcon": { "alias": "messageIcon"; "required": false; "isSignal": true; }; "hasFooter": { "alias": "hasFooter"; "required": false; "isSignal": true; }; "hasPrefix": { "alias": "hasPrefix"; "required": false; "isSignal": true; }; }, {}, never, ["[uiFieldPrefix]", "*", "[uiFieldSuffix]", "[uiFieldFooter]"], true, never>;
81
- }
82
-
83
- export { UiField };
25
+ export declare class UiField {
26
+ /** Label (rendered via `ui-label`). */
27
+ label: import("@angular/core").InputSignal<string | undefined>;
28
+ /** Label `for` = id of the projected input. */
29
+ for: import("@angular/core").InputSignal<string | undefined>;
30
+ /** Required marker (*). */
31
+ required: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
32
+ /** Size. */
33
+ size: import("@angular/core").InputSignal<FieldSize>;
34
+ /** Effective level (drives the border + message color). */
35
+ level: import("@angular/core").InputSignal<FieldLevel>;
36
+ /** Floating label placement (`over` | `in` | `on`). Unset = classic label above the box. */
37
+ floatLabel: import("@angular/core").InputSignal<FieldFloatLabel | undefined>;
38
+ /** The control holds a value: keeps the floating label raised once focus leaves. */
39
+ filled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
40
+ /** Disabled state (visual). */
41
+ disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
42
+ /** Read-only state (visual). */
43
+ readonly: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
44
+ /** Multiline box (top-aligned, auto-height with min-height) — used by `ui-textarea`. */
45
+ multiline: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
46
+ /**
47
+ * Auto-height box (grows with wrapping content, keeps padding + centering) —
48
+ * used by `ui-select` in `multiple` mode so chips/values can wrap.
49
+ */
50
+ autoHeight: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
51
+ /** Message under the field (helper or error, already resolved by the component). */
52
+ message: import("@angular/core").InputSignal<string | undefined>;
53
+ /** id of the message (for `aria-describedby`, set by the component on the input). */
54
+ messageId: import("@angular/core").InputSignal<string | undefined>;
55
+ /**
56
+ * Prefixes the message with an icon (rendered by `ui-helper`, decorative).
57
+ *
58
+ * Off by default: a field states its status through the border and the text.
59
+ * `messageIcon` only picks *which* glyph — it never turns the icon on.
60
+ */
61
+ showMessageIcon: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
62
+ /**
63
+ * Overrides the glyph shown by `showMessageIcon`. Unset = the icon
64
+ * `ui-helper` derives from the level (question / check / times).
65
+ */
66
+ messageIcon: import("@angular/core").InputSignal<string | undefined>;
67
+ /** Renders the footer row even without a message (e.g. to host a `[uiFieldFooter]` counter). */
68
+ hasFooter: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
69
+ /**
70
+ * An affix is projected into `[uiFieldPrefix]` (left icon…). Only read in
71
+ * `floatLabel` mode, to indent the floating label past it: the prefix is
72
+ * projected content, so no scoped selector here can see it.
73
+ */
74
+ hasPrefix: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
75
+ /** @ignore */
76
+ protected onBoxMouseDown(event: MouseEvent): void;
77
+ /** @ignore The label is rendered inside the box, as a floating label. */
78
+ protected readonly isFloating: import("@angular/core").Signal<boolean>;
79
+ /** @ignore */
80
+ protected readonly classes: import("@angular/core").Signal<string>;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiField, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiField, "ui-field", never, {
83
+ "label": {
84
+ "alias": "label";
85
+ "required": false;
86
+ "isSignal": true;
87
+ };
88
+ "for": {
89
+ "alias": "for";
90
+ "required": false;
91
+ "isSignal": true;
92
+ };
93
+ "required": {
94
+ "alias": "required";
95
+ "required": false;
96
+ "isSignal": true;
97
+ };
98
+ "size": {
99
+ "alias": "size";
100
+ "required": false;
101
+ "isSignal": true;
102
+ };
103
+ "level": {
104
+ "alias": "level";
105
+ "required": false;
106
+ "isSignal": true;
107
+ };
108
+ "floatLabel": {
109
+ "alias": "floatLabel";
110
+ "required": false;
111
+ "isSignal": true;
112
+ };
113
+ "filled": {
114
+ "alias": "filled";
115
+ "required": false;
116
+ "isSignal": true;
117
+ };
118
+ "disabled": {
119
+ "alias": "disabled";
120
+ "required": false;
121
+ "isSignal": true;
122
+ };
123
+ "readonly": {
124
+ "alias": "readonly";
125
+ "required": false;
126
+ "isSignal": true;
127
+ };
128
+ "multiline": {
129
+ "alias": "multiline";
130
+ "required": false;
131
+ "isSignal": true;
132
+ };
133
+ "autoHeight": {
134
+ "alias": "autoHeight";
135
+ "required": false;
136
+ "isSignal": true;
137
+ };
138
+ "message": {
139
+ "alias": "message";
140
+ "required": false;
141
+ "isSignal": true;
142
+ };
143
+ "messageId": {
144
+ "alias": "messageId";
145
+ "required": false;
146
+ "isSignal": true;
147
+ };
148
+ "showMessageIcon": {
149
+ "alias": "showMessageIcon";
150
+ "required": false;
151
+ "isSignal": true;
152
+ };
153
+ "messageIcon": {
154
+ "alias": "messageIcon";
155
+ "required": false;
156
+ "isSignal": true;
157
+ };
158
+ "hasFooter": {
159
+ "alias": "hasFooter";
160
+ "required": false;
161
+ "isSignal": true;
162
+ };
163
+ "hasPrefix": {
164
+ "alias": "hasPrefix";
165
+ "required": false;
166
+ "isSignal": true;
167
+ };
168
+ }, {}, never, ["[uiFieldPrefix]", "*", "[uiFieldSuffix]", "[uiFieldFooter]"], true, never>;
169
+ }