@cgi-learning-hub/ui 1.3.3-dev.1732627187 → 1.3.3-dev.1732631258

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 (31) hide show
  1. package/dist/components/Dropzone/Dropzone.cjs.js +5 -1
  2. package/dist/components/Dropzone/Dropzone.es.js +2162 -24
  3. package/dist/components/FileList/FileListItem.cjs.js +1 -1
  4. package/dist/components/FileList/FileListItem.es.js +21 -20
  5. package/dist/components/PasswordInput/PasswordInput.cjs.js +1 -1
  6. package/dist/components/PasswordInput/PasswordInput.es.js +2 -3
  7. package/dist/components/index.cjs.js +1 -1
  8. package/dist/components/index.d.ts +0 -1
  9. package/dist/components/index.es.js +171 -173
  10. package/dist/components/stories/Dialog.stories.cjs.js +1 -1
  11. package/dist/components/stories/Dialog.stories.es.js +37 -17
  12. package/dist/components/stories/IconButton.stories.cjs.js +1 -1
  13. package/dist/components/stories/IconButton.stories.es.js +47 -11
  14. package/dist/components/stories/TabList.stories.cjs.js +1 -1
  15. package/dist/components/stories/TabList.stories.es.js +139 -89
  16. package/dist/index.cjs.js +1 -1
  17. package/dist/index.es.js +171 -173
  18. package/package.json +1 -1
  19. package/dist/Delete-Bb_PhA6v.cjs +0 -1
  20. package/dist/Delete-Dip-1l7n.js +0 -8
  21. package/dist/components/ImagePicker/ImagePicker.cjs.js +0 -1
  22. package/dist/components/ImagePicker/ImagePicker.d.ts +0 -12
  23. package/dist/components/ImagePicker/ImagePicker.es.js +0 -176
  24. package/dist/components/ImagePicker/index.cjs.js +0 -1
  25. package/dist/components/ImagePicker/index.d.ts +0 -2
  26. package/dist/components/ImagePicker/index.es.js +0 -4
  27. package/dist/components/stories/ImagePicker.stories.cjs.js +0 -1
  28. package/dist/components/stories/ImagePicker.stories.d.ts +0 -6
  29. package/dist/components/stories/ImagePicker.stories.es.js +0 -50
  30. package/dist/index-BtGBke8y.js +0 -2141
  31. package/dist/index-CEgiY5tJ.cjs +0 -5
