@alveole/components 0.36.1 → 0.37.2

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.
Files changed (158) hide show
  1. package/dist/core/A/A.stories.d.ts +4 -3
  2. package/dist/core/A/A.stories.d.ts.map +1 -1
  3. package/dist/core/A/A.stories.js +7 -5
  4. package/dist/core/A/A.stories.sources.d.ts +2 -0
  5. package/dist/core/A/A.stories.sources.d.ts.map +1 -1
  6. package/dist/core/A/A.stories.sources.js +3 -1
  7. package/dist/core/Box/Box.stories.d.ts +1 -1
  8. package/dist/core/Box/Box.stories.js +1 -1
  9. package/dist/core/Highlight/Highlight.d.ts +8 -0
  10. package/dist/core/Highlight/Highlight.d.ts.map +1 -0
  11. package/dist/core/Highlight/Highlight.js +76 -0
  12. package/dist/core/Highlight/Highlight.stories.d.ts +26 -0
  13. package/dist/core/Highlight/Highlight.stories.d.ts.map +1 -0
  14. package/dist/core/Highlight/Highlight.stories.js +43 -0
  15. package/dist/core/Highlight/Highlight.stories.sources.d.ts +14 -0
  16. package/dist/core/Highlight/Highlight.stories.sources.d.ts.map +1 -0
  17. package/dist/core/Highlight/Highlight.stories.sources.js +14 -0
  18. package/dist/core/Highlight/Highlight.styles.d.ts +12 -0
  19. package/dist/core/Highlight/Highlight.styles.d.ts.map +1 -0
  20. package/dist/core/Highlight/Highlight.styles.js +12 -0
  21. package/dist/core/Highlight/index.d.ts +2 -0
  22. package/dist/core/Highlight/index.d.ts.map +1 -0
  23. package/dist/core/Highlight/index.js +1 -0
  24. package/dist/core/Image/Image.stories.d.ts +2 -2
  25. package/dist/core/Image/Image.stories.js +2 -2
  26. package/dist/core/Lottie/Lottie.stories.d.ts +2 -2
  27. package/dist/core/Lottie/Lottie.stories.js +2 -2
  28. package/dist/core/Map/Map.stories.d.ts +2 -2
  29. package/dist/core/Map/Map.stories.js +2 -2
  30. package/dist/core/Metabase/Metabase.stories.d.ts +3 -3
  31. package/dist/core/Metabase/Metabase.stories.js +2 -2
  32. package/dist/core/Metabase/Metabase.styles.d.ts +1 -1
  33. package/dist/core/Page/Page.stories.d.ts +1 -1
  34. package/dist/core/Page/Page.stories.js +1 -1
  35. package/dist/core/PdfViewer/PdfViewer.stories.d.ts +1 -1
  36. package/dist/core/PdfViewer/PdfViewer.stories.js +1 -1
  37. package/dist/core/Section/Section.stories.d.ts +1 -1
  38. package/dist/core/Section/Section.stories.js +1 -1
  39. package/dist/core/Typography/Typography.stories.d.ts +1 -1
  40. package/dist/core/Typography/Typography.stories.js +1 -1
  41. package/dist/core/Version/Version.stories.d.ts +1 -1
  42. package/dist/core/Version/Version.stories.js +1 -1
  43. package/dist/core/index.d.ts +1 -0
  44. package/dist/core/index.d.ts.map +1 -1
  45. package/dist/core/index.js +1 -0
  46. package/dist/generated/version.d.ts +1 -1
  47. package/dist/generated/version.js +1 -1
  48. package/dist/stories/index.d.ts +3 -0
  49. package/dist/stories/index.d.ts.map +1 -1
  50. package/dist/stories/index.js +3 -0
  51. package/dist/ui/ActionMenu/ActionMenu.stories.d.ts +1 -1
  52. package/dist/ui/ActionMenu/ActionMenu.stories.js +2 -2
  53. package/dist/ui/Avatar/Avatar.stories.d.ts +1 -1
  54. package/dist/ui/Avatar/Avatar.stories.js +1 -1
  55. package/dist/ui/Badge/Badge.stories.d.ts +1 -1
  56. package/dist/ui/Badge/Badge.stories.js +1 -1
  57. package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts +2 -1
  58. package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
  59. package/dist/ui/Breadcrumbs/Breadcrumbs.stories.js +3 -2
  60. package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.d.ts.map +1 -1
  61. package/dist/ui/Breadcrumbs/Breadcrumbs.stories.sources.js +1 -1
  62. package/dist/ui/Button/Button.js +1 -1
  63. package/dist/ui/Button/Button.stories.d.ts +1 -1
  64. package/dist/ui/Button/Button.stories.d.ts.map +1 -1
  65. package/dist/ui/Button/Button.stories.js +4 -4
  66. package/dist/ui/Button/Button.stories.sources.d.ts.map +1 -1
  67. package/dist/ui/Button/Button.stories.sources.js +2 -2
  68. package/dist/ui/Card/Card.stories.d.ts +1 -1
  69. package/dist/ui/Card/Card.stories.js +1 -1
  70. package/dist/ui/Divider/Divider.stories.d.ts +1 -1
  71. package/dist/ui/Divider/Divider.stories.js +1 -1
  72. package/dist/ui/DocumentViewer/DocumentViewer.stories.d.ts +1 -1
  73. package/dist/ui/DocumentViewer/DocumentViewer.stories.js +1 -1
  74. package/dist/ui/EmptyState/EmptyState.stories.d.ts +1 -1
  75. package/dist/ui/EmptyState/EmptyState.stories.js +1 -1
  76. package/dist/ui/ListItem/ListItem.stories.d.ts +3 -2
  77. package/dist/ui/ListItem/ListItem.stories.d.ts.map +1 -1
  78. package/dist/ui/ListItem/ListItem.stories.js +2 -2
  79. package/dist/ui/ListItem/ListItem.stories.sources.d.ts.map +1 -1
  80. package/dist/ui/ListItem/ListItem.stories.sources.js +1 -1
  81. package/dist/ui/ListItem/ListItem.styles.d.ts +1 -0
  82. package/dist/ui/ListItem/ListItem.styles.d.ts.map +1 -1
  83. package/dist/ui/ListItem/ListItem.styles.js +1 -0
  84. package/dist/ui/LucideIcon/LucideIcon.stories.d.ts +1 -1
  85. package/dist/ui/LucideIcon/LucideIcon.stories.d.ts.map +1 -1
  86. package/dist/ui/LucideIcon/LucideIcon.stories.js +2 -2
  87. package/dist/ui/LucideIcon/LucideIcon.stories.sources.d.ts.map +1 -1
  88. package/dist/ui/LucideIcon/LucideIcon.stories.sources.js +1 -1
  89. package/dist/ui/PageHeader/PageHeader.stories.d.ts +1 -1
  90. package/dist/ui/PageHeader/PageHeader.stories.js +1 -1
  91. package/dist/ui/Popover/Popover.stories.d.ts +1 -1
  92. package/dist/ui/Popover/Popover.stories.js +1 -1
  93. package/dist/ui/ProgressBar/ProgressBar.stories.d.ts +1 -1
  94. package/dist/ui/ProgressBar/ProgressBar.stories.js +2 -2
  95. package/dist/ui/ResourceList/ResourceList.stories.d.ts +1 -1
  96. package/dist/ui/ResourceList/ResourceList.stories.js +1 -1
  97. package/dist/ui/Sidebar/Sidebar.stories.d.ts +1 -1
  98. package/dist/ui/Sidebar/Sidebar.stories.js +1 -1
  99. package/dist/ui/Sidebar/SidebarItem.d.ts +1 -1
  100. package/dist/ui/Sidebar/SidebarItem.d.ts.map +1 -1
  101. package/dist/ui/Sidebar/SidebarItem.js +5 -7
  102. package/dist/ui/Signature/Signature.d.ts +12 -0
  103. package/dist/ui/Signature/Signature.d.ts.map +1 -0
  104. package/dist/ui/Signature/Signature.js +55 -0
  105. package/dist/ui/Signature/Signature.stories.d.ts +40 -0
  106. package/dist/ui/Signature/Signature.stories.d.ts.map +1 -0
  107. package/dist/ui/Signature/Signature.stories.js +24 -0
  108. package/dist/ui/Signature/Signature.stories.sources.d.ts +8 -0
  109. package/dist/ui/Signature/Signature.stories.sources.d.ts.map +1 -0
  110. package/dist/ui/Signature/Signature.stories.sources.js +8 -0
  111. package/dist/ui/Signature/Signature.styles.d.ts +29 -0
  112. package/dist/ui/Signature/Signature.styles.d.ts.map +1 -0
  113. package/dist/ui/Signature/Signature.styles.js +26 -0
  114. package/dist/ui/Signature/Signature.web.d.ts +3 -0
  115. package/dist/ui/Signature/Signature.web.d.ts.map +1 -0
  116. package/dist/ui/Signature/Signature.web.js +50 -0
  117. package/dist/ui/Signature/index.d.ts +2 -0
  118. package/dist/ui/Signature/index.d.ts.map +1 -0
  119. package/dist/ui/Signature/index.js +1 -0
  120. package/dist/ui/Tabs/Tabs.stories.d.ts +1 -1
  121. package/dist/ui/Tabs/Tabs.stories.js +1 -1
  122. package/dist/ui/Tag/Tag.stories.d.ts +1 -1
  123. package/dist/ui/Tag/Tag.stories.d.ts.map +1 -1
  124. package/dist/ui/Tag/Tag.stories.js +2 -2
  125. package/dist/ui/Tag/Tag.stories.sources.d.ts.map +1 -1
  126. package/dist/ui/Tag/Tag.stories.sources.js +1 -1
  127. package/dist/ui/Toast/Toast.d.ts +4 -0
  128. package/dist/ui/Toast/Toast.d.ts.map +1 -0
  129. package/dist/ui/Toast/Toast.js +48 -0
  130. package/dist/ui/Toast/Toast.stories.d.ts +94 -0
  131. package/dist/ui/Toast/Toast.stories.d.ts.map +1 -0
  132. package/dist/ui/Toast/Toast.stories.js +51 -0
  133. package/dist/ui/Toast/Toast.stories.sources.d.ts +6 -0
  134. package/dist/ui/Toast/Toast.stories.sources.d.ts.map +1 -0
  135. package/dist/ui/Toast/Toast.stories.sources.js +6 -0
  136. package/dist/ui/Toast/Toast.styles.d.ts +82 -0
  137. package/dist/ui/Toast/Toast.styles.d.ts.map +1 -0
  138. package/dist/ui/Toast/Toast.styles.js +54 -0
  139. package/dist/ui/Toast/ToastBridge.d.ts +11 -0
  140. package/dist/ui/Toast/ToastBridge.d.ts.map +1 -0
  141. package/dist/ui/Toast/ToastBridge.js +19 -0
  142. package/dist/ui/Toast/ToastContext.d.ts +12 -0
  143. package/dist/ui/Toast/ToastContext.d.ts.map +1 -0
  144. package/dist/ui/Toast/ToastContext.js +2 -0
  145. package/dist/ui/Toast/Toasts.d.ts +5 -0
  146. package/dist/ui/Toast/Toasts.d.ts.map +1 -0
  147. package/dist/ui/Toast/Toasts.js +16 -0
  148. package/dist/ui/Toast/index.d.ts +2 -0
  149. package/dist/ui/Toast/index.d.ts.map +1 -0
  150. package/dist/ui/Toast/index.js +1 -0
  151. package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts +1 -1
  152. package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.js +1 -1
  153. package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +1 -1
  154. package/dist/ui/ToolbarTop/ToolbarTop.stories.js +1 -1
  155. package/dist/ui/index.d.ts +2 -0
  156. package/dist/ui/index.d.ts.map +1 -1
  157. package/dist/ui/index.js +2 -0
  158. package/package.json +9 -1
