@algorithm-shift/design-system 1.2.979 → 1.2.981

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.mjs CHANGED
@@ -382,7 +382,7 @@ var Typography = ({
382
382
  React4.createElement("span", {
383
383
  key: "html",
384
384
  className: "pointer-events-none",
385
- dangerouslySetInnerHTML: { __html: textContent }
385
+ dangerouslySetInnerHTML: { __html: textContent || "--" }
386
386
  })
387
387
  ]
388
388
  );
@@ -1690,7 +1690,7 @@ __export(lucide_react_exports, {
1690
1690
  FerrisWheelIcon: () => FerrisWheel,
1691
1691
  Figma: () => Figma,
1692
1692
  FigmaIcon: () => Figma,
1693
- File: () => File,
1693
+ File: () => File2,
1694
1694
  FileArchive: () => FileArchive,
1695
1695
  FileArchiveIcon: () => FileArchive,
1696
1696
  FileAudio: () => FileAudio,
@@ -1743,7 +1743,7 @@ __export(lucide_react_exports, {
1743
1743
  FileEditIcon: () => FilePen,
1744
1744
  FileHeart: () => FileHeart,
1745
1745
  FileHeartIcon: () => FileHeart,
1746
- FileIcon: () => File,
1746
+ FileIcon: () => File2,
1747
1747
  FileImage: () => FileImage,
1748
1748
  FileImageIcon: () => FileImage,
1749
1749
  FileInput: () => FileInput,
@@ -3100,7 +3100,7 @@ __export(lucide_react_exports, {
3100
3100
  LucideFence: () => Fence,
3101
3101
  LucideFerrisWheel: () => FerrisWheel,
3102
3102
  LucideFigma: () => Figma,
3103
- LucideFile: () => File,
3103
+ LucideFile: () => File2,
3104
3104
  LucideFileArchive: () => FileArchive,
3105
3105
  LucideFileAudio: () => FileAudio,
3106
3106
  LucideFileAudio2: () => FileAudio2,
@@ -6521,7 +6521,7 @@ __export(icons_exports, {
6521
6521
  Fence: () => Fence,
6522
6522
  FerrisWheel: () => FerrisWheel,
6523
6523
  Figma: () => Figma,
6524
- File: () => File,
6524
+ File: () => File2,
6525
6525
  FileArchive: () => FileArchive,
6526
6526
  FileAudio: () => FileAudio,
6527
6527
  FileAudio2: () => FileAudio2,
@@ -14671,7 +14671,7 @@ var __iconNode630 = [
14671
14671
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
14672
14672
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
14673
14673
  ];
14674
- var File = createLucideIcon("file", __iconNode630);
14674
+ var File2 = createLucideIcon("file", __iconNode630);
14675
14675
 
14676
14676
  // node_modules/lucide-react/dist/esm/icons/files.js
14677
14677
  var __iconNode631 = [
@@ -26926,18 +26926,26 @@ var TextInput = ({ className, style, ...props }) => {
26926
26926
  const handleChange = (e) => {
26927
26927
  props.onChange?.(e, props?.name || "");
26928
26928
  };
26929
+ const formatValue = (value) => {
26930
+ if (props.inputType === "file") {
26931
+ return value instanceof File || value instanceof FileList ? value : null;
26932
+ }
26933
+ if (value === null || value === void 0) return "";
26934
+ return value;
26935
+ };
26929
26936
  return /* @__PURE__ */ jsxs7(Fragment3, { children: [
26930
26937
  /* @__PURE__ */ jsx20(
26931
26938
  Input,
26932
26939
  {
26933
26940
  type: props.inputType || "text",
26934
26941
  name: props.name,
26942
+ id: props.name || "text-field",
26935
26943
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
26936
26944
  style: {
26937
26945
  ...style,
26938
26946
  borderColor: props.errorMessage ? "#f87171" : style?.borderColor
26939
26947
  },
26940
- value: props.value || "",
26948
+ value: formatValue(props.value),
26941
26949
  autoComplete: isAutocomplete ? "on" : "off",
26942
26950
  placeholder,
26943
26951
  onChange: handleChange,
@@ -26968,14 +26976,21 @@ var NumberInput = ({ className, style, ...props }) => {
26968
26976
  const handleChange = (e) => {
26969
26977
  props.onChange?.(e, props.name || "");
26970
26978
  };
26979
+ const formatValue = (value) => {
26980
+ if (props.inputType === "file") {
26981
+ return value instanceof File || value instanceof FileList ? value : null;
26982
+ }
26983
+ if (value === null || value === void 0) return 0;
26984
+ return value;
26985
+ };
26971
26986
  return /* @__PURE__ */ jsxs8(Fragment4, { children: [
26972
26987
  /* @__PURE__ */ jsx21("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx21(
26973
26988
  Input,
26974
26989
  {
26975
- type: "number",
26990
+ type: props.inputType || "number",
26976
26991
  id: props.name || "number-field",
26977
26992
  name: props.name,
26978
- value: props.value || "",
26993
+ value: formatValue(props.value),
26979
26994
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
26980
26995
  style: {
26981
26996
  ...style,
@@ -27011,13 +27026,21 @@ var EmailInput = ({ className, style, ...props }) => {
27011
27026
  const handleChange = (e) => {
27012
27027
  props.onChange?.(e, props?.name || "");
27013
27028
  };
27029
+ const formatValue = (value) => {
27030
+ if (props.inputType === "file") {
27031
+ return value instanceof File || value instanceof FileList ? value : null;
27032
+ }
27033
+ if (value === null || value === void 0) return "";
27034
+ return value;
27035
+ };
27014
27036
  return /* @__PURE__ */ jsxs9(Fragment5, { children: [
27015
27037
  /* @__PURE__ */ jsx22("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx22(
27016
27038
  Input,
27017
27039
  {
27018
- type: "email",
27040
+ type: props.inputType || "email",
27019
27041
  name: props.name,
27020
- value: props.value || "",
27042
+ id: props.name || "email-field",
27043
+ value: formatValue(props.value),
27021
27044
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27022
27045
  style: {
27023
27046
  ...style,
@@ -27053,14 +27076,21 @@ var PasswordInput = ({ className, style, ...props }) => {
27053
27076
  const handleChange = (e) => {
27054
27077
  props.onChange?.(e, props?.name || "");
27055
27078
  };
27079
+ const formatValue = (value) => {
27080
+ if (props.inputType === "file") {
27081
+ return value instanceof File || value instanceof FileList ? value : null;
27082
+ }
27083
+ if (value === null || value === void 0) return "";
27084
+ return value;
27085
+ };
27056
27086
  return /* @__PURE__ */ jsxs10(Fragment6, { children: [
27057
27087
  /* @__PURE__ */ jsx23("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx23(
27058
27088
  Input,
27059
27089
  {
27060
- type: "password",
27090
+ type: props.inputType || "password",
27061
27091
  id: props.name || "password-field",
27062
27092
  name: props.name,
27063
- value: props.value || "",
27093
+ value: formatValue(props.value),
27064
27094
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27065
27095
  style: {
27066
27096
  ...style,
@@ -27156,16 +27186,23 @@ var UrlInput = ({ className, style, ...props }) => {
27156
27186
  const handleChange = (e) => {
27157
27187
  props.onChange?.(e, props?.name || "");
27158
27188
  };
27189
+ const formatValue = (value) => {
27190
+ if (props.inputType === "file") {
27191
+ return value instanceof File || value instanceof FileList ? value : null;
27192
+ }
27193
+ if (value === null || value === void 0) return "";
27194
+ return value;
27195
+ };
27159
27196
  return /* @__PURE__ */ jsxs12(Fragment8, { children: [
27160
27197
  /* @__PURE__ */ jsxs12("div", { className: "flex justify-start items-center relative", children: [
27161
27198
  /* @__PURE__ */ jsx26("div", { className: "bg-[#E9E9E9] absolute px-10 text-center top-1/2 h-full justify-center items-center flex w-10 -translate-y-1/2 text-[#383838] font-[500] text-[12px]", children: "https://" }),
27162
27199
  /* @__PURE__ */ jsx26(
27163
27200
  Input,
27164
27201
  {
27165
- id: "url-field",
27166
- type: "url",
27202
+ id: props.name || "url-field",
27203
+ type: props.inputType || "url",
27167
27204
  name: props.name,
27168
- value: props.value || "",
27205
+ value: formatValue(props.value),
27169
27206
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27170
27207
  style: {
27171
27208
  ...style,
@@ -28022,7 +28059,8 @@ function LazySelectDropdown({
28022
28059
  dataLabel = "name",
28023
28060
  errorMessage,
28024
28061
  axiosInstance,
28025
- enableAddNewOption = false
28062
+ enableAddNewOption = false,
28063
+ enforceStrictQueryParams = false
28026
28064
  }) {
28027
28065
  const [isOpen, setIsOpen] = useState5(false);
28028
28066
  const [searchTerm, setSearchTerm] = useState5("");
@@ -28046,7 +28084,8 @@ function LazySelectDropdown({
28046
28084
  dataLabel,
28047
28085
  initialData: options || [],
28048
28086
  value,
28049
- axiosInstance
28087
+ axiosInstance,
28088
+ enforceStrictQueryParams
28050
28089
  });
28051
28090
  const selectedOption = useMemo3(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
28052
28091
  useEffect14(() => {
@@ -28400,14 +28439,21 @@ var SearchInput = ({ className, style, ...props }) => {
28400
28439
  const handleChange = (e) => {
28401
28440
  props.onChange?.(e, props?.name || "");
28402
28441
  };
28442
+ const formatValue = (value) => {
28443
+ if (props.inputType === "file") {
28444
+ return value instanceof File || value instanceof FileList ? value : null;
28445
+ }
28446
+ if (value === null || value === void 0) return "";
28447
+ return value;
28448
+ };
28403
28449
  return /* @__PURE__ */ jsxs22(Fragment15, { children: [
28404
28450
  /* @__PURE__ */ jsx41("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ jsx41(
28405
28451
  Input,
28406
28452
  {
28407
- type: "text",
28453
+ type: props.inputType || "search",
28408
28454
  id: props.name || "text-field",
28409
28455
  name: props.name,
28410
- value: props.value || "",
28456
+ value: formatValue(props.value),
28411
28457
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
28412
28458
  style: {
28413
28459
  ...style,
@@ -28439,14 +28485,21 @@ var FileInput2 = ({ className, style, ...props }) => {
28439
28485
  const handleChange = (e) => {
28440
28486
  props.onChange?.(e, props?.name || "");
28441
28487
  };
28488
+ const formatValue = (value) => {
28489
+ if (props.inputType === "file") {
28490
+ return value instanceof File || value instanceof FileList ? value : null;
28491
+ }
28492
+ if (value === null || value === void 0) return "";
28493
+ return value;
28494
+ };
28442
28495
  return /* @__PURE__ */ jsxs23("div", { className: "d-flex items-center relative align-middle", children: [
28443
28496
  /* @__PURE__ */ jsx42(
28444
28497
  Input,
28445
28498
  {
28446
- type: "file",
28447
- id: "file",
28499
+ type: props.inputType || "file",
28500
+ id: props.name || "file-field",
28448
28501
  name: props.name,
28449
- value: props.value || "",
28502
+ value: formatValue(props.value),
28450
28503
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
28451
28504
  style: {
28452
28505
  ...style,
@@ -29675,6 +29728,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29675
29728
  onChange: info.row.getToggleSelectedHandler()
29676
29729
  }
29677
29730
  );
29731
+ case "html":
29732
+ return /* @__PURE__ */ jsx50(
29733
+ "span",
29734
+ {
29735
+ dangerouslySetInnerHTML: { __html: String(rowValue || formattedValue) }
29736
+ }
29737
+ );
29678
29738
  /* -------------------- ADVANCED -------------------- */
29679
29739
  case "custom": {
29680
29740
  const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
@@ -29947,17 +30007,20 @@ function DataTable({
29947
30007
  ),
29948
30008
  "Toggle All"
29949
30009
  ] }),
29950
- table.getAllLeafColumns().map((column) => /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
29951
- /* @__PURE__ */ jsx51(
29952
- "input",
29953
- {
29954
- type: "checkbox",
29955
- checked: column.getIsVisible(),
29956
- onChange: (e) => column.toggleVisibility(e.target.checked)
29957
- }
29958
- ),
29959
- column.columnDef.header?.toString() ?? column.id
29960
- ] }, column.id))
30010
+ table.getAllLeafColumns().map((column) => {
30011
+ const header = column.columnDef.header;
30012
+ return /* @__PURE__ */ jsxs29("label", { className: "flex items-center gap-2 text-sm", children: [
30013
+ /* @__PURE__ */ jsx51(
30014
+ "input",
30015
+ {
30016
+ type: "checkbox",
30017
+ checked: column.getIsVisible(),
30018
+ onChange: (e) => column.toggleVisibility(e.target.checked)
30019
+ }
30020
+ ),
30021
+ typeof header === "function" ? header({ column, header, table }) : typeof header === "string" ? header : column.id
30022
+ ] }, column.id);
30023
+ })
29961
30024
  ] })
29962
30025
  ] })
29963
30026
  ] }),