@alveole/components 0.39.0 → 0.40.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.
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.d.ts +4 -2
- package/dist/ui/ActionMenu/ActionMenu.stories.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.js +48 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.d.ts +2 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.js +2 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.d.ts +7 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.js +3 -3
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.js +10 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.d.ts +4 -0
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.js +4 -0
- package/dist/ui/Signature/Signature.stories.d.ts +1 -1
- package/dist/ui/Signature/Signature.styles.d.ts +1 -1
- package/dist/ui/Signature/Signature.styles.js +4 -4
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ALVEOLE_COMPONENTS_VERSION: "0.
|
|
1
|
+
export declare const ALVEOLE_COMPONENTS_VERSION: "0.40.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ALVEOLE_COMPONENTS_VERSION = "0.
|
|
1
|
+
export const ALVEOLE_COMPONENTS_VERSION = "0.40.0";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
4
|
tags: "ui"[];
|
|
4
5
|
experimental: false;
|
|
5
6
|
figmaURL: string;
|
|
6
7
|
description: string;
|
|
7
|
-
component: ((props: import("./ActionMenu").ActionMenuProps) =>
|
|
8
|
+
component: ((props: import("./ActionMenu").ActionMenuProps) => React.JSX.Element) & {
|
|
8
9
|
Item: typeof import("./ActionMenuItem").ActionMenuItem;
|
|
9
10
|
};
|
|
10
11
|
styleFn: () => string;
|
|
11
12
|
};
|
|
12
13
|
export default _default;
|
|
13
|
-
export declare const Default: () =>
|
|
14
|
+
export declare const Default: () => React.JSX.Element;
|
|
15
|
+
export declare const Filters: () => React.JSX.Element;
|
|
14
16
|
export * as Sources from './ActionMenu.stories.sources';
|
|
15
17
|
//# sourceMappingURL=ActionMenu.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActionMenu.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;AAO1B,wBAQkB;AAElB,eAAO,MAAM,OAAO,yBAuCnB,CAAC;AAIF,eAAO,MAAM,OAAO,yBAqFnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Platform, ScrollView } from 'react-native';
|
|
2
4
|
import { Box } from '../../core';
|
|
3
5
|
import { Button } from '../Button';
|
|
4
6
|
import { ActionMenu } from './ActionMenu';
|
|
@@ -28,4 +30,50 @@ export const Default = () => {
|
|
|
28
30
|
];
|
|
29
31
|
return (_jsx(Box, { display: "flex", flexWrap: "wrap", gap: "1W", flexDirection: "row", "justify-content": "center", "align-items": "center", width: "100%", children: alignments.map(alignment => (_jsxs(ActionMenu, { placement: alignment, renderTrigger: () => _jsx(Button, { variant: "secondary", title: alignment }), children: [_jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Settings", selected: true }), _jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Copy" }), _jsx(ActionMenu.Item, { title: "Contenu de l'action menu", icon: "Trash" })] }, alignment))) }));
|
|
30
32
|
};
|
|
33
|
+
export const Filters = () => {
|
|
34
|
+
const filters = [
|
|
35
|
+
{ id: 'epic', title: 'Epic', options: ['Refonte design', 'Onboarding', 'Facturation'] },
|
|
36
|
+
{ id: 'type', title: 'Type', options: ['Bug', 'Story', 'Tâche'] },
|
|
37
|
+
{
|
|
38
|
+
id: 'filtresRapides',
|
|
39
|
+
title: 'Filtres rapides',
|
|
40
|
+
options: ['Assigné à moi', 'En cours', 'En retard'],
|
|
41
|
+
multi: true,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
const [openId, setOpenId] = React.useState(null);
|
|
45
|
+
const [singleSelected, setSingleSelected] = React.useState({});
|
|
46
|
+
const [multiSelected, setMultiSelected] = React.useState({});
|
|
47
|
+
return (_jsx(ScrollView, { horizontal: true, nestedScrollEnabled: true, directionalLockEnabled: Platform.OS === 'ios', showsHorizontalScrollIndicator: false, contentContainerStyle: { flexDirection: 'row', gap: 8, paddingHorizontal: 16 }, children: filters.map(filter => {
|
|
48
|
+
const isOpen = openId === filter.id;
|
|
49
|
+
const hasSelection = filter.multi
|
|
50
|
+
? (multiSelected[filter.id]?.length ?? 0) > 0
|
|
51
|
+
: singleSelected[filter.id] != null;
|
|
52
|
+
return (_jsx(ActionMenu, { placement: "bottom-start", scrollable: false, open: isOpen, setOpen: open => setOpenId(open ? filter.id : null), renderTrigger: () => (_jsx(Button, { variant: "secondary", title: filter.title, endIcon: isOpen ? 'ChevronUp' : 'ChevronDown', size: "sm", selected: hasSelection, active: isOpen })), children: filter.options.map(option => {
|
|
53
|
+
const isSelected = filter.multi
|
|
54
|
+
? (multiSelected[filter.id] ?? []).includes(option)
|
|
55
|
+
: singleSelected[filter.id] === option;
|
|
56
|
+
return (_jsx(ActionMenu.Item, { title: option, selected: isSelected, onPress: () => {
|
|
57
|
+
if (filter.multi) {
|
|
58
|
+
setMultiSelected(prev => {
|
|
59
|
+
const current = prev[filter.id] ?? [];
|
|
60
|
+
return {
|
|
61
|
+
...prev,
|
|
62
|
+
[filter.id]: current.includes(option)
|
|
63
|
+
? current.filter(o => o !== option)
|
|
64
|
+
: [...current, option],
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
setSingleSelected(prev => ({
|
|
70
|
+
...prev,
|
|
71
|
+
[filter.id]: prev[filter.id] === option ? undefined : option,
|
|
72
|
+
}));
|
|
73
|
+
setOpenId(null);
|
|
74
|
+
}
|
|
75
|
+
} }, option));
|
|
76
|
+
}) }, filter.id));
|
|
77
|
+
}) }));
|
|
78
|
+
};
|
|
31
79
|
export * as Sources from './ActionMenu.stories.sources';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const Default: () => string;
|
|
2
|
+
export declare const Filters: () => string;
|
|
2
3
|
export declare const storySources: {
|
|
3
4
|
readonly Default: () => string;
|
|
5
|
+
readonly Filters: () => string;
|
|
4
6
|
};
|
|
5
7
|
export type StorySourceName = keyof typeof storySources;
|
|
6
8
|
//# sourceMappingURL=ActionMenu.stories.sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2/B,CAAC;AAEhhC,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"ActionMenu.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ActionMenu/ActionMenu.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2/B,CAAC;AAEhhC,eAAO,MAAM,OAAO,cAAilG,CAAC;AAEtmG,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// This file is generated. Do not edit manually.
|
|
2
2
|
// Source: src/ui/ActionMenu/ActionMenu.stories.tsx
|
|
3
3
|
export const Default = () => "export const Default = () => {\n const alignments = [\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'bottom-start',\n 'bottom-end',\n 'left-start',\n 'left-end',\n ] as const;\n\n return (\n <Box\n display=\"flex\"\n flexWrap=\"wrap\"\n gap=\"1W\"\n flexDirection=\"row\"\n justify-content=\"center\"\n align-items=\"center\"\n width=\"100%\"\n >\n {alignments.map(alignment => (\n <ActionMenu\n key={alignment}\n placement={alignment}\n renderTrigger={() => <Button variant=\"secondary\" title={alignment} />}\n >\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Settings\" selected />\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Copy\" />\n <ActionMenu.Item title=\"Contenu de l'action menu\" icon=\"Trash\" />\n </ActionMenu>\n ))}\n </Box>\n );\n};";
|
|
4
|
+
export const Filters = () => "export const Filters = () => {\n const filters: { id: FilterId; title: string; options: string[]; multi?: boolean }[] = [\n { id: 'epic', title: 'Epic', options: ['Refonte design', 'Onboarding', 'Facturation'] },\n { id: 'type', title: 'Type', options: ['Bug', 'Story', 'Tâche'] },\n {\n id: 'filtresRapides',\n title: 'Filtres rapides',\n options: ['Assigné à moi', 'En cours', 'En retard'],\n multi: true,\n },\n ];\n\n const [openId, setOpenId] = React.useState<FilterId | null>(null);\n const [singleSelected, setSingleSelected] = React.useState<Partial<Record<FilterId, string>>>({});\n const [multiSelected, setMultiSelected] = React.useState<Partial<Record<FilterId, string[]>>>({});\n\n return (\n <ScrollView\n horizontal\n nestedScrollEnabled\n directionalLockEnabled={Platform.OS === 'ios'}\n showsHorizontalScrollIndicator={false}\n contentContainerStyle={{ flexDirection: 'row', gap: 8, paddingHorizontal: 16 }}\n >\n {filters.map(filter => {\n const isOpen = openId === filter.id;\n const hasSelection = filter.multi\n ? (multiSelected[filter.id]?.length ?? 0) > 0\n : singleSelected[filter.id] != null;\n\n return (\n <ActionMenu\n key={filter.id}\n placement=\"bottom-start\"\n scrollable={false}\n open={isOpen}\n setOpen={open => setOpenId(open ? filter.id : null)}\n renderTrigger={() => (\n <Button\n variant=\"secondary\"\n title={filter.title}\n endIcon={isOpen ? 'ChevronUp' : 'ChevronDown'}\n size=\"sm\"\n selected={hasSelection}\n active={isOpen}\n />\n )}\n >\n {filter.options.map(option => {\n const isSelected = filter.multi\n ? (multiSelected[filter.id] ?? []).includes(option)\n : singleSelected[filter.id] === option;\n\n return (\n <ActionMenu.Item\n key={option}\n title={option}\n selected={isSelected}\n onPress={() => {\n if (filter.multi) {\n setMultiSelected(prev => {\n const current = prev[filter.id] ?? [];\n return {\n ...prev,\n [filter.id]: current.includes(option)\n ? current.filter(o => o !== option)\n : [...current, option],\n };\n });\n } else {\n setSingleSelected(prev => ({\n ...prev,\n [filter.id]: prev[filter.id] === option ? undefined : option,\n }));\n setOpenId(null);\n }\n }}\n />\n );\n })}\n </ActionMenu>\n );\n })}\n </ScrollView>\n );\n};";
|
|
4
5
|
export const storySources = {
|
|
5
6
|
Default,
|
|
7
|
+
Filters,
|
|
6
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type BreadcrumbItem = {
|
|
3
3
|
label: string;
|
|
4
|
-
href: string;
|
|
4
|
+
href: string | null;
|
|
5
5
|
isCurrent: boolean;
|
|
6
6
|
};
|
|
7
7
|
export type BreadcrumbsProps = React.PropsWithChildren<{
|
|
@@ -16,6 +16,12 @@ export type BreadcrumbsProps = React.PropsWithChildren<{
|
|
|
16
16
|
* Par défaut : capitalisation + remplacement des - et _ par des espaces.
|
|
17
17
|
*/
|
|
18
18
|
getLabel?: (segment: string, index: number, path: string) => string;
|
|
19
|
+
/**
|
|
20
|
+
* Personnalisation du lien pour un segment.
|
|
21
|
+
* Retourner null pour afficher le segment sans lien.
|
|
22
|
+
* Par défaut : chemin reconstruit depuis l'URL courante.
|
|
23
|
+
*/
|
|
24
|
+
getHref?: (segment: string, index: number, path: string) => string | null;
|
|
19
25
|
}>;
|
|
20
26
|
/**
|
|
21
27
|
* Fil d'Ariane construit à partir de la navigation Expo Router.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpE;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAC3E,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,sBA+ClD,CAAC"}
|
|
@@ -13,7 +13,7 @@ function humanizeSegment(segment) {
|
|
|
13
13
|
* Accueil > Admin > Missions > Détail
|
|
14
14
|
*/
|
|
15
15
|
export const Breadcrumbs = (props) => {
|
|
16
|
-
const { rootLabel = 'Accueil', segmentsToSkip, getLabel = segment => humanizeSegment(segment) } = props;
|
|
16
|
+
const { rootLabel = 'Accueil', segmentsToSkip, getLabel = segment => humanizeSegment(segment), getHref } = props;
|
|
17
17
|
const pathname = usePathname();
|
|
18
18
|
const styles = useStyles();
|
|
19
19
|
const segments = pathname.split('/').filter(Boolean);
|
|
@@ -32,9 +32,9 @@ export const Breadcrumbs = (props) => {
|
|
|
32
32
|
},
|
|
33
33
|
...segmentItems.map(({ segment, index, path }) => ({
|
|
34
34
|
label: getLabel(segment, index, path),
|
|
35
|
-
href: path,
|
|
35
|
+
href: getHref ? getHref(segment, index, path) : path,
|
|
36
36
|
isCurrent: index === segments.length - 1,
|
|
37
37
|
})),
|
|
38
38
|
];
|
|
39
|
-
return (_jsx(Box, { style: styles.container, children: items.map((item, index) => (_jsxs(Box, { style: { flexDirection: 'row', alignItems: 'center' }, children: [index > 0 && _jsx(Typography, { style: styles.separator, children: " > " }), item.isCurrent ? (_jsx(Typography, { style: styles.current, children: item.label })) : (_jsx(A, { href: item.href, style: styles.link, hoverStyle: styles.linkHover, children: _jsx(Typography, { style: styles.link, hoverStyle: styles.linkHover, children: item.label }) }))] }, `${item.href}-${index}`))) }));
|
|
39
|
+
return (_jsx(Box, { style: styles.container, children: items.map((item, index) => (_jsxs(Box, { style: { flexDirection: 'row', alignItems: 'center' }, children: [index > 0 && _jsx(Typography, { style: styles.separator, children: " > " }), item.isCurrent || item.href === null ? (_jsx(Typography, { style: styles.current, children: item.label })) : (_jsx(A, { href: item.href, style: styles.link, hoverStyle: styles.linkHover, children: _jsx(Typography, { style: styles.link, hoverStyle: styles.linkHover, children: item.label }) }))] }, `${item.href}-${index}`))) }));
|
|
40
40
|
};
|
|
@@ -42,6 +42,8 @@ export default _default;
|
|
|
42
42
|
export declare const Default: () => import("react").JSX.Element;
|
|
43
43
|
export declare const WithCustomRootLabel: () => import("react").JSX.Element;
|
|
44
44
|
export declare const WithCustomLabels: () => import("react").JSX.Element;
|
|
45
|
+
export declare const WithCustomHref: () => import("react").JSX.Element;
|
|
46
|
+
export declare const WithNoLink: () => import("react").JSX.Element;
|
|
45
47
|
export declare const WithSegmentsToSkip: () => import("react").JSX.Element;
|
|
46
48
|
export * as Sources from './Breadcrumbs.stories.sources';
|
|
47
49
|
//# sourceMappingURL=Breadcrumbs.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAElB,eAAO,MAAM,OAAO,mCAInB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAI/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAe5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAgB9B,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAElB,eAAO,MAAM,OAAO,mCAInB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAI/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAe5B,CAAC;AAEF,eAAO,MAAM,cAAc,mCAW1B,CAAC;AAEF,eAAO,MAAM,UAAU,mCAStB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAgB9B,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC"}
|
|
@@ -23,6 +23,16 @@ export const WithCustomLabels = () => (_jsx(Box, { p: 4, children: _jsx(Breadcru
|
|
|
23
23
|
};
|
|
24
24
|
return labels[segment] ?? segment;
|
|
25
25
|
} }) }));
|
|
26
|
+
export const WithCustomHref = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { getHref: (segment, _index, path) => {
|
|
27
|
+
const hrefs = {
|
|
28
|
+
components: '/ui-kit/components',
|
|
29
|
+
};
|
|
30
|
+
return hrefs[segment] ?? path;
|
|
31
|
+
} }) }));
|
|
32
|
+
export const WithNoLink = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { getHref: (segment, _index, path) => {
|
|
33
|
+
const noLink = ['components'];
|
|
34
|
+
return noLink.includes(segment) ? null : path;
|
|
35
|
+
} }) }));
|
|
26
36
|
export const WithSegmentsToSkip = () => (_jsx(Box, { p: 4, children: _jsx(Breadcrumbs, { segmentsToSkip: ['admin', 'ui-kit', 'components'], getLabel: (segment, _index, _path) => {
|
|
27
37
|
const labels = {
|
|
28
38
|
admin: 'Administration',
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export declare const Default: () => string;
|
|
2
2
|
export declare const WithCustomRootLabel: () => string;
|
|
3
3
|
export declare const WithCustomLabels: () => string;
|
|
4
|
+
export declare const WithCustomHref: () => string;
|
|
5
|
+
export declare const WithNoLink: () => string;
|
|
4
6
|
export declare const WithSegmentsToSkip: () => string;
|
|
5
7
|
export declare const storySources: {
|
|
6
8
|
readonly Default: () => string;
|
|
7
9
|
readonly WithCustomRootLabel: () => string;
|
|
8
10
|
readonly WithCustomLabels: () => string;
|
|
11
|
+
readonly WithCustomHref: () => string;
|
|
12
|
+
readonly WithNoLink: () => string;
|
|
9
13
|
readonly WithSegmentsToSkip: () => string;
|
|
10
14
|
};
|
|
11
15
|
export type StorySourceName = keyof typeof storySources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2F,CAAC;AAEhH,eAAO,MAAM,mBAAmB,cAAqI,CAAC;AAEtK,eAAO,MAAM,gBAAgB,cAAsb,CAAC;AAEpd,eAAO,MAAM,kBAAkB,cAAkf,CAAC;AAElhB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Breadcrumbs/Breadcrumbs.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA2F,CAAC;AAEhH,eAAO,MAAM,mBAAmB,cAAqI,CAAC;AAEtK,eAAO,MAAM,gBAAgB,cAAsb,CAAC;AAEpd,eAAO,MAAM,cAAc,cAAgT,CAAC;AAE5U,eAAO,MAAM,UAAU,cAA0P,CAAC;AAElR,eAAO,MAAM,kBAAkB,cAAkf,CAAC;AAElhB,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
export const Default = () => "export const Default = () => (\n <Box p={4}>\n <Breadcrumbs />\n </Box>\n);";
|
|
4
4
|
export const WithCustomRootLabel = () => "export const WithCustomRootLabel = () => (\n <Box p={4}>\n <Breadcrumbs rootLabel=\"Tableau de bord\" />\n </Box>\n);";
|
|
5
5
|
export const WithCustomLabels = () => "export const WithCustomLabels = () => (\n <Box p={4}>\n <Breadcrumbs\n getLabel={(segment, _index, _path) => {\n const labels: Record<string, string> = {\n admin: 'Administration',\n missions: 'Missions',\n show: 'Détail',\n salarie: 'Espace salarié',\n client: 'Espace client',\n };\n return labels[segment] ?? segment;\n }}\n />\n </Box>\n);";
|
|
6
|
+
export const WithCustomHref = () => "export const WithCustomHref = () => (\n <Box p={4}>\n <Breadcrumbs\n getHref={(segment, _index, path) => {\n const hrefs: Record<string, string> = {\n components: '/ui-kit/components',\n };\n return hrefs[segment] ?? path;\n }}\n />\n </Box>\n);";
|
|
7
|
+
export const WithNoLink = () => "export const WithNoLink = () => (\n <Box p={4}>\n <Breadcrumbs\n getHref={(segment, _index, path) => {\n const noLink = ['components'];\n return noLink.includes(segment) ? null : path;\n }}\n />\n </Box>\n);";
|
|
6
8
|
export const WithSegmentsToSkip = () => "export const WithSegmentsToSkip = () => (\n <Box p={4}>\n <Breadcrumbs\n segmentsToSkip={['admin', 'ui-kit', 'components']}\n getLabel={(segment, _index, _path) => {\n const labels: Record<string, string> = {\n admin: 'Administration',\n missions: 'Missions',\n show: 'Détail',\n salarie: 'Espace salarié',\n client: 'Espace client',\n };\n return labels[segment] ?? segment;\n }}\n />\n </Box>\n);";
|
|
7
9
|
export const storySources = {
|
|
8
10
|
Default,
|
|
9
11
|
WithCustomRootLabel,
|
|
10
12
|
WithCustomLabels,
|
|
13
|
+
WithCustomHref,
|
|
14
|
+
WithNoLink,
|
|
11
15
|
WithSegmentsToSkip,
|
|
12
16
|
};
|
|
@@ -18,7 +18,7 @@ declare const _default: {
|
|
|
18
18
|
signatureWeb: {
|
|
19
19
|
borderColor: "#DEE3EC";
|
|
20
20
|
borderWidth: number;
|
|
21
|
-
borderRadius: import("@alveole/theme").
|
|
21
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
22
22
|
};
|
|
23
23
|
headerSignature: {
|
|
24
24
|
display: "flex";
|
|
@@ -11,7 +11,7 @@ export declare const useStyles: () => {
|
|
|
11
11
|
signatureWeb: {
|
|
12
12
|
borderColor: "#DEE3EC";
|
|
13
13
|
borderWidth: number;
|
|
14
|
-
borderRadius: import("@alveole/theme").
|
|
14
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
15
15
|
};
|
|
16
16
|
headerSignature: {
|
|
17
17
|
display: "flex";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
export const useStyles = makeStyles(({ color,
|
|
2
|
+
export const useStyles = makeStyles(({ color, text, radius }) => ({
|
|
3
3
|
container: {
|
|
4
4
|
width: '100%',
|
|
5
5
|
display: 'flex',
|
|
6
6
|
flexDirection: 'column',
|
|
7
7
|
},
|
|
8
8
|
pen: {
|
|
9
|
-
color: color.text['default-grey'],
|
|
9
|
+
color: color.light.text['default-grey'],
|
|
10
10
|
backgroundColor: '#FFFFFF',
|
|
11
11
|
},
|
|
12
12
|
signatureWeb: {
|
|
13
|
-
borderColor: color.border['default-grey'],
|
|
13
|
+
borderColor: color.light.border['default-grey'],
|
|
14
14
|
borderWidth: 2,
|
|
15
|
-
borderRadius:
|
|
15
|
+
borderRadius: radius('lg'),
|
|
16
16
|
},
|
|
17
17
|
headerSignature: {
|
|
18
18
|
display: 'flex',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alveole/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Shared UI components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"pdfjs-dist": "^4.10.38",
|
|
48
48
|
"react": "^19.2.5",
|
|
49
49
|
"react-dom": "^19.2.5",
|
|
50
|
-
"react-native": "^0.
|
|
50
|
+
"react-native": "^0.80.0",
|
|
51
51
|
"react-native-code-highlighter": "1.3.0",
|
|
52
52
|
"react-syntax-highlighter": "16.1.1",
|
|
53
53
|
"react-test-renderer": "^19.2.5",
|