@vention/machine-apps-components 0.3.22 → 0.4.1

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.
Files changed (36) hide show
  1. package/index.esm.js +2124 -208
  2. package/package.json +8 -2
  3. package/src/constants/z-index.d.ts +8 -0
  4. package/src/contexts/i18n-context.d.ts +12 -0
  5. package/src/contexts/i18n-provider.d.ts +13 -0
  6. package/src/hooks/use-auto-scroll-input.d.ts +6 -0
  7. package/src/hooks/use-i18n.d.ts +19 -0
  8. package/src/i18n/config.d.ts +8 -0
  9. package/src/i18n/locales/de.d.ts +131 -0
  10. package/src/i18n/locales/en.d.ts +131 -0
  11. package/src/i18n/locales/es.d.ts +131 -0
  12. package/src/i18n/locales/fr.d.ts +131 -0
  13. package/src/i18n/utils.d.ts +13 -0
  14. package/src/index.d.ts +14 -2
  15. package/src/lib/action-button/action-button.d.ts +14 -0
  16. package/src/lib/action-button/action-button.stories.d.ts +15 -0
  17. package/src/lib/file-upload-panel/file-upload-panel.d.ts +23 -0
  18. package/src/lib/file-upload-panel/file-upload-panel.stories.d.ts +12 -0
  19. package/src/lib/i18n-settings/i18n-settings.d.ts +8 -0
  20. package/src/lib/i18n-settings/i18n-settings.stories.d.ts +7 -0
  21. package/src/lib/logs/logs-panel.stories.d.ts +6 -0
  22. package/src/lib/navigation-bar/navigation-bar.d.ts +3 -0
  23. package/src/lib/navigation-bar/navigation-bar.stories.d.ts +6 -0
  24. package/src/lib/navigation-bar/password-protection-modal.stories.d.ts +6 -0
  25. package/src/lib/product-form-list/product-form-list.d.ts +27 -0
  26. package/src/lib/product-form-list/product-form-list.stories.d.ts +18 -0
  27. package/src/lib/settings-page/settings-page.d.ts +11 -0
  28. package/src/lib/settings-page/settings-page.stories.d.ts +9 -0
  29. package/src/lib/sidebar/sidebar.d.ts +4 -1
  30. package/src/lib/sidebar/sidebar.stories.d.ts +8 -0
  31. package/src/lib/status-top-bar/status-top-bar.d.ts +2 -0
  32. package/src/lib/status-top-bar/status-top-bar.stories.d.ts +10 -0
  33. package/src/lib/step-progress-circle/step-progress-circle.d.ts +14 -0
  34. package/src/lib/step-progress-circle/step-progress-circle.stories.d.ts +16 -0
  35. package/src/test-utils.d.ts +7 -6
  36. package/src/types/user-level.d.ts +6 -0
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ActionButton } from "./action-button";
3
+ declare const meta: Meta<typeof ActionButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ActionButton>;
6
+ export declare const Home: Story;
7
+ export declare const Start: Story;
8
+ export declare const Stop: Story;
9
+ export declare const CustomDispense: Story;
10
+ export declare const CustomIndexer: Story;
11
+ export declare const Destructive: Story;
12
+ export declare const Disabled: Story;
13
+ export declare const MachineControlExample: Story;
14
+ export declare const SmallSize: Story;
15
+ export declare const LargeSize: Story;
@@ -0,0 +1,23 @@
1
+ export interface UploadedFile {
2
+ id: string;
3
+ name: string;
4
+ size: number;
5
+ state: "indeterminate" | "success" | "error";
6
+ errorMessage?: string;
7
+ }
8
+ export interface FileUploadPanelProps {
9
+ title?: string;
10
+ files: UploadedFile[];
11
+ onFilesSelect: (files: FileList) => string[];
12
+ onFileRemove: (fileId: string) => void;
13
+ onFileRetry?: (fileId: string) => void;
14
+ onFileCancel?: (fileId: string) => void;
15
+ fileCriteriaDescription?: string;
16
+ dropzoneTitle?: string;
17
+ disabled?: boolean;
18
+ maxHeight?: number | string;
19
+ }
20
+ export declare function FileUploadPanel({ title, files, onFilesSelect, onFileRemove, onFileRetry, onFileCancel, fileCriteriaDescription, dropzoneTitle, disabled, maxHeight, }: FileUploadPanelProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare namespace FileUploadPanel {
22
+ var displayName: string;
23
+ }
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { FileUploadPanel } from "./file-upload-panel";
3
+ declare const meta: Meta<typeof FileUploadPanel>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FileUploadPanel>;
6
+ export declare const Empty: Story;
7
+ export declare const WithFiles: Story;
8
+ export declare const WithUploadingFile: Story;
9
+ export declare const WithError: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const WithMaxHeight: Story;
12
+ export declare const Interactive: Story;
@@ -0,0 +1,8 @@
1
+ export interface I18nSettingsProps {
2
+ className?: string;
3
+ layout?: "stacked" | "horizontal";
4
+ }
5
+ export declare const I18nSettings: {
6
+ ({ className, layout }: I18nSettingsProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { I18nSettings } from "./i18n-settings";
3
+ declare const meta: Meta<typeof I18nSettings>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof I18nSettings>;
6
+ export declare const Default: Story;
7
+ export declare const Horizontal: Story;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { LogsPanel } from "./logs-panel";
3
+ declare const meta: Meta<typeof LogsPanel>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LogsPanel>;
6
+ export declare const Default: Story;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { NavigationItemProps } from "./navigation-bar-item";
3
+ export type NavigationBarVariant = "fixed" | "flex";
3
4
  export interface NavigationBarProps {
4
5
  children: ReactNode;
5
6
  showTimer?: boolean;
@@ -10,6 +11,8 @@ export interface NavigationBarProps {
10
11
  isSupportDisabled?: boolean;
11
12
  showControlCenterButton?: boolean;
12
13
  showSupportButton?: boolean;
14
+ /** Layout variant: "fixed" positions the bar fixed to viewport bottom (default), "flex" uses relative positioning for flex layouts */
15
+ variant?: NavigationBarVariant;
13
16
  }
14
17
  export declare const NavigationBar: ((props: NavigationBarProps) => import("react/jsx-runtime").JSX.Element) & {
15
18
  Item: (props: NavigationItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { NavigationBar } from "./navigation-bar";
3
+ declare const meta: Meta<typeof NavigationBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof NavigationBar>;
6
+ export declare const Default: Story;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PasswordProtectionModal } from "./password-protection-modal";
3
+ declare const meta: Meta<typeof PasswordProtectionModal>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PasswordProtectionModal>;
6
+ export declare const Default: Story;
@@ -0,0 +1,27 @@
1
+ type FieldType = "text" | "number" | "select";
2
+ export interface FieldDefinition {
3
+ name: string;
4
+ label: string;
5
+ type: FieldType;
6
+ options?: {
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ min?: number;
11
+ max?: number;
12
+ }
13
+ export interface ProductFormListProps<T> {
14
+ title?: string;
15
+ items: T[];
16
+ onDelete: (id: string) => Promise<void>;
17
+ onSubmit: (formData: Partial<T>) => Promise<boolean>;
18
+ getItemId: (item: T) => string;
19
+ fields: FieldDefinition[];
20
+ maxHeight?: string | number;
21
+ }
22
+ declare function ProductFormListComponent<T extends Record<string, unknown>>({ title, items, onDelete, onSubmit, getItemId, fields, maxHeight, }: ProductFormListProps<T>): import("react/jsx-runtime").JSX.Element;
23
+ declare namespace ProductFormListComponent {
24
+ var displayName: string;
25
+ }
26
+ export declare const ProductFormList: typeof ProductFormListComponent;
27
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ProductFormList } from "./product-form-list";
3
+ interface Part {
4
+ [key: string]: unknown;
5
+ id: string;
6
+ partNumber: string;
7
+ description: string;
8
+ quantity: number;
9
+ material: string;
10
+ cycleTime: number;
11
+ }
12
+ declare const meta: Meta<typeof ProductFormList<Part>>;
13
+ export default meta;
14
+ type Story = StoryObj<typeof ProductFormList<Part>>;
15
+ export declare const Default: Story;
16
+ export declare const Empty: Story;
17
+ export declare const WithMaxHeight: Story;
18
+ export declare const Interactive: Story;
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ import { SidebarItem } from "../sidebar/sidebar";
3
+ export interface SettingsPageProps {
4
+ sidebarItems: SidebarItem[];
5
+ children: ReactNode;
6
+ sidebarWidth?: number | string;
7
+ }
8
+ export declare const SettingsPage: {
9
+ ({ sidebarItems, children, sidebarWidth }: SettingsPageProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { SettingsPage } from "./settings-page";
3
+ declare const meta: Meta<typeof SettingsPage>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof SettingsPage>;
6
+ export declare const Default: Story;
7
+ export declare const NarrowSidebar: Story;
8
+ export declare const WideSidebar: Story;
9
+ export declare const PercentageWidth: Story;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { type IconType } from "@vention/machine-ui";
2
- import React from "react";
3
+ export type SidebarVariant = "card" | "accent";
3
4
  export interface SidebarItem {
4
5
  id: string;
5
6
  title: string;
@@ -11,5 +12,7 @@ export interface SidebarItem {
11
12
  }
12
13
  export interface SidebarProps {
13
14
  items: SidebarItem[];
15
+ /** Style variant: "card" (default) shows full bordered cards, "accent" shows left border accent only */
16
+ variant?: SidebarVariant;
14
17
  }
15
18
  export declare const Sidebar: (props: SidebarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Sidebar } from "./sidebar";
3
+ declare const meta: Meta<typeof Sidebar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Sidebar>;
6
+ export declare const Default: Story;
7
+ export declare const CardVariant: Story;
8
+ export declare const AccentVariant: Story;
@@ -14,12 +14,14 @@ export interface ButtonConfig {
14
14
  icon?: ReactNode;
15
15
  iconDisabled?: ReactNode;
16
16
  }
17
+ export type StatusTopBarVariant = "light" | "dark";
17
18
  export interface StatusTopBarProps {
18
19
  status?: {
19
20
  label: string;
20
21
  color: string;
21
22
  };
22
23
  buttonConfigs?: ButtonConfig[];
24
+ variant?: StatusTopBarVariant;
23
25
  }
24
26
  export declare const StatusTopBar: (props: StatusTopBarProps) => import("react/jsx-runtime").JSX.Element;
25
27
  export default StatusTopBar;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { StatusTopBar } from "./status-top-bar";
3
+ declare const meta: Meta<typeof StatusTopBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof StatusTopBar>;
6
+ export declare const Default: Story;
7
+ export declare const DarkVariant: Story;
8
+ export declare const DarkVariantRunning: Story;
9
+ export declare const DarkVariantError: Story;
10
+ export declare const Error: Story;
@@ -0,0 +1,14 @@
1
+ export type StepProgressCircleVariant = "default" | "success" | "error" | "warning";
2
+ export interface StepProgressCircleProps {
3
+ currentStep: number;
4
+ totalSteps: number;
5
+ title?: string;
6
+ variant?: StepProgressCircleVariant;
7
+ size?: number;
8
+ strokeWidth?: number;
9
+ showTitle?: boolean;
10
+ }
11
+ export declare function StepProgressCircle({ currentStep, totalSteps, title, variant, size, strokeWidth, showTitle, }: StepProgressCircleProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare namespace StepProgressCircle {
13
+ var displayName: string;
14
+ }
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { StepProgressCircle } from "./step-progress-circle";
3
+ declare const meta: Meta<typeof StepProgressCircle>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof StepProgressCircle>;
6
+ export declare const Default: Story;
7
+ export declare const InProgress: Story;
8
+ export declare const Complete: Story;
9
+ export declare const WithError: Story;
10
+ export declare const Warning: Story;
11
+ export declare const CustomTitle: Story;
12
+ export declare const NoTitle: Story;
13
+ export declare const SmallSize: Story;
14
+ export declare const LargeSize: Story;
15
+ export declare const AllVariants: Story;
16
+ export declare const ProgressStages: Story;
@@ -2,11 +2,12 @@ import { ReactElement } from "react";
2
2
  import { RenderOptions, RenderResult } from "@testing-library/react";
3
3
  interface CustomRenderOptions extends Omit<RenderOptions, "wrapper"> {
4
4
  initialRoute?: string;
5
+ i18nConfig?: {
6
+ locale?: string;
7
+ unitSystem?: "metric" | "imperial";
8
+ timezone?: string | "auto";
9
+ supportedLanguages?: string[];
10
+ };
5
11
  }
6
- /**
7
- * Custom render function that wraps components with necessary providers:
8
- * - ThemeProvider with machineUiTheme
9
- * - MemoryRouter for routing
10
- */
11
- export declare const renderWithProviders: (ui: ReactElement, { initialRoute, ...renderOptions }?: CustomRenderOptions) => RenderResult;
12
+ export declare const renderWithProviders: (ui: ReactElement, { initialRoute, i18nConfig, ...renderOptions }?: CustomRenderOptions) => RenderResult;
12
13
  export * from "@testing-library/react";
@@ -0,0 +1,6 @@
1
+ export declare enum UserLevel {
2
+ Operator = 1,
3
+ Maintenance = 2,
4
+ Admin = 3
5
+ }
6
+ export declare function hasSufficientLevel(requiredLevel: UserLevel, currentLevel: UserLevel): boolean;