@mk-kit/ui 0.43.0 → 0.45.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
@@ -165,6 +165,15 @@ bootstrapApplication(AppRoot, {
165
165
  });
166
166
  ```
167
167
 
168
+ Complete translations are their own entry points, so an app carries only the
169
+ locales it provides — today Polish:
170
+
171
+ ```ts
172
+ import { provideMkI18nPl } from '@mk-kit/ui/locales/pl';
173
+
174
+ providers: [provideMkI18nPl({ noData: 'Nic tu nie ma' })]; // overrides merge over the pack
175
+ ```
176
+
168
177
  Overrides can be scoped to a component subtree for mixed-locale screens.
169
178
  Layout and arrow keys flip under `dir="rtl"`.
170
179
 
@@ -176,6 +185,8 @@ modals, an Escape that closes only the topmost overlay, live-region
176
185
  announcements for async state, contrast-checked tokens in both themes,
177
186
  `prefers-reduced-motion` and `forced-colors` support. Axe runs over rendered
178
187
  fixtures in the test suite; information is never conveyed by colour alone.
188
+ The [accessibility statement](https://mk-kit.dev/accessibility) lists what is
189
+ verified automatically and the known gaps.
179
190
 
180
191
  ## SSR & zoneless
181
192
 
@@ -1585,6 +1585,11 @@ const MK_DEFAULT_I18N = {
1585
1585
  chartShare: 'Share',
1586
1586
  chartLabel: 'Label',
1587
1587
  qrCodeLabel: (text) => `QR code: ${text}`,
1588
+ sortableListLabel: 'Sortable list',
1589
+ filterColumn: (column) => `Filter ${column}`,
1590
+ clearFilter: (column) => `Clear filter for ${column}`,
1591
+ filterAny: 'All',
1592
+ filterMin: 'Min',
1588
1593
  blockEditor: {
1589
1594
  addBlock: 'Add block',
1590
1595
  addFirstBlock: 'Add your first block',
@@ -1719,25 +1724,37 @@ const MK_I18N = new InjectionToken('MK_I18N', {
1719
1724
  factory: () => MK_DEFAULT_I18N,
1720
1725
  });
1721
1726
  /**
1722
- * Provide localised strings (merged over the English defaults) pass any
1723
- * subset. The nested `dateNames`, `blockEditor` and `validation` groups are
1724
- * merged deeply, so partial overrides of those work too.
1727
+ * Merges `overrides` over a complete string mapshallow for the top level,
1728
+ * deep for the `dateNames`, `blockEditor` and `validation` groups. Exported
1729
+ * so locale packs and tests can build a map without providing it.
1730
+ */
1731
+ function mkMergeI18n(base, overrides) {
1732
+ return {
1733
+ ...base,
1734
+ ...overrides,
1735
+ dateNames: { ...base.dateNames, ...overrides.dateNames },
1736
+ blockEditor: { ...base.blockEditor, ...overrides.blockEditor },
1737
+ validation: { ...base.validation, ...overrides.validation },
1738
+ };
1739
+ }
1740
+ /**
1741
+ * Provide localised strings — pass any subset, merged over `base` (the
1742
+ * English defaults unless given). The nested `dateNames`, `blockEditor` and
1743
+ * `validation` groups are merged deeply, so partial overrides of those work
1744
+ * too.
1725
1745
  *
1726
1746
  * ```ts
1727
1747
  * bootstrapApplication(App, {
1728
1748
  * providers: [provideMkI18n({ noResults: 'Brak wyników', close: 'Zamknij' })],
1729
1749
  * });
1730
1750
  * ```
1751
+ *
1752
+ * A locale pack is a complete map that serves as the base — either through
1753
+ * its own helper (`provideMkI18nPl(overrides)` from `@mk-kit/ui/locales/pl`)
1754
+ * or explicitly: `provideMkI18n(overrides, MK_PL_I18N)`.
1731
1755
  */
1732
- function provideMkI18n(overrides) {
1733
- const value = {
1734
- ...MK_DEFAULT_I18N,
1735
- ...overrides,
1736
- dateNames: { ...MK_DEFAULT_DATE_NAMES, ...overrides.dateNames },
1737
- blockEditor: { ...MK_DEFAULT_I18N.blockEditor, ...overrides.blockEditor },
1738
- validation: { ...MK_DEFAULT_VALIDATION, ...overrides.validation },
1739
- };
1740
- return { provide: MK_I18N, useValue: value };
1756
+ function provideMkI18n(overrides, base = MK_DEFAULT_I18N) {
1757
+ return { provide: MK_I18N, useValue: mkMergeI18n(base, overrides) };
1741
1758
  }
1742
1759
 
1743
1760
  /**
@@ -2256,5 +2273,5 @@ function mkQueryToText(group, fields = [], i18n = MK_DEFAULT_I18N) {
2256
2273
  * Generated bundle index. Do not edit.
2257
2274
  */
2258
2275
 
2259
- export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
2276
+ export { MK_BREAKPOINTS, MK_DEFAULT_BREAKPOINTS, MK_DEFAULT_DATE_NAMES, MK_DEFAULT_I18N, MK_DEFAULT_VALIDATION, MK_I18N, MK_OVERLAY_DATA, MK_QUERY_OPERATORS, MK_QUERY_UNARY, MkAnchoredPanel, MkBreakpointService, MkFieldContext, MkFocusTrap, MkLiveAnnouncer, MkOverlayRef, MkOverlayService, MkThemeService, mkComputeAnchoredPosition, mkCreateQueryGroup, mkCreateQueryRule, mkFirstErrorMessage, mkGetFocusable, mkHighlight, mkHighlightJson, mkInjectFieldTouched, mkIsQueryGroup, mkIsResponsive, mkMergeI18n, mkQueryCompact, mkQueryIsEmpty, mkQueryOperatorLabel, mkQueryOperatorsFor, mkQueryRuleCount, mkQueryRuleIsComplete, mkQueryRuleMatches, mkQueryToPredicate, mkQueryToText, mkSignalErrorMessage, mkSignalErrorsToValidationErrors, mkUniqueId, mkValidatorChange, provideMkI18n };
2260
2277
  //# sourceMappingURL=mk-kit-ui-core.mjs.map