@fctc/sme-widget-ui 1.7.6 → 1.7.7

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.d.mts CHANGED
@@ -2,6 +2,6 @@ export { useClickOutside, useFileInfo } from './hooks.mjs';
2
2
  export { AddIcon, ArchiveIcon, ArrowDownIcon, ArrowRightIcon, AttachIcon, BackIcon, CalendarIcon, CheckIcon, ChevronBottomIcon, CloseIcon, CopyIcon, DeleteIcon, DeleteIconDanger, DownloadIcon, ExcelIcon, ExportIcon, EyeClosedIcon, EyeIcon, FilterIcon, GoogleIcon, GroupByIcon, KanbanIcon, ListIcon, LoadingIcon, MoreIcon, PaidIcon, PdfIcon, PlaceHolderIcon, PlayIcon, ResetIcon, SearchIcon, SettingIcon, StarIcon, TriangleIcon, UnArchiveIcon, VectorIcon, ZipIcon } from './icons.mjs';
3
3
  export { IInputFieldProps, LoginData, LoginProps, Provider, ValuePropsType, loginSchema } from './types.mjs';
4
4
  export { ActiveBadgeField, AvatarField, BinaryField, ButtonBadgeField, ButtonField, ButtonSelectFiles, CharField, CheckboxField, ColorField, ColorWrapper, CopyLinkButtonField, DateField, DateOptionField, DownLoadBinaryField, DownloadFileField, DropdownField, EmptyTable, FeeField, FileUploadField, FloatField, FloatTimeField, HtmlField, IActiveBadgeProps, IAvatarProps, IBinaryFieldProps, IButtonBadgeProps, IButtonProps, ICharFieldProps, IColorFieldProps, IColorWrapperProps, ICopyLinkButtonProps, IDateFieldProps, IDownLoadBinary, IDownloadFileProps, IDurationProps, IFileUploadProps, IMany2ManyTagsProps, IMonetaryProps, IOptionProps, IPaginationProps, IPriorityFieldProps, IRadioGroupProps, IRatingStarProps, ISelectDropdownProps, IStatusDropdownFieldProps, ImageField, InfomationField, IntegerField, LayerLoading, LoadingSmall, Login, Many2ManyField, Many2ManyProps, Many2ManyTagField, Many2OneField, Many2OneProps, ModalConfirm, ModalDetail, ModalLayer, MonetaryField, PaginationView, PaidBadgedField, PriorityField, RadioGroupField, RatingStarField, RemainingDaysField, RenderFiles, Row, Search, SelectDropdownField, StatusBarOptionField, StatusDropdownField, StatusbarDurationField, TDropdownSelectorProps, TableBody, TableFilter, TableFooter, TableGroup, TableHead, TextAreaField, ToggleButtonField, VideoPlayer, usePagination } from './widgets.mjs';
5
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput } from './utils.mjs';
5
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput } from './utils.mjs';
6
6
  import 'react';
7
7
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export { useClickOutside, useFileInfo } from './hooks.js';
2
2
  export { AddIcon, ArchiveIcon, ArrowDownIcon, ArrowRightIcon, AttachIcon, BackIcon, CalendarIcon, CheckIcon, ChevronBottomIcon, CloseIcon, CopyIcon, DeleteIcon, DeleteIconDanger, DownloadIcon, ExcelIcon, ExportIcon, EyeClosedIcon, EyeIcon, FilterIcon, GoogleIcon, GroupByIcon, KanbanIcon, ListIcon, LoadingIcon, MoreIcon, PaidIcon, PdfIcon, PlaceHolderIcon, PlayIcon, ResetIcon, SearchIcon, SettingIcon, StarIcon, TriangleIcon, UnArchiveIcon, VectorIcon, ZipIcon } from './icons.js';
3
3
  export { IInputFieldProps, LoginData, LoginProps, Provider, ValuePropsType, loginSchema } from './types.js';
