@esic-lab/data-core-ui 0.0.70 → 0.0.72

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/dist/index.css CHANGED
@@ -71,7 +71,6 @@
71
71
  --default-font-family: var(--font-sans);
72
72
  --default-mono-font-family: var(--font-mono);
73
73
  --color-primary-800: #2b3587;
74
- --color-primary-700: #3745af;
75
74
  --color-primary-500: #4e61f6;
76
75
  --color-primary-400: #7181f8;
77
76
  --color-primary-200: #aeb6fb;
@@ -978,8 +977,8 @@
978
977
  .border-b-gray-200 {
979
978
  border-bottom-color: var(--color-gray-200);
980
979
  }
981
- .border-b-primary-700 {
982
- border-bottom-color: var(--color-primary-700);
980
+ .border-b-primary-500 {
981
+ border-bottom-color: var(--color-primary-500);
983
982
  }
984
983
  .\!bg-gray-300 {
985
984
  background-color: var(--color-gray-300) !important;
@@ -1110,6 +1109,9 @@
1110
1109
  .pb-2 {
1111
1110
  padding-bottom: calc(var(--spacing) * 2);
1112
1111
  }
1112
+ .pb-\[10px\] {
1113
+ padding-bottom: 10px;
1114
+ }
1113
1115
  .pb-\[16px\] {
1114
1116
  padding-bottom: 16px;
1115
1117
  }
@@ -1225,9 +1227,6 @@
1225
1227
  .text-primary-500 {
1226
1228
  color: var(--color-primary-500);
1227
1229
  }
1228
- .text-primary-700 {
1229
- color: var(--color-primary-700);
1230
- }
1231
1230
  .text-red-500 {
1232
1231
  color: var(--color-red-500);
1233
1232
  }
package/dist/index.d.mts CHANGED
@@ -58,7 +58,7 @@ interface ParamTabSelection {
58
58
  now: string;
59
59
  onClickGoto: (path: string) => void;
60
60
  }
61
- declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
61
+ declare const TabSelectionButton: ({ title, now, onClickGoto, }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
62
62
 
63
63
  interface TertiaryButtonProps {
64
64
  title: string;
@@ -220,8 +220,9 @@ interface TextInputProps {
220
220
  value?: string;
221
221
  onChange: (value: string) => void;
222
222
  disabled?: boolean;
223
+ className?: string;
223
224
  }
224
- declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
225
+ declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, className, }: TextInputProps): react_jsx_runtime.JSX.Element;
225
226
 
226
227
  interface TextAreaProps {
227
228
  label?: string;
@@ -258,6 +259,7 @@ declare function InputField({ value, onChange, placeholder, label, required, dis
258
259
  interface InputFieldNumberProps {
259
260
  value: number | string | null;
260
261
  onChange: (value: number | string | null) => void;
262
+ onBlur?: (e: HTMLInputElement) => void;
261
263
  placeholder?: string;
262
264
  label?: string;
263
265
  required?: boolean;
@@ -281,7 +283,7 @@ interface InputFieldNumberProps {
281
283
  decimalScale?: number;
282
284
  format?: "number" | "currency";
283
285
  }
284
- declare function InputFieldNumber({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, decimal, decimalScale, format, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
286
+ declare function InputFieldNumber({ value, onChange, onBlur, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, decimal, decimalScale, format, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
285
287
 
286
288
  interface DatePickerBasicProps {
287
289
  value: Date | null;
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ interface ParamTabSelection {
58
58
  now: string;
59
59
  onClickGoto: (path: string) => void;
60
60
  }
61
- declare const TabSelectionButton: ({ title, now, onClickGoto }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
61
+ declare const TabSelectionButton: ({ title, now, onClickGoto, }: ParamTabSelection) => react_jsx_runtime.JSX.Element;
62
62
 
63
63
  interface TertiaryButtonProps {
64
64
  title: string;
@@ -220,8 +220,9 @@ interface TextInputProps {
220
220
  value?: string;
221
221
  onChange: (value: string) => void;
222
222
  disabled?: boolean;
223
+ className?: string;
223
224
  }
224
- declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, }: TextInputProps): react_jsx_runtime.JSX.Element;
225
+ declare function TextInput({ label, placeholder, type, maxLength, required, error, value, onChange, disabled, className, }: TextInputProps): react_jsx_runtime.JSX.Element;
225
226
 
226
227
  interface TextAreaProps {
227
228
  label?: string;
@@ -258,6 +259,7 @@ declare function InputField({ value, onChange, placeholder, label, required, dis
258
259
  interface InputFieldNumberProps {
259
260
  value: number | string | null;
260
261
  onChange: (value: number | string | null) => void;
262
+ onBlur?: (e: HTMLInputElement) => void;
261
263
  placeholder?: string;
262
264
  label?: string;
263
265
  required?: boolean;
@@ -281,7 +283,7 @@ interface InputFieldNumberProps {
281
283
  decimalScale?: number;
282
284
  format?: "number" | "currency";
283
285
  }
284
- declare function InputFieldNumber({ value, onChange, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, decimal, decimalScale, format, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
286
+ declare function InputFieldNumber({ value, onChange, onBlur, placeholder, label, required, disabled, error, addonBefore, addonAfter, defaultValue, className, max, min, controls, size, changeOnWheel, formatter, parser, decimal, decimalScale, format, }: InputFieldNumberProps): react_jsx_runtime.JSX.Element;
285
287
 
286
288
  interface DatePickerBasicProps {
287
289
  value: Date | null;
package/dist/index.js CHANGED
@@ -529,13 +529,17 @@ function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
529
529
 
530
530
  // src/Button/TabSelectionButton/TabSelectionButton.tsx
531
531
  var import_jsx_runtime4 = require("react/jsx-runtime");
532
- var TabSelectionButton = ({ title, now, onClickGoto }) => {
532
+ var TabSelectionButton = ({
533
+ title,
534
+ now,
535
+ onClickGoto
536
+ }) => {
533
537
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex subtitle-2", children: [
534
538
  title.map((text) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
535
539
  "button",
536
540
  {
537
541
  onClick: () => onClickGoto(text.path),
538
- className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-700 text-primary-700 border-b-2" : "border-b-gray-200 border-b-2"}`,
542
+ className: `text-nowrap px-2 cursor-pointer pb-[10px] ${now === text.path ? "border-b-primary-500 text-primary-500 border-b-2" : "border-b-gray-200 border-b-2"}`,
539
543
  children: text.name
540
544
  }
541
545
  )),
@@ -1187,15 +1191,16 @@ function TextInput({
1187
1191
  error,
1188
1192
  value,
1189
1193
  onChange,
1190
- disabled
1194
+ disabled,
1195
+ className
1191
1196
  }) {
1192
1197
  const [showPassword, setShowPassword] = (0, import_react7.useState)(false);
1193
1198
  const onShowPassword = () => {
1194
1199
  setShowPassword(!showPassword);
1195
1200
  };
1196
1201
  const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
1197
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
1198
- label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1 mb-[8px]", children: [
1202
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex-col flex gap-2", children: [
1203
+ label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1", children: [
1199
1204
  label,
1200
1205
  required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "\xA0*" })
1201
1206
  ] }),
@@ -1203,7 +1208,7 @@ function TextInput({
1203
1208
  "div",
1204
1209
  {
1205
1210
  className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
1206
- ${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
1211
+ ${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""} ${className ?? ""}`,
1207
1212
  children: [
1208
1213
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1209
1214
  "input",
@@ -1218,11 +1223,23 @@ function TextInput({
1218
1223
  disabled
1219
1224
  }
1220
1225
  ),
1221
- type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons_react7.IconEye, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_icons_react7.IconEyeOff, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }))
1226
+ type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1227
+ import_icons_react7.IconEye,
1228
+ {
1229
+ className: "text-gray-600 mr-[8px] cursor-pointer",
1230
+ onClick: onShowPassword
1231
+ }
1232
+ ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1233
+ import_icons_react7.IconEyeOff,
1234
+ {
1235
+ className: "text-gray-600 mr-[8px] cursor-pointer",
1236
+ onClick: onShowPassword
1237
+ }
1238
+ ))
1222
1239
  ]
1223
1240
  }
1224
1241
  ),
1225
- error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 body-1", children: error })
1242
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 caption-1", children: error })
1226
1243
  ] });
1227
1244
  }
1228
1245
 
@@ -1343,6 +1360,7 @@ var import_jsx_runtime23 = require("react/jsx-runtime");
1343
1360
  function InputFieldNumber({
1344
1361
  value,
1345
1362
  onChange,
1363
+ onBlur,
1346
1364
  placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
1347
1365
  label,
1348
1366
  required,
@@ -1401,6 +1419,7 @@ function InputFieldNumber({
1401
1419
  {
1402
1420
  value: value ?? void 0,
1403
1421
  onChange: (val) => onChange(val),
1422
+ onBlur: (e) => onBlur?.(e.target),
1404
1423
  placeholder,
1405
1424
  disabled,
1406
1425
  className: `body-1 !w-full ${className ?? ""}`,
@@ -1417,16 +1436,7 @@ function InputFieldNumber({
1417
1436
  precision: decimal ? safeScale : 0,
1418
1437
  inputMode: decimal ? "decimal" : "numeric",
1419
1438
  onKeyDown: (e) => {
1420
- const allowed = [
1421
- "Backspace",
1422
- "Delete",
1423
- "ArrowLeft",
1424
- "ArrowRight",
1425
- "Tab",
1426
- "Enter",
1427
- "Home",
1428
- "End"
1429
- ];
1439
+ const allowed = ["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab", "Enter", "Home", "End"];
1430
1440
  if (allowed.includes(e.key)) return;
1431
1441
  if (e.ctrlKey || e.metaKey) return;
1432
1442
  if (!decimal) {
package/dist/index.mjs CHANGED
@@ -463,13 +463,17 @@ function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
463
463
 
464
464
  // src/Button/TabSelectionButton/TabSelectionButton.tsx
465
465
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
466
- var TabSelectionButton = ({ title, now, onClickGoto }) => {
466
+ var TabSelectionButton = ({
467
+ title,
468
+ now,
469
+ onClickGoto
470
+ }) => {
467
471
  return /* @__PURE__ */ jsxs2("div", { className: "flex subtitle-2", children: [
468
472
  title.map((text) => /* @__PURE__ */ jsx4(
469
473
  "button",
470
474
  {
471
475
  onClick: () => onClickGoto(text.path),
472
- className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-700 text-primary-700 border-b-2" : "border-b-gray-200 border-b-2"}`,
476
+ className: `text-nowrap px-2 cursor-pointer pb-[10px] ${now === text.path ? "border-b-primary-500 text-primary-500 border-b-2" : "border-b-gray-200 border-b-2"}`,
473
477
  children: text.name
474
478
  }
475
479
  )),
@@ -1121,15 +1125,16 @@ function TextInput({
1121
1125
  error,
1122
1126
  value,
1123
1127
  onChange,
1124
- disabled
1128
+ disabled,
1129
+ className
1125
1130
  }) {
1126
1131
  const [showPassword, setShowPassword] = useState5(false);
1127
1132
  const onShowPassword = () => {
1128
1133
  setShowPassword(!showPassword);
1129
1134
  };
1130
1135
  const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
1131
- return /* @__PURE__ */ jsxs13("div", { children: [
1132
- label && /* @__PURE__ */ jsxs13("p", { className: "body-1 mb-[8px]", children: [
1136
+ return /* @__PURE__ */ jsxs13("div", { className: "flex-col flex gap-2", children: [
1137
+ label && /* @__PURE__ */ jsxs13("p", { className: "body-1", children: [
1133
1138
  label,
1134
1139
  required && /* @__PURE__ */ jsx20("span", { className: "text-red-500", children: "\xA0*" })
1135
1140
  ] }),
@@ -1137,7 +1142,7 @@ function TextInput({
1137
1142
  "div",
1138
1143
  {
1139
1144
  className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
1140
- ${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
1145
+ ${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""} ${className ?? ""}`,
1141
1146
  children: [
1142
1147
  /* @__PURE__ */ jsx20(
1143
1148
  "input",
@@ -1152,11 +1157,23 @@ function TextInput({
1152
1157
  disabled
1153
1158
  }
1154
1159
  ),
1155
- type === "password" && (showPassword ? /* @__PURE__ */ jsx20(IconEye, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }) : /* @__PURE__ */ jsx20(IconEyeOff, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }))
1160
+ type === "password" && (showPassword ? /* @__PURE__ */ jsx20(
1161
+ IconEye,
1162
+ {
1163
+ className: "text-gray-600 mr-[8px] cursor-pointer",
1164
+ onClick: onShowPassword
1165
+ }
1166
+ ) : /* @__PURE__ */ jsx20(
1167
+ IconEyeOff,
1168
+ {
1169
+ className: "text-gray-600 mr-[8px] cursor-pointer",
1170
+ onClick: onShowPassword
1171
+ }
1172
+ ))
1156
1173
  ]
1157
1174
  }
1158
1175
  ),
1159
- error && /* @__PURE__ */ jsx20("p", { className: "text-red-500 body-1", children: error })
1176
+ error && /* @__PURE__ */ jsx20("p", { className: "text-red-500 caption-1", children: error })
1160
1177
  ] });
1161
1178
  }
1162
1179
 
@@ -1277,6 +1294,7 @@ import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
1277
1294
  function InputFieldNumber({
1278
1295
  value,
1279
1296
  onChange,
1297
+ onBlur,
1280
1298
  placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
1281
1299
  label,
1282
1300
  required,
@@ -1335,6 +1353,7 @@ function InputFieldNumber({
1335
1353
  {
1336
1354
  value: value ?? void 0,
1337
1355
  onChange: (val) => onChange(val),
1356
+ onBlur: (e) => onBlur?.(e.target),
1338
1357
  placeholder,
1339
1358
  disabled,
1340
1359
  className: `body-1 !w-full ${className ?? ""}`,
@@ -1351,16 +1370,7 @@ function InputFieldNumber({
1351
1370
  precision: decimal ? safeScale : 0,
1352
1371
  inputMode: decimal ? "decimal" : "numeric",
1353
1372
  onKeyDown: (e) => {
1354
- const allowed = [
1355
- "Backspace",
1356
- "Delete",
1357
- "ArrowLeft",
1358
- "ArrowRight",
1359
- "Tab",
1360
- "Enter",
1361
- "Home",
1362
- "End"
1363
- ];
1373
+ const allowed = ["Backspace", "Delete", "ArrowLeft", "ArrowRight", "Tab", "Enter", "Home", "End"];
1364
1374
  if (allowed.includes(e.key)) return;
1365
1375
  if (e.ctrlKey || e.metaKey) return;
1366
1376
  if (!decimal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.70",
3
+ "version": "0.0.72",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",