@alpic-ai/ui 0.0.0-dev.fffc79a → 0.0.0-dev.g00dcac1

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.
Files changed (75) hide show
  1. package/dist/components/accordion-card.d.mts +5 -6
  2. package/dist/components/accordion.d.mts +5 -6
  3. package/dist/components/alert.d.mts +9 -11
  4. package/dist/components/attachment-tile.d.mts +1 -3
  5. package/dist/components/avatar.d.mts +8 -10
  6. package/dist/components/badge.d.mts +2 -4
  7. package/dist/components/breadcrumb.d.mts +10 -11
  8. package/dist/components/button.d.mts +6 -8
  9. package/dist/components/card.d.mts +9 -10
  10. package/dist/components/checkbox.d.mts +2 -3
  11. package/dist/components/collapsible.d.mts +4 -5
  12. package/dist/components/combobox.d.mts +12 -11
  13. package/dist/components/combobox.mjs +7 -4
  14. package/dist/components/command.d.mts +9 -10
  15. package/dist/components/copyable.d.mts +2 -3
  16. package/dist/components/description-list.d.mts +5 -6
  17. package/dist/components/dialog.d.mts +15 -17
  18. package/dist/components/dropdown-menu.d.mts +18 -20
  19. package/dist/components/form.d.mts +71 -19
  20. package/dist/components/form.mjs +120 -10
  21. package/dist/components/github-button.d.mts +1 -2
  22. package/dist/components/input-group.d.mts +5 -7
  23. package/dist/components/input.d.mts +4 -5
  24. package/dist/components/input.mjs +2 -2
  25. package/dist/components/label.d.mts +2 -3
  26. package/dist/components/page-loader.d.mts +1 -3
  27. package/dist/components/pagination.d.mts +3 -4
  28. package/dist/components/popover.d.mts +5 -6
  29. package/dist/components/radio-group.d.mts +3 -4
  30. package/dist/components/scroll-area.d.mts +3 -4
  31. package/dist/components/select-trigger-variants.d.mts +1 -3
  32. package/dist/components/select.d.mts +9 -10
  33. package/dist/components/separator.d.mts +2 -3
  34. package/dist/components/sheet.d.mts +11 -12
  35. package/dist/components/shimmer-text.d.mts +12 -0
  36. package/dist/components/shimmer-text.mjs +22 -0
  37. package/dist/components/sidebar.d.mts +34 -36
  38. package/dist/components/sidebar.mjs +10 -10
  39. package/dist/components/skeleton.d.mts +2 -4
  40. package/dist/components/sonner.d.mts +5 -6
  41. package/dist/components/spinner.d.mts +3 -5
  42. package/dist/components/status-dot.d.mts +2 -4
  43. package/dist/components/switch.d.mts +2 -3
  44. package/dist/components/table.d.mts +10 -11
  45. package/dist/components/table.mjs +3 -3
  46. package/dist/components/tabs.d.mts +12 -14
  47. package/dist/components/tabs.mjs +4 -4
  48. package/dist/components/tag.d.mts +3 -5
  49. package/dist/components/task-progress.d.mts +25 -0
  50. package/dist/components/task-progress.mjs +66 -0
  51. package/dist/components/textarea.d.mts +3 -4
  52. package/dist/components/textarea.mjs +2 -2
  53. package/dist/components/toggle-group.d.mts +4 -6
  54. package/dist/components/toggle-group.mjs +3 -3
  55. package/dist/components/tooltip-icon-button.d.mts +1 -2
  56. package/dist/components/tooltip.d.mts +5 -6
  57. package/dist/components/tooltip.mjs +1 -1
  58. package/dist/components/typography.d.mts +4 -5
  59. package/dist/components/wizard.d.mts +33 -0
  60. package/dist/components/wizard.mjs +46 -0
  61. package/dist/hooks/use-mobile.mjs +3 -3
  62. package/package.json +30 -30
  63. package/src/components/combobox.tsx +9 -2
  64. package/src/components/form.tsx +164 -3
  65. package/src/components/shimmer-text.tsx +23 -0
  66. package/src/components/table.tsx +2 -3
  67. package/src/components/tabs.tsx +4 -4
  68. package/src/components/task-progress.tsx +107 -0
  69. package/src/components/tooltip.tsx +1 -1
  70. package/src/components/wizard.tsx +69 -0
  71. package/src/stories/form.stories.tsx +64 -2
  72. package/src/stories/tabs.stories.tsx +4 -2
  73. package/src/stories/task-progress.stories.tsx +81 -0
  74. package/src/stories/wizard.stories.tsx +64 -0
  75. package/src/styles/tokens.css +11 -4
