@konce-pt/angular 0.3.0 → 0.4.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/README.md CHANGED
@@ -32,6 +32,7 @@
32
32
  - 🎨 **100% tokenized** — every style is a `var(--kpt-*)` CSS custom property. Light/dark theme, neutral OKLCH palette. Swap the brand by swapping one token layer.
33
33
  - 🧩 **Standalone components** — no NgModules. Import only what you use; tree-shakeable.
34
34
  - ♿ **Built on Angular CDK** — overlays, a11y, focus management, virtual scrolling.
35
+ - 🌍 **i18n built in** — English (default) & Polish out of the box, runtime locale switch, add any language with one JSON.
35
36
 
36
37
  ## Installation
37
38
 
@@ -166,6 +167,40 @@ import { provideKptTablerIcons } from '@konce-pt/angular/icons';
166
167
  // providers: [provideKptTablerIcons()]
167
168
  ```
168
169
 
170
+ ## Internationalization (i18n)
171
+
172
+ Component labels ship in **English (default)** and **Polish**. All user-facing strings — aria-labels, empty states, paginator, calendars, rich-text menus — read from a signal-based service, so switching locale updates the UI instantly (zoneless-friendly).
173
+
174
+ ```ts
175
+ import { provideKptI18n } from '@konce-pt/angular';
176
+ // providers: [provideKptI18n({ locale: 'pl' })] // Polish UI
177
+ ```
178
+
179
+ Switch at runtime:
180
+
181
+ ```ts
182
+ import { inject } from '@angular/core';
183
+ import { KptI18n } from '@konce-pt/angular';
184
+
185
+ const i18n = inject(KptI18n);
186
+ i18n.setLocale('en');
187
+ ```
188
+
189
+ **Add any language with one JSON** (shape = the `KptMessages` contract; missing keys fall back to English):
190
+
191
+ ```ts
192
+ import de from './i18n/de.json';
193
+ provideKptI18n({ locale: 'de', messages: { de } });
194
+ ```
195
+
196
+ **Override individual labels** of an existing language:
197
+
198
+ ```ts
199
+ provideKptI18n({ messages: { en: { paginator: { rowsPerPage: 'Rows per page:' } } } });
200
+ ```
201
+
202
+ Calendar weekday/month names come from the browser's `Intl` API for the active locale. Per-component label inputs (e.g. `emptyMessage`, `acceptLabel`) still take precedence over the dictionary.
203
+
169
204
  ## Documentation
170
205
 
171
206
  - **Storybook** — interactive docs for every component.
@@ -192,6 +227,7 @@ import { provideKptTablerIcons } from '@konce-pt/angular/icons';
192
227
  - 📊 **Flagowa tabela danych** — sortowanie, filtr, paginacja, virtual scroll, zaznaczanie, przestawianie/zamrażanie kolumn, eksport CSV, szablony komórek.
193
228
  - 🎨 **100% na tokenach** — każdy styl to `var(--kpt-*)`. Motyw jasny/ciemny, neutralna paleta OKLCH.
194
229
  - 🧩 **Standalone** — bez NgModules, tree-shaking.
230
+ - 🌍 **Wbudowane i18n** — angielski (domyślny) i polski, przełączanie języka w runtime, dowolny język jednym plikiem JSON.
195
231
 
196
232
  ### Instalacja
197
233
 
@@ -217,6 +253,27 @@ npm i @konce-pt/angular @konce-pt/tokens @konce-pt/styles
217
253
 
218
254
  Motyw ciemny: `<html data-theme="dark">`; nadpisania `--kpt-color-*` w `styles.scss`. Pełny zestaw ikon Tabler: `provideKptTablerIcons()` z `@konce-pt/angular/icons`.
219
255
 
256
+ ### Internacjonalizacja (i18n)
257
+
258
+ Etykiety komponentów są dostępne po **angielsku (domyślnie)** i **polsku**. Wszystkie napisy (aria-label, stany puste, paginator, kalendarze, menu edytora) pochodzą z serwisu opartego o sygnały — zmiana języka odświeża UI natychmiast (zoneless).
259
+
260
+ ```ts
261
+ import { provideKptI18n } from '@konce-pt/angular';
262
+ // providers: [provideKptI18n({ locale: 'pl' })] // polski interfejs
263
+ ```
264
+
265
+ Przełączanie w runtime: `inject(KptI18n).setLocale('en')`.
266
+
267
+ **Własny język jednym plikiem JSON** (kształt = kontrakt `KptMessages`; brakujące klucze spadają na EN):
268
+
269
+ ```ts
270
+ import de from './i18n/de.json';
271
+ provideKptI18n({ locale: 'de', messages: { de } });
272
+ ```
273
+
274
+ Nadpisanie pojedynczych etykiet: `provideKptI18n({ messages: { pl: { paginator: { rowsPerPage: 'Na stronie:' } } } })`.
275
+ Nazwy dni/miesięcy w kalendarzach pochodzą z `Intl` wg locale. Inputy etykiet per-komponent (np. `emptyMessage`) mają priorytet nad słownikiem.
276
+
220
277
  ### Komponenty (70+)
221
278
 
222
279
  Formularze (Signal Forms), przyciski i akcje, layout, nawigacja, dane (z flagową `kpt-data-table`), feedback i overlay — pełna lista w tabeli powyżej. Każdy komponent ma plik `llms.txt` z opisem API obok źródła.
package/dist/README.md CHANGED
@@ -32,6 +32,7 @@
32
32
  - 🎨 **100% tokenized** — every style is a `var(--kpt-*)` CSS custom property. Light/dark theme, neutral OKLCH palette. Swap the brand by swapping one token layer.
33
33
  - 🧩 **Standalone components** — no NgModules. Import only what you use; tree-shakeable.
34
34
  - ♿ **Built on Angular CDK** — overlays, a11y, focus management, virtual scrolling.
35
+ - 🌍 **i18n built in** — English (default) & Polish out of the box, runtime locale switch, add any language with one JSON.
35
36
 
36
37
  ## Installation
37
38
 
@@ -166,6 +167,40 @@ import { provideKptTablerIcons } from '@konce-pt/angular/icons';
166
167
  // providers: [provideKptTablerIcons()]
167
168
  ```