4
4
  export { ActiveBadgeField, AvatarField, BinaryField, ButtonBadgeField, ButtonField, ButtonSelectFiles, CharField, CheckboxField, ColorField, ColorWrapper, CopyLinkButtonField, DateField, DateOptionField, DownLoadBinaryField, DownloadFileField, DropdownField, EmptyTable, FeeField, FileUploadField, FloatField, FloatTimeField, HtmlField, IActiveBadgeProps, IAvatarProps, IBinaryFieldProps, IButtonBadgeProps, IButtonProps, ICharFieldProps, IColorFieldProps, IColorWrapperProps, ICopyLinkButtonProps, IDateFieldProps, IDownLoadBinary, IDownloadFileProps, IDurationProps, IFileUploadProps, IMany2ManyTagsProps, IMonetaryProps, IOptionProps, IPaginationProps, IPriorityFieldProps, IRadioGroupProps, IRatingStarProps, ISelectDropdownProps, IStatusDropdownFieldProps, ImageField, InfomationField, IntegerField, LayerLoading, LoadingSmall, Login, Many2ManyField, Many2ManyProps, Many2ManyTagField, Many2OneField, Many2OneProps, ModalConfirm, ModalDetail, ModalLayer, MonetaryField, PaginationView, PaidBadgedField, PriorityField, RadioGroupField, RatingStarField, RemainingDaysField, RenderFiles, Row, Search, SelectDropdownField, StatusBarOptionField, StatusDropdownField, StatusbarDurationField, TDropdownSelectorProps, TableBody, TableFilter, TableFooter, TableGroup, TableHead, TextAreaField, ToggleButtonField, VideoPlayer, usePagination } from './widgets.js';
5
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput } from './utils.js';
5
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput } from './utils.js';
6
6
  import 'react';
7
7
  import 'zod';
