@seij/common-ui 0.1.1 → 0.1.3

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 (41) hide show
  1. package/README.md +15 -3
  2. package/dist/index.d.ts +3 -2
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +101 -95
  5. package/dist/index.js.map +1 -1
  6. package/dist/init/SeijUIProvider.d.ts.map +1 -1
  7. package/dist/init/SeijUIProvider.js +8 -8
  8. package/dist/init/SeijUIProvider.js.map +1 -1
  9. package/dist/lib/applicationshell/ApplicationShell.js +30 -30
  10. package/dist/lib/applicationshell/ApplicationShell.js.map +1 -1
  11. package/dist/lib/i18n/i18n.detect.js +5 -6
  12. package/dist/lib/i18n/i18n.detect.js.map +1 -1
  13. package/dist/lib/i18n/i18n.react.d.ts +2 -11
  14. package/dist/lib/i18n/i18n.react.d.ts.map +1 -1
  15. package/dist/lib/i18n/i18n.react.js +29 -23
  16. package/dist/lib/i18n/i18n.react.js.map +1 -1
  17. package/dist/lib/i18n/i18n.service.d.ts +27 -0
  18. package/dist/lib/i18n/i18n.service.d.ts.map +1 -0
  19. package/dist/lib/i18n/i18n.service.js +65 -0
  20. package/dist/lib/i18n/i18n.service.js.map +1 -0
  21. package/dist/lib/i18n/i18n.types.d.ts +3 -3
  22. package/dist/lib/i18n/i18n.types.d.ts.map +1 -1
  23. package/dist/lib/i18n/index.d.ts +2 -1
  24. package/dist/lib/i18n/index.d.ts.map +1 -1
  25. package/dist/lib/localdate/InputLocalDate.js +1 -1
  26. package/dist/lib/localdate/InputLocalDate.js.map +1 -1
  27. package/dist/lib/month/InputMonth.js +1 -1
  28. package/dist/lib/month/InputMonth.js.map +1 -1
  29. package/dist/lib/number/InputNumber.js +56 -56
  30. package/dist/lib/number/InputNumber.js.map +1 -1
  31. package/dist/lib/percent/InputPercent.js +12 -12
  32. package/dist/lib/percent/InputPercent.js.map +1 -1
  33. package/dist/lib/select/InputSelect.js +15 -16
  34. package/dist/lib/select/InputSelect.js.map +1 -1
  35. package/dist/lib/view_layout/ViewTitle.js +16 -17
  36. package/dist/lib/view_layout/ViewTitle.js.map +1 -1
  37. package/package.json +4 -4
  38. package/dist/lib/i18n/i18n.factory.d.ts +0 -3
  39. package/dist/lib/i18n/i18n.factory.d.ts.map +0 -1
  40. package/dist/lib/i18n/i18n.factory.js +0 -70
  41. package/dist/lib/i18n/i18n.factory.js.map +0 -1
package/README.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # @seij/common-ui
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ Business-oriented UI components for Seij applications, built on React and
4
+ designed to sit on top of Fluent UI while keeping a framework-agnostic direction
5
+ for our other applications..
4
6
 
5
- ## Running unit tests
7
+ ## What it provides
8
+
9
+ - Application shell and navigation building blocks.
10
+ - Form layout primitives and input controls (text, select, numbers, dates,
11
+ months, years, money, percent).
12
+ - Data display components (tables, list view, badges, tabs, info/error boxes).
13
+ - UX helpers like loaders, inline edit, error notifier, and button bar.
14
+ - Basic i18n utilities and locale resources (FR/EN).
15
+
16
+ ## Notes
17
+
18
+ - This package exposes UI primitives rather than a full design system.
6
19
 
7
- Run `nx test common-ui` to execute the unit tests.
package/dist/index.d.ts CHANGED
@@ -11,10 +11,9 @@ export * from './lib/datatabledynamic/DataTableDynamic';
11
11
  export * from './lib/error_notifier/ErrorNotifier';
12
12
  export * from './lib/errorbox/ErrorBox';
13
13
  export * from './lib/form_layout/FormLayout';
14
+ export * from './lib/i18n';
14
15
  export * from './lib/info_box/InfoBox';
15
16
  export * from './lib/inlineedit/InlineEdit';
16
- export * from './lib/year/InputDurationYears';
17
- export * from './lib/number';
18
17
  export * from './lib/listview/ListView';
19
18
  export * from './lib/loader/Loader';
20
19
  export * from './lib/localdate/InputLocalDate';
@@ -27,6 +26,7 @@ export * from './lib/month/InputDurationMonths';
27
26
  export * from './lib/month/InputMonth';
28
27
  export * from './lib/navigation/Navigation.types';
29
28
  export * from './lib/navigation/Navigation';
29
+ export * from './lib/number';
30
30
  export * from './lib/percent/InputPercent';
31
31
  export * from './lib/percent/LabelPercent';
32
32
  export * from './lib/percent/LabelPercentInt';
@@ -41,5 +41,6 @@ export * from './lib/view_layout/ViewFooter';
41
41
  export * from './lib/view_layout/ViewHeader';
42
42
  export * from './lib/view_layout/ViewLayout';
43
43
  export * from './lib/view_layout/ViewTitle';
44
+ export * from './lib/year/InputDurationYears';
44
45
  export * from './lib/year/InputYear';
45
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;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C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,113 +1,119 @@
1
1
  import { SeijUIProvider as e } from "./init/SeijUIProvider.js";
2
2
  import { ApplicationShell as p } from "./lib/applicationshell/ApplicationShell.js";
3
3
  import { Badge as m } from "./lib/badge/Badge.js";
4
- import { ButtonBar as f } from "./lib/button_bar/ButtonBar.js";
4
+ import { ButtonBar as n } from "./lib/button_bar/ButtonBar.js";
5
5
  import { Button as i } from "./lib/button/Button.js";
6
6
  import { CommonUi as b } from "./lib/common-ui.js";
7
7
  import { obfuscateLabel as I } from "./lib/commons/obfuscatelabel.js";
