@alveole/components 0.31.3 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Lottie/Lottie.d.ts +9 -1
- package/dist/core/Lottie/Lottie.d.ts.map +1 -1
- package/dist/core/Lottie/Lottie.js +1 -1
- package/dist/core/Lottie/Lottie.stories.d.ts +2 -0
- package/dist/core/Lottie/Lottie.stories.d.ts.map +1 -1
- package/dist/core/Lottie/Lottie.stories.js +4 -2
- package/dist/ui/Button/Button.d.ts +2 -0
- package/dist/ui/Button/Button.d.ts.map +1 -1
- package/dist/ui/Button/Button.js +6 -6
- package/dist/ui/Button/Button.stories.d.ts +2 -0
- package/dist/ui/Button/Button.stories.d.ts.map +1 -1
- package/dist/ui/Button/Button.stories.js +1 -0
- package/package.json +1 -1
|
@@ -2,7 +2,15 @@ import LottieView from 'lottie-react-native';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export type LottieDimensionValue = number | `${string}%` | undefined;
|
|
4
4
|
export declare const isLottieDimensionValue: (dimension: unknown) => dimension is LottieDimensionValue;
|
|
5
|
-
export type
|
|
5
|
+
export type LottieLoopProps = {
|
|
6
|
+
loop: true;
|
|
7
|
+
onLoop?: React.ComponentProps<typeof LottieView>['onAnimationLoop'];
|
|
8
|
+
};
|
|
9
|
+
export type LottieOneTimeProps = {
|
|
10
|
+
loop: false;
|
|
11
|
+
onFinish?: React.ComponentProps<typeof LottieView>['onAnimationFinish'];
|
|
12
|
+
};
|
|
13
|
+
export type LottieProps = (LottieLoopProps | LottieOneTimeProps) & {
|
|
6
14
|
style: React.ComponentProps<typeof LottieView>['style'];
|
|
7
15
|
source: React.ComponentProps<typeof LottieView>['source'];
|
|
8
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lottie.d.ts","sourceRoot":"","sources":["../../../src/core/Lottie/Lottie.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,qBAAqB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Lottie = (props) => {
|
|
|
16
16
|
const { style } = props;
|
|
17
17
|
const height = style && 'height' in style && isLottieDimensionValue(style.height) ? style.height : undefined;
|
|
18
18
|
const width = style && 'width' in style && isLottieDimensionValue(style.width) ? style.width : undefined;
|
|
19
|
-
return (_jsx(View, { style: { height, width }, children: _jsx(LottieView, { autoPlay: true,
|
|
19
|
+
return (_jsx(View, { style: { height, width }, children: _jsx(LottieView, { autoPlay: true, resizeMode: "contain", ...props }) }));
|
|
20
20
|
};
|
|
@@ -9,4 +9,6 @@ declare const _default: {
|
|
|
9
9
|
export default _default;
|
|
10
10
|
export declare const Default: () => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const Size: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Loop: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const OneTime: () => import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=Lottie.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lottie.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Lottie/Lottie.stories.tsx"],"names":[],"mappings":";;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,+
|
|
1
|
+
{"version":3,"file":"Lottie.stories.d.ts","sourceRoot":"","sources":["../../../src/core/Lottie/Lottie.stories.tsx"],"names":[],"mappings":";;;;;;;;AAIA,wBAOkB;AAElB,eAAO,MAAM,OAAO,+CAAiF,CAAC;AAEtG,eAAO,MAAM,IAAI,+CAAiF,CAAC;AAEnG,eAAO,MAAM,IAAI,+CAAsG,CAAC;AAExH,eAAO,MAAM,OAAO,+CAEnB,CAAC"}
|
|
@@ -9,5 +9,7 @@ export default {
|
|
|
9
9
|
component: Lottie,
|
|
10
10
|
styleFn: () => 'Aucun style',
|
|
11
11
|
};
|
|
12
|
-
export const Default = () => _jsx(Lottie, { style: { width: 32, height: 32 }, source: dotsAnimation });
|
|
13
|
-
export const Size = () => _jsx(Lottie, { style: { width: 60, height: 60 }, source: dotsAnimation });
|
|
12
|
+
export const Default = () => _jsx(Lottie, { loop: true, style: { width: 32, height: 32 }, source: dotsAnimation });
|
|
13
|
+
export const Size = () => _jsx(Lottie, { loop: true, style: { width: 60, height: 60 }, source: dotsAnimation });
|
|
14
|
+
export const Loop = () => _jsx(Lottie, { loop: true, style: { width: 60, height: 60 }, source: dotsAnimation, onLoop: console.log });
|
|
15
|
+
export const OneTime = () => (_jsx(Lottie, { loop: false, style: { width: 60, height: 60 }, source: dotsAnimation, onFinish: console.log }));
|
|
@@ -15,6 +15,7 @@ export type ButtonProps = Omit<PressableProps, 'children' | 'style'> & {
|
|
|
15
15
|
borderNone?: boolean;
|
|
16
16
|
leftAlign?: boolean;
|
|
17
17
|
type?: 'button' | 'submit';
|
|
18
|
+
active?: boolean;
|
|
18
19
|
isLoading?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare const Button: React.ForwardRefExoticComponent<Omit<PressableProps, "children" | "style"> & {
|
|
@@ -30,6 +31,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<PressableProps
|
|
|
30
31
|
borderNone?: boolean;
|
|
31
32
|
leftAlign?: boolean;
|
|
32
33
|
type?: "button" | "submit";
|
|
34
|
+
active?: boolean;
|
|
33
35
|
isLoading?: boolean;
|
|
34
36
|
} & React.RefAttributes<View>>;
|
|
35
37
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA0C,cAAc,EAA8B,IAAI,EAAE,MAAM,cAAc,CAAC;AACxH,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAc,MAAM,eAAe,CAAC;AAOtD,MAAM,MAAM,WAAW,GAAG,IAAI,CAA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AClE,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,MAAM;WAhBV,MAAM;WACN,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI;aACvB,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM;gBACrD,SAAS,CAAC,MAAM,CAAC;cACnB,SAAS,CAAC,MAAM,CAAC;eAChB,OAAO;qBACD,QAAQ;gBACb,OAAO;gBACP,OAAO;iBACN,OAAO;gBACR,OAAO;WACZ,QAAQ,GAAG,QAAQ;aACjB,OAAO;gBACJ,OAAO;8BA4MnB,CAAC"}
|
package/dist/ui/Button/Button.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Box, Typography } from '../../core';
|
|
|
5
5
|
import { LucideIcon } from '../LucideIcon';
|
|
6
6
|
import { useStyles } from './Button.styles';
|
|
7
7
|
export const Button = React.forwardRef(function Button(props, ref) {
|
|
8
|
-
const { title, type, size, variant, disabled, startIcon, endIcon, noPadding, borderNone, leftAlign, isLoading, selected, fullWidth = false, ContainerProps = {}, ...buttonProps } = props;
|
|
8
|
+
const { title, type, size, variant, disabled, startIcon, endIcon, noPadding, borderNone, leftAlign, isLoading, selected, fullWidth = false, ContainerProps = {}, active = false, ...buttonProps } = props;
|
|
9
9
|
const { style, hoverStyle, ...containerProps } = ContainerProps;
|
|
10
10
|
const styles = useStyles();
|
|
11
11
|
const containerSize = size === 'sm'
|
|
@@ -42,35 +42,35 @@ export const Button = React.forwardRef(function Button(props, ref) {
|
|
|
42
42
|
applicableStyles = { ...applicableStyles, ...styles.primaryContainer };
|
|
43
43
|
if (disabled)
|
|
44
44
|
applicableStyles = { ...applicableStyles, ...styles.primaryContainerDisabled };
|
|
45
|
-
else if (state?.pressed)
|
|
45
|
+
else if (state?.pressed || active)
|
|
46
46
|
applicableStyles = { ...applicableStyles, ...styles.primaryContainerPressed };
|
|
47
47
|
}
|
|
48
48
|
else if (variant === 'secondary') {
|
|
49
49
|
applicableStyles = { ...applicableStyles, ...styles.secondaryContainer };
|
|
50
50
|
if (disabled)
|
|
51
51
|
applicableStyles = { ...applicableStyles, ...styles.secondaryContainerDisabled };
|
|
52
|
-
else if (state?.pressed)
|
|
52
|
+
else if (state?.pressed || active)
|
|
53
53
|
applicableStyles = { ...applicableStyles, ...styles.secondaryContainerPressed };
|
|
54
54
|
}
|
|
55
55
|
else if (variant === 'tertiary') {
|
|
56
56
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainer };
|
|
57
57
|
if (disabled)
|
|
58
58
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerDisabled };
|
|
59
|
-
else if (state?.pressed)
|
|
59
|
+
else if (state?.pressed || active)
|
|
60
60
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerPressed };
|
|
61
61
|
}
|
|
62
62
|
else if (variant === 'danger') {
|
|
63
63
|
applicableStyles = { ...applicableStyles, ...styles.dangerContainer };
|
|
64
64
|
if (disabled)
|
|
65
65
|
applicableStyles = { ...applicableStyles, ...styles.dangerContainerDisabled };
|
|
66
|
-
else if (state?.pressed)
|
|
66
|
+
else if (state?.pressed || active)
|
|
67
67
|
applicableStyles = { ...applicableStyles, ...styles.dangerContainerPressed };
|
|
68
68
|
}
|
|
69
69
|
else if (variant === 'link') {
|
|
70
70
|
applicableStyles = { ...applicableStyles, ...styles.linkContainer };
|
|
71
71
|
if (disabled)
|
|
72
72
|
applicableStyles = { ...applicableStyles, ...styles.tertiaryContainerDisabled };
|
|
73
|
-
else if (state?.pressed)
|
|
73
|
+
else if (state?.pressed || active)
|
|
74
74
|
applicableStyles = { ...applicableStyles, ...styles.linkContainerPressed };
|
|
75
75
|
}
|
|
76
76
|
return {
|
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
borderNone?: boolean;
|
|
18
18
|
leftAlign?: boolean;
|
|
19
19
|
type?: "button" | "submit";
|
|
20
|
+
active?: boolean;
|
|
20
21
|
isLoading?: boolean;
|
|
21
22
|
} & import("react").RefAttributes<import("react-native").View>>;
|
|
22
23
|
styleFn: () => {
|
|
@@ -308,4 +309,5 @@ export declare const Link: () => import("react/jsx-runtime").JSX.Element;
|
|
|
308
309
|
export declare const Icons: () => import("react/jsx-runtime").JSX.Element;
|
|
309
310
|
export declare const FullWidth: () => import("react/jsx-runtime").JSX.Element;
|
|
310
311
|
export declare const Selected: () => import("react/jsx-runtime").JSX.Element;
|
|
312
|
+
export declare const Active: () => import("react/jsx-runtime").JSX.Element;
|
|
311
313
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Button/Button.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,KAAK,+CAMjB,CAAC;AAEF,eAAO,MAAM,OAAO,+CAKnB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAKrB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAKpB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAKlB,CAAC;AAEF,eAAO,MAAM,IAAI,+CAQhB,CAAC;AAEF,eAAO,MAAM,KAAK,+CAQjB,CAAC;AAEF,eAAO,MAAM,SAAS,+CAAkE,CAAC;AAEzF,eAAO,MAAM,QAAQ,+CAIpB,CAAC;AAEF,eAAO,MAAM,MAAM,+CAKlB,CAAC"}
|
|
@@ -21,3 +21,4 @@ export const Link = () => (_jsxs(_Fragment, { children: [_jsx(Typography, { chil
|
|
|
21
21
|
export const Icons = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, children: [_jsx(Button, { variant: "primary", title: "Start Icon", startIcon: "Plus" }), _jsx(Button, { variant: "primary", title: "End Icon", endIcon: "Plus" }), _jsx(Button, { variant: "primary", title: "End Icon", endIcon: "Plus" }), _jsx(ButtonIcon, { variant: "primary", icon: "CircleUser" }), _jsx(ButtonIcon, { variant: "primary", icon: "CircleUser" })] }));
|
|
22
22
|
export const FullWidth = () => _jsx(Button, { variant: "primary", title: "Full Width", fullWidth: true });
|
|
23
23
|
export const Selected = () => (_jsx(Box, { display: "flex", flexDirection: "row", gap: 4, children: _jsx(Button, { variant: "secondary", title: "Selected", selected: true }) }));
|
|
24
|
+
export const Active = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, children: [_jsx(Typography, { children: "Utilis\u00E9 quand le bouton est actif (ex: quand un menu est ouvert)" }), _jsx(Button, { variant: "secondary", title: "Active", active: true })] }));
|