@sixbell-telco/sdk 4.1.2 → 4.3.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 (252) hide show
  1. package/CHANGELOG.md +102 -1
  2. package/README.md +98 -66
  3. package/_index.css +2 -1498
  4. package/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
  5. package/components/alert/README.md +27 -0
  6. package/components/alert/index.d.ts +5 -0
  7. package/components/alert/public-api.d.ts +1 -0
  8. package/components/alert/src/alert.component.d.ts +85 -0
  9. package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
  10. package/components/audio-player/button-play/button-play.component.d.ts +7 -7
  11. package/components/audio-player/src/audio-player.component.d.ts +2 -2
  12. package/components/audio-player/volume-control/volume-control.component.d.ts +1 -1
  13. package/components/avatar/README.md +1 -0
  14. package/components/avatar/src/avatar.component.d.ts +2 -2
  15. package/components/badge/src/badge.component.d.ts +4 -4
  16. package/components/button/README.md +5 -4
  17. package/components/button/src/button.component.d.ts +38 -16
  18. package/components/card/README.md +2 -0
  19. package/components/card/card-footer/card-footer.component.d.ts +37 -2
  20. package/components/card/card-section-group/card-section-group.component.d.ts +1 -1
  21. package/components/card/src/card.component.d.ts +6 -6
  22. package/components/countdown/src/countdown.component.d.ts +4 -4
  23. package/components/data-table/README.md +26 -0
  24. package/components/data-table/expandable/expandable.component.d.ts +4 -4
  25. package/components/data-table/sortable-header/sortable-header.component.d.ts +1 -1
  26. package/components/data-table/src/data-table.component.d.ts +15 -8
  27. package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +1 -1
  28. package/components/description-list/README.md +27 -0
  29. package/components/description-list/index.d.ts +5 -0
  30. package/components/description-list/public-api.d.ts +1 -0
  31. package/components/description-list/src/description-list.component.d.ts +90 -0
  32. package/components/dialog/README.md +10 -6
  33. package/components/dialog/dialog-actions/dialog-actions.component.d.ts +4 -0
  34. package/components/dialog/src/dialog.component.d.ts +27 -6
  35. package/components/dialog/src/fullscreen-block-scroll-strategy.d.ts +31 -0
  36. package/components/divider/src/divider.component.d.ts +1 -1
  37. package/components/dropdown/README.md +1 -1
  38. package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +1 -1
  39. package/components/dropdown/dropdown-item/dropdown-item.component.d.ts +4 -4
  40. package/components/dropdown/dropdown-item-checkbox/dropdown-item-checkbox.component.d.ts +5 -5
  41. package/components/dropdown/dropdown-item-radio/dropdown-item-radio.component.d.ts +5 -5
  42. package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +1 -1
  43. package/components/dropdown-menu/README.md +1 -1
  44. package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +1 -1
  45. package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +1 -1
  46. package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +3 -3
  47. package/components/dropdown-menu/bar/dropdown-menu-bar-item-checkbox/dropdown-menu-bar-item-checkbox.component.d.ts +4 -4
  48. package/components/dropdown-menu/bar/dropdown-menu-bar-item-radio/dropdown-menu-bar-item-radio.component.d.ts +4 -4
  49. package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +1 -1
  50. package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +1 -1
  51. package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +1 -1
  52. package/components/dropdown-menu/dropdown-menu-chevron/dropdown-menu-chevron.component.d.ts +1 -1
  53. package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -3
  54. package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +1 -1
  55. package/components/empty-state/README.md +40 -0
  56. package/components/empty-state/index.d.ts +5 -0
  57. package/components/empty-state/public-api.d.ts +1 -0
  58. package/components/empty-state/src/empty-state.component.d.ts +73 -0
  59. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +4 -4
  60. package/components/file-upload/file-uploader/file-uploader.component.d.ts +2 -2
  61. package/components/forms/checkbox/src/checkbox.component.d.ts +1 -1
  62. package/components/forms/combobox/README.md +1 -0
  63. package/components/forms/combobox/src/combobox.component.d.ts +29 -7
  64. package/components/forms/date-picker/src/date-picker.component.d.ts +21 -9
  65. package/components/forms/form-hint/README.md +29 -0
  66. package/components/forms/form-hint/index.d.ts +5 -0
  67. package/components/forms/form-hint/public-api.d.ts +1 -0
  68. package/components/forms/form-hint/src/form-hint.component.d.ts +38 -0
  69. package/components/forms/form-item/src/form-item.component.d.ts +45 -1
  70. package/components/forms/input/README.md +2 -0
  71. package/components/forms/input/src/input.component.d.ts +41 -7
  72. package/components/forms/radio/src/radio.component.d.ts +1 -1
  73. package/components/forms/range/src/range.component.d.ts +26 -4
  74. package/components/forms/select/README.md +1 -0
  75. package/components/forms/select/src/select.component.d.ts +28 -5
  76. package/components/forms/switch/src/switch.component.d.ts +1 -1
  77. package/components/forms/textarea/src/textarea.component.d.ts +20 -5
  78. package/components/forms/toggle/src/toggle.component.d.ts +1 -1
  79. package/components/notification/src/notification.component.d.ts +1 -1
  80. package/components/overlay/README.md +1 -1
  81. package/components/overlay/overlay-trigger/overlay-trigger.component.d.ts +1 -1
  82. package/components/overlay/src/overlay.component.d.ts +1 -1
  83. package/components/paginator/components/pagination-item/pagination-item.component.d.ts +3 -3
  84. package/components/progress/src/progress.component.d.ts +1 -1
  85. package/components/segmented-button/README.md +57 -0
  86. package/components/segmented-button/index.d.ts +5 -0
  87. package/components/segmented-button/public-api.d.ts +1 -0
  88. package/components/segmented-button/src/segmented-button.component.d.ts +110 -0
  89. package/components/sonner/toaster/src/toaster.component.d.ts +3 -3
  90. package/components/tab/src/tab.component.d.ts +2 -2
  91. package/components/table/README.md +51 -3
  92. package/components/table/public-api.d.ts +1 -0
  93. package/components/table/src/table.component.d.ts +20 -13
  94. package/components/table/table-action/table-action.component.d.ts +14 -3
  95. package/components/table/table-actions/table-actions.component.d.ts +12 -1
  96. package/components/table/tokens/README.md +7 -0
  97. package/components/table/tokens/index.d.ts +5 -0
  98. package/components/table/tokens/public-api.d.ts +1 -0
  99. package/components/table/tokens/table-empty-state.d.ts +6 -0
  100. package/components/tooltip/README.md +22 -5
  101. package/components/tooltip/src/tooltip.component.d.ts +36 -4
  102. package/components/tree/README.md +73 -0
  103. package/components/tree/index.d.ts +5 -0
  104. package/components/tree/public-api.d.ts +1 -0
  105. package/components/tree/src/tree.component.d.ts +180 -0
  106. package/components/wizard/README.md +9 -0
  107. package/components/wizard/wizard-content/wizard-content.component.d.ts +1 -1
  108. package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +15 -6
  109. package/directives/auto-focus/src/auto-focus.directive.d.ts +1 -1
  110. package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -1
  111. package/directives/truncate/README.md +49 -0
  112. package/directives/truncate/index.d.ts +5 -0
  113. package/directives/truncate/public-api.d.ts +1 -0
  114. package/directives/truncate/src/truncate-popover.component.d.ts +11 -0
  115. package/directives/truncate/src/truncate.directive.d.ts +96 -0
  116. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +2 -2
  117. package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
  118. package/fesm2022/sixbell-telco-sdk-components-alert.mjs +152 -0
  119. package/fesm2022/sixbell-telco-sdk-components-alert.mjs.map +1 -0
  120. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +15 -15
  121. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
  122. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +4 -4
  123. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
  124. package/fesm2022/sixbell-telco-sdk-components-badge.mjs +5 -5
  125. package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
  126. package/fesm2022/sixbell-telco-sdk-components-button.mjs +53 -19
  127. package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
  128. package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -14
  129. package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
  130. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +5 -5
  131. package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
  132. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +3 -3
  133. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
  134. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +34 -33
  135. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
  136. package/fesm2022/sixbell-telco-sdk-components-description-list.mjs +200 -0
  137. package/fesm2022/sixbell-telco-sdk-components-description-list.mjs.map +1 -0
  138. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +128 -17
  139. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
  140. package/fesm2022/sixbell-telco-sdk-components-divider.mjs +2 -2
  141. package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
  142. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +16 -16
  143. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
  144. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +2 -2
  145. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
  146. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +6 -6
  147. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
  148. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +17 -17
  149. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  150. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
  151. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  152. package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs +131 -0
  153. package/fesm2022/sixbell-telco-sdk-components-empty-state.mjs.map +1 -0
  154. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +9 -9
  155. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
  156. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
  157. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
  158. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +80 -25
  159. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  160. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +28 -12
  161. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
  162. package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs +81 -0
  163. package/fesm2022/sixbell-telco-sdk-components-forms-form-hint.mjs.map +1 -0
  164. package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +45 -3
  165. package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
  166. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +62 -13
  167. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  168. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
  169. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
  170. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +38 -7
  171. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
  172. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +60 -15
  173. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  174. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
  175. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
  176. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +36 -22
  177. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  178. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -2
  179. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
  180. package/fesm2022/sixbell-telco-sdk-components-notification.mjs +2 -2
  181. package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
  182. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +3 -3
  183. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
  184. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +4 -4
  185. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
  186. package/fesm2022/sixbell-telco-sdk-components-progress.mjs +2 -2
  187. package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
  188. package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +329 -0
  189. package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -0
  190. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +4 -4
  191. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
  192. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +4 -4
  193. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
  194. package/fesm2022/sixbell-telco-sdk-components-tab.mjs +3 -3
  195. package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
  196. package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs +14 -0
  197. package/fesm2022/sixbell-telco-sdk-components-table-tokens.mjs.map +1 -0
  198. package/fesm2022/sixbell-telco-sdk-components-table.mjs +63 -32
  199. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  200. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +156 -25
  201. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
  202. package/fesm2022/sixbell-telco-sdk-components-tree.mjs +478 -0
  203. package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -0
  204. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +18 -9
  205. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  206. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +2 -2
  207. package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
  208. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +2 -2
  209. package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
  210. package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +339 -0
  211. package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -0
  212. package/fesm2022/sixbell-telco-sdk-layouts.mjs +43 -35
  213. package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
  214. package/fesm2022/sixbell-telco-sdk-utils-date.mjs +15 -2
  215. package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
  216. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +87 -2
  217. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -1
  218. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +242 -4
  219. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
  220. package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs +203 -0
  221. package/fesm2022/sixbell-telco-sdk-utils-translation-testing.mjs.map +1 -0
  222. package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs +150 -0
  223. package/fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs.map +1 -0
  224. package/i18n/sdk/en.json +224 -0
  225. package/i18n/sdk/es.json +224 -0
  226. package/i18n/sdk/pt.json +224 -0
  227. package/layouts/README.md +11 -10
  228. package/layouts/src/app-layout/app-layout.component.d.ts +11 -8
  229. package/layouts/src/layout.config.d.ts +1 -1
  230. package/layouts/src/navbar/navbar.component.d.ts +5 -5
  231. package/layouts/src/page-banner/page-banner.component.d.ts +6 -1
  232. package/layouts/src/side-menu/side-menu.component.d.ts +2 -2
  233. package/layouts/src/user-menu/user-menu.component.d.ts +5 -5
  234. package/package.json +63 -23
  235. package/src/_index.css +1616 -0
  236. package/utils/mfe/README.md +1 -0
  237. package/utils/mfe/src/hoist-property-rules.d.ts +13 -0
  238. package/utils/mfe/src/mfe-shadow-shell.component.d.ts +3 -0
  239. package/utils/theme/README.md +94 -1
  240. package/utils/theme/public-api.d.ts +2 -1
  241. package/utils/theme/src/models/theme.d.ts +32 -0
  242. package/utils/theme/src/overlay/theme-overlay.d.ts +33 -0
  243. package/utils/theme/src/providers/theme.provider.types.d.ts +7 -0
  244. package/utils/translation/README.md +61 -0
  245. package/utils/translation/testing/index.d.ts +5 -0
  246. package/utils/translation/testing/public-api.d.ts +2 -0
  247. package/utils/translation/testing/src/translation-testing.d.ts +96 -0
  248. package/utils/unsaved-changes/README.md +33 -0
  249. package/utils/unsaved-changes/index.d.ts +5 -0
  250. package/utils/unsaved-changes/public-api.d.ts +1 -0
  251. package/utils/unsaved-changes/src/unsaved-changes-dialog.component.d.ts +24 -0
  252. package/utils/unsaved-changes/src/unsaved-changes.d.ts +50 -0