8
- import { DataTable as D, DataTableBody as L, DataTableCaption as c, DataTableCell as d, DataTableHead as s, DataTableHeaderCell as y, DataTableRow as B } from "./lib/data_table/DataTable.js";
9
- import { DataTableDynamic as w } from "./lib/datatabledynamic/DataTableDynamic.js";
10
- import { ErrorManager as A, useErrorNotifier as E } from "./lib/error_notifier/ErrorNotifier.js";
11
- import { ErrorBox as N } from "./lib/errorbox/ErrorBox.js";
12
- import { FormField as C, FormLayout as V, FormLayoutTable as h, FormSectionTitle as R, FormText as U } from "./lib/form_layout/FormLayout.js";
13
- import { InfoBox as g } from "./lib/info_box/InfoBox.js";
14
- import { InlineEdit as O } from "./lib/inlineedit/InlineEdit.js";
15
- import { InputDurationYears as Y } from "./lib/year/InputDurationYears.js";
16
- import { INPUT_AMOUNT_ALLOWED_DECIMAL_SEPARATORS as W, InputNumber as k } from "./lib/number/InputNumber.js";
17
- import { InputNumberDec as z } from "./lib/number/InputNumberDec.js";
18
- import { InputNumberInt as J } from "./lib/number/InputNumberInt.js";
19
- import { ListView as Q } from "./lib/listview/ListView.js";
20
- import { Loader as Z } from "./lib/loader/Loader.js";
21
- import { InputLocalDate as oo } from "./lib/localdate/InputLocalDate.js";
22
- import { LabelLocalDate as eo } from "./lib/localdate/LabelLocalDate.js";
23
- import { InputMoneyDec as po } from "./lib/money/InputMoneyDec.js";
24
- import { InputMoneyInt as mo } from "./lib/money/InputMoneyInt.js";
25
- import { LabelMoneyDec as fo } from "./lib/money/LabelMoneyDec.js";
26
- import { LabelMoneyInt as io } from "./lib/money/LabelMoneyInt.js";
27
- import { InputDurationMonths as bo } from "./lib/month/InputDurationMonths.js";
28
- import { InputMonth as Io } from "./lib/month/InputMonth.js";
29
- import { Navigation as Do } from "./lib/navigation/Navigation.js";
30
- import { InputPercent as co } from "./lib/percent/InputPercent.js";
31
- import { LabelPercent as yo, LabelRate as Bo } from "./lib/percent/LabelPercent.js";
32
- import { LabelPercentInt as wo } from "./lib/percent/LabelPercentInt.js";
33
- import { InputCombobox as Ao } from "./lib/select/InputCombobox.js";
34
- import { InputSelect as Fo } from "./lib/select/InputSelect.js";
35
- import { SwitchButton as Po } from "./lib/switchbutton/SwitchButton.js";
36
- import { Tabs as Vo, TabsList as ho, TabsPanel as Ro, TabsTab as Uo } from "./lib/tabs/Tabs.js";
37
- import { InputText as go } from "./lib/text/InputText.js";
38
- import { Description as Oo } from "./lib/typography/description/Description.js";
39
- import { LabelAndDescription as Yo } from "./lib/typography/label_and_description/LabelAndDescription.js";
40
- import { Todo as Wo } from "./lib/typography/todo/Todo.js";
41
- import { SectionTitle as qo } from "./lib/typography/sectiontitle/SectionTitle.js";
42
- import { ViewBody as Go } from "./lib/view_layout/ViewBody.js";
43
- import { ViewFooter as Ko } from "./lib/view_layout/ViewFooter.js";
44
- import { ViewHeader as Xo } from "./lib/view_layout/ViewHeader.js";
45
- import { ViewLayout as $o } from "./lib/view_layout/ViewLayout.js";
46
- import { ViewTitle as rr } from "./lib/view_layout/ViewTitle.js";
47
- import { InputYear as tr } from "./lib/year/InputYear.js";
8
+ import { DataTable as c, DataTableBody as D, DataTableCaption as L, DataTableCell as s, DataTableHead as d, DataTableHeaderCell as y, DataTableRow as S } from "./lib/data_table/DataTable.js";
9
+ import { DataTableDynamic as M } from "./lib/datatabledynamic/DataTableDynamic.js";
10
+ import { ErrorManager as P, useErrorNotifier as A } from "./lib/error_notifier/ErrorNotifier.js";
11
+ import { ErrorBox as F } from "./lib/errorbox/ErrorBox.js";
12
+ import { FormField as C, FormLayout as V, FormLayoutTable as v, FormSectionTitle as h, FormText as R } from "./lib/form_layout/FormLayout.js";
13
+ import { I18nService as _, I18nServiceInstance as g } from "./lib/i18n/i18n.service.js";
14
+ import { I18nProvider as O, useI18n as Y } from "./lib/i18n/i18n.react.js";
15
+ import { InfoBox as W } from "./lib/info_box/InfoBox.js";
16
+ import { InlineEdit as q } from "./lib/inlineedit/InlineEdit.js";
17
+ import { ListView as G } from "./lib/listview/ListView.js";
18
+ import { Loader as K } from "./lib/loader/Loader.js";
19
+ import { InputLocalDate as X } from "./lib/localdate/InputLocalDate.js";
20
+ import { LabelLocalDate as $ } from "./lib/localdate/LabelLocalDate.js";
21
+ import { InputMoneyDec as ro } from "./lib/money/InputMoneyDec.js";
22
+ import { InputMoneyInt as to } from "./lib/money/InputMoneyInt.js";
23
+ import { LabelMoneyDec as ao } from "./lib/money/LabelMoneyDec.js";
24
+ import { LabelMoneyInt as xo } from "./lib/money/LabelMoneyInt.js";
25
+ import { InputDurationMonths as fo } from "./lib/month/InputDurationMonths.js";
26
+ import { InputMonth as lo } from "./lib/month/InputMonth.js";
27
+ import { Navigation as uo } from "./lib/navigation/Navigation.js";
28
+ import { INPUT_AMOUNT_ALLOWED_DECIMAL_SEPARATORS as To, InputNumber as co } from "./lib/number/InputNumber.js";
29
+ import { InputNumberDec as Lo } from "./lib/number/InputNumberDec.js";
30
+ import { InputNumberInt as yo } from "./lib/number/InputNumberInt.js";
31
+ import { InputPercent as Bo } from "./lib/percent/InputPercent.js";
32
+ import { LabelPercent as wo, LabelRate as Po } from "./lib/percent/LabelPercent.js";
33
+ import { LabelPercentInt as Eo } from "./lib/percent/LabelPercentInt.js";
34
+ import { InputCombobox as No } from "./lib/select/InputCombobox.js";
35
+ import { InputSelect as Vo } from "./lib/select/InputSelect.js";
36
+ import { SwitchButton as ho } from "./lib/switchbutton/SwitchButton.js";
37
+ import { Tabs as Uo, TabsList as _o, TabsPanel as go, TabsTab as Ho } from "./lib/tabs/Tabs.js";
38
+ import { InputText as Yo } from "./lib/text/InputText.js";
39
+ import { Description as Wo } from "./lib/typography/description/Description.js";
40
+ import { LabelAndDescription as qo } from "./lib/typography/label_and_description/LabelAndDescription.js";
41
+ import { Todo as Go } from "./lib/typography/todo/Todo.js";
42
+ import { SectionTitle as Ko } from "./lib/typography/sectiontitle/SectionTitle.js";
43
+ import { ViewBody as Xo } from "./lib/view_layout/ViewBody.js";
44
+ import { ViewFooter as $o } from "./lib/view_layout/ViewFooter.js";
45
+ import { ViewHeader as rr } from "./lib/view_layout/ViewHeader.js";
46
+ import { ViewLayout as tr } from "./lib/view_layout/ViewLayout.js";
47
+ import { ViewTitle as ar } from "./lib/view_layout/ViewTitle.js";
48
+ import { InputDurationYears as xr } from "./lib/year/InputDurationYears.js";
49
+ import { InputYear as fr } from "./lib/year/InputYear.js";
48
50
  export {
49
51
  p as ApplicationShell,
50
52
  m as Badge,
51
53
  i as Button,
52
- f as ButtonBar,
54
+ n as ButtonBar,
53
55
  b as CommonUi,
54
- D as DataTable,
55
- L as DataTableBody,
56
- c as DataTableCaption,
57
- d as DataTableCell,
58
- w as DataTableDynamic,
59
- s as DataTableHead,
56
+ c as DataTable,
57
+ D as DataTableBody,
58
+ L as DataTableCaption,
59
+ s as DataTableCell,
60
+ M as DataTableDynamic,
61
+ d as DataTableHead,
60
62
  y as DataTableHeaderCell,
61
- B as DataTableRow,
62
- Oo as Description,
63
- N as ErrorBox,
64
- A as ErrorManager,
63
+ S as DataTableRow,
64
+ Wo as Description,
65
+ F as ErrorBox,
66
+ P as ErrorManager,
65
67
  C as FormField,
66
68
  V as FormLayout,
67
- h as FormLayoutTable,
68
- R as FormSectionTitle,
69
- U as FormText,
70
- W as INPUT_AMOUNT_ALLOWED_DECIMAL_SEPARATORS,
71
- g as InfoBox,
72
- O as InlineEdit,
73
- Ao as InputCombobox,
74
- bo as InputDurationMonths,
75
- Y as InputDurationYears,
76
- oo as InputLocalDate,
77
- po as InputMoneyDec,
78
- mo as InputMoneyInt,
79
- Io as InputMonth,
80
- k as InputNumber,
81
- z as InputNumberDec,
82
- J as InputNumberInt,
83
- co as InputPercent,
84
- Fo as InputSelect,
85
- go as InputText,
86
- tr as InputYear,
87
- Yo as LabelAndDescription,
88
- eo as LabelLocalDate,
89
- fo as LabelMoneyDec,
90
- io as LabelMoneyInt,
91
- yo as LabelPercent,
92
- wo as LabelPercentInt,
93
- Bo as LabelRate,
94
- Q as ListView,
95
- Z as Loader,
96
- Do as Navigation,
97
- qo as SectionTitle,
69
+ v as FormLayoutTable,
70
+ h as FormSectionTitle,
71
+ R as FormText,
72
+ O as I18nProvider,
73
+ _ as I18nService,
74
+ g as I18nServiceInstance,
75
+ To as INPUT_AMOUNT_ALLOWED_DECIMAL_SEPARATORS,
76
+ W as InfoBox,
77
+ q as InlineEdit,
78
+ No as InputCombobox,
79
+ fo as InputDurationMonths,
80
+ xr as InputDurationYears,
81
+ X as InputLocalDate,
82
+ ro as InputMoneyDec,
83
+ to as InputMoneyInt,
84
+ lo as InputMonth,
85
+ co as InputNumber,
86
+ Lo as InputNumberDec,
87
+ yo as InputNumberInt,
88
+ Bo as InputPercent,
89
+ Vo as InputSelect,
90
+ Yo as InputText,
91
+ fr as InputYear,
92
+ qo as LabelAndDescription,
93
+ $ as LabelLocalDate,
94
+ ao as LabelMoneyDec,
95
+ xo as LabelMoneyInt,
96
+ wo as LabelPercent,
97
+ Eo as LabelPercentInt,
98
+ Po as LabelRate,
99
+ G as ListView,
100
+ K as Loader,
101
+ uo as Navigation,
102
+ Ko as SectionTitle,
98
103
  e as SeijUIProvider,
99
- Po as SwitchButton,
100
- Vo as Tabs,
101
- ho as TabsList,
102
- Ro as TabsPanel,
103
- Uo as TabsTab,
104
- Wo as Todo,
105
- Go as ViewBody,
106
- Ko as ViewFooter,
107
- Xo as ViewHeader,
108
- $o as ViewLayout,
109
- rr as ViewTitle,
104
+ ho as SwitchButton,
105
+ Uo as Tabs,
106
+ _o as TabsList,
107
+ go as TabsPanel,
108
+ Ho as TabsTab,
109
+ Go as Todo,
110
+ Xo as ViewBody,
111
+ $o as ViewFooter,
112
+ rr as ViewHeader,
113
+ tr as ViewLayout,
114
+ ar as ViewTitle,
110
115
  I as obfuscateLabel,
111
- E as useErrorNotifier
116
+ A as useErrorNotifier,
117
+ Y as useI18n
112
118
  };
