@mbao01/common 0.0.4 → 0.0.6
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/README.md +1 -2
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Badge/constants.d.ts +5 -5
- package/dist/types/components/Badge/types.d.ts +3 -7
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/types/components/Breadcrumbs/types.d.ts +2 -0
- package/dist/types/components/Button/Button.d.ts +11 -2
- package/dist/types/components/Button/constants.d.ts +7 -8
- package/dist/types/components/Button/types.d.ts +6 -12
- package/dist/types/components/Card/Card.d.ts +10 -8
- package/dist/types/components/Card/constants.d.ts +6 -0
- package/dist/types/components/Card/types.d.ts +3 -18
- package/dist/types/components/Description/Description.d.ts +7 -0
- package/dist/types/components/Description/index.d.ts +1 -0
- package/dist/types/components/Description/types.d.ts +3 -0
- package/dist/types/components/Loading/Loading.d.ts +2 -0
- package/dist/types/components/Loading/constants.d.ts +5 -0
- package/dist/types/components/Loading/index.d.ts +1 -0
- package/dist/types/components/Loading/types.d.ts +3 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/types/components/Skeleton/constants.d.ts +6 -0
- package/dist/types/components/Skeleton/index.d.ts +1 -0
- package/dist/types/components/Skeleton/types.d.ts +3 -0
- package/dist/types/components/Text/Text.d.ts +2 -4
- package/dist/types/components/Text/constants.d.ts +4 -5
- package/dist/types/components/Text/types.d.ts +4 -9
- package/dist/types/components/Tooltip/Tooltip.d.ts +14 -2
- package/dist/types/components/Tooltip/constants.d.ts +6 -5
- package/dist/types/components/Tooltip/index.d.ts +1 -1
- package/dist/types/components/Tooltip/types.d.ts +5 -10
- package/dist/types/index.d.ts +9 -2
- package/dist/types/libs/cva.d.ts +1 -0
- package/dist/types/libs/index.d.ts +1 -0
- package/dist/types/utilities/cn.d.ts +2 -0
- package/dist/types/utilities/getSubpaths/getSubpaths.d.ts +6 -0
- package/dist/types/utilities/getSubpaths/index.d.ts +1 -0
- package/dist/types/utilities/index.d.ts +2 -0
- package/package.json +12 -5
- package/plugin.js +1 -3
- package/src/components/Badge/Badge.tsx +4 -14
- package/src/components/Badge/constants.ts +28 -30
- package/src/components/Badge/types.ts +4 -17
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +13 -0
- package/src/components/Breadcrumbs/index.ts +1 -0
- package/src/components/Breadcrumbs/types.ts +3 -0
- package/src/components/Button/Button.tsx +51 -37
- package/src/components/Button/constants.ts +39 -43
- package/src/components/Button/types.ts +7 -25
- package/src/components/Card/Card.tsx +16 -23
- package/src/components/Card/constants.ts +22 -0
- package/src/components/Card/types.ts +4 -18
- package/src/components/Description/Description.tsx +34 -0
- package/src/components/Description/index.ts +1 -0
- package/src/components/Description/types.ts +5 -0
- package/src/components/Loading/Loading.tsx +18 -0
- package/src/components/Loading/constants.ts +30 -0
- package/src/components/Loading/index.ts +1 -0
- package/src/components/Loading/types.ts +5 -0
- package/src/components/Skeleton/Skeleton.tsx +22 -0
- package/src/components/Skeleton/constants.ts +40 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/Skeleton/types.ts +5 -0
- package/src/components/Text/Text.tsx +24 -9
- package/src/components/Text/constants.ts +26 -28
- package/src/components/Text/types.ts +9 -20
- package/src/components/Tooltip/Tooltip.tsx +36 -11
- package/src/components/Tooltip/constants.ts +32 -31
- package/src/components/Tooltip/index.ts +1 -1
- package/src/components/Tooltip/types.ts +13 -22
- package/src/index.ts +12 -2
- package/src/libs/cva.ts +1 -0
- package/src/libs/index.ts +1 -0
- package/src/utilities/cn.ts +6 -0
- package/src/utilities/getSubpaths/getSubpaths.ts +34 -0
- package/src/utilities/getSubpaths/index.ts +1 -0
- package/src/utilities/index.ts +2 -0
- package/vitest-setup.ts +11 -1
- package/dist/types/components/Detail/Detail.d.ts +0 -2
- package/dist/types/components/Detail/index.d.ts +0 -1
- package/dist/types/components/Detail/types.d.ts +0 -5
- package/src/components/Detail/Detail.tsx +0 -10
- package/src/components/Detail/index.ts +0 -1
- package/src/components/Detail/types.ts +0 -6
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type BadgeProps } from "./types";
|
|
2
|
-
export declare const Badge: ({ size, outline, variant,
|
|
2
|
+
export declare const Badge: ({ size, outline, variant, className, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}) => string;
|
|
1
|
+
export declare const getBadgeClasses: (props?: ({
|
|
2
|
+
variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
|
+
outline?: boolean | null | undefined;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
4
|
-
size?: BadgeSize;
|
|
5
|
-
outline?: boolean;
|
|
6
|
-
variant?: BadgeVariant;
|
|
7
|
-
};
|
|
1
|
+
import { type VariantProps } from "../../libs";
|
|
2
|
+
import { getBadgeClasses } from "./constants";
|
|
3
|
+
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof getBadgeClasses>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breadcrumbs } from "./Breadcrumbs";
|
|
@@ -1,2 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<(props?: ({
|
|
3
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
4
|
+
outline?: boolean | null | undefined;
|
|
5
|
+
wide?: boolean | null | undefined;
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
isLoading?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
9
|
+
as?: "a" | "span" | "p" | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export { Button };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
wide?: boolean | undefined;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}) => string;
|
|
1
|
+
export declare const getButtonClasses: (props?: ({
|
|
2
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
|
+
outline?: boolean | null | undefined;
|
|
4
|
+
wide?: boolean | null | undefined;
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
6
|
+
isLoading?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type ButtonProps = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
label: ReactNode;
|
|
8
|
-
loading?: boolean;
|
|
9
|
-
outline?: boolean;
|
|
10
|
-
variant?: ButtonVariant;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
1
|
+
import { type VariantProps } from "../../libs";
|
|
2
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
3
|
+
import { getButtonClasses } from "./constants";
|
|
4
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof getButtonClasses> & {
|
|
5
|
+
as?: keyof Pick<JSX.IntrinsicElements, "a" | "span" | "p">;
|
|
6
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardImageProps, CardProps } from "./types";
|
|
2
|
-
declare const Card:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardImageProps, CardProps } from "./types";
|
|
2
|
+
declare const Card: {
|
|
3
|
+
({ compact, bordered, horizontal, overlay, className, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Header: ({ className, ...props }: CardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Content: ({ className, ...props }: CardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Description: ({ className, ...props }: CardDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Image: ({ className, src, alt, ...props }: CardImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Footer: ({ className, ...props }: CardFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export { Card };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getCardClasses: (props?: ({
|
|
2
|
+
bordered?: boolean | null | undefined;
|
|
3
|
+
compact?: boolean | null | undefined;
|
|
4
|
+
horizontal?: boolean | null | undefined;
|
|
5
|
+
overlay?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
compact?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* applies border to the card.
|
|
9
|
-
*/
|
|
10
|
-
bordered?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* shows the card horizontally with image to the right or left of it.
|
|
13
|
-
*/
|
|
14
|
-
horizontal?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* overlay is used to make the image full width with the content on top.
|
|
17
|
-
*/
|
|
18
|
-
overlay?: boolean;
|
|
19
|
-
} & React.HTMLAttributes<HTMLDivElement>;
|
|
2
|
+
import { type VariantProps } from "../../libs";
|
|
3
|
+
import { getCardClasses } from "./constants";
|
|
4
|
+
export type CardProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof getCardClasses>;
|
|
20
5
|
export type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
21
6
|
export type CardImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
|
|
22
7
|
export type CardHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DescriptionProps, DescriptionTermProps, DescriptionDetailProps } from "./types";
|
|
2
|
+
declare const Description: {
|
|
3
|
+
(props: DescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
Term: ({ className, ...props }: DescriptionTermProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
Detail: ({ className, ...props }: DescriptionDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export { Description };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Description } from "./Description";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getLoadingClasses: (props?: ({
|
|
2
|
+
variant?: "spinner" | "dots" | "ring" | "ball" | "bars" | "infinity" | null | undefined;
|
|
3
|
+
intent?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading } from "./Loading";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getSkeletonClasses: (props?: ({
|
|
2
|
+
variant?: "pulse" | null | undefined;
|
|
3
|
+
width?: "full" | 4 | 2 | 8 | 12 | 16 | 24 | 32 | 48 | 64 | null | undefined;
|
|
4
|
+
height?: "full" | 4 | 2 | 8 | 12 | 16 | 24 | 32 | 48 | 64 | null | undefined;
|
|
5
|
+
round?: boolean | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton } from "./Skeleton";
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { type TextProps } from
|
|
2
|
-
export declare const Text: ({ as, size, variant, children, className }: TextProps) => import("react").
|
|
3
|
-
className: string;
|
|
4
|
-
}, HTMLElement>;
|
|
1
|
+
import { type TextProps } from "./types";
|
|
2
|
+
export declare const Text: ({ as, size, variant, children, className, ...props }: TextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
size?:
|
|
4
|
-
|
|
5
|
-
}) => string;
|
|
1
|
+
export declare const getTextClasses: (props?: ({
|
|
2
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
|
+
size?: "xs" | "sm" | "lg" | "base" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
as?: TextTag;
|
|
6
|
-
size?: TextSize;
|
|
7
|
-
variant?: TextVariant;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
className?: string;
|
|
1
|
+
import { type VariantProps } from "../../libs";
|
|
2
|
+
import { getTextClasses } from "./constants";
|
|
3
|
+
export type TextProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof getTextClasses> & {
|
|
4
|
+
as?: keyof Pick<JSX.IntrinsicElements, "h1" | "h2" | "h3" | "h4" | "h5" | "p">;
|
|
10
5
|
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import type { TooltipArrowProps } from "./types";
|
|
4
|
+
declare const Tooltip: {
|
|
5
|
+
(props: TooltipPrimitive.TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Content: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & TooltipPrimitive.TooltipContentProps & import("class-variance-authority").VariantProps<(props?: ({
|
|
7
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
Arrow: ({ className, variant, ...props }: TooltipArrowProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Portal: React.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
11
|
+
Provider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
12
|
+
Trigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
};
|
|
14
|
+
export { Tooltip };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export declare const getTooltipContentClasses: (props?: ({
|
|
2
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const getTooltipArrowClasses: (props?: ({
|
|
5
|
+
variant?: "accent" | "error" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Tooltip } from
|
|
1
|
+
export { Tooltip } from "./Tooltip";
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
variant?: TooltipVariant;
|
|
8
|
-
position?: TooltipPosition;
|
|
9
|
-
className?: string;
|
|
10
|
-
};
|
|
1
|
+
import { type VariantProps } from "../../libs";
|
|
2
|
+
import { getTooltipArrowClasses, getTooltipContentClasses } from "./constants";
|
|
3
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
+
export type TooltipArrowProps = React.HTMLAttributes<React.ElementRef<typeof TooltipPrimitive.Arrow>> & TooltipPrimitive.TooltipArrowProps & VariantProps<typeof getTooltipArrowClasses>;
|
|
5
|
+
export type TooltipContentProps = React.HTMLAttributes<React.ElementRef<typeof TooltipPrimitive.Content>> & TooltipPrimitive.TooltipContentProps & VariantProps<typeof getTooltipContentClasses>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** actions */
|
|
2
2
|
export * from "./components/Button";
|
|
3
|
+
export * from "./components/Breadcrumbs";
|
|
4
|
+
/** data display */
|
|
5
|
+
export * from "./components/Badge";
|
|
3
6
|
export * from "./components/Card";
|
|
4
|
-
export * from "./components/
|
|
7
|
+
export * from "./components/Description";
|
|
5
8
|
export * from "./components/Text";
|
|
9
|
+
/** data input */
|
|
10
|
+
/** feedback */
|
|
11
|
+
export * from "./components/Loading";
|
|
12
|
+
export * from "./components/Skeleton";
|
|
6
13
|
export * from "./components/Tooltip";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { cva, type VariantProps } from "./cva";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getSubpaths } from "./getSubpaths";
|
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.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Ayomide Bakare",
|
|
7
7
|
"license": "MIT",
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"default": "./src/index.ts"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
+
"./libs": "./src/libs/index.ts",
|
|
23
24
|
"./plugin": "./plugin.js",
|
|
25
|
+
"./utilities": "./src/utilities/index.ts",
|
|
24
26
|
"./vitest/setup": "./vitest-setup.ts",
|
|
25
27
|
"./vitest/config": "./vitest.config.ts",
|
|
26
28
|
"./styles": "./src/stylesheets/index.css"
|
|
@@ -38,7 +40,7 @@
|
|
|
38
40
|
"vitest.config.ts"
|
|
39
41
|
],
|
|
40
42
|
"bugs": "https://github.com/mbao01/mbao01/issues",
|
|
41
|
-
"homepage": "https://
|
|
43
|
+
"homepage": "https://ui.ayomidebakare.site/common/",
|
|
42
44
|
"repository": {
|
|
43
45
|
"type": "git",
|
|
44
46
|
"url": "git+https://github.com/mbao01/mbao01.git"
|
|
@@ -58,8 +60,14 @@
|
|
|
58
60
|
"test:coverage": "vitest run --coverage"
|
|
59
61
|
},
|
|
60
62
|
"dependencies": {
|
|
63
|
+
"@radix-ui/react-icons": "^1.3.0",
|
|
64
|
+
"@radix-ui/react-slot": "^1.0.2",
|
|
65
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
66
|
+
"class-variance-authority": "^0.7.0",
|
|
61
67
|
"clsx": "^2.1.0",
|
|
62
|
-
"daisyui": "^4.6.2"
|
|
68
|
+
"daisyui": "^4.6.2",
|
|
69
|
+
"tailwind-merge": "^2.2.1",
|
|
70
|
+
"tailwindcss-animate": "^1.0.7"
|
|
63
71
|
},
|
|
64
72
|
"devDependencies": {
|
|
65
73
|
"@storybook/addon-essentials": "^7.6.14",
|
|
@@ -102,10 +110,9 @@
|
|
|
102
110
|
"vitest": "^1.2.2"
|
|
103
111
|
},
|
|
104
112
|
"peerDependencies": {
|
|
105
|
-
"@heroicons/react": "^2.1.1",
|
|
106
113
|
"react": "^18.2.0",
|
|
107
114
|
"react-dom": "^18.2.0",
|
|
108
115
|
"typescript": "^5.2.2"
|
|
109
116
|
},
|
|
110
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "ceb6cef48e8547b4da5c51dda329bd6edee73c0b"
|
|
111
118
|
}
|
package/plugin.js
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cn } from "../../utilities";
|
|
2
2
|
import { getBadgeClasses } from "./constants";
|
|
3
3
|
import { type BadgeProps } from "./types";
|
|
4
4
|
|
|
5
5
|
export const Badge = ({
|
|
6
6
|
size,
|
|
7
7
|
outline,
|
|
8
|
-
variant
|
|
9
|
-
children,
|
|
8
|
+
variant,
|
|
10
9
|
className,
|
|
11
10
|
...props
|
|
12
11
|
}: BadgeProps) => {
|
|
13
12
|
return (
|
|
14
13
|
<span
|
|
14
|
+
className={cn(getBadgeClasses({ size, variant, outline }), className)}
|
|
15
15
|
{...props}
|
|
16
|
-
|
|
17
|
-
getBadgeClasses({ size, variant }),
|
|
18
|
-
{
|
|
19
|
-
"badge-outline": outline,
|
|
20
|
-
"text-base-200": !["ghost", "neutral"].includes(variant),
|
|
21
|
-
},
|
|
22
|
-
className
|
|
23
|
-
)}
|
|
24
|
-
>
|
|
25
|
-
{children}
|
|
26
|
-
</span>
|
|
16
|
+
/>
|
|
27
17
|
);
|
|
28
18
|
};
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { BadgeSize, BadgeVariant } from "./types";
|
|
1
|
+
import { cva } from "../../libs";
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
};
|
|
3
|
+
export const getBadgeClasses = cva("badge", {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
accent: "badge-accent",
|
|
7
|
+
error: "badge-error",
|
|
8
|
+
ghost: "badge-ghost",
|
|
9
|
+
info: "badge-info",
|
|
10
|
+
neutral: "badge-neutral",
|
|
11
|
+
primary: "badge-primary",
|
|
12
|
+
secondary: "badge-secondary",
|
|
13
|
+
success: "badge-success",
|
|
14
|
+
warning: "badge-warning",
|
|
15
|
+
},
|
|
16
|
+
outline: {
|
|
17
|
+
true: "badge-outline",
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
xs: "badge-xs",
|
|
21
|
+
sm: "badge-sm",
|
|
22
|
+
md: "badge-md",
|
|
23
|
+
lg: "badge-lg",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type VariantProps } from "../../libs";
|
|
2
|
+
import { getBadgeClasses } from "./constants";
|
|
2
3
|
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
| "primary"
|
|
6
|
-
| "secondary"
|
|
7
|
-
| "accent"
|
|
8
|
-
| "ghost"
|
|
9
|
-
| "info"
|
|
10
|
-
| "success"
|
|
11
|
-
| "warning"
|
|
12
|
-
| "error";
|
|
13
|
-
|
|
14
|
-
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
15
|
-
size?: BadgeSize;
|
|
16
|
-
outline?: boolean;
|
|
17
|
-
variant?: BadgeVariant;
|
|
18
|
-
};
|
|
4
|
+
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
5
|
+
VariantProps<typeof getBadgeClasses>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BreadcrumbProps, BreadcrumbsProps } from "./types";
|
|
2
|
+
|
|
3
|
+
export const Breadcrumbs = (props: BreadcrumbsProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="breadcrumbs -ml-1 w-fit px-1 text-sm">
|
|
6
|
+
<ul {...props} />
|
|
7
|
+
</div>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Breadcrumb = (props: BreadcrumbProps) => {
|
|
12
|
+
return <li {...props} />;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Breadcrumbs } from "./Breadcrumbs";
|