@abyss-project/commons-front-core 8.2.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 (99) hide show
  1. package/README.md +171 -125
  2. package/catalog/catalog-entries.ts +17 -1
  3. package/catalog/cloud-picker-fixture.tsx +97 -0
  4. package/catalog/pages/Avatar.tsx +94 -0
  5. package/catalog/pages/Callout.tsx +67 -0
  6. package/catalog/pages/CloudImport.tsx +35 -0
  7. package/catalog/pages/ContextSelector.tsx +103 -0
  8. package/catalog/pages/CopyField.tsx +29 -0
  9. package/catalog/pages/DropZone.tsx +37 -0
  10. package/catalog/pages/FormField.tsx +54 -0
  11. package/catalog/pages/ImportButton.tsx +45 -0
  12. package/catalog/pages/ImportFromCloudModal.tsx +33 -0
  13. package/catalog/pages/Menu.tsx +99 -98
  14. package/catalog/pages/NumberField.tsx +46 -0
  15. package/catalog/pages/QRCodeModal.tsx +26 -0
  16. package/catalog/pages/SettingsRow.tsx +67 -0
  17. package/catalog/pages/Tabs.tsx +72 -0
  18. package/catalog/pages/UsageMeter.tsx +58 -0
  19. package/catalog/pages/index.ts +30 -2
  20. package/dist/{AbyssCookieConsentProvider-TE46ywnd.js → AbyssCookieConsentProvider-B-PlGbFf.js} +1096 -946
  21. package/dist/{CookieConsentSettings.component-BKsYgpMa.js → CookieConsentSettings.component-DEGCDEJW.js} +1 -1
  22. package/dist/components/business/CloudImport/CloudImport.d.ts +24 -0
  23. package/dist/components/business/CloudImport/cloud-import-tree.d.ts +22 -0
  24. package/dist/components/business/ImportFromCloudModal/ImportFromCloudModal.d.ts +21 -0
  25. package/dist/components/business/QRCodeModal/QRCodeModal.d.ts +18 -0
  26. package/dist/components/business/QRCodeModal/QRCodeModal.spec.d.ts +1 -0
  27. package/dist/components/business/index.d.ts +3 -0
  28. package/dist/components/data/DataTable/data-table.types.d.ts +10 -0
  29. package/dist/components/data/UsageMeter/UsageMeter.d.ts +31 -0
  30. package/dist/components/data/UsageMeter/UsageMeter.spec.d.ts +1 -0
  31. package/dist/components/data/index.d.ts +1 -0
  32. package/dist/components/inputs/ContextSelector/ContextSelector.d.ts +60 -0
  33. package/dist/components/inputs/ContextSelector/ContextSelector.spec.d.ts +1 -0
  34. package/dist/components/inputs/CopyField/CopyField.d.ts +19 -0
  35. package/dist/components/inputs/CopyField/CopyField.spec.d.ts +1 -0
  36. package/dist/components/inputs/DropZone/DropZone.d.ts +30 -0
  37. package/dist/components/inputs/DropZone/DropZone.spec.d.ts +1 -0
  38. package/dist/components/inputs/FormField/FormField.d.ts +29 -0
  39. package/dist/components/inputs/FormField/FormField.spec.d.ts +1 -0
  40. package/dist/components/inputs/ImportButton/ImportButton.d.ts +33 -0
  41. package/dist/components/inputs/ImportButton/ImportButton.spec.d.ts +1 -0
  42. package/dist/components/inputs/NumberField/NumberField.d.ts +21 -0
  43. package/dist/components/inputs/NumberField/NumberField.spec.d.ts +1 -0
  44. package/dist/components/inputs/NumberField/number-input.d.ts +13 -0
  45. package/dist/components/inputs/SettingsRow/SettingsRow.d.ts +16 -0
  46. package/dist/components/inputs/SettingsRow/SettingsRow.spec.d.ts +1 -0
  47. package/dist/components/inputs/index.d.ts +7 -0
  48. package/dist/components/layers/Menu/Menu.d.ts +2 -0
  49. package/dist/components/meaning/Avatar/Avatar.d.ts +41 -0
  50. package/dist/components/meaning/Avatar/Avatar.spec.d.ts +1 -0
  51. package/dist/components/meaning/index.d.ts +1 -0
  52. package/dist/components/states/Callout/Callout.d.ts +25 -0
  53. package/dist/components/states/Callout/Callout.spec.d.ts +1 -0
  54. package/dist/components/states/index.d.ts +1 -0
  55. package/dist/components/structure/Tabs/Tabs.d.ts +34 -0
  56. package/dist/components/structure/Tabs/Tabs.spec.d.ts +1 -0
  57. package/dist/components/structure/index.d.ts +1 -0
  58. package/dist/cookie-consent.js +2 -2
  59. package/dist/design-theme-CKTz_cOa.js +15490 -0
  60. package/dist/hooks/use-rich-intl.hook.d.ts +150 -0
  61. package/dist/{index-Dhz388yW.js → index-7N3J68EI.js} +2 -2
  62. package/dist/{index-BI8z_ZwK.js → index-B3rK_-T4.js} +4 -4
  63. package/dist/{index-BZfgg1Dp.js → index-B6qHo25Z.js} +2 -2
  64. package/dist/{index-D490I-Im.js → index-BMaAO_4e.js} +2 -2
  65. package/dist/{index-FS21eF3a.js → index-B_jSh70G.js} +3 -3
  66. package/dist/{index-B-Gq5Zeh.js → index-B_yywet5.js} +3 -3
  67. package/dist/{index-BR66kEMM.js → index-Bdtvzv-J.js} +2 -2
  68. package/dist/{index-C-bs2P06.js → index-Bh2_8FCK.js} +2 -2
  69. package/dist/{index-BXs_bBcm.js → index-Bpg9TBMX.js} +1 -1
  70. package/dist/{index-4BMCQ_6u.js → index-Bpnf8xKI.js} +2 -2
  71. package/dist/{index-DPxFwYmx.js → index-Bw2swxVq.js} +2 -2
  72. package/dist/{index-DjLWvtUt.js → index-BxxZgBFn.js} +2 -2
  73. package/dist/{index-C6ZLgLu-.js → index-Ca9tzEsn.js} +2 -2
  74. package/dist/{index-Bi3OW3pz.js → index-Csvh-AG6.js} +2 -2
  75. package/dist/{index-ltq6POQa.js → index-CwuklsUK.js} +3 -3
  76. package/dist/{index-csvcp4rP.js → index-DFC9xBY9.js} +2 -2
  77. package/dist/{index-C4VmhCn7.js → index-DfUcsAJv.js} +4 -4
  78. package/dist/{index-Bu5LDz63.js → index-DqedXp41.js} +3 -3
  79. package/dist/{index-CK9kVK6Y.js → index-DwXNHQIp.js} +4 -4
  80. package/dist/{index-Dm6584pR.js → index-_UY_fqvv.js} +28373 -34464
  81. package/dist/{index-DC-vg2P2.js → index-dVVflNge.js} +2 -2
  82. package/dist/{index-DistZiPf.js → index-sEWp0xIC.js} +2 -2
  83. package/dist/index.js +7214 -5051
  84. package/dist/legacy/components/QuotaOffer/AbyssQuotaOffer.component.d.ts +1 -1
  85. package/dist/legacy/components/QuotaOffer/index.d.ts +2 -2
  86. package/dist/legacy.js +142 -142
  87. package/dist/theme/tokens/semantic.d.ts +1 -1
  88. package/dist/translations/en.d.ts +75 -0
  89. package/dist/translations/fr.d.ts +75 -0
  90. package/dist/utils/cloud-accept.utils.spec.d.ts +1 -0
  91. package/dist/utils/index.d.ts +1 -0
  92. package/dist/utils/quota-offer-state.utils.spec.d.ts +1 -0
  93. package/package.json +1 -1
  94. package/test-results/catalog/.last-run.json +4 -0
  95. package/dist/design-theme-CN_6fRX3.js +0 -9344
  96. /package/dist/{legacy/components/Inputs/CloudImport/cloud-accept.spec.d.ts → components/business/CloudImport/CloudImport.spec.d.ts} +0 -0
  97. /package/dist/{legacy/components/QuotaOffer/quota-offer-state.spec.d.ts → components/business/ImportFromCloudModal/ImportFromCloudModal.spec.d.ts} +0 -0
  98. /package/dist/{legacy/components/Inputs/CloudImport/cloud-accept.d.ts → utils/cloud-accept.utils.d.ts} +0 -0
  99. /package/dist/{legacy/components/QuotaOffer/quota-offer-state.d.ts → utils/quota-offer-state.utils.d.ts} +0 -0