@@ -1,28 +1,26 @@
1
1
  import { ButtonProps } from "./button.mjs";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
2
  import { VariantProps } from "class-variance-authority";
4
- import * as React from "react";
3
+ import * as React$1 from "react";
5
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
6
- import * as _$class_variance_authority_types0 from "class-variance-authority/types";
7
5
 
8
6
  //#region src/components/dialog.d.ts
9
7
  declare function Dialog({
10
8
  ...props
11
- }: React.ComponentProps<typeof DialogPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
9
+ }: React$1.ComponentProps<typeof DialogPrimitive.Root>): React$1.JSX.Element;
12
10
  declare function DialogTrigger({
13
11
  ...props
14
- }: React.ComponentProps<typeof DialogPrimitive.Trigger>): _$react_jsx_runtime0.JSX.Element;
12
+ }: React$1.ComponentProps<typeof DialogPrimitive.Trigger>): React$1.JSX.Element;
15
13
  declare function DialogPortal({
16
14
  ...props
17
- }: React.ComponentProps<typeof DialogPrimitive.Portal>): _$react_jsx_runtime0.JSX.Element;
15
+ }: React$1.ComponentProps<typeof DialogPrimitive.Portal>): React$1.JSX.Element;
18
16
  declare function DialogOverlay({
19
17
  className,
20
18
  ...props
21
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>): _$react_jsx_runtime0.JSX.Element;
19
+ }: React$1.ComponentProps<typeof DialogPrimitive.Overlay>): React$1.JSX.Element;
22
20
  declare const dialogContentVariants: (props?: ({
23
21
  size?: "sm" | "lg" | null | undefined;
24
- } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
25
- interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive.Content>, VariantProps<typeof dialogContentVariants> {
22
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
23
+ interface DialogContentProps extends React$1.ComponentProps<typeof DialogPrimitive.Content>, VariantProps<typeof dialogContentVariants> {
26
24
  showCloseButton?: boolean;
27
25
  }
28
26
  declare function DialogContent({
@@ -31,31 +29,31 @@ declare function DialogContent({
31
29
  size,
32
30
  showCloseButton,
33
31
  ...props
34
- }: DialogContentProps): _$react_jsx_runtime0.JSX.Element;
32
+ }: DialogContentProps): React$1.JSX.Element;
35
33
  declare function DialogHeader({
36
34
  className,
37
35
  ...props
38
- }: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
36
+ }: React$1.ComponentProps<"div">): React$1.JSX.Element;
39
37
  declare const dialogFooterVariants: (props?: ({
40
38
  layout?: "horizontal" | "vertical" | null | undefined;
41
- } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
42
- interface DialogFooterProps extends React.ComponentProps<"div">, VariantProps<typeof dialogFooterVariants> {}
39
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
40
+ interface DialogFooterProps extends React$1.ComponentProps<"div">, VariantProps<typeof dialogFooterVariants> {}
43
41
  declare function DialogFooter({
44
42
  className,
45
43
  layout,
46
44
  ...props
47
- }: DialogFooterProps): _$react_jsx_runtime0.JSX.Element;
45
+ }: DialogFooterProps): React$1.JSX.Element;
48
46
  declare function DialogTitle({
49
47
  className,
50
48
  ...props
51
- }: React.ComponentProps<typeof DialogPrimitive.Title>): _$react_jsx_runtime0.JSX.Element;
49
+ }: React$1.ComponentProps<typeof DialogPrimitive.Title>): React$1.JSX.Element;
52
50
  declare function DialogClose({
53
51
  children,
54
52
  ...props
55
- }: Omit<ButtonProps, "variant" | "asChild">): _$react_jsx_runtime0.JSX.Element;
53
+ }: Omit<ButtonProps, "variant" | "asChild">): React$1.JSX.Element;
56
54
  declare function DialogDescription({
57
55
  className,
58
56
  ...props
59
- }: React.ComponentProps<typeof DialogPrimitive.Description>): _$react_jsx_runtime0.JSX.Element;
57
+ }: React$1.ComponentProps<typeof DialogPrimitive.Description>): React$1.JSX.Element;
60
58
  //#endregion
