@alveole/components 2.0.0-alpha → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/generated/version.d.ts +1 -1
  2. package/dist/generated/version.d.ts.map +1 -1
  3. package/dist/generated/version.js +1 -1
  4. package/dist/stories/index.d.ts +1 -1
  5. package/dist/stories/index.d.ts.map +1 -1
  6. package/dist/stories/index.js +1 -1
  7. package/dist/ui/Checkbox/Checkbox.js +2 -2
  8. package/dist/ui/FileDropZone/FileDropZone.d.ts +10 -0
  9. package/dist/ui/FileDropZone/FileDropZone.d.ts.map +1 -0
  10. package/dist/ui/FileDropZone/FileDropZone.js +3 -0
  11. package/dist/ui/FileDropZone/FileDropZone.stories.d.ts +50 -0
  12. package/dist/ui/FileDropZone/FileDropZone.stories.d.ts.map +1 -0
  13. package/dist/ui/FileDropZone/FileDropZone.stories.js +29 -0
  14. package/dist/ui/FileDropZone/FileDropZone.stories.sources.d.ts +10 -0
  15. package/dist/ui/FileDropZone/FileDropZone.stories.sources.d.ts.map +1 -0
  16. package/dist/ui/FileDropZone/FileDropZone.stories.sources.js +10 -0
  17. package/dist/ui/FileDropZone/FileDropZone.styles.d.ts +37 -0
  18. package/dist/ui/FileDropZone/FileDropZone.styles.d.ts.map +1 -0
  19. package/dist/ui/FileDropZone/FileDropZone.styles.js +35 -0
  20. package/dist/ui/FileDropZone/FileDropZone.web.d.ts +4 -0
  21. package/dist/ui/FileDropZone/FileDropZone.web.d.ts.map +1 -0
  22. package/dist/ui/FileDropZone/FileDropZone.web.js +11 -0
  23. package/dist/ui/FileDropZone/fichiersDuDataTransfer.d.ts.map +1 -0
  24. package/dist/ui/FileDropZone/index.d.ts +2 -0
  25. package/dist/ui/FileDropZone/index.d.ts.map +1 -0
  26. package/dist/ui/FileDropZone/index.js +1 -0
  27. package/dist/ui/FileDropZone/useDepotFichier.d.ts +17 -0
  28. package/dist/ui/FileDropZone/useDepotFichier.d.ts.map +1 -0
  29. package/dist/ui/FileDropZone/useDepotFichier.js +89 -0
  30. package/dist/ui/FormControl/FileInput.d.ts +10 -12
  31. package/dist/ui/FormControl/FileInput.d.ts.map +1 -1
  32. package/dist/ui/FormControl/FileInput.js +15 -53
  33. package/dist/ui/FormControl/FileInput.stories.d.ts +8 -40
  34. package/dist/ui/FormControl/FileInput.stories.d.ts.map +1 -1
  35. package/dist/ui/FormControl/FileInput.stories.js +46 -4
  36. package/dist/ui/FormControl/FileInput.stories.sources.d.ts +10 -0
  37. package/dist/ui/FormControl/FileInput.stories.sources.d.ts.map +1 -1
  38. package/dist/ui/FormControl/FileInput.stories.sources.js +11 -1
  39. package/dist/ui/FormControl/FileInput.styles.d.ts +2 -39
  40. package/dist/ui/FormControl/FileInput.styles.d.ts.map +1 -1
  41. package/dist/ui/FormControl/FileInput.styles.js +3 -32
  42. package/dist/ui/FormControl/FileInputListe.d.ts +11 -0
  43. package/dist/ui/FormControl/FileInputListe.d.ts.map +1 -0
  44. package/dist/ui/FormControl/FileInputListe.js +24 -0
  45. package/dist/ui/FormControl/fichierCorrespondAuType.d.ts +1 -0
  46. package/dist/ui/FormControl/fichierCorrespondAuType.d.ts.map +1 -1
  47. package/dist/ui/FormControl/fichierCorrespondAuType.js +5 -1
  48. package/dist/ui/FormControl/fichiersDuChamp.d.ts +43 -0
  49. package/dist/ui/FormControl/fichiersDuChamp.d.ts.map +1 -0
  50. package/dist/ui/FormControl/fichiersDuChamp.js +63 -0
  51. package/dist/ui/FormControl/useChoixDeFichier.d.ts +15 -0
  52. package/dist/ui/FormControl/useChoixDeFichier.d.ts.map +1 -0
  53. package/dist/ui/FormControl/useChoixDeFichier.js +87 -0
  54. package/dist/ui/FormControl/valideLeType.d.ts +1 -1
  55. package/dist/ui/FormControl/valideLeType.js +1 -1
  56. package/dist/ui/RadioGroup/RadioGroup.d.ts +3 -1
  57. package/dist/ui/RadioGroup/RadioGroup.d.ts.map +1 -1
  58. package/dist/ui/RadioGroup/RadioGroup.js +5 -1
  59. package/dist/ui/index.d.ts +1 -1
  60. package/dist/ui/index.d.ts.map +1 -1
  61. package/dist/ui/index.js +1 -1
  62. package/package.json +9 -7
  63. package/dist/ui/DragAndDropFile/DragAndDropFile.d.ts +0 -10
  64. package/dist/ui/DragAndDropFile/DragAndDropFile.d.ts.map +0 -1
  65. package/dist/ui/DragAndDropFile/DragAndDropFile.js +0 -13
  66. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.d.ts +0 -56
  67. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.d.ts.map +0 -1
  68. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.js +0 -17
  69. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.d.ts +0 -10
  70. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.d.ts.map +0 -1
  71. package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.js +0 -10
  72. package/dist/ui/DragAndDropFile/DragAndDropFile.styles.d.ts +0 -43
  73. package/dist/ui/DragAndDropFile/DragAndDropFile.styles.d.ts.map +0 -1
  74. package/dist/ui/DragAndDropFile/DragAndDropFile.styles.js +0 -43
  75. package/dist/ui/DragAndDropFile/DragAndDropFile.web.d.ts +0 -3
  76. package/dist/ui/DragAndDropFile/DragAndDropFile.web.d.ts.map +0 -1
  77. package/dist/ui/DragAndDropFile/DragAndDropFile.web.js +0 -18
  78. package/dist/ui/DragAndDropFile/fichiersDuDataTransfer.d.ts.map +0 -1
  79. package/dist/ui/DragAndDropFile/index.d.ts +0 -2
  80. package/dist/ui/DragAndDropFile/index.d.ts.map +0 -1
  81. package/dist/ui/DragAndDropFile/index.js +0 -1
  82. package/dist/ui/DragAndDropFile/useDepotFichier.d.ts +0 -21
  83. package/dist/ui/DragAndDropFile/useDepotFichier.d.ts.map +0 -1
  84. package/dist/ui/DragAndDropFile/useDepotFichier.js +0 -77
  85. /package/dist/ui/{DragAndDropFile → FileDropZone}/fichiersDuDataTransfer.d.ts +0 -0
  86. /package/dist/ui/{DragAndDropFile → FileDropZone}/fichiersDuDataTransfer.js +0 -0