@@ -0,0 +1,12 @@
1
+ import { BoxProps } from '../../core/Box';
2
+ export type SignatureProps = Omit<BoxProps, 'children'> & {
3
+ height: number;
4
+ date?: string | Date;
5
+ dateLabel?: string;
6
+ clearButtonLabel?: string;
7
+ onChange: (value: string | null) => void;
8
+ onBegin?: () => void;
9
+ onEnd?: () => void;
10
+ };
11
+ export declare const Signature: (props: SignatureProps) => import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=Signature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signature.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/Signature.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,4CA8E9C,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { DateFormats, displayDate, isValidDate } from '@alveole/core';
3
+ import { useTheme } from '@alveole/theme';
4
+ import * as React from 'react';
5
+ import SignatureCanvas from 'react-native-signature-canvas';
6
+ import { Box } from '../../core/Box';
7
+ import { Typography } from '../../core/Typography';
8
+ import { Button } from '../Button';
9
+ import { useStyles } from './Signature.styles';
10
+ export const Signature = (props) => {
11
+ const { height, date = new Date(), dateLabel = 'Le', clearButtonLabel = 'Effacer', onChange, onBegin, onEnd } = props;
12
+ const { color, spacing } = useTheme();
13
+ const styles = useStyles();
14
+ const ref = React.useRef(null);
15
+ const readTimeoutRef = React.useRef(null);
16
+ const handleOk = (signature) => {
17
+ onChange(signature);
18
+ };
19
+ const handleEnd = () => {
20
+ if (readTimeoutRef.current)
21
+ clearTimeout(readTimeoutRef.current);
22
+ readTimeoutRef.current = setTimeout(() => {
23
+ ref.current?.readSignature();
24
+ readTimeoutRef.current = null;
25
+ }, 100);
26
+ };
27
+ const handleClear = () => {
28
+ if (readTimeoutRef.current) {
29
+ clearTimeout(readTimeoutRef.current);
30
+ readTimeoutRef.current = null;
31
+ }
32
+ onChange(null);
33
+ };
34
+ React.useEffect(() => {
35
+ return () => {
36
+ if (readTimeoutRef.current)
37
+ clearTimeout(readTimeoutRef.current);
38
+ };
39
+ }, []);
40
+ const dateFormat = isValidDate(date) ? displayDate(date, { format: DateFormats.DateSlash }) : String(date);
41
+ const webviewHeightWithBorders = height + spacing('200') + spacing('100') + 3;
42
+ const webviewStyle = `
43
+ .m-signature-pad {
44
+ box-shadow: none;
45
+ border-radius: ${spacing('075')}px;
46
+ border-color: ${color.border['default-grey']};
47
+ border-width: 2px;
48
+ height: ${height}px;
49
+ }
50
+ .m-signature-pad--body {border: none; overflow: hidden; border-radius: ${spacing('075')}px}
51
+ .m-signature-pad--footer {display: none; margin: 0px;}
52
+ .button, .description {display: none;}
53
+ `;
54
+ return (_jsxs(Box, { height: webviewHeightWithBorders, width: '100%', children: [_jsxs(Box, { style: styles.headerSignature, children: [_jsxs(Typography, { style: styles.date, children: [dateLabel, " ", dateFormat] }), _jsx(Button, { size: "xs", title: clearButtonLabel, variant: "tertiary", onPress: () => ref.current?.clearSignature() })] }), _jsx(Box, { tag: "signature", height: '100%', onTouchEnd: onEnd, maxH: webviewHeightWithBorders, style: styles.container, children: _jsx(SignatureCanvas, { ref: ref, onOK: handleOk, onEnd: handleEnd, onClear: handleClear, penColor: styles.pen.color, backgroundColor: styles.pen.backgroundColor, dotSize: 3.5, minWidth: 3, maxWidth: 4, onBegin: onBegin, androidHardwareAccelerationDisabled: true, webviewProps: { cacheEnabled: false, androidLayerType: 'software' }, webStyle: webviewStyle }) })] }));
55
+ };
@@ -0,0 +1,40 @@
1
+ declare const _default: {
2
+ title: string;
3
+ tags: "ui"[];
4
+ experimental: true;
5
+ description: string;
6
+ component: (props: import("./Signature").SignatureProps) => import("react/jsx-runtime").JSX.Element;
7
+ styleFn: () => {
8
+ container: {
9
+ width: "100%";
10
+ display: "flex";
11
+ flexDirection: "column";
12
+ };
13
+ pen: {
14
+ color: "#373A3F";
15
+ backgroundColor: "#FFFFFF";
16
+ };
17
+ signatureWeb: {
18
+ borderColor: "#DEE3EC";
19
+ borderWidth: number;
20
+ borderRadius: import("@alveole/theme").Spacing;
21
+ };
22
+ headerSignature: {
23
+ display: "flex";
24
+ flexDirection: "row";
25
+ alignItems: "center";
26
+ justifyContent: "space-between";
27
+ };
28
+ date: {
29
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
30
+ fontSize: 12;
31
+ lineHeight: 20;
32
+ letterSpacing: 0;
33
+ };
34
+ };
35
+ };
36
+ export default _default;
37
+ export declare const Example: () => import("react/jsx-runtime").JSX.Element;
38
+ export declare const CustomLabels: () => import("react/jsx-runtime").JSX.Element;
39
+ export * as Sources from './Signature.stories.sources';
40
+ //# sourceMappingURL=Signature.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signature.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/Signature.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAQkB;AAElB,eAAO,MAAM,OAAO,+CAgBnB,CAAC;AAEF,eAAO,MAAM,YAAY,+CAgBxB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { Box, Image, Typography } from '../../';
4
+ import { Signature } from './Signature';
5
+ import { useStyles } from './Signature.styles';
6
+ export default {
7
+ title: 'Signature',
8
+ tags: ['ui'],
9
+ experimental: true,
10
+ description: 'Composant de signature par le doigt ou la souris. Différent entre web et mobile. La hauteur doit être fixe.',
11
+ component: Signature,
12
+ styleFn: useStyles,
13
+ };
14
+ export const Example = () => {
15
+ const containerHeight = 100;
16
+ const [value, setValue] = React.useState(null);
17
+ return (_jsxs(Box, { width: '100%', children: [_jsx(Signature, { height: containerHeight, onChange: setValue }), value && (_jsxs(_Fragment, { children: [_jsx(Typography, { fontSize: 24, children: "Signature captur\u00E9e :" }), _jsx(Image, { contentFit: "contain", height: containerHeight, width: "100%", source: value })] }))] }));
18
+ };
19
+ export const CustomLabels = () => {
20
+ const containerHeight = 100;
21
+ const [value, setValue] = React.useState(null);
22
+ return (_jsxs(Box, { width: '100%', children: [_jsx(Signature, { height: containerHeight, onChange: setValue, dateLabel: "Date :", clearButtonLabel: "Clear" }), value && (_jsxs(_Fragment, { children: [_jsx(Typography, { fontSize: 24, children: "Captured signature:" }), _jsx(Image, { contentFit: "contain", height: containerHeight, width: "100%", source: value })] }))] }));
23
+ };
24
+ export * as Sources from './Signature.stories.sources';
@@ -0,0 +1,8 @@
1
+ export declare const Example: () => string;
2
+ export declare const CustomLabels: () => string;
3
+ export declare const storySources: {
4
+ readonly Example: () => string;
5
+ readonly CustomLabels: () => string;
6
+ };
7
+ export type StorySourceName = keyof typeof storySources;
8
+ //# sourceMappingURL=Signature.stories.sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signature.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/Signature.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA6e,CAAC;AAElgB,eAAO,MAAM,YAAY,cAAiiB,CAAC;AAE3jB,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ // This file is generated. Do not edit manually.
2
+ // Source: src/ui/Signature/Signature.stories.tsx
3
+ export const Example = () => "export const Example = () => {\n const containerHeight = 100;\n const [value, setValue] = React.useState<string | null>(null);\n\n return (\n <Box width={'100%'}>\n <Signature height={containerHeight} onChange={setValue} />\n\n {value && (\n <>\n <Typography fontSize={24}>Signature capturée :</Typography>\n <Image contentFit=\"contain\" height={containerHeight} width=\"100%\" source={value} />\n </>\n )}\n </Box>\n );\n};";
4
+ export const CustomLabels = () => "export const CustomLabels = () => {\n const containerHeight = 100;\n const [value, setValue] = React.useState<string | null>(null);\n\n return (\n <Box width={'100%'}>\n <Signature height={containerHeight} onChange={setValue} dateLabel=\"Date :\" clearButtonLabel=\"Clear\" />\n\n {value && (\n <>\n <Typography fontSize={24}>Captured signature:</Typography>\n <Image contentFit=\"contain\" height={containerHeight} width=\"100%\" source={value} />\n </>\n )}\n </Box>\n );\n};";
5
+ export const storySources = {
6
+ Example,
7
+ CustomLabels,
8
+ };
@@ -0,0 +1,29 @@
1
+ export declare const useStyles: () => {
2
+ container: {
3
+ width: "100%";
4
+ display: "flex";
5
+ flexDirection: "column";
6
+ };
7
+ pen: {
8
+ color: "#373A3F";
9
+ backgroundColor: "#FFFFFF";
10
+ };
11
+ signatureWeb: {
12
+ borderColor: "#DEE3EC";
13
+ borderWidth: number;
14
+ borderRadius: import("@alveole/theme").Spacing;
15
+ };
16
+ headerSignature: {
17
+ display: "flex";
18
+ flexDirection: "row";
19
+ alignItems: "center";
20
+ justifyContent: "space-between";
21
+ };
22
+ date: {
23
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
24
+ fontSize: 12;
25
+ lineHeight: 20;
26
+ letterSpacing: 0;
27
+ };
28
+ };
29
+ //# sourceMappingURL=Signature.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signature.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/Signature.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BnB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { makeStyles } from '@alveole/theme';
2
+ export const useStyles = makeStyles(({ color, spacing, text }) => ({
3
+ container: {
4
+ width: '100%',
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ },
8
+ pen: {
9
+ color: color.text['default-grey'],
10
+ backgroundColor: '#FFFFFF',
11
+ },
12
+ signatureWeb: {
13
+ borderColor: color.border['default-grey'],
14
+ borderWidth: 2,
15
+ borderRadius: spacing('075'),
16
+ },
17
+ headerSignature: {
18
+ display: 'flex',
19
+ flexDirection: 'row',
20
+ alignItems: 'center',
21
+ justifyContent: 'space-between',
22
+ },
23
+ date: {
24
+ ...text['Corps de texte'].XS.Regular,
25
+ },
26
+ }));
@@ -0,0 +1,3 @@
1
+ import { SignatureProps } from './Signature';
2
+ export declare const Signature: (props: SignatureProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=Signature.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Signature.web.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/Signature.web.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,4CAyE9C,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { DateFormats, displayDate, isValidDate } from '@alveole/core';
3
+ import ReactSignature from '@uiw/react-signature';
4
+ import * as React from 'react';
5
+ import { Box } from '../../core/Box';
6
+ import { Typography } from '../../core/Typography';
7
+ import { Button } from '../Button';
8
+ import { useStyles } from './Signature.styles';
9
+ export const Signature = (props) => {
10
+ const { height, style, date = new Date(), dateLabel = 'Le', clearButtonLabel = 'Effacer', onChange, ...boxProps } = props;
11
+ const styles = useStyles();
12
+ const signatureRef = React.useRef(null);
13
+ const serializeSvgToBase64 = (svg) => {
14
+ return new Promise(resolve => {
15
+ const svgString = new XMLSerializer().serializeToString(svg);
16
+ const blob = new Blob([svgString], { type: 'image/svg+xml' });
17
+ const reader = new FileReader();
18
+ reader.onloadend = () => {
19
+ const base64data = reader.result;
20
+ resolve(base64data);
21
+ };
22
+ reader.readAsDataURL(blob);
23
+ });
24
+ };
25
+ React.useEffect(() => {
26
+ const svgEl = signatureRef.current?.svg;
27
+ if (!svgEl)
28
+ return;
29
+ const handlePointerUp = async () => {
30
+ const svgEl = signatureRef.current?.svg;
31
+ if (!svgEl)
32
+ return;
33
+ const base64 = await serializeSvgToBase64(svgEl);
34
+ onChange(base64);
35
+ };
36
+ svgEl.addEventListener('pointerup', handlePointerUp);
37
+ return () => {
38
+ svgEl.removeEventListener('pointerup', handlePointerUp);
39
+ };
40
+ }, [signatureRef.current?.svg, onChange]);
41
+ const handleClear = () => {
42
+ signatureRef.current?.clear();
43
+ onChange(null);
44
+ };
45
+ const dateFormat = isValidDate(date) ? displayDate(date, { format: DateFormats.DateSlash }) : String(date);
46
+ return (_jsxs(Box, { tag: "signature", style: [styles.container, style], ...boxProps, children: [_jsxs(Box, { style: styles.headerSignature, children: [_jsxs(Typography, { style: styles.date, children: [dateLabel, " ", dateFormat] }), _jsx(Button, { title: clearButtonLabel, variant: "tertiary", size: "xs", onPress: handleClear })] }), _jsx(Box, { style: { ...styles.signatureWeb, height }, children: _jsx(ReactSignature, { ref: (inst) => {
47
+ if (inst)
48
+ signatureRef.current = inst;
49
+ }, style: styles.signatureWeb, fill: styles.pen.color, options: { size: 12, smoothing: 0.15, thinning: 0.73, streamline: 0.5 } }) })] }));
50
+ };
@@ -0,0 +1,2 @@
1
+ export * from './Signature';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Signature/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './Signature';
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  title: string;
3
- tags: "Composant"[];
3
+ tags: "ui"[];
4
4
  experimental: false;
5
5
  figmaURL: string;
6
6
  description: string;
@@ -5,7 +5,7 @@ import { Tabs } from './Tabs';
5
5
  import { useStyles } from './Tabs.styles';
6
6
  export default {
7
7
  title: 'Tabs',
8
- tags: ['Composant'],
8
+ tags: ['ui'],
9
9
  experimental: false,
10
10
  figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1863-621',
11
11
  description: 'Composant d’onglets (tabs) basé sur tamagui.',
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  title: string;
3
- tags: "Kit"[];
3
+ tags: "ui"[];
4
4
  experimental: false;
5
5
  figmaURL: string;
6
6
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAElB,eAAO,MAAM,MAAM,+CAWlB,CAAC;AAEF,eAAO,MAAM,KAAK,+CASjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"Tag.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBAQkB;AAElB,eAAO,MAAM,MAAM,+CASlB,CAAC;AAEF,eAAO,MAAM,KAAK,+CASjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC"}
@@ -4,13 +4,13 @@ import { Tag } from './Tag';
4
4
  import { useStyles } from './Tag.styles';
5
5
  export default {
6
6
  title: 'Tag',
7
- tags: ['Kit'],
7
+ tags: ['ui'],
8
8
  experimental: false,
9
9
  figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=1002-8509',
10
10
  description: 'Différents tags. Composant de type Typography.',
11
11
  component: Tag,
12
12
  styleFn: useStyles,
13
13
  };
14
- export const Colors = () => (_jsx(Box, { children: _jsxs(Box, { display: "flex", flexDirection: "column", gap: 4, children: [_jsx(Tag, { size: "md", color: "default", children: "Tag default" }), _jsx(Tag, { size: "md", color: "action", children: "Tag action" })] }) }));
14
+ export const Colors = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: [_jsx(Tag, { size: "md", color: "default", children: "Tag default" }), _jsx(Tag, { size: "md", color: "action", children: "Tag action" })] }));
15
15
  export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: [_jsx(Tag, { size: "sm", color: "default", children: "Tag sm" }), _jsx(Tag, { size: "md", color: "default", children: "Tag md" })] }));
