@mbao01/common 0.0.29 → 0.0.30

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 (40) hide show
  1. package/dist/types/components/Alert/constants.d.ts +1 -1
  2. package/dist/types/components/AlertDialog/AlertDialog.d.ts +2 -2
  3. package/dist/types/components/Anchor/Anchor.d.ts +2 -0
  4. package/dist/types/components/Anchor/constant.d.ts +5 -0
  5. package/dist/types/components/Anchor/index.d.ts +1 -0
  6. package/dist/types/components/Anchor/types.d.ts +6 -0
  7. package/dist/types/components/Avatar/constants.d.ts +2 -2
  8. package/dist/types/components/Badge/constants.d.ts +1 -1
  9. package/dist/types/components/Button/Button.d.ts +1 -1
  10. package/dist/types/components/Button/constants.d.ts +1 -1
  11. package/dist/types/components/Carousel/Carousel.d.ts +2 -2
  12. package/dist/types/components/Command/Command.d.ts +1 -1
  13. package/dist/types/components/Form/Checkbox/Checkbox.d.ts +1 -1
  14. package/dist/types/components/Form/Input/Input.d.ts +4 -3
  15. package/dist/types/components/Form/Input/constants.d.ts +2 -1
  16. package/dist/types/components/Form/Input/types.d.ts +1 -1
  17. package/dist/types/components/Form/Radio/Radio.d.ts +1 -1
  18. package/dist/types/components/Form/Range/Range.d.ts +1 -1
  19. package/dist/types/components/Form/Switch/Switch.d.ts +1 -1
  20. package/dist/types/components/Form/TextField/TextField.d.ts +4 -3
  21. package/dist/types/components/Form/Textarea/Textarea.d.ts +2 -2
  22. package/dist/types/components/Form/Textarea/constants.d.ts +1 -1
  23. package/dist/types/components/Progress/Progress.d.ts +1 -1
  24. package/dist/types/components/Progress/constants.d.ts +2 -2
  25. package/dist/types/components/ScrollArea/ScrollArea.d.ts +1 -1
  26. package/dist/types/components/ScrollArea/constants.d.ts +1 -1
  27. package/dist/types/components/Sonner/constants.d.ts +1 -1
  28. package/dist/types/components/Toggle/Toggle.d.ts +1 -1
  29. package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +1 -1
  30. package/dist/types/index.d.ts +1 -0
  31. package/package.json +2 -2
  32. package/src/components/Anchor/Anchor.tsx +29 -0
  33. package/src/components/Anchor/constant.ts +24 -0
  34. package/src/components/Anchor/index.ts +1 -0
  35. package/src/components/Anchor/types.ts +6 -0
  36. package/src/components/Form/Input/Input.tsx +6 -2
  37. package/src/components/Form/Input/constants.ts +4 -0
  38. package/src/components/Form/Input/types.ts +1 -1
  39. package/src/components/Form/Select/constants.ts +1 -1
  40. package/src/index.ts +1 -0
