@attraccess/plugins-frontend-ui 1.10.0 → 1.11.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +40 -1
  2. package/index.js +1847 -2467
  3. package/lib/components/AlertStatusIcon.d.ts +6 -0
  4. package/lib/components/EmptyState.d.ts +5 -0
  5. package/lib/components/LabeledSwitch.d.ts +11 -0
  6. package/lib/components/ResourceSelector/ResourceSelector.d.ts +2 -2
  7. package/lib/components/StandardDrawer.d.ts +12 -0
  8. package/lib/components/StandardModal.d.ts +21 -0
  9. package/lib/components/StatusAlert.d.ts +9 -0
  10. package/lib/components/attraccess-user/AttraccessUser.d.ts +1 -1
  11. package/lib/components/attraccess-user/AttraccessUserActionsContext.d.ts +1 -1
  12. package/lib/components/button/index.d.ts +3 -0
  13. package/lib/components/datetime-display/DateTimeDisplay.d.ts +1 -1
  14. package/lib/components/delete-confirmation-modal/index.d.ts +10 -0
  15. package/lib/components/index.d.ts +13 -0
  16. package/lib/components/loading-indicator/index.d.ts +4 -0
  17. package/lib/components/page-header/accessory.d.ts +15 -0
  18. package/lib/components/page-header/actions.d.ts +39 -0
  19. package/lib/components/page-header/index.d.ts +19 -0
  20. package/lib/components/password-input/PasswordInput.d.ts +15 -0
  21. package/lib/components/status-dialog/index.d.ts +33 -0
  22. package/lib/components/string-list-field/StringListField.d.ts +25 -0
  23. package/lib/components/user-search/UserSearch.d.ts +2 -3
  24. package/lib/hooks/index.d.ts +4 -1
  25. package/lib/hooks/useDateTimeFormatter.d.ts +8 -0
  26. package/lib/hooks/useDateTimeLocale.d.ts +1 -0
  27. package/lib/hooks/useDateTimePreferences.d.ts +4 -0
  28. package/lib/hooks/useFormatDateTime.d.ts +1 -6
  29. package/lib/hooks/{useFormatDuration.d.ts → useFormatedDuration.d.ts} +2 -2
  30. package/lib/i18n.d.ts +18 -2
  31. package/package.json +6 -1
package/README.md CHANGED
@@ -1,6 +1,45 @@
1
1
  # plugins-frontend-ui
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ Shared frontend components and internationalization for the core and plugins.
4
+
5
+ ## Plugin translations
6
+
7
+ Use `useTranslations` with plugin-owned English and German catalogs. The hook
8
+ subscribes to the core language store, so already-mounted pages, forms and slot
9
+ contributions update when the user selects a language in Attraccess.
10
+
11
+ ```tsx
12
+ import { useTranslations } from '@attraccess/plugins-frontend-ui';
13
+ import en from './en.json';
14
+ import de from './de.json';
15
+
16
+ const translations = { en, de };
17
+
18
+ export function DevicesPage() {
19
+ const { t, language } = useTranslations(translations);
20
+ return <h1>{t('devices.title')}</h1>;
21
+ }
22
+ ```
23
+
24
+ Catalog strings support Handlebars interpolation (`{{name}}`) and plural
25
+ objects (`{ "one": "One device", "many": "{{count}} devices" }`). Missing German
26
+ keys fall back to English. Use the returned `language` for locale-dependent
27
+ date and number formatting. Translate labels and explanatory text; retain
28
+ user-entered names, identifiers and protocol values.
29
+
30
+ The host and plugin federation configurations must share
31
+ `@attraccess/plugins-frontend-ui`. The official plugin build helper configures
32
+ this as a host-owned singleton with no remote fallback. Bundling a private
33
+ copy would create a separate language store. Plugins should not call
34
+ `detectAndSetLanguage` or persist an independent language preference: the core
35
+ owns detection and selection. Supported personal choices and browser languages
36
+ take precedence over the configured system default. The system default is the
37
+ fallback when neither has an English or German translation. Detection does not
38
+ persist a fallback as a personal choice.
39
+
40
+ Explicit selections are retained in memory when browser storage is unavailable.
41
+ Detection and system fallback resolution update the displayed language without
42
+ marking it as an explicit preference.
4
43
 
5
44
  ## Running unit tests
6
45