@abyss-project/commons-front-core 8.1.0 → 8.3.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.
Files changed (130) hide show
  1. package/README.md +78 -0
  2. package/catalog/captures-plan.ts +5 -1
  3. package/catalog/catalog-entries.ts +21 -1
  4. package/catalog/cloud-picker-fixture.tsx +97 -0
  5. package/catalog/pages/AccountMenu.tsx +62 -0
  6. package/catalog/pages/Avatar.tsx +94 -0
  7. package/catalog/pages/Callout.tsx +67 -0
  8. package/catalog/pages/CloudImport.tsx +35 -0
  9. package/catalog/pages/ContextSelector.tsx +103 -0
  10. package/catalog/pages/CopyField.tsx +29 -0
  11. package/catalog/pages/DropZone.tsx +37 -0
  12. package/catalog/pages/FormField.tsx +54 -0
  13. package/catalog/pages/ImportButton.tsx +45 -0
  14. package/catalog/pages/ImportFromCloudModal.tsx +33 -0
  15. package/catalog/pages/Menu.tsx +99 -98
  16. package/catalog/pages/NotificationsMenu.tsx +116 -0
  17. package/catalog/pages/NumberField.tsx +46 -0
  18. package/catalog/pages/QRCodeModal.tsx +26 -0
  19. package/catalog/pages/SettingsRow.tsx +67 -0
  20. package/catalog/pages/Tabs.tsx +72 -0
  21. package/catalog/pages/UsageMeter.tsx +58 -0
  22. package/catalog/pages/index.ts +34 -2
  23. package/catalog/specs/captures.spec.ts +7 -0
  24. package/catalog/specs/write-capture-index.ts +1 -0
  25. package/dist/{AbyssCookieConsentProvider-BhSzVu8P.js → AbyssCookieConsentProvider-B-PlGbFf.js} +815 -625
  26. package/dist/{CookieConsentSettings.component-DMEAuCVS.js → CookieConsentSettings.component-DEGCDEJW.js} +1 -1
  27. package/dist/components/business/CloudImport/CloudImport.d.ts +24 -0
  28. package/dist/components/business/CloudImport/cloud-import-tree.d.ts +22 -0
  29. package/dist/components/business/ImportFromCloudModal/ImportFromCloudModal.d.ts +21 -0
  30. package/dist/components/business/QRCodeModal/QRCodeModal.d.ts +18 -0
  31. package/dist/components/business/QRCodeModal/QRCodeModal.spec.d.ts +1 -0
  32. package/dist/components/business/index.d.ts +3 -0
  33. package/dist/components/data/DataTable/data-table.types.d.ts +10 -0
  34. package/dist/components/data/UsageMeter/UsageMeter.d.ts +31 -0
  35. package/dist/components/data/UsageMeter/UsageMeter.spec.d.ts +1 -0
  36. package/dist/components/data/index.d.ts +1 -0
  37. package/dist/components/inputs/ContextSelector/ContextSelector.d.ts +60 -0
  38. package/dist/components/inputs/ContextSelector/ContextSelector.spec.d.ts +1 -0
  39. package/dist/components/inputs/CopyField/CopyField.d.ts +19 -0
  40. package/dist/components/inputs/CopyField/CopyField.spec.d.ts +1 -0
  41. package/dist/components/inputs/DropZone/DropZone.d.ts +30 -0
  42. package/dist/components/inputs/DropZone/DropZone.spec.d.ts +1 -0
  43. package/dist/components/inputs/FormField/FormField.d.ts +29 -0
  44. package/dist/components/inputs/FormField/FormField.spec.d.ts +1 -0
  45. package/dist/components/inputs/ImportButton/ImportButton.d.ts +33 -0
  46. package/dist/components/inputs/ImportButton/ImportButton.spec.d.ts +1 -0
  47. package/dist/components/inputs/NumberField/NumberField.d.ts +21 -0
  48. package/dist/components/inputs/NumberField/NumberField.spec.d.ts +1 -0
  49. package/dist/components/inputs/NumberField/number-input.d.ts +13 -0
  50. package/dist/components/inputs/SettingsRow/SettingsRow.d.ts +16 -0
  51. package/dist/components/inputs/SettingsRow/SettingsRow.spec.d.ts +1 -0
  52. package/dist/components/inputs/index.d.ts +7 -0
  53. package/dist/components/layers/CommandPalette/CommandPalette.d.ts +27 -6
  54. package/dist/components/layers/CommandPalette/command-registry.d.ts +39 -9
  55. package/dist/components/layers/Menu/Menu.d.ts +2 -0
  56. package/dist/components/layers/Modal/Modal.d.ts +2 -1
  57. package/dist/components/meaning/Avatar/Avatar.d.ts +41 -0
  58. package/dist/components/meaning/Avatar/Avatar.spec.d.ts +1 -0
  59. package/dist/components/meaning/index.d.ts +1 -0
  60. package/dist/components/states/Callout/Callout.d.ts +25 -0
  61. package/dist/components/states/Callout/Callout.spec.d.ts +1 -0
  62. package/dist/components/states/PageState/PageState.d.ts +6 -1
  63. package/dist/components/states/index.d.ts +1 -0
  64. package/dist/components/structure/AccountMenu/AccountMenu.d.ts +27 -0
  65. package/dist/components/structure/AccountMenu/AccountMenu.spec.d.ts +1 -0
  66. package/dist/components/structure/AppShell/AppShell.d.ts +9 -3
  67. package/dist/components/structure/AppShell/ShellNavigation.d.ts +4 -2
  68. package/dist/components/structure/AppShell/app-shell.types.d.ts +38 -2
  69. package/dist/components/structure/NotificationsMenu/NotificationsMenu.d.ts +36 -0
  70. package/dist/components/structure/NotificationsMenu/NotificationsMenu.spec.d.ts +1 -0
  71. package/dist/components/structure/PageHeader/PageHeader.d.ts +2 -2
  72. package/dist/components/structure/Tabs/Tabs.d.ts +34 -0
  73. package/dist/components/structure/Tabs/Tabs.spec.d.ts +1 -0
  74. package/dist/components/structure/index.d.ts +3 -0
  75. package/dist/components/structure/test-support/structure-test-harness.d.ts +6 -0
  76. package/dist/cookie-consent.js +2 -2
  77. package/dist/design-theme-CKTz_cOa.js +15490 -0
  78. package/dist/hooks/index.d.ts +1 -0
  79. package/dist/hooks/use-rich-intl.hook.d.ts +190 -0
  80. package/dist/hooks/use-scroll-overflow-cue.hook.d.ts +9 -0
  81. package/dist/hooks/use-scroll-overflow-cue.hook.spec.d.ts +1 -0
  82. package/dist/{index-D5e4uD4k.js → index-7N3J68EI.js} +2 -2
  83. package/dist/{index-BqIg55B3.js → index-B3rK_-T4.js} +4 -4
  84. package/dist/{index-6KdfKdSJ.js → index-B6qHo25Z.js} +2 -2
  85. package/dist/{index-BTjzj7mm.js → index-BMaAO_4e.js} +2 -2
  86. package/dist/{index-CHGRiRCe.js → index-B_jSh70G.js} +3 -3
  87. package/dist/{index-BkfBpYKR.js → index-B_yywet5.js} +3 -3
  88. package/dist/{index-DixNft1u.js → index-Bdtvzv-J.js} +2 -2
  89. package/dist/{index-ClLoBnCN.js → index-Bh2_8FCK.js} +2 -2
  90. package/dist/{index-D_GWBYM2.js → index-Bpg9TBMX.js} +1 -1
  91. package/dist/{index-GoHiFeaw.js → index-Bpnf8xKI.js} +2 -2
  92. package/dist/{index-bR-mnNUA.js → index-Bw2swxVq.js} +2 -2
  93. package/dist/{index-LdiTmDFg.js → index-BxxZgBFn.js} +2 -2
  94. package/dist/{index-ASLTmD1Y.js → index-Ca9tzEsn.js} +2 -2
  95. package/dist/{index-21vSFz6u.js → index-Csvh-AG6.js} +2 -2
  96. package/dist/{index-l7FAjaVB.js → index-CwuklsUK.js} +3 -3
  97. package/dist/{index-Ni4BmFs4.js → index-DFC9xBY9.js} +2 -2
  98. package/dist/{index-Btnmn1iK.js → index-DfUcsAJv.js} +4 -4
  99. package/dist/{index-D4Qh2Iww.js → index-DqedXp41.js} +3 -3
  100. package/dist/{index-BVS73U9E.js → index-DwXNHQIp.js} +4 -4
  101. package/dist/{index-BtsnuEJC.js → index-_UY_fqvv.js} +28415 -34554
  102. package/dist/{index-7HAvRXgu.js → index-dVVflNge.js} +2 -2
  103. package/dist/{index-C92C_oG5.js → index-sEWp0xIC.js} +2 -2
  104. package/dist/index.js +8273 -5009
  105. package/dist/legacy/components/QuotaOffer/AbyssQuotaOffer.component.d.ts +1 -1
  106. package/dist/legacy/components/QuotaOffer/index.d.ts +2 -2
  107. package/dist/legacy/theme/core-breakpoints-under-legacy-theme.spec.d.ts +1 -0
  108. package/dist/legacy.js +144 -144
  109. package/dist/theme/DesignCssVariables.d.ts +11 -0
  110. package/dist/theme/DesignCssVariables.spec.d.ts +1 -0
  111. package/dist/theme/components/shared.d.ts +4 -1
  112. package/dist/theme/css-variables.d.ts +7 -0
  113. package/dist/theme/design-media.d.ts +26 -0
  114. package/dist/theme/design-media.spec.d.ts +1 -0
  115. package/dist/theme/focus-ring.spec.d.ts +1 -0
  116. package/dist/theme/index.d.ts +4 -0
  117. package/dist/theme/tokens/semantic.d.ts +1 -1
  118. package/dist/theme/use-design-breakpoint.d.ts +7 -0
  119. package/dist/translations/en.d.ts +95 -0
  120. package/dist/translations/fr.d.ts +95 -0
  121. package/dist/utils/cloud-accept.utils.spec.d.ts +1 -0
  122. package/dist/utils/index.d.ts +1 -0
  123. package/dist/utils/quota-offer-state.utils.spec.d.ts +1 -0
  124. package/package.json +1 -1
  125. package/test-results/catalog/.last-run.json +4 -0
  126. package/dist/design-theme-CvLzOz3p.js +0 -9305
  127. /package/dist/{legacy/components/Inputs/CloudImport/cloud-accept.spec.d.ts → components/business/CloudImport/CloudImport.spec.d.ts} +0 -0
  128. /package/dist/{legacy/components/QuotaOffer/quota-offer-state.spec.d.ts → components/business/ImportFromCloudModal/ImportFromCloudModal.spec.d.ts} +0 -0
  129. /package/dist/{legacy/components/Inputs/CloudImport/cloud-accept.d.ts → utils/cloud-accept.utils.d.ts} +0 -0
  130. /package/dist/{legacy/components/QuotaOffer/quota-offer-state.d.ts → utils/quota-offer-state.utils.d.ts} +0 -0