package/dist/index.js CHANGED
@@ -5046,7 +5046,6 @@ __export(index_exports, {
5046
5046
  loginSchema: () => loginSchema,
5047
5047
  parseFormattedNumber: () => parseFormattedNumber,
5048
5048
  range: () => range,
5049
- typeStyles: () => typeStyles,
5050
5049
  useClickOutside: () => useClickOutside,
5051
5050
  useFileInfo: () => useFileInfo,
5052
5051
  useFormatDate: () => useFormatDate,
@@ -7846,16 +7845,6 @@ var COLORS = [
7846
7845
  }
7847
7846
  ];
7848
7847
  var DOTS = "...";
7849
- var typeStyles = {
7850
- primary: "bg-blue-500 text-white",
7851
- secondary: "bg-lime-600 text-white",
7852
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
7853
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
7854
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
7855
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
7856
- default: "bg-[#dee2e6]",
7857
- light: "bg-white text-gray-800 shadow-md"
7858
- };
7859
7848
  var SearchType = {
7860
7849
  FILTER: "filter_by",
7861
7850
  SEARCH: "search_by",
@@ -18501,6 +18490,58 @@ var BinaryField = (props) => {
18501
18490
 
18502
18491
  // src/widgets/basic/button-badge-field/button-badge.tsx
18503
18492
  var import_jsx_runtime71 = require("react/jsx-runtime");
18493
+ var typeStyles = {
18494
+ primary: {
18495
+ backgroundColor: "#3b82f6",
18496
+ color: "#fff",
18497
+ border: "1px solid #fff"
18498
+ },
18499
+ secondary: {
18500
+ backgroundColor: "#EBF1FF",
18501
+ color: "#2597D0",
18502
+ border: "1px solid #35ADE9"
18503
+ },
18504
+ danger: {
18505
+ backgroundColor: "#FFEBEC",
18506
+ color: "#E93544",
18507
+ border: "1px solid #FB2B3D"
18508
+ },
18509
+ info: {
18510
+ backgroundColor: "rgba(5,152,237,0.12)",
18511
+ color: "rgb(5,152,237)",
18512
+ border: "1px solid rgb(5,152,237)"
18513
+ },
18514
+ success: {
18515
+ backgroundColor: "#E0FAEB",
18516
+ color: "#12AF53",
18517
+ border: "1px solid #1FC163"
18518
+ },
18519
+ warning: {
18520
+ backgroundColor: "#FFFAEB",
18521
+ color: "#E6A819)",
18522
+ border: "1px solid #F6B51E"
18523
+ },
18524
+ default: {
18525
+ backgroundColor: "#dee2e6",
18526
+ color: "#000",
18527
+ border: "1px solid #000"
18528
+ },
18529
+ light: {
18530
+ backgroundColor: "#fff",
18531
+ color: "#1f2937",
18532
+ border: "1px solid #1f2937"
18533
+ }
18534
+ };
18535
+ var baseStyle = {
18536
+ borderRadius: "4px",
18537
+ fontSize: "12px",
18538
+ padding: "4px 8px",
18539
+ width: "fit-content",
18540
+ textAlign: "center",
18541
+ fontWeight: 500,
18542
+ cursor: "pointer",
18543
+ transition: "all 0.3s ease-in-out"
18544
+ };
18504
18545
  var ButtonBadgeField = (props) => {
18505
18546
  const { defaultValue, selection, value, formValues, domainHelper } = props;
18506
18547
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
@@ -18508,31 +18549,21 @@ var ButtonBadgeField = (props) => {
18508
18549
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
18509
18550
  const decorationWarning = props["decoration-warning"] && domainHelper.checkDomain(formValues, props["decoration-warning"]);
18510
18551
  const getType = () => {
18511
- if (decorationInfo) {
18512
- return typeStyles["info"];
18513
- }
18514
- if (decorationSuccess) {
18515
- return typeStyles["success"];
18516
- }
18517
- if (decorationDanger) {
18518
- return typeStyles["danger"];
18519
- }
18520
- if (decorationWarning) {
18521
- return typeStyles["warning"];
18522
- }
18552
+ if (decorationInfo) return typeStyles["info"];
18553
+ if (decorationSuccess) return typeStyles["success"];
18554
+ if (decorationDanger) return typeStyles["danger"];
18555
+ if (decorationWarning) return typeStyles["warning"];
18523
18556
  return typeStyles["default"];
18524
18557
  };
18525
- const baseStyle = "rounded-full text-xs px-[0.82rem] w-fit py-1 text-center font-medium cursor-pointer transition duration-300 ease-in-out transform";
18526
- const buttonClass = `${baseStyle} ${getType()}`;
18527
18558
  const getLabel = (value2) => {
18528
18559
  if (!value2) return "";
18529
- const item = selection?.find((item2) => {
18530
- return Array.isArray(item2) && item2[0] === value2;
18531
- });
18560
+ const item = selection?.find(
18561
+ (item2) => Array.isArray(item2) && item2[0] === value2
18562
+ );
18532
18563
  return item ? item[1] : "";
18533
18564
  };
18534
18565
  const label = getLabel(defaultValue ?? value);
18535
- return label ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: buttonClass, children: i18n_default.t(label) }) : null;
18566
+ return label ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
18536
18567
  };
18537
18568
 
18538
18569
  // src/widgets/basic/button-field/button.tsx
@@ -35566,7 +35597,6 @@ var DateOptionField = (props) => {
35566
35597
  loginSchema,
35567
35598
  parseFormattedNumber,
35568
35599
  range,
35569
- typeStyles,
35570
35600
  useClickOutside,
35571
35601
  useFileInfo,
35572
35602
  useFormatDate,
package/dist/index.mjs CHANGED
@@ -7725,16 +7725,6 @@ var COLORS = [
7725
7725
  }
7726
7726
  ];
7727
7727
  var DOTS = "...";
7728
- var typeStyles = {
7729
- primary: "bg-blue-500 text-white",
7730
- secondary: "bg-lime-600 text-white",
7731
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
7732
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
7733
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
7734
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
7735
- default: "bg-[#dee2e6]",
7736
- light: "bg-white text-gray-800 shadow-md"
7737
- };
7738
7728
  var SearchType = {
7739
7729
  FILTER: "filter_by",
7740
7730
  SEARCH: "search_by",
@@ -18380,6 +18370,58 @@ var BinaryField = (props) => {
18380
18370
 
18381
18371
  // src/widgets/basic/button-badge-field/button-badge.tsx
18382
18372
  import { jsx as jsx71 } from "react/jsx-runtime";
18373
+ var typeStyles = {
18374
+ primary: {
18375
+ backgroundColor: "#3b82f6",
18376
+ color: "#fff",
18377
+ border: "1px solid #fff"
18378
+ },
18379
+ secondary: {
18380
+ backgroundColor: "#EBF1FF",
18381
+ color: "#2597D0",
18382
+ border: "1px solid #35ADE9"
18383
+ },
18384
+ danger: {
18385
+ backgroundColor: "#FFEBEC",
18386
+ color: "#E93544",
18387
+ border: "1px solid #FB2B3D"
18388
+ },
18389
+ info: {
18390
+ backgroundColor: "rgba(5,152,237,0.12)",
18391
+ color: "rgb(5,152,237)",
18392
+ border: "1px solid rgb(5,152,237)"
18393
+ },
18394
+ success: {
18395
+ backgroundColor: "#E0FAEB",
18396
+ color: "#12AF53",
18397
+ border: "1px solid #1FC163"
18398
+ },
18399
+ warning: {
18400
+ backgroundColor: "#FFFAEB",
18401
+ color: "#E6A819)",
18402
+ border: "1px solid #F6B51E"
18403
+ },
18404
+ default: {
18405
+ backgroundColor: "#dee2e6",
18406
+ color: "#000",
18407
+ border: "1px solid #000"
18408
+ },
18409
+ light: {
18410
+ backgroundColor: "#fff",
18411
+ color: "#1f2937",
18412
+ border: "1px solid #1f2937"
18413
+ }
18414
+ };
18415
+ var baseStyle = {
18416
+ borderRadius: "4px",
18417
+ fontSize: "12px",
18418
+ padding: "4px 8px",
18419
+ width: "fit-content",
18420
+ textAlign: "center",
18421
+ fontWeight: 500,
18422
+ cursor: "pointer",
18423
+ transition: "all 0.3s ease-in-out"
18424
+ };
18383
18425
  var ButtonBadgeField = (props) => {
18384
18426
  const { defaultValue, selection, value, formValues, domainHelper } = props;
18385
18427
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
@@ -18387,31 +18429,21 @@ var ButtonBadgeField = (props) => {
18387
18429
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
18388
18430
  const decorationWarning = props["decoration-warning"] && domainHelper.checkDomain(formValues, props["decoration-warning"]);
18389
18431
  const getType = () => {
18390
- if (decorationInfo) {
18391
- return typeStyles["info"];
18392
- }
18393
- if (decorationSuccess) {
18394
- return typeStyles["success"];
18395
- }
18396
- if (decorationDanger) {
18397
- return typeStyles["danger"];
18398
- }
18399
- if (decorationWarning) {
18400
- return typeStyles["warning"];
18401
- }
18432
+ if (decorationInfo) return typeStyles["info"];
18433
+ if (decorationSuccess) return typeStyles["success"];
18434
+ if (decorationDanger) return typeStyles["danger"];
18435
+ if (decorationWarning) return typeStyles["warning"];
18402
18436
  return typeStyles["default"];
18403
18437
  };
18404
- const baseStyle = "rounded-full text-xs px-[0.82rem] w-fit py-1 text-center font-medium cursor-pointer transition duration-300 ease-in-out transform";
18405
- const buttonClass = `${baseStyle} ${getType()}`;
18406
18438
  const getLabel = (value2) => {
18407
18439
  if (!value2) return "";
18408
- const item = selection?.find((item2) => {
18409
- return Array.isArray(item2) && item2[0] === value2;
18410
- });
18440
+ const item = selection?.find(
18441
+ (item2) => Array.isArray(item2) && item2[0] === value2
18442
+ );
18411
18443
  return item ? item[1] : "";
18412
18444
  };
18413
18445
  const label = getLabel(defaultValue ?? value);
18414
- return label ? /* @__PURE__ */ jsx71("div", { className: buttonClass, children: i18n_default.t(label) }) : null;
18446
+ return label ? /* @__PURE__ */ jsx71("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
18415
18447
  };
18416
18448
 
18417
18449
  // src/widgets/basic/button-field/button.tsx
@@ -35444,7 +35476,6 @@ export {
35444
35476
  loginSchema,
35445
35477
  parseFormattedNumber,
35446
35478
  range,
35447
- typeStyles,
35448
35479
  useClickOutside,
35449
35480
  useFileInfo,
35450
35481
  useFormatDate,
package/dist/utils.d.mts CHANGED
@@ -21,20 +21,10 @@ declare const COLORS: {
21
21
  id: number;
22
22
  }[];
23
23
  declare const DOTS = "...";
24
- declare const typeStyles: {
25
- primary: string;
26
- secondary: string;
27
- danger: string;
28
- info: string;
29
- success: string;
30
- warning: string;
31
- default: string;
32
- light: string;
33
- };
34
24
  declare const SearchType: {
35
25
  FILTER: string;
36
26
  SEARCH: string;
37
27
  GROUP: string;
38
28
  };
39
29
 
40
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput };
30
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput };
package/dist/utils.d.ts CHANGED
@@ -21,20 +21,10 @@ declare const COLORS: {
21
21
  id: number;
22
22
  }[];
23
23
  declare const DOTS = "...";
24
- declare const typeStyles: {
25
- primary: string;
26
- secondary: string;
27
- danger: string;
28
- info: string;
29
- success: string;
30
- warning: string;
31
- default: string;
32
- light: string;
33
- };
34
24
  declare const SearchType: {
35
25
  FILTER: string;
36
26
  SEARCH: string;
37
27
  GROUP: string;
38
28
  };
39
29
 
40
- export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, typeStyles, useFormatDate, validateAndParseDate, validateInput };
30
+ export { COLORS, DOTS, SearchType, checkIsImageLink, convertFloatToTime, convertTimeToFloat, formatFileSize, formatFloatNumber, formatNumberOnly, getPasswordMessage, isBase64Image, isObjectEmpty, parseFormattedNumber, range, useFormatDate, validateAndParseDate, validateInput };
package/dist/utils.js CHANGED
@@ -4071,7 +4071,6 @@ __export(utils_exports, {
4071
4071
  isObjectEmpty: () => isObjectEmpty,
4072
4072
  parseFormattedNumber: () => parseFormattedNumber,
4073
4073
  range: () => range,
4074
- typeStyles: () => typeStyles,
4075
4074
  useFormatDate: () => useFormatDate,
4076
4075
  validateAndParseDate: () => validateAndParseDate,
4077
4076
  validateInput: () => validateInput
@@ -4838,16 +4837,6 @@ var COLORS = [
4838
4837
  }
4839
4838
  ];
4840
4839
  var DOTS = "...";
4841
- var typeStyles = {
4842
- primary: "bg-blue-500 text-white",
4843
- secondary: "bg-lime-600 text-white",
4844
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
4845
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
4846
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
4847
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
4848
- default: "bg-[#dee2e6]",
4849
- light: "bg-white text-gray-800 shadow-md"
4850
- };
4851
4840
  var SearchType = {
4852
4841
  FILTER: "filter_by",
4853
4842
  SEARCH: "search_by",
@@ -4869,7 +4858,6 @@ var SearchType = {
4869
4858
  isObjectEmpty,
4870
4859
  parseFormattedNumber,
4871
4860
  range,
4872
- typeStyles,
4873
4861
  useFormatDate,
4874
4862
  validateAndParseDate,
4875
4863
  validateInput
package/dist/utils.mjs CHANGED
@@ -4814,16 +4814,6 @@ var COLORS = [
4814
4814
  }
4815
4815
  ];
4816
4816
  var DOTS = "...";
4817
- var typeStyles = {
4818
- primary: "bg-blue-500 text-white",
4819
- secondary: "bg-lime-600 text-white",
4820
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
4821
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
4822
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
4823
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
4824
- default: "bg-[#dee2e6]",
4825
- light: "bg-white text-gray-800 shadow-md"
4826
- };
4827
4817
  var SearchType = {
4828
4818
  FILTER: "filter_by",
4829
4819
  SEARCH: "search_by",
@@ -4844,7 +4834,6 @@ export {
4844
4834
  isObjectEmpty,
4845
4835
  parseFormattedNumber,
4846
4836
  range,
4847
- typeStyles,
4848
4837
  useFormatDate,
4849
4838
  validateAndParseDate,
4850
4839
  validateInput
package/dist/widgets.js CHANGED
@@ -5778,16 +5778,6 @@ var COLORS = [
5778
5778
  }
5779
5779
  ];
5780
5780
  var DOTS = "...";
5781
- var typeStyles = {
5782
- primary: "bg-blue-500 text-white",
5783
- secondary: "bg-lime-600 text-white",
5784
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
5785
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
5786
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
5787
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
5788
- default: "bg-[#dee2e6]",
5789
- light: "bg-white text-gray-800 shadow-md"
5790
- };
5791
5781
  var SearchType = {
5792
5782
  FILTER: "filter_by",
5793
5783
  SEARCH: "search_by",
@@ -18125,6 +18115,58 @@ var BinaryField = (props) => {
18125
18115
 
18126
18116
  // src/widgets/basic/button-badge-field/button-badge.tsx
18127
18117
  var import_jsx_runtime71 = require("react/jsx-runtime");
18118
+ var typeStyles = {
18119
+ primary: {
18120
+ backgroundColor: "#3b82f6",
18121
+ color: "#fff",
18122
+ border: "1px solid #fff"
18123
+ },
18124
+ secondary: {
18125
+ backgroundColor: "#EBF1FF",
18126
+ color: "#2597D0",
18127
+ border: "1px solid #35ADE9"
18128
+ },
18129
+ danger: {
18130
+ backgroundColor: "#FFEBEC",
18131
+ color: "#E93544",
18132
+ border: "1px solid #FB2B3D"
18133
+ },
18134
+ info: {
18135
+ backgroundColor: "rgba(5,152,237,0.12)",
18136
+ color: "rgb(5,152,237)",
18137
+ border: "1px solid rgb(5,152,237)"
18138
+ },
18139
+ success: {
18140
+ backgroundColor: "#E0FAEB",
18141
+ color: "#12AF53",
18142
+ border: "1px solid #1FC163"
18143
+ },
18144
+ warning: {
18145
+ backgroundColor: "#FFFAEB",
18146
+ color: "#E6A819)",
18147
+ border: "1px solid #F6B51E"
18148
+ },
18149
+ default: {
18150
+ backgroundColor: "#dee2e6",
18151
+ color: "#000",
18152
+ border: "1px solid #000"
18153
+ },
18154
+ light: {
18155
+ backgroundColor: "#fff",
18156
+ color: "#1f2937",
18157
+ border: "1px solid #1f2937"
18158
+ }
18159
+ };
18160
+ var baseStyle = {
18161
+ borderRadius: "4px",
18162
+ fontSize: "12px",
18163
+ padding: "4px 8px",
18164
+ width: "fit-content",
18165
+ textAlign: "center",
18166
+ fontWeight: 500,
18167
+ cursor: "pointer",
18168
+ transition: "all 0.3s ease-in-out"
18169
+ };
18128
18170
  var ButtonBadgeField = (props) => {
18129
18171
  const { defaultValue, selection, value, formValues, domainHelper } = props;
18130
18172
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
@@ -18132,31 +18174,21 @@ var ButtonBadgeField = (props) => {
18132
18174
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
18133
18175
  const decorationWarning = props["decoration-warning"] && domainHelper.checkDomain(formValues, props["decoration-warning"]);
18134
18176
  const getType = () => {
18135
- if (decorationInfo) {
18136
- return typeStyles["info"];
18137
- }
18138
- if (decorationSuccess) {
18139
- return typeStyles["success"];
18140
- }
18141
- if (decorationDanger) {
18142
- return typeStyles["danger"];
18143
- }
18144
- if (decorationWarning) {
18145
- return typeStyles["warning"];
18146
- }
18177
+ if (decorationInfo) return typeStyles["info"];
18178
+ if (decorationSuccess) return typeStyles["success"];
18179
+ if (decorationDanger) return typeStyles["danger"];
18180
+ if (decorationWarning) return typeStyles["warning"];
18147
18181
  return typeStyles["default"];
18148
18182
  };
18149
- const baseStyle = "rounded-full text-xs px-[0.82rem] w-fit py-1 text-center font-medium cursor-pointer transition duration-300 ease-in-out transform";
18150
- const buttonClass = `${baseStyle} ${getType()}`;
18151
18183
  const getLabel = (value2) => {
18152
18184
  if (!value2) return "";
18153
- const item = selection?.find((item2) => {
18154
- return Array.isArray(item2) && item2[0] === value2;
18155
- });
18185
+ const item = selection?.find(
18186
+ (item2) => Array.isArray(item2) && item2[0] === value2
18187
+ );
18156
18188
  return item ? item[1] : "";
18157
18189
  };
18158
18190
  const label = getLabel(defaultValue ?? value);
18159
- return label ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: buttonClass, children: i18n_default.t(label) }) : null;
18191
+ return label ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
18160
18192
  };
18161
18193
 
18162
18194
  // src/widgets/basic/button-field/button.tsx
package/dist/widgets.mjs CHANGED
@@ -5715,16 +5715,6 @@ var COLORS = [
5715
5715
  }
5716
5716
  ];
5717
5717
  var DOTS = "...";
5718
- var typeStyles = {
5719
- primary: "bg-blue-500 text-white",
5720
- secondary: "bg-lime-600 text-white",
5721
- danger: "bg-[rgba(237,28,36,0.1)] text-[#F5222D]",
5722
- info: "bg-[rgba(5,152,237,0.12)] text-[rgb(5,152,237)]",
5723
- success: "bg-[rgba(46,181,83,0.1)] text-[rgb(46,181,83)]",
5724
- warning: "bg-[rgba(237,166,28,0.1)] text-[rgb(250,140,22)]",
5725
- default: "bg-[#dee2e6]",
5726
- light: "bg-white text-gray-800 shadow-md"
5727
- };
5728
5718
  var SearchType = {
5729
5719
  FILTER: "filter_by",
5730
5720
  SEARCH: "search_by",
@@ -18062,6 +18052,58 @@ var BinaryField = (props) => {
18062
18052
 
18063
18053
  // src/widgets/basic/button-badge-field/button-badge.tsx
18064
18054
  import { jsx as jsx71 } from "react/jsx-runtime";
18055
+ var typeStyles = {
18056
+ primary: {
18057
+ backgroundColor: "#3b82f6",
18058
+ color: "#fff",
18059
+ border: "1px solid #fff"
18060
+ },
18061
+ secondary: {
18062
+ backgroundColor: "#EBF1FF",
18063
+ color: "#2597D0",
18064
+ border: "1px solid #35ADE9"
18065
+ },
18066
+ danger: {
18067
+ backgroundColor: "#FFEBEC",
18068
+ color: "#E93544",
18069
+ border: "1px solid #FB2B3D"
18070
+ },
18071
+ info: {
18072
+ backgroundColor: "rgba(5,152,237,0.12)",
18073
+ color: "rgb(5,152,237)",
18074
+ border: "1px solid rgb(5,152,237)"
18075
+ },
18076
+ success: {
18077
+ backgroundColor: "#E0FAEB",
18078
+ color: "#12AF53",
18079
+ border: "1px solid #1FC163"
18080
+ },
18081
+ warning: {
18082
+ backgroundColor: "#FFFAEB",
18083
+ color: "#E6A819)",
18084
+ border: "1px solid #F6B51E"
18085
+ },
18086
+ default: {
18087
+ backgroundColor: "#dee2e6",
18088
+ color: "#000",
18089
+ border: "1px solid #000"
18090
+ },
18091
+ light: {
18092
+ backgroundColor: "#fff",
18093
+ color: "#1f2937",
18094
+ border: "1px solid #1f2937"
18095
+ }
18096
+ };
18097
+ var baseStyle = {
18098
+ borderRadius: "4px",
18099
+ fontSize: "12px",
18100
+ padding: "4px 8px",
18101
+ width: "fit-content",
18102
+ textAlign: "center",
18103
+ fontWeight: 500,
18104
+ cursor: "pointer",
18105
+ transition: "all 0.3s ease-in-out"
18106
+ };
18065
18107
  var ButtonBadgeField = (props) => {
18066
18108
  const { defaultValue, selection, value, formValues, domainHelper } = props;
18067
18109
  const decorationSuccess = props["decoration-success"] && domainHelper.checkDomain(formValues, props["decoration-success"]);
@@ -18069,31 +18111,21 @@ var ButtonBadgeField = (props) => {
18069
18111
  const decorationDanger = props["decoration-danger"] && domainHelper.checkDomain(formValues, props["decoration-danger"]);
18070
18112
  const decorationWarning = props["decoration-warning"] && domainHelper.checkDomain(formValues, props["decoration-warning"]);
18071
18113
  const getType = () => {
18072
- if (decorationInfo) {
18073
- return typeStyles["info"];
18074
- }
18075
- if (decorationSuccess) {
18076
- return typeStyles["success"];
18077
- }
18078
- if (decorationDanger) {
18079
- return typeStyles["danger"];
18080
- }
18081
- if (decorationWarning) {
18082
- return typeStyles["warning"];
18083
- }
18114
+ if (decorationInfo) return typeStyles["info"];
18115
+ if (decorationSuccess) return typeStyles["success"];
18116
+ if (decorationDanger) return typeStyles["danger"];
18117
+ if (decorationWarning) return typeStyles["warning"];
18084
18118
  return typeStyles["default"];
18085
18119
  };
18086
- const baseStyle = "rounded-full text-xs px-[0.82rem] w-fit py-1 text-center font-medium cursor-pointer transition duration-300 ease-in-out transform";
18087
- const buttonClass = `${baseStyle} ${getType()}`;
18088
18120
  const getLabel = (value2) => {
18089
18121
  if (!value2) return "";
18090
- const item = selection?.find((item2) => {
18091
- return Array.isArray(item2) && item2[0] === value2;
18092
- });
18122
+ const item = selection?.find(
18123
+ (item2) => Array.isArray(item2) && item2[0] === value2
18124
+ );
18093
18125
  return item ? item[1] : "";
18094
18126
  };
18095
18127
  const label = getLabel(defaultValue ?? value);
18096
- return label ? /* @__PURE__ */ jsx71("div", { className: buttonClass, children: i18n_default.t(label) }) : null;
18128
+ return label ? /* @__PURE__ */ jsx71("div", { style: { ...baseStyle, ...getType() }, children: i18n_default.t(label) }) : null;
18097
18129
  };
18098
18130
 
18099
18131
  // src/widgets/basic/button-field/button.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",