@alveole/components 0.22.1 → 0.23.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/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/Button/Button.d.ts.map +1 -1
- package/dist/ui/Button/Button.js +10 -2
- package/dist/ui/Button/Button.stories.d.ts +13 -0
- package/dist/ui/Button/Button.stories.d.ts.map +1 -1
- package/dist/ui/Button/Button.styles.d.ts +13 -0
- package/dist/ui/Button/Button.styles.d.ts.map +1 -1
- package/dist/ui/Button/Button.styles.js +13 -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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA0C,cAAc,EAA8B,IAAI,EAAE,MAAM,cAAc,CAAC;AACxH,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAOtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IACvD,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM;WAdV,MAAM;WACN,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;aACvB,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM;gBAC1C,SAAS,CAAC,MAAM,CAAC;cACnB,SAAS,CAAC,MAAM,CAAC;qBACV,QAAQ;gBACb,OAAO;gBACP,OAAO;iBACN,OAAO;gBACR,OAAO;WACZ,QAAQ,GAAG,QAAQ;gBACd,OAAO;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA0C,cAAc,EAA8B,IAAI,EAAE,MAAM,cAAc,CAAC;AACxH,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAOtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;IACvD,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM;WAdV,MAAM;WACN,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;aACvB,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM;gBAC1C,SAAS,CAAC,MAAM,CAAC;cACnB,SAAS,CAAC,MAAM,CAAC;qBACV,QAAQ;gBACb,OAAO;gBACP,OAAO;iBACN,OAAO;gBACR,OAAO;WACZ,QAAQ,GAAG,QAAQ;gBACd,OAAO;8BAoLnB,CAAC"}
|
package/dist/ui/Button/Button.js
CHANGED
|
@@ -17,7 +17,7 @@ export const Button = React.forwardRef(function Button(props, ref) {
|
|
|
17
17
|
: styles.mdContainer;
|
|
18
18
|
const titleSize = size === 'sm' ? styles.smTitle : size === 'lg' ? styles.lgTitle : size === 'xs' ? styles.xsTitle : styles.mdTitle;
|
|
19
19
|
const noPaddingStyle = { paddingTop: 0, paddingBottom: 0, paddingLeft: 0, paddingRight: 0 };
|
|
20
|
-
const buttonContainerStyle = () => {
|
|
20
|
+
const buttonContainerStyle = (state) => {
|
|
21
21
|
let applicableStyles = {
|
|
22
22
|
...styles.container,
|
|
23
23
|
...(startIcon
|
|
@@ -39,21 +39,29 @@ export const Button = React.forwardRef(function Button(props, ref) {
|
|
|
39
39
|
applicableStyles = { ...applicableStyles, ...styles.primaryContainer };
|
|
40
40
|
if (disabled)
|
|
41
41
|
applicableStyles = { ...applicableStyles, ...styles.primaryContainerDisabled };
|
|
42
|
+
else if (state?.pressed)
|
|
43
|
+
applicableStyles = { ...applicableStyles, ...styles.primaryContainerPressed };
|
|
42
44
|
}
|
|
43
45
|
else if (variant === 'secondary') {
|
|
44
46
|
applicableStyles = { ...applicableStyles, ...styles.secondaryContainer };
|
|
45
47
|
if (disabled)
|
|
46
48
|
applicableStyles = { ...applicableStyles, ...styles.secondaryContainerDisabled };
|
|
49
|
+
else if (state?.pressed)
|
|
50
|
+
applicableStyles = { ...applicableStyles, ...styles.secondaryContainerPressed };
|
|
47
51
|
}
|
|
48
52
|
else if (variant === 'tertiary') {
|
|
49
53
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainer };
|
|
50
54
|
if (disabled)
|
|
51
55
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerDisabled };
|
|
56
|
+
else if (state?.pressed)
|
|
57
|
+
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerPressed };
|
|
52
58
|
}
|
|
53
59
|
else if (variant === 'link') {
|
|
54
60
|
applicableStyles = { ...applicableStyles, ...styles.linkContainer };
|
|
55
61
|
if (disabled)
|
|
56
62
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerDisabled };
|
|
63
|
+
else if (state?.pressed)
|
|
64
|
+
applicableStyles = { ...applicableStyles, ...styles.linkContainerPressed };
|
|
57
65
|
}
|
|
58
66
|
return {
|
|
59
67
|
...applicableStyles,
|
|
@@ -152,5 +160,5 @@ export const Button = React.forwardRef(function Button(props, ref) {
|
|
|
152
160
|
: {}),
|
|
153
161
|
...(disabled ? { borderWidth: 0 } : {}),
|
|
154
162
|
};
|
|
155
|
-
return (_jsx(Pressable, { ref: ref, disabled: disabled, accessibilityRole: "button", ...(type === 'submit' ? { 'aria-selected': true } : {}), ...(fullWidth ? { style: { width: '100%' } } : {}), ...buttonProps, style: [pressableStyle], children: (state) => (_jsxs(Box, { style: [buttonContainerStyle(), style], hoverStyle: { ...buttonContainerHoverStyle(), ...hoverStyle }, ...containerProps, children: [startIcon && _jsx(LucideIcon, { name: startIcon, ...iconStyle({ hovered: !!state.hovered }) }), _jsx(Typography, { "user-select": false, style: textStyle({ hovered: !!state.hovered }), children: title }), isLoading ? (_jsx(ActivityIndicator, { size: "small", style: styles.buttonLoader })) : (endIcon && _jsx(LucideIcon, { name: endIcon, ...iconStyle({ hovered: !!state.hovered }) }))] })) }));
|
|
163
|
+
return (_jsx(Pressable, { ref: ref, disabled: disabled, accessibilityRole: "button", ...(type === 'submit' ? { 'aria-selected': true } : {}), ...(fullWidth ? { style: { width: '100%' } } : {}), ...buttonProps, style: [pressableStyle], children: (state) => (_jsxs(Box, { style: [buttonContainerStyle({ pressed: state.pressed }), style], hoverStyle: { ...buttonContainerHoverStyle(), ...hoverStyle }, ...containerProps, children: [startIcon && _jsx(LucideIcon, { name: startIcon, ...iconStyle({ hovered: !!state.hovered }) }), _jsx(Typography, { "user-select": false, style: textStyle({ hovered: !!state.hovered }), children: title }), isLoading ? (_jsx(ActivityIndicator, { size: "small", style: styles.buttonLoader })) : (endIcon && _jsx(LucideIcon, { name: endIcon, ...iconStyle({ hovered: !!state.hovered }) }))] })) }));
|
|
156
164
|
});
|
|
@@ -56,6 +56,9 @@ declare const _default: {
|
|
|
56
56
|
primaryContainerHover: {
|
|
57
57
|
backgroundColor: "#0048AC";
|
|
58
58
|
};
|
|
59
|
+
primaryContainerPressed: {
|
|
60
|
+
backgroundColor: "#0048AC";
|
|
61
|
+
};
|
|
59
62
|
secondaryTitle: {
|
|
60
63
|
color: "#151617";
|
|
61
64
|
};
|
|
@@ -72,6 +75,10 @@ declare const _default: {
|
|
|
72
75
|
borderColor: "#DEE3EC";
|
|
73
76
|
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
74
77
|
};
|
|
78
|
+
secondaryContainerPressed: {
|
|
79
|
+
borderColor: "#DEE3EC";
|
|
80
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
81
|
+
};
|
|
75
82
|
tertiaryTitle: {
|
|
76
83
|
color: "#151617";
|
|
77
84
|
};
|
|
@@ -82,6 +89,9 @@ declare const _default: {
|
|
|
82
89
|
tertiaryContainerHover: {
|
|
83
90
|
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
84
91
|
};
|
|
92
|
+
tertiaryContainerPressed: {
|
|
93
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
94
|
+
};
|
|
85
95
|
linkTitle: {
|
|
86
96
|
color: "#076D8A";
|
|
87
97
|
};
|
|
@@ -94,6 +104,9 @@ declare const _default: {
|
|
|
94
104
|
linkContainerHover: {
|
|
95
105
|
backgroundColor: "transparent";
|
|
96
106
|
};
|
|
107
|
+
linkContainerPressed: {
|
|
108
|
+
backgroundColor: "transparent";
|
|
109
|
+
};
|
|
97
110
|
xsContainer: {
|
|
98
111
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
99
112
|
paddingRight: import("@alveole/theme").Spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,KAAK,+CAMjB,CAAC;AAEF,eAAO,MAAM,OAAO,+CAKnB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAKrB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAKpB,CAAC;AAEF,eAAO,MAAM,IAAI,+CAKhB,CAAC;AAEF,eAAO,MAAM,KAAK,+CAQjB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAIrB,CAAC"}
|
|
@@ -36,6 +36,9 @@ export declare const useStyles: () => {
|
|
|
36
36
|
primaryContainerHover: {
|
|
37
37
|
backgroundColor: "#0048AC";
|
|
38
38
|
};
|
|
39
|
+
primaryContainerPressed: {
|
|
40
|
+
backgroundColor: "#0048AC";
|
|
41
|
+
};
|
|
39
42
|
secondaryTitle: {
|
|
40
43
|
color: "#151617";
|
|
41
44
|
};
|
|
@@ -52,6 +55,10 @@ export declare const useStyles: () => {
|
|
|
52
55
|
borderColor: "#DEE3EC";
|
|
53
56
|
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
54
57
|
};
|
|
58
|
+
secondaryContainerPressed: {
|
|
59
|
+
borderColor: "#DEE3EC";
|
|
60
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
61
|
+
};
|
|
55
62
|
tertiaryTitle: {
|
|
56
63
|
color: "#151617";
|
|
57
64
|
};
|
|
@@ -62,6 +69,9 @@ export declare const useStyles: () => {
|
|
|
62
69
|
tertiaryContainerHover: {
|
|
63
70
|
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
64
71
|
};
|
|
72
|
+
tertiaryContainerPressed: {
|
|
73
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
74
|
+
};
|
|
65
75
|
linkTitle: {
|
|
66
76
|
color: "#076D8A";
|
|
67
77
|
};
|
|
@@ -74,6 +84,9 @@ export declare const useStyles: () => {
|
|
|
74
84
|
linkContainerHover: {
|
|
75
85
|
backgroundColor: "transparent";
|
|
76
86
|
};
|
|
87
|
+
linkContainerPressed: {
|
|
88
|
+
backgroundColor: "transparent";
|
|
89
|
+
};
|
|
77
90
|
xsContainer: {
|
|
78
91
|
paddingLeft: import("@alveole/theme").Spacing;
|
|
79
92
|
paddingRight: import("@alveole/theme").Spacing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2NnB,CAAC"}
|
|
@@ -38,6 +38,9 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
38
38
|
primaryContainerHover: {
|
|
39
39
|
backgroundColor: color.light.background['action-high-primary-hover'],
|
|
40
40
|
},
|
|
41
|
+
primaryContainerPressed: {
|
|
42
|
+
backgroundColor: color.light.background['action-high-primary-hover'],
|
|
43
|
+
},
|
|
41
44
|
secondaryTitle: {
|
|
42
45
|
color: color.light.text['action-high-grey'],
|
|
43
46
|
},
|
|
@@ -54,6 +57,10 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
54
57
|
borderColor: color.light.border['default-grey'],
|
|
55
58
|
backgroundColor: color.light.background['transparent-hover'],
|
|
56
59
|
},
|
|
60
|
+
secondaryContainerPressed: {
|
|
61
|
+
borderColor: color.light.border['default-grey'],
|
|
62
|
+
backgroundColor: color.light.background['transparent-hover'],
|
|
63
|
+
},
|
|
57
64
|
tertiaryTitle: {
|
|
58
65
|
color: color.light.text['action-high-grey'],
|
|
59
66
|
},
|
|
@@ -64,6 +71,9 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
64
71
|
tertiaryContainerHover: {
|
|
65
72
|
backgroundColor: color.light.background['transparent-hover'],
|
|
66
73
|
},
|
|
74
|
+
tertiaryContainerPressed: {
|
|
75
|
+
backgroundColor: color.light.background['transparent-hover'],
|
|
76
|
+
},
|
|
67
77
|
linkTitle: {
|
|
68
78
|
color: color.text.link.default,
|
|
69
79
|
},
|
|
@@ -76,6 +86,9 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
76
86
|
linkContainerHover: {
|
|
77
87
|
backgroundColor: color.background.button.tertiary.default,
|
|
78
88
|
},
|
|
89
|
+
linkContainerPressed: {
|
|
90
|
+
backgroundColor: color.background.button.tertiary.default,
|
|
91
|
+
},
|
|
79
92
|
// Sizes
|
|
80
93
|
xsContainer: {
|
|
81
94
|
paddingLeft: spacing('075'),
|
|
@@ -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
|
+
};
|