@mriqbox/ui-kit 4.2.0 → 4.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 +1 -1
- package/dist/components/atoms/MriSwitch.d.ts +25 -0
- package/dist/components/atoms/MriSwitch.stories.d.ts +9 -0
- package/dist/components/atoms/MriTextarea.d.ts +25 -0
- package/dist/components/atoms/MriTextarea.stories.d.ts +10 -0
- 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 +3 -0
- package/dist/index.es.js +1112 -974
- package/dist/index.umd.js +31 -31
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MriSwitchProps {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onCheckedChange: (checked: boolean) => void;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Tamanho do switch — `sm` (w-7 h-4) ou `default` (w-9 h-5). */
|
|
7
|
+
size?: 'sm' | 'default';
|
|
8
|
+
/** Texto pra screen readers (recomendado quando o switch nao tem label visivel). */
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Switch (toggle iOS-style). Wrapper sobre `<input type="checkbox">` com
|
|
15
|
+
* styling Tailwind via `peer`. Sem dep extra — funciona com a a11y nativa
|
|
16
|
+
* do checkbox HTML (screen readers anunciam estado via `aria-checked` que
|
|
17
|
+
* o navegador deriva do `checked`).
|
|
18
|
+
*
|
|
19
|
+
* Uso controlado:
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const [enabled, setEnabled] = useState(false)
|
|
22
|
+
* <MriSwitch checked={enabled} onCheckedChange={setEnabled} aria-label="Modo debug"/>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const MriSwitch: React.ForwardRefExoticComponent<MriSwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriSwitch } from './MriSwitch';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriSwitch>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<typeof MriSwitch>;
|
|
7
|
+
export declare const Small: StoryObj<typeof MriSwitch>;
|
|
8
|
+
export declare const Disabled: StoryObj<typeof MriSwitch>;
|
|
9
|
+
export declare const InForm: StoryObj<typeof MriSwitch>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MriTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
|
+
error?: boolean | string;
|
|
4
|
+
/** Hint visible abaixo do textarea (texto cinza, info contextual). */
|
|
5
|
+
hint?: string;
|
|
6
|
+
/**
|
|
7
|
+
* `auto` cresce com o conteudo (sem scrollbar interna). Default: `vertical`
|
|
8
|
+
* (user-resizable). `none` trava o tamanho.
|
|
9
|
+
*/
|
|
10
|
+
resize?: 'auto' | 'vertical' | 'none';
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Textarea estilizado consistente com `MriInput`. Mesmo border/focus/disabled,
|
|
14
|
+
* apenas altura adaptavel. Pra single-line use `MriInput`.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <MriTextarea
|
|
18
|
+
* value={text}
|
|
19
|
+
* onChange={(e) => setText(e.target.value)}
|
|
20
|
+
* rows={4}
|
|
21
|
+
* placeholder="Descreva a acao..."
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const MriTextarea: React.ForwardRefExoticComponent<MriTextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { MriTextarea } from './MriTextarea';
|
|
3
|
+
|
|
4
|
+
declare const meta: Meta<typeof MriTextarea>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<typeof MriTextarea>;
|
|
7
|
+
export declare const WithHint: StoryObj<typeof MriTextarea>;
|
|
8
|
+
export declare const WithError: StoryObj<typeof MriTextarea>;
|
|
9
|
+
export declare const AutoResize: StoryObj<typeof MriTextarea>;
|
|
10
|
+
export declare const NonResizable: StoryObj<typeof MriTextarea>;
|
|
@@ -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
|
@@ -9,6 +9,8 @@ export * from './components/atoms/MriStatusBadge';
|
|
|
9
9
|
export * from './components/atoms/mri-badge-variants';
|
|
10
10
|
export * from './components/atoms/mri-button-variants';
|
|
11
11
|
export * from './components/atoms/MriSpinner';
|
|
12
|
+
export * from './components/atoms/MriSwitch';
|
|
13
|
+
export * from './components/atoms/MriTextarea';
|
|
12
14
|
export * from './components/molecules/MriAccordion';
|
|
13
15
|
export * from './components/molecules/MriButtonGroup';
|
|
14
16
|
export * from './components/molecules/MriCard';
|
|
@@ -18,6 +20,7 @@ export * from './components/molecules/MriModal';
|
|
|
18
20
|
export * from './components/molecules/MriPopover';
|
|
19
21
|
export * from './components/molecules/MriSelect';
|
|
20
22
|
export * from './components/molecules/MriThemeToggle';
|
|
23
|
+
export * from './components/molecules/MriTabs';
|
|
21
24
|
export * from './components/molecules/MriTimePicker';
|
|
22
25
|
export * from './components/molecules/MriCommand';
|
|
23
26
|
export * from './components/molecules/MriCopyButton';
|