@mriqbox/ui-kit 4.4.0 → 4.5.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
@@ -182,7 +182,7 @@ async function checkDependencies(filePath, installDir) {
182
182
  program
183
183
  .name('mri-ui')
184
184
  .description('Add Mri UI components to your project')
185
- .version('4.4.0');
185
+ .version('4.5.0');
186
186
 
187
187
  program
188
188
  .command('add <component>')
@@ -0,0 +1,41 @@
1
+ import { ElementType } from 'react';
2
+ import * as React from 'react';
3
+ export type MriIconToggleButtonVariant = 'primary' | 'destructive';
4
+ export type MriIconToggleButtonSize = 'sm' | 'default';
5
+ export interface MriIconToggleButtonProps {
6
+ /** Estado on/off. */
7
+ active: boolean;
8
+ onClick: () => void;
9
+ /** Icone lucide (ou qualquer ElementType de svg). */
10
+ icon: ElementType;
11
+ /** Tooltip nativo via `title`. */
12
+ title?: string;
13
+ /** Cor do estado ativo. Default `primary`. `destructive` pra toggles "perigosos" (ex: muteCategory). */
14
+ variant?: MriIconToggleButtonVariant;
15
+ /** Tamanho. `sm` (28px) ou `default` (36px). */
16
+ size?: MriIconToggleButtonSize;
17
+ disabled?: boolean;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Botao toggle com icone — UI compacta pra ligar/desligar uma opcao.
22
+ * Diferente de `MriSwitch` (que e label+switch horizontal): este e um
23
+ * quadrado com icone que muda de cor quando ativo. Util em filtros, tabelas
24
+ * com colunas toggle, configuracoes densas.
25
+ *
26
+ * Estados:
27
+ * - active=true (variant=primary): fundo primary/15, icone primary
28
+ * - active=true (variant=destructive): fundo destructive/15, icone destructive
29
+ * - active=false: muted background no hover, icone esmaecido
30
+ * - disabled: opacidade 40%, sem hover
31
+ *
32
+ * ```tsx
33
+ * <MriIconToggleButton
34
+ * active={cat.enabled}
35
+ * onClick={() => toggle(cat.id)}
36
+ * icon={Database}
37
+ * title="Salvar no DB"
38
+ * />
39
+ * ```
40
+ */
41
+ export declare const MriIconToggleButton: React.FC<MriIconToggleButtonProps>;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriIconToggleButton } from './MriIconToggleButton';
3
+
4
+ declare const meta: Meta<typeof MriIconToggleButton>;
5
+ export default meta;
6
+ export declare const Default: StoryObj<typeof MriIconToggleButton>;
7
+ export declare const Variants: StoryObj<typeof MriIconToggleButton>;
8
+ export declare const Sizes: StoryObj<typeof MriIconToggleButton>;
9
+ export declare const Disabled: StoryObj<typeof MriIconToggleButton>;
10
+ export declare const InCategoryRow: StoryObj<typeof MriIconToggleButton>;
@@ -0,0 +1,28 @@
1
+ import { default as React } from 'react';
2
+
3
+ export interface MriExpandableSearchProps {
4
+ value: string;
5
+ onChange: (val: string) => void;
6
+ placeholder?: string;
7
+ /** Largura quando expandido. Default: `w-64` (256px). */
8
+ expandedWidth?: string;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * Search bar compacta — inicialmente colapsada como botao de icone (40x40),
13
+ * expande ao clicar e foca o input. Auto-colapsa no blur se o valor estiver
14
+ * vazio. ESC blura e colapsa.
15
+ *
16
+ * Util em headers de paginas admin onde a busca e secundaria — economiza
17
+ * espaco horizontal vs uma search bar sempre expandida.
18
+ *
19
+ * ```tsx
20
+ * const [query, setQuery] = useState('')
21
+ * <MriExpandableSearch
22
+ * value={query}
23
+ * onChange={setQuery}
24
+ * placeholder="Buscar jogador..."
25
+ * />
26
+ * ```
27
+ */
28
+ export declare const MriExpandableSearch: React.FC<MriExpandableSearchProps>;
@@ -0,0 +1,9 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { MriExpandableSearch } from './MriExpandableSearch';
3
+
4
+ declare const meta: Meta<typeof MriExpandableSearch>;
5
+ export default meta;
6
+ export declare const Default: StoryObj<typeof MriExpandableSearch>;
7
+ export declare const InsideHeader: StoryObj<typeof MriExpandableSearch>;
8
+ export declare const PreFilled_: StoryObj<typeof MriExpandableSearch>;
9
+ export declare const CustomExpandedWidth: StoryObj<typeof MriExpandableSearch>;
package/dist/index.d.ts CHANGED
@@ -11,10 +11,12 @@ export * from './components/atoms/mri-button-variants';
11
11
  export * from './components/atoms/MriSpinner';
12
12
  export * from './components/atoms/MriSwitch';
13
13
  export * from './components/atoms/MriTextarea';
14
+ export * from './components/atoms/MriIconToggleButton';
14
15
  export * from './components/molecules/MriAccordion';
15
16
  export * from './components/molecules/MriButtonGroup';
16
17
  export * from './components/molecules/MriCard';
17
18
  export * from './components/molecules/MriCompactSearch';
19
+ export * from './components/molecules/MriExpandableSearch';
18
20
  export * from './components/molecules/MriDialog';
19
21
  export * from './components/molecules/MriModal';
20
22
  export * from './components/molecules/MriPopover';