@alveole/components 2.0.0-alpha.10 → 2.0.0-alpha.12
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/A/A.d.ts.map +1 -1
- package/dist/core/A/A.js +5 -2
- package/dist/core/Highlight/Highlight.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.js +5 -2
- package/dist/core/Highlight/Highlight.styles.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.styles.js +2 -1
- package/dist/core/MarkdownDescription/MarkdownDescription.js +5 -7
- package/dist/core/MarkdownDescription/markdownComponents.d.ts +1 -1
- package/dist/core/MarkdownDescription/markdownComponents.d.ts.map +1 -1
- package/dist/core/MarkdownDescription/markdownNatif.d.ts +13 -0
- package/dist/core/MarkdownDescription/markdownNatif.d.ts.map +1 -0
- package/dist/core/MarkdownDescription/markdownNatif.js +73 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/ui/Card/Card.stories.d.ts.map +1 -1
- package/dist/ui/Card/Card.stories.js +3 -2
- package/dist/ui/Card/Card.stories.sources.d.ts.map +1 -1
- package/dist/ui/Card/Card.stories.sources.js +2 -2
- package/dist/ui/DateInput/DateInput.d.ts +2 -2
- package/dist/ui/DateInput/DateInput.d.ts.map +1 -1
- package/dist/ui/DateInput/DateInput.ios.d.ts +1 -1
- package/dist/ui/DateInput/DateInput.stories.d.ts +1 -1
- package/dist/ui/DateInput/DateInput.web.d.ts +1 -1
- package/dist/ui/EmptyState/EmptyState.stories.d.ts +1 -2
- package/dist/ui/EmptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/ui/EmptyState/EmptyState.stories.js +1 -1
- package/dist/ui/EmptyState/EmptyState.stories.sources.d.ts.map +1 -1
- package/dist/ui/EmptyState/EmptyState.stories.sources.js +1 -1
- package/dist/ui/EmptyState/EmptyState.styles.d.ts +1 -2
- package/dist/ui/EmptyState/EmptyState.styles.d.ts.map +1 -1
- package/dist/ui/EmptyState/EmptyState.styles.js +3 -2
- package/dist/ui/FormControl/FormControl.stories.d.ts.map +1 -1
- package/dist/ui/FormControl/FormControl.stories.js +3 -2
- package/dist/ui/FormControl/FormControl.stories.sources.d.ts.map +1 -1
- package/dist/ui/FormControl/FormControl.stories.sources.js +1 -1
- package/dist/ui/FormControl/NumberInput.stories.js +1 -1
- package/dist/ui/FormControl/NumberInput.stories.sources.d.ts.map +1 -1
- package/dist/ui/FormControl/NumberInput.stories.sources.js +1 -1
- package/dist/ui/Header/Header.stories.d.ts +3 -30
- package/dist/ui/Header/Header.stories.d.ts.map +1 -1
- package/dist/ui/Header/Header.styles.d.ts +3 -30
- package/dist/ui/Header/Header.styles.d.ts.map +1 -1
- package/dist/ui/Header/Header.styles.js +5 -5
- 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.styles.d.ts +1 -0
- package/dist/ui/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.styles.js +2 -0
- package/dist/ui/Popover/Popover.d.ts.map +1 -1
- package/dist/ui/Popover/Popover.js +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.d.ts +2 -0
- package/dist/ui/ResourceList/ResourceList.stories.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.js +3 -1
- package/dist/ui/ResourceList/ResourceList.stories.sources.d.ts +2 -0
- package/dist/ui/ResourceList/ResourceList.stories.sources.d.ts.map +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.sources.js +4 -1
- package/package.json +1 -1
package/dist/core/A/A.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A.d.ts","sourceRoot":"","sources":["../../../src/core/A/A.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAQ,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,aAAa,EAA6B,MAAM,OAAO,CAAC;AAExE,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC;AAE7D,qIAAqI;AACrI,eAAO,MAAM,iBAAiB,qCAA4C,CAAC;AAE3E,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,aAAa,KAAG,aAGhE,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC3C,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC9C,qGAAqG;IACrG,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7D,gIAAgI;IAChI,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;AAEH,eAAO,MAAM,CAAC,GAAI,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"A.d.ts","sourceRoot":"","sources":["../../../src/core/A/A.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAQ,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,aAAa,EAA6B,MAAM,OAAO,CAAC;AAExE,OAAO,EAAO,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAmB,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,KAAK,OAAO,CAAC;AAE7D,qIAAqI;AACrI,eAAO,MAAM,iBAAiB,qCAA4C,CAAC;AAE3E,0GAA0G;AAC1G,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,aAAa,KAAG,aAGhE,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC3C,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IAC9C,qGAAqG;IACrG,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7D,gIAAgI;IAChI,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC,CAAC;AAEH,eAAO,MAAM,CAAC,GAAI,OAAO,MAAM,sBAqE9B,CAAC"}
|
package/dist/core/A/A.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { focusRingProps } from '@alveole/theme';
|
|
3
3
|
import { Link } from 'expo-router';
|
|
4
4
|
import { createContext, useContext } from 'react';
|
|
5
|
-
import { Pressable } from 'react-native';
|
|
5
|
+
import { Platform, Pressable } from 'react-native';
|
|
6
6
|
import { Box } from '../Box';
|
|
7
7
|
import { GridColumnContext } from '../Grid';
|
|
8
8
|
import { useStyles } from './A.styles';
|
|
@@ -23,7 +23,10 @@ export const A = (props) => {
|
|
|
23
23
|
const canAccess = useCanAccessHref(canAccessProp);
|
|
24
24
|
const fill = useContext(GridColumnContext) ? styles.fill : undefined;
|
|
25
25
|
const { navigateurIntegre, propsDuPressable, annonce } = ouvertureDuLien(href, target);
|
|
26
|
-
const contenu = (_jsxs(Box, { tag: "a-pressable", style: { ...styles.pressable, ...fill, ...style }, backgroundColor: backgroundColor,
|
|
26
|
+
const contenu = (_jsxs(Box, { tag: "a-pressable", style: { ...styles.pressable, ...fill, ...style }, backgroundColor: backgroundColor,
|
|
27
|
+
// En natif, les clauses de survol des descendants ne doivent pas capter le toucher
|
|
28
|
+
// destiné au Pressable du lien. Le web garde ses interactions et son survol.
|
|
29
|
+
pointerEvents: Platform.OS === 'web' ? 'auto' : 'none', children: [children, annonce] }));
|
|
27
30
|
const lienNavigateurIntegre = (_jsx(Pressable, { accessibilityRole: "link", "aria-current": ariaCurrent, ...propsDuPressable, style: { ...styleDuLien, ...fill }, ...focusRingProps(), children: contenu }));
|
|
28
31
|
const expoLink = (_jsx(Link, { href: href, asChild: true, replace: direction === 'replace', push: direction === 'push', dismissTo: direction === 'dismiss', children: _jsx(Pressable, { accessibilityRole: "link", "aria-current": ariaCurrent, ...propsDuPressable, style: { ...styleDuLien, ...fill }, ...focusRingProps(), children: contenu }) }));
|
|
29
32
|
if (!canAccess(href))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/core/Highlight/Highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAKxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMvE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG;IACtE,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACjF,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACrC,CAAC;AAMF,eAAO,MAAM,SAAS,GAAI,wCAAuD,cAAc,
|
|
1
|
+
{"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/core/Highlight/Highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAKxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMvE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG;IACtE,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACjF,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACrC,CAAC;AAMF,eAAO,MAAM,SAAS,GAAI,wCAAuD,cAAc,sBA2E9F,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { Platform, ScrollView, StyleSheet, Text, View } from 'react-native';
|
|
4
4
|
// Le type est importé en `import type` : il est effacé à l'exécution, donc l'index du
|
|
5
5
|
// paquet, qui charge aussi toute la moitié highlight.js, n'est jamais évalué.
|
|
6
6
|
import { CustomPalette, focusRingProps } from '@alveole/theme';
|
|
@@ -32,7 +32,10 @@ export const Highlight = ({ children, language, style, variant = 'standalone' })
|
|
|
32
32
|
}
|
|
33
33
|
return acc;
|
|
34
34
|
}, []);
|
|
35
|
-
const renderer = ({ rows }) => (_jsx(ScrollView, { horizontal: true, focusable: true,
|
|
35
|
+
const renderer = ({ rows }) => (_jsx(ScrollView, { horizontal: true, focusable: true,
|
|
36
|
+
// En natif, ScrollView grandit par défaut. Dans la page défilante du catalogue,
|
|
37
|
+
// le code doit garder sa hauteur de contenu au lieu de remplir la hauteur disponible.
|
|
38
|
+
style: Platform.OS === 'web' ? undefined : { flexGrow: 0, flexShrink: 0 }, ...focusRingProps(),
|
|
36
39
|
// `styles.highlight` pose `overflow: scroll`, ce qui ferait défiler le conteneur de
|
|
37
40
|
// contenu en doublon du `ScrollView` qui l'entoure. C'est ce doublon intérieur qu'axe
|
|
38
41
|
// signalait : il défile sans pouvoir recevoir le focus, que porte l'extérieur.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Highlight.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Highlight/Highlight.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Highlight.styles.d.ts","sourceRoot":"","sources":["../../../src/core/Highlight/Highlight.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;CAsBpB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
export const useStyles = makeStyles(({ color, radius, spacingValue }) => {
|
|
3
4
|
const base = {
|
|
4
5
|
overflow: 'scroll',
|
|
5
|
-
padding: spacingValue('2W'),
|
|
6
|
+
padding: spacingValue(Platform.OS === 'web' ? '2W' : '1W'),
|
|
6
7
|
width: '100%',
|
|
7
8
|
backgroundColor: color.light.background['alt-grey'],
|
|
8
9
|
};
|
|
@@ -2,16 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTheme } from '@alveole/theme';
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
|
-
import { Typography } from '../Typography';
|
|
6
5
|
import { createMarkdownComponents } from './markdownComponents';
|
|
6
|
+
import { createNativeMarkdownComponents, preparerMarkdownNatif } from './markdownNatif';
|
|
7
7
|
import { replierLesCoupuresDeLigne } from './replierLesCoupuresDeLigne';
|
|
8
8
|
export const MarkdownDescription = ({ children, taille = 'MD', color: textColor }) => {
|
|
9
9
|
const { text, color } = useTheme();
|
|
10
10
|
const bodyStyle = text['Corps de texte'][taille].Regular;
|
|
11
11
|
const boldStyle = text['Corps de texte'][taille].Bold;
|
|
12
|
-
if (Platform.OS !== 'web') {
|
|
13
|
-
return (_jsx(Typography, { style: bodyStyle, color: textColor, children: children }));
|
|
14
|
-
}
|
|
15
12
|
const ReactMarkdown = require('react-markdown').default;
|
|
16
13
|
const remarkGfm = require('remark-gfm').default;
|
|
17
14
|
const borderColor = color.light.border['default-grey'];
|
|
@@ -24,7 +21,7 @@ export const MarkdownDescription = ({ children, taille = 'MD', color: textColor
|
|
|
24
21
|
// de la couleur) exige qu'un lien au milieu d'un bloc de texte se distingue de son
|
|
25
22
|
// entourage par autre chose que sa seule couleur.
|
|
26
23
|
const linkColor = color.light.text['default-info'];
|
|
27
|
-
const
|
|
24
|
+
const styles = {
|
|
28
25
|
bodyStyle,
|
|
29
26
|
boldStyle,
|
|
30
27
|
textColor,
|
|
@@ -33,6 +30,7 @@ export const MarkdownDescription = ({ children, taille = 'MD', color: textColor
|
|
|
33
30
|
borderColor,
|
|
34
31
|
headerBg,
|
|
35
32
|
linkColor,
|
|
36
|
-
}
|
|
37
|
-
|
|
33
|
+
};
|
|
34
|
+
const components = Platform.OS === 'web' ? createMarkdownComponents(styles) : createNativeMarkdownComponents(styles);
|
|
35
|
+
return (_jsx(Box, { tag: "markdown-description", display: "flex", gap: 8, children: _jsx(ReactMarkdown, { remarkPlugins: [remarkGfm, replierLesCoupuresDeLigne], rehypePlugins: Platform.OS === 'web' ? [] : [preparerMarkdownNatif], skipHtml: Platform.OS !== 'web', components: components, children: children }) }));
|
|
38
36
|
};
|
|
@@ -8,7 +8,7 @@ type AvecEnfants = {
|
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
};
|
|
10
10
|
type TextStyle = Pick<RNTextStyle, 'fontSize' | 'lineHeight' | 'fontWeight' | 'fontFamily' | 'letterSpacing'>;
|
|
11
|
-
type MarkdownComponentsStyles = {
|
|
11
|
+
export type MarkdownComponentsStyles = {
|
|
12
12
|
bodyStyle: TextStyle;
|
|
13
13
|
boldStyle: TextStyle;
|
|
14
14
|
/** Couleur du texte courant, hors titres et liens. Vide garde le gris par defaut. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownComponents.d.ts","sourceRoot":"","sources":["../../../src/core/MarkdownDescription/markdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAczD,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,KAAG,cAAc,CAAC,UAAU,CAG7E,CAAC;AAEF,KAAK,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAClD,KAAK,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,CAAC,CAAC;AAE9G,
|
|
1
|
+
{"version":3,"file":"markdownComponents.d.ts","sourceRoot":"","sources":["../../../src/core/MarkdownDescription/markdownComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAa,cAAc,EAAE,MAAM,cAAc,CAAC;AAczD,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM,KAAG,cAAc,CAAC,UAAU,CAG7E,CAAC;AAEF,KAAK,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAClD,KAAK,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,CAAC,CAAC;AAE9G,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,SAAS,CAAC;IACrB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAChC,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,EAAE,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAEnG,eAAO,MAAM,oBAAoB,GAAI,qCAAqC,mBAAmB;yBACtE,WAAW;8BAKN,WAAW;0BAKf,WAAW;CAKjC,CAAC;AAEH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,KAAK,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,MAAM;0BACnE,WAAW;0BAKX,WAAW;0BAKX,WAAW;0BAKX,WAAW;CAKjC,CAAC;AA+HH,eAAO,MAAM,wBAAwB,GAAI,QAAQ,wBAAwB,KAAG,UAQ1E,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Components } from 'react-markdown';
|
|
2
|
+
import { MarkdownComponentsStyles } from './markdownComponents';
|
|
3
|
+
type Noeud = {
|
|
4
|
+
type: string;
|
|
5
|
+
tagName?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
properties?: Record<string, string | number | boolean>;
|
|
8
|
+
children?: Noeud[];
|
|
9
|
+
};
|
|
10
|
+
export declare const preparerMarkdownNatif: () => (noeud: Noeud) => void;
|
|
11
|
+
export declare const createNativeMarkdownComponents: (styles: MarkdownComponentsStyles) => Components;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=markdownNatif.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownNatif.d.ts","sourceRoot":"","sources":["../../../src/core/MarkdownDescription/markdownNatif.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,EAA4B,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE1F,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACvD,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;CACpB,CAAC;AAwCF,eAAO,MAAM,qBAAqB,gBAjBT,KAAK,KAAG,IAiBkB,CAAC;AAuBpD,eAAO,MAAM,8BAA8B,GAAI,QAAQ,wBAAwB,KAAG,UAwChF,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Linking } from 'react-native';
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
import { Typography } from '../Typography';
|
|
5
|
+
import { createMarkdownComponents } from './markdownComponents';
|
|
6
|
+
const CONTENEURS = new Set(['ul', 'ol', 'li', 'blockquote', 'table', 'thead', 'tbody', 'tr', 'section']);
|
|
7
|
+
const BLOCS = new Set(['p', 'ul', 'ol', 'blockquote', 'pre']);
|
|
8
|
+
// Les listes compactes de Markdown ont du texte directement sous `li`. En natif,
|
|
9
|
+
// chaque suite de texte doit être dans un paragraphe, même avant une sous-liste.
|
|
10
|
+
const paragraphesDeListe = (children) => {
|
|
11
|
+
const resultat = [];
|
|
12
|
+
let inline = [];
|
|
13
|
+
const terminer = () => {
|
|
14
|
+
if (inline.length)
|
|
15
|
+
resultat.push({ type: 'element', tagName: 'p', properties: {}, children: inline });
|
|
16
|
+
inline = [];
|
|
17
|
+
};
|
|
18
|
+
for (const enfant of children) {
|
|
19
|
+
if (BLOCS.has(enfant.tagName ?? '')) {
|
|
20
|
+
terminer();
|
|
21
|
+
resultat.push(enfant);
|
|
22
|
+
}
|
|
23
|
+
else
|
|
24
|
+
inline.push(enfant);
|
|
25
|
+
}
|
|
26
|
+
terminer();
|
|
27
|
+
return resultat;
|
|
28
|
+
};
|
|
29
|
+
const preparer = (noeud) => {
|
|
30
|
+
if (!noeud.children)
|
|
31
|
+
return;
|
|
32
|
+
// Les retours entre blocs HTML sont décoratifs. Une View native ne peut pas
|
|
33
|
+
// recevoir ces chaînes de texte, contrairement à un élément DOM.
|
|
34
|
+
if (noeud.type === 'root' || CONTENEURS.has(noeud.tagName ?? '')) {
|
|
35
|
+
noeud.children = noeud.children.filter(enfant => enfant.type !== 'text' || !!enfant.value?.trim());
|
|
36
|
+
}
|
|
37
|
+
if (noeud.tagName === 'li')
|
|
38
|
+
noeud.children = paragraphesDeListe(noeud.children);
|
|
39
|
+
if (noeud.tagName === 'ol') {
|
|
40
|
+
const debut = Number(noeud.properties?.start ?? 1);
|
|
41
|
+
noeud.children.forEach((enfant, index) => {
|
|
42
|
+
enfant.properties = { ...enfant.properties, 'data-marker': `${debut + index}.` };
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
noeud.children.forEach(preparer);
|
|
46
|
+
};
|
|
47
|
+
export const preparerMarkdownNatif = () => preparer;
|
|
48
|
+
const tableauxNatifs = ({ bodyStyle, boldStyle, borderColor, headerBg }) => ({
|
|
49
|
+
table: ({ children }) => (_jsx(Box, { borderWidth: 1, borderColor: borderColor, children: children })),
|
|
50
|
+
thead: ({ children }) => _jsx(Box, { style: { backgroundColor: headerBg }, children: children }),
|
|
51
|
+
tbody: ({ children }) => _jsx(Box, { children: children }),
|
|
52
|
+
tr: ({ children }) => _jsx(Box, { style: { flexDirection: 'row' }, children: children }),
|
|
53
|
+
th: ({ children }) => (_jsx(Box, { p: 8, borderWidth: 1, borderColor: borderColor, style: { flex: 1, minWidth: 0 }, children: _jsx(Typography, { style: boldStyle, children: children }) })),
|
|
54
|
+
td: ({ children }) => (_jsx(Box, { p: 8, borderWidth: 1, borderColor: borderColor, style: { flex: 1, minWidth: 0 }, children: _jsx(Typography, { style: bodyStyle, children: children }) })),
|
|
55
|
+
});
|
|
56
|
+
export const createNativeMarkdownComponents = (styles) => ({
|
|
57
|
+
...createMarkdownComponents(styles),
|
|
58
|
+
...tableauxNatifs(styles),
|
|
59
|
+
section: ({ children }) => _jsx(Box, { style: { gap: 8 }, children: children }),
|
|
60
|
+
sup: ({ children }) => _jsx(Typography, { style: styles.bodyStyle, children: children }),
|
|
61
|
+
h5: ({ children }) => (_jsx(Typography, { style: styles.titres['H6 - XXS'], color: styles.titleColor, children: children })),
|
|
62
|
+
h6: ({ children }) => (_jsx(Typography, { style: styles.titres['H6 - XXS'], color: styles.titleColor, children: children })),
|
|
63
|
+
a: ({ href, children }) => (_jsx(Typography, { style: styles.bodyStyle, color: styles.linkColor, textDecorationLine: "underline", accessibilityRole: "link", onPress: href ? () => void Linking.openURL(href) : undefined, children: children })),
|
|
64
|
+
li: ({ children, node }) => {
|
|
65
|
+
const marque = node?.properties?.['data-marker'];
|
|
66
|
+
return (_jsxs(Box, { style: { flexDirection: 'row', gap: 8, alignItems: 'flex-start' }, children: [_jsx(Typography, { style: styles.bodyStyle, children: typeof marque === 'string' ? marque : '•' }), _jsx(Box, { style: { flex: 1, gap: 4 }, children: children })] }));
|
|
67
|
+
},
|
|
68
|
+
br: () => _jsx(Typography, { children: '\n' }),
|
|
69
|
+
hr: () => _jsx(Box, { style: { borderTopWidth: 1, borderColor: styles.borderColor } }),
|
|
70
|
+
del: ({ children }) => _jsx(Typography, { style: { textDecorationLine: 'line-through' }, children: children }),
|
|
71
|
+
input: ({ checked }) => _jsx(Typography, { children: checked ? '☑ ' : '☐ ' }),
|
|
72
|
+
img: ({ alt }) => _jsx(Typography, { style: styles.bodyStyle, children: alt }),
|
|
73
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ALVEOLE_COMPONENTS_VERSION: "2.0.0-alpha.
|
|
1
|
+
export declare const ALVEOLE_COMPONENTS_VERSION: "2.0.0-alpha.12";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ALVEOLE_COMPONENTS_VERSION = "2.0.0-alpha.
|
|
1
|
+
export const ALVEOLE_COMPONENTS_VERSION = "2.0.0-alpha.12";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,wBAQkB;AAElB,eAAO,MAAM,IAAI,mCAuBhB,CAAC;AAEF,eAAO,MAAM,YAAY,mCAwBxB,CAAC;AAEF,eAAO,MAAM,aAAa,mCA0BzB,CAAC;AAEF,eAAO,MAAM,qBAAqB,mCA2BjC,CAAC;AAEF,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAU/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAU/B,CAAC;AAEF,eAAO,MAAM,UAAU,mCAiBtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAc9B,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,WAAW,mCAOvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '../../core/Box';
|
|
3
|
+
import { Image } from '../../core/Image';
|
|
3
4
|
import { Avatar } from '../Avatar';
|
|
4
5
|
import { Badge } from '../Badge';
|
|
5
6
|
import { Button } from '../Button';
|
|
@@ -22,10 +23,10 @@ export const cardDisabled = () => {
|
|
|
22
23
|
return (_jsx(Box, { style: { width: '100%', maxWidth: 400 }, children: _jsxs(Card, { children: [_jsx(Card.Header, { variant: "disabled", titre: "Titre lorem", sousTitre: "Sous-titre", image: _jsx(Avatar, { size: "md", src: "https://picsum.photos/100/100", fallbackText: "M" }), badge: _jsx(Badge, { variant: "default", size: "sm", children: "PR\u00C9SENT" }) }), _jsx(Card.Section, { variant: "disabled", titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsx(Card.Section, { variant: "disabled", titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsxs(Card.Actions, { children: [_jsx(Button, { variant: "secondary", title: "Libell\u00E9", size: "sm", disabled: true }), _jsx(Button, { variant: "primary", title: "Libell\u00E9", size: "sm", disabled: true })] })] }) }));
|
|
23
24
|
};
|
|
24
25
|
export const cardWithMedia = () => {
|
|
25
|
-
return (_jsx(Box, { style: { width: '100%', maxWidth: 400 }, children: _jsxs(Card, { children: [_jsx(Card.Media, { children: _jsx(
|
|
26
|
+
return (_jsx(Box, { style: { width: '100%', maxWidth: 400 }, children: _jsxs(Card, { children: [_jsx(Card.Media, { children: _jsx(Image, { source: "https://picsum.photos/400/200", alt: "", width: "100%", height: 200 }) }), _jsx(Card.Header, { titre: "Titre lorem", sousTitre: "Sous-titre", image: _jsx(Avatar, { size: "md", fallbackText: "M" }), badge: _jsx(Badge, { variant: "success", size: "sm", children: "PR\u00C9SENT" }) }), _jsx(Card.Section, { titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsx(Card.Section, { titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsxs(Card.Actions, { children: [_jsx(Button, { variant: "secondary", title: "Libell\u00E9", size: "sm" }), _jsx(Button, { variant: "primary", title: "Libell\u00E9", size: "sm" })] })] }) }));
|
|
26
27
|
};
|
|
27
28
|
export const cardWithMediaDisabled = () => {
|
|
28
|
-
return (_jsx(Box, { style: { width: '100%', maxWidth: 400 }, children: _jsxs(Card, { children: [_jsx(Card.Media, { variant: "disabled", children: _jsx(
|
|
29
|
+
return (_jsx(Box, { style: { width: '100%', maxWidth: 400 }, children: _jsxs(Card, { children: [_jsx(Card.Media, { variant: "disabled", children: _jsx(Image, { source: "https://picsum.photos/400/200", alt: "", width: "100%", height: 200 }) }), _jsx(Card.Header, { variant: "disabled", titre: "Titre lorem", sousTitre: "Sous-titre", image: _jsx(Avatar, { size: "md", fallbackText: "M" }), badge: _jsx(Badge, { variant: "default", size: "sm", children: "PR\u00C9SENT" }) }), _jsx(Card.Section, { variant: "disabled", titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsx(Card.Section, { variant: "disabled", titre: "Titre section", titreIcone: "Calendar", description: "Description" }), _jsxs(Card.Actions, { children: [_jsx(Button, { variant: "secondary", title: "Libell\u00E9", size: "sm", disabled: true }), _jsx(Button, { variant: "primary", title: "Libell\u00E9", size: "sm", disabled: true })] })] }) }));
|
|
29
30
|
};
|
|
30
31
|
export const cardSection = () => {
|
|
31
32
|
return (_jsx(Card.Section, { titre: "Titre de la carte", description: "Description de la carte", titreIcone: "Image", descriptionIcone: "Image" }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAA80B,CAAC;AAEh2B,eAAO,MAAM,YAAY,cAAw9B,CAAC;AAEl/B,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"Card.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAA80B,CAAC;AAEh2B,eAAO,MAAM,YAAY,cAAw9B,CAAC;AAEl/B,eAAO,MAAM,aAAa,cAAu+B,CAAC;AAElgC,eAAO,MAAM,qBAAqB,cAAgmC,CAAC;AAEnoC,eAAO,MAAM,WAAW,cAA8O,CAAC;AAEvQ,eAAO,MAAM,mBAAmB,cAAkR,CAAC;AAEnT,eAAO,MAAM,mBAAmB,cAAmR,CAAC;AAEpT,eAAO,MAAM,UAAU,cAA2hB,CAAC;AAEnjB,eAAO,MAAM,kBAAkB,cAAoW,CAAC;AAEpY,eAAO,MAAM,WAAW,cAAoP,CAAC;AAE7Q,eAAO,MAAM,YAAY;;;;;;;;;;;CAWf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAEtE,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Source: src/ui/Card/Card.stories.tsx
|
|
3
3
|
export const card = () => "export const card = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Header\n titre=\"Titre lorem\"\n sousTitre=\"Sous-titre\"\n image={<Avatar size=\"md\" fallbackText=\"M\" />}\n badge={\n <Badge variant=\"success\" size=\"sm\">\n PRÉSENT\n </Badge>\n }\n />\n <Card.Section titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Section titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Actions>\n <Button variant=\"secondary\" title=\"Libellé\" size=\"sm\" />\n <Button variant=\"primary\" title=\"Libellé\" size=\"sm\" />\n </Card.Actions>\n </Card>\n </Box>\n );\n};";
|
|
4
4
|
export const cardDisabled = () => "export const cardDisabled = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Header\n variant=\"disabled\"\n titre=\"Titre lorem\"\n sousTitre=\"Sous-titre\"\n image={<Avatar size=\"md\" src=\"https://picsum.photos/100/100\" fallbackText=\"M\" />}\n badge={\n <Badge variant=\"default\" size=\"sm\">\n PRÉSENT\n </Badge>\n }\n />\n <Card.Section variant=\"disabled\" titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Section variant=\"disabled\" titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Actions>\n <Button variant=\"secondary\" title=\"Libellé\" size=\"sm\" disabled />\n <Button variant=\"primary\" title=\"Libellé\" size=\"sm\" disabled />\n </Card.Actions>\n </Card>\n </Box>\n );\n};";
|
|
5
|
-
export const cardWithMedia = () => "export const cardWithMedia = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Media>\n <
|
|
6
|
-
export const cardWithMediaDisabled = () => "export const cardWithMediaDisabled = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Media variant=\"disabled\">\n <
|
|
5
|
+
export const cardWithMedia = () => "export const cardWithMedia = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Media>\n <Image source=\"https://picsum.photos/400/200\" alt=\"\" width=\"100%\" height={200} />\n </Card.Media>\n <Card.Header\n titre=\"Titre lorem\"\n sousTitre=\"Sous-titre\"\n image={<Avatar size=\"md\" fallbackText=\"M\" />}\n badge={\n <Badge variant=\"success\" size=\"sm\">\n PRÉSENT\n </Badge>\n }\n />\n <Card.Section titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Section titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Actions>\n <Button variant=\"secondary\" title=\"Libellé\" size=\"sm\" />\n <Button variant=\"primary\" title=\"Libellé\" size=\"sm\" />\n </Card.Actions>\n </Card>\n </Box>\n );\n};";
|
|
6
|
+
export const cardWithMediaDisabled = () => "export const cardWithMediaDisabled = () => {\n return (\n <Box style={{ width: '100%', maxWidth: 400 }}>\n <Card>\n <Card.Media variant=\"disabled\">\n <Image source=\"https://picsum.photos/400/200\" alt=\"\" width=\"100%\" height={200} />\n </Card.Media>\n <Card.Header\n variant=\"disabled\"\n titre=\"Titre lorem\"\n sousTitre=\"Sous-titre\"\n image={<Avatar size=\"md\" fallbackText=\"M\" />}\n badge={\n <Badge variant=\"default\" size=\"sm\">\n PRÉSENT\n </Badge>\n }\n />\n <Card.Section variant=\"disabled\" titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Section variant=\"disabled\" titre=\"Titre section\" titreIcone=\"Calendar\" description=\"Description\" />\n <Card.Actions>\n <Button variant=\"secondary\" title=\"Libellé\" size=\"sm\" disabled />\n <Button variant=\"primary\" title=\"Libellé\" size=\"sm\" disabled />\n </Card.Actions>\n </Card>\n </Box>\n );\n};";
|
|
7
7
|
export const cardSection = () => "export const cardSection = () => {\n return (\n <Card.Section\n titre=\"Titre de la carte\"\n description=\"Description de la carte\"\n titreIcone=\"Image\"\n descriptionIcone=\"Image\"\n />\n );\n};";
|
|
8
8
|
export const cardSectionDisabled = () => "export const cardSectionDisabled = () => {\n return (\n <Card.Section\n variant=\"disabled\"\n titre=\"Titre de la carte\"\n description=\"Description de la carte\"\n titreIcone=\"Image\"\n descriptionIcone=\"Image\"\n />\n );\n};";
|
|
9
9
|
export const cardSectionWithLink = () => "export const cardSectionWithLink = () => {\n return (\n <Card.Section\n titre=\"Titre de la carte\"\n description=\"Description de la carte\"\n descriptionLink=\"/\"\n titreIcone=\"Image\"\n descriptionIcone=\"Image\"\n />\n );\n};";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextInputProps } from '../FormControl';
|
|
3
3
|
type MinuteInterval = 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
|
|
4
|
-
export type DateInputProps = Omit<TextInputProps, 'type'> & {
|
|
4
|
+
export type DateInputProps = Omit<TextInputProps, 'type' | 'onChange'> & {
|
|
5
5
|
type?: 'date' | 'datetime' | 'month';
|
|
6
6
|
display?: 'default' | 'spinner';
|
|
7
7
|
value?: string;
|
|
@@ -11,7 +11,7 @@ export type DateInputProps = Omit<TextInputProps, 'type'> & {
|
|
|
11
11
|
is24Hour?: boolean;
|
|
12
12
|
minuteInterval?: MinuteInterval;
|
|
13
13
|
};
|
|
14
|
-
export declare const DateInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "type"> & {
|
|
14
|
+
export declare const DateInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "onChange" | "type"> & {
|
|
15
15
|
type?: "date" | "datetime" | "month";
|
|
16
16
|
display?: "default" | "spinner";
|
|
17
17
|
value?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAA+B,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE7E,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAA+B,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE7E,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG;IACvE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AA+EF,eAAO,MAAM,SAAS;WAvFb,MAAM,GAAG,UAAU,GAAG,OAAO;cAC1B,SAAS,GAAG,SAAS;YACvB,MAAM;kBACA,IAAI;kBACJ,IAAI;eACP,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;eACtB,OAAO;qBACD,cAAc;0DAkI/B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "type"> & {
|
|
2
|
+
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "onChange" | "type"> & {
|
|
3
3
|
type?: "date" | "datetime" | "month";
|
|
4
4
|
display?: "default" | "spinner";
|
|
5
5
|
value?: string;
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
tags: "ui"[];
|
|
5
5
|
experimental: true;
|
|
6
6
|
description: string;
|
|
7
|
-
component: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "type"> & {
|
|
7
|
+
component: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "onChange" | "type"> & {
|
|
8
8
|
type?: "date" | "datetime" | "month";
|
|
9
9
|
display?: "default" | "spinner";
|
|
10
10
|
value?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "type"> & {
|
|
2
|
+
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("..").TextInputProps, "onChange" | "type"> & {
|
|
3
3
|
type?: "date" | "datetime" | "month";
|
|
4
4
|
display?: "default" | "spinner";
|
|
5
5
|
value?: string;
|
|
@@ -17,7 +17,6 @@ declare const _default: {
|
|
|
17
17
|
paddingLeft: string | number;
|
|
18
18
|
paddingRight: string | number;
|
|
19
19
|
textAlign: "center";
|
|
20
|
-
height: "100%" | undefined;
|
|
21
20
|
width: "100%";
|
|
22
21
|
};
|
|
23
22
|
contenu: {
|
|
@@ -25,7 +24,7 @@ declare const _default: {
|
|
|
25
24
|
gap: string | number;
|
|
26
25
|
alignItems: "center";
|
|
27
26
|
textAlign: "center";
|
|
28
|
-
|
|
27
|
+
flexGrow: number | undefined;
|
|
29
28
|
justifyContent: "center";
|
|
30
29
|
width: "100%";
|
|
31
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyState.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBASkB;AAElB,eAAO,MAAM,OAAO,mCAOnB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAQpB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAcvB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAO9B,CAAC;AAEF,eAAO,MAAM,aAAa,mCAOzB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC"}
|
|
@@ -24,6 +24,6 @@ export const WithCustomChildren = () => {
|
|
|
24
24
|
return (_jsxs(EmptyState, { iconName: "File", description: 'Vous n’avez aucun item', children: [_jsx(Button, { title: 'Button', variant: 'primary', fullWidth: true }), _jsx(Button, { title: 'Secondary action', variant: 'tertiary' })] }));
|
|
25
25
|
};
|
|
26
26
|
export const WithFixHeight = () => {
|
|
27
|
-
return (_jsxs(EmptyState, { iconName: "File", description: 'Vous n’avez aucun item', style: { height:
|
|
27
|
+
return (_jsxs(EmptyState, { iconName: "File", description: 'Vous n’avez aucun item', style: { height: 600 }, children: [_jsx(Button, { title: 'Button', variant: 'primary' }), _jsx(Button, { title: 'Secondary action', variant: 'tertiary' })] }));
|
|
28
28
|
};
|
|
29
29
|
export * as Sources from './EmptyState.stories.sources';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAuO,CAAC;AAE5P,eAAO,MAAM,QAAQ,cAA6N,CAAC;AAEnP,eAAO,MAAM,WAAW,cAAoc,CAAC;AAE7d,eAAO,MAAM,kBAAkB,cAA2S,CAAC;AAE3U,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"EmptyState.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAuO,CAAC;AAE5P,eAAO,MAAM,QAAQ,cAA6N,CAAC;AAEnP,eAAO,MAAM,WAAW,cAAoc,CAAC;AAE7d,eAAO,MAAM,kBAAkB,cAA2S,CAAC;AAE3U,eAAO,MAAM,aAAa,cAAoT,CAAC;AAE/U,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -4,7 +4,7 @@ export const Default = () => "export const Default = () => {\n return (\n <E
|
|
|
4
4
|
export const WithIcon = () => "export const WithIcon = () => {\n return (\n <EmptyState\n iconName=\"ClipboardList\"\n title=\"Aucune donnée\"\n description=\"Ajoutez un élément pour remplir ce tableau.\"\n />\n );\n};";
|
|
5
5
|
export const WithActions = () => "export const WithActions = () => {\n return (\n <EmptyState\n iconName=\"FilePlus\"\n title=\"Vous n’avez aucun document\"\n description=\"Créez un premier document ou importez-en un depuis votre ordinateur.\"\n actions={\n <>\n <Button title=\"Créer un document\" variant=\"primary\" />\n <Button title=\"Importer un fichier\" variant=\"secondary\" />\n </>\n }\n />\n );\n};";
|
|
6
6
|
export const WithCustomChildren = () => "export const WithCustomChildren = () => {\n return (\n <EmptyState iconName=\"File\" description={'Vous n’avez aucun item'}>\n <Button title={'Button'} variant={'primary'} fullWidth />\n <Button title={'Secondary action'} variant={'tertiary'} />\n </EmptyState>\n );\n};";
|
|
7
|
-
export const WithFixHeight = () => "export const WithFixHeight = () => {\n return (\n <EmptyState iconName=\"File\" description={'Vous n’avez aucun item'} style={{ height:
|
|
7
|
+
export const WithFixHeight = () => "export const WithFixHeight = () => {\n return (\n <EmptyState iconName=\"File\" description={'Vous n’avez aucun item'} style={{ height: 600 }}>\n <Button title={'Button'} variant={'primary'} />\n <Button title={'Secondary action'} variant={'tertiary'} />\n </EmptyState>\n );\n};";
|
|
8
8
|
export const storySources = {
|
|
9
9
|
Default,
|
|
10
10
|
WithIcon,
|
|
@@ -10,7 +10,6 @@ export declare const useStyles: () => {
|
|
|
10
10
|
paddingLeft: string | number;
|
|
11
11
|
paddingRight: string | number;
|
|
12
12
|
textAlign: "center";
|
|
13
|
-
height: "100%" | undefined;
|
|
14
13
|
width: "100%";
|
|
15
14
|
};
|
|
16
15
|
contenu: {
|
|
@@ -18,7 +17,7 @@ export declare const useStyles: () => {
|
|
|
18
17
|
gap: string | number;
|
|
19
18
|
alignItems: "center";
|
|
20
19
|
textAlign: "center";
|
|
21
|
-
|
|
20
|
+
flexGrow: number | undefined;
|
|
22
21
|
justifyContent: "center";
|
|
23
22
|
width: "100%";
|
|
24
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DpB,CAAC"}
|
|
@@ -13,7 +13,6 @@ export const useStyles = makeStyles(({ externalPadding, text, color, spacing, ra
|
|
|
13
13
|
paddingLeft: paddingValue,
|
|
14
14
|
paddingRight: paddingValue,
|
|
15
15
|
textAlign: 'center',
|
|
16
|
-
height: isVariant('mobile') ? '100%' : undefined,
|
|
17
16
|
width: '100%',
|
|
18
17
|
},
|
|
19
18
|
contenu: {
|
|
@@ -21,7 +20,9 @@ export const useStyles = makeStyles(({ externalPadding, text, color, spacing, ra
|
|
|
21
20
|
gap: spacing('2W'),
|
|
22
21
|
alignItems: 'center',
|
|
23
22
|
textAlign: 'center',
|
|
24
|
-
|
|
23
|
+
// Grandir seulement si le parent impose une hauteur : une base nulle ou une
|
|
24
|
+
// hauteur à 100 % déforme les exemples et les pages défilantes.
|
|
25
|
+
flexGrow: isVariant('mobile') ? 1 : undefined,
|
|
25
26
|
justifyContent: 'center',
|
|
26
27
|
width: '100%',
|
|
27
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FormControl.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"FormControl.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FormControl.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,wBAOkB;AAElB,eAAO,MAAM,aAAa,mCAQzB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAQrB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAQvB,CAAC;AAEF,eAAO,MAAM,KAAK,mCAMjB,CAAC;AAEF,eAAO,MAAM,OAAO,mCAKnB,CAAC;AAEF,eAAO,MAAM,IAAI,mCAKhB,CAAC;AAEF,eAAO,MAAM,KAAK,mCAejB,CAAC;AAEF,eAAO,MAAM,SAAS,mCA0BrB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,+BAA+B,CAAC"}
|
|
@@ -3,11 +3,12 @@ import { useState } from 'react';
|
|
|
3
3
|
import { Box } from '../../core/Box';
|
|
4
4
|
import { Typography } from '../../core/Typography';
|
|
5
5
|
import { Button } from '../Button';
|
|
6
|
+
import { DateInput as DateInputControl } from '../DateInput';
|
|
6
7
|
import { InputHeading } from '../InputHeading';
|
|
8
|
+
import { TimeInput } from '../TimeInput';
|
|
7
9
|
import { FormControl } from './FormControl';
|
|
8
10
|
import { useStyles } from './FormControl.styles';
|
|
9
11
|
import { FormControlCaption } from './FormControlCaption';
|
|
10
|
-
import { FormControlDateInput } from './FormControlDateInput';
|
|
11
12
|
import { FormControlHint } from './FormControlHint';
|
|
12
13
|
import { FormControlLabel } from './FormControlLabel';
|
|
13
14
|
import { FormControlModal } from './FormControlModal';
|
|
@@ -34,6 +35,6 @@ export const DateInput = () => {
|
|
|
34
35
|
const [date, setDate] = useState('');
|
|
35
36
|
const [time, setTime] = useState('');
|
|
36
37
|
const [month, setMonth] = useState('');
|
|
37
|
-
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 12, children: [_jsxs(FormControl, { children: [_jsx(InputHeading, { children: _jsx(FormControlLabel, { label: "Date" }) }), _jsx(
|
|
38
|
+
return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 12, children: [_jsxs(FormControl, { children: [_jsx(InputHeading, { children: _jsx(FormControlLabel, { label: "Date" }) }), _jsx(DateInputControl, { type: "date", value: date, onChange: setDate })] }), _jsxs(FormControl, { children: [_jsx(InputHeading, { children: _jsx(FormControlLabel, { label: "Heure" }) }), _jsx(TimeInput, { value: time, onChange: setTime })] }), _jsxs(FormControl, { children: [_jsx(InputHeading, { children: _jsx(FormControlLabel, { label: "Mois" }) }), _jsx(DateInputControl, { type: "month", value: month, onChange: setMonth })] })] }));
|
|
38
39
|
};
|
|
39
40
|
export * as Sources from './FormControl.stories.sources';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormControl.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FormControl.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,cAAoS,CAAC;AAE/T,eAAO,MAAM,SAAS,cAAwR,CAAC;AAE/S,eAAO,MAAM,WAAW,cAAyR,CAAC;AAElT,eAAO,MAAM,KAAK,cAA4T,CAAC;AAE/U,eAAO,MAAM,OAAO,cAA8N,CAAC;AAEnP,eAAO,MAAM,IAAI,cAAuO,CAAC;AAEzP,eAAO,MAAM,KAAK,cAA2f,CAAC;AAE9gB,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"FormControl.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FormControl.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,cAAoS,CAAC;AAE/T,eAAO,MAAM,SAAS,cAAwR,CAAC;AAE/S,eAAO,MAAM,WAAW,cAAyR,CAAC;AAElT,eAAO,MAAM,KAAK,cAA4T,CAAC;AAE/U,eAAO,MAAM,OAAO,cAA8N,CAAC;AAEnP,eAAO,MAAM,IAAI,cAAuO,CAAC;AAEzP,eAAO,MAAM,KAAK,cAA2f,CAAC;AAE9gB,eAAO,MAAM,SAAS,cAA43B,CAAC;AAEn5B,eAAO,MAAM,YAAY;;;;;;;;;CASf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -7,7 +7,7 @@ export const Label = () => "export const Label = () => (\n <Box display=\"flex\
|
|
|
7
7
|
export const Caption = () => "export const Caption = () => (\n <Box display=\"flex\" flexDirection=\"column\" gap={24}>\n <FormControlCaption error=\"Champ requis\" />\n <FormControlCaption success=\"Valeur correcte\" />\n </Box>\n);";
|
|
8
8
|
export const Hint = () => "export const Hint = () => (\n <Box display=\"flex\" flexDirection=\"column\" gap={24}>\n <FormControlHint hint=\"Texte descriptif du champ\" />\n <FormControlHint hint=\"Texte desactive\" disabled />\n </Box>\n);";
|
|
9
9
|
export const Modal = () => "export const Modal = () => {\n const [open, setOpen] = useState(false);\n return (\n <Box>\n <Button variant=\"secondary\" title=\"Ouvrir la modale\" onPress={() => setOpen(true)} />\n <FormControlModal\n open={open}\n onClose={() => setOpen(false)}\n submitLabel=\"Valider\"\n onSubmit={() => setOpen(false)}\n >\n <TextInput placeholder=\"Saisir un texte...\" multiline numberOfLines={6} />\n </FormControlModal>\n </Box>\n );\n};";
|
|
10
|
-
export const DateInput = () => "export const DateInput = () => {\n const [date, setDate] = useState('');\n const [time, setTime] = useState('');\n const [month, setMonth] = useState('');\n return (\n <Box display=\"flex\" flexDirection=\"column\" gap={12}>\n <FormControl>\n <InputHeading>\n <FormControlLabel label=\"Date\" />\n </InputHeading>\n <
|
|
10
|
+
export const DateInput = () => "export const DateInput = () => {\n const [date, setDate] = useState('');\n const [time, setTime] = useState('');\n const [month, setMonth] = useState('');\n return (\n <Box display=\"flex\" flexDirection=\"column\" gap={12}>\n <FormControl>\n <InputHeading>\n <FormControlLabel label=\"Date\" />\n </InputHeading>\n <DateInputControl type=\"date\" value={date} onChange={setDate} />\n </FormControl>\n <FormControl>\n <InputHeading>\n <FormControlLabel label=\"Heure\" />\n </InputHeading>\n <TimeInput value={time} onChange={setTime} />\n </FormControl>\n <FormControl>\n <InputHeading>\n <FormControlLabel label=\"Mois\" />\n </InputHeading>\n <DateInputControl type=\"month\" value={month} onChange={setMonth} />\n </FormControl>\n </Box>\n );\n};";
|
|
11
11
|
export const storySources = {
|
|
12
12
|
WithTextInput,
|
|
13
13
|
WithError,
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
};
|
|
16
16
|
export const Default = () => {
|
|
17
17
|
const [value, setValue] = useState(null);
|
|
18
|
-
return (_jsx(FormControl, { label: "Montant", children: _jsx(NumberInput, { value: value, onChange: setValue, placeholder: "
|
|
18
|
+
return (_jsx(FormControl, { label: "Montant", children: _jsx(NumberInput, { value: value, onChange: setValue, placeholder: "Quantit\u00E9" }) }));
|
|
19
19
|
};
|
|
20
20
|
export const AvecUnites = () => {
|
|
21
21
|
const [value, setValue] = useState(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/NumberInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"NumberInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/NumberInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAsQ,CAAC;AAE3R,eAAO,MAAM,UAAU,cAAqkB,CAAC;AAE7lB,eAAO,MAAM,SAAS,cAAmK,CAAC;AAE1L,eAAO,MAAM,YAAY;;;;CAIf,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/FormControl/NumberInput.stories.tsx
|
|
3
|
-
export const Default = () => "export const Default = () => {\n const [value, setValue] = useState<number | null>(null);\n return (\n <FormControl label=\"Montant\">\n <NumberInput value={value} onChange={setValue} placeholder=\"
|
|
3
|
+
export const Default = () => "export const Default = () => {\n const [value, setValue] = useState<number | null>(null);\n return (\n <FormControl label=\"Montant\">\n <NumberInput value={value} onChange={setValue} placeholder=\"Quantité\" />\n </FormControl>\n );\n};";
|
|
4
4
|
export const AvecUnites = () => "export const AvecUnites = () => {\n const [value, setValue] = useState<number | null>(null);\n return (\n <FormControl label=\"Avec unités\">\n <NumberInput\n value={value}\n onChange={setValue}\n startAdornment={\n <Box style={{ paddingLeft: 8, paddingRight: 4 }}>\n <Typography>€</Typography>\n </Box>\n }\n endAdornment={\n <Box style={{ paddingLeft: 4, paddingRight: 8 }}>\n <Typography>TTC</Typography>\n </Box>\n }\n />\n </FormControl>\n );\n};";
|
|
5
5
|
export const Desactive = () => "export const Desactive = () => (\n <FormControl label=\"Désactivé\">\n <NumberInput value={42} onChange={() => {}} disabled />\n </FormControl>\n);";
|
|
6
6
|
export const storySources = {
|
|
@@ -8,40 +8,13 @@ declare const _default: {
|
|
|
8
8
|
component: ({ logo, title, right, homeHref }: import("./Header").HeaderProps) => import("react").JSX.Element;
|
|
9
9
|
styleFn: () => {
|
|
10
10
|
container: {
|
|
11
|
-
position: "sticky";
|
|
12
|
-
top: number;
|
|
13
|
-
zIndex: number;
|
|
14
|
-
width: "100%";
|
|
15
|
-
backgroundColor: string;
|
|
16
|
-
} | {
|
|
17
|
-
position: "sticky";
|
|
18
|
-
top: number;
|
|
19
|
-
zIndex: number;
|
|
20
|
-
width: "100%";
|
|
21
|
-
shadowColor: string;
|
|
22
|
-
shadowOffset: {
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
};
|
|
26
|
-
shadowOpacity: number;
|
|
27
|
-
shadowRadius: number;
|
|
28
|
-
elevation: number;
|
|
29
|
-
backgroundColor: string;
|
|
30
|
-
} | {
|
|
31
|
-
position: "sticky";
|
|
32
|
-
top: number;
|
|
33
|
-
zIndex: number;
|
|
34
|
-
width: "100%";
|
|
35
|
-
boxShadow: string;
|
|
36
11
|
backgroundColor: string;
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
borderBottomWidth: number;
|
|
13
|
+
borderBottomColor: string;
|
|
14
|
+
position: "relative" | "sticky";
|
|
39
15
|
top: number;
|
|
40
16
|
zIndex: number;
|
|
41
17
|
width: "100%";
|
|
42
|
-
borderBottomWidth: number;
|
|
43
|
-
borderBottomColor: string;
|
|
44
|
-
backgroundColor: string;
|
|
45
18
|
};
|
|
46
19
|
inner: {
|
|
47
20
|
display: "flex";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Header/Header.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Header/Header.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAUkB;AAqBlB,eAAO,MAAM,OAAO,mCAYnB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mCAAmE,CAAC;AAElG,eAAO,MAAM,YAAY,mCAExB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,39 +1,12 @@
|
|
|
1
1
|
export declare const useStyles: () => {
|
|
2
2
|
container: {
|
|
3
|
-
position: "sticky";
|
|
4
|
-
top: number;
|
|
5
|
-
zIndex: number;
|
|
6
|
-
width: "100%";
|
|
7
|
-
backgroundColor: string;
|
|
8
|
-
} | {
|
|
9
|
-
position: "sticky";
|
|
10
|
-
top: number;
|
|
11
|
-
zIndex: number;
|
|
12
|
-
width: "100%";
|
|
13
|
-
shadowColor: string;
|
|
14
|
-
shadowOffset: {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
shadowOpacity: number;
|
|
19
|
-
shadowRadius: number;
|
|
20
|
-
elevation: number;
|
|
21
|
-
backgroundColor: string;
|
|
22
|
-
} | {
|
|
23
|
-
position: "sticky";
|
|
24
|
-
top: number;
|
|
25
|
-
zIndex: number;
|
|
26
|
-
width: "100%";
|
|
27
|
-
boxShadow: string;
|
|
28
3
|
backgroundColor: string;
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
borderBottomWidth: number;
|
|
5
|
+
borderBottomColor: string;
|
|
6
|
+
position: "relative" | "sticky";
|
|
31
7
|
top: number;
|
|
32
8
|
zIndex: number;
|
|
33
9
|
width: "100%";
|
|
34
|
-
borderBottomWidth: number;
|
|
35
|
-
borderBottomColor: string;
|
|
36
|
-
backgroundColor: string;
|
|
37
10
|
};
|
|
38
11
|
inner: {
|
|
39
12
|
display: "flex";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Header/Header.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Header/Header.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDnB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
export const useStyles = makeStyles(({ color, text, spacing, spacingValue, radius, isVariant }) => ({
|
|
3
4
|
container: {
|
|
4
5
|
// Barre blanche, séparée du contenu par la seule hairline : c'est ce que font Primer
|
|
5
6
|
// et Atlassian. Un fond gris sur une page blanche ajoute un second séparateur au
|
|
6
7
|
// filet, et écrase tout ce qu'on pose dessus.
|
|
7
8
|
backgroundColor: color.light.background['default-grey'],
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
position: 'sticky',
|
|
9
|
+
borderBottomWidth: 1,
|
|
10
|
+
borderBottomColor: color.light.border['default-grey'],
|
|
11
|
+
position: Platform.OS === 'web' ? 'sticky' : 'relative',
|
|
12
12
|
top: 0,
|
|
13
13
|
zIndex: 100,
|
|
14
14
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAWkB;AAElB,eAAO,MAAM,OAAO,mCAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,mCAgBxB,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/ListItem/ListItem.styles.ts"],"names":[],"mappings":"AAmHA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAiF,CAAC"}
|
|
@@ -43,6 +43,8 @@ const detail = ({ color, text, spacing }) => ({
|
|
|
43
43
|
alignSelf: 'stretch',
|
|
44
44
|
gap: spacing('1W'),
|
|
45
45
|
position: 'relative',
|
|
46
|
+
// Hauteur fixee par la maquette, avec ou sans description.
|
|
47
|
+
minHeight: 52,
|
|
46
48
|
},
|
|
47
49
|
// Pose en absolu sur le bord haut du detail, et non entre deux lignes : c'est ce qui lui
|
|
48
50
|
// evite de compter dans la hauteur de la ligne.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/ui/Popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyC,YAAY,IAAI,mBAAmB,EAAU,MAAM,SAAS,CAAC;AAI7G,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,KAAK,CAAC,iBAAiB,CAAC;IACtB,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,CAAC,CAAC;AAEL,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/ui/Popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAyC,YAAY,IAAI,mBAAmB,EAAU,MAAM,SAAS,CAAC;AAI7G,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7D,MAAM,MAAM,YAAY,GAAG,aAAa,GACtC,KAAK,CAAC,iBAAiB,CAAC;IACtB,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,aAAa,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,CAAC,CAAC;AAEL,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,sBAuD1C,CAAC"}
|
|
@@ -22,5 +22,5 @@ export const Popover = (props) => {
|
|
|
22
22
|
const maxW = popoverStyles.maxW ?? '100%';
|
|
23
23
|
return (_jsxs(TamaguiPopover, { placement: placement, disableFocus: true, open: open, onOpenChange: setOpen, children: [_jsx(TamaguiPopover.Trigger, { asChild: true, children: renderTrigger({ open }) }), _jsx(TamaguiPopover.Content, { trapFocus: false, disableFocusScope: true, ...spacings,
|
|
24
24
|
// {...styles.tamaguiPopoverContent}
|
|
25
|
-
style: [{ maxHeight: scrollable ? maxH : undefined, maxWidth: scrollable ? maxW : undefined }, styles.content], children: scrollable ? (_jsx(YStack, { style: { overflow: 'hidden' }, children: _jsx(ScrollView, { style: { maxHeight: maxH - spacingValue('025') }, children: children }) })) : (children) })] }));
|
|
25
|
+
style: [{ maxHeight: scrollable ? maxH : undefined, maxWidth: scrollable ? maxW : undefined }, styles.content], children: scrollable ? (_jsx(YStack, { style: { overflow: 'hidden' }, children: _jsx(ScrollView, { style: { maxHeight: maxH - spacingValue('025'), flexGrow: 0, flexShrink: 0 }, children: children }) })) : (children) })] }));
|
|
26
26
|
};
|
|
@@ -54,6 +54,8 @@ export declare const Default: () => import("react").JSX.Element;
|
|
|
54
54
|
export declare const WithTitle: () => import("react").JSX.Element;
|
|
55
55
|
export declare const WithIcon: () => import("react").JSX.Element;
|
|
56
56
|
export declare const WithPreviewImageAndTrailing: () => import("react").JSX.Element;
|
|
57
|
+
/** Sans description, le contenu garde ses 52px de haut. */
|
|
58
|
+
export declare const WithoutDescription: () => import("react").JSX.Element;
|
|
57
59
|
/**
|
|
58
60
|
* Quand `isLoading` est `true`, la liste entière est remplacée par un
|
|
59
61
|
* spinner centré. Aucun délai n'est appliqué ici : le chargement initial
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBASkB;AA6BlB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAUrB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAcpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,mCAevC,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,mCAQrB,CAAC;AAEF,eAAO,MAAM,aAAa,mCAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ResourceList.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBASkB;AA6BlB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,SAAS,mCAUrB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCAcpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,mCAevC,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,mCAO9B,CAAC;AAIF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,mCAQrB,CAAC;AAEF,eAAO,MAAM,aAAa,mCAOzB,CAAC;AAEF,eAAO,MAAM,WAAW,mCAQvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC"}
|
|
@@ -43,6 +43,8 @@ export const Default = () => (_jsx(ResourceList, { data: exampleData, keyExtract
|
|
|
43
43
|
export const WithTitle = () => (_jsx(ResourceList, { titre: "Titre de la liste", data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
44
44
|
export const WithIcon = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, IconProps: { name: 'Settings' }, showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
45
45
|
export const WithPreviewImageAndTrailing = () => (_jsx(ResourceList, { data: exampleDataWithPreview, keyExtractor: item => item.id, renderItem: ({ item, index }) => (_jsx(ListItem, { title: item.name, description: item.description, preview_url: item.preview_url, trailing: () => _jsx(LucideIcon, { name: "ChevronRight", size: "sm" }), showSeparateur: index !== 0 })), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
46
|
+
/** Sans description, le contenu garde ses 52px de haut. */
|
|
47
|
+
export const WithoutDescription = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item, index }) => _jsx(ListItem, { title: item.name, showSeparateur: index !== 0 }), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
46
48
|
const aucunExemple = [];
|
|
47
49
|
/**
|
|
48
50
|
* Quand `isLoading` est `true`, la liste entière est remplacée par un
|
|
@@ -52,5 +54,5 @@ const aucunExemple = [];
|
|
|
52
54
|
*/
|
|
53
55
|
export const IsLoading = () => (_jsx(ResourceList, { data: aucunExemple, isLoading: true, keyExtractor: item => item.id, renderItem: () => null, renderNoContent: () => null }));
|
|
54
56
|
export const WithNoContent = () => (_jsx(ResourceList, { data: aucunExemple, keyExtractor: item => item.id, renderItem: ({ item }) => _jsx(ListItem, { title: item.name, description: item.description }), renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
55
|
-
export const WithDivider = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item
|
|
57
|
+
export const WithDivider = () => (_jsx(ResourceList, { data: exampleData, keyExtractor: item => item.id, renderItem: ({ item }) => _jsx(ListItem, { title: item.name, description: item.description, showSeparateur: false }), ItemSeparatorComponent: ResourceListDivider, renderNoContent: () => _jsx(EmptyState, { title: "Aucun \u00E9l\u00E9ment", description: "Cliquez sur le bouton", iconName: "House" }) }));
|
|
56
58
|
export * as Sources from './ResourceList.stories.sources';
|
|
@@ -2,6 +2,7 @@ export declare const Default: () => string;
|
|
|
2
2
|
export declare const WithTitle: () => string;
|
|
3
3
|
export declare const WithIcon: () => string;
|
|
4
4
|
export declare const WithPreviewImageAndTrailing: () => string;
|
|
5
|
+
export declare const WithoutDescription: () => string;
|
|
5
6
|
export declare const IsLoading: () => string;
|
|
6
7
|
export declare const WithNoContent: () => string;
|
|
7
8
|
export declare const WithDivider: () => string;
|
|
@@ -10,6 +11,7 @@ export declare const storySources: {
|
|
|
10
11
|
readonly WithTitle: () => string;
|
|
11
12
|
readonly WithIcon: () => string;
|
|
12
13
|
readonly WithPreviewImageAndTrailing: () => string;
|
|
14
|
+
readonly WithoutDescription: () => string;
|
|
13
15
|
readonly IsLoading: () => string;
|
|
14
16
|
readonly WithNoContent: () => string;
|
|
15
17
|
readonly WithDivider: () => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceList.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA+Y,CAAC;AAEpa,eAAO,MAAM,SAAS,cAAkb,CAAC;AAEzc,eAAO,MAAM,QAAQ,cAA4d,CAAC;AAElf,eAAO,MAAM,2BAA2B,cAAmkB,CAAC;AAE5mB,eAAO,MAAM,SAAS,cAAwN,CAAC;AAE/O,eAAO,MAAM,aAAa,cAAkW,CAAC;AAE7X,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"ResourceList.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/ResourceList/ResourceList.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA+Y,CAAC;AAEpa,eAAO,MAAM,SAAS,cAAkb,CAAC;AAEzc,eAAO,MAAM,QAAQ,cAA4d,CAAC;AAElf,eAAO,MAAM,2BAA2B,cAAmkB,CAAC;AAE5mB,eAAO,MAAM,kBAAkB,cAA2W,CAAC;AAE3Y,eAAO,MAAM,SAAS,cAAwN,CAAC;AAE/O,eAAO,MAAM,aAAa,cAAkW,CAAC;AAE7X,eAAO,MAAM,WAAW,cAAwa,CAAC;AAEjc,eAAO,MAAM,YAAY;;;;;;;;;CASf,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"}
|
|
@@ -4,18 +4,21 @@ export const Default = () => "export const Default = () => (\n <ResourceList\n
|
|
|
4
4
|
export const WithTitle = () => "export const WithTitle = () => (\n <ResourceList\n titre=\"Titre de la liste\"\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem title={item.name} description={item.description} showSeparateur={index !== 0} />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
5
5
|
export const WithIcon = () => "export const WithIcon = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem\n title={item.name}\n description={item.description}\n IconProps={{ name: 'Settings' }}\n showSeparateur={index !== 0}\n />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
6
6
|
export const WithPreviewImageAndTrailing = () => "export const WithPreviewImageAndTrailing = () => (\n <ResourceList\n data={exampleDataWithPreview}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => (\n <ListItem\n title={item.name}\n description={item.description}\n preview_url={item.preview_url}\n trailing={() => <LucideIcon name=\"ChevronRight\" size=\"sm\" />}\n showSeparateur={index !== 0}\n />\n )}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
7
|
+
export const WithoutDescription = () => "export const WithoutDescription = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item, index }) => <ListItem title={item.name} showSeparateur={index !== 0} />}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
7
8
|
export const IsLoading = () => "export const IsLoading = () => (\n <ResourceList\n data={aucunExemple}\n isLoading={true}\n keyExtractor={item => item.id}\n renderItem={() => null}\n renderNoContent={() => null}\n />\n);";
|
|
8
9
|
export const WithNoContent = () => "export const WithNoContent = () => (\n <ResourceList\n data={aucunExemple}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <ListItem title={item.name} description={item.description} />}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
9
|
-
export const WithDivider = () => "export const WithDivider = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item
|
|
10
|
+
export const WithDivider = () => "export const WithDivider = () => (\n <ResourceList\n data={exampleData}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <ListItem title={item.name} description={item.description} showSeparateur={false} />}\n ItemSeparatorComponent={ResourceListDivider}\n renderNoContent={() => <EmptyState title=\"Aucun élément\" description=\"Cliquez sur le bouton\" iconName=\"House\" />}\n />\n);";
|
|
10
11
|
export const storySources = {
|
|
11
12
|
Default,
|
|
12
13
|
WithTitle,
|
|
13
14
|
WithIcon,
|
|
14
15
|
WithPreviewImageAndTrailing,
|
|
16
|
+
WithoutDescription,
|
|
15
17
|
IsLoading,
|
|
16
18
|
WithNoContent,
|
|
17
19
|
WithDivider,
|
|
18
20
|
};
|
|
19
21
|
export const storyDescriptions = {
|
|
22
|
+
WithoutDescription: "Sans description, le contenu garde ses 52px de haut.",
|
|
20
23
|
IsLoading: "Quand `isLoading` est `true`, la liste entière est remplacée par un\nspinner centré. Aucun délai n'est appliqué ici : le chargement initial\nd'une liste vide n'a rien à afficher, le spinner apparaît donc\nimmédiatement pour éviter un écran blanc sans feedback.",
|
|
21
24
|
};
|