61
59
  export { Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, type DialogFooterProps, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogContentVariants, dialogFooterVariants };
@@ -1,72 +1,70 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
1
  import { VariantProps } from "class-variance-authority";
3
- import * as React from "react";
2
+ import * as React$1 from "react";
4
3
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
5
- import * as _$class_variance_authority_types0 from "class-variance-authority/types";
6
4
 
7
5
  //#region src/components/dropdown-menu.d.ts
8
6
  declare function DropdownMenu({
9
7
  ...props
10
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
8
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Root>): React$1.JSX.Element;
11
9
  declare function DropdownMenuPortal({
12
10
  ...props
13
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): _$react_jsx_runtime0.JSX.Element;
11
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React$1.JSX.Element;
14
12
  declare function DropdownMenuTrigger({
15
13
  ...props
16
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): _$react_jsx_runtime0.JSX.Element;
14
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React$1.JSX.Element;
17
15
  declare function DropdownMenuContent({
18
16
  className,
19
17
  sideOffset,
20
18
  ...props
21
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): _$react_jsx_runtime0.JSX.Element;
19
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Content>): React$1.JSX.Element;
22
20
  declare function DropdownMenuGroup({
23
21
  ...props
24
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): _$react_jsx_runtime0.JSX.Element;
22
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Group>): React$1.JSX.Element;
25
23
  declare const dropdownMenuItemVariants: (props?: ({
26
24
  variant?: "default" | "destructive" | null | undefined;
27
- } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
25
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
28
26
  declare function DropdownMenuItem({
29
27
  className,
30
28
  inset,
31
29
  variant,
32
30
  ...props
33
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & VariantProps<typeof dropdownMenuItemVariants> & {
31
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Item> & VariantProps<typeof dropdownMenuItemVariants> & {
34
32
  inset?: boolean;
35
- }): _$react_jsx_runtime0.JSX.Element;
33
+ }): React$1.JSX.Element;
36
34
  declare function DropdownMenuLabel({
37
35
  className,
38
36
  inset,
39
37
  ...props
40
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
38
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
41
39
  inset?: boolean;
42
- }): _$react_jsx_runtime0.JSX.Element;
40
+ }): React$1.JSX.Element;
43
41
  declare function DropdownMenuHeader({
44
42
  className,
45
43
  children,
46
44
  ...props
47
- }: React.HTMLAttributes<HTMLDivElement>): _$react_jsx_runtime0.JSX.Element;
45
+ }: React$1.HTMLAttributes<HTMLDivElement>): React$1.JSX.Element;
48
46
  declare function DropdownMenuSeparator({
49
47
  className,
50
48
  ...props
51
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): _$react_jsx_runtime0.JSX.Element;
49
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React$1.JSX.Element;
52
50
  declare function DropdownMenuShortcut({
53
51
  className,
54
52
  ...props
55
- }: React.ComponentProps<"span">): _$react_jsx_runtime0.JSX.Element;
53
+ }: React$1.ComponentProps<"span">): React$1.JSX.Element;
56
54
  declare function DropdownMenuSub({
57
55
  ...props
58
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): _$react_jsx_runtime0.JSX.Element;
56
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React$1.JSX.Element;
59
57
  declare function DropdownMenuSubTrigger({
60
58
  className,
61
59
  inset,
62
60
  children,
63
61
  ...props
64
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
62
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
65
63
  inset?: boolean;
66
- }): _$react_jsx_runtime0.JSX.Element;
64
+ }): React$1.JSX.Element;
67
65
  declare function DropdownMenuSubContent({
68
66
  className,
69
67
  ...props
70
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): _$react_jsx_runtime0.JSX.Element;
68
+ }: React$1.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React$1.JSX.Element;
71
69
  //#endregion
72
70
  export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuHeader, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, dropdownMenuItemVariants };
@@ -1,23 +1,40 @@
1
1
  import { InputProps } from "./input.mjs";
