@mriqbox/ui-kit 4.3.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 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.3.0');
185
+ .version('4.4.0');
186
186
 
187
187
  program
188
188
  .command('add <component>')
@@ -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>;
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';