@qodo/design-system 0.2.0 → 0.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/dist/index.d.ts CHANGED
@@ -1,14 +1,40 @@
1
1
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
2
+ import { ButtonProps as ButtonProps_2 } from '..';
2
3
  import { ClassProp } from 'class-variance-authority/types';
3
4
  import { ClassValue } from 'clsx';
5
+ import { ComboboxProps as ComboboxProps_2 } from './types';
6
+ import { Control } from 'react-hook-form';
4
7
  import * as DialogPrimitive from '@radix-ui/react-dialog';
8
+ import { FieldValues } from 'react-hook-form';
9
+ import { FormState } from 'react-hook-form';
10
+ import { InputProps as InputProps_2 } from './types';
5
11
  import { JSX } from 'react/jsx-runtime';
6
12
  import * as ProgressPrimitive from '@radix-ui/react-progress';
13
+ import { PropsWithChildren } from 'react';
7
14
  import * as React_2 from 'react';
15
+ import * as SelectPrimitive from '@radix-ui/react-select';
16
+ import { SelectProps } from './types';
17
+ import { SubmitHandler } from 'react-hook-form';
8
18
  import * as SwitchPrimitive from '@radix-ui/react-switch';
19
+ import { TitleProps } from './types';
9
20
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
10
21
  import * as TogglePrimitive from '@radix-ui/react-toggle';
11
22
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
23
+ import { UseFormClearErrors } from 'react-hook-form';
24
+ import { UseFormGetFieldState } from 'react-hook-form';
25
+ import { UseFormGetValues } from 'react-hook-form';
26
+ import { UseFormHandleSubmit } from 'react-hook-form';
27
+ import { UseFormRegister } from 'react-hook-form';
28
+ import { UseFormReset } from 'react-hook-form';
29
+ import { UseFormResetField } from 'react-hook-form';
30
+ import { UseFormReturn } from 'react-hook-form';
31
+ import { UseFormSetError } from 'react-hook-form';
32
+ import { UseFormSetFocus } from 'react-hook-form';
33
+ import { UseFormSetValue } from 'react-hook-form';
34
+ import { UseFormSubscribe } from 'react-hook-form';
35
+ import { UseFormTrigger } from 'react-hook-form';
36
+ import { UseFormUnregister } from 'react-hook-form';
37
+ import { UseFormWatch } from 'react-hook-form';
12
38
  import { VariantProps } from 'class-variance-authority';
13
39
 
14
40
  export declare function Accordion({ ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Root>): JSX.Element;
@@ -24,7 +50,7 @@ export declare function Badge({ className, variant, asChild, ...props }: React_2
24
50
  }): JSX.Element;
25
51
 
26
52
  declare const badgeVariants: (props?: ({
27
- variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
53
+ variant?: "default" | "destructive" | "outline" | "secondary" | "success" | null | undefined;
28
54
  } & ClassProp) | undefined) => string;
29
55
 
30
56
  export declare const borderRadius: {
@@ -87,6 +113,25 @@ export declare const colors: {
87
113
  };
88
114
  };
89
115
 