2
2
  import { Label } from "./label.mjs";
3
3
  import { TextareaProps } from "./textarea.mjs";
4
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
5
- import * as React from "react";
4
+ import * as React$1 from "react";
6
5
  import { Slot } from "@radix-ui/react-slot";
7
- import * as _$react_hook_form0 from "react-hook-form";
8
6
  import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
9
7
 
10
8
  //#region src/components/form.d.ts
11
- declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: _$react_hook_form0.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
9
+ declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({
10
+ children,
11
+ watch,
12
+ getValues,
13
+ getFieldState,
14
+ setError,
15
+ clearErrors,
16
+ setValue,
17
+ setValues,
18
+ trigger,
19
+ formState,
20
+ resetField,
21
+ reset,
22
+ handleSubmit,
23
+ unregister,
24
+ control,
25
+ register,
26
+ setFocus,
27
+ subscribe
28
+ }: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React$1.JSX.Element;
12
29
  declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
13
30
  ...props
14
- }: ControllerProps<TFieldValues, TName>) => _$react_jsx_runtime0.JSX.Element;
31
+ }: ControllerProps<TFieldValues, TName>) => React$1.JSX.Element;
15
32
  declare const useFormField: () => {
16
33
  invalid: boolean;
17
34
  isDirty: boolean;
18
35
  isTouched: boolean;
19
36
  isValidating: boolean;
20
- error?: _$react_hook_form0.FieldError;
37
+ error?: import("react-hook-form").FieldError;
21
38
  id: string;
22
39
  name: string;
23
40
  formItemId: string;
@@ -27,8 +44,8 @@ declare const useFormField: () => {
27
44
  declare function FormItem({
28
45
  className,
29
46
  ...props
30
- }: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
31
- interface FormLabelProps extends React.ComponentProps<typeof Label> {
47
+ }: React$1.ComponentProps<"div">): React$1.JSX.Element;
48
+ interface FormLabelProps extends React$1.ComponentProps<typeof Label> {
32
49
  required?: boolean;
33
50
  tooltip?: string;
34
51
  }
@@ -38,19 +55,19 @@ declare function FormLabel({
38
55
  tooltip,
39
56
  children,
40
57
  ...props
41
- }: FormLabelProps): _$react_jsx_runtime0.JSX.Element;
58
+ }: FormLabelProps): React$1.JSX.Element;
42
59
  declare function FormControl({
43
60
  ...props
44
- }: React.ComponentProps<typeof Slot>): _$react_jsx_runtime0.JSX.Element;
61
+ }: React$1.ComponentProps<typeof Slot>): React$1.JSX.Element;
45
62
  declare function FormDescription({
46
63
  className,
47
64
  ...props
48
- }: React.ComponentProps<"p">): _$react_jsx_runtime0.JSX.Element;
65
+ }: React$1.ComponentProps<"p">): React$1.JSX.Element;
49
66
  declare function FormMessage({
50
67
  className,
51
68
  ...props
52
- }: React.ComponentProps<"p">): _$react_jsx_runtime0.JSX.Element | null;
53
- interface FormHeaderProps extends React.ComponentProps<"div"> {
69
+ }: React$1.ComponentProps<"p">): React$1.JSX.Element | null;
70
+ interface FormHeaderProps extends React$1.ComponentProps<"div"> {
54
71
  title: string;
55
72
  description?: string;
56
73
  }
@@ -59,11 +76,11 @@ declare function FormHeader({
59
76
  description,
60
77
  className,
61
78
  ...props
62
- }: FormHeaderProps): _$react_jsx_runtime0.JSX.Element;
79
+ }: FormHeaderProps): React$1.JSX.Element;
63
80
  declare function FormFields({
64
81
  className,
65
82
  ...props
66
- }: React.ComponentProps<"div">): _$react_jsx_runtime0.JSX.Element;
83
+ }: React$1.ComponentProps<"div">): React$1.JSX.Element;
67
84
  interface FormFieldBaseProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> {
68
85
  control: ControllerProps<TFieldValues, TName>["control"];
69
86
  name: TName;
@@ -83,7 +100,7 @@ declare function InputField<TFieldValues extends FieldValues, TName extends Fiel
83
100
  description,
84
101
  tooltip,
85
102
  ...inputProps
86
- }: InputFieldProps<TFieldValues, TName>): _$react_jsx_runtime0.JSX.Element;
103
+ }: InputFieldProps<TFieldValues, TName>): React$1.JSX.Element;
87
104
  interface TextareaFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> extends FormFieldBaseProps<TFieldValues, TName>, Omit<TextareaProps, "name" | "label"> {}