168
169
 
170
+ ## Internationalization (i18n)
171
+
172
+ Component labels ship in **English (default)** and **Polish**. All user-facing strings — aria-labels, empty states, paginator, calendars, rich-text menus — read from a signal-based service, so switching locale updates the UI instantly (zoneless-friendly).
173
+
174
+ ```ts
175
+ import { provideKptI18n } from '@konce-pt/angular';
176
+ // providers: [provideKptI18n({ locale: 'pl' })] // Polish UI
177
+ ```
178
+
179
+ Switch at runtime:
180
+
181
+ ```ts
182
+ import { inject } from '@angular/core';
183
+ import { KptI18n } from '@konce-pt/angular';
184
+
185
+ const i18n = inject(KptI18n);
186
+ i18n.setLocale('en');
187
+ ```
188
+
189
+ **Add any language with one JSON** (shape = the `KptMessages` contract; missing keys fall back to English):
190
+
191
+ ```ts
192
+ import de from './i18n/de.json';
193
+ provideKptI18n({ locale: 'de', messages: { de } });
194
+ ```
195
+
196
+ **Override individual labels** of an existing language:
197
+
198
+ ```ts
199
+ provideKptI18n({ messages: { en: { paginator: { rowsPerPage: 'Rows per page:' } } } });
200
+ ```
201
+
202
+ Calendar weekday/month names come from the browser's `Intl` API for the active locale. Per-component label inputs (e.g. `emptyMessage`, `acceptLabel`) still take precedence over the dictionary.
203
+
169
204
  ## Documentation
170
205
 
171
206
  - **Storybook** — interactive docs for every component.
@@ -192,6 +227,7 @@ import { provideKptTablerIcons } from '@konce-pt/angular/icons';
192
227
  - 📊 **Flagowa tabela danych** — sortowanie, filtr, paginacja, virtual scroll, zaznaczanie, przestawianie/zamrażanie kolumn, eksport CSV, szablony komórek.
193
228
  - 🎨 **100% na tokenach** — każdy styl to `var(--kpt-*)`. Motyw jasny/ciemny, neutralna paleta OKLCH.
194
229
  - 🧩 **Standalone** — bez NgModules, tree-shaking.
230
+ - 🌍 **Wbudowane i18n** — angielski (domyślny) i polski, przełączanie języka w runtime, dowolny język jednym plikiem JSON.
195
231
 
196
232
  ### Instalacja
197
233
 
@@ -217,6 +253,27 @@ npm i @konce-pt/angular @konce-pt/tokens @konce-pt/styles
217
253
 
218
254
  Motyw ciemny: `<html data-theme="dark">`; nadpisania `--kpt-color-*` w `styles.scss`. Pełny zestaw ikon Tabler: `provideKptTablerIcons()` z `@konce-pt/angular/icons`.
219
255
 
256
+ ### Internacjonalizacja (i18n)
257
+
258
+ Etykiety komponentów są dostępne po **angielsku (domyślnie)** i **polsku**. Wszystkie napisy (aria-label, stany puste, paginator, kalendarze, menu edytora) pochodzą z serwisu opartego o sygnały — zmiana języka odświeża UI natychmiast (zoneless).
259
+
260
+ ```ts
261
+ import { provideKptI18n } from '@konce-pt/angular';
262
+ // providers: [provideKptI18n({ locale: 'pl' })] // polski interfejs
263
+ ```
264
+
265
+ Przełączanie w runtime: `inject(KptI18n).setLocale('en')`.
266
+
267
+ **Własny język jednym plikiem JSON** (kształt = kontrakt `KptMessages`; brakujące klucze spadają na EN):
268
+
269
+ ```ts
270
+ import de from './i18n/de.json';
271
+ provideKptI18n({ locale: 'de', messages: { de } });
272
+ ```
273
+
274
+ Nadpisanie pojedynczych etykiet: `provideKptI18n({ messages: { pl: { paginator: { rowsPerPage: 'Na stronie:' } } } })`.
275
+ Nazwy dni/miesięcy w kalendarzach pochodzą z `Intl` wg locale. Inputy etykiet per-komponent (np. `emptyMessage`) mają priorytet nad słownikiem.
276
+
220
277
  ### Komponenty (70+)
221
278
 
222
279
  Formularze (Signal Forms), przyciski i akcje, layout, nawigacja, dane (z flagową `kpt-data-table`), feedback i overlay — pełna lista w tabeli powyżej. Każdy komponent ma plik `llms.txt` z opisem API obok źródła.