@procaaso/alphinity-ui-components 1.0.9 → 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,10 @@ 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,
1002
1005
  maxHeight,
1003
1006
  maxWidth,
1004
1007
  onModeChange,
@@ -1022,6 +1025,20 @@ function DeviceControlPanel({
1022
1025
  const currentMode = binding.state.currentMode;
1023
1026
  const currentParams = binding.parameters[currentMode] || [];
1024
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
+ };
1025
1042
  const currentModeObj = binding.modes.find((m) => m.value === currentMode);
1026
1043
  const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
1027
1044
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
@@ -1060,12 +1077,9 @@ function DeviceControlPanel({
1060
1077
  position: "fixed",
1061
1078
  ...position === "bottom" ? {
1062
1079
  bottom: 0,
1063
- left: 0,
1064
- right: 0,
1080
+ ...align === "left" ? { left: 0, right: "auto" } : align === "right" ? { right: 0, left: "auto" } : { left: 0, right: 0, marginLeft: "auto", marginRight: "auto" },
1065
1081
  animation: "slideUp 0.3s ease-out",
1066
- maxWidth,
1067
- marginLeft: "auto",
1068
- marginRight: "auto"
1082
+ maxWidth
1069
1083
  } : {
1070
1084
  right: 0,
1071
1085
  top: 0,
@@ -1078,7 +1092,7 @@ function DeviceControlPanel({
1078
1092
  borderRadius: position === "bottom" ? "8px 8px 0 0" : "8px 0 0 8px",
1079
1093
  boxShadow: "none",
1080
1094
  border: `2px solid ${borderColor}`,
1081
- padding: "20px",
1095
+ padding: spacing.padding,
1082
1096
  zIndex: 9999,
1083
1097
  maxHeight: maxHeight || (position === "bottom" ? "70vh" : "100vh"),
1084
1098
  overflowY: "auto",
@@ -1104,7 +1118,7 @@ function DeviceControlPanel({
1104
1118
  {
1105
1119
  style: {
1106
1120
  margin: 0,
1107
- fontSize: "14px",
1121
+ fontSize: `${fontSize.title}px`,
1108
1122
  fontWeight: 600,
1109
1123
  fontFamily: "Arial, sans-serif",
1110
1124
  letterSpacing: "0.5px",
@@ -1156,11 +1170,11 @@ function DeviceControlPanel({
1156
1170
  display: "flex",
1157
1171
  alignItems: "center",
1158
1172
  gap: "12px",
1159
- padding: "10px 12px",
1173
+ padding: spacing.itemPadding,
1160
1174
  backgroundColor: surfaceColor,
1161
1175
  border: `1px solid ${borderColor}`,
1162
1176
  borderRadius: "6px",
1163
- marginBottom: "16px"
1177
+ marginBottom: spacing.marginBottom
1164
1178
  },
1165
1179
  children: [
1166
1180
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -1182,7 +1196,7 @@ function DeviceControlPanel({
1182
1196
  style: {
1183
1197
  fontWeight: 600,
1184
1198
  textTransform: "uppercase",
1185
- fontSize: "11px",
1199
+ fontSize: `${fontSize.label}px`,
1186
1200
  fontFamily: "Arial, sans-serif",
1187
1201
  letterSpacing: "0.5px",
1188
1202
  color: textColor
@@ -1240,7 +1254,7 @@ function DeviceControlPanel({
1240
1254
  children: "Mode"
1241
1255
  }
1242
1256
  ),
1243
- /* @__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) => {
1244
1258
  const isSelected = mode.value === currentMode;
1245
1259
  const isEnabled = mode.enabled !== false;
1246
1260
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -1256,7 +1270,7 @@ function DeviceControlPanel({
1256
1270
  color: isSelected ? "#000000" : textColor,
1257
1271
  border: `1px solid ${isSelected ? "#b4d0fe" : borderColor}`,
1258
1272
  borderRadius: "6px",
1259
- fontSize: "11px",
1273
+ fontSize: `${fontSize.label}px`,
1260
1274
  fontWeight: 600,
1261
1275
  fontFamily: "Arial, sans-serif",
1262
1276
  letterSpacing: "0.5px",
@@ -1270,14 +1284,14 @@ function DeviceControlPanel({
1270
1284
  );
1271
1285
  }) })
1272
1286
  ] }),
1273
- 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: [
1274
1288
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1275
1289
  "label",
1276
1290
  {
1277
1291
  style: {
1278
1292
  display: "block",
1279
- marginBottom: "8px",
1280
- fontSize: "11px",
1293
+ marginBottom: spacing.gap,
1294
+ fontSize: `${fontSize.label}px`,
1281
1295
  fontWeight: 600,
1282
1296
  textTransform: "uppercase",
1283
1297
  letterSpacing: "0.5px",
@@ -1291,8 +1305,8 @@ function DeviceControlPanel({
1291
1305
  "div",
1292
1306
  {
1293
1307
  style: {
1294
- marginBottom: "10px",
1295
- padding: "10px",
1308
+ marginBottom: spacing.gap,
1309
+ padding: spacing.itemPadding,
1296
1310
  backgroundColor: surfaceColor,
1297
1311
  border: `1px solid ${borderColor}`,
1298
1312
  borderRadius: "6px"
@@ -1301,13 +1315,17 @@ function DeviceControlPanel({
1301
1315
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1302
1316
  "div",
1303
1317
  {
1304
- style: { display: "flex", justifyContent: "space-between", marginBottom: "8px" },
1318
+ style: {
1319
+ display: "flex",
1320
+ justifyContent: "space-between",
1321
+ marginBottom: spacing.gap
1322
+ },
1305
1323
  children: [
1306
1324
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1307
1325
  "span",
1308
1326
  {
1309
1327
  style: {
1310
- fontSize: "11px",
1328
+ fontSize: `${fontSize.label}px`,
1311
1329
  fontWeight: 600,
1312
1330
  textTransform: "uppercase",
1313
1331
  letterSpacing: "0.5px",
@@ -1321,7 +1339,7 @@ function DeviceControlPanel({
1321
1339
  "span",
1322
1340
  {
1323
1341
  style: {
1324
- fontSize: "13px",
1342
+ fontSize: `${fontSize.value}px`,
1325
1343
  fontWeight: 700,
1326
1344
  fontFamily: "Arial, sans-serif",
1327
1345
  color: textColor
@@ -1406,7 +1424,7 @@ function DeviceControlPanel({
1406
1424
  border: `1px solid ${borderColor}`,
1407
1425
  borderRadius: "6px",
1408
1426
  padding: "0 12px",
1409
- fontSize: "14px",
1427
+ fontSize: `${fontSize.input}px`,
1410
1428
  fontFamily: "Arial, sans-serif",
1411
1429
  fontWeight: 600
1412
1430
  }
@@ -1417,7 +1435,7 @@ function DeviceControlPanel({
1417
1435
  param.id
1418
1436
  ))
1419
1437
  ] }),
1420
- 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: [
1421
1439
  activeCapabilities?.canStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1422
1440
  "button",
1423
1441
  {