88
105
  declare function TextareaField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({
89
106
  control,
@@ -94,7 +111,7 @@ declare function TextareaField<TFieldValues extends FieldValues, TName extends F
94
111
  description,
95
112
  tooltip,
96
113
  ...textareaProps
97
- }: TextareaFieldProps<TFieldValues, TName>): _$react_jsx_runtime0.JSX.Element;
114
+ }: TextareaFieldProps<TFieldValues, TName>): React$1.JSX.Element;
98
115
  interface SelectFieldOption {
99
116
  value: string;
100
117
  label: string;
@@ -114,6 +131,41 @@ declare function SelectField<TFieldValues extends FieldValues, TName extends Fie
114
131
  tooltip,
115
132
  options,
116
133
  placeholder
117
- }: SelectFieldProps<TFieldValues, TName>): _$react_jsx_runtime0.JSX.Element;
134
+ }: SelectFieldProps<TFieldValues, TName>): React$1.JSX.Element;
135
+ interface RadioFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> extends FormFieldBaseProps<TFieldValues, TName> {
136
+ options: SelectFieldOption[];
137
+ }
138
+ declare function RadioField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({
139
+ control,
140
+ name,
141
+ rules,
142
+ required,
143
+ label,
144
+ description,
145
+ tooltip,
146
+ options
147
+ }: RadioFieldProps<TFieldValues, TName>): React$1.JSX.Element;
148
+ interface ChecklistFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> extends FormFieldBaseProps<TFieldValues, TName> {
149
+ options: SelectFieldOption[];
150
+ }
151
+ declare function ChecklistField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({
152
+ control,
153
+ name,
154
+ rules,
155
+ required,
156
+ label,
157
+ description,
158
+ tooltip,
159
+ options
160
+ }: ChecklistFieldProps<TFieldValues, TName>): React$1.JSX.Element;
161
+ interface CheckboxFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> extends Omit<FormFieldBaseProps<TFieldValues, TName>, "required"> {}
162
+ declare function CheckboxField<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({
163
+ control,
164
+ name,
165
+ rules,
166
+ label,
167
+ description,
168
+ tooltip
169
+ }: CheckboxFieldProps<TFieldValues, TName>): React$1.JSX.Element;
118
170
  //#endregion
119
- export { Form, FormControl, FormDescription, FormField, FormFields, FormHeader, FormItem, FormLabel, FormMessage, InputField, SelectField, type SelectFieldOption, TextareaField, useFormField };
171
+ export { CheckboxField, ChecklistField, Form, FormControl, FormDescription, FormField, FormFields, FormHeader, FormItem, FormLabel, FormMessage, InputField, RadioField, SelectField, type SelectFieldOption, TextareaField, useFormField };
@@ -1,18 +1,20 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.mjs";
3
3
  import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
4
+ import { Checkbox } from "./checkbox.mjs";
4
5
  import { Label } from "./label.mjs";
5
6
  import { Input } from "./input.mjs";
7
+ import { RadioGroup, RadioGroupItem } from "./radio-group.mjs";
6
8
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.mjs";
7
9
  import { Textarea } from "./textarea.mjs";
8
10
  import { Info } from "lucide-react";
9
11
  import { jsx, jsxs } from "react/jsx-runtime";
10
- import * as React from "react";
12
+ import * as React$1 from "react";
11
13
  import { Slot } from "@radix-ui/react-slot";
12
14
  import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
13
15
  //#region src/components/form.tsx
14
16
  const Form = FormProvider;
15
- const FormFieldContext = React.createContext({});
17
+ const FormFieldContext = React$1.createContext({});
16
18
  const FormField = ({ ...props }) => {
17
19
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, {
18
20
  value: { name: props.name },
@@ -20,8 +22,8 @@ const FormField = ({ ...props }) => {
20
22
  });
21
23
  };
