@deepnoid/ui 0.1.191 → 0.1.192
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/.turbo/turbo-build.log +153 -153
- package/dist/{chunk-DT632UOW.mjs → chunk-HA7PFE74.mjs} +14 -38
- package/dist/components/fileUpload/fileUpload.d.mts +2 -1
- package/dist/components/fileUpload/fileUpload.d.ts +2 -1
- package/dist/components/fileUpload/fileUpload.js +43 -429
- package/dist/components/fileUpload/fileUpload.mjs +1 -1
- package/dist/components/fileUpload/index.js +43 -429
- package/dist/components/fileUpload/index.mjs +1 -1
- package/dist/components/picker/datePicker.mjs +2 -2
- package/dist/components/picker/index.mjs +2 -2
- package/dist/components/toast/index.mjs +2 -2
- package/dist/components/toast/use-toast.mjs +2 -2
- package/dist/index.js +14 -35
- package/dist/index.mjs +18 -18
- package/package.json +1 -1
- package/dist/{chunk-TKQLMBX2.mjs → chunk-2A3APCWC.mjs} +3 -3
- package/dist/{chunk-ZVV7ISV7.mjs → chunk-B2TLDEF4.mjs} +3 -3
|
@@ -107,8 +107,8 @@ __export(fileUpload_exports, {
|
|
|
107
107
|
module.exports = __toCommonJS(fileUpload_exports);
|
|
108
108
|
|
|
109
109
|
// src/components/fileUpload/fileUpload.tsx
|
|
110
|
-
var
|
|
111
|
-
var
|
|
110
|
+
var import_react6 = require("react");
|
|
111
|
+
var import_tailwind_variants5 = require("tailwind-variants");
|
|
112
112
|
|
|
113
113
|
// src/components/input/input.tsx
|
|
114
114
|
var import_react = require("react");
|
|
@@ -6109,381 +6109,16 @@ var buttonStyle = tv({
|
|
|
6109
6109
|
]
|
|
6110
6110
|
});
|
|
6111
6111
|
|
|
6112
|
-
// src/components/button/icon-button.tsx
|
|
6113
|
-
var import_react4 = require("react");
|
|
6114
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6115
|
-
var IconButton = (0, import_react4.forwardRef)((props, ref) => {
|
|
6116
|
-
const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
|
|
6117
|
-
const { classNames, name, disableRipple, disabled, isLoading, size, full, isInGroup, onMouseDown, ...buttonProps } = {
|
|
6118
|
-
...localProps,
|
|
6119
|
-
...variantProps
|
|
6120
|
-
};
|
|
6121
|
-
const slots = (0, import_react4.useMemo)(() => iconButtonStyle({ ...variantProps }), [variantProps]);
|
|
6122
|
-
const { onPress, onClear, ripples } = useRipple();
|
|
6123
|
-
const handleRipple = (0, import_react4.useCallback)(
|
|
6124
|
-
(e) => {
|
|
6125
|
-
if (!disableRipple && !disabled) {
|
|
6126
|
-
onPress(e);
|
|
6127
|
-
}
|
|
6128
|
-
},
|
|
6129
|
-
[disableRipple, disabled, onPress]
|
|
6130
|
-
);
|
|
6131
|
-
const handleMouseDown = (0, import_react4.useCallback)(
|
|
6132
|
-
(e) => {
|
|
6133
|
-
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
6134
|
-
handleRipple(e);
|
|
6135
|
-
},
|
|
6136
|
-
[onMouseDown, handleRipple]
|
|
6137
|
-
);
|
|
6138
|
-
const rippleProps = (0, import_react4.useMemo)(() => ({ ripples, onClear }), [ripples, onClear]);
|
|
6139
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
6140
|
-
"button",
|
|
6141
|
-
{
|
|
6142
|
-
...buttonProps,
|
|
6143
|
-
onMouseDown: handleMouseDown,
|
|
6144
|
-
ref,
|
|
6145
|
-
disabled: disabled || isLoading,
|
|
6146
|
-
"data-loading": isLoading,
|
|
6147
|
-
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
6148
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon_default, { name: "loading", size, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
6149
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon_default, { name, size }),
|
|
6150
|
-
!disableRipple && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ripple_default, { ...rippleProps })
|
|
6151
|
-
] })
|
|
6152
|
-
}
|
|
6153
|
-
);
|
|
6154
|
-
});
|
|
6155
|
-
IconButton.displayName = "IconButton";
|
|
6156
|
-
var icon_button_default = IconButton;
|
|
6157
|
-
var iconButtonStyle = tv({
|
|
6158
|
-
slots: {
|
|
6159
|
-
base: [
|
|
6160
|
-
"relative",
|
|
6161
|
-
"flex",
|
|
6162
|
-
"items-center",
|
|
6163
|
-
"justify-center",
|
|
6164
|
-
"whitespace-nowrap",
|
|
6165
|
-
"transition",
|
|
6166
|
-
"duration-200",
|
|
6167
|
-
"select-none",
|
|
6168
|
-
"overflow-hidden",
|
|
6169
|
-
"box-border"
|
|
6170
|
-
]
|
|
6171
|
-
},
|
|
6172
|
-
variants: {
|
|
6173
|
-
variant: {
|
|
6174
|
-
solid: [],
|
|
6175
|
-
soft: [],
|
|
6176
|
-
outline: [],
|
|
6177
|
-
ghost: []
|
|
6178
|
-
},
|
|
6179
|
-
color: {
|
|
6180
|
-
primary: [],
|
|
6181
|
-
secondary: [],
|
|
6182
|
-
neutral: [],
|
|
6183
|
-
info: [],
|
|
6184
|
-
success: [],
|
|
6185
|
-
warning: [],
|
|
6186
|
-
danger: []
|
|
6187
|
-
},
|
|
6188
|
-
size: {
|
|
6189
|
-
sm: {
|
|
6190
|
-
base: ["w-[24px]", "h-[24px]", "rounded-sm"]
|
|
6191
|
-
},
|
|
6192
|
-
md: {
|
|
6193
|
-
base: ["w-[32px]", "h-[32px]", "rounded-md"]
|
|
6194
|
-
},
|
|
6195
|
-
lg: {
|
|
6196
|
-
base: ["w-[40px]", "h-[40px]", "rounded-lg"]
|
|
6197
|
-
},
|
|
6198
|
-
xl: {
|
|
6199
|
-
base: ["w-[50px]", "h-[50px]", "rounded-xl"]
|
|
6200
|
-
}
|
|
6201
|
-
},
|
|
6202
|
-
isLoading: {
|
|
6203
|
-
true: {}
|
|
6204
|
-
},
|
|
6205
|
-
disabled: {
|
|
6206
|
-
true: {
|
|
6207
|
-
base: ["!bg-neutral-soft", "!border-neutral-soft", "!text-neutral-light", "pointer-events-none"]
|
|
6208
|
-
}
|
|
6209
|
-
},
|
|
6210
|
-
isInGroup: {
|
|
6211
|
-
true: {
|
|
6212
|
-
base: [
|
|
6213
|
-
"[&:not(:first-child):not(:last-child)]:rounded-none",
|
|
6214
|
-
"first:rounded-r-none",
|
|
6215
|
-
"last:rounded-l-none",
|
|
6216
|
-
"[&:not(:first-child)]:border-l-0"
|
|
6217
|
-
]
|
|
6218
|
-
}
|
|
6219
|
-
}
|
|
6220
|
-
},
|
|
6221
|
-
compoundVariants: [
|
|
6222
|
-
{
|
|
6223
|
-
variant: "solid",
|
|
6224
|
-
color: "primary",
|
|
6225
|
-
class: {
|
|
6226
|
-
base: ["text-white", "bg-primary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6227
|
-
}
|
|
6228
|
-
},
|
|
6229
|
-
{
|
|
6230
|
-
variant: "solid",
|
|
6231
|
-
color: "secondary",
|
|
6232
|
-
class: {
|
|
6233
|
-
base: ["text-white", "bg-secondary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6234
|
-
}
|
|
6235
|
-
},
|
|
6236
|
-
{
|
|
6237
|
-
variant: "solid",
|
|
6238
|
-
color: "neutral",
|
|
6239
|
-
class: {
|
|
6240
|
-
base: ["text-white", "bg-neutral-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6241
|
-
}
|
|
6242
|
-
},
|
|
6243
|
-
{
|
|
6244
|
-
variant: "solid",
|
|
6245
|
-
color: "info",
|
|
6246
|
-
class: {
|
|
6247
|
-
base: ["text-white", "bg-info-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6248
|
-
}
|
|
6249
|
-
},
|
|
6250
|
-
{
|
|
6251
|
-
variant: "solid",
|
|
6252
|
-
color: "success",
|
|
6253
|
-
class: {
|
|
6254
|
-
base: ["text-white", "bg-success-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6255
|
-
}
|
|
6256
|
-
},
|
|
6257
|
-
{
|
|
6258
|
-
variant: "solid",
|
|
6259
|
-
color: "warning",
|
|
6260
|
-
class: {
|
|
6261
|
-
base: ["text-white", "bg-warning-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6262
|
-
}
|
|
6263
|
-
},
|
|
6264
|
-
{
|
|
6265
|
-
variant: "solid",
|
|
6266
|
-
color: "danger",
|
|
6267
|
-
class: {
|
|
6268
|
-
base: ["text-white", "bg-danger-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
6269
|
-
}
|
|
6270
|
-
},
|
|
6271
|
-
// soft
|
|
6272
|
-
{
|
|
6273
|
-
variant: "soft",
|
|
6274
|
-
color: "primary",
|
|
6275
|
-
class: {
|
|
6276
|
-
base: ["text-primary-main", "bg-primary-soft", "!border-primary-soft", "hover:!border-primary-light"]
|
|
6277
|
-
}
|
|
6278
|
-
},
|
|
6279
|
-
{
|
|
6280
|
-
variant: "soft",
|
|
6281
|
-
color: "secondary",
|
|
6282
|
-
class: {
|
|
6283
|
-
base: ["text-secondary-main", "bg-secondary-soft", "!border-secondary-soft", "hover:!border-secondary-light"]
|
|
6284
|
-
}
|
|
6285
|
-
},
|
|
6286
|
-
{
|
|
6287
|
-
variant: "soft",
|
|
6288
|
-
color: "neutral",
|
|
6289
|
-
class: {
|
|
6290
|
-
base: ["text-neutral-main", "bg-neutral-soft", "!border-neutral-soft", "hover:!border-neutral-light"]
|
|
6291
|
-
}
|
|
6292
|
-
},
|
|
6293
|
-
{
|
|
6294
|
-
variant: "soft",
|
|
6295
|
-
color: "info",
|
|
6296
|
-
class: {
|
|
6297
|
-
base: ["text-info-main", "bg-info-soft", "!border-info-soft", "hover:!border-info-light"]
|
|
6298
|
-
}
|
|
6299
|
-
},
|
|
6300
|
-
{
|
|
6301
|
-
variant: "soft",
|
|
6302
|
-
color: "success",
|
|
6303
|
-
class: {
|
|
6304
|
-
base: ["text-success-main", "bg-success-soft", "!border-success-soft", "hover:!border-success-light"]
|
|
6305
|
-
}
|
|
6306
|
-
},
|
|
6307
|
-
{
|
|
6308
|
-
variant: "soft",
|
|
6309
|
-
color: "warning",
|
|
6310
|
-
class: {
|
|
6311
|
-
base: ["text-warning-main", "bg-warning-soft", "!border-warning-soft", "hover:!border-warning-light"]
|
|
6312
|
-
}
|
|
6313
|
-
},
|
|
6314
|
-
{
|
|
6315
|
-
variant: "soft",
|
|
6316
|
-
color: "danger",
|
|
6317
|
-
class: {
|
|
6318
|
-
base: ["text-danger-main", "bg-danger-soft", "!border-danger-soft", "hover:!border-danger-light"]
|
|
6319
|
-
}
|
|
6320
|
-
},
|
|
6321
|
-
// outline
|
|
6322
|
-
{
|
|
6323
|
-
variant: "outline",
|
|
6324
|
-
color: "primary",
|
|
6325
|
-
class: {
|
|
6326
|
-
base: ["bg-body-background", "!border-primary-main", "text-primary-main", "hover:bg-primary-soft"]
|
|
6327
|
-
}
|
|
6328
|
-
},
|
|
6329
|
-
{
|
|
6330
|
-
variant: "outline",
|
|
6331
|
-
color: "secondary",
|
|
6332
|
-
class: {
|
|
6333
|
-
base: ["bg-body-background", "!border-secondary-main", "text-secondary-main", "hover:bg-secondary-soft"]
|
|
6334
|
-
}
|
|
6335
|
-
},
|
|
6336
|
-
{
|
|
6337
|
-
variant: "outline",
|
|
6338
|
-
color: "neutral",
|
|
6339
|
-
class: {
|
|
6340
|
-
base: ["bg-body-background", "!border-neutral-light", "text-neutral-main", "hover:bg-neutral-soft"]
|
|
6341
|
-
}
|
|
6342
|
-
},
|
|
6343
|
-
{
|
|
6344
|
-
variant: "outline",
|
|
6345
|
-
color: "info",
|
|
6346
|
-
class: {
|
|
6347
|
-
base: ["bg-body-background", "!border-info-main", "text-info-main", "hover:bg-info-soft"]
|
|
6348
|
-
}
|
|
6349
|
-
},
|
|
6350
|
-
{
|
|
6351
|
-
variant: "outline",
|
|
6352
|
-
color: "success",
|
|
6353
|
-
class: {
|
|
6354
|
-
base: ["bg-body-background", "!border-success-main", "text-success-main", "hover:bg-success-soft"]
|
|
6355
|
-
}
|
|
6356
|
-
},
|
|
6357
|
-
{
|
|
6358
|
-
variant: "outline",
|
|
6359
|
-
color: "warning",
|
|
6360
|
-
class: {
|
|
6361
|
-
base: ["bg-body-background", "!border-warning-main", "text-warning-main", "hover:bg-warning-soft"]
|
|
6362
|
-
}
|
|
6363
|
-
},
|
|
6364
|
-
{
|
|
6365
|
-
variant: "outline",
|
|
6366
|
-
color: "danger",
|
|
6367
|
-
class: {
|
|
6368
|
-
base: ["bg-body-background", "!border-danger-main", "text-danger-main", "hover:bg-danger-soft"]
|
|
6369
|
-
}
|
|
6370
|
-
},
|
|
6371
|
-
// ghost
|
|
6372
|
-
{
|
|
6373
|
-
variant: "ghost",
|
|
6374
|
-
color: "primary",
|
|
6375
|
-
class: {
|
|
6376
|
-
base: ["text-primary-main", "border-transparent", "hover:bg-primary-soft"]
|
|
6377
|
-
}
|
|
6378
|
-
},
|
|
6379
|
-
{
|
|
6380
|
-
variant: "ghost",
|
|
6381
|
-
color: "secondary",
|
|
6382
|
-
class: {
|
|
6383
|
-
base: ["text-secondary-main", "border-transparent", "hover:bg-secondary-soft"]
|
|
6384
|
-
}
|
|
6385
|
-
},
|
|
6386
|
-
{
|
|
6387
|
-
variant: "ghost",
|
|
6388
|
-
color: "neutral",
|
|
6389
|
-
class: {
|
|
6390
|
-
base: ["text-neutral-main", "border-transparent", "hover:bg-neutral-soft"]
|
|
6391
|
-
}
|
|
6392
|
-
},
|
|
6393
|
-
{
|
|
6394
|
-
variant: "ghost",
|
|
6395
|
-
color: "info",
|
|
6396
|
-
class: {
|
|
6397
|
-
base: ["text-info-main", "border-transparent", "hover:bg-info-soft"]
|
|
6398
|
-
}
|
|
6399
|
-
},
|
|
6400
|
-
{
|
|
6401
|
-
variant: "ghost",
|
|
6402
|
-
color: "success",
|
|
6403
|
-
class: {
|
|
6404
|
-
base: ["text-success-main", "border-transparent", "hover:bg-success-soft"]
|
|
6405
|
-
}
|
|
6406
|
-
},
|
|
6407
|
-
{
|
|
6408
|
-
variant: "ghost",
|
|
6409
|
-
color: "warning",
|
|
6410
|
-
class: {
|
|
6411
|
-
base: ["text-warning-main", "border-transparent", "hover:bg-warning-soft"]
|
|
6412
|
-
}
|
|
6413
|
-
},
|
|
6414
|
-
{
|
|
6415
|
-
variant: "ghost",
|
|
6416
|
-
color: "danger",
|
|
6417
|
-
class: {
|
|
6418
|
-
base: ["text-danger-main", "border-transparent", "hover:bg-danger-soft"]
|
|
6419
|
-
}
|
|
6420
|
-
},
|
|
6421
|
-
// soft/outline + size
|
|
6422
|
-
{
|
|
6423
|
-
variant: ["soft", "outline"],
|
|
6424
|
-
size: "sm",
|
|
6425
|
-
class: {
|
|
6426
|
-
base: ["border-sm"]
|
|
6427
|
-
}
|
|
6428
|
-
},
|
|
6429
|
-
{
|
|
6430
|
-
variant: ["soft", "outline"],
|
|
6431
|
-
size: "md",
|
|
6432
|
-
class: {
|
|
6433
|
-
base: ["border-md"]
|
|
6434
|
-
}
|
|
6435
|
-
},
|
|
6436
|
-
{
|
|
6437
|
-
variant: ["soft", "outline"],
|
|
6438
|
-
size: "lg",
|
|
6439
|
-
class: {
|
|
6440
|
-
base: ["border-lg"]
|
|
6441
|
-
}
|
|
6442
|
-
},
|
|
6443
|
-
{
|
|
6444
|
-
variant: ["soft", "outline"],
|
|
6445
|
-
size: "xl",
|
|
6446
|
-
class: {
|
|
6447
|
-
base: ["border-xl"]
|
|
6448
|
-
}
|
|
6449
|
-
},
|
|
6450
|
-
// disabled + variant
|
|
6451
|
-
{
|
|
6452
|
-
variant: ["soft", "ghost"],
|
|
6453
|
-
disabled: true,
|
|
6454
|
-
class: {
|
|
6455
|
-
base: ["!border-neutral-soft"]
|
|
6456
|
-
}
|
|
6457
|
-
},
|
|
6458
|
-
{
|
|
6459
|
-
variant: ["outline"],
|
|
6460
|
-
disabled: true,
|
|
6461
|
-
class: {
|
|
6462
|
-
base: ["!border-neutral-light"]
|
|
6463
|
-
}
|
|
6464
|
-
}
|
|
6465
|
-
],
|
|
6466
|
-
defaultVariants: {
|
|
6467
|
-
size: "md",
|
|
6468
|
-
variant: "solid",
|
|
6469
|
-
color: "primary",
|
|
6470
|
-
full: false,
|
|
6471
|
-
disabled: false,
|
|
6472
|
-
isLoading: false,
|
|
6473
|
-
isInGroup: false
|
|
6474
|
-
}
|
|
6475
|
-
});
|
|
6476
|
-
|
|
6477
6112
|
// src/components/progress/progress.tsx
|
|
6478
|
-
var
|
|
6113
|
+
var import_react5 = require("react");
|
|
6479
6114
|
|
|
6480
6115
|
// src/hooks/useIsMounted.ts
|
|
6481
|
-
var
|
|
6116
|
+
var import_react4 = require("react");
|
|
6482
6117
|
function useIsMounted(props = {}) {
|
|
6483
6118
|
const { rerender = false, delay = 0 } = props;
|
|
6484
|
-
const isMountedRef = (0,
|
|
6485
|
-
const [isMounted, setIsMounted] = (0,
|
|
6486
|
-
(0,
|
|
6119
|
+
const isMountedRef = (0, import_react4.useRef)(false);
|
|
6120
|
+
const [isMounted, setIsMounted] = (0, import_react4.useState)(false);
|
|
6121
|
+
(0, import_react4.useEffect)(() => {
|
|
6487
6122
|
isMountedRef.current = true;
|
|
6488
6123
|
let timer = null;
|
|
6489
6124
|
if (rerender) {
|
|
@@ -6505,11 +6140,11 @@ function useIsMounted(props = {}) {
|
|
|
6505
6140
|
}
|
|
6506
6141
|
};
|
|
6507
6142
|
}, [rerender]);
|
|
6508
|
-
return [(0,
|
|
6143
|
+
return [(0, import_react4.useCallback)(() => isMountedRef.current, []), isMounted];
|
|
6509
6144
|
}
|
|
6510
6145
|
|
|
6511
6146
|
// src/components/progress/progress.tsx
|
|
6512
|
-
var
|
|
6147
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6513
6148
|
var Progress = (originalProps) => {
|
|
6514
6149
|
const [props, variantProps] = mapPropsVariants(originalProps, progressStyle.variantKeys);
|
|
6515
6150
|
const { children, classNames, value = 0, minValue = 0, maxValue = 100, ...progressProps } = props;
|
|
@@ -6519,12 +6154,12 @@ var Progress = (originalProps) => {
|
|
|
6519
6154
|
delay: 100
|
|
6520
6155
|
});
|
|
6521
6156
|
const selfMounted = variantProps.disableAnimation ? true : isMounted;
|
|
6522
|
-
const percentage = (0,
|
|
6157
|
+
const percentage = (0, import_react5.useMemo)(
|
|
6523
6158
|
() => isIndeterminate || !selfMounted ? void 0 : clampPercentage((value - minValue) / (maxValue - minValue) * 100),
|
|
6524
6159
|
[selfMounted, isIndeterminate, value, minValue, maxValue]
|
|
6525
6160
|
);
|
|
6526
|
-
const slots = (0,
|
|
6527
|
-
return /* @__PURE__ */ (0,
|
|
6161
|
+
const slots = (0, import_react5.useMemo)(() => progressStyle({ ...variantProps }), [variantProps]);
|
|
6162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: slots.track({ class: classNames == null ? void 0 : classNames.track }), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
6528
6163
|
"div",
|
|
6529
6164
|
{
|
|
6530
6165
|
className: slots.indicator({ class: classNames == null ? void 0 : classNames.indicator }),
|
|
@@ -6623,9 +6258,10 @@ var clampPercentage = (value) => {
|
|
|
6623
6258
|
};
|
|
6624
6259
|
|
|
6625
6260
|
// src/components/fileUpload/fileUpload.tsx
|
|
6626
|
-
var
|
|
6261
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
6627
6262
|
function FileUpload({
|
|
6628
6263
|
buttonText,
|
|
6264
|
+
cancelText,
|
|
6629
6265
|
maxSizeMB = 10,
|
|
6630
6266
|
placeholder,
|
|
6631
6267
|
errorMessage,
|
|
@@ -6640,14 +6276,14 @@ function FileUpload({
|
|
|
6640
6276
|
classNames,
|
|
6641
6277
|
defaultFile
|
|
6642
6278
|
}) {
|
|
6643
|
-
const fileInputRef = (0,
|
|
6644
|
-
const uploadIntervalRef = (0,
|
|
6645
|
-
const [currentFile, setCurrentFile] = (0,
|
|
6646
|
-
const [uploadProgress, setUploadProgress] = (0,
|
|
6647
|
-
const [message, setMessage] = (0,
|
|
6648
|
-
const [displayFileName, setDisplayFileName] = (0,
|
|
6649
|
-
const [hasUploadedFile, setHasUploadedFile] = (0,
|
|
6650
|
-
const [isUploading, setIsUploading] = (0,
|
|
6279
|
+
const fileInputRef = (0, import_react6.useRef)(null);
|
|
6280
|
+
const uploadIntervalRef = (0, import_react6.useRef)(null);
|
|
6281
|
+
const [currentFile, setCurrentFile] = (0, import_react6.useState)(null);
|
|
6282
|
+
const [uploadProgress, setUploadProgress] = (0, import_react6.useState)(0);
|
|
6283
|
+
const [message, setMessage] = (0, import_react6.useState)(errorMessage);
|
|
6284
|
+
const [displayFileName, setDisplayFileName] = (0, import_react6.useState)(() => (defaultFile == null ? void 0 : defaultFile.name) || "");
|
|
6285
|
+
const [hasUploadedFile, setHasUploadedFile] = (0, import_react6.useState)(false);
|
|
6286
|
+
const [isUploading, setIsUploading] = (0, import_react6.useState)(false);
|
|
6651
6287
|
const slots = fileUploadStyle();
|
|
6652
6288
|
const handleButtonClick = () => {
|
|
6653
6289
|
var _a;
|
|
@@ -6714,67 +6350,45 @@ function FileUpload({
|
|
|
6714
6350
|
}
|
|
6715
6351
|
if (onCancelUpload) onCancelUpload();
|
|
6716
6352
|
};
|
|
6717
|
-
(0,
|
|
6353
|
+
(0, import_react6.useEffect)(() => {
|
|
6718
6354
|
return () => {
|
|
6719
6355
|
if (uploadIntervalRef.current) {
|
|
6720
6356
|
clearInterval(uploadIntervalRef.current);
|
|
6721
6357
|
}
|
|
6722
6358
|
};
|
|
6723
6359
|
}, []);
|
|
6724
|
-
(0,
|
|
6360
|
+
(0, import_react6.useEffect)(() => {
|
|
6725
6361
|
if (errorMessage !== void 0) {
|
|
6726
6362
|
setMessage(errorMessage);
|
|
6727
6363
|
}
|
|
6728
6364
|
}, [errorMessage]);
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
6734
|
-
input_default,
|
|
6735
|
-
{
|
|
6736
|
-
name,
|
|
6737
|
-
readOnly: true,
|
|
6738
|
-
variant: "outline",
|
|
6739
|
-
full: true,
|
|
6740
|
-
placeholder,
|
|
6741
|
-
value: displayFileName,
|
|
6742
|
-
errorMessage: message && (message == null ? void 0 : message.length) > 0 ? message : void 0
|
|
6743
|
-
}
|
|
6744
|
-
),
|
|
6745
|
-
shouldShowCloseButton && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
6746
|
-
icon_button_default,
|
|
6747
|
-
{
|
|
6748
|
-
name: "close",
|
|
6749
|
-
size: "sm",
|
|
6750
|
-
variant: "ghost",
|
|
6751
|
-
color: "neutral",
|
|
6752
|
-
onClick: handleCancelUpload,
|
|
6753
|
-
classNames: { base: slots.cancelButton() },
|
|
6754
|
-
"aria-label": "cancel"
|
|
6755
|
-
}
|
|
6756
|
-
)
|
|
6757
|
-
] }),
|
|
6758
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
6759
|
-
button_default,
|
|
6365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: slots.container({ class: classNames == null ? void 0 : classNames.container }), children: [
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: slots.inputWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6368
|
+
input_default,
|
|
6760
6369
|
{
|
|
6761
|
-
|
|
6370
|
+
name,
|
|
6371
|
+
readOnly: true,
|
|
6762
6372
|
variant: "outline",
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6373
|
+
full: true,
|
|
6374
|
+
placeholder,
|
|
6375
|
+
value: displayFileName,
|
|
6376
|
+
errorMessage: message && (message == null ? void 0 : message.length) > 0 ? message : void 0
|
|
6767
6377
|
}
|
|
6768
|
-
),
|
|
6769
|
-
/* @__PURE__ */ (0,
|
|
6378
|
+
) }),
|
|
6379
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
6380
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(button_default, { type: "button", variant: "outline", onClick: handleButtonClick, isLoading: isUploading, children: buttonText }),
|
|
6381
|
+
cancelText && hasUploadedFile && !isUploading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(button_default, { type: "button", variant: "soft", color: "danger", onClick: handleCancelUpload, children: cancelText })
|
|
6382
|
+
] }),
|
|
6383
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { ref: fileInputRef, type: "file", hidden: true, accept: accept.join(","), onChange: handleFileChange })
|
|
6770
6384
|
] }),
|
|
6771
|
-
showProgress && currentFile && hasUploadedFile && uploadProgress < 100 && /* @__PURE__ */ (0,
|
|
6772
|
-
!message && helperMessage && /* @__PURE__ */ (0,
|
|
6385
|
+
showProgress && currentFile && hasUploadedFile && uploadProgress < 100 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(progress_default, { value: uploadProgress }),
|
|
6386
|
+
!message && helperMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: slots.helperMessage(), children: helperMessage })
|
|
6773
6387
|
] });
|
|
6774
6388
|
}
|
|
6775
6389
|
FileUpload.displayName = "FileUpload";
|
|
6776
6390
|
var fileUpload_default = FileUpload;
|
|
6777
|
-
var fileUploadStyle = (0,
|
|
6391
|
+
var fileUploadStyle = (0, import_tailwind_variants5.tv)({
|
|
6778
6392
|
slots: {
|
|
6779
6393
|
base: ["flex", "flex-col", "gap-[5px]"],
|
|
6780
6394
|
container: ["flex", "gap-[10px]"],
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
datePickerStyle,
|
|
4
4
|
datePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-FWFEKWWD.mjs";
|
|
5
|
+
} from "../../chunk-2A3APCWC.mjs";
|
|
7
6
|
import "../../chunk-XZYQFBCT.mjs";
|
|
7
|
+
import "../../chunk-FWFEKWWD.mjs";
|
|
8
8
|
import "../../chunk-2GCSFWHD.mjs";
|
|
9
9
|
import "../../chunk-ONBPPSS2.mjs";
|
|
10
10
|
import "../../chunk-MY5U63QO.mjs";
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import "../../chunk-4VWG4726.mjs";
|
|
3
3
|
import {
|
|
4
4
|
datePicker_default
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-FWFEKWWD.mjs";
|
|
5
|
+
} from "../../chunk-2A3APCWC.mjs";
|
|
7
6
|
import {
|
|
8
7
|
day_default
|
|
9
8
|
} from "../../chunk-XZYQFBCT.mjs";
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
} from "../../chunk-ESTRSTMW.mjs";
|
|
13
12
|
import "../../chunk-QCEKPS7U.mjs";
|
|
14
13
|
import "../../chunk-SJUM4XSW.mjs";
|
|
14
|
+
import "../../chunk-FWFEKWWD.mjs";
|
|
15
15
|
import "../../chunk-2GCSFWHD.mjs";
|
|
16
16
|
import "../../chunk-ONBPPSS2.mjs";
|
|
17
17
|
import "../../chunk-MY5U63QO.mjs";
|
|
@@ -3,11 +3,11 @@ import "../../chunk-LUWGOKLG.mjs";
|
|
|
3
3
|
import {
|
|
4
4
|
ToastProvider,
|
|
5
5
|
useToast
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-B2TLDEF4.mjs";
|
|
7
|
+
import "../../chunk-ZOTHPHXA.mjs";
|
|
7
8
|
import {
|
|
8
9
|
toast_default
|
|
9
10
|
} from "../../chunk-EYLKPAI5.mjs";
|
|
10
|
-
import "../../chunk-ZOTHPHXA.mjs";
|
|
11
11
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
12
12
|
import "../../chunk-4GZGDIYK.mjs";
|
|
13
13
|
import "../../chunk-E3G5QXSH.mjs";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ToastProvider,
|
|
4
4
|
useToast
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-EYLKPAI5.mjs";
|
|
5
|
+
} from "../../chunk-B2TLDEF4.mjs";
|
|
7
6
|
import "../../chunk-ZOTHPHXA.mjs";
|
|
7
|
+
import "../../chunk-EYLKPAI5.mjs";
|
|
8
8
|
import "../../chunk-ZYIIXWVY.mjs";
|
|
9
9
|
import "../../chunk-4GZGDIYK.mjs";
|
|
10
10
|
import "../../chunk-E3G5QXSH.mjs";
|