@abyss-project/commons-front-core 9.1.1 → 9.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 (97) hide show
  1. package/README.md +63 -0
  2. package/catalog/catalog-entries.ts +12 -0
  3. package/catalog/pages/AmbientBackground.tsx +83 -0
  4. package/catalog/pages/AvatarGroup.tsx +45 -0
  5. package/catalog/pages/BarChart.tsx +127 -0
  6. package/catalog/pages/CompanySearchField.tsx +113 -0
  7. package/catalog/pages/ConfirmDialog.tsx +43 -1
  8. package/catalog/pages/ConfirmDialogWarning.tsx +45 -0
  9. package/catalog/pages/CopyField.tsx +24 -1
  10. package/catalog/pages/EntityImageField.tsx +124 -0
  11. package/catalog/pages/LineChart.tsx +138 -0
  12. package/catalog/pages/Pagination.tsx +52 -0
  13. package/catalog/pages/Section.tsx +16 -2
  14. package/catalog/pages/TeamAvatar.tsx +40 -0
  15. package/catalog/pages/UserPicker.tsx +124 -0
  16. package/catalog/pages/index.ts +20 -0
  17. package/dist/{AbyssCookieConsentProvider-B7-F6osY.js → AbyssCookieConsentProvider-CeDdkoPq.js} +104 -36
  18. package/dist/{CookieConsentSettings.component-DxQL4ULz.js → CookieConsentSettings.component-tJE0g-SS.js} +1 -1
  19. package/dist/components/data/BarChart/BarChart.d.ts +47 -0
  20. package/dist/components/data/BarChart/BarChart.spec.d.ts +1 -0
  21. package/dist/components/data/DataTable/DataTableDesktop.d.ts +1 -1
  22. package/dist/components/data/DataTable/DataTableMobile.d.ts +1 -1
  23. package/dist/components/data/DataTable/data-table.types.d.ts +6 -0
  24. package/dist/components/data/LineChart/LineChart.d.ts +44 -0
  25. package/dist/components/data/LineChart/LineChart.spec.d.ts +1 -0
  26. package/dist/components/data/LineChart/line-chart-ticks.d.ts +31 -0
  27. package/dist/components/data/LineChart/line-chart-ticks.spec.d.ts +1 -0
  28. package/dist/components/data/Pagination/Pagination.d.ts +16 -0
  29. package/dist/components/data/Pagination/Pagination.spec.d.ts +1 -0
  30. package/dist/components/data/chart-series-tone.d.ts +21 -0
  31. package/dist/components/data/chart-series-tone.spec.d.ts +1 -0
  32. package/dist/components/data/index.d.ts +4 -0
  33. package/dist/components/inputs/ColorField/ColorField.d.ts +8 -5
  34. package/dist/components/inputs/CompanySearchField/CompanySearchField.d.ts +24 -0
  35. package/dist/components/inputs/CompanySearchField/CompanySearchField.spec.d.ts +1 -0
  36. package/dist/components/inputs/CompanySearchField/pappers-company.d.ts +18 -0
  37. package/dist/components/inputs/CopyField/CopyField.d.ts +22 -6
  38. package/dist/components/inputs/EntityImageField/EntityImageField.d.ts +47 -0
  39. package/dist/components/inputs/EntityImageField/EntityImageField.spec.d.ts +1 -0
  40. package/dist/components/inputs/UserPicker/UserPicker.d.ts +50 -0
  41. package/dist/components/inputs/UserPicker/UserPicker.spec.d.ts +1 -0
  42. package/dist/components/inputs/index.d.ts +3 -0
  43. package/dist/components/layers/ConfirmDialog/ConfirmDialog.d.ts +6 -2
  44. package/dist/components/layers/ConfirmDialog/useConfirmDialog.d.ts +21 -0
  45. package/dist/components/layers/ConfirmDialog/useConfirmDialog.spec.d.ts +1 -0
  46. package/dist/components/layers/index.d.ts +1 -0
  47. package/dist/components/meaning/AvatarGroup/AvatarGroup.d.ts +22 -0
  48. package/dist/components/meaning/AvatarGroup/AvatarGroup.spec.d.ts +1 -0
  49. package/dist/components/meaning/TeamAvatar/TeamAvatar.d.ts +14 -0
  50. package/dist/components/meaning/TeamAvatar/TeamAvatar.spec.d.ts +1 -0
  51. package/dist/components/meaning/index.d.ts +2 -0
  52. package/dist/components/structure/AmbientBackground/AmbientBackground.d.ts +24 -0
  53. package/dist/components/structure/AmbientBackground/AmbientBackground.spec.d.ts +1 -0
  54. package/dist/components/structure/Section/Section.d.ts +10 -2
  55. package/dist/components/structure/index.d.ts +1 -0
  56. package/dist/cookie-consent.js +2 -2
  57. package/dist/design-theme-D3DQFMu-.js +27614 -0
  58. package/dist/hooks/use-rich-intl.hook.d.ts +68 -0
  59. package/dist/{index-uLh81uFU.js → index-3wZ_n-X5.js} +2 -2
  60. package/dist/{index-BuQlif6i.js → index-7E3aXufv.js} +2 -2
  61. package/dist/{index-iQhqBjKY.js → index-9E4QhCRp.js} +2 -2
  62. package/dist/{index-BtzB7aR_.js → index-B7yu6Zm9.js} +2 -2
  63. package/dist/{index-DkcMwm_T.js → index-BK4lWFRR.js} +3 -3
  64. package/dist/{index-2zbZ2URx.js → index-BTfe4Sz-.js} +3 -3
  65. package/dist/{index-CspGahq0.js → index-BbwAoYtC.js} +4 -4
  66. package/dist/{index-Waz6-pQr.js → index-BcUA-oDy.js} +4 -4
  67. package/dist/{index-CTP0QoCT.js → index-BfICcXrk.js} +3 -3
  68. package/dist/{index-DflXNluH.js → index-By24n0PI.js} +2 -2
  69. package/dist/{index-C5OyIHCq.js → index-CMyNL_Kk.js} +2 -2
  70. package/dist/{index-BloHDADq.js → index-CNMUrFys.js} +35281 -47311
  71. package/dist/{index-BMM6rvML.js → index-CTkBexi5.js} +2 -2
  72. package/dist/{index-Bhhwuj39.js → index-CUoOFhRH.js} +2 -2
  73. package/dist/{index-RkXYGPSf.js → index-CZvosKer.js} +4 -4
  74. package/dist/{index-uGXjK3xv.js → index-CzkoqdQK.js} +3 -3
  75. package/dist/{index-CsyAu658.js → index-D3QW807K.js} +2 -2
  76. package/dist/{index-IooWxH41.js → index-D6Gkj-V6.js} +2 -2
  77. package/dist/{index-Dew1ymFy.js → index-DYUdQPwj.js} +2 -2
  78. package/dist/{index-jhW25X__.js → index-DeoE1f9Z.js} +2 -2
  79. package/dist/{index-BXtPl6pH.js → index-F67JSDx7.js} +1 -1
  80. package/dist/{index-BAcf97X_.js → index-rpW-_Gh4.js} +2 -2
  81. package/dist/index.js +5979 -4545
  82. package/dist/legacy/components/CompanySearchAutocomplete/CompanySearchAutocomplete.d.ts +2 -14
  83. package/dist/legacy/components/Layouts/AbyssFamilyBanner/AbyssFamilyBanner.component.d.ts +3 -7
  84. package/dist/legacy/utils/file.utils.d.ts +1 -2
  85. package/dist/legacy.js +107 -107
  86. package/dist/theme/tokens/choice-swatches.d.ts +12 -0
  87. package/dist/theme/tokens/choice-swatches.spec.d.ts +1 -0
  88. package/dist/theme/tokens/index.d.ts +1 -0
  89. package/dist/theme/tokens/semantic.d.ts +4 -1
  90. package/dist/translations/en.d.ts +34 -0
  91. package/dist/translations/fr.d.ts +34 -0
  92. package/dist/utils/family.d.ts +12 -0
  93. package/dist/utils/file.utils.d.ts +10 -0
  94. package/dist/utils/file.utils.spec.d.ts +1 -0
  95. package/dist/utils/index.d.ts +2 -0
  96. package/package.json +1 -1
  97. package/dist/design-theme-BztWe75w.js +0 -15490