22
24
  const useFormField = () => {
23
- const fieldContext = React.useContext(FormFieldContext);
24
- const itemContext = React.useContext(FormItemContext);
25
+ const fieldContext = React$1.useContext(FormFieldContext);
26
+ const itemContext = React$1.useContext(FormItemContext);
25
27
  if (!fieldContext.name) throw new Error("useFormField should be used within <FormField>");
26
28
  const { getFieldState } = useFormContext();
27
29
  const formState = useFormState({ name: fieldContext.name });
@@ -36,9 +38,9 @@ const useFormField = () => {
36
38
  ...fieldState
37
39
  };
38
40
  };
39
- const FormItemContext = React.createContext({});
41
+ const FormItemContext = React$1.createContext({});
40
42
  function FormItem({ className, ...props }) {
41
- const id = React.useId();
43
+ const id = React$1.useId();
42
44
  return /* @__PURE__ */ jsx(FormItemContext.Provider, {
43
45
  value: { id },
44
46
  children: /* @__PURE__ */ jsx("div", {
@@ -88,7 +90,7 @@ function FormDescription({ className, ...props }) {
88
90
  return /* @__PURE__ */ jsx("p", {
89
91
  "data-slot": "form-description",
90
92
  id: formDescriptionId,
91
- className: cn("text-muted-foreground text-sm", className),
93
+ className: cn("text-muted-foreground type-text-sm whitespace-pre-line", className),
92
94
  ...props
93
95
  });
94
96
  }
@@ -134,11 +136,11 @@ function InputField({ control, name, rules, required, label, description, toolti
134
136
  tooltip,
135
137
  children: label
136
138
  }),
139
+ description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
137
140
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Input, {
138
141
  ...inputProps,
139
142
  ...field
140
143
  }) }),
141
- description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
142
144
  /* @__PURE__ */ jsx(FormMessage, {})
143
145
  ] })
144
146
  });
@@ -154,11 +156,11 @@ function TextareaField({ control, name, rules, required, label, description, too
154
156
  tooltip,
155
157
  children: label
156
158
  }),
159
+ description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
157
160
  /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Textarea, {
158
161
  ...textareaProps,
159
162
  ...field
160
163
  }) }),
161
- description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
162
164
  /* @__PURE__ */ jsx(FormMessage, {})
163
165
  ] })
164
166
  });
@@ -174,6 +176,7 @@ function SelectField({ control, name, rules, required, label, description, toolt
174
176
  tooltip,
175
177
  children: label
176
178
  }),
179
+ description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
177
180
  /* @__PURE__ */ jsxs(Select, {
178
181
  value: field.value,
179
182
  onValueChange: field.onChange,
@@ -183,10 +186,117 @@ function SelectField({ control, name, rules, required, label, description, toolt
183
186
  children: option.label
184
187
  }, option.value)) })]
185
188
  }),
189
+ /* @__PURE__ */ jsx(FormMessage, {})
190
+ ] })
191
+ });
192
+ }
193
+ function RadioField({ control, name, rules, required, label, description, tooltip, options }) {
194
+ return /* @__PURE__ */ jsx(FormField, {
195
+ control,
196
+ name,
197
+ rules,
198
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, { children: [
199
+ label && /* @__PURE__ */ jsx(FormLabel, {
200
+ required,
201
+ tooltip,
202
+ children: label
203
+ }),
186
204
  description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
205
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(RadioGroup, {
206
+ value: field.value ?? "",
207
+ onValueChange: field.onChange,
208
+ onBlur: field.onBlur,
209
+ children: options.map((option) => {
210
+ const itemId = `${field.name}-${option.value}`;
211
+ return /* @__PURE__ */ jsxs("div", {
212
+ className: "flex items-center gap-2",
213
+ children: [/* @__PURE__ */ jsx(RadioGroupItem, {
214
+ id: itemId,
215
+ value: option.value,
216
+ disabled: option.disabled
217
+ }), /* @__PURE__ */ jsx(Label, {
218
+ htmlFor: itemId,
219
+ className: "type-text-sm font-normal",
220
+ children: option.label
221
+ })]
222
+ }, option.value);
223
+ })
224
+ }) }),
187
225
  /* @__PURE__ */ jsx(FormMessage, {})
188
226
  ] })
