@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.d.cts CHANGED
@@ -462,8 +462,14 @@ interface DeviceControlPanelProps {
462
462
  onClose: () => void;
463
463
  /** Panel position */
464
464
  position?: 'bottom' | 'side';
465
+ /** Horizontal alignment for bottom position (default: center) */
466
+ align?: 'left' | 'center' | 'right';
465
467
  /** Optimize for touch (larger targets) */
466
468
  touchOptimized?: boolean;
469
+ /** Compact mode - reduces padding and spacing */
470
+ compact?: boolean;
471
+ /** Font size scale (default: 1.0, smaller: 0.8, larger: 1.2) */
472
+ fontScale?: number;
467
473
  /** Maximum height for bottom position (default: 70vh) */
468
474
  maxHeight?: string;
469
475
  /** Maximum width for bottom position (default: none) */
@@ -479,7 +485,7 @@ interface DeviceControlPanelProps {
479
485
  /** Called when custom action clicked */
480
486
  onCustomAction?: (actionId: string) => void;
481
487
  }
482
- declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
488
+ declare function DeviceControlPanel({ binding, onClose, position, align, touchOptimized, compact, fontScale, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
483
489
 
484
490
  type DisplayMode = 'standard' | 'dashboard';
485
491
  interface FullscreenContainerProps {
package/dist/index.d.ts CHANGED
@@ -462,8 +462,14 @@ interface DeviceControlPanelProps {
462
462
  onClose: () => void;
463
463
  /** Panel position */
464
464
  position?: 'bottom' | 'side';
465
+ /** Horizontal alignment for bottom position (default: center) */
466
+ align?: 'left' | 'center' | 'right';
465
467
  /** Optimize for touch (larger targets) */
466
468
  touchOptimized?: boolean;
469
+ /** Compact mode - reduces padding and spacing */
470
+ compact?: boolean;
471
+ /** Font size scale (default: 1.0, smaller: 0.8, larger: 1.2) */
472
+ fontScale?: number;
467
473
  /** Maximum height for bottom position (default: 70vh) */
468
474
  maxHeight?: string;
469
475
  /** Maximum width for bottom position (default: none) */
@@ -479,7 +485,7 @@ interface DeviceControlPanelProps {
479
485
  /** Called when custom action clicked */
480
486
  onCustomAction?: (actionId: string) => void;
481
487
  }
482
- declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
488
+ declare function DeviceControlPanel({ binding, onClose, position, align, touchOptimized, compact, fontScale, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
483
489
 
484
490
  type DisplayMode = 'standard' | 'dashboard';
485
491
  interface FullscreenContainerProps {
package/dist/index.js CHANGED
@@ -900,7 +900,10 @@ function DeviceControlPanel({
900
900
  binding,
901
901
  onClose,
902
902
  position = "bottom",
903
+ align = "center",
903
904
  touchOptimized = true,
905
+ compact = false,
906
+ fontScale = 1,
904
907
  maxHeight,
905
908
  maxWidth,
906
909
  onModeChange,
@@ -924,6 +927,20 @@ function DeviceControlPanel({
924
927
  const currentMode = binding.state.currentMode;
925
928
  const currentParams = binding.parameters[currentMode] || [];
926
929
  const touchSize = touchOptimized ? 56 : 40;
930
+ const spacing = {
931
+ padding: compact ? "12px" : "20px",
932
+ gap: compact ? "6px" : "8px",
933
+ marginBottom: compact ? "10px" : "16px",
934
+ itemPadding: compact ? "8px 10px" : "10px 12px"
935
+ };
936
+ const fontSize = {
937
+ title: Math.round(14 * fontScale),
938
+ label: Math.round(11 * fontScale),
939
+ value: Math.round(13 * fontScale),
940
+ input: Math.round(14 * fontScale),
941
+ button: Math.round(12 * fontScale),
942
+ status: Math.round(10 * fontScale)
943
+ };
927
944
  const currentModeObj = binding.modes.find((m) => m.value === currentMode);
928
945
  const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
929
946
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
@@ -962,12 +979,9 @@ function DeviceControlPanel({
962
979
  position: "fixed",
963
980
  ...position === "bottom" ? {
964
981
  bottom: 0,
965
- left: 0,
966
- right: 0,
982
+ ...align === "left" ? { left: 0, right: "auto" } : align === "right" ? { right: 0, left: "auto" } : { left: 0, right: 0, marginLeft: "auto", marginRight: "auto" },
967
983
  animation: "slideUp 0.3s ease-out",
968
- maxWidth,
969
- marginLeft: "auto",
970
- marginRight: "auto"
984
+ maxWidth
971
985
  } : {
972
986
  right: 0,
973
987
  top: 0,
@@ -980,7 +994,7 @@ function DeviceControlPanel({
980
994
  borderRadius: position === "bottom" ? "8px 8px 0 0" : "8px 0 0 8px",
981
995
  boxShadow: "none",
982
996
  border: `2px solid ${borderColor}`,
983
- padding: "20px",
997
+ padding: spacing.padding,
984
998
  zIndex: 9999,
985
999
  maxHeight: maxHeight || (position === "bottom" ? "70vh" : "100vh"),
986
1000
  overflowY: "auto",
@@ -1006,7 +1020,7 @@ function DeviceControlPanel({
1006
1020
  {
1007
1021
  style: {
1008
1022
  margin: 0,
1009
- fontSize: "14px",
1023
+ fontSize: `${fontSize.title}px`,
1010
1024
  fontWeight: 600,
1011
1025
  fontFamily: "Arial, sans-serif",
1012
1026
  letterSpacing: "0.5px",
@@ -1058,11 +1072,11 @@ function DeviceControlPanel({
1058
1072
  display: "flex",
1059
1073
  alignItems: "center",
1060
1074
  gap: "12px",
1061
- padding: "10px 12px",
1075
+ padding: spacing.itemPadding,
1062
1076
  backgroundColor: surfaceColor,
1063
1077
  border: `1px solid ${borderColor}`,
1064
1078
  borderRadius: "6px",
1065
- marginBottom: "16px"
1079
+ marginBottom: spacing.marginBottom
1066
1080
  },
1067
1081
  children: [
1068
1082
  /* @__PURE__ */ jsx8(
@@ -1084,7 +1098,7 @@ function DeviceControlPanel({
1084
1098
  style: {
1085
1099
  fontWeight: 600,
1086
1100
  textTransform: "uppercase",
1087
- fontSize: "11px",
1101
+ fontSize: `${fontSize.label}px`,
1088
1102
  fontFamily: "Arial, sans-serif",
1089
1103
  letterSpacing: "0.5px",
1090
1104
  color: textColor
@@ -1142,7 +1156,7 @@ function DeviceControlPanel({
1142
1156
  children: "Mode"
1143
1157
  }
1144
1158
  ),
1145
- /* @__PURE__ */ jsx8("div", { style: { display: "flex", gap: "6px", flexWrap: "wrap" }, children: binding.modes.map((mode) => {
1159
+ /* @__PURE__ */ jsx8("div", { style: { display: "flex", gap: spacing.gap, flexWrap: "wrap" }, children: binding.modes.map((mode) => {
1146
1160
  const isSelected = mode.value === currentMode;
1147
1161
  const isEnabled = mode.enabled !== false;
1148
1162
  return /* @__PURE__ */ jsx8(
@@ -1158,7 +1172,7 @@ function DeviceControlPanel({
1158
1172
  color: isSelected ? "#000000" : textColor,
1159
1173
  border: `1px solid ${isSelected ? "#b4d0fe" : borderColor}`,
1160
1174
  borderRadius: "6px",
1161
- fontSize: "11px",
1175
+ fontSize: `${fontSize.label}px`,
1162
1176
  fontWeight: 600,
1163
1177
  fontFamily: "Arial, sans-serif",
1164
1178
  letterSpacing: "0.5px",
@@ -1172,14 +1186,14 @@ function DeviceControlPanel({
1172
1186
  );
1173
1187
  }) })
1174
1188
  ] }),
1175
- currentParams.length > 0 && /* @__PURE__ */ jsxs7("div", { style: { marginBottom: "16px" }, children: [
1189
+ currentParams.length > 0 && /* @__PURE__ */ jsxs7("div", { style: { marginBottom: spacing.marginBottom }, children: [
1176
1190
  /* @__PURE__ */ jsx8(
1177
1191
  "label",
1178
1192
  {
1179
1193
  style: {
1180
1194
  display: "block",
1181
- marginBottom: "8px",
1182
- fontSize: "11px",
1195
+ marginBottom: spacing.gap,
1196
+ fontSize: `${fontSize.label}px`,
1183
1197
  fontWeight: 600,
1184
1198
  textTransform: "uppercase",
1185
1199
  letterSpacing: "0.5px",
@@ -1193,8 +1207,8 @@ function DeviceControlPanel({
1193
1207
  "div",
1194
1208
  {
1195
1209
  style: {
1196
- marginBottom: "10px",
1197
- padding: "10px",
1210
+ marginBottom: spacing.gap,
1211
+ padding: spacing.itemPadding,
1198
1212
  backgroundColor: surfaceColor,
1199
1213
  border: `1px solid ${borderColor}`,
1200
1214
  borderRadius: "6px"
@@ -1203,13 +1217,17 @@ function DeviceControlPanel({
1203
1217
  /* @__PURE__ */ jsxs7(
1204
1218
  "div",
1205
1219
  {
1206
- style: { display: "flex", justifyContent: "space-between", marginBottom: "8px" },
1220
+ style: {
1221
+ display: "flex",
1222
+ justifyContent: "space-between",
1223
+ marginBottom: spacing.gap
1224
+ },
1207
1225
  children: [
1208
1226
  /* @__PURE__ */ jsx8(
1209
1227
  "span",
1210
1228
  {
1211
1229
  style: {
1212
- fontSize: "11px",
1230
+ fontSize: `${fontSize.label}px`,
1213
1231
  fontWeight: 600,
1214
1232
  textTransform: "uppercase",
1215
1233
  letterSpacing: "0.5px",
@@ -1223,7 +1241,7 @@ function DeviceControlPanel({
1223
1241
  "span",
1224
1242
  {
1225
1243
  style: {
1226
- fontSize: "13px",
1244
+ fontSize: `${fontSize.value}px`,
1227
1245
  fontWeight: 700,
1228
1246
  fontFamily: "Arial, sans-serif",
1229
1247
  color: textColor
@@ -1308,7 +1326,7 @@ function DeviceControlPanel({
1308
1326
  border: `1px solid ${borderColor}`,
1309
1327
  borderRadius: "6px",
1310
1328
  padding: "0 12px",
1311
- fontSize: "14px",
1329
+ fontSize: `${fontSize.input}px`,
1312
1330
  fontFamily: "Arial, sans-serif",
1313
1331
  fontWeight: 600
1314
1332
  }
@@ -1319,7 +1337,7 @@ function DeviceControlPanel({
1319
1337
  param.id
1320
1338
  ))
1321
1339
  ] }),
1322
- binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1340
+ binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", gap: spacing.gap, marginBottom: spacing.marginBottom }, children: [
1323
1341
  activeCapabilities?.canStart && /* @__PURE__ */ jsx8(
1324
1342
  "button",
1325
1343
  {