@abyss-project/commons-front-core 16.1.0 → 16.1.1
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.
- package/CHANGELOG.md +8 -0
- package/catalog/captures-plan.ts +1 -0
- package/catalog/catalog-entries.ts +4 -0
- package/catalog/pages/Accordion.tsx +93 -0
- package/catalog/pages/Breadcrumbs.tsx +61 -0
- package/catalog/pages/ComboboxField.tsx +220 -0
- package/catalog/pages/Menu.tsx +3 -1
- package/catalog/pages/Modal.tsx +3 -1
- package/catalog/pages/SegmentedControl.tsx +18 -4
- package/catalog/pages/StatusBadge.tsx +37 -18
- package/catalog/pages/index.ts +6 -0
- package/catalog/specs/write-capture-index.ts +1 -0
- package/dist/{CookieConsentSettings-DM0P2po1.js → CookieConsentSettings-CTAyLGkm.js} +1 -1
- package/dist/{Surface-DW78GtlG.js → Surface-76bwVL_Z.js} +370 -323
- package/dist/{Tabs-DGh_2Lgc.js → Tabs-D2bdAWGo.js} +384 -376
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/ComboboxField/ComboboxField.d.ts +190 -0
- package/dist/components/inputs/ComboboxField/ComboboxField.spec.d.ts +1 -0
- package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +8 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/layers/Menu/Menu.d.ts +11 -1
- package/dist/components/layers/Modal/Modal.d.ts +3 -1
- package/dist/components/meaning/StatusBadge/StatusBadge.d.ts +25 -3
- package/dist/components/mobile/BottomSheet/BottomSheet.d.ts +3 -1
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +43 -0
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.spec.d.ts +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/structure/Accordion/Accordion.d.ts +65 -0
- package/dist/components/structure/Accordion/Accordion.spec.d.ts +1 -0
- package/dist/components/structure/PageHeader/PageHeader.d.ts +3 -5
- package/dist/components/structure/index.d.ts +1 -0
- package/dist/components/structure/test-support/structure-test-harness.d.ts +6 -1
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-BNfby4u0.js → design-theme-B1PgRGnU.js} +2 -2
- package/dist/{editors-CoA-ElkI.js → editors-C2rcatuM.js} +27 -27
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +26 -0
- package/dist/{index-DSRCuEE1.js → index-3lv992-d.js} +2 -2
- package/dist/{index-9AhVX_o8.js → index-4Yy0aUgK.js} +1 -1
- package/dist/{index-BNnh8uiO.js → index-BFmuZ1fy.js} +2 -2
- package/dist/{index-B4W3BpjI.js → index-BQDShLfx.js} +4 -4
- package/dist/{index-CpJ_UF5V.js → index-BT4II8Xn.js} +2 -2
- package/dist/{index-BPIERrcr.js → index-CNEoRNth.js} +3 -3
- package/dist/{index-C2MJfXbp.js → index-CSuco3OH.js} +2 -2
- package/dist/{index-BXY3SD83.js → index-CV-IfV6z.js} +2 -2
- package/dist/{index-jHXiCbzE.js → index-CY7TSo5q.js} +2 -2
- package/dist/{index-Dl1yghiT.js → index-Cv2nccBd.js} +2 -2
- package/dist/{index-DakS19sw.js → index-CwT2qdxO.js} +2 -2
- package/dist/{index-DJ4F-yGQ.js → index-D0JsaNEm.js} +3 -3
- package/dist/{index-SJdLMrNS.js → index-Dc4AUxs3.js} +2 -2
- package/dist/{index-ebpXyaXh.js → index-Dn53bUXz.js} +2 -2
- package/dist/{index--WDnqvkI.js → index-DoXNSm4g.js} +3 -3
- package/dist/{index-Dgongfv-.js → index-Ds9SlbVU.js} +2 -2
- package/dist/{index-BX4GOdlN.js → index-N01-gzsR.js} +4 -4
- package/dist/{index-DF-LePxe.js → index-PFLipTVz.js} +2 -2
- package/dist/{index-MEKGvAmO.js → index-vvVLoC4J.js} +3 -3
- package/dist/{index-CMyVfh9D.js → index-wZeZLKGl.js} +2 -2
- package/dist/{index-BIX2oQnD.js → index-zLjfdiAC.js} +4 -4
- package/dist/index.js +7381 -6705
- package/dist/legacy.js +1014 -921
- package/dist/translations/en.d.ts +13 -0
- package/dist/translations/fr.d.ts +13 -0
- package/package.json +3 -3
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { ReactNode, SyntheticEvent } from 'react';
|
|
2
|
+
/** The ready-made option: what `options` can be made of when nothing else is needed. */
|
|
3
|
+
export interface ComboboxOption {
|
|
4
|
+
/** Identifies the option; also what the list is keyed and compared on. */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Shown in the list and in the field, searched. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** A second line under the label in the list. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Mark before the label, in the list and in the tag of a multiple field. */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Where a change of the text typed in the field comes from. */
|
|
14
|
+
export declare enum ComboboxInputSource {
|
|
15
|
+
/** The person typed or pasted. */
|
|
16
|
+
Typed = "typed",
|
|
17
|
+
/** The person cleared the field. */
|
|
18
|
+
Cleared = "cleared",
|
|
19
|
+
/** The field rewrote its own text: the label of a picked option, or the text back on blur. */
|
|
20
|
+
Reset = "reset"
|
|
21
|
+
}
|
|
22
|
+
/** What a tag of a multiple field must carry to be removed and reached from the keyboard. */
|
|
23
|
+
export interface ComboboxTagItem {
|
|
24
|
+
/** Removes the value; undefined while the field is disabled. */
|
|
25
|
+
onDelete?(event: SyntheticEvent): void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
tabIndex?: number;
|
|
29
|
+
'data-item-index'?: number;
|
|
30
|
+
}
|
|
31
|
+
/** State of an option row handed to `renderOption`. */
|
|
32
|
+
export interface ComboboxOptionState {
|
|
33
|
+
selected: boolean;
|
|
34
|
+
/** The text typed in the field. */
|
|
35
|
+
inputValue: string;
|
|
36
|
+
}
|
|
37
|
+
interface ComboboxBaseProps<T> {
|
|
38
|
+
/** Label above the field, its accessible name. */
|
|
39
|
+
label: string;
|
|
40
|
+
/** Keep the label as the field's accessible name but do not draw it (a field in a dense row). */
|
|
41
|
+
hideLabel?: boolean;
|
|
42
|
+
/** Replaces the label as the input's accessible name (`aria-label`). */
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
/** A hint under the field, always shown. */
|
|
45
|
+
help?: ReactNode;
|
|
46
|
+
/** An error message under the field; the field turns to the danger color and is marked invalid. */
|
|
47
|
+
error?: ReactNode;
|
|
48
|
+
/** The asterisk of the label and the `required` attribute of the input. */
|
|
49
|
+
required?: boolean;
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
autoFocus?: boolean;
|
|
53
|
+
options: T[];
|
|
54
|
+
/**
|
|
55
|
+
* The key of an option, unique within `options`: what the list is keyed on and what a value is
|
|
56
|
+
* matched to an option by. Defaults to `value` for a `ComboboxOption`, to the string itself for
|
|
57
|
+
* a string, else to the label: give it when two options can share a label.
|
|
58
|
+
*/
|
|
59
|
+
getOptionKey?(option: T): string;
|
|
60
|
+
getOptionDisabled?(option: T): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The group of an option, drawn as a heading over its run of options. Options of one group
|
|
63
|
+
* must follow one another.
|
|
64
|
+
*/
|
|
65
|
+
groupBy?(option: T): string;
|
|
66
|
+
/**
|
|
67
|
+
* The content of an option row (the row, its 44 px height on a phone and its keyboard and
|
|
68
|
+
* selected states are the field's). Default: icon, label and description of a `ComboboxOption`,
|
|
69
|
+
* else the label.
|
|
70
|
+
*/
|
|
71
|
+
renderOption?(option: T, state: ComboboxOptionState): ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* The tag of a picked option in a multiple field. It must spread `item` on its focusable root
|
|
74
|
+
* (or be a `ComboboxTag`): that is how the keyboard walks and removes the tags. Text typed in
|
|
75
|
+
* a `freeSolo` field is always the default tag.
|
|
76
|
+
*/
|
|
77
|
+
renderTag?(option: T, item: ComboboxTagItem): ReactNode;
|
|
78
|
+
/**
|
|
79
|
+
* Narrows the options to the typed text. Return elements of `options`. Default: the options
|
|
80
|
+
* whose label contains the text, without regard to case or accents. For a server-side search
|
|
81
|
+
* return `options` unchanged and fetch from `onInputChange`.
|
|
82
|
+
*/
|
|
83
|
+
filterOptions?(options: T[], inputValue: string): T[];
|
|
84
|
+
/** A search is in flight: the list says so while it has no option to show. */
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
/** Default « Searching… » (translated). */
|
|
87
|
+
loadingText?: string;
|
|
88
|
+
/** What the list says when nothing matches. Default « No result » (translated). */
|
|
89
|
+
emptyText?: string;
|
|
90
|
+
/** The text of the field, set by the host. Unset, the field keeps its own. */
|
|
91
|
+
inputValue?: string;
|
|
92
|
+
/** Told each time the text of the field changes, with where the change comes from. */
|
|
93
|
+
onInputChange?(text: string, source: ComboboxInputSource): void;
|
|
94
|
+
/** Hide the clear button (the value can still be replaced). */
|
|
95
|
+
disableClearable?: boolean;
|
|
96
|
+
/** Keep the list open after a pick: for a multiple field filled in one go. */
|
|
97
|
+
disableCloseOnSelect?: boolean;
|
|
98
|
+
/** Open the list when the field takes the focus. */
|
|
99
|
+
openOnFocus?: boolean;
|
|
100
|
+
/** Take the focus off the field after a pick. */
|
|
101
|
+
blurOnSelect?: boolean;
|
|
102
|
+
/** `freeSolo`: confirm the typed text as the value when the field loses the focus. */
|
|
103
|
+
autoSelect?: boolean;
|
|
104
|
+
/** Multiple: tags shown while the field is not focused, « +N » for the rest. */
|
|
105
|
+
limitTags?: number;
|
|
106
|
+
/** The mono font of the tokens in the input: a field that holds code, a route, a key. */
|
|
107
|
+
monospace?: boolean;
|
|
108
|
+
maxLength?: number;
|
|
109
|
+
/**
|
|
110
|
+
* `data-testid` of the input; an option gets `<testId>-option-<key>` and a default tag
|
|
111
|
+
* `<testId>-tag-<key>`.
|
|
112
|
+
*/
|
|
113
|
+
testId?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A `getOptionLabel` is optional for a string or an object with a `label`, which is read as the
|
|
117
|
+
* text of the option; any other option type must say how to read it.
|
|
118
|
+
*/
|
|
119
|
+
type Labeling<T> = [T] extends [string | {
|
|
120
|
+
label: string;
|
|
121
|
+
}] ? {
|
|
122
|
+
getOptionLabel?(option: T): string;
|
|
123
|
+
} : {
|
|
124
|
+
getOptionLabel(option: T): string;
|
|
125
|
+
};
|
|
126
|
+
interface SingleMode<T> {
|
|
127
|
+
multiple?: false;
|
|
128
|
+
freeSolo?: false;
|
|
129
|
+
/** The picked option, `null` when none. */
|
|
130
|
+
value: T | null;
|
|
131
|
+
onChange(value: T | null): void;
|
|
132
|
+
/**
|
|
133
|
+
* A mark before the picked option, inside the closed field: a color dot, an emoji, an icon, a
|
|
134
|
+
* status. The field hides nothing of it: the host sets `aria-hidden` on what is decoration (the
|
|
135
|
+
* label says the same), and what carries a meaning stays readable. Not called while no option
|
|
136
|
+
* is picked, nor for text typed in a `freeSolo` field.
|
|
137
|
+
*/
|
|
138
|
+
renderValueAdornment?(option: T): ReactNode;
|
|
139
|
+
}
|
|
140
|
+
interface MultipleMode<T> {
|
|
141
|
+
multiple: true;
|
|
142
|
+
freeSolo?: false;
|
|
143
|
+
/** The picked options, in the order they were picked. */
|
|
144
|
+
value: T[];
|
|
145
|
+
onChange(value: T[]): void;
|
|
146
|
+
}
|
|
147
|
+
interface FreeSoloMode<T> {
|
|
148
|
+
multiple?: false;
|
|
149
|
+
/** The typed text can be the value: it arrives as a `string` next to the options. */
|
|
150
|
+
freeSolo: true;
|
|
151
|
+
value: T | string | null;
|
|
152
|
+
onChange(value: T | string | null): void;
|
|
153
|
+
/**
|
|
154
|
+
* A mark before the picked option, inside the closed field: a color dot, an emoji, an icon, a
|
|
155
|
+
* status. The field hides nothing of it: the host sets `aria-hidden` on what is decoration (the
|
|
156
|
+
* label says the same), and what carries a meaning stays readable. Not called while no option
|
|
157
|
+
* is picked, nor for text typed in a `freeSolo` field.
|
|
158
|
+
*/
|
|
159
|
+
renderValueAdornment?(option: T): ReactNode;
|
|
160
|
+
}
|
|
161
|
+
interface FreeSoloMultipleMode<T> {
|
|
162
|
+
multiple: true;
|
|
163
|
+
freeSolo: true;
|
|
164
|
+
value: Array<T | string>;
|
|
165
|
+
onChange(value: Array<T | string>): void;
|
|
166
|
+
}
|
|
167
|
+
export type ComboboxFieldProps<T = ComboboxOption> = ComboboxBaseProps<T> & Labeling<T> & (SingleMode<T> | MultipleMode<T> | FreeSoloMode<T> | FreeSoloMultipleMode<T>);
|
|
168
|
+
export interface ComboboxTagProps {
|
|
169
|
+
label: string;
|
|
170
|
+
/** Mark before the label. */
|
|
171
|
+
icon?: ReactNode;
|
|
172
|
+
/** Any CSS color: a dot before the label, for a value whose color is data (a tag, a category). */
|
|
173
|
+
color?: string;
|
|
174
|
+
/** What the field gave the tag: spread by `renderTag` into the tag. */
|
|
175
|
+
item: ComboboxTagItem;
|
|
176
|
+
testId?: string;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The tag of a picked value in a multiple field: the one a field draws by default, for a
|
|
180
|
+
* `renderTag` that only adds a mark or a color to it.
|
|
181
|
+
*/
|
|
182
|
+
export declare function ComboboxTag({ label, icon, color, item, testId, }: ComboboxTagProps): import("react/jsx-runtime").JSX.Element;
|
|
183
|
+
/**
|
|
184
|
+
* A field whose list is filtered by what is typed: one pick, several (tags), or free text next to
|
|
185
|
+
* the options (`freeSolo`). Labelled, with a hint and an error, like `FormField`. The list is the
|
|
186
|
+
* `Autocomplete` of MUI: the arrows move, Enter picks, Escape closes; in a multiple field the left
|
|
187
|
+
* arrow walks the tags and Backspace or Delete removes the focused one.
|
|
188
|
+
*/
|
|
189
|
+
export declare function ComboboxField<T = ComboboxOption>(props: ComboboxFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
190
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export interface SegmentedOption<V extends string> {
|
|
2
3
|
value: V;
|
|
3
4
|
label: string;
|
|
5
|
+
/** Mark before the label (decoration, hidden from screen readers). */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Draw the icon alone: the label stays the accessible name of the segment but is not shown.
|
|
9
|
+
* Needs an `icon`; without one the label is shown anyway.
|
|
10
|
+
*/
|
|
11
|
+
iconOnly?: boolean;
|
|
4
12
|
count?: number;
|
|
5
13
|
/** Rendered as `data-testid` on the segment. */
|
|
6
14
|
testId?: string;
|
|
@@ -21,11 +21,21 @@ export interface MenuItem {
|
|
|
21
21
|
testId?: string;
|
|
22
22
|
onSelect(): void;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A heading over the run of items that follows it, up to the next heading. It is not an item: the
|
|
26
|
+
* arrows skip it. It is a `role="group"` named by its text that owns the run (`aria-owns`: the
|
|
27
|
+
* rows stay siblings, which is what the arrow walk of MUI needs), so two items with the same label
|
|
28
|
+
* under two headings stay told apart by a screen reader.
|
|
29
|
+
*/
|
|
30
|
+
export interface MenuGroupTitle {
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
}
|
|
24
34
|
export interface MenuProps {
|
|
25
35
|
anchorEl: HTMLElement | null;
|
|
26
36
|
open: boolean;
|
|
27
37
|
onClose(): void;
|
|
28
|
-
items: (MenuItem | MenuSeparator)[];
|
|
38
|
+
items: (MenuItem | MenuGroupTitle | MenuSeparator)[];
|
|
29
39
|
/** Rendered as `data-testid` on the menu container, for a host whose trigger needs it. */
|
|
30
40
|
testId?: string;
|
|
31
41
|
}
|
|
@@ -9,6 +9,8 @@ export interface ModalProps {
|
|
|
9
9
|
open: boolean;
|
|
10
10
|
onClose(): void;
|
|
11
11
|
title: string;
|
|
12
|
+
/** Mark before the title (decoration: the title names the dialog), 20 px tall in the header. */
|
|
13
|
+
titleIcon?: ReactNode;
|
|
12
14
|
description?: string;
|
|
13
15
|
size?: ModalSize;
|
|
14
16
|
/** Buttons of the footer, right-aligned; the first focus goes to the one carrying `autoFocus`. */
|
|
@@ -21,4 +23,4 @@ export interface ModalProps {
|
|
|
21
23
|
* scrim close it. Below 768 px (the design system's tablet tier, whatever the theme) it is presented
|
|
22
24
|
* as a `BottomSheet`.
|
|
23
25
|
*/
|
|
24
|
-
export declare function Modal({ open, onClose, title, description, size, actions, children, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function Modal({ open, onClose, title, titleIcon, description, size, actions, children, }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export declare enum StatusTone {
|
|
2
3
|
Success = "success",
|
|
3
4
|
Warning = "warning",
|
|
@@ -6,10 +7,31 @@ export declare enum StatusTone {
|
|
|
6
7
|
Highlight = "highlight",
|
|
7
8
|
Neutral = "neutral"
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
interface StatusBadgeBaseProps {
|
|
10
11
|
tone: StatusTone;
|
|
11
12
|
label: string;
|
|
12
13
|
dot?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Color of the dot when it is data, not a state: the color a user gave a tag, any CSS color.
|
|
16
|
+
* Only read with `dot`; the label keeps the color of its tone.
|
|
17
|
+
*/
|
|
18
|
+
dotColor?: string;
|
|
19
|
+
/** Mark before the label, after the dot if any (decoration: the label tells the state). */
|
|
20
|
+
icon?: ReactNode;
|
|
13
21
|
}
|
|
14
|
-
/** A
|
|
15
|
-
export
|
|
22
|
+
/** A badge that can be removed carries the name of its remove button; one that cannot has neither. */
|
|
23
|
+
export type StatusBadgeProps = StatusBadgeBaseProps & ({
|
|
24
|
+
/** Adds a remove button after the label. */
|
|
25
|
+
onRemove: () => void;
|
|
26
|
+
/** Name of the remove button, already translated and naming what it removes. */
|
|
27
|
+
removeLabel: string;
|
|
28
|
+
} | {
|
|
29
|
+
onRemove?: undefined;
|
|
30
|
+
removeLabel?: undefined;
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* A state or outcome told by color and by its label, with an optional leading dot or icon and,
|
|
34
|
+
* for a filter or a value the user can take off, a remove button.
|
|
35
|
+
*/
|
|
36
|
+
export declare const StatusBadge: ({ tone, label, dot, dotColor, icon, onRemove, removeLabel, }: StatusBadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -3,6 +3,8 @@ export interface BottomSheetProps {
|
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose(): void;
|
|
5
5
|
title?: string;
|
|
6
|
+
/** Mark before the title (decoration: the title names the dialog); `Modal` passes its `titleIcon`. */
|
|
7
|
+
titleIcon?: ReactNode;
|
|
6
8
|
/** Shows a close button in the top corner, named by this label (`Modal` below 768 px). */
|
|
7
9
|
closeLabel?: string;
|
|
8
10
|
children: ReactNode;
|
|
@@ -11,4 +13,4 @@ export interface BottomSheetProps {
|
|
|
11
13
|
* A sheet that slides up from the bottom edge (`.sheet`). Escape, the scrim and a downward drag of
|
|
12
14
|
* its handle past 30 % of its height close it; focus stays inside while it is open.
|
|
13
15
|
*/
|
|
14
|
-
export declare function BottomSheet({ open, onClose, title, closeLabel, children, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function BottomSheet({ open, onClose, title, titleIcon, closeLabel, children, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface BreadcrumbItem {
|
|
2
|
+
label: string;
|
|
3
|
+
/** Route inside the app: the crumb is a router link. */
|
|
4
|
+
href?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Called when the crumb is activated. Alone, the crumb is a button; with `href`, it runs
|
|
7
|
+
* before the navigation.
|
|
8
|
+
*/
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
/** `data-testid` of the crumb's link or button. */
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BreadcrumbsProps {
|
|
14
|
+
items: BreadcrumbItem[];
|
|
15
|
+
/** Name of the `nav`. Defaults to « Breadcrumb » (translated). */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The most crumbs shown, the « … » button included. Past it, the middle of the path is hidden
|
|
19
|
+
* behind « … » until it is activated. Unset: nothing is hidden.
|
|
20
|
+
*/
|
|
21
|
+
maxItems?: number;
|
|
22
|
+
/** `maxItems` below 768 px. Defaults to `maxItems`. */
|
|
23
|
+
maxItemsMobile?: number;
|
|
24
|
+
/** Crumbs kept before the « … ». Defaults to 1. */
|
|
25
|
+
itemsBeforeCollapse?: number;
|
|
26
|
+
/** Crumbs kept after the « … ». Defaults to what `maxItems` leaves: `maxItems` − before − 1. */
|
|
27
|
+
itemsAfterCollapse?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Let the crumbs wrap onto several lines, a long label breaking where it must. Without it
|
|
30
|
+
* (the default) the trail is one line, each crumb cut by an ellipsis with its full label in
|
|
31
|
+
* `title`.
|
|
32
|
+
*/
|
|
33
|
+
wrap?: boolean;
|
|
34
|
+
/** `data-testid` of the `nav`. */
|
|
35
|
+
testId?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A trail of crumbs from the top of a hierarchy to the open page: router links (or buttons), the
|
|
39
|
+
* last one the current page when it carries no link. A long path hides its middle behind a
|
|
40
|
+
* « … » button (`maxItems`); on one line, every crumb is cut by an ellipsis so the trail never
|
|
41
|
+
* overflows a phone. The `nav` of `PageHeader`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function Breadcrumbs({ items, ariaLabel, maxItems, maxItemsMobile, itemsBeforeCollapse, itemsAfterCollapse, wrap, testId, }: BreadcrumbsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Breadcrumbs/Breadcrumbs';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare enum AccordionVariant {
|
|
3
|
+
/** A bordered block on `bg.raised`, its content under a rule: a setting block in a form. */
|
|
4
|
+
Framed = "framed",
|
|
5
|
+
/** No frame, a hairline between sections: a list of folds in a panel. */
|
|
6
|
+
Flat = "flat"
|
|
7
|
+
}
|
|
8
|
+
export declare enum AccordionTone {
|
|
9
|
+
Default = "default",
|
|
10
|
+
/** The content holds something to fix: frame and summary in `status.danger`. */
|
|
11
|
+
Danger = "danger"
|
|
12
|
+
}
|
|
13
|
+
export interface AccordionProps {
|
|
14
|
+
/** The header's name, in a heading. */
|
|
15
|
+
title: string;
|
|
16
|
+
/** One line under the title: the content's state in plain words. Describes the header. */
|
|
17
|
+
summary?: ReactNode;
|
|
18
|
+
/** Decorative mark before the title; hidden from assistive technology. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Shown at the end of the header, before the arrow (a hint, a count). */
|
|
21
|
+
aside?: ReactNode;
|
|
22
|
+
/** Defaults to `AccordionVariant.Framed`. */
|
|
23
|
+
variant?: AccordionVariant;
|
|
24
|
+
/** Defaults to `AccordionTone.Default`. */
|
|
25
|
+
tone?: AccordionTone;
|
|
26
|
+
/** Open state, set by the host: pair it with `onExpandedChange`. Unset, the accordion keeps its own. */
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
/** Starting state of an accordion that keeps its own. Closed by default. */
|
|
29
|
+
defaultExpanded?: boolean;
|
|
30
|
+
/** Told each time the header opens or closes the content. */
|
|
31
|
+
onExpandedChange?(expanded: boolean): void;
|
|
32
|
+
/**
|
|
33
|
+
* Name of the accordion in an `AccordionGroup`, whose `value` lists the open ones. Required
|
|
34
|
+
* there and unique within the group; elsewhere it only names the DOM nodes.
|
|
35
|
+
*/
|
|
36
|
+
id?: string;
|
|
37
|
+
/** Level of the heading around the header button. Defaults to 3. */
|
|
38
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
/** `data-testid` of the root; the header button gets `<testId>-header`, the content `<testId>-content`. */
|
|
41
|
+
testId?: string;
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export interface AccordionGroupProps {
|
|
45
|
+
/** At most one accordion open: opening one closes the others. */
|
|
46
|
+
exclusive?: boolean;
|
|
47
|
+
/** Ids of the open accordions, set by the host: pair it with `onChange`. */
|
|
48
|
+
value?: string[];
|
|
49
|
+
/** Ids open at the start of a group that keeps its own state. */
|
|
50
|
+
defaultValue?: string[];
|
|
51
|
+
/** Told the ids that are open after each change. */
|
|
52
|
+
onChange?(value: string[]): void;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A fold: a header button that opens and closes its content (the WAI-ARIA accordion pattern).
|
|
57
|
+
* The header is at least 44 px tall, `aria-expanded` and `aria-controls` tell its state, Enter and
|
|
58
|
+
* Space toggle it, and the content stays mounted while closed (a form keeps what was typed).
|
|
59
|
+
*/
|
|
60
|
+
export declare function Accordion({ title, summary, icon, aside, variant, tone, expanded, defaultExpanded, onExpandedChange, id, headingLevel, disabled, testId, children, }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Accordions that share their state: `exclusive` keeps one open at most. Each accordion inside
|
|
63
|
+
* names itself with an `id`, which `value` and `onChange` list.
|
|
64
|
+
*/
|
|
65
|
+
export declare function AccordionGroup({ exclusive, value, defaultValue, onChange, children, }: AccordionGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
href?: string;
|
|
6
|
-
}
|
|
2
|
+
import { BreadcrumbItem } from '../../navigation/Breadcrumbs/Breadcrumbs';
|
|
3
|
+
/** A crumb of the header's trail; the last one is the current page and is never a link. */
|
|
4
|
+
export type PageHeaderBreadcrumb = BreadcrumbItem;
|
|
7
5
|
export interface PageHeaderProps {
|
|
8
6
|
title: string;
|
|
9
7
|
subtitle?: ReactNode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { RenderResult } from '@testing-library/react';
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
|
+
import { UserLanguage } from '@abyss-project/main';
|
|
4
5
|
import { Density, ThemeMode } from '../../../theme';
|
|
5
6
|
export declare const THEME_MODES: ThemeMode[];
|
|
6
7
|
/** Viewport widths of the three layouts (ADR-0174 §3, paliers). */
|
|
@@ -20,12 +21,16 @@ export interface StructureRenderOptions {
|
|
|
20
21
|
density?: Density;
|
|
21
22
|
width?: number;
|
|
22
23
|
route?: string;
|
|
24
|
+
/** Render under the legacy theme the front still runs on, which carries `theme.design` too. */
|
|
25
|
+
legacy?: boolean;
|
|
26
|
+
/** Language of the messages. Defaults to French. */
|
|
27
|
+
language?: UserLanguage;
|
|
23
28
|
}
|
|
24
29
|
export interface StructureRenderResult extends RenderResult {
|
|
25
30
|
theme: Theme;
|
|
26
31
|
}
|
|
27
32
|
/** Renders `ui` under the design system theme, the French messages and a router. */
|
|
28
|
-
export declare const renderStructure: (ui: ReactElement, { mode, density, width, route, }?: StructureRenderOptions) => StructureRenderResult;
|
|
33
|
+
export declare const renderStructure: (ui: ReactElement, { mode, density, width, route, legacy, language, }?: StructureRenderOptions) => StructureRenderResult;
|
|
29
34
|
/** Prints the router location, to observe a navigation. */
|
|
30
35
|
export declare const LocationProbe: () => import("react/jsx-runtime").JSX.Element;
|
|
31
36
|
/** The color `value` resolves to in the computed style of jsdom (`rgb(…)` or `rgba(…)`). */
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as e, d as a, C as n, b as C, D as i, R as t, V as r, e as A, r as k, f as c, u as l, c as f, a as b, w as u } from "./CookieConsentSettings-
|
|
2
|
-
import { f as E } from "./Surface-
|
|
1
|
+
import { A as e, d as a, C as n, b as C, D as i, R as t, V as r, e as A, r as k, f as c, u as l, c as f, a as b, w as u } from "./CookieConsentSettings-CTAyLGkm.js";
|
|
2
|
+
import { f as E } from "./Surface-76bwVL_Z.js";
|
|
3
3
|
export {
|
|
4
4
|
e as AbyssCookieConsentProvider,
|
|
5
5
|
a as COOKIE_NAME,
|
|
@@ -2,7 +2,7 @@ import { B as Mt, C as MW, D as FW, F as RW, f as IW, m as tf, n as h3, G as VW,
|
|
|
2
2
|
import { W as LW, r as YW, C as QW } from "./index-D7cgykJH.js";
|
|
3
3
|
import * as ga from "react";
|
|
4
4
|
import IT, { useRef as gt, useEffect as xr, useState as Pr, useCallback as xe, useMemo as Ye, useLayoutEffect as aE, createContext as ro, forwardRef as vs, createElement as Tr, useContext as ji, memo as Kt, cloneElement as HW, Component as oE, Fragment as zy, isValidElement as GW } from "react";
|
|
5
|
-
import { u as jW, T as xc,
|
|
5
|
+
import { u as jW, T as xc, q as XW, H as sE, l as uE, r as lE, o as cE, y as fE, z as dE, J as JW, K as zW, I as ZW, n as $W } from "./Surface-76bwVL_Z.js";
|
|
6
6
|
import VT from "@mui/icons-material/InsertDriveFile";
|
|
7
7
|
import eB from "@mui/icons-material/Image";
|
|
8
8
|
import tB from "@mui/icons-material/PictureAsPdf";
|
|
@@ -12,7 +12,7 @@ import iB from "@mui/icons-material/Description";
|
|
|
12
12
|
import { jsx as X, jsxs as Jt, Fragment as xn } from "react/jsx-runtime";
|
|
13
13
|
import { unstable_batchedUpdates as aB } from "react-dom";
|
|
14
14
|
import { useTheme as oB, useMediaQuery as sB, Dialog as uB, IconButton as lB } from "@mui/material";
|
|
15
|
-
import
|
|
15
|
+
import cB from "@mui/icons-material/Close";
|
|
16
16
|
import { useIntl as fB } from "react-intl";
|
|
17
17
|
var hE = /* @__PURE__ */ ((e) => (e.Comfortable = "comfortable", e.Compact = "compact", e))(hE || {}), Fo = {}, Wh, OT;
|
|
18
18
|
function dB() {
|