@mriqbox/ui-kit 3.3.2 → 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 +4 -1
- package/dist/components/atoms/MriScrollArea.stories.d.ts +8 -0
- package/dist/components/molecules/MriPlayerVitals.d.ts +26 -0
- package/dist/components/molecules/MriPlayerVitals.stories.d.ts +10 -0
- package/dist/components/molecules/MriVitalAdjustModal.d.ts +19 -0
- package/dist/components/molecules/MriVitalAdjustModal.stories.d.ts +11 -0
- package/dist/components/organisms/MriPlayerScreenStream.d.ts +41 -0
- package/dist/components/organisms/MriPlayerScreenStream.stories.d.ts +9 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +4209 -3656
- package/dist/index.umd.js +119 -38
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -51,6 +51,8 @@ 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',
|
|
@@ -59,6 +61,7 @@ const COMPONENT_MAP = {
|
|
|
59
61
|
'MriSidebar': 'organisms',
|
|
60
62
|
'MriTopbar': 'organisms',
|
|
61
63
|
'MriTable': 'organisms',
|
|
64
|
+
'MriPlayerScreenStream': 'organisms',
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
function toPascalCase(str) {
|
|
@@ -174,7 +177,7 @@ async function checkDependencies(filePath, installDir) {
|
|
|
174
177
|
program
|
|
175
178
|
.name('mri-ui')
|
|
176
179
|
.description('Add Mri UI components to your project')
|
|
177
|
-
.version('3.
|
|
180
|
+
.version('3.4.0');
|
|
178
181
|
|
|
179
182
|
program
|
|
180
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;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,10 +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
37
|
export * from './components/organisms/MriTopbar';
|
|
36
|
-
export * from './components/organisms/
|
|
38
|
+
export * from './components/organisms/MriTopbar';
|
|
37
39
|
export * from './components/organisms/MriKeyboardVisualizer';
|
|
40
|
+
export * from './components/organisms/MriPlayerScreenStream';
|
|
38
41
|
export * from './lib/utils';
|