@algorithm-shift/design-system 1.2.971 → 1.2.973

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
@@ -27336,9 +27336,18 @@ var CheckboxInput = ({ className, style, ...props }) => {
27336
27336
  const isEditable = props.isEditable ?? true;
27337
27337
  const isDisabled = props.isDisabled ?? false;
27338
27338
  const text = props.text ? props.text : "Subscribe";
27339
+ const formatValue = (value) => {
27340
+ if (typeof value === "boolean") {
27341
+ return value;
27342
+ }
27343
+ if (value === "true" || value === "1") {
27344
+ return true;
27345
+ }
27346
+ return false;
27347
+ };
27339
27348
  (0, import_react14.useEffect)(() => {
27340
27349
  if (props.value) {
27341
- handleChange(props.value);
27350
+ handleChange(formatValue(props.value));
27342
27351
  }
27343
27352
  }, []);
27344
27353
  const handleChange = (value) => {
@@ -27350,7 +27359,7 @@ var CheckboxInput = ({ className, style, ...props }) => {
27350
27359
  Checkbox,
27351
27360
  {
27352
27361
  id: props.name || "checkbox",
27353
- checked: !!props.value,
27362
+ checked: formatValue(props.value),
27354
27363
  onCheckedChange: handleChange,
27355
27364
  disabled: !isEditable || isDisabled
27356
27365
  }
@@ -27917,7 +27926,7 @@ function useLazyDropdown(config) {
27917
27926
  if (term) params[configRef.current.dataLabel ? `${configRef.current.dataLabel}[ilike]` : "search[ilike]"] = term;
27918
27927
  const { baseUrl, shouldAbort, params: urlParams } = extractAndEnforceUrlParams(
27919
27928
  configRef.current.apiUrl,
27920
- configRef.current.enforceStrictQueryParams ?? false
27929
+ !!configRef.current.enforceStrictQueryParams
27921
27930
  );
27922
27931
  if (shouldAbort) {
27923
27932
  setLoading(false);
@@ -27991,7 +28000,7 @@ function useLazyDropdown(config) {
27991
28000
  }
27992
28001
  const { baseUrl, shouldAbort, params: urlParams } = extractAndEnforceUrlParams(
27993
28002
  configRef.current.apiUrl,
27994
- configRef.current.enforceStrictQueryParams ?? false
28003
+ !!configRef.current.enforceStrictQueryParams
27995
28004
  );
27996
28005
  if (shouldAbort) {
27997
28006
  setLoading(false);
@@ -28890,8 +28899,7 @@ function DateTimePicker({
28890
28899
  return;
28891
28900
  }
28892
28901
  const clickedDate = new Date(next);
28893
- const selectedYearDate = new Date(year, clickedDate.getMonth(), clickedDate.getDate());
28894
- updateDateTime(selectedYearDate);
28902
+ updateDateTime(clickedDate);
28895
28903
  };
28896
28904
  const updateTimeInDate = (h, m) => {
28897
28905
  if (!date) {
@@ -28941,9 +28949,9 @@ function DateTimePicker({
28941
28949
  const displayValue = React6.useMemo(() => {
28942
28950
  if (!date) return "";
28943
28951
  try {
28944
- if (mode === "date") return (0, import_date_fns.format)(date, "yyyy-MM-dd");
28952
+ if (mode === "date") return (0, import_date_fns.format)(date, "dd-MM-yyyy");
28945
28953
  if (mode === "time") return (0, import_date_fns.format)(date, "hh:mm aa");
28946
- return (0, import_date_fns.format)(date, "yyyy-MM-dd hh:mm aa");
28954
+ return (0, import_date_fns.format)(date, "dd-MM-yyyy hh:mm aa");
28947
28955
  } catch {
28948
28956
  return "";
28949
28957
  }
@@ -28980,8 +28988,21 @@ function DateTimePicker({
28980
28988
  },
28981
28989
  disabled: isInputDisabled,
28982
28990
  children: [
28983
- displayValue || placeholder,
28984
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Calendar1, { className: "absolute right-2 top-2" })
28991
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Calendar1, { className: "absolute left-2 top-2" }),
28992
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "ml-5", children: displayValue || placeholder }),
28993
+ displayValue && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
28994
+ SquareX,
28995
+ {
28996
+ className: "absolute right-2 top-2 cursor-pointer",
28997
+ role: "presentation",
28998
+ style: { pointerEvents: "auto" },
28999
+ onClick: (e) => {
29000
+ e.stopPropagation();
29001
+ setDate(void 0);
29002
+ emitChange(void 0);
29003
+ }
29004
+ }
29005
+ )
28985
29006
  ]
28986
29007
  }
28987
29008
  ) }),
@@ -30979,7 +31000,7 @@ function Navbar({
30979
31000
  list = [],
30980
31001
  profileMenu = [],
30981
31002
  userName = "Guest User",
30982
- isBuilder = true,
31003
+ isBuilder = false,
30983
31004
  source,
30984
31005
  navList
30985
31006
  }) {