@deepnoid/ui 0.1.30 → 0.1.32
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 +135 -135
- package/dist/chunk-62X5AX5B.mjs +297 -0
- package/dist/{chunk-VCVQMPC7.mjs → chunk-AIIMJZ7L.mjs} +69 -39
- package/dist/{chunk-NKH3OF6I.mjs → chunk-BCMVEGJG.mjs} +1 -1
- package/dist/{chunk-QM4ZSQYX.mjs → chunk-CVQM3T2X.mjs} +1 -1
- package/dist/{chunk-272FMLIL.mjs → chunk-IEJRE6LT.mjs} +7 -4
- package/dist/{chunk-CEZQCD6Z.mjs → chunk-LWRK5TPZ.mjs} +12 -11
- package/dist/{chunk-GLMM253Q.mjs → chunk-P67LLF3G.mjs} +5 -5
- package/dist/components/fileUpload/fileUpload.js +62 -39
- package/dist/components/fileUpload/fileUpload.mjs +2 -2
- package/dist/components/fileUpload/index.js +62 -39
- package/dist/components/fileUpload/index.mjs +2 -2
- package/dist/components/input/index.js +62 -39
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input/input.d.mts +21 -14
- package/dist/components/input/input.d.ts +21 -14
- package/dist/components/input/input.js +62 -39
- package/dist/components/input/input.mjs +1 -1
- package/dist/components/pagination/index.js +62 -39
- package/dist/components/pagination/index.mjs +2 -2
- package/dist/components/pagination/pagination.js +62 -39
- package/dist/components/pagination/pagination.mjs +2 -2
- package/dist/components/select/index.js +7 -4
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/select/select.d.mts +9 -0
- package/dist/components/select/select.d.ts +9 -0
- package/dist/components/select/select.js +7 -4
- package/dist/components/select/select.mjs +1 -1
- package/dist/components/table/index.js +77 -53
- package/dist/components/table/index.mjs +4 -4
- package/dist/components/table/table-body.js +12 -11
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table.d.mts +2 -1
- package/dist/components/table/table.d.ts +2 -1
- package/dist/components/table/table.js +77 -53
- package/dist/components/table/table.mjs +4 -4
- package/dist/components/textarea/index.js +255 -138
- package/dist/components/textarea/index.mjs +2 -1
- package/dist/components/textarea/textarea.d.mts +157 -150
- package/dist/components/textarea/textarea.d.ts +157 -150
- package/dist/components/textarea/textarea.js +255 -138
- package/dist/components/textarea/textarea.mjs +2 -1
- package/dist/index.js +299 -195
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
- package/dist/chunk-BKE6QF6W.mjs +0 -209
|
@@ -734,11 +734,12 @@ var TableBody = ({
|
|
|
734
734
|
classNames,
|
|
735
735
|
className
|
|
736
736
|
}) => {
|
|
737
|
-
const getCellStyle = (
|
|
738
|
-
width:
|
|
739
|
-
minWidth:
|
|
740
|
-
maxWidth:
|
|
741
|
-
height:
|
|
737
|
+
const getCellStyle = (column) => ({
|
|
738
|
+
width: column.width ? `${column.width}px` : void 0,
|
|
739
|
+
minWidth: column.minWidth ? `${column.minWidth}px` : void 0,
|
|
740
|
+
maxWidth: column.maxWidth ? `${column.maxWidth}px` : void 0,
|
|
741
|
+
height: column.height ? `${column.height}px` : void 0,
|
|
742
|
+
textAlign: column.align || "center"
|
|
742
743
|
});
|
|
743
744
|
const renderTdSkeleton = (key) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(skeleton_default, { color, className: "h-full w-full", rounded: "lg", speed: "fast" }) }, key);
|
|
744
745
|
const renderCheckboxCell = (rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), "text-center"), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -755,16 +756,16 @@ var TableBody = ({
|
|
|
755
756
|
] }, `skeleton-${rowIndex}`);
|
|
756
757
|
const renderEmptyRow = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { colSpan: columns.length + (rowCheckbox ? 1 : 0), className: slots.empty({ class: classNames == null ? void 0 : classNames.empty }), children: emptyContent }) });
|
|
757
758
|
const renderDataRow = (row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), onClick: () => onRowClick == null ? void 0 : onRowClick(row), children: [
|
|
758
|
-
columns.map((
|
|
759
|
+
columns.map((column, colIdx) => {
|
|
759
760
|
var _a;
|
|
760
|
-
const value = row[
|
|
761
|
-
const formattedValue = ((_a =
|
|
762
|
-
const content =
|
|
761
|
+
const value = row[column.field];
|
|
762
|
+
const formattedValue = ((_a = column.valueFormatter) == null ? void 0 : _a.call(column, { value, field: column.field })) || value;
|
|
763
|
+
const content = column.renderCell ? column.renderCell({ id: row.id, field: column.field, value, formattedValue, row }) : formattedValue;
|
|
763
764
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
764
765
|
"td",
|
|
765
766
|
{
|
|
766
|
-
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }),
|
|
767
|
-
style: getCellStyle(
|
|
767
|
+
className: clsx(slots.td({ class: classNames == null ? void 0 : classNames.td }), column.className),
|
|
768
|
+
style: getCellStyle(column),
|
|
768
769
|
children: content
|
|
769
770
|
},
|
|
770
771
|
`${rowIndex}-${colIdx}`
|
|
@@ -810,7 +811,7 @@ var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) =>
|
|
|
810
811
|
var usePagination_default = usePagination;
|
|
811
812
|
|
|
812
813
|
// src/components/input/input.tsx
|
|
813
|
-
var import_react3 =
|
|
814
|
+
var import_react3 = require("react");
|
|
814
815
|
|
|
815
816
|
// src/components/icon/template.tsx
|
|
816
817
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -4802,19 +4803,22 @@ var Input = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
4802
4803
|
const slots = (0, import_react3.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
4803
4804
|
const getContentProps = (0, import_react3.useCallback)(
|
|
4804
4805
|
() => ({
|
|
4805
|
-
className:
|
|
4806
|
+
className: clsx(
|
|
4807
|
+
slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
4808
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
4809
|
+
),
|
|
4806
4810
|
size: originalProps.size
|
|
4807
4811
|
}),
|
|
4808
4812
|
[slots, classNames, originalProps.size]
|
|
4809
4813
|
);
|
|
4810
4814
|
const renderStartContent = () => {
|
|
4811
|
-
if (import_react3.
|
|
4815
|
+
if ((0, import_react3.isValidElement)(startContent)) {
|
|
4812
4816
|
const existingProps = startContent.props;
|
|
4813
4817
|
const mergedProps = {
|
|
4814
4818
|
...getContentProps(),
|
|
4815
4819
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
4816
4820
|
};
|
|
4817
|
-
return import_react3.
|
|
4821
|
+
return (0, import_react3.cloneElement)(startContent, mergedProps);
|
|
4818
4822
|
} else {
|
|
4819
4823
|
const contentProps = getContentProps();
|
|
4820
4824
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ...contentProps, children: startContent });
|
|
@@ -4833,13 +4837,13 @@ var Input = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
4833
4837
|
}
|
|
4834
4838
|
);
|
|
4835
4839
|
const renderContentWithIcon = () => {
|
|
4836
|
-
if (import_react3.
|
|
4840
|
+
if ((0, import_react3.isValidElement)(endContent)) {
|
|
4837
4841
|
const existingProps = endContent.props;
|
|
4838
4842
|
const mergedProps = {
|
|
4839
4843
|
...getContentProps(),
|
|
4840
4844
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
4841
4845
|
};
|
|
4842
|
-
return import_react3.
|
|
4846
|
+
return (0, import_react3.cloneElement)(endContent, mergedProps);
|
|
4843
4847
|
} else if (errorMessage) {
|
|
4844
4848
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
4845
4849
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
@@ -4874,20 +4878,17 @@ var Input = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
4874
4878
|
{
|
|
4875
4879
|
className: clsx(
|
|
4876
4880
|
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
4877
|
-
inputProps.readOnly ? slots.
|
|
4881
|
+
inputProps.readOnly ? slots.readonlyWrapper({ class: classNames == null ? void 0 : classNames.readonlyWrapper }) : ""
|
|
4878
4882
|
),
|
|
4879
4883
|
children: [
|
|
4880
4884
|
startContent && renderStartContent(),
|
|
4881
4885
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4882
4886
|
"input",
|
|
4883
4887
|
{
|
|
4884
|
-
...inputProps,
|
|
4885
4888
|
ref: ref || inputRef,
|
|
4889
|
+
...inputProps,
|
|
4886
4890
|
readOnly: props.readOnly,
|
|
4887
|
-
className: clsx(
|
|
4888
|
-
slots.input({ class: classNames == null ? void 0 : classNames.input }),
|
|
4889
|
-
inputProps.readOnly ? "!text-body-foreground placeholder:!text-body-foreground" : ""
|
|
4890
|
-
),
|
|
4891
|
+
className: clsx(slots.input({ class: classNames == null ? void 0 : classNames.input })),
|
|
4891
4892
|
size: 0
|
|
4892
4893
|
}
|
|
4893
4894
|
),
|
|
@@ -4895,7 +4896,16 @@ var Input = (0, import_react3.forwardRef)((originalProps, ref) => {
|
|
|
4895
4896
|
]
|
|
4896
4897
|
}
|
|
4897
4898
|
),
|
|
4898
|
-
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4899
|
+
helperMessage && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
4900
|
+
"p",
|
|
4901
|
+
{
|
|
4902
|
+
className: clsx(
|
|
4903
|
+
slots.helperMessage({ class: classNames == null ? void 0 : classNames.helperMessage }),
|
|
4904
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
4905
|
+
),
|
|
4906
|
+
children: helperMessage
|
|
4907
|
+
}
|
|
4908
|
+
),
|
|
4899
4909
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: clsx("error", slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })), children: errorMessage })
|
|
4900
4910
|
] })
|
|
4901
4911
|
]
|
|
@@ -4907,12 +4917,12 @@ var input_default = Input;
|
|
|
4907
4917
|
var inputStyle = tv(
|
|
4908
4918
|
{
|
|
4909
4919
|
slots: {
|
|
4910
|
-
base: ["group/input", "flex select-none"],
|
|
4920
|
+
base: ["group/input", "flex", "select-none"],
|
|
4911
4921
|
vertical: ["flex-col"],
|
|
4912
4922
|
horizon: ["flex-row", "gap-0"],
|
|
4913
4923
|
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
4914
4924
|
innerWrapper: ["flex", "flex-col"],
|
|
4915
|
-
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input
|
|
4925
|
+
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input:!bg-danger-soft"],
|
|
4916
4926
|
input: [
|
|
4917
4927
|
"w-full",
|
|
4918
4928
|
"h-full",
|
|
@@ -4921,8 +4931,8 @@ var inputStyle = tv(
|
|
|
4921
4931
|
"placeholder:text-neutral-main",
|
|
4922
4932
|
"outline-none",
|
|
4923
4933
|
"focus:ring-0",
|
|
4924
|
-
"group-has-[:hover]/input
|
|
4925
|
-
"group-has-[:hover]/input:placeholder
|
|
4934
|
+
"group-has-[:hover]/input:!text-neutral-dark",
|
|
4935
|
+
"group-has-[:hover]/input:placeholder:!text-neutral-dark",
|
|
4926
4936
|
"group-has-[:focus]/input:text-neutral-dark",
|
|
4927
4937
|
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
4928
4938
|
"group-has-[p.error]/input:text-danger-main",
|
|
@@ -4938,13 +4948,22 @@ var inputStyle = tv(
|
|
|
4938
4948
|
],
|
|
4939
4949
|
helperMessage: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
4940
4950
|
errorMessage: ["text-danger-main"],
|
|
4941
|
-
|
|
4951
|
+
readonlyWrapper: [
|
|
4952
|
+
"pointer-events-none",
|
|
4953
|
+
"!text-body-foreground",
|
|
4954
|
+
"placeholder:!text-body-foreground",
|
|
4955
|
+
"group-has-[p.error]/input:!text-danger-main",
|
|
4956
|
+
"group-has-[p.error]/input:placeholder:!text-danger-main",
|
|
4957
|
+
"[&>input]:!text-body-foreground",
|
|
4958
|
+
"[&>input]:placeholder:!text-body-foreground"
|
|
4959
|
+
],
|
|
4960
|
+
readonly: []
|
|
4942
4961
|
},
|
|
4943
4962
|
variants: {
|
|
4944
4963
|
variant: {
|
|
4945
4964
|
solid: {
|
|
4946
4965
|
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
4947
|
-
|
|
4966
|
+
readonlyWrapper: ["!bg-trans-light"]
|
|
4948
4967
|
},
|
|
4949
4968
|
outline: {
|
|
4950
4969
|
inputWrapper: [
|
|
@@ -4953,7 +4972,7 @@ var inputStyle = tv(
|
|
|
4953
4972
|
"group-has-[:focus]/input:bg-body-background",
|
|
4954
4973
|
"group-has-[p.error]/input:border-danger-main"
|
|
4955
4974
|
],
|
|
4956
|
-
|
|
4975
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
4957
4976
|
},
|
|
4958
4977
|
underline: {
|
|
4959
4978
|
inputWrapper: [
|
|
@@ -4963,30 +4982,31 @@ var inputStyle = tv(
|
|
|
4963
4982
|
"group-has-[:focus]/input:bg-body-background",
|
|
4964
4983
|
"group-has-[p.error]/input:border-danger-main"
|
|
4965
4984
|
],
|
|
4966
|
-
|
|
4985
|
+
readonlyWrapper: ["!bg-trans-soft"]
|
|
4967
4986
|
}
|
|
4968
4987
|
},
|
|
4969
4988
|
color: {
|
|
4970
4989
|
primary: {
|
|
4971
4990
|
content: [
|
|
4972
|
-
"group-has-[:focus]/input
|
|
4973
|
-
"
|
|
4991
|
+
"group-has-[:focus]/input:!text-primary-main",
|
|
4992
|
+
"group-has-[p.error]:not(input:focus):hover/input:!text-primary-main"
|
|
4974
4993
|
],
|
|
4975
4994
|
helperMessage: [
|
|
4976
|
-
"group-has-[:focus]/input
|
|
4977
|
-
"group-has-[:focus:hover]/input
|
|
4978
|
-
"group-has-[:focus]/input:hover
|
|
4979
|
-
]
|
|
4995
|
+
"group-has-[:focus]/input:!text-primary-main",
|
|
4996
|
+
"group-has-[:focus:hover]/input:!text-primary-main",
|
|
4997
|
+
"group-has-[:focus]/input:hover:!text-primary-main"
|
|
4998
|
+
],
|
|
4999
|
+
readonly: ["!text-primary-main"]
|
|
4980
5000
|
},
|
|
4981
5001
|
secondary: {
|
|
4982
5002
|
content: [
|
|
4983
|
-
"group-has-[:focus]/input
|
|
4984
|
-
"
|
|
5003
|
+
"group-has-[:focus]/input:!text-secondary-main",
|
|
5004
|
+
"group-has-[p.error]:not(input:focus):hover/input:!text-secondary-main"
|
|
4985
5005
|
],
|
|
4986
5006
|
helperMessage: [
|
|
4987
|
-
"group-has-[:focus]/input
|
|
4988
|
-
"group-has-[:focus:hover]/input
|
|
4989
|
-
"group-has-[:focus]/input:hover
|
|
5007
|
+
"group-has-[:focus]/input:!text-secondary-main",
|
|
5008
|
+
"group-has-[:focus:hover]/input:!text-secondary-main",
|
|
5009
|
+
"group-has-[:focus]/input:hover:!text-secondary-main"
|
|
4990
5010
|
]
|
|
4991
5011
|
}
|
|
4992
5012
|
},
|
|
@@ -5037,14 +5057,14 @@ var inputStyle = tv(
|
|
|
5037
5057
|
},
|
|
5038
5058
|
disabled: {
|
|
5039
5059
|
true: {
|
|
5040
|
-
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "
|
|
5060
|
+
inputWrapper: ["!bg-neutral-soft", "pointer-events-none", "group-has-[p.error]/input:!text-danger-light"],
|
|
5041
5061
|
input: [
|
|
5042
|
-
"text-neutral-light",
|
|
5043
|
-
"placeholder
|
|
5044
|
-
"group-has-[p.error]/input
|
|
5045
|
-
"group-has-[p.error]/input:placeholder
|
|
5062
|
+
"!text-neutral-light",
|
|
5063
|
+
"placeholder:!text-neutral-light",
|
|
5064
|
+
"group-has-[p.error]/input:!text-danger-light",
|
|
5065
|
+
"group-has-[p.error]/input:placeholder:!text-danger-light"
|
|
5046
5066
|
],
|
|
5047
|
-
content: ["text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
5067
|
+
content: ["!text-neutral-light", "group-has-[p.error]/input:text-danger-light"],
|
|
5048
5068
|
helperMessage: ["!text-neutral-light"],
|
|
5049
5069
|
errorMessage: ["!text-danger-light"]
|
|
5050
5070
|
}
|
|
@@ -5111,7 +5131,11 @@ var inputStyle = tv(
|
|
|
5111
5131
|
disabled: true,
|
|
5112
5132
|
variant: ["outline", "underline"],
|
|
5113
5133
|
class: {
|
|
5114
|
-
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input
|
|
5134
|
+
inputWrapper: ["!bg-body-background", "group-has-[p.error]/input:!border-danger-light"],
|
|
5135
|
+
content: [
|
|
5136
|
+
"group-has-[p.error]/input:!text-danger-light",
|
|
5137
|
+
"group-has-[p.error]/input:placeholder:!text-danger-light"
|
|
5138
|
+
]
|
|
5115
5139
|
}
|
|
5116
5140
|
}
|
|
5117
5141
|
],
|
|
@@ -5432,7 +5456,7 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
5432
5456
|
columns,
|
|
5433
5457
|
rowCheckbox = false,
|
|
5434
5458
|
onRowClick,
|
|
5435
|
-
totalData,
|
|
5459
|
+
totalData = 0,
|
|
5436
5460
|
pagination,
|
|
5437
5461
|
onPageChange,
|
|
5438
5462
|
emptyContent,
|
|
@@ -5442,8 +5466,8 @@ var Table = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
5442
5466
|
size,
|
|
5443
5467
|
skeletonRow
|
|
5444
5468
|
} = { ...props, ...variantProps };
|
|
5445
|
-
const { page = 1, perPage =
|
|
5446
|
-
const showPagination = pagination &&
|
|
5469
|
+
const { page = 1, perPage = 15 } = pagination || {};
|
|
5470
|
+
const showPagination = pagination && totalData > 0 && !isLoading;
|
|
5447
5471
|
const [checkedRows, setCheckedRows] = (0, import_react5.useState)(/* @__PURE__ */ new Set());
|
|
5448
5472
|
const divRef = (0, import_react5.useRef)(null);
|
|
5449
5473
|
(0, import_react5.useImperativeHandle)(
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
table_default
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-P67LLF3G.mjs";
|
|
5
|
+
import "../../chunk-LWRK5TPZ.mjs";
|
|
6
6
|
import "../../chunk-P7YYNA6L.mjs";
|
|
7
7
|
import "../../chunk-DQRAFUDA.mjs";
|
|
8
8
|
import "../../chunk-M37VBNB3.mjs";
|
|
9
9
|
import "../../chunk-MZ76AA76.mjs";
|
|
10
10
|
import "../../chunk-6PN3DGOE.mjs";
|
|
11
11
|
import "../../chunk-7B7LRG5J.mjs";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-CVQM3T2X.mjs";
|
|
13
13
|
import "../../chunk-F3HENRVM.mjs";
|
|
14
14
|
import "../../chunk-2GCSFWHD.mjs";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-AIIMJZ7L.mjs";
|
|
16
16
|
import "../../chunk-QZ3LVYJW.mjs";
|
|
17
17
|
import "../../chunk-D6QI3DJG.mjs";
|
|
18
18
|
import "../../chunk-ZYIIXWVY.mjs";
|