@@ -0,0 +1,72 @@
1
+ import { useState } from 'react';
2
+ import { Tabs, TabsVariant } from '../../src/components/structure/Tabs/Tabs';
3
+ import type { TabItem } from '../../src/components/structure/Tabs/Tabs';
4
+ import { Example, LastEvent, Showcase, useEventLog } from '../frame';
5
+
6
+ const ACCOUNT_TABS: TabItem[] = [
7
+ { value: 'profile', label: 'Profil', to: '/compte/profil' },
8
+ { value: 'security', label: 'Sécurité', to: '/compte/securite' },
9
+ {
10
+ value: 'notifications',
11
+ label: 'Notifications',
12
+ to: '/compte/notifications',
13
+ },
14
+ { value: 'family', label: 'Famille', to: '/compte/famille', badge: 2 },
15
+ { value: 'billing', label: 'Facturation', to: '/compte/facturation' },
16
+ { value: 'api-key', label: 'Clé d’API', to: '/compte/cle-api' },
17
+ { value: 'ai', label: 'Connexions IA', to: '/compte/connexions-ia' },
18
+ {
19
+ value: 'admin',
20
+ label: 'Administration',
21
+ to: '/compte/admin',
22
+ hidden: true,
23
+ },
24
+ ];
25
+
26
+ const BILLING_TABS: TabItem[] = [
27
+ { value: 'overview', label: 'Vue d’ensemble' },
28
+ { value: 'subscription', label: 'Abonnement' },
29
+ { value: 'storage', label: 'Stockage' },
30
+ { value: 'credits', label: 'Crédits' },
31
+ { value: 'payment', label: 'Moyens de paiement' },
32
+ { value: 'invoices', label: 'Factures', badge: 'Nouveau' },
33
+ ];
34
+
35
+ export const TabsPage = () => {
36
+ const { log } = useEventLog();
37
+ const [account, setAccount] = useState('billing');
38
+ const [billing, setBilling] = useState('overview');
39
+ return (
40
+ <Showcase
41
+ family="Structure"
42
+ name="Tabs"
43
+ description="Rangée d'onglets : liens de route ou boutons, deux variantes, un seul arrêt de tabulation, flèches, Début et Fin, défilement horizontal avec un fondu tant qu'il reste des onglets à droite."
44
+ >
45
+ <Example title="Navigation du compte (primaire, liens de route ; « Administration » est masqué)">
46
+ <Tabs
47
+ aria-label="Compte"
48
+ variant={TabsVariant.Primary}
49
+ items={ACCOUNT_TABS}
50
+ value={account}
51
+ onChange={(next) => {
52
+ setAccount(next);
53
+ log(`onglet ${next}`);
54
+ }}
55
+ />
56
+ </Example>
57
+ <Example title="Sous-navigation de la facturation (secondaire, boutons)">
58
+ <Tabs
59
+ aria-label="Facturation"
60
+ variant={TabsVariant.Secondary}
61
+ items={BILLING_TABS}
62
+ value={billing}
63
+ onChange={(next) => {
64
+ setBilling(next);
65
+ log(`sous-onglet ${next}`);
66
+ }}
67
+ />
68
+ </Example>
69
+ <LastEvent />
70
+ </Showcase>
71
+ );
72
+ };
@@ -0,0 +1,58 @@
1
+ import { UsageMeter } from '../../src/components/data/UsageMeter/UsageMeter';
2
+ import { Columns, Example, Showcase } from '../frame';
3
+ import { formatInteger } from '../fixtures';
4
+
5
+ const THRESHOLDS = { warning: 0.8, danger: 1 };
6
+
7
+ const gigabyteFormat = new Intl.NumberFormat('fr-FR', {
8
+ maximumFractionDigits: 1,
9
+ });
10
+
11
+ const gigabytes = (value: number): string =>
12
+ `${gigabyteFormat.format(value)} Go`;
13
+
14
+ export const UsageMeterPage = () => (
15
+ <Showcase
16
+ family="Données"
17
+ name="UsageMeter"
18
+ description="Consommation sur un plafond : jauge à l'accent, puis à l'avertissement et au danger aux seuils ; sans plafond, la valeur seule."
19
+ >
20
+ <Example title="Sous les seuils, au seuil d'avertissement, au plafond">
21
+ <Columns>
22
+ <UsageMeter
23
+ label="Stockage"
24
+ value={3.2}
25
+ max={10}
26
+ thresholds={THRESHOLDS}
27
+ formatValue={gigabytes}
28
+ />
29
+ <UsageMeter
30
+ label="Crédits IA"
31
+ value={8600}
32
+ max={10000}
33
+ thresholds={THRESHOLDS}
34
+ formatValue={formatInteger}
35
+ />
36
+ <UsageMeter
37
+ label="Membres"
38
+ value={5}
39
+ max={5}
40
+ thresholds={THRESHOLDS}
41
+ formatValue={formatInteger}
42
+ />
43
+ </Columns>
44
+ </Example>
45
+ <Example title="Au-delà du plafond, et sans plafond">
46
+ <Columns>
47
+ <UsageMeter
48
+ label="Stockage"
49
+ value={12.5}
50
+ max={10}
51
+ thresholds={THRESHOLDS}
52
+ formatValue={gigabytes}
53
+ />
54
+ <UsageMeter label="Fichiers" value={3210} formatValue={formatInteger} />
55
+ </Columns>
56
+ </Example>
57
+ </Showcase>
58
+ );
@@ -1,24 +1,37 @@
1
1
  import type { ComponentType } from 'react';