@@ -1,6 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import { Box } from '../../core/Box';
4
3
  import { FileInput } from './FileInput';
5
4
  import { useStyles } from './FileInput.styles';
6
5
  import { FormControl } from './FormControl';
@@ -8,16 +7,59 @@ export default {
8
7
  title: 'FileInput',
9
8
  tags: ['ui'],
10
9
  experimental: false,
11
- description: 'Sélection de fichier avec validation MIME, nue : on la place dans un FormControl pour son libellé, son aide et sa validation.',
10
+ description: "Sélection de fichiers avec validation MIME et liste des fichiers choisis. Sur natif, propose galerie, appareil photo ou document. Nue : on la place dans un FormControl pour son libellé, son aide et sa validation. Pour déposer des fichiers sur tout un formulaire (web), l'envelopper dans une [FileDropZone](/components/FileDropZone).",
12
11
  component: FileInput,
13
12
  styleFn: useStyles,
14
13
  };
15
14
  export const Default = () => {
16
15
  const [file, setFile] = useState(null);
17
- return (_jsxs(Box, { display: "flex", flexDirection: "column", gap: 24, children: [_jsx(FormControl, { label: "Document", children: _jsx(FileInput, { value: file, onChange: setFile }) }), _jsx(FormControl, { label: "Image uniquement", children: _jsx(FileInput, { type: "image/*", value: file, onChange: setFile }) }), _jsx(FormControl, { label: "Avec erreur", error: "Ce champ est requis", children: _jsx(FileInput, { value: null, onChange: () => { } }) }), _jsx(FormControl, { label: "D\u00E9sactiv\u00E9", disabled: true, children: _jsx(FileInput, { value: null, onChange: () => { }, disabled: true }) })] }));
16
+ return (_jsx(FormControl, { label: "Document", children: _jsx(FileInput, { value: file, onChange: setFile }) }));
18
17
  };
19
18
  export const Multiple = () => {
20
19
  const [files, setFiles] = useState(null);
21
20
  return (_jsx(FormControl, { label: "Documents", children: _jsx(FileInput, { value: files, onChange: setFiles, multiple: true }) }));
22
21
  };
22
+ export const ImagesSeulement = () => {
23
+ const [files, setFiles] = useState(null);
24
+ return (_jsx(FormControl, { label: "Photos", hint: "Formats accept\u00E9s : JPG, PNG", children: _jsx(FileInput, { type: "image/*", value: files, onChange: setFiles, multiple: true }) }));
25
+ };
26
+ export const AvecFichiersEnregistres = () => {
27
+ const [files, setFiles] = useState([
28
+ {
29
+ id: '1',
30
+ persisted: true,
31
+ uri: 'https://picsum.photos/id/10/200',
32
+ name: 'photo-chantier.jpg',
33
+ mimeType: 'image/jpeg',
34
+ lastModified: 0,
35
+ },
36
+ {
37
+ id: '2',
38
+ persisted: true,
39
+ uri: 'https://example.com/devis.pdf',
40
+ name: 'devis.pdf',
41
+ mimeType: 'application/pdf',
42
+ lastModified: 0,
43
+ },
44
+ ]);
45
+ return (_jsx(FormControl, { label: "Pi\u00E8ces jointes", hint: "Un fichier enregistr\u00E9 retir\u00E9 reste dans la valeur, marqu\u00E9 removed.", children: _jsx(FileInput, { value: files, onChange: setFiles, multiple: true }) }));
46
+ };
47
+ export const LibellesPersonnalises = () => {
48
+ const [file, setFile] = useState(null);
49
+ return (_jsx(FormControl, { label: "Attachment", children: _jsx(FileInput, { value: file, onChange: setFile, labels: { addFile: 'Add a file', gallery: 'Gallery', camera: 'Camera', document: 'Document', cancel: 'Cancel' } }) }));
50
+ };
51
+ export const Desactive = () => (_jsx(FormControl, { label: "Document", disabled: true, children: _jsx(FileInput, { value: {
52
+ uri: 'https://example.com/contrat.pdf',
53
+ name: 'contrat.pdf',
54
+ mimeType: 'application/pdf',
55
+ lastModified: 0,
56
+ }, onChange: () => { }, disabled: true }) }));
57
+ export const NonRetirable = () => (_jsx(FormControl, { label: "Justificatif", children: _jsx(FileInput, { value: {
58
+ id: '3',
59
+ persisted: true,
60
+ uri: 'https://example.com/justificatif.pdf',
61
+ name: 'justificatif.pdf',
62
+ mimeType: 'application/pdf',
63
+ lastModified: 0,
64
+ }, onChange: () => { }, removable: false }) }));
23
65
  export * as Sources from './FileInput.stories.sources';