@@ -0,0 +1,67 @@
1
+ import { useState } from 'react';
2
+ import Button from '@mui/material/Button';
3
+ import MenuItem from '@mui/material/MenuItem';
4
+ import Select from '@mui/material/Select';
5
+ import Switch from '@mui/material/Switch';
6
+ import { SettingsRow } from '../../src/components/inputs/SettingsRow/SettingsRow';
7
+ import { Surface } from '../../src/components/structure/Surface/Surface';
8
+ import { Example, LastEvent, Showcase, useEventLog } from '../frame';
9
+
10
+ export const SettingsRowPage = () => {
11
+ const { log } = useEventLog();
12
+ const [renew, setRenew] = useState(true);
13
+ const [language, setLanguage] = useState('fr');
14
+ return (
15
+ <Showcase
16
+ family="Saisie"
17
+ name="SettingsRow"
18
+ description="Un réglage : libellé et description à gauche, contrôle à droite, lignes séparées d'un filet ; le contrôle passe sous le texte sous 768 px."
19
+ >
20
+ <Example title="Réglages de l'abonnement, dans une surface">
21
+ <Surface padding={4}>
22
+ <SettingsRow
23
+ label="Renouvellement automatique"
24
+ description="Votre abonnement est reconduit à chaque échéance, au tarif en vigueur."
25
+ htmlFor="catalog-auto-renew"
26
+ control={
27
+ <Switch
28
+ id="catalog-auto-renew"
29
+ checked={renew}
30
+ onChange={(event) => setRenew(event.target.checked)}
31
+ />
32
+ }
33
+ />
34
+ <SettingsRow
35
+ label="Langue des factures"
36
+ description="Les prochaines factures seront émises dans cette langue."
37
+ control={
38
+ <Select
39
+ size="small"
40
+ value={language}
41
+ inputProps={{ 'aria-label': 'Langue des factures' }}
42
+ onChange={(event) => setLanguage(event.target.value)}
43
+ >
44
+ <MenuItem value="fr">Français</MenuItem>
45
+ <MenuItem value="en">English</MenuItem>
46
+ </Select>
47
+ }
48
+ />
49
+ <SettingsRow
50
+ label="Résilier l'abonnement"
51
+ description="Vous gardez l'accès jusqu'à la fin de la période payée."
52
+ control={
53
+ <Button
54
+ variant="outlined"
55
+ color="error"
56
+ onClick={() => log('résilier')}
57
+ >
58
+ Résilier
59
+ </Button>
60
+ }
61
+ />
62
+ </Surface>
63
+ </Example>
64
+ <LastEvent />
65
+ </Showcase>
66
+ );
67
+ };
@@ -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
+ );
@@ -2,16 +2,25 @@ import type { ComponentType } from 'react';
2
2
  import { AccountMenuPage } from './AccountMenu';
