@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
@@ -1,14 +1,18 @@
1
1
  import { ReactNode } from 'react';
2
2
  export declare enum ConfirmDialogTone {
3
3
  Default = "default",
4
- Danger = "danger"
4
+ Danger = "danger",
5
+ Warning = "warning"
5
6
  }
6
7
  export interface ConfirmDialogProps {
7
8
  open: boolean;
8
9
  title: string;
9
10
  body: ReactNode;
10
11
  confirmLabel: string;
11
- /** `danger` paints the confirm button in `status.danger` and starts the focus on « Annuler ». */
12
+ /**
13
+ * `danger` paints the confirm button in `status.danger`, `warning` in `status.warning`; both start
14
+ * the focus on « Annuler ».
15
+ */
12
16
  tone?: ConfirmDialogTone;
13
17
  /** Text the user must type, exactly, before the confirm button is enabled. */
14
18
  confirmationText?: string;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ import { ConfirmDialogProps } from './ConfirmDialog';
3
+ /** What a confirmation asks: the texts and the tone of `ConfirmDialog`. */
4
+ export type ConfirmDialogOptions = Pick<ConfirmDialogProps, 'title' | 'body' | 'confirmLabel' | 'tone' | 'confirmationText'>;
5
+ export interface ConfirmDialogApi {
6
+ /**
7
+ * Opens a confirmation and resolves `true` when the user confirms, `false` when they cancel.
8
+ * While a confirmation is open, the next one waits for it to close.
9
+ */
10
+ confirm(options: ConfirmDialogOptions): Promise<boolean>;
11
+ }
12
+ /**
13
+ * Hosts the confirmations asked through `useConfirmDialog`: one `ConfirmDialog` at a time, the
14
+ * requests made meanwhile queued in their order. Requests still waiting when the provider unmounts
15
+ * are answered `false`.
16
+ */
17
+ export declare function ConfirmDialogProvider({ children }: {
18
+ children: ReactNode;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ /** The `confirm` of the nearest `ConfirmDialogProvider`. */
21
+ export declare function useConfirmDialog(): ConfirmDialogApi;
@@ -4,4 +4,5 @@ export * from './Drawer/Drawer';
4
4
  export * from './Menu/Menu';
5
5
  export * from './Toast/Toast';
6
6
  export * from './CommandPalette/CommandPalette';
7
+ export * from './ConfirmDialog/useConfirmDialog';
7
8
  export * from './ProductTour/ProductTour';
@@ -0,0 +1,22 @@
1
+ export interface AvatarGroupPerson {
2
+ id: string;
3
+ /** Accessible name of the avatar, and its initial while there is no picture. */
4
+ name: string;
5
+ /** URL of the person's picture; `null` when they have none. */
6
+ pictureUrl: string | null;
7
+ }
8
+ export interface AvatarGroupProps {
9
+ people: AvatarGroupPerson[];
10
+ /** Number of avatars drawn; the others are counted in a "+N" (at least one avatar is drawn). */
11
+ max?: number;
12
+ /** Side of each avatar in px. Defaults to `AVATAR_DEFAULT_SIZE`. */
13
+ size?: number;
14
+ /** Accessible name of the group ("Membres de l'équipe Ops"). */
15
+ label: string;
16
+ }
17
+ /**
18
+ * People side by side in an overlapping stack: their picture in a disc, or their initial. Beyond
19
+ * `max`, a "+N" counts the others; it is named after them and lists them in a tooltip on hover.
20
+ * Nothing is interactive: an avatar that opens something is placed in a button by the host.
21
+ */
22
+ export declare function AvatarGroup({ people, max, size, label, }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,14 @@
1
+ export interface TeamAvatarProps {
2
+ /** The team's name: accessible name, and its initial. */
3
+ name: string;
4
+ /** The team's stored color (free text); `null` when it has none. */
5
+ color: string | null;
6
+ /** Side in px. Defaults to `AVATAR_DEFAULT_SIZE`. */
7
+ size?: number;
8
+ }
9
+ /**
10
+ * A team: the initial of its name on its own color, in a rounded square. The initial takes the
11
+ * paper ink (light or dark, whatever the theme) that contrasts best with the team color. A
12
+ * missing or unreadable color gives the neutral tint of the other avatars, never an exception.
13
+ */
14
+ export declare function TeamAvatar({ name, color, size, }: TeamAvatarProps): import("react/jsx-runtime").JSX.Element;
@@ -5,3 +5,5 @@ export * from './ScanBadge/ScanBadge';
5
5
  export * from './RoleBadge/RoleBadge';
6
6
  export * from './ToolIcon/ToolIcon';
7
7
  export * from './Avatar/Avatar';
8
+ export * from './AvatarGroup/AvatarGroup';
9
+ export * from './TeamAvatar/TeamAvatar';
@@ -0,0 +1,24 @@
1
+ export declare enum AmbientBackgroundPlacement {
2
+ /** Covers the window (position fixed): full-page backdrop of a public page. */
3
+ Viewport = "viewport",
4
+ /** Stops at the nearest positioned ancestor (position absolute): a panel, the Probe scanner. */
5
+ Container = "container"
6
+ }
7
+ export interface AmbientBackgroundProps {
8
+ /** `Viewport` by default. */
9
+ placement?: AmbientBackgroundPlacement;
10
+ /** Freezes the motion (Probe between two scans). */
11
+ paused?: boolean;
12
+ }
13
+ /** Whether the layers move, as exposed by `data-motion`. */
14
+ export declare enum AmbientBackgroundMotion {
15
+ Animated = "animated",
16
+ Static = "static"
17
+ }
18
+ /**
19
+ * A quiet animated backdrop of glows drawn from `accent` and `data.series.5`, under the content of a
20
+ * public page or a panel. It is decoration only: hidden from assistive technologies, transparent to
21
+ * the pointer, out of the flow (it never moves nor sizes the content). The glows drift slowly, and
22
+ * stand still under `prefers-reduced-motion: reduce`, below 768 px and while `paused`.
23
+ */
24
+ export declare function AmbientBackground({ placement, paused, }: AmbientBackgroundProps): import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,22 @@
1
1
  import { ReactNode } from 'react';
2
+ export declare enum SectionTone {
3
+ Default = "default",
4
+ /** A danger zone (deletion, transfer of ownership): title and top rule in `status.danger`. */
5
+ Danger = "danger"
6
+ }
2
7
  export interface SectionProps {
3
8
  title: string;
4
9
  /** Number of items in the section, shown next to the title in mono. */
5
10
  count?: number;
6
11
  /** Actions aligned to the right of the title (a link, a button, a `Toolbar`). */
7
12
  actions?: ReactNode;
13
+ /** Defaults to `SectionTone.Default`. */
14
+ tone?: SectionTone;
8
15
  children: ReactNode;
9
16
  }
10
17
  /**
11
18
  * A titled block of a page (mock-up `.sec`, `.sech`): section title, optional count and actions,
12
- * then its content. The `<section>` is named by its title.
19
+ * then its content. The `<section>` is named by its title. In the danger tone, a rule in
20
+ * `status.danger` sets the block apart and the title takes the same color.
13
21
  */
14
- export declare function Section({ title, count, actions, children }: SectionProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function Section({ title, count, actions, tone, children, }: SectionProps): import("react/jsx-runtime").JSX.Element;
@@ -9,3 +9,4 @@ export * from './Toolbar/Toolbar';
9
9
  export * from './FilterBar/FilterBar';
10
10
  export * from './SplitView/SplitView';
11
11
  export * from './Tabs/Tabs';
12
+ export * from './AmbientBackground/AmbientBackground';
@@ -1,5 +1,5 @@
1
- import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-B7-F6osY.js";
2
- import { C as E } from "./CookieConsentSettings.component-DxQL4ULz.js";
1
+ import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-CeDdkoPq.js";
2
+ import { C as E } from "./CookieConsentSettings.component-tJE0g-SS.js";
3
3
  export {
4
4
  e as AbyssCookieConsentProvider,
5
5
  a as COOKIE_NAME,