@@ -1,8 +1,18 @@
1
1
  export declare const Default: () => string;
2
2
  export declare const Multiple: () => string;
3
+ export declare const ImagesSeulement: () => string;
4
+ export declare const AvecFichiersEnregistres: () => string;
5
+ export declare const LibellesPersonnalises: () => string;
6
+ export declare const Desactive: () => string;
7
+ export declare const NonRetirable: () => string;
3
8
  export declare const storySources: {
4
9
  readonly Default: () => string;
5
10
  readonly Multiple: () => string;
11
+ readonly ImagesSeulement: () => string;
12
+ readonly AvecFichiersEnregistres: () => string;
13
+ readonly LibellesPersonnalises: () => string;
14
+ readonly Desactive: () => string;
15
+ readonly NonRetirable: () => string;
6
16
  };
7
17
  export type StorySourceName = keyof typeof storySources;
8
18
  //# sourceMappingURL=FileInput.stories.sources.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FileInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAuuB,CAAC;AAE5vB,eAAO,MAAM,QAAQ,cAAwP,CAAC;AAE9Q,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"FileInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FileInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAyO,CAAC;AAE9P,eAAO,MAAM,QAAQ,cAAwP,CAAC;AAE9Q,eAAO,MAAM,eAAe,cAAkT,CAAC;AAE/U,eAAO,MAAM,uBAAuB,cAAotB,CAAC;AAEzvB,eAAO,MAAM,qBAAqB,cAA4Y,CAAC;AAE/a,eAAO,MAAM,SAAS,cAA0V,CAAC;AAEjX,eAAO,MAAM,YAAY,cAAuZ,CAAC;AAEjb,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
@@ -1,8 +1,18 @@
1
1
  // This file is generated. Do not edit manually.
2
2
  // Source: src/ui/FormControl/FileInput.stories.tsx
3
- export const Default = () => "export const Default = () => {\n const [file, setFile] = useState<FileInputValue>(null);\n return (\n <Box display=\"flex\" flexDirection=\"column\" gap={24}>\n <FormControl label=\"Document\">\n <FileInput value={file} onChange={setFile} />\n </FormControl>\n <FormControl label=\"Image uniquement\">\n <FileInput type=\"image/*\" value={file} onChange={setFile} />\n </FormControl>\n <FormControl label=\"Avec erreur\" error=\"Ce champ est requis\">\n <FileInput value={null} onChange={() => {}} />\n </FormControl>\n <FormControl label=\"Désactivé\" disabled>\n <FileInput value={null} onChange={() => {}} disabled />\n </FormControl>\n </Box>\n );\n};";
3
+ export const Default = () => "export const Default = () => {\n const [file, setFile] = useState<FileInputValue>(null);\n return (\n <FormControl label=\"Document\">\n <FileInput value={file} onChange={setFile} />\n </FormControl>\n );\n};";
4
4
  export const Multiple = () => "export const Multiple = () => {\n const [files, setFiles] = useState<FileInputValue>(null);\n return (\n <FormControl label=\"Documents\">\n <FileInput value={files} onChange={setFiles} multiple />\n </FormControl>\n );\n};";
5
+ export const ImagesSeulement = () => "export const ImagesSeulement = () => {\n const [files, setFiles] = useState<FileInputValue>(null);\n return (\n <FormControl label=\"Photos\" hint=\"Formats acceptés : JPG, PNG\">\n <FileInput type=\"image/*\" value={files} onChange={setFiles} multiple />\n </FormControl>\n );\n};";
6
+ export const AvecFichiersEnregistres = () => "export const AvecFichiersEnregistres = () => {\n const [files, setFiles] = useState<FileInputValue>([\n {\n id: '1',\n persisted: true,\n uri: 'https://picsum.photos/id/10/200',\n name: 'photo-chantier.jpg',\n mimeType: 'image/jpeg',\n lastModified: 0,\n },\n {\n id: '2',\n persisted: true,\n uri: 'https://example.com/devis.pdf',\n name: 'devis.pdf',\n mimeType: 'application/pdf',\n lastModified: 0,\n },\n ]);\n return (\n <FormControl label=\"Pièces jointes\" hint=\"Un fichier enregistré retiré reste dans la valeur, marqué removed.\">\n <FileInput value={files} onChange={setFiles} multiple />\n </FormControl>\n );\n};";
7
+ export const LibellesPersonnalises = () => "export const LibellesPersonnalises = () => {\n const [file, setFile] = useState<FileInputValue>(null);\n return (\n <FormControl label=\"Attachment\">\n <FileInput\n value={file}\n onChange={setFile}\n labels={{ addFile: 'Add a file', gallery: 'Gallery', camera: 'Camera', document: 'Document', cancel: 'Cancel' }}\n />\n </FormControl>\n );\n};";
8
+ export const Desactive = () => "export const Desactive = () => (\n <FormControl label=\"Document\" disabled>\n <FileInput\n value={{\n uri: 'https://example.com/contrat.pdf',\n name: 'contrat.pdf',\n mimeType: 'application/pdf',\n lastModified: 0,\n }}\n onChange={() => {}}\n disabled\n />\n </FormControl>\n);";
9
+ export const NonRetirable = () => "export const NonRetirable = () => (\n <FormControl label=\"Justificatif\">\n <FileInput\n value={{\n id: '3',\n persisted: true,\n uri: 'https://example.com/justificatif.pdf',\n name: 'justificatif.pdf',\n mimeType: 'application/pdf',\n lastModified: 0,\n }}\n onChange={() => {}}\n removable={false}\n />\n </FormControl>\n);";
5
10
  export const storySources = {
6
11
  Default,
7
12
  Multiple,
13
+ ImagesSeulement,
14
+ AvecFichiersEnregistres,
15
+ LibellesPersonnalises,
16
+ Desactive,
17
+ NonRetirable,
8
18
  };
