@mriqbox/ui-kit 4.2.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/index.d.ts +1 -0
- package/dist/index.es.js +289 -239
- package/dist/index.umd.js +7 -7
- 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>;
|
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';
|