cecomponent 2.0.81 → 2.0.82

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.
@@ -44647,23 +44647,24 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44647
44647
  placeholder: i = "Select status...",
44648
44648
  size: o = "medium",
44649
44649
  disabled: l = !1,
44650
- ariaLabel: u = "Status selection dropdown"
44650
+ ariaLabel: u = "Status selection dropdown",
44651
+ fullButtonAsDropdown: f = !1
44651
44652
  }) => {
44652
- const [f, p] = useState(!1), m = useRef(null), d = e.find((_) => _.value === t), g = (_) => {
44653
- n(_), p(!1);
44653
+ const [p, m] = useState(!1), d = useRef(null), g = e.find((T) => T.value === t), b = (T) => {
44654
+ n(T), m(!1);
44654
44655
  };
44655
44656
  useEffect(() => {
44656
- const _ = (T) => {
44657
- var C;
44658
- (C = m.current) != null && C.contains(T.target) || p(!1);
44657
+ const T = (C) => {
44658
+ var R;
44659
+ (R = d.current) != null && R.contains(C.target) || m(!1);
44659
44660
  };
44660
- return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
44661
+ return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
44661
44662
  }, []);
44662
- const b = (_) => {
44663
- l || (_.key === "Enter" || _.key === " " ? (_.preventDefault(), p(!f)) : _.key === "Escape" && p(!1));
44664
- }, E = (_) => {
44665
- if (_ != null && _.statusType)
44666
- switch (_.statusType) {
44663
+ const E = (T) => {
44664
+ l || (T.key === "Enter" || T.key === " " ? (T.preventDefault(), m(!p)) : T.key === "Escape" && m(!1));
44665
+ }, S = (T) => {
44666
+ if (T != null && T.statusType)
44667
+ switch (T.statusType) {
44667
44668
  case "in-progress":
44668
44669
  return "in-progress";
44669
44670
  case "declined":
@@ -44674,10 +44675,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44674
44675
  return "";
44675
44676
  }
44676
44677
  return "";
44677
- }, S = () => {
44678
- if (d) {
44679
- const _ = {};
44680
- return d.backgroundColor && (_.backgroundColor = d.backgroundColor), d.textColor && (_.color = d.textColor), _;
44678
+ }, _ = () => {
44679
+ if (g) {
44680
+ const T = {};
44681
+ return g.backgroundColor && (T.backgroundColor = g.backgroundColor), g.textColor && (T.color = g.textColor), T;
44681
44682
  }
44682
44683
  return {};
44683
44684
  };
@@ -44685,28 +44686,30 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44685
44686
  "div",
44686
44687
  {
44687
44688
  className: `status-dropdown-container ${l ? "disabled" : ""} size-${o}`,
44688
- ref: m,
44689
+ ref: d,
44689
44690
  children: [
44690
44691
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
44691
44692
  "div",
44692
44693
  {
44693
- className: `status-dropdown-trigger ${f ? "open" : ""} ${d ? `has-selection ${E(d)}` : ""}`,
44694
- onClick: () => !l && g((d == null ? void 0 : d.value) || ""),
44695
- onKeyDown: b,
44694
+ className: `status-dropdown-trigger ${p ? "open" : ""} ${g ? `has-selection ${S(g)}` : ""}`,
44695
+ onClick: () => {
44696
+ l || (f ? m(!p) : b((g == null ? void 0 : g.value) || ""));
44697
+ },
44698
+ onKeyDown: E,
44696
44699
  tabIndex: l ? -1 : 0,
44697
44700
  role: "button",
44698
44701
  "aria-haspopup": "listbox",
44699
- "aria-expanded": f ? "true" : "false",
44702
+ "aria-expanded": p ? "true" : "false",
44700
44703
  "aria-label": u,
44701
- style: S(),
44704
+ style: _(),
44702
44705
  children: [
44703
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children: d ? d.label : i }),
44706
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "status-text", children: g ? g.label : i }),
44704
44707
  /* @__PURE__ */ jsxRuntimeExports.jsx(
44705
44708
  "span",
44706
44709
  {
44707
44710
  className: "status-dropdown-icon",
44708
- onClick: (_) => {
44709
- _.stopPropagation(), !l && p(!f);
44711
+ onClick: (T) => {
44712
+ T.stopPropagation(), !l && m(!p);
44710
44713
  },
44711
44714
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44712
44715
  "svg",
@@ -44716,7 +44719,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44716
44719
  viewBox: "0 0 24 24",
44717
44720
  fill: "none",
44718
44721
  xmlns: "http://www.w3.org/2000/svg",
44719
- className: `dropdown-arrow ${f ? "rotate" : ""}`,
44722
+ className: `dropdown-arrow ${p ? "rotate" : ""}`,
44720
44723
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44721
44724
  "path",
44722
44725
  {
@@ -44732,25 +44735,25 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44732
44735
  ]
44733
44736
  }
44734
44737
  ),
44735
- f && !l && /* @__PURE__ */ jsxRuntimeExports.jsx(
44738
+ p && !l && /* @__PURE__ */ jsxRuntimeExports.jsx(
44736
44739
  "ul",
44737
44740
  {
44738
44741
  className: "status-dropdown-options",
44739
44742
  role: "listbox",
44740
44743
  "aria-label": "Status options",
44741
- children: e.map((_) => {
44742
- const T = {};
44743
- return _.backgroundColor && (T.backgroundColor = _.backgroundColor), _.textColor && (T.color = _.textColor), /* @__PURE__ */ jsxRuntimeExports.jsxs(
44744
+ children: e.map((T) => {
44745
+ const C = {};
44746
+ return T.backgroundColor && (C.backgroundColor = T.backgroundColor), T.textColor && (C.color = T.textColor), /* @__PURE__ */ jsxRuntimeExports.jsxs(
44744
44747
  "li",
44745
44748
  {
44746
- className: `status-dropdown-option ${t === _.value ? "selected" : ""} ${E(_)}`,
44747
- onClick: () => g(_.value),
44749
+ className: `status-dropdown-option ${t === T.value ? "selected" : ""} ${S(T)}`,
44750
+ onClick: () => b(T.value),
44748
44751
  role: "option",
44749
- "aria-selected": t === _.value ? "true" : "false",
44750
- style: T,
44752
+ "aria-selected": t === T.value ? "true" : "false",
44753
+ style: C,
44751
44754
  children: [
44752
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children: _.icon ? _.icon : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44753
- _.statusType === "declined" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44755
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "option-indicator", children: T.icon ? T.icon : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44756
+ T.statusType === "declined" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44754
44757
  "svg",
44755
44758
  {
44756
44759
  width: "16",
@@ -44771,7 +44774,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44771
44774
  ]
44772
44775
  }
44773
44776
  ),
44774
- _.statusType === "withdrawn" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44777
+ T.statusType === "withdrawn" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44775
44778
  "svg",
44776
44779
  {
44777
44780
  width: "16",
@@ -44792,7 +44795,7 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44792
44795
  ]
44793
44796
  }
44794
44797
  ),
44795
- _.statusType === "in-progress" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44798
+ T.statusType === "in-progress" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
44796
44799
  "svg",
44797
44800
  {
44798
44801
  width: "16",
@@ -44815,10 +44818,10 @@ const CESkeletonTable = ({ columns: e, rows: t }) => /* @__PURE__ */ jsxRuntimeE
44815
44818
  }
44816
44819
  )
44817
44820
  ] }) }),
44818
- _.label
44821
+ T.label
44819
44822
  ]
44820
44823
  },
44821
- _.value
44824
+ T.value
44822
44825
  );
44823
44826
  })
44824
44827
  }
@@ -16,6 +16,7 @@ interface StatusDropdownProps {
16
16
  size?: Size;
17
17
  disabled?: boolean;
18
18
  ariaLabel?: string;
19
+ fullButtonAsDropdown?: boolean;
19
20
  }
20
21
  declare const CEStatusDropdown: React.FC<StatusDropdownProps>;
21
22
  export default CEStatusDropdown;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cecomponent",
3
3
  "description": "A React component library for building modern UIs for Cleanearth",
4
- "version": "2.0.81",
4
+ "version": "2.0.82",
5
5
  "main": "dist/ce-component-lib.js",
6
6
  "module": "dist/ce-component-lib.mjs",
7
7
  "types": "dist/idex.d.ts",