2
+ import { AccountMenuPage } from './AccountMenu';
2
3
  import { ActionBarPage } from './ActionBar';
3
4
  import { AppShellPage } from './AppShell';
5
+ import { AvatarPage } from './Avatar';
4
6
  import { BottomSheetPage } from './BottomSheet';
7
+ import { CalloutPage } from './Callout';
5
8
  import { ChartThemePage } from './ChartTheme';
9
+ import { CloudImportPage } from './CloudImport';
6
10
  import { ColorFieldPage } from './ColorField';
7
11
  import { CommandPalettePage } from './CommandPalette';
8
12
  import { ConfirmDialogPage } from './ConfirmDialog';
13
+ import { ContextSelectorPage } from './ContextSelector';
14
+ import { CopyFieldPage } from './CopyField';
9
15
  import { DataTablePage } from './DataTable';
10
16
  import { DateFieldPage } from './DateField';
11
17
  import { DateRangeFieldPage } from './DateRangeField';
12
18
  import { DrawerPage } from './Drawer';
19
+ import { DropZonePage } from './DropZone';
13
20
  import { FilterBarPage } from './FilterBar';
21
+ import { FormFieldPage } from './FormField';
22
+ import { ImportButtonPage } from './ImportButton';
23
+ import { ImportFromCloudModalPage } from './ImportFromCloudModal';
14
24
  import { InfectedDownloadModalPage } from './InfectedDownloadModal';