113
119
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SeijUIProvider.d.ts","sourceRoot":"","sources":["../../src/init/SeijUIProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAahD,UAAU,mBAAoB,SAAQ,iBAAiB;IACrD,kBAAkB;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,kBAAkB;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CAc9E"}
1
+ {"version":3,"file":"SeijUIProvider.d.ts","sourceRoot":"","sources":["../../src/init/SeijUIProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAahD,UAAU,mBAAoB,SAAQ,iBAAiB;IACrD,kBAAkB;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB;IAClB,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,kBAAkB;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CAS9E"}
@@ -1,20 +1,20 @@
1
- import { jsx as o, jsxs as a } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { webLightTheme as i, FluentProvider as n } from "@fluentui/react-components";
3
3
  import { ErrorManager as s } from "../lib/error_notifier/ErrorNotifier.js";
4
- import { I18nProvider as m } from "../lib/i18n/i18n.react.js";
5
- const f = {
4
+ import { I18nProvider as a } from "../lib/i18n/i18n.react.js";
5
+ const m = {
6
6
  ...i,
7
7
  fontFamilyBase: "'Noto Sans', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif",
8
8
  fontFamilyMonospace: "Fira Mono, Consolas, 'Courier New', Courier, monospace",
9
9
  fontFamilyNumeric: "Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif"
10
10
  };
11
- function y({ children: r, initialLocale: t }) {
12
- return /* @__PURE__ */ o(m, { initialLocale: t, load: async (e) => e === "fr" ? (await import("../locales/fr.js")).default : e === "en" ? (await import("../locales/en.js")).default : (await import("../locales/en.js")).default, children: /* @__PURE__ */ a(n, { theme: f, children: [
13
- r,
14
- /* @__PURE__ */ o(s, {})
11
+ function u({ children: o, initialLocale: r }) {
12
+ return /* @__PURE__ */ e(a, { initialLocale: r, children: /* @__PURE__ */ t(n, { theme: m, children: [
13
+ o,
14
+ /* @__PURE__ */ e(s, {})
15
15
  ] }) });
16
16
  }
17
17
  export {
18
- y as SeijUIProvider
18
+ u as SeijUIProvider
19
19
  };
20
20
  //# sourceMappingURL=SeijUIProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SeijUIProvider.js","sources":["../../src/init/SeijUIProvider.tsx"],"sourcesContent":["import { FluentProvider, Theme, webLightTheme } from \"@fluentui/react-components\";\n\nimport { PropsWithChildren } from \"react\";\nimport { ErrorManager } from \"../lib/error_notifier/ErrorNotifier\";\nimport { Formats, Messages } from \"../lib/i18n\";\nimport { I18nProvider } from \"../lib/i18n/i18n.react\";\n\n// noinspection SpellCheckingInspection\nconst theme: Theme = {\n ...webLightTheme,\n fontFamilyBase:\n \"'Noto Sans', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif\",\n fontFamilyMonospace: \"Fira Mono, Consolas, 'Courier New', Courier, monospace\",\n fontFamilyNumeric:\n \"Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif\",\n};\n\ninterface SeijUIProviderProps extends PropsWithChildren {\n /** SSR hydrate */\n initialLocale?: string;\n /** SSR hydrate */\n initialMessages?: Messages;\n /** SSR hydrate */\n initialFormats?: Formats;\n /** for tests, storybook, preview */\n forcedLocale?: string;\n}\n\nexport function SeijUIProvider({ children, initialLocale }: SeijUIProviderProps) {\n const loader = async (locale: string) => {\n if (locale === \"fr\") return (await import(\"../locales/fr\")).default;\n if (locale === \"en\") return (await import(\"../locales/en\")).default;\n return (await import(\"../locales/en\")).default;\n };\n return (\n <I18nProvider initialLocale={initialLocale} load={loader}>\n <FluentProvider theme={theme}>\n {children}\n <ErrorManager />\n </FluentProvider>\n </I18nProvider>\n );\n}\n"],"names":["theme","webLightTheme","SeijUIProvider","children","initialLocale","I18nProvider","locale","jsxs","FluentProvider","ErrorManager"],"mappings":";;;;AAQA,MAAMA,IAAe;AAAA,EACnB,GAAGC;AAAA,EACH,gBACE;AAAA,EACF,qBAAqB;AAAA,EACrB,mBACE;AACJ;AAaO,SAASC,EAAe,EAAE,UAAAC,GAAU,eAAAC,KAAsC;AAM/E,2BACGC,GAAA,EAAa,eAAAD,GAA8B,MAN/B,OAAOE,MAChBA,MAAW,QAAc,MAAM,OAAO,kBAAe,GAAG,UACxDA,MAAW,QAAc,MAAM,OAAO,kBAAe,GAAG,WACpD,MAAM,OAAO,kBAAe,GAAG,SAIrC,UAAA,gBAAAC,EAACC,KAAe,OAAAR,GACb,UAAA;AAAA,IAAAG;AAAA,sBACAM,GAAA,CAAA,CAAa;AAAA,EAAA,EAAA,CAChB,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"SeijUIProvider.js","sources":["../../src/init/SeijUIProvider.tsx"],"sourcesContent":["import { FluentProvider, Theme, webLightTheme } from \"@fluentui/react-components\";\n\nimport { PropsWithChildren } from \"react\";\nimport { ErrorManager } from \"../lib/error_notifier/ErrorNotifier\";\nimport { Formats, Messages } from \"../lib/i18n\";\nimport { I18nProvider } from \"../lib/i18n/i18n.react\";\n\n// noinspection SpellCheckingInspection\nconst theme: Theme = {\n ...webLightTheme,\n fontFamilyBase:\n \"'Noto Sans', 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif\",\n fontFamilyMonospace: \"Fira Mono, Consolas, 'Courier New', Courier, monospace\",\n fontFamilyNumeric:\n \"Bahnschrift, 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif\",\n};\n\ninterface SeijUIProviderProps extends PropsWithChildren {\n /** SSR hydrate */\n initialLocale?: string;\n /** SSR hydrate */\n initialMessages?: Messages;\n /** SSR hydrate */\n initialFormats?: Formats;\n /** for tests, storybook, preview */\n forcedLocale?: string;\n}\n\nexport function SeijUIProvider({ children, initialLocale }: SeijUIProviderProps) {\n return (\n <I18nProvider initialLocale={initialLocale}>\n <FluentProvider theme={theme}>\n {children}\n <ErrorManager />\n </FluentProvider>\n </I18nProvider>\n );\n}\n"],"names":["theme","webLightTheme","SeijUIProvider","children","initialLocale","jsx","I18nProvider","jsxs","FluentProvider","ErrorManager"],"mappings":";;;;AAQA,MAAMA,IAAe;AAAA,EACnB,GAAGC;AAAA,EACH,gBACE;AAAA,EACF,qBAAqB;AAAA,EACrB,mBACE;AACJ;AAaO,SAASC,EAAe,EAAE,UAAAC,GAAU,eAAAC,KAAsC;AAC/E,SACE,gBAAAC,EAACC,GAAA,EAAa,eAAAF,GACZ,UAAA,gBAAAG,EAACC,KAAe,OAAAR,GACb,UAAA;AAAA,IAAAG;AAAA,sBACAM,GAAA,CAAA,CAAa;AAAA,EAAA,EAAA,CAChB,EAAA,CACF;AAEJ;"}
@@ -1,10 +1,10 @@
1
- import { jsxs as h, jsx as l } from "react/jsx-runtime";
2
- import { makeStyles as M, tokens as m, NavDrawer as A, NavDrawerHeader as F, NavDrawerBody as H, Tooltip as V, Hamburger as U } from "@fluentui/react-components";
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import { makeStyles as j, tokens as m, NavDrawer as M, NavDrawerHeader as A, NavDrawerBody as H, Tooltip as V, Hamburger as U } from "@fluentui/react-components";
3
3
  import { useState as u, useMemo as q } from "react";
4
4
  import { Navigation as z } from "../navigation/Navigation.js";
5
5
  import { createNavigationTreeItemServiceImpl as E } from "../navigation/NavigationService.js";
6
- import { TitleBar as N } from "./TitleBar.js";
7
- const y = M({
6
+ import { TitleBar as I } from "./TitleBar.js";
7
+ const y = j({
8
8
  shell: {
9
9
  width: "100vw",
10
10
  height: "100vh",
@@ -39,70 +39,70 @@ const y = M({
39
39
  });
40
40
  function R({
41
41
  applicationName: a,
42
- main: s,
42
+ main: d,
43
43
  navigationItems: o,
44
44
  userStatus: f,
45
45
  onClickHome: g,
46
46
  navigate: C,
47
47
  matchPath: w
48
48
  }) {
49
- const t = o.find((n) => "path" in n && n.path !== null && w(n.path)), x = t == null ? void 0 : t.id, b = t && "parentId" in t && t.parentId !== null ? [t.parentId] : [], i = y(), [d, B] = u(!0), [S, k] = u(x ?? ""), [r, c] = u(b), _ = q(() => E(o), [o]), v = () => {
50
- B(!d);
51
- }, D = (n) => {
52
- const e = _.findById(n);
49
+ const l = o.find((t) => "path" in t && t.path !== null && w(t.path)), x = l?.id, b = l && "parentId" in l && l.parentId !== null ? [l.parentId] : [], i = y(), [s, B] = u(!0), [S, k] = u(x ?? ""), [r, c] = u(b), _ = q(() => E(o), [o]), v = () => {
50
+ B(!s);
51
+ }, D = (t) => {
52
+ const e = _.findById(t);
53
53
  k(e.id);
54
54
  const p = "parentId" in e ? e.parentId : null;
55
- p && (r.find((j) => j === p) || c([...r, p])), "path" in e && e.path && C(e.path);
56
- }, O = (n) => {
57
- r.find((e) => e === n) ? c(r.filter((e) => e !== n)) : c([...r, n]);
58
- }, T = [];
59
- return t && "parentId" in t && t.parentId !== null && T.push(t.parentId), /* @__PURE__ */ h("div", { "data-e2e-id": "shell", className: i.shell, children: [
60
- /* @__PURE__ */ l("div", { "data-e2e-id": "shell__menu_top", className: i.titleBar, children: d ? null : /* @__PURE__ */ l(
61
- N,
55
+ p && (r.find((T) => T === p) || c([...r, p])), "path" in e && e.path && C(e.path);
56
+ }, O = (t) => {
57
+ r.find((e) => e === t) ? c(r.filter((e) => e !== t)) : c([...r, t]);
58
+ }, F = [];
59
+ return l && "parentId" in l && l.parentId !== null && F.push(l.parentId), /* @__PURE__ */ h("div", { "data-e2e-id": "shell", className: i.shell, children: [
60
+ /* @__PURE__ */ n("div", { "data-e2e-id": "shell__menu_top", className: i.titleBar, children: s ? null : /* @__PURE__ */ n(
61
+ I,
62
62
  {
63
63
  applicationName: a,
64
64
  userStatus: f,
65
65
  onClickHome: g,
66
- hamburger: /* @__PURE__ */ l(I, { onClick: v })
66
+ hamburger: /* @__PURE__ */ n(N, { onClick: v })
67
67
  }
68
68
  ) }),
69
69
  /* @__PURE__ */ h("div", { "data-e2e-id": "shell__main", className: i.main, children: [
70
70
  /* @__PURE__ */ h(
71
- A,
71
+ M,
72
72
  {
73
73
  selectedValue: S,
74
- open: d,
74
+ open: s,
75
75
  density: "small",
76
76
  type: "inline",
77
77
  openCategories: r,
78
- onNavItemSelect: (n, e) => {
78
+ onNavItemSelect: (t, e) => {
79
79
  D(e.value);
80
80
  },
81
- onNavCategoryItemToggle: (n, e) => {
81
+ onNavCategoryItemToggle: (t, e) => {
82
82
  O(e.categoryValue ?? "");
83
83
  },
84
84
  children: [
85
- /* @__PURE__ */ l(
86
- N,
85
+ /* @__PURE__ */ n(
86
+ I,
87
87
  {
88
88
  applicationName: a,
89
89
  userStatus: f,
90
90
  onClickHome: g,
91
- hamburger: /* @__PURE__ */ l(I, { onClick: v })
91
+ hamburger: /* @__PURE__ */ n(N, { onClick: v })
92
92
  }
93
93
  ),
94
- /* @__PURE__ */ l(F, {}),
95
- /* @__PURE__ */ l(H, { children: /* @__PURE__ */ l(z, { items: o }) })
94
+ /* @__PURE__ */ n(A, {}),
95
+ /* @__PURE__ */ n(H, { children: /* @__PURE__ */ n(z, { items: o }) })
96
96
  ]
97
97
  }
98
98
  ),
99
- /* @__PURE__ */ l("div", { "data-e2e-id": "shell__content", className: i.content, children: s })
99
+ /* @__PURE__ */ n("div", { "data-e2e-id": "shell__content", className: i.content, children: d })
100
100
  ] })
101
101
  ] });
102
102
  }
103
- const I = ({ onClick: a }) => {
104
- const s = y();
105
- return /* @__PURE__ */ l(V, { content: "Navigation", relationship: "label", children: /* @__PURE__ */ l(U, { className: s.bugerIcon, onClick: a }) });
103
+ const N = ({ onClick: a }) => {
104
+ const d = y();
105
+ return /* @__PURE__ */ n(V, { content: "Navigation", relationship: "label", children: /* @__PURE__ */ n(U, { className: d.bugerIcon, onClick: a }) });
106
106
  };
107
107
  export {
108
108
  R as ApplicationShell
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationShell.js","sources":["../../../src/lib/applicationshell/ApplicationShell.tsx"],"sourcesContent":["import {\n Hamburger,\n makeStyles,\n NavDrawer,\n NavDrawerBody,\n NavDrawerHeader,\n tokens,\n Tooltip,\n} from \"@fluentui/react-components\";\nimport { ReactNode, useMemo, useState } from \"react\";\nimport { Navigation } from \"../navigation/Navigation\";\nimport { NavigationTreeItem } from \"../navigation/Navigation.types\";\nimport { createNavigationTreeItemServiceImpl } from \"../navigation/NavigationService\";\nimport { UserStatus } from \"./ApplicationShell.types\";\nimport { TitleBar } from \"./TitleBar\";\n\nconst useApplicationShellStyles = makeStyles({\n shell: {\n width: \"100vw\",\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n },\n titleBar: {\n width: \"100%\",\n height: \"48px\",\n flex: 0,\n },\n main: {\n overflow: \"hidden\",\n display: \"flex\",\n height: \"100%\",\n },\n content: {\n flex: \"1\",\n display: \"bloc\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n overflow: \"auto\",\n backgroundColor: tokens.colorNeutralBackground2,\n },\n bugerIcon: {\n color: tokens.colorNeutralForegroundOnBrand,\n \":hover\": {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n});\n\nexport function ApplicationShell({\n applicationName,\n main,\n navigationItems,\n userStatus,\n onClickHome,\n navigate,\n matchPath,\n}: {\n applicationName: string;\n main: ReactNode;\n navigationItems: NavigationTreeItem[];\n userStatus: UserStatus;\n onClickHome: () => void;\n navigate: (path: string) => void;\n matchPath: (path: string | undefined) => boolean;\n}) {\n // test si le chemin courant du navigateur correspond à cet item\n // attention, on est obligés de tester tous les items, qu'ils aient\n // un lien ou pas, d'où le url-inconnue pour ceux qui n'ont pas de lien.\n // On est obligés car useMatch est un hook que l'on ne peut pas lancer\n // de manière conditionnelle\n const navigationItemFound = navigationItems.find((it) => \"path\" in it && it.path !== null && matchPath(it.path));\n const navigationItemSelectedFromUrl = navigationItemFound?.id;\n const defaultOpenCategory =\n navigationItemFound && \"parentId\" in navigationItemFound && navigationItemFound.parentId !== null\n ? [navigationItemFound.parentId]\n : [];\n\n const styles = useApplicationShellStyles();\n const [navDrawerOpened, setNavDrawerOpened] = useState<boolean>(true);\n const [selectedItem, setSelectedItem] = useState<string>(navigationItemSelectedFromUrl ?? \"\");\n const [openedCategories, setOpenCategories] = useState<string[]>(defaultOpenCategory);\n\n const navigationService = useMemo(() => createNavigationTreeItemServiceImpl(navigationItems), [navigationItems]);\n const handleClickHamburger = () => {\n setNavDrawerOpened(!navDrawerOpened);\n };\n\n const handleClickMenuItem = (itemId: string) => {\n const item = navigationService.findById(itemId);\n setSelectedItem(item.id);\n const parentId = \"parentId\" in item ? item.parentId : null;\n if (parentId) {\n if (!openedCategories.find((cat) => cat === parentId)) {\n setOpenCategories([...openedCategories, parentId]);\n }\n }\n if (\"path\" in item && item.path) navigate(item.path);\n };\n\n const handleClickCategory = (categoryId: string) => {\n if (!openedCategories.find((cat) => cat === categoryId)) {\n setOpenCategories([...openedCategories, categoryId]);\n } else {\n setOpenCategories(openedCategories.filter((it) => it !== categoryId));\n }\n };\n\n const openCategories: string[] = [];\n if (navigationItemFound && \"parentId\" in navigationItemFound && navigationItemFound.parentId !== null) {\n openCategories.push(navigationItemFound.parentId);\n }\n\n return (\n <div data-e2e-id=\"shell\" className={styles.shell}>\n <div data-e2e-id=\"shell__menu_top\" className={styles.titleBar}>\n {!navDrawerOpened ? (\n <TitleBar\n applicationName={applicationName}\n userStatus={userStatus}\n onClickHome={onClickHome}\n hamburger={<MenuBurger onClick={handleClickHamburger} />}\n />\n ) : null}\n </div>\n <div data-e2e-id=\"shell__main\" className={styles.main}>\n <NavDrawer\n selectedValue={selectedItem}\n open={navDrawerOpened}\n density={\"small\"}\n type={\"inline\"}\n openCategories={openedCategories}\n onNavItemSelect={(e, data) => {\n handleClickMenuItem(data.value);\n }}\n onNavCategoryItemToggle={(e, data) => {\n handleClickCategory(data.categoryValue ?? \"\");\n }}\n >\n <TitleBar\n applicationName={applicationName}\n userStatus={userStatus}\n onClickHome={onClickHome}\n hamburger={<MenuBurger onClick={handleClickHamburger} />}\n />\n <NavDrawerHeader></NavDrawerHeader>\n <NavDrawerBody>\n <Navigation items={navigationItems} />\n </NavDrawerBody>\n </NavDrawer>\n <div data-e2e-id=\"shell__content\" className={styles.content}>\n {main}\n </div>\n </div>\n </div>\n );\n}\n\nconst MenuBurger = ({ onClick }: { onClick: () => void }) => {\n const styles = useApplicationShellStyles();\n return (\n <Tooltip content=\"Navigation\" relationship=\"label\">\n <Hamburger className={styles.bugerIcon} onClick={onClick} />\n </Tooltip>\n );\n};\n"],"names":["useApplicationShellStyles","makeStyles","tokens","ApplicationShell","applicationName","main","navigationItems","userStatus","onClickHome","navigate","matchPath","navigationItemFound","it","navigationItemSelectedFromUrl","defaultOpenCategory","styles","navDrawerOpened","setNavDrawerOpened","useState","selectedItem","setSelectedItem","openedCategories","setOpenCategories","navigationService","useMemo","createNavigationTreeItemServiceImpl","handleClickHamburger","handleClickMenuItem","itemId","item","parentId","cat","handleClickCategory","categoryId","openCategories","jsx","TitleBar","MenuBurger","jsxs","NavDrawer","e","data","NavDrawerHeader","NavDrawerBody","Navigation","onClick","Tooltip","Hamburger"],"mappings":";;;;;;AAgBA,MAAMA,IAA4BC,EAAW;AAAA,EAC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AC5B,YAAAd,EAAoBc,EAAK,KAAK;AAAA,UAChC;AAAA,UACA,yBAAyB,CAACD,GAAGC,MAAS;AACpC,YAAAT,EAAoBS,EAAK,iBAAiB,EAAE;AAAA,UAC9C;AAAA,UAEA,UAAA;AAAA,YAAA,gBAAAN;AAAA,cAACC;AAAA,cAAA;AAAA,gBACC,iBAAAhC;AAAA,gBACA,YAAAG;AAAA,gBACA,aAAAC;AAAA,gBACA,WAAW,gBAAA2B,EAACE,GAAA,EAAW,SAASX,EAAA,CAAsB;AAAA,cAAA;AAAA,YAAA;AAAA,8BAEvDgB,GAAA,EAAgB;AAAA,8BAChBC,GAAA,EACC,UAAA,gBAAAR,EAACS,GAAA,EAAW,OAAOtC,GAAiB,EAAA,CACtC;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,wBAED,OAAA,EAAI,eAAY,kBAAiB,WAAWS,EAAO,SACjD,UAAAV,EAAA,CACH;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAEA,MAAMgC,IAAa,CAAC,EAAE,SAAAQ,QAAuC;AAC3D,QAAM9B,IAASf,EAAA;AACf,SACE,gBAAAmC,EAACW,GAAA,EAAQ,SAAQ,cAAa,cAAa,SACzC,UAAA,gBAAAX,EAACY,GAAA,EAAU,WAAWhC,EAAO,WAAW,SAAA8B,EAAA,CAAkB,GAC5D;AAEJ;"}
1
+ {"version":3,"file":"ApplicationShell.js","sources":["../../../src/lib/applicationshell/ApplicationShell.tsx"],"sourcesContent":["import {\n Hamburger,\n makeStyles,\n NavDrawer,\n NavDrawerBody,\n NavDrawerHeader,\n tokens,\n Tooltip,\n} from \"@fluentui/react-components\";\nimport { ReactNode, useMemo, useState } from \"react\";\nimport { Navigation } from \"../navigation/Navigation\";\nimport { NavigationTreeItem } from \"../navigation/Navigation.types\";\nimport { createNavigationTreeItemServiceImpl } from \"../navigation/NavigationService\";\nimport { UserStatus } from \"./ApplicationShell.types\";\nimport { TitleBar } from \"./TitleBar\";\n\nconst useApplicationShellStyles = makeStyles({\n shell: {\n width: \"100vw\",\n height: \"100vh\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n },\n titleBar: {\n width: \"100%\",\n height: \"48px\",\n flex: 0,\n },\n main: {\n overflow: \"hidden\",\n display: \"flex\",\n height: \"100%\",\n },\n content: {\n flex: \"1\",\n display: \"bloc\",\n justifyContent: \"flex-start\",\n alignItems: \"flex-start\",\n overflow: \"auto\",\n backgroundColor: tokens.colorNeutralBackground2,\n },\n bugerIcon: {\n color: tokens.colorNeutralForegroundOnBrand,\n \":hover\": {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n});\n\nexport function ApplicationShell({\n applicationName,\n main,\n navigationItems,\n userStatus,\n onClickHome,\n navigate,\n matchPath,\n}: {\n applicationName: string;\n main: ReactNode;\n navigationItems: NavigationTreeItem[];\n userStatus: UserStatus;\n onClickHome: () => void;\n navigate: (path: string) => void;\n matchPath: (path: string | undefined) => boolean;\n}) {\n // test si le chemin courant du navigateur correspond à cet item\n // attention, on est obligés de tester tous les items, qu'ils aient\n // un lien ou pas, d'où le url-inconnue pour ceux qui n'ont pas de lien.\n // On est obligés car useMatch est un hook que l'on ne peut pas lancer\n // de manière conditionnelle\n const navigationItemFound = navigationItems.find((it) => \"path\" in it && it.path !== null && matchPath(it.path));\n const navigationItemSelectedFromUrl = navigationItemFound?.id;\n const defaultOpenCategory =\n navigationItemFound && \"parentId\" in navigationItemFound && navigationItemFound.parentId !== null\n ? [navigationItemFound.parentId]\n : [];\n\n const styles = useApplicationShellStyles();\n const [navDrawerOpened, setNavDrawerOpened] = useState<boolean>(true);\n const [selectedItem, setSelectedItem] = useState<string>(navigationItemSelectedFromUrl ?? \"\");\n const [openedCategories, setOpenCategories] = useState<string[]>(defaultOpenCategory);\n\n const navigationService = useMemo(() => createNavigationTreeItemServiceImpl(navigationItems), [navigationItems]);\n const handleClickHamburger = () => {\n setNavDrawerOpened(!navDrawerOpened);\n };\n\n const handleClickMenuItem = (itemId: string) => {\n const item = navigationService.findById(itemId);\n setSelectedItem(item.id);\n const parentId = \"parentId\" in item ? item.parentId : null;\n if (parentId) {\n if (!openedCategories.find((cat) => cat === parentId)) {\n setOpenCategories([...openedCategories, parentId]);\n }\n }\n if (\"path\" in item && item.path) navigate(item.path);\n };\n\n const handleClickCategory = (categoryId: string) => {\n if (!openedCategories.find((cat) => cat === categoryId)) {\n setOpenCategories([...openedCategories, categoryId]);\n } else {\n setOpenCategories(openedCategories.filter((it) => it !== categoryId));\n }\n };\n\n const openCategories: string[] = [];\n if (navigationItemFound && \"parentId\" in navigationItemFound && navigationItemFound.parentId !== null) {\n openCategories.push(navigationItemFound.parentId);\n }\n\n return (\n <div data-e2e-id=\"shell\" className={styles.shell}>\n <div data-e2e-id=\"shell__menu_top\" className={styles.titleBar}>\n {!navDrawerOpened ? (\n <TitleBar\n applicationName={applicationName}\n userStatus={userStatus}\n onClickHome={onClickHome}\n hamburger={<MenuBurger onClick={handleClickHamburger} />}\n />\n ) : null}\n </div>\n <div data-e2e-id=\"shell__main\" className={styles.main}>\n <NavDrawer\n selectedValue={selectedItem}\n open={navDrawerOpened}\n density={\"small\"}\n type={\"inline\"}\n openCategories={openedCategories}\n onNavItemSelect={(e, data) => {\n handleClickMenuItem(data.value);\n }}\n onNavCategoryItemToggle={(e, data) => {\n handleClickCategory(data.categoryValue ?? \"\");\n }}\n >\n <TitleBar\n applicationName={applicationName}\n userStatus={userStatus}\n onClickHome={onClickHome}\n hamburger={<MenuBurger onClick={handleClickHamburger} />}\n />\n <NavDrawerHeader></NavDrawerHeader>\n <NavDrawerBody>\n <Navigation items={navigationItems} />\n </NavDrawerBody>\n </NavDrawer>\n <div data-e2e-id=\"shell__content\" className={styles.content}>\n {main}\n </div>\n </div>\n </div>\n );\n}\n\nconst MenuBurger = ({ onClick }: { onClick: () => void }) => {\n const styles = useApplicationShellStyles();\n return (\n <Tooltip content=\"Navigation\" relationship=\"label\">\n <Hamburger className={styles.bugerIcon} onClick={onClick} />\n </Tooltip>\n );\n};\n"],"names":["useApplicationShellStyles","makeStyles","tokens","ApplicationShell","applicationName","main","navigationItems","userStatus","onClickHome","navigate","matchPath","navigationItemFound","it","navigationItemSelectedFromUrl","defaultOpenCategory","styles","navDrawerOpened","setNavDrawerOpened","useState","selectedItem","setSelectedItem","openedCategories","setOpenCategories","navigationService","useMemo","createNavigationTreeItemServiceImpl","handleClickHamburger","handleClickMenuItem","itemId","item","parentId","cat","handleClickCategory","categoryId","openCategories","jsx","TitleBar","MenuBurger","jsxs","NavDrawer","e","data","NavDrawerHeader","NavDrawerBody","Navigation","onClick","Tooltip","Hamburger"],"mappings":";;;;;;AAgBA,MAAMA,IAA4BC,EAAW;AAAA,EAC3C,OAAO;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,eAAe;AAAA,IACf,UAAU;AAAA,EAAA;AAAA,EAEZ,UAAU;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,EAAA;AAAA,EAER,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,iBAAiBC,EAAO;AAAA,EAAA;AAAA,EAE1B,WAAW;AAAA,IACT,OAAOA,EAAO;AAAA,IACd,UAAU;AAAA,MACR,OAAOA,EAAO;AAAA,IAAA;AAAA,EAChB;AAEJ,CAAC;AAEM,SAASC,EAAiB;AAAA,EAC/B,iBAAAC;AAAA,EACA,MAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AACF,GAQG;AAMD,QAAMC,IAAsBL,EAAgB,KAAK,CAACM,MAAO,UAAUA,KAAMA,EAAG,SAAS,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AA,EAAU,WAAWhC,EAAO,WAAW,SAAA8B,EAAA,CAAkB,GAC5D;AAEJ;"}
@@ -1,13 +1,12 @@
1
1
  const t = ["fr", "en"];
2
- function r(n) {
3
- if (!n) return "en";
4
- const e = n.toLowerCase(), o = e.split("-")[0];
5
- return t.includes(e) ? e : t.includes(o) ? o : "en";
2
+ function r(e) {
3
+ if (!e) return "en";
4
+ const n = e.toLowerCase(), o = n.split("-")[0];
5
+ return t.includes(n) ? n : t.includes(o) ? o : "en";
6
6
  }
7
7
  function i() {
8
- var n;
9
8
  if (!(typeof navigator > "u"))
10
- return ((n = navigator.languages) == null ? void 0 : n[0]) || navigator.language;
9
+ return navigator.languages?.[0] || navigator.language;
11
10
  }
12
11
  function a() {
13
12
  if (!(typeof window > "u"))
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.detect.js","sources":["../../../src/lib/i18n/i18n.detect.ts"],"sourcesContent":["// i18n/locale.ts\nexport type Locale = string;\n\nconst SUPPORTED = [\"fr\", \"en\"] as const;\nconst FALLBACK: Locale = \"en\";\n\nexport function normalize(loc?: string): Locale {\n if (!loc) return FALLBACK;\n // garde \"fr-CA\" mais tombe sur \"fr\" si non supporté\n const lc = loc.toLowerCase();\n const base = lc.split(\"-\")[0];\n return SUPPORTED.includes(lc as any) ? (lc as Locale) : SUPPORTED.includes(base as any) ? (base as Locale) : FALLBACK;\n}\n\n// Client-only helpers\nfunction fromHtmlLang(): string | undefined {\n return typeof document !== \"undefined\" ? document.documentElement.lang : undefined;\n}\nfunction fromNavigator(): string | undefined {\n if (typeof navigator === \"undefined\") return undefined;\n return navigator.languages?.[0] || navigator.language;\n}\nfunction fromStorage(): string | undefined {\n if (typeof window === \"undefined\") return undefined;\n return localStorage.getItem(\"locale\") || undefined;\n}\nfunction fromQuery(): string | undefined {\n if (typeof window === \"undefined\") return undefined;\n return new URLSearchParams(window.location.search).get(\"lang\") || undefined;\n}\n\nexport function detectClientLocale(): Locale {\n return normalize(\n fromQuery() ||\n fromStorage() ||\n // fromHtmlLang() ||\n fromNavigator(),\n );\n}\n\n// SSR-side (ex: Next.js route handler / Node middleware)\nexport function detectServerLocale(opts: {\n queryLang?: string | null;\n cookieLang?: string | null;\n acceptLanguage?: string | null;\n}): Locale {\n const fromAL = opts.acceptLanguage?.split(\",\")?.[0]; // ex: \"fr-CA,fr;q=0.9,en;q=0.8\"\n return normalize(opts.queryLang || opts.cookieLang || fromAL);\n}\n\n// Persister le choix utilisateur (client)\nexport function setUserLocale(loc: string) {\n const n = normalize(loc);\n if (typeof document !== \"undefined\") document.documentElement.lang = n;\n if (typeof window !== \"undefined\") localStorage.setItem(\"locale\", n);\n return n;\n}\n"],"names":["SUPPORTED","normalize","loc","lc","base","fromNavigator","_a","fromStorage","fromQuery","detectClientLocale"],"mappings":"AAGA,MAAMA,IAAY,CAAC,MAAM,IAAI;AAGtB,SAASC,EAAUC,GAAsB;AAC9C,MAAI,CAACA,EAAK,QAAO;AAEjB,QAAMC,IAAKD,EAAI,YAAA,GACTE,IAAOD,EAAG,MAAM,GAAG,EAAE,CAAC;AAC5B,SAAOH,EAAU,SAASG,CAAS,IAAKA,IAAgBH,EAAU,SAASI,CAAW,IAAKA,IAAkB;AAC/G;AAMA,SAASC,IAAoC;AAf7C,MAAAC;AAgBE,MAAI,SAAO,YAAc;AACzB,aAAOA,IAAA,UAAU,cAAV,gBAAAA,EAAsB,OAAM,UAAU;AAC/C;AACA,SAASC,IAAkC;AACzC,MAAI,SAAO,SAAW;AACtB,WAAO,aAAa,QAAQ,QAAQ,KAAK;AAC3C;AACA,SAASC,IAAgC;AACvC,MAAI,SAAO,SAAW;AACtB,WAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,MAAM,KAAK;AACpE;AAEO,SAASC,IAA6B;AAC3C,SAAOR;AAAA,IACLO,EAAA,KACED,EAAA;AAAA,IAEAF,EAAA;AAAA,EAAc;AAEpB;"}
1
+ {"version":3,"file":"i18n.detect.js","sources":["../../../src/lib/i18n/i18n.detect.ts"],"sourcesContent":["// i18n/locale.ts\nexport type Locale = string;\n\nconst SUPPORTED = [\"fr\", \"en\"] as const;\nconst FALLBACK: Locale = \"en\";\n\nexport function normalize(loc?: string): Locale {\n if (!loc) return FALLBACK;\n // garde \"fr-CA\" mais tombe sur \"fr\" si non supporté\n const lc = loc.toLowerCase();\n const base = lc.split(\"-\")[0];\n return SUPPORTED.includes(lc as any) ? (lc as Locale) : SUPPORTED.includes(base as any) ? (base as Locale) : FALLBACK;\n}\n\n// Client-only helpers\nfunction fromHtmlLang(): string | undefined {\n return typeof document !== \"undefined\" ? document.documentElement.lang : undefined;\n}\nfunction fromNavigator(): string | undefined {\n if (typeof navigator === \"undefined\") return undefined;\n return navigator.languages?.[0] || navigator.language;\n}\nfunction fromStorage(): string | undefined {\n if (typeof window === \"undefined\") return undefined;\n return localStorage.getItem(\"locale\") || undefined;\n}\nfunction fromQuery(): string | undefined {\n if (typeof window === \"undefined\") return undefined;\n return new URLSearchParams(window.location.search).get(\"lang\") || undefined;\n}\n\nexport function detectClientLocale(): Locale {\n return normalize(\n fromQuery() ||\n fromStorage() ||\n // fromHtmlLang() ||\n fromNavigator(),\n );\n}\n\n// SSR-side (ex: Next.js route handler / Node middleware)\nexport function detectServerLocale(opts: {\n queryLang?: string | null;\n cookieLang?: string | null;\n acceptLanguage?: string | null;\n}): Locale {\n const fromAL = opts.acceptLanguage?.split(\",\")?.[0]; // ex: \"fr-CA,fr;q=0.9,en;q=0.8\"\n return normalize(opts.queryLang || opts.cookieLang || fromAL);\n}\n\n// Persister le choix utilisateur (client)\nexport function setUserLocale(loc: string) {\n const n = normalize(loc);\n if (typeof document !== \"undefined\") document.documentElement.lang = n;\n if (typeof window !== \"undefined\") localStorage.setItem(\"locale\", n);\n return n;\n}\n"],"names":["SUPPORTED","normalize","loc","lc","base","fromNavigator","fromStorage","fromQuery","detectClientLocale"],"mappings":"AAGA,MAAMA,IAAY,CAAC,MAAM,IAAI;AAGtB,SAASC,EAAUC,GAAsB;AAC9C,MAAI,CAACA,EAAK,QAAO;AAEjB,QAAMC,IAAKD,EAAI,YAAA,GACTE,IAAOD,EAAG,MAAM,GAAG,EAAE,CAAC;AAC5B,SAAOH,EAAU,SAASG,CAAS,IAAKA,IAAgBH,EAAU,SAASI,CAAW,IAAKA,IAAkB;AAC/G;AAMA,SAASC,IAAoC;AAC3C,MAAI,SAAO,YAAc;AACzB,WAAO,UAAU,YAAY,CAAC,KAAK,UAAU;AAC/C;AACA,SAASC,IAAkC;AACzC,MAAI,SAAO,SAAW;AACtB,WAAO,aAAa,QAAQ,QAAQ,KAAK;AAC3C;AACA,SAASC,IAAgC;AACvC,MAAI,SAAO,SAAW;AACtB,WAAO,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,MAAM,KAAK;AACpE;AAEO,SAASC,IAA6B;AAC3C,SAAOP;AAAA,IACLM,EAAA,KACED,EAAA;AAAA,IAEAD,EAAA;AAAA,EAAc;AAEpB;"}
@@ -1,19 +1,10 @@
1
1
  import { default as React } from 'react';
2
- import { Formats, I18n, Messages } from './i18n.types';
3
- type Loader = (locale: string) => Promise<{
4
- messages: Messages;
5
- formats: Formats;
6
- }>;
2
+ import { I18n } from './i18n.types';
7
3
  export interface I18nProviderProps {
8
4
  children: React.ReactNode;
9
5
  /** SSR hydrate */
10
6
  initialLocale?: string;
11
- /** for tests, storybook, preview */
12
- forcedLocale?: string;
13
- /** Lazy loading by locale of messages and formats (promise) */
14
- load: Loader;
15
7
  }
16
- export declare function I18nProvider({ children, initialLocale, forcedLocale, load }: I18nProviderProps): string | import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function I18nProvider({ children, initialLocale }: I18nProviderProps): import("react/jsx-runtime").JSX.Element;
17
9
  export declare function useI18n(): I18n;
18
- export {};
19
10
  //# sourceMappingURL=i18n.react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.react.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/i18n.react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAIpF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,iBAAiB,2DAwB9F;AAED,wBAAgB,OAAO,IAAI,IAAI,CAI9B"}
1
+ {"version":3,"file":"i18n.react.d.ts","sourceRoot":"","sources":["../../../src/lib/i18n/i18n.react.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAG5E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQpC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,iBAAiB,2CAwB1E;AAED,wBAAgB,OAAO,IAAI,IAAI,CAI9B"}