@qodo/design-system 0.20.0 → 0.20.2

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/dist/index.d.ts CHANGED
@@ -1,45 +1,34 @@
1
1
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
- import { ButtonProps as ButtonProps_2 } from '..';
3
- import { CheckboxGroupProps as CheckboxGroupProps_2 } from './types';
4
- import { CheckboxProps as CheckboxProps_2 } from '..';
5
2
  import { ClassProp } from 'class-variance-authority/types';
6
3
  import { ClassValue } from 'clsx';
7
4
  import { Column } from '@tanstack/react-table';
8
- import { ComboboxProps as ComboboxProps_2 } from './types';
9
5
  import { Control } from 'react-hook-form';
10
6
  import { default as default_2 } from 'react';
11
7
  import * as DialogPrimitive from '@radix-ui/react-dialog';
12
8
  import { Dispatch } from 'react';
13
9
  import { DropdownMenuContentProps } from '@radix-ui/react-dropdown-menu';
14
10
  import { FC } from 'react';
15
- import { FieldBaseProps } from './types';
16
11
  import { FieldValues } from 'react-hook-form';
17
12
  import { FormState } from 'react-hook-form';
18
13
  import { ForwardRefExoticComponent } from 'react';
19
14
  import { FunctionComponent } from 'react';
20
15
  import { HTMLAttributes } from 'react';
21
- import { InputProps as InputProps_2 } from './types';
22
16
  import { JSX as JSX_2 } from 'react/jsx-runtime';
23
17
  import { MouseEvent as MouseEvent_2 } from 'react';
24
18
  import * as ProgressPrimitive from '@radix-ui/react-progress';
25
19
  import { PropsWithChildren } from 'react';
26
- import { RadioGroupItemProps as RadioGroupItemProps_2 } from '..';
27
- import { RadioGroupProps as RadioGroupProps_2 } from './types';
28
20
  import * as React_2 from 'react';
29
21
  import { ReactNode } from 'react';
30
22
  import { RefAttributes } from 'react';
23
+ import { RegisterOptions } from 'react-hook-form';
31
24
  import { RowData } from '@tanstack/react-table';
32
25
  import * as SelectPrimitive from '@radix-ui/react-select';
33
- import { SelectProps as SelectProps_2 } from './types';
34
26
  import { SetStateAction } from 'react';
35
27
  import { Steps as Steps_2 } from '@ark-ui/react/steps';
36
28
  import { SubmitHandler } from 'react-hook-form';
37
29
  import * as SwitchPrimitive from '@radix-ui/react-switch';
38
30
  import { Table as Table_3 } from '@tanstack/react-table';
39
31
  import * as TabsPrimitive from '@radix-ui/react-tabs';
40
- import { TagsInputProps as TagsInputProps_2 } from '..';
41
- import { TextareaProps } from './types';
42
- import { TitleProps } from './types';
43
32
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
44
33
  import * as TogglePrimitive from '@radix-ui/react-toggle';
45
34
  import { TooltipContentProps } from '@radix-ui/react-tooltip';
@@ -203,6 +192,11 @@ export declare interface CheckboxGroupProps extends React.HTMLAttributes<HTMLDiv
203
192
  direction?: "horizontal" | "vertical";
204
193
  }
205
194
 