@@ -1,176 +0,0 @@
1
- import { jsx as e, jsxs as t, Fragment as c } from "react/jsx-runtime";
2
- import { c as h } from "../../createSvgIcon-BS0Qe85N.js";
3
- import { D as S } from "../../Delete-Dip-1l7n.js";
4
- import { Box as r } from "@mui/material";
5
- import { useState as w } from "react";
6
- import { u as D } from "../../index-BtGBke8y.js";
7
- import { S as F } from "../../Stack-DbWQHN5i.js";
8
- import { T as l } from "../../Typography-CizHc1nM.js";
9
- const p = h(/* @__PURE__ */ e("path", {
10
- d: "M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"
11
- }), "AddPhotoAlternate"), A = h(/* @__PURE__ */ e("path", {
12
- d: "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"
13
- }), "Create"), j = () => /* @__PURE__ */ t(l, { textAlign: "center", children: [
14
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "Glissez-déposez" }),
15
- " ou ",
16
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "cliquez" }),
17
- " pour choisir une image"
18
- ] }), P = () => /* @__PURE__ */ t(l, { textAlign: "center", children: [
19
- /* @__PURE__ */ e(r, { component: "span", fontWeight: "bold", children: "Glissez" }),
20
- " une image"
21
- ] }), U = ({
22
- defaultLabel: g = /* @__PURE__ */ e(j, {}),
23
- dragLabel: u = /* @__PURE__ */ e(P, {}),
24
- information: i,
25
- onFileChange: a = (n) => {
26
- },
27
- width: x = "100%",
28
- height: f = "400px",
29
- ...b
30
- }) => {
31
- const [n, s] = w(null), y = (o) => {
32
- const m = o[0] || null;
33
- s(m), a(m);
34
- }, k = (o) => {
35
- o.stopPropagation(), s(null), a(null);
36
- }, z = (o) => {
37
- o.stopPropagation(), d();
38
- }, { open: d, getRootProps: C, getInputProps: I, isDragActive: v } = D({
39
- ...b,
40
- maxFiles: 1,
41
- onDropAccepted: y,
42
- accept: {
43
- "image/*": [".png", ".jpeg", ".jpg", ".gif"]
44
- },
45
- noClick: !0
46
- });
47
- return /* @__PURE__ */ t(
48
- F,
49
- {
50
- direction: "column",
51
- justifyContent: "center",
52
- alignItems: "center",
53
- spacing: 1,
54
- width: x,
55
- minWidth: "200px",
56
- minHeight: "200px",
57
- height: f,
58
- padding: 1,
59
- border: "1px dashed",
60
- borderColor: "grey.main",
61
- borderRadius: 1,
62
- sx: {
63
- cursor: "pointer",
64
- position: "relative",
65
- background: `${!n && "linear-gradient(180deg, #F5F7F9 0%, #FFF 100%)"}`
66
- },
67
- ...C({
68
- onClick: d
69
- }),
70
- children: [
71
- /* @__PURE__ */ e("input", { ...I() }),
72
- n ? /* @__PURE__ */ t(c, { children: [
73
- /* @__PURE__ */ t(
74
- r,
75
- {
76
- sx: {
77
- position: "absolute",
78
- top: "0.5rem",
79
- right: "0.5rem",
80
- display: "flex",
81
- gap: "0.5rem"
82
- },
83
- children: [
84
- /* @__PURE__ */ e(
85
- r,
86
- {
87
- onClick: z,
88
- sx: {
89
- backgroundColor: "common.white",
90
- display: "flex",
91
- borderRadius: "3px",
92
- alignItems: "center",
93
- justifyContent: "center",
94
- boxShadow: 1,
95
- width: "2rem",
96
- height: "2rem",
97
- cursor: "pointer",
98
- "&:hover": {
99
- backgroundColor: "common.black",
100
- "& .MuiSvgIcon-root": {
101
- fill: (o) => o.palette.common.white
102
- }
103
- }
104
- },
105
- children: /* @__PURE__ */ e(A, { fontSize: "small" })
106
- }
107
- ),
108
- /* @__PURE__ */ e(
109
- r,
110
- {
111
- onClick: k,
112
- sx: {
113
- backgroundColor: "common.white",
114
- display: "flex",
115
- borderRadius: "3px",
116
- alignItems: "center",
117
- boxShadow: 1,
118
- justifyContent: "center",
119
- width: "2rem",
120
- height: "2rem",
121
- cursor: "pointer",
122
- "&:hover": {
123
- backgroundColor: "common.black",
124
- "& .MuiSvgIcon-root": {
125
- fill: (o) => o.palette.common.white
126
- }
127
- }
128
- },
129
- children: /* @__PURE__ */ e(S, { fontSize: "small" })
130
- }
131
- )
132
- ]
133
- }
134
- ),
135
- /* @__PURE__ */ e(
136
- "img",
137
- {
138
- src: URL.createObjectURL(n),
139
- alt: n.name,
140
- style: {
141
- width: "auto",
142
- height: "100%",
143
- maxWidth: "100%",
144
- objectFit: "cover",
145
- borderRadius: "8px"
146
- }
147
- }
148
- )
149
- ] }) : /* @__PURE__ */ e(c, { children: v ? /* @__PURE__ */ t(c, { children: [
150
- /* @__PURE__ */ e(p, { color: "primary", style: {
151
- width: "4rem",
152
- height: "4rem"
153
- } }),
154
- u,
155
- i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "0.875rem", color: "grey", children: i })
156
- ] }) : /* @__PURE__ */ t(r, { sx: {
157
- display: "flex",
158
- flexDirection: "column",
159
- alignItems: "center",
160
- padding: "0.5rem",
161
- gap: "0.5rem"
162
- }, children: [
163
- /* @__PURE__ */ e(p, { color: "primary", style: {
164
- width: "4rem",
165
- height: "4rem"
166
- } }),
167
- g,
168
- i && /* @__PURE__ */ e(l, { textAlign: "center", fontSize: "0.875rem", color: "grey", children: i })
169
- ] }) })
170
- ]
171
- }
172
- );
173
- };
174
- export {
175
- U as default
176
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ImagePicker.cjs.js");exports.ImagePicker=e;
@@ -1,2 +0,0 @@
1
- export * from './ImagePicker';
2
- export { default as ImagePicker } from './ImagePicker';
@@ -1,4 +0,0 @@
1
- import { default as r } from "./ImagePicker.es.js";
2
- export {
3
- r as ImagePicker
4
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../ImagePicker/ImagePicker.cjs.js"),a={title:"Components/ImagePicker",component:t,argTypes:{defaultLabel:{description:"Le contenu affiché comme label par défaut (ReactNode).",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultLabel />"}}},dragLabel:{description:"Texte affiché lorsque l'utilisateur fait glisser un fichier.",control:"text",table:{type:{summary:"ReactNode"},defaultValue:{summary:"<ImagePickerDefaultDragLabel />"}}},information:{description:"Informations supplémentaires affichées sous le label par défaut.",control:"text",table:{type:{summary:"string"}}},onFileChange:{description:"Callback déclenché lorsque l'utilisateur sélectionne ou supprime un fichier.",action:"file-changed",table:{type:{summary:"(file: File | null) => void"}}}}},l={args:{information:"SVG, PNG, JPG, GIF",onFileChange:e=>{console.log(e?"Image uplaodé":"Image supprimé")},width:"400px",height:"400px"}};exports.Default=l;exports.default=a;
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { ImagePicker } from '../ImagePicker';
3
- declare const meta: Meta<typeof ImagePicker>;
4
- export default meta;
5
- type Story = StoryObj<typeof ImagePicker>;
6
- export declare const Default: Story;
@@ -1,50 +0,0 @@
1
- import a from "../ImagePicker/ImagePicker.es.js";
2
- const l = {
3
- title: "Components/ImagePicker",
4
- component: a,
5
- argTypes: {
6
- defaultLabel: {
7
- description: "Le contenu affiché comme label par défaut (ReactNode).",
8
- control: "text",
9
- table: {
10
- type: { summary: "ReactNode" },
11
- defaultValue: { summary: "<ImagePickerDefaultLabel />" }
12
- }
13
- },
14
- dragLabel: {
15
- description: "Texte affiché lorsque l'utilisateur fait glisser un fichier.",
16
- control: "text",
17
- table: {
18
- type: { summary: "ReactNode" },
19
- defaultValue: { summary: "<ImagePickerDefaultDragLabel />" }
20
- }
21
- },
22
- information: {
23
- description: "Informations supplémentaires affichées sous le label par défaut.",
24
- control: "text",
25
- table: {
26
- type: { summary: "string" }
27
- }
28
- },
29
- onFileChange: {
30
- description: "Callback déclenché lorsque l'utilisateur sélectionne ou supprime un fichier.",
31
- action: "file-changed",
32
- table: {
33
- type: { summary: "(file: File | null) => void" }
34
- }
35
- }
36
- }
37
- }, i = {
38
- args: {
39
- information: "SVG, PNG, JPG, GIF",
40
- onFileChange: (e) => {
41
- console.log(e ? "Image uplaodé" : "Image supprimé");
42
- },
43
- width: "400px",
44
- height: "400px"
45
- }
46
- };
47
- export {
48
- i as Default,
49
- l as default
50
- };