@mci-ui/mci-ui 0.0.83 → 0.0.85

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 (49) hide show
  1. package/dist/assets/icons/check.svg.js +5 -0
  2. package/dist/assets/icons/close.svg.js +5 -0
  3. package/dist/assets/icons/loaderIcon.svg.js +5 -0
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +53 -0
  6. package/dist/shared/lib/hooks/useTableColumnSettings.js +132 -0
  7. package/dist/shared/lib/locales.js +101 -0
  8. package/dist/shared/lib/uploadLanguage.js +80 -0
  9. package/dist/shared/lib/utils.js +20 -0
  10. package/dist/shared/ui/MciModal/MciModal.js +97 -0
  11. package/dist/shared/ui/mciAccordion/MciAccordion.js +74 -0
  12. package/dist/shared/ui/mciBreadcrumb/MciBreadcrumb.js +39 -0
  13. package/dist/shared/ui/mciButton/MciButton.js +63 -0
  14. package/dist/shared/ui/mciCheck/MciCheck.js +170 -0
  15. package/dist/shared/ui/mciCollapse/MciCollapse.js +60 -0
  16. package/dist/shared/ui/mciDrawer/MciDrawer.js +108 -0
  17. package/dist/shared/ui/mciIdentityInput/MciIdentityInput.js +30 -0
  18. package/dist/shared/ui/mciIdentityInput/mci-identity-input.utils.js +32 -0
  19. package/dist/shared/ui/mciInput/MciInput.js +225 -0
  20. package/dist/shared/ui/mciInput/mci-input.utils.js +49 -0
  21. package/dist/shared/ui/mciLoader/MciLoader.js +38 -0
  22. package/dist/shared/ui/mciPagination/MciPagination.js +135 -0
  23. package/dist/shared/ui/mciPagination/mci-pagination.utils.js +12 -0
  24. package/dist/shared/ui/mciPhone/MciPhone.js +83 -0
  25. package/dist/shared/ui/mciPhone/mci-phone.utils.js +47 -0
  26. package/dist/shared/ui/mciPicker/MciPicker.js +256 -0
  27. package/dist/shared/ui/mciPicker/mci-picker.utils.js +62 -0
  28. package/dist/shared/ui/mciSelect/MciSelect.js +226 -0
  29. package/dist/shared/ui/mciSelect/mci-select.utils.js +52 -0
  30. package/dist/shared/ui/mciSkeleton/MciSkeleton.js +29 -0
  31. package/dist/shared/ui/mciTable/MciTable.js +153 -0
  32. package/dist/shared/ui/mciTable/MciTableClamp2.js +7 -0
  33. package/dist/shared/ui/mciTable/MciTableColumnsPanel.js +184 -0
  34. package/dist/shared/ui/mciTable/mci-table.utils.js +14 -0
  35. package/dist/shared/ui/mciTabs/MciTabs.js +131 -0
  36. package/dist/shared/ui/mciTag/MciTag.js +46 -0
  37. package/dist/shared/ui/mciTextarea/MciTextarea.js +56 -0
  38. package/dist/shared/ui/mciToast/MciToast.js +106 -0
  39. package/dist/shared/ui/mciToast/mci-toast.utils.js +47 -0
  40. package/dist/shared/ui/mciToggle/MciToggle.js +77 -0
  41. package/dist/shared/ui/mciTooltip/MciTooltip.js +52 -0
  42. package/dist/shared/ui/mciUpload/MciUpload.js +337 -0
  43. package/dist/shared/ui/mciUpload/mci-upload.utils.js +186 -0
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist/types/shared/types/ui/accordion.types.d.ts +7 -0
  46. package/dist/types/shared/ui/mciAccordion/MciAccordion.d.ts +22 -0
  47. package/package.json +15 -12
  48. package/dist/index.es.js +0 -3319
  49. package/dist/index.umd.js +0 -2
