@algorithm-shift/design-system 1.2.19 → 1.2.21

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
@@ -133,10 +133,11 @@ var ImageControl = ({
133
133
  "w-full h-full",
134
134
  className
135
135
  );
136
- if ((!imageUrl || imageUrl === "") && (!imageUrlExternal || imageUrlExternal === "")) {
137
- /* @__PURE__ */ jsx5("div", { className: imageClass, children: /* @__PURE__ */ jsx5("img", { src: image_placeholder_default, alt: altText, className: "opacity-50", width: 50, height: 50 }) });
136
+ if (!imageUrl && !imageUrlExternal) {
137
+ return /* @__PURE__ */ jsx5("div", { className: imageClass, children: /* @__PURE__ */ jsx5("img", { src: image_placeholder_default, alt: altText, className: "opacity-50", width: 50, height: 50 }) });
138
138
  }
139
- return /* @__PURE__ */ jsx5("img", { src: imageUrlExternal || imageUrl, alt: altText, className: defaultImgClass, style });
139
+ const url = imageUrlExternal || imageUrl;
140
+ return /* @__PURE__ */ jsx5("img", { src: url, alt: altText, className: defaultImgClass, style });
140
141
  };
141
142
  var Image_default = ImageControl;
142
143
 
@@ -760,9 +761,13 @@ function RadioGroupItem({
760
761
  import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
761
762
  var RadioInput = ({ className, style, ...props }) => {
762
763
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Subscribe"];
763
- return /* @__PURE__ */ jsx18("div", { className, style, children: /* @__PURE__ */ jsx18(RadioGroup, { defaultValue: "option-1", children: text?.map((item, index) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center space-x-2", children: [
764
- /* @__PURE__ */ jsx18(RadioGroupItem, { value: item, id: `r${index}` }),
765
- /* @__PURE__ */ jsx18(Label, { htmlFor: `r${index}`, children: item })
764
+ const formatList = text.filter((i) => i.value && i.label).map((item) => ({
765
+ label: item.label,
766
+ value: item.value
767
+ }));
768
+ return /* @__PURE__ */ jsx18("div", { className, style, children: /* @__PURE__ */ jsx18(RadioGroup, { defaultValue: "option-1", children: formatList?.map((item, index) => /* @__PURE__ */ jsxs8("div", { className: "flex items-center space-x-2", children: [
769
+ /* @__PURE__ */ jsx18(RadioGroupItem, { value: item.value, id: `r${index}` }),
770
+ /* @__PURE__ */ jsx18(Label, { htmlFor: `r${index}`, children: item.label })
766
771
  ] }, index)) }) });
767
772
  };
768
773
 
@@ -770,9 +775,13 @@ var RadioInput = ({ className, style, ...props }) => {
770
775
  import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
771
776
  var MultiCheckbox = ({ className, style, ...props }) => {
772
777
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Subscribe"];
773
- return /* @__PURE__ */ jsx19("div", { className, style, children: /* @__PURE__ */ jsx19("div", { className: "flex gap-3 flex-col", children: text?.map((item, index) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-2", children: [
778
+ const formatList = text.filter((i) => i.value && i.label).map((item) => ({
779
+ label: item.label,
780
+ value: item.value
781
+ }));
782
+ return /* @__PURE__ */ jsx19("div", { className, style, children: /* @__PURE__ */ jsx19("div", { className: "flex gap-3 flex-col", children: formatList?.map((item, index) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center space-x-2", children: [
774
783
  /* @__PURE__ */ jsx19(Checkbox, { id: `newsletter-${index}` }),
775
- /* @__PURE__ */ jsx19(Label, { htmlFor: `newsletter-${index}`, children: item })
784
+ /* @__PURE__ */ jsx19(Label, { htmlFor: `newsletter-${index}`, children: item.label })
776
785
  ] }, index)) }) });
777
786
  };
778
787
 
@@ -1015,9 +1024,9 @@ import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-r
1015
1024
  var Dropdown = ({ className, style, ...props }) => {
1016
1025
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Default"];
1017
1026
  const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
1018
- const formatList = text.map((item) => ({
1019
- label: item || "value1",
1020
- value: item
1027
+ const formatList = text.filter((i) => i.value && i.label).map((item) => ({
1028
+ label: item.label,
1029
+ value: item.value
1021
1030
  }));
1022
1031
  const regexPattern = props.regexPattern ?? "";
1023
1032
  const errorMessage = props.errorMessage ?? "Required";
@@ -1779,7 +1788,7 @@ var Tabs = ({ tabs, className, style, pathname, LinkComponent }) => {
1779
1788
  const hoverClasses = "hover:bg-white/5";
1780
1789
  const isActive = (path) => {
1781
1790
  if (!path) return false;
1782
- return pathname === path || path !== "/" && pathname.startsWith(path);
1791
+ return pathname === path || path !== "/" && pathname?.startsWith(path);
1783
1792
  };
1784
1793
  return /* @__PURE__ */ jsx38("div", { className, style, children: rawTabs.map((tab, index) => {
1785
1794
  const finalClasses = [
@@ -1819,7 +1828,7 @@ var Tabs = ({ tabs, className, style, pathname, LinkComponent }) => {
1819
1828
  )
1820
1829
  ] }, index);
1821
1830
  }
1822
- return tab.url && LinkComponent ? /* @__PURE__ */ jsx38(LinkComponent, { href: tab.url, className: finalClasses, style, children: tab.header }, index) : /* @__PURE__ */ jsx38("div", { className: finalClasses, style, role: "button", tabIndex: 0, children: tab.header }, index);
1831
+ return tab.url && LinkComponent ? /* @__PURE__ */ jsx38(LinkComponent, { href: tab.url, className: finalClasses, style: tab.style, children: tab.header }, index) : /* @__PURE__ */ jsx38("div", { className: finalClasses, style: tab.style, role: "button", tabIndex: 0, children: tab.header }, index);
1823
1832
  }) });
1824
1833
  };
1825
1834
  var Tabs_default = Tabs;