16
16
  export * as Sources from './Tag.stories.sources';
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,cAAkS,CAAC;AAEtT,eAAO,MAAM,KAAK,cAAqQ,CAAC;AAExR,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"Tag.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,cAA8Q,CAAC;AAElS,eAAO,MAAM,KAAK,cAAqQ,CAAC;AAExR,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // This file is generated. Do not edit manually.
2
2
  // Source: src/ui/Tag/Tag.stories.tsx
3
- export const Colors = () => "export const Colors = () => (\n <Box>\n <Box display=\"flex\" flexDirection=\"column\" gap={4}>\n <Tag size=\"md\" color=\"default\">\n Tag default\n </Tag>\n <Tag size=\"md\" color=\"action\">\n Tag action\n </Tag>\n </Box>\n </Box>\n);";
3
+ export const Colors = () => "export const Colors = () => (\n <Box display=\"flex\" flexDirection=\"row\" gap={4} flexWrap=\"wrap\">\n <Tag size=\"md\" color=\"default\">\n Tag default\n </Tag>\n <Tag size=\"md\" color=\"action\">\n Tag action\n </Tag>\n </Box>\n);";
4
4
  export const Sizes = () => "export const Sizes = () => (\n <Box display=\"flex\" flexDirection=\"row\" gap={4} flexWrap=\"wrap\">\n <Tag size=\"sm\" color=\"default\">\n Tag sm\n </Tag>\n <Tag size=\"md\" color=\"default\">\n Tag md\n </Tag>\n </Box>\n);";