@@ -0,0 +1,186 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { FileText as c, File as m, MusicNote as f, VideoFramePlayHorizontal as u, Gallery as x } from "@solar-icons/react";
3
+ const l = [
4
+ "pdf",
5
+ "doc",
6
+ "docx",
7
+ "xls",
8
+ "xlsx",
9
+ "ppt",
10
+ "pptx",
11
+ "txt",
12
+ "jpg",
13
+ "jpeg",
14
+ "png",
15
+ "bmp",
16
+ "tiff"
17
+ ], h = [
18
+ "zip",
19
+ "rar",
20
+ "7z",
21
+ "tar",
22
+ "gz",
23
+ "bz2",
24
+ "xz",
25
+ "tgz",
26
+ "tbz2",
27
+ "txz",
28
+ "iso",
29
+ "cab",
30
+ "arj",
31
+ "lz",
32
+ "lzh",
33
+ "z",
34
+ "exe",
35
+ "bat",
36
+ "cmd",
37
+ "com",
38
+ "msi",
39
+ "scr",
40
+ "pif",
41
+ "js",
42
+ "mjs",
43
+ "cjs",
44
+ "jse",
45
+ "vbs",
46
+ "vbe",
47
+ "wsf",
48
+ "wsh",
49
+ "ps1",
50
+ "psm1",
51
+ "sh",
52
+ "bash",
53
+ "zsh",
54
+ "ksh",
55
+ "csh",
56
+ "fish"
57
+ ], r = new Set(l), p = new Set(h), g = l.map((e) => `.${e}`).join(","), w = {
58
+ "image/*": ["jpg", "jpeg", "png", "bmp", "tiff"],
59
+ "text/*": ["txt"]
60
+ }, E = {
61
+ "application/pdf": ["pdf"],
62
+ "application/msword": ["doc"],
63
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ["docx"],
64
+ "application/vnd.ms-excel": ["xls"],
65
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ["xlsx"],
66
+ "application/vnd.ms-powerpoint": ["ppt"],
67
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": ["pptx"],
68
+ "text/plain": ["txt"],
69
+ "image/jpg": ["jpg"],
70
+ "image/jpeg": ["jpg", "jpeg"],
71
+ "image/png": ["png"],
72
+ "image/bmp": ["bmp"],
73
+ "image/tiff": ["tiff"]
74
+ }, S = /* @__PURE__ */ new Set([
75
+ "application/zip",
76
+ "application/x-zip-compressed",
77
+ "application/x-rar-compressed",
78
+ "application/vnd.rar",
79
+ "application/x-7z-compressed",
80
+ "application/x-msdownload",
81
+ "application/x-msdos-program",
82
+ "application/x-executable",
83
+ "application/x-bat",
84
+ "application/x-msi",
85
+ "application/javascript",
86
+ "text/javascript",
87
+ "application/x-javascript",
88
+ "application/x-sh",
89
+ "application/x-csh",
90
+ "text/x-shellscript",
91
+ "application/x-powershell"
92
+ ]);
93
+ function z(e) {
94
+ const t = e.trim().toLowerCase(), n = t.lastIndexOf(".");
95
+ return n <= 0 || n === t.length - 1 ? "" : t.slice(n + 1);
96
+ }
97
+ function j(e) {
98
+ return e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
99
+ }
100
+ function d(e) {
101
+ if (!e || e === "*/*") return null;
102
+ const t = j(e), n = /* @__PURE__ */ new Set();
103
+ for (const i of t)
104
+ if (i !== "*/*") {
105
+ if (i.endsWith("/*")) {
106
+ const s = w[i];
107
+ if (!s) continue;
108
+ for (const o of s)
109
+ r.has(o) && !p.has(o) && n.add(o);
110
+ continue;
111
+ }
112
+ if (i.startsWith(".")) {
113
+ const s = i.slice(1);
114
+ r.has(s) && !p.has(s) && n.add(s);
115
+ continue;
116
+ }
117
+ if (i.includes("/")) {
118
+ const s = E[i];
119
+ if (!s) continue;
120
+ for (const o of s)
121
+ r.has(o) && !p.has(o) && n.add(o);
122
+ continue;
123
+ }
124
+ r.has(i) && !p.has(i) && n.add(i);
125
+ }
126
+ return n.size > 0 ? n : null;
127
+ }
128
+ function T(e) {
129
+ const t = d(e);
130
+ return t ? Array.from(t).map((n) => `.${n}`).join(",") : g;
131
+ }
132
+ function b(e) {
133
+ const t = d(e);
134
+ return t ? Array.from(t).join(", ") : l.join(", ");
135
+ }
136
+ function v(e) {
137
+ switch (e.type.split("/")[0]) {
138
+ case "image":
139
+ return /* @__PURE__ */ a(x, { className: "h-5 w-5 text-blue-500" });
140
+ case "video":
141
+ return /* @__PURE__ */ a(u, { className: "h-5 w-5 text-purple-500" });
142
+ case "audio":
143
+ return /* @__PURE__ */ a(f, { className: "h-5 w-5 text-green-500" });
144
+ default:
145
+ return e.type.includes("pdf") ? /* @__PURE__ */ a(c, { className: "h-5 w-5 text-red-500" }) : e.type.includes("word") || e.type.includes("document") ? /* @__PURE__ */ a(c, { className: "h-5 w-5 text-blue-600" }) : e.type.includes("excel") || e.type.includes("spreadsheet") ? /* @__PURE__ */ a(c, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ a(m, { className: "h-5 w-5 text-gray-500" });
146
+ }
147
+ }
148
+ function _(e) {
149
+ if (e === 0) return "0 Bytes";
150
+ const t = 1024, n = ["Bytes", "KB", "MB", "GB"], i = Math.floor(Math.log(e) / Math.log(t));
151
+ return parseFloat((e / Math.pow(t, i)).toFixed(2)) + " " + n[i];
152
+ }
153
+ function F(e, t) {
154
+ const n = t * 1024 * 1024;
155
+ return e.size <= n;
156
+ }
157
+ function O(e, t) {
158
+ const n = z(e.name), i = e.type.trim().toLowerCase();
159
+ if (i && S.has(i))
160
+ return { isValid: !1, reason: "blocked" };
161
+ if (!n) return { isValid: !1, reason: "not-allowed" };
162
+ if (p.has(n)) return { isValid: !1, reason: "blocked" };
163
+ if (!r.has(n)) return { isValid: !1, reason: "not-allowed" };
164
+ const s = d(t);
165
+ return s && !s.has(n) ? { isValid: !1, reason: "not-allowed" } : { isValid: !0 };
166
+ }
167
+ function A(e) {
168
+ return new Promise((t) => {
169
+ if (e.type.startsWith("image/")) {
170
+ const n = new FileReader();
171
+ n.onload = (i) => t(i.target?.result ?? ""), n.readAsDataURL(e);
172
+ } else
173
+ t("");
174
+ });
175
+ }
176
+ export {
177
+ h as BLOCKED_EXTENSIONS,
178
+ l as SECURE_ALLOWED_EXTENSIONS,
179
+ T as buildSecureAccept,
180
+ A as createPreview,
181
+ _ as formatFileSize,
182
+ b as getAllowedFormatsHint,
183
+ v as getFileIcon,
184
+ F as validateFileSize,
185
+ O as validateFileType
186
+ };
@@ -2,6 +2,7 @@ export { default as MciBreadcrumb } from './shared/ui/mciBreadcrumb/MciBreadcrum
2
2
  export { default as MciButton } from './shared/ui/mciButton/MciButton.tsx';
3
3
  export { default as MciCheck } from './shared/ui/mciCheck/MciCheck.tsx';
4
4
  export { default as MciCollapse } from './shared/ui/mciCollapse/MciCollapse.tsx';
5
+ export { default as MciAccordion } from './shared/ui/mciAccordion/MciAccordion.tsx';
5
6
  export { default as MciDrawer } from './shared/ui/mciDrawer/MciDrawer.tsx';
6
7
  export { default as MciInput } from './shared/ui/mciInput/MciInput.tsx';
7
8
  export { default as MciPicker } from './shared/ui/mciPicker/MciPicker.tsx';
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export type AccordionProps = {
3
+ children: ReactNode;
4
+ defaultValue?: boolean;
5
+ icon?: ReactNode;
6
+ className?: string;
7
+ };
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { AccordionProps } from '../../types/ui/accordion.types';
3
+ declare function AccordionTitle({ children, className, }: {
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ declare namespace AccordionTitle {
8
+ var displayName: string;
9
+ }
10
+ declare function AccordionContent({ children, className, }: {
11
+ children: React.ReactNode;
12
+ className?: string;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ declare namespace AccordionContent {
15
+ var displayName: string;
16
+ }
17
+ declare function MciAccordion({ children, defaultValue, icon, className }: AccordionProps): import("react/jsx-runtime").JSX.Element;
18
+ declare namespace MciAccordion {
19
+ var Title: typeof AccordionTitle;
20
+ var Content: typeof AccordionContent;
21
+ }
22
+ export default MciAccordion;
package/package.json CHANGED
@@ -1,23 +1,21 @@
1
1
  {
2
2
  "name": "@mci-ui/mci-ui",
3
3
  "private": false,
4
- "version": "0.0.83",
4
+ "version": "0.0.85",
5
5
  "type": "module",
6
- "main": "./dist/index.umd.js",
7
- "module": "./dist/index.es.js",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
8
  "types": "./dist/types/index.d.ts",
9
9
  "style": "./dist/index.css",
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/types/index.d.ts",
13
- "import": "./dist/index.es.js",
14
- "require": "./dist/index.umd.js"
13
+ "import": "./dist/index.js"
15
14
  },
16
15
  "./style.css": "./dist/index.css"
17
16
  },
18
17
  "sideEffects": [
19
- "./dist/index.css",
20
- "./style.css"
18
+ "**/*.css"
21
19
  ],
22
20
  "files": [
23
21
  "dist"
@@ -33,7 +31,10 @@
33
31
  "preview": "vite preview",
34
32
  "format": "prettier --write ."
35
33
  },
36
- "dependencies": {},
34
+ "dependencies": {
35
+ "clsx": "^2.1.1",
36
+ "tailwind-merge": "^3.4.0"
37
+ },
37
38
  "devDependencies": {
38
39
  "@eslint/js": "^9.39.1",
39
40
  "@solar-icons/react": "^1.0.1",
@@ -62,10 +63,12 @@
62
63
  },
63
64
  "peerDependencies": {
64
65
  "react": ">=19",
65
- "react-dom": ">=19",
66
- "@solar-icons/react": "^1.0.1",
67
- "clsx": "^2.1.1",
68
- "tailwind-merge": "^3.4.0"
66
+ "react-dom": ">=19"
67
+ },
68
+ "peerDependenciesMeta": {
69
+ "@solar-icons/react": {
70
+ "optional": true
71
+ }
69
72
  },
70
73
  "description": "Minimal UI component library built with React and Tailwind CSS.",
71
74
  "keywords": [