prom-pal-ui 1.1.0 → 1.2.1

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.
@@ -1,8 +1,8 @@
1
1
  declare const usePromPromiseQuery: <T>(fetchFn?: () => Promise<T>) => {
2
2
  data: T;
3
3
  error: string;
4
- execute: (fn?: () => Promise<T>) => Promise<T>;
4
+ execute: (fn?: () => Promise<T>) => Promise<void>;
5
5
  loading: boolean;
6
- onRefetch: () => Promise<T>;
6
+ onRefetch: () => Promise<void>;
7
7
  };
8
8
  export { usePromPromiseQuery };
@@ -4,6 +4,7 @@ import { z } from "zod";
4
4
  import { CommonPromComponentProps } from "../types";
5
5
  type PromFormRenderProps = {
6
6
  isValid: boolean;
7
+ serverError?: any;
7
8
  isSubmitting: boolean;
8
9
  errors: Record<string, any>;
9
10
  form: UseFormReturn<z.infer<any>>;
@@ -12,10 +13,9 @@ interface PromFromProps extends CommonPromComponentProps {
12
13
  children?: ReactNode;
13
14
  schema?: z.ZodObject<any>;
14
15
  defaultValues?: z.infer<any>;
15
- onSubmit?: (data: z.infer<any>) => void;
16
- render?: (props: PromFormRenderProps) => ReactNode;
17
16
  form?: UseFormReturn<z.infer<any>>;
18
- errorDisplay?: ReactNode;
17
+ onSubmit?: (data: z.infer<any>) => Promise<void>;
18
+ render?: (props: PromFormRenderProps) => ReactNode;
19
19
  }
20
20
  declare const PromFrom: ({ schema, render, children, onSubmit, defaultValues, form: externalForm, }: PromFromProps) => import("react/jsx-runtime").JSX.Element;
21
21
  declare const usePromForm: <T extends FieldValues>() => {
@@ -26,11 +26,11 @@ declare const usePromForm: <T extends FieldValues>() => {
26
26
  reset: import("react-hook-form").UseFormReset<T>;
27
27
  watch: import("react-hook-form").UseFormWatch<T>;
28
28
  control: import("react-hook-form").Control<T, any, T>;
29
- setValue: import("react-hook-form").UseFormSetValue<T>;
29
+ trigger: import("react-hook-form").UseFormTrigger<T>;
30
30
  register: import("react-hook-form").UseFormRegister<T>;
31
- handleSubmit: import("react-hook-form").UseFormHandleSubmit<T, T>;
31
+ setValue: import("react-hook-form").UseFormSetValue<T>;
32
32
  getValues: import("react-hook-form").UseFormGetValues<T>;
33
- trigger: import("react-hook-form").UseFormTrigger<T>;
33
+ handleSubmit: import("react-hook-form").UseFormHandleSubmit<T, T>;
34
34
  };
35
35
  type PromFormFiledProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ControllerProps<TFieldValues, TName>;
36
36
  declare const PromFormFiled: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: PromFormFiledProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export * from "./ui/button";
2
+ export * from "./ui/select";
3
+ export * from "./fields";
4
+ export * from "./ui/skeleton";
5
+ import "./styles/tailwind.css";
6
+ export * from "./lib/index";
7
+ export * from "./ui/test";
@@ -0,0 +1,2 @@
1
+ export * from "./schema";
2
+ export * from "./schema-msg";
@@ -0,0 +1,5 @@
1
+ declare const PROM_MSG_ERROR: {
2
+ EMPTY: string;
3
+ INVALID_VALUES: string;
4
+ };
5
+ export { PROM_MSG_ERROR };
@@ -0,0 +1,3 @@
1
+ import z from "zod";
2
+ declare const promSchemaPhone: z.ZodString;
3
+ export { promSchemaPhone };
@@ -0,0 +1,2 @@
1
+ export { cn } from "./utils";
2
+ export * from "./form/rules";
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,17 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ import { CommonPromComponentProps } from "../types";
4
+ declare const buttonVariants: (props?: {
5
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost";
6
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg";
7
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
8
+ declare const skeletonVariants: (props?: {
9
+ variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost";
10
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg";
11
+ } & import("class-variance-authority/dist/types").ClassProp) => string;
12
+ interface PromButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants>, CommonPromComponentProps {
13
+ asChild?: boolean;
14
+ loadingText?: string;
15
+ }
16
+ declare function PromButton({ size, variant, children, disabled, className, loadingText, isLoad, asChild, skeleton, ...props }: PromButtonProps): import("react/jsx-runtime").JSX.Element;
17
+ export { PromButton, buttonVariants, skeletonVariants };
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ declare function PromSelect({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PromSelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PromSelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PromSelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
7
+ size?: "sm" | "default";
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare function PromSelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
10
+ declare function PromSelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
11
+ declare function PromSelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
12
+ declare function PromSelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
13
+ declare function PromSelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
14
+ declare function PromSelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
15
+ export { PromSelect, PromSelectContent, PromSelectGroup, PromSelectItem, PromSelectLabel, PromSelectScrollDownButton, PromSelectScrollUpButton, PromSelectSeparator, PromSelectTrigger, PromSelectValue, };
@@ -0,0 +1,2 @@
1
+ declare function PromSkeleton({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
2
+ export { PromSkeleton };
@@ -0,0 +1,4 @@
1
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
2
+ import * as React from "react";
3
+ declare const PromSwitch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { PromSwitch };
@@ -0,0 +1 @@
1
+ export declare function PromTest(): import("react/jsx-runtime").JSX.Element;