fina-react-ds 1.0.43 → 1.0.44
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/ckeditor5.css +10589 -0
- package/dist/components/file-uploader.js +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
var F=Object.defineProperty;var
|
|
1
|
+
var F=Object.defineProperty;var n=(i,c)=>F(i,"name",{value:c,configurable:!0});import{jsxs as r,jsx as e,Fragment as f}from"react/jsx-runtime";import{useState as D,useImperativeHandle as C,useCallback as p}from"react";import{FileIcon as x,DownloadIcon as I,UploadIcon as S}from"lucide-react";import{useDropzone as w}from"react-dropzone";import{cn as o}from"../lib/utils.js";import{Button as b}from"./button.js";function O({onChange:i,"aria-invalid":c,fileTypes:h,ref:v}){const[d,a]=D([]);C(v,()=>({focus:n(()=>{t?.current&&t.current.focus()},"focus")}));const g=p(l=>{a(l),i?.(l.length>0?l[0]:null)},[i]),y=n(()=>{t?.current&&t.current.focus()},"handleFileDialogCancel"),{getRootProps:N,getInputProps:z,acceptedFiles:u,open:j,rootRef:t}=w({maxFiles:1,noClick:!0,onDrop:g,onFileDialogCancel:y}),k=p(l=>{let s=0,m="ko";return s=l.size/1e3,s>1e3&&(s/=1e3,m="mo"),s.toFixed(2)+" "+m},[]);return r("div",{className:"flex space-x-2 items-center h-50",children:[r("div",{className:"flex-1 flex-col h-full shrink-0 bg-accent rounded-md flex items-center justify-center",children:[e("div",{className:o("bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"),children:e(x,{className:"size-4"})}),e("div",{className:"mb-4 text-center",children:"Mon super fichier"}),e(b,{type:"button",color:"info",size:"icon",variant:"ghost",onClick:n(()=>{a([]),i?.(null),t?.current?.focus()},"onClick"),children:e(I,{})})]}),r("div",{...N(),className:o("bg-input border border-input-border flex flex-col h-50 flex-2 rounded-md px-3 py-1 text-base shadow-xs items-center justify-center md:text-sm outline-none","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"),"aria-invalid":c,children:[d.length>0&&r(f,{children:[e("div",{className:o("bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"),children:e(x,{className:"size-4"})}),r("div",{className:"mb-4 text-center",children:[u[0].name,e("br",{}),k(u[0])]}),e(b,{type:"button",color:"destructive",variant:"ghost",onClick:n(()=>{a([]),i?.(null),t?.current?.focus()},"onClick"),children:"Supprimer"})]}),d.length===0&&r(f,{children:[e("div",{className:o("bg-primary text-primary-foreground flex items-center justify-center rounded-full size-10 mb-4"),children:e(S,{className:"size-4"})}),r("div",{className:"mb-4",children:["Glisser-déposer ou"," ",e("span",{className:"font-bold underline cursor-pointer",onClick:j,children:"Choisir un fichier"})," ","à uploader"]}),r("div",{className:"text-center text-sm md:text-xs",children:["Formats acceptés : ",Object.keys(h).join(", "),e("br",{}),"Taille max : 5Mo"]})]}),e("input",{...z()})]})]})}n(O,"FileUploader");export{O as FileUploader};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "https://github.com/F1na/fina-react-ds"
|
|
6
6
|
},
|
|
7
7
|
"private": false,
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.44",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
@@ -110,11 +110,12 @@
|
|
|
110
110
|
},
|
|
111
111
|
"scripts": {
|
|
112
112
|
"dev": "vite",
|
|
113
|
-
"build": "rimraf dist && pnpm build:types && pnpm build:components && pnpm build:clean",
|
|
113
|
+
"build": "rimraf dist && pnpm build:types && pnpm build:components && pnpm build:ckeditor && pnpm build:clean",
|
|
114
114
|
"build:types": "tsc -p tsconfig.build.json && tsc-alias",
|
|
115
115
|
"build:themes": "pnpm dlx @tailwindcss/cli -i ./src/themes/base.css -o ./dist/themes/base.css",
|
|
116
116
|
"build:components": "vite build",
|
|
117
117
|
"build:clean": "rimraf dist/vite.config.d.ts dist/vite.config.d.ts.map",
|
|
118
|
+
"build:ckeditor": "cp ./node_modules/ckeditor5/dist/ckeditor5.css ./dist/ckeditor5.css",
|
|
118
119
|
"lint": "eslint .",
|
|
119
120
|
"preview": "vite preview"
|
|
120
121
|
}
|