189
227
  });
190
228
  }
229
+ function ChecklistField({ control, name, rules, required, label, description, tooltip, options }) {
230
+ return /* @__PURE__ */ jsx(FormField, {
231
+ control,
232
+ name,
233
+ rules,
234
+ render: ({ field }) => {
235
+ const selected = Array.isArray(field.value) ? field.value : [];
236
+ const toggle = (value, checked) => {
237
+ if (checked) field.onChange([...selected, value]);
238
+ else field.onChange(selected.filter((existing) => existing !== value));
239
+ };
240
+ return /* @__PURE__ */ jsxs(FormItem, { children: [
241
+ label && /* @__PURE__ */ jsx(FormLabel, {
242
+ required,
243
+ tooltip,
244
+ children: label
245
+ }),
246
+ description && /* @__PURE__ */ jsx(FormDescription, { children: description }),
247
+ /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx("fieldset", {
248
+ className: "m-0 flex flex-col gap-2 border-0 p-0",
249
+ onBlur: field.onBlur,
250
+ children: options.map((option) => {
251
+ const itemId = `${field.name}-${option.value}`;
252
+ return /* @__PURE__ */ jsxs("div", {
253
+ className: "flex items-start gap-2",
254
+ children: [/* @__PURE__ */ jsx(Checkbox, {
255
+ id: itemId,
256
+ checked: selected.includes(option.value),
257
+ onCheckedChange: (next) => toggle(option.value, Boolean(next)),
258
+ disabled: option.disabled
259
+ }), /* @__PURE__ */ jsx(Label, {
260
+ htmlFor: itemId,
261
+ className: "type-text-sm font-normal leading-tight",
262
+ children: option.label
263
+ })]
264
+ }, option.value);
265
+ })
266
+ }) }),
267
+ /* @__PURE__ */ jsx(FormMessage, {})
268
+ ] });
269
+ }
270
+ });
271
+ }
272
+ function CheckboxField({ control, name, rules, label, description, tooltip }) {
273
+ return /* @__PURE__ */ jsx(FormField, {
274
+ control,
275
+ name,
276
+ rules,
277
+ render: ({ field }) => /* @__PURE__ */ jsxs(FormItem, {
278
+ className: "gap-1.5",
279
+ children: [
280
+ /* @__PURE__ */ jsxs("div", {
281
+ className: "flex items-start gap-2",
282
+ children: [/* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Checkbox, {
283
+ checked: field.value ?? false,
284
+ onCheckedChange: (next) => field.onChange(Boolean(next)),
285
+ onBlur: field.onBlur
286
+ }) }), label && /* @__PURE__ */ jsx(FormLabel, {
287
+ tooltip,
288
+ className: "font-normal",
289
+ children: label
290
+ })]
291
+ }),
292
+ description && /* @__PURE__ */ jsx(FormDescription, {
293
+ className: "ml-6",
294
+ children: description
295
+ }),
296
+ /* @__PURE__ */ jsx(FormMessage, { className: "ml-6" })
297
+ ]
298
+ })
299
+ });
300
+ }
191
301
  //#endregion
192
- export { Form, FormControl, FormDescription, FormField, FormFields, FormHeader, FormItem, FormLabel, FormMessage, InputField, SelectField, TextareaField, useFormField };
302
+ export { CheckboxField, ChecklistField, Form, FormControl, FormDescription, FormField, FormFields, FormHeader, FormItem, FormLabel, FormMessage, InputField, RadioField, SelectField, TextareaField, useFormField };
@@ -1,5 +1,4 @@
1
1
  import { Button } from "./button.mjs";
2
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
2
  import { ComponentProps } from "react";
4
3
 
5
4
  //#region src/components/github-button.d.ts
@@ -8,6 +7,6 @@ declare function GitHubButton({
8
7
  className,
9
8
  children,
10
9
  ...props
11
- }: GitHubButtonProps): _$react_jsx_runtime0.JSX.Element;
10
+ }: GitHubButtonProps): import("react").JSX.Element;
12
11
  //#endregion
13
12
  export { GitHubButton, type GitHubButtonProps };
@@ -1,25 +1,23 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
1
  import { VariantProps } from "class-variance-authority";
