@procaaso/alphinity-ui-components 1.5.0 → 1.8.0

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.cjs CHANGED
@@ -1859,33 +1859,41 @@ function DeviceControlPanel({
1859
1859
  }
1860
1860
  )
1861
1861
  ] }),
1862
- activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1863
- "button",
1864
- {
1865
- onClick: () => onCustomAction?.(action.id),
1866
- style: {
1867
- flex: 1,
1868
- minWidth: "120px",
1869
- height: touchSize,
1870
- backgroundColor: surfaceColor,
1871
- color: textColor,
1872
- border: `1px solid ${borderColor}`,
1873
- borderRadius: "6px",
1874
- fontSize: "11px",
1875
- fontWeight: 600,
1876
- fontFamily: "monospace",
1877
- letterSpacing: "0.5px",
1878
- textTransform: "uppercase",
1879
- cursor: "pointer",
1880
- transition: "all 0.15s"
1862
+ activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => {
1863
+ const actionDisabled = action.disabled === true;
1864
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1865
+ "button",
1866
+ {
1867
+ onClick: () => {
1868
+ if (!actionDisabled) onCustomAction?.(action.id);
1869
+ },
1870
+ disabled: actionDisabled,
1871
+ title: actionDisabled ? action.disabledReason : void 0,
1872
+ style: {
1873
+ flex: 1,
1874
+ minWidth: "120px",
1875
+ height: touchSize,
1876
+ backgroundColor: surfaceColor,
1877
+ color: textColor,
1878
+ border: `1px solid ${borderColor}`,
1879
+ borderRadius: "6px",
1880
+ fontSize: "11px",
1881
+ fontWeight: 600,
1882
+ fontFamily: "monospace",
1883
+ letterSpacing: "0.5px",
1884
+ textTransform: "uppercase",
1885
+ cursor: actionDisabled ? "not-allowed" : "pointer",
1886
+ opacity: actionDisabled ? 0.4 : 1,
1887
+ transition: "all 0.15s"
1888
+ },
1889
+ children: [
1890
+ action.icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { marginRight: "6px" }, children: action.icon }),
1891
+ action.label
1892
+ ]
1881
1893
  },
1882
- children: [
1883
- action.icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { marginRight: "6px" }, children: action.icon }),
1884
- action.label
1885
- ]
1886
- },
1887
- action.id
1888
- )) })
1894
+ action.id
1895
+ );
1896
+ }) })
1889
1897
  ] }),
1890
1898
  binding.state.lastCommandResult && showToast && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1891
1899
  "div",