@procaaso/alphinity-ui-components 1.0.8 → 1.0.10

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
@@ -998,7 +998,12 @@ function DeviceControlPanel({
998
998
  binding,
999
999
  onClose,
1000
1000
  position = "bottom",
1001
+ align = "center",
1001
1002
  touchOptimized = true,
1003
+ compact = false,
1004
+ fontScale = 1,
1005
+ maxHeight,
1006
+ maxWidth,
1002
1007
  onModeChange,
1003
1008
  onParameterChange,
1004
1009
  onStart,
@@ -1020,6 +1025,20 @@ function DeviceControlPanel({
1020
1025
  const currentMode = binding.state.currentMode;
1021
1026
  const currentParams = binding.parameters[currentMode] || [];
1022
1027
  const touchSize = touchOptimized ? 56 : 40;
1028
+ const spacing = {
1029
+ padding: compact ? "12px" : "20px",
1030
+ gap: compact ? "6px" : "8px",
1031
+ marginBottom: compact ? "10px" : "16px",
1032
+ itemPadding: compact ? "8px 10px" : "10px 12px"
1033
+ };
1034
+ const fontSize = {
1035
+ title: Math.round(14 * fontScale),
1036
+ label: Math.round(11 * fontScale),
1037
+ value: Math.round(13 * fontScale),
1038
+ input: Math.round(14 * fontScale),
1039
+ button: Math.round(12 * fontScale),
1040
+ status: Math.round(10 * fontScale)
1041
+ };
1023
1042
  const currentModeObj = binding.modes.find((m) => m.value === currentMode);
1024
1043
  const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
1025
1044
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
@@ -1058,9 +1077,9 @@ function DeviceControlPanel({
1058
1077
  position: "fixed",
1059
1078
  ...position === "bottom" ? {
1060
1079
  bottom: 0,
1061
- left: 0,
1062
- right: 0,
1063
- animation: "slideUp 0.3s ease-out"
1080
+ ...align === "left" ? { left: 0, right: "auto" } : align === "right" ? { right: 0, left: "auto" } : { left: 0, right: 0, marginLeft: "auto", marginRight: "auto" },
1081
+ animation: "slideUp 0.3s ease-out",
1082
+ maxWidth
1064
1083
  } : {
1065
1084
  right: 0,
1066
1085
  top: 0,
@@ -1073,9 +1092,9 @@ function DeviceControlPanel({
1073
1092
  borderRadius: position === "bottom" ? "8px 8px 0 0" : "8px 0 0 8px",
1074
1093
  boxShadow: "none",
1075
1094
  border: `2px solid ${borderColor}`,
1076
- padding: "20px",
1095
+ padding: spacing.padding,
1077
1096
  zIndex: 9999,
1078
- maxHeight: position === "bottom" ? "70vh" : "100vh",
1097
+ maxHeight: maxHeight || (position === "bottom" ? "70vh" : "100vh"),
1079
1098
  overflowY: "auto",
1080
1099
  ...binding.display?.style
1081
1100
  };
@@ -1099,7 +1118,7 @@ function DeviceControlPanel({
1099
1118
  {
1100
1119
  style: {
1101
1120
  margin: 0,
1102
- fontSize: "14px",
1121
+ fontSize: `${fontSize.title}px`,
1103
1122
  fontWeight: 600,
1104
1123
  fontFamily: "Arial, sans-serif",
1105
1124
  letterSpacing: "0.5px",
@@ -1151,11 +1170,11 @@ function DeviceControlPanel({
1151
1170
  display: "flex",
1152
1171
  alignItems: "center",
1153
1172
  gap: "12px",
1154
- padding: "10px 12px",
1173
+ padding: spacing.itemPadding,
1155
1174
  backgroundColor: surfaceColor,
1156
1175
  border: `1px solid ${borderColor}`,
1157
1176
  borderRadius: "6px",
1158
- marginBottom: "16px"
1177
+ marginBottom: spacing.marginBottom
1159
1178
  },
1160
1179
  children: [
1161
1180
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -1177,7 +1196,7 @@ function DeviceControlPanel({
1177
1196
  style: {
1178
1197
  fontWeight: 600,
1179
1198
  textTransform: "uppercase",
1180
- fontSize: "11px",
1199
+ fontSize: `${fontSize.label}px`,
1181
1200
  fontFamily: "Arial, sans-serif",
1182
1201
  letterSpacing: "0.5px",
1183
1202
  color: textColor
@@ -1235,7 +1254,7 @@ function DeviceControlPanel({
1235
1254
  children: "Mode"
1236
1255
  }
1237
1256
  ),
1238
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" }, children: binding.modes.map((mode) => {
1257
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: spacing.gap, flexWrap: "wrap" }, children: binding.modes.map((mode) => {
1239
1258
  const isSelected = mode.value === currentMode;
1240
1259
  const isEnabled = mode.enabled !== false;
1241
1260
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -1251,7 +1270,7 @@ function DeviceControlPanel({
1251
1270
  color: isSelected ? "#000000" : textColor,
1252
1271
  border: `1px solid ${isSelected ? "#b4d0fe" : borderColor}`,
1253
1272
  borderRadius: "6px",
1254
- fontSize: "11px",
1273
+ fontSize: `${fontSize.label}px`,
1255
1274
  fontWeight: 600,
1256
1275
  fontFamily: "Arial, sans-serif",
1257
1276
  letterSpacing: "0.5px",
@@ -1265,14 +1284,14 @@ function DeviceControlPanel({
1265
1284
  );
1266
1285
  }) })
1267
1286
  ] }),
1268
- currentParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginBottom: "16px" }, children: [
1287
+ currentParams.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { marginBottom: spacing.marginBottom }, children: [
1269
1288
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1270
1289
  "label",
1271
1290
  {
1272
1291
  style: {
1273
1292
  display: "block",
1274
- marginBottom: "8px",
1275
- fontSize: "11px",
1293
+ marginBottom: spacing.gap,
1294
+ fontSize: `${fontSize.label}px`,
1276
1295
  fontWeight: 600,
1277
1296
  textTransform: "uppercase",
1278
1297
  letterSpacing: "0.5px",
@@ -1286,8 +1305,8 @@ function DeviceControlPanel({
1286
1305
  "div",
1287
1306
  {
1288
1307
  style: {
1289
- marginBottom: "10px",
1290
- padding: "10px",
1308
+ marginBottom: spacing.gap,
1309
+ padding: spacing.itemPadding,
1291
1310
  backgroundColor: surfaceColor,
1292
1311
  border: `1px solid ${borderColor}`,
1293
1312
  borderRadius: "6px"
@@ -1296,13 +1315,17 @@ function DeviceControlPanel({
1296
1315
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1297
1316
  "div",
1298
1317
  {
1299
- style: { display: "flex", justifyContent: "space-between", marginBottom: "8px" },
1318
+ style: {
1319
+ display: "flex",
1320
+ justifyContent: "space-between",
1321
+ marginBottom: spacing.gap
1322
+ },
1300
1323
  children: [
1301
1324
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1302
1325
  "span",
1303
1326
  {
1304
1327
  style: {
1305
- fontSize: "11px",
1328
+ fontSize: `${fontSize.label}px`,
1306
1329
  fontWeight: 600,
1307
1330
  textTransform: "uppercase",
1308
1331
  letterSpacing: "0.5px",
@@ -1316,7 +1339,7 @@ function DeviceControlPanel({
1316
1339
  "span",
1317
1340
  {
1318
1341
  style: {
1319
- fontSize: "13px",
1342
+ fontSize: `${fontSize.value}px`,
1320
1343
  fontWeight: 700,
1321
1344
  fontFamily: "Arial, sans-serif",
1322
1345
  color: textColor
@@ -1401,7 +1424,7 @@ function DeviceControlPanel({
1401
1424
  border: `1px solid ${borderColor}`,
1402
1425
  borderRadius: "6px",
1403
1426
  padding: "0 12px",
1404
- fontSize: "14px",
1427
+ fontSize: `${fontSize.input}px`,
1405
1428
  fontFamily: "Arial, sans-serif",
1406
1429
  fontWeight: 600
1407
1430
  }
@@ -1412,7 +1435,7 @@ function DeviceControlPanel({
1412
1435
  param.id
1413
1436
  ))
1414
1437
  ] }),
1415
- binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1438
+ binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: spacing.gap, marginBottom: spacing.marginBottom }, children: [
1416
1439
  activeCapabilities?.canStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1417
1440
  "button",
1418
1441
  {