@sixbell-telco/sdk 4.5.0 → 4.6.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.
- package/CHANGELOG.md +266 -986
- package/GLOSSARY.md +76 -0
- package/README.md +143 -1346
- package/banner.webp +0 -0
- package/components/badge/src/badge.component.d.ts +6 -1
- package/components/dropdown-menu/README.md +1 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +2 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +9 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +6 -0
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +7 -0
- package/components/dropdown-menu/public-api.d.ts +1 -0
- package/components/dropdown-menu/src/directives/dropdown-menu-keyboard.directive.d.ts +54 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +5 -0
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +15 -2
- package/components/forms/checkbox/src/checkbox.component.d.ts +12 -1
- package/components/status-illustration/README.md +38 -0
- package/components/status-illustration/index.d.ts +5 -0
- package/components/status-illustration/public-api.d.ts +1 -0
- package/components/status-illustration/src/status-illustration.component.d.ts +42 -0
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +1 -1
- package/components/tree/README.md +11 -1
- package/components/tree/src/tree.component.d.ts +44 -5
- package/components/wizard/README.md +17 -0
- package/components/wizard/services/wizard.service.d.ts +9 -0
- package/components/wizard/wizard-indicator/wizard-indicator.component.d.ts +71 -0
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +24 -1
- package/directives/text/src/text.directive.d.ts +6 -2
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +8 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +92 -25
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +29 -3
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +271 -21
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +14 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +15 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-status-illustration.mjs +66 -0
- package/fesm2022/sixbell-telco-sdk-components-status-illustration.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs +171 -51
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +123 -356
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +4 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +55 -13
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +23 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/i18n/sdk/en.json +4 -1
- package/i18n/sdk/es.json +4 -1
- package/i18n/sdk/pt.json +4 -1
- package/layouts/README.md +16 -6
- package/layouts/src/page-banner/page-banner.component.d.ts +37 -6
- package/manifest.json +10943 -0
- package/package.json +53 -41
- package/schematics/lib/plan.cjs +179 -0
- package/schematics/lib/tokens.cjs +133 -0
- package/schematics/lib/workspace.cjs +118 -0
- package/schematics/manual-steps.json +90 -0
- package/schematics/migration.json +15 -0
- package/schematics/migrations/v4-0-0/assets.cjs +331 -0
- package/schematics/migrations/v4-0-0/canonical/enghouse_networks.json +360 -0
- package/schematics/migrations/v4-0-0/canonical/shell.json +25 -0
- package/schematics/migrations/v4-0-0/canonical/theme-assets.json +44 -0
- package/schematics/migrations/v4-0-0/canonical/themes.json +11 -0
- package/schematics/migrations/v4-0-0/index.cjs +96 -0
- package/schematics/migrations/v4-0-0/layout.cjs +269 -0
- package/schematics/migrations/v4-0-0/shell.cjs +1864 -0
- package/schematics/migrations/v4-6-0/index.cjs +394 -0
- package/src/_index.css +257 -26
- package/utils/theme/README.md +1 -1
- package/utils/theme/public-api.d.ts +1 -1
- package/utils/theme/src/models/theme.d.ts +10 -0
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +12 -1
- package/banner.png +0 -0
- package/components/wizard/wizard-marker/wizard-marker.component.d.ts +0 -85
- package/components/wizard/wizard-step/wizard-step.component.d.ts +0 -83
- package/components/wizard/wizard-sub-step/wizard-sub-step.component.d.ts +0 -95
package/README.md
CHANGED
|
@@ -1,164 +1,45 @@
|
|
|
1
1
|
# Enghouse Networks UI Kit — Component Library (`@sixbell-telco/sdk`)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
The package is public on npm, but the repository is private and there is no separate public docs page. Because of that, this README keeps setup guidance, provider examples, translation examples, and usage references that public consumers need.
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
The SDK provides:
|
|
10
|
-
|
|
11
|
-
- **25+ Production-Ready Components**: Button, Card, Form inputs, Data Table, Dialog, Dropdown, and more
|
|
12
|
-
- **Utility Services**: Theme management, i18n translation, logging, runtime config, and formatting
|
|
13
|
-
- **Directive Support**: Text, truncate, auto-focus, click-outside, and only-numbers
|
|
14
|
-
- **Tailwind CSS v4 + DaisyUI**: Modern styling with customizable themes
|
|
15
|
-
- **Multi-Entry Point Architecture**: Granular imports for optimized bundle sizes
|
|
16
|
-
- **Angular 19 Signal-Based**: Modern reactive patterns with Angular signals
|
|
17
|
-
|
|
18
|
-
## Pre-requirements
|
|
19
|
-
|
|
20
|
-
- **Node.js**: `>=22.19.0 <23`
|
|
21
|
-
- **npm**: `>=10 <11`
|
|
22
|
-
- **Angular**: 19.2.x or later
|
|
23
|
-
- **Tailwind CSS**: v4.x
|
|
24
|
-
|
|
25
|
-
## Available Components
|
|
26
|
-
|
|
27
|
-
### General Components
|
|
28
|
-
|
|
29
|
-
| Component | Description | Documentation |
|
|
30
|
-
| ---------------- | ----------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
31
|
-
| Accordion | Expandable/collapsible content sections | [README](components/accordion/README.md) |
|
|
32
|
-
| Alert | Inline status callout with role per urgency | [README](components/alert/README.md) |
|
|
33
|
-
| Audio Player | Audio playback with track controls | [README](components/audio-player/README.md) |
|
|
34
|
-
| Avatar | User profile pictures with initials fallback | [README](components/avatar/README.md) |
|
|
35
|
-
| Badge | Status and label indicators | [README](components/badge/README.md) |
|
|
36
|
-
| Button | Interactive buttons with variants and sizes | [README](components/button/README.md) |
|
|
37
|
-
| Card | Compound content shell with contextual headers, sections, and divided footers | [README](components/card/README.md) |
|
|
38
|
-
| Countdown | Countdown timer with customizable formatting | [README](components/countdown/README.md) |
|
|
39
|
-
| Description List | Semantic responsive key/value grid for detail pages | [README](components/description-list/README.md) |
|
|
40
|
-
| Data Table | Advanced grid with sorting, filtering, pagination, row actions | [README](components/data-table/README.md) |
|
|
41
|
-
| Dialog | Modal dialogs with animations and positioning | [README](components/dialog/README.md) |
|
|
42
|
-
| Divider | Semantic divider with orientation, placement, and margin control | [README](components/divider/README.md) |
|
|
43
|
-
| Dropdown | Menu dropdown for actions and links | [README](components/dropdown/README.md) |
|
|
44
|
-
| Dropdown Menu | Advanced nested menu system | [README](components/dropdown-menu/README.md) |
|
|
45
|
-
| Dual List | Dual list selection for managing items | [README](components/dual-list/README.md) |
|
|
46
|
-
| Empty State | Illustration, heading, description and single CTA for empty areas | [README](components/empty-state/README.md) |
|
|
47
|
-
| File Upload | File uploader and dropzone entry point | [README](components/file-upload/README.md) |
|
|
48
|
-
| Icon | SVG icon component with ng-icons integration | [README](components/icon/README.md) |
|
|
49
|
-
| Link | Hyperlink component with router support | [README](components/link/README.md) |
|
|
50
|
-
| Notification | Toast-style notifications | [README](components/notification/README.md) |
|
|
51
|
-
| Overlay | Generic overlay with trigger and content | [README](components/overlay/README.md) |
|
|
52
|
-
| Paginator | Pagination controls for data | [README](components/paginator/README.md) |
|
|
53
|
-
| Product Card | Product display card with image and actions | [README](components/product-card/README.md) |
|
|
54
|
-
| Progress | Progress bar with variants | [README](components/progress/README.md) |
|
|
55
|
-
| Segmented Button | Single-choice radio group styled as a compact button bar | [README](components/segmented-button/README.md) |
|
|
56
|
-
| Sonner Toast | Modern toast notifications via ngx-sonner | [README](components/sonner/README.md) |
|
|
57
|
-
| Tab | Tabbed navigation interface | [README](components/tab/README.md) |
|
|
58
|
-
| Table | Data table with inline and dropdown row actions | [README](components/table/README.md) |
|
|
59
|
-
| Text | Polymorphic text component with semantic HTML tags | [README](components/text/README.md) |
|
|
60
|
-
| Tree | Single-select WAI-ARIA tree with filter, badges and node actions | [README](components/tree/README.md) |
|
|
61
|
-
| Tooltip | Floating tooltip with positioning | [README](components/tooltip/README.md) |
|
|
62
|
-
| Wizard | Multi-step wizard with validation | [README](components/wizard/README.md) |
|
|
63
|
-
|
|
64
|
-
### Form Components
|
|
65
|
-
|
|
66
|
-
| Component | Description | Documentation |
|
|
67
|
-
| ---------- | ------------------------------------------------------ | ------------------------------------------------ |
|
|
68
|
-
| Checkbox | Checkbox input with multiple variants | [README](components/forms/checkbox/README.md) |
|
|
69
|
-
| Combobox | Searchable dropdown with multi-select support | [README](components/forms/combobox/README.md) |
|
|
70
|
-
| Datepicker | Single and range date selection with time | [README](components/forms/date-picker/README.md) |
|
|
71
|
-
| Form Item | Layout wrapper for fields + full-width errors | [README](components/forms/form-item/README.md) |
|
|
72
|
-
| Form Hint | Field hint linked by aria-describedby, required legend | [README](components/forms/form-hint/README.md) |
|
|
73
|
-
| Form Error | Error message display for form fields | [README](components/forms/form-error/README.md) |
|
|
74
|
-
| Form Group | Vertical spacing helper for grouped fields | [README](components/forms/form-group/README.md) |
|
|
75
|
-
| Input | Text input with variants, icons, and validation | [README](components/forms/input/README.md) |
|
|
76
|
-
| Radio | Radio button group selection | [README](components/forms/radio/README.md) |
|
|
77
|
-
| Range | Slider input for numeric ranges | [README](components/forms/range/README.md) |
|
|
78
|
-
| Select | Dropdown select with object support | [README](components/forms/select/README.md) |
|
|
79
|
-
| Switch | Toggle switch for boolean values | [README](components/forms/switch/README.md) |
|
|
80
|
-
| Textarea | Multi-line text input with character count | [README](components/forms/textarea/README.md) |
|
|
81
|
-
| Toggle | Toggle button for boolean states | [README](components/forms/toggle/README.md) |
|
|
82
|
-
|
|
83
|
-
### Form field chrome (Select, Combobox, Dropdown)
|
|
84
|
-
|
|
85
|
-
Select and combobox use a DaisyUI `.select` field shell with three trailing pieces:
|
|
86
|
-
|
|
87
|
-
1. **Trigger** — one focusable `<button role="combobox">` owns keyboard access and overlay open/close.
|
|
88
|
-
2. **Clear** (optional) — sibling `btn-ghost btn-square` when `allowClear` is true; stays in tab order after the trigger and never nests inside it.
|
|
89
|
-
3. **Chevron** — custom Material icon in a `[data-st-chevron]` wrapper. DaisyUI's painted native triangles are hidden; rotation uses `transform` on the wrapper when the field carries `[data-open]`. Do not put Tailwind `rotate-*` on `st-icon`.
|
|
90
|
-
|
|
91
|
-
Overlays use position-aware fade animations (same model as dropdown) with a symmetric **4px** gap above or below the trigger.
|
|
92
|
-
|
|
93
|
-
Dropdown menus use `st-dropdown-chevron` inside the trigger content. The chevron host is `display: contents` so the rotate box centers vertically inside button triggers; rotation follows the trigger's `[aria-expanded]`.
|
|
94
|
-
|
|
95
|
-
See [docs/ui-kit-trigger-clear-chevron/spec.md](../../docs/ui-kit-trigger-clear-chevron/spec.md) for the full contract.
|
|
96
|
-
|
|
97
|
-
### Form Errors Layout
|
|
98
|
-
|
|
99
|
-
For full-width validation messages, wrap each field and its error with `st-form-item` and place `st-form-errors` as a sibling (not inside the field component).
|
|
3
|
+