195
+ declare interface CheckboxGroupProps_2 extends Omit<CheckboxGroupProps, "name">, Omit<FieldBaseProps, "defaultValue"> {
196
+ readOnly?: boolean;
197
+ defaultValue?: string[];
198
+ }
199
+
206
200
  declare interface CheckboxGroupType extends TypeGuard<"CheckboxGroup"> {
207
201
  checkboxes: CheckboxItemType[];
208
202
  separator?: boolean;
@@ -294,6 +288,9 @@ export declare interface ComboboxProps {
294
288
  loadingText?: string;
295
289
  }
296
290
 
291
+ declare interface ComboboxProps_2 extends ComboboxProps, FieldBaseProps {
292
+ }
293
+
297
294
  export declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX_2.Element;
298
295
 
299
296
  export declare function DialogClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX_2.Element;
@@ -381,19 +378,34 @@ export declare type EmptyStateProps = {
381
378
  description?: string;
382
379
  };
383
380
 
381
+ /*********************
382
+ * Fields
383
+ *********************/
384
+ declare interface FieldBaseProps extends React.HTMLAttributes<HTMLDivElement> {
385
+ name: string;
386
+ label?: string;
387
+ description?: string;
388
+ placeholder?: string;
389
+ registerOptions?: RegisterOptions;
390
+ tooltip?: React.ReactNode;
391
+ error?: boolean;
392
+ required?: boolean;
393
+ disabled?: boolean;
394
+ }
395
+
384
396
  declare interface FooterItemType extends BaseMenuItemType {
385
397
  action?: () => void;
386
398
  }
387
399
 
388
400
  export declare const Form: {
389
401
  <T extends FieldValues>(props: FormProps<T>): JSX_2.Element;
390
- Button: ({ type, variant, ...rest }: ButtonProps_2) => JSX_2.Element;
402
+ Button: ({ type, variant, ...rest }: ButtonProps) => JSX_2.Element;
391
403
  Input: ForwardRefExoticComponent<Omit<InputProps_2, "ref"> & RefAttributes<HTMLInputElement>>;
392
404
  Select: (props: PropsWithChildren<SelectProps_2>) => JSX_2.Element;
393
405
  Combobox: (props: PropsWithChildren<ComboboxProps_2>) => JSX_2.Element;
394
406
  RadioGroup: (props: PropsWithChildren<RadioGroupProps_2>) => JSX_2.Element;
395
407
  RadioGroupItem: {
396
- ({ value, disabled, error, name, label, description, wrapperClassName, labelClassName, descriptionClassName, labelWrapperClassName, }: React.PropsWithChildren<RadioGroupItemProps_2>): JSX_2.Element;
408
+ ({ value, disabled, error, name, label, description, wrapperClassName, labelClassName, descriptionClassName, labelWrapperClassName, }: React.PropsWithChildren<RadioGroupItemProps>): JSX_2.Element;
397
409
  displayName: string;
398
410
  };
399
411
  Group: ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
@@ -402,12 +414,12 @@ export declare const Form: {
402
414
  Textarea: ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & RefAttributes<HTMLTextAreaElement>>;
403
415
  Divider: (props: React.HTMLAttributes<HTMLHRElement>) => JSX_2.Element;
404
416
  Title: ({ children, description, className }: TitleProps) => JSX_2.Element;
405
- TagsInput: (props: PropsWithChildren<FieldBaseProps & Omit<TagsInputProps_2, "value" | "onBlur" | "onChange"> & {
417
+ TagsInput: (props: PropsWithChildren<FieldBaseProps & Omit<TagsInputProps, "value" | "onBlur" | "onChange"> & {
406
418
  name: string;
407
419
  }>) => JSX_2.Element;
408
420
  CheckboxGroup: (props: PropsWithChildren<CheckboxGroupProps_2>) => JSX_2.Element;
409
421
  Checkbox: {
410
- ({ disabled, error, name, checked, onCheckedChange, label, description, labelWrapperClassName, labelClassName, descriptionClassName, checkboxClassName, wrapperClassName, }: React.PropsWithChildren<CheckboxProps_2>): JSX_2.Element;
422
+ ({ disabled, error, name, checked, onCheckedChange, label, description, labelWrapperClassName, labelClassName, descriptionClassName, checkboxClassName, wrapperClassName, }: React.PropsWithChildren<CheckboxProps>): JSX_2.Element;
411
423
  displayName: string;
412
424
  };
413
425
  };
@@ -479,6 +491,8 @@ export declare interface InputProps extends React_2.ComponentProps<"input">, Var
479
491
  error?: boolean;
480
492
  }
481
493
 
494
+ declare type InputProps_2 = InputProps & FieldBaseProps;
495
+
482
496
  declare const inputVariants: (props?: ({
483
497
  variant?: "default" | "secondary" | "ghost" | "accent" | "success" | "warning" | "destructive" | null | undefined;
484
498
  } & ClassProp) | undefined) => string;
@@ -515,17 +529,6 @@ export declare type LoadingSkeletonProps = {
515
529
  rowsCount?: number;
516
530
  };
517
531
 
518
- /**
519
- * A reusable markdown preview component that renders markdown content with consistent styling.
520
- * Can be used in textareas, forms, or any other component that needs markdown display.
521
- */
522
- export declare function MarkdownPreview({ content, className }: MarkdownPreviewProps): JSX_2.Element;
523
-
524
- declare type MarkdownPreviewProps = {
525
- content: string;
526
- className?: string;
527
- };
528
-
529
532
  declare interface MenuLabelType extends TypeGuard<"MenuLabel"> {
530
533
  label: ReactNode;
531
534
  }
@@ -605,6 +608,15 @@ export declare interface RadioGroupProps extends React.HTMLAttributes<HTMLDivEle
605
608
  direction?: "horizontal" | "vertical";
606
609
  }
607
610
 
611
+ declare interface RadioGroupProps_2 extends FieldBaseProps {
612
+ value?: string;
613
+ defaultValue?: string;
614
+ onValueChange?: (value: string) => void;
615
+ disabled?: boolean;
616
+ readOnly?: boolean;
617
+ direction?: "horizontal" | "vertical";
618
+ }
619
+
608
620
  declare interface RadioGroupType extends TypeGuard<"RadioGroup"> {
609
621
  value: string;
610
622
  onValueChange: (value: string) => void;
@@ -661,6 +673,12 @@ export declare const SelectLabel: React_2.ForwardRefExoticComponent<Omit<SelectP
661
673
 
662
674
  export declare type SelectProps = SingleSelectProps | MultipleSelectProps;
663
675
 
676
+ declare interface SelectProps_2 extends Omit<SelectProps, "value" | "onSelect" | "dir">, FieldBaseProps {
677
+ options: Option_2[];
678
+ value?: string[];
679
+ readOnly?: boolean;
680
+ }
681
+
664
682
  export declare const SelectScrollDownButton: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
665
683
 
666
684
  export declare const SelectScrollUpButton: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
@@ -813,11 +831,21 @@ export declare type TagSuggestionItemProps = {
813
831
  tagVariant?: BadgeProps["variant"];
814
832
  };
815
833
 
834
+ declare type TextareaProps = FieldBaseProps & React.ComponentProps<"textarea"> & {
835
+ variant?: "default" | "code";
836
+ };
837
+
816
838
  declare interface TitleHeaderContentType extends TypeGuard<"MenuTitleHeader"> {
817
839
  title: string;
818
840
  label: string;
819
841
  }
820
842
 
843
+ declare type TitleProps = {
844
+ children: React.ReactNode;
845
+ description?: string;
846
+ className?: string;
847
+ };
848
+
821
849
  export declare function Toggle({ className, variant, size, ...props }: React_2.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): JSX_2.Element;
822
850
 
823
851
  export declare function ToggleGroup({ className, variant, size, children, ...props }: React_2.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>): JSX_2.Element;