@mriqbox/ui-kit 3.3.1 → 3.4.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/bin/cli.js CHANGED
@@ -51,13 +51,17 @@ const COMPONENT_MAP = {
51
51
  'MriSectionHeader': 'molecules',
52
52
  'MriDatePicker': 'molecules',
53
53
  'MriDrawer': 'molecules',
54
+ 'MriPlayerVitals': 'molecules',
55
+ 'MriVitalAdjustModal': 'molecules',
54
56
 
55
57
  // Organisms
56
58
  'MriCalendar': 'organisms',
57
59
  'MriKeyboardVisualizer': 'organisms',
58
60
  'MriPageHeader': 'organisms',
59
61
  'MriSidebar': 'organisms',
62
+ 'MriTopbar': 'organisms',
60
63
  'MriTable': 'organisms',
64
+ 'MriPlayerScreenStream': 'organisms',
61
65
  };
62
66
 
63
67
  function toPascalCase(str) {
@@ -173,7 +177,7 @@ async function checkDependencies(filePath, installDir) {
173
177
  program
174
178
  .name('mri-ui')
175
179
  .description('Add Mri UI components to your project')
176
- .version('3.3.1');
180
+ .version('3.4.0');
177
181
 
178
182
  program
179
183
  .command('add <component>')
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriScrollArea } from './MriScrollArea';
3
+
4
+ declare const meta: Meta<typeof MriScrollArea>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof MriScrollArea>;
7
+ export declare const Vertical: Story;
8
+ export declare const Horizontal: Story;
@@ -0,0 +1,26 @@
1
+ export interface VitalsData {
2
+ health: number;
3
+ armor: number;
4
+ metadata?: {
5
+ hunger?: number;
6
+ thirst?: number;
7
+ stress?: number;
8
+ isdead?: boolean;
9
+ [key: string]: unknown;
10
+ };
11
+ [key: string]: unknown;
12
+ }
13
+ export interface MriPlayerVitalsProps {
14
+ vitals: VitalsData;
15
+ size?: 'mini' | 'compact' | 'full';
16
+ onAction?: (vital: string, label: string, value: number) => void;
17
+ className?: string;
18
+ labels?: {
19
+ health?: string;
20
+ armor?: string;
21
+ hunger?: string;
22
+ thirst?: string;
23
+ stress?: string;
24
+ };
25
+ }
26
+ export declare function MriPlayerVitals({ vitals, size, onAction, className, labels }: MriPlayerVitalsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriPlayerVitals } from './MriPlayerVitals';
3
+
4
+ declare const meta: Meta<typeof MriPlayerVitals>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof MriPlayerVitals>;
7
+ export declare const Compact: Story;
8
+ export declare const Mini: Story;
9
+ export declare const Full: Story;
10
+ export declare const CriticalState: Story;
@@ -0,0 +1,19 @@
1
+ export interface MriVitalAdjustModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ onSubmit: (value: number) => void;
5
+ vital: 'health' | 'armor' | 'hunger' | 'thirst' | 'stress';
6
+ currentValue: number;
7
+ playerName: string;
8
+ labels?: {
9
+ health?: string;
10
+ armor?: string;
11
+ hunger?: string;
12
+ thirst?: string;
13
+ stress?: string;
14
+ newValue?: string;
15
+ confirm?: string;
16
+ cancel?: string;
17
+ };
18
+ }
19
+ export declare function MriVitalAdjustModal({ isOpen, onClose, onSubmit, vital, currentValue, playerName, labels }: MriVitalAdjustModalProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriVitalAdjustModal } from './MriVitalAdjustModal';
3
+
4
+ declare const meta: Meta<typeof MriVitalAdjustModal>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof MriVitalAdjustModal>;
7
+ export declare const Health: Story;
8
+ export declare const Armor: Story;
9
+ export declare const Hunger: Story;
10
+ export declare const Thirst: Story;
11
+ export declare const Stress: Story;
@@ -0,0 +1,41 @@
1
+ export interface MriPlayerScreenStreamProps {
2
+ playerId: number | string;
3
+ playerName?: string;
4
+ className?: string;
5
+ onFpsUpdate?: (fps: number) => void;
6
+ autoPlay?: boolean;
7
+ muted?: boolean;
8
+ isMock?: boolean;
9
+ showKeyboard?: boolean;
10
+ onSendNui?: (method: string, data?: unknown) => Promise<unknown>;
11
+ onNuiEvent?: (event: string, callback: (data: unknown) => void) => () => void;
12
+ signaling?: {
13
+ init: (url: string | null, id: string, provider: string) => void;
14
+ disconnect: () => void;
15
+ send: (msg: unknown) => void;
16
+ onMessage: (callback: (msg: unknown) => void) => () => void;
17
+ onConnect: (callback: () => void) => void;
18
+ isConnected?: () => boolean;
19
+ };
20
+ subscribeFromCF?: (sessionId: string, trackName: string) => Promise<{
21
+ pc: RTCPeerConnection;
22
+ stream: MediaStream;
23
+ }>;
24
+ webrtcConfig?: {
25
+ url: string | null;
26
+ provider: 'websocket' | 'fivem-native' | 'cloudflare-sfu';
27
+ iceServers?: RTCIceServer[];
28
+ };
29
+ selfId?: string | number;
30
+ labels?: {
31
+ connecting?: string;
32
+ error_title?: string;
33
+ error_desc?: string;
34
+ retry?: string;
35
+ live?: string;
36
+ stable?: string;
37
+ mock_active?: string;
38
+ simulator?: string;
39
+ };
40
+ }
41
+ export declare function MriPlayerScreenStream({ playerId, className, onFpsUpdate, autoPlay, muted, isMock, showKeyboard, onSendNui, onNuiEvent, signaling, subscribeFromCF, webrtcConfig, selfId, labels }: MriPlayerScreenStreamProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriPlayerScreenStream } from './MriPlayerScreenStream';
3
+
4
+ declare const meta: Meta<typeof MriPlayerScreenStream>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof MriPlayerScreenStream>;
7
+ export declare const MockFeed: Story;
8
+ export declare const WithKeyboard: Story;
9
+ export declare const Loading: Story;
@@ -0,0 +1,19 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+
3
+ export interface MriTopbarItem {
4
+ label: string;
5
+ route?: string;
6
+ icon: ElementType;
7
+ onClick?: () => void;
8
+ divider?: boolean;
9
+ }
10
+ export interface MriTopbarProps {
11
+ items: MriTopbarItem[];
12
+ activeRoute?: string;
13
+ onNavigate?: (route: string) => void;
14
+ logo?: ReactNode;
15
+ rightContent?: ReactNode;
16
+ children?: ReactNode;
17
+ className?: string;
18
+ }
19
+ export declare function MriTopbar({ items, activeRoute, onNavigate, logo, rightContent, children, className }: MriTopbarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriTopbar } from './MriTopbar';
3
+
4
+ declare const meta: Meta<typeof MriTopbar>;
5
+ export default meta;
6
+ export declare const Default: StoryObj<typeof MriTopbar>;
package/dist/index.d.ts CHANGED
@@ -29,9 +29,13 @@ export * from './components/molecules/MriSectionHeader';
29
29
  export * from './components/molecules/MriDatePicker';
30
30
  export * from './components/molecules/MriColorPicker';
31
31
  export * from './components/molecules/MriCreatableCombobox';
32
+ export * from './components/molecules/MriPlayerVitals';
33
+ export * from './components/molecules/MriVitalAdjustModal';
32
34
  export * from './components/organisms/MriCalendar';
33
35
  export * from './components/organisms/MriPageHeader';
34
36
  export * from './components/organisms/MriSidebar';
35
- export * from './components/organisms/MriTable';
37
+ export * from './components/organisms/MriTopbar';
38
+ export * from './components/organisms/MriTopbar';
36
39
  export * from './components/organisms/MriKeyboardVisualizer';
40
+ export * from './components/organisms/MriPlayerScreenStream';
37
41
  export * from './lib/utils';