@instincthub/react-ui 0.1.49 → 0.1.50
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/README.md +23 -8
- package/dist/src/assets/css/forms/forms-index.css +1 -0
- package/dist/src/assets/css/forms/s3-multi-uploader.css +208 -0
- package/dist/src/components/forms/uploads/S3MultiUploader.js +2 -0
- package/dist/src/components/forms/uploads/S3MultiUploader.js.map +1 -0
- package/dist/src/components/navbar/ResponsiveNavbar.js +1 -1
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/components/forms/index.d.ts +1 -0
- package/dist/src/types/components/forms/uploads/S3MultiUploader.d.ts +13 -0
- package/dist/src/types/components/navbar/ResponsiveNavbar.d.ts +2 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/src/types/types/index.d.ts +41 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# InstinctHub React UI
|
|
2
2
|
|
|
3
|
-
A comprehensive React component library with
|
|
3
|
+
A comprehensive React component library with 130+ components for building modern web applications.
|
|
4
4
|
|
|
5
5
|
## 🚀 Quick Start
|
|
6
6
|
|
|
@@ -41,21 +41,18 @@ To use the `@instincthub/react-ui` package, another project needs to install the
|
|
|
41
41
|
`@instincthub/react-ui` has several peer dependencies that need to be installed separately:
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
npm install @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16
|
|
45
|
-
|
|
44
|
+
npm install @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16
|
|
46
45
|
```
|
|
47
46
|
|
|
48
47
|
Or using yarn:
|
|
49
48
|
|
|
50
49
|
```sh
|
|
51
|
-
yarn add @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16
|
|
52
|
-
```
|
|
50
|
+
yarn add @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16```
|
|
53
51
|
|
|
54
52
|
Or using pnmpm:
|
|
55
53
|
|
|
56
54
|
```sh
|
|
57
|
-
pnpm add @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16
|
|
58
|
-
```
|
|
55
|
+
pnpm add @aws-sdk/client-s3@^3.777.0 @aws-sdk/lib-storage@^3.777.0 @emotion/react@^11.14.0 @emotion/styled@^11.14.0 @mui/icons-material@^7.0.0 @mui/material@^7.0.0 @reduxjs/toolkit@^2.6.1 @types/redux-logger@^3.0.13 jspdf@^3.0.1 next@^15.2.1 next-auth@beta primereact@^10.9.3 react@^19.0.0 react-dom@^19.0.0 react-redux@^9.2.0 redux-logger@^3.0.6 react-syntax-highlighter@^15.6.1 styled-components@^6.1.16```
|
|
59
56
|
|
|
60
57
|
### Step 2: Install the Package
|
|
61
58
|
|
|
@@ -105,6 +102,24 @@ To unlink:
|
|
|
105
102
|
npm unlink @instincthub/react-ui
|
|
106
103
|
```
|
|
107
104
|
|
|
105
|
+
## Available Scripts
|
|
106
|
+
|
|
107
|
+
<!-- AUTO-GENERATED from package.json scripts -->
|
|
108
|
+
| Command | Description |
|
|
109
|
+
|---------|-------------|
|
|
110
|
+
| `npm run dev` | Start the example Next.js app with hot reload |
|
|
111
|
+
| `npm run build` | Build the example Next.js app |
|
|
112
|
+
| `npm run start` | Start the built example app |
|
|
113
|
+
| `npm run rollup` | Build the library for distribution |
|
|
114
|
+
| `npm run link-ui` | Rebuild and `npm link` for local development (macOS/Linux) |
|
|
115
|
+
| `npm run link-ui-win` | Rebuild and `npm link` for local development (Windows) |
|
|
116
|
+
| `npm run unlink-ui-linux` | Unlink the package (macOS/Linux) |
|
|
117
|
+
| `npm run yalc-link-ui` | Rebuild and publish to local yalc store |
|
|
118
|
+
| `npm run yalc-link-ui-win` | Rebuild and publish to local yalc store (Windows) |
|
|
119
|
+
| `npm run yalc-update-ui` | Rebuild and push updates to all yalc consumers |
|
|
120
|
+
| `npm run deploy` | Build + publish to npm + deploy to Vercel |
|
|
121
|
+
<!-- END AUTO-GENERATED -->
|
|
122
|
+
|
|
108
123
|
## Core Features
|
|
109
124
|
|
|
110
125
|
- **Form Components**: A comprehensive set of form elements including text fields, date pickers, phone inputs, and more
|
|
@@ -342,7 +357,7 @@ This package works seamlessly with Next.js applications. For optimal performance
|
|
|
342
357
|
|
|
343
358
|
```jsx
|
|
344
359
|
// In your _app.js or layout.js
|
|
345
|
-
import "@instincthub/react-ui/
|
|
360
|
+
import "@instincthub/react-ui/assets/css/styles.css"; // Import styles once at the application root
|
|
346
361
|
```
|
|
347
362
|
|
|
348
363
|
## TypeScript Support
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/* ── S3MultiUploader ── */
|
|
2
|
+
|
|
3
|
+
.s3mu-root { width: 100%; }
|
|
4
|
+
|
|
5
|
+
.s3mu-root.s3mu-disabled { opacity: 0.55; pointer-events: none; }
|
|
6
|
+
|
|
7
|
+
.s3mu-dropzone {
|
|
8
|
+
border: 2px dashed var(--borderDefault, #e5e7eb);
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
padding: 28px 20px;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
transition: border-color 0.15s, background 0.15s;
|
|
13
|
+
background: var(--OpacityBackground, #f4f4f480);
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.s3mu-dropzone:hover,
|
|
21
|
+
.s3mu-dropzone.dragging {
|
|
22
|
+
border-color: var(--DarkCyan, #00838f);
|
|
23
|
+
background: rgba(0, 131, 143, 0.03);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.s3mu-drop-icon {
|
|
27
|
+
color: var(--DarkCyan, #00838f);
|
|
28
|
+
margin-bottom: 8px;
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.s3mu-drop-label {
|
|
33
|
+
font-size: 13px;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
color: var(--Gunmetal, #2c333a);
|
|
36
|
+
margin: 0 0 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.s3mu-drop-hint {
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
color: var(--Rhythm, #69779b);
|
|
42
|
+
margin: 2px 0 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.s3mu-maxfiles-badge {
|
|
46
|
+
display: inline-block;
|
|
47
|
+
margin-top: 6px;
|
|
48
|
+
font-size: 11px;
|
|
49
|
+
color: var(--DarkCyan, #00838f);
|
|
50
|
+
background: rgba(0, 131, 143, 0.08);
|
|
51
|
+
border-radius: 4px;
|
|
52
|
+
padding: 2px 8px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Queue list */
|
|
56
|
+
.s3mu-queue {
|
|
57
|
+
margin-top: 12px;
|
|
58
|
+
border: 1px solid var(--borderDefault, #e5e7eb);
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.s3mu-queue-header {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
padding: 8px 14px;
|
|
68
|
+
background: var(--Gray, #f4f4f4);
|
|
69
|
+
border-bottom: 1px solid var(--borderDefault, #e5e7eb);
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
color: var(--Rhythm, #69779b);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.s3mu-clear-btn {
|
|
76
|
+
font-size: 11px;
|
|
77
|
+
color: var(--DarkCyan, #00838f);
|
|
78
|
+
background: none;
|
|
79
|
+
border: none;
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
padding: 2px 6px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Queue filter search */
|
|
85
|
+
.s3mu-filter {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: 6px;
|
|
89
|
+
margin: 6px 14px 4px;
|
|
90
|
+
padding: 5px 10px;
|
|
91
|
+
border: 1px solid var(--borderDefault, #e5e7eb);
|
|
92
|
+
border-radius: 6px;
|
|
93
|
+
background: var(--White, #fff);
|
|
94
|
+
color: var(--Rhythm, #69779b);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.s3mu-filter input {
|
|
98
|
+
flex: 1;
|
|
99
|
+
border: none;
|
|
100
|
+
outline: none;
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
background: transparent;
|
|
103
|
+
color: var(--Gunmetal, #2c333a);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Queue item */
|
|
107
|
+
.s3mu-item {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: 10px;
|
|
111
|
+
padding: 10px 14px;
|
|
112
|
+
border-bottom: 1px solid var(--borderDefault, #e5e7eb);
|
|
113
|
+
background: var(--White, #fff);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.s3mu-item:last-child { border-bottom: none; }
|
|
117
|
+
|
|
118
|
+
.s3mu-item--complete .s3mu-item-icon { color: var(--CaribbeanGreen, #00c5a2); }
|
|
119
|
+
.s3mu-item--error .s3mu-item-icon { color: var(--Danger, #ea5f5e); }
|
|
120
|
+
.s3mu-item--uploading .s3mu-item-icon { color: var(--DarkCyan, #00838f); }
|
|
121
|
+
.s3mu-item--queued .s3mu-item-icon { color: var(--Rhythm, #69779b); }
|
|
122
|
+
|
|
123
|
+
.s3mu-queued-dot {
|
|
124
|
+
width: 8px;
|
|
125
|
+
height: 8px;
|
|
126
|
+
border-radius: 50%;
|
|
127
|
+
background: var(--Rhythm, #69779b);
|
|
128
|
+
opacity: 0.4;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.s3mu-item-body {
|
|
132
|
+
flex: 1;
|
|
133
|
+
min-width: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.s3mu-item-name-row {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
gap: 8px;
|
|
141
|
+
margin-bottom: 4px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.s3mu-item-name {
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
font-weight: 500;
|
|
147
|
+
color: var(--Gunmetal, #2c333a);
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
text-overflow: ellipsis;
|
|
150
|
+
white-space: nowrap;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.s3mu-item-size {
|
|
154
|
+
font-size: 11px;
|
|
155
|
+
color: var(--Rhythm, #69779b);
|
|
156
|
+
flex-shrink: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Per-file progress bar */
|
|
160
|
+
.s3mu-bar-wrap {
|
|
161
|
+
height: 4px;
|
|
162
|
+
background: var(--Gray, #e5e7eb);
|
|
163
|
+
border-radius: 2px;
|
|
164
|
+
overflow: hidden;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.s3mu-bar-fill {
|
|
168
|
+
height: 100%;
|
|
169
|
+
background: var(--DarkCyan, #00838f);
|
|
170
|
+
border-radius: 2px;
|
|
171
|
+
transition: width 0.2s ease;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.s3mu-item--complete .s3mu-bar-fill { background: var(--CaribbeanGreen, #00c5a2); }
|
|
175
|
+
.s3mu-item--error .s3mu-bar-fill { background: var(--Danger, #ea5f5e); }
|
|
176
|
+
|
|
177
|
+
.s3mu-item-pct {
|
|
178
|
+
font-size: 11px;
|
|
179
|
+
color: var(--Rhythm, #69779b);
|
|
180
|
+
margin-top: 2px;
|
|
181
|
+
display: block;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.s3mu-item-err {
|
|
185
|
+
font-size: 11px;
|
|
186
|
+
color: var(--Danger, #ea5f5e);
|
|
187
|
+
margin-top: 2px;
|
|
188
|
+
display: block;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.s3mu-item-remove {
|
|
192
|
+
flex-shrink: 0;
|
|
193
|
+
width: 22px;
|
|
194
|
+
height: 22px;
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
justify-content: center;
|
|
198
|
+
border: none;
|
|
199
|
+
background: none;
|
|
200
|
+
cursor: pointer;
|
|
201
|
+
color: var(--Rhythm, #69779b);
|
|
202
|
+
border-radius: 4px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.s3mu-item-remove:hover {
|
|
206
|
+
background: rgba(234, 95, 94, 0.1);
|
|
207
|
+
color: var(--Danger, #ea5f5e);
|
|
208
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("@aws-sdk/client-s3"),s=require("@aws-sdk/lib-storage"),i=require("../../lib/helpFunction.js"),o=require("../../lib/modals/modals.js"),a=function(e){return e<1048576?"".concat((e/1024).toFixed(0)," KB"):"".concat((e/1048576).toFixed(1)," MB")},c=function(){return n.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 16 12 12 8 16"}),n.jsx("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),n.jsx("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"})]})},l=function(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})},u=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin",children:[n.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),n.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),n.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),n.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),n.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),n.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),n.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),n.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]})},d=function(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})},m=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})},x=function(e){var t=e.size,r=void 0===t?13:t;return n.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};exports.default=function(f){var p=f.accepts,h=f.maxFileSizeBytes,j=void 0===h?524288e3:h,v=f.maxFiles,y=f.concurrency,g=void 0===y?1:y,k=f.username,N=f.location,C=f.cdnBase,b=f.label,_=void 0===b?"Drop files here or click to browse":b,w=f.hint,L=f.onFileComplete,S=f.onQueueComplete,A=f.onError,B=f.disabled,E=void 0!==B&&B,T=f.className,q=void 0===T?"":T,U=t.useState([]),D=e.slicedToArray(U,2),I=D[0],W=D[1],z=t.useState(!1),M=e.slicedToArray(z,2),F=M[0],P=M[1],K=t.useState(""),O=e.slicedToArray(K,2),R=O[0],X=O[1],G=t.useRef(null),Q=t.useRef(0),Y=t.useRef([]);Y.current=I;var H=Math.min(Math.max(g,1),4),V=t.useCallback(function(n,t){W(function(r){return r.map(function(r){return r.id===n?e.objectSpread2(e.objectSpread2({},r),t):r})})},[]),J=t.useCallback(function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){var o,a,c,l,u,d,m,x,f,p,h,j;return e.regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:return V(t.id,{status:"uploading",progress:0}),o=new r.S3Client({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),a=(new Date).toISOString(),c=i.slugifyFileName("".concat(k,"-").concat(a,"-").concat(t.file.name)),l=i.IN_DEV_MODE?"test-env__".concat(c):c,u="".concat(N,"/").concat(l),d=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",e.p=1,e.n=2,t.file.arrayBuffer();case 2:return m=e.v,x=new Uint8Array(m),(f=new s.Upload({client:o,partSize:5242880,queueSize:2,params:{Bucket:d,Key:u,Body:x,ContentType:t.file.type,ACL:"public-read"}})).on("httpUploadProgress",function(e){if(e.total){var n=Math.round(e.loaded/e.total*100);V(t.id,{progress:n})}}),e.n=3,f.done();case 3:p={bucket:d,title:t.file.name,key:l,content_type:t.file.type,size:t.file.size,location:"".concat(C).concat(l)},V(t.id,{status:"complete",progress:100}),L(p),e.n=5;break;case 4:e.p=4,j=e.v,h=j instanceof Error?j.message:"Upload failed",V(t.id,{status:"error",error:h}),null==A||A(t.file.name,h);case 5:return e.a(2)}},n,null,[[1,4]])}));return function(e){return n.apply(this,arguments)}}(),[k,N,C,V,L,A]),Z=t.useCallback(e.asyncToGenerator(e.regenerator().m(function n(){var t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(!(Q.current>=H)){e.n=1;break}return e.a(2);case 1:if(t=Y.current.find(function(e){return"queued"===e.status})){e.n=2;break}return 0===Q.current&&Y.current.length>0&&Y.current.every(function(e){return"complete"===e.status||"error"===e.status})&&(null==S||S()),e.a(2);case 2:return Q.current+=1,e.n=3,J(t);case 3:Q.current-=1,Z();case 4:return e.a(2)}},n)})),[H,J,S]),$=t.useCallback(function(n){var t=n.filter(function(e){return e.size<=j});if(v&&v>0){var r=Y.current.length,s=v-r;if(s<=0)return void o.openToast("Maximum ".concat(v," file").concat(1!==v?"s":""," allowed"),400);t.length>s&&(o.openToast("Only ".concat(s," more file").concat(1!==s?"s":""," allowed (limit: ").concat(v,"). First ").concat(s," selected."),400),t=t.slice(0,s))}if(t.length){var i=t.map(function(e){return{id:crypto.randomUUID(),file:e,status:"queued",progress:0}});W(function(n){var t=[].concat(e.toConsumableArray(n),e.toConsumableArray(i));Y.current=t;for(var r=0;r<H;r++)setTimeout(Z,0);return t})}},[j,v,H,Z]),ee=I.filter(function(e){return"complete"===e.status}).length,ne=I.some(function(e){return"uploading"===e.status||"queued"===e.status}),te=R?I.filter(function(e){return e.file.name.toLowerCase().includes(R.toLowerCase())}):I;return n.jsxs("div",{className:"s3mu-root".concat(E?" s3mu-disabled":""," ").concat(q).trim(),children:[n.jsxs("div",{className:"s3mu-dropzone".concat(F?" dragging":""),onDragOver:function(e){e.preventDefault(),E||P(!0)},onDragLeave:function(){return P(!1)},onDrop:function(e){e.preventDefault(),P(!1),E||$(Array.from(e.dataTransfer.files))},onClick:function(){var e;return!E&&(null===(e=G.current)||void 0===e?void 0:e.click())},children:[n.jsx("input",{ref:G,type:"file",accept:p,multiple:!0,disabled:E,style:{display:"none"},onChange:function(e){e.target.files&&$(Array.from(e.target.files)),e.target.value=""}}),n.jsx("div",{className:"s3mu-drop-icon",children:n.jsx(c,{})}),n.jsx("p",{className:"s3mu-drop-label",children:_}),w&&n.jsx("p",{className:"s3mu-drop-hint",children:w}),n.jsxs("p",{className:"s3mu-drop-hint",children:["Max ",a(j)," per file"]}),v&&v>0&&n.jsxs("span",{className:"s3mu-maxfiles-badge",children:["Up to ",v," file",1!==v?"s":""]})]}),I.length>0&&n.jsxs("div",{className:"s3mu-queue",children:[n.jsxs("div",{className:"s3mu-queue-header",children:[n.jsx("span",{children:R&&te.length!==I.length?"".concat(te.length," of ").concat(I.length," file").concat(1!==I.length?"s":""):"".concat(I.length," file").concat(1!==I.length?"s":"")}),ee>0&&!ne&&n.jsx("button",{type:"button",className:"s3mu-clear-btn",onClick:function(){W(function(e){return e.filter(function(e){return"complete"!==e.status})})},children:"Clear completed"})]}),I.length>=5&&n.jsxs("div",{className:"s3mu-filter",children:[n.jsx(l,{}),n.jsx("input",{type:"text",placeholder:"Filter files…",value:R,onChange:function(e){return X(e.target.value)}})]}),te.map(function(e){return n.jsxs("div",{className:"s3mu-item s3mu-item--".concat(e.status),children:[n.jsxs("div",{className:"s3mu-item-icon",children:["complete"===e.status&&n.jsx(d,{}),"error"===e.status&&n.jsx(m,{}),"uploading"===e.status&&n.jsx(u,{}),"queued"===e.status&&n.jsx("div",{className:"s3mu-queued-dot"})]}),n.jsxs("div",{className:"s3mu-item-body",children:[n.jsxs("div",{className:"s3mu-item-name-row",children:[n.jsx("span",{className:"s3mu-item-name",title:e.file.name,children:e.file.name}),n.jsx("span",{className:"s3mu-item-size",children:a(e.file.size)})]}),("uploading"===e.status||"complete"===e.status)&&n.jsx("div",{className:"s3mu-bar-wrap",children:n.jsx("div",{className:"s3mu-bar-fill",style:{width:"".concat(e.progress,"%")}})}),"uploading"===e.status&&n.jsxs("span",{className:"s3mu-item-pct",children:[e.progress,"%"]}),"error"===e.status&&n.jsx("span",{className:"s3mu-item-err",children:e.error}),"queued"===e.status&&n.jsx("span",{className:"s3mu-item-pct",style:{opacity:.5},children:"Queued"})]}),"uploading"!==e.status&&n.jsx("button",{type:"button",className:"s3mu-item-remove",onClick:function(){return n=e.id,void W(function(e){return e.filter(function(e){return e.id!==n})});var n},title:"Remove",children:n.jsx(x,{})})]},e.id)})]})]})};
|
|
2
|
+
//# sourceMappingURL=S3MultiUploader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"S3MultiUploader.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),i=require("react"),r=require("next/link"),a=require("next/image"),s=require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),t=require("@mui/icons-material/LightMode"),o=require("@mui/icons-material/DarkMode");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(r),c=u(a),d=u(t),h=u(o);exports.default=function(r){var a=r.session,t=r.logoSrc,o=r.logoAlt,u=void 0===o?"Company Logo":o,m=r.navLinks,b=r.userAreaLinks,f=void 0===b?[]:b,v=r.theme,x=void 0===v?"LightMode":v,p=r.containerClass,g=void 0===p?"ihub-container":p,j=r.topBanner,N=r.bottomBanner,w=r.hideTopBanner,k=void 0!==w&&w,_=r.hideBottomBanner,E=void 0!==_&&_,L=r.signoutUrl,M=r.userDropdownOpen,D=r.onUserDropdownToggle,S=r.renderUserDropdown,y=i.useState(!1),A=e.slicedToArray(y,2),q=A[0],C=A[1],T=i.useState(!1),B=e.slicedToArray(T,2),U=B[0],O=B[1],F=i.useState(!1),P=e.slicedToArray(F,2),z=P[0],I=P[1],H=i.useState(null),W=e.slicedToArray(H,2),Y=W[0],G=W[1],J=i.useState(null),K=e.slicedToArray(J,2),Q=K[0],R=K[1],V=i.useState(x),X=e.slicedToArray(V,2),Z=X[0],$=X[1],ee=void 0!==M,ne=ee?M:z,ie=a,re=null==ie?void 0:ie.user,ae=function(){if(null==re||!re.name)return"";if("string"==typeof re.name)return re.name;if("object"===e.typeof(re.name)){var n=re.name;return n.full_name||"".concat(n.first_name||""," ").concat(n.last_name||"").trim()||n.email||""}return""}();i.useEffect(function(){var e=function(){window.scrollY>50?O(!0):O(!1)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]),i.useEffect(function(){var e=localStorage.getItem("theme");e&&($(e),document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e))},[]),i.useEffect(function(){var e=function(e){var n=e.target;!q||n.closest(".ihub-navbar-elements")||n.closest(".ihub-hamburger")||C(!1),ne&&!n.closest(".ihub-user-dropdown")&&te(),null===Y||n.closest(".ihub-nav-submenu-".concat(Y))||G(null)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[q,ne,Y,Q]),i.useEffect(function(){var e=function(){window.innerWidth>768&&q&&C(!1)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[q]);var se=function(){var e=!ne;ee?null==D||D(e):I(e),R(null)},te=function(){ee?null==D||D(!1):I(!1),R(null)};return n.jsxs("header",{className:"ihub-navbar ".concat(U?"ihub-navbar-scrolled":""," ").concat("DarkMode"===Z?"ihub-navbar-dark":""),children:[j&&!k&&n.jsx("div",{className:"ihub-navbar-top-banner",children:j}),n.jsx("div",{className:g,children:n.jsxs("nav",{className:"ihub-navbar-container",children:[n.jsx("div",{className:"ihub-navbar-logo",children:n.jsx(l.default,{href:"/",children:n.jsx(c.default,{src:t,alt:u,width:120,height:40,className:"ihub-logo-image"})})}),n.jsxs("div",{className:"ihub-hamburger",onClick:function(){C(!q),G(null)},children:[n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")}),n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")}),n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")})]}),n.jsxs("div",{className:"ihub-navbar-elements ".concat(q?"ihub-active":""),children:[n.jsxs("ul",{className:"ihub-nav-links",children:[m.map(function(e,i){return n.jsx("li",{className:"ihub-nav-item ihub-nav-submenu-".concat(i," ").concat(e.submenu?"ihub-has-submenu":""," ").concat(Y===i?"ihub-submenu-active":""),children:e.submenu?n.jsxs(n.Fragment,{children:[n.jsxs("a",{href:"#",onClick:function(e){return function(e,n){n.preventDefault(),G(Y===e?null:e)}(i,e)},className:"ihub-submenu-toggle ".concat(e.highlight?"ihub-nav-highlight":""),children:[e.title,n.jsx("span",{className:"ihub-dropdown-arrow"})]}),Y===i&&n.jsx("ul",{className:"ihub-submenu",children:e.submenu.map(function(e,i){return n.jsx("li",{className:"ihub-submenu-item",children:e.isExternal?n.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",children:[e.icon&&n.jsx("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]}):n.jsxs(l.default,{href:e.href,children:[e.icon&&n.jsx("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]})},i)})})]}):n.jsx(n.Fragment,{children:e.isExternal?n.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:e.highlight?"ihub-nav-highlight":"",children:e.title}):n.jsx(l.default,{href:e.href,className:e.highlight?"ihub-nav-highlight":"",children:e.title})})},i)}),n.jsx("li",{className:"ihub-nav-item",children:n.jsx("button",{onClick:function(){var e="LightMode"===Z?"DarkMode":"LightMode";document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e),$(e),localStorage.setItem("theme",e)},className:"ihub-theme-toggle","aria-label":"Switch to ".concat("LightMode"===Z?"DarkMode":"LightMode"," mode"),children:"LightMode"===Z?n.jsx(h.default,{}):n.jsx(d.default,{})})})]}),n.jsx("div",{className:"ihub-navbar-user-area",children:a?n.jsxs("div",{className:"ihub-user-dropdown",children:[n.jsxs("div",{className:"ihub-user-profile",onClick:se,children:[null!=re&&re.image?n.jsx(c.default,{src:re.image,alt:"User",width:40,height:40,className:"ihub-user-avatar"}):n.jsx("div",{className:"ihub-user-initials",children:ae.charAt(0)||"U"}),n.jsxs("span",{className:"ihub-user-name ihub-hide-sm",children:[ae,n.jsx("span",{className:"ihub-dropdown-arrow"})]})]}),ne&&n.jsx("div",{className:"ihub-dropdown ihub-user-menu-dropdown",children:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),i=require("react"),r=require("next/link"),a=require("next/image"),s=require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),t=require("@mui/icons-material/LightMode"),o=require("@mui/icons-material/DarkMode");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=u(r),c=u(a),d=u(t),h=u(o);exports.default=function(r){var a=r.session,t=r.logoSrc,o=r.logoAlt,u=void 0===o?"Company Logo":o,m=r.navLinks,b=r.userAreaLinks,f=void 0===b?[]:b,v=r.theme,x=void 0===v?"LightMode":v,p=r.containerClass,g=void 0===p?"ihub-container":p,j=r.topBanner,N=r.bottomBanner,w=r.hideTopBanner,k=void 0!==w&&w,_=r.hideBottomBanner,E=void 0!==_&&_,L=r.signoutUrl,M=r.userDropdownOpen,D=r.onUserDropdownToggle,S=r.renderUserDropdown,y=i.useState(!1),A=e.slicedToArray(y,2),q=A[0],C=A[1],T=i.useState(!1),B=e.slicedToArray(T,2),U=B[0],O=B[1],F=i.useState(!1),P=e.slicedToArray(F,2),z=P[0],I=P[1],H=i.useState(null),W=e.slicedToArray(H,2),Y=W[0],G=W[1],J=i.useState(null),K=e.slicedToArray(J,2),Q=K[0],R=K[1],V=i.useState(x),X=e.slicedToArray(V,2),Z=X[0],$=X[1],ee=void 0!==M,ne=ee?M:z,ie=a,re=null==ie?void 0:ie.user,ae=function(){if(null==re||!re.name)return"";if("string"==typeof re.name)return re.name;if("object"===e.typeof(re.name)){var n=re.name;return n.full_name||"".concat(n.first_name||""," ").concat(n.last_name||"").trim()||n.email||""}return""}();i.useEffect(function(){var e=function(){window.scrollY>50?O(!0):O(!1)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[]),i.useEffect(function(){var e=localStorage.getItem("theme");e&&($(e),document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e))},[]),i.useEffect(function(){var e=function(e){var n=e.target;!q||n.closest(".ihub-navbar-elements")||n.closest(".ihub-hamburger")||C(!1),ne&&!n.closest(".ihub-user-dropdown")&&te(),null===Y||n.closest(".ihub-nav-submenu-".concat(Y))||G(null)};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[q,ne,Y,Q]),i.useEffect(function(){var e=function(){window.innerWidth>768&&q&&C(!1)};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[q]);var se=function(){var e=!ne;ee?null==D||D(e):I(e),R(null)},te=function(){ee?null==D||D(!1):I(!1),R(null)};return n.jsxs("header",{className:"ihub-navbar ".concat(U?"ihub-navbar-scrolled":""," ").concat("DarkMode"===Z?"ihub-navbar-dark":""),children:[j&&!k&&n.jsx("div",{className:"ihub-navbar-top-banner",children:j}),n.jsx("div",{className:g,children:n.jsxs("nav",{className:"ihub-navbar-container",children:[n.jsx("div",{className:"ihub-navbar-logo",children:n.jsx(l.default,{href:"/",children:n.jsx(c.default,{src:t,alt:u,width:120,height:40,className:"ihub-logo-image"})})}),n.jsxs("div",{className:"ihub-hamburger",onClick:function(){C(!q),G(null)},children:[n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")}),n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")}),n.jsx("div",{className:"ihub-hamburger-line ".concat(q?"ihub-active":"")})]}),n.jsxs("div",{className:"ihub-navbar-elements ".concat(q?"ihub-active":""),children:[n.jsxs("ul",{className:"ihub-nav-links",children:[m.map(function(e,i){return n.jsx("li",{className:"ihub-nav-item ihub-nav-submenu-".concat(i," ").concat(e.submenu?"ihub-has-submenu":""," ").concat(Y===i?"ihub-submenu-active":""),children:e.submenu?n.jsxs(n.Fragment,{children:[n.jsxs("a",{href:"#",onClick:function(e){return function(e,n){n.preventDefault(),G(Y===e?null:e)}(i,e)},className:"ihub-submenu-toggle ".concat(e.highlight?"ihub-nav-highlight":""),children:[e.title,n.jsx("span",{className:"ihub-dropdown-arrow"})]}),Y===i&&n.jsx("ul",{className:"ihub-submenu",children:e.submenu.map(function(e,i){return n.jsx("li",{className:"ihub-submenu-item",children:e.isExternal?n.jsxs("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",children:[e.icon&&n.jsx("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]}):n.jsxs(l.default,{href:e.href,children:[e.icon&&n.jsx("span",{className:"ihub-submenu-icon",children:e.icon}),e.title]})},i)})})]}):n.jsx(n.Fragment,{children:e.isExternal?n.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:e.highlight?"ihub-nav-highlight":"",children:e.title}):n.jsx(l.default,{href:e.href,className:e.highlight?"ihub-nav-highlight":"",children:e.title})})},i)}),n.jsx("li",{className:"ihub-nav-item",children:n.jsx("button",{onClick:function(){var e="LightMode"===Z?"DarkMode":"LightMode";document.documentElement.classList.remove("LightMode","DarkMode"),document.documentElement.classList.add(e),$(e),localStorage.setItem("theme",e)},className:"ihub-theme-toggle","aria-label":"Switch to ".concat("LightMode"===Z?"DarkMode":"LightMode"," mode"),children:"LightMode"===Z?n.jsx(h.default,{}):n.jsx(d.default,{})})})]}),n.jsx("div",{className:"ihub-navbar-user-area",children:a?n.jsxs("div",{className:"ihub-user-dropdown",children:[n.jsxs("div",{className:"ihub-user-profile",onClick:se,children:[null!=re&&re.image?n.jsx(c.default,{src:re.image,alt:"User",width:40,height:40,className:"ihub-user-avatar"}):n.jsx("div",{className:"ihub-user-initials",children:ae.charAt(0)||"U"}),n.jsxs("span",{className:"ihub-user-name ihub-hide-sm",children:[ae,n.jsx("span",{className:"ihub-dropdown-arrow"})]})]}),ne&&(S?S({user:re,isOpen:ne,toggleDropdown:se,closeDropdown:te}):n.jsx("div",{className:"ihub-dropdown ihub-user-menu-dropdown",children:n.jsxs(n.Fragment,{children:[f.map(function(e,i){return n.jsx("div",{className:"ihub-dropdown-item-wrapper",children:e.submenu?n.jsxs("div",{className:"ihub-dropdown-with-submenu",children:[n.jsxs("a",{href:"#",className:"ihub-dropdown-item ihub-dropdown-parent",onClick:function(e){return function(e,n){n.preventDefault(),n.stopPropagation(),R(Q===e?null:e)}(i,e)},target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:[e.icon&&n.jsx("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title,n.jsx("span",{className:"ihub-submenu-caret ".concat(Q===i?"ihub-active":"")})]}),Q===i&&n.jsx("div",{className:"ihub-user-submenu",children:e.submenu.map(function(e,i){return n.jsxs(l.default,{href:e.href,className:"ihub-dropdown-subitem",target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:[e.icon&&n.jsx("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title]},i)})})]}):n.jsxs(l.default,{href:e.href,className:"ihub-dropdown-item",children:[e.icon&&n.jsx("span",{className:"ihub-dropdown-icon",children:e.icon}),e.title]})},i)}),L?n.jsxs(l.default,{href:L,className:"ihub-dropdown-item ihub-signout",children:[n.jsx("span",{className:"ihub-dropdown-icon",children:"⤴"}),"Sign out"]}):n.jsxs("button",{onClick:function(){return s.signOut()},className:"ihub-dropdown-item ihub-signout",children:[n.jsx("span",{className:"ihub-dropdown-icon",children:"⤴"}),"Sign out"]})]})}))]}):n.jsx("div",{className:"ihub-auth-buttons",children:f.map(function(e,i){return e.isButton?n.jsx(l.default,{href:e.href,className:"".concat("outline"===e.buttonStyle?"ihub-outlined-btn":"ihub-important-btn"),target:e.isExternal?"_blank":void 0,rel:e.isExternal?"noopener noreferrer":void 0,children:e.title},i):n.jsx(l.default,{href:e.href,className:"ihub-auth-link",children:e.title},i)})})})]})]})}),N&&!E&&n.jsx("div",{className:"ihub-navbar-bottom-banner",children:N})]})};
|
|
2
2
|
//# sourceMappingURL=ResponsiveNavbar.js.map
|