@algorithm-shift/design-system 1.2.20 → 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,8 +133,8 @@ var ImageControl = ({
133
133
  "w-full h-full",
134
134
  className
135
135
  );
136
- if (!!(imageUrl && 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
139
  const url = imageUrlExternal || imageUrl;
140
140
  return /* @__PURE__ */ jsx5("img", { src: url, alt: altText, className: defaultImgClass, style });
@@ -761,9 +761,13 @@ function RadioGroupItem({
761
761
  import { jsx as jsx18, jsxs as jsxs8 } from "react/jsx-runtime";
762
762
  var RadioInput = ({ className, style, ...props }) => {
763
763
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Subscribe"];
764
- 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: [
765
- /* @__PURE__ */ jsx18(RadioGroupItem, { value: item, id: `r${index}` }),
766
- /* @__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 })
767
771
  ] }, index)) }) });
768
772
  };
769
773
 
@@ -771,9 +775,13 @@ var RadioInput = ({ className, style, ...props }) => {
771
775
  import { jsx as jsx19, jsxs as jsxs9 } from "react/jsx-runtime";
772
776
  var MultiCheckbox = ({ className, style, ...props }) => {
773
777
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Subscribe"];
774
- 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: [
775
783
  /* @__PURE__ */ jsx19(Checkbox, { id: `newsletter-${index}` }),
776
- /* @__PURE__ */ jsx19(Label, { htmlFor: `newsletter-${index}`, children: item })
784
+ /* @__PURE__ */ jsx19(Label, { htmlFor: `newsletter-${index}`, children: item.label })
777
785
  ] }, index)) }) });
778
786
  };
779
787
 
@@ -1016,9 +1024,9 @@ import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs12 } from "react/jsx-r
1016
1024
  var Dropdown = ({ className, style, ...props }) => {
1017
1025
  const text = Array.isArray(props.text) ? props.text : [props.text ?? "Default"];
1018
1026
  const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
1019
- const formatList = text.map((item) => ({
1020
- label: item || "value1",
1021
- value: item
1027
+ const formatList = text.filter((i) => i.value && i.label).map((item) => ({
1028
+ label: item.label,
1029
+ value: item.value
1022
1030
  }));
1023
1031
  const regexPattern = props.regexPattern ?? "";
1024
1032
  const errorMessage = props.errorMessage ?? "Required";
@@ -1820,7 +1828,7 @@ var Tabs = ({ tabs, className, style, pathname, LinkComponent }) => {
1820
1828
  )
1821
1829
  ] }, index);
1822
1830
  }
1823
- 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);
1824
1832
  }) });
1825
1833
  };
1826
1834
  var Tabs_default = Tabs;