@@ -81,6 +81,12 @@ export declare class TooltipComponent {
81
81
  * @defaultValue 'left'
82
82
  */
83
83
  iconPosition: import("@angular/core").InputSignal<"right" | "left" | null | undefined>;
84
+ /**
85
+ * Delay in milliseconds before the tooltip hides after the pointer leaves the trigger or the tooltip,
86
+ * so the pointer can cross the gap onto the tooltip (WCAG 1.4.13 hoverable). `0` hides immediately.
87
+ * @defaultValue 120
88
+ */
89
+ closeDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
84
90
  /**
85
91
  * @internal
86
92
  * Reference to custom tooltip content component
@@ -93,17 +99,24 @@ export declare class TooltipComponent {
93
99
  * Computed flag indicating presence of custom content
94
100
  */
95
101
  hasCustomContent: import("@angular/core").Signal<boolean>;
102
+ /** @internal Plain-text description the trigger's `aria-describedby` resolves to, open or closed. */
103
+ protected readonly descriptionText: import("@angular/core").Signal<string>;
96
104
  private readonly hasTooltipContent;
97
105
  private readonly requestedOpen;
98
106
  private readonly pointerInside;
107
+ private readonly pointerOverPane;
108
+ private closeTimer;
99
109
  private readonly focusedTarget;
100
- private readonly escapeClosed;
110
+ private readonly keyboardFocused;
111
+ /** Set by a press, an activation or Escape; only a fresh pointer enter or keyboard focus clears it. */
112
+ private readonly dismissed;
101
113
  protected readonly renderedOpen: import("@angular/core").WritableSignal<boolean>;
102
114
  protected readonly phase: import("@angular/core").WritableSignal<TooltipPhase>;
103
115
  private readonly activePosition;
104
116
  private readonly closingSide;
105
117
  private transitionToken;
106
118
  protected readonly tooltipId: string;
119
+ protected readonly paneId: string;
107
120
  protected readonly origin: import("@angular/core").Signal<CdkOverlayOrigin>;
108
121
  private animationFallbackHandle;
109
122
  protected readonly triggerTabIndexValue: import("@angular/core").WritableSignal<number | null>;
@@ -113,6 +126,11 @@ export declare class TooltipComponent {
113
126
  */
114
127
  componentClass: import("@angular/core").Signal<string>;
115
128
  constructor();
129
+ /**
130
+ * Capture phase, so a projected control that stops propagation (`st-button [stopPropagation]`) still
131
+ * dismisses it. `click` also covers keyboard activation (Enter/Space), which has no pointerdown.
132
+ */
133
+ private listenForPress;
116
134
  protected readonly positions: import("@angular/core").Signal<ConnectedPosition[]>;
117
135
  private primaryPosition;
118
136
  private oppositeSide;
@@ -130,11 +148,25 @@ export declare class TooltipComponent {
130
148
  protected requestOpen(next: boolean): void;
131
149
  protected onPointerEnter(): void;
132
150
  protected onPointerLeave(): void;
151
+ /** The pointer may move onto the tooltip without hiding it (WCAG 1.4.13 hoverable). */
152
+ protected onPaneEnter(): void;
153
+ protected onPaneLeave(): void;
154
+ private scheduleClose;
155
+ private clearCloseTimer;
156
+ /**
157
+ * Only keyboard focus (`:focus-visible`) opens or keeps the tooltip open. Focus caused by a mouse press,
158
+ * or restored by a dialog after one, describes the control but never shows or pins the tooltip.
159
+ */
133
160
  protected onFocusIn(event: FocusEvent): void;
134
- /** Pressing the trigger dismisses the tooltip until a fresh pointer enter or keyboard focus. */
161
+ /** Pressing or activating the trigger dismisses the tooltip until a fresh pointer enter or keyboard focus. */
135
162
  protected onPress(): void;
136
163
  protected onFocusOut(event: FocusEvent): void;
137
- protected onEscape(): void;
164
+ /**
165
+ * Escape arrives through the CDK overlay keyboard stack, which hands it only to the topmost overlay that
166
+ * listens. While the tooltip is the top layer it closes the tooltip alone; an enclosing `st-dialog`
167
+ * keeps its own Escape for the next press, and a menu opened above the tooltip keeps this one.
168
+ */
169
+ protected onOverlayKeydown(event: KeyboardEvent): void;
138
170
  protected onTooltipPositionChange(event: ConnectedOverlayPositionChange): void;
139
171
  protected tooltipPositionStrategy(): FlexibleConnectedPositionStrategy;
140
172
  private isOriginOutsideView;
@@ -146,6 +178,6 @@ export declare class TooltipComponent {
146
178
  private scheduleTooltipAnimationFallback;
147
179
  private clearTooltipAnimationFallback;
148
180
  static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, never>;
149
- static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "st-tooltip", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; }, {}, ["customContent", "richContentElement"], ["st-tooltip-content", "*"], true, never>;
181
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "st-tooltip", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "iconPosition": { "alias": "iconPosition"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; }, {}, ["customContent", "richContentElement"], ["st-tooltip-content", "*"], true, never>;
150
182
  }
151
183
  export {};
@@ -0,0 +1,73 @@
1
+ # Tree
2
+
3
+ Import: `@sixbell-telco/sdk/components/tree`
4
+
5
+ Selector: `st-tree` (actions template: `ng-template[stTreeNodeActions]`)
6
+
7
+ Single-select tree for hierarchies of any depth (categories, groups), with a
8
+ filter, count badges, controlled selection and expansion, an empty state and
9
+ optional per-node actions.
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <st-tree label="Categories" [nodes]="nodes" [filter]="query()" [(selectedId)]="selectedId" [(expandedIds)]="expandedIds">
15
+ <ng-template stTreeNodeActions let-node let-level="level">
16
+ <st-button
17
+ variant="primary"
18
+ size="xs"
19
+ [ghost]="true"
20
+ [square]="true"
21
+ [icon]="plus"
22
+ [ariaLabel]="'Add under ' + node.label"
23
+ (triggered)="add(node)"
24
+ />
25
+ <st-button variant="warning" size="xs" [ghost]="true" [square]="true" [icon]="edit" [ariaLabel]="'Edit ' + node.label" (triggered)="edit(node)" />
26
+ </ng-template>
27
+ </st-tree>
28
+ ```
29
+
30
+ ```ts
31
+ nodes: TreeNode[] = [
32
+ { id: 'delivery', label: 'Delivery', badge: 12, children: [{ id: 'express', label: 'Express', badge: 4 }] },
33
+ { id: 'billing', label: 'Billing' },
34
+ ];
35
+ ```
36
+
37
+ | Input | Default | Purpose |
38
+ | --------------------- | ------- | -------------------------------------------------------------------------- |
39
+ | `nodes` | - | Required. `{ id, label, badge?, icon?, children?, data? }`, any depth |
40
+ | `label` | `Tree` | Accessible name of the tree (translated default `sdk.tree.label`) |
41
+ | `filter` | `''` | Case-insensitive label filter; matches keep their ancestors, expanded |
42
+ | `selectedId` (model) | `null` | Selected node id, two-way with `[(selectedId)]` |
43
+ | `expandedIds` (model) | `[]` | Expanded branch ids, two-way with `[(expandedIds)]` (ignored if filtering) |
44
+ | `actionsLabel` | auto | Name of the actions group (default `sdk.tree.actions`, "Actions for ...") |
45
+ | `emptyHeading` | auto | Empty-state heading (defaults `sdk.tree.empty` / `sdk.tree.noResults`) |
46
+ | `emptyDescription` | auto | Empty-state description |
47
+ | `class` | `''` | Extra classes merged onto the host |
48
+
49
+ Rows are 32px, indented 20px per level, with a layers icon for branches and a
50
+ tune icon for leaves (override per node with `icon`). Selected rows use the soft
51
+ primary tint, hover uses `base-content/10`.
52
+
53
+ `TreeNode<T>` carries your own payload in `data`; the actions template receives
54
+ the node (`$implicit`), its zero-based `level` and `expanded`.
55
+
56
+ ## Node actions
57
+
58
+ The template renders for the node whose actions hold focus, else the **hovered** one, else the **selected** one, inside a `role="group"`
59
+ toolbar that is a sibling of the tree (never inside a treeitem), laid over the end
60
+ of that row and next in the tab order. Hovering a row shows its actions too (as in the Figma Tree / Item); this adds to the keyboard path, which is unchanged. While focus is inside the actions, hover cannot move them to another row (not even when focus moves between two action buttons), and a click always acts on the node the group is showing. Tab from a tree row goes to the actions of the **selected** node even if the pointer rests on another row, Shift+Tab returns, and Escape inside the actions returns focus to the row they belong to. Give every action button an accessible name that includes the node label. Node actions follow the row-action roles: add `primary`, edit `warning`, delete `error`, all `ghost`.
61
+
62
+ ## Accessibility
63
+
64
+ - WAI-ARIA APG treeview: `role="tree"` / `treeitem`, `aria-level`, `aria-setsize`,
65
+ `aria-posinset`, `aria-expanded` on branches, `aria-selected` on every row.
66
+ - One tab stop (roving tabindex): the last focused row, else the selected one, else the first.
67
+ - Up/Down move, Right expands or enters the first child, Left collapses or returns
68
+ to the parent, Home/End jump, typing a character jumps to the next label that
69
+ starts with it (Space joins the typed text while a type-ahead is in progress), `*` expands every sibling branch, Enter/Space select. Clicking the chevron toggles; clicking the row selects.
70
+ - While filtering, Left/Right still collapse and expand matches until the filter changes.
71
+ - The badge is read with the label (for example "Delivery 12"); keep it meaningful.
72
+ - With no rows (no nodes, or no match) the tree is replaced by `st-empty-state`, since an empty `role="tree"` is invalid.
73
+ - The focus ring stays visible and transitions respect `motion-reduce`.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/components/tree" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from './src/tree.component';
@@ -0,0 +1,180 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /** A node of `st-tree`. Nodes nest to any depth through `children`. */
4
+ export interface TreeNode<T = unknown> {
5
+ /** Unique id, used by `selectedId` and `expandedIds`. */
6
+ id: string;
7
+ /** Visible text and the filter target. */
8
+ label: string;
9
+ /** Small badge after the label, such as the number of items the node owns. */
10
+ badge?: number | string;
11
+ /** Icon SVG (same format as `st-icon` `icon`) shown before the label. Defaults to layers for a branch and tune for a leaf. */
12
+ icon?: string;
13
+ children?: TreeNode<T>[];
14
+ /** Your own payload, handed back through the actions template context. */
15
+ data?: T;
16
+ }
17
+ /** Context of the `stTreeNodeActions` template. */
18
+ export interface TreeNodeActionsContext<T = unknown> {
19
+ $implicit: TreeNode<T>;
20
+ /** Zero-based depth of the node. */
21
+ level: number;
22
+ expanded: boolean;
23
+ }
24
+ /**
25
+ * Marks the `ng-template` rendered as the actions of a node (add, edit, delete…).
26
+ * The template is laid over the end of the row the actions belong to (the row whose actions hold focus, else the hovered row, else the selected row), inside a `role="group"` that is a sibling
27
+ * of the tree, so treeitems stay free of interactive content (APG treeview).
28
+ *
29
+ * @example
30
+ * ```html
31
+ * <st-tree [nodes]="nodes" label="Categories">
32
+ * <ng-template stTreeNodeActions let-node>
33
+ * <st-button size="xs" [ghost]="true" [square]="true" [icon]="plus" [ariaLabel]="'Add under ' + node.label" />
34
+ * </ng-template>
35
+ * </st-tree>
36
+ * ```
37
+ */
38
+ export declare class TreeNodeActionsDirective<T = unknown> {
39
+ readonly template: TemplateRef<TreeNodeActionsContext<T>>;
40
+ static ngTemplateContextGuard<T>(_directive: TreeNodeActionsDirective<T>, _context: unknown): _context is TreeNodeActionsContext<T>;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeNodeActionsDirective<any>, never>;
42
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TreeNodeActionsDirective<any>, "ng-template[stTreeNodeActions]", never, {}, {}, never, never, true, never>;
43
+ }
44
+ /** A visible row of the flattened tree. */
45
+ interface TreeRow<T> {
46
+ node: TreeNode<T>;
47
+ level: number;
48
+ parentId: string | null;
49
+ hasChildren: boolean;
50
+ expanded: boolean;
51
+ posInSet: number;
52
+ setSize: number;
53
+ }
54
+ /**
55
+ * @internal
56
+ * Row classes: selected rows use the primary tint, the keyboard focus ring stays visible.
57
+ */
58
+ export declare const treeRow: (props?: ({
59
+ selected?: boolean | null | undefined;
60
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
61
+ /**
62
+ * Single-select tree following the WAI-ARIA treeview pattern.
63
+ *
64
+ * Rows render flat with `aria-level`, `aria-setsize` and `aria-posinset`, and one roving `tabindex`:
65
+ * Up/Down move, Right expands or enters the first child, Left collapses or returns to the parent,
66
+ * Home/End jump, typing a character jumps to the next label that starts with it (Space joins the typed text while
67
+ * a type-ahead is in progress), `*` expands every sibling branch, Enter/Space select.
68
+ * While filtering, matches show with their ancestors expanded; Left and Right still collapse and
69
+ * expand them until the filter changes.
70
+ *
71
+ * Treeitems hold no interactive content. Project an `ng-template[stTreeNodeActions]` for node
72
+ * actions: it renders inside a `role="group"` toolbar that is a sibling of the tree, laid over the
73
+ * end of the hovered row, else the selected row, and next in the tab order. Hovering a row shows its
74
+ * actions as well, which adds to the keyboard path and never replaces it: Tab from a tree row goes to
75
+ * the actions of the selected node even if the pointer rests on another row, Shift+Tab returns, Escape
76
+ * inside the actions returns focus to the row they belong to. While focus is inside the actions, the
77
+ * pointer cannot move them to another row, not even when focus moves between two action buttons.
78
+ */
79
+ export declare class TreeComponent<T = unknown> {
80
+ /** Root nodes. Nodes nest to any depth through `children`. */
81
+ nodes: import("@angular/core").InputSignal<TreeNode<T>[]>;
82
+ /** Accessible name of the tree. Defaults to a translated "Tree"; name it for the screen reader user. */
83
+ label: import("@angular/core").InputSignal<string>;
84
+ /** Accessible name of the node actions group, e.g. "Actions for Delivery". Defaults to a translated "Actions for {label}". */
85
+ actionsLabel: import("@angular/core").InputSignal<string>;
86
+ /** Case-insensitive label filter. Matches keep their ancestors and expand them. */
87
+ filter: import("@angular/core").InputSignal<string>;
88
+ /** Heading of the empty state shown when there are no nodes. Defaults to a translated text. */
89
+ emptyHeading: import("@angular/core").InputSignal<string>;
90
+ /** Description of the empty state shown when there are no nodes. Defaults to a translated text. */
91
+ emptyDescription: import("@angular/core").InputSignal<string>;
92
+ /** Additional classes merged onto the host */
93
+ class: import("@angular/core").InputSignal<string>;
94
+ /** Id of the selected node, two-way with `[(selectedId)]`. */
95
+ selectedId: import("@angular/core").ModelSignal<string | null>;
96
+ /** Ids of the expanded branches, two-way with `[(expandedIds)]`. Ignored while a filter is active. */
97
+ expandedIds: import("@angular/core").ModelSignal<string[]>;
98
+ private readonly actionsTemplate;
99
+ private readonly rowElements;
100
+ private readonly actionsElement;
101
+ private readonly translateLabel;
102
+ /** @internal */
103
+ protected readonly indent = 20;
104
+ /** @internal */
105
+ protected readonly basePadding = 8;
106
+ /** @internal */
107
+ protected readonly rowHeight = 32;
108
+ /** @internal */
109
+ protected readonly rowGap = 2;
110
+ /** @internal */
111
+ protected readonly icons: {
112
+ expanded: string;
113
+ collapsed: string;
114
+ branch: string;
115
+ leaf: string;
116
+ };
117
+ /** @internal */
118
+ protected readonly focusedId: import("@angular/core").WritableSignal<string | null>;
119
+ /** @internal Measured width of the actions group, reserved as end padding on the row showing the actions. */
120
+ protected readonly actionsWidth: import("@angular/core").WritableSignal<number>;
121
+ private typeahead;
122
+ private readonly normalizedFilter;
123
+ /** Branches collapsed by the user while filtering; a new filter starts with every match expanded again. */
124
+ private readonly collapsedWhileFiltering;
125
+ /** @internal */
126
+ protected readonly hostClass: import("@angular/core").Signal<string>;
127
+ /** @internal */
128
+ protected readonly hasActions: import("@angular/core").Signal<boolean>;
129
+ /** Visible rows: expanded branches only, or every match plus its ancestors while filtering. */
130
+ readonly rows: import("@angular/core").Signal<TreeRow<T>[]>;
131
+ /** @internal The row holding the roving tab stop: last focused, else selected, else first. */
132
+ protected readonly focusId: import("@angular/core").Signal<string>;
133
+ /** @internal Row under the pointer. Hover shows its actions in addition to the selected row's. */
134
+ protected readonly hoveredId: import("@angular/core").WritableSignal<string | null>;
135
+ /** @internal Node whose actions hold focus; the group stays on it whatever the pointer does. */
136
+ protected readonly lockedId: import("@angular/core").WritableSignal<string | null>;
137
+ /** @internal The row whose actions show (focused group, else hovered, else selected) and where they sit; none when that row is not visible or no actions template is projected. */
138
+ protected readonly actionsRow: import("@angular/core").Signal<{
139
+ row: TreeRow<T>;
140
+ template: TemplateRef<TreeNodeActionsContext<any>>;
141
+ top: number;
142
+ } | null>;
143
+ /** @internal */
144
+ protected readonly treeLabel: import("@angular/core").Signal<string>;
145
+ /** @internal */
146
+ protected readonly actionsGroupLabel: import("@angular/core").Signal<string>;
147
+ /** @internal */
148
+ protected readonly emptyText: import("@angular/core").Signal<{
149
+ heading: string;
150
+ description: string;
151
+ }>;
152
+ constructor();
153
+ /** @internal */
154
+ protected rowClass(selected: boolean): string;
155
+ /** @internal */
156
+ protected focusActionsRow(): void;
157
+ /** @internal */
158
+ protected lockActions(): void;
159
+ /** @internal Drops the lock unless focus is moving inside the actions group (between two action buttons, or from a row into it). */
160
+ protected releaseLock(event: FocusEvent): void;
161
+ /** @internal Tracks the hovered row; the actions group itself keeps the row it belongs to. */
162
+ protected onPointerOver(event: MouseEvent): void;
163
+ /** @internal */
164
+ protected onRowClick(row: TreeRow<T>, event: MouseEvent): void;
165
+ /** @internal */
166
+ protected onKeydown(row: TreeRow<T>, event: KeyboardEvent): void;
167
+ /** Keyboard path wins while focus is in the tree: Tab goes to the actions of the selected node, whatever row the pointer rests on. */
168
+ private lockSelectedActions;
169
+ private typeaheadActive;
170
+ /** APG `*`: expands every collapsed branch among the siblings of the focused row. */
171
+ private expandSiblings;
172
+ /** Moves focus to the next row whose label starts with the typed characters. Returns whether the key was a type-ahead character. */
173
+ private typeaheadMove;
174
+ private setExpanded;
175
+ private moveFocus;
176
+ private focusRow;
177
+ static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent<any>, never>;
178
+ static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent<any>, "st-tree", never, { "nodes": { "alias": "nodes"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "actionsLabel": { "alias": "actionsLabel"; "required": false; "isSignal": true; }; "filter": { "alias": "filter"; "required": false; "isSignal": true; }; "emptyHeading": { "alias": "emptyHeading"; "required": false; "isSignal": true; }; "emptyDescription": { "alias": "emptyDescription"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "selectedId": { "alias": "selectedId"; "required": false; "isSignal": true; }; "expandedIds": { "alias": "expandedIds"; "required": false; "isSignal": true; }; }, { "selectedId": "selectedIdChange"; "expandedIds": "expandedIdsChange"; }, ["actionsTemplate"], never, true, never>;
179
+ }
180
+ export {};
@@ -23,3 +23,12 @@ this.wizardService.init([
23
23
  { name: 'summary', label: 'Summary' },
24
24
  ]);
25
25
  ```
26
+
27
+ ## Notes
28
+
29
+ - `nextDescribedBy`: id(s) of the element(s) that explain why the step cannot continue. They are rendered as `aria-describedby` on the built-in Next/End button, so screen readers announce the reason with the button.
30
+
31
+ ```html
32
+ <p id="next-blocked">Pick a service plan to continue.</p>
33
+ <st-wizard nextDescribedBy="next-blocked">…</st-wizard>
34
+ ```
@@ -34,7 +34,7 @@ export declare class WizardContentComponent {
34
34
  * @default false
35
35
  * @remarks Updates wizard service automatically when changed
36
36
  */
37
- isValid: import("@angular/core").InputSignal<boolean>;
37
+ isValid: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
38
38
  /**
39
39
  * Computed status from wizard service
40
40
  * @internal
@@ -30,8 +30,8 @@ export type WizardVariantProps = 'vertical' | 'horizontal';
30
30
  * <!-- Step contents -->
31
31
  * </st-wizard>
32
32
  * <div class="controls">
33
- * <st-button (click)="handlePrevious()">Previous</st-button>
34
- * <st-button (click)="handleNext()">Next</st-button>
33
+ * <st-button variant="secondary" [outline]="true" (click)="handlePrevious()">Previous</st-button>
34
+ * <st-button variant="primary" (click)="handleNext()">Next</st-button>
35
35
  * </div>
36
36
  * ```
37
37
  */
@@ -54,7 +54,7 @@ export declare class WizardWrapperComponent {
54
54
  * @example
55
55
  * <st-wizard [card]="true">...</st-wizard>
56
56
  */
57
- card: import("@angular/core").InputSignal<boolean>;
57
+ card: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
58
58
  /**
59
59
  * Query list of contained wizard content components
60
60
  * @internal
@@ -66,7 +66,7 @@ export declare class WizardWrapperComponent {
66
66
  * @example
67
67
  * <st-wizard [showControls]="false">...</st-wizard>
68
68
  */
69
- showControls: import("@angular/core").InputSignal<boolean>;
69
+ showControls: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
70
70
  /**
71
71
  * Event emitted when the back button is clicked
72
72
  * @example
@@ -97,7 +97,16 @@ export declare class WizardWrapperComponent {
97
97
  * @example
98
98
  * <st-wizard [loading]="true">...</st-wizard>
99
99
  */
100
- loading: import("@angular/core").InputSignal<boolean>;
100
+ loading: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
101
+ /**
102
+ * Id(s) of the element(s) that describe the built-in Next/End button, rendered as its `aria-describedby`.
103
+ * Point it at a notice that explains why the step cannot continue, so screen readers announce it with the button.
104
+ *
105
+ * @example
106
+ * <p id="next-blocked">Pick at least one product to continue.</p>
107
+ * <st-wizard nextDescribedBy="next-blocked">...</st-wizard>
108
+ */
109
+ nextDescribedBy: import("@angular/core").InputSignal<string | null | undefined>;
101
110
  /** @internal Material design chevron left icon */
102
111
  iconChevronLeft: string;
103
112
  /** @internal Material design chevron right icon */
@@ -156,5 +165,5 @@ export declare class WizardWrapperComponent {
156
165
  */
157
166
  handleComplete(): void;
158
167
  static ɵfac: i0.ɵɵFactoryDeclaration<WizardWrapperComponent, never>;
159
- static ɵcmp: i0.ɵɵComponentDeclaration<WizardWrapperComponent, "st-wizard", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "card": { "alias": "card"; "required": false; "isSignal": true; }; "showControls": { "alias": "showControls"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; }, { "back": "back"; "previous": "previous"; "next": "next"; "complete": "complete"; }, ["contents"], ["*", "st-wizard-actions"], true, never>;
168
+ static ɵcmp: i0.ɵɵComponentDeclaration<WizardWrapperComponent, "st-wizard", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "card": { "alias": "card"; "required": false; "isSignal": true; }; "showControls": { "alias": "showControls"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "nextDescribedBy": { "alias": "nextDescribedBy"; "required": false; "isSignal": true; }; }, { "back": "back"; "previous": "previous"; "next": "next"; "complete": "complete"; }, ["contents"], ["*", "st-wizard-actions"], true, never>;
160
169
  }
@@ -41,7 +41,7 @@ export declare class AutofocusDirective {
41
41
  * Controls whether autofocus should be applied to the element.
42
42
  * Set to true to enable autofocus.
43
43
  */
44
- focus: import("@angular/core").InputSignal<boolean>;
44
+ focus: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
45
45
  /** Tracks the current visibility state of the element */
46
46
  private readonly isVisible;
47
47
  /** Keeps a reference so the afterRenderEffect can be destroyed with the directive */
@@ -16,7 +16,7 @@ export declare class OnlyNumbersDirective {
16
16
  * Enable numeric-only input restriction.
17
17
  * @default false
18
18
  */
19
- stOnlyNumbers: import("@angular/core").InputSignal<boolean>;
19
+ stOnlyNumbers: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
20
20
  blockPaste(event: ClipboardEvent): boolean;
21
21
  onKeyPress(event: KeyboardEvent): boolean;
22
22
  static ɵfac: i0.ɵɵFactoryDeclaration<OnlyNumbersDirective, never>;
@@ -0,0 +1,49 @@
1
+ # Truncate
2
+
3
+ Import: `@sixbell-telco/sdk/directives/truncate`
4
+
5
+ Selector: `[stTruncate]` (exported as `stTruncate`)
6
+
7
+ Keeps long text on one line (or a fixed number of lines) with an ellipsis and
8
+ shows the full text in a popover only while the text is actually cut off. Use it
9
+ on description values, banner titles and table cells.
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <dd stText="7" stTruncate class="min-w-0">{{ product.description }}</dd>
15
+ <h1 stText="3" stTruncate>{{ title }}</h1>
16
+ <td><span stTruncate [stTruncateLines]="2">{{ row.notes }}</span></td>
17
+ ```
18
+
19
+ | Input | Default | Purpose |
20
+ | ---------------------- | ------- | ---------------------------------------------------------------- |
21
+ | `stTruncateLines` | `1` | Visible lines before the ellipsis |
22
+ | `stTruncateOpenDelay` | `200` | Hover delay (ms); focus and touch open at once |
23
+ | `stTruncateCloseDelay` | `120` | Delay (ms) after the pointer leaves, so it can reach the popover |
24
+ | `stTruncateFocusable` | `true` | Make truncated text a tab stop; `false` for dense tables |
25
+
26
+ Read-only state: `truncated()` and `isOpen()` signals. Methods: `measure()`,
27
+ `open()`, `close()`.
28
+
29
+ ## Behavior
30
+
31
+ - Overflow is measured on the element itself and re-checked on resize
32
+ (`ResizeObserver`), text changes (`MutationObserver`) and web-font load
33
+ (`document.fonts.ready`). Measuring only runs in the browser (SSR-safe).
34
+ - The popover opens on hover, keyboard focus and touch tap. It is hoverable,
35
+ persists while hovered or focused, and closes on Escape, blur, pointer leave or
36
+ a tap elsewhere (WCAG 1.4.13 Content on Hover or Focus).
37
+ - Screen readers read the element's own text, which CSS truncation never
38
+ removes, so the popover is `aria-hidden` and nothing is announced twice.
39
+ - A truncated element that is not natively focusable gets `tabindex="0"` so
40
+ keyboard users can reveal the full text (WCAG 2.1.1). Text that fits is never
41
+ made focusable. Native controls keep their own focus behavior, and text inside
42
+ an interactive ancestor (button, link, form control, `tabindex` of 0 or more,
43
+ or a role such as `checkbox`, `tab` or `option`) never adds a nested tab stop.
44
+ `tabindex="-1"` containers, such as the dialog container or a skip-link
45
+ target, do not count, so truncated text inside `st-dialog` stays reachable.
46
+ - The popover inherits the nearest `data-theme`, uses `bg-base-300` /
47
+ `text-base-content`, wraps long words, and is capped in width and height.
48
+ - The element needs a constrained width: inside flex or grid, add `min-w-0`.
49
+ Inline elements are switched to `inline-block` with `max-width: 100%`.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/directives/truncate" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from './src/truncate.directive';
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * @internal
4
+ * Visual-only surface that shows the full text of a truncated `stTruncate` host.
5
+ * The host keeps the full text in the accessibility tree, so this copy is hidden from assistive technology.
6
+ */
7
+ export declare class TruncatePopoverComponent {
8
+ readonly text: import("@angular/core").InputSignal<string>;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruncatePopoverComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<TruncatePopoverComponent, "st-truncate-popover", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,96 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Truncates overflowing text with an ellipsis and reveals the full text in a popover,
4
+ * only while the text is actually cut off.
5
+ *
6
+ * @remarks
7
+ * - Single line by default; `stTruncateLines` > 1 clamps to that many lines.
8
+ * - Overflow is measured on the host itself, re-checked on resize, text changes and web-font load.
9
+ * Measuring only runs in the browser, so it is SSR-safe.
10
+ * - The popover opens on hover (after `stTruncateOpenDelay`), on keyboard focus and on touch tap.
11
+ * It is hoverable, stays open while hovered or focused, and closes on Escape, blur or pointer leave
12
+ * (WCAG 1.4.13 Content on Hover or Focus).
13
+ * - The host keeps its full text in the accessibility tree (CSS truncation hides nothing from screen
14
+ * readers), so the popover is `aria-hidden` and nothing is announced twice.
15
+ * - A truncated, non-focusable host becomes a tab stop (`tabindex="0"`) so keyboard users can reveal the
16
+ * hidden text (WCAG 2.1.1). Text that fits is never made focusable, nor is text inside an interactive
17
+ * ancestor (no nested tab stops); `stTruncateFocusable="false"` opts out, for example in dense tables.
18
+ * - The host needs a constrained width: give a flex or grid child `min-w-0`.
19
+ *
20
+ * @example
21
+ * ```html
22
+ * <p stTruncate>{{ product.description }}</p>
23
+ * <h1 stText="3" stTruncate>{{ title }}</h1>
24
+ * <td><span stTruncate [stTruncateLines]="2">{{ row.notes }}</span></td>
25
+ * ```
26
+ *
27
+ * @publicApi
28
+ */
29
+ export declare class TruncateDirective {
30
+ /**
31
+ * Number of visible lines before the text is cut off.
32
+ * @defaultValue 1
33
+ */
34
+ readonly stTruncateLines: import("@angular/core").InputSignalWithTransform<number, unknown>;
35
+ /**
36
+ * Hover delay in milliseconds before the popover opens. Focus and touch open it immediately.
37
+ * @defaultValue 200
38
+ */
39
+ readonly stTruncateOpenDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
40
+ /**
41
+ * Delay in milliseconds before the popover closes after the pointer leaves, so the pointer can move onto it.
42
+ * @defaultValue 120
43
+ */
44
+ readonly stTruncateCloseDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
45
+ /**
46
+ * Whether a truncated, non-focusable host becomes a tab stop so keyboard users can reveal the full text.
47
+ * Set it to `false` in dense tables where the row or another control already exposes the text.
48
+ * The host never becomes a tab stop inside an interactive ancestor (button, link, form control, `tabindex` ≥ 0, or a role such as checkbox or tab).
49
+ * @defaultValue true
50
+ */
51
+ readonly stTruncateFocusable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
52
+ private readonly truncatedState;
53
+ private readonly openState;
54
+ /** Whether the text currently overflows its box. */
55
+ readonly truncated: import("@angular/core").Signal<boolean>;
56
+ /** Whether the full-text popover is open. */
57
+ readonly isOpen: import("@angular/core").Signal<boolean>;
58
+ private readonly lines;
59
+ private readonly host;
60
+ private readonly renderer;
61
+ private readonly overlay;
62
+ private readonly themeDom;
63
+ private readonly destroyRef;
64
+ private readonly nativelyFocusable;
65
+ private overlayRef;
66
+ private popoverRef;
67
+ private openTimer;
68
+ private closeTimer;
69
+ private pointerOverHost;
70
+ private pointerOverPopover;
71
+ private focused;
72
+ private destroyed;
73
+ private rendered;
74
+ private inlineHost;
75
+ constructor();
76
+ /** Re-measures the host. Call it after a layout change the directive cannot observe. */
77
+ measure(): void;
78
+ /** Opens the popover now, if the text is truncated. */
79
+ open(): void;
80
+ /** Closes the popover now. */
81
+ close(): void;
82
+ protected onPointerEnter(): void;
83
+ protected onPointerLeave(): void;
84
+ protected onFocus(): void;
85
+ protected onBlur(): void;
86
+ protected onPointerDown(event: PointerEvent): void;
87
+ private scheduleClose;
88
+ private createOverlay;
89
+ private observe;
90
+ private applyTruncationStyles;
91
+ private hasInteractiveAncestor;
92
+ private fullText;
93
+ private clearTimers;
94
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruncateDirective, never>;
95
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TruncateDirective, "[stTruncate]", ["stTruncate"], { "stTruncateLines": { "alias": "stTruncateLines"; "required": false; "isSignal": true; }; "stTruncateOpenDelay": { "alias": "stTruncateOpenDelay"; "required": false; "isSignal": true; }; "stTruncateCloseDelay": { "alias": "stTruncateCloseDelay"; "required": false; "isSignal": true; }; "stTruncateFocusable": { "alias": "stTruncateFocusable"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
96
+ }
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Component, inject, computed } from '@angular/core';
2
+ import { input, Component, booleanAttribute, inject, computed } from '@angular/core';
3
3
  import { TextDirective } from '@sixbell-telco/sdk/directives/text';
4
4
  import { cn } from '@sixbell-telco/sdk/utils/cn';
5
5
  import { cva } from 'class-variance-authority';
@@ -29,7 +29,7 @@ const accordionItemComponent = cva(['join-item border-neutral collapse border'],
29
29
  });
30
30
  class AccordionItemComponent {
31
31
  header = input('');
32
- opened = input(false);
32
+ opened = input(false, { transform: booleanAttribute });
33
33
  variant = input();
34
34
  name;
35
35
  type;