@alveole/components 0.22.1 → 0.23.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/core/Map/Map.d.ts +3 -0
- package/dist/core/Map/Map.d.ts.map +1 -0
- package/dist/core/Map/Map.js +5 -0
- package/dist/core/Map/Map.props.d.ts +57 -0
- package/dist/core/Map/Map.props.d.ts.map +1 -0
- package/dist/core/Map/Map.props.js +18 -0
- package/dist/core/Map/Map.stories.d.ts +38 -0
- package/dist/core/Map/Map.stories.d.ts.map +1 -0
- package/dist/core/Map/Map.stories.js +30 -0
- package/dist/core/Map/Map.styles.d.ts +9 -0
- package/dist/core/Map/Map.styles.d.ts.map +1 -0
- package/dist/core/Map/Map.styles.js +9 -0
- package/dist/core/Map/Map.web.d.ts +12 -0
- package/dist/core/Map/Map.web.d.ts.map +1 -0
- package/dist/core/Map/Map.web.js +134 -0
- package/dist/core/Map/index.d.ts +3 -0
- package/dist/core/Map/index.d.ts.map +1 -0
- package/dist/core/Map/index.js +2 -0
- package/dist/core/Metabase/Metabase.d.ts +1 -9
- package/dist/core/Metabase/Metabase.d.ts.map +1 -1
- package/dist/core/Metabase/Metabase.props.d.ts +10 -0
- package/dist/core/Metabase/Metabase.props.d.ts.map +1 -0
- package/dist/core/Metabase/Metabase.props.js +1 -0
- package/dist/core/Metabase/Metabase.stories.d.ts +1 -1
- package/dist/core/Metabase/Metabase.web.d.ts +1 -6
- package/dist/core/Metabase/Metabase.web.d.ts.map +1 -1
- package/dist/core/Page/PageContentScrollable.d.ts +1 -1
- package/dist/core/PdfViewer/PdfViewer.d.ts +3 -0
- package/dist/core/PdfViewer/PdfViewer.d.ts.map +1 -0
- package/dist/core/PdfViewer/PdfViewer.js +8 -0
- package/dist/core/PdfViewer/PdfViewer.props.d.ts +9 -0
- package/dist/core/PdfViewer/PdfViewer.props.d.ts.map +1 -0
- package/dist/core/PdfViewer/PdfViewer.props.js +1 -0
- package/dist/core/PdfViewer/PdfViewer.stories.d.ts +13 -0
- package/dist/core/PdfViewer/PdfViewer.stories.d.ts.map +1 -0
- package/dist/core/PdfViewer/PdfViewer.stories.js +16 -0
- package/dist/core/PdfViewer/PdfViewer.styles.d.ts +2 -0
- package/dist/core/PdfViewer/PdfViewer.styles.d.ts.map +1 -0
- package/dist/core/PdfViewer/PdfViewer.styles.js +2 -0
- package/dist/core/PdfViewer/PdfViewer.web.d.ts +3 -0
- package/dist/core/PdfViewer/PdfViewer.web.d.ts.map +1 -0
- package/dist/core/PdfViewer/PdfViewer.web.js +6 -0
- package/dist/core/PdfViewer/index.d.ts +3 -0
- package/dist/core/PdfViewer/index.d.ts.map +1 -0
- package/dist/core/PdfViewer/index.js +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/stories/index.d.ts +5 -0
- package/dist/stories/index.d.ts.map +1 -1
- package/dist/stories/index.js +5 -0
- package/dist/ui/Badge/Badge.d.ts +9 -0
- package/dist/ui/Badge/Badge.d.ts.map +1 -0
- package/dist/ui/Badge/Badge.js +34 -0
- package/dist/ui/Badge/Badge.stories.d.ts +67 -0
- package/dist/ui/Badge/Badge.stories.d.ts.map +1 -0
- package/dist/ui/Badge/Badge.stories.js +16 -0
- package/dist/ui/Badge/Badge.styles.d.ts +55 -0
- package/dist/ui/Badge/Badge.styles.d.ts.map +1 -0
- package/dist/ui/Badge/Badge.styles.js +49 -0
- package/dist/ui/Badge/index.d.ts +2 -0
- package/dist/ui/Badge/index.d.ts.map +1 -0
- package/dist/ui/Badge/index.js +1 -0
- package/dist/ui/Sidebar/Sidebar.d.ts +11 -0
- package/dist/ui/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/ui/Sidebar/Sidebar.js +30 -0
- package/dist/ui/Sidebar/Sidebar.stories.d.ts +182 -0
- package/dist/ui/Sidebar/Sidebar.stories.d.ts.map +1 -0
- package/dist/ui/Sidebar/Sidebar.stories.js +27 -0
- package/dist/ui/Sidebar/Sidebar.styles.d.ts +172 -0
- package/dist/ui/Sidebar/Sidebar.styles.d.ts.map +1 -0
- package/dist/ui/Sidebar/Sidebar.styles.js +148 -0
- package/dist/ui/Sidebar/SidebarFooter.d.ts +4 -0
- package/dist/ui/Sidebar/SidebarFooter.d.ts.map +1 -0
- package/dist/ui/Sidebar/SidebarFooter.js +7 -0
- package/dist/ui/Sidebar/SidebarGroup.d.ts +6 -0
- package/dist/ui/Sidebar/SidebarGroup.d.ts.map +1 -0
- package/dist/ui/Sidebar/SidebarGroup.js +20 -0
- package/dist/ui/Sidebar/SidebarHeader.d.ts +8 -0
- package/dist/ui/Sidebar/SidebarHeader.d.ts.map +1 -0
- package/dist/ui/Sidebar/SidebarHeader.js +26 -0
- package/dist/ui/Sidebar/SidebarItem.d.ts +19 -0
- package/dist/ui/Sidebar/SidebarItem.d.ts.map +1 -0
- package/dist/ui/Sidebar/SidebarItem.js +48 -0
- package/dist/ui/Sidebar/index.d.ts +4 -1
- package/dist/ui/Sidebar/index.d.ts.map +1 -1
- package/dist/ui/Sidebar/index.js +4 -1
- package/dist/ui/Tag/Tag.d.ts +10 -0
- package/dist/ui/Tag/Tag.d.ts.map +1 -0
- package/dist/ui/Tag/Tag.js +17 -0
- package/dist/ui/Tag/Tag.stories.d.ts +48 -0
- package/dist/ui/Tag/Tag.stories.d.ts.map +1 -0
- package/dist/ui/Tag/Tag.stories.js +15 -0
- package/dist/ui/Tag/Tag.styles.d.ts +37 -0
- package/dist/ui/Tag/Tag.styles.d.ts.map +1 -0
- package/dist/ui/Tag/Tag.styles.js +33 -0
- package/dist/ui/Tag/index.d.ts +2 -0
- package/dist/ui/Tag/index.d.ts.map +1 -0
- package/dist/ui/Tag/index.js +1 -0
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +1 -0
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.stories.js +2 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -0
- package/package.json +3 -2
package/dist/stories/index.js
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
export * as AStory from '../core/A/A.stories';
|
|
3
3
|
export * as BoxStory from '../core/Box/Box.stories';
|
|
4
4
|
export * as ImageStory from '../core/Image/Image.stories';
|
|
5
|
+
export * as MapStory from '../core/Map/Map.stories';
|
|
5
6
|
export * as MetabaseStory from '../core/Metabase/Metabase.stories';
|
|
6
7
|
export * as PageStory from '../core/Page/Page.stories';
|
|
8
|
+
export * as PdfViewerStory from '../core/PdfViewer/PdfViewer.stories';
|
|
7
9
|
export * as SectionStory from '../core/Section/Section.stories';
|
|
8
10
|
export * as TypographyStory from '../core/Typography/Typography.stories';
|
|
9
11
|
export * as VersionStory from '../core/Version/Version.stories';
|
|
10
12
|
// UI
|
|
11
13
|
export * as AvatarStory from '../ui/Avatar/Avatar.stories';
|
|
14
|
+
export * as BadgeStory from '../ui/Badge/Badge.stories';
|
|
12
15
|
export * as BreadcrumbsStory from '../ui/Breadcrumbs/Breadcrumbs.stories';
|
|
13
16
|
export * as ButtonStory from '../ui/Button/Button.stories';
|
|
14
17
|
export * as CardStory from '../ui/Card/Card.stories';
|
|
@@ -18,5 +21,7 @@ export * as ListItemStory from '../ui/ListItem/ListItem.stories';
|
|
|
18
21
|
export * as LucideIconStory from '../ui/LucideIcon/LucideIcon.stories';
|
|
19
22
|
export * as PageHeaderStory from '../ui/PageHeader/PageHeader.stories';
|
|
20
23
|
export * as ResourceListStory from '../ui/ResourceList/ResourceList.stories';
|
|
24
|
+
export * as SidebarStory from '../ui/Sidebar/Sidebar.stories';
|
|
25
|
+
export * as TagStory from '../ui/Tag/Tag.stories';
|
|
21
26
|
export * as ToolbarBottomNavStory from '../ui/ToolbarBottomNav/ToolbarBottomNav.stories';
|
|
22
27
|
export * as ToolbarTopStory from '../ui/ToolbarTop/ToolbarTop.stories';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypographyProps } from '../../core/Typography';
|
|
2
|
+
import { LucideIconProps } from '../LucideIcon';
|
|
3
|
+
export type BadgeProps = TypographyProps & {
|
|
4
|
+
variant: 'default' | 'info' | 'success' | 'error' | 'new' | 'warning';
|
|
5
|
+
size: 'sm' | 'md';
|
|
6
|
+
icon?: LucideIconProps['name'];
|
|
7
|
+
};
|
|
8
|
+
export declare const Badge: (props: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAG5D,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG;IACzC,OAAO,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IACtE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CAChC,CAAC;AACF,eAAO,MAAM,KAAK,GAAI,OAAO,UAAU,4CAoCtC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../../core';
|
|
3
|
+
import { Typography } from '../../core/Typography';
|
|
4
|
+
import { LucideIcon } from '../LucideIcon';
|
|
5
|
+
import { useStyles } from './Badge.styles';
|
|
6
|
+
export const Badge = (props) => {
|
|
7
|
+
const { variant, style, size, icon, ...badgeProps } = props;
|
|
8
|
+
const styles = useStyles();
|
|
9
|
+
const badgeSize = size === 'sm' ? styles.badgeSm : styles.badgeMd;
|
|
10
|
+
const badgeVariant = () => {
|
|
11
|
+
switch (variant) {
|
|
12
|
+
case 'default':
|
|
13
|
+
return styles.badgeDefault;
|
|
14
|
+
case 'success':
|
|
15
|
+
return styles.badgeSuccess;
|
|
16
|
+
case 'warning':
|
|
17
|
+
return styles.badgeWarning;
|
|
18
|
+
case 'error':
|
|
19
|
+
return styles.badgeError;
|
|
20
|
+
case 'info':
|
|
21
|
+
return styles.badgeInfo;
|
|
22
|
+
case 'new':
|
|
23
|
+
return styles.badgeNew;
|
|
24
|
+
default:
|
|
25
|
+
((_) => { })(variant);
|
|
26
|
+
}
|
|
27
|
+
return {};
|
|
28
|
+
};
|
|
29
|
+
if (icon) {
|
|
30
|
+
const iconSize = size === 'sm' ? 'xs' : 'sm';
|
|
31
|
+
return (_jsxs(Box, { tag: "badge", style: [styles.badge, badgeVariant(), badgeSize, style], children: [_jsx(LucideIcon, { name: icon, size: iconSize }), _jsx(Typography, { tag: "badge-text", ...badgeProps })] }));
|
|
32
|
+
}
|
|
33
|
+
return _jsx(Typography, { tag: "badge", style: [styles.badge, badgeVariant(), badgeSize, style], ...badgeProps });
|
|
34
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: ["Kit"];
|
|
4
|
+
experimental: false;
|
|
5
|
+
figmaURL: string;
|
|
6
|
+
description: string;
|
|
7
|
+
component: (props: import("./Badge").BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
styleFn: () => {
|
|
9
|
+
badge: {
|
|
10
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
11
|
+
marginRight: string;
|
|
12
|
+
display: "flex";
|
|
13
|
+
flexDirection: "row";
|
|
14
|
+
alignItems: "center";
|
|
15
|
+
justifyContent: "center";
|
|
16
|
+
};
|
|
17
|
+
badgeInfo: {
|
|
18
|
+
color: "#0264C7";
|
|
19
|
+
backgroundColor: "#E5F1FE";
|
|
20
|
+
};
|
|
21
|
+
badgeSuccess: {
|
|
22
|
+
color: "#1B7440";
|
|
23
|
+
backgroundColor: "#B9FDD5";
|
|
24
|
+
};
|
|
25
|
+
badgeError: {
|
|
26
|
+
color: "#C62416";
|
|
27
|
+
backgroundColor: "#FDEAE8";
|
|
28
|
+
};
|
|
29
|
+
badgeWarning: {
|
|
30
|
+
color: "#B34000";
|
|
31
|
+
backgroundColor: "#FFE9E6";
|
|
32
|
+
};
|
|
33
|
+
badgeNew: {
|
|
34
|
+
color: "#7F4214";
|
|
35
|
+
backgroundColor: "#FBF2C6";
|
|
36
|
+
};
|
|
37
|
+
badgeDefault: {
|
|
38
|
+
color: "#373A3F";
|
|
39
|
+
backgroundColor: "#EFF1F6";
|
|
40
|
+
};
|
|
41
|
+
badgeSm: {
|
|
42
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
43
|
+
fontSize: 12;
|
|
44
|
+
lineHeight: 20;
|
|
45
|
+
letterSpacing: 0;
|
|
46
|
+
textTransform: "uppercase";
|
|
47
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
48
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
49
|
+
gap: import("@alveole/theme").Spacing;
|
|
50
|
+
};
|
|
51
|
+
badgeMd: {
|
|
52
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
53
|
+
fontSize: 14;
|
|
54
|
+
lineHeight: 20;
|
|
55
|
+
letterSpacing: 0;
|
|
56
|
+
textTransform: "uppercase";
|
|
57
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
58
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
59
|
+
gap: import("@alveole/theme").Spacing;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export default _default;
|
|
64
|
+
export declare const Variants: () => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export declare const Sizes: () => import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare const Icons: () => import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
//# sourceMappingURL=Badge.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAElB,eAAO,MAAM,QAAQ,+CAuBpB,CAAC;AAEF,eAAO,MAAM,KAAK,+CASjB,CAAC;AAEF,eAAO,MAAM,KAAK,+CAMjB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../../core';
|
|
3
|
+
import { Badge } from './Badge';
|
|
4
|
+
import { useStyles } from './Badge.styles';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Badge',
|
|
7
|
+
tags: ['Kit'],
|
|
8
|
+
experimental: false,
|
|
9
|
+
figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Composants?node-id=1002-547',
|
|
10
|
+
description: 'Différents variants de badges. Composant de type Typography.',
|
|
11
|
+
component: Badge,
|
|
12
|
+
styleFn: useStyles,
|
|
13
|
+
};
|
|
14
|
+
export const Variants = () => (_jsx(Box, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: 4, children: [_jsx(Badge, { size: "md", variant: "default", children: "Badge default" }), _jsx(Badge, { size: "md", variant: "info", children: "Badge info" }), _jsx(Badge, { size: "md", variant: "error", children: "Badge error" }), _jsx(Badge, { size: "md", variant: "new", children: "Badge new" }), _jsx(Badge, { size: "md", variant: "success", children: "Badge success" }), _jsx(Badge, { size: "md", variant: "warning", children: "Badge warning" })] }) }));
|
|
15
|
+
export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: [_jsx(Badge, { size: "sm", variant: "info", m: "auto", children: "Badge small" }), _jsx(Badge, { size: "md", variant: "info", children: "Badge medium" })] }));
|
|
16
|
+
export const Icons = () => (_jsx(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: _jsx(Badge, { size: "sm", variant: "info", icon: "Check", children: "Badge small" }) }));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
badge: {
|
|
3
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
4
|
+
marginRight: string;
|
|
5
|
+
display: "flex";
|
|
6
|
+
flexDirection: "row";
|
|
7
|
+
alignItems: "center";
|
|
8
|
+
justifyContent: "center";
|
|
9
|
+
};
|
|
10
|
+
badgeInfo: {
|
|
11
|
+
color: "#0264C7";
|
|
12
|
+
backgroundColor: "#E5F1FE";
|
|
13
|
+
};
|
|
14
|
+
badgeSuccess: {
|
|
15
|
+
color: "#1B7440";
|
|
16
|
+
backgroundColor: "#B9FDD5";
|
|
17
|
+
};
|
|
18
|
+
badgeError: {
|
|
19
|
+
color: "#C62416";
|
|
20
|
+
backgroundColor: "#FDEAE8";
|
|
21
|
+
};
|
|
22
|
+
badgeWarning: {
|
|
23
|
+
color: "#B34000";
|
|
24
|
+
backgroundColor: "#FFE9E6";
|
|
25
|
+
};
|
|
26
|
+
badgeNew: {
|
|
27
|
+
color: "#7F4214";
|
|
28
|
+
backgroundColor: "#FBF2C6";
|
|
29
|
+
};
|
|
30
|
+
badgeDefault: {
|
|
31
|
+
color: "#373A3F";
|
|
32
|
+
backgroundColor: "#EFF1F6";
|
|
33
|
+
};
|
|
34
|
+
badgeSm: {
|
|
35
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
36
|
+
fontSize: 12;
|
|
37
|
+
lineHeight: 20;
|
|
38
|
+
letterSpacing: 0;
|
|
39
|
+
textTransform: "uppercase";
|
|
40
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
41
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
42
|
+
gap: import("@alveole/theme").Spacing;
|
|
43
|
+
};
|
|
44
|
+
badgeMd: {
|
|
45
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
46
|
+
fontSize: 14;
|
|
47
|
+
lineHeight: 20;
|
|
48
|
+
letterSpacing: 0;
|
|
49
|
+
textTransform: "uppercase";
|
|
50
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
51
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
52
|
+
gap: import("@alveole/theme").Spacing;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=Badge.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/Badge.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDnB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { makeStyles } from '@alveole/theme';
|
|
2
|
+
export const useStyles = makeStyles(({ radius, text, color, spacing }) => ({
|
|
3
|
+
badge: {
|
|
4
|
+
borderRadius: radius('sm'),
|
|
5
|
+
marginRight: 'auto',
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
},
|
|
11
|
+
// Variants
|
|
12
|
+
badgeInfo: {
|
|
13
|
+
color: color.light.text['default-info'],
|
|
14
|
+
backgroundColor: color.light.background['contrast-info'],
|
|
15
|
+
},
|
|
16
|
+
badgeSuccess: {
|
|
17
|
+
color: color.light.text['default-success'],
|
|
18
|
+
backgroundColor: color.light.background['contrast-success'],
|
|
19
|
+
},
|
|
20
|
+
badgeError: {
|
|
21
|
+
color: color.light.text['default-error'],
|
|
22
|
+
backgroundColor: color.light.background['contrast-error'],
|
|
23
|
+
},
|
|
24
|
+
badgeWarning: {
|
|
25
|
+
color: color.light.text['default-warning'],
|
|
26
|
+
backgroundColor: color.light.background['contrast-warning'],
|
|
27
|
+
},
|
|
28
|
+
badgeNew: {
|
|
29
|
+
color: color.text.badge.new,
|
|
30
|
+
backgroundColor: color.background.badge.new,
|
|
31
|
+
},
|
|
32
|
+
badgeDefault: {
|
|
33
|
+
color: color.light.text['default-grey'],
|
|
34
|
+
backgroundColor: color.light.background['contrast-grey'],
|
|
35
|
+
},
|
|
36
|
+
// Sizes
|
|
37
|
+
badgeSm: {
|
|
38
|
+
paddingLeft: spacing('1V'),
|
|
39
|
+
paddingRight: spacing('1,5V'),
|
|
40
|
+
gap: spacing('1V'),
|
|
41
|
+
...text['Corps de texte'].XS.CapsBold,
|
|
42
|
+
},
|
|
43
|
+
badgeMd: {
|
|
44
|
+
paddingLeft: spacing('1V'),
|
|
45
|
+
paddingRight: spacing('1W'),
|
|
46
|
+
gap: spacing('1V'),
|
|
47
|
+
...text['Corps de texte'].SM.CapsBold,
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Badge';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarController } from './useSidebar';
|
|
3
|
+
export declare const SidebarWidth = 286;
|
|
4
|
+
export declare const SidebarHeight = 58;
|
|
5
|
+
export type SidebarProps = React.PropsWithChildren & {
|
|
6
|
+
controller?: SidebarController;
|
|
7
|
+
logo: React.ReactNode;
|
|
8
|
+
footer?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const Sidebar: (props: SidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=Sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/ui/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,iBAAiB,GAAG;IACnD,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAuCF,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,4CAI1C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@alveole/theme';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScrollView } from 'react-native';
|
|
5
|
+
import { Box } from '../../core';
|
|
6
|
+
import { useStyles } from './Sidebar.styles';
|
|
7
|
+
import { SidebarFooter } from './SidebarFooter';
|
|
8
|
+
import { SidebarHeader } from './SidebarHeader';
|
|
9
|
+
export const SidebarWidth = 286;
|
|
10
|
+
export const SidebarHeight = 58;
|
|
11
|
+
const SidebarDesktop = (props) => {
|
|
12
|
+
const { children, controller, footer, logo } = props;
|
|
13
|
+
const styles = useStyles();
|
|
14
|
+
return (_jsx(Box, { tag: "sidebar", width: SidebarWidth, style: styles.sidebar, children: _jsxs(Box, { style: styles.sidebarContent, children: [_jsx(SidebarHeader, { controller: controller, logo: logo }), _jsx(ScrollView, { style: styles.scrollView, children: children }), footer && _jsx(SidebarFooter, { children: footer })] }) }));
|
|
15
|
+
};
|
|
16
|
+
const SidebarMobile = (props) => {
|
|
17
|
+
const { children, controller, footer, logo } = props;
|
|
18
|
+
const styles = useStyles();
|
|
19
|
+
const navWidth = React.useMemo(() => {
|
|
20
|
+
if (controller?.open)
|
|
21
|
+
return '100%';
|
|
22
|
+
return 0;
|
|
23
|
+
}, [controller?.open]);
|
|
24
|
+
return (_jsx(Box, { tag: "sidebar", width: navWidth, style: styles.sidebar, children: _jsxs(Box, { style: styles.sidebarContent, pb: '3V', pr: '3V', pl: '3V', children: [_jsx(SidebarHeader, { controller: controller, logo: logo }), _jsx(ScrollView, { style: styles.scrollView, children: children }), footer && controller?.open && _jsx(SidebarFooter, { children: footer })] }) }));
|
|
25
|
+
};
|
|
26
|
+
export const Sidebar = (props) => {
|
|
27
|
+
const { isVariant } = useTheme();
|
|
28
|
+
const mobileOrTablet = React.useMemo(() => isVariant('mobile') || isVariant('tablet'), [isVariant]);
|
|
29
|
+
return mobileOrTablet ? _jsx(SidebarMobile, { ...props }) : _jsx(SidebarDesktop, { ...props });
|
|
30
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: ["Composant"];
|
|
4
|
+
experimental: false;
|
|
5
|
+
figmaURL: string;
|
|
6
|
+
description: string;
|
|
7
|
+
component: (props: import("./Sidebar").SidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
styleFn: () => {
|
|
9
|
+
sidebar: {
|
|
10
|
+
backgroundColor: "#FFFFFF";
|
|
11
|
+
borderRightWidth: number;
|
|
12
|
+
borderColor: "#DEE3EC";
|
|
13
|
+
display: "flex";
|
|
14
|
+
flexDirection: "column";
|
|
15
|
+
alignItems: "flex-start";
|
|
16
|
+
alignSelf: "stretch";
|
|
17
|
+
};
|
|
18
|
+
header: {};
|
|
19
|
+
headerContent: {
|
|
20
|
+
display: "flex";
|
|
21
|
+
flexDirection: "row";
|
|
22
|
+
padding: import("@alveole/theme").Spacing;
|
|
23
|
+
};
|
|
24
|
+
logo: {
|
|
25
|
+
marginLeft: import("@alveole/theme").Spacing;
|
|
26
|
+
};
|
|
27
|
+
sidebarContent: {
|
|
28
|
+
flex: number;
|
|
29
|
+
justifyContent: "space-between";
|
|
30
|
+
width: "100%";
|
|
31
|
+
};
|
|
32
|
+
scrollView: {
|
|
33
|
+
flex: number;
|
|
34
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
35
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
36
|
+
zIndex: number;
|
|
37
|
+
backgroundColor: "#FFFFFF";
|
|
38
|
+
};
|
|
39
|
+
groupTitleDesktop: {
|
|
40
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
41
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
42
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
43
|
+
fontSize: 12;
|
|
44
|
+
lineHeight: 20;
|
|
45
|
+
letterSpacing: 0;
|
|
46
|
+
};
|
|
47
|
+
groupTitleMobile: {
|
|
48
|
+
color: "#5F6571";
|
|
49
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
50
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
51
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
52
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
53
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
54
|
+
fontSize: 16;
|
|
55
|
+
lineHeight: 24;
|
|
56
|
+
letterSpacing: 0;
|
|
57
|
+
};
|
|
58
|
+
sidebarItemDesktop: {
|
|
59
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
60
|
+
display: "flex";
|
|
61
|
+
flexDirection: "row";
|
|
62
|
+
alignItems: "center";
|
|
63
|
+
gap: import("@alveole/theme").Spacing;
|
|
64
|
+
padding: import("@alveole/theme").Spacing;
|
|
65
|
+
width: "100%";
|
|
66
|
+
color: "#151617";
|
|
67
|
+
stroke: "#151617";
|
|
68
|
+
};
|
|
69
|
+
sidebarItemMobile: {
|
|
70
|
+
display: "flex";
|
|
71
|
+
flexDirection: "row";
|
|
72
|
+
alignItems: "center";
|
|
73
|
+
gap: import("@alveole/theme").Spacing;
|
|
74
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
75
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
76
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
77
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
78
|
+
width: "100%";
|
|
79
|
+
color: "#151617";
|
|
80
|
+
stroke: "#151617";
|
|
81
|
+
};
|
|
82
|
+
sidebarItemSelectedDesktop: {
|
|
83
|
+
backgroundColor: "#EFF1F6";
|
|
84
|
+
};
|
|
85
|
+
sidebarItemSelectedMobile: {
|
|
86
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
87
|
+
backgroundColor: "#F2F9FF";
|
|
88
|
+
};
|
|
89
|
+
sidebarItemHover: {
|
|
90
|
+
backgroundColor: "#F4F6FA";
|
|
91
|
+
};
|
|
92
|
+
sidebarItemCurrentHover: {
|
|
93
|
+
backgroundColor: "#EFF1F6";
|
|
94
|
+
};
|
|
95
|
+
sidebarItemContainerDesktop: {
|
|
96
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
97
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
98
|
+
display: "flex";
|
|
99
|
+
flexDirection: "row";
|
|
100
|
+
cursor: "pointer";
|
|
101
|
+
marginLeft: import("@alveole/theme").Spacing;
|
|
102
|
+
marginRight: import("@alveole/theme").Spacing;
|
|
103
|
+
};
|
|
104
|
+
sidebarItemContainerMobile: {
|
|
105
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
106
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
107
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
108
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
109
|
+
gap: import("@alveole/theme").Spacing;
|
|
110
|
+
display: "flex";
|
|
111
|
+
flexDirection: "row";
|
|
112
|
+
cursor: "pointer";
|
|
113
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
114
|
+
marginLeft: import("@alveole/theme").Spacing;
|
|
115
|
+
marginRight: import("@alveole/theme").Spacing;
|
|
116
|
+
};
|
|
117
|
+
sidebarItemTitleSelectedDesktop: {
|
|
118
|
+
color: "#373A3F";
|
|
119
|
+
stroke: "#373A3F";
|
|
120
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
121
|
+
fontSize: 16;
|
|
122
|
+
lineHeight: 24;
|
|
123
|
+
letterSpacing: 0;
|
|
124
|
+
};
|
|
125
|
+
sidebarItemTitleSelectedMobile: {
|
|
126
|
+
color: "#D81B38";
|
|
127
|
+
stroke: "#D81B38";
|
|
128
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
129
|
+
fontSize: 16;
|
|
130
|
+
lineHeight: 24;
|
|
131
|
+
letterSpacing: 0;
|
|
132
|
+
};
|
|
133
|
+
sidebarItemIconSelectedMobile: {
|
|
134
|
+
color: "#D81B38";
|
|
135
|
+
};
|
|
136
|
+
sidebarItemTitleDesktop: {
|
|
137
|
+
color: "#151617";
|
|
138
|
+
stroke: "#151617";
|
|
139
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
140
|
+
fontSize: 16;
|
|
141
|
+
lineHeight: 24;
|
|
142
|
+
letterSpacing: 0;
|
|
143
|
+
};
|
|
144
|
+
sidebarItemTitleMobile: {
|
|
145
|
+
color: "#373A3F";
|
|
146
|
+
stroke: "#373A3F";
|
|
147
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
148
|
+
fontSize: 16;
|
|
149
|
+
lineHeight: 24;
|
|
150
|
+
letterSpacing: 0;
|
|
151
|
+
};
|
|
152
|
+
sidebarItemTitleCurrentHoverDesktop: {
|
|
153
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
154
|
+
fontSize: 16;
|
|
155
|
+
lineHeight: 24;
|
|
156
|
+
letterSpacing: 0;
|
|
157
|
+
};
|
|
158
|
+
sidebarItemTitleCurrentHoverMobile: {
|
|
159
|
+
color: "#002764";
|
|
160
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
161
|
+
fontSize: 16;
|
|
162
|
+
lineHeight: 24;
|
|
163
|
+
letterSpacing: 0;
|
|
164
|
+
};
|
|
165
|
+
sidebarItemSelectedIndicator: {
|
|
166
|
+
height: "100%";
|
|
167
|
+
width: import("@alveole/theme").Spacing;
|
|
168
|
+
position: "absolute";
|
|
169
|
+
left: number;
|
|
170
|
+
};
|
|
171
|
+
sidebarItemSelectedIndicatorContent: {
|
|
172
|
+
width: "100%";
|
|
173
|
+
minHeight: import("@alveole/theme").Spacing;
|
|
174
|
+
backgroundColor: "#0264C7";
|
|
175
|
+
margin: string;
|
|
176
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
export default _default;
|
|
181
|
+
export declare const ExampleUsage: () => import("react/jsx-runtime").JSX.Element;
|
|
182
|
+
//# sourceMappingURL=Sidebar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Sidebar/Sidebar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAgBlB,eAAO,MAAM,YAAY,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Typography } from '../../core';
|
|
3
|
+
import { Sidebar } from './Sidebar';
|
|
4
|
+
import { useStyles } from './Sidebar.styles';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Sidebar',
|
|
7
|
+
tags: ['Composant'],
|
|
8
|
+
experimental: false,
|
|
9
|
+
figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1328-725',
|
|
10
|
+
description: 'SideNav est un composant de navigation primaire qui permet d’accéder aux principales sections d’une application. Navigation coté droit, se transformant en menu burger sur mobile. Uitliser <SidebarItem> et <SidebarGroup>.',
|
|
11
|
+
component: Sidebar,
|
|
12
|
+
styleFn: useStyles,
|
|
13
|
+
};
|
|
14
|
+
const codeExample = `<Sidebar
|
|
15
|
+
controller={sidebarController}
|
|
16
|
+
logo={<Image source={require('../../assets/logo.png')} />}
|
|
17
|
+
footer={<Button borderNone variant="tertiary" title="Se déconnecter" onPress={onLogout} />}
|
|
18
|
+
>
|
|
19
|
+
<SidebarItem title="Item 1" href="/admin/item-1" routeName="item-1" />
|
|
20
|
+
<SidebarItem title="Item 2" href="/admin/item-2" routeName="item-2" />
|
|
21
|
+
|
|
22
|
+
<SidebarGroup title="Groupe">
|
|
23
|
+
<SidebarItem title="Item group 1" href="/admin/gp-item-2" routeName="gp-item-1" />
|
|
24
|
+
<SidebarItem title="Item group 2" href="/admin/gp-item-2" routeName="gp-item-2" />
|
|
25
|
+
</SidebarGroup>
|
|
26
|
+
</Sidebar>`;
|
|
27
|
+
export const ExampleUsage = () => _jsx(Typography, { children: codeExample });
|