@@ -1709,7 +1709,25 @@ const fm = {
1709
1709
  reveal: "Afficher la valeur",
1710
1710
  hide: "Masquer la valeur",
1711
1711
  copied: "Copié dans le presse-papiers",
1712
- "copy-failed": "La copie a échoué. Réessayez ou copiez la valeur à la main."
1712
+ "copy-failed": "La copie a échoué. Réessayez ou copiez la valeur à la main.",
1713
+ "load-failed": "La valeur n’a pas pu être chargée. Réessayez."
1714
+ },
1715
+ "entity-image-field": {
1716
+ uploading: "Envoi de l’image…"
1717
+ },
1718
+ "user-picker": {
1719
+ loading: "Recherche…",
1720
+ clear: "Effacer",
1721
+ open: "Ouvrir la liste",
1722
+ close: "Fermer la liste"
1723
+ },
1724
+ "company-search-field": {
1725
+ label: "Nom de l’entreprise",
1726
+ placeholder: "Rechercher une entreprise",
1727
+ loading: "Recherche…",
1728
+ error: "La recherche d’entreprise est momentanément indisponible. Réessayez dans un instant.",
1729
+ created: "Créée le {date}",
1730
+ clear: "Effacer"
1713
1731
  },
1714
1732
  "context-selector": {
1715
1733
  personal: "Mon espace",
@@ -1825,6 +1843,22 @@ const fm = {
1825
1843
  }
1826
1844
  },
