@alveole/components 0.23.4 → 0.24.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/stories/index.d.ts +1 -0
- package/dist/stories/index.d.ts.map +1 -1
- package/dist/stories/index.js +1 -0
- package/dist/ui/ResourceList/ResourceList.d.ts +2 -3
- package/dist/ui/ResourceList/ResourceList.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.js +3 -4
- package/dist/ui/ResourceList/ResourceList.stories.d.ts +1 -40
- package/dist/ui/ResourceList/ResourceList.stories.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.js +8 -6
- package/dist/ui/ResourceList/ResourceList.styles.d.ts +0 -40
- package/dist/ui/ResourceList/ResourceList.styles.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.styles.js +2 -36
- package/dist/ui/ResourceList/ResourceListDivider.d.ts +2 -0
- package/dist/ui/ResourceList/ResourceListDivider.d.ts.map +1 -0
- package/dist/ui/ResourceList/ResourceListDivider.js +4 -0
- package/dist/ui/ResourceList/index.d.ts +1 -1
- package/dist/ui/ResourceList/index.d.ts.map +1 -1
- package/dist/ui/ResourceList/index.js +1 -1
- package/dist/ui/Tabs/Tabs.d.ts +17 -0
- package/dist/ui/Tabs/Tabs.d.ts.map +1 -0
- package/dist/ui/Tabs/Tabs.js +56 -0
- package/dist/ui/Tabs/Tabs.stories.d.ts +108 -0
- package/dist/ui/Tabs/Tabs.stories.d.ts.map +1 -0
- package/dist/ui/Tabs/Tabs.stories.js +28 -0
- package/dist/ui/Tabs/Tabs.styles.d.ts +98 -0
- package/dist/ui/Tabs/Tabs.styles.d.ts.map +1 -0
- package/dist/ui/Tabs/Tabs.styles.js +89 -0
- package/dist/ui/Tabs/index.d.ts +2 -0
- package/dist/ui/Tabs/index.d.ts.map +1 -0
- package/dist/ui/Tabs/index.js +1 -0
- package/dist/ui/ToolbarBottomNav/index.d.ts +1 -2
- package/dist/ui/ToolbarBottomNav/index.d.ts.map +1 -1
- package/dist/ui/ToolbarBottomNav/index.js +1 -2
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +1 -0
- package/package.json +2 -1
- package/dist/ui/ResourceList/ResourceListNoContent.d.ts +0 -95
- package/dist/ui/ResourceList/ResourceListNoContent.d.ts.map +0 -1
- package/dist/ui/ResourceList/ResourceListNoContent.js +0 -13
package/dist/stories/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * as LucideIconStory from '../ui/LucideIcon/LucideIcon.stories';
|
|
|
20
20
|
export * as PageHeaderStory from '../ui/PageHeader/PageHeader.stories';
|
|
21
21
|
export * as ResourceListStory from '../ui/ResourceList/ResourceList.stories';
|
|
22
22
|
export * as SidebarStory from '../ui/Sidebar/Sidebar.stories';
|
|
23
|
+
export * as TabsStory from '../ui/Tabs/Tabs.stories';
|
|
23
24
|
export * as TagStory from '../ui/Tag/Tag.stories';
|
|
24
25
|
export * as ToolbarBottomNavStory from '../ui/ToolbarBottomNav/ToolbarBottomNav.stories';
|
|
25
26
|
export * as ToolbarTopStory from '../ui/ToolbarTop/ToolbarTop.stories';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stories/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,eAAe,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,qBAAqB,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stories/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAC1D,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,cAAc,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,eAAe,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAC;AAGhE,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,aAAa,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,iBAAiB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,qBAAqB,MAAM,iDAAiD,CAAC;AACzF,OAAO,KAAK,eAAe,MAAM,qCAAqC,CAAC"}
|
package/dist/stories/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * as LucideIconStory from '../ui/LucideIcon/LucideIcon.stories';
|
|
|
22
22
|
export * as PageHeaderStory from '../ui/PageHeader/PageHeader.stories';
|
|
23
23
|
export * as ResourceListStory from '../ui/ResourceList/ResourceList.stories';
|
|
24
24
|
export * as SidebarStory from '../ui/Sidebar/Sidebar.stories';
|
|
25
|
+
export * as TabsStory from '../ui/Tabs/Tabs.stories';
|
|
25
26
|
export * as TagStory from '../ui/Tag/Tag.stories';
|
|
26
27
|
export * as ToolbarBottomNavStory from '../ui/ToolbarBottomNav/ToolbarBottomNav.stories';
|
|
27
28
|
export * as ToolbarTopStory from '../ui/ToolbarTop/ToolbarTop.stories';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { FlashListProps } from '@shopify/flash-list';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export type ResourceListProps<Item> = FlatListProps<Item> & {
|
|
3
|
+
export type ResourceListProps<Item> = FlashListProps<Item> & {
|
|
4
4
|
data: Item[];
|
|
5
5
|
isLoading?: boolean;
|
|
6
6
|
withPagination?: boolean;
|
|
@@ -9,6 +9,5 @@ export type ResourceListProps<Item> = FlatListProps<Item> & {
|
|
|
9
9
|
titre?: string;
|
|
10
10
|
renderNoContent: () => React.ReactNode;
|
|
11
11
|
};
|
|
12
|
-
export declare const ResourceListDivider: () => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export declare const ResourceList: <Item>(props: ResourceListProps<Item>) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
14
13
|
//# sourceMappingURL=ResourceList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceList.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ResourceList.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,iBAAiB,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG;IAC3D,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,IAAI,EAAG,OAAO,iBAAiB,CAAC,IAAI,CAAC,0TAsDjE,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { FlashList } from '@shopify/flash-list';
|
|
3
|
+
import { ActivityIndicator } from 'react-native';
|
|
3
4
|
import { Box, Typography } from '../../core';
|
|
4
|
-
import { Divider } from '../Divider';
|
|
5
5
|
import { useStyles } from './ResourceList.styles';
|
|
6
|
-
export const ResourceListDivider = () => (_jsx(Box, { pl: "100", pr: "100", children: _jsx(Divider, {}) }));
|
|
7
6
|
export const ResourceList = (props) => {
|
|
8
7
|
const { style, data, isLoading, withPagination, renderNoContent, noBorder = false, withWhiteBackground = false, titre, ...listProps } = props;
|
|
9
8
|
const styles = useStyles();
|
|
@@ -24,5 +23,5 @@ export const ResourceList = (props) => {
|
|
|
24
23
|
...paginationStyles,
|
|
25
24
|
...(noBorder ? styles.noBorder : styles.withBorder),
|
|
26
25
|
...(withWhiteBackground ? styles.itemsWithWhiteBackground : {}),
|
|
27
|
-
}, children: _jsx(
|
|
26
|
+
}, children: _jsx(FlashList, { data: data, contentContainerStyle: style, ...listProps }) })] }));
|
|
28
27
|
};
|
|
@@ -45,46 +45,6 @@ declare const _default: {
|
|
|
45
45
|
alignItems: "center";
|
|
46
46
|
padding: import("@alveole/theme").Spacing;
|
|
47
47
|
};
|
|
48
|
-
noContent: {
|
|
49
|
-
display: "flex";
|
|
50
|
-
padding: import("@alveole/theme").Spacing;
|
|
51
|
-
flexDirection: "column";
|
|
52
|
-
alignItems: "center";
|
|
53
|
-
gap: import("@alveole/theme").Spacing;
|
|
54
|
-
borderRadius: import("@alveole/theme").Spacing;
|
|
55
|
-
borderWidth: number;
|
|
56
|
-
borderColor: "#DEE3EC";
|
|
57
|
-
backgroundColor: "#FFFFFF";
|
|
58
|
-
borderLeftWidth: number;
|
|
59
|
-
borderRightWidth: number;
|
|
60
|
-
width: "100%";
|
|
61
|
-
};
|
|
62
|
-
noContentIntro: {
|
|
63
|
-
display: "flex";
|
|
64
|
-
flexDirection: "column";
|
|
65
|
-
alignItems: "center";
|
|
66
|
-
gap: import("@alveole/theme").Spacing;
|
|
67
|
-
};
|
|
68
|
-
noContentText: {
|
|
69
|
-
display: "flex";
|
|
70
|
-
flexDirection: "column";
|
|
71
|
-
alignItems: "center";
|
|
72
|
-
gap: import("@alveole/theme").Spacing;
|
|
73
|
-
};
|
|
74
|
-
noContentTextTitle: {
|
|
75
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
76
|
-
fontSize: 18 | 20;
|
|
77
|
-
lineHeight: 24 | 28;
|
|
78
|
-
letterSpacing: 0;
|
|
79
|
-
color: "#151617";
|
|
80
|
-
};
|
|
81
|
-
noContentTextDescription: {
|
|
82
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
83
|
-
fontSize: 14;
|
|
84
|
-
lineHeight: 20;
|
|
85
|
-
letterSpacing: 0;
|
|
86
|
-
color: "#5F6571";
|
|
87
|
-
};
|
|
88
48
|
};
|
|
89
49
|
};
|
|
90
50
|
export default _default;
|
|
@@ -93,4 +53,5 @@ export declare const WithTitle: () => import("react/jsx-runtime").JSX.Element;
|
|
|
93
53
|
export declare const WithIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
94
54
|
export declare const WithPreviewImageAndTrailing: () => import("react/jsx-runtime").JSX.Element;
|
|
95
55
|
export declare const WithNoContent: () => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const WithDivider: () => import("react/jsx-runtime").JSX.Element;
|
|
96
57
|
//# sourceMappingURL=ResourceList.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBASkB;AA6BlB,eAAO,MAAM,OAAO,+CASnB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAUrB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAcpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,+CAevC,CAAC;AAEF,eAAO,MAAM,aAAa,+CAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,+CAUvB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EmptyState } from '../EmptyState';
|
|
2
3
|
import { ListItem } from '../ListItem';
|
|
3
4
|
import { LucideIcon } from '../LucideIcon';
|
|
4
5
|
import { ResourceList } from './ResourceList';
|
|
5
6
|
import { useStyles } from './ResourceList.styles';
|
|
6
|
-
import {
|
|
7
|
+
import { ResourceListDivider } from './ResourceListDivider';
|
|
7
8
|
export default {
|
|
8
9
|
title: 'ResourceList',
|
|
9
10
|
tags: ['Composant'],
|
|
@@ -38,8 +39,9 @@ const exampleDataWithPreview = [
|
|
|
38
39
|
preview_url: 'https://images.unsplash.com/photo-1579783902614-a3fb3927b6a5?w=400',
|
|
39
40
|
},
|
|
40
41
|
];
|
|
41
|
-
export const Default = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () =>
|
|
42
|
-
export const WithTitle = () => (_jsx(ResourceList, { titre: "Titre de la liste", data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () =>
|
|
43
|
-
export const WithIcon = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, IconProps: { name: 'Settings' }, showSeparateur: index !== 0 })), renderNoContent: () =>
|
|
44
|
-
export const WithPreviewImageAndTrailing = () => (_jsx(ResourceList, { data: exampleDataWithPreview, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, preview_url: item.preview_url, trailing: () => _jsx(LucideIcon, { name: "ChevronRight", size: "sm" }), showSeparateur: index !== 0 })), renderNoContent: () =>
|
|
45
|
-
export const WithNoContent = () => (_jsx(ResourceList, { data: [], keyExtractor: item => item.id, renderItem: ({ item }) => _jsx(ListItem, { title: item.name, description: item.description }), renderNoContent: () =>
|
|
42
|
+
export const Default = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
43
|
+
export const WithTitle = () => (_jsx(ResourceList, { titre: "Titre de la liste", data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
44
|
+
export const WithIcon = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, IconProps: { name: 'Settings' }, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
45
|
+
export const WithPreviewImageAndTrailing = () => (_jsx(ResourceList, { data: exampleDataWithPreview, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, preview_url: item.preview_url, trailing: () => _jsx(LucideIcon, { name: "ChevronRight", size: "sm" }), showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
46
|
+
export const WithNoContent = () => (_jsx(ResourceList, { data: [], keyExtractor: item => item.id, renderItem: ({ item }) => _jsx(ListItem, { title: item.name, description: item.description }), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
47
|
+
export const WithDivider = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), ItemSeparatorComponent: ResourceListDivider, renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
@@ -38,45 +38,5 @@ export declare const useStyles: () => {
|
|
|
38
38
|
alignItems: "center";
|
|
39
39
|
padding: import("@alveole/theme").Spacing;
|
|
40
40
|
};
|
|
41
|
-
noContent: {
|
|
42
|
-
display: "flex";
|
|
43
|
-
padding: import("@alveole/theme").Spacing;
|
|
44
|
-
flexDirection: "column";
|
|
45
|
-
alignItems: "center";
|
|
46
|
-
gap: import("@alveole/theme").Spacing;
|
|
47
|
-
borderRadius: import("@alveole/theme").Spacing;
|
|
48
|
-
borderWidth: number;
|
|
49
|
-
borderColor: "#DEE3EC";
|
|
50
|
-
backgroundColor: "#FFFFFF";
|
|
51
|
-
borderLeftWidth: number;
|
|
52
|
-
borderRightWidth: number;
|
|
53
|
-
width: "100%";
|
|
54
|
-
};
|
|
55
|
-
noContentIntro: {
|
|
56
|
-
display: "flex";
|
|
57
|
-
flexDirection: "column";
|
|
58
|
-
alignItems: "center";
|
|
59
|
-
gap: import("@alveole/theme").Spacing;
|
|
60
|
-
};
|
|
61
|
-
noContentText: {
|
|
62
|
-
display: "flex";
|
|
63
|
-
flexDirection: "column";
|
|
64
|
-
alignItems: "center";
|
|
65
|
-
gap: import("@alveole/theme").Spacing;
|
|
66
|
-
};
|
|
67
|
-
noContentTextTitle: {
|
|
68
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
69
|
-
fontSize: 18 | 20;
|
|
70
|
-
lineHeight: 24 | 28;
|
|
71
|
-
letterSpacing: 0;
|
|
72
|
-
color: "#151617";
|
|
73
|
-
};
|
|
74
|
-
noContentTextDescription: {
|
|
75
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
76
|
-
fontSize: 14;
|
|
77
|
-
lineHeight: 20;
|
|
78
|
-
letterSpacing: 0;
|
|
79
|
-
color: "#5F6571";
|
|
80
|
-
};
|
|
81
41
|
};
|
|
82
42
|
//# sourceMappingURL=ResourceList.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceList.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"ResourceList.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
export const useStyles = makeStyles(({ color, text, radius, spacing
|
|
2
|
+
export const useStyles = makeStyles(({ color, text, radius, spacing }) => ({
|
|
3
3
|
list: {
|
|
4
4
|
display: 'flex',
|
|
5
5
|
flexDirection: 'column',
|
|
@@ -21,7 +21,7 @@ export const useStyles = makeStyles(({ color, text, radius, spacing, isVariant }
|
|
|
21
21
|
},
|
|
22
22
|
withBorder: {
|
|
23
23
|
borderWidth: 1,
|
|
24
|
-
borderColor: color.border['default-grey'],
|
|
24
|
+
borderColor: color.light.border['default-grey'],
|
|
25
25
|
borderLeftWidth: 1,
|
|
26
26
|
borderRightWidth: 1,
|
|
27
27
|
},
|
|
@@ -36,38 +36,4 @@ export const useStyles = makeStyles(({ color, text, radius, spacing, isVariant }
|
|
|
36
36
|
alignItems: 'center',
|
|
37
37
|
padding: spacing('4W'),
|
|
38
38
|
},
|
|
39
|
-
noContent: {
|
|
40
|
-
display: 'flex',
|
|
41
|
-
padding: spacing('4W'),
|
|
42
|
-
flexDirection: 'column',
|
|
43
|
-
alignItems: 'center',
|
|
44
|
-
gap: spacing('5W'),
|
|
45
|
-
borderRadius: isVariant('mobile') ? 0 : spacing('2W'),
|
|
46
|
-
borderWidth: 1,
|
|
47
|
-
borderColor: color.border['default-grey'],
|
|
48
|
-
backgroundColor: '#FFFFFF',
|
|
49
|
-
borderLeftWidth: isVariant('mobile') ? 0 : 1,
|
|
50
|
-
borderRightWidth: isVariant('mobile') ? 0 : 1,
|
|
51
|
-
width: '100%',
|
|
52
|
-
},
|
|
53
|
-
noContentIntro: {
|
|
54
|
-
display: 'flex',
|
|
55
|
-
flexDirection: 'column',
|
|
56
|
-
alignItems: 'center',
|
|
57
|
-
gap: spacing('2W'),
|
|
58
|
-
},
|
|
59
|
-
noContentText: {
|
|
60
|
-
display: 'flex',
|
|
61
|
-
flexDirection: 'column',
|
|
62
|
-
alignItems: 'center',
|
|
63
|
-
gap: spacing('1W'),
|
|
64
|
-
},
|
|
65
|
-
noContentTextTitle: {
|
|
66
|
-
color: color.text['title-grey'],
|
|
67
|
-
...text.Titres['H6 - XXS'],
|
|
68
|
-
},
|
|
69
|
-
noContentTextDescription: {
|
|
70
|
-
color: color.text['mention'],
|
|
71
|
-
...text['Corps de texte'].SM.Regular,
|
|
72
|
-
},
|
|
73
39
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceListDivider.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceListDivider.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,+CAI/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './ResourceList';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './ResourceListDivider';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BoxProps, LucideIconProps } from '@alveole/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type TabsProps = Omit<BoxProps, 'children'> & {
|
|
4
|
+
tabs: {
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: LucideIconProps['name'];
|
|
7
|
+
counter?: number;
|
|
8
|
+
value: string;
|
|
9
|
+
content: React.ReactNode;
|
|
10
|
+
scrollable?: boolean;
|
|
11
|
+
renderAction?: () => React.ReactNode;
|
|
12
|
+
}[];
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
onChange?: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const Tabs: (props: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/ui/Tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAc,eAAe,EAAc,MAAM,qBAAqB,CAAC;AAC7F,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IACnD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;KACtC,EAAE,CAAC;IACJ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,SAAS,4CA6IpC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, LucideIcon, Typography } from '@alveole/components';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScrollView } from 'react-native';
|
|
5
|
+
import { Tabs as TamaguiTabs } from 'tamagui';
|
|
6
|
+
import { useStyles } from './Tabs.styles';
|
|
7
|
+
export const Tabs = (props) => {
|
|
8
|
+
const { tabs, defaultValue = '', onChange, style, ...boxProps } = props;
|
|
9
|
+
const styles = useStyles();
|
|
10
|
+
const initialValue = defaultValue || tabs[0]?.value || '';
|
|
11
|
+
const [tabState, setTabState] = React.useState({
|
|
12
|
+
activeAt: null,
|
|
13
|
+
currentTab: initialValue,
|
|
14
|
+
intentAt: null,
|
|
15
|
+
prevActiveAt: null,
|
|
16
|
+
hoverTab: null,
|
|
17
|
+
});
|
|
18
|
+
const setCurrentTab = (currentTab, index) => {
|
|
19
|
+
setTabState({ ...tabState, currentTab });
|
|
20
|
+
onChange?.(index);
|
|
21
|
+
};
|
|
22
|
+
const setIntentIndicator = (intentAt) => setTabState({ ...tabState, intentAt });
|
|
23
|
+
const setActiveIndicator = (activeAt) => setTabState({ ...tabState, prevActiveAt: tabState.activeAt, activeAt });
|
|
24
|
+
const setHoverTab = (hoverTab) => setTabState({ ...tabState, hoverTab });
|
|
25
|
+
const { currentTab, hoverTab } = tabState;
|
|
26
|
+
const handleOnInteraction = (type, layout) => {
|
|
27
|
+
if (type === 'select') {
|
|
28
|
+
setActiveIndicator(layout);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setIntentIndicator(layout);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function isCurrentTab(tabValue) {
|
|
35
|
+
return currentTab === tabValue;
|
|
36
|
+
}
|
|
37
|
+
function isHoverTab(tabValue) {
|
|
38
|
+
return hoverTab === tabValue;
|
|
39
|
+
}
|
|
40
|
+
const renderActions = React.useCallback(() => {
|
|
41
|
+
const currentTab = tabs.find(t => t.value === tabState.currentTab);
|
|
42
|
+
if (currentTab == null)
|
|
43
|
+
return null;
|
|
44
|
+
return currentTab.renderAction && _jsx(Box, { ml: 'auto', children: currentTab.renderAction() });
|
|
45
|
+
}, [tabState.currentTab, tabs]);
|
|
46
|
+
const renderContent = React.useCallback(() => {
|
|
47
|
+
const currentTab = tabs.find(t => t.value === tabState.currentTab);
|
|
48
|
+
if (currentTab?.scrollable)
|
|
49
|
+
return (_jsx(ScrollView, { style: { flex: 1 }, contentContainerStyle: { paddingBottom: 16 }, keyboardShouldPersistTaps: "handled", showsVerticalScrollIndicator: true, children: currentTab.content }));
|
|
50
|
+
return currentTab?.content;
|
|
51
|
+
}, [tabState.currentTab, tabs]);
|
|
52
|
+
return (_jsx(Box, { tag: "tabs-container", style: [styles.container, style], ...boxProps, children: _jsxs(TamaguiTabs, { style: styles.tabs, defaultValue: initialValue, value: currentTab, onValueChange: e => setCurrentTab(e, tabs.findIndex(t => t.value === e)), orientation: "horizontal", size: "$4", activationMode: "manual", children: [_jsxs(TamaguiTabs.List, { disablePassBorderRadius: true, loop: false, style: styles.tabsList, children: [tabs.map((tab, idx) => (_jsx(_Fragment, { children: _jsx(TamaguiTabs.Tab, { unstyled: true, onHoverIn: () => setHoverTab(tab.value), onHoverOut: () => setHoverTab(null), onInteraction: handleOnInteraction, value: tab.value, disabled: tabs.length < 2, style: { ...styles.tabsTab, ...(isCurrentTab(tab.value) ? styles.tabsTabActive : {}) }, children: _jsxs(Box, { style: {
|
|
53
|
+
...styles.wrapper,
|
|
54
|
+
...(isHoverTab(tab.value) ? styles.wrapperHover : {}),
|
|
55
|
+
}, children: [tab.icon && (_jsx(LucideIcon, { name: tab.icon, size: "sm", color: "currentColor", style: { ...(isHoverTab(tab.value) ? styles.tabIconHover : styles.tabIcon) } })), _jsx(Typography, { style: { ...styles.tabsLabel, ...(isCurrentTab(tab.value) ? styles.tabsLabelActive : {}) }, children: tab.label }), tab.counter !== undefined && tab.counter > 0 && (_jsx(Typography, { style: { ...styles.tabsCounter, ...(isCurrentTab(tab.value) ? styles.tabsCounterActive : {}) }, children: tab.counter }))] }) }, idx) }))), renderActions && _jsx(Box, { ml: 'auto', children: renderActions() })] }), _jsx(Box, { style: { flex: 1, minHeight: 0 }, children: tabs.map((tab, idx) => (_jsx(TamaguiTabs.Content, { style: styles.tabsContent, value: tab.value, children: renderContent() }, idx))) })] }) }));
|
|
56
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: ["Composant"];
|
|
4
|
+
experimental: false;
|
|
5
|
+
figmaURL: string;
|
|
6
|
+
description: string;
|
|
7
|
+
component: (props: import("@alveole/components").TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
styleFn: () => {
|
|
9
|
+
container: {
|
|
10
|
+
flex: number;
|
|
11
|
+
minHeight: number;
|
|
12
|
+
display: "flex";
|
|
13
|
+
flexDirection: "column";
|
|
14
|
+
gap: import("@alveole/theme").Spacing;
|
|
15
|
+
};
|
|
16
|
+
tabs: {
|
|
17
|
+
flex: number;
|
|
18
|
+
minHeight: number;
|
|
19
|
+
flexDirection: "column";
|
|
20
|
+
};
|
|
21
|
+
tabsList: {
|
|
22
|
+
borderBottomLeftRadius: import("@alveole/theme").Spacing;
|
|
23
|
+
borderBottomRightRadius: import("@alveole/theme").Spacing;
|
|
24
|
+
gap: import("@alveole/theme").Spacing;
|
|
25
|
+
boxSizing: "border-box";
|
|
26
|
+
borderColor: "#DEE3EC";
|
|
27
|
+
borderBottomWidth: number;
|
|
28
|
+
backgroundColor: "transparent";
|
|
29
|
+
};
|
|
30
|
+
tabsTab: {
|
|
31
|
+
appearance: "none";
|
|
32
|
+
backgroundColor: "transparent";
|
|
33
|
+
cursor: "pointer";
|
|
34
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
35
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
36
|
+
paddingLeft: number;
|
|
37
|
+
paddingRight: number;
|
|
38
|
+
boxSizing: "border-box";
|
|
39
|
+
borderWidth: number;
|
|
40
|
+
borderBottomWidth: number;
|
|
41
|
+
borderBottomColor: "transparent";
|
|
42
|
+
display: "flex";
|
|
43
|
+
alignItems: "center";
|
|
44
|
+
gap: import("@alveole/theme").Spacing;
|
|
45
|
+
};
|
|
46
|
+
tabsTabActive: {
|
|
47
|
+
borderBottomColor: "#0264C7";
|
|
48
|
+
borderBottomWidth: number;
|
|
49
|
+
};
|
|
50
|
+
tabsCounter: {
|
|
51
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
52
|
+
fontSize: 12;
|
|
53
|
+
lineHeight: 20;
|
|
54
|
+
letterSpacing: 0;
|
|
55
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
56
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
57
|
+
backgroundColor: "#E6EAF1";
|
|
58
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
59
|
+
};
|
|
60
|
+
tabsCounterActive: {};
|
|
61
|
+
wrapperHover: {
|
|
62
|
+
display: "flex";
|
|
63
|
+
flexDirection: "row";
|
|
64
|
+
alignItems: "center";
|
|
65
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
66
|
+
};
|
|
67
|
+
wrapper: {
|
|
68
|
+
display: "flex";
|
|
69
|
+
flexDirection: "row";
|
|
70
|
+
alignItems: "center";
|
|
71
|
+
transitionProperty: "all";
|
|
72
|
+
transitionDuration: "0.1s";
|
|
73
|
+
transitionTimingFunction: "ease-in-out";
|
|
74
|
+
gap: import("@alveole/theme").Spacing;
|
|
75
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
76
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
77
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
78
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
79
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
80
|
+
};
|
|
81
|
+
tabIcon: {
|
|
82
|
+
color: "#5F6571";
|
|
83
|
+
};
|
|
84
|
+
tabIconHover: {
|
|
85
|
+
color: "#373A3F";
|
|
86
|
+
};
|
|
87
|
+
tabsLabel: {
|
|
88
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
89
|
+
fontSize: 14;
|
|
90
|
+
lineHeight: 20;
|
|
91
|
+
letterSpacing: 0;
|
|
92
|
+
};
|
|
93
|
+
tabsLabelActive: {
|
|
94
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
95
|
+
fontSize: 14;
|
|
96
|
+
lineHeight: 20;
|
|
97
|
+
letterSpacing: 0;
|
|
98
|
+
};
|
|
99
|
+
tabsContent: {
|
|
100
|
+
flex: number;
|
|
101
|
+
minHeight: number;
|
|
102
|
+
overflow: "hidden";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
export default _default;
|
|
107
|
+
export declare const Example: () => import("react/jsx-runtime").JSX.Element;
|
|
108
|
+
//# sourceMappingURL=Tabs.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Tabs/Tabs.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,OAAO,+CAsBnB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Typography } from '@alveole/components';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Tabs } from './Tabs';
|
|
5
|
+
import { useStyles } from './Tabs.styles';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Tabs',
|
|
8
|
+
tags: ['Composant'],
|
|
9
|
+
experimental: false,
|
|
10
|
+
figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1863-621',
|
|
11
|
+
description: 'Composant d’onglets (tabs) basé sur tamagui.',
|
|
12
|
+
component: Tabs,
|
|
13
|
+
styleFn: useStyles,
|
|
14
|
+
};
|
|
15
|
+
export const Example = () => {
|
|
16
|
+
const [_activeTab, setActiveTab] = React.useState(0);
|
|
17
|
+
return (_jsx(Box, { width: '100%', children: _jsx(Tabs, { defaultValue: 'onglet-1', onChange: setActiveTab, tabs: [
|
|
18
|
+
{ label: 'Onglet 1', value: 'onglet-1', content: _jsx(Typography, { children: "Contenu de onglet 1" }) },
|
|
19
|
+
{ label: 'Onglet 2', counter: 12, value: 'onglet-2', content: _jsx(Typography, { children: "Contenu de onglet 2" }) },
|
|
20
|
+
{ label: 'Onglet 3', value: 'onglet-3', content: _jsx(Typography, { children: "Contenu de onglet 3" }) },
|
|
21
|
+
{
|
|
22
|
+
label: 'Onglet 4',
|
|
23
|
+
icon: 'Settings',
|
|
24
|
+
value: 'onglet-4',
|
|
25
|
+
content: _jsx(Typography, { children: "Contenu de onglet 4" }),
|
|
26
|
+
},
|
|
27
|
+
] }) }));
|
|
28
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
container: {
|
|
3
|
+
flex: number;
|
|
4
|
+
minHeight: number;
|
|
5
|
+
display: "flex";
|
|
6
|
+
flexDirection: "column";
|
|
7
|
+
gap: import("@alveole/theme").Spacing;
|
|
8
|
+
};
|
|
9
|
+
tabs: {
|
|
10
|
+
flex: number;
|
|
11
|
+
minHeight: number;
|
|
12
|
+
flexDirection: "column";
|
|
13
|
+
};
|
|
14
|
+
tabsList: {
|
|
15
|
+
borderBottomLeftRadius: import("@alveole/theme").Spacing;
|
|
16
|
+
borderBottomRightRadius: import("@alveole/theme").Spacing;
|
|
17
|
+
gap: import("@alveole/theme").Spacing;
|
|
18
|
+
boxSizing: "border-box";
|
|
19
|
+
borderColor: "#DEE3EC";
|
|
20
|
+
borderBottomWidth: number;
|
|
21
|
+
backgroundColor: "transparent";
|
|
22
|
+
};
|
|
23
|
+
tabsTab: {
|
|
24
|
+
appearance: "none";
|
|
25
|
+
backgroundColor: "transparent";
|
|
26
|
+
cursor: "pointer";
|
|
27
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
28
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
29
|
+
paddingLeft: number;
|
|
30
|
+
paddingRight: number;
|
|
31
|
+
boxSizing: "border-box";
|
|
32
|
+
borderWidth: number;
|
|
33
|
+
borderBottomWidth: number;
|
|
34
|
+
borderBottomColor: "transparent";
|
|
35
|
+
display: "flex";
|
|
36
|
+
alignItems: "center";
|
|
37
|
+
gap: import("@alveole/theme").Spacing;
|
|
38
|
+
};
|
|
39
|
+
tabsTabActive: {
|
|
40
|
+
borderBottomColor: "#0264C7";
|
|
41
|
+
borderBottomWidth: number;
|
|
42
|
+
};
|
|
43
|
+
tabsCounter: {
|
|
44
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
45
|
+
fontSize: 12;
|
|
46
|
+
lineHeight: 20;
|
|
47
|
+
letterSpacing: 0;
|
|
48
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
49
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
50
|
+
backgroundColor: "#E6EAF1";
|
|
51
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
52
|
+
};
|
|
53
|
+
tabsCounterActive: {};
|
|
54
|
+
wrapperHover: {
|
|
55
|
+
display: "flex";
|
|
56
|
+
flexDirection: "row";
|
|
57
|
+
alignItems: "center";
|
|
58
|
+
backgroundColor: "rgba(0, 0, 0, 0.04)";
|
|
59
|
+
};
|
|
60
|
+
wrapper: {
|
|
61
|
+
display: "flex";
|
|
62
|
+
flexDirection: "row";
|
|
63
|
+
alignItems: "center";
|
|
64
|
+
transitionProperty: "all";
|
|
65
|
+
transitionDuration: "0.1s";
|
|
66
|
+
transitionTimingFunction: "ease-in-out";
|
|
67
|
+
gap: import("@alveole/theme").Spacing;
|
|
68
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
69
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
70
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
71
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
72
|
+
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
73
|
+
};
|
|
74
|
+
tabIcon: {
|
|
75
|
+
color: "#5F6571";
|
|
76
|
+
};
|
|
77
|
+
tabIconHover: {
|
|
78
|
+
color: "#373A3F";
|
|
79
|
+
};
|
|
80
|
+
tabsLabel: {
|
|
81
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
82
|
+
fontSize: 14;
|
|
83
|
+
lineHeight: 20;
|
|
84
|
+
letterSpacing: 0;
|
|
85
|
+
};
|
|
86
|
+
tabsLabelActive: {
|
|
87
|
+
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
88
|
+
fontSize: 14;
|
|
89
|
+
lineHeight: 20;
|
|
90
|
+
letterSpacing: 0;
|
|
91
|
+
};
|
|
92
|
+
tabsContent: {
|
|
93
|
+
flex: number;
|
|
94
|
+
minHeight: number;
|
|
95
|
+
overflow: "hidden";
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=Tabs.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Tabs/Tabs.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuFnB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { makeStyles } from '@alveole/theme';
|
|
2
|
+
export const useStyles = makeStyles(({ color, spacing, text, radius }) => ({
|
|
3
|
+
container: {
|
|
4
|
+
flex: 1,
|
|
5
|
+
minHeight: 0,
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
gap: spacing('075'),
|
|
9
|
+
},
|
|
10
|
+
tabs: {
|
|
11
|
+
flex: 1,
|
|
12
|
+
minHeight: 0,
|
|
13
|
+
flexDirection: 'column',
|
|
14
|
+
},
|
|
15
|
+
tabsList: {
|
|
16
|
+
borderBottomLeftRadius: spacing('000'),
|
|
17
|
+
borderBottomRightRadius: spacing('000'),
|
|
18
|
+
gap: spacing('075'),
|
|
19
|
+
boxSizing: 'border-box',
|
|
20
|
+
borderColor: color.light.border['default-grey'],
|
|
21
|
+
borderBottomWidth: 1,
|
|
22
|
+
backgroundColor: 'transparent',
|
|
23
|
+
},
|
|
24
|
+
tabsTab: {
|
|
25
|
+
appearance: 'none',
|
|
26
|
+
backgroundColor: 'transparent',
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
paddingTop: spacing('1W'),
|
|
29
|
+
paddingBottom: spacing('1W'),
|
|
30
|
+
paddingLeft: 0,
|
|
31
|
+
paddingRight: 0,
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
borderWidth: 0,
|
|
34
|
+
borderBottomWidth: 2,
|
|
35
|
+
borderBottomColor: 'transparent',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
gap: spacing('1W'),
|
|
39
|
+
},
|
|
40
|
+
tabsTabActive: {
|
|
41
|
+
borderBottomColor: color.light.border['default-primary'],
|
|
42
|
+
borderBottomWidth: 2,
|
|
43
|
+
},
|
|
44
|
+
tabsCounter: {
|
|
45
|
+
paddingRight: spacing('1W'),
|
|
46
|
+
paddingLeft: spacing('1W'),
|
|
47
|
+
backgroundColor: color.light.background['disabled-grey'],
|
|
48
|
+
borderRadius: radius('full'),
|
|
49
|
+
...text['Corps de texte'].XS.Bold,
|
|
50
|
+
},
|
|
51
|
+
tabsCounterActive: {},
|
|
52
|
+
wrapperHover: {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
backgroundColor: color.light.background['transparent-hover'],
|
|
57
|
+
},
|
|
58
|
+
wrapper: {
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexDirection: 'row',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
transitionProperty: 'all',
|
|
63
|
+
transitionDuration: '0.1s',
|
|
64
|
+
transitionTimingFunction: 'ease-in-out',
|
|
65
|
+
gap: spacing('1W'),
|
|
66
|
+
paddingTop: spacing('025'),
|
|
67
|
+
paddingBottom: spacing('025'),
|
|
68
|
+
paddingLeft: spacing('050'),
|
|
69
|
+
paddingRight: spacing('050'),
|
|
70
|
+
borderRadius: radius('md'),
|
|
71
|
+
},
|
|
72
|
+
tabIcon: {
|
|
73
|
+
color: color.light.text['mention-grey'],
|
|
74
|
+
},
|
|
75
|
+
tabIconHover: {
|
|
76
|
+
color: color.light.text['default-grey'],
|
|
77
|
+
},
|
|
78
|
+
tabsLabel: {
|
|
79
|
+
...text['Corps de texte'].SM.Regular,
|
|
80
|
+
},
|
|
81
|
+
tabsLabelActive: {
|
|
82
|
+
...text['Corps de texte'].SM.Bold,
|
|
83
|
+
},
|
|
84
|
+
tabsContent: {
|
|
85
|
+
flex: 1,
|
|
86
|
+
minHeight: 0,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
},
|
|
89
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tabs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarBottomNav/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarBottomNav/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,EAAE,GAG7B,CAAC"}
|
|
@@ -2,8 +2,7 @@ import { Tabs as ExpoTabs } from 'expo-router';
|
|
|
2
2
|
import { ToolbarBottomNav as ToolbarBottomNavBase } from './ToolbarBottomNav';
|
|
3
3
|
import { toolbarBottomNavIcon } from './ToolbarBottomNavIcon';
|
|
4
4
|
// L'annotation explicite évite de faire fuiter des types internes de React Navigation.
|
|
5
|
-
export const
|
|
5
|
+
export const ToolbarBottomNav = Object.assign(ToolbarBottomNavBase, {
|
|
6
6
|
Screen: ExpoTabs.Screen,
|
|
7
7
|
Icon: toolbarBottomNavIcon,
|
|
8
8
|
});
|
|
9
|
-
export { Tabs as ToolbarBottomNav };
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
package/dist/ui/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alveole/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "Shared UI components.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"react-native-svg": "^15.0.0",
|
|
55
55
|
"lucide-react-native": ">=0.570.0",
|
|
56
56
|
"@lucide/lab": "*",
|
|
57
|
+
"@shopify/flash-list": ">=2",
|
|
57
58
|
"react-native-webview": ">=13",
|
|
58
59
|
"expo-application": "*",
|
|
59
60
|
"expo-image": "*",
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { BoxProps } from '../../core';
|
|
2
|
-
import { ButtonProps } from '../Button';
|
|
3
|
-
import { IconProps } from '../LucideIcon';
|
|
4
|
-
export type ResourceListNoContentProps = Pick<BoxProps, 'style'> & {
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
IconProps: Pick<IconProps, 'color' | 'name'>;
|
|
8
|
-
ButtonProps?: Pick<ButtonProps, 'title' | 'onPress'>;
|
|
9
|
-
};
|
|
10
|
-
export declare const ResourceListNoContent: {
|
|
11
|
-
(props: ResourceListNoContentProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
stylesFn: () => {
|
|
13
|
-
list: {
|
|
14
|
-
display: "flex";
|
|
15
|
-
flexDirection: "column";
|
|
16
|
-
gap: import("@alveole/theme").Spacing;
|
|
17
|
-
};
|
|
18
|
-
entete: {
|
|
19
|
-
paddingTop: import("@alveole/theme").Spacing;
|
|
20
|
-
paddingBottom: import("@alveole/theme").Spacing;
|
|
21
|
-
};
|
|
22
|
-
enteteTitle: {
|
|
23
|
-
color: "#151617";
|
|
24
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
25
|
-
fontSize: 14;
|
|
26
|
-
lineHeight: 20;
|
|
27
|
-
letterSpacing: 0;
|
|
28
|
-
};
|
|
29
|
-
items: {
|
|
30
|
-
borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
31
|
-
};
|
|
32
|
-
itemsWithWhiteBackground: {
|
|
33
|
-
backgroundColor: "#FFFFFF";
|
|
34
|
-
};
|
|
35
|
-
withBorder: {
|
|
36
|
-
borderWidth: number;
|
|
37
|
-
borderColor: "#DEE3EC";
|
|
38
|
-
borderLeftWidth: number;
|
|
39
|
-
borderRightWidth: number;
|
|
40
|
-
};
|
|
41
|
-
noBorder: {
|
|
42
|
-
borderWidth: number;
|
|
43
|
-
borderLeftWidth: number;
|
|
44
|
-
borderRightWidth: number;
|
|
45
|
-
};
|
|
46
|
-
loader: {
|
|
47
|
-
flex: number;
|
|
48
|
-
justifyContent: "center";
|
|
49
|
-
alignItems: "center";
|
|
50
|
-
padding: import("@alveole/theme").Spacing;
|
|
51
|
-
};
|
|
52
|
-
noContent: {
|
|
53
|
-
display: "flex";
|
|
54
|
-
padding: import("@alveole/theme").Spacing;
|
|
55
|
-
flexDirection: "column";
|
|
56
|
-
alignItems: "center";
|
|
57
|
-
gap: import("@alveole/theme").Spacing;
|
|
58
|
-
borderRadius: import("@alveole/theme").Spacing;
|
|
59
|
-
borderWidth: number;
|
|
60
|
-
borderColor: "#DEE3EC";
|
|
61
|
-
backgroundColor: "#FFFFFF";
|
|
62
|
-
borderLeftWidth: number;
|
|
63
|
-
borderRightWidth: number;
|
|
64
|
-
width: "100%";
|
|
65
|
-
};
|
|
66
|
-
noContentIntro: {
|
|
67
|
-
display: "flex";
|
|
68
|
-
flexDirection: "column";
|
|
69
|
-
alignItems: "center";
|
|
70
|
-
gap: import("@alveole/theme").Spacing;
|
|
71
|
-
};
|
|
72
|
-
noContentText: {
|
|
73
|
-
display: "flex";
|
|
74
|
-
flexDirection: "column";
|
|
75
|
-
alignItems: "center";
|
|
76
|
-
gap: import("@alveole/theme").Spacing;
|
|
77
|
-
};
|
|
78
|
-
noContentTextTitle: {
|
|
79
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
80
|
-
fontSize: 18 | 20;
|
|
81
|
-
lineHeight: 24 | 28;
|
|
82
|
-
letterSpacing: 0;
|
|
83
|
-
color: "#151617";
|
|
84
|
-
};
|
|
85
|
-
noContentTextDescription: {
|
|
86
|
-
fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
|
|
87
|
-
fontSize: 14;
|
|
88
|
-
lineHeight: 20;
|
|
89
|
-
letterSpacing: 0;
|
|
90
|
-
color: "#5F6571";
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
description: string;
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=ResourceListNoContent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceListNoContent.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceListNoContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AACvD,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,qBAAqB;YAAW,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBtE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Typography } from '../../core';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
import { LucideIcon } from '../LucideIcon';
|
|
5
|
-
import { useStyles } from './ResourceList.styles';
|
|
6
|
-
export const ResourceListNoContent = (props) => {
|
|
7
|
-
const { title, description, style, IconProps, ButtonProps, ...boxProps } = props;
|
|
8
|
-
const styles = useStyles();
|
|
9
|
-
return (_jsxs(Box, { style: [styles.noContent, style], ...boxProps, children: [_jsxs(Box, { style: styles.noContentIntro, children: [_jsx(LucideIcon, { size: "lg", ...IconProps }), _jsxs(Box, { style: styles.noContentText, children: [_jsx(Typography, { style: styles.noContentTextTitle, children: title }), _jsx(Typography, { style: styles.noContentTextDescription, children: description })] })] }), ButtonProps && _jsx(Button, { size: "lg", variant: "primary", ...ButtonProps })] }));
|
|
10
|
-
};
|
|
11
|
-
// Component configuration
|
|
12
|
-
ResourceListNoContent.stylesFn = useStyles;
|
|
13
|
-
ResourceListNoContent.description = 'Elément affiché dans une liste vide';
|