@deepnoid/ui 0.1.182 → 0.1.184
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 +176 -176
- package/dist/{chunk-SX2FQY4L.mjs → chunk-2H5EBNCD.mjs} +4 -4
- package/dist/{chunk-XZTVXEOD.mjs → chunk-7C7RHDHV.mjs} +4 -4
- package/dist/{chunk-KDBM7UVG.mjs → chunk-GG7QANQF.mjs} +1 -1
- package/dist/{chunk-M5ZLURXE.mjs → chunk-K6AKMFZH.mjs} +5 -5
- package/dist/{chunk-YTW5HJJH.mjs → chunk-LZRLIXM6.mjs} +120 -37
- package/dist/{chunk-W67QZ4OB.mjs → chunk-MU6QDNYC.mjs} +1 -1
- package/dist/{chunk-GPJVGQ5W.mjs → chunk-NPVMCUZ4.mjs} +2 -2
- package/dist/{chunk-6NO7GQHG.mjs → chunk-ROXKJQSJ.mjs} +3 -3
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +4 -4
- package/dist/components/breadcrumb/index.mjs +4 -4
- package/dist/components/button/button.mjs +1 -1
- package/dist/components/button/icon-button.mjs +1 -1
- package/dist/components/button/index.mjs +3 -3
- package/dist/components/button/text-button.mjs +2 -2
- package/dist/components/charts/areaChart.mjs +1 -1
- package/dist/components/charts/index.mjs +1 -1
- package/dist/components/checkbox/checkbox.mjs +2 -2
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/chip/chip.mjs +1 -1
- package/dist/components/chip/index.mjs +1 -1
- package/dist/components/drawer/drawer.mjs +2 -2
- package/dist/components/drawer/index.mjs +2 -2
- package/dist/components/fileUpload/fileUpload.mjs +6 -6
- package/dist/components/fileUpload/index.mjs +6 -6
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/index.mjs +5 -5
- package/dist/components/modal/modal.mjs +5 -5
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/picker/datePicker.mjs +6 -6
- package/dist/components/picker/index.mjs +8 -8
- package/dist/components/picker/timePicker.mjs +4 -4
- package/dist/components/progress/index.mjs +2 -2
- package/dist/components/progress/progress.mjs +2 -2
- package/dist/components/radio/index.mjs +2 -2
- package/dist/components/radio/radio.mjs +2 -2
- package/dist/components/select/index.mjs +3 -3
- package/dist/components/select/select.mjs +3 -3
- package/dist/components/starRating/index.mjs +1 -1
- package/dist/components/starRating/starRating.mjs +1 -1
- package/dist/components/table/definition-table.mjs +2 -2
- package/dist/components/table/index.js +149 -66
- package/dist/components/table/index.mjs +9 -9
- package/dist/components/table/table-body.js +145 -62
- package/dist/components/table/table-body.mjs +6 -6
- package/dist/components/table/table-head.js +113 -32
- package/dist/components/table/table-head.mjs +6 -6
- package/dist/components/table/table.js +145 -62
- package/dist/components/table/table.mjs +6 -6
- package/dist/components/textarea/index.mjs +2 -2
- package/dist/components/textarea/textarea.mjs +2 -2
- package/dist/components/timePicker/calendar.mjs +1 -1
- package/dist/components/toast/index.mjs +5 -5
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tree/index.mjs +2 -2
- package/dist/components/tree/tree.mjs +2 -2
- package/dist/index.js +327 -244
- package/dist/index.mjs +54 -54
- package/package.json +1 -1
- package/dist/{chunk-3HXNAVAN.mjs → chunk-3CRSSRCH.mjs} +3 -3
- package/dist/{chunk-ZFC5O2V3.mjs → chunk-45Y7ANPK.mjs} +3 -3
- package/dist/{chunk-LE7PGMCV.mjs → chunk-4EELFA6L.mjs} +3 -3
- package/dist/{chunk-NDNIAALB.mjs → chunk-4LUASWAN.mjs} +3 -3
- package/dist/{chunk-UINFH5AT.mjs → chunk-A3WPBLOW.mjs} +3 -3
- package/dist/{chunk-BH3I4LIZ.mjs → chunk-DS5CGU2X.mjs} +3 -3
- package/dist/{chunk-GVTYOGSV.mjs → chunk-GS5X67UB.mjs} +3 -3
- package/dist/{chunk-4X35QQTI.mjs → chunk-IH3BJRTV.mjs} +3 -3
- package/dist/{chunk-ACZ3DQVT.mjs → chunk-KH63CD55.mjs} +3 -3
- package/dist/{chunk-NKF2TQMA.mjs → chunk-MWUA62VL.mjs} +3 -3
- package/dist/{chunk-3DCUMRYP.mjs → chunk-OEIEALIP.mjs} +3 -3
- package/dist/{chunk-XL6LZDT4.mjs → chunk-PRNE3U26.mjs} +3 -3
- package/dist/{chunk-7H6U5XJA.mjs → chunk-RXDRG6MC.mjs} +3 -3
package/dist/index.js
CHANGED
|
@@ -7921,9 +7921,12 @@ var textareaStyle = (0, import_tailwind_variants13.tv)({
|
|
|
7921
7921
|
});
|
|
7922
7922
|
|
|
7923
7923
|
// src/components/table/table.tsx
|
|
7924
|
-
var
|
|
7924
|
+
var import_react19 = require("react");
|
|
7925
7925
|
var import_tailwind_variants17 = require("tailwind-variants");
|
|
7926
7926
|
|
|
7927
|
+
// src/components/table/table-head.tsx
|
|
7928
|
+
var import_react15 = require("react");
|
|
7929
|
+
|
|
7927
7930
|
// src/components/checkbox/checkbox.tsx
|
|
7928
7931
|
var import_react14 = require("react");
|
|
7929
7932
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -8133,20 +8136,51 @@ var checkboxStyle = tv({
|
|
|
8133
8136
|
|
|
8134
8137
|
// src/components/table/table-head.tsx
|
|
8135
8138
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8136
|
-
|
|
8139
|
+
function TableHeaderCell({
|
|
8140
|
+
content,
|
|
8141
|
+
column,
|
|
8142
|
+
isCheckbox = false,
|
|
8137
8143
|
slots,
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
}
|
|
8146
|
-
|
|
8144
|
+
classNames
|
|
8145
|
+
}) {
|
|
8146
|
+
const thRef = (0, import_react15.useRef)(null);
|
|
8147
|
+
const [showTitle, setShowTitle] = (0, import_react15.useState)(false);
|
|
8148
|
+
const checkOverflow = (el) => {
|
|
8149
|
+
if (el.scrollWidth > el.clientWidth) {
|
|
8150
|
+
return true;
|
|
8151
|
+
}
|
|
8152
|
+
const children = Array.from(el.children);
|
|
8153
|
+
for (const child of children) {
|
|
8154
|
+
if (child.scrollWidth > child.clientWidth) {
|
|
8155
|
+
return true;
|
|
8156
|
+
}
|
|
8157
|
+
}
|
|
8158
|
+
return false;
|
|
8159
|
+
};
|
|
8160
|
+
const extractTextFromContent = (node) => {
|
|
8161
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
8162
|
+
return String(node);
|
|
8163
|
+
}
|
|
8164
|
+
if ((0, import_react15.isValidElement)(node)) {
|
|
8165
|
+
return String(node.props.children || "");
|
|
8166
|
+
}
|
|
8167
|
+
return "";
|
|
8168
|
+
};
|
|
8169
|
+
(0, import_react15.useEffect)(() => {
|
|
8170
|
+
if (thRef.current && !isCheckbox) {
|
|
8171
|
+
setTimeout(() => {
|
|
8172
|
+
if (thRef.current) {
|
|
8173
|
+
setShowTitle(checkOverflow(thRef.current));
|
|
8174
|
+
}
|
|
8175
|
+
}, 0);
|
|
8176
|
+
}
|
|
8177
|
+
}, [content, isCheckbox]);
|
|
8178
|
+
const titleText = !isCheckbox && showTitle ? extractTextFromContent(content) : void 0;
|
|
8179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8147
8180
|
"th",
|
|
8148
8181
|
{
|
|
8149
|
-
|
|
8182
|
+
ref: thRef,
|
|
8183
|
+
className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column == null ? void 0 : column.className, !isCheckbox && "truncate"),
|
|
8150
8184
|
style: isCheckbox ? {
|
|
8151
8185
|
width: "40px",
|
|
8152
8186
|
minWidth: "40px",
|
|
@@ -8155,31 +8189,55 @@ var TableHead = ({
|
|
|
8155
8189
|
flexGrow: 0,
|
|
8156
8190
|
boxSizing: "border-box"
|
|
8157
8191
|
} : column ? { ...getCellStyle(column), textAlign: "center" } : void 0,
|
|
8192
|
+
title: titleText,
|
|
8158
8193
|
children: content
|
|
8159
|
-
}
|
|
8160
|
-
key
|
|
8194
|
+
}
|
|
8161
8195
|
);
|
|
8196
|
+
}
|
|
8197
|
+
var TableHead = ({
|
|
8198
|
+
slots,
|
|
8199
|
+
columns,
|
|
8200
|
+
color,
|
|
8201
|
+
size,
|
|
8202
|
+
rowCheckbox = false,
|
|
8203
|
+
hasCheckedRows,
|
|
8204
|
+
classNames,
|
|
8205
|
+
onCheckAll
|
|
8206
|
+
}) => {
|
|
8162
8207
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
8163
|
-
columns.map((column, idx) =>
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8208
|
+
columns.map((column, idx) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8209
|
+
TableHeaderCell,
|
|
8210
|
+
{
|
|
8211
|
+
content: column.headerName,
|
|
8212
|
+
column,
|
|
8213
|
+
slots,
|
|
8214
|
+
classNames
|
|
8215
|
+
},
|
|
8216
|
+
`${column.field}-${idx}`
|
|
8217
|
+
)),
|
|
8218
|
+
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8219
|
+
TableHeaderCell,
|
|
8220
|
+
{
|
|
8221
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { "data-checkbox": true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
8222
|
+
checkbox_default,
|
|
8223
|
+
{
|
|
8224
|
+
size,
|
|
8225
|
+
checked: hasCheckedRows,
|
|
8226
|
+
onChange: (e) => onCheckAll(e.target.checked)
|
|
8227
|
+
}
|
|
8228
|
+
) }),
|
|
8229
|
+
isCheckbox: true,
|
|
8230
|
+
slots,
|
|
8231
|
+
classNames
|
|
8232
|
+
},
|
|
8233
|
+
"checkbox"
|
|
8176
8234
|
)
|
|
8177
8235
|
] }) });
|
|
8178
8236
|
};
|
|
8179
8237
|
var table_head_default = TableHead;
|
|
8180
8238
|
|
|
8181
8239
|
// src/components/table/table-body.tsx
|
|
8182
|
-
var
|
|
8240
|
+
var import_react16 = require("react");
|
|
8183
8241
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
8184
8242
|
function TableCell({
|
|
8185
8243
|
row,
|
|
@@ -8189,25 +8247,50 @@ function TableCell({
|
|
|
8189
8247
|
slots,
|
|
8190
8248
|
classNames
|
|
8191
8249
|
}) {
|
|
8192
|
-
var _a;
|
|
8250
|
+
var _a, _b;
|
|
8193
8251
|
const value = row[column.field];
|
|
8194
8252
|
const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
|
|
8195
8253
|
const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
|
|
8196
|
-
const tdRef = (0,
|
|
8197
|
-
const [showTitle, setShowTitle] = (0,
|
|
8198
|
-
const checkOverflow = (el) =>
|
|
8199
|
-
|
|
8254
|
+
const tdRef = (0, import_react16.useRef)(null);
|
|
8255
|
+
const [showTitle, setShowTitle] = (0, import_react16.useState)(false);
|
|
8256
|
+
const checkOverflow = (el) => {
|
|
8257
|
+
if (el.scrollWidth > el.clientWidth) {
|
|
8258
|
+
return true;
|
|
8259
|
+
}
|
|
8260
|
+
const children = Array.from(el.children);
|
|
8261
|
+
for (const child of children) {
|
|
8262
|
+
if (child.scrollWidth > child.clientWidth) {
|
|
8263
|
+
return true;
|
|
8264
|
+
}
|
|
8265
|
+
}
|
|
8266
|
+
return false;
|
|
8267
|
+
};
|
|
8268
|
+
(0, import_react16.useEffect)(() => {
|
|
8200
8269
|
if (tdRef.current) {
|
|
8201
|
-
|
|
8270
|
+
setTimeout(() => {
|
|
8271
|
+
if (tdRef.current) {
|
|
8272
|
+
setShowTitle(checkOverflow(tdRef.current));
|
|
8273
|
+
}
|
|
8274
|
+
}, 0);
|
|
8202
8275
|
}
|
|
8203
8276
|
}, [content]);
|
|
8204
8277
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
8205
8278
|
"td",
|
|
8206
8279
|
{
|
|
8207
8280
|
ref: tdRef,
|
|
8208
|
-
className: clsx(
|
|
8209
|
-
|
|
8210
|
-
|
|
8281
|
+
className: clsx(
|
|
8282
|
+
slots.td(),
|
|
8283
|
+
classNames == null ? void 0 : classNames.td,
|
|
8284
|
+
column.className,
|
|
8285
|
+
"truncate",
|
|
8286
|
+
"[&>*]:inline-block [&>*]:max-w-full [&>*]:truncate"
|
|
8287
|
+
),
|
|
8288
|
+
style: {
|
|
8289
|
+
...getCellStyle(column),
|
|
8290
|
+
maxWidth: column.width || "150px",
|
|
8291
|
+
textAlign: column.align || "center"
|
|
8292
|
+
},
|
|
8293
|
+
title: showTitle ? String(((_b = value == null ? void 0 : value.props) == null ? void 0 : _b.children) || content || "") : void 0,
|
|
8211
8294
|
children: content
|
|
8212
8295
|
},
|
|
8213
8296
|
`${row.id}-${column.field}-${colIdx}-${rowIndex}`
|
|
@@ -8277,18 +8360,18 @@ var TableBody = ({
|
|
|
8277
8360
|
var table_body_default = TableBody;
|
|
8278
8361
|
|
|
8279
8362
|
// src/components/pagination/pagination.tsx
|
|
8280
|
-
var
|
|
8363
|
+
var import_react18 = require("react");
|
|
8281
8364
|
|
|
8282
8365
|
// src/components/pagination/usePagination.ts
|
|
8283
|
-
var
|
|
8366
|
+
var import_react17 = require("react");
|
|
8284
8367
|
var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) => {
|
|
8285
|
-
const startPage = (0,
|
|
8286
|
-
const endPage = (0,
|
|
8287
|
-
const pageList = (0,
|
|
8368
|
+
const startPage = (0, import_react17.useMemo)(() => Math.floor((currentPage - 1) / groupSize) * groupSize + 1, [currentPage, groupSize]);
|
|
8369
|
+
const endPage = (0, import_react17.useMemo)(() => Math.min(startPage + groupSize - 1, totalPage), [startPage, groupSize, totalPage]);
|
|
8370
|
+
const pageList = (0, import_react17.useMemo)(
|
|
8288
8371
|
() => Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i),
|
|
8289
8372
|
[startPage, endPage]
|
|
8290
8373
|
);
|
|
8291
|
-
const handleClickMovePage = (0,
|
|
8374
|
+
const handleClickMovePage = (0, import_react17.useCallback)(
|
|
8292
8375
|
(page) => (event) => {
|
|
8293
8376
|
event.preventDefault();
|
|
8294
8377
|
handleChangePage == null ? void 0 : handleChangePage(page);
|
|
@@ -8306,7 +8389,7 @@ var usePagination_default = usePagination;
|
|
|
8306
8389
|
|
|
8307
8390
|
// src/components/pagination/pagination.tsx
|
|
8308
8391
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
8309
|
-
var Pagination = (0,
|
|
8392
|
+
var Pagination = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
8310
8393
|
const [props, variantProps] = mapPropsVariants(originalProps, paginationStyle.variantKeys);
|
|
8311
8394
|
const {
|
|
8312
8395
|
classNames,
|
|
@@ -8320,12 +8403,12 @@ var Pagination = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
8320
8403
|
variant,
|
|
8321
8404
|
size
|
|
8322
8405
|
} = { ...props, ...variantProps };
|
|
8323
|
-
const [inputPage, setInputPage] = (0,
|
|
8406
|
+
const [inputPage, setInputPage] = (0, import_react18.useState)(currentPage);
|
|
8324
8407
|
const isFirstPageDisabled = currentPage <= 1;
|
|
8325
8408
|
const isPrevPageDisabled = currentPage <= 1;
|
|
8326
8409
|
const isNextPageDisabled = currentPage >= totalPage;
|
|
8327
8410
|
const isLastPageDisabled = currentPage >= totalPage;
|
|
8328
|
-
const slots = (0,
|
|
8411
|
+
const slots = (0, import_react18.useMemo)(() => paginationStyle(variantProps), [variantProps]);
|
|
8329
8412
|
const { pageList, handleClickMovePage } = usePagination_default({
|
|
8330
8413
|
currentPage,
|
|
8331
8414
|
totalPage,
|
|
@@ -8693,7 +8776,7 @@ var scrollAreaStyle = (0, import_tailwind_variants16.tv)({
|
|
|
8693
8776
|
|
|
8694
8777
|
// src/components/table/table.tsx
|
|
8695
8778
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
8696
|
-
var Table = (0,
|
|
8779
|
+
var Table = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
8697
8780
|
const [props, variantProps] = mapPropsVariants(originalProps, tableStyle.variantKeys);
|
|
8698
8781
|
const {
|
|
8699
8782
|
rows,
|
|
@@ -8718,8 +8801,8 @@ var Table = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8718
8801
|
} = { ...props, ...variantProps };
|
|
8719
8802
|
const { page = 1, perPage = 15 } = pagination || {};
|
|
8720
8803
|
const showPagination = pagination && totalData > 0;
|
|
8721
|
-
const [checkedRowIds, setCheckedRowIds] = (0,
|
|
8722
|
-
const tableMinWidth = (0,
|
|
8804
|
+
const [checkedRowIds, setCheckedRowIds] = (0, import_react19.useState)(new Set(checkedRows == null ? void 0 : checkedRows.map((row) => row.id)));
|
|
8805
|
+
const tableMinWidth = (0, import_react19.useMemo)(() => {
|
|
8723
8806
|
const columnsWidth = columns.reduce((total, column) => {
|
|
8724
8807
|
if (column.width) return total + column.width;
|
|
8725
8808
|
if (column.minWidth) return total + column.minWidth;
|
|
@@ -8728,10 +8811,10 @@ var Table = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8728
8811
|
const checkboxWidth = rowCheckbox ? 40 : 0;
|
|
8729
8812
|
return columnsWidth + checkboxWidth;
|
|
8730
8813
|
}, [columns, rowCheckbox]);
|
|
8731
|
-
(0,
|
|
8814
|
+
(0, import_react19.useEffect)(() => {
|
|
8732
8815
|
onCheckedRowsChange == null ? void 0 : onCheckedRowsChange(getCheckedRowData(checkedRowIds));
|
|
8733
8816
|
}, [checkedRowIds]);
|
|
8734
|
-
(0,
|
|
8817
|
+
(0, import_react19.useEffect)(() => {
|
|
8735
8818
|
const currentRowIds = new Set(rows.map((row) => row.id));
|
|
8736
8819
|
const ids = Array.from(checkedRowIds);
|
|
8737
8820
|
const hasValidCheckedRows = ids.every((id) => currentRowIds.has(id));
|
|
@@ -8739,7 +8822,7 @@ var Table = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8739
8822
|
setCheckedRowIds(new Set(checkedRows == null ? void 0 : checkedRows.map((row) => row.id)));
|
|
8740
8823
|
}
|
|
8741
8824
|
}, [rows.map((row) => row.id).join(",")]);
|
|
8742
|
-
(0,
|
|
8825
|
+
(0, import_react19.useImperativeHandle)(
|
|
8743
8826
|
ref,
|
|
8744
8827
|
() => ({
|
|
8745
8828
|
checkedRowIds,
|
|
@@ -8766,7 +8849,7 @@ var Table = (0, import_react18.forwardRef)((originalProps, ref) => {
|
|
|
8766
8849
|
onRowClick == null ? void 0 : onRowClick(row, index, event);
|
|
8767
8850
|
};
|
|
8768
8851
|
const getCheckedRowData = (checked) => rows.filter((row) => checked.has(row.id));
|
|
8769
|
-
const slots = (0,
|
|
8852
|
+
const slots = (0, import_react19.useMemo)(
|
|
8770
8853
|
() => tableStyle({ ...variantProps, rowClickable: typeof onRowClick === "function" }),
|
|
8771
8854
|
[variantProps, onRowClick]
|
|
8772
8855
|
);
|
|
@@ -9085,7 +9168,7 @@ var getCellStyle = (column) => {
|
|
|
9085
9168
|
};
|
|
9086
9169
|
|
|
9087
9170
|
// src/components/table/definition-table.tsx
|
|
9088
|
-
var
|
|
9171
|
+
var import_react20 = require("react");
|
|
9089
9172
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
9090
9173
|
var DEFAULT_CELL_CLASSES = "px-[10px] py-[8px] text-md border-r border-neutral-light h-[50px]";
|
|
9091
9174
|
var FIRST_CELL_WIDTH_CLASS = "w-[120px] font-bold text-md text-body-foreground";
|
|
@@ -9178,10 +9261,10 @@ var DefinitionTableRow = ({
|
|
|
9178
9261
|
colIndex
|
|
9179
9262
|
);
|
|
9180
9263
|
}) });
|
|
9181
|
-
var DefinitionTable = (0,
|
|
9264
|
+
var DefinitionTable = (0, import_react20.forwardRef)(
|
|
9182
9265
|
({ rows = [], footer, highlightColumnKey, classNames }, ref) => {
|
|
9183
|
-
const slots = (0,
|
|
9184
|
-
const highlightColumnIndex = (0,
|
|
9266
|
+
const slots = (0, import_react20.useMemo)(() => DefinitionTableStyle(), []);
|
|
9267
|
+
const highlightColumnIndex = (0, import_react20.useMemo)(
|
|
9185
9268
|
() => getHighlightColumnIndex(rows, highlightColumnKey),
|
|
9186
9269
|
[rows, highlightColumnKey]
|
|
9187
9270
|
);
|
|
@@ -9214,10 +9297,10 @@ var DefinitionTableStyle = tv({
|
|
|
9214
9297
|
});
|
|
9215
9298
|
|
|
9216
9299
|
// src/components/select/select.tsx
|
|
9217
|
-
var
|
|
9300
|
+
var import_react21 = require("react");
|
|
9218
9301
|
var import_react_dom = require("react-dom");
|
|
9219
9302
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
9220
|
-
var Select = (0,
|
|
9303
|
+
var Select = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
9221
9304
|
var _a, _b;
|
|
9222
9305
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
9223
9306
|
const {
|
|
@@ -9234,14 +9317,14 @@ var Select = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
|
9234
9317
|
optionIconPlacement,
|
|
9235
9318
|
...inputProps
|
|
9236
9319
|
} = props;
|
|
9237
|
-
const slots = (0,
|
|
9238
|
-
const [selectedOptions, setSelectedOptions] = (0,
|
|
9239
|
-
const [targetRect, setTargetRect] = (0,
|
|
9240
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0,
|
|
9241
|
-
const [isVisible, setIsVisible] = (0,
|
|
9242
|
-
const [isOpen, setIsOpen] = (0,
|
|
9243
|
-
const selectWrapperRef = (0,
|
|
9244
|
-
const optionWrapperRef = (0,
|
|
9320
|
+
const slots = (0, import_react21.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
9321
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react21.useState)(defaultSelectedOptions || []);
|
|
9322
|
+
const [targetRect, setTargetRect] = (0, import_react21.useState)(null);
|
|
9323
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react21.useState)(0);
|
|
9324
|
+
const [isVisible, setIsVisible] = (0, import_react21.useState)(false);
|
|
9325
|
+
const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
|
|
9326
|
+
const selectWrapperRef = (0, import_react21.useRef)(null);
|
|
9327
|
+
const optionWrapperRef = (0, import_react21.useRef)(null);
|
|
9245
9328
|
const isControlled = originalProps.value !== void 0;
|
|
9246
9329
|
const openSelect = () => {
|
|
9247
9330
|
if (selectWrapperRef.current) {
|
|
@@ -9281,7 +9364,7 @@ var Select = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
|
9281
9364
|
setSelectedOptions(nextOptions);
|
|
9282
9365
|
onChange == null ? void 0 : onChange(nextOptions);
|
|
9283
9366
|
};
|
|
9284
|
-
(0,
|
|
9367
|
+
(0, import_react21.useEffect)(() => {
|
|
9285
9368
|
const handleClickOutside = (e) => {
|
|
9286
9369
|
var _a2;
|
|
9287
9370
|
const target = e.target;
|
|
@@ -9292,12 +9375,12 @@ var Select = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
|
9292
9375
|
window.addEventListener("mousedown", handleClickOutside);
|
|
9293
9376
|
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
9294
9377
|
}, []);
|
|
9295
|
-
(0,
|
|
9378
|
+
(0, import_react21.useEffect)(() => {
|
|
9296
9379
|
if (optionWrapperRef.current) {
|
|
9297
9380
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
9298
9381
|
}
|
|
9299
9382
|
}, [targetRect]);
|
|
9300
|
-
(0,
|
|
9383
|
+
(0, import_react21.useEffect)(() => {
|
|
9301
9384
|
if (isControlled) {
|
|
9302
9385
|
const valueArray = Array.isArray(originalProps.value) ? originalProps.value : [originalProps.value];
|
|
9303
9386
|
const matched = options.filter((opt) => valueArray.includes(opt.value));
|
|
@@ -9667,14 +9750,14 @@ var select = tv({
|
|
|
9667
9750
|
});
|
|
9668
9751
|
|
|
9669
9752
|
// src/components/chip/chip.tsx
|
|
9670
|
-
var
|
|
9753
|
+
var import_react22 = require("react");
|
|
9671
9754
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
9672
|
-
var Chip = (0,
|
|
9755
|
+
var Chip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
9673
9756
|
var _a;
|
|
9674
9757
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
9675
9758
|
const props = { ...rawProps, ...variantProps };
|
|
9676
9759
|
const Component = props.onClick ? "button" : "div";
|
|
9677
|
-
const slots = (0,
|
|
9760
|
+
const slots = (0, import_react22.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
9678
9761
|
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
9679
9762
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
9680
9763
|
Component,
|
|
@@ -9852,12 +9935,12 @@ var chipStyle = tv({
|
|
|
9852
9935
|
});
|
|
9853
9936
|
|
|
9854
9937
|
// src/components/radio/radio.tsx
|
|
9855
|
-
var
|
|
9938
|
+
var import_react23 = require("react");
|
|
9856
9939
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
9857
|
-
var Radio = (0,
|
|
9940
|
+
var Radio = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
9858
9941
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
9859
9942
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
9860
|
-
const slots = (0,
|
|
9943
|
+
const slots = (0, import_react23.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
9861
9944
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
9862
9945
|
"label",
|
|
9863
9946
|
{
|
|
@@ -10022,16 +10105,16 @@ var radioStyle = tv({
|
|
|
10022
10105
|
});
|
|
10023
10106
|
|
|
10024
10107
|
// src/components/switch/switch.tsx
|
|
10025
|
-
var
|
|
10108
|
+
var import_react24 = require("react");
|
|
10026
10109
|
var import_tailwind_variants22 = require("tailwind-variants");
|
|
10027
10110
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
10028
|
-
var Switch = (0,
|
|
10111
|
+
var Switch = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
10029
10112
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
10030
10113
|
const { size, color, disabled, disableAnimation, id, checked, onChange, classNames, ...inputProps } = {
|
|
10031
10114
|
...rawProps,
|
|
10032
10115
|
...variantProps
|
|
10033
10116
|
};
|
|
10034
|
-
const slots = (0,
|
|
10117
|
+
const slots = (0, import_react24.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
10035
10118
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
10036
10119
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
10037
10120
|
"input",
|
|
@@ -10156,7 +10239,7 @@ var switchStyle = (0, import_tailwind_variants22.tv)({
|
|
|
10156
10239
|
});
|
|
10157
10240
|
|
|
10158
10241
|
// src/components/tooltip/tooltip.tsx
|
|
10159
|
-
var
|
|
10242
|
+
var import_react26 = require("react");
|
|
10160
10243
|
var import_react_dom2 = require("react-dom");
|
|
10161
10244
|
|
|
10162
10245
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -10279,11 +10362,11 @@ var getTailStyles = (placement) => {
|
|
|
10279
10362
|
};
|
|
10280
10363
|
|
|
10281
10364
|
// src/components/tooltip/useTooltip.ts
|
|
10282
|
-
var
|
|
10365
|
+
var import_react25 = require("react");
|
|
10283
10366
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
10284
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
10285
|
-
const tooltipRef = (0,
|
|
10286
|
-
(0,
|
|
10367
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react25.useState)({ x: 0, y: 0 });
|
|
10368
|
+
const tooltipRef = (0, import_react25.useRef)(null);
|
|
10369
|
+
(0, import_react25.useEffect)(() => {
|
|
10287
10370
|
if (targetRect && tooltipRef.current) {
|
|
10288
10371
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
10289
10372
|
const scrollX = window.scrollX;
|
|
@@ -10314,28 +10397,28 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
10314
10397
|
|
|
10315
10398
|
// src/components/tooltip/tooltip.tsx
|
|
10316
10399
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10317
|
-
var Tooltip = (0,
|
|
10400
|
+
var Tooltip = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
10318
10401
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
10319
10402
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames, noTouchContent } = props;
|
|
10320
|
-
const slots = (0,
|
|
10321
|
-
const [targetRect, setTargetRect] = (0,
|
|
10403
|
+
const slots = (0, import_react26.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
10404
|
+
const [targetRect, setTargetRect] = (0, import_react26.useState)(null);
|
|
10322
10405
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
10323
10406
|
placement,
|
|
10324
10407
|
offset,
|
|
10325
10408
|
delay,
|
|
10326
10409
|
targetRect
|
|
10327
10410
|
});
|
|
10328
|
-
const childrenRef = (0,
|
|
10329
|
-
const delayTimeoutRef = (0,
|
|
10330
|
-
const getProps = (0,
|
|
10411
|
+
const childrenRef = (0, import_react26.useRef)(null);
|
|
10412
|
+
const delayTimeoutRef = (0, import_react26.useRef)(null);
|
|
10413
|
+
const getProps = (0, import_react26.useCallback)(
|
|
10331
10414
|
(slotKey, classNameKey) => ({
|
|
10332
10415
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
10333
10416
|
}),
|
|
10334
10417
|
[slots, classNames]
|
|
10335
10418
|
);
|
|
10336
|
-
const getBaseProps = (0,
|
|
10337
|
-
const getContentProps = (0,
|
|
10338
|
-
const showTooltip = (0,
|
|
10419
|
+
const getBaseProps = (0, import_react26.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
10420
|
+
const getContentProps = (0, import_react26.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
10421
|
+
const showTooltip = (0, import_react26.useCallback)(() => {
|
|
10339
10422
|
if (childrenRef.current) {
|
|
10340
10423
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
10341
10424
|
setTargetRect({
|
|
@@ -10348,12 +10431,12 @@ var Tooltip = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
10348
10431
|
});
|
|
10349
10432
|
}
|
|
10350
10433
|
}, []);
|
|
10351
|
-
const hideTooltip = (0,
|
|
10434
|
+
const hideTooltip = (0, import_react26.useCallback)(() => {
|
|
10352
10435
|
if (!persistent) {
|
|
10353
10436
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
10354
10437
|
}
|
|
10355
10438
|
}, [persistent, delay]);
|
|
10356
|
-
(0,
|
|
10439
|
+
(0, import_react26.useEffect)(() => {
|
|
10357
10440
|
if (persistent) showTooltip();
|
|
10358
10441
|
}, [persistent, showTooltip]);
|
|
10359
10442
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
@@ -10438,10 +10521,10 @@ var tooltipStyle = tv({
|
|
|
10438
10521
|
});
|
|
10439
10522
|
|
|
10440
10523
|
// src/components/modal/modal.tsx
|
|
10441
|
-
var
|
|
10524
|
+
var import_react27 = require("react");
|
|
10442
10525
|
var import_react_dom3 = require("react-dom");
|
|
10443
10526
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
10444
|
-
var Modal = (0,
|
|
10527
|
+
var Modal = (0, import_react27.forwardRef)((props, ref) => {
|
|
10445
10528
|
const [localProps, variantProps] = mapPropsVariants(props, modal.variantKeys);
|
|
10446
10529
|
const {
|
|
10447
10530
|
classNames,
|
|
@@ -10456,8 +10539,8 @@ var Modal = (0, import_react26.forwardRef)((props, ref) => {
|
|
|
10456
10539
|
onCancel,
|
|
10457
10540
|
extraFooter
|
|
10458
10541
|
} = localProps;
|
|
10459
|
-
const slots = (0,
|
|
10460
|
-
(0,
|
|
10542
|
+
const slots = (0, import_react27.useMemo)(() => modal(variantProps), [variantProps]);
|
|
10543
|
+
(0, import_react27.useEffect)(() => {
|
|
10461
10544
|
document.body.classList.toggle("overflow-hidden", !!isOpen);
|
|
10462
10545
|
if (!isOpen || isKeyboardDismissDisabled) return;
|
|
10463
10546
|
const handleKeyDown = (e) => {
|
|
@@ -10559,18 +10642,18 @@ var modal = tv({
|
|
|
10559
10642
|
});
|
|
10560
10643
|
|
|
10561
10644
|
// src/components/drawer/drawer.tsx
|
|
10562
|
-
var
|
|
10645
|
+
var import_react28 = require("react");
|
|
10563
10646
|
var import_react_dom4 = require("react-dom");
|
|
10564
10647
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10565
|
-
var Drawer = (0,
|
|
10648
|
+
var Drawer = (0, import_react28.forwardRef)((props, ref) => {
|
|
10566
10649
|
const [localProps, variantProps] = mapPropsVariants(props, drawer.variantKeys);
|
|
10567
10650
|
const { classNames, isOpen, content, isKeyboardDismissDisabled = false, onClose, backdrop = true } = localProps;
|
|
10568
10651
|
const position = props.position || "right";
|
|
10569
|
-
const [shouldRender, setShouldRender] = (0,
|
|
10570
|
-
const [isAnimating, setIsAnimating] = (0,
|
|
10571
|
-
const [isContentAnimating, setIsContentAnimating] = (0,
|
|
10572
|
-
const slots = (0,
|
|
10573
|
-
(0,
|
|
10652
|
+
const [shouldRender, setShouldRender] = (0, import_react28.useState)(isOpen);
|
|
10653
|
+
const [isAnimating, setIsAnimating] = (0, import_react28.useState)(isOpen);
|
|
10654
|
+
const [isContentAnimating, setIsContentAnimating] = (0, import_react28.useState)(isOpen);
|
|
10655
|
+
const slots = (0, import_react28.useMemo)(() => drawer(variantProps), [variantProps]);
|
|
10656
|
+
(0, import_react28.useEffect)(() => {
|
|
10574
10657
|
if (isOpen) {
|
|
10575
10658
|
setShouldRender(true);
|
|
10576
10659
|
requestAnimationFrame(() => {
|
|
@@ -10588,7 +10671,7 @@ var Drawer = (0, import_react27.forwardRef)((props, ref) => {
|
|
|
10588
10671
|
return () => clearTimeout(timer);
|
|
10589
10672
|
}
|
|
10590
10673
|
}, [isOpen]);
|
|
10591
|
-
(0,
|
|
10674
|
+
(0, import_react28.useEffect)(() => {
|
|
10592
10675
|
if (shouldRender) {
|
|
10593
10676
|
document.body.classList.add("overflow-hidden");
|
|
10594
10677
|
} else {
|
|
@@ -10719,15 +10802,15 @@ var drawer = tv({
|
|
|
10719
10802
|
var drawer_default = Drawer;
|
|
10720
10803
|
|
|
10721
10804
|
// src/components/list/list.tsx
|
|
10722
|
-
var
|
|
10805
|
+
var import_react29 = require("react");
|
|
10723
10806
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
10724
|
-
var List = (0,
|
|
10807
|
+
var List = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
10725
10808
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
10726
10809
|
const { children, classNames } = props;
|
|
10727
|
-
const slots = (0,
|
|
10728
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children:
|
|
10729
|
-
if (!(0,
|
|
10730
|
-
return (0,
|
|
10810
|
+
const slots = (0, import_react29.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
10811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react29.Children.map(children, (child) => {
|
|
10812
|
+
if (!(0, import_react29.isValidElement)(child)) return child;
|
|
10813
|
+
return (0, import_react29.cloneElement)(child, {
|
|
10731
10814
|
...variantProps,
|
|
10732
10815
|
...child.props
|
|
10733
10816
|
});
|
|
@@ -10764,9 +10847,9 @@ var listStyle = tv({
|
|
|
10764
10847
|
});
|
|
10765
10848
|
|
|
10766
10849
|
// src/components/list/listItem.tsx
|
|
10767
|
-
var
|
|
10850
|
+
var import_react30 = require("react");
|
|
10768
10851
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10769
|
-
var ListItem = (0,
|
|
10852
|
+
var ListItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
10770
10853
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
10771
10854
|
const {
|
|
10772
10855
|
title,
|
|
@@ -10778,7 +10861,7 @@ var ListItem = (0, import_react29.forwardRef)((props, ref) => {
|
|
|
10778
10861
|
classNames,
|
|
10779
10862
|
onClick
|
|
10780
10863
|
} = { ...rawProps, ...variantProps };
|
|
10781
|
-
const slots = (0,
|
|
10864
|
+
const slots = (0, import_react30.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
10782
10865
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
10783
10866
|
const avatarSize = iconSize;
|
|
10784
10867
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
@@ -10958,9 +11041,9 @@ var listItemStyle = tv({
|
|
|
10958
11041
|
});
|
|
10959
11042
|
|
|
10960
11043
|
// src/components/toast/toast.tsx
|
|
10961
|
-
var
|
|
11044
|
+
var import_react31 = require("react");
|
|
10962
11045
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
10963
|
-
var Toast = (0,
|
|
11046
|
+
var Toast = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
10964
11047
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
10965
11048
|
const {
|
|
10966
11049
|
title,
|
|
@@ -10974,9 +11057,9 @@ var Toast = (0, import_react30.forwardRef)((originalProps, ref) => {
|
|
|
10974
11057
|
disableAnimation,
|
|
10975
11058
|
onClose
|
|
10976
11059
|
} = { ...props, ...variantProps };
|
|
10977
|
-
const slots = (0,
|
|
10978
|
-
const toastRef = (0,
|
|
10979
|
-
(0,
|
|
11060
|
+
const slots = (0, import_react31.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
11061
|
+
const toastRef = (0, import_react31.useRef)(null);
|
|
11062
|
+
(0, import_react31.useImperativeHandle)(
|
|
10980
11063
|
ref,
|
|
10981
11064
|
() => ({
|
|
10982
11065
|
getWidth: () => {
|
|
@@ -11109,7 +11192,7 @@ var toast = tv({
|
|
|
11109
11192
|
});
|
|
11110
11193
|
|
|
11111
11194
|
// src/components/toast/use-toast.tsx
|
|
11112
|
-
var
|
|
11195
|
+
var import_react32 = require("react");
|
|
11113
11196
|
|
|
11114
11197
|
// src/components/toast/toast-utils.ts
|
|
11115
11198
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -11149,9 +11232,9 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
11149
11232
|
|
|
11150
11233
|
// src/components/toast/use-toast.tsx
|
|
11151
11234
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
11152
|
-
var ToastContext = (0,
|
|
11235
|
+
var ToastContext = (0, import_react32.createContext)(null);
|
|
11153
11236
|
var useToast = () => {
|
|
11154
|
-
const context = (0,
|
|
11237
|
+
const context = (0, import_react32.useContext)(ToastContext);
|
|
11155
11238
|
if (!context) {
|
|
11156
11239
|
throw new Error("useToast must be used within a ToastProvider");
|
|
11157
11240
|
}
|
|
@@ -11161,10 +11244,10 @@ var ToastProvider = ({
|
|
|
11161
11244
|
globalOptions,
|
|
11162
11245
|
children
|
|
11163
11246
|
}) => {
|
|
11164
|
-
const [toasts, setToasts] = (0,
|
|
11165
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
11166
|
-
const toastRef = (0,
|
|
11167
|
-
const addToast = (0,
|
|
11247
|
+
const [toasts, setToasts] = (0, import_react32.useState)([]);
|
|
11248
|
+
const [containerStyle, setContainerStyle] = (0, import_react32.useState)({});
|
|
11249
|
+
const toastRef = (0, import_react32.useRef)(null);
|
|
11250
|
+
const addToast = (0, import_react32.useCallback)(
|
|
11168
11251
|
(title, options = {}) => {
|
|
11169
11252
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
11170
11253
|
const newToast = {
|
|
@@ -11181,11 +11264,11 @@ var ToastProvider = ({
|
|
|
11181
11264
|
},
|
|
11182
11265
|
[globalOptions]
|
|
11183
11266
|
);
|
|
11184
|
-
const removeToast = (0,
|
|
11267
|
+
const removeToast = (0, import_react32.useCallback)((id) => {
|
|
11185
11268
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
11186
11269
|
}, []);
|
|
11187
11270
|
const contextValue = addToast;
|
|
11188
|
-
(0,
|
|
11271
|
+
(0, import_react32.useEffect)(() => {
|
|
11189
11272
|
var _a;
|
|
11190
11273
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
11191
11274
|
const offset = 20;
|
|
@@ -11206,12 +11289,12 @@ var ToastProvider = ({
|
|
|
11206
11289
|
};
|
|
11207
11290
|
|
|
11208
11291
|
// src/components/picker/day.tsx
|
|
11209
|
-
var
|
|
11292
|
+
var import_react33 = require("react");
|
|
11210
11293
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11211
|
-
var Day = (0,
|
|
11294
|
+
var Day = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
11212
11295
|
const [props, variantProps] = mapPropsVariants(originalProps, dayStyle.variantKeys);
|
|
11213
11296
|
const { classNames, children, ...divProps } = props;
|
|
11214
|
-
const slots = (0,
|
|
11297
|
+
const slots = (0, import_react33.useMemo)(() => dayStyle({ ...variantProps }), [variantProps]);
|
|
11215
11298
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), ...divProps, children });
|
|
11216
11299
|
});
|
|
11217
11300
|
Day.displayName = "Day";
|
|
@@ -11248,7 +11331,7 @@ var dayStyle = tv({
|
|
|
11248
11331
|
});
|
|
11249
11332
|
|
|
11250
11333
|
// src/components/picker/datePicker.tsx
|
|
11251
|
-
var
|
|
11334
|
+
var import_react34 = require("react");
|
|
11252
11335
|
var import_react_dom5 = require("react-dom");
|
|
11253
11336
|
|
|
11254
11337
|
// src/components/picker/utils.ts
|
|
@@ -11265,7 +11348,7 @@ var formatStringToDate = (date) => {
|
|
|
11265
11348
|
|
|
11266
11349
|
// src/components/picker/datePicker.tsx
|
|
11267
11350
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11268
|
-
var DatePicker = (0,
|
|
11351
|
+
var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
11269
11352
|
const [props, variantProps] = mapPropsVariants(originalProps, datePickerStyle.variantKeys);
|
|
11270
11353
|
const {
|
|
11271
11354
|
classNames,
|
|
@@ -11292,26 +11375,26 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11292
11375
|
dualCalendar = false,
|
|
11293
11376
|
...inputProps
|
|
11294
11377
|
} = { ...props, ...variantProps };
|
|
11295
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
11296
|
-
const [selectedRange, setSelectedRange] = (0,
|
|
11378
|
+
const [selectedDate, setSelectedDate] = (0, import_react34.useState)(range ? "" : typeof value === "string" ? value || "" : "");
|
|
11379
|
+
const [selectedRange, setSelectedRange] = (0, import_react34.useState)({
|
|
11297
11380
|
startDate: range && typeof value === "object" ? (value == null ? void 0 : value.startDate) || "" : "",
|
|
11298
11381
|
endDate: range && typeof value === "object" ? (value == null ? void 0 : value.endDate) || "" : ""
|
|
11299
11382
|
});
|
|
11300
|
-
const [tempSelectedDate, setTempSelectedDate] = (0,
|
|
11301
|
-
const [tempSelectedRange, setTempSelectedRange] = (0,
|
|
11302
|
-
const [rangeSelection, setRangeSelection] = (0,
|
|
11303
|
-
const [isPanelOpen, setIsPanelOpen] = (0,
|
|
11304
|
-
const [leftCurrentDate, setLeftCurrentDate] = (0,
|
|
11383
|
+
const [tempSelectedDate, setTempSelectedDate] = (0, import_react34.useState)(selectedDate);
|
|
11384
|
+
const [tempSelectedRange, setTempSelectedRange] = (0, import_react34.useState)(selectedRange);
|
|
11385
|
+
const [rangeSelection, setRangeSelection] = (0, import_react34.useState)("start");
|
|
11386
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react34.useState)(false);
|
|
11387
|
+
const [leftCurrentDate, setLeftCurrentDate] = (0, import_react34.useState)(
|
|
11305
11388
|
range && tempSelectedRange.startDate ? new Date(tempSelectedRange.startDate) : tempSelectedDate ? new Date(tempSelectedDate) : /* @__PURE__ */ new Date()
|
|
11306
11389
|
);
|
|
11307
|
-
const [rightCurrentDate, setRightCurrentDate] = (0,
|
|
11390
|
+
const [rightCurrentDate, setRightCurrentDate] = (0, import_react34.useState)(
|
|
11308
11391
|
dualCalendar ? new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1) : /* @__PURE__ */ new Date()
|
|
11309
11392
|
);
|
|
11310
|
-
const inputWrapperRef = (0,
|
|
11311
|
-
const calendarWrapperRef = (0,
|
|
11312
|
-
const [panelPos, setPanelPos] = (0,
|
|
11313
|
-
const blurTimeoutRef = (0,
|
|
11314
|
-
const isConfirmDisabled = (0,
|
|
11393
|
+
const inputWrapperRef = (0, import_react34.useRef)(null);
|
|
11394
|
+
const calendarWrapperRef = (0, import_react34.useRef)(null);
|
|
11395
|
+
const [panelPos, setPanelPos] = (0, import_react34.useState)({ top: -9999, left: -9999 });
|
|
11396
|
+
const blurTimeoutRef = (0, import_react34.useRef)(null);
|
|
11397
|
+
const isConfirmDisabled = (0, import_react34.useMemo)(() => {
|
|
11315
11398
|
if (range) {
|
|
11316
11399
|
const hasStart = !!tempSelectedRange.startDate;
|
|
11317
11400
|
const hasEnd = !!tempSelectedRange.endDate;
|
|
@@ -11331,7 +11414,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11331
11414
|
return dateString;
|
|
11332
11415
|
}
|
|
11333
11416
|
};
|
|
11334
|
-
const displayValue = (0,
|
|
11417
|
+
const displayValue = (0, import_react34.useMemo)(() => {
|
|
11335
11418
|
if (range) {
|
|
11336
11419
|
const start = formatDate(selectedRange.startDate);
|
|
11337
11420
|
const end = formatDate(selectedRange.endDate);
|
|
@@ -11341,7 +11424,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11341
11424
|
}
|
|
11342
11425
|
return formatDate(selectedDate);
|
|
11343
11426
|
}, [selectedDate, selectedRange, format, range]);
|
|
11344
|
-
const calculatePosition = (0,
|
|
11427
|
+
const calculatePosition = (0, import_react34.useCallback)(() => {
|
|
11345
11428
|
if (inputWrapperRef.current) {
|
|
11346
11429
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
11347
11430
|
setPanelPos({ top: rect.bottom + window.scrollY + 6, left: rect.left + window.scrollX });
|
|
@@ -11384,7 +11467,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11384
11467
|
e.preventDefault();
|
|
11385
11468
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
11386
11469
|
};
|
|
11387
|
-
const getCalendarDates = (0,
|
|
11470
|
+
const getCalendarDates = (0, import_react34.useCallback)((currentDate) => {
|
|
11388
11471
|
const year = currentDate.getFullYear();
|
|
11389
11472
|
const month = currentDate.getMonth();
|
|
11390
11473
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -11480,7 +11563,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11480
11563
|
}
|
|
11481
11564
|
setIsPanelOpen(false);
|
|
11482
11565
|
};
|
|
11483
|
-
const getDayProps = (0,
|
|
11566
|
+
const getDayProps = (0, import_react34.useCallback)(
|
|
11484
11567
|
(dateObj, currentDate) => {
|
|
11485
11568
|
const today = /* @__PURE__ */ new Date();
|
|
11486
11569
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -11507,7 +11590,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11507
11590
|
const getPlaceholderText = () => {
|
|
11508
11591
|
return placeholder;
|
|
11509
11592
|
};
|
|
11510
|
-
(0,
|
|
11593
|
+
(0, import_react34.useEffect)(() => {
|
|
11511
11594
|
if (range && typeof value === "object") {
|
|
11512
11595
|
setSelectedRange(value || { startDate: "", endDate: "" });
|
|
11513
11596
|
setTempSelectedRange(value || { startDate: "", endDate: "" });
|
|
@@ -11518,12 +11601,12 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11518
11601
|
if (value) setLeftCurrentDate(new Date(value));
|
|
11519
11602
|
}
|
|
11520
11603
|
}, [value, range]);
|
|
11521
|
-
(0,
|
|
11604
|
+
(0, import_react34.useEffect)(() => {
|
|
11522
11605
|
if (dualCalendar) {
|
|
11523
11606
|
setRightCurrentDate(new Date(leftCurrentDate.getFullYear(), leftCurrentDate.getMonth() + 1));
|
|
11524
11607
|
}
|
|
11525
11608
|
}, [leftCurrentDate, dualCalendar]);
|
|
11526
|
-
const slots = (0,
|
|
11609
|
+
const slots = (0, import_react34.useMemo)(() => datePickerStyle({ ...variantProps, dualCalendar }), [variantProps, dualCalendar]);
|
|
11527
11610
|
const endContent = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Icon_default, { name: "calendar", size, className: "cursor-pointer", fill: true, onClick: handleCalendarIconClick });
|
|
11528
11611
|
const renderCalendar = (currentDate, isLeft) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col gap-[5px]", children: [
|
|
11529
11612
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: slots.calendarHead({ class: classNames == null ? void 0 : classNames.calendarHead }), children: dualCalendar ? isLeft ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
@@ -11540,7 +11623,7 @@ var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
|
11540
11623
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(icon_button_default, { name: "right", variant: "soft", color: "neutral", onClick: handleLeftNextMonth })
|
|
11541
11624
|
] }) }),
|
|
11542
11625
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(day_default, { variant: "text", children: day }, `${day}-${index}`)) }),
|
|
11543
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7 gap-y-[5px] text-center", children: getCalendarDates(currentDate).map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11626
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-7 gap-y-[5px] text-center", children: getCalendarDates(currentDate).map((week, weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react34.Fragment, { children: week.map((dateObj, index) => {
|
|
11544
11627
|
const dayVariant = getDayProps(dateObj, currentDate);
|
|
11545
11628
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11546
11629
|
day_default,
|
|
@@ -11688,10 +11771,10 @@ var datePickerStyle = tv({
|
|
|
11688
11771
|
});
|
|
11689
11772
|
|
|
11690
11773
|
// src/components/picker/timePicker.tsx
|
|
11691
|
-
var
|
|
11774
|
+
var import_react35 = require("react");
|
|
11692
11775
|
var import_react_dom6 = require("react-dom");
|
|
11693
11776
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11694
|
-
var TimePicker = (0,
|
|
11777
|
+
var TimePicker = (0, import_react35.forwardRef)((originalProps, ref) => {
|
|
11695
11778
|
const [props, variantProps] = mapPropsVariants(originalProps, timePickerStyle.variantKeys);
|
|
11696
11779
|
const {
|
|
11697
11780
|
classNames,
|
|
@@ -11704,20 +11787,20 @@ var TimePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11704
11787
|
placeholder = "",
|
|
11705
11788
|
...inputProps
|
|
11706
11789
|
} = props;
|
|
11707
|
-
const [selectedRange, setSelectedRange] = (0,
|
|
11790
|
+
const [selectedRange, setSelectedRange] = (0, import_react35.useState)(
|
|
11708
11791
|
valueRange || { start: "", end: "" }
|
|
11709
11792
|
);
|
|
11710
|
-
const [isPanelOpen, setIsPanelOpen] = (0,
|
|
11711
|
-
const inputWrapperRef = (0,
|
|
11712
|
-
const panelWrapperRef = (0,
|
|
11713
|
-
const [panelPos, setPanelPos] = (0,
|
|
11714
|
-
const displayValue = (0,
|
|
11793
|
+
const [isPanelOpen, setIsPanelOpen] = (0, import_react35.useState)(false);
|
|
11794
|
+
const inputWrapperRef = (0, import_react35.useRef)(null);
|
|
11795
|
+
const panelWrapperRef = (0, import_react35.useRef)(null);
|
|
11796
|
+
const [panelPos, setPanelPos] = (0, import_react35.useState)({ top: -9999, left: -9999 });
|
|
11797
|
+
const displayValue = (0, import_react35.useMemo)(() => {
|
|
11715
11798
|
if (selectedRange.start && selectedRange.end) {
|
|
11716
11799
|
return `${selectedRange.start} ~ ${selectedRange.end}`;
|
|
11717
11800
|
}
|
|
11718
11801
|
return "";
|
|
11719
11802
|
}, [selectedRange]);
|
|
11720
|
-
const calculatePosition = (0,
|
|
11803
|
+
const calculatePosition = (0, import_react35.useCallback)(() => {
|
|
11721
11804
|
if (inputWrapperRef.current) {
|
|
11722
11805
|
const rect = inputWrapperRef.current.getBoundingClientRect();
|
|
11723
11806
|
setPanelPos({ top: rect.bottom + window.scrollY + 6, left: rect.left + window.scrollX });
|
|
@@ -11739,7 +11822,7 @@ var TimePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
11739
11822
|
setIsPanelOpen(false);
|
|
11740
11823
|
}
|
|
11741
11824
|
};
|
|
11742
|
-
const slots = (0,
|
|
11825
|
+
const slots = (0, import_react35.useMemo)(() => timePickerStyle({ ...variantProps }), [variantProps]);
|
|
11743
11826
|
const renderHourOptions = () => {
|
|
11744
11827
|
return Array.from({ length: 24 }, (_, i) => {
|
|
11745
11828
|
const value = String(i).padStart(2, "0");
|
|
@@ -12032,19 +12115,19 @@ var timePickerStyle = tv({
|
|
|
12032
12115
|
});
|
|
12033
12116
|
|
|
12034
12117
|
// src/components/tree/tree.tsx
|
|
12035
|
-
var
|
|
12118
|
+
var import_react36 = require("react");
|
|
12036
12119
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
12037
|
-
var TreeNodeItem = (0,
|
|
12120
|
+
var TreeNodeItem = (0, import_react36.forwardRef)(
|
|
12038
12121
|
({ node, depth, fileIcon, selectedName, classNames, onExpand }, ref) => {
|
|
12039
|
-
const [isOpen, setIsOpen] = (0,
|
|
12040
|
-
const [children, setChildren] = (0,
|
|
12041
|
-
const slots = (0,
|
|
12042
|
-
const hasMore = (0,
|
|
12122
|
+
const [isOpen, setIsOpen] = (0, import_react36.useState)(false);
|
|
12123
|
+
const [children, setChildren] = (0, import_react36.useState)(node.children);
|
|
12124
|
+
const slots = (0, import_react36.useMemo)(() => treeStyle(), []);
|
|
12125
|
+
const hasMore = (0, import_react36.useMemo)(() => {
|
|
12043
12126
|
if (node.isLeaf) return false;
|
|
12044
12127
|
if (Array.isArray(children)) return children.length > 0;
|
|
12045
12128
|
return typeof onExpand === "function";
|
|
12046
12129
|
}, [node.isLeaf, children, onExpand]);
|
|
12047
|
-
const toggleOpen = (0,
|
|
12130
|
+
const toggleOpen = (0, import_react36.useCallback)(async () => {
|
|
12048
12131
|
if (!isOpen && !children && onExpand && !node.isLeaf) {
|
|
12049
12132
|
try {
|
|
12050
12133
|
const result = await onExpand(node);
|
|
@@ -12120,7 +12203,7 @@ var TreeNodeItem = (0, import_react35.forwardRef)(
|
|
|
12120
12203
|
);
|
|
12121
12204
|
TreeNodeItem.displayName = "TreeNodeItem";
|
|
12122
12205
|
var Tree = ({ headerContent, group, groupIcon, fileIcon, selectedName, classNames, onExpand }) => {
|
|
12123
|
-
const slots = (0,
|
|
12206
|
+
const slots = (0, import_react36.useMemo)(() => treeStyle(), []);
|
|
12124
12207
|
const handleClick = (e) => {
|
|
12125
12208
|
var _a;
|
|
12126
12209
|
(_a = group.onClick) == null ? void 0 : _a.call(group, e);
|
|
@@ -12188,19 +12271,19 @@ var treeStyle = tv({
|
|
|
12188
12271
|
});
|
|
12189
12272
|
|
|
12190
12273
|
// src/components/fileUpload/fileUpload.tsx
|
|
12191
|
-
var
|
|
12274
|
+
var import_react39 = require("react");
|
|
12192
12275
|
var import_tailwind_variants34 = require("tailwind-variants");
|
|
12193
12276
|
|
|
12194
12277
|
// src/components/progress/progress.tsx
|
|
12195
|
-
var
|
|
12278
|
+
var import_react38 = require("react");
|
|
12196
12279
|
|
|
12197
12280
|
// src/hooks/useIsMounted.ts
|
|
12198
|
-
var
|
|
12281
|
+
var import_react37 = require("react");
|
|
12199
12282
|
function useIsMounted(props = {}) {
|
|
12200
12283
|
const { rerender = false, delay = 0 } = props;
|
|
12201
|
-
const isMountedRef = (0,
|
|
12202
|
-
const [isMounted, setIsMounted] = (0,
|
|
12203
|
-
(0,
|
|
12284
|
+
const isMountedRef = (0, import_react37.useRef)(false);
|
|
12285
|
+
const [isMounted, setIsMounted] = (0, import_react37.useState)(false);
|
|
12286
|
+
(0, import_react37.useEffect)(() => {
|
|
12204
12287
|
isMountedRef.current = true;
|
|
12205
12288
|
let timer = null;
|
|
12206
12289
|
if (rerender) {
|
|
@@ -12222,7 +12305,7 @@ function useIsMounted(props = {}) {
|
|
|
12222
12305
|
}
|
|
12223
12306
|
};
|
|
12224
12307
|
}, [rerender]);
|
|
12225
|
-
return [(0,
|
|
12308
|
+
return [(0, import_react37.useCallback)(() => isMountedRef.current, []), isMounted];
|
|
12226
12309
|
}
|
|
12227
12310
|
|
|
12228
12311
|
// src/components/progress/progress.tsx
|
|
@@ -12236,11 +12319,11 @@ var Progress = (originalProps) => {
|
|
|
12236
12319
|
delay: 100
|
|
12237
12320
|
});
|
|
12238
12321
|
const selfMounted = variantProps.disableAnimation ? true : isMounted;
|
|
12239
|
-
const percentage = (0,
|
|
12322
|
+
const percentage = (0, import_react38.useMemo)(
|
|
12240
12323
|
() => isIndeterminate || !selfMounted ? void 0 : clampPercentage((value - minValue) / (maxValue - minValue) * 100),
|
|
12241
12324
|
[selfMounted, isIndeterminate, value, minValue, maxValue]
|
|
12242
12325
|
);
|
|
12243
|
-
const slots = (0,
|
|
12326
|
+
const slots = (0, import_react38.useMemo)(() => progressStyle({ ...variantProps }), [variantProps]);
|
|
12244
12327
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: slots.track({ class: classNames == null ? void 0 : classNames.track }), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
12245
12328
|
"div",
|
|
12246
12329
|
{
|
|
@@ -12357,14 +12440,14 @@ function FileUpload({
|
|
|
12357
12440
|
classNames,
|
|
12358
12441
|
defaultFile
|
|
12359
12442
|
}) {
|
|
12360
|
-
const fileInputRef = (0,
|
|
12361
|
-
const uploadIntervalRef = (0,
|
|
12362
|
-
const [currentFile, setCurrentFile] = (0,
|
|
12363
|
-
const [uploadProgress, setUploadProgress] = (0,
|
|
12364
|
-
const [message, setMessage] = (0,
|
|
12365
|
-
const [displayFileName, setDisplayFileName] = (0,
|
|
12366
|
-
const [hasUploadedFile, setHasUploadedFile] = (0,
|
|
12367
|
-
const [isUploading, setIsUploading] = (0,
|
|
12443
|
+
const fileInputRef = (0, import_react39.useRef)(null);
|
|
12444
|
+
const uploadIntervalRef = (0, import_react39.useRef)(null);
|
|
12445
|
+
const [currentFile, setCurrentFile] = (0, import_react39.useState)(null);
|
|
12446
|
+
const [uploadProgress, setUploadProgress] = (0, import_react39.useState)(0);
|
|
12447
|
+
const [message, setMessage] = (0, import_react39.useState)(errorMessage);
|
|
12448
|
+
const [displayFileName, setDisplayFileName] = (0, import_react39.useState)(() => (defaultFile == null ? void 0 : defaultFile.name) || "");
|
|
12449
|
+
const [hasUploadedFile, setHasUploadedFile] = (0, import_react39.useState)(false);
|
|
12450
|
+
const [isUploading, setIsUploading] = (0, import_react39.useState)(false);
|
|
12368
12451
|
const slots = fileUploadStyle();
|
|
12369
12452
|
const handleButtonClick = () => {
|
|
12370
12453
|
var _a;
|
|
@@ -12431,14 +12514,14 @@ function FileUpload({
|
|
|
12431
12514
|
}
|
|
12432
12515
|
if (onCancelUpload) onCancelUpload();
|
|
12433
12516
|
};
|
|
12434
|
-
(0,
|
|
12517
|
+
(0, import_react39.useEffect)(() => {
|
|
12435
12518
|
return () => {
|
|
12436
12519
|
if (uploadIntervalRef.current) {
|
|
12437
12520
|
clearInterval(uploadIntervalRef.current);
|
|
12438
12521
|
}
|
|
12439
12522
|
};
|
|
12440
12523
|
}, []);
|
|
12441
|
-
(0,
|
|
12524
|
+
(0, import_react39.useEffect)(() => {
|
|
12442
12525
|
if (errorMessage !== void 0) {
|
|
12443
12526
|
setMessage(errorMessage);
|
|
12444
12527
|
}
|
|
@@ -12573,12 +12656,12 @@ var skeletonStyle = (0, import_tailwind_variants35.tv)({
|
|
|
12573
12656
|
|
|
12574
12657
|
// src/components/charts/circularProgress.tsx
|
|
12575
12658
|
var import_recharts = require("recharts");
|
|
12576
|
-
var
|
|
12659
|
+
var import_react40 = require("react");
|
|
12577
12660
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
12578
|
-
var CircularProgress = (0,
|
|
12661
|
+
var CircularProgress = (0, import_react40.forwardRef)((originalProps, ref) => {
|
|
12579
12662
|
const [props, variantProps] = mapPropsVariants(originalProps, circularProgressStyle.variantKeys);
|
|
12580
12663
|
const { label, size = 150, percentage, innerContent, classNames } = { ...props, ...variantProps };
|
|
12581
|
-
const slots = (0,
|
|
12664
|
+
const slots = (0, import_react40.useMemo)(() => circularProgressStyle({ ...variantProps }), [variantProps]);
|
|
12582
12665
|
const data = [
|
|
12583
12666
|
{
|
|
12584
12667
|
name: label,
|
|
@@ -12610,7 +12693,7 @@ var CircularProgress = (0, import_react39.forwardRef)((originalProps, ref) => {
|
|
|
12610
12693
|
const colorValue = originalProps.color;
|
|
12611
12694
|
const colorKey = colorValue || "blue";
|
|
12612
12695
|
const currentGradient = gradientColors[colorKey];
|
|
12613
|
-
const wrappedInnerContent = (0,
|
|
12696
|
+
const wrappedInnerContent = (0, import_react40.useMemo)(() => {
|
|
12614
12697
|
return wrapSpanWithClass(innerContent);
|
|
12615
12698
|
}, [innerContent]);
|
|
12616
12699
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
@@ -12704,16 +12787,16 @@ function wrapSpanWithClass(node) {
|
|
|
12704
12787
|
if (Array.isArray(node)) {
|
|
12705
12788
|
return node.map(wrapSpanWithClass);
|
|
12706
12789
|
}
|
|
12707
|
-
if ((0,
|
|
12790
|
+
if ((0, import_react40.isValidElement)(node)) {
|
|
12708
12791
|
const element = node;
|
|
12709
12792
|
if (element.type === "span") {
|
|
12710
12793
|
const existing = (_a = element.props.className) != null ? _a : "";
|
|
12711
|
-
return (0,
|
|
12794
|
+
return (0, import_react40.cloneElement)(element, {
|
|
12712
12795
|
className: `text-xl font-bold ${existing}`.trim()
|
|
12713
12796
|
});
|
|
12714
12797
|
}
|
|
12715
12798
|
if (element.props.children) {
|
|
12716
|
-
return (0,
|
|
12799
|
+
return (0, import_react40.cloneElement)(element, {
|
|
12717
12800
|
children: wrapSpanWithClass(element.props.children)
|
|
12718
12801
|
});
|
|
12719
12802
|
}
|
|
@@ -12723,11 +12806,11 @@ function wrapSpanWithClass(node) {
|
|
|
12723
12806
|
}
|
|
12724
12807
|
|
|
12725
12808
|
// src/components/charts/areaChart.tsx
|
|
12726
|
-
var
|
|
12809
|
+
var import_react41 = require("react");
|
|
12727
12810
|
var import_recharts2 = require("recharts");
|
|
12728
12811
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
12729
|
-
var AreaChartComponent = (0,
|
|
12730
|
-
const uniqueId = (0,
|
|
12812
|
+
var AreaChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
|
|
12813
|
+
const uniqueId = (0, import_react41.useId)();
|
|
12731
12814
|
const [props, variantProps] = mapPropsVariants(originalProps, areaChartStyle.variantKeys);
|
|
12732
12815
|
const {
|
|
12733
12816
|
data,
|
|
@@ -12739,26 +12822,26 @@ var AreaChartComponent = (0, import_react40.forwardRef)((originalProps, ref) =>
|
|
|
12739
12822
|
chartHeight = 240,
|
|
12740
12823
|
classNames
|
|
12741
12824
|
} = { ...props, ...variantProps };
|
|
12742
|
-
const slots = (0,
|
|
12825
|
+
const slots = (0, import_react41.useMemo)(() => areaChartStyle({ ...variantProps }), [variantProps]);
|
|
12743
12826
|
const COLOR_MAP = {
|
|
12744
12827
|
primary: "#3F9CF2",
|
|
12745
12828
|
danger: "#FF4684"
|
|
12746
12829
|
};
|
|
12747
|
-
const colorHex = (0,
|
|
12748
|
-
const totalChartWidth = (0,
|
|
12830
|
+
const colorHex = (0, import_react41.useMemo)(() => COLOR_MAP[color], [color]);
|
|
12831
|
+
const totalChartWidth = (0, import_react41.useMemo)(() => {
|
|
12749
12832
|
if (!data || !itemWidth) return void 0;
|
|
12750
12833
|
const dataLength = startFromZero ? data.length + 1 : data.length;
|
|
12751
12834
|
return dataLength * itemWidth;
|
|
12752
12835
|
}, [data, itemWidth, startFromZero]);
|
|
12753
|
-
const needsScroll = (0,
|
|
12836
|
+
const needsScroll = (0, import_react41.useMemo)(() => {
|
|
12754
12837
|
return totalChartWidth;
|
|
12755
12838
|
}, [totalChartWidth]);
|
|
12756
|
-
const processedData = (0,
|
|
12839
|
+
const processedData = (0, import_react41.useMemo)(() => {
|
|
12757
12840
|
if (!data) return [];
|
|
12758
12841
|
return data;
|
|
12759
12842
|
}, [data, startFromZero]);
|
|
12760
|
-
const [tickPositions, setTickPositions] = (0,
|
|
12761
|
-
const tickRef = (0,
|
|
12843
|
+
const [tickPositions, setTickPositions] = (0, import_react41.useState)([]);
|
|
12844
|
+
const tickRef = (0, import_react41.useRef)([]);
|
|
12762
12845
|
const CustomTick = ({ x, y, payload }) => {
|
|
12763
12846
|
if (x !== void 0) {
|
|
12764
12847
|
tickRef.current.push(x);
|
|
@@ -12780,7 +12863,7 @@ var AreaChartComponent = (0, import_react40.forwardRef)((originalProps, ref) =>
|
|
|
12780
12863
|
}
|
|
12781
12864
|
);
|
|
12782
12865
|
};
|
|
12783
|
-
(0,
|
|
12866
|
+
(0, import_react41.useEffect)(() => {
|
|
12784
12867
|
const raf = requestAnimationFrame(() => {
|
|
12785
12868
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
12786
12869
|
const mids = [];
|
|
@@ -12907,10 +12990,10 @@ var areaChartStyle = tv({
|
|
|
12907
12990
|
});
|
|
12908
12991
|
|
|
12909
12992
|
// src/components/charts/barChart.tsx
|
|
12910
|
-
var
|
|
12993
|
+
var import_react42 = require("react");
|
|
12911
12994
|
var import_recharts3 = require("recharts");
|
|
12912
12995
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
12913
|
-
var BarChartComponent = (0,
|
|
12996
|
+
var BarChartComponent = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
12914
12997
|
const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
|
|
12915
12998
|
const {
|
|
12916
12999
|
data = [],
|
|
@@ -12922,13 +13005,13 @@ var BarChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
|
|
|
12922
13005
|
barGap = 20,
|
|
12923
13006
|
tooltipFormatter
|
|
12924
13007
|
} = { ...props, ...variantProps };
|
|
12925
|
-
const slots = (0,
|
|
12926
|
-
const chartRef = (0,
|
|
12927
|
-
const tooltipRef = (0,
|
|
12928
|
-
const [tooltipLeft, setTooltipLeft] = (0,
|
|
12929
|
-
const [tickPositions, setTickPositions] = (0,
|
|
12930
|
-
const tickRef = (0,
|
|
12931
|
-
const [tooltipState, setTooltipState] = (0,
|
|
13008
|
+
const slots = (0, import_react42.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
|
|
13009
|
+
const chartRef = (0, import_react42.useRef)(null);
|
|
13010
|
+
const tooltipRef = (0, import_react42.useRef)(null);
|
|
13011
|
+
const [tooltipLeft, setTooltipLeft] = (0, import_react42.useState)(0);
|
|
13012
|
+
const [tickPositions, setTickPositions] = (0, import_react42.useState)([]);
|
|
13013
|
+
const tickRef = (0, import_react42.useRef)([]);
|
|
13014
|
+
const [tooltipState, setTooltipState] = (0, import_react42.useState)(null);
|
|
12932
13015
|
const handleMouseEnter = (e, dataKey) => {
|
|
12933
13016
|
if (!tooltipFormatter || !chartRef.current) return;
|
|
12934
13017
|
const { payload, x, y } = e;
|
|
@@ -12988,7 +13071,7 @@ var BarChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
|
|
|
12988
13071
|
children: yAxisTickFormatter(payload.value)
|
|
12989
13072
|
}
|
|
12990
13073
|
);
|
|
12991
|
-
(0,
|
|
13074
|
+
(0, import_react42.useEffect)(() => {
|
|
12992
13075
|
const raf = requestAnimationFrame(() => {
|
|
12993
13076
|
const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
|
|
12994
13077
|
const mids = [];
|
|
@@ -13000,7 +13083,7 @@ var BarChartComponent = (0, import_react41.forwardRef)((originalProps, ref) => {
|
|
|
13000
13083
|
});
|
|
13001
13084
|
return () => cancelAnimationFrame(raf);
|
|
13002
13085
|
}, [data]);
|
|
13003
|
-
(0,
|
|
13086
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
13004
13087
|
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
13005
13088
|
const chartRect = chartRef.current.getBoundingClientRect();
|
|
13006
13089
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
@@ -13160,13 +13243,13 @@ function BarChartTooltip({ className = "", children }) {
|
|
|
13160
13243
|
|
|
13161
13244
|
// src/components/charts/radarChart.tsx
|
|
13162
13245
|
var import_recharts4 = require("recharts");
|
|
13163
|
-
var
|
|
13246
|
+
var import_react43 = require("react");
|
|
13164
13247
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
13165
|
-
var RadarChart = (0,
|
|
13248
|
+
var RadarChart = (0, import_react43.forwardRef)((originalProps, ref) => {
|
|
13166
13249
|
const [props, variantProps] = mapPropsVariants(originalProps, radarChartStyle.variantKeys);
|
|
13167
13250
|
const { data, label, classNames, tooltipFormatter } = { ...props, ...variantProps };
|
|
13168
|
-
const slots = (0,
|
|
13169
|
-
const normalizedData = (0,
|
|
13251
|
+
const slots = (0, import_react43.useMemo)(() => radarChartStyle({ ...variantProps }), [variantProps]);
|
|
13252
|
+
const normalizedData = (0, import_react43.useMemo)(() => {
|
|
13170
13253
|
if (!data || data.length === 0) return [];
|
|
13171
13254
|
return data.map((item) => ({
|
|
13172
13255
|
...item,
|
|
@@ -13175,18 +13258,18 @@ var RadarChart = (0, import_react42.forwardRef)((originalProps, ref) => {
|
|
|
13175
13258
|
originalFullMark: item.fullMark || 100
|
|
13176
13259
|
}));
|
|
13177
13260
|
}, [data]);
|
|
13178
|
-
const containerHeight = (0,
|
|
13261
|
+
const containerHeight = (0, import_react43.useMemo)(() => {
|
|
13179
13262
|
if (!data || data.length === 0) return 250;
|
|
13180
13263
|
return data.length === 3 ? 245 : 306;
|
|
13181
13264
|
}, [data]);
|
|
13182
|
-
const chartMargin = (0,
|
|
13265
|
+
const chartMargin = (0, import_react43.useMemo)(() => {
|
|
13183
13266
|
return { top: 0, right: 0, bottom: 0, left: 0 };
|
|
13184
13267
|
}, [data]);
|
|
13185
|
-
const outerRadius = (0,
|
|
13268
|
+
const outerRadius = (0, import_react43.useMemo)(() => {
|
|
13186
13269
|
if (!data || data.length === 0) return 125;
|
|
13187
13270
|
return data.length === 3 ? 135 : 125;
|
|
13188
13271
|
}, [data]);
|
|
13189
|
-
const chartCenter = (0,
|
|
13272
|
+
const chartCenter = (0, import_react43.useMemo)(() => {
|
|
13190
13273
|
if (!data || data.length === 0) return {};
|
|
13191
13274
|
if (data.length === 3) return { cx: "50%", cy: "65%" };
|
|
13192
13275
|
return {};
|
|
@@ -13263,10 +13346,10 @@ var radarChartStyle = tv({
|
|
|
13263
13346
|
});
|
|
13264
13347
|
|
|
13265
13348
|
// src/components/charts/simpleBarChart.tsx
|
|
13266
|
-
var
|
|
13349
|
+
var import_react44 = require("react");
|
|
13267
13350
|
var import_recharts5 = require("recharts");
|
|
13268
13351
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
13269
|
-
var SimpleBarChartComponent = (0,
|
|
13352
|
+
var SimpleBarChartComponent = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
13270
13353
|
const [props, variantProps] = mapPropsVariants(originalProps, simpleBarChartStyle.variantKeys);
|
|
13271
13354
|
const {
|
|
13272
13355
|
data = [],
|
|
@@ -13277,13 +13360,13 @@ var SimpleBarChartComponent = (0, import_react43.forwardRef)((originalProps, ref
|
|
|
13277
13360
|
barGap = 20,
|
|
13278
13361
|
tooltipFormatter
|
|
13279
13362
|
} = { ...props, ...variantProps };
|
|
13280
|
-
const slots = (0,
|
|
13281
|
-
const chartRef = (0,
|
|
13282
|
-
const tooltipRef = (0,
|
|
13283
|
-
const [tooltipLeft, setTooltipLeft] = (0,
|
|
13284
|
-
const [tickPositions, setTickPositions] = (0,
|
|
13285
|
-
const [tooltipState, setTooltipState] = (0,
|
|
13286
|
-
(0,
|
|
13363
|
+
const slots = (0, import_react44.useMemo)(() => simpleBarChartStyle({ ...variantProps }), [variantProps]);
|
|
13364
|
+
const chartRef = (0, import_react44.useRef)(null);
|
|
13365
|
+
const tooltipRef = (0, import_react44.useRef)(null);
|
|
13366
|
+
const [tooltipLeft, setTooltipLeft] = (0, import_react44.useState)(0);
|
|
13367
|
+
const [tickPositions, setTickPositions] = (0, import_react44.useState)([]);
|
|
13368
|
+
const [tooltipState, setTooltipState] = (0, import_react44.useState)(null);
|
|
13369
|
+
(0, import_react44.useEffect)(() => {
|
|
13287
13370
|
if (!chartRef.current || !data.length) return;
|
|
13288
13371
|
const updateDimensions = () => {
|
|
13289
13372
|
if (!chartRef.current) return;
|
|
@@ -13357,7 +13440,7 @@ var SimpleBarChartComponent = (0, import_react43.forwardRef)((originalProps, ref
|
|
|
13357
13440
|
}
|
|
13358
13441
|
);
|
|
13359
13442
|
};
|
|
13360
|
-
(0,
|
|
13443
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
13361
13444
|
if (!tooltipState || !chartRef.current || !tooltipRef.current) return;
|
|
13362
13445
|
const chartRect = chartRef.current.getBoundingClientRect();
|
|
13363
13446
|
const tooltipRect = tooltipRef.current.getBoundingClientRect();
|
|
@@ -13475,9 +13558,9 @@ var simpleBarChartStyle = tv({
|
|
|
13475
13558
|
});
|
|
13476
13559
|
|
|
13477
13560
|
// src/components/starRating/starRating.tsx
|
|
13478
|
-
var
|
|
13561
|
+
var import_react45 = require("react");
|
|
13479
13562
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
13480
|
-
var StarRating = (0,
|
|
13563
|
+
var StarRating = (0, import_react45.forwardRef)((originalProps, ref) => {
|
|
13481
13564
|
const [props, variantProps] = mapPropsVariants(originalProps, starRatingStyle.variantKeys);
|
|
13482
13565
|
const {
|
|
13483
13566
|
stars,
|
|
@@ -13490,8 +13573,8 @@ var StarRating = (0, import_react44.forwardRef)((originalProps, ref) => {
|
|
|
13490
13573
|
filledColor = "text-primary-main",
|
|
13491
13574
|
emptyColor = "text-neutral-soft"
|
|
13492
13575
|
} = { ...props, ...variantProps };
|
|
13493
|
-
const slots = (0,
|
|
13494
|
-
const [hoverRating, setHoverRating] = (0,
|
|
13576
|
+
const slots = (0, import_react45.useMemo)(() => starRatingStyle({ ...variantProps }), [variantProps]);
|
|
13577
|
+
const [hoverRating, setHoverRating] = (0, import_react45.useState)(0);
|
|
13495
13578
|
const handleStarClick = (starIndex, isHalf = false) => {
|
|
13496
13579
|
if (readOnly || !onChange) return;
|
|
13497
13580
|
let newRating;
|