@@ -1,4 +1,4 @@
1
1
  export declare const getAlertClasses: (props?: ({
2
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -21,14 +21,14 @@ declare const AlertDialog: {
21
21
  Title: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & {} & React.RefAttributes<HTMLHeadingElement>>;
22
22
  Description: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & {} & React.RefAttributes<HTMLParagraphElement>>;
23
23
  Action: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
24
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
24
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
25
25
  outline?: boolean | undefined;
26
26
  wide?: boolean | undefined;
27
27
  size?: "xs" | "sm" | "md" | "lg" | undefined;
28
28
  isLoading?: boolean | undefined;
29
29
  } & React.RefAttributes<HTMLButtonElement>>;
30
30
  Cancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
31
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
31
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
32
32
  outline?: boolean | undefined;
33
33
  wide?: boolean | undefined;
34
34
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -0,0 +1,2 @@
1
+ import { type AnchorProps } from "./types";
2
+ export declare const Anchor: ({ href, hover, variant, children, className, underline, isExternal, ...props }: AnchorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const getAnchorClasses: (props?: ({
2
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
3
+ hover?: boolean | null | undefined;
4
+ underline?: boolean | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1 @@
1
+ export { Anchor } from "./Anchor";
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { VariantProps } from "../../libs";
3
+ import { getAnchorClasses } from "./constant";
4
+ export type AnchorProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
5
+ isExternal?: boolean;
6
+ } & VariantProps<typeof getAnchorClasses>;
@@ -3,13 +3,13 @@ export declare const getAvatarClasses: (props?: ({
3
3
  status?: "online" | "offline" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export declare const getAvatarImageClasses: (props?: ({
6
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
6
+ variant?: "accent" | "default" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
7
7
  shape?: "circle" | "round" | "hexagon" | "triangle" | "television" | null | undefined;
8
8
  ring?: boolean | null | undefined;
9
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
10
  export declare const getAvatarFallbackClasses: (props?: ({
11
11
  size?: 16 | 4 | 8 | 12 | 24 | 32 | 48 | 64 | null | undefined;
12
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
12
+ variant?: "accent" | "default" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
13
13
  shape?: "circle" | "round" | "hexagon" | "triangle" | "television" | null | undefined;
14
14
  ring?: boolean | null | undefined;
15
15
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  export declare const getBadgeClasses: (props?: ({
2
- variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
5
5
  rounded?: "xs" | "sm" | "md" | "lg" | null | undefined;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
3
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
3
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
4
4
  outline?: boolean | undefined;
5
5
  wide?: boolean | undefined;
6
6
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const getButtonClasses: (props?: ({
2
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  wide?: boolean | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
@@ -6,7 +6,7 @@ declare const Carousel: {
6
6
  Content: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
7
7
  Item: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
8
8
  Next: import("react").ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
9
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
9
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
10
10
  outline?: boolean | undefined;
11
11
  wide?: boolean | undefined;
12
12
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -15,7 +15,7 @@ declare const Carousel: {
15
15
  asChild?: boolean | undefined;
16
16
  } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
17
17
  Previous: import("react").ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
18
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
18
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
19
19
  outline?: boolean | undefined;
20
20
  wide?: boolean | undefined;
21
21
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -8,7 +8,7 @@ declare const Command: {
8
8
  ref?: React.Ref<HTMLInputElement> | undefined;
9
9
  } & {
10
10
  asChild?: boolean | undefined;
11
- }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
11
+ }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
12
12
  value?: string | undefined;
13
13
  onValueChange?: ((search: string) => void) | undefined;
14
14
  } & React.RefAttributes<HTMLInputElement>, "ref"> & {} & React.RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
2
+ declare const Checkbox: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "type" | "ref" | "size"> & {
3
3
  variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
4
4
  size?: "xs" | "sm" | "md" | "lg" | undefined;
5
5
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- export declare const Input: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
3
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
2
+ export declare const Input: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "ref" | "size"> & Omit<{
3
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
4
+ type?: string | number | undefined;
4
5
  outline?: boolean | undefined;
5
6
  wide?: boolean | undefined;
6
7
  size?: "xs" | "sm" | "md" | "lg" | undefined;
7
- } & React.RefAttributes<HTMLInputElement>>;
8
+ }, "type"> & React.RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,7 @@
1
1
  export declare const getInputClasses: (props?: ({
2
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  wide?: boolean | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
6
+ type?: string | number | null | undefined;
6
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { type VariantProps } from "../../../libs";
3
3
  import { getInputClasses } from "./constants";
4
- export type InputProps = Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & VariantProps<typeof getInputClasses>;
4
+ export type InputProps = Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & Omit<VariantProps<typeof getInputClasses>, "type">;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const Radio: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
2
+ declare const Radio: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "type" | "ref" | "size"> & {
3
3
  variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
4
4
  size?: "xs" | "sm" | "md" | "lg" | undefined;
5
5
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const Range: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
2
+ declare const Range: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "type" | "ref" | "size"> & {
3
3
  variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
4
4
  wide?: boolean | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- declare const Switch: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref" | "type"> & {
2
+ declare const Switch: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "type" | "ref" | "size"> & {
3
3
  variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
4
4
  size?: "xs" | "sm" | "md" | "lg" | undefined;
5
5
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
- export declare const TextField: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "size" | "ref"> & {
3
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
2
+ export declare const TextField: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLInputElement>, "ref" | "size"> & Omit<{
3
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
4
+ type?: string | number | undefined;
4
5
  outline?: boolean | undefined;
5
6
  wide?: boolean | undefined;
6
7
  size?: "xs" | "sm" | "md" | "lg" | undefined;
7
- } & {
8
+ }, "type"> & {
8
9
  info?: React.ReactNode;
9
10
  error?: string | string[] | null | undefined;
10
11
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,6 @@
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" | undefined;
2
+ declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "ref" | "size"> & {
3
+ variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
4
4
  outline?: boolean | undefined;
5
5
  wide?: boolean | undefined;
6
6
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const getTextareaClasses: (props?: ({
2
- variant?: "accent" | "error" | "ghost" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  wide?: boolean | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import * as ProgressPrimitive from "@radix-ui/react-progress";
3
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;
4
+ variant?: "accent" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | "base" | undefined;
5
5
  } & React.RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,6 @@
1
1
  export declare const getProgressClasses: (props?: ({
2
- variant?: "accent" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | null | undefined;
2
+ variant?: "accent" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | "base" | null | undefined;
3
3
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
4
  export declare const getProgressIndicatorClasses: (props?: ({
5
- variant?: "accent" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | null | undefined;
5
+ variant?: "accent" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | "base" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -6,6 +6,6 @@ declare const ScrollArea: {
6
6
  displayName: string | undefined;
7
7
  };
8
8
  declare const Scrollbar: import("react").ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
9
- variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | undefined;
9
+ variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | "base" | undefined;
10
10
  } & import("react").RefAttributes<HTMLDivElement>>;
11
11
  export { ScrollArea, Scrollbar };
@@ -3,6 +3,6 @@ export declare const getScrollAreaScrollbarClasses: (props?: ({
3
3
  orientation?: "horizontal" | "vertical" | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export declare const getScrollAreaThumbClasses: (props?: ({
6
- variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | null | undefined;
6
+ variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | "base" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  export declare const getScrollAreaViewportClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -1,5 +1,5 @@
1
1
  export declare const getToastClasses: (props?: ({
2
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
5
  export declare const getToastButtonClasses: (props?: ({
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import * as TogglePrimitive from "@radix-ui/react-toggle";
3
3
  declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & Omit<{
4
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
4
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
5
5
  outline?: boolean | undefined;
6
6
  wide?: boolean | undefined;
7
7
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -4,7 +4,7 @@ import type { ToggleGroupProps } from "./types";
4
4
  declare const ToggleGroup: {
5
5
  ({ className, variant, children, ...props }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
6
6
  Item: import("react").ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & Omit<{
7
- variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
7
+ variant?: "accent" | "default" | "error" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
8
8
  outline?: boolean | undefined;
9
9
  wide?: boolean | undefined;
10
10
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,4 +1,5 @@
1
1
  /** actions */
2
+ export * from "./components/Anchor";
2
3
  export * from "./components/Button";
3
4
  export * from "./components/Breadcrumbs";
4
5
  export * from "./components/Menu";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mbao01/common",
3
3
  "private": false,
4
- "version": "0.0.29",
4
+ "version": "0.0.30",
5
5
  "type": "module",
6
6
  "author": "Ayomide Bakare",
7
7
  "license": "MIT",
@@ -142,5 +142,5 @@
142
142
  "react-dom": "^18.2.0",
143
143
  "typescript": "^5.2.2"
144
144
  },
145
- "gitHead": "1ccc8b44c98ab629a4ec708e3ee1bee6d9e13be8"
145
+ "gitHead": "1ab357d82f27002c7a0fe7211a39248077ce33d3"
146
146
  }
@@ -0,0 +1,29 @@
1
+ import { ExternalLinkIcon } from "@radix-ui/react-icons";
2
+ import { type AnchorProps } from "./types";
3
+ import { getAnchorClasses } from "./constant";
4
+ import { cn } from "../../utilities";
5
+
6
+ export const Anchor = ({
7
+ href,
8
+ hover,
9
+ variant,
10
+ children,
11
+ className,
12
+ underline = false,
13
+ isExternal = false,
14
+ ...props
15
+ }: AnchorProps) => {
16
+ return (
17
+ <a
18
+ href={href}
19
+ className={cn(getAnchorClasses({ hover, variant, underline }), className)}
20
+ {...props}
21
+ {...(isExternal && { rel: "noopener noreferrer" })}
22
+ >
23
+ {children}
24
+ {isExternal ? (
25
+ <ExternalLinkIcon name="external" className="ml-[2px] inline" />
26
+ ) : null}
27
+ </a>
28
+ );
29
+ };
@@ -0,0 +1,24 @@
1
+ import { cva } from "../../libs";
2
+
3
+ export const getAnchorClasses = cva("link transition-all", {
4
+ variants: {
5
+ variant: {
6
+ accent: "link-accent",
7
+ default: "link-default",
8
+ error: "link-error",
9
+ info: "link-info",
10
+ link: "link-link",
11
+ neutral: "link-neutral",
12
+ primary: "link-primary",
13
+ secondary: "link-secondary",
14
+ success: "link-success",
15
+ warning: "link-warning",
16
+ },
17
+ hover: {
18
+ true: "link-hover",
19
+ },
20
+ underline: {
21
+ false: "no-underline",
22
+ },
23
+ },
24
+ });
@@ -0,0 +1 @@
1
+ export { Anchor } from "./Anchor";
@@ -0,0 +1,6 @@
1
+ import { VariantProps } from "../../libs";
2
+ import { getAnchorClasses } from "./constant";
3
+
4
+ export type AnchorProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
5
+ isExternal?: boolean;
6
+ } & VariantProps<typeof getAnchorClasses>;
@@ -4,11 +4,15 @@ import { cn } from "../../../utilities";
4
4
  import { getInputClasses } from "./constants";
5
5
 
6
6
  export const Input = React.forwardRef<HTMLInputElement, InputProps>(
7
- ({ size, variant, wide, outline, className, ...props }: InputProps, ref) => (
7
+ (
8
+ { size, variant, wide, outline, className, type, ...props }: InputProps,
9
+ ref
10
+ ) => (
8
11
  <input
9
12
  ref={ref}
13
+ type={type}
10
14
  className={cn(
11
- getInputClasses({ size, wide, variant, outline }),
15
+ getInputClasses({ type, size, wide, variant, outline }),
12
16
  className
13
17
  )}
14
18
  {...props}
@@ -27,6 +27,10 @@ export const getInputClasses = cva(
27
27
  md: "input-md",
28
28
  lg: "input-lg",
29
29
  },
30
+ type: {
31
+ ["file" as string]:
32
+ "file:border-0 file:bg-transparent file:text-sm file:font-medium file:h-full",
33
+ },
30
34
  },
31
35
  compoundVariants: [
32
36
  {
@@ -5,4 +5,4 @@ export type InputProps = Omit<
5
5
  React.HTMLProps<HTMLInputElement>,
6
6
  "size" | "ref"
7
7
  > &
8
- VariantProps<typeof getInputClasses>;
8
+ Omit<VariantProps<typeof getInputClasses>, "type">;
@@ -1,7 +1,7 @@
1
1
  import { cva } from "../../../libs";
2
2
 
3
3
  export const getSelectTriggerClasses = cva(
4
- "select flex items-center justify-between rounded-md text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
4
+ "select flex items-center justify-between rounded-md text-sm text-left ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
5
5
  {
6
6
  variants: {
7
7
  variant: {
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /** actions */
2
+ export * from "./components/Anchor";
2
3
  export * from "./components/Button";
3
4
  export * from "./components/Breadcrumbs";
4
5
  export * from "./components/Menu";