@alveole/components 0.16.12 → 0.17.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.
@@ -1,6 +1,6 @@
1
1
  import { makeStyles } from '@alveole/theme';
2
- export const useStyles = makeStyles(({ isVariant, spacing }) => {
3
- const paddingValue = isVariant('mobile') ? spacing('100') : spacing('150');
2
+ export const useStyles = makeStyles(({ externalPadding, spacing }) => {
3
+ const paddingValue = externalPadding();
4
4
  return {
5
5
  section: {
6
6
  display: 'flex',
@@ -5,6 +5,7 @@ export type AvatarProps = {
5
5
  fallbackText?: string;
6
6
  style?: CSSProperties;
7
7
  src?: AvatarImageProps['src'];
8
+ carre?: boolean;
8
9
  };
9
10
  export declare const Avatar: (props: AvatarProps) => import("react/jsx-runtime").JSX.Element;
10
11
  //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,SAAS,CAAC;AAIpE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,GAAG,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;CAC/B,CAAC;AASF,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CAsBxC,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAA2B,MAAM,SAAS,CAAC;AAIpE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,GAAG,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AASF,eAAO,MAAM,MAAM,GAAI,OAAO,WAAW,4CA2BxC,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useTheme } from '@alveole/theme';
3
3
  import { Avatar as TamaguiAvatar } from 'tamagui';
4
4
  import { Typography } from '../../core';
5
- import { useStyles } from '././Avatar.styles';
5
+ import { useStyles } from './Avatar.styles';
6
6
  const getInitials = (name) => {
7
7
  const words = name.trim().split(/\s+/);
8
8
  if (words.length === 0)
@@ -12,7 +12,7 @@ const getInitials = (name) => {
12
12
  return (words[0][0] + words[1][0]).toUpperCase();
13
13
  };
14
14
  export const Avatar = (props) => {
15
- const { style, fallbackText, src, size, ...avatarProps } = props;
15
+ const { style, fallbackText, src, size, carre, ...avatarProps } = props;
16
16
  const initials = getInitials(fallbackText ?? '');
17
17
  const { spacing } = useTheme();
18
18
  const styles = useStyles();
@@ -23,5 +23,5 @@ export const Avatar = (props) => {
23
23
  lg: spacing('5W'),
24
24
  xl: spacing('8W'),
25
25
  };
26
- return (_jsxs(TamaguiAvatar, { style: { ...styles.avatar, ...style }, circular: true, size: avatarSize[size], ...avatarProps, children: [_jsx(TamaguiAvatar.Image, { src: src }), _jsx(Typography, { style: styles.fallbackText, children: initials })] }));
26
+ return (_jsxs(TamaguiAvatar, { style: { ...styles.avatar, ...(carre ? styles.carre : {}), ...style }, circular: !carre, size: avatarSize[size], ...avatarProps, children: [_jsx(TamaguiAvatar.Image, { src: src }), _jsx(Typography, { style: styles.fallbackText, children: initials })] }));
27
27
  };
@@ -7,9 +7,13 @@ declare const _default: {
7
7
  component: (props: import("./Avatar").AvatarProps) => import("react/jsx-runtime").JSX.Element;
8
8
  styleFn: () => {
9
9
  avatar: {
10
- backgroundColor: "#D2E8FE";
10
+ backgroundColor: "#232427";
11
+ };
12
+ carre: {
13
+ borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
11
14
  };
12
15
  fallbackText: {
16
+ color: "#CED5E1";
13
17
  display: "flex";
14
18
  justifyContent: "center";
15
19
  textAlign: "center";
@@ -23,5 +27,6 @@ declare const _default: {
23
27
  };
24
28
  export default _default;
25
29
  export declare const Sizes: () => import("react/jsx-runtime").JSX.Element;
26
- export declare const Variants: () => import("react/jsx-runtime").JSX.Element;
30
+ export declare const WithFallbackText: () => import("react/jsx-runtime").JSX.Element;
31
+ export declare const Carre: () => import("react/jsx-runtime").JSX.Element;
27
32
  //# sourceMappingURL=Avatar.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAElB,eAAO,MAAM,KAAK,+CAQjB,CAAC;AAEF,eAAO,MAAM,QAAQ,+CAMpB,CAAC"}
1
+ {"version":3,"file":"Avatar.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAUlB,eAAO,MAAM,KAAK,+CAQjB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAK5B,CAAC;AAEF,eAAO,MAAM,KAAK,+CAQjB,CAAC"}
@@ -11,5 +11,13 @@ export default {
11
11
  component: Avatar,
12
12
  styleFn: useStyles,
13
13
  };
14
- export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 8, flexWrap: "wrap", children: [_jsx(Avatar, { size: "xs", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "sm", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "md", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "lg", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "xl", src: "https://picsum.photos/100/200" })] }));
15
- export const Variants = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 8, flexWrap: "wrap", children: [_jsx(Avatar, { size: "sm", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "sm", fallbackText: "Jean Pierre" }), _jsx(Avatar, { size: "sm", fallbackText: "Jean-Pierre" })] }));
14
+ const styleContainer = {
15
+ display: 'flex',
16
+ flexDirection: 'row',
17
+ gap: 8,
18
+ alignItems: 'center',
19
+ flexWrap: 'wrap',
20
+ };
21
+ export const Sizes = () => (_jsxs(Box, { style: styleContainer, children: [_jsx(Avatar, { size: "xs", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "sm", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "md", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "lg", src: "https://picsum.photos/100/200" }), _jsx(Avatar, { size: "xl", src: "https://picsum.photos/100/200" })] }));
22
+ export const WithFallbackText = () => (_jsxs(Box, { style: styleContainer, children: [_jsx(Avatar, { size: "lg", fallbackText: "Jean Pierre" }), _jsx(Avatar, { size: "md", fallbackText: "Jean Pierre" })] }));
23
+ export const Carre = () => (_jsxs(Box, { style: styleContainer, children: [_jsx(Avatar, { size: "xs", src: "https://picsum.photos/100/200", carre: true }), _jsx(Avatar, { size: "sm", src: "https://picsum.photos/100/200", carre: true }), _jsx(Avatar, { size: "md", src: "https://picsum.photos/100/200", carre: true }), _jsx(Avatar, { size: "lg", src: "https://picsum.photos/100/200", carre: true }), _jsx(Avatar, { size: "xl", src: "https://picsum.photos/100/200", carre: true })] }));
@@ -1,8 +1,12 @@
1
1
  export declare const useStyles: () => {
2
2
  avatar: {
3
- backgroundColor: "#D2E8FE";
3
+ backgroundColor: "#232427";
4
+ };
5
+ carre: {
6
+ borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
4
7
  };
5
8
  fallbackText: {
9
+ color: "#CED5E1";
6
10
  display: "flex";
7
11
  justifyContent: "center";
8
12
  textAlign: "center";
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;CAWnB,CAAC"}
1
+ {"version":3,"file":"Avatar.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Avatar/Avatar.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;CAenB,CAAC"}
@@ -1,10 +1,14 @@
1
1
  import { makeStyles } from '@alveole/theme';
2
- export const useStyles = makeStyles(({ color, text }) => ({
2
+ export const useStyles = makeStyles(({ color, text, radius }) => ({
3
3
  avatar: {
4
- backgroundColor: color.background['open-bleu-captive'],
4
+ backgroundColor: color.dark.background['contrast-grey'],
5
+ },
6
+ carre: {
7
+ borderRadius: radius('md'),
5
8
  },
6
9
  fallbackText: {
7
- ...text['Corps de texte'].MD.Regular,
10
+ ...text['Corps de texte'].MD.Medium,
11
+ color: color.dark.text['default-grey'],
8
12
  display: 'flex',
9
13
  justifyContent: 'center',
10
14
  textAlign: 'center',
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDnB,CAAC"}
1
+ {"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DpB,CAAC"}
@@ -1,58 +1,61 @@
1
1
  import { makeStyles } from '@alveole/theme';
2
- export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
3
- container: {
4
- display: 'flex',
5
- flexDirection: 'column',
6
- alignItems: 'center',
7
- justifyContent: 'center',
8
- gap: spacing('150'),
9
- paddingTop: 0,
10
- paddingBottom: spacing('2W'),
11
- paddingLeft: spacing('2W'),
12
- paddingRight: spacing('2W'),
13
- textAlign: 'center',
14
- height: '100%',
15
- width: '100%',
16
- },
17
- contenu: {
18
- display: 'flex',
19
- gap: spacing('2W'),
20
- alignItems: 'center',
21
- textAlign: 'center',
22
- flex: 1,
23
- justifyContent: 'center',
24
- width: '100%',
25
- },
26
- media: {
27
- display: 'flex',
28
- alignItems: 'center',
29
- justifyContent: 'center',
30
- color: color.light.text['active-primary'],
31
- backgroundColor: color.light.background['alt-primary'],
32
- borderRadius: radius('full'),
33
- padding: spacing('075'),
34
- },
35
- messageEtDescription: {
36
- display: 'flex',
37
- flexDirection: 'column',
38
- gap: spacing('2W'),
39
- width: '100%',
40
- justifyContent: 'center',
41
- },
42
- title: {
43
- color: color.light.text['title-grey'],
44
- ...text.Titres['H6 - XXS'],
45
- textAlign: 'center',
46
- },
47
- description: {
48
- color: color.light.text['mention-grey'],
49
- ...text['Corps de texte'].SM.Regular,
50
- textAlign: 'center',
51
- },
52
- footer: {
53
- width: '100%',
54
- display: 'flex',
55
- flexDirection: 'column',
56
- gap: spacing('100'),
57
- },
58
- }));
2
+ export const useStyles = makeStyles(({ externalPadding, text, color, spacing, radius }) => {
3
+ const paddingValue = externalPadding();
4
+ return {
5
+ container: {
6
+ display: 'flex',
7
+ flexDirection: 'column',
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ gap: spacing('150'),
11
+ paddingTop: 0,
12
+ paddingBottom: spacing('2W'),
13
+ paddingLeft: paddingValue,
14
+ paddingRight: paddingValue,
15
+ textAlign: 'center',
16
+ height: '100%',
17
+ width: '100%',
18
+ },
19
+ contenu: {
20
+ display: 'flex',
21
+ gap: spacing('2W'),
22
+ alignItems: 'center',
23
+ textAlign: 'center',
24
+ flex: 1,
25
+ justifyContent: 'center',
26
+ width: '100%',
27
+ },
28
+ media: {
29
+ display: 'flex',
30
+ alignItems: 'center',
31
+ justifyContent: 'center',
32
+ color: color.light.text['active-primary'],
33
+ backgroundColor: color.light.background['alt-primary'],
34
+ borderRadius: radius('full'),
35
+ padding: spacing('075'),
36
+ },
37
+ messageEtDescription: {
38
+ display: 'flex',
39
+ flexDirection: 'column',
40
+ gap: spacing('2W'),
41
+ width: '100%',
42
+ justifyContent: 'center',
43
+ },
44
+ title: {
45
+ color: color.light.text['title-grey'],
46
+ ...text.Titres['H6 - XXS'],
47
+ textAlign: 'center',
48
+ },
49
+ description: {
50
+ color: color.light.text['mention-grey'],
51
+ ...text['Corps de texte'].SM.Regular,
52
+ textAlign: 'center',
53
+ },
54
+ footer: {
55
+ width: '100%',
56
+ display: 'flex',
57
+ flexDirection: 'column',
58
+ gap: spacing('100'),
59
+ },
60
+ };
61
+ });
@@ -8,10 +8,10 @@ export type IconName = LucideIconName | LabIconName;
8
8
  export declare const isLucideIconName: (name: string) => name is LucideIconName;
9
9
  declare const PublicPropsSchema: z.ZodObject<{
10
10
  size: z.ZodEnum<{
11
- xs: "xs";
12
11
  sm: "sm";
13
12
  md: "md";
14
13
  lg: "lg";
14
+ xs: "xs";
15
15
  xl: "xl";
16
16
  }>;
17
17
  name: z.ZodEnum<{
@@ -2073,10 +2073,10 @@ type PrivateProps = {
2073
2073
  export type LucideIconProps = z.infer<typeof PublicPropsSchema> & PrivateProps;
2074
2074
  export declare const LucideIconPropsJSON: z.core.ZodStandardJSONSchemaPayload<z.ZodObject<{
2075
2075
  size: z.ZodEnum<{
2076
- xs: "xs";
2077
2076
  sm: "sm";
2078
2077
  md: "md";
2079
2078
  lg: "lg";
2079
+ xs: "xs";
2080
2080
  xl: "xl";
2081
2081
  }>;
2082
2082
  name: z.ZodEnum<{
@@ -6,10 +6,10 @@ declare const _default: {
6
6
  description: string;
7
7
  props: import("zod/v4/core").ZodStandardJSONSchemaPayload<import("zod").ZodObject<{
8
8
  size: import("zod").ZodEnum<{
9
- xs: "xs";
10
9
  sm: "sm";
11
10
  md: "md";
12
11
  lg: "lg";
12
+ xs: "xs";
13
13
  xl: "xl";
14
14
  }>;
15
15
  name: import("zod").ZodEnum<{
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
- export type ToolbarTopVariant = 'default' | 'large' | 'compactLarge';
3
- export type ToolbarTopProps = {
4
- variant?: ToolbarTopVariant;
2
+ import { BoxProps } from '../../core';
3
+ import { AvatarProps } from '../Avatar';
4
+ import { IconProps } from '../LucideIcon';
5
+ export type ToolbarTopProps = BoxProps & {
6
+ variant?: 'default' | 'large' | 'compactLarge';
5
7
  title: string;
6
- subtitle?: string;
7
- background?: boolean;
8
- showSubtitle?: boolean;
9
- canGoBack?: boolean;
10
- onNavigateBack?: () => void;
8
+ AvatarProps?: Omit<AvatarProps, 'size'>;
9
+ onNavigate?: () => void;
10
+ navigationIcon?: IconProps['name'];
11
+ sousTitre?: string;
12
+ onActions?: () => void;
13
+ actionsIcon?: IconProps['name'];
11
14
  actions?: React.ReactNode;
12
15
  };
13
16
  export declare const ToolbarTop: (props: ToolbarTopProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarTop.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAErE,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAwChD,CAAC"}
1
+ {"version":3,"file":"ToolbarTop.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AACvD,OAAO,EAAU,WAAW,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IACvC,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAmFhD,CAAC"}
@@ -1,19 +1,22 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRouter } from 'expo-router';
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { Box, Typography } from '../../core';
3
+ import { Avatar } from '../Avatar';
4
4
  import { ButtonIcon } from '../Button';
5
5
  import { useStyles } from './ToolbarTop.styles';
6
6
  export const ToolbarTop = (props) => {
7
- const { title, subtitle, background, canGoBack, actions, variant, onNavigateBack } = props;
8
- const router = useRouter();
7
+ const { variant = 'default', style, title, onNavigate, navigationIcon = 'ChevronLeft', AvatarProps, sousTitre, actions, ...toolbarProps } = props;
9
8
  const styles = useStyles();
10
- const handleBack = () => {
11
- if (onNavigateBack) {
12
- onNavigateBack();
13
- }
14
- else if (router.canGoBack()) {
15
- router.back();
16
- }
17
- };
18
- return (_jsxs(Box, { tag: "toolbar", style: { ...styles.container, ...(background && styles.containerWithBackground) }, children: [variant !== 'compactLarge' && (_jsxs(Box, { tag: "toolbar-haut", style: styles.toolbarHaut, children: [_jsx(Box, { tag: "toolbar-navigation", children: canGoBack && _jsx(ButtonIcon, { size: "lg", variant: "tertiary", icon: "ArrowLeft", onPress: handleBack }) }), _jsx(Box, { tag: "toolbar-actions", children: actions })] })), _jsxs(Box, { tag: "toolbar-informations", style: { ...styles.informations, ...(variant === 'compactLarge' && styles.compactLargeInformations) }, children: [_jsx(Box, { tag: "toolbar-titre", children: _jsx(Typography, { style: styles.titre, children: title }) }), subtitle && (_jsx(Box, { tag: "toolbar-sous-titre", children: _jsx(Typography, { style: styles.sousTitre, children: subtitle }) }))] })] }));
9
+ const toolbarNavigation = onNavigate ? (_jsx(Box, { tag: "toolbar-navigation", style: styles.toolbarNavigation, children: _jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: navigationIcon, onPress: onNavigate }) })) : (_jsx(_Fragment, {}));
10
+ const toolbarInformation = (_jsxs(Box, { tag: "toolbar-information", style: { ...styles.toolbarInformation, ...(variant === 'compactLarge' ? styles.compactLargeInformations : {}) }, children: [AvatarProps && _jsx(Avatar, { ...AvatarProps, size: "md" }), _jsxs(Box, { tag: "toolbar-information-title", style: styles.toolbarInformationTitle, children: [_jsx(Typography, { style: {
11
+ ...styles.toolbarInformationTitleText,
12
+ ...(variant === 'compactLarge' || variant === 'large' ? styles.largeInformationTitleText : {}),
13
+ }, children: title }), sousTitre && (_jsx(Typography, { style: {
14
+ ...styles.toolbarInformationTitleSubText,
15
+ ...(variant === 'compactLarge' || variant === 'large' ? styles.largeToolbarInformationTitleSubText : {}),
16
+ }, children: sousTitre }))] })] }));
17
+ const toolbarActions = actions ? (_jsx(Box, { tag: "toolbar-actions", style: styles.toolbarActions, children: actions })) : (_jsx(_Fragment, {}));
18
+ if (variant === 'large') {
19
+ return (_jsxs(Box, { tag: "toolbar", style: [styles.toolbarContainer, styles.largeToolbarContainer, style], ...toolbarProps, children: [toolbarNavigation, _jsxs(Box, { tag: "toolbar-bas", children: [toolbarInformation, toolbarActions] })] }));
20
+ }
21
+ return (_jsxs(Box, { tag: "toolbar", style: [styles.toolbarContainer, variant === 'compactLarge' ? styles.compactLargetoolbarContainer : {}, style], ...toolbarProps, children: [toolbarNavigation, toolbarInformation, toolbarActions] }));
19
22
  };
@@ -2,58 +2,106 @@ declare const _default: {
2
2
  title: string;
3
3
  tags: ["Composant"];
4
4
  experimental: false;
5
- description: string;
6
5
  figmaURL: string;
6
+ description: string;
7
+ mobileOnly: true;
7
8
  component: (props: import("./ToolbarTop").ToolbarTopProps) => import("react/jsx-runtime").JSX.Element;
8
9
  styleFn: () => {
9
- container: {
10
+ toolbarContainer: {
11
+ backgroundColor: "white";
10
12
  display: "flex";
11
- width: "100%";
13
+ flexDirection: "row";
14
+ alignItems: "center";
15
+ paddingLeft: import("@alveole/theme").Spacing;
16
+ paddingRight: import("@alveole/theme").Spacing;
17
+ paddingTop: import("@alveole/theme").Spacing;
18
+ paddingBottom: import("@alveole/theme").Spacing;
12
19
  };
13
- containerWithBackground: {
14
- backgroundColor: "#FFFFFF";
20
+ compactLargetoolbarContainer: {
21
+ paddingTop: import("@alveole/theme").Spacing;
22
+ paddingBottom: import("@alveole/theme").Spacing;
23
+ paddingLeft: import("@alveole/theme").Spacing;
24
+ paddingRight: import("@alveole/theme").Spacing;
15
25
  };
16
- toolbarHaut: {
26
+ largeToolbarContainer: {
27
+ paddingTop: number;
28
+ paddingBottom: number;
29
+ paddingLeft: number;
30
+ paddingRight: number;
31
+ flexDirection: "column";
32
+ alignItems: "flex-start";
33
+ };
34
+ toolbarNavigation: {
35
+ display: "flex";
36
+ justifyContent: "center";
37
+ gap: import("@alveole/theme").Spacing;
38
+ };
39
+ toolbarInformation: {
17
40
  display: "flex";
18
41
  flexDirection: "row";
19
- justifyContent: "space-between";
20
42
  alignItems: "center";
21
- width: "100%";
22
- minHeight: import("@alveole/theme").Spacing;
43
+ gap: import("@alveole/theme").Spacing;
44
+ flex: number;
23
45
  };
24
- informations: {
46
+ toolbarInformationTitle: {
25
47
  display: "flex";
26
- paddingLeft: import("@alveole/theme").Spacing;
27
- paddingRight: import("@alveole/theme").Spacing;
28
- paddingBottom: import("@alveole/theme").Spacing;
48
+ flexDirection: "column";
49
+ justifyContent: "center";
50
+ alignItems: "flex-start";
51
+ flex: number;
29
52
  };
30
53
  compactLargeInformations: {
31
54
  paddingBottom: number;
32
- minHeight: number;
33
55
  justifyContent: "center";
34
56
  };
35
- titre: {
57
+ toolbarInformationTitleText: {
36
58
  color: "#151617";
59
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
60
+ fontSize: 14;
61
+ lineHeight: 20;
62
+ letterSpacing: 0;
63
+ };
64
+ largeInformationTitleText: {
37
65
  fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
38
66
  fontSize: 32 | 40;
39
67
  lineHeight: 48 | 40;
40
68
  letterSpacing: 0;
41
69
  };
42
- sousTitre: {
70
+ toolbarInformationTitleSubText: {
43
71
  color: "#5F6571";
72
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
73
+ fontSize: 12;
74
+ lineHeight: 20;
75
+ letterSpacing: 0;
76
+ };
77
+ largeToolbarInformationTitleSubText: {
44
78
  fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
45
79
  fontSize: 14;
46
80
  lineHeight: 20;
47
81
  letterSpacing: 0;
48
82
  };
83
+ toolbarActions: {
84
+ display: "flex";
85
+ flexDirection: "row";
86
+ justifyContent: "flex-end";
87
+ alignItems: "center";
88
+ };
89
+ toolbarInformationContainer: {
90
+ flex: number;
91
+ alignItems: "center";
92
+ display: "flex";
93
+ flexDirection: "row";
94
+ justifyContent: "space-between";
95
+ };
49
96
  };
50
97
  };
51
98
  export default _default;
52
99
  export declare const Default: () => import("react/jsx-runtime").JSX.Element;
53
- export declare const WithSubtitle: () => import("react/jsx-runtime").JSX.Element;
54
- export declare const WithBackground: () => import("react/jsx-runtime").JSX.Element;
55
- export declare const WithBackButton: () => import("react/jsx-runtime").JSX.Element;
56
- export declare const WithActions: () => import("react/jsx-runtime").JSX.Element;
57
- export declare const Full: () => import("react/jsx-runtime").JSX.Element;
100
+ export declare const SansAvatarEtAvecActions: () => import("react/jsx-runtime").JSX.Element;
101
+ export declare const AvecAvatarSansActions: () => import("react/jsx-runtime").JSX.Element;
102
+ export declare const AvecAvatarEtActions: () => import("react/jsx-runtime").JSX.Element;
103
+ export declare const AvecPlusieursActions: () => import("react/jsx-runtime").JSX.Element;
104
+ export declare const AvecTitreEtSansSousTitre: () => import("react/jsx-runtime").JSX.Element;
58
105
  export declare const CompactLarge: () => import("react/jsx-runtime").JSX.Element;
106
+ export declare const Large: () => import("react/jsx-runtime").JSX.Element;
59
107
  //# sourceMappingURL=ToolbarTop.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarTop.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAElB,eAAO,MAAM,OAAO,+CAAyC,CAAC;AAE9D,eAAO,MAAM,YAAY,+CAA4E,CAAC;AAEtG,eAAO,MAAM,cAAc,+CAE1B,CAAC;AAEF,eAAO,MAAM,cAAc,+CAO1B,CAAC;AAEF,eAAO,MAAM,WAAW,+CAUvB,CAAC;AAEF,eAAO,MAAM,IAAI,+CAShB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAA0E,CAAC"}
1
+ {"version":3,"file":"ToolbarTop.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAWkB;AAElB,eAAO,MAAM,OAAO,+CAA4D,CAAC;AAEjF,eAAO,MAAM,uBAAuB,+CAOnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAEjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,+CAQ/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAahC,CAAC;AAEF,eAAO,MAAM,wBAAwB,+CAYpC,CAAC;AAEF,eAAO,MAAM,YAAY,+CAA0E,CAAC;AAEpG,eAAO,MAAM,KAAK,+CAEjB,CAAC"}
@@ -1,20 +1,22 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ButtonIcon } from '../Button';
2
+ import { ButtonIcon } from '../Button/ButtonIcon';
3
+ import { ToolbarTop } from './ToolbarTop';
3
4
  import { useStyles } from './ToolbarTop.styles';
4
- import { ToolbarTop } from './index';
5
5
  export default {
6
6
  title: 'ToolbarTop',
7
7
  tags: ['Composant'],
8
8
  experimental: false,
9
- description: "Barre d'outils en haut de page avec titre, sous-titre optionnel, bouton retour et actions.",
10
- figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1749-4674&t=baZKFA9BpkeQGeZm-4',
9
+ figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1749-4674&t=qyctNCnE5tT5rKRk-4',
10
+ description: "La ToolbarTop est un composant de navigation et d'action. A utiliser uniquement sur Mobile. Elle dispose de 3 variantes : default, large et compactLarge.",
11
+ mobileOnly: true,
11
12
  component: ToolbarTop,
12
13
  styleFn: useStyles,
13
14
  };
14
- export const Default = () => _jsx(ToolbarTop, { title: "Mon titre" });
15
- export const WithSubtitle = () => _jsx(ToolbarTop, { title: "Mon titre", subtitle: "Un sous-titre optionnel" });
16
- export const WithBackground = () => (_jsx(ToolbarTop, { title: "Page avec fond", subtitle: "Le fond utilise la couleur par d\u00E9faut", background: true }));
17
- export const WithBackButton = () => (_jsx(ToolbarTop, { title: "Page d\u00E9tails", subtitle: "Avec bouton de retour", canGoBack: true, onNavigateBack: () => console.log('Retour') }));
18
- export const WithActions = () => (_jsx(ToolbarTop, { title: "Page avec actions", actions: _jsxs(_Fragment, { children: [_jsx(ButtonIcon, { variant: "tertiary", icon: "Search", onPress: () => console.log('Recherche') }), _jsx(ButtonIcon, { variant: "tertiary", icon: "MoveVertical", onPress: () => console.log('Menu') })] }) }));
19
- export const Full = () => (_jsx(ToolbarTop, { title: "Tous les options", subtitle: "Sous-titre avec fond et actions", background: true, canGoBack: true, onNavigateBack: () => console.log('Retour'), actions: _jsx(ButtonIcon, { variant: "tertiary", icon: "Share", onPress: () => console.log('Partager') }) }));
15
+ export const Default = () => _jsx(ToolbarTop, { title: "Titre", sousTitre: "Sous-titre" });
16
+ export const SansAvatarEtAvecActions = () => (_jsx(ToolbarTop, { title: "Titre", sousTitre: "Sous-titre", onNavigate: console.log, actions: _jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Plus', onPress: console.log }) }));
17
+ export const AvecAvatarSansActions = () => (_jsx(ToolbarTop, { title: "Titre", sousTitre: "Sous-titre", AvatarProps: { src: 'https://picsum.photos/100/200' } }));
18
+ export const AvecAvatarEtActions = () => (_jsx(ToolbarTop, { title: "Titre", sousTitre: "Sous-titre", onNavigate: console.log, AvatarProps: { src: 'https://picsum.photos/100/200' }, actions: _jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Plus', onPress: console.log }) }));
19
+ export const AvecPlusieursActions = () => (_jsx(ToolbarTop, { title: "Titre", sousTitre: "Sous-titre", onNavigate: console.log, AvatarProps: { src: 'https://picsum.photos/100/200' }, actions: _jsxs(_Fragment, { children: [_jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Plus', onPress: console.log }), _jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Download', onPress: console.log })] }) }));
20
+ export const AvecTitreEtSansSousTitre = () => (_jsx(ToolbarTop, { title: "Titre", onNavigate: console.log, AvatarProps: { src: 'https://picsum.photos/100/200' }, actions: _jsxs(_Fragment, { children: [_jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Plus', onPress: console.log }), _jsx(ButtonIcon, { variant: "tertiary", size: "lg", iconSize: "md", icon: 'Download', onPress: console.log })] }) }));
20
21
  export const CompactLarge = () => _jsx(ToolbarTop, { title: "Titre compact large", variant: "compactLarge" });
22
+ export const Large = () => (_jsx(ToolbarTop, { title: "Titre large", variant: "large", onNavigate: console.log, sousTitre: "Sous-titre" }));
@@ -1,43 +1,89 @@
1
1
  export declare const useStyles: () => {
2
- container: {
2
+ toolbarContainer: {
3
+ backgroundColor: "white";
3
4
  display: "flex";
4
- width: "100%";
5
+ flexDirection: "row";
6
+ alignItems: "center";
7
+ paddingLeft: import("@alveole/theme").Spacing;
8
+ paddingRight: import("@alveole/theme").Spacing;
9
+ paddingTop: import("@alveole/theme").Spacing;
10
+ paddingBottom: import("@alveole/theme").Spacing;
11
+ };
12
+ compactLargetoolbarContainer: {
13
+ paddingTop: import("@alveole/theme").Spacing;
14
+ paddingBottom: import("@alveole/theme").Spacing;
15
+ paddingLeft: import("@alveole/theme").Spacing;
16
+ paddingRight: import("@alveole/theme").Spacing;
5
17
  };
6
- containerWithBackground: {
7
- backgroundColor: "#FFFFFF";
18
+ largeToolbarContainer: {
19
+ paddingTop: number;
20
+ paddingBottom: number;
21
+ paddingLeft: number;
22
+ paddingRight: number;
23
+ flexDirection: "column";
24
+ alignItems: "flex-start";
8
25
  };
9
- toolbarHaut: {
26
+ toolbarNavigation: {
27
+ display: "flex";
28
+ justifyContent: "center";
29
+ gap: import("@alveole/theme").Spacing;
30
+ };
31
+ toolbarInformation: {
10
32
  display: "flex";
11
33
  flexDirection: "row";
12
- justifyContent: "space-between";
13
34
  alignItems: "center";
14
- width: "100%";
15
- minHeight: import("@alveole/theme").Spacing;
35
+ gap: import("@alveole/theme").Spacing;
36
+ flex: number;
16
37
  };
17
- informations: {
38
+ toolbarInformationTitle: {
18
39
  display: "flex";
19
- paddingLeft: import("@alveole/theme").Spacing;
20
- paddingRight: import("@alveole/theme").Spacing;
21
- paddingBottom: import("@alveole/theme").Spacing;
40
+ flexDirection: "column";
41
+ justifyContent: "center";
42
+ alignItems: "flex-start";
43
+ flex: number;
22
44
  };
23
45
  compactLargeInformations: {
24
46
  paddingBottom: number;
25
- minHeight: number;
26
47
  justifyContent: "center";
27
48
  };
28
- titre: {
49
+ toolbarInformationTitleText: {
29
50
  color: "#151617";
51
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
52
+ fontSize: 14;
53
+ lineHeight: 20;
54
+ letterSpacing: 0;
55
+ };
56
+ largeInformationTitleText: {
30
57
  fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
31
58
  fontSize: 32 | 40;
32
59
  lineHeight: 48 | 40;
33
60
  letterSpacing: 0;
34
61
  };
35
- sousTitre: {
62
+ toolbarInformationTitleSubText: {
36
63
  color: "#5F6571";
64
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
65
+ fontSize: 12;
66
+ lineHeight: 20;
67
+ letterSpacing: 0;
68
+ };
69
+ largeToolbarInformationTitleSubText: {
37
70
  fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
38
71
  fontSize: 14;
39
72
  lineHeight: 20;
40
73
  letterSpacing: 0;
41
74
  };
75
+ toolbarActions: {
76
+ display: "flex";
77
+ flexDirection: "row";
78
+ justifyContent: "flex-end";
79
+ alignItems: "center";
80
+ };
81
+ toolbarInformationContainer: {
82
+ flex: number;
83
+ alignItems: "center";
84
+ display: "flex";
85
+ flexDirection: "row";
86
+ justifyContent: "space-between";
87
+ };
42
88
  };
43
89
  //# sourceMappingURL=ToolbarTop.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarTop.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCnB,CAAC"}
1
+ {"version":3,"file":"ToolbarTop.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ToolbarTop/ToolbarTop.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EnB,CAAC"}
@@ -1,37 +1,77 @@
1
1
  import { makeStyles } from '@alveole/theme';
2
- export const useStyles = makeStyles(({ text, spacing, color }) => ({
3
- container: {
2
+ export const useStyles = makeStyles(({ text, color, spacing }) => ({
3
+ toolbarContainer: {
4
+ backgroundColor: 'white',
4
5
  display: 'flex',
5
- width: '100%',
6
+ flexDirection: 'row',
7
+ alignItems: 'center',
8
+ paddingLeft: spacing('025'),
9
+ paddingRight: spacing('025'),
10
+ paddingTop: spacing('050'),
11
+ paddingBottom: spacing('050'),
12
+ },
13
+ compactLargetoolbarContainer: {
14
+ paddingTop: spacing('3V'),
15
+ paddingBottom: spacing('1W'),
16
+ paddingLeft: spacing('2W'),
17
+ paddingRight: spacing('2W'),
6
18
  },
7
- containerWithBackground: {
8
- backgroundColor: color.background.default,
19
+ largeToolbarContainer: {
20
+ paddingTop: 0,
21
+ paddingBottom: 0,
22
+ paddingLeft: 0,
23
+ paddingRight: 0,
24
+ flexDirection: 'column',
25
+ alignItems: 'flex-start',
9
26
  },
10
- toolbarHaut: {
27
+ toolbarNavigation: {
28
+ display: 'flex',
29
+ justifyContent: 'center',
30
+ gap: spacing('075'),
31
+ },
32
+ toolbarInformation: {
11
33
  display: 'flex',
12
34
  flexDirection: 'row',
13
- justifyContent: 'space-between',
14
35
  alignItems: 'center',
15
- width: '100%',
16
- minHeight: spacing('300'),
36
+ gap: spacing('075'),
37
+ flex: 1,
17
38
  },
18
- informations: {
39
+ toolbarInformationTitle: {
19
40
  display: 'flex',
20
- paddingLeft: spacing('2W'),
21
- paddingRight: spacing('2W'),
22
- paddingBottom: spacing('050'),
41
+ flexDirection: 'column',
42
+ justifyContent: 'center',
43
+ alignItems: 'flex-start',
44
+ flex: 1,
23
45
  },
24
46
  compactLargeInformations: {
25
47
  paddingBottom: 0,
26
- minHeight: 60,
27
48
  justifyContent: 'center',
28
49
  },
29
- titre: {
30
- ...text.Titres['H1 - XL'],
50
+ toolbarInformationTitleText: {
51
+ ...text['Corps de texte'].SM.SemiBold,
31
52
  color: color.light.text['title-grey'],
32
53
  },
33
- sousTitre: {
34
- ...text['Corps de texte'].SM.Regular,
54
+ largeInformationTitleText: {
55
+ ...text.Titres['H1 - XL'],
56
+ },
57
+ toolbarInformationTitleSubText: {
58
+ ...text['Corps de texte'].XS.Regular,
35
59
  color: color.light.text['mention-grey'],
36
60
  },
61
+ largeToolbarInformationTitleSubText: {
62
+ ...text['Corps de texte'].SM.Regular,
63
+ },
64
+ toolbarActions: {
65
+ display: 'flex',
66
+ flexDirection: 'row',
67
+ justifyContent: 'flex-end',
68
+ alignItems: 'center',
69
+ },
70
+ toolbarInformationContainer: {
71
+ flex: 1,
72
+ alignItems: 'center',
73
+ display: 'flex',
74
+ flexDirection: 'row',
75
+ justifyContent: 'space-between',
76
+ },
37
77
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveole/components",
3
- "version": "0.16.12",
3
+ "version": "0.17.0",
4
4
  "description": "Shared UI components.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",