@mriqbox/ui-kit 4.1.0 → 4.3.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 +1 -1
- package/dist/components/molecules/MriTabs.d.ts +40 -0
- package/dist/components/molecules/MriTabs.stories.d.ts +9 -0
- package/dist/components/templates/MriDashboardLayout.d.ts +8 -1
- package/dist/components/templates/MriDashboardLayout.stories.d.ts +11 -0
- package/dist/components/templates/MriTabletFrame.d.ts +46 -0
- package/dist/components/templates/MriTabletFrame.stories.d.ts +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +354 -270
- package/dist/index.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MriTabsItem {
|
|
4
|
+
label: string;
|
|
5
|
+
route: string;
|
|
6
|
+
icon?: ElementType;
|
|
7
|
+
/** Badge opcional na direita (count, status, etc). */
|
|
8
|
+
badge?: ReactNode;
|
|
9
|
+
/** Desabilita o tab — mostra mas nao clicavel. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface MriTabsProps {
|
|
13
|
+
items: MriTabsItem[];
|
|
14
|
+
activeRoute?: string;
|
|
15
|
+
onNavigate?: (route: string) => void;
|
|
16
|
+
/** Conteudo extra alinhado a direita do tab strip (ex: action button). */
|
|
17
|
+
rightContent?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sub-navegacao horizontal pra dividir uma pagina em abas. Uso tipico:
|
|
22
|
+
* pagina de admin com varias seccoes que nao merecem item proprio no
|
|
23
|
+
* sidebar do app. Funciona standalone OU dentro de iframe embedded — nao
|
|
24
|
+
* conflita com o sidebar do host.
|
|
25
|
+
*
|
|
26
|
+
* Visual: linha de tabs com underline animado no ativo (estilo
|
|
27
|
+
* GitHub/Linear/Stripe). Light weight — sem bg-card, sem h-16, so border-b.
|
|
28
|
+
*
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <MriTabs
|
|
31
|
+
* items={[
|
|
32
|
+
* { label: 'Spawns', icon: MapPin, route: 'spawns' },
|
|
33
|
+
* { label: 'Settings', icon: Settings, route: 'config' },
|
|
34
|
+
* ]}
|
|
35
|
+
* activeRoute={route}
|
|
36
|
+
* onNavigate={setRoute}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function MriTabs({ items, activeRoute, onNavigate, rightContent, className, }: MriTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriTabs } from './MriTabs';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriTabs>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<typeof MriTabs>;
|
|
7
|
+
export declare const WithBadges_: StoryObj<typeof MriTabs>;
|
|
8
|
+
export declare const WithRightAction_: StoryObj<typeof MriTabs>;
|
|
9
|
+
export declare const WithDisabled_: StoryObj<typeof MriTabs>;
|
|
@@ -6,6 +6,13 @@ export interface MriDashboardLayoutProps {
|
|
|
6
6
|
sidebar?: ReactNode;
|
|
7
7
|
topbar?: ReactNode;
|
|
8
8
|
header?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Sub-navegacao da pagina (entre header e main). Tipico: <MriTabs/>,
|
|
11
|
+
* breadcrumbs, segmented control. Layout so reserva o espaco — content
|
|
12
|
+
* fica a cargo do consumer. Diferente do `header` semanticamente: header
|
|
13
|
+
* e titulo+acoes da pagina, subnav e navegacao entre subsessoes.
|
|
14
|
+
*/
|
|
15
|
+
subnav?: ReactNode;
|
|
9
16
|
footer?: ReactNode;
|
|
10
17
|
children?: ReactNode;
|
|
11
18
|
sidebarPosition?: MriDashboardSidebarPosition;
|
|
@@ -14,4 +21,4 @@ export interface MriDashboardLayoutProps {
|
|
|
14
21
|
contentClassName?: string;
|
|
15
22
|
mainClassName?: string;
|
|
16
23
|
}
|
|
17
|
-
export declare function MriDashboardLayout({ sidebar, topbar, header, footer, children, sidebarPosition, topbarPlacement, className, contentClassName, mainClassName, }: MriDashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function MriDashboardLayout({ sidebar, topbar, header, subnav, footer, children, sidebarPosition, topbarPlacement, className, contentClassName, mainClassName, }: MriDashboardLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,3 +6,14 @@ export default meta;
|
|
|
6
6
|
export declare const Default: StoryObj<typeof MriDashboardLayout>;
|
|
7
7
|
export declare const TopbarBelow: StoryObj<typeof MriDashboardLayout>;
|
|
8
8
|
export declare const SidebarRightWithFooter: StoryObj<typeof MriDashboardLayout>;
|
|
9
|
+
export declare const WithSubnav_: StoryObj<typeof MriDashboardLayout>;
|
|
10
|
+
type PlaygroundArgs = {
|
|
11
|
+
showSidebar: boolean;
|
|
12
|
+
showHeader: boolean;
|
|
13
|
+
showSubnav: boolean;
|
|
14
|
+
showFooter: boolean;
|
|
15
|
+
showTopbar: boolean;
|
|
16
|
+
sidebarPosition: 'left' | 'right';
|
|
17
|
+
topbarPlacement: 'aside' | 'below';
|
|
18
|
+
};
|
|
19
|
+
export declare const Playground_: StoryObj<PlaygroundArgs>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type MriTabletFrameSize = 'sm' | 'md' | 'lg' | 'fullscreen';
|
|
4
|
+
export interface MriTabletFrameProps {
|
|
5
|
+
/** Conteudo do tablet — geralmente um <MriDashboardLayout> ou panel custom. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Toggle de visibilidade. `false` usa display:none ao inves de unmount —
|
|
9
|
+
* preserva state interno (eg. video streamers, redux store) entre toggles.
|
|
10
|
+
*/
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Zoom user-controlled (0-200, default 100). Aplicado via CSS transform
|
|
14
|
+
* scale a partir do centro — nao afeta layout interno.
|
|
15
|
+
*/
|
|
16
|
+
scale?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Preset de tamanho. Cada um combina porcentagem (responsivo) com max
|
|
19
|
+
* absoluto (clamp em telas grandes / 4K) e min absoluto (anti-colapso).
|
|
20
|
+
*
|
|
21
|
+
* - sm: ~80% até 1100x700, min 900x550
|
|
22
|
+
* - md: ~85% até 1400x900, min 1000x600 (default)
|
|
23
|
+
* - lg: ~90% até 1700x1080, min 1100x700
|
|
24
|
+
* - fullscreen: 100% sem border/radius (debug ou caso edge)
|
|
25
|
+
*/
|
|
26
|
+
size?: MriTabletFrameSize;
|
|
27
|
+
/** Classes extras pro frame externo (sobrepoe sizing/border se necessario). */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Frame de tablet centralizado pra UIs FiveM. O body do consumer precisa de
|
|
32
|
+
* `background: transparent` pra deixar o jogo aparecer ao redor — nao da
|
|
33
|
+
* pra forcar isso de dentro do componente.
|
|
34
|
+
*
|
|
35
|
+
* Composivel com qualquer conteudo, mas o caso primario e envolver um
|
|
36
|
+
* <MriDashboardLayout>:
|
|
37
|
+
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <MriTabletFrame size="md" visible={uiOpen} scale={userZoom}>
|
|
40
|
+
* <MriDashboardLayout sidebar={...} header={...}>
|
|
41
|
+
* {children}
|
|
42
|
+
* </MriDashboardLayout>
|
|
43
|
+
* </MriTabletFrame>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare function MriTabletFrame({ children, visible, scale, size, className, }: MriTabletFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriTabletFrame } from './MriTabletFrame';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriTabletFrame>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<typeof MriTabletFrame>;
|
|
7
|
+
export declare const Small: StoryObj<typeof MriTabletFrame>;
|
|
8
|
+
export declare const Large: StoryObj<typeof MriTabletFrame>;
|
|
9
|
+
export declare const Fullscreen: StoryObj<typeof MriTabletFrame>;
|
|
10
|
+
export declare const WithUserScale: StoryObj<typeof MriTabletFrame>;
|
|
11
|
+
export declare const Toggle: StoryObj<typeof MriTabletFrame>;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './components/molecules/MriModal';
|
|
|
18
18
|
export * from './components/molecules/MriPopover';
|
|
19
19
|
export * from './components/molecules/MriSelect';
|
|
20
20
|
export * from './components/molecules/MriThemeToggle';
|
|
21
|
+
export * from './components/molecules/MriTabs';
|
|
21
22
|
export * from './components/molecules/MriTimePicker';
|
|
22
23
|
export * from './components/molecules/MriCommand';
|
|
23
24
|
export * from './components/molecules/MriCopyButton';
|
|
@@ -39,4 +40,5 @@ export * from './components/organisms/MriTopbar';
|
|
|
39
40
|
export * from './components/organisms/MriKeyboardVisualizer';
|
|
40
41
|
export * from './components/organisms/MriPlayerScreenStream';
|
|
41
42
|
export * from './components/templates/MriDashboardLayout';
|
|
43
|
+
export * from './components/templates/MriTabletFrame';
|
|
42
44
|
export * from './lib/utils';
|