@deepnoid/ui 0.1.20 → 0.1.21
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 +149 -159
- package/dist/{chunk-JOCMCOEK.mjs → chunk-2Y7IBUAZ.mjs} +17 -6
- package/dist/{chunk-LNYMVBV5.mjs → chunk-7CFOD7G4.mjs} +11 -9
- package/dist/{chunk-YBDA3WQP.mjs → chunk-7KUFDVGL.mjs} +1 -1
- package/dist/{chunk-6KXBXGYR.mjs → chunk-HQLSHEK6.mjs} +1 -1
- package/dist/{chunk-EYVRTVRM.mjs → chunk-JHDYQCEE.mjs} +5 -5
- package/dist/{chunk-3DPVPTHL.mjs → chunk-MV7RSV4D.mjs} +3 -3
- package/dist/chunk-MW7CSRIE.mjs +348 -0
- package/dist/{chunk-ZUSUVPYV.mjs → chunk-OV7CZNXU.mjs} +5 -5
- package/dist/{chunk-OWG4RL2T.mjs → chunk-Q6BZ76DI.mjs} +2 -2
- package/dist/{chunk-63WXGSTV.mjs → chunk-QHWFHOW2.mjs} +24 -14
- package/dist/{chunk-EGHTZLZJ.mjs → chunk-UTC2D6GV.mjs} +5 -5
- package/dist/components/backdrop/backdrop.mjs +2 -2
- package/dist/components/backdrop/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.mjs +6 -6
- package/dist/components/breadcrumb/index.mjs +6 -6
- package/dist/components/button/button.mjs +2 -2
- package/dist/components/button/icon-button.mjs +2 -2
- package/dist/components/button/index.mjs +5 -5
- package/dist/components/button/text-button.mjs +3 -3
- package/dist/components/checkbox/checkbox.mjs +3 -3
- package/dist/components/checkbox/index.mjs +3 -3
- package/dist/components/chip/chip.mjs +2 -2
- package/dist/components/chip/index.mjs +2 -2
- package/dist/components/dateTimePicker/calendar.mjs +2 -2
- package/dist/components/dateTimePicker/dateTimePicker.mjs +6 -6
- package/dist/components/dateTimePicker/index.mjs +6 -6
- package/dist/components/dateTimePicker/timePicker.mjs +4 -4
- package/dist/components/input/index.js +13 -2
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +13 -2
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.mjs +3 -3
- package/dist/components/list/list.mjs +2 -2
- package/dist/components/list/listItem.mjs +2 -2
- package/dist/components/modal/index.mjs +8 -8
- package/dist/components/modal/modal.mjs +8 -8
- package/dist/components/pagination/index.js +13 -2
- package/dist/components/pagination/index.mjs +4 -4
- package/dist/components/pagination/pagination.js +13 -2
- package/dist/components/pagination/pagination.mjs +4 -4
- package/dist/components/radio/index.mjs +3 -3
- package/dist/components/radio/radio.mjs +3 -3
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.js +301 -286
- package/dist/components/select/index.mjs +3 -4
- package/dist/components/select/select.d.mts +190 -177
- package/dist/components/select/select.d.ts +190 -177
- package/dist/components/select/select.js +301 -286
- package/dist/components/select/select.mjs +3 -4
- package/dist/components/table/index.js +43 -20
- package/dist/components/table/index.mjs +8 -8
- package/dist/components/table/table-body.d.mts +3 -2
- package/dist/components/table/table-body.d.ts +3 -2
- package/dist/components/table/table-body.js +23 -13
- package/dist/components/table/table-body.mjs +4 -4
- package/dist/components/table/table-head.d.mts +2 -2
- package/dist/components/table/table-head.d.ts +2 -2
- package/dist/components/table/table-head.js +2 -2
- package/dist/components/table/table-head.mjs +4 -4
- package/dist/components/table/table.d.mts +2 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.js +43 -20
- package/dist/components/table/table.mjs +8 -8
- package/dist/components/tabs/index.mjs +2 -2
- package/dist/components/tabs/tabs.mjs +2 -2
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/components/tooltip/index.mjs +2 -2
- package/dist/components/tooltip/tooltip.mjs +2 -2
- package/dist/components/tree/index.mjs +3 -3
- package/dist/components/tree/tree.mjs +3 -3
- package/dist/index.js +490 -494
- package/dist/index.mjs +50 -52
- package/package.json +1 -1
- package/dist/chunk-BXXAMH3R.mjs +0 -255
- package/dist/chunk-OF3X4BXG.mjs +0 -76
- package/dist/chunk-S3QS5B7F.mjs +0 -61
- package/dist/components/select/option.d.mts +0 -17
- package/dist/components/select/option.d.ts +0 -17
- package/dist/components/select/option.js +0 -4359
- package/dist/components/select/option.mjs +0 -12
- package/dist/components/select/useSelect.d.mts +0 -31
- package/dist/components/select/useSelect.d.ts +0 -31
- package/dist/components/select/useSelect.js +0 -84
- package/dist/components/select/useSelect.mjs +0 -8
- package/dist/{chunk-OUAKGMDW.mjs → chunk-2DLKV6TT.mjs} +4 -4
- package/dist/{chunk-D6QI3DJG.mjs → chunk-7H5XPHY6.mjs} +4 -4
- package/dist/{chunk-Q72LZAPG.mjs → chunk-DUPQBPI2.mjs} +3 -3
- package/dist/{chunk-VQROXH43.mjs → chunk-EWZAHXN7.mjs} +3 -3
- package/dist/{chunk-6HX3PPL6.mjs → chunk-FBAR75U4.mjs} +3 -3
- package/dist/{chunk-Z2537DF6.mjs → chunk-IL5ENWCR.mjs} +3 -3
- package/dist/{chunk-WFMFC7R6.mjs → chunk-KCOHU7X7.mjs} +4 -4
- package/dist/{chunk-PNRS23HE.mjs → chunk-MQI5SZWO.mjs} +3 -3
- package/dist/{chunk-LL6F3WDX.mjs → chunk-P5QCU457.mjs} +3 -3
- package/dist/{chunk-PZIVMTKX.mjs → chunk-SDHQUYFI.mjs} +3 -3
- package/dist/{chunk-2YMAKIZ6.mjs → chunk-SSMMWMQC.mjs} +3 -3
- package/dist/{chunk-HIVPDIEP.mjs → chunk-UFVQPPPW.mjs} +3 -3
- package/dist/{chunk-BPVRXFIC.mjs → chunk-XGYQ6D3S.mjs} +3 -3
- package/dist/{chunk-QIRL6HY6.mjs → chunk-YIIFWADW.mjs} +4 -4
package/dist/index.js
CHANGED
|
@@ -5941,7 +5941,18 @@ var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
|
|
|
5941
5941
|
),
|
|
5942
5942
|
children: [
|
|
5943
5943
|
startContent && renderStartContent(),
|
|
5944
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5944
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5945
|
+
"input",
|
|
5946
|
+
{
|
|
5947
|
+
...inputProps,
|
|
5948
|
+
ref: ref || inputRef,
|
|
5949
|
+
className: clsx(
|
|
5950
|
+
slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
5951
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
5952
|
+
),
|
|
5953
|
+
size: 0
|
|
5954
|
+
}
|
|
5955
|
+
),
|
|
5945
5956
|
renderEndContent()
|
|
5946
5957
|
]
|
|
5947
5958
|
}
|
|
@@ -5989,7 +6000,7 @@ var inputStyle = tv(
|
|
|
5989
6000
|
],
|
|
5990
6001
|
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
5991
6002
|
errorText: ["text-danger-main"],
|
|
5992
|
-
readonly: ["pointer-events-none"]
|
|
6003
|
+
readonly: ["pointer-events-none", "!text-body-foreground"]
|
|
5993
6004
|
},
|
|
5994
6005
|
variants: {
|
|
5995
6006
|
variant: {
|
|
@@ -6802,7 +6813,7 @@ var checkboxStyle = tv({
|
|
|
6802
6813
|
|
|
6803
6814
|
// src/components/table/table-head.tsx
|
|
6804
6815
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6805
|
-
var TableHead = ({ columns, slots, size,
|
|
6816
|
+
var TableHead = ({ columns, slots, size, rowCheckbox, isCheckedAll, classNames, onCheckAll }) => {
|
|
6806
6817
|
const handleClickCheckAll = (e) => {
|
|
6807
6818
|
e.preventDefault();
|
|
6808
6819
|
onCheckAll(!isCheckedAll);
|
|
@@ -6821,7 +6832,7 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
6821
6832
|
},
|
|
6822
6833
|
`${column.field}${index}thead`
|
|
6823
6834
|
));
|
|
6824
|
-
const renderSelectAllCheckbox = () =>
|
|
6835
|
+
const renderSelectAllCheckbox = () => rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: slots.th({ class: classNames == null ? void 0 : classNames.th }), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
6825
6836
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: slots.thead({ class: classNames == null ? void 0 : classNames.thead }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: [
|
|
6826
6837
|
renderColumnHeaders(),
|
|
6827
6838
|
renderSelectAllCheckbox()
|
|
@@ -6838,9 +6849,10 @@ var TableBody = ({
|
|
|
6838
6849
|
columns,
|
|
6839
6850
|
rows,
|
|
6840
6851
|
size,
|
|
6841
|
-
|
|
6852
|
+
rowCheckbox,
|
|
6842
6853
|
checkedRows,
|
|
6843
6854
|
onCheckRow,
|
|
6855
|
+
onRowClick,
|
|
6844
6856
|
emptyContent,
|
|
6845
6857
|
isLoading,
|
|
6846
6858
|
classNames,
|
|
@@ -6881,21 +6893,30 @@ var TableBody = ({
|
|
|
6881
6893
|
[classNames == null ? void 0 : classNames.td, generateColumnStyles, slots]
|
|
6882
6894
|
);
|
|
6883
6895
|
const hasRows = rows.length > 0;
|
|
6884
|
-
const colSpan = (columns.length || 1) + (
|
|
6896
|
+
const colSpan = (columns.length || 1) + (rowCheckbox ? 1 : 0);
|
|
6885
6897
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tbody", { className: clsx(slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), className), children: [
|
|
6886
6898
|
!isLoading && hasRows && rows.map((row, rowIndex) => {
|
|
6887
6899
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
6888
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
6901
|
+
"tr",
|
|
6902
|
+
{
|
|
6903
|
+
className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }),
|
|
6904
|
+
"aria-checked": isRowChecked,
|
|
6905
|
+
onClick: () => onRowClick ? onRowClick(row) : void 0,
|
|
6906
|
+
children: [
|
|
6907
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react14.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
6908
|
+
rowCheckbox && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6909
|
+
checkbox_default,
|
|
6910
|
+
{
|
|
6911
|
+
size,
|
|
6912
|
+
checked: isRowChecked,
|
|
6913
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
6914
|
+
}
|
|
6915
|
+
) }) })
|
|
6916
|
+
]
|
|
6917
|
+
},
|
|
6918
|
+
rowIndex
|
|
6919
|
+
);
|
|
6899
6920
|
}),
|
|
6900
6921
|
!isLoading && !hasRows && emptyContent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { colSpan, className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) })
|
|
6901
6922
|
] });
|
|
@@ -7233,7 +7254,8 @@ var Table = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7233
7254
|
rows,
|
|
7234
7255
|
columns,
|
|
7235
7256
|
size,
|
|
7236
|
-
|
|
7257
|
+
rowCheckbox,
|
|
7258
|
+
onRowClick,
|
|
7237
7259
|
totalData,
|
|
7238
7260
|
pagination,
|
|
7239
7261
|
onPageChange,
|
|
@@ -7270,7 +7292,7 @@ var Table = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7270
7292
|
{
|
|
7271
7293
|
columns,
|
|
7272
7294
|
size,
|
|
7273
|
-
|
|
7295
|
+
rowCheckbox,
|
|
7274
7296
|
isCheckedAll: checkedRows.size === rows.length && rows.length > 0,
|
|
7275
7297
|
onCheckAll: handleCheckAll,
|
|
7276
7298
|
classNames,
|
|
@@ -7284,8 +7306,9 @@ var Table = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7284
7306
|
rows,
|
|
7285
7307
|
columns,
|
|
7286
7308
|
size,
|
|
7287
|
-
|
|
7309
|
+
rowCheckbox,
|
|
7288
7310
|
checkedRows,
|
|
7311
|
+
onRowClick,
|
|
7289
7312
|
onCheckRow: handleCheck,
|
|
7290
7313
|
emptyContent,
|
|
7291
7314
|
isLoading,
|
|
@@ -7569,374 +7592,347 @@ var formTableStyle = tv({
|
|
|
7569
7592
|
});
|
|
7570
7593
|
|
|
7571
7594
|
// src/components/select/select.tsx
|
|
7572
|
-
var import_react20 = require("react");
|
|
7573
|
-
var import_react_dom = require("react-dom");
|
|
7574
|
-
|
|
7575
|
-
// src/components/select/useSelect.tsx
|
|
7576
7595
|
var import_react19 = require("react");
|
|
7577
|
-
var
|
|
7578
|
-
|
|
7596
|
+
var import_react_dom = require("react-dom");
|
|
7597
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7598
|
+
var Select = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
7599
|
+
var _a;
|
|
7600
|
+
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
7601
|
+
const {
|
|
7602
|
+
label,
|
|
7603
|
+
options,
|
|
7604
|
+
helperText,
|
|
7605
|
+
errorText,
|
|
7606
|
+
classNames,
|
|
7607
|
+
defaultSelectedOptions = [],
|
|
7608
|
+
onChange,
|
|
7609
|
+
multiple,
|
|
7610
|
+
...inputProps
|
|
7611
|
+
} = props;
|
|
7612
|
+
const slots = (0, import_react19.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
7613
|
+
const [selectedOptions, setSelectedOptions] = (0, import_react19.useState)(defaultSelectedOptions);
|
|
7579
7614
|
const [targetRect, setTargetRect] = (0, import_react19.useState)(null);
|
|
7580
7615
|
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react19.useState)(0);
|
|
7616
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
|
|
7617
|
+
const [isOpen, setIsOpen] = (0, import_react19.useState)(false);
|
|
7581
7618
|
const selectWrapperRef = (0, import_react19.useRef)(null);
|
|
7582
7619
|
const optionWrapperRef = (0, import_react19.useRef)(null);
|
|
7583
|
-
const
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7620
|
+
const handleToggleSelect = () => {
|
|
7621
|
+
if (isOpen) {
|
|
7622
|
+
setIsOpen(false);
|
|
7623
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
7624
|
+
} else {
|
|
7625
|
+
if (selectWrapperRef.current) {
|
|
7626
|
+
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
7627
|
+
setTargetRect(rect);
|
|
7628
|
+
setIsVisible(true);
|
|
7629
|
+
requestAnimationFrame(() => setIsOpen(true));
|
|
7630
|
+
}
|
|
7631
|
+
}
|
|
7632
|
+
};
|
|
7633
|
+
const calculatePositionWithScroll = (rect, height) => {
|
|
7634
|
+
const scrollTop = window.scrollY;
|
|
7635
|
+
const scrollLeft = window.scrollX;
|
|
7636
|
+
const spaceBelow = window.innerHeight - (rect.y + rect.height + 4);
|
|
7637
|
+
const spaceAbove = rect.y - 4;
|
|
7638
|
+
const top = spaceBelow < height && spaceAbove > height ? rect.y - height - 4 : rect.y + rect.height + 4;
|
|
7589
7639
|
return {
|
|
7590
7640
|
top: top + scrollTop,
|
|
7591
|
-
left:
|
|
7641
|
+
left: rect.x + scrollLeft
|
|
7592
7642
|
};
|
|
7593
7643
|
};
|
|
7594
|
-
const handleToggleSelect = () => {
|
|
7595
|
-
if (selectWrapperRef.current) {
|
|
7596
|
-
const rect = selectWrapperRef.current.getBoundingClientRect();
|
|
7597
|
-
setTargetRect((prevRect) => prevRect ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height });
|
|
7598
|
-
}
|
|
7599
|
-
};
|
|
7600
7644
|
const handleChangeOption = (option) => {
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7645
|
+
let nextOptions;
|
|
7646
|
+
if (multiple) {
|
|
7647
|
+
const exists = selectedOptions.some((o) => o.key === option.key);
|
|
7648
|
+
nextOptions = exists ? selectedOptions.filter((o) => o.key !== option.key) : [...selectedOptions, option];
|
|
7649
|
+
} else {
|
|
7650
|
+
nextOptions = [option];
|
|
7651
|
+
setIsOpen(false);
|
|
7652
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
7653
|
+
}
|
|
7654
|
+
setSelectedOptions(nextOptions);
|
|
7655
|
+
onChange == null ? void 0 : onChange(nextOptions);
|
|
7604
7656
|
};
|
|
7605
7657
|
(0, import_react19.useEffect)(() => {
|
|
7606
|
-
const
|
|
7607
|
-
|
|
7608
|
-
|
|
7658
|
+
const handleClickOutside = (e) => {
|
|
7659
|
+
var _a2;
|
|
7660
|
+
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target) && !((_a2 = selectWrapperRef.current) == null ? void 0 : _a2.contains(e.target))) {
|
|
7661
|
+
setIsOpen(false);
|
|
7662
|
+
setTimeout(() => setIsVisible(false), 150);
|
|
7609
7663
|
}
|
|
7610
7664
|
};
|
|
7611
|
-
window.addEventListener("mousedown",
|
|
7612
|
-
return () => window.removeEventListener("mousedown",
|
|
7665
|
+
window.addEventListener("mousedown", handleClickOutside);
|
|
7666
|
+
return () => window.removeEventListener("mousedown", handleClickOutside);
|
|
7613
7667
|
}, []);
|
|
7614
7668
|
(0, import_react19.useEffect)(() => {
|
|
7615
7669
|
if (optionWrapperRef.current) {
|
|
7616
7670
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
7617
7671
|
}
|
|
7618
7672
|
}, [targetRect]);
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7673
|
+
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
7674
|
+
const displayValue = multiple ? selectedOptions.map((opt) => opt.value).join(", ") : ((_a = selectedOptions[0]) == null ? void 0 : _a.value) || "";
|
|
7675
|
+
const Option = ({
|
|
7676
|
+
option,
|
|
7677
|
+
isSelected,
|
|
7678
|
+
onClick
|
|
7679
|
+
}) => {
|
|
7680
|
+
const slot = select({ ...variantProps, isSelected });
|
|
7681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { title: option.value, onClick, className: clsx(slot.option({ class: classNames == null ? void 0 : classNames.option })), children: [
|
|
7682
|
+
option.value,
|
|
7683
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name: "check", size: originalProps.size })
|
|
7684
|
+
] });
|
|
7628
7685
|
};
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
},
|
|
7681
|
-
lg: {
|
|
7682
|
-
base: "text-lg px-[10px] py-[8px]"
|
|
7683
|
-
},
|
|
7684
|
-
xl: {
|
|
7685
|
-
base: "text-xl px-[10px] py-[8px]"
|
|
7686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
7687
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7688
|
+
"div",
|
|
7689
|
+
{
|
|
7690
|
+
className: clsx(
|
|
7691
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
7692
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
7693
|
+
),
|
|
7694
|
+
children: [
|
|
7695
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
7696
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
7697
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7698
|
+
"div",
|
|
7699
|
+
{
|
|
7700
|
+
"data-expanded": isOpen,
|
|
7701
|
+
className: clsx(
|
|
7702
|
+
slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
7703
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
7704
|
+
),
|
|
7705
|
+
ref: selectWrapperRef,
|
|
7706
|
+
onClick: handleToggleSelect,
|
|
7707
|
+
children: [
|
|
7708
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7709
|
+
"input",
|
|
7710
|
+
{
|
|
7711
|
+
...inputProps,
|
|
7712
|
+
ref,
|
|
7713
|
+
className: clsx(
|
|
7714
|
+
slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
7715
|
+
inputProps.readOnly ? "!text-body-foreground placeholder:text-body-foreground" : ""
|
|
7716
|
+
),
|
|
7717
|
+
value: displayValue,
|
|
7718
|
+
readOnly: true,
|
|
7719
|
+
size: 0
|
|
7720
|
+
}
|
|
7721
|
+
),
|
|
7722
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7723
|
+
Icon_default,
|
|
7724
|
+
{
|
|
7725
|
+
name: "brace-up",
|
|
7726
|
+
size: originalProps.size,
|
|
7727
|
+
className: `transition-transform duration-200 ${isOpen ? "rotate-0" : "rotate-180"}`
|
|
7728
|
+
}
|
|
7729
|
+
)
|
|
7730
|
+
]
|
|
7731
|
+
}
|
|
7732
|
+
),
|
|
7733
|
+
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
7734
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
7735
|
+
] })
|
|
7736
|
+
]
|
|
7686
7737
|
}
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
variant: "normal",
|
|
7691
|
-
color: "primary",
|
|
7692
|
-
size: "md"
|
|
7693
|
-
}
|
|
7694
|
-
});
|
|
7695
|
-
|
|
7696
|
-
// src/components/select/select.tsx
|
|
7697
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7698
|
-
var Select = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
7699
|
-
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
7700
|
-
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
7701
|
-
const slots = (0, import_react20.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
7702
|
-
const {
|
|
7703
|
-
targetRect,
|
|
7704
|
-
selectedOption,
|
|
7705
|
-
optionWrapperHeight,
|
|
7706
|
-
selectWrapperRef,
|
|
7707
|
-
optionWrapperRef,
|
|
7708
|
-
handleToggleSelect,
|
|
7709
|
-
handleChangeOption,
|
|
7710
|
-
calculatePositionWithScroll
|
|
7711
|
-
} = useSelect({
|
|
7712
|
-
options,
|
|
7713
|
-
defaultOption,
|
|
7714
|
-
onChange
|
|
7715
|
-
});
|
|
7716
|
-
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
7717
|
-
const getBaseProps = (0, import_react20.useCallback)(
|
|
7718
|
-
() => ({
|
|
7719
|
-
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
7720
|
-
}),
|
|
7721
|
-
[slots, classNames]
|
|
7722
|
-
);
|
|
7723
|
-
const getLabelProps = (0, import_react20.useCallback)(
|
|
7724
|
-
() => ({
|
|
7725
|
-
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
7726
|
-
}),
|
|
7727
|
-
[slots, classNames]
|
|
7728
|
-
);
|
|
7729
|
-
const getSelectWrapperProps = (0, import_react20.useCallback)(
|
|
7730
|
-
() => ({
|
|
7731
|
-
className: slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
7732
|
-
ref: selectWrapperRef,
|
|
7733
|
-
onClick: handleToggleSelect
|
|
7734
|
-
}),
|
|
7735
|
-
[slots, classNames]
|
|
7736
|
-
);
|
|
7737
|
-
const getSelectProps = (0, import_react20.useCallback)(
|
|
7738
|
-
() => ({
|
|
7739
|
-
...inputProps,
|
|
7740
|
-
ref,
|
|
7741
|
-
className: slots.select({ class: classNames == null ? void 0 : classNames.select }),
|
|
7742
|
-
value: (selectedOption == null ? void 0 : selectedOption.value) || "",
|
|
7743
|
-
readOnly: true,
|
|
7744
|
-
size: 0
|
|
7745
|
-
}),
|
|
7746
|
-
[slots, classNames, inputProps, selectedOption, ref]
|
|
7747
|
-
);
|
|
7748
|
-
const getOptionsWrapperProps = (0, import_react20.useCallback)(
|
|
7749
|
-
() => ({
|
|
7750
|
-
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
7751
|
-
ref: optionWrapperRef
|
|
7752
|
-
}),
|
|
7753
|
-
[slots, classNames]
|
|
7754
|
-
);
|
|
7755
|
-
const getErrorMessageProps = (0, import_react20.useCallback)(
|
|
7756
|
-
() => ({
|
|
7757
|
-
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
7758
|
-
}),
|
|
7759
|
-
[slots, classNames]
|
|
7760
|
-
);
|
|
7761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
7762
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { ...getBaseProps(), children: [
|
|
7763
|
-
props.label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
7764
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { "data-expanded": !!targetRect, ...getSelectWrapperProps(), children: [
|
|
7765
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { ...getSelectProps() }),
|
|
7766
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon_default, { name: !!targetRect ? "arrow-triangle-up" : "arrow-triangle-down", size: originalProps.size, fill: true })
|
|
7767
|
-
] }),
|
|
7768
|
-
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
7769
|
-
] }),
|
|
7770
|
-
targetRect && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children: (0, import_react_dom.createPortal)(
|
|
7771
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
7738
|
+
),
|
|
7739
|
+
isVisible && (0, import_react_dom.createPortal)(
|
|
7740
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7772
7741
|
"div",
|
|
7773
7742
|
{
|
|
7774
|
-
|
|
7743
|
+
ref: optionWrapperRef,
|
|
7744
|
+
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
7775
7745
|
style: {
|
|
7776
7746
|
position: "absolute",
|
|
7777
7747
|
top: position == null ? void 0 : position.top,
|
|
7778
7748
|
left: position == null ? void 0 : position.left,
|
|
7779
|
-
width: targetRect.width
|
|
7749
|
+
width: targetRect == null ? void 0 : targetRect.width,
|
|
7750
|
+
zIndex: 1e3,
|
|
7751
|
+
opacity: isOpen ? 1 : 0,
|
|
7752
|
+
transform: isOpen ? "translateY(0)" : "translateY(-0.25rem)",
|
|
7753
|
+
transition: "opacity 150ms ease-out, transform 150ms ease-out"
|
|
7780
7754
|
},
|
|
7781
|
-
children: options.map((option) =>
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7787
|
-
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
|
|
7793
|
-
))
|
|
7755
|
+
children: options.map((option) => {
|
|
7756
|
+
const isSelected = selectedOptions.some((o) => o.key === option.key);
|
|
7757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
7758
|
+
Option,
|
|
7759
|
+
{
|
|
7760
|
+
option,
|
|
7761
|
+
isSelected,
|
|
7762
|
+
onClick: () => handleChangeOption(option)
|
|
7763
|
+
},
|
|
7764
|
+
option.key
|
|
7765
|
+
);
|
|
7766
|
+
})
|
|
7794
7767
|
}
|
|
7795
7768
|
),
|
|
7796
7769
|
document.body
|
|
7797
|
-
)
|
|
7770
|
+
)
|
|
7798
7771
|
] });
|
|
7799
7772
|
});
|
|
7800
7773
|
Select.displayName = "Select";
|
|
7801
7774
|
var select_default = Select;
|
|
7802
7775
|
var select = tv({
|
|
7803
7776
|
slots: {
|
|
7804
|
-
base: ["group/select", "flex
|
|
7805
|
-
|
|
7777
|
+
base: ["group/select", "flex"],
|
|
7778
|
+
vertical: ["flex-col"],
|
|
7779
|
+
horizon: ["flex-row", "gap-0"],
|
|
7780
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
7781
|
+
wrapper: ["flex", "flex-col"],
|
|
7806
7782
|
selectWrapper: [
|
|
7807
7783
|
"flex",
|
|
7808
7784
|
"items-center",
|
|
7809
|
-
"
|
|
7810
|
-
"border
|
|
7811
|
-
"
|
|
7812
|
-
"
|
|
7813
|
-
"
|
|
7814
|
-
"group-has-[p]/select:
|
|
7785
|
+
"justify-between",
|
|
7786
|
+
"border",
|
|
7787
|
+
"cursor-pointer",
|
|
7788
|
+
"text-neutral-main",
|
|
7789
|
+
"hover:bg-trans-soft",
|
|
7790
|
+
"group-has-[p.error]/select:border-danger-main",
|
|
7791
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
7792
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
7793
|
+
"group-has-[p.error]/select:hover:bg-danger-soft"
|
|
7815
7794
|
],
|
|
7816
7795
|
select: [
|
|
7817
|
-
"w-full",
|
|
7818
7796
|
"bg-transparent",
|
|
7819
|
-
"
|
|
7820
|
-
"
|
|
7821
|
-
"cursor-pointer",
|
|
7797
|
+
"w-full",
|
|
7798
|
+
"outline-none",
|
|
7822
7799
|
"placeholder:text-neutral-main",
|
|
7823
|
-
"
|
|
7824
|
-
"
|
|
7800
|
+
"text-neutral-dark",
|
|
7801
|
+
"group-has-[p.error]/select:text-danger-main",
|
|
7802
|
+
"group-has-[p.error]/select:placeholder:text-danger-main"
|
|
7825
7803
|
],
|
|
7826
|
-
optionsWrapper: ["
|
|
7827
|
-
|
|
7804
|
+
optionsWrapper: ["border", "rounded", "bg-white", "shadow", "overflow-auto"],
|
|
7805
|
+
option: ["flex", "justify-between", "items-center", "cursor-pointer"],
|
|
7806
|
+
helperText: ["text-neutral-main"],
|
|
7807
|
+
errorText: ["text-danger-main"],
|
|
7808
|
+
readonly: ["pointer-events-none", "!bg-trans-soft"]
|
|
7828
7809
|
},
|
|
7829
7810
|
variants: {
|
|
7830
|
-
variant: {
|
|
7831
|
-
solid: {
|
|
7832
|
-
selectWrapper: "bg-trans-soft hover:bg-trans-light data-[expanded=true]:bg-trans-light group-has-[p]/select:bg-danger-soft"
|
|
7833
|
-
},
|
|
7834
|
-
normal: {
|
|
7835
|
-
selectWrapper: "border hover:bg-trans-soft data-[expanded=true]:bg-trans-soft"
|
|
7836
|
-
},
|
|
7837
|
-
line: {
|
|
7838
|
-
selectWrapper: "border-b !rounded-none hover:bg-trans-soft data-[expanded=true]:bg-trans-soft",
|
|
7839
|
-
optionsWrapper: "!rounded-none"
|
|
7840
|
-
}
|
|
7841
|
-
},
|
|
7842
7811
|
color: {
|
|
7843
7812
|
primary: {
|
|
7844
|
-
selectWrapper: "
|
|
7845
|
-
|
|
7846
|
-
select: "data-[expanded=true]:text-primary-main"
|
|
7813
|
+
selectWrapper: ["hover:text-primary-main"],
|
|
7814
|
+
option: ["hover:bg-primary-soft", "hover:text-primary-main"]
|
|
7847
7815
|
},
|
|
7848
7816
|
secondary: {
|
|
7849
|
-
selectWrapper: "
|
|
7850
|
-
|
|
7851
|
-
|
|
7817
|
+
selectWrapper: ["hover:text-secondary-main"],
|
|
7818
|
+
select: ["text-secondary-main"],
|
|
7819
|
+
option: ["hover:bg-secondary-soft", "hover:text-secondary-main"]
|
|
7852
7820
|
}
|
|
7853
7821
|
},
|
|
7854
7822
|
size: {
|
|
7855
7823
|
sm: {
|
|
7856
|
-
base: "text-sm gap-[
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7824
|
+
base: ["text-sm", "gap-[4px]"],
|
|
7825
|
+
label: ["text-sm"],
|
|
7826
|
+
wrapper: ["gap-[4px]"],
|
|
7827
|
+
selectWrapper: ["w-[240px]", "h-[24px]", "rounded-sm", "px-[4px]"],
|
|
7828
|
+
select: ["text-sm"],
|
|
7829
|
+
option: ["px-[4px]", "py-[3px]", "text-sm"],
|
|
7830
|
+
helperText: ["text-sm"],
|
|
7831
|
+
errorText: ["text-sm"]
|
|
7860
7832
|
},
|
|
7861
7833
|
md: {
|
|
7862
|
-
base: "text-md gap-[
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7834
|
+
base: ["text-md", "gap-[6px]", "rounded-md"],
|
|
7835
|
+
label: ["text-md"],
|
|
7836
|
+
wrapper: ["gap-[6px]"],
|
|
7837
|
+
selectWrapper: ["w-[240px]", "h-[32px]", "rounded-md", "px-[6px]"],
|
|
7838
|
+
select: ["text-md"],
|
|
7839
|
+
option: ["px-[6px]", "py-[5.5px]", "text-md"],
|
|
7840
|
+
helperText: ["text-sm"],
|
|
7841
|
+
errorText: ["text-sm"]
|
|
7866
7842
|
},
|
|
7867
7843
|
lg: {
|
|
7868
|
-
base: "text-lg gap-[
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7844
|
+
base: ["text-lg", "gap-[8px]"],
|
|
7845
|
+
label: ["text-lg"],
|
|
7846
|
+
wrapper: ["gap-[8px]"],
|
|
7847
|
+
selectWrapper: ["w-[240px]", "h-[40px]", "rounded-lg", "px-[8px]"],
|
|
7848
|
+
select: ["text-lg"],
|
|
7849
|
+
option: ["px-[8px]", "py-[8px]", "text-lg"],
|
|
7850
|
+
helperText: ["text-md"],
|
|
7851
|
+
errorText: ["text-md"]
|
|
7872
7852
|
},
|
|
7873
7853
|
xl: {
|
|
7874
|
-
base: "text-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7854
|
+
base: ["text-xl", "gap-[10px]"],
|
|
7855
|
+
label: ["text-xl"],
|
|
7856
|
+
wrapper: ["gap-[10px]"],
|
|
7857
|
+
selectWrapper: ["w-[240px]", "h-[50px]", "rounded-lg", "px-[10px]"],
|
|
7858
|
+
select: ["text-xl"],
|
|
7859
|
+
option: ["px-[10px]", "py-[11.5px]"],
|
|
7860
|
+
helperText: ["text-md"],
|
|
7861
|
+
errorText: ["text-md"]
|
|
7878
7862
|
}
|
|
7879
7863
|
},
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
selectWrapper: "rounded-none",
|
|
7884
|
-
optionsWrapper: "rounded-none"
|
|
7885
|
-
},
|
|
7886
|
-
full: {
|
|
7887
|
-
selectWrapper: "rounded-full"
|
|
7888
|
-
}
|
|
7864
|
+
direction: {
|
|
7865
|
+
vertical: "",
|
|
7866
|
+
horizon: ""
|
|
7889
7867
|
},
|
|
7890
|
-
|
|
7868
|
+
full: {
|
|
7891
7869
|
true: {
|
|
7892
|
-
|
|
7893
|
-
|
|
7870
|
+
base: ["w-full"],
|
|
7871
|
+
wrapper: ["w-full"],
|
|
7872
|
+
selectWrapper: ["w-full"]
|
|
7894
7873
|
}
|
|
7895
7874
|
},
|
|
7896
|
-
|
|
7875
|
+
disabled: {
|
|
7897
7876
|
true: {
|
|
7898
|
-
base: "
|
|
7899
|
-
selectWrapper:
|
|
7900
|
-
|
|
7901
|
-
|
|
7877
|
+
base: ["pointer-events-none"],
|
|
7878
|
+
selectWrapper: [
|
|
7879
|
+
"bg-neutral-soft",
|
|
7880
|
+
"border-neutral-light",
|
|
7881
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
7882
|
+
"group-has-[p.error]/select:bg-danger-soft",
|
|
7883
|
+
"group-has-[p.error]/select:border-danger-light"
|
|
7884
|
+
],
|
|
7885
|
+
select: [
|
|
7886
|
+
"text-neutral-light",
|
|
7887
|
+
"placeholder:text-neutral-light",
|
|
7888
|
+
"group-has-[p.error]/select:text-danger-light",
|
|
7889
|
+
"group-has-[p.error]/select:placeholder:text-danger-light"
|
|
7890
|
+
],
|
|
7891
|
+
helperText: ["!text-neutral-light"],
|
|
7892
|
+
errorText: ["!text-danger-light"]
|
|
7902
7893
|
}
|
|
7903
7894
|
},
|
|
7904
|
-
|
|
7905
|
-
true:
|
|
7906
|
-
|
|
7907
|
-
}
|
|
7895
|
+
isSelected: {
|
|
7896
|
+
true: "",
|
|
7897
|
+
false: ""
|
|
7908
7898
|
}
|
|
7909
7899
|
},
|
|
7910
|
-
defaultVariants: {
|
|
7911
|
-
variant: "solid",
|
|
7912
|
-
color: "primary",
|
|
7913
|
-
size: "md",
|
|
7914
|
-
fullWidth: false,
|
|
7915
|
-
isDisabled: false,
|
|
7916
|
-
isRequired: false
|
|
7917
|
-
},
|
|
7918
7900
|
compoundVariants: [
|
|
7919
7901
|
{
|
|
7920
|
-
|
|
7921
|
-
|
|
7902
|
+
color: "primary",
|
|
7903
|
+
isSelected: true,
|
|
7922
7904
|
class: {
|
|
7923
|
-
|
|
7905
|
+
option: "bg-primary-soft text-primary-main"
|
|
7906
|
+
}
|
|
7907
|
+
},
|
|
7908
|
+
{
|
|
7909
|
+
color: "secondary",
|
|
7910
|
+
isSelected: true,
|
|
7911
|
+
class: {
|
|
7912
|
+
option: "bg-secondary-soft text-secondary-main"
|
|
7924
7913
|
}
|
|
7925
7914
|
}
|
|
7926
|
-
]
|
|
7915
|
+
],
|
|
7916
|
+
defaultVariants: {
|
|
7917
|
+
color: "primary",
|
|
7918
|
+
size: "md",
|
|
7919
|
+
direction: "vertical",
|
|
7920
|
+
disabled: false,
|
|
7921
|
+
readonly: false
|
|
7922
|
+
}
|
|
7927
7923
|
});
|
|
7928
7924
|
|
|
7929
7925
|
// src/components/chip/chip.tsx
|
|
7930
|
-
var
|
|
7931
|
-
var
|
|
7932
|
-
var Chip = (0,
|
|
7926
|
+
var import_react20 = require("react");
|
|
7927
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7928
|
+
var Chip = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
7933
7929
|
var _a;
|
|
7934
7930
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
7935
7931
|
const props = { ...rawProps, ...variantProps };
|
|
7936
7932
|
const Component = props.onClick ? "button" : "div";
|
|
7937
|
-
const slots = (0,
|
|
7938
|
-
const renderIcon = (name) => name ? /* @__PURE__ */ (0,
|
|
7939
|
-
return /* @__PURE__ */ (0,
|
|
7933
|
+
const slots = (0, import_react20.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
7934
|
+
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
7935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
7940
7936
|
Component,
|
|
7941
7937
|
{
|
|
7942
7938
|
ref,
|
|
@@ -8112,13 +8108,13 @@ var chipStyle = tv({
|
|
|
8112
8108
|
});
|
|
8113
8109
|
|
|
8114
8110
|
// src/components/radio/radio.tsx
|
|
8115
|
-
var
|
|
8116
|
-
var
|
|
8117
|
-
var Radio = (0,
|
|
8111
|
+
var import_react21 = require("react");
|
|
8112
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8113
|
+
var Radio = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
8118
8114
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
8119
8115
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
8120
|
-
const slots = (0,
|
|
8121
|
-
return /* @__PURE__ */ (0,
|
|
8116
|
+
const slots = (0, import_react21.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
8117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
8122
8118
|
"label",
|
|
8123
8119
|
{
|
|
8124
8120
|
className: clsx(
|
|
@@ -8126,9 +8122,9 @@ var Radio = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
8126
8122
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
8127
8123
|
),
|
|
8128
8124
|
children: [
|
|
8129
|
-
/* @__PURE__ */ (0,
|
|
8130
|
-
/* @__PURE__ */ (0,
|
|
8131
|
-
/* @__PURE__ */ (0,
|
|
8125
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { ...inputProps, type: "radio", ref }) }),
|
|
8126
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.outerDot({ class: classNames == null ? void 0 : classNames.outerDot }), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.innerDot({ class: classNames == null ? void 0 : classNames.innerDot }) }) }),
|
|
8127
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }), children: children && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children }) })
|
|
8132
8128
|
]
|
|
8133
8129
|
}
|
|
8134
8130
|
);
|
|
@@ -8268,21 +8264,21 @@ var radioStyle = tv({
|
|
|
8268
8264
|
});
|
|
8269
8265
|
|
|
8270
8266
|
// src/components/switch/switch.tsx
|
|
8271
|
-
var
|
|
8272
|
-
var
|
|
8273
|
-
var
|
|
8274
|
-
var Switch = (0,
|
|
8267
|
+
var import_react22 = require("react");
|
|
8268
|
+
var import_tailwind_variants20 = require("tailwind-variants");
|
|
8269
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8270
|
+
var Switch = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
8275
8271
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
8276
8272
|
const { size, color, isDisabled, disableAnimation, id, classNames, ...inputProps } = { ...rawProps, ...variantProps };
|
|
8277
|
-
const slots = (0,
|
|
8278
|
-
return /* @__PURE__ */ (0,
|
|
8279
|
-
/* @__PURE__ */ (0,
|
|
8280
|
-
/* @__PURE__ */ (0,
|
|
8273
|
+
const slots = (0, import_react22.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
8274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { ...inputProps, id, ref, type: "checkbox", disabled: isDisabled, className: "hidden" }),
|
|
8276
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.outerWrapper({ class: classNames == null ? void 0 : classNames.outerWrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb }) }) }) })
|
|
8281
8277
|
] });
|
|
8282
8278
|
});
|
|
8283
8279
|
Switch.displayName = "Switch";
|
|
8284
8280
|
var switch_default = Switch;
|
|
8285
|
-
var switchStyle = (0,
|
|
8281
|
+
var switchStyle = (0, import_tailwind_variants20.tv)({
|
|
8286
8282
|
slots: {
|
|
8287
8283
|
base: ["group/switch", "relative", "max-w-fit", "inline-flex", "items-center", "justify-start", "cursor-pointer"],
|
|
8288
8284
|
outerWrapper: [
|
|
@@ -8387,7 +8383,7 @@ var switchStyle = (0, import_tailwind_variants21.tv)({
|
|
|
8387
8383
|
});
|
|
8388
8384
|
|
|
8389
8385
|
// src/components/tooltip/tooltip.tsx
|
|
8390
|
-
var
|
|
8386
|
+
var import_react24 = require("react");
|
|
8391
8387
|
var import_react_dom2 = require("react-dom");
|
|
8392
8388
|
|
|
8393
8389
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -8510,11 +8506,11 @@ var getTailStyles = (placement) => {
|
|
|
8510
8506
|
};
|
|
8511
8507
|
|
|
8512
8508
|
// src/components/tooltip/useTooltip.ts
|
|
8513
|
-
var
|
|
8509
|
+
var import_react23 = require("react");
|
|
8514
8510
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
8515
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
8516
|
-
const tooltipRef = (0,
|
|
8517
|
-
(0,
|
|
8511
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react23.useState)({ x: 0, y: 0 });
|
|
8512
|
+
const tooltipRef = (0, import_react23.useRef)(null);
|
|
8513
|
+
(0, import_react23.useEffect)(() => {
|
|
8518
8514
|
if (targetRect && tooltipRef.current) {
|
|
8519
8515
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
8520
8516
|
const scrollX = window.scrollX;
|
|
@@ -8544,29 +8540,29 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
8544
8540
|
};
|
|
8545
8541
|
|
|
8546
8542
|
// src/components/tooltip/tooltip.tsx
|
|
8547
|
-
var
|
|
8548
|
-
var Tooltip = (0,
|
|
8543
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8544
|
+
var Tooltip = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
8549
8545
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
8550
8546
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames } = props;
|
|
8551
|
-
const slots = (0,
|
|
8552
|
-
const [targetRect, setTargetRect] = (0,
|
|
8547
|
+
const slots = (0, import_react24.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
8548
|
+
const [targetRect, setTargetRect] = (0, import_react24.useState)(null);
|
|
8553
8549
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
8554
8550
|
placement,
|
|
8555
8551
|
offset,
|
|
8556
8552
|
delay,
|
|
8557
8553
|
targetRect
|
|
8558
8554
|
});
|
|
8559
|
-
const childrenRef = (0,
|
|
8560
|
-
const delayTimeoutRef = (0,
|
|
8561
|
-
const getProps = (0,
|
|
8555
|
+
const childrenRef = (0, import_react24.useRef)(null);
|
|
8556
|
+
const delayTimeoutRef = (0, import_react24.useRef)(null);
|
|
8557
|
+
const getProps = (0, import_react24.useCallback)(
|
|
8562
8558
|
(slotKey, classNameKey) => ({
|
|
8563
8559
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
8564
8560
|
}),
|
|
8565
8561
|
[slots, classNames]
|
|
8566
8562
|
);
|
|
8567
|
-
const getBaseProps = (0,
|
|
8568
|
-
const getContentProps = (0,
|
|
8569
|
-
const showTooltip = (0,
|
|
8563
|
+
const getBaseProps = (0, import_react24.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
8564
|
+
const getContentProps = (0, import_react24.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
8565
|
+
const showTooltip = (0, import_react24.useCallback)(() => {
|
|
8570
8566
|
if (childrenRef.current) {
|
|
8571
8567
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
8572
8568
|
setTargetRect({
|
|
@@ -8579,16 +8575,16 @@ var Tooltip = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
8579
8575
|
});
|
|
8580
8576
|
}
|
|
8581
8577
|
}, []);
|
|
8582
|
-
const hideTooltip = (0,
|
|
8578
|
+
const hideTooltip = (0, import_react24.useCallback)(() => {
|
|
8583
8579
|
if (!persistent) {
|
|
8584
8580
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
8585
8581
|
}
|
|
8586
8582
|
}, [persistent, delay]);
|
|
8587
|
-
(0,
|
|
8583
|
+
(0, import_react24.useEffect)(() => {
|
|
8588
8584
|
if (persistent) showTooltip();
|
|
8589
8585
|
}, [persistent, showTooltip]);
|
|
8590
|
-
return /* @__PURE__ */ (0,
|
|
8591
|
-
/* @__PURE__ */ (0,
|
|
8586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
8587
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8592
8588
|
"div",
|
|
8593
8589
|
{
|
|
8594
8590
|
ref: (node) => {
|
|
@@ -8605,7 +8601,7 @@ var Tooltip = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
8605
8601
|
}
|
|
8606
8602
|
),
|
|
8607
8603
|
targetRect && (0, import_react_dom2.createPortal)(
|
|
8608
|
-
/* @__PURE__ */ (0,
|
|
8604
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8609
8605
|
"div",
|
|
8610
8606
|
{
|
|
8611
8607
|
ref: tooltipRef,
|
|
@@ -8618,7 +8614,7 @@ var Tooltip = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
|
8618
8614
|
},
|
|
8619
8615
|
children: [
|
|
8620
8616
|
props.content,
|
|
8621
|
-
variantProps.tail && /* @__PURE__ */ (0,
|
|
8617
|
+
variantProps.tail && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8622
8618
|
"div",
|
|
8623
8619
|
{
|
|
8624
8620
|
className: `absolute h-2 w-2 rotate-45 bg-inherit ${getTailClassName(placement)}`,
|
|
@@ -8669,10 +8665,10 @@ var tooltipStyle = tv({
|
|
|
8669
8665
|
});
|
|
8670
8666
|
|
|
8671
8667
|
// src/components/modal/modal.tsx
|
|
8672
|
-
var
|
|
8668
|
+
var import_react25 = require("react");
|
|
8673
8669
|
var import_react_dom3 = require("react-dom");
|
|
8674
|
-
var
|
|
8675
|
-
var Modal = (0,
|
|
8670
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8671
|
+
var Modal = (0, import_react25.forwardRef)((props, ref) => {
|
|
8676
8672
|
const [localProps, variantProps] = mapPropsVariants(props, modal.variantKeys);
|
|
8677
8673
|
const {
|
|
8678
8674
|
classNames,
|
|
@@ -8686,8 +8682,8 @@ var Modal = (0, import_react26.forwardRef)((props, ref) => {
|
|
|
8686
8682
|
onConfirm,
|
|
8687
8683
|
onCancel
|
|
8688
8684
|
} = localProps;
|
|
8689
|
-
const slots = (0,
|
|
8690
|
-
(0,
|
|
8685
|
+
const slots = (0, import_react25.useMemo)(() => modal(variantProps), [variantProps]);
|
|
8686
|
+
(0, import_react25.useEffect)(() => {
|
|
8691
8687
|
document.body.classList.toggle("overflow-hidden", !!isOpen);
|
|
8692
8688
|
if (!isOpen || isKeyboardDismissDisabled) return;
|
|
8693
8689
|
const handleKeyDown = (e) => {
|
|
@@ -8701,10 +8697,10 @@ var Modal = (0, import_react26.forwardRef)((props, ref) => {
|
|
|
8701
8697
|
}, [isOpen, isKeyboardDismissDisabled, onCancel]);
|
|
8702
8698
|
if (!isOpen) return null;
|
|
8703
8699
|
return (0, import_react_dom3.createPortal)(
|
|
8704
|
-
/* @__PURE__ */ (0,
|
|
8705
|
-
/* @__PURE__ */ (0,
|
|
8706
|
-
/* @__PURE__ */ (0,
|
|
8707
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
8700
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
8701
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(backdrop_default, { open: true }),
|
|
8702
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }), children: [
|
|
8703
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
8708
8704
|
Icon_default,
|
|
8709
8705
|
{
|
|
8710
8706
|
size: "xl",
|
|
@@ -8713,12 +8709,12 @@ var Modal = (0, import_react26.forwardRef)((props, ref) => {
|
|
|
8713
8709
|
onClick: onCancel
|
|
8714
8710
|
}
|
|
8715
8711
|
),
|
|
8716
|
-
/* @__PURE__ */ (0,
|
|
8717
|
-
title && /* @__PURE__ */ (0,
|
|
8718
|
-
typeof content === "string" ? /* @__PURE__ */ (0,
|
|
8719
|
-
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0,
|
|
8720
|
-
cancelButtonText && /* @__PURE__ */ (0,
|
|
8721
|
-
confirmButtonText && /* @__PURE__ */ (0,
|
|
8712
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
8713
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
8714
|
+
typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: slots.content({ class: classNames == null ? void 0 : classNames.content }), children: content }) : content,
|
|
8715
|
+
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: slots.footer({ class: classNames == null ? void 0 : classNames.footer }), children: [
|
|
8716
|
+
cancelButtonText && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(button_default, { variant: "soft", color: "neutral", fullWidth: true, onClick: onCancel, children: cancelButtonText }),
|
|
8717
|
+
confirmButtonText && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(button_default, { color: props.color, fullWidth: true, onClick: onConfirm, children: confirmButtonText })
|
|
8722
8718
|
] })
|
|
8723
8719
|
] })
|
|
8724
8720
|
] }) })
|
|
@@ -8784,15 +8780,15 @@ var modal = tv({
|
|
|
8784
8780
|
});
|
|
8785
8781
|
|
|
8786
8782
|
// src/components/list/list.tsx
|
|
8787
|
-
var
|
|
8788
|
-
var
|
|
8789
|
-
var List = (0,
|
|
8783
|
+
var import_react26 = require("react");
|
|
8784
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8785
|
+
var List = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
8790
8786
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
8791
8787
|
const { children, classNames } = props;
|
|
8792
|
-
const slots = (0,
|
|
8793
|
-
return /* @__PURE__ */ (0,
|
|
8794
|
-
if (!(0,
|
|
8795
|
-
return (0,
|
|
8788
|
+
const slots = (0, import_react26.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
8789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react26.Children.map(children, (child) => {
|
|
8790
|
+
if (!(0, import_react26.isValidElement)(child)) return child;
|
|
8791
|
+
return (0, import_react26.cloneElement)(child, {
|
|
8796
8792
|
...variantProps,
|
|
8797
8793
|
...child.props
|
|
8798
8794
|
});
|
|
@@ -8829,9 +8825,9 @@ var listStyle = tv({
|
|
|
8829
8825
|
});
|
|
8830
8826
|
|
|
8831
8827
|
// src/components/list/listItem.tsx
|
|
8832
|
-
var
|
|
8833
|
-
var
|
|
8834
|
-
var ListItem = (0,
|
|
8828
|
+
var import_react27 = require("react");
|
|
8829
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8830
|
+
var ListItem = (0, import_react27.forwardRef)((props, ref) => {
|
|
8835
8831
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
8836
8832
|
const {
|
|
8837
8833
|
title,
|
|
@@ -8843,19 +8839,19 @@ var ListItem = (0, import_react28.forwardRef)((props, ref) => {
|
|
|
8843
8839
|
classNames,
|
|
8844
8840
|
onClick
|
|
8845
8841
|
} = { ...rawProps, ...variantProps };
|
|
8846
|
-
const slots = (0,
|
|
8842
|
+
const slots = (0, import_react27.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
8847
8843
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
8848
8844
|
const avatarSize = iconSize;
|
|
8849
|
-
return /* @__PURE__ */ (0,
|
|
8850
|
-
/* @__PURE__ */ (0,
|
|
8851
|
-
avatar && /* @__PURE__ */ (0,
|
|
8852
|
-
startIconName && /* @__PURE__ */ (0,
|
|
8853
|
-
/* @__PURE__ */ (0,
|
|
8854
|
-
/* @__PURE__ */ (0,
|
|
8855
|
-
subTitle && /* @__PURE__ */ (0,
|
|
8845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
8846
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
8847
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(avatar_default, { ...avatar, variant: "round", size: avatarSize }),
|
|
8848
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: startIconName, fill: true, size, className: slots.startIcon({ class: classNames == null ? void 0 : classNames.startIcon }) }),
|
|
8849
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper }), children: [
|
|
8850
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
8851
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle }), children: subTitle })
|
|
8856
8852
|
] })
|
|
8857
8853
|
] }),
|
|
8858
|
-
/* @__PURE__ */ (0,
|
|
8854
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "right-chevron", size: iconSize, className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) })
|
|
8859
8855
|
] });
|
|
8860
8856
|
});
|
|
8861
8857
|
ListItem.displayName = "ListItem";
|
|
@@ -9023,9 +9019,9 @@ var listItemStyle = tv({
|
|
|
9023
9019
|
});
|
|
9024
9020
|
|
|
9025
9021
|
// src/components/toast/toast.tsx
|
|
9026
|
-
var
|
|
9027
|
-
var
|
|
9028
|
-
var Toast = (0,
|
|
9022
|
+
var import_react28 = require("react");
|
|
9023
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
9024
|
+
var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
9029
9025
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
9030
9026
|
const {
|
|
9031
9027
|
title,
|
|
@@ -9039,9 +9035,9 @@ var Toast = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
9039
9035
|
disableAnimation,
|
|
9040
9036
|
onClose
|
|
9041
9037
|
} = { ...props, ...variantProps };
|
|
9042
|
-
const slots = (0,
|
|
9043
|
-
const toastRef = (0,
|
|
9044
|
-
(0,
|
|
9038
|
+
const slots = (0, import_react28.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
9039
|
+
const toastRef = (0, import_react28.useRef)(null);
|
|
9040
|
+
(0, import_react28.useImperativeHandle)(
|
|
9045
9041
|
ref,
|
|
9046
9042
|
() => ({
|
|
9047
9043
|
getWidth: () => {
|
|
@@ -9052,7 +9048,7 @@ var Toast = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
9052
9048
|
[]
|
|
9053
9049
|
);
|
|
9054
9050
|
const animationClass = (placement == null ? void 0 : placement.includes("top")) ? "animate-slideInFromTop" : "animate-slideInFromBottom";
|
|
9055
|
-
return /* @__PURE__ */ (0,
|
|
9051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
9056
9052
|
"div",
|
|
9057
9053
|
{
|
|
9058
9054
|
ref: toastRef,
|
|
@@ -9064,12 +9060,12 @@ var Toast = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
9064
9060
|
),
|
|
9065
9061
|
style: hasShadow ? { boxShadow: "0px 6px 18px rgba(0, 0, 0, 0.10)" } : {},
|
|
9066
9062
|
children: [
|
|
9067
|
-
/* @__PURE__ */ (0,
|
|
9068
|
-
showIcon && /* @__PURE__ */ (0,
|
|
9069
|
-
/* @__PURE__ */ (0,
|
|
9070
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
9064
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
|
|
9065
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
9066
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon_default, { name: "close", className: "cursor-pointer", onClick: onClose })
|
|
9071
9067
|
] }),
|
|
9072
|
-
content && /* @__PURE__ */ (0,
|
|
9068
|
+
content && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: content })
|
|
9073
9069
|
]
|
|
9074
9070
|
}
|
|
9075
9071
|
);
|
|
@@ -9174,7 +9170,7 @@ var toast = tv({
|
|
|
9174
9170
|
});
|
|
9175
9171
|
|
|
9176
9172
|
// src/components/toast/use-toast.tsx
|
|
9177
|
-
var
|
|
9173
|
+
var import_react29 = require("react");
|
|
9178
9174
|
|
|
9179
9175
|
// src/components/toast/toast-utils.ts
|
|
9180
9176
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -9213,10 +9209,10 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
9213
9209
|
};
|
|
9214
9210
|
|
|
9215
9211
|
// src/components/toast/use-toast.tsx
|
|
9216
|
-
var
|
|
9217
|
-
var ToastContext = (0,
|
|
9212
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
9213
|
+
var ToastContext = (0, import_react29.createContext)(null);
|
|
9218
9214
|
var useToast = () => {
|
|
9219
|
-
const context = (0,
|
|
9215
|
+
const context = (0, import_react29.useContext)(ToastContext);
|
|
9220
9216
|
if (!context) {
|
|
9221
9217
|
throw new Error("useToast must be used within a ToastProvider");
|
|
9222
9218
|
}
|
|
@@ -9226,10 +9222,10 @@ var ToastProvider = ({
|
|
|
9226
9222
|
globalOptions,
|
|
9227
9223
|
children
|
|
9228
9224
|
}) => {
|
|
9229
|
-
const [toasts, setToasts] = (0,
|
|
9230
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
9231
|
-
const toastRef = (0,
|
|
9232
|
-
const addToast = (0,
|
|
9225
|
+
const [toasts, setToasts] = (0, import_react29.useState)([]);
|
|
9226
|
+
const [containerStyle, setContainerStyle] = (0, import_react29.useState)({});
|
|
9227
|
+
const toastRef = (0, import_react29.useRef)(null);
|
|
9228
|
+
const addToast = (0, import_react29.useCallback)(
|
|
9233
9229
|
(title, options = {}) => {
|
|
9234
9230
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
9235
9231
|
const newToast = {
|
|
@@ -9246,11 +9242,11 @@ var ToastProvider = ({
|
|
|
9246
9242
|
},
|
|
9247
9243
|
[globalOptions]
|
|
9248
9244
|
);
|
|
9249
|
-
const removeToast = (0,
|
|
9245
|
+
const removeToast = (0, import_react29.useCallback)((id) => {
|
|
9250
9246
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
9251
9247
|
}, []);
|
|
9252
9248
|
const contextValue = addToast;
|
|
9253
|
-
(0,
|
|
9249
|
+
(0, import_react29.useEffect)(() => {
|
|
9254
9250
|
var _a;
|
|
9255
9251
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
9256
9252
|
const offset = 20;
|
|
@@ -9264,18 +9260,18 @@ var ToastProvider = ({
|
|
|
9264
9260
|
right: right !== void 0 ? `${right}px` : void 0
|
|
9265
9261
|
});
|
|
9266
9262
|
}, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
|
|
9267
|
-
return /* @__PURE__ */ (0,
|
|
9263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(ToastContext.Provider, { value: contextValue, children: [
|
|
9268
9264
|
children,
|
|
9269
|
-
/* @__PURE__ */ (0,
|
|
9265
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { id: "deepnoid-toast-container", className: "flex flex-col gap-[10px]", style: containerStyle, children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(toast_default, { ref: toastRef, onClose: () => removeToast(toast2.id), ...toast2 }, toast2.id)) })
|
|
9270
9266
|
] });
|
|
9271
9267
|
};
|
|
9272
9268
|
|
|
9273
9269
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
9274
|
-
var
|
|
9270
|
+
var import_react33 = __toESM(require("react"));
|
|
9275
9271
|
var import_react_dom4 = require("react-dom");
|
|
9276
9272
|
|
|
9277
9273
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
9278
|
-
var
|
|
9274
|
+
var import_react30 = require("react");
|
|
9279
9275
|
|
|
9280
9276
|
// src/components/dateTimePicker/util.ts
|
|
9281
9277
|
var formatDateToString = (date) => {
|
|
@@ -9291,17 +9287,17 @@ var formatStringToDate = (date) => {
|
|
|
9291
9287
|
|
|
9292
9288
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
9293
9289
|
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
9294
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
9290
|
+
const [selectedDate, setSelectedDate] = (0, import_react30.useState)(
|
|
9295
9291
|
initialDate ? formatDateToString(initialDate) : ""
|
|
9296
9292
|
);
|
|
9297
|
-
const [selectedTime, setSelectedTime] = (0,
|
|
9298
|
-
const [targetRect, setTargetRect] = (0,
|
|
9299
|
-
const [popupWidth, setPopupWidth] = (0,
|
|
9300
|
-
const [popupHeight, setPopupHeight] = (0,
|
|
9301
|
-
const [isFocusInput, setIsFocusInput] = (0,
|
|
9302
|
-
const dateInputRef = (0,
|
|
9303
|
-
const datePickerWrapperRef = (0,
|
|
9304
|
-
const datePickerRef = (0,
|
|
9293
|
+
const [selectedTime, setSelectedTime] = (0, import_react30.useState)(initialTime ? initialTime : "");
|
|
9294
|
+
const [targetRect, setTargetRect] = (0, import_react30.useState)(null);
|
|
9295
|
+
const [popupWidth, setPopupWidth] = (0, import_react30.useState)(0);
|
|
9296
|
+
const [popupHeight, setPopupHeight] = (0, import_react30.useState)(0);
|
|
9297
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react30.useState)(false);
|
|
9298
|
+
const dateInputRef = (0, import_react30.useRef)(null);
|
|
9299
|
+
const datePickerWrapperRef = (0, import_react30.useRef)(null);
|
|
9300
|
+
const datePickerRef = (0, import_react30.useRef)(null);
|
|
9305
9301
|
const DATE_PICKER_GAP = 4;
|
|
9306
9302
|
const calculatePositionWithScroll = (targetRect2) => {
|
|
9307
9303
|
if (targetRect2 && popupWidth && popupHeight) {
|
|
@@ -9334,7 +9330,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9334
9330
|
const handleBlueInput = () => {
|
|
9335
9331
|
setIsFocusInput(false);
|
|
9336
9332
|
};
|
|
9337
|
-
(0,
|
|
9333
|
+
(0, import_react30.useEffect)(() => {
|
|
9338
9334
|
const onClickOutside = (e) => {
|
|
9339
9335
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
9340
9336
|
setTargetRect(null);
|
|
@@ -9343,7 +9339,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9343
9339
|
window.addEventListener("mousedown", onClickOutside);
|
|
9344
9340
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
9345
9341
|
}, []);
|
|
9346
|
-
(0,
|
|
9342
|
+
(0, import_react30.useEffect)(() => {
|
|
9347
9343
|
if (datePickerWrapperRef.current) {
|
|
9348
9344
|
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
9349
9345
|
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
@@ -9368,19 +9364,19 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
9368
9364
|
};
|
|
9369
9365
|
|
|
9370
9366
|
// src/components/dateTimePicker/calendar.tsx
|
|
9371
|
-
var
|
|
9372
|
-
var
|
|
9373
|
-
var Calendar = (0,
|
|
9367
|
+
var import_react31 = __toESM(require("react"));
|
|
9368
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
9369
|
+
var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
9374
9370
|
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
9375
9371
|
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
9376
|
-
const [currentDate, setCurrentDate] = (0,
|
|
9372
|
+
const [currentDate, setCurrentDate] = (0, import_react31.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
9377
9373
|
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
9378
|
-
(0,
|
|
9374
|
+
(0, import_react31.useEffect)(() => {
|
|
9379
9375
|
if (selectedDate) {
|
|
9380
9376
|
setCurrentDate(new Date(selectedDate));
|
|
9381
9377
|
}
|
|
9382
9378
|
}, [selectedDate]);
|
|
9383
|
-
const getCalendarDates = (0,
|
|
9379
|
+
const getCalendarDates = (0, import_react31.useCallback)(() => {
|
|
9384
9380
|
const year = currentDate.getFullYear();
|
|
9385
9381
|
const month = currentDate.getMonth();
|
|
9386
9382
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -9426,17 +9422,17 @@ var Calendar = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
9426
9422
|
onChangeDate(formatted);
|
|
9427
9423
|
}
|
|
9428
9424
|
};
|
|
9429
|
-
(0,
|
|
9425
|
+
(0, import_react31.useImperativeHandle)(ref, () => ({
|
|
9430
9426
|
getSelectedDate: () => selectedDate
|
|
9431
9427
|
}));
|
|
9432
|
-
const slots = (0,
|
|
9433
|
-
const getBaseProps = (0,
|
|
9428
|
+
const slots = (0, import_react31.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
9429
|
+
const getBaseProps = (0, import_react31.useCallback)(
|
|
9434
9430
|
() => ({
|
|
9435
9431
|
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
9436
9432
|
}),
|
|
9437
9433
|
[slots, classNames]
|
|
9438
9434
|
);
|
|
9439
|
-
const getDateTitleProps = (0,
|
|
9435
|
+
const getDateTitleProps = (0, import_react31.useCallback)(
|
|
9440
9436
|
(index) => {
|
|
9441
9437
|
return {
|
|
9442
9438
|
className: `${slots.dateTitle({
|
|
@@ -9448,7 +9444,7 @@ var Calendar = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
9448
9444
|
},
|
|
9449
9445
|
[slots, classNames, highlightWeekend]
|
|
9450
9446
|
);
|
|
9451
|
-
const getDateProps = (0,
|
|
9447
|
+
const getDateProps = (0, import_react31.useCallback)(
|
|
9452
9448
|
(dateObj) => {
|
|
9453
9449
|
const today = /* @__PURE__ */ new Date();
|
|
9454
9450
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -9470,18 +9466,18 @@ var Calendar = (0, import_react32.forwardRef)((originalProps, ref) => {
|
|
|
9470
9466
|
[slots, classNames, selectedDate, currentDate, highlightWeekend]
|
|
9471
9467
|
);
|
|
9472
9468
|
const calendarDates = getCalendarDates();
|
|
9473
|
-
return /* @__PURE__ */ (0,
|
|
9474
|
-
/* @__PURE__ */ (0,
|
|
9475
|
-
/* @__PURE__ */ (0,
|
|
9476
|
-
/* @__PURE__ */ (0,
|
|
9477
|
-
/* @__PURE__ */ (0,
|
|
9469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { ...getBaseProps(), children: [
|
|
9470
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "calendar-header flex justify-between items-center mb-4", children: [
|
|
9471
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon_default, { name: "brace-left", size: "md", className: "cursor-pointer", onClick: handlePrevMonth }),
|
|
9472
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-h6 font-semibold", children: currentDate.toLocaleString("default", { year: "numeric", month: "2-digit" }) }),
|
|
9473
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon_default, { name: "brace-right", size: "md", className: "cursor-pointer", onClick: handleNextMonth })
|
|
9478
9474
|
] }),
|
|
9479
|
-
/* @__PURE__ */ (0,
|
|
9480
|
-
/* @__PURE__ */ (0,
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "grid grid-cols-7 gap-2 text-center", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ...getDateTitleProps(index), children: day }, `${day}-${index}`)) }),
|
|
9476
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
9481
9477
|
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
9482
9478
|
if (!hasCurrentMonthDates) return null;
|
|
9483
|
-
return /* @__PURE__ */ (0,
|
|
9484
|
-
return /* @__PURE__ */ (0,
|
|
9479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react31.default.Fragment, { children: week.map((dateObj, index) => {
|
|
9480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
9485
9481
|
}) }, weekIndex);
|
|
9486
9482
|
}) })
|
|
9487
9483
|
] }) });
|
|
@@ -9552,22 +9548,22 @@ var calendarStyle = tv({
|
|
|
9552
9548
|
});
|
|
9553
9549
|
|
|
9554
9550
|
// src/components/dateTimePicker/timePicker.tsx
|
|
9555
|
-
var
|
|
9556
|
-
var
|
|
9551
|
+
var import_react32 = require("react");
|
|
9552
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9557
9553
|
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
9558
9554
|
const TOTAL_HOURS = 12;
|
|
9559
9555
|
const TOTAL_MINUTES = 60;
|
|
9560
9556
|
const ITEM_HEIGHT = 30;
|
|
9561
9557
|
const PERIODS = ["AM", "PM"];
|
|
9562
|
-
const [selectedHour, setSelectedHour] = (0,
|
|
9563
|
-
const [selectedMinute, setSelectedMinute] = (0,
|
|
9564
|
-
const [selectedPeriod, setSelectedPeriod] = (0,
|
|
9565
|
-
const hourRef = (0,
|
|
9566
|
-
const minuteRef = (0,
|
|
9567
|
-
const periodRef = (0,
|
|
9558
|
+
const [selectedHour, setSelectedHour] = (0, import_react32.useState)("01");
|
|
9559
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react32.useState)("00");
|
|
9560
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react32.useState)("AM");
|
|
9561
|
+
const hourRef = (0, import_react32.useRef)(null);
|
|
9562
|
+
const minuteRef = (0, import_react32.useRef)(null);
|
|
9563
|
+
const periodRef = (0, import_react32.useRef)(null);
|
|
9568
9564
|
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
9569
9565
|
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
9570
|
-
(0,
|
|
9566
|
+
(0, import_react32.useEffect)(() => {
|
|
9571
9567
|
if (selectedTime) {
|
|
9572
9568
|
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
9573
9569
|
setSelectedHour(formattedHour);
|
|
@@ -9578,7 +9574,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
9578
9574
|
scrollToSelectedTime();
|
|
9579
9575
|
}
|
|
9580
9576
|
}, [selectedTime, isFocusInput]);
|
|
9581
|
-
(0,
|
|
9577
|
+
(0, import_react32.useEffect)(() => {
|
|
9582
9578
|
scrollToSelectedTime();
|
|
9583
9579
|
}, []);
|
|
9584
9580
|
const parseAndFormatTime = (time) => {
|
|
@@ -9615,8 +9611,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
9615
9611
|
onChangeTime(formattedTime);
|
|
9616
9612
|
}
|
|
9617
9613
|
};
|
|
9618
|
-
return /* @__PURE__ */ (0,
|
|
9619
|
-
/* @__PURE__ */ (0,
|
|
9614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
|
|
9615
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9620
9616
|
listItem_default,
|
|
9621
9617
|
{
|
|
9622
9618
|
color,
|
|
@@ -9630,7 +9626,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
9630
9626
|
},
|
|
9631
9627
|
`${period}-${index}`
|
|
9632
9628
|
)) }),
|
|
9633
|
-
/* @__PURE__ */ (0,
|
|
9629
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9634
9630
|
listItem_default,
|
|
9635
9631
|
{
|
|
9636
9632
|
color,
|
|
@@ -9644,7 +9640,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
9644
9640
|
},
|
|
9645
9641
|
`${hour}-${index}`
|
|
9646
9642
|
)) }),
|
|
9647
|
-
/* @__PURE__ */ (0,
|
|
9643
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9648
9644
|
listItem_default,
|
|
9649
9645
|
{
|
|
9650
9646
|
color,
|
|
@@ -9663,8 +9659,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
9663
9659
|
var timePicker_default = TimePicker;
|
|
9664
9660
|
|
|
9665
9661
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
9666
|
-
var
|
|
9667
|
-
var DatePicker = (0,
|
|
9662
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
9663
|
+
var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
9668
9664
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
9669
9665
|
const {
|
|
9670
9666
|
classNames,
|
|
@@ -9678,7 +9674,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9678
9674
|
onChangeTime,
|
|
9679
9675
|
...inputProps
|
|
9680
9676
|
} = props;
|
|
9681
|
-
const slots = (0,
|
|
9677
|
+
const slots = (0, import_react33.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
9682
9678
|
const {
|
|
9683
9679
|
selectedDate,
|
|
9684
9680
|
selectedTime,
|
|
@@ -9699,32 +9695,32 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9699
9695
|
initialTime: typeof value === "string" ? value : void 0
|
|
9700
9696
|
});
|
|
9701
9697
|
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
9702
|
-
const getBaseProps = (0,
|
|
9698
|
+
const getBaseProps = (0, import_react33.useCallback)(
|
|
9703
9699
|
() => ({
|
|
9704
9700
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
9705
9701
|
}),
|
|
9706
9702
|
[slots, classNames]
|
|
9707
9703
|
);
|
|
9708
|
-
const getLabelProps = (0,
|
|
9704
|
+
const getLabelProps = (0, import_react33.useCallback)(
|
|
9709
9705
|
() => ({
|
|
9710
9706
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
9711
9707
|
}),
|
|
9712
9708
|
[slots, classNames]
|
|
9713
9709
|
);
|
|
9714
|
-
const getInnerWrapperProps = (0,
|
|
9710
|
+
const getInnerWrapperProps = (0, import_react33.useCallback)(
|
|
9715
9711
|
() => ({
|
|
9716
9712
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
9717
9713
|
}),
|
|
9718
9714
|
[slots, classNames]
|
|
9719
9715
|
);
|
|
9720
|
-
const getInputWrapperProps = (0,
|
|
9716
|
+
const getInputWrapperProps = (0, import_react33.useCallback)(
|
|
9721
9717
|
() => ({
|
|
9722
9718
|
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
9723
9719
|
ref: datePickerRef
|
|
9724
9720
|
}),
|
|
9725
9721
|
[slots, classNames]
|
|
9726
9722
|
);
|
|
9727
|
-
const getInputProps = (0,
|
|
9723
|
+
const getInputProps = (0, import_react33.useCallback)(
|
|
9728
9724
|
() => ({
|
|
9729
9725
|
...inputProps,
|
|
9730
9726
|
ref: ref || dateInputRef,
|
|
@@ -9755,33 +9751,33 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9755
9751
|
}),
|
|
9756
9752
|
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
9757
9753
|
);
|
|
9758
|
-
const getContentProps = (0,
|
|
9754
|
+
const getContentProps = (0, import_react33.useCallback)(
|
|
9759
9755
|
() => ({
|
|
9760
9756
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
9761
9757
|
size: originalProps.size
|
|
9762
9758
|
}),
|
|
9763
9759
|
[slots, classNames, originalProps.size]
|
|
9764
9760
|
);
|
|
9765
|
-
const getErrorMessageProps = (0,
|
|
9761
|
+
const getErrorMessageProps = (0, import_react33.useCallback)(
|
|
9766
9762
|
() => ({
|
|
9767
9763
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
9768
9764
|
}),
|
|
9769
9765
|
[slots, classNames]
|
|
9770
9766
|
);
|
|
9771
9767
|
const renderStartContent = () => {
|
|
9772
|
-
if (
|
|
9768
|
+
if (import_react33.default.isValidElement(startContent)) {
|
|
9773
9769
|
const existingProps = startContent.props;
|
|
9774
9770
|
const mergedProps = {
|
|
9775
9771
|
...getContentProps(),
|
|
9776
9772
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9777
9773
|
};
|
|
9778
|
-
return
|
|
9774
|
+
return import_react33.default.cloneElement(startContent, mergedProps);
|
|
9779
9775
|
} else {
|
|
9780
9776
|
const contentProps = getContentProps();
|
|
9781
|
-
return /* @__PURE__ */ (0,
|
|
9777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ...contentProps, children: startContent });
|
|
9782
9778
|
}
|
|
9783
9779
|
};
|
|
9784
|
-
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0,
|
|
9780
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
9785
9781
|
Icon_default,
|
|
9786
9782
|
{
|
|
9787
9783
|
name: type === "time" ? "clock" : "calendar",
|
|
@@ -9791,18 +9787,18 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9791
9787
|
}
|
|
9792
9788
|
) });
|
|
9793
9789
|
const renderContentWithIcon = () => {
|
|
9794
|
-
if (
|
|
9790
|
+
if (import_react33.default.isValidElement(endContent)) {
|
|
9795
9791
|
const existingProps = endContent.props;
|
|
9796
9792
|
const mergedProps = {
|
|
9797
9793
|
...getContentProps(),
|
|
9798
9794
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9799
9795
|
};
|
|
9800
|
-
return
|
|
9796
|
+
return import_react33.default.cloneElement(endContent, mergedProps);
|
|
9801
9797
|
} else if (errorMessage) {
|
|
9802
9798
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
9803
|
-
return /* @__PURE__ */ (0,
|
|
9799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
9804
9800
|
} else {
|
|
9805
|
-
return /* @__PURE__ */ (0,
|
|
9801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, {});
|
|
9806
9802
|
}
|
|
9807
9803
|
};
|
|
9808
9804
|
const renderEndContent = () => {
|
|
@@ -9817,20 +9813,20 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9817
9813
|
return renderContentWithIcon();
|
|
9818
9814
|
}
|
|
9819
9815
|
};
|
|
9820
|
-
return /* @__PURE__ */ (0,
|
|
9821
|
-
/* @__PURE__ */ (0,
|
|
9822
|
-
label && /* @__PURE__ */ (0,
|
|
9823
|
-
/* @__PURE__ */ (0,
|
|
9824
|
-
/* @__PURE__ */ (0,
|
|
9816
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
9817
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...getBaseProps(), children: [
|
|
9818
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("label", { ...getLabelProps(), children: label }),
|
|
9819
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
9820
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ...getInputWrapperProps(), children: [
|
|
9825
9821
|
startContent && renderStartContent(),
|
|
9826
|
-
/* @__PURE__ */ (0,
|
|
9822
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("input", { ...getInputProps() }),
|
|
9827
9823
|
renderEndContent()
|
|
9828
9824
|
] }),
|
|
9829
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
9825
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { ...getErrorMessageProps(), children: errorMessage })
|
|
9830
9826
|
] })
|
|
9831
9827
|
] }),
|
|
9832
|
-
targetRect && /* @__PURE__ */ (0,
|
|
9833
|
-
/* @__PURE__ */ (0,
|
|
9828
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: (0, import_react_dom4.createPortal)(
|
|
9829
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
9834
9830
|
"div",
|
|
9835
9831
|
{
|
|
9836
9832
|
ref: datePickerWrapperRef,
|
|
@@ -9841,7 +9837,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9841
9837
|
zIndex: 1e3
|
|
9842
9838
|
},
|
|
9843
9839
|
children: [
|
|
9844
|
-
type === "date" && /* @__PURE__ */ (0,
|
|
9840
|
+
type === "date" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
9845
9841
|
calendar_default,
|
|
9846
9842
|
{
|
|
9847
9843
|
color: originalProps.color,
|
|
@@ -9853,7 +9849,7 @@ var DatePicker = (0, import_react34.forwardRef)((originalProps, ref) => {
|
|
|
9853
9849
|
}
|
|
9854
9850
|
}
|
|
9855
9851
|
),
|
|
9856
|
-
type === "time" && /* @__PURE__ */ (0,
|
|
9852
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
9857
9853
|
timePicker_default,
|
|
9858
9854
|
{
|
|
9859
9855
|
color: originalProps.color,
|
|
@@ -10003,7 +9999,7 @@ var dateTimePickerStyle = tv({
|
|
|
10003
9999
|
});
|
|
10004
10000
|
|
|
10005
10001
|
// src/components/tree/tree.tsx
|
|
10006
|
-
var
|
|
10002
|
+
var import_react34 = require("react");
|
|
10007
10003
|
|
|
10008
10004
|
// src/assets/images/cogwheel.png
|
|
10009
10005
|
var cogwheel_default = "./cogwheel-U2B3CWEL.png";
|
|
@@ -10012,12 +10008,12 @@ var cogwheel_default = "./cogwheel-U2B3CWEL.png";
|
|
|
10012
10008
|
var folder_default = "./folder-RO3QTLGS.svg";
|
|
10013
10009
|
|
|
10014
10010
|
// src/components/tree/tree.tsx
|
|
10015
|
-
var
|
|
10016
|
-
var TreeNodeItem = (0,
|
|
10011
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
10012
|
+
var TreeNodeItem = (0, import_react34.forwardRef)(({ node, depth }, _ref) => {
|
|
10017
10013
|
var _a;
|
|
10018
|
-
const [isOpen, setIsOpen] = (0,
|
|
10019
|
-
const slots = (0,
|
|
10020
|
-
const toggleOpen = (0,
|
|
10014
|
+
const [isOpen, setIsOpen] = (0, import_react34.useState)(false);
|
|
10015
|
+
const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
|
|
10016
|
+
const toggleOpen = (0, import_react34.useCallback)(() => {
|
|
10021
10017
|
setIsOpen((prev) => !prev);
|
|
10022
10018
|
}, []);
|
|
10023
10019
|
const handleClick = () => {
|
|
@@ -10025,32 +10021,32 @@ var TreeNodeItem = (0, import_react35.forwardRef)(({ node, depth }, _ref) => {
|
|
|
10025
10021
|
toggleOpen();
|
|
10026
10022
|
(_a2 = node.onClick) == null ? void 0 : _a2.call(node);
|
|
10027
10023
|
};
|
|
10028
|
-
return /* @__PURE__ */ (0,
|
|
10029
|
-
/* @__PURE__ */ (0,
|
|
10030
|
-
node.children && /* @__PURE__ */ (0,
|
|
10024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: depth > 1 ? "ml-[30px]" : "", children: [
|
|
10025
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.label(), onClick: handleClick, children: [
|
|
10026
|
+
node.children && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
10031
10027
|
Icon_default,
|
|
10032
10028
|
{
|
|
10033
10029
|
name: "right-chevron",
|
|
10034
10030
|
className: `text-neutral-main transition-transform duration-150 ${isOpen ? "rotate-90" : "rotate-0"}`
|
|
10035
10031
|
}
|
|
10036
10032
|
),
|
|
10037
|
-
/* @__PURE__ */ (0,
|
|
10033
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("img", { src: folder_default, alt: "folder", width: 25, height: 25 }),
|
|
10038
10034
|
node.label
|
|
10039
10035
|
] }),
|
|
10040
|
-
isOpen && ((_a = node.children) == null ? void 0 : _a.map((child) => /* @__PURE__ */ (0,
|
|
10036
|
+
isOpen && ((_a = node.children) == null ? void 0 : _a.map((child) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TreeNodeItem, { node: child, depth: depth + 1 }, child.id)))
|
|
10041
10037
|
] });
|
|
10042
10038
|
});
|
|
10043
|
-
var Tree = (0,
|
|
10039
|
+
var Tree = (0, import_react34.forwardRef)(({ headerContent, group }, ref) => {
|
|
10044
10040
|
const { label, data, onClick } = group;
|
|
10045
|
-
const slots = (0,
|
|
10046
|
-
return /* @__PURE__ */ (0,
|
|
10047
|
-
headerContent && /* @__PURE__ */ (0,
|
|
10048
|
-
/* @__PURE__ */ (0,
|
|
10049
|
-
/* @__PURE__ */ (0,
|
|
10050
|
-
/* @__PURE__ */ (0,
|
|
10041
|
+
const slots = (0, import_react34.useMemo)(() => treeStyle(), []);
|
|
10042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.base(), ref, children: [
|
|
10043
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { children: headerContent }),
|
|
10044
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
10045
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: slots.label(), onClick, children: [
|
|
10046
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("img", { src: cogwheel_default, alt: "cogwheel", width: 25, height: 25 }),
|
|
10051
10047
|
label
|
|
10052
10048
|
] }),
|
|
10053
|
-
data.map((node) => /* @__PURE__ */ (0,
|
|
10049
|
+
data.map((node) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TreeNodeItem, { node, depth: 1 }, node.id))
|
|
10054
10050
|
] })
|
|
10055
10051
|
] });
|
|
10056
10052
|
});
|