3
3
  import { ActionBarPage } from './ActionBar';
4
4
  import { AppShellPage } from './AppShell';
5
+ import { AvatarPage } from './Avatar';
5
6
  import { BottomSheetPage } from './BottomSheet';
7
+ import { CalloutPage } from './Callout';
6
8
  import { ChartThemePage } from './ChartTheme';
9
+ import { CloudImportPage } from './CloudImport';
7
10
  import { ColorFieldPage } from './ColorField';
8
11
  import { CommandPalettePage } from './CommandPalette';
9
12
  import { ConfirmDialogPage } from './ConfirmDialog';
13
+ import { ContextSelectorPage } from './ContextSelector';
14
+ import { CopyFieldPage } from './CopyField';
10
15
  import { DataTablePage } from './DataTable';
11
16
  import { DateFieldPage } from './DateField';
12
17
  import { DateRangeFieldPage } from './DateRangeField';
13
18
  import { DrawerPage } from './Drawer';
19
+ import { DropZonePage } from './DropZone';
14
20
  import { FilterBarPage } from './FilterBar';
21
+ import { FormFieldPage } from './FormField';
22
+ import { ImportButtonPage } from './ImportButton';
23
+ import { ImportFromCloudModalPage } from './ImportFromCloudModal';
15
24
  import { InfectedDownloadModalPage } from './InfectedDownloadModal';
16
25
  import { KeyValueListPage } from './KeyValueList';
17
26
  import { MenuPage } from './Menu';
@@ -19,8 +28,10 @@ import { MethodBadgePage } from './MethodBadge';
19
28
  import { MobileShellPage } from './MobileShell';
20
29
  import { ModalPage } from './Modal';
21
30
  import { NotificationsMenuPage } from './NotificationsMenu';