|
|
100
4
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Migration notes: `projects/sdk/components/forms/form-error/MIGRATION.md`
|
|
109
|
-
|
|
110
|
-
### Optional Label Indicator
|
|
5
|
+
[](https://www.npmjs.com/package/@sixbell-telco/sdk)
|
|
6
|
+
[](https://www.npmjs.com/package/@sixbell-telco/sdk)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
[](https://fantastic-broccoli-8lj2gke.pages.github.io/)
|
|
111
10
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```html
|
|
115
|
-
<st-input label="Email" [showOptional]="true" [optionalText]="'sdk.formFields.optional'"></st-input>
|
|
116
|
-
```
|
|
11
|
+
Angular component library of the Enghouse Networks UI Kit: 25+ production-ready UI components, directives and services built with Angular 19 signals, Tailwind CSS v4 and DaisyUI 5. The built-in visual identity is **Enghouse Networks** (`enghouse_networks`).
|
|
117
12
|
|
|
118
|
-
|
|
13
|
+
- **Components**: button, card, form controls, data table, dialog, dropdown, wizard and more.
|
|
14
|
+
- **Services**: runtime theme, i18n translation, logger, runtime config and locale-aware formatting.
|
|
15
|
+
- **Directives**: text, truncate, auto-focus, click-outside and only-numbers.
|
|
16
|
+
- **One entry point per feature**, so you import only what you use.
|
|
119
17
|
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
"sdk": {
|
|
123
|
-
"formFields": {
|
|
124
|
-
"optional": "Optional"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
```
|
|
18
|
+
## Compatibility
|
|
129
19
|
|
|
130
|
-
|
|
20
|
+
| Requirement | Version |
|
|
21
|
+
| ------------ | --------------- |
|
|
22
|
+
| Angular | 19.2.x |
|
|
23
|
+
| Tailwind CSS | 4.x |
|
|
24
|
+
| DaisyUI | 5.x |
|
|
25
|
+
| Node.js | 22 (`^22.0.0`) |
|
|
26
|
+
| npm | 10 (`>=10 <11`) |
|
|
131
27
|
|
|
132
|
-
|
|
133
|
-
| ------------------- | -------------------------------------------------- | -------------------------------- |
|
|
134
|
-
| Logger Service | Theme-aware logging with IndexedDB persistence | [README](utils/logger/) |
|
|
135
|
-
| Unsaved Changes | canDeactivate guard + beforeunload helper | [README](utils/unsaved-changes/) |
|
|
136
|
-
| Theme Service | Runtime theme management with multi-tenant support | [README](utils/theme/) |
|
|
137
|
-
| Translation Service | Multi-language i18n with ngx-translate integration | [README](utils/translation/) |
|
|
138
|
-
| Formatting Service | Reactive locale-aware formatting utilities | [README](utils/formatting/) |
|
|
139
|
-
| Runtime Config | Last-known-good runtime config loader | [README](utils/runtime-config/) |
|
|
28
|
+
The SDK is built and verified against the peer ranges declared in `package.json`: `@angular/core` `~19.2.25`, `daisyui` `~5.7.47`, `tailwindcss` `~4.3.3`, `@tailwindcss/postcss` `~4.3.3`, `postcss` `~8.5.29`, `@tailwindcss/typography` `~0.5.20` and the remaining peer dependencies. Install at least these versions.
|
|
140
29
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
| Directive | Purpose |
|
|
144
|
-
| ------------- | ----------------------------------------------------- |
|
|
145
|
-
| auto-focus | Auto-focus elements when visible |
|
|
146
|
-
| click-outside | Detect clicks outside an element |
|
|
147
|
-
| only-numbers | Restrict input to numeric values only |
|
|
148
|
-
| text | Apply preset-based typography with line-clamp support |
|
|
149
|
-
| truncate | Ellipsis with a full-text popover only when cut off |
|
|
150
|
-
|
|
151
|
-
## Installation
|
|
152
|
-
|
|
153
|
-
### Step 1: Install Dependencies
|
|
30
|
+
## Install
|
|
154
31
|
|
|
155
32
|
```bash
|
|
156
33
|
npm install @sixbell-telco/sdk @tailwindcss/typography daisyui tailwind-animations
|
|
157
34
|
```
|
|
158
35
|
|
|
159
|
-
|
|
36
|
+
The other peer dependencies (Angular CDK, ng-icons, ngx-translate, Dexie and so on) are listed in the package `peerDependencies`; npm 7+ installs them for you.
|
|
160
37
|
|
|
161
|
-
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
### 1. Import the SDK styles
|
|
41
|
+
|
|
42
|
+
In your global `styles.css`, import the SDK stylesheet **before** Tailwind. `@source` tells Tailwind where to look for classes.
|
|
162
43
|
|
|
163
44
|
```css
|
|
164
45
|
@import '../node_modules/@sixbell-telco/sdk/_index.css';
|
|
@@ -168,11 +49,7 @@ In your global `styles.css`:
|
|
|
168
49
|
@source '../src';
|
|
169
50
|
```
|
|
170
51
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
### Step 3: Configure Microfrontend (if applicable)
|
|
174
|
-
|
|
175
|
-
Add path mapping to `tsconfig.json`:
|
|
52
|
+
Microfrontends only: add the path mapping to `tsconfig.json`.
|
|
176
53
|
|
|
177
54
|
```json
|
|
178
55
|
{
|
|
@@ -184,437 +61,178 @@ Add path mapping to `tsconfig.json`:
|
|
|
184
61
|
}
|
|
185
62
|
```
|
|
186
63
|
|
|
187
|
-
###
|
|
188
|
-
|
|
189
|
-
Install the Tailwind CSS extension and add to `.vscode/settings.json`:
|
|
190
|
-
|
|
191
|
-
```json
|
|
192
|
-
{
|
|
193
|
-
"editor.quickSuggestions": {
|
|
194
|
-
"strings": "on"
|
|
195
|
-
},
|
|
196
|
-
"files.associations": {
|
|
197
|
-
"*.css": "tailwindcss"
|
|
198
|
-
},
|
|
199
|
-
"tailwindCSS.classFunctions": ["tw", "clsx", "cva", "cn", "tw\\.[a-z-]+"]
|
|
200
|
-
}
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
These settings improve your development experience:
|
|
204
|
-
|
|
205
|
-
- `editor.quickSuggestions`: Enables autosuggestions within string literals
|
|
206
|
-
- `files.associations`: Ensures CSS files are treated as Tailwind CSS files
|
|
207
|
-
- `tailwindCSS.classFunctions`: Enables Tailwind intellisense in utility functions like `tw()`, `clsx()`, and `cva()`, etc that are used for conditional class name composition
|
|
208
|
-
|
|
209
|
-
With these settings, VSCode will provide class autocompletion for the library's custom attributes and utility functions.
|
|
210
|
-
|
|
211
|
-
## Themes and translation configuration (an optional Logger)
|
|
212
|
-
|
|
213
|
-
Configure all services using runtime providers in your `app.config.ts`. This approach loads configuration from JSON files at runtime, eliminating the need to recompile when updating themes or languages.
|
|
214
|
-
|
|
215
|
-
### Logger Service Setup
|
|
216
|
-
|
|
217
|
-
Configure logging with different levels for development and production:
|
|
218
|
-
|
|
219
|
-
```typescript
|
|
220
|
-
import { provideLogger } from '@sixbell-telco/sdk/utils/logger';
|
|
221
|
-
|
|
222
|
-
export const appConfig: ApplicationConfig = {
|
|
223
|
-
providers: [
|
|
224
|
-
provideLogger({
|
|
225
|
-
enableLogging: true,
|
|
226
|
-
logLevel: isDevMode() ? 'debug' : 'warn', // trace | debug | info | warn | error | fatal
|
|
227
|
-
showTimestamp: true,
|
|
228
|
-
persistToIndexedDB: true, // Persistent storage for debugging
|
|
229
|
-
silentMode: !isDevMode(),
|
|
230
|
-
}),
|
|
231
|
-
],
|
|
232
|
-
};
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Translation Service Setup
|
|
64
|
+
### 2. Register the providers
|
|
236
65
|
|
|
237
|
-
|
|
66
|
+
Theme and translation load from JSON files at runtime, so updating them needs no rebuild. A complete `app.config.ts`:
|
|
238
67
|
|
|
239
68
|
```typescript
|
|
240
|
-
import { provideRuntimeTranslation } from '@sixbell-telco/sdk/utils/translation';
|
|
241
|
-
|
|
242
|
-
export const appConfig: ApplicationConfig = {
|
|
243
|
-
providers: [provideRuntimeTranslation('/assets/translation/translation.json')],
|
|
244
|
-
};
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
The `translation.json` file defines available languages and their translation paths:
|
|
248
|
-
|
|
249
|
-
```json
|
|
250
|
-
{
|
|
251
|
-
"meta": {
|
|
252
|
-
"updatedAt": "2026-02-02T00:00:00Z",
|
|
253
|
-
"hash": "showcase-translations-v2",
|
|
254
|
-
"schemaVersion": "3"
|
|
255
|
-
},
|
|
256
|
-
"additionalLanguages": [],
|
|
257
|
-
"defaultLang": "es",
|
|
258
|
-
"excludeLanguages": [],
|
|
259
|
-
"translationPaths": ["/assets/i18n/", "/assets/i18n/sdk/", "/assets/themes/i18n"],
|
|
260
|
-
"locale": {
|
|
261
|
-
"defaultLocale": "en-US",
|
|
262
|
-
"languageToLocale": {
|
|
263
|
-
"en": "en-US",
|
|
264
|
-
"es": "es-CL",
|
|
265
|
-
"pt": "pt-BR"
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
### Theme Service Setup
|
|
272
|
-
|
|
273
|
-
The Theme Service loads theme configuration from a runtime JSON file:
|
|
274
|
-
|
|
275
|
-
```typescript
|
|
276
|
-
import { provideRuntimeTheme } from '@sixbell-telco/sdk/utils/theme';
|
|
277
|
-
|
|
278
|
-
export const appConfig: ApplicationConfig = {
|
|
279
|
-
providers: [provideRuntimeTheme('/assets/themes/themes.json')],
|
|
280
|
-
};
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
The `themes.json` file defines available themes and their variants:
|
|
284
|
-
|
|
285
|
-
```json
|
|
286
|
-
{
|
|
287
|
-
"meta": {
|
|
288
|
-
"updatedAt": "2026-02-02T00:00:00Z",
|
|
289
|
-
"hash": "showcase-themes-v1",
|
|
290
|
-
"schemaVersion": "3"
|
|
291
|
-
},
|
|
292
|
-
"themes": ["/assets/themes/catalog/enghouse_networks.json", "/assets/themes/catalog/wom.json"],
|
|
293
|
-
"defaultTheme": "enghouse_networks",
|
|
294
|
-
"defaultScheme": "system",
|
|
295
|
-
"excludeThemes": []
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Complete Configuration Example
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
// app.config.ts
|
|
303
69
|
import { ApplicationConfig, isDevMode } from '@angular/core';
|
|
304
|
-
import { provideRouter } from '@angular/router';
|
|
305
70
|
import { provideHttpClient } from '@angular/common/http';
|
|
71
|
+
import { provideRouter } from '@angular/router';
|
|
306
72
|
import { provideLogger } from '@sixbell-telco/sdk/utils/logger';
|
|
307
73
|
import { provideRuntimeTheme } from '@sixbell-telco/sdk/utils/theme';
|
|
308
74
|
import { provideRuntimeTranslation } from '@sixbell-telco/sdk/utils/translation';
|
|
309
|
-
import {
|
|
310
|
-
import { switchMap } from 'rxjs/operators';
|
|
311
|
-
|
|
312
|
-
const runtimeUpdateStream$ = timer(0, environment.runtime.pollIntervalMs).pipe(
|
|
313
|
-
switchMap(() => from(fetch(`${environment.runtime.apiBaseUrl}/api/runtime/updates/poll`))),
|
|
314
|
-
switchMap((response) => from(response.json())),
|
|
315
|
-
);
|
|
75
|
+
import { routes } from './app.routes';
|
|
316
76
|
|
|
317
77
|
export const appConfig: ApplicationConfig = {
|
|
318
78
|
providers: [
|
|
319
79
|
provideRouter(routes),
|
|
320
80
|
provideHttpClient(),
|
|
81
|
+
// Optional logger
|
|
321
82
|
provideLogger({
|
|
322
83
|
enableLogging: isDevMode(),
|
|
323
|
-
logLevel: isDevMode() ? 'debug' : 'warn',
|
|
84
|
+
logLevel: isDevMode() ? 'debug' : 'warn', // trace | debug | info | warn | error | fatal
|
|
324
85
|
showTimestamp: true,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
idbRetentionDays: 7,
|
|
328
|
-
idbMaxLogs: 5000,
|
|
329
|
-
silentMode: !isDevMode(),
|
|
86
|
+
persistToIndexedDB: true, // keep logs in IndexedDB (idbRetentionDays: 7, idbMaxLogs: 5000 by default)
|
|
87
|
+
silentMode: !isDevMode(), // store without console output
|
|
330
88
|
}),
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
if (mode === 'default') {
|
|
335
|
-
return [provideRuntimeTranslation('/assets/translation/translation.json'), provideRuntimeTheme('/assets/themes/themes.json')];
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
if (mode === 'stream' && environment.runtime.enableStream) {
|
|
339
|
-
return [
|
|
340
|
-
provideRuntimeTranslation(`${environment.runtime.apiBaseUrl}/api/runtime/translation/config`, {
|
|
341
|
-
updateStream: runtimeUpdateStream$,
|
|
342
|
-
}),
|
|
343
|
-
provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
|
|
344
|
-
updateStream: runtimeUpdateStream$,
|
|
345
|
-
}),
|
|
346
|
-
];
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return [
|
|
350
|
-
provideRuntimeTranslation(`${environment.runtime.apiBaseUrl}/api/runtime/translation/config`, {
|
|
351
|
-
sse: {
|
|
352
|
-
url: `${environment.runtime.apiBaseUrl}/api/runtime/updates?resource=translation`,
|
|
353
|
-
eventType: 'message',
|
|
354
|
-
},
|
|
355
|
-
}),
|
|
356
|
-
provideRuntimeTheme(`${environment.runtime.apiBaseUrl}/api/runtime/theme/config`, {
|
|
357
|
-
sse: {
|
|
358
|
-
url: `${environment.runtime.apiBaseUrl}/api/runtime/updates?resource=theme`,
|
|
359
|
-
eventType: 'message',
|
|
360
|
-
},
|
|
361
|
-
}),
|
|
362
|
-
];
|
|
363
|
-
})(),
|
|
89
|
+
provideRuntimeTranslation('/assets/translation/translation.json'),
|
|
90
|
+
provideRuntimeTheme('/assets/themes/themes.json'),
|
|
364
91
|
],
|
|
365
92
|
};
|
|
366
93
|
```
|
|
367
94
|
|
|
368
|
-
|
|
95
|
+
Both runtime providers take an optional second argument for live updates: `{ sse: { url, eventType: 'message' } }` for server-sent events or `{ updateStream: observable$ }` for polling or a custom stream. With neither, the files are read at startup. The last good config is cached in IndexedDB, and the user's language, theme and scheme are restored on the next visit. Create the two JSON files described under Themes and Translations below before you start the app.
|
|
369
96
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
```html
|
|
373
|
-
{{ createdAt | stDate:'DD/MM/YYYY HH:mm:ss' }} {{ total | stDecimal:'1.0-2' }} {{ amount | stCurrency:'CLP':'symbol':'1.0-0' }} {{ ratio |
|
|
374
|
-
stPercent:'1.0-2' }}
|
|
375
|
-
```
|
|
97
|
+
### 3. Use a component
|
|
376
98
|
|
|
377
99
|
```typescript
|
|
378
|
-
import { Component
|
|
379
|
-
import {
|
|
100
|
+
import { Component } from '@angular/core';
|
|
101
|
+
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
380
102
|
|
|
381
103
|
@Component({
|
|
382
|
-
selector: 'app-
|
|
383
|
-
|
|
104
|
+
selector: 'app-example',
|
|
105
|
+
imports: [ButtonComponent],
|
|
106
|
+
template: `<st-button variant="primary">Save changes</st-button>`,
|
|
384
107
|
})
|
|
385
|
-
export class
|
|
386
|
-
|
|
108
|
+
export class ExampleComponent {}
|
|
109
|
+
```
|
|
387
110
|
|
|
388
|
-
|
|
111
|
+
## Entry-point imports
|
|
389
112
|
|
|
390
|
-
|
|
391
|
-
this.formatting.formatCurrency(this.amount, 'CLP', {
|
|
392
|
-
display: 'symbol',
|
|
393
|
-
digitsInfo: '1.0-0',
|
|
394
|
-
}),
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
```
|
|
113
|
+
Every component, directive and util is its own entry point. Import from the entry point, never from the package root:
|
|
398
114
|
|
|
399
|
-
|
|
115
|
+
```typescript
|
|
116
|
+
// Correct
|
|
117
|
+
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
118
|
+
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
400
119
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
- **Hot Updates**: Changes to `themes.json` and `translation.json` take effect immediately
|
|
405
|
-
- **Persistent Preferences**: User language and theme preferences are stored and restored automatically
|
|
120
|
+
// Avoid: the root barrel
|
|
121
|
+
import { ButtonComponent } from '@sixbell-telco/sdk';
|
|
122
|
+
```
|
|
406
123
|
|
|
407
|
-
|
|
124
|
+
The pattern is `@sixbell-telco/sdk/components/<name>` (form controls: `@sixbell-telco/sdk/components/forms/<name>`, services: `@sixbell-telco/sdk/utils/<name>`, directives: `@sixbell-telco/sdk/directives/<name>`). Components use the `st-` selector prefix and signal-based inputs.
|
|
408
125
|
|
|
409
|
-
Themes
|
|
126
|
+
## Themes
|
|
410
127
|
|
|
411
|
-
|
|
412
|
-
- **Multi-Tenant Support**: Different themes per deployment
|
|
413
|
-
- **Dynamic Assets**: Brand-specific logos and images per theme
|
|
414
|
-
- **Runtime Fonts**: Load custom fonts for each theme
|
|
415
|
-
- **Hot Updates**: Changes take effect immediately
|
|
128
|
+
Themes are runtime JSON files. `ThemeService` applies and persists the user's choice, and each theme can bring its own logos, illustrations and fonts.
|
|
416
129
|
|
|
417
|
-
###
|
|
130
|
+
### `themes.json`
|
|
418
131
|
|
|
419
|
-
|
|
132
|
+
Serve it at the path you gave `provideRuntimeTheme()`, for example `src/assets/themes/themes.json`:
|
|
420
133
|
|
|
421
134
|
```json
|
|
422
135
|
{
|
|
423
|
-
"meta": {
|
|
424
|
-
|
|
425
|
-
"hash": "showcase-themes-v1",
|
|
426
|
-
"schemaVersion": "3"
|
|
427
|
-
},
|
|
428
|
-
"themes": ["/assets/themes/catalog/enghouse_networks.json", "/assets/themes/catalog/wom.json"],
|
|
136
|
+
"meta": { "updatedAt": "2026-02-02T00:00:00Z", "hash": "my-app-themes-v1", "schemaVersion": "3" },
|
|
137
|
+
"themes": ["/assets/themes/catalog/enghouse_networks.json", "/assets/themes/catalog/acme.json"],
|
|
429
138
|
"defaultTheme": "enghouse_networks",
|
|
430
139
|
"defaultScheme": "system",
|
|
431
140
|
"excludeThemes": []
|
|
432
141
|
}
|
|
433
142
|
```
|
|
434
143
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
- `
|
|
438
|
-
- `
|
|
439
|
-
- `
|
|
440
|
-
|
|
441
|
-
### 2. Define DaisyUI Themes in Global Styles
|
|
144
|
+
- `meta.hash` and `meta.schemaVersion` (`"3"`) are required. Change the hash whenever a theme file changes, so clients drop their cached copy.
|
|
145
|
+
- `themes` (required): URL of each theme catalog file. The theme's key is the `meta.name` inside that file.
|
|
146
|
+
- `defaultTheme`: theme used until the user picks one.
|
|
147
|
+
- `defaultScheme`: `system`, `light` or `dark`. `system` follows the OS preference.
|
|
148
|
+
- `excludeThemes`: theme keys to hide without deleting their files.
|
|
442
149
|
|
|
443
|
-
|
|
150
|
+
### Add a custom theme
|
|
444
151
|
|
|
445
|
-
|
|
446
|
-
@import '../node_modules/@sixbell-telco/sdk/_index.css';
|
|
447
|
-
|
|
448
|
-
@import 'tailwindcss';
|
|
449
|
-
|
|
450
|
-
@source '../src';
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
### 3. Use Themes in Components
|
|
454
|
-
|
|
455
|
-
The ThemeService automatically loads available themes from `themes.json`:
|
|
456
|
-
|
|
457
|
-
```typescript
|
|
458
|
-
import { Component, ChangeDetectionStrategy, inject, computed } from '@angular/core';
|
|
459
|
-
import { ThemeService, ThemeAssetsService } from '@sixbell-telco/sdk/utils/theme';
|
|
460
|
-
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
461
|
-
import { CommonModule } from '@angular/common';
|
|
462
|
-
|
|
463
|
-
@Component({
|
|
464
|
-
selector: 'app-theme-switcher',
|
|
465
|
-
standalone: true,
|
|
466
|
-
imports: [CommonModule, ButtonComponent],
|
|
467
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
468
|
-
template: `
|
|
469
|
-
<div>
|
|
470
|
-
<select (change)="themeService.setTheme($event.target.value)">
|
|
471
|
-
@for (theme of themeService.getAvailableThemes(); track theme) {
|
|
472
|
-
<option [value]="theme" [selected]="themeService.selectedTheme() === theme">
|
|
473
|
-
{{ themeService.getLocalizedThemeName(theme) }}
|
|
474
|
-
</option>
|
|
475
|
-
}
|
|
476
|
-
</select>
|
|
477
|
-
|
|
478
|
-
<select (change)="themeService.setScheme($event.target.value)">
|
|
479
|
-
@for (scheme of themeService.getAvailableSchemes(); track scheme) {
|
|
480
|
-
<option [value]="scheme" [selected]="themeService.selectedScheme() === scheme">
|
|
481
|
-
{{ themeService.getLocalizedSchemeName(scheme) }}
|
|
482
|
-
</option>
|
|
483
|
-
}
|
|
484
|
-
</select>
|
|
485
|
-
|
|
486
|
-
<img [src]="logoUrl()" alt="Brand Logo" />
|
|
487
|
-
</div>
|
|
488
|
-
`,
|
|
489
|
-
})
|
|
490
|
-
export class ThemeSwitcherComponent {
|
|
491
|
-
themeService = inject(ThemeService);
|
|
492
|
-
private assetsService = inject(ThemeAssetsService);
|
|
493
|
-
|
|
494
|
-
logoUrl = computed(
|
|
495
|
-
() => this.assetsService.getAssetUrl(this.themeService.selectedTheme(), 'logo', this.themeService.resolvedScheme()) || '/default-logo.svg',
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### 4. Add Theme Names to Translations
|
|
501
|
-
|
|
502
|
-
Store theme and scheme display names in translation files. Create `/assets/themes/i18n/en.json`:
|
|
503
|
-
|
|
504
|
-
**English (`en.json`):**
|
|
152
|
+
Create a catalog file such as `/assets/themes/catalog/acme.json` and add its path to `themes`. Both `light` and `dark` are required, and each needs a `variables` object with the `colors`, `radius`, `sizes`, `effects` and `others` groups (empty groups are fine). Every entry becomes a CSS custom property on the theme. `fonts` and `assets` are optional.
|
|
505
153
|
|
|
506
154
|
```json
|
|
507
155
|
{
|
|
508
|
-
"
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
"
|
|
516
|
-
"
|
|
517
|
-
"
|
|
156
|
+
"meta": { "name": "acme", "updatedAt": "2026-02-02T00:00:00Z", "hash": "acme-theme-v1", "schemaVersion": "3" },
|
|
157
|
+
"fonts": [{ "family": "Acme Sans", "faces": [{ "weight": 400, "style": "normal", "src": "/assets/fonts/AcmeSans-Regular.woff2" }] }],
|
|
158
|
+
"themes": {
|
|
159
|
+
"light": {
|
|
160
|
+
"variables": {
|
|
161
|
+
"colors": { "--color-primary": "oklch(70% 0.1 220)" },
|
|
162
|
+
"radius": {},
|
|
163
|
+
"sizes": {},
|
|
164
|
+
"effects": {},
|
|
165
|
+
"others": { "--font-body": "Acme Sans, sans-serif" }
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"dark": {
|
|
169
|
+
"variables": {
|
|
170
|
+
"colors": { "--color-primary": "oklch(65% 0.1 220)" },
|
|
171
|
+
"radius": {},
|
|
172
|
+
"sizes": {},
|
|
173
|
+
"effects": {},
|
|
174
|
+
"others": { "--font-body": "Acme Sans, sans-serif" }
|
|
518
175
|
}
|
|
519
176
|
}
|
|
520
|
-
}
|
|
177
|
+
},
|
|
178
|
+
"assets": [{ "name": "logo", "light": "/assets/logos/acme_light.svg", "dark": "/assets/logos/acme_dark.svg" }]
|
|
521
179
|
}
|
|
522
180
|
```
|
|
523
181
|
|
|
524
|
-
|
|
182
|
+
- `meta.name`, `meta.hash`, `meta.updatedAt` and `meta.schemaVersion` are required. Change `meta.hash` on every edit.
|
|
183
|
+
- Tokens you add under `others` (or any token that is new to the SDK) need a matching entry in an `@theme { ... }` block of your global CSS before Tailwind generates utility classes for them.
|
|
184
|
+
- Read an asset with `ThemeAssetsService.getAssetUrl(themeService.selectedTheme(), 'logo', themeService.resolvedScheme())`.
|
|
185
|
+
- Display names come from translations: `sdk.theme.catalog.<name>` for themes and `sdk.theme.schemes.<scheme>` for schemes (for example `{ "sdk": { "theme": { "catalog": { "acme": "Acme" } } } }`). Without a key, the name is derived from the theme key.
|
|
525
186
|
|
|
526
|
-
|
|
527
|
-
{
|
|
528
|
-
"sdk": {
|
|
529
|
-
"theme": {
|
|
530
|
-
"catalog": {
|
|
531
|
-
"enghouse_networks": "Enghouse Networks",
|
|
532
|
-
"wom": "Wom"
|
|
533
|
-
},
|
|
534
|
-
"schemes": {
|
|
535
|
-
"system": "Sistema",
|
|
536
|
-
"light": "Claro",
|
|
537
|
-
"dark": "Oscuro"
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
```
|
|
187
|
+
Switch the scheme from a component:
|
|
543
188
|
|
|
544
|
-
|
|
189
|
+
```typescript
|
|
190
|
+
import { Component, inject } from '@angular/core';
|
|
191
|
+
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
545
192
|
|
|
546
|
-
|
|
547
|
-
{
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
"enghouse_networks": "Enghouse Networks",
|
|
552
|
-
"wom": "Wom"
|
|
553
|
-
},
|
|
554
|
-
"schemes": {
|
|
555
|
-
"system": "Sistema",
|
|
556
|
-
"light": "Claro",
|
|
557
|
-
"dark": "Escuro"
|
|
558
|
-
}
|
|
559
|
-
}
|
|
193
|
+
@Component({ selector: 'app-theme-toggle', template: `<button (click)="toggle()">{{ theme.selectedTheme() }}</button>` })
|
|
194
|
+
export class ThemeToggleComponent {
|
|
195
|
+
theme = inject(ThemeService);
|
|
196
|
+
toggle() {
|
|
197
|
+
this.theme.setScheme(this.theme.isDarkTheme() ? 'light' : 'dark');
|
|
560
198
|
}
|
|
561
199
|
}
|
|
562
200
|
```
|
|
563
201
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
- Loads theme definitions from `themes.json`
|
|
567
|
-
- Injects CSS variables via signals
|
|
568
|
-
- Resolves dynamic assets based on current theme and scheme
|
|
569
|
-
- Persists user preferences to localStorage
|
|
570
|
-
- Detects system dark mode preference when scheme is set to `'system'`
|
|
202
|
+
Other `ThemeService` members: `setTheme(name)`, `selectedScheme()`, `resolvedScheme()` (`light` or `dark`), `getAvailableThemes()`, `getAvailableSchemes()`, `getLocalizedThemeName(name)` and `getLocalizedSchemeName(scheme)`.
|
|
571
203
|
|
|
572
|
-
##
|
|
204
|
+
## Translations
|
|
573
205
|
|
|
574
|
-
Languages are
|
|
206
|
+
Languages are runtime JSON files too. The built-in languages are `en`, `es` and `pt`.
|
|
575
207
|
|
|
576
|
-
|
|
577
|
-
- **Multi-Tenant Languages**: Different language sets per deployment environment
|
|
578
|
-
- **Hot Updates**: Changes to translation configuration take effect immediately
|
|
579
|
-
- **Flexible Structure**: Organize translation files any way you need
|
|
208
|
+
### `translation.json`
|
|
580
209
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
Create `/assets/translation/translation.json` in your application:
|
|
210
|
+
Serve it at the path you gave `provideRuntimeTranslation()`, for example `src/assets/translation/translation.json`:
|
|
584
211
|
|
|
585
212
|
```json
|
|
586
213
|
{
|
|
587
|
-
"meta": {
|
|
588
|
-
"updatedAt": "2026-02-02T00:00:00Z",
|
|
589
|
-
"hash": "showcase-translations-v2",
|
|
590
|
-
"schemaVersion": "3"
|
|
591
|
-
},
|
|
214
|
+
"meta": { "updatedAt": "2026-02-02T00:00:00Z", "hash": "my-app-translations-v1", "schemaVersion": "3" },
|
|
592
215
|
"additionalLanguages": [],
|
|
593
216
|
"defaultLang": "es",
|
|
594
217
|
"excludeLanguages": [],
|
|
595
|
-
"translationPaths": ["/assets/i18n/
|
|
218
|
+
"translationPaths": ["/assets/i18n/sdk/", "/assets/i18n/"],
|
|
596
219
|
"locale": {
|
|
597
220
|
"defaultLocale": "en-US",
|
|
598
|
-
"languageToLocale": {
|
|
599
|
-
"en": "en-US",
|
|
600
|
-
"es": "es-CL",
|
|
601
|
-
"pt": "pt-BR"
|
|
602
|
-
}
|
|
221
|
+
"languageToLocale": { "en": "en-US", "es": "es-CL", "pt": "pt-BR" }
|
|
603
222
|
}
|
|
604
223
|
}
|
|
605
224
|
```
|
|
606
225
|
|
|
607
|
-
|
|
226
|
+
- `meta.hash` and `meta.schemaVersion` (`"3"`) are required. Change the hash whenever a translation file changes, so clients reload it.
|
|
227
|
+
- `defaultLang`: language used until the user picks one. It must be available (built-in plus `additionalLanguages`, minus `excludeLanguages`).
|
|
228
|
+
- `additionalLanguages`: extra languages as `{ "code": "de", "name": "Deutsch" }`.
|
|
229
|
+
- `excludeLanguages`: built-in codes to hide, for example `["pt"]`.
|
|
230
|
+
- `translationPaths`: folders that each hold one `{lang}.json` per language. All of them are loaded and deep-merged in order, and later paths win, so put your own folder after `/assets/i18n/sdk/` to override an `sdk.*` label.
|
|
231
|
+
- `locale.languageToLocale`: the locale each language uses for the SDK formatting pipes and `FormattingService`; `locale.defaultLocale` is the fallback.
|
|
608
232
|
|
|
609
|
-
|
|
610
|
-
- `translationPaths`: list of directories that contain `{lang}.json`
|
|
611
|
-
- `additionalLanguages`: extra languages beyond the built-in SDK defaults
|
|
612
|
-
- `excludeLanguages`: built-in languages to remove from the available list
|
|
613
|
-
- `locale.languageToLocale`: mapping used by `FormattingService` and the formatting pipes
|
|
233
|
+
### SDK labels
|
|
614
234
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
The package ships the SDK bundles at `@sixbell-telco/sdk/i18n/sdk/{en,es,pt}.json`. Serve them from `node_modules` with an asset glob in the application's `angular.json` build options, instead of copying them into the app:
|
|
235
|
+
The SDK ships its own labels for English, Spanish and Portuguese at `@sixbell-telco/sdk/i18n/sdk/{en,es,pt}.json`. Serve them from `node_modules` with an asset glob in your `angular.json`, and keep `/assets/i18n/sdk/` in `translationPaths`:
|
|
618
236
|
|
|
619
237
|
```json
|
|
620
238
|
"assets": [
|
|
@@ -623,871 +241,50 @@ The package ships the SDK bundles at `@sixbell-telco/sdk/i18n/sdk/{en,es,pt}.jso
|
|
|
623
241
|
]
|
|
624
242
|
```
|
|
625
243
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
### 3. Create Translation Files
|
|
629
|
-
|
|
630
|
-
Create your application's translation files at the other paths defined in `translation.json`. The SDK bundles above have this structure, shown here for reference:
|
|
631
|
-
|
|
632
|
-
**English (`/assets/i18n/sdk/en.json`):**
|
|
633
|
-
|
|
634
|
-
```json
|
|
635
|
-
{
|
|
636
|
-
"sdk": {
|
|
637
|
-
"fileUpload": {
|
|
638
|
-
"dropzone": {
|
|
639
|
-
"selectPrompt": "Click to select files or drag and drop here",
|
|
640
|
-
"maxSizeLabel": "Max size:",
|
|
641
|
-
"allowedTypesLabel": "Allowed types:",
|
|
642
|
-
"invalidFileType": "Invalid file type",
|
|
643
|
-
"fileTooLarge": "File too large",
|
|
644
|
-
"fileCounter": "{{current}} of {{max}} files",
|
|
645
|
-
"maxFilesExceeded": "Maximum {{max}} file(s) allowed",
|
|
646
|
-
"noValidFiles": "No valid files selected",
|
|
647
|
-
"fileActions": {
|
|
648
|
-
"play": "Play audio",
|
|
649
|
-
"pause": "Pause audio",
|
|
650
|
-
"download": "Download file",
|
|
651
|
-
"remove": "Remove file"
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
"fileUploader": {
|
|
655
|
-
"allowedTypesLabel": "Allowed types:"
|
|
656
|
-
}
|
|
657
|
-
},
|
|
658
|
-
"audioPlayer": {
|
|
659
|
-
"trackListTitle": "Tracks",
|
|
660
|
-
"trackInfo": {
|
|
661
|
-
"title": "No title",
|
|
662
|
-
"description": "No description"
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
"countdown": {
|
|
666
|
-
"days": "Days",
|
|
667
|
-
"hours": "Hours",
|
|
668
|
-
"minutes": "Minutes",
|
|
669
|
-
"seconds": "Seconds"
|
|
670
|
-
},
|
|
671
|
-
"dualList": {
|
|
672
|
-
"searchPlaceHolder": "Search"
|
|
673
|
-
},
|
|
674
|
-
"combobox": {
|
|
675
|
-
"searchPlaceholder": "Search",
|
|
676
|
-
"placeholder": "Select",
|
|
677
|
-
"noResultsFound": "No results found",
|
|
678
|
-
"clearAll": "Clear All",
|
|
679
|
-
"clearSelection": "Clear selection",
|
|
680
|
-
"searchOptions": "Search options",
|
|
681
|
-
"loading": "Loading..."
|
|
682
|
-
},
|
|
683
|
-
"select": {
|
|
684
|
-
"placeholder": "Select"
|
|
685
|
-
},
|
|
686
|
-
"formErrors": {
|
|
687
|
-
"validation": {
|
|
688
|
-
"required": "*This field is required",
|
|
689
|
-
"email": "*Please enter a valid email address",
|
|
690
|
-
"minLength": "*Must be at least {{min}} characters",
|
|
691
|
-
"maxLength": "*Must be no more than {{max}} characters",
|
|
692
|
-
"min": "*Value must be at least {{min}}",
|
|
693
|
-
"max": "*Value must be no more than {{max}}",
|
|
694
|
-
"pattern": "*Invalid format",
|
|
695
|
-
"unhandledError": "*Unhandled error"
|
|
696
|
-
}
|
|
697
|
-
},
|
|
698
|
-
"formFields": {
|
|
699
|
-
"optional": "Optional"
|
|
700
|
-
},
|
|
701
|
-
"textarea": {
|
|
702
|
-
"maxCharacters": "{{current}} of {{max}} characters"
|
|
703
|
-
},
|
|
704
|
-
"table": {
|
|
705
|
-
"entriesByPage": "Entries per page",
|
|
706
|
-
"perPage": "{{count}} / page",
|
|
707
|
-
"totalEntries": "{{total}} entries",
|
|
708
|
-
"entriesRange": "{{range}} of {{total}} entries",
|
|
709
|
-
"emptyListMessage": "No items to show",
|
|
710
|
-
"noData": {
|
|
711
|
-
"title": "No data available",
|
|
712
|
-
"message": "There are no records to display at this time."
|
|
713
|
-
},
|
|
714
|
-
"noResults": {
|
|
715
|
-
"title": "No results found",
|
|
716
|
-
"message": "Try adjusting your search criteria"
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
"dataTable": {
|
|
720
|
-
"entriesByPage": "Entries per page",
|
|
721
|
-
"perPage": "{{count}} / page",
|
|
722
|
-
"totalEntries": "{{total}} entries",
|
|
723
|
-
"entriesRange": "{{range}} of {{total}} entries",
|
|
724
|
-
"emptyListMessage": "No items to show",
|
|
725
|
-
"noData": {
|
|
726
|
-
"title": "No data available",
|
|
727
|
-
"message": "There are no records to display at this time."
|
|
728
|
-
},
|
|
729
|
-
"noResults": {
|
|
730
|
-
"title": "No results found",
|
|
731
|
-
"message": "Try adjusting your search criteria"
|
|
732
|
-
}
|
|
733
|
-
},
|
|
734
|
-
"wizard": {
|
|
735
|
-
"wizardMarker": {
|
|
736
|
-
"completed": "Completed",
|
|
737
|
-
"inProgress": "In progress",
|
|
738
|
-
"pending": "Pending"
|
|
739
|
-
},
|
|
740
|
-
"wizardWrapper": {
|
|
741
|
-
"back": "Back",
|
|
742
|
-
"previous": "Previous",
|
|
743
|
-
"end": "End",
|
|
744
|
-
"next": "Next",
|
|
745
|
-
"step": "Step {{index}}"
|
|
746
|
-
}
|
|
747
|
-
},
|
|
748
|
-
"datePicker": {
|
|
749
|
-
"quickActions": {
|
|
750
|
-
"title": "Quick Select",
|
|
751
|
-
"lastHour": "Last hour",
|
|
752
|
-
"last3Hours": "Last 3 hours",
|
|
753
|
-
"last6Hours": "Last 6 hours",
|
|
754
|
-
"last12Hours": "Last 12 hours",
|
|
755
|
-
"last24Hours": "Last 24 hours",
|
|
756
|
-
"last7Days": "Last 7 days",
|
|
757
|
-
"last30Days": "Last 30 days",
|
|
758
|
-
"last6Months": "Last 6 months",
|
|
759
|
-
"lastYear": "Last year",
|
|
760
|
-
"clear": "Clear"
|
|
761
|
-
},
|
|
762
|
-
"labels": {
|
|
763
|
-
"from": "From",
|
|
764
|
-
"to": "To"
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
**Spanish (`/assets/i18n/es.json`):**
|
|
772
|
-
|
|
773
|
-
```json
|
|
774
|
-
{
|
|
775
|
-
"sdk": {
|
|
776
|
-
"fileUpload": {
|
|
777
|
-
"dropzone": {
|
|
778
|
-
"selectPrompt": "Haz clic para seleccionar archivos o arrastra y suelta aquí",
|
|
779
|
-
"maxSizeLabel": "Tamaño máximo:",
|
|
780
|
-
"allowedTypesLabel": "Tipos permitidos:",
|
|
781
|
-
"invalidFileType": "Tipo de archivo no válido",
|
|
782
|
-
"fileTooLarge": "Archivo demasiado grande",
|
|
783
|
-
"fileCounter": "{{current}} de {{max}} archivos",
|
|
784
|
-
"maxFilesExceeded": "Máximo de {{max}} archivo(s) permitido",
|
|
785
|
-
"noValidFiles": "No se han seleccionado archivos válidos",
|
|
786
|
-
"fileActions": {
|
|
787
|
-
"play": "Reproducir audio",
|
|
788
|
-
"pause": "Pausar audio",
|
|
789
|
-
"download": "Descargar archivo",
|
|
790
|
-
"remove": "Quitar archivo"
|
|
791
|
-
}
|
|
792
|
-
},
|
|
793
|
-
"fileUploader": {
|
|
794
|
-
"allowedTypesLabel": "Tipos permitidos:"
|
|
795
|
-
}
|
|
796
|
-
},
|
|
797
|
-
"audioPlayer": {
|
|
798
|
-
"trackListTitle": "Pistas",
|
|
799
|
-
"trackInfo": {
|
|
800
|
-
"title": "Sin título",
|
|
801
|
-
"description": "Sin descripción"
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
"countdown": {
|
|
805
|
-
"days": "Días",
|
|
806
|
-
"hours": "Horas",
|
|
807
|
-
"minutes": "Minutos",
|
|
808
|
-
"seconds": "Segundos"
|
|
809
|
-
},
|
|
810
|
-
"dualList": {
|
|
811
|
-
"searchPlaceHolder": "Buscar"
|
|
812
|
-
},
|
|
813
|
-
"combobox": {
|
|
814
|
-
"searchPlaceholder": "Buscar",
|
|
815
|
-
"placeholder": "Seleccione",
|
|
816
|
-
"noResultsFound": "No se encontraron resultados",
|
|
817
|
-
"clearAll": "Limpiar Todo",
|
|
818
|
-
"clearSelection": "Limpiar selección",
|
|
819
|
-
"searchOptions": "Buscar opciones",
|
|
820
|
-
"loading": "Cargando..."
|
|
821
|
-
},
|
|
822
|
-
"select": {
|
|
823
|
-
"placeholder": "Seleccione"
|
|
824
|
-
},
|
|
825
|
-
"formErrors": {
|
|
826
|
-
"validation": {
|
|
827
|
-
"required": "*Este campo es obligatorio",
|
|
828
|
-
"email": "*Por favor ingresa una dirección de correo válida",
|
|
829
|
-
"minLength": "*Debe tener al menos {{min}} caracteres",
|
|
830
|
-
"maxLength": "*No debe tener más de {{max}} caracteres",
|
|
831
|
-
"min": "*El valor debe ser al menos {{min}}",
|
|
832
|
-
"max": "*El valor no debe superar {{max}}",
|
|
833
|
-
"pattern": "*Formato inválido",
|
|
834
|
-
"unhandledError": "*Error inesperado"
|
|
835
|
-
}
|
|
836
|
-
},
|
|
837
|
-
"textarea": {
|
|
838
|
-
"maxCharacters": "{{current}} de {{max}} caracteres"
|
|
839
|
-
},
|
|
840
|
-
"table": {
|
|
841
|
-
"entriesByPage": "Entradas por página",
|
|
842
|
-
"perPage": "{{count}} / página",
|
|
843
|
-
"totalEntries": "{{total}} entradas",
|
|
844
|
-
"entriesRange": "{{range}} de {{total}} entradas",
|
|
845
|
-
"emptyListMessage": "No hay elementos para mostrar"
|
|
846
|
-
},
|
|
847
|
-
"dataTable": {
|
|
848
|
-
"entriesByPage": "Entradas por página",
|
|
849
|
-
"perPage": "{{count}} / página",
|
|
850
|
-
"totalEntries": "{{total}} entradas",
|
|
851
|
-
"entriesRange": "{{range}} de {{total}} entradas",
|
|
852
|
-
"emptyListMessage": "No hay elementos para mostrar",
|
|
853
|
-
"noData": {
|
|
854
|
-
"title": "No hay datos disponibles",
|
|
855
|
-
"message": "No hay registros para mostrar en este momento."
|
|
856
|
-
},
|
|
857
|
-
"noResults": {
|
|
858
|
-
"title": "No se encontraron resultados",
|
|
859
|
-
"message": "Intenta ajustar tus criterios de búsqueda"
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
"wizard": {
|
|
863
|
-
"wizardMarker": {
|
|
864
|
-
"completed": "Completado",
|
|
865
|
-
"inProgress": "En progreso",
|
|
866
|
-
"pending": "Pendiente"
|
|
867
|
-
},
|
|
868
|
-
"wizardWrapper": {
|
|
869
|
-
"back": "Atrás",
|
|
870
|
-
"previous": "Anterior",
|
|
871
|
-
"end": "Finalizar",
|
|
872
|
-
"next": "Siguiente",
|
|
873
|
-
"step": "Paso {{index}}"
|
|
874
|
-
}
|
|
875
|
-
},
|
|
876
|
-
"datePicker": {
|
|
877
|
-
"quickActions": {
|
|
878
|
-
"title": "Selección Rápida",
|
|
879
|
-
"lastHour": "Última hora",
|
|
880
|
-
"last3Hours": "Últimas 3 horas",
|
|
881
|
-
"last6Hours": "Últimas 6 horas",
|
|
882
|
-
"last12Hours": "Últimas 12 horas",
|
|
883
|
-
"last24Hours": "Últimas 24 horas",
|
|
884
|
-
"last7Days": "Últimos 7 días",
|
|
885
|
-
"last30Days": "Últimos 30 días",
|
|
886
|
-
"last6Months": "Últimos 6 meses",
|
|
887
|
-
"lastYear": "Último año",
|
|
888
|
-
"clear": "Limpiar"
|
|
889
|
-
},
|
|
890
|
-
"labels": {
|
|
891
|
-
"from": "Desde",
|
|
892
|
-
"to": "Hasta"
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
```
|
|
898
|
-
|
|
899
|
-
**Portuguese (`/assets/i18n/pt.json`):**
|
|
244
|
+
Do not copy these files into your app, so an SDK upgrade brings its new labels with it.
|
|
900
245
|
|
|
901
|
-
|
|
902
|
-
{
|
|
903
|
-
"sdk": {
|
|
904
|
-
"fileUpload": {
|
|
905
|
-
"dropzone": {
|
|
906
|
-
"selectPrompt": "Haz clic para seleccionar archivos o arrastra y suelta aquí",
|
|
907
|
-
"maxSizeLabel": "Tamaño máximo:",
|
|
908
|
-
"allowedTypesLabel": "Tipos permitidos:",
|
|
909
|
-
"invalidFileType": "Tipo de archivo no válido",
|
|
910
|
-
"fileTooLarge": "Archivo demasiado grande",
|
|
911
|
-
"fileCounter": "{{current}} de {{max}} archivos",
|
|
912
|
-
"maxFilesExceeded": "Máximo de {{max}} archivo(s) permitido",
|
|
913
|
-
"noValidFiles": "No se han seleccionado archivos válidos",
|
|
914
|
-
"fileActions": {
|
|
915
|
-
"play": "Reproducir audio",
|
|
916
|
-
"pause": "Pausar audio",
|
|
917
|
-
"download": "Descargar archivo",
|
|
918
|
-
"remove": "Quitar archivo"
|
|
919
|
-
}
|
|
920
|
-
},
|
|
921
|
-
"fileUploader": {
|
|
922
|
-
"allowedTypesLabel": "Tipos permitidos:"
|
|
923
|
-
}
|
|
924
|
-
},
|
|
925
|
-
"audioPlayer": {
|
|
926
|
-
"trackListTitle": "Trilhas",
|
|
927
|
-
"trackInfo": {
|
|
928
|
-
"title": "Sem título",
|
|
929
|
-
"description": "Sem descrição"
|
|
930
|
-
}
|
|
931
|
-
},
|
|
932
|
-
"countdown": {
|
|
933
|
-
"days": "Dias",
|
|
934
|
-
"hours": "Horas",
|
|
935
|
-
"minutes": "Minutos",
|
|
936
|
-
"seconds": "Segundos"
|
|
937
|
-
},
|
|
938
|
-
"dualList": {
|
|
939
|
-
"searchPlaceHolder": "Pesquisar"
|
|
940
|
-
},
|
|
941
|
-
"combobox": {
|
|
942
|
-
"searchPlaceholder": "Pesquisar",
|
|
943
|
-
"placeholder": "Selecione",
|
|
944
|
-
"noResultsFound": "Nenhum resultado encontrado",
|
|
945
|
-
"clearAll": "Limpar Tudo",
|
|
946
|
-
"clearSelection": "Limpar seleção",
|
|
947
|
-
"searchOptions": "Pesquisar opções",
|
|
948
|
-
"loading": "Carregando..."
|
|
949
|
-
},
|
|
950
|
-
"select": {
|
|
951
|
-
"placeholder": "Selecione"
|
|
952
|
-
},
|
|
953
|
-
"formErrors": {
|
|
954
|
-
"validation": {
|
|
955
|
-
"required": "*Este campo é obrigatório",
|
|
956
|
-
"email": "*Por favor, insira um endereço de e-mail válido",
|
|
957
|
-
"minLength": "*Deve ter pelo menos {{min}} caracteres",
|
|
958
|
-
"maxLength": "*Deve ter no máximo {{max}} caracteres",
|
|
959
|
-
"min": "*O valor deve ser de pelo menos {{min}}",
|
|
960
|
-
"max": "*O valor deve ser de no máximo {{max}}",
|
|
961
|
-
"pattern": "*Formato inválido",
|
|
962
|
-
"unhandledError": "*Erro não tratado"
|
|
963
|
-
}
|
|
964
|
-
},
|
|
965
|
-
"textarea": {
|
|
966
|
-
"maxCharacters": "{{current}} de {{max}} caracteres"
|
|
967
|
-
},
|
|
968
|
-
"table": {
|
|
969
|
-
"entriesByPage": "Entradas por página",
|
|
970
|
-
"perPage": "{{count}} / página",
|
|
971
|
-
"totalEntries": "{{total}} entradas",
|
|
972
|
-
"entriesRange": "{{range}} de {{total}} entradas",
|
|
973
|
-
"emptyListMessage": "Nenhum item para mostrar"
|
|
974
|
-
},
|
|
975
|
-
"dataTable": {
|
|
976
|
-
"entriesByPage": "Entradas por página",
|
|
977
|
-
"perPage": "{{count}} / página",
|
|
978
|
-
"totalEntries": "{{total}} entradas",
|
|
979
|
-
"entriesRange": "{{range}} de {{total}} entradas",
|
|
980
|
-
"emptyListMessage": "Nenhum item para mostrar",
|
|
981
|
-
"noData": {
|
|
982
|
-
"title": "Nenhum dado disponível",
|
|
983
|
-
"message": "Não há registros para exibir neste momento."
|
|
984
|
-
},
|
|
985
|
-
"noResults": {
|
|
986
|
-
"title": "Nenhum resultado encontrado",
|
|
987
|
-
"message": "Tente ajustar seus critérios de pesquisa"
|
|
988
|
-
}
|
|
989
|
-
},
|
|
990
|
-
"wizard": {
|
|
991
|
-
"wizardMarker": {
|
|
992
|
-
"completed": "Concluído",
|
|
993
|
-
"inProgress": "Em andamento",
|
|
994
|
-
"pending": "Pendente"
|
|
995
|
-
},
|
|
996
|
-
"wizardWrapper": {
|
|
997
|
-
"back": "Voltar",
|
|
998
|
-
"previous": "Anterior",
|
|
999
|
-
"end": "Fim",
|
|
1000
|
-
"next": "Próximo",
|
|
1001
|
-
"step": "Etapa {{index}}"
|
|
1002
|
-
}
|
|
1003
|
-
},
|
|
1004
|
-
"datePicker": {
|
|
1005
|
-
"quickActions": {
|
|
1006
|
-
"title": "Seleção Rápida",
|
|
1007
|
-
"lastHour": "Última hora",
|
|
1008
|
-
"last3Hours": "Últimas 3 horas",
|
|
1009
|
-
"last6Hours": "Últimas 6 horas",
|
|
1010
|
-
"last12Hours": "Últimas 12 horas",
|
|
1011
|
-
"last24Hours": "Últimas 24 horas",
|
|
1012
|
-
"last7Days": "Últimos 7 dias",
|
|
1013
|
-
"last30Days": "Últimos 30 dias",
|
|
1014
|
-
"last6Months": "Últimos 6 meses",
|
|
1015
|
-
"lastYear": "Último ano",
|
|
1016
|
-
"clear": "Limpar"
|
|
1017
|
-
},
|
|
1018
|
-
"labels": {
|
|
1019
|
-
"from": "De",
|
|
1020
|
-
"to": "Até"
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
```
|
|
246
|
+
### Your own keys and languages
|
|
1026
247
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
The TranslationService automatically loads available languages from `translation.json`:
|
|
1030
|
-
|
|
1031
|
-
```typescript
|
|
1032
|
-
// In any component
|
|
1033
|
-
import { TranslationService } from '@sixbell-telco/sdk/utils/translation';
|
|
1034
|
-
import { inject } from '@angular/core';
|
|
1035
|
-
|
|
1036
|
-
export class MyComponent {
|
|
1037
|
-
private translationService = inject(TranslationService);
|
|
1038
|
-
|
|
1039
|
-
availableLanguages = this.translationService.getAvailableLanguagesConfig();
|
|
1040
|
-
currentLanguage = this.translationService.currentLanguage;
|
|
1041
|
-
|
|
1042
|
-
setLanguage(languageCode: string) {
|
|
1043
|
-
this.translationService.setLanguage(languageCode);
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
getLanguageName(languageCode: string): string {
|
|
1047
|
-
return this.translationService.getLocalizedLanguageName(languageCode);
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
```
|
|
1051
|
-
|
|
1052
|
-
### 5. Use Translations in Templates
|
|
1053
|
-
|
|
1054
|
-
Translations are automatically loaded and available through the `translate` pipe:
|
|
1055
|
-
|
|
1056
|
-
```html
|
|
1057
|
-
<!-- Access any translation key -->
|
|
1058
|
-
<h1>{{ 'ui.showcase' | translate }}</h1>
|
|
1059
|
-
|
|
1060
|
-
<!-- With parameters -->
|
|
1061
|
-
<p>{{ 'welcome.message' | translate: { name: userName } }}</p>
|
|
1062
|
-
|
|
1063
|
-
<!-- In component -->
|
|
1064
|
-
<select (change)="setLanguage($event.target.value)">
|
|
1065
|
-
@for (lang of availableLanguages; track lang.code) {
|
|
1066
|
-
<option [value]="lang.code">{{ getLanguageName(lang.code) }}</option>
|
|
1067
|
-
}
|
|
1068
|
-
</select>
|
|
1069
|
-
```
|
|
1070
|
-
|
|
1071
|
-
### 6. Add Custom Application Translations
|
|
1072
|
-
|
|
1073
|
-
Extend the translation files with your application-specific keys:
|
|
1074
|
-
|
|
1075
|
-
**English (`/assets/i18n/en.json`):**
|
|
248
|
+
Put your keys in `{lang}.json` files under your own path (`src/assets/i18n/en.json`, `es.json` and so on), and read them with the ngx-translate `translate` pipe (`TranslatePipe` from `@ngx-translate/core` in the component's `imports`):
|
|
1076
249
|
|
|
1077
250
|
```json
|
|
1078
251
|
{
|
|
1079
|
-
"app": {
|
|
1080
|
-
|
|
1081
|
-
"welcome": "Welcome to our app",
|
|
1082
|
-
"features": {
|
|
1083
|
-
"description": "Powerful features for your business"
|
|
1084
|
-
}
|
|
1085
|
-
},
|
|
1086
|
-
"sdk": {
|
|
1087
|
-
"formFields": {
|
|
1088
|
-
"optional": "Optional"
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
```
|
|
1093
|
-
|
|
1094
|
-
Your application is now configured with full multi-language support. Language preferences are automatically persisted and restored on return visits.
|
|
1095
|
-
|
|
1096
|
-
## Usage Examples
|
|
1097
|
-
|
|
1098
|
-
### Using Components
|
|
1099
|
-
|
|
1100
|
-
Here's a basic example of using a button component:
|
|
1101
|
-
|
|
1102
|
-
```typescript
|
|
1103
|
-
// app.component.ts
|
|
1104
|
-
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1105
|
-
|
|
1106
|
-
@Component({
|
|
1107
|
-
imports: [ButtonComponent],
|
|
1108
|
-
template: `
|
|
1109
|
-
<div>
|
|
1110
|
-
<h1>Awesome button</h1>
|
|
1111
|
-
<st-button variant="primary">Click me!</st-button>
|
|
1112
|
-
</div>
|
|
1113
|
-
`
|
|
1114
|
-
})
|
|
1115
|
-
```
|
|
1116
|
-
|
|
1117
|
-
### Using Text Directive & Component
|
|
1118
|
-
|
|
1119
|
-
The **Text Directive** (`stText`) applies preset-based typography styles directly on any HTML element. The **Text Component** (`st-text`) is a polymorphic wrapper that renders the correct semantic HTML tag.
|
|
1120
|
-
|
|
1121
|
-
Both support class overrides — any Tailwind class you put in `class=""` will override the corresponding directive/component default via `cn()`.
|
|
1122
|
-
|
|
1123
|
-
#### Text Directive
|
|
1124
|
-
|
|
1125
|
-
```typescript
|
|
1126
|
-
import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
1127
|
-
|
|
1128
|
-
@Component({
|
|
1129
|
-
imports: [TextDirective],
|
|
1130
|
-
template: `
|
|
1131
|
-
<!-- Basic presets (1 = largest heading, 10 = smallest body) -->
|
|
1132
|
-
<h1 stText="1">Hero Title</h1>
|
|
1133
|
-
<p stText="7">Body text (default preset)</p>
|
|
1134
|
-
<span stText="9">Small label</span>
|
|
1135
|
-
|
|
1136
|
-
<!-- Override weight and color via inputs -->
|
|
1137
|
-
<p stText="7" stTextWeight="bold" stTextColor="primary">Bold primary text</p>
|
|
1138
|
-
|
|
1139
|
-
<!-- Override any prop via class (wins over defaults) -->
|
|
1140
|
-
<p stText="7" class="text-error font-semibold">Error text with semibold weight</p>
|
|
1141
|
-
<p stText="7" class="text-3xl leading-loose">Larger size and loose line-height</p>
|
|
1142
|
-
|
|
1143
|
-
<!-- Line clamp -->
|
|
1144
|
-
<p stText="7" stTextLineClamp="2">Long text clamped to 2 lines...</p>
|
|
1145
|
-
`
|
|
1146
|
-
})
|
|
1147
|
-
```
|
|
1148
|
-
|
|
1149
|
-
**Available inputs:**
|
|
1150
|
-
|
|
1151
|
-
| Input | Default | Options |
|
|
1152
|
-
| ----------------- | ----------- | ----------------------------------------------------------------------------------- |
|
|
1153
|
-
| `stText` | `'7'` | `'1'`–`'10'` (preset scale) |
|
|
1154
|
-
| `stTextWeight` | `'normal'` | `'bold'`, `'semibold'`, `'medium'`, `'normal'`, `'light'`, `'inherit'` |
|
|
1155
|
-
| `stTextColor` | `'inherit'` | `'base'`, `'base-placeholder'`, `'primary'`, `'secondary'`, `'accent'`, `'inherit'` |
|
|
1156
|
-
| `stTextOverflow` | `'clip'` | `'clip'`, `'ellipsis'`, `'truncate'` |
|
|
1157
|
-
| `stTextLineClamp` | `undefined` | `'1'`–`'6'`, `'none'` |
|
|
1158
|
-
|
|
1159
|
-
**Class overrides:** Any Tailwind utility in `class=""` overrides the corresponding directive default (color, weight, font-size, line-height, tracking, etc.) via `cn()`.
|
|
1160
|
-
|
|
1161
|
-
#### Text Component
|
|
1162
|
-
|
|
1163
|
-
```typescript
|
|
1164
|
-
import { TextComponent } from '@sixbell-telco/sdk/components/text';
|
|
1165
|
-
|
|
1166
|
-
@Component({
|
|
1167
|
-
imports: [TextComponent],
|
|
1168
|
-
template: `
|
|
1169
|
-
<!-- Semantic tags with presets -->
|
|
1170
|
-
<st-text as="h1" preset="1">Hero Title</st-text>
|
|
1171
|
-
<st-text as="h2" preset="2">Page Title</st-text>
|
|
1172
|
-
<st-text as="p" preset="7">Body paragraph</st-text>
|
|
1173
|
-
<st-text as="span" preset="9" color="primary">Inline label</st-text>
|
|
1174
|
-
|
|
1175
|
-
<!-- Override via inputs -->
|
|
1176
|
-
<st-text as="p" preset="7" weight="bold" color="accent">Bold accent text</st-text>
|
|
1177
|
-
|
|
1178
|
-
<!-- Override via class (wins over defaults) -->
|
|
1179
|
-
<st-text as="p" preset="7" class="text-error font-medium">Custom error text</st-text>
|
|
1180
|
-
<st-text as="h1" preset="1" class="mb-4 border-b border-accent pb-2">Heading with border</st-text>
|
|
1181
|
-
`
|
|
1182
|
-
})
|
|
1183
|
-
```
|
|
1184
|
-
|
|
1185
|
-
**Available inputs:**
|
|
1186
|
-
|
|
1187
|
-
| Input | Default | Options |
|
|
1188
|
-
| ----------- | ----------- | ----------------------------------------------------------------------------------- |
|
|
1189
|
-
| `as` | `'p'` | `'h1'`–`'h6'`, `'p'`, `'span'`, `'div'`, `'label'` |
|
|
1190
|
-
| `preset` | `'7'` | `'1'`–`'10'` |
|
|
1191
|
-
| `weight` | `undefined` | `'bold'`, `'semibold'`, `'medium'`, `'normal'`, `'light'`, `'inherit'` |
|
|
1192
|
-
| `color` | `'base'` | `'base'`, `'base-placeholder'`, `'primary'`, `'secondary'`, `'accent'`, `'inherit'` |
|
|
1193
|
-
| `overflow` | `'clip'` | `'clip'`, `'ellipsis'`, `'truncate'` |
|
|
1194
|
-
| `lineClamp` | `undefined` | `'1'`–`'6'`, `'none'` |
|
|
1195
|
-
|
|
1196
|
-
### Using Services in Components
|
|
1197
|
-
|
|
1198
|
-
```typescript
|
|
1199
|
-
// component.ts
|
|
1200
|
-
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
1201
|
-
import { TranslationService } from '@sixbell-telco/sdk/utils/translation';
|
|
1202
|
-
|
|
1203
|
-
@Component({
|
|
1204
|
-
template: `
|
|
1205
|
-
<div [class]="themeService.finalTheme()">
|
|
1206
|
-
<h1>{{ 'welcome.title' | translate }}</h1>
|
|
1207
|
-
<p>Current theme: {{ themeService.selectedTheme() }}</p>
|
|
1208
|
-
<p>Dark mode: {{ themeService.isDarkTheme() ? 'Yes' : 'No' }}</p>
|
|
1209
|
-
|
|
1210
|
-
<!-- Theme selector -->
|
|
1211
|
-
<select (change)="changeTheme($event.target.value)">
|
|
1212
|
-
@for (theme of themeService.getAvailableThemes(); track theme) {
|
|
1213
|
-
<option [value]="theme">{{ theme }}</option>
|
|
1214
|
-
}
|
|
1215
|
-
</select>
|
|
1216
|
-
|
|
1217
|
-
<!-- Language selector -->
|
|
1218
|
-
<select (change)="changeLanguage($event.target.value)">
|
|
1219
|
-
@for (lang of translationService.getAvailableLanguagesConfig(); track lang.code) {
|
|
1220
|
-
<option [value]="lang.code">{{ translationService.getLocalizedLanguageName(lang.code) }}</option>
|
|
1221
|
-
}
|
|
1222
|
-
</select>
|
|
1223
|
-
</div>
|
|
1224
|
-
`,
|
|
1225
|
-
})
|
|
1226
|
-
export class MyComponent {
|
|
1227
|
-
themeService = inject(ThemeService);
|
|
1228
|
-
translationService = inject(TranslationService);
|
|
1229
|
-
|
|
1230
|
-
changeTheme(theme: string) {
|
|
1231
|
-
this.themeService.setTheme(theme);
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
changeLanguage(language: string) {
|
|
1235
|
-
this.translationService.setLanguage(language);
|
|
1236
|
-
}
|
|
252
|
+
"app": { "title": "My Application", "welcome": "Welcome, {{name}}" },
|
|
253
|
+
"sdk": { "formFields": { "optional": "Optional" } }
|
|
1237
254
|
}
|
|
1238
255
|
```
|
|
1239
256
|
|
|
1240
|
-
## Quick Start
|
|
1241
|
-
|
|
1242
|
-
### Using Components
|
|
1243
|
-
|
|
1244
|
-
```typescript
|
|
1245
|
-
import { Component } from '@angular/core';
|
|
1246
|
-
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1247
|
-
import {
|
|
1248
|
-
CardActionsComponent,
|
|
1249
|
-
CardBodyComponent,
|
|
1250
|
-
CardComponent,
|
|
1251
|
-
CardFooterComponent,
|
|
1252
|
-
CardHeaderComponent,
|
|
1253
|
-
CardSectionBodyComponent,
|
|
1254
|
-
CardSectionComponent,
|
|
1255
|
-
CardSectionGroupComponent,
|
|
1256
|
-
CardSubtitleComponent,
|
|
1257
|
-
CardTitleComponent,
|
|
1258
|
-
} from '@sixbell-telco/sdk/components/card';
|
|
1259
|
-
|
|
1260
|
-
@Component({
|
|
1261
|
-
selector: 'app-example',
|
|
1262
|
-
standalone: true,
|
|
1263
|
-
imports: [
|
|
1264
|
-
ButtonComponent,
|
|
1265
|
-
CardActionsComponent,
|
|
1266
|
-
CardBodyComponent,
|
|
1267
|
-
CardComponent,
|
|
1268
|
-
CardFooterComponent,
|
|
1269
|
-
CardHeaderComponent,
|
|
1270
|
-
CardSectionBodyComponent,
|
|
1271
|
-
CardSectionComponent,
|
|
1272
|
-
CardSectionGroupComponent,
|
|
1273
|
-
CardSubtitleComponent,
|
|
1274
|
-
CardTitleComponent,
|
|
1275
|
-
],
|
|
1276
|
-
template: `
|
|
1277
|
-
<st-card>
|
|
1278
|
-
<st-card-header>
|
|
1279
|
-
<st-card-title>Hello World</st-card-title>
|
|
1280
|
-
<st-card-subtitle>Small supporting text</st-card-subtitle>
|
|
1281
|
-
</st-card-header>
|
|
1282
|
-
<st-card-body>
|
|
1283
|
-
<st-card-section-group [divided]="true">
|
|
1284
|
-
<st-card-section>
|
|
1285
|
-
<st-card-section-body>Welcome to the new compound card API.</st-card-section-body>
|
|
1286
|
-
</st-card-section>
|
|
1287
|
-
</st-card-section-group>
|
|
1288
|
-
</st-card-body>
|
|
1289
|
-
<st-card-footer [divided]="true">
|
|
1290
|
-
<st-card-actions>
|
|
1291
|
-
<st-button variant="primary">Click me!</st-button>
|
|
1292
|
-
</st-card-actions>
|
|
1293
|
-
</st-card-footer>
|
|
1294
|
-
</st-card>
|
|
1295
|
-
`,
|
|
1296
|
-
})
|
|
1297
|
-
export class ExampleComponent {}
|
|
1298
|
-
```
|
|
1299
|
-
|
|
1300
|
-
### Using Form Components
|
|
1301
|
-
|
|
1302
|
-
```typescript
|
|
1303
|
-
import { Component } from '@angular/core';
|
|
1304
|
-
import { ReactiveFormsModule, FormControl, FormGroup, Validators } from '@angular/forms';
|
|
1305
|
-
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1306
|
-
import { FormHintComponent, FormRequiredLegendComponent } from '@sixbell-telco/sdk/components/forms/form-hint';
|
|
1307
|
-
import { FormItemComponent } from '@sixbell-telco/sdk/components/forms/form-item';
|
|
1308
|
-
import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
|
|
1309
|
-
|
|
1310
|
-
@Component({
|
|
1311
|
-
selector: 'app-form-example',
|
|
1312
|
-
standalone: true,
|
|
1313
|
-
imports: [ButtonComponent, FormHintComponent, FormItemComponent, FormRequiredLegendComponent, InputComponent, ReactiveFormsModule],
|
|
1314
|
-
template: `
|
|
1315
|
-
<form [formGroup]="form" (ngSubmit)="submit()">
|
|
1316
|
-
<st-form-required-legend />
|
|
1317
|
-
<st-form-item>
|
|
1318
|
-
<st-input label="Email" formControlName="email" [parentForm]="form" />
|
|
1319
|
-
<st-form-hint>We send the invitation to this address.</st-form-hint>
|
|
1320
|
-
</st-form-item>
|
|
1321
|
-
<!-- The submit stays enabled: validation runs on submit. -->
|
|
1322
|
-
<st-button variant="primary" type="submit">Create contact</st-button>
|
|
1323
|
-
</form>
|
|
1324
|
-
`,
|
|
1325
|
-
})
|
|
1326
|
-
export class FormExampleComponent {
|
|
1327
|
-
form = new FormGroup({
|
|
1328
|
-
email: new FormControl('', [Validators.required, Validators.email]),
|
|
1329
|
-
});
|
|
1330
|
-
|
|
1331
|
-
submit() {
|
|
1332
|
-
if (this.form.invalid) {
|
|
1333
|
-
this.form.markAllAsTouched();
|
|
1334
|
-
return;
|
|
1335
|
-
}
|
|
1336
|
-
console.log(this.form.value);
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
```
|
|
1340
|
-
|
|
1341
|
-
### Using Services
|
|
1342
|
-
|
|
1343
|
-
```typescript
|
|
1344
|
-
import { Component, inject, effect } from '@angular/core';
|
|
1345
|
-
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
1346
|
-
import { TranslationService } from '@sixbell-telco/sdk/utils/translation';
|
|
1347
|
-
import { LoggerService } from '@sixbell-telco/sdk/utils/logger';
|
|
1348
|
-
|
|
1349
|
-
@Component({
|
|
1350
|
-
selector: 'app-services-example',
|
|
1351
|
-
template: `
|
|
1352
|
-
<div>
|
|
1353
|
-
<p>Current Theme: {{ themeService.selectedTheme() }}</p>
|
|
1354
|
-
<p>Dark Mode: {{ themeService.isDarkTheme() ? 'Yes' : 'No' }}</p>
|
|
1355
|
-
<button (click)="toggleTheme()">Toggle Theme</button>
|
|
1356
|
-
</div>
|
|
1357
|
-
`,
|
|
1358
|
-
})
|
|
1359
|
-
export class ServicesExampleComponent {
|
|
1360
|
-
themeService = inject(ThemeService);
|
|
1361
|
-
translationService = inject(TranslationService);
|
|
1362
|
-
logger = inject(LoggerService);
|
|
1363
|
-
|
|
1364
|
-
constructor() {
|
|
1365
|
-
effect(() => {
|
|
1366
|
-
this.logger.info(`Theme changed to: ${this.themeService.selectedTheme()}`);
|
|
1367
|
-
});
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
toggleTheme() {
|
|
1371
|
-
const newScheme = this.themeService.isDarkTheme() ? 'light' : 'dark';
|
|
1372
|
-
this.themeService.setScheme(newScheme);
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
```
|
|
1376
|
-
|
|
1377
|
-
## Configuration
|
|
1378
|
-
|
|
1379
|
-
### Theme Configuration
|
|
1380
|
-
|
|
1381
|
-
Runtime themes are loaded from `themes.json`. See [Theme Service README](utils/theme/) for detailed configuration.
|
|
1382
|
-
|
|
1383
|
-
### Translation Configuration
|
|
1384
|
-
|
|
1385
|
-
Runtime translations are loaded from `translation.json`. See [Translation Service README](utils/translation/) for detailed configuration.
|
|
1386
|
-
|
|
1387
|
-
### Logger Configuration
|
|
1388
|
-
|
|
1389
|
-
Configure logging levels and output. See [Logger Service README](utils/logger/) for detailed options.
|
|
1390
|
-
|
|
1391
|
-
## Architecture
|
|
1392
|
-
|
|
1393
|
-
### Multi-Entry Point Imports
|
|
1394
|
-
|
|
1395
|
-
Always use specific imports for optimal tree-shaking:
|
|
1396
|
-
|
|
1397
|
-
```typescript
|
|
1398
|
-
// ✅ Correct - specific imports
|
|
1399
|
-
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1400
|
-
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
1401
|
-
|
|
1402
|
-
// ❌ Avoid - barrel exports
|
|
1403
|
-
import { ButtonComponent } from '@sixbell-telco/sdk';
|
|
1404
|
-
```
|
|
1405
|
-
|
|
1406
|
-
### Component Prefix
|
|
1407
|
-
|
|
1408
|
-
All SDK components use the `st-` prefix:
|
|
1409
|
-
|
|
1410
257
|
```html
|
|
1411
|
-
<
|
|
1412
|
-
<
|
|
1413
|
-
<st-card>Card Content</st-card>
|
|
1414
|
-
<st-divider>OR</st-divider>
|
|
1415
|
-
```
|
|
1416
|
-
|
|
1417
|
-
### Signal-Based API
|
|
1418
|
-
|
|
1419
|
-
Components use Angular 19 signals for reactive inputs:
|
|
1420
|
-
|
|
1421
|
-
```typescript
|
|
1422
|
-
variant = input<'primary' | 'secondary'>();
|
|
1423
|
-
isDisabled = input(false);
|
|
1424
|
-
|
|
1425
|
-
@Component({
|
|
1426
|
-
template: `<button [disabled]="isDisabled()">{{ variant() }}</button>`,
|
|
1427
|
-
})
|
|
1428
|
-
```
|
|
1429
|
-
|
|
1430
|
-
## Testing
|
|
1431
|
-
|
|
1432
|
-
The SDK includes Jest configuration. Run tests with:
|
|
1433
|
-
|
|
1434
|
-
```bash
|
|
1435
|
-
npm test # Run all tests
|
|
1436
|
-
npm run test:watch # Watch mode
|
|
1437
|
-
npm run test:coverage # Coverage report
|
|
258
|
+
<h1>{{ 'app.title' | translate }}</h1>
|
|
259
|
+
<p>{{ 'app.welcome' | translate: { name: userName } }}</p>
|
|
1438
260
|
```
|
|
1439
261
|
|
|
1440
|
-
|
|
262
|
+
To add a language, list it in `additionalLanguages`, map it in `locale.languageToLocale`, and add a `{code}.json` to each translation path. The SDK bundles cover only `en`, `es` and `pt`, so for a new language provide the `sdk.*` labels yourself (copy the structure of `@sixbell-telco/sdk/i18n/sdk/en.json`). A language's display name comes from `sdk.language.languages.<code>` when that key exists, otherwise from its `name`.
|
|
1441
263
|
|
|
1442
|
-
|
|
264
|
+
`TranslationService` (`@sixbell-telco/sdk/utils/translation`) exposes `currentLanguage()`, `setLanguage(code)`, `getAvailableLanguagesConfig()` and `getLocalizedLanguageName(code)`.
|
|
1443
265
|
|
|
1444
|
-
|
|
1445
|
-
- [DESIGN.md](../../DESIGN.md) — product styling source of truth
|
|
1446
|
-
- [AGENTS.md](../../AGENTS.md) — agent workflow guide
|
|
1447
|
-
- **Component Stories**: View component documentation in [Storybook](../storybook/README.md)
|
|
1448
|
-
- **Live Examples**: Showcase app at `projects/showcase/` (`npm start` rebuilds SDK + serves on :3001)
|
|
1449
|
-
- **API Documentation**: JSDoc comments in component files
|
|
1450
|
-
- **Changelog**: See [CHANGELOG.md](./CHANGELOG.md)
|
|
266
|
+
## Components
|
|
1451
267
|
|
|
1452
|
-
|
|
268
|
+
Browse every component live in the [Storybook](https://fantastic-broccoli-8lj2gke.pages.github.io/) (private, sign in with GitHub).
|
|
1453
269
|
|
|
1454
|
-
|
|
270
|
+
- **General**: Accordion, Alert, Audio Player, Avatar, Badge, Button, Card, Countdown, Data Table, Description List, Dialog, Divider, Dropdown, Dropdown Menu, Dual List, Empty State, File Upload, Icon, Link, Notification, Overlay, Paginator, Product Card, Progress, Segmented Button, Sonner Toast, Status Illustration, Tab, Table, Text, Tooltip, Tree, Wizard.
|
|
271
|
+
- **Forms**: Checkbox, Combobox, Datepicker, Form Error, Form Group, Form Hint, Form Item, Input, Radio, Range, Select, Switch, Textarea, Toggle.
|
|
272
|
+
- **Services**: Logger, Unsaved Changes, Theme, Translation, Formatting, Runtime Config.
|
|
273
|
+
- **Directives**: auto-focus, click-outside, only-numbers, text, truncate.
|
|
1455
274
|
|
|
1456
|
-
|
|
1457
|
-
2. When a release is created, update the skill metadata to the released version or tag.
|
|
1458
|
-
3. When development starts again, switch the skill metadata back to `Unreleased`.
|
|
275
|
+
## Changelog and migrations
|
|
1459
276
|
|
|
1460
|
-
|
|
277
|
+
`CHANGELOG.md` in this package lists what changed in each release of the current major, in short form; the detailed notes and older releases are in the [changelog archive](https://github.com/EnghouseGlobal/nw-sx-web-libs-ui-kit/blob/develop/docs/changelog-archive.md). Breaking changes have upgrade guides in the UI Kit repository (`docs/migrations/`):
|
|
1461
278
|
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
1. Use `st-` prefix for selectors
|
|
1467
|
-
2. Follow CVA pattern for styling variants
|
|
1468
|
-
3. Use signal-based inputs
|
|
1469
|
-
4. Add comprehensive JSDoc comments
|
|
1470
|
-
5. Create Storybook stories
|
|
1471
|
-
6. Add unit tests with Jest
|
|
1472
|
-
7. Update CHANGELOG.md
|
|
1473
|
-
|
|
1474
|
-
## Resources
|
|
1475
|
-
|
|
1476
|
-
- <a href="https://angular.dev" target="_blank" rel="noopener noreferrer">Angular Documentation</a>
|
|
1477
|
-
- <a href="https://tailwindcss.com" target="_blank" rel="noopener noreferrer">Tailwind CSS</a>
|
|
1478
|
-
- <a href="https://daisyui.com" target="_blank" rel="noopener noreferrer">DaisyUI</a>
|
|
1479
|
-
- <a href="https://cva.style" target="_blank" rel="noopener noreferrer">class-variance-authority</a>
|
|
1480
|
-
- <a href="https://ng-icons.herokuapp.com" target="_blank" rel="noopener noreferrer">ng-icons</a>
|
|
1481
|
-
- <a href="https://material.angular.io/cdk" target="_blank" rel="noopener noreferrer">Angular CDK</a>
|
|
279
|
+
- **Form Errors Migration**: move validation messages to `st-form-errors`.
|
|
280
|
+
- **Card Migration**: the compound card API.
|
|
281
|
+
- **Activation Events Update**: the `(clicked)` / `(triggered)` outputs.
|
|
282
|
+
- **Theme Token Roles**: role-named theme tokens and the deprecated aliases.
|
|
1482
283
|
|
|
1483
284
|
## License
|
|
1484
285
|
|
|
1485
|
-
|
|
286
|
+
Apache-2.0. See `LICENSE` in this package.
|
|
1486
287
|
|
|
1487
288
|
## Support
|
|
1488
289
|
|
|
1489
|
-
For issues, questions
|
|
1490
|
-
|
|
1491
|
-
---
|
|
1492
|
-
|
|
1493
|
-
**Last updated**: March 19, 2026
|
|
290
|
+
For issues, questions or feature requests, contact the Enghouse Networks / Sixbell Telco team.
|