@sixbell-telco/sdk 3.3.1 → 4.1.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 (171) hide show
  1. package/CHANGELOG.md +137 -1
  2. package/README.md +47 -47
  3. package/THIRD_PARTY_NOTICES.md +33 -0
  4. package/_index.css +673 -76
  5. package/components/audio-player/README.md +1 -0
  6. package/components/audio-player/button-play/button-play.component.d.ts +3 -0
  7. package/components/audio-player/src/audio-player.component.d.ts +8 -0
  8. package/components/audio-player/volume-control/volume-control.component.d.ts +3 -0
  9. package/components/button/README.md +13 -0
  10. package/components/button/src/button.component.d.ts +30 -5
  11. package/components/data-table/README.md +53 -3
  12. package/components/data-table/expandable/expandable.component.d.ts +15 -2
  13. package/components/data-table/public-api.d.ts +2 -0
  14. package/components/data-table/sortable-header/sortable-header.component.d.ts +15 -1
  15. package/components/data-table/src/aria-sort.d.ts +22 -0
  16. package/components/data-table/src/data-table-context.service.d.ts +11 -3
  17. package/components/data-table/src/data-table.component.d.ts +39 -3
  18. package/components/data-table/src/sort-icon.component.d.ts +22 -0
  19. package/components/data-table/src/toggle-size.d.ts +7 -0
  20. package/components/data-table/sub-component-toggle/sub-component-toggle.component.d.ts +13 -0
  21. package/components/dialog/README.md +1 -0
  22. package/components/dialog/src/dialog.component.d.ts +9 -2
  23. package/components/divider/src/divider.component.d.ts +5 -0
  24. package/components/dropdown/README.md +21 -0
  25. package/components/dropdown/dropdown-content/dropdown-content.component.d.ts +4 -0
  26. package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +36 -0
  27. package/components/dropdown/src/dropdown-item-focus.d.ts +6 -0
  28. package/components/dropdown/src/dropdown.component.d.ts +5 -2
  29. package/components/dual-list/src/dual-list.component.d.ts +6 -0
  30. package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +6 -0
  31. package/components/forms/combobox/src/combobox.component.d.ts +7 -0
  32. package/components/forms/date-picker/README.md +2 -0
  33. package/components/forms/date-picker/src/date-picker.component.d.ts +6 -0
  34. package/components/forms/select/src/select.component.d.ts +3 -0
  35. package/components/icon/README.md +8 -1
  36. package/components/icon/src/icon.component.d.ts +9 -1
  37. package/components/notification/README.md +8 -0
  38. package/components/notification/src/notification.component.d.ts +8 -1
  39. package/components/paginator/README.md +1 -0
  40. package/components/paginator/components/pagination-item/pagination-item.component.d.ts +7 -1
  41. package/components/paginator/src/paginator.component.d.ts +10 -0
  42. package/components/sonner/toaster/src/toaster.component.d.ts +2 -1
  43. package/components/table/README.md +25 -0
  44. package/components/table/public-api.d.ts +1 -0
  45. package/components/table/src/table-loading.d.ts +18 -0
  46. package/components/table/src/table.component.d.ts +32 -4
  47. package/components/text/README.md +1 -0
  48. package/components/tooltip/src/tooltip.component.d.ts +2 -0
  49. package/directives/text/src/text.directive.d.ts +2 -2
  50. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +48 -10
  51. package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
  52. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
  53. package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
  54. package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
  55. package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
  56. package/fesm2022/sixbell-telco-sdk-components-button.mjs +83 -4
  57. package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
  58. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs +34 -33
  59. package/fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs.map +1 -1
  60. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +429 -361
  61. package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
  62. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +42 -22
  63. package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
  64. package/fesm2022/sixbell-telco-sdk-components-divider.mjs +8 -2
  65. package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -1
  66. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +7 -7
  67. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
  68. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +4 -4
  69. package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
  70. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +247 -47
  71. package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
  72. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +10 -3
  73. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  74. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +16 -8
  75. package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
  76. package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
  77. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +13 -5
  78. package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
  79. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +9 -3
  80. package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
  81. package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
  82. package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
  83. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +1 -1
  84. package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
  85. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +8 -4
  86. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  87. package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
  88. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +3 -15
  89. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  90. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +2 -3
  91. package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
  92. package/fesm2022/sixbell-telco-sdk-components-icon.mjs +12 -4
  93. package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
  94. package/fesm2022/sixbell-telco-sdk-components-link.mjs +1 -1
  95. package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
  96. package/fesm2022/sixbell-telco-sdk-components-notification.mjs +17 -8
  97. package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
  98. package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
  99. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +24 -5
  100. package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
  101. package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +5 -5
  102. package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
  103. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +2 -1
  104. package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
  105. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +2 -1
  106. package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
  107. package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -1
  108. package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
  109. package/fesm2022/sixbell-telco-sdk-components-table.mjs +99 -22
  110. package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
  111. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +21 -3
  112. package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
  113. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +9 -9
  114. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  115. package/fesm2022/sixbell-telco-sdk-directives-text.mjs +3 -3
  116. package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -1
  117. package/fesm2022/sixbell-telco-sdk-layouts.mjs +944 -0
  118. package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -0
  119. package/fesm2022/sixbell-telco-sdk-utils-cn.mjs +2 -3
  120. package/fesm2022/sixbell-telco-sdk-utils-cn.mjs.map +1 -1
  121. package/fesm2022/sixbell-telco-sdk-utils-http.mjs +39 -0
  122. package/fesm2022/sixbell-telco-sdk-utils-http.mjs.map +1 -0
  123. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs +150 -0
  124. package/fesm2022/sixbell-telco-sdk-utils-mfe.mjs.map +1 -0
  125. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +103 -4
  126. package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
  127. package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +71 -2
  128. package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
  129. package/layouts/README.md +278 -0
  130. package/layouts/index.d.ts +5 -0
  131. package/layouts/public-api.d.ts +23 -0
  132. package/layouts/src/app-layout/app-layout.component.d.ts +83 -0
  133. package/layouts/src/layout-account.d.ts +16 -0
  134. package/layouts/src/layout-logo.d.ts +10 -0
  135. package/layouts/src/layout-switcher/layout-switcher.component.d.ts +13 -0
  136. package/layouts/src/layout.config.d.ts +22 -0
  137. package/layouts/src/layout.service.d.ts +17 -0
  138. package/layouts/src/menu/menu-active.d.ts +24 -0
  139. package/layouts/src/menu/menu-animation.d.ts +34 -0
  140. package/layouts/src/menu/menu-search.d.ts +13 -0
  141. package/layouts/src/menu/menu-sections.d.ts +23 -0
  142. package/layouts/src/menu/menu-url.d.ts +12 -0
  143. package/layouts/src/menu/menu.model.d.ts +15 -0
  144. package/layouts/src/navbar/navbar.component.d.ts +33 -0
  145. package/layouts/src/page-banner/page-banner.component.d.ts +40 -0
  146. package/layouts/src/side-menu/side-menu.component.d.ts +89 -0
  147. package/layouts/src/user-menu/user-menu.component.d.ts +91 -0
  148. package/package.json +26 -15
  149. package/utils/cn/src/cn.d.ts +1 -1
  150. package/utils/http/README.md +26 -0
  151. package/utils/http/index.d.ts +5 -0
  152. package/utils/http/public-api.d.ts +3 -0
  153. package/utils/http/src/bearer-token.interceptor.d.ts +19 -0
  154. package/utils/http/src/http-context.d.ts +3 -0
  155. package/utils/mfe/README.md +35 -0
  156. package/utils/mfe/index.d.ts +5 -0
  157. package/utils/mfe/public-api.d.ts +5 -0
  158. package/utils/mfe/src/mfe-shadow-root.d.ts +23 -0
  159. package/utils/mfe/src/mfe-shadow-shell.component.d.ts +20 -0
  160. package/utils/mfe/src/provide-mfe-shadow-shell.d.ts +20 -0
  161. package/utils/mfe/src/shadow-root-overlay-container.d.ts +13 -0
  162. package/utils/theme/README.md +14 -0
  163. package/utils/theme/public-api.d.ts +3 -1
  164. package/utils/theme/src/models/theme.d.ts +18 -0
  165. package/utils/theme/src/scheme-favicon/scheme-favicon.d.ts +26 -0
  166. package/utils/theme/src/theme-assets/theme-assets.service.d.ts +31 -1
  167. package/utils/theme/src/theme-assets/theme-assets.types.d.ts +6 -0
  168. package/utils/translation/README.md +12 -0
  169. package/utils/translation/public-api.d.ts +4 -0
  170. package/utils/translation/src/title-strategy/translated-title-strategy.d.ts +27 -0
  171. package/utils/translation/src/translated-label/translated-label.d.ts +21 -0