15
25
  import { KeyValueListPage } from './KeyValueList';
16
26
  import { MenuPage } from './Menu';
17
27
  import { MethodBadgePage } from './MethodBadge';
18
28
  import { MobileShellPage } from './MobileShell';
19
29
  import { ModalPage } from './Modal';
30
+ import { NotificationsMenuPage } from './NotificationsMenu';
31
+ import { NumberFieldPage } from './NumberField';
20
32
  import { PageHeaderPage } from './PageHeader';
21
33
  import { PageStatePage } from './PageState';
34
+ import { QRCodeModalPage } from './QRCodeModal';
22
35
  import { RichSelectPage } from './RichSelect';
23
36
  import { RoleBadgePage } from './RoleBadge';
24
37
  import { ScanBadgePage } from './ScanBadge';
@@ -26,6 +39,7 @@ import { SceneDesktopPage } from './SceneDesktop';
26
39
  import { SceneMobilePage } from './SceneMobile';
27
40
  import { SectionPage } from './Section';
28
41
  import { SegmentedControlPage } from './SegmentedControl';
42
+ import { SettingsRowPage } from './SettingsRow';
29
43
  import { SeverityBadgePage } from './SeverityBadge';
30
44
  import { SparklinePage } from './Sparkline';
31
45
  import { SplitViewPage } from './SplitView';
