@abyss-project/commons-front-core 9.1.1 → 9.2.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 (77) hide show
  1. package/README.md +35 -0
  2. package/catalog/catalog-entries.ts +7 -0
  3. package/catalog/pages/AvatarGroup.tsx +45 -0
  4. package/catalog/pages/CompanySearchField.tsx +113 -0
  5. package/catalog/pages/ConfirmDialog.tsx +43 -1
  6. package/catalog/pages/CopyField.tsx +24 -1
  7. package/catalog/pages/EntityImageField.tsx +124 -0
  8. package/catalog/pages/LineChart.tsx +118 -0
  9. package/catalog/pages/Pagination.tsx +52 -0
  10. package/catalog/pages/Section.tsx +16 -2
  11. package/catalog/pages/TeamAvatar.tsx +40 -0
  12. package/catalog/pages/UserPicker.tsx +124 -0
  13. package/catalog/pages/index.ts +14 -0
  14. package/dist/{AbyssCookieConsentProvider-B7-F6osY.js → AbyssCookieConsentProvider-DUYUEZaO.js} +94 -36
  15. package/dist/{CookieConsentSettings.component-DxQL4ULz.js → CookieConsentSettings.component-aVDMZLIs.js} +1 -1
  16. package/dist/components/data/LineChart/LineChart.d.ts +32 -0
  17. package/dist/components/data/LineChart/LineChart.spec.d.ts +1 -0
  18. package/dist/components/data/LineChart/line-chart-ticks.d.ts +31 -0
  19. package/dist/components/data/LineChart/line-chart-ticks.spec.d.ts +1 -0
  20. package/dist/components/data/Pagination/Pagination.d.ts +16 -0
  21. package/dist/components/data/Pagination/Pagination.spec.d.ts +1 -0
  22. package/dist/components/data/index.d.ts +2 -0
  23. package/dist/components/inputs/CompanySearchField/CompanySearchField.d.ts +24 -0
  24. package/dist/components/inputs/CompanySearchField/CompanySearchField.spec.d.ts +1 -0
  25. package/dist/components/inputs/CompanySearchField/pappers-company.d.ts +18 -0
  26. package/dist/components/inputs/CopyField/CopyField.d.ts +22 -6
  27. package/dist/components/inputs/EntityImageField/EntityImageField.d.ts +47 -0
  28. package/dist/components/inputs/EntityImageField/EntityImageField.spec.d.ts +1 -0
  29. package/dist/components/inputs/UserPicker/UserPicker.d.ts +50 -0
  30. package/dist/components/inputs/UserPicker/UserPicker.spec.d.ts +1 -0
  31. package/dist/components/inputs/index.d.ts +3 -0
  32. package/dist/components/layers/ConfirmDialog/useConfirmDialog.d.ts +21 -0
  33. package/dist/components/layers/ConfirmDialog/useConfirmDialog.spec.d.ts +1 -0
  34. package/dist/components/layers/index.d.ts +1 -0
  35. package/dist/components/meaning/AvatarGroup/AvatarGroup.d.ts +22 -0
  36. package/dist/components/meaning/AvatarGroup/AvatarGroup.spec.d.ts +1 -0
  37. package/dist/components/meaning/TeamAvatar/TeamAvatar.d.ts +14 -0
  38. package/dist/components/meaning/TeamAvatar/TeamAvatar.spec.d.ts +1 -0
  39. package/dist/components/meaning/index.d.ts +2 -0
  40. package/dist/components/structure/Section/Section.d.ts +10 -2
  41. package/dist/cookie-consent.js +2 -2
  42. package/dist/design-theme-DyWPbqXp.js +26515 -0
  43. package/dist/hooks/use-rich-intl.hook.d.ts +58 -0
  44. package/dist/{index-DflXNluH.js → index-77h-J0x1.js} +2 -2
  45. package/dist/{index-Bhhwuj39.js → index-BGIR-HuR.js} +2 -2
  46. package/dist/{index-DkcMwm_T.js → index-BM8u6b8w.js} +3 -3
  47. package/dist/{index-2zbZ2URx.js → index-BMgcTA0L.js} +3 -3
  48. package/dist/{index-C5OyIHCq.js → index-Bdv62RC2.js} +2 -2
  49. package/dist/{index-uGXjK3xv.js → index-BykEZXU6.js} +3 -3
  50. package/dist/{index-CsyAu658.js → index-C4plH_av.js} +2 -2
  51. package/dist/{index-uLh81uFU.js → index-C6YE_5pO.js} +2 -2
  52. package/dist/{index-BloHDADq.js → index-C6rmH0hM.js} +35694 -46623
  53. package/dist/{index-BuQlif6i.js → index-C9Vm0yCV.js} +2 -2
  54. package/dist/{index-BtzB7aR_.js → index-CAWnWyTQ.js} +2 -2
  55. package/dist/{index-CTP0QoCT.js → index-CX-2IC2j.js} +3 -3
  56. package/dist/{index-jhW25X__.js → index-CZj1-4RN.js} +2 -2
  57. package/dist/{index-RkXYGPSf.js → index-ChBWwrvm.js} +4 -4
  58. package/dist/{index-BMM6rvML.js → index-DKF4BSrW.js} +2 -2
  59. package/dist/{index-iQhqBjKY.js → index-DPsPJ7S5.js} +2 -2
  60. package/dist/{index-IooWxH41.js → index-LNg1bMNB.js} +2 -2
  61. package/dist/{index-Dew1ymFy.js → index-URaKKzT4.js} +2 -2
  62. package/dist/{index-BAcf97X_.js → index-UXYdJQT_.js} +2 -2
  63. package/dist/{index-BXtPl6pH.js → index-WINZVUn3.js} +1 -1
  64. package/dist/{index-CspGahq0.js → index-_kMEUAM7.js} +4 -4
  65. package/dist/{index-Waz6-pQr.js → index-elrbx7C5.js} +4 -4
  66. package/dist/index.js +5483 -4346
  67. package/dist/legacy/components/CompanySearchAutocomplete/CompanySearchAutocomplete.d.ts +2 -14
  68. package/dist/legacy/components/Layouts/AbyssFamilyBanner/AbyssFamilyBanner.component.d.ts +3 -7
  69. package/dist/legacy.js +61 -61
  70. package/dist/theme/tokens/semantic.d.ts +4 -1
  71. package/dist/translations/en.d.ts +29 -0
  72. package/dist/translations/fr.d.ts +29 -0
  73. package/dist/utils/family.d.ts +12 -0
  74. package/dist/utils/index.d.ts +1 -0
  75. package/package.json +1 -1
  76. package/test-results/catalog/.last-run.json +1 -1
  77. package/dist/design-theme-BztWe75w.js +0 -15490
@@ -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';
@@ -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';
@@ -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;
@@ -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-DUYUEZaO.js";
2
+ import { C as E } from "./CookieConsentSettings.component-aVDMZLIs.js";
3
3
  export {
4
4
  e as AbyssCookieConsentProvider,
5
5
  a as COOKIE_NAME,