@sixbell-telco/sdk 1.6.0 → 2.0.1
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 +196 -711
- package/README.md +307 -282
- package/_index.css +3 -3
- package/components/audio-player/audio-timeline/audio-timeline.component.d.ts +1 -1
- package/components/audio-player/services/audio.service.d.ts +14 -14
- package/components/countdown/src/countdown.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -3
- package/components/dual-list/src/dual-list.component.d.ts +2 -1
- package/components/file-upload/file-dropzone/file-dropzone.component.d.ts +7 -7
- package/components/file-upload/file-uploader/file-uploader.component.d.ts +7 -7
- package/components/forms/input/src/input.component.d.ts +11 -1
- package/components/forms/textarea/src/textarea.component.d.ts +10 -10
- package/components/link/src/link.component.d.ts +0 -3
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +3 -3
- package/components/tab/directives/tab-header/tab-header.directive.d.ts +2 -2
- package/components/wizard/services/wizard.service.d.ts +5 -5
- package/directives/auto-focus/public-api.d.ts +1 -1
- package/directives/auto-focus/src/{autofocus.directive.d.ts → auto-focus.directive.d.ts} +5 -7
- package/directives/only-numbers/public-api.d.ts +6 -1
- package/directives/only-numbers/src/only-numbers.directive.d.ts +37 -0
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +7 -5
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +0 -4
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +8 -7
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -4
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +2 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +15 -5
- 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 +19 -8
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +2 -7
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs +14 -31
- package/fesm2022/sixbell-telco-sdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +42 -8
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-date.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs +339 -0
- package/fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-sync.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +1053 -716
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +345 -257
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +67 -66
- package/utils/runtime-config/README.md +235 -0
- package/utils/{resource-loader → runtime-config}/index.d.ts +1 -1
- package/utils/runtime-config/public-api.d.ts +5 -0
- package/utils/runtime-config/src/http-client.d.ts +11 -0
- package/utils/runtime-config/src/runtime-config-loader.d.ts +23 -0
- package/utils/runtime-config/src/runtime-config-store.d.ts +11 -0
- package/utils/runtime-config/src/runtime-update-adapter.d.ts +15 -0
- package/utils/runtime-config/src/types.d.ts +66 -0
- package/utils/theme/README.md +324 -986
- package/utils/theme/public-api.d.ts +4 -4
- package/utils/theme/src/constants.d.ts +6 -12
- package/utils/theme/src/models/theme.d.ts +46 -173
- package/utils/theme/src/providers/theme.provider.d.ts +0 -10
- package/utils/theme/src/providers/theme.provider.types.d.ts +16 -15
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +16 -12
- package/utils/theme/src/theme-dom/theme-dom.service.d.ts +8 -0
- package/utils/theme/src/theme.service.d.ts +24 -27
- package/utils/theme/src/utils/utils.d.ts +2 -10
- package/utils/translation/README.md +170 -1390
- package/utils/translation/public-api.d.ts +3 -3
- package/utils/translation/src/constants.d.ts +7 -9
- package/utils/translation/src/models/translation.d.ts +9 -10
- package/utils/translation/src/providers/translation.provider.d.ts +17 -28
- package/utils/translation/src/providers/translation.provider.types.d.ts +13 -6
- package/utils/translation/src/translation.service.d.ts +37 -9
- package/directives/only-numbers/src/just-numbers.directive.d.ts +0 -9
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs +0 -1222
- package/fesm2022/sixbell-telco-sdk-utils-resource-loader.mjs.map +0 -1
- package/utils/resource-loader/README.md +0 -460
- package/utils/resource-loader/public-api.d.ts +0 -1
- package/utils/resource-loader/src/cache/index.d.ts +0 -2
- package/utils/resource-loader/src/cache/layers/factory.d.ts +0 -38
- package/utils/resource-loader/src/cache/layers/index.d.ts +0 -3
- package/utils/resource-loader/src/cache/layers/indexed-db-cache.d.ts +0 -118
- package/utils/resource-loader/src/cache/layers/local-storage-cache.d.ts +0 -86
- package/utils/resource-loader/src/cache/layers/memory-cache.d.ts +0 -76
- package/utils/resource-loader/src/cache/types.d.ts +0 -107
- package/utils/resource-loader/src/config/index.d.ts +0 -1
- package/utils/resource-loader/src/config/load-config.d.ts +0 -32
- package/utils/resource-loader/src/constants.d.ts +0 -38
- package/utils/resource-loader/src/http/index.d.ts +0 -1
- package/utils/resource-loader/src/http/retryable-client.d.ts +0 -43
- package/utils/resource-loader/src/index.d.ts +0 -1
- package/utils/resource-loader/src/resource-loader.d.ts +0 -67
- package/utils/resource-loader/src/types.d.ts +0 -152
- package/utils/resource-loader/src/utils/cache-validator.d.ts +0 -72
- package/utils/resource-loader/src/utils/helpers.d.ts +0 -15
- package/utils/resource-loader/src/utils/index.d.ts +0 -2
- package/utils/theme/src/providers/constants.d.ts +0 -7
- package/utils/translation/src/providers/constants.d.ts +0 -11
package/README.md
CHANGED
|
@@ -1,104 +1,103 @@
|
|
|
1
|
-
# Sixbell Telco SDK
|
|
1
|
+
# Sixbell Telco SDK - Component Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Welcome to the Sixbell Telco SDK component library. This is a comprehensive Angular component library featuring 25+ pre-built, production-ready UI components built with Angular 19, Tailwind CSS v4, and DaisyUI.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The SDK provides:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **25+ Production-Ready Components**: Button, Card, Form inputs, Data Table, Dialog, Dropdown, and more
|
|
10
|
+
- **Utility Services**: Theme management, i18n translation, logging, and resource loading
|
|
11
|
+
- **Directive Support**: Auto-focus, click-outside, form validation directives
|
|
12
|
+
- **Tailwind CSS v4 + DaisyUI**: Modern styling with customizable themes
|
|
13
|
+
- **Multi-Entry Point Architecture**: Granular imports for optimized bundle sizes
|
|
14
|
+
- **Angular 19 Signal-Based**: Modern reactive patterns with Angular signals
|
|
10
15
|
|
|
11
16
|
## Pre-requirements
|
|
12
17
|
|
|
13
|
-
-
|
|
18
|
+
- **Node.js**: ^18.19.1 || ^20.11.1 || ^22.0.0
|
|
19
|
+
- **npm**: 9.6.7 || ^10.0.0 || ^11.0.0
|
|
20
|
+
- **Angular**: 19.2.x or later
|
|
21
|
+
- **Tailwind CSS**: v4.x
|
|
14
22
|
|
|
15
23
|
## Available Components
|
|
16
24
|
|
|
17
|
-
### General
|
|
18
|
-
|
|
19
|
-
| Component
|
|
20
|
-
|
|
|
21
|
-
| Accordion
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
| Dropdown
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
| File Uploader
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| Notification
|
|
38
|
-
| Overlay
|
|
39
|
-
| Paginator
|
|
40
|
-
| Product Card
|
|
41
|
-
| Progress
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| Tooltip
|
|
46
|
-
| Wizard
|
|
47
|
-
|
|
48
|
-
###
|
|
49
|
-
|
|
50
|
-
| Component | Description
|
|
51
|
-
| ---------- |
|
|
52
|
-
| Checkbox | Checkbox input
|
|
53
|
-
| Combobox |
|
|
54
|
-
| Datepicker |
|
|
55
|
-
| Form Error |
|
|
56
|
-
| Input | Text input
|
|
57
|
-
| Radio | Radio button
|
|
58
|
-
| Range |
|
|
59
|
-
| Select | Dropdown select
|
|
60
|
-
| Switch | Toggle switch
|
|
61
|
-
| Textarea | Multi-line text input
|
|
62
|
-
| Toggle | Toggle button
|
|
63
|
-
|
|
64
|
-
### Services
|
|
65
|
-
|
|
66
|
-
| Service |
|
|
67
|
-
| ------------------- |
|
|
68
|
-
| Logger Service |
|
|
69
|
-
| Theme Service | Runtime theme management with multi-tenant support
|
|
70
|
-
| Translation Service |
|
|
71
|
-
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
25
|
+
### General Components
|
|
26
|
+
|
|
27
|
+
| Component | Description |
|
|
28
|
+
| ------------- | ------------------------------------------------- |
|
|
29
|
+
| Accordion | Expandable/collapsible content sections |
|
|
30
|
+
| Avatar | User profile pictures with initials fallback |
|
|
31
|
+
| Badge | Status and label indicators |
|
|
32
|
+
| Button | Interactive buttons with variants and sizes |
|
|
33
|
+
| Card | Container for content with actions |
|
|
34
|
+
| Countdown | Countdown timer with customizable formatting |
|
|
35
|
+
| Data Table | Advanced grid with sorting, filtering, pagination |
|
|
36
|
+
| Dialog | Modal dialogs with animations and positioning |
|
|
37
|
+
| Dropdown | Menu dropdown for actions and links |
|
|
38
|
+
| Dropdown Menu | Advanced nested menu system |
|
|
39
|
+
| Dual List | Dual list selection for managing items |
|
|
40
|
+
| File Dropzone | Drag-and-drop file upload with validation |
|
|
41
|
+
| File Uploader | File input with validation and preview |
|
|
42
|
+
| Icon | SVG icon component with ng-icons integration |
|
|
43
|
+
| Link | Hyperlink component with router support |
|
|
44
|
+
| Modal | Modal dialogs (legacy - use Dialog instead) |
|
|
45
|
+
| Notification | Toast-style notifications |
|
|
46
|
+
| Overlay | Generic overlay with trigger and content |
|
|
47
|
+
| Paginator | Pagination controls for data |
|
|
48
|
+
| Product Card | Product display card with image and actions |
|
|
49
|
+
| Progress | Progress bar with variants |
|
|
50
|
+
| Sonner Toast | Modern toast notifications via ngx-sonner |
|
|
51
|
+
| Tab | Tabbed navigation interface |
|
|
52
|
+
| Table | Basic table for displaying data |
|
|
53
|
+
| Tooltip | Floating tooltip with positioning |
|
|
54
|
+
| Wizard | Multi-step wizard with validation |
|
|
55
|
+
|
|
56
|
+
### Form Components
|
|
57
|
+
|
|
58
|
+
| Component | Description |
|
|
59
|
+
| ---------- | ----------------------------------------------- |
|
|
60
|
+
| Checkbox | Checkbox input with multiple variants |
|
|
61
|
+
| Combobox | Searchable dropdown with multi-select support |
|
|
62
|
+
| Datepicker | Single and range date selection with time |
|
|
63
|
+
| Form Error | Error message display for form fields |
|
|
64
|
+
| Input | Text input with variants, icons, and validation |
|
|
65
|
+
| Radio | Radio button group selection |
|
|
66
|
+
| Range | Slider input for numeric ranges |
|
|
67
|
+
| Select | Dropdown select with object support |
|
|
68
|
+
| Switch | Toggle switch for boolean values |
|
|
69
|
+
| Textarea | Multi-line text input with character count |
|
|
70
|
+
| Toggle | Toggle button for boolean states |
|
|
71
|
+
|
|
72
|
+
### Utility Services
|
|
73
|
+
|
|
74
|
+
| Service | Purpose | Documentation |
|
|
75
|
+
| ------------------- | -------------------------------------------------- | ------------------------------- |
|
|
76
|
+
| Logger Service | Theme-aware logging with IndexedDB persistence | [README](utils/logger/) |
|
|
77
|
+
| Theme Service | Runtime theme management with multi-tenant support | [README](utils/theme/) |
|
|
78
|
+
| Translation Service | Multi-language i18n with ngx-translate integration | [README](utils/translation/) |
|
|
79
|
+
| Runtime Config | Last-known-good runtime config loader | [README](utils/runtime-config/) |
|
|
80
|
+
|
|
81
|
+
### Directives
|
|
82
|
+
|
|
83
|
+
| Directive | Purpose |
|
|
84
|
+
| ------------- | ---------------------------------------- |
|
|
85
|
+
| auto-focus | Auto-focus elements when visible |
|
|
86
|
+
| click-outside | Detect clicks outside an element |
|
|
87
|
+
| only-numbers | Restrict input to numeric values only |
|
|
88
|
+
| typography | Apply typography styles to text elements |
|
|
89
|
+
|
|
90
|
+
## Installation
|
|
91
|
+
|
|
92
|
+
### Step 1: Install Dependencies
|
|
78
93
|
|
|
79
94
|
```bash
|
|
80
|
-
|
|
95
|
+
npm install @sixbell-telco/sdk @tailwindcss/typography daisyui @midudev/tailwind-animations
|
|
81
96
|
```
|
|
82
97
|
|
|
83
|
-
|
|
98
|
+
### Step 2: Import SDK Styles
|
|
84
99
|
|
|
85
|
-
|
|
86
|
-
- Configure Tailwind CSS and Daisy UI
|
|
87
|
-
- Set up required theme configurations
|
|
88
|
-
|
|
89
|
-
> **Note:** The CLI tool is currently a work in progress and is not yet available. Coming soon!
|
|
90
|
-
|
|
91
|
-
### Manual Setup
|
|
92
|
-
|
|
93
|
-
1. Install dependencies:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npm i -D @sixbell-telco/sdk @tailwindcss/typography daisyui @midudev/tailwind-animations
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
2. Configure Tailwind CSS ([Tailwind guide](https://tailwindcss.com/docs/guides/angular))
|
|
100
|
-
|
|
101
|
-
3. Add the provided configuration to global stylesheet where you configured tailwind [See detailed config below]
|
|
100
|
+
In your global `styles.css`:
|
|
102
101
|
|
|
103
102
|
```css
|
|
104
103
|
@import '../node_modules/@sixbell-telco/sdk/_index.css';
|
|
@@ -108,49 +107,36 @@ npm i -D @sixbell-telco/sdk @tailwindcss/typography daisyui @midudev/tailwind-an
|
|
|
108
107
|
@source '../src';
|
|
109
108
|
```
|
|
110
109
|
|
|
111
|
-
>
|
|
112
|
-
|
|
113
|
-
> **⚠️ IMPORTANT**: The `@source` decorator indicates where tailwind should look for classes.
|
|
114
|
-
|
|
115
|
-
With that configuration the library custom CSS will be loaded
|
|
110
|
+
> ⚠️ **Important**: Import `_index.css` **before** the tailwind import.
|
|
116
111
|
|
|
117
|
-
|
|
112
|
+
### Step 3: Configure Microfrontend (if applicable)
|
|
118
113
|
|
|
119
|
-
Add
|
|
120
|
-
|
|
121
|
-
```json
|
|
122
|
-
"@sixbell-telco/sdk/*": ["./node_modules/@sixbell-telco/sdk/*"]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Complete example of a `tsconfig.json`:
|
|
114
|
+
Add path mapping to `tsconfig.json`:
|
|
126
115
|
|
|
127
116
|
```json
|
|
128
117
|
{
|
|
129
|
-
"compileOnSave": false,
|
|
130
118
|
"compilerOptions": {
|
|
131
119
|
"paths": {
|
|
132
120
|
"@sixbell-telco/sdk/*": ["./node_modules/@sixbell-telco/sdk/*"]
|
|
133
|
-
// ... other path mappings
|
|
134
121
|
}
|
|
135
|
-
// ... other compiler options
|
|
136
122
|
}
|
|
137
123
|
}
|
|
138
124
|
```
|
|
139
125
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
5. **VSCode Settings (Optional)**
|
|
126
|
+
### Step 4: Optional - VSCode Configuration
|
|
143
127
|
|
|
144
|
-
|
|
128
|
+
Install the Tailwind CSS extension and add to `.vscode/settings.json`:
|
|
145
129
|
|
|
146
130
|
```json
|
|
131
|
+
{
|
|
147
132
|
"editor.quickSuggestions": {
|
|
148
133
|
"strings": "on"
|
|
149
134
|
},
|
|
150
135
|
"files.associations": {
|
|
151
136
|
"*.css": "tailwindcss"
|
|
152
137
|
},
|
|
153
|
-
|
|
138
|
+
"tailwindCSS.classFunctions": ["tw", "clsx", "cva", "cn", "tw\\.[a-z-]+"]
|
|
139
|
+
}
|
|
154
140
|
```
|
|
155
141
|
|
|
156
142
|
These settings improve your development experience:
|
|
@@ -161,7 +147,7 @@ These settings improve your development experience:
|
|
|
161
147
|
|
|
162
148
|
With these settings, VSCode will provide class autocompletion for the library's custom attributes and utility functions.
|
|
163
149
|
|
|
164
|
-
##
|
|
150
|
+
## Themes and translation configuration (an optional Logger)
|
|
165
151
|
|
|
166
152
|
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.
|
|
167
153
|
|
|
@@ -201,12 +187,8 @@ The `translation.json` file defines available languages and their translation pa
|
|
|
201
187
|
|
|
202
188
|
```json
|
|
203
189
|
{
|
|
204
|
-
"
|
|
205
|
-
"translationPaths":
|
|
206
|
-
"en": "/assets/i18n/en.json",
|
|
207
|
-
"es": "/assets/i18n/es.json",
|
|
208
|
-
"pt": "/assets/i18n/pt.json"
|
|
209
|
-
}
|
|
190
|
+
"defaultLang": "es",
|
|
191
|
+
"translationPaths": ["/assets/i18n/"]
|
|
210
192
|
}
|
|
211
193
|
```
|
|
212
194
|
|
|
@@ -226,80 +208,13 @@ The `themes.json` file defines available themes and their variants:
|
|
|
226
208
|
|
|
227
209
|
```json
|
|
228
210
|
{
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
{
|
|
235
|
-
"weight": 400,
|
|
236
|
-
"style": "normal",
|
|
237
|
-
"src": "./assets/fonts/Poppins-Regular.ttf"
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"weight": 700,
|
|
241
|
-
"style": "normal",
|
|
242
|
-
"src": "./assets/fonts/Poppins-Bold.ttf"
|
|
243
|
-
}
|
|
244
|
-
]
|
|
245
|
-
}
|
|
246
|
-
],
|
|
247
|
-
"themes": {
|
|
248
|
-
"sixbell_telco": {
|
|
249
|
-
"light": {
|
|
250
|
-
"displayName": "Sixbell Telco Light",
|
|
251
|
-
"daisyuiName": "sixbell_telco__light",
|
|
252
|
-
"prefersDark": false,
|
|
253
|
-
"variables": {
|
|
254
|
-
"--color-primary": "oklch(65.64% 0.1155 219.3)",
|
|
255
|
-
"--color-secondary": "oklch(86.57% 0.0064 255.48)"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
"dark": {
|
|
259
|
-
"displayName": "Sixbell Telco Dark",
|
|
260
|
-
"daisyuiName": "sixbell_telco__dark",
|
|
261
|
-
"prefersDark": true,
|
|
262
|
-
"variables": {
|
|
263
|
-
"--color-primary": "oklch(65.64% 0.1155 219.3)",
|
|
264
|
-
"--color-secondary": "oklch(48.72% 0.0161 276.78)"
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
"custom_theme": {
|
|
269
|
-
"light": {
|
|
270
|
-
"displayName": "Custom Theme Light",
|
|
271
|
-
"daisyuiName": "custom__light",
|
|
272
|
-
"prefersDark": false,
|
|
273
|
-
"variables": {
|
|
274
|
-
"--color-primary": "oklch(70% 0.15 220)",
|
|
275
|
-
"--color-secondary": "oklch(80% 0.1 210)"
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
"dark": {
|
|
279
|
-
"displayName": "Custom Theme Dark",
|
|
280
|
-
"daisyuiName": "custom__dark",
|
|
281
|
-
"prefersDark": true,
|
|
282
|
-
"variables": {
|
|
283
|
-
"--color-primary": "oklch(60% 0.12 220)",
|
|
284
|
-
"--color-secondary": "oklch(50% 0.08 210)"
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
"assets": {
|
|
290
|
-
"sixbell_telco": {
|
|
291
|
-
"logo": {
|
|
292
|
-
"light": "/assets/logos/sixbell-logo-light.svg",
|
|
293
|
-
"dark": "/assets/logos/sixbell-logo-dark.svg"
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
"custom_theme": {
|
|
297
|
-
"logo": {
|
|
298
|
-
"light": "/assets/logos/custom-logo-light.svg",
|
|
299
|
-
"dark": "/assets/logos/custom-logo-dark.svg"
|
|
300
|
-
}
|
|
301
|
-
}
|
|
211
|
+
"meta": {
|
|
212
|
+
"name": "themes",
|
|
213
|
+
"updatedAt": "2026-02-02T00:00:00Z",
|
|
214
|
+
"hash": "themes-v2",
|
|
215
|
+
"schemaVersion": "2"
|
|
302
216
|
},
|
|
217
|
+
"themes": ["/assets/themes/catalog/sixbell_telco.json", "/assets/themes/catalog/custom_theme.json"],
|
|
303
218
|
"defaultTheme": "sixbell_telco",
|
|
304
219
|
"defaultScheme": "system",
|
|
305
220
|
"excludeThemes": []
|
|
@@ -345,13 +260,13 @@ export const appConfig: ApplicationConfig = {
|
|
|
345
260
|
|
|
346
261
|
- **No Recompilation**: Update themes and languages without rebuilding your application
|
|
347
262
|
- **Multi-Tenant Support**: Easily switch themes and language sets per deployment environment
|
|
348
|
-
- **Caching Strategy**:
|
|
263
|
+
- **Caching Strategy**: RuntimeConfigStore keeps last-known-good config in Dexie
|
|
349
264
|
- **Hot Updates**: Changes to `themes.json` and `translation.json` take effect immediately
|
|
350
265
|
- **Persistent Preferences**: User language and theme preferences are stored and restored automatically
|
|
351
266
|
|
|
352
267
|
## Adding Custom Themes
|
|
353
268
|
|
|
354
|
-
Themes are managed through a runtime configuration file (`themes.json`) with
|
|
269
|
+
Themes are managed through a runtime configuration file (`themes.json`) with theme JSON files. This approach allows for:
|
|
355
270
|
|
|
356
271
|
- **Zero Recompilation**: Add/modify themes without rebuilding
|
|
357
272
|
- **Multi-Tenant Support**: Different themes per deployment
|
|
@@ -365,80 +280,13 @@ Add your custom theme to `/assets/themes/themes.json`:
|
|
|
365
280
|
|
|
366
281
|
```json
|
|
367
282
|
{
|
|
368
|
-
"
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
{
|
|
374
|
-
"weight": 400,
|
|
375
|
-
"style": "normal",
|
|
376
|
-
"src": "./assets/fonts/Poppins-Regular.ttf"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"weight": 700,
|
|
380
|
-
"style": "normal",
|
|
381
|
-
"src": "./assets/fonts/Poppins-Bold.ttf"
|
|
382
|
-
}
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
],
|
|
386
|
-
"themes": {
|
|
387
|
-
"sixbell_telco": {
|
|
388
|
-
"light": {
|
|
389
|
-
"displayName": "Sixbell Telco Light",
|
|
390
|
-
"daisyuiName": "sixbell_telco__light",
|
|
391
|
-
"prefersDark": false,
|
|
392
|
-
"variables": {
|
|
393
|
-
"--color-primary": "oklch(65.64% 0.1155 219.3)",
|
|
394
|
-
"--color-secondary": "oklch(86.57% 0.0064 255.48)"
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
"dark": {
|
|
398
|
-
"displayName": "Sixbell Telco Dark",
|
|
399
|
-
"daisyuiName": "sixbell_telco__dark",
|
|
400
|
-
"prefersDark": true,
|
|
401
|
-
"variables": {
|
|
402
|
-
"--color-primary": "oklch(65.64% 0.1155 219.3)",
|
|
403
|
-
"--color-secondary": "oklch(48.72% 0.0161 276.78)"
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
},
|
|
407
|
-
"custom_theme": {
|
|
408
|
-
"light": {
|
|
409
|
-
"displayName": "Custom Theme Light",
|
|
410
|
-
"daisyuiName": "custom__light",
|
|
411
|
-
"prefersDark": false,
|
|
412
|
-
"variables": {
|
|
413
|
-
"--color-primary": "oklch(70% 0.15 220)",
|
|
414
|
-
"--color-secondary": "oklch(80% 0.1 210)"
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
"dark": {
|
|
418
|
-
"displayName": "Custom Theme Dark",
|
|
419
|
-
"daisyuiName": "custom__dark",
|
|
420
|
-
"prefersDark": true,
|
|
421
|
-
"variables": {
|
|
422
|
-
"--color-primary": "oklch(60% 0.12 220)",
|
|
423
|
-
"--color-secondary": "oklch(50% 0.08 210)"
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
"assets": {
|
|
429
|
-
"sixbell_telco": {
|
|
430
|
-
"logo": {
|
|
431
|
-
"light": "/assets/logos/sixbell-logo-light.svg",
|
|
432
|
-
"dark": "/assets/logos/sixbell-logo-dark.svg"
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
"custom_theme": {
|
|
436
|
-
"logo": {
|
|
437
|
-
"light": "/assets/logos/custom-logo-light.svg",
|
|
438
|
-
"dark": "/assets/logos/custom-logo-dark.svg"
|
|
439
|
-
}
|
|
440
|
-
}
|
|
283
|
+
"meta": {
|
|
284
|
+
"name": "themes",
|
|
285
|
+
"updatedAt": "2026-02-02T00:00:00Z",
|
|
286
|
+
"hash": "themes-v2",
|
|
287
|
+
"schemaVersion": "2"
|
|
441
288
|
},
|
|
289
|
+
"themes": ["/assets/themes/catalog/sixbell_telco.json", "/assets/themes/catalog/custom_theme.json"],
|
|
442
290
|
"defaultTheme": "sixbell_telco",
|
|
443
291
|
"defaultScheme": "system",
|
|
444
292
|
"excludeThemes": []
|
|
@@ -447,11 +295,7 @@ Add your custom theme to `/assets/themes/themes.json`:
|
|
|
447
295
|
|
|
448
296
|
**Configuration Structure:**
|
|
449
297
|
|
|
450
|
-
- `
|
|
451
|
-
- `themes`: Theme variants (light/dark) with CSS variables and DaisyUI names
|
|
452
|
-
- `daisyuiName`: Maps to CSS `@plugin "daisyui/theme" { name: '...' }`
|
|
453
|
-
- `variables`: CSS custom properties applied to this theme variant
|
|
454
|
-
- `assets`: Theme-specific resources (logos, banners) for light/dark schemes
|
|
298
|
+
- `themes`: Theme JSON paths
|
|
455
299
|
- `defaultTheme`: Initial theme on app startup
|
|
456
300
|
- `defaultScheme`: Initial color scheme (`'system'`, `'light'`, or `'dark'`)
|
|
457
301
|
|
|
@@ -508,7 +352,9 @@ export class ThemeSwitcherComponent {
|
|
|
508
352
|
themeService = inject(ThemeService);
|
|
509
353
|
private assetsService = inject(ThemeAssetsService);
|
|
510
354
|
|
|
511
|
-
logoUrl = computed(
|
|
355
|
+
logoUrl = computed(
|
|
356
|
+
() => this.assetsService.getAssetUrl(this.themeService.selectedTheme(), 'logo', this.themeService.resolvedScheme()) || '/default-logo.svg',
|
|
357
|
+
);
|
|
512
358
|
}
|
|
513
359
|
```
|
|
514
360
|
|
|
@@ -599,19 +445,15 @@ Create `/assets/translation/translation.json` in your application:
|
|
|
599
445
|
|
|
600
446
|
```json
|
|
601
447
|
{
|
|
602
|
-
"
|
|
603
|
-
"translationPaths":
|
|
604
|
-
"en": "/assets/i18n/en.json",
|
|
605
|
-
"es": "/assets/i18n/es.json",
|
|
606
|
-
"pt": "/assets/i18n/pt.json"
|
|
607
|
-
}
|
|
448
|
+
"defaultLang": "es",
|
|
449
|
+
"translationPaths": ["/assets/i18n/"]
|
|
608
450
|
}
|
|
609
451
|
```
|
|
610
452
|
|
|
611
453
|
**Configuration Structure:**
|
|
612
454
|
|
|
613
|
-
- `
|
|
614
|
-
- `translationPaths`:
|
|
455
|
+
- `defaultLang`: Language code used on app initialization
|
|
456
|
+
- `translationPaths`: List of directories that contain `{lang}.json`
|
|
615
457
|
- Custom paths are fully supported - organize as needed for your architecture
|
|
616
458
|
|
|
617
459
|
### 2. Create Translation Files
|
|
@@ -1014,7 +856,7 @@ import { inject } from '@angular/core';
|
|
|
1014
856
|
export class MyComponent {
|
|
1015
857
|
private translationService = inject(TranslationService);
|
|
1016
858
|
|
|
1017
|
-
availableLanguages = this.translationService.
|
|
859
|
+
availableLanguages = this.translationService.getAvailableLanguageCodes();
|
|
1018
860
|
currentLanguage = this.translationService.currentLanguage;
|
|
1019
861
|
|
|
1020
862
|
setLanguage(languageCode: string) {
|
|
@@ -1022,7 +864,7 @@ export class MyComponent {
|
|
|
1022
864
|
}
|
|
1023
865
|
|
|
1024
866
|
getLanguageName(languageCode: string): string {
|
|
1025
|
-
return this.translationService.
|
|
867
|
+
return this.translationService.getLanguageDisplayName(languageCode);
|
|
1026
868
|
}
|
|
1027
869
|
}
|
|
1028
870
|
```
|
|
@@ -1134,12 +976,195 @@ export class MyComponent {
|
|
|
1134
976
|
}
|
|
1135
977
|
```
|
|
1136
978
|
|
|
979
|
+
## Quick Start
|
|
980
|
+
|
|
981
|
+
### Using Components
|
|
982
|
+
|
|
983
|
+
```typescript
|
|
984
|
+
import { Component } from '@angular/core';
|
|
985
|
+
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
986
|
+
import { CardComponent } from '@sixbell-telco/sdk/components/card';
|
|
987
|
+
|
|
988
|
+
@Component({
|
|
989
|
+
selector: 'app-example',
|
|
990
|
+
standalone: true,
|
|
991
|
+
imports: [ButtonComponent, CardComponent],
|
|
992
|
+
template: `
|
|
993
|
+
<st-card>
|
|
994
|
+
<h2>Hello World</h2>
|
|
995
|
+
<st-button variant="primary">Click me!</st-button>
|
|
996
|
+
</st-card>
|
|
997
|
+
`,
|
|
998
|
+
})
|
|
999
|
+
export class ExampleComponent {}
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
### Using Form Components
|
|
1003
|
+
|
|
1004
|
+
```typescript
|
|
1005
|
+
import { Component, signal } from '@angular/core';
|
|
1006
|
+
import { ReactiveFormsModule, FormControl, FormGroup } from '@angular/forms';
|
|
1007
|
+
import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
|
|
1008
|
+
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1009
|
+
|
|
1010
|
+
@Component({
|
|
1011
|
+
selector: 'app-form-example',
|
|
1012
|
+
standalone: true,
|
|
1013
|
+
imports: [InputComponent, ButtonComponent, ReactiveFormsModule],
|
|
1014
|
+
template: `
|
|
1015
|
+
<form [formGroup]="form">
|
|
1016
|
+
<st-input formControlName="email" placeholder="Enter email"></st-input>
|
|
1017
|
+
<st-button (click)="submit()">Submit</st-button>
|
|
1018
|
+
</form>
|
|
1019
|
+
`,
|
|
1020
|
+
})
|
|
1021
|
+
export class FormExampleComponent {
|
|
1022
|
+
form = new FormGroup({
|
|
1023
|
+
email: new FormControl(''),
|
|
1024
|
+
});
|
|
1025
|
+
|
|
1026
|
+
submit() {
|
|
1027
|
+
console.log(this.form.value);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
### Using Services
|
|
1033
|
+
|
|
1034
|
+
```typescript
|
|
1035
|
+
import { Component, inject, effect } from '@angular/core';
|
|
1036
|
+
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
1037
|
+
import { TranslationService } from '@sixbell-telco/sdk/utils/translation';
|
|
1038
|
+
import { LoggerService } from '@sixbell-telco/sdk/utils/logger';
|
|
1039
|
+
|
|
1040
|
+
@Component({
|
|
1041
|
+
selector: 'app-services-example',
|
|
1042
|
+
template: `
|
|
1043
|
+
<div>
|
|
1044
|
+
<p>Current Theme: {{ themeService.selectedTheme() }}</p>
|
|
1045
|
+
<p>Dark Mode: {{ themeService.isDarkTheme() ? 'Yes' : 'No' }}</p>
|
|
1046
|
+
<button (click)="toggleTheme()">Toggle Theme</button>
|
|
1047
|
+
</div>
|
|
1048
|
+
`,
|
|
1049
|
+
})
|
|
1050
|
+
export class ServicesExampleComponent {
|
|
1051
|
+
themeService = inject(ThemeService);
|
|
1052
|
+
translationService = inject(TranslationService);
|
|
1053
|
+
logger = inject(LoggerService);
|
|
1054
|
+
|
|
1055
|
+
constructor() {
|
|
1056
|
+
effect(() => {
|
|
1057
|
+
this.logger.info(`Theme changed to: ${this.themeService.selectedTheme()}`);
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
toggleTheme() {
|
|
1062
|
+
const newScheme = this.themeService.isDarkTheme() ? 'light' : 'dark';
|
|
1063
|
+
this.themeService.setScheme(newScheme);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
```
|
|
1067
|
+
|
|
1068
|
+
## Configuration
|
|
1069
|
+
|
|
1070
|
+
### Theme Configuration
|
|
1071
|
+
|
|
1072
|
+
Runtime themes are loaded from `themes.json`. See [Theme Service README](utils/theme/) for detailed configuration.
|
|
1073
|
+
|
|
1074
|
+
### Translation Configuration
|
|
1075
|
+
|
|
1076
|
+
Runtime translations are loaded from `translation.json`. See [Translation Service README](utils/translation/) for detailed configuration.
|
|
1077
|
+
|
|
1078
|
+
### Logger Configuration
|
|
1079
|
+
|
|
1080
|
+
Configure logging levels and output. See [Logger Service README](utils/logger/) for detailed options.
|
|
1081
|
+
|
|
1082
|
+
## Architecture
|
|
1083
|
+
|
|
1084
|
+
### Multi-Entry Point Imports
|
|
1085
|
+
|
|
1086
|
+
Always use specific imports for optimal tree-shaking:
|
|
1087
|
+
|
|
1088
|
+
```typescript
|
|
1089
|
+
// ✅ Correct - specific imports
|
|
1090
|
+
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
1091
|
+
import { ThemeService } from '@sixbell-telco/sdk/utils/theme';
|
|
1092
|
+
|
|
1093
|
+
// ❌ Avoid - barrel exports
|
|
1094
|
+
import { ButtonComponent } from '@sixbell-telco/sdk';
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
### Component Prefix
|
|
1098
|
+
|
|
1099
|
+
All SDK components use the `st-` prefix:
|
|
1100
|
+
|
|
1101
|
+
```html
|
|
1102
|
+
<st-button>Button</st-button>
|
|
1103
|
+
<st-input type="text" />
|
|
1104
|
+
<st-card>Card Content</st-card>
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
### Signal-Based API
|
|
1108
|
+
|
|
1109
|
+
Components use Angular 19 signals for reactive inputs:
|
|
1110
|
+
|
|
1111
|
+
```typescript
|
|
1112
|
+
variant = input<'primary' | 'secondary'>();
|
|
1113
|
+
isDisabled = input(false);
|
|
1114
|
+
|
|
1115
|
+
@Component({
|
|
1116
|
+
template: `<button [disabled]="isDisabled()">{{ variant() }}</button>`,
|
|
1117
|
+
})
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
## Testing
|
|
1121
|
+
|
|
1122
|
+
The SDK includes Jest configuration. Run tests with:
|
|
1123
|
+
|
|
1124
|
+
```bash
|
|
1125
|
+
npm test # Run all tests
|
|
1126
|
+
npm run test:watch # Watch mode
|
|
1127
|
+
npm run test:coverage # Coverage report
|
|
1128
|
+
```
|
|
1129
|
+
|
|
1130
|
+
See `.github/instructions/testing-basics.instructions.md` for Angular 19 testing patterns.
|
|
1131
|
+
|
|
1137
1132
|
## Documentation
|
|
1138
1133
|
|
|
1139
|
-
|
|
1134
|
+
- **Component Stories**: View component documentation in [Storybook](../storybook/README.md)
|
|
1135
|
+
- **Live Examples**: Showcase app at `projects/showcase/`
|
|
1136
|
+
- **API Documentation**: JSDoc comments in component files
|
|
1137
|
+
- **Changelog**: See [CHANGELOG.md](./CHANGELOG.md)
|
|
1138
|
+
|
|
1139
|
+
## Contributing
|
|
1140
|
+
|
|
1141
|
+
When creating new components:
|
|
1142
|
+
|
|
1143
|
+
1. Use `st-` prefix for selectors
|
|
1144
|
+
2. Follow CVA pattern for styling variants
|
|
1145
|
+
3. Use signal-based inputs
|
|
1146
|
+
4. Add comprehensive JSDoc comments
|
|
1147
|
+
5. Create Storybook stories
|
|
1148
|
+
6. Add unit tests with Jest
|
|
1149
|
+
7. Update CHANGELOG.md
|
|
1150
|
+
|
|
1151
|
+
## Resources
|
|
1152
|
+
|
|
1153
|
+
- <a href="https://angular.dev" target="_blank" rel="noopener noreferrer">Angular Documentation</a>
|
|
1154
|
+
- <a href="https://tailwindcss.com" target="_blank" rel="noopener noreferrer">Tailwind CSS</a>
|
|
1155
|
+
- <a href="https://daisyui.com" target="_blank" rel="noopener noreferrer">DaisyUI</a>
|
|
1156
|
+
- <a href="https://cva.style" target="_blank" rel="noopener noreferrer">class-variance-authority</a>
|
|
1157
|
+
- <a href="https://ng-icons.herokuapp.com" target="_blank" rel="noopener noreferrer">ng-icons</a>
|
|
1158
|
+
- <a href="https://material.angular.io/cdk" target="_blank" rel="noopener noreferrer">Angular CDK</a>
|
|
1159
|
+
|
|
1160
|
+
## License
|
|
1161
|
+
|
|
1162
|
+
MIT - See [LICENSE](./LICENSE) file for details
|
|
1163
|
+
|
|
1164
|
+
## Support
|
|
1140
1165
|
|
|
1141
|
-
|
|
1166
|
+
For issues, questions, or feature requests, please visit the project repository or contact the Sixbell Telco team.
|
|
1142
1167
|
|
|
1143
|
-
|
|
1168
|
+
---
|
|
1144
1169
|
|
|
1145
|
-
|
|
1170
|
+
**Last updated**: November 24, 2025
|