@@ -33,32 +47,47 @@ import { StatTilePage } from './StatTile';
33
47
  import { StatusBadgePage } from './StatusBadge';
34
48
  import { SurfacePage } from './Surface';
35
49
  import { SwipeDeckPage } from './SwipeDeck';
50
+ import { TabsPage } from './Tabs';
36
51
  import { ToastPage } from './Toast';
37
- import { ToolIconPage } from './ToolIcon';
38
52
  import { ToolbarPage } from './Toolbar';
53
+ import { ToolIconPage } from './ToolIcon';
54
+ import { UsageMeterPage } from './UsageMeter';
39
55
 
40
56
  /** Every catalog page, by the `component` URL parameter (`catalog-entries.ts`). */
41
57
  export const CATALOG_PAGES: Record<string, ComponentType> = {
58
+ AccountMenu: AccountMenuPage,
42
59
  ActionBar: ActionBarPage,
43
60
  AppShell: AppShellPage,
61
+ Avatar: AvatarPage,
44
62
  BottomSheet: BottomSheetPage,
63
+ Callout: CalloutPage,
45
64
  ChartTheme: ChartThemePage,
65
+ CloudImport: CloudImportPage,
46
66
  ColorField: ColorFieldPage,
47
67
  CommandPalette: CommandPalettePage,
48
68
  ConfirmDialog: ConfirmDialogPage,
69
+ ContextSelector: ContextSelectorPage,
70
+ CopyField: CopyFieldPage,
49
71
  DataTable: DataTablePage,
50
72
  DateField: DateFieldPage,
51
73
  DateRangeField: DateRangeFieldPage,
52
74
  Drawer: DrawerPage,
75
+ DropZone: DropZonePage,
53
76
  FilterBar: FilterBarPage,
77
+ FormField: FormFieldPage,
78
+ ImportButton: ImportButtonPage,
79
+ ImportFromCloudModal: ImportFromCloudModalPage,
54
80
  InfectedDownloadModal: InfectedDownloadModalPage,
55
81
  KeyValueList: KeyValueListPage,
56
82
  Menu: MenuPage,
57
83
  MethodBadge: MethodBadgePage,
58
84
  MobileShell: MobileShellPage,
59
85
  Modal: ModalPage,
86
+ NotificationsMenu: NotificationsMenuPage,
87
+ NumberField: NumberFieldPage,
60
88
  PageHeader: PageHeaderPage,
61
89
  PageState: PageStatePage,
90
+ QRCodeModal: QRCodeModalPage,
62
91
  RichSelect: RichSelectPage,
63
92
  RoleBadge: RoleBadgePage,
64
93
  ScanBadge: ScanBadgePage,
@@ -66,6 +95,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
66
95
  SceneMobile: SceneMobilePage,
67
96
  Section: SectionPage,
68
97
  SegmentedControl: SegmentedControlPage,
98
+ SettingsRow: SettingsRowPage,
69
99
  SeverityBadge: SeverityBadgePage,
70
100
  Sparkline: SparklinePage,
71
101
  SplitView: SplitViewPage,
@@ -73,7 +103,9 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
73
103
  StatusBadge: StatusBadgePage,
74
104
  Surface: SurfacePage,
75
105
  SwipeDeck: SwipeDeckPage,
106
+ Tabs: TabsPage,
76
107
  Toast: ToastPage,
77
- ToolIcon: ToolIconPage,
78
108
  Toolbar: ToolbarPage,
109
+ ToolIcon: ToolIconPage,
110
+ UsageMeter: UsageMeterPage,
79
111
  };
@@ -32,6 +32,13 @@ const REACH: Record<
32
32
  .click();
33
33
  await expect(page.getByRole('dialog')).toBeVisible();
34
34
  },
35
+ // The first top bar trigger of the page: the notifications bell or the account avatar.
36
+ 'panel-open': async (page) => {
37
+ await page.locator('[aria-haspopup]').first().click();
38
+ await expect(
39
+ page.getByRole('dialog').or(page.getByRole('menu')),
40
+ ).toBeVisible();
41
+ },
35
42
  };
36
43
 
37
44
  for (const capture of CAPTURES) {
@@ -24,6 +24,7 @@ const STATE_LABEL: Record<CaptureState, string> = {
24
24
  'sheet-open': ', feuille ouverte',
25
25
  'list-open': ', liste ouverte',
26
26
  'calendar-open': ', calendrier ouvert',
27
+ 'panel-open': ', panneau ouvert',
27
28
  };
28
29
 
29
30
  const describe = (capture: Capture): string =>