@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.js CHANGED
@@ -478,7 +478,7 @@ var Typography = ({
478
478
  import_react5.default.createElement("span", {
479
479
  key: "html",
480
480
  className: "pointer-events-none",
481
- dangerouslySetInnerHTML: { __html: textContent }
481
+ dangerouslySetInnerHTML: { __html: textContent || "--" }
482
482
  })
483
483
  ]
484
484
  );
@@ -1786,7 +1786,7 @@ __export(lucide_react_exports, {
1786
1786
  FerrisWheelIcon: () => FerrisWheel,
1787
1787
  Figma: () => Figma,
1788
1788
  FigmaIcon: () => Figma,
1789
- File: () => File,
1789
+ File: () => File2,
1790
1790
  FileArchive: () => FileArchive,
1791
1791
  FileArchiveIcon: () => FileArchive,
1792
1792
  FileAudio: () => FileAudio,
@@ -1839,7 +1839,7 @@ __export(lucide_react_exports, {
1839
1839
  FileEditIcon: () => FilePen,
1840
1840
  FileHeart: () => FileHeart,
1841
1841
  FileHeartIcon: () => FileHeart,
1842
- FileIcon: () => File,
1842
+ FileIcon: () => File2,
1843
1843
  FileImage: () => FileImage,
1844
1844
  FileImageIcon: () => FileImage,
1845
1845
  FileInput: () => FileInput,
@@ -3196,7 +3196,7 @@ __export(lucide_react_exports, {
3196
3196
  LucideFence: () => Fence,
3197
3197
  LucideFerrisWheel: () => FerrisWheel,
3198
3198
  LucideFigma: () => Figma,
3199
- LucideFile: () => File,
3199
+ LucideFile: () => File2,
3200
3200
  LucideFileArchive: () => FileArchive,
3201
3201
  LucideFileAudio: () => FileAudio,
3202
3202
  LucideFileAudio2: () => FileAudio2,
@@ -6617,7 +6617,7 @@ __export(icons_exports, {
6617
6617
  Fence: () => Fence,
6618
6618
  FerrisWheel: () => FerrisWheel,
6619
6619
  Figma: () => Figma,
6620
- File: () => File,
6620
+ File: () => File2,
6621
6621
  FileArchive: () => FileArchive,
6622
6622
  FileAudio: () => FileAudio,
6623
6623
  FileAudio2: () => FileAudio2,
@@ -14767,7 +14767,7 @@ var __iconNode630 = [
14767
14767
  ["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
14768
14768
  ["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }]
14769
14769
  ];
14770
- var File = createLucideIcon("file", __iconNode630);
14770
+ var File2 = createLucideIcon("file", __iconNode630);
14771
14771
 
14772
14772
  // node_modules/lucide-react/dist/esm/icons/files.js
14773
14773
  var __iconNode631 = [
@@ -27022,18 +27022,26 @@ var TextInput = ({ className, style, ...props }) => {
27022
27022
  const handleChange = (e) => {
27023
27023
  props.onChange?.(e, props?.name || "");
27024
27024
  };
27025
+ const formatValue = (value) => {
27026
+ if (props.inputType === "file") {
27027
+ return value instanceof File || value instanceof FileList ? value : null;
27028
+ }
27029
+ if (value === null || value === void 0) return "";
27030
+ return value;
27031
+ };
27025
27032
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
27026
27033
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
27027
27034
  Input,
27028
27035
  {
27029
27036
  type: props.inputType || "text",
27030
27037
  name: props.name,
27038
+ id: props.name || "text-field",
27031
27039
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27032
27040
  style: {
27033
27041
  ...style,
27034
27042
  borderColor: props.errorMessage ? "#f87171" : style?.borderColor
27035
27043
  },
27036
- value: props.value || "",
27044
+ value: formatValue(props.value),
27037
27045
  autoComplete: isAutocomplete ? "on" : "off",
27038
27046
  placeholder,
27039
27047
  onChange: handleChange,
@@ -27064,14 +27072,21 @@ var NumberInput = ({ className, style, ...props }) => {
27064
27072
  const handleChange = (e) => {
27065
27073
  props.onChange?.(e, props.name || "");
27066
27074
  };
27075
+ const formatValue = (value) => {
27076
+ if (props.inputType === "file") {
27077
+ return value instanceof File || value instanceof FileList ? value : null;
27078
+ }
27079
+ if (value === null || value === void 0) return 0;
27080
+ return value;
27081
+ };
27067
27082
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
27068
27083
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
27069
27084
  Input,
27070
27085
  {
27071
- type: "number",
27086
+ type: props.inputType || "number",
27072
27087
  id: props.name || "number-field",
27073
27088
  name: props.name,
27074
- value: props.value || "",
27089
+ value: formatValue(props.value),
27075
27090
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27076
27091
  style: {
27077
27092
  ...style,
@@ -27107,13 +27122,21 @@ var EmailInput = ({ className, style, ...props }) => {
27107
27122
  const handleChange = (e) => {
27108
27123
  props.onChange?.(e, props?.name || "");
27109
27124
  };
27125
+ const formatValue = (value) => {
27126
+ if (props.inputType === "file") {
27127
+ return value instanceof File || value instanceof FileList ? value : null;
27128
+ }
27129
+ if (value === null || value === void 0) return "";
27130
+ return value;
27131
+ };
27110
27132
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
27111
27133
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
27112
27134
  Input,
27113
27135
  {
27114
- type: "email",
27136
+ type: props.inputType || "email",
27115
27137
  name: props.name,
27116
- value: props.value || "",
27138
+ id: props.name || "email-field",
27139
+ value: formatValue(props.value),
27117
27140
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27118
27141
  style: {
27119
27142
  ...style,
@@ -27149,14 +27172,21 @@ var PasswordInput = ({ className, style, ...props }) => {
27149
27172
  const handleChange = (e) => {
27150
27173
  props.onChange?.(e, props?.name || "");
27151
27174
  };
27175
+ const formatValue = (value) => {
27176
+ if (props.inputType === "file") {
27177
+ return value instanceof File || value instanceof FileList ? value : null;
27178
+ }
27179
+ if (value === null || value === void 0) return "";
27180
+ return value;
27181
+ };
27152
27182
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
27153
27183
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
27154
27184
  Input,
27155
27185
  {
27156
- type: "password",
27186
+ type: props.inputType || "password",
27157
27187
  id: props.name || "password-field",
27158
27188
  name: props.name,
27159
- value: props.value || "",
27189
+ value: formatValue(props.value),
27160
27190
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27161
27191
  style: {
27162
27192
  ...style,
@@ -27252,16 +27282,23 @@ var UrlInput = ({ className, style, ...props }) => {
27252
27282
  const handleChange = (e) => {
27253
27283
  props.onChange?.(e, props?.name || "");
27254
27284
  };
27285
+ const formatValue = (value) => {
27286
+ if (props.inputType === "file") {
27287
+ return value instanceof File || value instanceof FileList ? value : null;
27288
+ }
27289
+ if (value === null || value === void 0) return "";
27290
+ return value;
27291
+ };
27255
27292
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
27256
27293
  /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-start items-center relative", children: [
27257
27294
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("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://" }),
27258
27295
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
27259
27296
  Input,
27260
27297
  {
27261
- id: "url-field",
27262
- type: "url",
27298
+ id: props.name || "url-field",
27299
+ type: props.inputType || "url",
27263
27300
  name: props.name,
27264
- value: props.value || "",
27301
+ value: formatValue(props.value),
27265
27302
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
27266
27303
  style: {
27267
27304
  ...style,
@@ -28118,7 +28155,8 @@ function LazySelectDropdown({
28118
28155
  dataLabel = "name",
28119
28156
  errorMessage,
28120
28157
  axiosInstance,
28121
- enableAddNewOption = false
28158
+ enableAddNewOption = false,
28159
+ enforceStrictQueryParams = false
28122
28160
  }) {
28123
28161
  const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
28124
28162
  const [searchTerm, setSearchTerm] = (0, import_react20.useState)("");
@@ -28142,7 +28180,8 @@ function LazySelectDropdown({
28142
28180
  dataLabel,
28143
28181
  initialData: options || [],
28144
28182
  value,
28145
- axiosInstance
28183
+ axiosInstance,
28184
+ enforceStrictQueryParams
28146
28185
  });
28147
28186
  const selectedOption = (0, import_react20.useMemo)(() => lazyOptions.find((opt) => opt.value === value), [lazyOptions, value]);
28148
28187
  (0, import_react20.useEffect)(() => {
@@ -28496,14 +28535,21 @@ var SearchInput = ({ className, style, ...props }) => {
28496
28535
  const handleChange = (e) => {
28497
28536
  props.onChange?.(e, props?.name || "");
28498
28537
  };
28538
+ const formatValue = (value) => {
28539
+ if (props.inputType === "file") {
28540
+ return value instanceof File || value instanceof FileList ? value : null;
28541
+ }
28542
+ if (value === null || value === void 0) return "";
28543
+ return value;
28544
+ };
28499
28545
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
28500
28546
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex justify-start items-center relative", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
28501
28547
  Input,
28502
28548
  {
28503
- type: "text",
28549
+ type: props.inputType || "search",
28504
28550
  id: props.name || "text-field",
28505
28551
  name: props.name,
28506
- value: props.value || "",
28552
+ value: formatValue(props.value),
28507
28553
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
28508
28554
  style: {
28509
28555
  ...style,
@@ -28535,14 +28581,21 @@ var FileInput2 = ({ className, style, ...props }) => {
28535
28581
  const handleChange = (e) => {
28536
28582
  props.onChange?.(e, props?.name || "");
28537
28583
  };
28584
+ const formatValue = (value) => {
28585
+ if (props.inputType === "file") {
28586
+ return value instanceof File || value instanceof FileList ? value : null;
28587
+ }
28588
+ if (value === null || value === void 0) return "";
28589
+ return value;
28590
+ };
28538
28591
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "d-flex items-center relative align-middle", children: [
28539
28592
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
28540
28593
  Input,
28541
28594
  {
28542
- type: "file",
28543
- id: "file",
28595
+ type: props.inputType || "file",
28596
+ id: props.name || "file-field",
28544
28597
  name: props.name,
28545
- value: props.value || "",
28598
+ value: formatValue(props.value),
28546
28599
  className: cn(className, props.errorMessage ? "border-red-500" : ""),
28547
28600
  style: {
28548
28601
  ...style,
@@ -29765,6 +29818,13 @@ var cellRendererFactory = (renderer, rendererProps, value, row, customRenderers
29765
29818
  onChange: info.row.getToggleSelectedHandler()
29766
29819
  }
29767
29820
  );
29821
+ case "html":
29822
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
29823
+ "span",
29824
+ {
29825
+ dangerouslySetInnerHTML: { __html: String(rowValue || formattedValue) }
29826
+ }
29827
+ );
29768
29828
  /* -------------------- ADVANCED -------------------- */
29769
29829
  case "custom": {
29770
29830
  const CustomRenderer = customRenderers[rendererProps?.customRendererId] || customRenderers[rendererProps?.rendererId];
@@ -30037,17 +30097,20 @@ function DataTable({
30037
30097
  ),
30038
30098
  "Toggle All"
30039
30099
  ] }),
30040
- table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
30041
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30042
- "input",
30043
- {
30044
- type: "checkbox",
30045
- checked: column.getIsVisible(),
30046
- onChange: (e) => column.toggleVisibility(e.target.checked)
30047
- }
30048
- ),
30049
- column.columnDef.header?.toString() ?? column.id
30050
- ] }, column.id))
30100
+ table.getAllLeafColumns().map((column) => {
30101
+ const header = column.columnDef.header;
30102
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
30103
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
30104
+ "input",
30105
+ {
30106
+ type: "checkbox",
30107
+ checked: column.getIsVisible(),
30108
+ onChange: (e) => column.toggleVisibility(e.target.checked)
30109
+ }
30110
+ ),
30111
+ typeof header === "function" ? header({ column, header, table }) : typeof header === "string" ? header : column.id
30112
+ ] }, column.id);
30113
+ })
30051
30114
  ] })
30052
30115
  ] })
30053
30116
  ] }),