@@ -0,0 +1,278 @@
1
+ # @sixbell-telco/sdk/layouts
2
+
3
+ Application chrome shared by MFE hosts and their standalone dev harnesses: the classic and modern layouts and the pieces around them.
4
+
5
+ ## Setup
6
+
7
+ ```ts
8
+ import { provideLayout } from '@sixbell-telco/sdk/layouts';
9
+
10
+ providers: [provideLayout({ defaultLayout: 'modern' })];
11
+ ```
12
+
13
+ | Option | Description |
14
+ | ------------------ | ----------------------------------------------------------------------- |
15
+ | `defaultLayout` | Layout used until the user picks one. Defaults to `classic`. |
16
+ | `storageNamespace` | Prefix for the persisted preferences when several apps share an origin. |
17
+
18
+ The texts use the `sdk.layout.*` keys of the SDK translation bundle (`/assets/i18n/sdk/`).
19
+
20
+ ## LayoutService
21
+
22
+ - `selectedLayout()`, `setLayout(layout)`: the current layout, persisted in `localStorage` (`layout:selectedLayout`).
23
+ - `sidebarCollapsed()`, `setSidebarCollapsed(collapsed)`: the shared sidebar state (`layout:sidebarCollapsed`).
24
+
25
+ ## st-app-layout
26
+
27
+ The whole shell in one tag. Only the chrome follows `LayoutService.selectedLayout()`; the projected content stays in one `main`, so the `router-outlet` and its page survive a layout switch.
28
+
29
+ ```html
30
+ <st-app-layout [items]="menu()" topLevelGroups="divider" activeMatch="menu-id">
31
+ <router-outlet />
32
+ </st-app-layout>
33
+ ```
34
+
35
+ | Input | Type | Default | Description |
36
+ | ---------------- | -------------------------- | --------------- | ----------------------------------------------------------- |
37
+ | `items` | `LayoutMenuItem[]` | required | Passed to `st-side-menu`. |
38
+ | `topLevelGroups` | `LayoutMenuTopLevelGroups` | `'collapsible'` | Passed to `st-side-menu`. |
39
+ | `activeMatch` | `LayoutMenuActiveMatch` | `'route'` | Passed to `st-side-menu`. |
40
+ | `searchable` | `boolean` | `true` | Passed to `st-side-menu`. |
41
+ | `homeLink` | `string` | `'/'` | Route of the logo link. |
42
+ | `logoAlt` | `string \| null` | `null` | Alt text of the logo. Defaults to the localized theme name. |
43
+
44
+ `showLanguageSelector`, `showSchemeSelector`, `showThemeSelector` and `showLayoutSelector` (all `true`) are passed to the account menu of both layouts, as on `st-user-menu`.
45
+
46
+ Navbar end content (modern only): mark a template with `stAppLayoutNavbarEnd` (`AppLayoutNavbarEndDirective`) and the shell renders it at the end of `st-navbar`, before the account pill. It is a template, not `ng-content`, because projected content cannot be re-projected from inside the layout `@switch`. The classic layout has no top bar and does not render it; place classic actions in the page yourself.
47
+
48
+ ```html
49
+ <st-app-layout [items]="menu()" [showThemeSelector]="false">
50
+ <st-button *stAppLayoutNavbarEnd variant="base" [ghost]="true" ariaLabel="Notifications">…</st-button>
51
+ <router-outlet />
52
+ </st-app-layout>
53
+ ```
54
+
55
+ - **Classic**: a full-height sticky sidebar with the logo (`logo-icon` while the rail is collapsed, `logo` otherwise), `st-side-menu`, a separator and `st-user-menu variant="sidebar"`. No top bar. The sidebar is `w-84`, the rail `w-22`.
56
+ - **Modern**: a `bg-modern-gradient` page, a `header` with `st-navbar`, and a rounded sticky sidebar (`h-[calc(100dvh-7rem)]`) with `st-side-menu` only. The sidebar is `w-84`, the rail `w-20`.
57
+ - The `aside` is an unnamed complementary landmark: the `st-side-menu` `nav` inside it carries the `sdk.layout.navigation` name, so screen readers hear it once. The width transition is off under `prefers-reduced-motion`.
58
+ - The collapse toggle is the `st-side-menu` one; the shell has none. A sidebar pinned collapsed expands while hovered (hovering a pinned-open sidebar does nothing, so pinning it collapsed takes effect at once), and in classic it stays expanded while the account menu is open.
59
+ - The shell owns `st-layout-switcher`; the account menu's layout option opens it.
60
+ - Theme art always uses `ThemeService.resolvedScheme()`.
61
+
62
+ It needs `provideLayoutAccount` for the account menu, like `st-user-menu`.
63
+
64
+ ## st-navbar
65
+
66
+ The modern top bar, used by `st-app-layout` and available for custom shells.
67
+
68
+ ```html
69
+ <header>
70
+ <st-navbar homeLink="/" (openLayoutSwitcher)="layoutDialogOpen.set(true)">
71
+ <st-button stNavbarEnd variant="base" [ghost]="true" ariaLabel="Notifications">…</st-button>
72
+ </st-navbar>
73
+ </header>
74
+ ```
75
+
76
+ - Start: the logo linking to `homeLink` (default `'/'`). The image is the theme asset `logo-modern`, else `logo`, for the resolved scheme. Its alt text is `logoAlt`, else the localized theme name.
77
+ - End: the content marked `stNavbarEnd`, then `st-user-menu variant="navbar"` in a glass pill (`showUserMenu`, default `true`). `showLanguageSelector`, `showSchemeSelector`, `showThemeSelector` and `showLayoutSelector` (all `true`) are passed to that menu.
78
+ - Output `openLayoutSwitcher`: the account menu's layout option was picked.
79
+ - The component is not a landmark; wrap it in a `header` (as `st-app-layout` does).
80
+
81
+ ## Utilities
82
+
83
+ `bg-modern-gradient` (in the kit stylesheet): the modern page background. Remove app copies of it. A dark brand band (the ink) sits behind the navbar and the page-banner title and fades into `base-100`:
84
+
85
+ ```css
86
+ linear-gradient(to bottom, ink 0, color-mix(in oklch, ink 85%, primary) 12rem, color-mix(in oklch, primary 18%, base-100) 24rem, base-100 38rem)
87
+ ```
88
+
89
+ | Token | Default | Use |
90
+ | ----------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
91
+ | `--color-modern-gradient-ink` | unset: `oklch(from var(--color-primary) min(l, 0.4) c h)`, primary capped at lightness 0.4 | The band color. Set it in a theme to replace it (no hex) |
92
+
93
+ With `prefers-contrast: more` the ink (default or override) is capped at lightness 0.32. Browsers without relative colors use `color-mix(in oklch, var(--color-primary) 62%, oklch(0% 0 0))` unless the theme sets the token.
94
+
95
+ `st-navbar` marks its logo link and end area `data-st-navbar-band`; there `--color-base-content` is `--color-primary-gradient-content`, so the account pill and any `stNavbarEnd` buttons stay readable on the band in both schemes. The account menu opens in an overlay outside the navbar and keeps the page foreground; an inline `.dropdown-content`, `[popover]` or `dialog` inside the band is reset to it too. Ghost buttons on the band (`.btn-ghost`: the logo link, the pill trigger, end buttons) darken the band on hover, active, focus and while their menu is open, instead of daisyUI's `base-200` fill, and keep the band foreground and a band-foreground focus ring.
96
+
97
+ ## st-page-banner
98
+
99
+ ```html
100
+ <st-page-banner [title]="title" [subtitle]="subtitle" [backLink]="'/tables'" bannerAsset="network-banner">
101
+ <router-outlet />
102
+ </st-page-banner>
103
+ ```
104
+
105
+ Classic shows the title over the theme banner image, or a plain surface when the theme has no such asset. Modern shows it on the brand gradient. The projected content fills the remaining height.
106
+
107
+ Theme art always uses `ThemeService.resolvedScheme()`; no layout forces a scheme. Art that the modern chrome needs in a fixed look, such as the white logo on the brand gradient, is its own asset (by convention `logo-modern`), declared in the app's theme catalog with both variants (for example the white logo for `light` and `dark`) and read like any other asset:
108
+
109
+ ```ts
110
+ getAssetUrl(themeService.selectedTheme(), 'logo-modern', themeService.resolvedScheme());
111
+ ```
112
+
113
+ Over the image, the title color comes from the image tone: the `bannerTone` input (`light` or `dark`), else the `tone` the theme catalog declares for that asset and the resolved scheme (`ThemeAssetsService.getAssetTone`). Light art gets dark text and dark art light text. When neither declares a tone, the banner lays a `base-100` scrim over the image and uses `base-content` text, so the title stays readable in both schemes without guessing the photo's luminance. Declare `tone` on every banner asset in the theme catalog:
114
+
115
+ ```json
116
+ { "name": "banner", "light": "…/banner-light.jpg", "dark": "…/banner-dark.jpg", "tone": { "light": "light", "dark": "light" } }
117
+ ```
118
+
119
+ Over toned art the back button sits on a frosted `base-100` surface (80% opacity, backdrop blur) with `base-content` text. The surface and the text come from the same scheme, so the label keeps at least 4.5:1 over any image in both schemes. On the scrim and on the plain surface it is the plain tertiary button.
120
+
121
+ In every case (toned art, scrim, plain surface and the modern gradient) its focus ring is two-tone: a `base-content` outline over a 4px `base-100` ring, so one of the two contrasts at least 3:1 with whatever is behind it, in both schemes.
122
+
123
+ ## st-layout-switcher
124
+
125
+ ```html
126
+ <st-layout-switcher [(opened)]="layoutDialogOpen" />
127
+ ```
128
+
129
+ ## st-user-menu
130
+
131
+ The account menu of both layouts: the navbar avatar (modern) and the sidebar footer avatar (classic). The kit has no session or router dependency, so the app supplies the account:
132
+
133
+ ```ts
134
+ import { provideLayoutAccount } from '@sixbell-telco/sdk/layouts';
135
+
136
+ providers: [
137
+ provideLayoutAccount(() => {
138
+ const session = inject(SessionService);
139
+ const router = inject(Router);
140
+ return {
141
+ user: session.avatarUser, // Signal<AvatarUser | null>
142
+ logout: () => session.logout(),
143
+ changePassword: () => router.navigate(['/account/change-password']), // optional
144
+ };
145
+ }),
146
+ ];
147
+ ```
148
+
149
+ `factory` runs in an injection context, so it can `inject()` app services.
150
+
151
+ ```html
152
+ <st-user-menu variant="sidebar" [collapsed]="sidebarCollapsed()" (openLayoutSwitcher)="layoutDialogOpen.set(true)" />
153
+ <st-user-menu variant="navbar" (openLayoutSwitcher)="layoutDialogOpen.set(true)" />
154
+ ```
155
+
156
+ | Input | Default | Description |
157
+ | ---------------------- | ----------- | ---------------------------------------------------------------- |
158
+ | `variant` | `'sidebar'` | `navbar` (modern) or `sidebar` (classic). |
159
+ | `collapsed` | `false` | Sidebar variant only: shows the avatar without name and role. |
160
+ | `showLanguageSelector` | `true` | Shows the language option (also needs more than one language). |
161
+ | `showSchemeSelector` | `true` | Shows the color scheme option (also needs more than one scheme). |
162
+ | `showThemeSelector` | `true` | Shows the theme option (also needs more than one theme). |
163
+ | `showLayoutSelector` | `true` | Shows the layout option (also needs more than one layout). |
164
+ | `class` | `''` | Extra classes for the host. |
165
+
166
+ | Output | Description |
167
+ | -------------------- | -------------------------------------------------------- |
168
+ | `openLayoutSwitcher` | The layout option was picked; open `st-layout-switcher`. |
169
+ | `openChange` | `true` when the menu opens, `false` when it closes. |
170
+
171
+ Options: change password (only when the account provides `changePassword`), language (`TranslationService`), color scheme and theme (`ThemeService`), layout and logout. Language, scheme and theme appear only with more than one option and their `show*Selector` input left `true`; with every preference hidden, the Preferences group is gone. Theme and scheme names use `sdk.theme.catalog.*` and `sdk.theme.schemes.*`, falling back to a formatted name.
172
+
173
+ ## st-side-menu
174
+
175
+ Sidebar navigation for both layouts: a search box, the menu tree and, when the sidebar is collapsed, an icon rail. Labels must already be translated. The component fills its container; the layout shell sets the width.
176
+
177
+ ```html
178
+ <st-side-menu [items]="menu" topLevelGroups="divider" activeMatch="menu-id" />
179
+ ```
180
+
181
+ | Input | Type | Default | Description |
182
+ | -------------------- | -------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------ |
183
+ | `items` | `LayoutMenuItem[]` | required | Menu tree with translated labels. `icon` is an SVG string, as `st-icon` takes it. |
184
+ | `topLevelGroups` | `LayoutMenuTopLevelGroups` | `'collapsible'` | `divider` (SBP): level-1 groups are uppercase section labels. `collapsible` (IRP, aux): every group collapses. |
185
+ | `activeMatch` | `LayoutMenuActiveMatch` | `'route'` | `route`: the longest matching route is active. `menu-id`: links carry `menu=<id>` and that entry is active. |
186
+ | `collapsed` | `boolean \| undefined` | `undefined` | Overrides the visible state of `LayoutService.sidebarCollapsed()`, for example `pinned && !hovered` for a hover rail. |
187
+ | `searchable` | `boolean` | `true` | Shows the search box (a search button in the rail). |
188
+ | `showCollapseToggle` | `boolean` | `true` | Shows the footer button that pins the sidebar through `LayoutService.setSidebarCollapsed`. Hide it when the shell has its own. |
189
+ | `class` | `string` | `''` | Merged into the host classes with `cn()`. |
190
+ | `search` | `string` (`model`) | `''` | Text of the search box. `[(search)]` binds it two-way; `searchChange` emits each edit and each clear. |
191
+
192
+ Behaviour:
193
+
194
+ - The active entry follows the router URL (`NavigationEnd`) through `resolveActiveMenu`. Its link gets `aria-current="page"`. Links use `menuLinkQueryParams`, so `menu-id` mode adds the `menu` param.
195
+ - The collapsed state is `LayoutService.sidebarCollapsed()`, persisted in `localStorage`, unless the `collapsed` input is set. The toggle and the rail search button always write `LayoutService.setSidebarCollapsed`, so a shell that overrides `collapsed` derives it from the service.
196
+ - The toggle's label, icon and action follow the pinned state, `LayoutService.sidebarCollapsed()`, not the `collapsed` override: on a hover-expanded rail (`[collapsed]="pinned && !hovered"`) it reads "expand" and pins the sidebar open, and once pinned open it reads "collapse", pins it collapsed and clears the search. Its placement (centred with a right tooltip in the rail, end-aligned with a top tooltip in the tree) follows the visible state.
197
+ - Groups are disclosure buttons with `aria-expanded` and `aria-controls`. They open with `animate-morph-in` and close with `animate-morph-out`, and `animationend` is filtered by target and keyframe name. Under `prefers-reduced-motion` a toggle settles at once. The chevron uses the global `[data-st-chevron]` rotation.
198
+ - Navigation and search drive the expansion from one effect, as in [Expansion and animation](#expansion-and-animation). A non-blank search filters the tree and opens the matched branches. Clearing it, or navigating, which clears it, returns to the active trail.
199
+ - The collapsed rail shows `toRailItems(items, topLevelGroups)` as icon-only links with an `st-tooltip` label and an `aria-label`. Items without `icon` use `matFolderOutline`. As in SBP, a group in the rail links to its first navigable entry (`firstNavigableMenuItem`), and it gets `aria-current="true"` while its branch holds the current page. There is no flyout.
200
+ - Entry states, the same in the tree and the rail, with semantic tokens only. The current page is `bg-primary text-primary-content` raised by `shadow-sm` in `shadow-primary`; hover mixes the primary 70% toward `base-content`, a press 55% and drops the shadow. Mixing toward `base-content` moves away from `primary-content`, so text contrast rises in both schemes. Other links, group headers and rail entries tint to `base-300` on hover and to `color-mix(in oklch, var(--color-base-300) 80%, var(--color-base-content))` while pressed; a pressed, focused entry switches its inset focus ring to `base-content`, since primary falls below 3:1 against that fill in dark schemes. Hover only applies on pointer devices (`@media (hover: hover)`), and transitions stop under `prefers-reduced-motion`. The entries do not use DaisyUI `menu`, so its `aria-current` and `menu-active` look never applies on top.
201
+ - The rail search button expands the sidebar and focuses the search box.
202
+ - The search clears on navigation and when the collapse toggle pins the sidebar collapsed; `searchChange` emits `''` then. A hover rail that only collapses visually (the `collapsed` override turning `true`) keeps the text, so it is still there when the rail expands again.
203
+
204
+ Texts: `sdk.layout.navigation` (the `nav` label), `sdk.layout.search`, `sdk.layout.expand`, `sdk.layout.collapse` and `sdk.layout.no_results`.
205
+
206
+ ## Testing
207
+
208
+ Specs that mock these components with ng-mocks (`MockComponent(UserMenuComponent)`, `MockBuilder(...).mock(AppLayoutComponent)`) need ng-mocks 14.16 or later: older versions do not see signal inputs, so bindings such as `[showThemeSelector]` fail as unknown properties. Consumers pinned to 14.13.5 must upgrade, or stub the component by hand.
209
+
210
+ ## Menu utilities
211
+
212
+ Pure helpers behind the layout sidebars. They take a `LayoutMenuItem[]` tree and hold no Angular state, except the signal-based animation store.
213
+
214
+ ### Model
215
+
216
+ ```ts
217
+ interface LayoutMenuItem {
218
+ id: string | number;
219
+ label: string;
220
+ icon?: string;
221
+ route?: string;
222
+ queryParams?: Record<string, string>;
223
+ children?: LayoutMenuItem[];
224
+ }
225
+ ```
226
+
227
+ - An item is a group only when it has at least one child (`menuItemHasChildren`). `children: []` is a leaf.
228
+ - Every id set and active id the helpers return is a string (`String(item.id)`), so `1` and `'1'` are the same entry. Look them up with `trailIds.has(String(item.id))`.
229
+ - `walkMenuItems(items, visit)` visits every item depth-first with its depth, starting at 1.
230
+
231
+ ### Modes
232
+
233
+ | Type | Values | Default |
234
+ | -------------------------- | ----------------------------------------- | ------------- |
235
+ | `LayoutMenuTopLevelGroups` | `divider`, `collapsible` | `collapsible` |
236
+ | `LayoutMenuActiveMatch` | `route` (longest route prefix), `menu-id` | `route` |
237
+
238
+ The defaults are exported as `DEFAULT_MENU_TOP_LEVEL_GROUPS` and `DEFAULT_MENU_ACTIVE_MATCH`.
239
+
240
+ - `divider`: level-1 groups render as non-clickable section labels followed by their children. `toMenuSections(items, mode)` returns `LayoutMenuSection`s (`label` or `item`). `toRailItems(items, mode)` flattens those sections into their children for the collapsed icon rail. `firstNavigableMenuItem(item)` is the entry a rail icon links to: a leaf with a route, or the first such descendant of a group.
241
+ - `collapsible`: every top-level item stays a regular item and groups expand in place.
242
+ - `route`: `resolveActiveMenu(items, url)` activates the item whose route is the longest prefix of the URL path, ignoring query and fragment. When two routes are equally long, the later item wins, and a matching child wins over its parent. A parent whose own route is longer than its matching child's stays active.
243
+ - `menu-id`: `resolveActiveMenu(items, url, 'menu-id')` activates the item whose id equals the URL's `menu` query param and whose route matches. Use it when several entries open the same page.
244
+
245
+ ### Helpers
246
+
247
+ - `resolveActiveMenu(items, url, match?)`: returns a `LayoutMenuActiveState` with `trailIds` (root first), `activeId` and `rootItem`.
248
+ - `shouldSyncActiveBranch(url, match)`: returns `false` in `menu-id` mode when the URL has no `menu` param. Such a URL says nothing about the menu, so keep the current expansion instead of syncing it to an empty trail.
249
+ - `menuLinkQueryParams(item, match)`: the query params for an item's link. That is the item's `queryParams`, plus `menu=<id>` in `menu-id` mode.
250
+ - `menuQueryParams(item)`, `menuIdFromUrl(url)`, `menuRoutesMatch(route, url)` and `normalizeMenuRoute(route)` are the URL primitives behind them.
251
+ - `searchMenu(items, search)`: a search that ignores case and accents. It returns a `LayoutMenuSearchResult`. An item whose own label matches keeps its whole original subtree, so a matching divider section stays a label with all its entries. Ancestors of a match keep only their matching branches. `expandedIds` holds every matching group and every ancestor of a match. A blank search returns the input tree unchanged.
252
+
253
+ ### Expansion and animation
254
+
255
+ `createMenuAnimationStore()` returns a `LayoutMenuAnimationStore` that tracks one `LayoutMenuAnimationState` (`closed`, `opening`, `open` or `closing`) per group id. `isExpanded(id)` is true while a group's content must stay rendered, which is every state except `closed`.
256
+
257
+ - `toggle(id)` moves through `opening`/`closing`, and `animationEnd(id)` settles it. The `animationend` DOM event bubbles from nested groups, so filter it by `event.target` or `event.animationName` before calling `animationEnd` for a group.
258
+ - `sync(items, openIds)` opens the groups in `openIds` and closes the rest. By default it settles directly to `open`/`closed`. `animationend` never fires for a group that is not rendered (inside a collapsed parent, or hidden by the icon rail) or whose animation is removed (`animate-none`, or a host without the kit's keyframes), so a group left in `opening`/`closing` would never settle. Under `motion-reduce` it does fire: the kit's global reduced-motion rule shortens animations to `0.01ms` instead of removing them.
259
+ - `sync(items, openIds, { animate: true })` (`LayoutMenuAnimationSyncOptions`) moves through `opening`/`closing` instead. Use it only when every affected group is rendered and animates.
260
+
261
+ Drive both sources from one effect, so a search result is never overwritten by a navigation sync and clearing the search returns to the active trail:
262
+
263
+ ```ts
264
+ const store: LayoutMenuAnimationStore = createMenuAnimationStore();
265
+
266
+ effect(() => {
267
+ const url = currentUrl();
268
+ const query = search();
269
+ if (query.trim()) {
270
+ store.sync(items(), searchMenu(items(), query).expandedIds);
271
+ return;
272
+ }
273
+ if (!shouldSyncActiveBranch(url, match)) return;
274
+ store.sync(items(), resolveActiveMenu(items(), url, match).trailIds);
275
+ });
276
+ ```
277
+
278
+ `st-side-menu` uses exactly this pattern.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sixbell-telco/sdk/layouts" />
5
+ export * from './public-api';
@@ -0,0 +1,23 @@
1
+ export { AppLayoutComponent, AppLayoutNavbarEndDirective } from './src/app-layout/app-layout.component';
2
+ export { LAYOUT_ACCOUNT, provideLayoutAccount } from './src/layout-account';
3
+ export type { LayoutAccount } from './src/layout-account';
4
+ export { LayoutSwitcherComponent } from './src/layout-switcher/layout-switcher.component';
5
+ export { DEFAULT_COLLAPSE_TOGGLE, LAYOUT_CONFIG, LAYOUT_OPTIONS, provideLayout } from './src/layout.config';
6
+ export type { LayoutCollapseToggle, LayoutConfig, LayoutOption, LayoutType } from './src/layout.config';
7
+ export { LayoutService } from './src/layout.service';
8
+ export { findMenuIdTrail, findRouteTrail, isActiveMenuItem, resolveActiveMenu, shouldSyncActiveBranch } from './src/menu/menu-active';
9
+ export type { LayoutMenuActiveState } from './src/menu/menu-active';
10
+ export { createMenuAnimationStore } from './src/menu/menu-animation';
11
+ export type { LayoutMenuAnimationState, LayoutMenuAnimationStore, LayoutMenuAnimationSyncOptions } from './src/menu/menu-animation';
12
+ export { normalizeMenuSearchText, searchMenu } from './src/menu/menu-search';
13
+ export type { LayoutMenuSearchResult } from './src/menu/menu-search';
14
+ export { firstNavigableMenuItem, toMenuSections, toRailItems } from './src/menu/menu-sections';
15
+ export type { LayoutMenuSection } from './src/menu/menu-sections';
16
+ export { MENU_QUERY_PARAM, menuIdFromUrl, menuLinkQueryParams, menuQueryParams, menuRoutesMatch, normalizeMenuRoute } from './src/menu/menu-url';
17
+ export { DEFAULT_MENU_ACTIVE_MATCH, DEFAULT_MENU_TOP_LEVEL_GROUPS, menuItemHasChildren, walkMenuItems } from './src/menu/menu.model';
18
+ export type { LayoutMenuActiveMatch, LayoutMenuItem, LayoutMenuTopLevelGroups } from './src/menu/menu.model';
19
+ export { NavbarComponent } from './src/navbar/navbar.component';
20
+ export { PageBannerComponent } from './src/page-banner/page-banner.component';
21
+ export { SideMenuComponent } from './src/side-menu/side-menu.component';
22
+ export { UserMenuComponent } from './src/user-menu/user-menu.component';
23
+ export type { UserMenuVariant } from './src/user-menu/user-menu.component';
@@ -0,0 +1,83 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { type LayoutCollapseToggle } from '../layout.config';
3
+ import { type LayoutMenuActiveMatch, type LayoutMenuItem, type LayoutMenuTopLevelGroups } from '../menu/menu.model';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Marks an `ng-template` (or, with `*stAppLayoutNavbarEnd`, an element) whose content `st-app-layout`
7
+ * renders at the end of the modern `st-navbar`, before the account menu. Modern only: the classic
8
+ * layout has no top bar and does not render it.
9
+ *
10
+ * @example
11
+ * ```html
12
+ * <st-app-layout [items]="menu()">
13
+ * <st-button *stAppLayoutNavbarEnd variant="base" [ghost]="true" ariaLabel="Notifications">…</st-button>
14
+ * <router-outlet />
15
+ * </st-app-layout>
16
+ * ```
17
+ */
18
+ export declare class AppLayoutNavbarEndDirective {
19
+ readonly template: TemplateRef<unknown>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppLayoutNavbarEndDirective, never>;
21
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AppLayoutNavbarEndDirective, "[stAppLayoutNavbarEnd]", never, {}, {}, never, never, true, never>;
22
+ }
23
+ /**
24
+ * The application shell: classic (full-height sidebar with logo, menu and account) or modern
25
+ * (gradient page, `st-navbar` banner and a rounded sidebar), following `LayoutService.selectedLayout()`.
26
+ * A pinned-collapsed sidebar expands while hovered, and in classic while its account menu is open.
27
+ * The projected content (usually a `router-outlet`) lives in one `main` that survives layout switches.
28
+ */
29
+ export declare class AppLayoutComponent {
30
+ private readonly layoutService;
31
+ private readonly logo;
32
+ /** Menu tree with labels already translated, passed to `st-side-menu`. */
33
+ readonly items: import("@angular/core").InputSignal<LayoutMenuItem[]>;
34
+ /** `st-side-menu` `topLevelGroups`. */
35
+ readonly topLevelGroups: import("@angular/core").InputSignal<LayoutMenuTopLevelGroups>;
36
+ /** `st-side-menu` `activeMatch`. */
37
+ readonly activeMatch: import("@angular/core").InputSignal<LayoutMenuActiveMatch>;
38
+ /** `st-side-menu` `searchable`. */
39
+ readonly searchable: import("@angular/core").InputSignal<boolean>;
40
+ /** Route the logo links to. */
41
+ readonly homeLink: import("@angular/core").InputSignal<string>;
42
+ /** Alt text of the logo; defaults to the localized theme name. */
43
+ readonly logoAlt: import("@angular/core").InputSignal<string | null>;
44
+ /** `st-user-menu` `showLanguageSelector`, in both layouts. */
45
+ readonly showLanguageSelector: import("@angular/core").InputSignal<boolean>;
46
+ /** `st-user-menu` `showSchemeSelector`, in both layouts. */
47
+ readonly showSchemeSelector: import("@angular/core").InputSignal<boolean>;
48
+ /** `st-user-menu` `showThemeSelector`, in both layouts. */
49
+ readonly showThemeSelector: import("@angular/core").InputSignal<boolean>;
50
+ /** `st-user-menu` `showLayoutSelector`, in both layouts. */
51
+ readonly showLayoutSelector: import("@angular/core").InputSignal<boolean>;
52
+ /**
53
+ * Classic layout only: `footer` (default) keeps the kit collapse toggle in the `st-side-menu`
54
+ * footer; `header` renders it next to the logo, like the pre-SDK4 classic sidebar. Modern keeps
55
+ * the footer.
56
+ */
57
+ readonly collapseToggle: import("@angular/core").InputSignal<LayoutCollapseToggle>;
58
+ /** Content for the end of the modern navbar; a template, so it can render inside the layout's `@switch`. */
59
+ private readonly navbarEnd;
60
+ protected readonly navbarEndTemplate: import("@angular/core").Signal<TemplateRef<unknown> | null>;
61
+ protected readonly layout: import("@angular/core").WritableSignal<import("@sixbell-telco/sdk/layouts").LayoutType>;
62
+ protected readonly switcherOpen: import("@angular/core").WritableSignal<boolean>;
63
+ private readonly hovering;
64
+ private readonly userMenuOpen;
65
+ /** The pinned-collapsed rail expands while hovered, and stays expanded while the classic account menu is open. */
66
+ protected readonly railCollapsed: import("@angular/core").Signal<boolean>;
67
+ protected readonly frameClass: import("@angular/core").Signal<string>;
68
+ protected readonly asideClass: import("@angular/core").Signal<string>;
69
+ protected readonly mainClass: import("@angular/core").Signal<string>;
70
+ protected readonly classicLogoUrl: import("@angular/core").Signal<string | null>;
71
+ protected readonly logoLabel: import("@angular/core").Signal<string>;
72
+ protected readonly pinnedCollapsed: import("@angular/core").Signal<boolean>;
73
+ protected readonly collapseOpenIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 18h13v-2H3v2zm0-5h10v-2H3v2zm0-7v2h13V6H3zm18 9.59L17.42 12L21 8.41L19.59 7l-5 5l5 5L21 15.59z\"></path></svg>";
74
+ protected readonly collapseClosedIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\"></path></svg>";
75
+ protected openSwitcher(): void;
76
+ /** Hovering only expands a rail that is pinned collapsed, so pinning it collapsed takes effect at once. */
77
+ protected setHovering(hovering: boolean): void;
78
+ protected setUserMenuOpen(open: boolean): void;
79
+ /** Pins the sidebar collapsed or open, like the `st-side-menu` footer button. */
80
+ protected toggleClassicCollapsed(): void;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppLayoutComponent, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppLayoutComponent, "st-app-layout", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "topLevelGroups": { "alias": "topLevelGroups"; "required": false; "isSignal": true; }; "activeMatch": { "alias": "activeMatch"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "homeLink": { "alias": "homeLink"; "required": false; "isSignal": true; }; "logoAlt": { "alias": "logoAlt"; "required": false; "isSignal": true; }; "showLanguageSelector": { "alias": "showLanguageSelector"; "required": false; "isSignal": true; }; "showSchemeSelector": { "alias": "showSchemeSelector"; "required": false; "isSignal": true; }; "showThemeSelector": { "alias": "showThemeSelector"; "required": false; "isSignal": true; }; "showLayoutSelector": { "alias": "showLayoutSelector"; "required": false; "isSignal": true; }; "collapseToggle": { "alias": "collapseToggle"; "required": false; "isSignal": true; }; }, {}, ["navbarEnd"], ["*"], true, never>;
83
+ }
@@ -0,0 +1,16 @@
1
+ import { InjectionToken, Provider, Signal } from '@angular/core';
2
+ import { AvatarUser } from '@sixbell-telco/sdk/components/avatar';
3
+ /** The signed-in account as the layouts see it. Apps adapt their own session to this shape. */
4
+ export interface LayoutAccount {
5
+ /** The user shown in the account menu; `null` while there is no session. */
6
+ user: Signal<AvatarUser | null>;
7
+ logout: () => void;
8
+ /** Opens the app's change-password flow. The option is hidden when absent. */
9
+ changePassword?: () => void;
10
+ }
11
+ export declare const LAYOUT_ACCOUNT: InjectionToken<LayoutAccount>;
12
+ /**
13
+ * Supplies the account used by `st-user-menu`. `factory` runs in an injection context, so it can
14
+ * `inject()` the app's session service.
15
+ */
16
+ export declare function provideLayoutAccount(factory: () => LayoutAccount): Provider;
@@ -0,0 +1,10 @@
1
+ import { Signal } from '@angular/core';
2
+ interface LayoutLogo {
3
+ /** URL of a theme asset for the selected theme and the resolved scheme; `null` when the theme lacks it. */
4
+ assetUrl: (key: string) => string | null;
5
+ /** The `logoAlt` override, else the localized name of the selected theme. */
6
+ alt: (override: Signal<string | null>) => Signal<string>;
7
+ }
8
+ /** Theme art and alt text for the layout logos. Call it in an injection context. */
9
+ export declare function injectLayoutLogo(): LayoutLogo;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ import { LayoutType } from '../layout.config';
2
+ import * as i0 from "@angular/core";
3
+ /** Dialog that previews the classic and modern layouts and applies the one the user picks. */
4
+ export declare class LayoutSwitcherComponent {
5
+ private readonly layoutService;
6
+ readonly opened: import("@angular/core").ModelSignal<boolean>;
7
+ protected readonly options: readonly import("@sixbell-telco/sdk/layouts").LayoutOption[];
8
+ protected readonly selectedLayout: import("@angular/core").WritableSignal<LayoutType>;
9
+ protected readonly checkIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41L9 16.17z\"></path></svg>";
10
+ protected select(layout: LayoutType): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<LayoutSwitcherComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<LayoutSwitcherComponent, "st-layout-switcher", never, { "opened": { "alias": "opened"; "required": false; "isSignal": true; }; }, { "opened": "openedChange"; }, never, never, true, never>;
13
+ }
@@ -0,0 +1,22 @@
1
+ import { InjectionToken, Provider } from '@angular/core';
2
+ /** Application chrome variants. */
3
+ export type LayoutType = 'classic' | 'modern';
4
+ /** Where `st-app-layout` renders the sidebar collapse toggle in the classic layout. */
5
+ export type LayoutCollapseToggle = 'footer' | 'header';
6
+ /** Default collapse toggle position: the `st-side-menu` footer button. */
7
+ export declare const DEFAULT_COLLAPSE_TOGGLE: LayoutCollapseToggle;
8
+ export interface LayoutOption {
9
+ value: LayoutType;
10
+ labelKey: string;
11
+ descriptionKey: string;
12
+ }
13
+ export interface LayoutConfig {
14
+ /** Layout used until the user picks one. Defaults to `classic`. */
15
+ defaultLayout?: LayoutType;
16
+ /** Namespace for the persisted preferences, for apps that share an origin. */
17
+ storageNamespace?: string;
18
+ }
19
+ export declare const LAYOUT_CONFIG: InjectionToken<LayoutConfig>;
20
+ export declare const LAYOUT_OPTIONS: readonly LayoutOption[];
21
+ /** Configures the SDK layouts: default layout and preference namespace. */
22
+ export declare function provideLayout(config: LayoutConfig): Provider;
@@ -0,0 +1,17 @@
1
+ import { LayoutType } from './layout.config';
2
+ import * as i0 from "@angular/core";
3
+ /** Selected layout and sidebar state, persisted in `localStorage` like the theme and language preferences. */
4
+ export declare class LayoutService {
5
+ private readonly config;
6
+ private readonly prefix;
7
+ readonly options: readonly import("@sixbell-telco/sdk/layouts").LayoutOption[];
8
+ readonly selectedLayout: import("@angular/core").WritableSignal<LayoutType>;
9
+ readonly sidebarCollapsed: import("@angular/core").WritableSignal<boolean>;
10
+ setLayout(layout: LayoutType): void;
11
+ setSidebarCollapsed(collapsed: boolean): void;
12
+ private restoreLayout;
13
+ private read;
14
+ private write;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
17
+ }
@@ -0,0 +1,24 @@
1
+ import { type LayoutMenuActiveMatch, type LayoutMenuItem } from './menu.model';
2
+ export interface LayoutMenuActiveState {
3
+ /** Ids along the active trail, root first, as strings so numeric and string ids compare equal. */
4
+ trailIds: ReadonlySet<string>;
5
+ /** Deepest id on the trail as a string, or null when nothing is active. */
6
+ activeId: string | null;
7
+ /** Top-level item the trail starts from, or null. */
8
+ rootItem: LayoutMenuItem | null;
9
+ }
10
+ /** `menu-id` mode: the URL's `menu` param equals the id and the route matches the path. */
11
+ export declare function isActiveMenuItem(url: string, item: LayoutMenuItem): boolean;
12
+ /**
13
+ * False when navigating to `url` must keep the current expansion: in `menu-id` mode a URL without a
14
+ * `menu` param says nothing about the menu, so the open groups stay as the user left them.
15
+ */
16
+ export declare function shouldSyncActiveBranch(url: string, match: LayoutMenuActiveMatch): boolean;
17
+ /**
18
+ * Depth-first trail to the best matching item for `url`; the longest route prefix wins, the later item on a tie.
19
+ * A matching child beats its own parent on an equally long route.
20
+ */
21
+ export declare function findRouteTrail(items: readonly LayoutMenuItem[], url: string, ancestors?: LayoutMenuItem[]): LayoutMenuItem[];
22
+ /** First trail, depth-first, whose leaf satisfies `isActiveMenuItem`. */
23
+ export declare function findMenuIdTrail(items: readonly LayoutMenuItem[], url: string, ancestors?: LayoutMenuItem[]): LayoutMenuItem[];
24
+ export declare function resolveActiveMenu(items: readonly LayoutMenuItem[], url: string, match?: LayoutMenuActiveMatch): LayoutMenuActiveState;
@@ -0,0 +1,34 @@
1
+ import { type Signal } from '@angular/core';
2
+ import { type LayoutMenuItem } from './menu.model';
3
+ export type LayoutMenuAnimationState = 'closed' | 'opening' | 'open' | 'closing';
4
+ export interface LayoutMenuAnimationSyncOptions {
5
+ /**
6
+ * Move through `opening`/`closing` instead of settling to `open`/`closed`. Use it only for groups
7
+ * that are rendered and animate, because each of them then needs an `animationEnd` call.
8
+ */
9
+ animate?: boolean;
10
+ }
11
+ export interface LayoutMenuAnimationStore {
12
+ /** Ids are keyed as strings, so `1` and `'1'` share one state. */
13
+ state(id: LayoutMenuItem['id']): Signal<LayoutMenuAnimationState>;
14
+ set(id: LayoutMenuItem['id'], value: LayoutMenuAnimationState): void;
15
+ /** Reverses direction, also while an animation is running. */
16
+ toggle(id: LayoutMenuItem['id']): void;
17
+ /**
18
+ * Settles `opening` to `open` and `closing` to `closed`; other states are unchanged. `animationend`
19
+ * bubbles from nested groups, so filter the event by `target` or `animationName` before calling it.
20
+ */
21
+ animationEnd(id: LayoutMenuItem['id']): void;
22
+ isExpanded(id: LayoutMenuItem['id']): boolean;
23
+ /**
24
+ * Opens every group whose id is in `openIds` and closes the rest. By default it settles directly to
25
+ * `open`/`closed`: `animationend` never fires for a group that is not rendered (inside a collapsed
26
+ * parent, hidden by the icon rail) or whose animation is removed (`animate-none`, or a host without the
27
+ * kit's keyframes), so `opening`/`closing` would never end. The kit's reduced-motion rule shortens
28
+ * animations to 0.01ms rather than removing them, so `animationend` still fires under `motion-reduce`.
29
+ * With `{ animate: true }` it moves through `opening`/`closing` instead, leaving in-flight states that
30
+ * already head the right way.
31
+ */
32
+ sync(items: readonly LayoutMenuItem[], openIds: ReadonlySet<string>, options?: LayoutMenuAnimationSyncOptions): void;
33
+ }
34
+ export declare function createMenuAnimationStore(): LayoutMenuAnimationStore;
@@ -0,0 +1,13 @@
1
+ import { type LayoutMenuItem } from './menu.model';
2
+ /** Lowercases, decomposes and strips combining marks so search ignores case and accents. */
3
+ export declare function normalizeMenuSearchText(value: string): string;
4
+ export interface LayoutMenuSearchResult {
5
+ /**
6
+ * Filtered tree: matches plus their ancestors. An item whose own label matches keeps its whole
7
+ * original subtree. Identical to the input for an empty search.
8
+ */
9
+ items: readonly LayoutMenuItem[];
10
+ /** Ids, as strings, of the groups to expand: matching groups and every ancestor of a match. */
11
+ expandedIds: ReadonlySet<string>;
12
+ }
13
+ export declare function searchMenu(items: readonly LayoutMenuItem[], search: string): LayoutMenuSearchResult;
@@ -0,0 +1,23 @@
1
+ import { type LayoutMenuItem, type LayoutMenuTopLevelGroups } from './menu.model';
2
+ /** A top-level entry as the sidebar renders it. */
3
+ export type LayoutMenuSection = {
4
+ kind: 'label';
5
+ item: LayoutMenuItem;
6
+ children: readonly LayoutMenuItem[];
7
+ } | {
8
+ kind: 'item';
9
+ item: LayoutMenuItem;
10
+ };
11
+ /**
12
+ * `divider`: level-1 items with children become non-clickable labels followed by their children.
13
+ * `collapsible`: every top-level item stays a regular (possibly collapsible) item.
14
+ */
15
+ export declare function toMenuSections(items: readonly LayoutMenuItem[], mode?: LayoutMenuTopLevelGroups): LayoutMenuSection[];
16
+ /** Items shown in the collapsed icon rail: divider mode flattens level-1 groups into their children. */
17
+ export declare function toRailItems(items: readonly LayoutMenuItem[], mode?: LayoutMenuTopLevelGroups): LayoutMenuItem[];
18
+ /**
19
+ * Entry a collapsed-rail icon links to: the item itself when it is a leaf with a route, otherwise its
20
+ * first navigable descendant, depth-first. A group whose descendants have no route falls back to its
21
+ * own route. Null when nothing in the branch can be navigated to.
22
+ */
23
+ export declare function firstNavigableMenuItem(item: LayoutMenuItem): LayoutMenuItem | null;
@@ -0,0 +1,12 @@
1
+ import type { LayoutMenuActiveMatch, LayoutMenuItem } from './menu.model';
2
+ export declare const MENU_QUERY_PARAM = "menu";
3
+ /** Path of a route or URL without query or fragment, with a leading slash and no trailing slash. */
4
+ export declare function normalizeMenuRoute(route: string | undefined | null): string | null;
5
+ /** True when `url` is the known route or sits beneath it, ignoring query and fragment. */
6
+ export declare function menuRoutesMatch(knownRoute: string | undefined | null, url: string): boolean;
7
+ /** Value of the `menu` query param carried by a URL, or null when absent or empty. */
8
+ export declare function menuIdFromUrl(url: string): string | null;
9
+ /** Query params that link a page to its own menu entry (`menu-id` active mode). */
10
+ export declare function menuQueryParams(item: Pick<LayoutMenuItem, 'id'> | null | undefined): Record<string, string>;
11
+ /** Query params for an item's link: its own `queryParams`, plus the `menu` param in `menu-id` mode. */
12
+ export declare function menuLinkQueryParams(item: Pick<LayoutMenuItem, 'id' | 'queryParams'>, match: LayoutMenuActiveMatch): Record<string, string>;
@@ -0,0 +1,15 @@
1
+ export interface LayoutMenuItem {
2
+ id: string | number;
3
+ label: string;
4
+ icon?: string;
5
+ route?: string;
6
+ queryParams?: Record<string, string>;
7
+ children?: LayoutMenuItem[];
8
+ }
9
+ export type LayoutMenuTopLevelGroups = 'divider' | 'collapsible';
10
+ export type LayoutMenuActiveMatch = 'route' | 'menu-id';
11
+ export declare const DEFAULT_MENU_TOP_LEVEL_GROUPS: LayoutMenuTopLevelGroups;
12
+ export declare const DEFAULT_MENU_ACTIVE_MATCH: LayoutMenuActiveMatch;
13
+ /** True when the item has at least one child; `children: []` counts as a leaf. */
14
+ export declare function menuItemHasChildren(item: LayoutMenuItem): boolean;
15
+ export declare function walkMenuItems(items: readonly LayoutMenuItem[], visit: (item: LayoutMenuItem, depth: number) => void, depth?: number): void;