@alveole/components 2.0.0-alpha.11 → 2.0.0-alpha.13
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/Code/Code.d.ts.map +1 -1
- package/dist/core/Code/Code.js +6 -0
- package/dist/core/Code/Code.stories.d.ts +15 -2
- package/dist/core/Code/Code.stories.d.ts.map +1 -1
- package/dist/core/Code/Code.styles.d.ts +15 -2
- package/dist/core/Code/Code.styles.d.ts.map +1 -1
- package/dist/core/Code/Code.styles.js +18 -4
- package/dist/core/Highlight/Highlight.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.js +4 -4
- package/dist/core/Highlight/Highlight.stories.d.ts +16 -2
- package/dist/core/Highlight/Highlight.stories.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.stories.js +1 -1
- package/dist/core/Highlight/Highlight.stories.sources.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.stories.sources.js +1 -1
- package/dist/core/Highlight/Highlight.styles.d.ts +16 -2
- package/dist/core/Highlight/Highlight.styles.d.ts.map +1 -1
- package/dist/core/Highlight/Highlight.styles.js +13 -1
- package/dist/core/MarkdownDescription/MarkdownDescription.js +1 -1
- package/dist/core/Metabase/Metabase.stories.d.ts.map +1 -1
- package/dist/core/Metabase/Metabase.stories.js +3 -2
- package/dist/core/Metabase/Metabase.stories.sources.d.ts.map +1 -1
- package/dist/core/Metabase/Metabase.stories.sources.js +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/ui/ActionMenu/ActionMenuItem.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenuItem.js +5 -2
- package/dist/ui/BottomSheet/BottomSheet.js +1 -1
- package/dist/ui/BottomSheet/BottomSheet.stories.d.ts +4 -3
- package/dist/ui/BottomSheet/BottomSheet.stories.d.ts.map +1 -1
- package/dist/ui/BottomSheet/BottomSheet.styles.d.ts +4 -3
- package/dist/ui/BottomSheet/BottomSheet.styles.d.ts.map +1 -1
- package/dist/ui/BottomSheet/BottomSheet.styles.js +4 -3
- package/dist/ui/Button/Button.stories.js +8 -8
- package/dist/ui/Button/Button.stories.sources.d.ts.map +1 -1
- package/dist/ui/Button/Button.stories.sources.js +8 -8
- package/dist/ui/Checkbox/Checkbox.stories.d.ts +2 -1
- package/dist/ui/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/ui/Checkbox/Checkbox.stories.js +3 -2
- package/dist/ui/Checkbox/Checkbox.stories.sources.d.ts.map +1 -1
- package/dist/ui/Checkbox/Checkbox.stories.sources.js +2 -2
- package/dist/ui/Checkbox/Checkbox.styles.d.ts +2 -1
- package/dist/ui/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/ui/Checkbox/Checkbox.styles.js +3 -1
- package/dist/ui/Checkbox/CheckboxLabel.d.ts.map +1 -1
- package/dist/ui/Checkbox/CheckboxLabel.js +2 -1
- package/dist/ui/DocumentViewer/DocumentViewer.stories.js +4 -4
- package/dist/ui/DocumentViewer/DocumentViewer.stories.sources.d.ts.map +1 -1
- package/dist/ui/DocumentViewer/DocumentViewer.stories.sources.js +4 -4
- 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/FormControl/OtpInput.stories.js +1 -1
- package/dist/ui/FormControl/OtpInput.stories.sources.d.ts.map +1 -1
- package/dist/ui/FormControl/OtpInput.stories.sources.js +1 -1
- package/dist/ui/FormControl/TextInputPassword.d.ts.map +1 -1
- package/dist/ui/FormControl/TextInputPassword.js +9 -2
- package/dist/ui/FormControl/textInputStyles.d.ts +1 -0
- package/dist/ui/FormControl/textInputStyles.d.ts.map +1 -1
- package/dist/ui/FormControl/textInputStyles.js +1 -0
- 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/RadioGroup/RadioGroup.js +1 -1
- package/dist/ui/RadioGroup/RadioGroupContext.d.ts +1 -0
- package/dist/ui/RadioGroup/RadioGroupContext.d.ts.map +1 -1
- package/dist/ui/RadioGroup/RadioGroupItem.d.ts.map +1 -1
- package/dist/ui/RadioGroup/RadioGroupItem.js +7 -2
- 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/dist/ui/Select/Select.stories.d.ts +0 -1
- package/dist/ui/Select/Select.stories.d.ts.map +1 -1
- package/dist/ui/Select/Select.styles.d.ts +1 -2
- package/dist/ui/Select/Select.styles.d.ts.map +1 -1
- package/dist/ui/Select/Select.styles.js +1 -2
- package/dist/ui/Select/selectTriggerStyle.d.ts +1 -1
- package/dist/ui/Switch/Switch.d.ts.map +1 -1
- package/dist/ui/Switch/Switch.js +4 -2
- package/dist/ui/Tag/Tag.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.js +14 -2
- package/dist/ui/Tag/Tag.stories.d.ts +8 -0
- package/dist/ui/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.styles.d.ts +8 -0
- package/dist/ui/Tag/Tag.styles.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.styles.js +11 -0
- package/dist/ui/Tag/TagNativeContent.d.ts +11 -0
- package/dist/ui/Tag/TagNativeContent.d.ts.map +1 -0
- package/dist/ui/Tag/TagNativeContent.js +10 -0
- package/dist/ui/TextInputArray/TextInputArray.js +1 -1
- package/dist/ui/Toast/Toast.stories.d.ts +11 -4
- package/dist/ui/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.styles.d.ts +11 -4
- package/dist/ui/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.styles.js +6 -3
- package/dist/ui/ToolbarTop/ToolbarTop.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.js +1 -2
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +1 -2
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts +1 -2
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.styles.js +1 -2
- package/dist/ui/ToolbarTop/ToolbarTop.types.d.ts +2 -3
- package/dist/ui/ToolbarTop/ToolbarTop.types.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/toolbarTopStyling.d.ts +3 -2
- package/dist/ui/ToolbarTop/toolbarTopStyling.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import { Box } from '../../core/Box';
|
|
3
4
|
import { Checkbox } from './Checkbox';
|
|
4
5
|
import { useStyles } from './Checkbox.styles';
|
|
@@ -10,6 +11,6 @@ export default {
|
|
|
10
11
|
component: Checkbox,
|
|
11
12
|
styleFn: useStyles,
|
|
12
13
|
};
|
|
13
|
-
export const Default = () => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 24, children: [_jsx(Checkbox, { label: "Non coch\u00E9" }), _jsx(Checkbox, { label: "Coch\u00E9", checked: true }), _jsx(Checkbox, { label: "D\u00E9sactiv\u00E9", disabled: true }), _jsx(Checkbox, { label: "Coch\u00E9 d\u00E9sactiv\u00E9", checked: true, disabled: true }), _jsx(Checkbox, { label: "Avec erreur", error: "Vous devez accepter les conditions" }), _jsx(Checkbox, { label: "Avec succ\u00E8s", success: "Valid\u00E9" })] }));
|
|
14
|
-
export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 16, children: [_jsx(Checkbox, { label: "Size MD", size: "md" }), _jsx(Checkbox, { label: "Size SM", size: "sm" })] }));
|
|
14
|
+
export const Default = () => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 24, style: Platform.OS === 'web' ? undefined : { alignSelf: 'stretch' }, children: [_jsx(Checkbox, { label: "Non coch\u00E9" }), _jsx(Checkbox, { label: "Coch\u00E9", checked: true }), _jsx(Checkbox, { label: "D\u00E9sactiv\u00E9", disabled: true }), _jsx(Checkbox, { label: "Coch\u00E9 d\u00E9sactiv\u00E9", checked: true, disabled: true }), _jsx(Checkbox, { label: "Avec erreur", error: "Vous devez accepter les conditions" }), _jsx(Checkbox, { label: "Avec succ\u00E8s", success: "Valid\u00E9" })] }));
|
|
15
|
+
export const Sizes = () => (_jsxs(Box, { display: "flex", flexDirection: "row", gap: 16, style: Platform.OS === 'web' ? undefined : { alignSelf: 'stretch', flexWrap: 'wrap' }, children: [_jsx(Checkbox, { label: "Size MD", size: "md" }), _jsx(Checkbox, { label: "Size SM", size: "sm" })] }));
|
|
15
16
|
export * as Sources from './Checkbox.stories.sources';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/Checkbox.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/Checkbox.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA4hB,CAAC;AAEjjB,eAAO,MAAM,KAAK,cAA6T,CAAC;AAEhV,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is generated. Do not edit manually.
|
|
2
2
|
// Source: src/ui/Checkbox/Checkbox.stories.tsx
|
|
3
|
-
export const Default = () => "export const Default = () => (\n <Box
|
|
4
|
-
export const Sizes = () => "export const Sizes = () => (\n <Box
|
|
3
|
+
export const Default = () => "export const Default = () => (\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n gap={24}\n style={Platform.OS === 'web' ? undefined : { alignSelf: 'stretch' }}\n >\n <Checkbox label=\"Non coché\" />\n <Checkbox label=\"Coché\" checked />\n <Checkbox label=\"Désactivé\" disabled />\n <Checkbox label=\"Coché désactivé\" checked disabled />\n <Checkbox label=\"Avec erreur\" error=\"Vous devez accepter les conditions\" />\n <Checkbox label=\"Avec succès\" success=\"Validé\" />\n </Box>\n);";
|
|
4
|
+
export const Sizes = () => "export const Sizes = () => (\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n gap={16}\n style={Platform.OS === 'web' ? undefined : { alignSelf: 'stretch', flexWrap: 'wrap' }}\n >\n <Checkbox label=\"Size MD\" size=\"md\" />\n <Checkbox label=\"Size SM\" size=\"sm\" />\n </Box>\n);";
|
|
5
5
|
export const storySources = {
|
|
6
6
|
Default,
|
|
7
7
|
Sizes,
|
|
@@ -7,7 +7,7 @@ export declare const useStyles: () => {
|
|
|
7
7
|
letterSpacing: 0;
|
|
8
8
|
fontFamily: string;
|
|
9
9
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
10
|
-
width
|
|
10
|
+
width?: "100%" | undefined;
|
|
11
11
|
};
|
|
12
12
|
labelSm: {
|
|
13
13
|
fontSize: 14;
|
|
@@ -27,6 +27,7 @@ export declare const useStyles: () => {
|
|
|
27
27
|
color: string;
|
|
28
28
|
};
|
|
29
29
|
checkbox: {
|
|
30
|
+
flexShrink: number;
|
|
30
31
|
height: import("@alveole/theme").Spacing;
|
|
31
32
|
width: import("@alveole/theme").Spacing;
|
|
32
33
|
backgroundColor: "transparent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/Checkbox.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/Checkbox.styles.ts"],"names":[],"mappings":"AAoFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuF,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import { sansEstompage } from '../../core/styleTamagui/sansEstompage';
|
|
3
4
|
const coque = ({ spacing }) => ({
|
|
4
5
|
checkboxContainer: {
|
|
@@ -13,6 +14,7 @@ const coque = ({ spacing }) => ({
|
|
|
13
14
|
});
|
|
14
15
|
const caseACocher = ({ color, spacingValue, radius }) => ({
|
|
15
16
|
checkbox: {
|
|
17
|
+
flexShrink: 0,
|
|
16
18
|
height: spacingValue('150'),
|
|
17
19
|
width: spacingValue('150'),
|
|
18
20
|
backgroundColor: 'transparent',
|
|
@@ -47,7 +49,7 @@ const caseACocher = ({ color, spacingValue, radius }) => ({
|
|
|
47
49
|
});
|
|
48
50
|
const libelle = ({ text, color }) => ({
|
|
49
51
|
label: {
|
|
50
|
-
width: '100%',
|
|
52
|
+
...(Platform.OS === 'web' && { width: '100%' }),
|
|
51
53
|
...text['Corps de texte'].MD.Regular,
|
|
52
54
|
cursor: 'pointer',
|
|
53
55
|
color: color.text['label-grey'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxLabel.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/CheckboxLabel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckboxLabel.d.ts","sourceRoot":"","sources":["../../../src/ui/Checkbox/CheckboxLabel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,GAAG,UAAU,gCA4BnE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Platform } from 'react-native';
|
|
2
3
|
import { Label } from 'tamagui/unstyled';
|
|
3
4
|
import { Typography } from '../../core/Typography';
|
|
4
5
|
import { useStyles } from './Checkbox.styles';
|
|
@@ -7,7 +8,7 @@ export const CheckboxLabel = (props) => {
|
|
|
7
8
|
const { size, variant, disabled, error, success, label, ...labelProps } = props;
|
|
8
9
|
const styles = useStyles();
|
|
9
10
|
const resolvedSize = resolveCheckboxSize(size, variant);
|
|
10
|
-
return (_jsx(Label, { disabled: disabled, ...labelProps, width: '100%', children: _jsx(Typography, { style: {
|
|
11
|
+
return (_jsx(Label, { disabled: disabled, ...labelProps, width: Platform.OS === 'web' ? '100%' : undefined, flexShrink: Platform.OS === 'web' ? undefined : 1, children: _jsx(Typography, { style: {
|
|
11
12
|
...styles.label,
|
|
12
13
|
...(resolvedSize === 'sm' ? styles.labelSm : {}),
|
|
13
14
|
...(disabled ? styles.labelDisabled : {}),
|
|
@@ -12,8 +12,8 @@ export default {
|
|
|
12
12
|
component: DocumentViewer,
|
|
13
13
|
styleFn: useStyles,
|
|
14
14
|
};
|
|
15
|
-
export const DocumentImageEx = () => (_jsx(Box, { maxW: 500, height: 500, children: _jsx(DocumentViewer, { title: "Document image", type: "image", source: "https://picsum.photos/1000/2000", height: "100%" }) }));
|
|
16
|
-
export const DocumentPdf = () => (_jsx(Box, { height: 400, maxW: 500, children: _jsx(DocumentViewer, { title: "Document PDF", type: "pdf", source: "https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf", height: "100%" }) }));
|
|
17
|
-
export const DocumentPdfError = () => (_jsx(Box, { height: 400, maxW: 500, children: _jsx(DocumentViewer, { title: "Document PDF en erreur", type: "pdf", source: "https://example.com/document-inexistant.pdf", height: "100%" }) }));
|
|
18
|
-
export const WithChildren = () => (_jsx(Box, { height: 600, children: _jsx(DocumentViewer, { title: "Document PDF", type: "pdf", source: "https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf", height: "100%", children: _jsx(Box, { p: '2W', children: _jsx(Typography, { children: "Contenu enfant" }) }) }) }));
|
|
15
|
+
export const DocumentImageEx = () => (_jsx(Box, { width: "100%", maxW: 500, height: 500, children: _jsx(DocumentViewer, { title: "Document image", type: "image", source: "https://picsum.photos/1000/2000", height: "100%" }) }));
|
|
16
|
+
export const DocumentPdf = () => (_jsx(Box, { width: "100%", height: 400, maxW: 500, children: _jsx(DocumentViewer, { title: "Document PDF", type: "pdf", source: "https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf", height: "100%" }) }));
|
|
17
|
+
export const DocumentPdfError = () => (_jsx(Box, { width: "100%", height: 400, maxW: 500, children: _jsx(DocumentViewer, { title: "Document PDF en erreur", type: "pdf", source: "https://example.com/document-inexistant.pdf", height: "100%" }) }));
|
|
18
|
+
export const WithChildren = () => (_jsx(Box, { width: "100%", height: 600, children: _jsx(DocumentViewer, { title: "Document PDF", type: "pdf", source: "https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf", height: "100%", children: _jsx(Box, { p: '2W', children: _jsx(Typography, { children: "Contenu enfant" }) }) }) }));
|
|
19
19
|
export * as Sources from './DocumentViewer.stories.sources';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentViewer.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/DocumentViewer/DocumentViewer.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"DocumentViewer.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/DocumentViewer/DocumentViewer.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,cAA0O,CAAC;AAEvQ,eAAO,MAAM,WAAW,cAA0S,CAAC;AAEnU,eAAO,MAAM,gBAAgB,cAA8R,CAAC;AAE5T,eAAO,MAAM,YAAY,cAA2Y,CAAC;AAEra,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is generated. Do not edit manually.
|
|
2
2
|
// Source: src/ui/DocumentViewer/DocumentViewer.stories.tsx
|
|
3
|
-
export const DocumentImageEx = () => "export const DocumentImageEx = () => (\n <Box maxW={500} height={500}>\n <DocumentViewer title=\"Document image\" type=\"image\" source=\"https://picsum.photos/1000/2000\" height=\"100%\" />\n </Box>\n);";
|
|
4
|
-
export const DocumentPdf = () => "export const DocumentPdf = () => (\n <Box height={400} maxW={500}>\n <DocumentViewer\n title=\"Document PDF\"\n type=\"pdf\"\n source=\"https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf\"\n height=\"100%\"\n />\n </Box>\n);";
|
|
5
|
-
export const DocumentPdfError = () => "export const DocumentPdfError = () => (\n <Box height={400} maxW={500}>\n <DocumentViewer\n title=\"Document PDF en erreur\"\n type=\"pdf\"\n source=\"https://example.com/document-inexistant.pdf\"\n height=\"100%\"\n />\n </Box>\n);";
|
|
6
|
-
export const WithChildren = () => "export const WithChildren = () => (\n <Box height={600}>\n <DocumentViewer\n title=\"Document PDF\"\n type=\"pdf\"\n source=\"https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf\"\n height=\"100%\"\n >\n <Box p={'2W'}>\n <Typography>Contenu enfant</Typography>\n </Box>\n </DocumentViewer>\n </Box>\n);";
|
|
3
|
+
export const DocumentImageEx = () => "export const DocumentImageEx = () => (\n <Box width=\"100%\" maxW={500} height={500}>\n <DocumentViewer title=\"Document image\" type=\"image\" source=\"https://picsum.photos/1000/2000\" height=\"100%\" />\n </Box>\n);";
|
|
4
|
+
export const DocumentPdf = () => "export const DocumentPdf = () => (\n <Box width=\"100%\" height={400} maxW={500}>\n <DocumentViewer\n title=\"Document PDF\"\n type=\"pdf\"\n source=\"https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf\"\n height=\"100%\"\n />\n </Box>\n);";
|
|
5
|
+
export const DocumentPdfError = () => "export const DocumentPdfError = () => (\n <Box width=\"100%\" height={400} maxW={500}>\n <DocumentViewer\n title=\"Document PDF en erreur\"\n type=\"pdf\"\n source=\"https://example.com/document-inexistant.pdf\"\n height=\"100%\"\n />\n </Box>\n);";
|
|
6
|
+
export const WithChildren = () => "export const WithChildren = () => (\n <Box width=\"100%\" height={600}>\n <DocumentViewer\n title=\"Document PDF\"\n type=\"pdf\"\n source=\"https://upload.wikimedia.org/wikipedia/commons/4/4e/Wikip%C3%A9dia.pdf\"\n height=\"100%\"\n >\n <Box p={'2W'}>\n <Typography>Contenu enfant</Typography>\n </Box>\n </DocumentViewer>\n </Box>\n);";
|
|
7
7
|
export const storySources = {
|
|
8
8
|
DocumentImageEx,
|
|
9
9
|
DocumentPdf,
|
|
@@ -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 = {
|
|
@@ -11,5 +11,5 @@ export default {
|
|
|
11
11
|
component: OtpInput,
|
|
12
12
|
styleFn: useStyles,
|
|
13
13
|
};
|
|
14
|
-
export const Default = () => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 24, children: [_jsx(FormControl, { label: "Code de v\u00E9rification", children: _jsx(OtpInput, { onChange: () => { } }) }), _jsx(FormControl, { label: "Avec erreur", error: "Code invalide", children: _jsx(OtpInput, { onChange: () => { }, error: "Code invalide" }) }), _jsx(FormControl, { label: "Avec succ\u00E8s", success: "Code v\u00E9rifi\u00E9", children: _jsx(OtpInput, { onChange: () => { }, success: "Code v\u00E9rifi\u00E9" }) }), _jsx(FormControl, { label: "D\u00E9sactiv\u00E9", disabled: true, children: _jsx(OtpInput, { onChange: () => { }, disabled: true }) })] }));
|
|
14
|
+
export const Default = () => (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 24, children: [_jsx(FormControl, { label: "Code de v\u00E9rification", children: _jsx(OtpInput, { numberOfDigits: 4, onChange: () => { } }) }), _jsx(FormControl, { label: "Avec erreur", error: "Code invalide", children: _jsx(OtpInput, { numberOfDigits: 4, onChange: () => { }, error: "Code invalide" }) }), _jsx(FormControl, { label: "Avec succ\u00E8s", success: "Code v\u00E9rifi\u00E9", children: _jsx(OtpInput, { numberOfDigits: 4, onChange: () => { }, success: "Code v\u00E9rifi\u00E9" }) }), _jsx(FormControl, { label: "D\u00E9sactiv\u00E9", disabled: true, children: _jsx(OtpInput, { numberOfDigits: 4, onChange: () => { }, disabled: true }) })] }));
|
|
15
15
|
export * as Sources from './OtpInput.stories.sources';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/OtpInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"OtpInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/OtpInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAA8sB,CAAC;AAEnuB,eAAO,MAAM,YAAY;;CAEf,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/OtpInput.stories.tsx
|
|
3
|
-
export const Default = () => "export const Default = () => (\n <Box display=\"flex\" flexDirection=\"column\" gap={24}>\n <FormControl label=\"Code de vérification\">\n <OtpInput onChange={() => {}} />\n </FormControl>\n <FormControl label=\"Avec erreur\" error=\"Code invalide\">\n <OtpInput onChange={() => {}} error=\"Code invalide\" />\n </FormControl>\n <FormControl label=\"Avec succès\" success=\"Code vérifié\">\n <OtpInput onChange={() => {}} success=\"Code vérifié\" />\n </FormControl>\n <FormControl label=\"Désactivé\" disabled>\n <OtpInput onChange={() => {}} disabled />\n </FormControl>\n </Box>\n);";
|
|
3
|
+
export const Default = () => "export const Default = () => (\n <Box display=\"flex\" flexDirection=\"column\" gap={24}>\n <FormControl label=\"Code de vérification\">\n <OtpInput numberOfDigits={4} onChange={() => {}} />\n </FormControl>\n <FormControl label=\"Avec erreur\" error=\"Code invalide\">\n <OtpInput numberOfDigits={4} onChange={() => {}} error=\"Code invalide\" />\n </FormControl>\n <FormControl label=\"Avec succès\" success=\"Code vérifié\">\n <OtpInput numberOfDigits={4} onChange={() => {}} success=\"Code vérifié\" />\n </FormControl>\n <FormControl label=\"Désactivé\" disabled>\n <OtpInput numberOfDigits={4} onChange={() => {}} disabled />\n </FormControl>\n </Box>\n);";
|
|
4
4
|
export const storySources = {
|
|
5
5
|
Default,
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputPassword.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/TextInputPassword.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInputPassword.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/TextInputPassword.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,qFAAqF;AACrF,eAAO,MAAM,iBAAiB;;;;;;;;;;0DAyB7B,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
3
4
|
import { ButtonIcon } from '../Button';
|
|
4
5
|
import { TextInputInline } from './TextInputInline';
|
|
5
|
-
//
|
|
6
|
-
|
|
6
|
+
// En natif, une hauteur en pourcentage dans ce cadre de hauteur automatique
|
|
7
|
+
// peut étirer toute la saisie. Le bouton y garde la hauteur de son cran.
|
|
8
|
+
const boutonAccole = {
|
|
9
|
+
...(Platform.OS === 'web' ? { height: '100%' } : {}),
|
|
10
|
+
borderRadius: 0,
|
|
11
|
+
paddingTop: 0,
|
|
12
|
+
paddingBottom: 0,
|
|
13
|
+
};
|
|
7
14
|
/** Le mot de passe : une saisie ordinaire, masquee, qu'un oeil permet de reveler. */
|
|
8
15
|
export const TextInputPassword = React.forwardRef(function TextInputPassword(props, ref) {
|
|
9
16
|
const [masque, setMasque] = React.useState(true);
|
|
@@ -26,6 +26,7 @@ export declare const inputFrameStyle: (styles: Styles, state: InputFrameState) =
|
|
|
26
26
|
paddingLeft?: number | undefined;
|
|
27
27
|
paddingRight?: number | undefined;
|
|
28
28
|
borderColor: string;
|
|
29
|
+
alignItems?: "center" | undefined;
|
|
29
30
|
display: "flex";
|
|
30
31
|
flexDirection: "row";
|
|
31
32
|
gap: string | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textInputStyles.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/textInputStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG;IAE/C,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,OAAO,eAAe
|
|
1
|
+
{"version":3,"file":"textInputStyles.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/textInputStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG;IAE/C,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,OAAO,eAAe;;;;;;;;;;;;;;;;CAOpE,CAAC;AAEH,6FAA6F;AAC7F,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,kCAAkC,IAAI,CAAC,eAAe,EAAE,gBAAgB,GAAG,cAAc,CAAC,yBAKxF,CAAC"}
|
|
@@ -14,6 +14,7 @@ import { fieldBorderState } from './fieldBorderState';
|
|
|
14
14
|
*/
|
|
15
15
|
export const inputFrameStyle = (styles, state) => ({
|
|
16
16
|
...styles.inputInner,
|
|
17
|
+
...(!state.multiline ? { alignItems: 'center' } : {}),
|
|
17
18
|
...fieldBorderState(styles, state),
|
|
18
19
|
...(state.endAdornment ? { paddingRight: 0 } : {}),
|
|
19
20
|
...(state.startAdornment ? { paddingLeft: 0 } : {}),
|
|
@@ -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.
|
|
@@ -13,5 +13,5 @@ export const RadioGroup = React.forwardRef(function RadioGroup(props, ref) {
|
|
|
13
13
|
const { children, value, label, labelRight, hint, error, success, disabled, onChange, variant = 'default', ...groupProps } = props;
|
|
14
14
|
const styles = useStyles();
|
|
15
15
|
const labelId = React.useId();
|
|
16
|
-
return (_jsx(RadioGroupContext.Provider, { value: { value, onChange }, children: _jsxs(Box, { tag: "radio-group", style: styles.container, children: [_jsxs(Box, { tag: "radio-group-heading", children: [!!label && _jsx(FormControlLabel, { id: labelId, labelRight: labelRight, label: label, disabled: disabled }), !!hint && _jsx(FormControlHint, { hint: hint, disabled: disabled })] }), _jsx(Box, { width: '100%', children: _jsx(TamaguiRadioGroup, { orientation: "vertical", ref: ref, "aria-labelledby": label ? labelId : undefined, value: value, onValueChange: onChange, style: [styles.group, variant === 'card' ? styles.groupCard : styles.groupItem], width: "100%", ...groupProps, minWidth: '100%', children: children }) }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }) }));
|
|
16
|
+
return (_jsx(RadioGroupContext.Provider, { value: { value, onChange, disabled }, children: _jsxs(Box, { tag: "radio-group", style: styles.container, children: [_jsxs(Box, { tag: "radio-group-heading", children: [!!label && _jsx(FormControlLabel, { id: labelId, labelRight: labelRight, label: label, disabled: disabled }), !!hint && _jsx(FormControlHint, { hint: hint, disabled: disabled })] }), _jsx(Box, { width: '100%', children: _jsx(TamaguiRadioGroup, { orientation: "vertical", ref: ref, "aria-labelledby": label ? labelId : undefined, value: value, onValueChange: onChange, style: [styles.group, variant === 'card' ? styles.groupCard : styles.groupItem], width: "100%", ...groupProps, minWidth: '100%', children: children }) }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }) }));
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupContext.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroupContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,iBAAiB,8BAAyC,CAAC;AACxE,eAAO,MAAM,aAAa,qBAA4C,CAAC"}
|
|
1
|
+
{"version":3,"file":"RadioGroupContext.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroupContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,iBAAiB,8BAAyC,CAAC;AACxE,eAAO,MAAM,aAAa,qBAA4C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupItem.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroupItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioGroupItem.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroupItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgB,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,mBAAmB,IAAI,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAS5F,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE,OAAO,CAAC,GAAG;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,sBAyCxD,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useId } from 'react';
|
|
3
|
+
import { Platform, Pressable } from 'react-native';
|
|
3
4
|
import { Label } from 'tamagui/unstyled';
|
|
4
5
|
import { Box } from '../../core/Box';
|
|
6
|
+
import { versStyleNatif } from '../../core/styleNatif/versStyleNatif';
|
|
5
7
|
import { Typography } from '../../core/Typography';
|
|
8
|
+
import { useRadioGroup } from './RadioGroupContext';
|
|
6
9
|
import { useStyles } from './RadioGroupItem.styles';
|
|
7
10
|
import { RadioInput } from './RadioInput';
|
|
8
11
|
export const RadioGroupItem = (props) => {
|
|
@@ -10,5 +13,7 @@ export const RadioGroupItem = (props) => {
|
|
|
10
13
|
const rid = useId();
|
|
11
14
|
const id = React.useMemo(() => `radiogroup-${value}-${rid}`, [value, rid]);
|
|
12
15
|
const styles = useStyles();
|
|
13
|
-
|
|
16
|
+
const { onChange, disabled } = useRadioGroup();
|
|
17
|
+
const contenu = (_jsxs(_Fragment, { children: [_jsx(Box, { children: _jsx(RadioInput, { value: value, id: id, size: "md", label: children }) }), _jsx(Box, { children: _jsx(Typography, { style: styles.itemLabel, children: children }) })] }));
|
|
18
|
+
return (_jsx(Box, { tag: "radio-group-item", style: styles.item, children: Platform.OS === 'web' ? (_jsx(Label, { htmlFor: id, style: styles.labelContainer, children: contenu })) : (_jsx(Pressable, { accessible: false, disabled: disabled, pointerEvents: "box-only", style: versStyleNatif(styles.labelContainer), onPress: () => onChange?.(value), children: contenu })) }));
|
|
14
19
|
};
|
|
@@ -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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAwCkB;AA2ClB,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAelB,CAAC;AAEF,eAAO,MAAM,SAAS,mCASrB,CAAC;AAEF,eAAO,MAAM,OAAO,mCASnB,CAAC;AAEF,eAAO,MAAM,QAAQ,mCASpB,CAAC;AAEF,eAAO,MAAM,SAAS,mCASrB,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,UAAU,mCAStB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,mCAmCxB,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,QAAQ,mCASpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,mCAyBrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,mCAiCnB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC"}
|
|
@@ -14,9 +14,8 @@ export declare const useStyles: () => {
|
|
|
14
14
|
valueDisabled: {
|
|
15
15
|
color: string;
|
|
16
16
|
};
|
|
17
|
-
/** Les puces repassent à la ligne
|
|
17
|
+
/** Les puces repassent à la ligne ; le chevron et la valeur restent centrés dans le champ. */
|
|
18
18
|
inputInnerMultiple: {
|
|
19
|
-
alignItems: "flex-start";
|
|
20
19
|
paddingTop: string | number;
|
|
21
20
|
paddingBottom: string | number;
|
|
22
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Select.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.styles.ts"],"names":[],"mappings":"AAuFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;IAflB,8FAA8F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA7B9F,0EAA0E;;;;;;;IAO1E;;;;OAIG;;CAiCsF,CAAC"}
|
|
@@ -59,9 +59,8 @@ const contenuDuChamp = ({ text, color, spacing }) => ({
|
|
|
59
59
|
valueDisabled: {
|
|
60
60
|
color: color.light.text['disabled-grey'],
|
|
61
61
|
},
|
|
62
|
-
/** Les puces repassent à la ligne
|
|
62
|
+
/** Les puces repassent à la ligne ; le chevron et la valeur restent centrés dans le champ. */
|
|
63
63
|
inputInnerMultiple: {
|
|
64
|
-
alignItems: 'flex-start',
|
|
65
64
|
paddingTop: spacing('1V'),
|
|
66
65
|
paddingBottom: spacing('1V'),
|
|
67
66
|
},
|
|
@@ -13,11 +13,11 @@ export type SelectTriggerState = Omit<FieldBorderState, 'focus'> & {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const selectTriggerStyle: (styles: SelectStyles, { open, multiple, ...state }: SelectTriggerState) => {
|
|
15
15
|
borderColor: string;
|
|
16
|
-
alignItems: "flex-start" | "center";
|
|
17
16
|
paddingTop?: string | number | undefined;
|
|
18
17
|
paddingBottom?: string | number | undefined;
|
|
19
18
|
display: "flex";
|
|
20
19
|
flexDirection: "row";
|
|
20
|
+
alignItems: "center";
|
|
21
21
|
gap: string | number;
|
|
22
22
|
paddingLeft: number;
|
|
23
23
|
paddingRight: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/ui/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/ui/Switch/Switch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAS,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,cAAc,EAA2B,WAAW,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AASrG,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACzE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AA4BF,eAAO,MAAM,MAAM;SAlCZ,MAAM;YACH,MAAM;YACN,aAAa;YACb,MAAM;cACJ,MAAM;gBACJ,OAAO;wCA8FnB,CAAC"}
|
package/dist/ui/Switch/Switch.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { focusRingProps, useTheme } from '@alveole/theme';
|
|
3
3
|
import React, { useId } from 'react';
|
|
4
|
+
import { Platform, Pressable } from 'react-native';
|
|
4
5
|
import { Switch as TamaguiSwitch } from 'tamagui';
|
|
5
6
|
import { Label } from 'tamagui/unstyled';
|
|
6
7
|
import { animer } from '../../core/animation/animer';
|
|
@@ -9,6 +10,7 @@ import { Typography } from '../../core/Typography';
|
|
|
9
10
|
import { FormControlCaption } from '../FormControl';
|
|
10
11
|
import { apparenceDuSwitch } from './Switch.apparence';
|
|
11
12
|
import { useStyles } from './Switch.styles';
|
|
13
|
+
const SwitchLabel = ({ id, checked, disabled, onChange, children }) => Platform.OS === 'web' ? (_jsx(Label, { htmlFor: id, width: "100%", children: children })) : (_jsx(Pressable, { accessible: false, disabled: disabled, pointerEvents: "box-only", onPress: () => onChange(!checked), children: children }));
|
|
12
14
|
// La piste du pouce, comme Tamagui v1 la dimensionnait : deux pouces de large, un de haut, plus
|
|
13
15
|
// 4 px pour le padding et la bordure qu'Alveole pose de chaque cote. La v2 ne compte plus ces
|
|
14
16
|
// 4 px, et le pouce debordait de sa piste. La taille de reference etait le token `$true` de la
|
|
@@ -31,7 +33,7 @@ export const Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
31
33
|
onCheckedChange?.(newValue);
|
|
32
34
|
};
|
|
33
35
|
const { bouton, pouce, libelle } = apparenceDuSwitch(styles, { value, disabled, noPadding, style });
|
|
34
|
-
const Toggle = (_jsx(TamaguiSwitch, { id: id, ref: ref, borderWidth: 1, ...DIMENSIONS_DE_LA_PISTE, checked: value, onCheckedChange: onChange, style: bouton, disabled: disabled, ...focusRingProps(), ...switchProps, children: _jsx(TamaguiSwitch.Thumb, { ...animer('quicker'), width: POUCE, height: POUCE, style: pouce }) }));
|
|
35
|
-
const ToggleWithLabel = (_jsxs(_Fragment, { children: [_jsx(
|
|
36
|
+
const Toggle = (_jsx(TamaguiSwitch, { id: id, ref: ref, borderWidth: 1, ...DIMENSIONS_DE_LA_PISTE, checked: value, onCheckedChange: onChange, style: bouton, disabled: disabled, accessibilityLabel: label, accessibilityRole: "switch", accessibilityState: { checked: Boolean(value), disabled: Boolean(disabled) }, ...focusRingProps(), ...switchProps, children: _jsx(TamaguiSwitch.Thumb, { ...animer('quicker'), width: POUCE, height: POUCE, style: pouce }) }));
|
|
37
|
+
const ToggleWithLabel = (_jsxs(_Fragment, { children: [_jsx(SwitchLabel, { id: id, checked: value, disabled: disabled, onChange: onChange, children: _jsxs(Box, { tag: "switch", style: styles.switch, children: [Toggle, !!label && (_jsx(Typography, { htmlFor: id, style: libelle, children: label }))] }) }), (error ?? success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
36
38
|
return (_jsx(Box, { tag: "switch", gap: error || success ? spacingValue('050') : 0, style: styles.switchContainer, children: !label ? Toggle : ToggleWithLabel }));
|
|
37
39
|
});
|
package/dist/ui/Tag/Tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7C,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAOlD,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,OAAO,QAAQ,sBAqElC,CAAC"}
|
package/dist/ui/Tag/Tag.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Pressable } from 'react-native';
|
|
3
|
+
import { Platform, Pressable } from 'react-native';
|
|
4
4
|
import { Box } from '../../core/Box';
|
|
5
5
|
import { Typography } from '../../core/Typography';
|
|
6
6
|
import { LeadingSlot } from '../Leading';
|
|
7
7
|
import { useStyles } from './Tag.styles';
|
|
8
8
|
import { TagClose } from './TagClose';
|
|
9
|
+
import { TagNativeContent } from './TagNativeContent';
|
|
9
10
|
import { apparenceDeLaPastille, ecartDeLIcone, reponseAuPointeur } from './tagStyling';
|
|
10
11
|
export const Tag = (props) => {
|
|
11
12
|
const { size, children, selected, interactive, closable, onClose, leading, style, ...tagProps } = props;
|
|
@@ -24,6 +25,17 @@ export const Tag = (props) => {
|
|
|
24
25
|
croixSurvolee,
|
|
25
26
|
selectionnee: !!selected,
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
+
const apparence = apparenceDeLaPastille(styles, {
|
|
29
|
+
size,
|
|
30
|
+
survolee,
|
|
31
|
+
selectionnee: !!selected,
|
|
32
|
+
fermable: !!closable,
|
|
33
|
+
});
|
|
34
|
+
const icone = leading != null && (_jsx(Box, { style: ecartDeLIcone(styles, size), children: _jsx(LeadingSlot, { contenu: leading, apparence: { size: 'sm' } }) }));
|
|
35
|
+
const croix = closable && (_jsx(TagClose, { size: size, libelle: typeof children === 'string' ? children : undefined, onSurvol: setCroixSurvolee, fonce: fonce, onClose: onClose }));
|
|
36
|
+
if (Platform.OS !== 'web') {
|
|
37
|
+
return (_jsx(TagNativeContent, { apparence: apparence, leading: icone, close: croix, children: children }));
|
|
38
|
+
}
|
|
39
|
+
return (_jsxs(Typography, { style: apparence, ...tagProps, children: [icone, children, croix] }));
|
|
28
40
|
} }) }));
|
|
29
41
|
};
|