31
+ import { NumberFieldPage } from './NumberField';
22
32
  import { PageHeaderPage } from './PageHeader';
23
33
  import { PageStatePage } from './PageState';
34
+ import { QRCodeModalPage } from './QRCodeModal';
24
35
  import { RichSelectPage } from './RichSelect';
25
36
  import { RoleBadgePage } from './RoleBadge';
26
37
  import { ScanBadgePage } from './ScanBadge';
@@ -28,6 +39,7 @@ import { SceneDesktopPage } from './SceneDesktop';
28
39
  import { SceneMobilePage } from './SceneMobile';
29
40
  import { SectionPage } from './Section';
30
41
  import { SegmentedControlPage } from './SegmentedControl';
42
+ import { SettingsRowPage } from './SettingsRow';
31
43
  import { SeverityBadgePage } from './SeverityBadge';
32
44
  import { SparklinePage } from './Sparkline';
33
45
  import { SplitViewPage } from './SplitView';
@@ -35,25 +47,36 @@ import { StatTilePage } from './StatTile';
35
47
  import { StatusBadgePage } from './StatusBadge';
36
48
  import { SurfacePage } from './Surface';
37
49
  import { SwipeDeckPage } from './SwipeDeck';
50
+ import { TabsPage } from './Tabs';
38
51
  import { ToastPage } from './Toast';
39
- import { ToolIconPage } from './ToolIcon';
40
52
  import { ToolbarPage } from './Toolbar';
53
+ import { ToolIconPage } from './ToolIcon';
54
+ import { UsageMeterPage } from './UsageMeter';
41
55
 
42
56
  /** Every catalog page, by the `component` URL parameter (`catalog-entries.ts`). */
43
57
  export const CATALOG_PAGES: Record<string, ComponentType> = {
44
58
  AccountMenu: AccountMenuPage,
45
59
  ActionBar: ActionBarPage,
46
60
  AppShell: AppShellPage,
61
+ Avatar: AvatarPage,
47
62
  BottomSheet: BottomSheetPage,
63
+ Callout: CalloutPage,
48
64
  ChartTheme: ChartThemePage,
65
+ CloudImport: CloudImportPage,
49
66
  ColorField: ColorFieldPage,
50
67
  CommandPalette: CommandPalettePage,
51
68
  ConfirmDialog: ConfirmDialogPage,
69
+ ContextSelector: ContextSelectorPage,
70
+ CopyField: CopyFieldPage,
52
71
  DataTable: DataTablePage,
53
72
  DateField: DateFieldPage,
54
73
  DateRangeField: DateRangeFieldPage,
55
74
  Drawer: DrawerPage,
75
+ DropZone: DropZonePage,
56
76
  FilterBar: FilterBarPage,
77
+ FormField: FormFieldPage,
78
+ ImportButton: ImportButtonPage,
79
+ ImportFromCloudModal: ImportFromCloudModalPage,
57
80
  InfectedDownloadModal: InfectedDownloadModalPage,
58
81
  KeyValueList: KeyValueListPage,
59
82
  Menu: MenuPage,
@@ -61,8 +84,10 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
61
84
  MobileShell: MobileShellPage,
62
85
  Modal: ModalPage,
63
86
  NotificationsMenu: NotificationsMenuPage,
87
+ NumberField: NumberFieldPage,
64
88
  PageHeader: PageHeaderPage,
65
89
  PageState: PageStatePage,
90
+ QRCodeModal: QRCodeModalPage,
66
91
  RichSelect: RichSelectPage,
67
92
  RoleBadge: RoleBadgePage,
68
93
  ScanBadge: ScanBadgePage,
@@ -70,6 +95,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
70
95
  SceneMobile: SceneMobilePage,
71
96
  Section: SectionPage,
72
97
  SegmentedControl: SegmentedControlPage,
98
+ SettingsRow: SettingsRowPage,
73
99
  SeverityBadge: SeverityBadgePage,
74
100
  Sparkline: SparklinePage,
75
101
  SplitView: SplitViewPage,
@@ -77,7 +103,9 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
77
103
  StatusBadge: StatusBadgePage,
78
104
  Surface: SurfacePage,
79
105
  SwipeDeck: SwipeDeckPage,
106
+ Tabs: TabsPage,
80
107
  Toast: ToastPage,
81
- ToolIcon: ToolIconPage,
82
108
  Toolbar: ToolbarPage,
109
+ ToolIcon: ToolIconPage,
110
+ UsageMeter: UsageMeterPage,
83
111
  };