5
5
  export const storySources = {
6
6
  Colors,
@@ -0,0 +1,4 @@
1
+ import { BoxProps } from '../../core';
2
+ export type ToastProps = Omit<BoxProps, 'children'>;
3
+ export declare function Toast(): import("react/jsx-runtime").JSX.Element | null;
4
+ //# sourceMappingURL=Toast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,QAAQ,EAAc,MAAM,YAAY,CAAC;AAIvD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEpD,wBAAgB,KAAK,mDA4EpB"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Toast as TamaguiToast, useToastController, useToastState } from '@tamagui/toast';
3
+ import React from 'react';
4
+ import { Pressable } from 'react-native';
5
+ import { Box, Typography } from '../../core';
6
+ import { LucideIcon } from '../LucideIcon';
7
+ import { useStyles } from './Toast.styles';
8
+ export function Toast() {
9
+ const toast = useToastState();
10
+ const controller = useToastController();
11
+ const styles = useStyles();
12
+ const variant = toast?.customData?.variant ?? 'default';
13
+ const icon = toast?.customData?.icon;
14
+ const iconColor = React.useMemo(() => {
15
+ switch (variant) {
16
+ case 'default':
17
+ return styles.iconDefault.color;
18
+ case 'success':
19
+ return styles.iconSuccess.color;
20
+ case 'error':
21
+ return styles.iconError.color;
22
+ case 'info':
23
+ return styles.iconInfo.color;
24
+ default:
25
+ ((_) => { })(variant);
26
+ }
27
+ }, [styles, variant]);
28
+ const iconName = React.useMemo(() => {
29
+ if (icon)
30
+ return icon;
31
+ switch (variant) {
32
+ case 'default':
33
+ return null;
34
+ case 'success':
35
+ return 'BadgeCheck';
36
+ case 'error':
37
+ return 'BadgeX';
38
+ case 'info':
39
+ return 'BadgeInfo';
40
+ default:
41
+ ((_) => { })(variant);
42
+ }
43
+ return null;
44
+ }, [icon, variant]);
45
+ if (!toast)
46
+ return null;
47
+ return (_jsxs(TamaguiToast, { style: styles.container, duration: toast.duration, enterStyle: { opacity: 0, y: 10, scale: 0.98 }, exitStyle: { opacity: 0, y: 10, scale: 0.98 }, viewportName: "app-toasts", children: [iconName && (_jsx(Box, { style: styles.icon, children: _jsx(LucideIcon, { color: iconColor, name: iconName, size: "sm" }) })), _jsxs(Box, { style: styles.contenu, children: [_jsxs(Box, { style: styles.titleContainer, children: [_jsx(Typography, { style: styles.title, children: toast.title }), _jsx(Pressable, { onPress: () => controller.hide(), children: _jsx(LucideIcon, { name: "X", size: "md" }) })] }), toast.message && (_jsx(Box, { children: _jsx(Typography, { style: styles.message, children: toast.message }) }))] })] }, toast.id));
48
+ }
@@ -0,0 +1,94 @@
1
+ import { Toast } from './Toast';
2
+ declare const _default: {
3
+ title: string;
4
+ tags: "ui"[];
5
+ experimental: false;
6
+ figmaURL: string;
7
+ description: string;
8
+ component: typeof Toast;
9
+ styleFn: () => {
10
+ container: {
11
+ backgroundColor: "#FFFFFF";
12
+ width: number;
13
+ padding: import("@alveole/theme").Spacing;
14
+ borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
15
+ display: "flex";
16
+ flexDirection: "row";
17
+ gap: import("@alveole/theme").Spacing;
18
+ alignItems: "flex-start";
19
+ } | {
20
+ shadowColor: import("@alveole/theme").Color;
21
+ shadowOffset: {
22
+ width: number;
23
+ height: number;
24
+ };
25
+ shadowOpacity: number;
26
+ shadowRadius: number;
27
+ elevation: number;
28
+ backgroundColor: "#FFFFFF";
29
+ width: number;
30
+ padding: import("@alveole/theme").Spacing;
31
+ borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
32
+ display: "flex";
33
+ flexDirection: "row";
34
+ gap: import("@alveole/theme").Spacing;
35
+ alignItems: "flex-start";
36
+ } | {
37
+ boxShadow: string;
38
+ backgroundColor: "#FFFFFF";
39
+ width: number;
40
+ padding: import("@alveole/theme").Spacing;
41
+ borderRadius: import("@alveole/theme/dist/constants/Radius").Radius;
42
+ display: "flex";
43
+ flexDirection: "row";
44
+ gap: import("@alveole/theme").Spacing;
45
+ alignItems: "flex-start";
46
+ };
47
+ contenu: {
48
+ display: "flex";
49
+ flex: number;
50
+ flexDirection: "column";
51
+ gap: import("@alveole/theme").Spacing;
52
+ };
53
+ titleContainer: {
54
+ display: "flex";
55
+ flexDirection: "row";
56
+ alignItems: "center";
57
+ justifyContent: "space-between";
58
+ minHeight: import("@alveole/theme").Spacing;
59
+ };
60
+ title: {
61
+ color: "#151617";
62
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
63
+ fontSize: 14;
64
+ lineHeight: 20;
65
+ letterSpacing: 0;
66
+ };
67
+ icon: {
68
+ paddingTop: import("@alveole/theme").Spacing;
69
+ };
70
+ iconDefault: {
71
+ color: "#373A3F";
72
+ };
73
+ iconInfo: {
74
+ color: "#373A3F";
75
+ };
76
+ iconSuccess: {
77
+ color: "#1B7440";
78
+ };
79
+ iconError: {
80
+ color: "#C62416";
81
+ };
82
+ message: {
83
+ color: "#373A3F";
84
+ fontFamily: "Barlow-Light" | "Barlow-Regular" | "Barlow-Medium" | "Barlow-SemiBold" | "Barlow-Bold" | "Inter-Light" | "Inter-Regular" | "Inter-Medium" | "Inter-SemiBold" | "Inter-Bold";
85
+ fontSize: 14;
86
+ lineHeight: 20;
87
+ letterSpacing: 0;
88
+ };
89
+ };
90
+ };
91
+ export default _default;
92
+ export declare const All: () => import("react/jsx-runtime").JSX.Element;
93
+ export * as Sources from './Toast.stories.sources';
94
+ //# sourceMappingURL=Toast.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKhC,wBAQkB;AAElB,eAAO,MAAM,GAAG,+CAwDf,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@alveole/components';
3
+ import { Box, Highlight, Typography } from '../../core';
4
+ import { Toast } from './Toast';
5
+ import { useStyles } from './Toast.styles';
6
+ import { defaultDuration } from './ToastBridge';
7
+ import { useToast } from './index';
8
+ export default {
9
+ title: 'Toast',
10
+ tags: ['ui'],
11
+ experimental: false,
12
+ figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=2084-1372',
13
+ description: `Toaster Tamagui. Contient le provider global et le hook useToast. Par défaut un toast reste affiché pendant ${defaultDuration / 1000} secondes`,
14
+ component: Toast,
15
+ styleFn: useStyles,
16
+ };
17
+ export const All = () => {
18
+ const toast = useToast();
19
+ defaultDuration;
20
+ const defaultToast = () => toast.present('Default', 'Message');
21
+ const successToast = () => toast.present('Success', 'Message', { variant: 'success' });
22
+ const errorToast = () => toast.present('Error', 'Message beaucoup plus long', { variant: 'error' });
23
+ const infoToast = () => toast.present('Information', 'Message', { variant: 'info' });
24
+ const infoToastMultiLine = () => toast.present('Information', 'Message beaucoup plus long avec retour à la ligne.\nDeuxième ligne', {
25
+ variant: 'info',
26
+ });
27
+ const withoutMessageToast = () => toast.present('Sans message');
28
+ const withoutMessageToastError = () => toast.present('Sans message', undefined, { variant: 'error' });
29
+ const withCustomIcon = () => toast.present('Avec icon custom', undefined, { icon: 'Worm' });
30
+ return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 8, children: [_jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: [_jsx(Button, { title: "Default toast", variant: "secondary", onPress: defaultToast }), _jsx(Button, { title: "Success toast", variant: "secondary", onPress: successToast }), _jsx(Button, { title: "Error toast", variant: "secondary", onPress: errorToast }), _jsx(Button, { title: "Info toast", variant: "secondary", onPress: infoToast }), _jsx(Button, { title: "Message long", variant: "secondary", onPress: infoToastMultiLine }), _jsx(Button, { title: "Without message toast", variant: "secondary", onPress: withoutMessageToast }), _jsx(Button, { title: "Without message toast error", variant: "secondary", onPress: withoutMessageToastError }), _jsx(Button, { title: "WithCustomIcon", variant: "secondary", onPress: withCustomIcon })] }), _jsxs(Box, { display: "flex", flexDirection: "column", gap: 4, children: [_jsx(Typography, { children: `Le fichier _layout.tsx doit inclure la balise <Toasts> pour fonctionner` }), _jsx(Highlight, { language: "tsx", children: `
31
+ import { Toasts } from '@alveole/components';
32
+ import { ThemeProvider } from '@alveole/theme';
33
+ import { Stack } from 'expo-router';
34
+ import React from 'react';
35
+ import { TamaguiProvider } from 'tamagui';
36
+ import { tamaguiConfig } from '../tamagui.config';
37
+
38
+ export default function RootLayout() {
39
+ return (
40
+ <TamaguiProvider config={tamaguiConfig} defaultTheme="light">
41
+ <ThemeProvider loader={false}>
42
+ <Toasts>
43
+ <Stack screenOptions={{ headerShown: false }} />
44
+ </Toasts>
45
+ </ThemeProvider>
46
+ </TamaguiProvider>
47
+ );
48
+ }
49
+ ` })] })] }));
50
+ };
51
+ export * as Sources from './Toast.stories.sources';
@@ -0,0 +1,6 @@
1
+ export declare const All: () => string;
2
+ export declare const storySources: {
3
+ readonly All: () => string;
4
+ };
5
+ export type StorySourceName = keyof typeof storySources;
6
+ //# sourceMappingURL=Toast.stories.sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,cAA+zF,CAAC;AAEh1F,eAAO,MAAM,YAAY;;CAEf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ // This file is generated. Do not edit manually.
2
+ // Source: src/ui/Toast/Toast.stories.tsx
3
+ export const All = () => "export const All = () => {\n const toast = useToast();\n\n defaultDuration;\n\n const defaultToast = () => toast.present('Default', 'Message');\n const successToast = () => toast.present('Success', 'Message', { variant: 'success' });\n const errorToast = () => toast.present('Error', 'Message beaucoup plus long', { variant: 'error' });\n const infoToast = () => toast.present('Information', 'Message', { variant: 'info' });\n const infoToastMultiLine = () =>\n toast.present('Information', 'Message beaucoup plus long avec retour à la ligne.\\nDeuxième ligne', {\n variant: 'info',\n });\n const withoutMessageToast = () => toast.present('Sans message');\n const withoutMessageToastError = () => toast.present('Sans message', undefined, { variant: 'error' });\n const withCustomIcon = () => toast.present('Avec icon custom', undefined, { icon: 'Worm' });\n\n return (\n <Box display=\"flex\" flexDirection=\"column\" gap={8}>\n <Box display=\"flex\" flexDirection=\"row\" gap={4} flexWrap=\"wrap\">\n <Button title=\"Default toast\" variant=\"secondary\" onPress={defaultToast} />\n <Button title=\"Success toast\" variant=\"secondary\" onPress={successToast} />\n <Button title=\"Error toast\" variant=\"secondary\" onPress={errorToast} />\n <Button title=\"Info toast\" variant=\"secondary\" onPress={infoToast} />\n <Button title=\"Message long\" variant=\"secondary\" onPress={infoToastMultiLine} />\n <Button title=\"Without message toast\" variant=\"secondary\" onPress={withoutMessageToast} />\n <Button title=\"Without message toast error\" variant=\"secondary\" onPress={withoutMessageToastError} />\n <Button title=\"WithCustomIcon\" variant=\"secondary\" onPress={withCustomIcon} />\n </Box>\n <Box display=\"flex\" flexDirection=\"column\" gap={4}>\n <Typography>{`Le fichier _layout.tsx doit inclure la balise <Toasts> pour fonctionner`}</Typography>\n <Highlight language=\"tsx\">\n {`\n import { Toasts } from '@alveole/components';\n import { ThemeProvider } from '@alveole/theme';\n import { Stack } from 'expo-router';\n import React from 'react';\n import { TamaguiProvider } from 'tamagui';\n import { tamaguiConfig } from '../tamagui.config';\n\n export default function RootLayout() {\n return (\n <TamaguiProvider config={tamaguiConfig} defaultTheme=\"light\">\n <ThemeProvider loader={false}>\n <Toasts>\n <Stack screenOptions={{ headerShown: false }} />\n </Toasts>\n </ThemeProvider>\n </TamaguiProvider>\n );\n }\n `}\n </Highlight>\n </Box>\n </Box>\n );\n};";
4
+ export const storySources = {
5
+ All,
6
+ };