1827
1845
  data: {
1846
+ pagination: {
1847
+ previous: "Précédent",
1848
+ next: "Suivant",
1849
+ page: "Page {page, number}",
1850
+ position: "Page {page, number} sur {count, number}"
1851
+ },
1852
+ "line-chart": {
1853
+ x: "Abscisse",
1854
+ "no-value": "Aucune valeur",
1855
+ empty: "Aucune donnée à afficher"
1856
+ },
1857
+ "bar-chart": {
1858
+ category: "Catégorie",
1859
+ "no-value": "Aucune valeur",
1860
+ empty: "Aucune donnée à afficher"
1861
+ },
1828
1862
  "data-table": {
1829
1863
  "select-all": "Sélectionner toutes les lignes",
1830
1864
  "select-row": "Sélectionner la ligne",
@@ -3475,7 +3509,25 @@ const fm = {
3475
3509
  reveal: "Show the value",
3476
3510
  hide: "Hide the value",
3477
3511
  copied: "Copied to the clipboard",
3478
- "copy-failed": "Copy failed. Try again or copy the value by hand."
3512
+ "copy-failed": "Copy failed. Try again or copy the value by hand.",
3513
+ "load-failed": "The value could not be loaded. Try again."
3514
+ },
3515
+ "entity-image-field": {
3516
+ uploading: "Uploading the image…"
3517
+ },
3518
+ "user-picker": {
3519
+ loading: "Searching…",
3520
+ clear: "Clear",
3521
+ open: "Open the list",
3522
+ close: "Close the list"
3523
+ },
3524
+ "company-search-field": {
3525
+ label: "Company name",
3526
+ placeholder: "Search for a company",
3527
+ loading: "Searching…",
3528
+ error: "Company search is temporarily unavailable. Try again in a moment.",
3529
+ created: "Founded on {date}",
3530
+ clear: "Clear"
3479
3531
  },
3480
3532
  "context-selector": {
3481
3533
  personal: "My space",
@@ -3591,6 +3643,22 @@ const fm = {
3591
3643
  }
3592
3644
  },
3593
3645
  data: {
3646
+ pagination: {
3647
+ previous: "Previous",
3648
+ next: "Next",
3649
+ page: "Page {page, number}",
3650
+ position: "Page {page, number} of {count, number}"
3651
+ },
3652
+ "line-chart": {
3653
+ x: "X value",
3654
+ "no-value": "No value",
3655
+ empty: "No data to show"
3656
+ },
3657
+ "bar-chart": {
3658
+ category: "Category",
3659
+ "no-value": "No value",
3660
+ empty: "No data to show"
3661
+ },
3594
3662
  "data-table": {
3595
3663
  "select-all": "Select all rows",
3596
3664
  "select-row": "Select row",
@@ -8311,36 +8379,36 @@ const Ym = tl * 24 * 60 * 60 * 1e3, Hm = (p) => ({
8311
8379
  ] });
8312
8380
  };
8313
8381
  export {
8314
- Rm as $,
8382
+ Ki as $,
8315
8383
  fv as A,
8316
- Dt as B,
8384
+ uv as B,
8317
8385
  Km as C,
8318
8386
  Fm as D,
8319
- xm as E,
8320
- Pm as F,
8321
- uv as G,
8322
- cv as H,
8323
- av as I,
8324
- Fe as J,
8325
- Sm as K,
8326
- Tr as L,
8327
- Xi as M,
8328
- Em as N,
8329
- bm as O,
8330
- Tm as P,
8331
- Cm as Q,
8387
+ cv as E,
8388
+ av as F,
8389
+ Fe as G,
8390
+ Sm as H,
8391
+ Tr as I,
8392
+ Xi as J,
8393
+ Em as K,
8394
+ bm as L,
8395
+ Tm as M,
8396
+ Cm as N,
8397
+ Im as O,
8398
+ Zs as P,
8399
+ sv as Q,
8332
8400
  Zi as R,
8333
- Im as S,
8334
- Zs as T,
8335
- sv as U,
8401
+ Qs as S,
8402
+ el as T,
8403
+ lv as U,
8336
8404
  tl as V,
8337
- Qs as W,
8338
- el as X,
8339
- lv as Y,
8340
- Om as Z,
8341
- Nm as _,
8405
+ Om as W,
8406
+ Nm as X,
8407
+ Rm as Y,
8408
+ wm as Z,
8409
+ Er as _,
8342
8410
  pv as a,
8343
- wm as a0,
8411
+ iv as a0,
8344
8412
  Wm as b,
8345
8413
  Cr as c,
8346
8414
  Um as d,
@@ -8352,18 +8420,18 @@ export {
8352
8420
  mm as j,
8353
8421
  gm as k,
8354
8422
  zm as l,
8355
- rv as m,
8356
- Er as n,
8357
- Ki as o,
8358
- iv as p,
8359
- Mt as q,
8423
+ Mt as m,
8424
+ he as n,
8425
+ oe as o,
8426
+ Ze as p,
8427
+ Nn as q,
8360
8428
  Mm as r,
8361
- he as s,
8429
+ rv as s,
8362
8430
  $s as t,
8363
8431
  dv as u,
8364
- oe as v,
8432
+ Lt as v,
8365
8433
  Fs as w,
8366
- Ze as x,
8367
- Nn as y,
8368
- Lt as z
8434
+ Dt as x,
8435
+ xm as y,
8436
+ Pm as z
8369
8437
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
2
  import { useState as m, useEffect as C } from "react";
3
3
  import { Card as v, CardContent as b, Stack as u, Typography as o, FormControlLabel as l, Box as r, Checkbox as d, Button as M } from "@mui/material";
4
- import { g as R, u as x } from "./AbyssCookieConsentProvider-B7-F6osY.js";
4
+ import { g as R, u as x } from "./AbyssCookieConsentProvider-CeDdkoPq.js";
5
5
  const B = () => {
6
6
  const t = R(), { consent: i, save: y } = x(), [h, g] = m((i == null ? void 0 : i.analytics) ?? !1), [k, f] = m((i == null ? void 0 : i.marketing) ?? !1), c = i == null ? void 0 : i.analytics, n = i == null ? void 0 : i.marketing;
7
7
  return C(() => {
@@ -0,0 +1,47 @@
1
+ import { ChartSeriesTone } from '../chart-series-tone';
2
+ export declare enum BarChartLayout {
3
+ /** Bars rise from the category axis at the bottom. */
4
+ Vertical = "vertical",
5
+ /** Bars run from the category axis on the left: long category names, many categories. */
6
+ Horizontal = "horizontal"
7
+ }
8
+ export interface BarChartSeries {
9
+ id: string;
10
+ /** Name of the series, in the legend, the tooltip and the table of values. */
11
+ label: string;
12
+ /**
13
+ * The meaning of the series when its color states one (failures, successes): it is then drawn in
14
+ * the `status.*` color of the tone. Without tone, the series takes the next data series color.
15
+ */
16
+ tone?: ChartSeriesTone;
17
+ }
18
+ export interface BarChartCategory {
19
+ id: string;
20
+ /** Text of the category axis, the tooltip and the table of values. */
21
+ label: string;
22
+ /** Value of each series for this category, keyed by series id; a missing key is no bar. */
23
+ values: Record<string, number>;
24
+ }
25
+ export interface BarChartProps {
26
+ series: BarChartSeries[];
27
+ categories: BarChartCategory[];
28
+ /** Height of the plot, in px; the width follows the container. */
29
+ height: number;
30
+ /** `Vertical` by default. */
31
+ layout?: BarChartLayout;
32
+ /** Stacks the series of a category; grouped side by side otherwise. */
33
+ stacked?: boolean;
34
+ /** Text of a value: axis ticks, tooltip, table of values. */
35
+ formatValue(value: number): string;
36
+ /** Accessible name of the figure and caption of its table. */
37
+ label: string;
38
+ }
39
+ /**
40
+ * A bar chart drawn by nivo under `abyssNivoTheme`: one bar per series and category, grouped side by
41
+ * side or stacked, vertical or horizontal. Each series is colored by its tone (`status.*`) or else
42
+ * in the order of the data series palette among the series without tone, never by the host. Beyond
43
+ * one series, a legend names the colors. For screen readers the figure is named by `label` and its
44
+ * drawing is replaced by a table of every value; a chart without any value says so instead of
45
+ * drawing empty axes.
46
+ */
47
+ export declare function BarChart({ series, categories, height, layout, stacked, formatValue, label, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -3,4 +3,4 @@ import { DataTableProps } from './data-table.types';
3
3
  * The table form of `DataTable`, from 768 px up. From 768 to 1199 px (next to the icon rail) the
4
4
  * `Optional` columns are hidden.
5
5
  */
6
- export declare function DataTableDesktop<T>({ columns: allColumns, rows, getRowId, density, selection, sort, onRowClick, loading, empty, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DataTableDesktop<T>({ columns: allColumns, rows, getRowId, density, selection, sort, onRowClick, loading, empty, label, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -3,4 +3,4 @@ import { DataTableProps } from './data-table.types';
3
3
  * The two-level list form of `DataTable` below 768 px (`.mli`): the selection stays, and the bulk
4
4
  * actions move into an `ActionBar` at the bottom of the screen.
5
5
  */
6
- export declare function DataTableMobile<T>({ rows, getRowId, selection, onRowClick, loading, empty, mobileRow, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DataTableMobile<T>({ rows, getRowId, selection, onRowClick, loading, empty, mobileRow, label, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -74,4 +74,10 @@ export interface DataTableProps<T> {
74
74
  empty: ReactNode;
75
75
  /** The two-level item that replaces a row below 768 px. */
76
76
  mobileRow: DataTableMobileRow<T>;
77
+ /**
78
+ * Accessible name of the table, and of the list that replaces it below 768 px: what the rows are
79
+ * (« Transferts Beam »). Without it, the table has no name and the list keeps the generic
80
+ * « Lignes ».
81
+ */
82
+ label?: string;
77
83
  }
@@ -0,0 +1,44 @@
1
+ import { ChartSeriesTone } from '../chart-series-tone';
2
+ export type LineChartX = Date | number;
3
+ export interface LineChartPoint {
4
+ x: LineChartX;
5
+ y: number;
6
+ }
7
+ export interface LineChartSeries {
8
+ id: string;
9
+ /** Name of the series, in the legend, the tooltip and the table of values. */
10
+ label: string;
11
+ points: LineChartPoint[];
12
+ /**
13
+ * The meaning of the series when its color states one (failures, successes): it is then drawn in
14
+ * the `status.*` color of the tone. Without tone, the series takes the next data series color.
15
+ */
16
+ tone?: ChartSeriesTone;
17
+ }
18
+ export interface LineChartProps {
19
+ series: LineChartSeries[];
20
+ /** Height of the plot, in px. */
21
+ height: number;
22
+ /** Fills the area under each line at the `.soft` opacity, from a zero baseline. */
23
+ area?: boolean;
24
+ /**
25
+ * Stacks the series as areas from a zero baseline (`area` implied): an x a series has no point at
26
+ * counts as zero there. The tooltip and the table of values keep each series' own values.
27
+ */
28
+ stacked?: boolean;
29
+ /** Text of an x value: axis ticks, tooltip, table of values. */
30
+ formatX(x: LineChartX): string;
31
+ /** Text of a y value: axis ticks, tooltip, table of values. */
32
+ formatY(y: number): string;
33
+ /** Accessible name of the figure and caption of its table: what the chart shows. */
34
+ label: string;
35
+ }
36
+ /**
37
+ * A line chart drawn by nivo under `abyssNivoTheme`: one line per series, colored by its tone
38
+ * (`status.*`) or else in the order of the data series palette among the series without tone
39
+ * (`data.series.1`, `2`…, the seventh starting over), never by the host. Dates give a time scale,
40
+ * numbers a linear one; `stacked` piles the series up as areas. Beyond one series, a legend names
41
+ * the colors. For screen readers the figure is named by `label` and its drawing is replaced by a
42
+ * table of every value; a chart without any point says so instead of drawing empty axes.
43
+ */
44
+ export declare function LineChart({ series, height, area, stacked, formatX, formatY, label, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ /** Width in px of a tick label of the x axis: mono, at the `caption` size of `abyssNivoTheme`. */
2
+ export declare const tickLabelWidth: (text: string) => number;
3
+ /**
4
+ * Least empty space between two tick labels of the x axis, in px: wide enough that the axis reads
5
+ * as a few landmarks, not as a ruler.
6
+ */
7
+ export declare const TICK_LABEL_GAP: 40;
8
+ export declare enum XScaleKind {
9
+ /** Values are timestamps in ms, ticked on the local clock. */
10
+ Time = "time",
11
+ /** Values are plain numbers, ticked on 1, 2 and 5 times a power of ten. */
12
+ Linear = "linear"
13
+ }
14
+ export interface XTickLayout {
15
+ /** Width of the plot between its margins, in px. */
16
+ plotWidth: number;
17
+ /** Room a label may take beyond each end of the plot (the chart margins), in px. */
18
+ overflow: {
19
+ left: number;
20
+ right: number;
21
+ };
22
+ }
23
+ /**
24
+ * The tick values of the x axis of a chart whose x values are `values` (distinct, ascending, at
25
+ * least one) and whose plot is `layout.plotWidth` px wide: the finest nice step (on the local clock
26
+ * for time), never finer than the closest two values, whose labels (`labelOf`), as wide as
27
+ * `tickLabelWidth` says, keep `TICK_LABEL_GAP` between neighbors. A label that would spill past the
28
+ * margins is dropped. Without room for two labels, a single one is kept; a plot without width gets
29
+ * none.
30
+ */
31
+ export declare function xTickValues(values: number[], kind: XScaleKind, labelOf: (value: number) => string, layout: XTickLayout): number[];
@@ -0,0 +1,16 @@
1
+ export interface PaginationProps {
2
+ /** The current page, from 1. A value outside `1…pageCount` shows the nearest bound. */
3
+ page: number;
4
+ /** Number of pages; nothing is rendered below 2. */
5
+ pageCount: number;
6
+ /** Called with the page the user asks for; never with the current page. */
7
+ onChange(page: number): void;
8
+ /** Accessible name of the navigation: what is paged ("Pages des permissions"). */
9
+ label: string;
10
+ }
11
+ /**
12
+ * Page navigation for a paged list: previous, the numbered pages with gaps, next. Below 768 px it
13
+ * shrinks to previous, "Page x of y" and next, every control a 44 px target. Previous and next are
14
+ * disabled at the bounds. A single page needs no navigation: nothing is rendered.
15
+ */
16
+ export declare function Pagination({ page, pageCount, onChange, label, }: PaginationProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ import { SemanticToken } from '../../theme/tokens/semantic';
2
+ /**
3
+ * The meaning of a chart series whose color states something (ADR-0174, amendment « ton sémantique
4
+ * des séries »): a series of failures, of successes. A series without a meaning takes no tone and
5
+ * keeps the data series palette.
6
+ */
7
+ export declare enum ChartSeriesTone {
8
+ Success = "success",
9
+ Warning = "warning",
10
+ Danger = "danger",
11
+ Info = "info",
12
+ Neutral = "neutral"
13
+ }
14
+ /**
15
+ * Colour token of each series: its tone, else the next data.series token among the series without
16
+ * tone. The palette counts only the series without tone (the first of them takes `data.series.1`,
17
+ * whatever toned series stand before it) and starts over after its sixth color.
18
+ */
19
+ export declare function seriesColorTokens(series: {
20
+ tone?: ChartSeriesTone;
21
+ }[]): SemanticToken[];
@@ -0,0 +1 @@
1
+ export {};
@@ -4,3 +4,7 @@ export * from './StatTile/StatTile';
4
4
  export * from './Sparkline/Sparkline';
5
5
  export * from './chart-theme';
6
6
  export * from './UsageMeter/UsageMeter';
7
+ export * from './Pagination/Pagination';
8
+ export * from './LineChart/LineChart';
9
+ export * from './BarChart/BarChart';
10
+ export * from './chart-series-tone';
@@ -2,14 +2,17 @@ export interface ColorFieldProps {
2
2
  label: string;
3
3
  value: string;
4
4
  onChange(hex: string): void;
5
- /** Colors offered as one-click choices. They belong to the caller's domain, not to the core. */
6
- swatches: string[];
5
+ /**
6
+ * Colors offered as one-click choices. `CHOICE_SWATCHES` by default, the user choice palette of the
7
+ * design system; a caller whose domain has its own colors passes them.
8
+ */
9
+ swatches?: readonly string[];
7
10
  }
8
11
  /** `#rrggbb` or `rrggbb` as lowercase `#rrggbb`; `null` when it is not a 6-digit hexadecimal. */
9
12
  export declare const normalizeHex: (input: string) => string | null;
10
13
  /**
11
- * A color input: a hexadecimal text field with a preview, plus the caller's swatches. Typing
12
- * emits `onChange` once the text is a valid `#rrggbb` (the `#` is optional, the case is normalized); any
13
- * other text shows a message and emits nothing. The swatches are toggle buttons in a labelled group.
14
+ * A color input: a hexadecimal text field with a preview, plus swatches (the caller's, or the
15
+ * choice palette `CHOICE_SWATCHES`). Typing emits `onChange` once the text is a valid `#rrggbb`
16
+ * (the `#` is optional, the case is normalized); any other text shows a message and emits nothing. The swatches are toggle buttons in a labelled group.
14
17
  */
15
18
  export declare function ColorField({ label, value, onChange, swatches, }: ColorFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { PappersCompany } from './pappers-company';
2
+ export type { PappersCompany };
3
+ /** Quiet time after the last keystroke before the request leaves, in ms. */
4
+ export declare const COMPANY_SEARCH_DEBOUNCE_MS = 300;
5
+ export interface CompanySearchFieldProps {
6
+ /** Text of the field, owned by the host. */
7
+ value: string;
8
+ /** Called at each keystroke, before the debounce. */
9
+ onInputChange(value: string): void;
10
+ /** Called when the user picks a suggestion; typing alone never calls it. */
11
+ onSelect(company: PappersCompany): void;
12
+ disabled?: boolean;
13
+ /** Label above the field; « Nom de l’entreprise » without it. */
14
+ label?: string;
15
+ /** « Rechercher une entreprise » without it. */
16
+ placeholder?: string;
17
+ }
18
+ /**
19
+ * A company name field that suggests French companies from Pappers as the user types: name,
20
+ * legal form, SIREN, creation date, head office and activity. The host owns the text; picking a
21
+ * suggestion hands the whole company to `onSelect`. A failed request (network, non-2xx answer)
22
+ * puts the field in error, apart from an answer without result.
23
+ */
24
+ export declare function CompanySearchField({ value, onInputChange, onSelect, disabled, label, placeholder, }: CompanySearchFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A company as the Pappers suggestions API returns it. The field names mirror the response verbatim
3
+ * (French, snake_case): hosts read them as they come, no mapping layer in between.
4
+ */
5
+ export type PappersCompany = {
6
+ siren: string;
7
+ nom_entreprise: string;
8
+ date_creation: string;
9
+ forme_juridique?: string;
10
+ domaine_activite?: string;
11
+ siege?: {
12
+ adresse?: string;
13
+ code_postal?: string;
14
+ ville?: string;
15
+ departement?: string;
16
+ pays?: string;
17
+ };
18
+ };
@@ -1,5 +1,4 @@
1
- export interface CopyFieldProps {
2
- value: string;
1
+ interface CopyFieldBaseProps {
3
2
  /** Hides the value behind dots until the user reveals it; the copy button still copies it. */
4
3
  masked?: boolean;
5
4
  /** Called each time the user reveals a masked value. */
@@ -7,13 +6,30 @@ export interface CopyFieldProps {
7
6
  /** Label of the copy button, named after what it copies ("Copier la clé"). */
8
7
  copyLabel: string;
9
8
  }
9
+ /** The value is known up front. */
10
+ interface CopyFieldValueProps extends CopyFieldBaseProps {
11
+ value: string;
12
+ loadValue?: never;
13
+ }
14
+ /**
15
+ * The value is asked for on the first « Afficher » or « Copier » only, then kept until the field
16
+ * unmounts: no request is made without a gesture.
17
+ */
18
+ interface CopyFieldLoadedProps extends CopyFieldBaseProps {
19
+ value?: never;
20
+ loadValue(): Promise<string>;
21
+ }
22
+ export type CopyFieldProps = CopyFieldValueProps | CopyFieldLoadedProps;
10
23
  /** How long the copy button shows its check mark after a copy, in ms. */
11
24
  export declare const COPY_FEEDBACK_MS = 2000;
12
25
  /**
13
26
  * A value to copy (API key, connection identifier): shown in mono in a read-only box, with a
14
27
  * button that copies it to the clipboard. Masked, the value is replaced by dots and a toggle
15
- * reveals it (calling `onReveal`). The outcome of a copy is announced in a polite live region; a
16
- * success turns the copy icon into a check mark for a moment, a failure is also written under the
17
- * field.
28
+ * reveals it (calling `onReveal`). With `loadValue` instead of `value`, the value stays masked and
29
+ * is asked for on the first reveal or copy, the button of that gesture showing the loading; a
30
+ * failed load is announced and the next gesture asks again. The outcome of a copy is announced in
31
+ * a polite live region; a success turns the copy icon into a check mark for a moment, a failure is
32
+ * also written under the field.
18
33
  */
19
- export declare function CopyField({ value, masked, onReveal, copyLabel, }: CopyFieldProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function CopyField({ value: givenValue, loadValue, masked, onReveal, copyLabel, }: CopyFieldProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,47 @@
1
+ import { ReactNode } from 'react';
2
+ import { CloudImportWiring } from '../../../hooks/cloud-picker.types';
3
+ export declare enum EntityImageVariant {
4
+ /** A logo, a profile picture or a project image: the picture itself is the button. */
5
+ Avatar = "avatar",
6
+ /** A banner: the picture spans the width, a button lies over it. */
7
+ Banner = "banner"
8
+ }
9
+ export declare enum EntityImageShape {
10
+ /** A person: a disc. */
11
+ Round = "round",
12
+ /** An organization or a project: a rounded square. */
13
+ Square = "square"
14
+ }
15
+ interface EntityImageFieldBaseProps {
16
+ /** The avatar or the image shown now, rendered by the host at its size. */
17
+ picture: ReactNode;
18
+ /** What the gesture does (« Changer le logo »): the name of the button. */
19
+ label: string;
20
+ /** Accepted types, as the HTML `accept` attribute lists them. */
21
+ accept?: string[];
22
+ /** Receives the file chosen on the device. The host uploads it and reports the outcome. */
23
+ onFile(file: File): void;
24
+ /** An upload is running: the button shows it and opens nothing. */
25
+ uploading: boolean;
26
+ /** AbyssCloud picker plus the import action: with it, the button opens a menu of sources. */
27
+ cloudImport?: CloudImportWiring;
28
+ }
29
+ export interface EntityImageAvatarProps extends EntityImageFieldBaseProps {
30
+ variant: EntityImageVariant.Avatar;
31
+ /** Defaults to `EntityImageShape.Round`. */
32
+ shape?: EntityImageShape;
33
+ }
34
+ interface EntityImageBannerProps extends EntityImageFieldBaseProps {
35
+ variant: EntityImageVariant.Banner;
36
+ shape?: never;
37
+ }
38
+ export type EntityImageFieldProps = EntityImageAvatarProps | EntityImageBannerProps;
39
+ /**
40
+ * An entity's image that the user changes in place: an avatar that is itself the button (with a
41
+ * camera badge), or a banner spanning the width with a button over it. The button opens the
42
+ * device's file chooser, or, with `cloudImport`, the menu of `ImportButton` (device, AbyssCloud).
43
+ * While `uploading`, the button shows a progress indicator, opens nothing, and the upload is
44
+ * announced in a polite live region.
45
+ */
46
+ export declare function EntityImageField(props: EntityImageFieldProps): import("react/jsx-runtime").JSX.Element;
47
+ export {};
@@ -0,0 +1,50 @@
1
+ /** A user the picker offers. */
2
+ export interface UserPickerOption {
3
+ id: string;
4
+ /** Display name: the option's title, the chip's label and the avatar's initial. */
5
+ name: string;
6
+ /** Shown under the name and searched; `null` when the host does not know it. */
7
+ email: string | null;
8
+ /** URL of the user's picture; `null` draws the initial of the name. */
9
+ pictureUrl: string | null;
10
+ }
11
+ interface UserPickerBaseProps {
12
+ options: UserPickerOption[];
13
+ /**
14
+ * Remote search: called with the typed text at each keystroke (the host debounces and fetches),
15
+ * and the options are shown as given. Without it, the options are filtered on the name and the
16
+ * email.
17
+ */
18
+ onSearch?(query: string): void;
19
+ /** A remote search is in flight: the list says so instead of « no option ». */
20
+ loading?: boolean;
21
+ /** Label above the field, its accessible name. */
22
+ label: string;
23
+ placeholder?: string;
24
+ /** Users listed but not selectable (already members, the current owner…). */
25
+ disabledIds?: string[];
26
+ /** What the list says when nothing matches. */
27
+ noOptionsText: string;
28
+ disabled?: boolean;
29
+ }
30
+ export interface UserPickerSingleProps extends UserPickerBaseProps {
31
+ multiple?: false;
32
+ /** Id of the selected user, `null` when none. */
33
+ value: string | null;
34
+ onChange(value: string | null): void;
35
+ }
36
+ export interface UserPickerMultipleProps extends UserPickerBaseProps {
37
+ multiple: true;
38
+ /** Ids of the selected users, in the order they were picked. */
39
+ value: string[];
40
+ onChange(value: string[]): void;
41
+ }
42
+ export type UserPickerProps = UserPickerSingleProps | UserPickerMultipleProps;
43
+ /**
44
+ * A field to pick one user or several among a list: each option shows the avatar, the name and
45
+ * the email. Typing filters the list on the name and the email, or hands the text to `onSearch`
46
+ * for a server-side search. In multiple mode, the selected users are chips in the field; the left
47
+ * arrow walks them from the text and Backspace or Delete removes the focused one.
48
+ */
49
+ export declare function UserPicker(props: UserPickerProps): import("react/jsx-runtime").JSX.Element;
50
+ export {};
@@ -10,3 +10,6 @@ export * from './CopyField/CopyField';
10
10
  export * from './ContextSelector/ContextSelector';
11
11
  export * from './DropZone/DropZone';
12
12
  export * from './ImportButton/ImportButton';
13
+ export * from './UserPicker/UserPicker';
14
+ export * from './CompanySearchField/CompanySearchField';
15
+ export * from './EntityImageField/EntityImageField';