3
- import * as React from "react";
4
- import * as _$class_variance_authority_types0 from "class-variance-authority/types";
2
+ import * as React$1 from "react";
5
3
 
6
4
  //#region src/components/input-group.d.ts
7
5
  declare function InputGroup({
8
6
  className,
9
7
  children,
10
8
  ...props
11
- }: React.ComponentProps<"fieldset">): _$react_jsx_runtime0.JSX.Element;
9
+ }: React$1.ComponentProps<"fieldset">): React$1.JSX.Element;
12
10
  declare const inputGroupAddonVariants: (props?: ({
13
11
  align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
14
- } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
15
13
  declare function InputGroupAddon({
16
14
  className,
17
15
  align,
18
16
  ...props
19
- }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): _$react_jsx_runtime0.JSX.Element;
17
+ }: React$1.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React$1.JSX.Element;
20
18
  declare function InputGroupTextarea({
21
19
  className,
22
20
  ...props
23
- }: React.ComponentProps<"textarea">): _$react_jsx_runtime0.JSX.Element;
21
+ }: React$1.ComponentProps<"textarea">): React$1.JSX.Element;
24
22
  //#endregion
25
23
  export { InputGroup, InputGroupAddon, InputGroupTextarea };
@@ -1,15 +1,14 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
- import * as React from "react";
1
+ import * as React$1 from "react";
3
2
 
4
3
  //#region src/components/input.d.ts
5
- interface InputProps extends Omit<React.ComponentProps<"input">, "size"> {
4
+ interface InputProps extends Omit<React$1.ComponentProps<"input">, "size"> {
6
5
  label?: string;
7
6
  required?: boolean;
8
7
  hint?: string;
9
8
  error?: string;
10
9
  tooltip?: string;
11
10
  leadingText?: string;
12
- leadingIcon?: React.ReactNode;
11
+ leadingIcon?: React$1.ReactNode;
13
12
  size?: "sm" | "md";
14
13
  }
15
14
  declare function Input({
@@ -24,6 +23,6 @@ declare function Input({
24
23
  leadingIcon,
25
24
  size,
26
25
  ...props
27
- }: InputProps): _$react_jsx_runtime0.JSX.Element;
26
+ }: InputProps): React$1.JSX.Element;
28
27
  //#endregion
29
28
  export { Input, type InputProps };
@@ -4,7 +4,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.mjs";
4
4
  import { Label } from "./label.mjs";
5
5
  import { Info } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- import * as React from "react";
7
+ import * as React$1 from "react";
8
8
  //#region src/components/input.tsx
9
9
  const inputSizeStyles = {
10
10
  sm: {
@@ -25,7 +25,7 @@ const inputSizeStyles = {
25
25
  }
26
26
  };
27
27
  function Input({ className, id, label, required, hint, error, tooltip, leadingText, leadingIcon, size = "md", ...props }) {
28
- const generatedId = React.useId();
28
+ const generatedId = React$1.useId();
29
29
  const fieldId = id ?? generatedId;
30
30
  const hasAddons = leadingText || leadingIcon;
31
31
  const sizes = inputSizeStyles[size];
@@ -1,11 +1,10 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
- import * as React from "react";
1
+ import * as React$1 from "react";
3
2
  import * as LabelPrimitive from "@radix-ui/react-label";
4
3
 
5
4
  //#region src/components/label.d.ts
6
5
  declare function Label({
7
6
  className,
8
7
  ...props
9
- }: React.ComponentProps<typeof LabelPrimitive.Root>): _$react_jsx_runtime0.JSX.Element;
8
+ }: React$1.ComponentProps<typeof LabelPrimitive.Root>): React$1.JSX.Element;
10
9
  //#endregion
11
10
  export { Label };
@@ -1,11 +1,9 @@
1
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
-
3
1
  //#region src/components/page-loader.d.ts
4
2
  interface PageLoaderProps {
5
3
  className?: string;
6
4
  }
7
5
  declare function PageLoader({
8
6
  className
9
- }: PageLoaderProps): _$react_jsx_runtime0.JSX.Element;
7
+ }: PageLoaderProps): import("react").JSX.Element;
10
8
  //#endregion
11
9
  export { PageLoader, type PageLoaderProps };