@alveole/components 1.6.4 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/ui/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/ui/BottomSheet/BottomSheet.js +1 -1
- package/dist/ui/ListItem/ListItem.d.ts +3 -1
- package/dist/ui/ListItem/ListItem.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.js +5 -2
- 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 +9 -0
- package/dist/ui/ListItem/ListItem.stories.sources.d.ts +2 -0
- package/dist/ui/ListItem/ListItem.stories.sources.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.stories.sources.js +2 -0
- package/dist/ui/ProgressBar/ProgressBar.d.ts +1 -0
- package/dist/ui/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts +4 -0
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.js +1 -0
- package/dist/ui/ProgressBar/ProgressBar.stories.sources.d.ts +2 -0
- package/dist/ui/ProgressBar/ProgressBar.stories.sources.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.sources.js +2 -0
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts +3 -0
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBar.styles.js +3 -0
- package/dist/ui/ProgressBar/ProgressBarDeterminate.d.ts +1 -0
- package/dist/ui/ProgressBar/ProgressBarDeterminate.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBarDeterminate.js +3 -2
- package/dist/ui/ProgressBar/ProgressBarIndeterminate.d.ts +3 -1
- package/dist/ui/ProgressBar/ProgressBarIndeterminate.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBarIndeterminate.js +4 -2
- package/dist/ui/ProgressBar/ProgressBarLoop.d.ts +3 -1
- package/dist/ui/ProgressBar/ProgressBarLoop.d.ts.map +1 -1
- package/dist/ui/ProgressBar/ProgressBarLoop.js +3 -2
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ALVEOLE_COMPONENTS_VERSION: "1.
|
|
1
|
+
export declare const ALVEOLE_COMPONENTS_VERSION: "1.7.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ALVEOLE_COMPONENTS_VERSION = "1.
|
|
1
|
+
export const ALVEOLE_COMPONENTS_VERSION = "1.7.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/ui/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyB,UAAU,IAAI,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAOjF,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CACpD;IACE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,GAAG,CAAC,wBAAwB,GAAG,qBAAqB,CAAC,CACvD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.ts","sourceRoot":"","sources":["../../../src/ui/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAyB,UAAU,IAAI,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAOjF,KAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CACpD;IACE,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,GAAG,CAAC,wBAAwB,GAAG,qBAAqB,CAAC,CACvD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,sBAwDlD,CAAC"}
|
|
@@ -13,5 +13,5 @@ export const BottomSheet = (props) => {
|
|
|
13
13
|
const styles = useStyles();
|
|
14
14
|
const { bottom } = useSafeAreaInsets();
|
|
15
15
|
const snapPointsMode = fitContent ? 'fit' : 'percent';
|
|
16
|
-
return (_jsx(Box, { tag: "sheet", style: styles.container, children: _jsxs(TamaguiSheet, { modal: true, forceRemoveScrollEnabled: open, open: open, onOpenChange: setOpen, snapPoints: fitContent ? undefined : points, snapPointsMode: snapPointsMode, dismissOnSnapToBottom: true, position: position, onPositionChange: setPosition, zIndex: 100000, animation: "medium", children: [_jsx(TamaguiSheet.Overlay, { style: styles.overlay }), _jsxs(TamaguiSheet.Frame, { style: styles.frame, children: [_jsx(TamaguiSheet.Handle, { style: styles.handle }), _jsxs(Box, { tag: "sheet-header", style: styles.header, children: [_jsx(Box, { children: _jsx(ButtonIcon, { icon: "X", variant: "tertiary", size: "md", onPress: () => setOpen(false) }) }), _jsx(Box, { flex: 1, children: _jsx(Typography, { style: styles.title, children: title }) }), action && (_jsx(Box, { mt: 'auto', mb: 'auto', children: action }))] }), _jsx(
|
|
16
|
+
return (_jsx(Box, { tag: "sheet", style: styles.container, children: _jsxs(TamaguiSheet, { modal: true, forceRemoveScrollEnabled: open, open: open, onOpenChange: setOpen, snapPoints: fitContent ? undefined : points, snapPointsMode: snapPointsMode, dismissOnSnapToBottom: true, position: position, onPositionChange: setPosition, zIndex: 100000, animation: "medium", children: [_jsx(TamaguiSheet.Overlay, { style: styles.overlay }), _jsxs(TamaguiSheet.Frame, { style: styles.frame, children: [_jsx(TamaguiSheet.Handle, { style: styles.handle }), _jsxs(Box, { tag: "sheet-header", style: styles.header, children: [_jsx(Box, { children: _jsx(ButtonIcon, { icon: "X", variant: "tertiary", size: "md", onPress: () => setOpen(false) }) }), _jsx(Box, { flex: 1, children: _jsx(Typography, { style: styles.title, children: title }) }), action && (_jsx(Box, { mt: 'auto', mb: 'auto', children: action }))] }), _jsx(Box, { pl: '2W', pr: '2W', children: _jsx(Divider, {}) }), _jsx(Box, { tag: "sheet-content", style: [styles.content, !fitContent && styles.contentFull], pb: bottom, children: children })] })] }) }));
|
|
17
17
|
};
|
|
@@ -8,7 +8,9 @@ export type ListItemProps = BoxProps & {
|
|
|
8
8
|
description?: string;
|
|
9
9
|
IconProps?: Pick<IconProps, 'color' | 'name'>;
|
|
10
10
|
AvatarProps?: Pick<AvatarProps, 'fallbackText' | 'src'>;
|
|
11
|
-
RadioProps?: Pick<RadioInputProps, 'checked' | 'onChange' | 'value'
|
|
11
|
+
RadioProps?: Pick<RadioInputProps, 'checked' | 'onChange' | 'value'> & {
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
};
|
|
12
14
|
preview_url?: string;
|
|
13
15
|
trailing?: () => React.ReactNode;
|
|
14
16
|
loading?: boolean;
|
|
@@ -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;
|
|
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;AAEhD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AACtD,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAI5D,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,UAAU,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9F,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,sBA4G5C,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Box, Image, Typography } from '../../core';
|
|
4
4
|
import { Avatar } from '../Avatar';
|
|
5
|
+
import { CheckboxContainer, CheckboxIndicator } from '../Checkbox';
|
|
5
6
|
import { LucideIcon } from '../LucideIcon';
|
|
6
7
|
import { RadioGroup } from '../RadioGroup';
|
|
7
8
|
import { Spinner } from '../Spinner';
|
|
@@ -14,7 +15,9 @@ export const ListItem = (props) => {
|
|
|
14
15
|
onPress?.(event);
|
|
15
16
|
}, [RadioProps, onPress]);
|
|
16
17
|
const styles = useStyles();
|
|
17
|
-
return (_jsxs(Box, { children: [_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: onPress || RadioProps ? styles.itemHover : {}, onPress: handlePress, ...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(Box, { display: "flex", flexDirection: "row", gap: '3V', children: [RadioProps && (_jsx(Box, { mt: 'auto', mb: 'auto', onPress: event => {
|
|
18
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { tag: "resource-item", style: [styles.item, style], hoverStyle: onPress || RadioProps ? styles.itemHover : {}, onPress: handlePress, ...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(Box, { display: "flex", flexDirection: "row", gap: '3V', children: [RadioProps && RadioProps.multiple !== true && (_jsx(Box, { mt: 'auto', mb: 'auto', onPress: event => {
|
|
18
19
|
event.stopPropagation();
|
|
19
|
-
}, children: _jsx(RadioGroup.Input, { id: `${title}--radio`, size: "md", ...RadioProps }) })),
|
|
20
|
+
}, children: _jsx(RadioGroup.Input, { id: `${title}--radio`, size: "md", ...RadioProps }) })), RadioProps && RadioProps.multiple === true && (_jsx(Box, { mt: 'auto', mb: 'auto', onPress: event => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
}, children: _jsx(CheckboxContainer, { id: `${title}--checkbox`, checked: RadioProps.checked, onCheckedChange: () => RadioProps.onChange?.(RadioProps.value), children: _jsx(CheckboxIndicator, {}) }) })), IconProps && (_jsx(Box, { mt: 'auto', mb: 'auto', children: _jsx(LucideIcon, { size: "sm", color: styles.defaultIcon.color, ...IconProps }) })), AvatarProps && (_jsx(Box, { mt: 'auto', mb: 'auto', children: _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(Spinner, { size: "sm" }) }))] }), children] }));
|
|
20
23
|
};
|
|
@@ -110,6 +110,7 @@ export declare const WithIcon: () => import("react").JSX.Element;
|
|
|
110
110
|
export declare const WithAvatar: () => import("react").JSX.Element;
|
|
111
111
|
export declare const WithPreviewImage: () => import("react").JSX.Element;
|
|
112
112
|
export declare const ItemRadio: () => import("react").JSX.Element;
|
|
113
|
+
export declare const ItemRadioMultiple: () => import("react").JSX.Element;
|
|
113
114
|
export declare const ItemRadioWithIcon: () => import("react").JSX.Element;
|
|
114
115
|
/** Sans prop `onPress`, l’effet de hover n’apparaît pas. */
|
|
115
116
|
export declare const withoutHover: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,OAAO,mCAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,mCASxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAS5B,CAAC;AAEF,eAAO,MAAM,QAAQ,mCASpB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAYtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAS5B,CAAC;AAEF,eAAO,MAAM,SAAS,mCAcrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mCAe7B,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,YAAY,mCAA6D,CAAC;AAEvF,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,OAAO,mCAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,mCASxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAS5B,CAAC;AAEF,eAAO,MAAM,QAAQ,mCASpB,CAAC;AAEF,eAAO,MAAM,UAAU,mCAYtB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mCAS5B,CAAC;AAEF,eAAO,MAAM,SAAS,mCAcrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mCAe7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mCAe7B,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,YAAY,mCAA6D,CAAC;AAEvF,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC"}
|
|
@@ -49,6 +49,15 @@ export const ItemRadio = () => {
|
|
|
49
49
|
onChange: v => setValue(v),
|
|
50
50
|
} }));
|
|
51
51
|
};
|
|
52
|
+
export const ItemRadioMultiple = () => {
|
|
53
|
+
const [value, setValue] = useState();
|
|
54
|
+
return (_jsx(ListItem, { title: "Titre", description: "Description", RadioProps: {
|
|
55
|
+
value: 'tutu',
|
|
56
|
+
checked: value === 'tutu',
|
|
57
|
+
onChange: v => setValue(v),
|
|
58
|
+
multiple: true,
|
|
59
|
+
} }));
|
|
60
|
+
};
|
|
52
61
|
export const ItemRadioWithIcon = () => {
|
|
53
62
|
const [value, setValue] = useState();
|
|
54
63
|
return (_jsx(ListItem, { title: "Titre", description: "Description", IconProps: { name: 'Settings' }, RadioProps: {
|
|
@@ -6,6 +6,7 @@ export declare const WithIcon: () => string;
|
|
|
6
6
|
export declare const WithAvatar: () => string;
|
|
7
7
|
export declare const WithPreviewImage: () => string;
|
|
8
8
|
export declare const ItemRadio: () => string;
|
|
9
|
+
export declare const ItemRadioMultiple: () => string;
|
|
9
10
|
export declare const ItemRadioWithIcon: () => string;
|
|
10
11
|
export declare const withoutHover: () => string;
|
|
11
12
|
export declare const storySources: {
|
|
@@ -17,6 +18,7 @@ export declare const storySources: {
|
|
|
17
18
|
readonly WithAvatar: () => string;
|
|
18
19
|
readonly WithPreviewImage: () => string;
|
|
19
20
|
readonly ItemRadio: () => string;
|
|
21
|
+
readonly ItemRadioMultiple: () => string;
|
|
20
22
|
readonly ItemRadioWithIcon: () => string;
|
|
21
23
|
readonly withoutHover: () => string;
|
|
22
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAoL,CAAC;AAEzM,eAAO,MAAM,YAAY,cAA0S,CAAC;AAEpU,eAAO,MAAM,WAAW,cAA4M,CAAC;AAErO,eAAO,MAAM,gBAAgB,cAAyN,CAAC;AAEvP,eAAO,MAAM,QAAQ,cAA6O,CAAC;AAEnQ,eAAO,MAAM,UAAU,cAAyU,CAAC;AAEjW,eAAO,MAAM,gBAAgB,cAAqR,CAAC;AAEnT,eAAO,MAAM,SAAS,cAAqU,CAAC;AAE5V,eAAO,MAAM,iBAAiB,cAAqX,CAAC;AAEpZ,eAAO,MAAM,YAAY,cAAsG,CAAC;AAEhI,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"ListItem.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAoL,CAAC;AAEzM,eAAO,MAAM,YAAY,cAA0S,CAAC;AAEpU,eAAO,MAAM,WAAW,cAA4M,CAAC;AAErO,eAAO,MAAM,gBAAgB,cAAyN,CAAC;AAEvP,eAAO,MAAM,QAAQ,cAA6O,CAAC;AAEnQ,eAAO,MAAM,UAAU,cAAyU,CAAC;AAEjW,eAAO,MAAM,gBAAgB,cAAqR,CAAC;AAEnT,eAAO,MAAM,SAAS,cAAqU,CAAC;AAE5V,eAAO,MAAM,iBAAiB,cAAsW,CAAC;AAErY,eAAO,MAAM,iBAAiB,cAAqX,CAAC;AAEpZ,eAAO,MAAM,YAAY,cAAsG,CAAC;AAEhI,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAGtE,CAAC"}
|
|
@@ -8,6 +8,7 @@ export const WithIcon = () => "export const WithIcon = () => (\n <ListItem\n
|
|
|
8
8
|
export const WithAvatar = () => "export const WithAvatar = () => (\n <ListItem\n title=\"Titre\"\n description=\"Description\"\n AvatarProps={{\n fallbackText: 'Jean Pierre',\n src: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400',\n }}\n onPress={() => {\n window.alert('click !');\n }}\n />\n);";
|
|
9
9
|
export const WithPreviewImage = () => "export const WithPreviewImage = () => (\n <ListItem\n title=\"Titre\"\n description=\"Description\"\n preview_url=\"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400\"\n onPress={() => {\n window.alert('click !');\n }}\n />\n);";
|
|
10
10
|
export const ItemRadio = () => "export const ItemRadio = () => {\n const [value, setValue] = useState<string>();\n\n return (\n <ListItem\n title=\"Titre\"\n description=\"Description\"\n RadioProps={{\n value: 'tutu',\n checked: value === 'tutu',\n onChange: v => setValue(v),\n }}\n />\n );\n};";
|
|
11
|
+
export const ItemRadioMultiple = () => "export const ItemRadioMultiple = () => {\n const [value, setValue] = useState<string>();\n\n return (\n <ListItem\n title=\"Titre\"\n description=\"Description\"\n RadioProps={{\n value: 'tutu',\n checked: value === 'tutu',\n onChange: v => setValue(v),\n multiple: true,\n }}\n />\n );\n};";
|
|
11
12
|
export const ItemRadioWithIcon = () => "export const ItemRadioWithIcon = () => {\n const [value, setValue] = useState<string>();\n\n return (\n <ListItem\n title=\"Titre\"\n description=\"Description\"\n IconProps={{ name: 'Settings' }}\n RadioProps={{\n value: 'tutu',\n checked: value === 'tutu',\n onChange: v => setValue(v),\n }}\n />\n );\n};";
|
|
12
13
|
export const withoutHover = () => "export const withoutHover = () => <ListItem title=\"Titre\" description=\"Description\" />;";
|
|
13
14
|
export const storySources = {
|
|
@@ -19,6 +20,7 @@ export const storySources = {
|
|
|
19
20
|
WithAvatar,
|
|
20
21
|
WithPreviewImage,
|
|
21
22
|
ItemRadio,
|
|
23
|
+
ItemRadioMultiple,
|
|
22
24
|
ItemRadioWithIcon,
|
|
23
25
|
withoutHover,
|
|
24
26
|
};
|
|
@@ -6,6 +6,7 @@ export type ProgressBarProps = BoxProps & {
|
|
|
6
6
|
indicator?: boolean;
|
|
7
7
|
indicatorPrecision?: 0 | 1 | 2 | 3;
|
|
8
8
|
mode?: ProgressBarMode;
|
|
9
|
+
noRadius?: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const ProgressBar: (props: ProgressBarProps) => import("react").JSX.Element | null;
|
|
11
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,eAAe,GAAG,aAAa,GAAG,eAAe,GAAG,MAAM,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,eAAe,GAAG,aAAa,GAAG,eAAe,GAAG,MAAM,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,uCAclD,CAAC"}
|
|
@@ -56,6 +56,9 @@ declare const _default: {
|
|
|
56
56
|
borderRadius: import("@alveole/theme").Radius;
|
|
57
57
|
backgroundColor: string;
|
|
58
58
|
};
|
|
59
|
+
noRadius: {
|
|
60
|
+
borderRadius: number;
|
|
61
|
+
};
|
|
59
62
|
indicator: {
|
|
60
63
|
color: string;
|
|
61
64
|
marginTop: string | number;
|
|
@@ -74,6 +77,7 @@ export declare const Determinate: () => React.JSX.Element;
|
|
|
74
77
|
export declare const Loop: () => React.JSX.Element;
|
|
75
78
|
export declare const Indeterminate: () => React.JSX.Element;
|
|
76
79
|
export declare const WithIndicator: () => React.JSX.Element;
|
|
80
|
+
export declare const NoRadius: () => React.JSX.Element;
|
|
77
81
|
export declare const Usage: () => React.JSX.Element;
|
|
78
82
|
export * as Sources from './ProgressBar.stories.sources';
|
|
79
83
|
//# sourceMappingURL=ProgressBar.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"ProgressBar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK1B,wBAOkB;AAElB,eAAO,MAAM,WAAW,yBAAwD,CAAC;AAEjF,eAAO,MAAM,IAAI,yBAAoC,CAAC;AAEtD,eAAO,MAAM,aAAa,yBAA6C,CAAC;AAExE,eAAO,MAAM,aAAa,yBAAkE,CAAC;AAE7F,eAAO,MAAM,QAAQ,yBAAiE,CAAC;AAEvF,eAAO,MAAM,KAAK,yBAmBjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC"}
|
|
@@ -15,6 +15,7 @@ export const Determinate = () => _jsx(ProgressBar, { mode: "determinate", value:
|
|
|
15
15
|
export const Loop = () => _jsx(ProgressBar, { mode: "loop" });
|
|
16
16
|
export const Indeterminate = () => _jsx(ProgressBar, { mode: "indeterminate" });
|
|
17
17
|
export const WithIndicator = () => _jsx(ProgressBar, { mode: "determinate", indicator: true, value: 0.25 });
|
|
18
|
+
export const NoRadius = () => _jsx(ProgressBar, { mode: "determinate", noRadius: true, value: 0.25 });
|
|
18
19
|
export const Usage = () => {
|
|
19
20
|
const [value, setValue] = React.useState(0.25);
|
|
20
21
|
return (_jsxs(Box, { children: [_jsx(ProgressBar, { value: value }), _jsx(Box, { mt: '2W', width: 150, children: _jsx(Button, { title: value < 1 ? 'Augmenter' : 'Réduire', variant: "secondary", onPress: () => {
|
|
@@ -2,12 +2,14 @@ export declare const Determinate: () => string;
|
|
|
2
2
|
export declare const Loop: () => string;
|
|
3
3
|
export declare const Indeterminate: () => string;
|
|
4
4
|
export declare const WithIndicator: () => string;
|
|
5
|
+
export declare const NoRadius: () => string;
|
|
5
6
|
export declare const Usage: () => string;
|
|
6
7
|
export declare const storySources: {
|
|
7
8
|
readonly Determinate: () => string;
|
|
8
9
|
readonly Loop: () => string;
|
|
9
10
|
readonly Indeterminate: () => string;
|
|
10
11
|
readonly WithIndicator: () => string;
|
|
12
|
+
readonly NoRadius: () => string;
|
|
11
13
|
readonly Usage: () => string;
|
|
12
14
|
};
|
|
13
15
|
export type StorySourceName = keyof typeof storySources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,cAA8F,CAAC;AAEvH,eAAO,MAAM,IAAI,cAAmE,CAAC;AAErF,eAAO,MAAM,aAAa,cAAqF,CAAC;AAEhH,eAAO,MAAM,aAAa,cAA0G,CAAC;AAErI,eAAO,MAAM,KAAK,cAAge,CAAC;AAEnf,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"ProgressBar.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,cAA8F,CAAC;AAEvH,eAAO,MAAM,IAAI,cAAmE,CAAC;AAErF,eAAO,MAAM,aAAa,cAAqF,CAAC;AAEhH,eAAO,MAAM,aAAa,cAA0G,CAAC;AAErI,eAAO,MAAM,QAAQ,cAAoG,CAAC;AAE1H,eAAO,MAAM,KAAK,cAAge,CAAC;AAEnf,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -4,11 +4,13 @@ export const Determinate = () => "export const Determinate = () => <ProgressBar
|
|
|
4
4
|
export const Loop = () => "export const Loop = () => <ProgressBar mode=\"loop\" />;";
|
|
5
5
|
export const Indeterminate = () => "export const Indeterminate = () => <ProgressBar mode=\"indeterminate\" />;";
|
|
6
6
|
export const WithIndicator = () => "export const WithIndicator = () => <ProgressBar mode=\"determinate\" indicator value={0.25} />;";
|
|
7
|
+
export const NoRadius = () => "export const NoRadius = () => <ProgressBar mode=\"determinate\" noRadius value={0.25} />;";
|
|
7
8
|
export const Usage = () => "export const Usage = () => {\n const [value, setValue] = React.useState(0.25);\n\n return (\n <Box>\n <ProgressBar value={value} />\n\n <Box mt={'2W'} width={150}>\n <Button\n title={value < 1 ? 'Augmenter' : 'Réduire'}\n variant=\"secondary\"\n onPress={() => {\n if (value < 1) setValue(v => v + 0.25);\n else setValue(v => v - 0.25);\n }}\n />\n </Box>\n </Box>\n );\n};";
|
|
8
9
|
export const storySources = {
|
|
9
10
|
Determinate,
|
|
10
11
|
Loop,
|
|
11
12
|
Indeterminate,
|
|
12
13
|
WithIndicator,
|
|
14
|
+
NoRadius,
|
|
13
15
|
Usage,
|
|
14
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"ProgressBar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DnB,CAAC"}
|
|
@@ -50,6 +50,9 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
50
50
|
borderRadius: radius('sm'),
|
|
51
51
|
backgroundColor: color.light.border['default-grey'],
|
|
52
52
|
},
|
|
53
|
+
noRadius: {
|
|
54
|
+
borderRadius: 0,
|
|
55
|
+
},
|
|
53
56
|
indicator: {
|
|
54
57
|
...text['Corps de texte'].XS.Regular,
|
|
55
58
|
color: color.light.artwork['major-primary'],
|
|
@@ -4,6 +4,7 @@ export type ProgressBarDeterminateProps = BoxProps & {
|
|
|
4
4
|
indicator?: boolean;
|
|
5
5
|
indicatorPrecision?: 0 | 1 | 2 | 3;
|
|
6
6
|
clamped: number;
|
|
7
|
+
noRadius?: boolean;
|
|
7
8
|
};
|
|
8
9
|
export declare const ProgressBarDeterminate: (props: ProgressBarDeterminateProps) => React.JSX.Element;
|
|
9
10
|
//# sourceMappingURL=ProgressBarDeterminate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarDeterminate.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarDeterminate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBarDeterminate.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarDeterminate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,2BAA2B,sBA4CxE,CAAC"}
|
|
@@ -6,8 +6,9 @@ import { Typography } from '../../core/Typography';
|
|
|
6
6
|
import { PROGRESS_BAR_GAP, PROGRESS_BAR_HEIGHT, PROGRESS_DETERMINATE_DURATION } from './ProgressBar.constants';
|
|
7
7
|
import { useStyles } from './ProgressBar.styles';
|
|
8
8
|
export const ProgressBarDeterminate = (props) => {
|
|
9
|
-
const { clamped, indicator, indicatorPrecision = 3, style, onLayout, ...boxProps } = props;
|
|
9
|
+
const { clamped, indicator, indicatorPrecision = 3, noRadius, style, onLayout, ...boxProps } = props;
|
|
10
10
|
const styles = useStyles();
|
|
11
|
+
const radiusStyle = noRadius ? styles.noRadius : undefined;
|
|
11
12
|
const [animatedProgress] = React.useState(() => new Animated.Value(clamped));
|
|
12
13
|
const remaining = React.useMemo(() => Animated.subtract(1, animatedProgress), [animatedProgress]);
|
|
13
14
|
const animatedGap = React.useMemo(() => animatedProgress.interpolate({
|
|
@@ -25,5 +26,5 @@ export const ProgressBarDeterminate = (props) => {
|
|
|
25
26
|
anim.start();
|
|
26
27
|
return () => anim.stop();
|
|
27
28
|
}, [animatedProgress, clamped]);
|
|
28
|
-
return (_jsxs(Box, { children: [_jsxs(Box, { style: [styles.determinate, { height: PROGRESS_BAR_HEIGHT }, style], ...boxProps, children: [_jsx(Animated.View, { style: [styles.progressed, { flex: animatedProgress }] }), _jsx(Animated.View, { style: { width: animatedGap } }), _jsx(Animated.View, { style: [styles.remaining, { flex: remaining }] })] }), indicator && (_jsx(Box, { children: _jsxs(Typography, { style: styles.indicator, children: [(clamped * 100).toFixed(indicatorPrecision), "%"] }) }))] }));
|
|
29
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { style: [styles.determinate, { height: PROGRESS_BAR_HEIGHT }, style], ...boxProps, children: [_jsx(Animated.View, { style: [styles.progressed, radiusStyle, { flex: animatedProgress }] }), _jsx(Animated.View, { style: { width: animatedGap } }), _jsx(Animated.View, { style: [styles.remaining, radiusStyle, { flex: remaining }] })] }), indicator && (_jsx(Box, { children: _jsxs(Typography, { style: styles.indicator, children: [(clamped * 100).toFixed(indicatorPrecision), "%"] }) }))] }));
|
|
29
30
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../../core';
|
|
3
|
-
export type ProgressBarIndeterminateProps = BoxProps
|
|
3
|
+
export type ProgressBarIndeterminateProps = BoxProps & {
|
|
4
|
+
noRadius?: boolean;
|
|
5
|
+
};
|
|
4
6
|
export declare const ProgressBarIndeterminate: (props: ProgressBarIndeterminateProps) => React.JSX.Element;
|
|
5
7
|
//# sourceMappingURL=ProgressBarIndeterminate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarIndeterminate.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarIndeterminate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,MAAM,6BAA6B,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBarIndeterminate.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarIndeterminate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,OAAO,6BAA6B,sBA+D5E,CAAC"}
|
|
@@ -5,9 +5,10 @@ import { Box } from '../../core';
|
|
|
5
5
|
import { PROGRESS_BAR_HEIGHT, PROGRESS_DURATION } from './ProgressBar.constants';
|
|
6
6
|
import { useStyles } from './ProgressBar.styles';
|
|
7
7
|
export const ProgressBarIndeterminate = (props) => {
|
|
8
|
-
const { style, ...boxProps } = props;
|
|
8
|
+
const { noRadius, style, ...boxProps } = props;
|
|
9
9
|
const [progress] = React.useState(() => new Animated.Value(0));
|
|
10
10
|
const styles = useStyles();
|
|
11
|
+
const radiusStyle = noRadius ? styles.noRadius : undefined;
|
|
11
12
|
const translateRange = React.useMemo(() => progress.interpolate({
|
|
12
13
|
inputRange: [0, 1],
|
|
13
14
|
outputRange: ['-50%', '150%'],
|
|
@@ -34,10 +35,11 @@ export const ProgressBarIndeterminate = (props) => {
|
|
|
34
35
|
run();
|
|
35
36
|
return () => anim?.stop();
|
|
36
37
|
}, [progress]);
|
|
37
|
-
return (_jsx(Box, { style: [styles.progress, { height: PROGRESS_BAR_HEIGHT, marginTop: -PROGRESS_BAR_HEIGHT }, style], ...boxProps, children: _jsx(Animated.View, { style: [
|
|
38
|
+
return (_jsx(Box, { style: [styles.progress, radiusStyle, { height: PROGRESS_BAR_HEIGHT, marginTop: -PROGRESS_BAR_HEIGHT }, style], ...boxProps, children: _jsx(Animated.View, { style: [
|
|
38
39
|
{
|
|
39
40
|
transform: [{ translateX: translateRange }, { scaleX: scaleRange }],
|
|
40
41
|
},
|
|
41
42
|
styles.bar,
|
|
43
|
+
radiusStyle,
|
|
42
44
|
] }) }));
|
|
43
45
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../../core';
|
|
3
|
-
export type ProgressBarLoopProps = BoxProps
|
|
3
|
+
export type ProgressBarLoopProps = BoxProps & {
|
|
4
|
+
noRadius?: boolean;
|
|
5
|
+
};
|
|
4
6
|
export declare const ProgressBarLoop: (props: ProgressBarLoopProps) => React.JSX.Element;
|
|
5
7
|
//# sourceMappingURL=ProgressBarLoop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBarLoop.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarLoop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ProgressBarLoop.d.ts","sourceRoot":"","sources":["../../../src/ui/ProgressBar/ProgressBarLoop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAO,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,sBA4D1D,CAAC"}
|
|
@@ -5,9 +5,10 @@ import { Box } from '../../core';
|
|
|
5
5
|
import { PROGRESS_BAR_GAP, PROGRESS_BAR_HEIGHT, PROGRESS_DURATION } from './ProgressBar.constants';
|
|
6
6
|
import { useStyles } from './ProgressBar.styles';
|
|
7
7
|
export const ProgressBarLoop = (props) => {
|
|
8
|
-
const { style, onLayout, ...boxProps } = props;
|
|
8
|
+
const { noRadius, style, onLayout, ...boxProps } = props;
|
|
9
9
|
const [progress] = React.useState(() => new Animated.Value(0));
|
|
10
10
|
const styles = useStyles();
|
|
11
|
+
const radiusStyle = noRadius ? styles.noRadius : undefined;
|
|
11
12
|
const [width, setWidth] = React.useState(0);
|
|
12
13
|
const loopProgressWidth = React.useMemo(() => Math.max(width - PROGRESS_BAR_GAP, 0), [width]);
|
|
13
14
|
const loopFillWidth = React.useMemo(() => progress.interpolate({
|
|
@@ -33,5 +34,5 @@ export const ProgressBarLoop = (props) => {
|
|
|
33
34
|
setWidth(event.nativeEvent.layout.width);
|
|
34
35
|
onLayout?.(event);
|
|
35
36
|
}, [onLayout]);
|
|
36
|
-
return (_jsxs(Box, { style: [styles.progressTrack, { height: PROGRESS_BAR_HEIGHT }, style], onLayout: handleLayout, ...boxProps, children: [_jsx(Animated.View, { style: [styles.progressedAbsolute, { width: loopFillWidth }] }), _jsx(Animated.View, { style: [styles.remainingAbsolute, { left: loopRemainingLeft }] })] }));
|
|
37
|
+
return (_jsxs(Box, { style: [styles.progressTrack, { height: PROGRESS_BAR_HEIGHT }, style], onLayout: handleLayout, ...boxProps, children: [_jsx(Animated.View, { style: [styles.progressedAbsolute, radiusStyle, { width: loopFillWidth }] }), _jsx(Animated.View, { style: [styles.remainingAbsolute, radiusStyle, { left: loopRemainingLeft }] })] }));
|
|
37
38
|
};
|