@alveole/components 0.34.7 → 0.34.9
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/ui/Badge/Badge.styles.js +2 -2
- package/dist/ui/ListItem/ListItem.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.js +1 -1
- package/dist/ui/ListItem/ListItem.stories.d.ts +1 -0
- package/dist/ui/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.stories.js +23 -7
- package/package.json +1 -1
|
@@ -35,13 +35,13 @@ export const useStyles = makeStyles(({ radius, text, color, spacing }) => ({
|
|
|
35
35
|
},
|
|
36
36
|
// Sizes
|
|
37
37
|
badgeSm: {
|
|
38
|
-
paddingLeft: spacing('
|
|
38
|
+
paddingLeft: spacing('1,5V'),
|
|
39
39
|
paddingRight: spacing('1,5V'),
|
|
40
40
|
gap: spacing('1V'),
|
|
41
41
|
...text['Corps de texte'].XS.CapsBold,
|
|
42
42
|
},
|
|
43
43
|
badgeMd: {
|
|
44
|
-
paddingLeft: spacing('
|
|
44
|
+
paddingLeft: spacing('1W'),
|
|
45
45
|
paddingRight: spacing('1W'),
|
|
46
46
|
gap: spacing('1V'),
|
|
47
47
|
...text['Corps de texte'].SM.CapsBold,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAqB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAqB,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC;IAC9C,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,KAAK,CAAC,CAAC;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CA6D5C,CAAC"}
|
|
@@ -7,5 +7,5 @@ import { useStyles } from './ListItem.styles';
|
|
|
7
7
|
export const ListItem = (props) => {
|
|
8
8
|
const { children, title, description, style, AvatarProps, IconProps, preview_url, trailing, loading = false, showSeparateur = true, ...itemProps } = props;
|
|
9
9
|
const styles = useStyles();
|
|
10
|
-
return (_jsxs(Box, { children: [_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: styles.itemHover, ...itemProps, children: [preview_url ? (_jsx(Box, { style: styles.previewContainer, children: _jsx(Image, { source: { uri: preview_url }, width: styles.preview.width, height: styles.preview.height, contentFit: "contain" }) })) : (_jsxs(_Fragment, { children: [IconProps && _jsx(LucideIcon, { size: "sm", color: styles.defaultIcon.color, ...IconProps }), AvatarProps && _jsx(Avatar, { size: "xs", ...AvatarProps })] })), _jsxs(Box, { style: styles.detail, children: [showSeparateur && _jsx(Box, { style: styles.separateur }), _jsxs(Box, { style: styles.principal, children: [_jsx(Typography, { style: styles.title, children: title }), description && _jsx(Typography, { style: styles.description, children: description })] }), trailing && trailing()] }), loading && (_jsx(Box, { style: styles.loading, children: _jsx(ActivityIndicator, { size: "small", color: styles.loading.color }) }))] }), children] }));
|
|
10
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: itemProps['onPress'] ? styles.itemHover : {}, ...itemProps, children: [preview_url ? (_jsx(Box, { style: styles.previewContainer, children: _jsx(Image, { source: { uri: preview_url }, width: styles.preview.width, height: styles.preview.height, contentFit: "contain" }) })) : (_jsxs(_Fragment, { children: [IconProps && _jsx(LucideIcon, { size: "sm", color: styles.defaultIcon.color, ...IconProps }), AvatarProps && _jsx(Avatar, { size: "xs", ...AvatarProps })] })), _jsxs(Box, { style: styles.detail, children: [showSeparateur && _jsx(Box, { style: styles.separateur }), _jsxs(Box, { style: styles.principal, children: [_jsx(Typography, { style: styles.title, children: title }), description && _jsx(Typography, { style: styles.description, children: description })] }), trailing && trailing()] }), loading && (_jsx(Box, { style: styles.loading, children: _jsx(ActivityIndicator, { size: "small", color: styles.loading.color }) }))] }), children] }));
|
|
11
11
|
};
|
|
@@ -101,4 +101,5 @@ export declare const WithoutSeparator: () => import("react/jsx-runtime").JSX.Ele
|
|
|
101
101
|
export declare const WithIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
102
102
|
export declare const WithAvatar: () => import("react/jsx-runtime").JSX.Element;
|
|
103
103
|
export declare const WithPreviewImage: () => import("react/jsx-runtime").JSX.Element;
|
|
104
|
+
export declare const withoutHover: import("react/jsx-runtime").JSX.Element;
|
|
104
105
|
//# sourceMappingURL=ListItem.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,OAAO,+CAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,+CASxB,CAAC;AAEF,eAAO,MAAM,WAAW,+CASvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAS5B,CAAC;AAEF,eAAO,MAAM,QAAQ,+CASpB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAYtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAS5B,CAAC;AAEF,eAAO,MAAM,YAAY,yCAKxB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Typography } from '../../core';
|
|
2
3
|
import { ButtonIcon } from '../Button';
|
|
3
4
|
import { ListItem } from './ListItem';
|
|
4
5
|
import { useStyles } from './ListItem.styles';
|
|
@@ -11,13 +12,28 @@ export default {
|
|
|
11
12
|
component: ListItem,
|
|
12
13
|
styleFn: useStyles,
|
|
13
14
|
};
|
|
14
|
-
export const Default = () => _jsx(ListItem, { title: "Titre", description: "Description"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
|
|
15
|
+
export const Default = () => (_jsx(ListItem, { title: "Titre", description: "Description", onPress: () => {
|
|
16
|
+
window.alert('click !');
|
|
17
|
+
} }));
|
|
18
|
+
export const WithTrailing = () => (_jsx(ListItem, { title: "Titre", description: "Description", trailing: () => _jsx(ButtonIcon, { variant: "tertiary", icon: "CircleX", onPress: () => console.log('remove') }), onPress: () => {
|
|
19
|
+
window.alert('click !');
|
|
20
|
+
} }));
|
|
21
|
+
export const WithLoading = () => (_jsx(ListItem, { title: "Titre", description: "Description", loading: true, onPress: () => {
|
|
22
|
+
window.alert('click !');
|
|
23
|
+
} }));
|
|
24
|
+
export const WithoutSeparator = () => (_jsx(ListItem, { title: "Titre", description: "Description", showSeparateur: false, onPress: () => {
|
|
25
|
+
window.alert('click !');
|
|
26
|
+
} }));
|
|
27
|
+
export const WithIcon = () => (_jsx(ListItem, { title: "Titre", description: "Description", IconProps: { name: 'Settings', color: 'primary' }, onPress: () => {
|
|
28
|
+
window.alert('click !');
|
|
29
|
+
} }));
|
|
19
30
|
export const WithAvatar = () => (_jsx(ListItem, { title: "Titre", description: "Description", AvatarProps: {
|
|
20
31
|
fallbackText: 'Jean Pierre',
|
|
21
32
|
src: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400',
|
|
33
|
+
}, onPress: () => {
|
|
34
|
+
window.alert('click !');
|
|
35
|
+
} }));
|
|
36
|
+
export const WithPreviewImage = () => (_jsx(ListItem, { title: "Titre", description: "Description", preview_url: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400", onPress: () => {
|
|
37
|
+
window.alert('click !');
|
|
22
38
|
} }));
|
|
23
|
-
export const
|
|
39
|
+
export const withoutHover = (_jsxs(Box, { children: [_jsx(Typography, { children: "Sans props openPress, l'effet de Hover n'apparait pas" }), _jsx(ListItem, { title: "Titre", description: "Description" })] }));
|