@@ -1,45 +1,8 @@
1
1
  export declare const useStyles: () => {
2
- fileInputContainer: {
2
+ container: {
3
3
  display: "flex";
4
- flexDirection: "row";
4
+ flexDirection: "column";
5
5
  gap: string | number;
6
- alignItems: "center";
7
- };
8
- fileInputButton: {
9
- borderWidth: number;
10
- borderColor: string;
11
- backgroundColor: string;
12
- transition: "background-color 0.1s ease-in-out";
13
- display: "flex";
14
- alignItems: "center";
15
- justifyContent: "center";
16
- paddingLeft: string | number;
17
- paddingRight: string | number;
18
- paddingTop: string | number;
19
- paddingBottom: string | number;
20
- };
21
- fileInputButtonHovered: {
22
- backgroundColor: string;
23
- };
24
- fileInputButtonDisabled: {
25
- cursor: "not-allowed";
26
- backgroundColor: string;
27
- };
28
- inputFileText: {
29
- color: string;
30
- fontSize: 12;
31
- lineHeight: 20;
32
- letterSpacing: 0;
33
- fontFamily: string;
34
- fontWeight?: import("react-native").TextStyle["fontWeight"];
35
- };
36
- placeholderText: {
37
- color: string;
38
- fontSize: 12;
39
- lineHeight: 20;
40
- letterSpacing: 0;
41
- fontFamily: string;
42
- fontWeight?: import("react-native").TextStyle["fontWeight"];
43
6
  };
44
7
  };
45
8
  //# sourceMappingURL=FileInput.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FileInput.styles.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCnB,CAAC"}
1
+ {"version":3,"file":"FileInput.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FileInput.styles.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;CAMnB,CAAC"}
@@ -1,37 +1,8 @@
1
1
  import { makeStyles } from '@alveole/theme';
2
- export const useStyles = makeStyles(({ text, color, spacing }) => ({
3
- fileInputContainer: {
2
+ export const useStyles = makeStyles(({ spacing }) => ({
3
+ container: {
4
4
  display: 'flex',
5
- flexDirection: 'row',
5
+ flexDirection: 'column',
6
6
  gap: spacing('1W'),
7
- alignItems: 'center',
8
- },
9
- fileInputButton: {
10
- borderWidth: 1,
11
- borderColor: color.border['default-grey'],
12
- backgroundColor: color.background['alt-grey'],
13
- transition: 'background-color 0.1s ease-in-out',
14
- display: 'flex',
15
- alignItems: 'center',
16
- justifyContent: 'center',
17
- paddingLeft: spacing('1W'),
18
- paddingRight: spacing('1W'),
19
- paddingTop: spacing('1,5V'),
20
- paddingBottom: spacing('1,5V'),
21
- },
22
- fileInputButtonHovered: {
23
- backgroundColor: color.background['contrast-grey'],
24
- },
25
- fileInputButtonDisabled: {
26
- cursor: 'not-allowed',
27
- backgroundColor: color.background['disabled-grey'],
28
- },
29
- inputFileText: {
30
- ...text['Corps de texte'].XS.Regular,
31
- color: color.text['default-grey'],
32
- },
33
- placeholderText: {
34
- ...text['Corps de texte'].XS.Regular,
35
- color: color.text['default-grey'],
36
7
  },
37
8
  }));
@@ -0,0 +1,11 @@
1
+ import { FileInputFile, FileInputLabels } from './fichiersDuChamp';
2
+ type FileInputListeProps = {
3
+ fichiers: FileInputFile[];
4
+ labels: FileInputLabels;
5
+ retirable: boolean;
6
+ onRetirer: (fichier: FileInputFile) => void;
7
+ };
8
+ /** Les fichiers montres par le champ : apercu ou icone, ouverture au clic, bouton de retrait. */
9
+ export declare const FileInputListe: ({ fichiers, labels, retirable, onRetirer }: FileInputListeProps) => import("react").JSX.Element | null;
10
+ export {};
11
+ //# sourceMappingURL=FileInputListe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileInputListe.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/FileInputListe.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAYnE,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,cAAc,GAAI,4CAA4C,mBAAmB,uCA6B7F,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Linking } from 'react-native';
3
+ import { Box } from '../../core/Box';
4
+ import { ButtonIcon } from '../Button';
5
+ import { ListItem } from '../ListItem';
6
+ const estUneImage = (fichier) => fichier.mimeType?.startsWith('image/') || /\.(jpe?g|png|gif|webp|bmp|svg)$/i.test(fichier.name ?? '');
7
+ const iconeDe = (fichier) => {
8
+ if (fichier.persisted)
9
+ return 'FileCheckCorner';
10
+ if (fichier.mimeType?.includes('pdf') || fichier.name?.endsWith('.pdf'))
11
+ return 'FileText';
12
+ if (estUneImage(fichier))
13
+ return 'FileImage';
14
+ return 'File';
15
+ };
16
+ /** Les fichiers montres par le champ : apercu ou icone, ouverture au clic, bouton de retrait. */
17
+ export const FileInputListe = ({ fichiers, labels, retirable, onRetirer }) => {
18
+ if (fichiers.length === 0)
19
+ return null;
20
+ return (_jsx(Box, { tag: "file-input-list", children: fichiers.map((fichier, index) => {
21
+ const nom = fichier.name ?? labels.unnamed;
22
+ return (_jsx(ListItem, { title: nom, preview_url: estUneImage(fichier) ? fichier.uri : undefined, IconProps: { name: iconeDe(fichier) }, showSeparateur: index !== 0, onPress: () => Linking.openURL(fichier.uri).catch(() => { }), trailing: () => (_jsx(ButtonIcon, { accessibilityLabel: `${labels.remove} ${nom}`, disabled: !retirable, variant: "tertiary", icon: "CircleX", onPress: () => onRetirer(fichier) })) }, fichier.id ?? fichier.uri));
23
+ }) }));
24
+ };
@@ -2,6 +2,7 @@
2
2
  * Vrai si le fichier (reconnu a son type MIME, avec repli sur l'extension du nom pour le CSV)
3
3
  * fait partie des types autorises. Sans type exige, tout fichier passe. Un seul type peut etre
4
4
  * fourni sous forme de chaine plutot que de tableau. Semantique stricte : `image/…`, pdf propre.
5
+ * Les types MIME du selecteur (`image/*`, `application/pdf`) sont aussi reconnus.
5
6
  */
6
7
  export declare const fichierCorrespondAuType: (mimeType: string, fileName: string | undefined, types: string | readonly string[] | undefined) => boolean;
7
8
  //# sourceMappingURL=fichierCorrespondAuType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fichierCorrespondAuType.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/fichierCorrespondAuType.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,UAAU,MAAM,GAAG,SAAS,EAC5B,OAAO,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,KAC5C,OAQF,CAAC"}
1
+ {"version":3,"file":"fichierCorrespondAuType.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/fichierCorrespondAuType.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,UAAU,MAAM,GAAG,SAAS,EAC5B,OAAO,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,KAC5C,OASF,CAAC"}
@@ -1,10 +1,13 @@
1
1
  const estUneImage = (mimeType) => mimeType.startsWith('image/');
2
2
  const estUnPdf = (mimeType) => mimeType === 'application/pdf' || mimeType.endsWith('/pdf');
3
+ // Un type MIME exact (`image/png`) ou generique (`image/*`, `*/*`), comme ceux du selecteur.
4
+ const correspondAuMime = (mimeType, type) => type === mimeType || type === '*/*' || (type.endsWith('/*') && mimeType.startsWith(type.slice(0, -1)));
3
5
  const estUnCsv = (mimeType, fileName) => mimeType === 'text/csv' || mimeType === 'application/csv' || (fileName?.endsWith('.csv') ?? false);
4
6
  /**
5
7
  * Vrai si le fichier (reconnu a son type MIME, avec repli sur l'extension du nom pour le CSV)
6
8
  * fait partie des types autorises. Sans type exige, tout fichier passe. Un seul type peut etre
7
9
  * fourni sous forme de chaine plutot que de tableau. Semantique stricte : `image/…`, pdf propre.
10
+ * Les types MIME du selecteur (`image/*`, `application/pdf`) sont aussi reconnus.
8
11
  */
9
12
  export const fichierCorrespondAuType = (mimeType, fileName, types) => {
10
13
  const liste = typeof types === 'string' ? [types] : types;
@@ -12,5 +15,6 @@ export const fichierCorrespondAuType = (mimeType, fileName, types) => {
12
15
  return true;
13
16
  return ((liste.includes('image') && estUneImage(mimeType)) ||
14
17
  (liste.includes('pdf') && estUnPdf(mimeType)) ||
15
- (liste.includes('csv') && estUnCsv(mimeType, fileName)));
18
+ (liste.includes('csv') && estUnCsv(mimeType, fileName)) ||
19
+ liste.some(type => correspondAuMime(mimeType, type)));
16
20
  };
@@ -0,0 +1,43 @@
1
+ import * as DocumentPicker from 'expo-document-picker';
2
+ /**
3
+ * Un fichier du champ. `persisted` signale un fichier enregistré (deja cote serveur, reconnu a
4
+ * son `id`) ; `removed` marque un fichier enregistre que l'utilisateur a retire.
5
+ */
6
+ export type FileInputFile = DocumentPicker.DocumentPickerAsset & {
7
+ id?: string;
8
+ persisted?: boolean;
9
+ removed?: boolean;
10
+ };
11
+ export type FileInputValue = FileInputFile | FileInputFile[] | null;
12
+ export type FileInputLabels = {
13
+ addFile: string;
14
+ selectFile: string;
15
+ gallery: string;
16
+ camera: string;
17
+ document: string;
18
+ cancel: string;
19
+ chooseImageTitle: string;
20
+ chooseDocumentTitle: string;
21
+ chooseImageMessage: string;
22
+ permissionRequired: string;
23
+ cameraPermissionMessage: string;
24
+ galleryPermissionMessage: string;
25
+ unnamed: string;
26
+ remove: string;
27
+ };
28
+ export declare const libellesParDefaut: FileInputLabels;
29
+ type TypesAcceptes = DocumentPicker.DocumentPickerOptions['type'];
30
+ export type Source = 'document' | 'gallery' | 'camera';
31
+ export declare const fichiersVisibles: (value: FileInputValue) => FileInputFile[];
32
+ export declare const ajoute: (value: FileInputValue, nouveaux: FileInputFile[], multiple: boolean) => FileInputValue;
33
+ export declare const retire: (value: FileInputValue, cible: FileInputFile) => FileInputValue;
34
+ export declare const imagesSeulement: (type: TypesAcceptes) => boolean;
35
+ /** Les sources que la feuille d'actions propose sur natif, dans l'ordre. Sur grand ecran, le document passe en tete. */
36
+ export declare const sourcesProposees: (type: TypesAcceptes, grandEcran: boolean) => Source[];
37
+ /** Sur grand ecran, l'option qui ouvre l'explorateur de fichiers s'annonce comme telle. */
38
+ export declare const libelleDeLaSource: (source: Source, labels: FileInputLabels, { type, grandEcran }: {
39
+ type: TypesAcceptes;
40
+ grandEcran: boolean;
41
+ }) => string;
42
+ export {};
43
+ //# sourceMappingURL=fichiersDuChamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fichiersDuChamp.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/fichiersDuChamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,mBAAmB,GAAG;IAC/D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAe/B,CAAC;AAEF,KAAK,aAAa,GAAG,cAAc,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAKvD,eAAO,MAAM,gBAAgB,GAAI,OAAO,cAAc,oBAAuD,CAAC;AAG9G,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,EAAE,UAAU,aAAa,EAAE,EAAE,UAAU,OAAO,KAAG,cAG5F,CAAC;AAOF,eAAO,MAAM,MAAM,GAAI,OAAO,cAAc,EAAE,OAAO,aAAa,KAAG,cAUpE,CAAC;AAMF,eAAO,MAAM,eAAe,GAAI,MAAM,aAAa,YAGlD,CAAC;AAOF,wHAAwH;AACxH,eAAO,MAAM,gBAAgB,GAAI,MAAM,aAAa,EAAE,YAAY,OAAO,KAAG,MAAM,EAIjF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,MAAM,EACd,QAAQ,eAAe,EACvB,sBAAsB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,WAKnE,CAAC"}
@@ -0,0 +1,63 @@
1
+ export const libellesParDefaut = {
2
+ addFile: 'Ajouter un fichier',
3
+ selectFile: 'Sélectionner un fichier',
4
+ gallery: 'Galerie',
5
+ camera: 'Appareil photo',
6
+ document: 'Document',
7
+ cancel: 'Annuler',
8
+ chooseImageTitle: 'Choisir une image',
9
+ chooseDocumentTitle: 'Choisir un fichier',
10
+ chooseImageMessage: 'Prendre une photo ou en choisir une dans la galerie.',
11
+ permissionRequired: 'Autorisation requise',
12
+ cameraPermissionMessage: "Autorisez l'accès à l'appareil photo dans les réglages pour prendre une photo.",
13
+ galleryPermissionMessage: "Autorisez l'accès à la galerie dans les réglages pour choisir une image.",
14
+ unnamed: 'Fichier sans nom',
15
+ remove: 'Retirer',
16
+ };
17
+ const listeDe = (value) => value == null ? [] : Array.isArray(value) ? value : [value];
18
+ export const fichiersVisibles = (value) => listeDe(value).filter(fichier => !fichier.removed);
19
+ // Le champ multiple accumule ; le champ simple ne recoit un fichier que s'il n'en montre aucun.
20
+ export const ajoute = (value, nouveaux, multiple) => {
21
+ if (!multiple)
22
+ return nouveaux[0] ?? value;
23
+ return [...listeDe(value), ...nouveaux];
24
+ };
25
+ const memeFichier = (a, b) => a.id != null && b.id != null ? a.id === b.id : a.uri === b.uri;
26
+ // Un fichier enregistre reste dans la valeur, marque `removed`, pour que l'appelant sache quoi
27
+ // supprimer cote serveur ; un fichier ajoute disparait simplement.
28
+ export const retire = (value, cible) => {
29
+ const retirer = (fichier) => {
30
+ if (!memeFichier(fichier, cible))
31
+ return [fichier];
32
+ return fichier.persisted ? [{ ...fichier, removed: true }] : [];
33
+ };
34
+ if (!Array.isArray(value))
35
+ return value == null ? null : (retirer(value)[0] ?? null);
36
+ const suivants = value.flatMap(retirer);
37
+ return suivants.length === 0 ? null : suivants;
38
+ };
39
+ const typesDe = (type) => (type == null ? [] : Array.isArray(type) ? type : [type]);
40
+ const estUnTypeImage = (t) => t === 'image' || t.startsWith('image/');
41
+ export const imagesSeulement = (type) => {
42
+ const types = typesDe(type);
43
+ return types.length > 0 && types.every(estUnTypeImage);
44
+ };
45
+ const accepteLesImages = (type) => {
46
+ const types = typesDe(type);
47
+ return types.length === 0 || types.some(t => t === '*/*' || estUnTypeImage(t));
48
+ };
49
+ /** Les sources que la feuille d'actions propose sur natif, dans l'ordre. Sur grand ecran, le document passe en tete. */
50
+ export const sourcesProposees = (type, grandEcran) => {
51
+ const images = accepteLesImages(type) ? ['gallery', 'camera'] : [];
52
+ if (imagesSeulement(type))
53
+ return images;
54
+ return grandEcran ? ['document', ...images] : [...images, 'document'];
55
+ };
56
+ /** Sur grand ecran, l'option qui ouvre l'explorateur de fichiers s'annonce comme telle. */
57
+ export const libelleDeLaSource = (source, labels, { type, grandEcran }) => {
58
+ if (source === 'document')
59
+ return grandEcran ? labels.selectFile : labels.document;
60
+ if (source === 'gallery')
61
+ return grandEcran && imagesSeulement(type) ? labels.selectFile : labels.gallery;
62
+ return labels.camera;
63
+ };
@@ -0,0 +1,15 @@
1
+ import type { FileInputProps } from './FileInput';
2
+ import { FileInputLabels } from './fichiersDuChamp';
3
+ type Options = Pick<FileInputProps, 'value' | 'onChange' | 'type' | 'disabled' | 'onPickStart'> & {
4
+ multiple: boolean;
5
+ cameraQuality: number;
6
+ labels: FileInputLabels;
7
+ };
8
+ /**
9
+ * Tout ce que le bouton du champ declenche : le selecteur de documents sur le web ; sur natif, une
10
+ * feuille d'actions galerie / appareil photo / document, avec les demandes d'autorisation. Les
11
+ * fichiers recus passent le controle de type, puis s'ajoutent a la valeur.
12
+ */
13
+ export declare const useChoixDeFichier: (options: Options) => () => Promise<void>;
14
+ export {};
15
+ //# sourceMappingURL=useChoixDeFichier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChoixDeFichier.d.ts","sourceRoot":"","sources":["../../../src/ui/FormControl/useChoixDeFichier.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAGL,eAAe,EAKhB,MAAM,mBAAmB,CAAC;AAmC3B,KAAK,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG;IAChG,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,wBAuDjD,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { useTheme } from '@alveole/theme';
2
+ import * as DocumentPicker from 'expo-document-picker';
3
+ import * as ImagePicker from 'expo-image-picker';
4
+ import React from 'react';
5
+ import { Platform } from 'react-native';
6
+ import { Alert } from '../../core/Alert';
7
+ import { ajoute, imagesSeulement, libelleDeLaSource, sourcesProposees, } from './fichiersDuChamp';
8
+ import { valideLeType } from './valideLeType';
9
+ const enFichier = (asset) => ({
10
+ uri: asset.uri,
11
+ name: asset.fileName ?? 'image.jpg',
12
+ size: asset.fileSize ?? 0,
13
+ mimeType: asset.mimeType ?? 'image/jpeg',
14
+ lastModified: Date.now(),
15
+ });
16
+ /** Demande l'autorisation, puis ouvre la galerie ou l'appareil photo. Rend les fichiers choisis, ou aucun. */
17
+ const prendreUneImage = async (source, { labels, cameraQuality, multiple }) => {
18
+ const camera = source === 'camera';
19
+ const demande = camera ? ImagePicker.requestCameraPermissionsAsync : ImagePicker.requestMediaLibraryPermissionsAsync;
20
+ const { status } = await demande();
21
+ if (status !== 'granted') {
22
+ const message = camera ? labels.cameraPermissionMessage : labels.galleryPermissionMessage;
23
+ Alert.alert({ title: labels.permissionRequired, message });
24
+ return [];
25
+ }
26
+ const result = camera
27
+ ? await ImagePicker.launchCameraAsync({ mediaTypes: ['images'], quality: cameraQuality })
28
+ : await ImagePicker.launchImageLibraryAsync({
29
+ mediaTypes: ['images'],
30
+ quality: 1,
31
+ allowsMultipleSelection: multiple,
32
+ });
33
+ return result.canceled ? [] : result.assets.map(enFichier);
34
+ };
35
+ /**
36
+ * Tout ce que le bouton du champ declenche : le selecteur de documents sur le web ; sur natif, une
37
+ * feuille d'actions galerie / appareil photo / document, avec les demandes d'autorisation. Les
38
+ * fichiers recus passent le controle de type, puis s'ajoutent a la valeur.
39
+ */
40
+ export const useChoixDeFichier = (options) => {
41
+ const { value, onChange, type, disabled, onPickStart, multiple, cameraQuality, labels } = options;
42
+ const { isVariant } = useTheme();
43
+ const grandEcran = isVariant('desktop');
44
+ const isPickingRef = React.useRef(false);
45
+ const recevoir = React.useCallback((nouveaux) => {
46
+ if (nouveaux.length === 0)
47
+ return;
48
+ const transmettre = () => onChange(ajoute(value, nouveaux, multiple));
49
+ valideLeType({ type, onChange: transmettre })(multiple ? nouveaux : nouveaux[0]);
50
+ }, [onChange, value, multiple, type]);
51
+ const choisirUnDocument = React.useCallback(async () => {
52
+ const result = await DocumentPicker.getDocumentAsync({ copyToCacheDirectory: true, multiple, type });
53
+ recevoir(result.assets ?? []);
54
+ }, [multiple, type, recevoir]);
55
+ const choisirUneImage = React.useCallback(async (source) => recevoir(await prendreUneImage(source, { labels, cameraQuality, multiple })), [labels, cameraQuality, multiple, recevoir]);
56
+ const ouvrirLaFeuille = React.useCallback(() => {
57
+ const lancer = (source) => (source === 'document' ? choisirUnDocument() : choisirUneImage(source));
58
+ const images = imagesSeulement(type);
59
+ Alert.alert({
60
+ title: images ? labels.chooseImageTitle : labels.chooseDocumentTitle,
61
+ message: images ? labels.chooseImageMessage : undefined,
62
+ buttons: [
63
+ ...sourcesProposees(type, grandEcran).map(source => ({
64
+ text: libelleDeLaSource(source, labels, { type, grandEcran }),
65
+ onPress: () => lancer(source),
66
+ })),
67
+ { text: labels.cancel, style: 'cancel' },
68
+ ],
69
+ });
70
+ }, [type, labels, grandEcran, choisirUnDocument, choisirUneImage]);
71
+ return React.useCallback(async () => {
72
+ if (isPickingRef.current)
73
+ return;
74
+ onPickStart?.();
75
+ if (disabled)
76
+ return;
77
+ if (Platform.OS !== 'web')
78
+ return ouvrirLaFeuille();
79
+ isPickingRef.current = true;
80
+ try {
81
+ await choisirUnDocument();
82
+ }
83
+ finally {
84
+ isPickingRef.current = false;
85
+ }
86
+ }, [onPickStart, disabled, ouvrirLaFeuille, choisirUnDocument]);
87
+ };
@@ -4,7 +4,7 @@ import type { FileInputProps } from './FileInput';
4
4
  * et prevenir l'utilisateur sinon. Un fichier dont le type MIME est inconnu passe : c'est au
5
5
  * selecteur, qui filtre deja, d'avoir eu le dernier mot.
6
6
  *
7
- * Les trois champs de fichier (l'ancien FileField, DragAndDropFile natif et web) faisaient ce filtrage
7
+ * Les trois champs de fichier (l'ancien FileField, l'ancien DragAndDropFile natif et web) faisaient ce filtrage
8
8
  * chacun dans son coin, et avaient deja diverge : FileField reconnaissait les types avec ses
9
9
  * propres comparaisons de chaines, plus laches que celles des deux autres, et ne verifiait que
10
10
  * le premier fichier d'une selection multiple. Un meme fichier pouvait donc etre accepte ici et
@@ -11,7 +11,7 @@ const refuser = (plusieurs) => Alert.alert({
11
11
  * et prevenir l'utilisateur sinon. Un fichier dont le type MIME est inconnu passe : c'est au
12
12
  * selecteur, qui filtre deja, d'avoir eu le dernier mot.
13
13
  *
14
- * Les trois champs de fichier (l'ancien FileField, DragAndDropFile natif et web) faisaient ce filtrage
14
+ * Les trois champs de fichier (l'ancien FileField, l'ancien DragAndDropFile natif et web) faisaient ce filtrage
15
15
  * chacun dans son coin, et avaient deja diverge : FileField reconnaissait les types avec ses
16
16
  * propres comparaisons de chaines, plus laches que celles des deux autres, et ne verifiait que
17
17
  * le premier fichier d'une selection multiple. Un meme fichier pouvait donc etre accepte ici et
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { TamaguiElement, RadioGroupProps as TamaguiRadioGroupProps } from 'tamagui';
3
- import { FormControlCaptionProps, FormControlHintProps, FormControlLabelProps } from '../FormControl';
3
+ import { FormControlCaptionProps } from '../FormControl/FormControlCaption';
4
+ import { FormControlHintProps } from '../FormControl/FormControlHint';
5
+ import { FormControlLabelProps } from '../FormControl/FormControlLabel';
4
6
  export type RadioGroupElement = TamaguiElement;
5
7
  export type RadioGroupProps = Omit<TamaguiRadioGroupProps, 'value' | 'onValueChange' | 'direction'> & FormControlCaptionProps & FormControlLabelProps & FormControlHintProps & {
6
8
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAmC,eAAe,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAErH,OAAO,EAEL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC,GACjG,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEJ,eAAO,MAAM,UAAU;YANX,MAAM;YACN,sBAAsB,CAAC,OAAO,CAAC;eAC5B,sBAAsB,CAAC,eAAe,CAAC;cACxC,SAAS,GAAG,MAAM;wCAiD9B,CAAC"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/ui/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAmC,eAAe,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIrH,OAAO,EAAsB,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAmB,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAoB,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAI1F,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,GAAG,eAAe,GAAG,WAAW,CAAC,GACjG,uBAAuB,GACvB,qBAAqB,GACrB,oBAAoB,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CAC9B,CAAC;AAEJ,eAAO,MAAM,UAAU;YANX,MAAM;YACN,sBAAsB,CAAC,OAAO,CAAC;eAC5B,sBAAsB,CAAC,eAAe,CAAC;cACxC,SAAS,GAAG,MAAM;wCAiD9B,CAAC"}
@@ -2,7 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { RadioGroup as TamaguiRadioGroup } from 'tamagui';
4
4
  import { Box } from '../../core/Box';
5
- import { FormControlCaption, FormControlHint, FormControlLabel, } from '../FormControl';
5
+ // Imports directs, pas par l'index : FormControl contient FileInput, qui rend des ListItem, qui
6
+ // rendent des RadioGroup. Passer par l'index refermerait le cycle.
7
+ import { FormControlCaption } from '../FormControl/FormControlCaption';
8
+ import { FormControlHint } from '../FormControl/FormControlHint';
9
+ import { FormControlLabel } from '../FormControl/FormControlLabel';
6
10
  import { useStyles } from './RadioGroup.styles';
7
11
  import { RadioGroupContext } from './RadioGroupContext';
8
12
  export const RadioGroup = React.forwardRef(function RadioGroup(props, ref) {
@@ -12,9 +12,9 @@ export * from './DataTable';
12
12
  export * from './DateInput';
13
13
  export * from './Divider';
14
14
  export * from './DocumentViewer';
15
- export * from './DragAndDropFile';
16
15
  export * from './DurationInput';
17
16
  export * from './EmptyState';
17
+ export * from './FileDropZone';
18
18
  export * from './FilterDate';
19
19
  export * from './FormControl';
20
20
  export * from './Header';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
package/dist/ui/index.js CHANGED
@@ -12,9 +12,9 @@ export * from './DataTable';
12
12
  export * from './DateInput';
13
13
  export * from './Divider';
14
14
  export * from './DocumentViewer';
15
- export * from './DragAndDropFile';
16
15
  export * from './DurationInput';
17
16
  export * from './EmptyState';
17
+ export * from './FileDropZone';
18
18
  export * from './FilterDate';
19
19
  export * from './FormControl';
20
20
  export * from './Header';