@vention/machine-apps-components 0.4.1 → 0.5.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/index.esm.js CHANGED
@@ -826,6 +826,7 @@ const useI18n = function useI18n() {
826
826
 
827
827
  const I18nSettings = function I18nSettings({
828
828
  className,
829
+ sx,
829
830
  layout = "stacked"
830
831
  }) {
831
832
  const {
@@ -886,6 +887,7 @@ const I18nSettings = function I18nSettings({
886
887
  };
887
888
  return jsxs(Box, {
888
889
  className: cx(classes.container, className),
890
+ sx: sx,
889
891
  children: [jsx(Box, {
890
892
  className: classes.settingItem,
891
893
  children: jsx(VentionSelect, {
@@ -2709,6 +2711,7 @@ const LogsPanel = forwardRef((props, ref) => {
2709
2711
  onFilterChange,
2710
2712
  onLogClick,
2711
2713
  className,
2714
+ sx,
2712
2715
  tableHeight,
2713
2716
  emptyStateMessage,
2714
2717
  emptyStateIcon
@@ -2829,6 +2832,7 @@ const LogsPanel = forwardRef((props, ref) => {
2829
2832
  }), [refresh, resetFilters, applyFilters, getCurrentFilters, exportLogs]);
2830
2833
  return jsxs(Box, {
2831
2834
  className: cx(classes.root, className),
2835
+ sx: sx,
2832
2836
  children: [jsx(LogFilterForm, {
2833
2837
  onFilterChange: handleFilterChange,
2834
2838
  onReset: handleReset,
@@ -2924,10 +2928,14 @@ function FileUploadPanel({
2924
2928
  fileCriteriaDescription,
2925
2929
  dropzoneTitle,
2926
2930
  disabled = false,
2927
- maxHeight
2931
+ maxHeight,
2932
+ titleVariant = "heading18SemiBold",
2933
+ className,
2934
+ sx
2928
2935
  }) {
2929
2936
  const {
2930
- classes
2937
+ classes,
2938
+ cx
2931
2939
  } = useStyles$3({
2932
2940
  maxHeight
2933
2941
  });
@@ -2951,9 +2959,10 @@ function FileUploadPanel({
2951
2959
  }
2952
2960
  }
2953
2961
  return jsxs(Box, {
2954
- className: classes.container,
2962
+ className: cx(classes.container, className),
2963
+ sx: sx,
2955
2964
  children: [displayTitle && jsx(Typography, {
2956
- variant: "heading18SemiBold",
2965
+ variant: titleVariant,
2957
2966
  className: classes.title,
2958
2967
  children: displayTitle
2959
2968
  }), jsx(VentionDropZone, {
@@ -3018,14 +3027,19 @@ function StepProgressCircle({
3018
3027
  variant = "default",
3019
3028
  size = 180,
3020
3029
  strokeWidth = 12,
3021
- showTitle = true
3030
+ showTitle = true,
3031
+ titleVariant = "heading18SemiBold",
3032
+ progressVariant = "heading24SemiBold",
3033
+ className,
3034
+ sx
3022
3035
  }) {
3023
3036
  var _a;
3024
3037
  const {
3025
3038
  t
3026
3039
  } = useTranslation();
3027
3040
  const {
3028
- classes
3041
+ classes,
3042
+ cx
3029
3043
  } = useStyles$2({
3030
3044
  size,
3031
3045
  strokeWidth,
@@ -3042,9 +3056,10 @@ function StepProgressCircle({
3042
3056
  const center = size / 2;
3043
3057
  const progressText = totalSteps > 0 ? `${currentStep}/${totalSteps}` : "-/-";
3044
3058
  return jsxs(Box, {
3045
- className: classes.container,
3059
+ className: cx(classes.container, className),
3060
+ sx: sx,
3046
3061
  children: [showTitle && jsx(Typography, {
3047
- variant: "heading18SemiBold",
3062
+ variant: titleVariant,
3048
3063
  className: classes.title,
3049
3064
  children: displayTitle
3050
3065
  }), jsxs(Box, {
@@ -3074,7 +3089,7 @@ function StepProgressCircle({
3074
3089
  }), jsx(Box, {
3075
3090
  className: classes.textContainer,
3076
3091
  children: jsx(Typography, {
3077
- variant: "heading24SemiBold",
3092
+ variant: progressVariant,
3078
3093
  className: classes.progressText,
3079
3094
  children: progressText
3080
3095
  })
@@ -3145,10 +3160,14 @@ const ActionButton = function ActionButton({
3145
3160
  disabled = false,
3146
3161
  icon,
3147
3162
  label,
3148
- size = 96
3163
+ size = 96,
3164
+ labelVariant = "uiText14SemiBold",
3165
+ className,
3166
+ sx
3149
3167
  }) {
3150
3168
  const {
3151
- classes
3169
+ classes,
3170
+ cx
3152
3171
  } = useStyles$1({
3153
3172
  size
3154
3173
  });
@@ -3164,7 +3183,8 @@ const ActionButton = function ActionButton({
3164
3183
  disabled: disabled,
3165
3184
  size: "x-large",
3166
3185
  variant: variant === "destructive" ? "destructive" : "filled",
3167
- className: classes.button,
3186
+ className: cx(classes.button, className),
3187
+ sx: sx,
3168
3188
  "data-testid": "action-button",
3169
3189
  children: jsxs(Box, {
3170
3190
  className: classes.content,
@@ -3172,7 +3192,7 @@ const ActionButton = function ActionButton({
3172
3192
  className: classes.iconContainer,
3173
3193
  children: icon
3174
3194
  }), jsx(Typography, {
3175
- variant: "uiText14SemiBold",
3195
+ variant: labelVariant,
3176
3196
  className: classes.label,
3177
3197
  children: translatedLabel
3178
3198
  })]
@@ -3277,7 +3297,12 @@ function ProductFormListComponent({
3277
3297
  onSubmit,
3278
3298
  getItemId,
3279
3299
  fields,
3280
- maxHeight = 600
3300
+ maxHeight = 600,
3301
+ titleVariant = "heading24SemiBold",
3302
+ itemTitleVariant = "heading18SemiBold",
3303
+ itemSubtitleVariant = "uiText14Regular",
3304
+ className,
3305
+ sx
3281
3306
  }) {
3282
3307
  const [editDialogOpen, setEditDialogOpen] = useState(false);
3283
3308
  const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
@@ -3287,7 +3312,8 @@ function ProductFormListComponent({
3287
3312
  t
3288
3313
  } = useTranslation();
3289
3314
  const {
3290
- classes
3315
+ classes,
3316
+ cx
3291
3317
  } = useStyles({
3292
3318
  maxHeight
3293
3319
  });
@@ -3335,11 +3361,11 @@ function ProductFormListComponent({
3335
3361
  return jsxs(Box, {
3336
3362
  className: classes.itemContent,
3337
3363
  children: [jsx(Typography, {
3338
- variant: "heading18SemiBold",
3364
+ variant: itemTitleVariant,
3339
3365
  className: classes.itemTitle,
3340
3366
  children: getFieldDisplayValue(mainField, item[mainField.name])
3341
3367
  }), jsx(Typography, {
3342
- variant: "uiText14Regular",
3368
+ variant: itemSubtitleVariant,
3343
3369
  color: "textSecondary",
3344
3370
  className: classes.itemSubtitle,
3345
3371
  children: secondaryFields.map(field => `${field.label}: ${getFieldDisplayValue(field, item[field.name])}`).join(" | ")
@@ -3382,11 +3408,12 @@ function ProductFormListComponent({
3382
3408
  }
3383
3409
  const isEditing = Object.keys(formData).length > 0 && "id" in formData;
3384
3410
  return jsxs(Box, {
3385
- className: classes.container,
3411
+ className: cx(classes.container, className),
3412
+ sx: sx,
3386
3413
  children: [jsxs(Box, {
3387
3414
  className: classes.header,
3388
3415
  children: [jsx(Typography, {
3389
- variant: "heading24SemiBold",
3416
+ variant: titleVariant,
3390
3417
  children: title
3391
3418
  }), jsx(VentionButton, {
3392
3419
  onClick: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vention/machine-apps-components",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/VentionCo/machine-cloud.git"
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import { TypographyProps, SxProps, Theme } from "@mui/material";
2
3
  export type ActionButtonVariant = "primary" | "destructive";
3
4
  export interface ActionButtonProps {
4
5
  variant?: ActionButtonVariant;
@@ -7,8 +8,11 @@ export interface ActionButtonProps {
7
8
  icon: ReactNode;
8
9
  label: string;
9
10
  size?: number;
11
+ labelVariant?: TypographyProps["variant"];
12
+ className?: string;
13
+ sx?: SxProps<Theme>;
10
14
  }
11
15
  export declare const ActionButton: {
12
- ({ variant, onClick, disabled, icon, label, size, }: ActionButtonProps): import("react/jsx-runtime").JSX.Element;
16
+ ({ variant, onClick, disabled, icon, label, size, labelVariant, className, sx, }: ActionButtonProps): import("react/jsx-runtime").JSX.Element;
13
17
  displayName: string;
14
18
  };
@@ -13,3 +13,6 @@ export declare const Disabled: Story;
13
13
  export declare const MachineControlExample: Story;
14
14
  export declare const SmallSize: Story;
15
15
  export declare const LargeSize: Story;
16
+ export declare const HmiLabelVariant: Story;
17
+ export declare const LabelVariants: Story;
18
+ export declare const WithSxOverride: Story;
@@ -1,3 +1,4 @@
1
+ import { TypographyProps, SxProps, Theme } from "@mui/material";
1
2
  export interface UploadedFile {
2
3
  id: string;
3
4
  name: string;
@@ -16,8 +17,11 @@ export interface FileUploadPanelProps {
16
17
  dropzoneTitle?: string;
17
18
  disabled?: boolean;
18
19
  maxHeight?: number | string;
20
+ titleVariant?: TypographyProps["variant"];
21
+ className?: string;
22
+ sx?: SxProps<Theme>;
19
23
  }
20
- export declare function FileUploadPanel({ title, files, onFilesSelect, onFileRemove, onFileRetry, onFileCancel, fileCriteriaDescription, dropzoneTitle, disabled, maxHeight, }: FileUploadPanelProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function FileUploadPanel({ title, files, onFilesSelect, onFileRemove, onFileRetry, onFileCancel, fileCriteriaDescription, dropzoneTitle, disabled, maxHeight, titleVariant, className, sx, }: FileUploadPanelProps): import("react/jsx-runtime").JSX.Element;
21
25
  export declare namespace FileUploadPanel {
22
26
  var displayName: string;
23
27
  }
@@ -9,4 +9,6 @@ export declare const WithUploadingFile: Story;
9
9
  export declare const WithError: Story;
10
10
  export declare const Disabled: Story;
11
11
  export declare const WithMaxHeight: Story;
12
+ export declare const WithSxOverride: Story;
13
+ export declare const HmiTitleVariant: Story;
12
14
  export declare const Interactive: Story;
@@ -1,8 +1,10 @@
1
+ import { SxProps, Theme } from "@mui/material";
1
2
  export interface I18nSettingsProps {
2
3
  className?: string;
4
+ sx?: SxProps<Theme>;
3
5
  layout?: "stacked" | "horizontal";
4
6
  }
5
7
  export declare const I18nSettings: {
6
- ({ className, layout }: I18nSettingsProps): import("react/jsx-runtime").JSX.Element;
8
+ ({ className, sx, layout }: I18nSettingsProps): import("react/jsx-runtime").JSX.Element;
7
9
  displayName: string;
8
10
  };
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof I18nSettings>;
6
6
  export declare const Default: Story;
7
7
  export declare const Horizontal: Story;
8
+ export declare const WithSxOverride: Story;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from "react";
2
+ import { SxProps, Theme } from "@mui/material";
2
3
  export type LogType = "error" | "warning" | "info";
3
4
  export interface LogEntry {
4
5
  id: string;
@@ -51,6 +52,7 @@ interface LogsPanelProps {
51
52
  onFilterChange?: (filters: LogFilterFormValues) => void;
52
53
  onLogClick?: (log: LogEntry) => void;
53
54
  className?: string;
55
+ sx?: SxProps<Theme>;
54
56
  tableHeight?: string | number;
55
57
  emptyStateMessage?: string;
56
58
  emptyStateIcon?: ReactNode;
@@ -4,3 +4,4 @@ declare const meta: Meta<typeof LogsPanel>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof LogsPanel>;
6
6
  export declare const Default: Story;
7
+ export declare const WithSxOverride: Story;
@@ -1,3 +1,4 @@
1
+ import { TypographyProps, SxProps, Theme } from "@mui/material";
1
2
  type FieldType = "text" | "number" | "select";
2
3
  export interface FieldDefinition {
3
4
  name: string;
@@ -18,8 +19,13 @@ export interface ProductFormListProps<T> {
18
19
  getItemId: (item: T) => string;
19
20
  fields: FieldDefinition[];
20
21
  maxHeight?: string | number;
22
+ titleVariant?: TypographyProps["variant"];
23
+ itemTitleVariant?: TypographyProps["variant"];
24
+ itemSubtitleVariant?: TypographyProps["variant"];
25
+ className?: string;
26
+ sx?: SxProps<Theme>;
21
27
  }
22
- declare function ProductFormListComponent<T extends Record<string, unknown>>({ title, items, onDelete, onSubmit, getItemId, fields, maxHeight, }: ProductFormListProps<T>): import("react/jsx-runtime").JSX.Element;
28
+ declare function ProductFormListComponent<T extends Record<string, unknown>>({ title, items, onDelete, onSubmit, getItemId, fields, maxHeight, titleVariant, itemTitleVariant, itemSubtitleVariant, className, sx, }: ProductFormListProps<T>): import("react/jsx-runtime").JSX.Element;
23
29
  declare namespace ProductFormListComponent {
24
30
  var displayName: string;
25
31
  }
@@ -15,4 +15,6 @@ type Story = StoryObj<typeof ProductFormList<Part>>;
15
15
  export declare const Default: Story;
16
16
  export declare const Empty: Story;
17
17
  export declare const WithMaxHeight: Story;
18
+ export declare const WithSxOverride: Story;
19
+ export declare const HmiTypography: Story;
18
20
  export declare const Interactive: Story;
@@ -1,3 +1,4 @@
1
+ import { TypographyProps, SxProps, Theme } from "@mui/material";
1
2
  export type StepProgressCircleVariant = "default" | "success" | "error" | "warning";
2
3
  export interface StepProgressCircleProps {
3
4
  currentStep: number;
@@ -7,8 +8,12 @@ export interface StepProgressCircleProps {
7
8
  size?: number;
8
9
  strokeWidth?: number;
9
10
  showTitle?: boolean;
11
+ titleVariant?: TypographyProps["variant"];
12
+ progressVariant?: TypographyProps["variant"];
13
+ className?: string;
14
+ sx?: SxProps<Theme>;
10
15
  }
11
- export declare function StepProgressCircle({ currentStep, totalSteps, title, variant, size, strokeWidth, showTitle, }: StepProgressCircleProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function StepProgressCircle({ currentStep, totalSteps, title, variant, size, strokeWidth, showTitle, titleVariant, progressVariant, className, sx, }: StepProgressCircleProps): import("react/jsx-runtime").JSX.Element;
12
17
  export declare namespace StepProgressCircle {
13
18
  var displayName: string;
14
19
  }
@@ -12,5 +12,7 @@ export declare const CustomTitle: Story;
12
12
  export declare const NoTitle: Story;
13
13
  export declare const SmallSize: Story;
14
14
  export declare const LargeSize: Story;
15
+ export declare const WithSxOverride: Story;
16
+ export declare const HmiTypography: Story;
15
17
  export declare const AllVariants: Story;
16
18
  export declare const ProgressStages: Story;