116
+ export declare const Combobox: React_2.ForwardRefExoticComponent<ComboboxProps & React_2.RefAttributes<HTMLButtonElement>>;
117
+
118
+ export declare interface ComboboxOption {
119
+ value: string;
120
+ label: string;
121
+ disabled?: boolean;
122
+ }
123
+
124
+ export declare interface ComboboxProps {
125
+ options: ComboboxOption[];
126
+ value?: string;
127
+ onValueChange?: (value: string) => void;
128
+ placeholder?: string;
129
+ searchPlaceholder?: string;
130
+ emptyText?: string;
131
+ disabled?: boolean;
132
+ className?: string;
133
+ }
134
+
90
135
  export declare function Dialog({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Root>): JSX.Element;
91
136
 
92
137
  export declare function DialogClose({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Close>): JSX.Element;
@@ -109,6 +154,34 @@ export declare function DialogTitle({ className, ...props }: React_2.ComponentPr
109
154
 
110
155
  export declare function DialogTrigger({ ...props }: React_2.ComponentProps<typeof DialogPrimitive.Trigger>): JSX.Element;
111
156
 
157
+ export declare const Form: {
158
+ <T extends FieldValues>(props: FormProps<T>): JSX.Element;
159
+ Button: ({ type, ...rest }: ButtonProps_2) => JSX.Element;
160
+ Input: (props: InputProps_2) => JSX.Element;
161
+ Select: (props: SelectProps) => JSX.Element;
162
+ Combobox: (props: ComboboxProps_2) => JSX.Element;
163
+ Divider: (props: React.HTMLAttributes<HTMLHRElement>) => JSX.Element;
164
+ Title: ({ children, description, className }: TitleProps) => JSX.Element;
165
+ };
166
+
167
+ declare type FormProps<T extends FieldValues> = PropsWithChildren<{
168
+ className?: string;
169
+ methods: UseFormReturn<T>;
170
+ onSubmit: SubmitHandler<T>;
171
+ required?: boolean;
172
+ disabled?: boolean;
173
+ readOnly?: boolean;
174
+ }>;
175
+
176
+ export declare const FormProvider: <T extends FieldValues>(props: FormProviderProps<T>) => JSX.Element;
177
+
178
+ declare type FormProviderProps<T extends FieldValues> = PropsWithChildren<{
179
+ methods: UseFormReturn<T>;
180
+ required?: boolean;
181
+ disabled?: boolean;
182
+ readOnly?: boolean;
183
+ }>;
184
+
112
185
  export declare function Input({ className, variant, type, ...props }: InputProps): JSX.Element;
113
186
 
114
187
  export declare interface InputProps extends React_2.ComponentProps<"input">, VariantProps<typeof inputVariants> {
@@ -120,6 +193,26 @@ declare const inputVariants: (props?: ({
120
193
 
121
194
  export declare function Progress({ className, value, ...props }: React_2.ComponentProps<typeof ProgressPrimitive.Root>): JSX.Element;
122
195
 
196
+ export declare const Select: React_2.FC<SelectPrimitive.SelectProps>;
197
+
198
+ export declare const SelectContent: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
199
+
200
+ export declare const SelectGroup: React_2.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React_2.RefAttributes<HTMLDivElement>>;
201
+
202
+ export declare const SelectItem: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
203
+
204
+ export declare const SelectLabel: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
205
+
206
+ export declare const SelectScrollDownButton: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
207
+
208
+ export declare const SelectScrollUpButton: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
209
+
210
+ export declare const SelectSeparator: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
211
+
212
+ export declare const SelectTrigger: React_2.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
213
+
214
+ export declare const SelectValue: React_2.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React_2.RefAttributes<HTMLSpanElement>>;
215
+
123
216
  export declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
124
217
 
125
218
  export declare const spacing: {
@@ -167,4 +260,29 @@ export declare const typography: {
167
260
  };
168
261
  };
169
262
 
263
+ /**
264
+ * This hook is used to get the merged form context: react-hook-form context and the FormProvider custom context
265
+ * @returns The form context and the react-hook-form context
266
+ */
267
+ export declare const useFormContext: () => {
268
+ watch: UseFormWatch<FieldValues>;
269
+ getValues: UseFormGetValues<FieldValues>;
270
+ getFieldState: UseFormGetFieldState<FieldValues>;
271
+ setError: UseFormSetError<FieldValues>;
272
+ clearErrors: UseFormClearErrors<FieldValues>;
273
+ setValue: UseFormSetValue<FieldValues>;
274
+ trigger: UseFormTrigger<FieldValues>;
275
+ formState: FormState<FieldValues>;
276
+ resetField: UseFormResetField<FieldValues>;
277
+ reset: UseFormReset<FieldValues>;
278
+ handleSubmit: UseFormHandleSubmit<FieldValues, FieldValues>;
279
+ unregister: UseFormUnregister<FieldValues>;
280
+ control: Control<FieldValues, any, FieldValues>;
281
+ register: UseFormRegister<FieldValues>;
282
+ setFocus: UseFormSetFocus<FieldValues>;
283
+ subscribe: UseFormSubscribe<FieldValues>;
284
+ disabled?: boolean;
285
+ readOnly?: boolean;
286
+ };
287
+
170
288
  export { }