@mbao01/common 0.0.8 → 0.0.9
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/types/components/Button/Button.d.ts +7 -7
- package/dist/types/components/Command/Command.d.ts +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +4 -4
- package/dist/types/components/Form/Checkbox/Checkbox.d.ts +4 -4
- package/dist/types/components/Form/Input/Input.d.ts +6 -6
- package/dist/types/components/Form/Phone/Phone.d.ts +2 -15
- package/dist/types/components/Form/Phone/types.d.ts +1 -7
- package/dist/types/components/Form/Radio/Radio.d.ts +4 -4
- package/dist/types/components/Form/Range/Range.d.ts +6 -6
- package/dist/types/components/Form/Select/Select.d.ts +15 -15
- package/dist/types/components/Form/Slider/Slider.d.ts +12 -12
- package/dist/types/components/Form/Switch/Switch.d.ts +4 -4
- package/dist/types/components/Form/TextField/TextField.d.ts +6 -6
- package/dist/types/components/Form/Textarea/Textarea.d.ts +6 -6
- package/dist/types/components/Popover/Popover.d.ts +1 -1
- package/dist/types/components/Progress/Progress.d.ts +3 -3
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/types/libs/cva.d.ts +6 -1
- package/package.json +2 -2
- package/src/components/Form/Phone/Phone.tsx +20 -14
- package/src/components/Form/Phone/constants.ts +1 -1
- package/src/components/Form/Phone/types.ts +1 -10
- package/src/components/Form/Select/constants.ts +1 -1
- package/src/components/Popover/constants.ts +1 -1
- package/src/libs/cva.ts +10 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
3
|
-
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
outline?: boolean |
|
|
5
|
-
wide?: boolean |
|
|
6
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
7
|
-
isLoading?: boolean |
|
|
8
|
-
} &
|
|
2
|
+
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
wide?: boolean | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
7
|
+
isLoading?: boolean | undefined;
|
|
8
|
+
} & {
|
|
9
9
|
as?: "a" | "span" | "p" | undefined;
|
|
10
10
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
export { Button };
|
|
@@ -11,7 +11,7 @@ declare const Command: {
|
|
|
11
11
|
}, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
|
|
12
12
|
value?: string | undefined;
|
|
13
13
|
onValueChange?: ((search: string) => void) | undefined;
|
|
14
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> &
|
|
14
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> & {} & React.RefAttributes<HTMLInputElement>>;
|
|
15
15
|
List: React.ForwardRefExoticComponent<Omit<{
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
} & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
@@ -10,13 +10,13 @@ declare const Dialog: {
|
|
|
10
10
|
({ className, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
|
-
Title: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> &
|
|
14
|
-
Description: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> &
|
|
15
|
-
Content: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
13
|
+
Title: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & {} & React.RefAttributes<HTMLHeadingElement>>;
|
|
14
|
+
Description: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & {} & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
Content: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {} & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
Footer: {
|
|
17
17
|
({ className, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
|
-
Overlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
20
|
+
Overlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {} & React.RefAttributes<HTMLDivElement>>;
|
|
21
21
|
};
|
|
22
22
|
export { Dialog };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
3
|
-
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
5
|
-
} &
|
|
2
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
|
|
3
|
+
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { Checkbox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const Input: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> &
|
|
3
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
outline?: boolean |
|
|
5
|
-
wide?: boolean |
|
|
6
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
7
|
-
} &
|
|
2
|
+
export declare const Input: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
|
|
3
|
+
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
wide?: boolean | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
5
|
-
outline?: boolean | null | undefined;
|
|
6
|
-
wide?: boolean | null | undefined;
|
|
7
|
-
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
8
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string> | undefined;
|
|
9
|
-
buttonProps?: import("class-variance-authority").VariantProps<(props?: ({
|
|
10
|
-
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
11
|
-
outline?: boolean | null | undefined;
|
|
12
|
-
wide?: boolean | null | undefined;
|
|
13
|
-
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
14
|
-
isLoading?: boolean | null | undefined;
|
|
15
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string> | undefined;
|
|
16
|
-
} & React.RefAttributes<HTMLInputElement>>;
|
|
2
|
+
import { type PhoneProps } from "./types";
|
|
3
|
+
declare const Phone: React.ForwardRefExoticComponent<PhoneProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
4
|
export { Phone };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { type VariantProps } from "../../../libs";
|
|
2
1
|
import { type InputProps } from "../Input/types";
|
|
3
|
-
|
|
4
|
-
import { getButtonClasses } from "../../Button/constants";
|
|
5
|
-
export type PhoneProps = Omit<InputProps, "type" | "size" | "label" | "inputMode"> & {
|
|
6
|
-
inputProps?: VariantProps<typeof getInputClasses>;
|
|
7
|
-
buttonProps?: VariantProps<typeof getButtonClasses>;
|
|
8
|
-
};
|
|
2
|
+
export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Radio: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
3
|
-
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
5
|
-
} &
|
|
2
|
+
declare const Radio: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
|
|
3
|
+
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { Radio };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Range: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
3
|
-
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} &
|
|
2
|
+
declare const Range: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
|
|
3
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
wide?: boolean | undefined;
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export { Range };
|
|
@@ -4,22 +4,22 @@ declare const Select: {
|
|
|
4
4
|
(props: React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
Group: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
Value: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
-
Trigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> &
|
|
8
|
-
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
9
|
-
outline?: boolean |
|
|
10
|
-
wide?: boolean |
|
|
11
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
12
|
-
} &
|
|
13
|
-
Content: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
14
|
-
position?: "popper" | "item-aligned" |
|
|
15
|
-
} &
|
|
7
|
+
Trigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
8
|
+
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
9
|
+
outline?: boolean | undefined;
|
|
10
|
+
wide?: boolean | undefined;
|
|
11
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
12
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
Content: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
|
+
position?: "popper" | "item-aligned" | undefined;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
16
|
Label: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
-
Item: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
18
|
-
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
19
|
-
outline?: boolean |
|
|
20
|
-
wide?: boolean |
|
|
21
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
22
|
-
} &
|
|
17
|
+
Item: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
18
|
+
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
19
|
+
outline?: boolean | undefined;
|
|
20
|
+
wide?: boolean | undefined;
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
22
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
Separator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
24
|
ScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
25
|
ScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
-
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> &
|
|
4
|
-
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
5
|
-
} &
|
|
6
|
-
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
7
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
8
|
-
} &
|
|
9
|
-
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
10
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
11
|
-
} &
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} &
|
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & {
|
|
4
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
10
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
wide?: boolean | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
15
15
|
export { Slider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Switch: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> &
|
|
3
|
-
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
5
|
-
} &
|
|
2
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
|
|
3
|
+
variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
6
6
|
export { Switch };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const TextField: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> &
|
|
3
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
outline?: boolean |
|
|
5
|
-
wide?: boolean |
|
|
6
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
7
|
-
} &
|
|
2
|
+
export declare const TextField: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
|
|
3
|
+
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
wide?: boolean | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
7
|
+
} & {
|
|
8
8
|
info?: React.ReactNode;
|
|
9
9
|
error?: string | string[] | null | undefined;
|
|
10
10
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "ref"> &
|
|
3
|
-
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" |
|
|
4
|
-
outline?: boolean |
|
|
5
|
-
wide?: boolean |
|
|
6
|
-
size?: "xs" | "sm" | "md" | "lg" |
|
|
7
|
-
} &
|
|
2
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size" | "ref"> & {
|
|
3
|
+
variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
4
|
+
outline?: boolean | undefined;
|
|
5
|
+
wide?: boolean | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
8
|
export { Textarea };
|
|
@@ -3,7 +3,7 @@ import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
|
3
3
|
import { PopoverProps } from "./types";
|
|
4
4
|
declare const Popover: {
|
|
5
5
|
(props: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Content: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> &
|
|
6
|
+
Content: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {} & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
Trigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
};
|
|
9
9
|
export { Popover };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
-
export declare const Progress: React.ForwardRefExoticComponent<Omit<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref">, "asChild"> &
|
|
4
|
-
variant?: "accent" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" |
|
|
5
|
-
} &
|
|
3
|
+
export declare const Progress: React.ForwardRefExoticComponent<Omit<Omit<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref">, "asChild"> & {
|
|
4
|
+
variant?: "accent" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | undefined;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -3,9 +3,9 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
|
3
3
|
import type { TooltipArrowProps } from "./types";
|
|
4
4
|
declare const Tooltip: {
|
|
5
5
|
(props: TooltipPrimitive.TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & TooltipPrimitive.TooltipContentProps &
|
|
7
|
-
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" |
|
|
8
|
-
} &
|
|
6
|
+
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & TooltipPrimitive.TooltipContentProps & {
|
|
7
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
Arrow: ({ className, variant, ...props }: TooltipArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
Portal: React.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
11
11
|
Provider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
package/dist/types/libs/cva.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { type VariantProps as OriginalVariantProps } from "class-variance-authority";
|
|
2
|
+
export { cva } from "class-variance-authority";
|
|
3
|
+
type ExcludeNull<T> = {
|
|
4
|
+
[P in keyof T]: Exclude<T[P], null>;
|
|
5
|
+
};
|
|
6
|
+
export type VariantProps<T extends (...args: any) => any> = ExcludeNull<OriginalVariantProps<T>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mbao01/common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Ayomide Bakare",
|
|
7
7
|
"license": "MIT",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"react-dom": "^18.2.0",
|
|
126
126
|
"typescript": "^5.2.2"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "c069fb2a492bd2e36c3b637275498dc88ca05a62"
|
|
129
129
|
}
|
|
@@ -13,18 +13,19 @@ import { cn } from "../../../utilities";
|
|
|
13
13
|
import { Button } from "../../Button";
|
|
14
14
|
import { Input } from "../Input";
|
|
15
15
|
import { getPhoneButtonClasses, getPhoneInputClasses } from "./constants";
|
|
16
|
-
import { getInputClasses } from "../Input/constants";
|
|
17
|
-
import { getButtonClasses } from "../../Button/constants";
|
|
18
16
|
|
|
19
17
|
const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
20
18
|
(
|
|
21
19
|
{
|
|
20
|
+
disabled,
|
|
22
21
|
defaultValue,
|
|
23
22
|
className,
|
|
24
23
|
placeholder,
|
|
25
24
|
onChange,
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
variant,
|
|
26
|
+
outline,
|
|
27
|
+
wide,
|
|
28
|
+
size,
|
|
28
29
|
...props
|
|
29
30
|
},
|
|
30
31
|
ref
|
|
@@ -60,12 +61,16 @@ const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
|
60
61
|
<Button
|
|
61
62
|
role="combobox"
|
|
62
63
|
aria-expanded={open}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)}
|
|
64
|
+
size={size}
|
|
65
|
+
variant={variant}
|
|
66
|
+
outline={outline}
|
|
67
|
+
className={cn(getPhoneButtonClasses())}
|
|
68
|
+
disabled={disabled}
|
|
67
69
|
>
|
|
68
|
-
<FlagImage
|
|
70
|
+
<FlagImage
|
|
71
|
+
iso2={country.iso2}
|
|
72
|
+
size={["xs", "sm"].includes(size!) ? "20px" : "30px"}
|
|
73
|
+
/>
|
|
69
74
|
</Button>
|
|
70
75
|
</Popover.Trigger>
|
|
71
76
|
<Popover.Content className="w-[200px] p-0">
|
|
@@ -104,11 +109,12 @@ const Phone = React.forwardRef<HTMLInputElement, PhoneProps>(
|
|
|
104
109
|
inputMode="numeric"
|
|
105
110
|
placeholder={placeholder ?? " "}
|
|
106
111
|
onChange={handleInputChange}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
size={size}
|
|
113
|
+
wide={wide}
|
|
114
|
+
variant={variant}
|
|
115
|
+
outline={outline}
|
|
116
|
+
disabled={disabled}
|
|
117
|
+
className={cn(getPhoneInputClasses(), className)}
|
|
112
118
|
{...props}
|
|
113
119
|
/>
|
|
114
120
|
</div>
|
|
@@ -3,5 +3,5 @@ import { cva } from "../../../libs";
|
|
|
3
3
|
export const getPhoneButtonClasses = cva("join-item justify-between px-2");
|
|
4
4
|
|
|
5
5
|
export const getPhoneInputClasses = cva(
|
|
6
|
-
"input join-item input-bordered
|
|
6
|
+
"input join-item input-bordered w-full !rounded-l-none !pl-2 transition-all duration-100"
|
|
7
7
|
);
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import { type VariantProps } from "../../../libs";
|
|
2
1
|
import { type InputProps } from "../Input/types";
|
|
3
|
-
import { getInputClasses } from "../Input/constants";
|
|
4
|
-
import { getButtonClasses } from "../../Button/constants";
|
|
5
2
|
|
|
6
|
-
export type PhoneProps = Omit<
|
|
7
|
-
InputProps,
|
|
8
|
-
"type" | "size" | "label" | "inputMode"
|
|
9
|
-
> & {
|
|
10
|
-
inputProps?: VariantProps<typeof getInputClasses>;
|
|
11
|
-
buttonProps?: VariantProps<typeof getButtonClasses>;
|
|
12
|
-
};
|
|
3
|
+
export type PhoneProps = Omit<InputProps, "type" | "label" | "inputMode">;
|
|
@@ -57,7 +57,7 @@ export const getSelectLabelClasses = cva("px-2 py-1.5 text-sm font-semibold");
|
|
|
57
57
|
export const getSelectSeparatorClasses = cva("-mx-1 my-1 h-px bg-muted");
|
|
58
58
|
|
|
59
59
|
export const getSelectContentClasses = cva(
|
|
60
|
-
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-
|
|
60
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-base-100 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
61
61
|
{
|
|
62
62
|
variants: {
|
|
63
63
|
position: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
3
|
export const getPopoverContentClasses = cva(
|
|
4
|
-
"z-50 w-72 rounded-md border bg-
|
|
4
|
+
"z-50 w-72 rounded-md border bg-base-100 p-4 shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
5
5
|
);
|
package/src/libs/cva.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { type VariantProps as OriginalVariantProps } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
export { cva } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
type ExcludeNull<T> = { [P in keyof T]: Exclude<T[P], null> };
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
export type VariantProps<T extends (...args: any) => any> = ExcludeNull<
|
|
9
|
+
OriginalVariantProps<T>
|
|
10
|
+
>;
|