@mbao01/common 0.0.18 → 0.0.20
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/Accordion/Accordion.d.ts +10 -0
- package/dist/types/components/Accordion/constants.d.ts +3 -0
- package/dist/types/components/Accordion/index.d.ts +1 -0
- package/dist/types/components/Accordion/types.d.ts +6 -0
- package/dist/types/components/Carousel/Carousel.d.ts +27 -0
- package/dist/types/components/Carousel/CarouselContext.d.ts +3 -0
- package/dist/types/components/Carousel/constants.d.ts +12 -0
- package/dist/types/components/Carousel/index.d.ts +1 -0
- package/dist/types/components/Carousel/types.d.ts +21 -0
- package/dist/types/components/Carousel/useCarousel.d.ts +1 -0
- package/dist/types/components/Collapsible/Collapsible.d.ts +9 -0
- package/dist/types/components/Collapsible/index.d.ts +1 -0
- package/dist/types/components/Collapsible/types.d.ts +3 -0
- package/dist/types/components/Drawer/Drawer.d.ts +41 -0
- package/dist/types/components/Drawer/constants.d.ts +6 -0
- package/dist/types/components/Drawer/index.d.ts +1 -0
- package/dist/types/components/Drawer/types.d.ts +3 -0
- package/dist/types/components/HoverCard/HoverCard.d.ts +9 -0
- package/dist/types/components/HoverCard/constants.d.ts +1 -0
- package/dist/types/components/HoverCard/index.d.ts +1 -0
- package/dist/types/components/HoverCard/types.d.ts +3 -0
- package/dist/types/components/Pagination/Pagination.d.ts +25 -0
- package/dist/types/components/Pagination/constants.d.ts +5 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/Pagination/types.d.ts +12 -0
- package/dist/types/components/ScrollArea/ScrollArea.d.ts +11 -0
- package/dist/types/components/ScrollArea/constants.d.ts +8 -0
- package/dist/types/components/ScrollArea/index.d.ts +1 -0
- package/dist/types/components/ScrollArea/types.d.ts +8 -0
- package/dist/types/index.d.ts +7 -1
- package/package.json +9 -3
- package/src/components/Accordion/Accordion.tsx +68 -0
- package/src/components/Accordion/constants.ts +11 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Accordion/types.ts +17 -0
- package/src/components/Carousel/Carousel.tsx +204 -0
- package/src/components/Carousel/CarouselContext.ts +4 -0
- package/src/components/Carousel/constants.ts +58 -0
- package/src/components/Carousel/index.ts +1 -0
- package/src/components/Carousel/types.ts +24 -0
- package/src/components/Carousel/useCarousel.ts +12 -0
- package/src/components/Collapsible/Collapsible.tsx +13 -0
- package/src/components/Collapsible/index.ts +1 -0
- package/src/components/Collapsible/types.ts +5 -0
- package/src/components/Drawer/Drawer.tsx +121 -0
- package/src/components/Drawer/constants.ts +19 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/Drawer/types.ts +3 -0
- package/src/components/HoverCard/HoverCard.tsx +30 -0
- package/src/components/HoverCard/constants.ts +5 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/HoverCard/types.ts +5 -0
- package/src/components/Pagination/Pagination.tsx +132 -0
- package/src/components/Pagination/constants.ts +15 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Pagination/types.ts +19 -0
- package/src/components/ScrollArea/ScrollArea.tsx +52 -0
- package/src/components/ScrollArea/constants.ts +36 -0
- package/src/components/ScrollArea/index.ts +1 -0
- package/src/components/ScrollArea/types.ts +14 -0
- package/src/index.ts +7 -1
- package/vitest-setup.ts +3 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
import type { AccordionProps } from "./types";
|
|
4
|
+
declare const Accordion: {
|
|
5
|
+
(props: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Item: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Trigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
Content: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
};
|
|
10
|
+
export { Accordion };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const getAccordionItemClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const getAccordionTriggerClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const getAccordionContentClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion } from "./Accordion";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
export type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root>;
|
|
4
|
+
export type AccordionContentProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>;
|
|
5
|
+
export type AccordionItemProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
6
|
+
export type AccordionTriggerProps = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CarouselProps } from "./types";
|
|
3
|
+
declare const Carousel: {
|
|
4
|
+
({ orientation, opts, setApi, plugins, className, children, ...props }: CarouselProps & React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
Content: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Item: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Next: import("react").ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
9
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
10
|
+
outline?: boolean | undefined;
|
|
11
|
+
wide?: boolean | undefined;
|
|
12
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
13
|
+
isLoading?: boolean | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
as?: "a" | "span" | "p" | undefined;
|
|
16
|
+
} & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
Previous: import("react").ForwardRefExoticComponent<Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
18
|
+
variant?: "accent" | "default" | "error" | "ghost" | "info" | "link" | "neutral" | "primary" | "secondary" | "success" | "warning" | undefined;
|
|
19
|
+
outline?: boolean | undefined;
|
|
20
|
+
wide?: boolean | undefined;
|
|
21
|
+
size?: "xs" | "sm" | "md" | "lg" | undefined;
|
|
22
|
+
isLoading?: boolean | undefined;
|
|
23
|
+
} & {
|
|
24
|
+
as?: "a" | "span" | "p" | undefined;
|
|
25
|
+
} & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
};
|
|
27
|
+
export { Carousel };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const getCarouselContentClasses: (props?: ({
|
|
2
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const getCarouselItemClasses: (props?: ({
|
|
5
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export declare const getCarouselNextClasses: (props?: ({
|
|
8
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export declare const getCarouselPreviousClasses: (props?: ({
|
|
11
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
12
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Carousel } from "./Carousel";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
2
|
+
import useEmblaCarousel from "embla-carousel-react";
|
|
3
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
4
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
5
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
6
|
+
export type CarouselApi = UseEmblaCarouselType[1];
|
|
7
|
+
export type CarouselProps = {
|
|
8
|
+
opts?: CarouselOptions;
|
|
9
|
+
plugins?: CarouselPlugin;
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
setApi?: (api: CarouselApi) => void;
|
|
12
|
+
};
|
|
13
|
+
export type CarouselContextProps = {
|
|
14
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
15
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
16
|
+
scrollPrev: () => void;
|
|
17
|
+
scrollNext: () => void;
|
|
18
|
+
canScrollPrev: boolean;
|
|
19
|
+
canScrollNext: boolean;
|
|
20
|
+
} & CarouselProps;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCarousel(): import("./types").CarouselContextProps;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
import { type CollapsibleProps } from "@radix-ui/react-accordion";
|
|
4
|
+
declare const Collapsible: {
|
|
5
|
+
(props: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Trigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
Content: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
};
|
|
9
|
+
export { Collapsible };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Collapsible } from "./Collapsible";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DrawerProps } from "./types";
|
|
3
|
+
declare const Drawer: {
|
|
4
|
+
({ shouldScaleBackground, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
Portal: import("react").FC<import("@radix-ui/react-dialog").DialogPortalProps>;
|
|
7
|
+
Overlay: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
Trigger: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
Close: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
Content: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
|
+
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
12
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Header: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
Footer: {
|
|
18
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Title: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
22
|
+
Description: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
};
|
|
24
|
+
declare const DrawerTrigger: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
declare const DrawerPortal: import("react").FC<import("@radix-ui/react-dialog").DialogPortalProps>;
|
|
26
|
+
declare const DrawerClose: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
27
|
+
declare const DrawerOverlay: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const DrawerContent: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
29
|
+
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
30
|
+
} & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const DrawerHeader: {
|
|
32
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
35
|
+
declare const DrawerFooter: {
|
|
36
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
declare const DrawerTitle: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
40
|
+
declare const DrawerDescription: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
41
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getDrawerContentClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const getDrawerDescriptionClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const getDrawerHeaderClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const getDrawerFooterClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
export declare const getDrawerOverlayClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const getDrawerTitleClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Drawer } from "./Drawer";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
+
import { HoverCardProps } from "./types";
|
|
4
|
+
declare const HoverCard: {
|
|
5
|
+
(props: HoverCardProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
Content: import("react").ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
Trigger: import("react").ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
};
|
|
9
|
+
export { HoverCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getHoverCardContentClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HoverCard } from "./HoverCard";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PaginationEllipsisProps, PaginationLinkProps, PaginationNextProps, PaginationPreviousProps, type PaginationProps } from "./types";
|
|
3
|
+
declare const Pagination: {
|
|
4
|
+
({ className, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
7
|
+
Link: {
|
|
8
|
+
({ className, size, wide, outline, variant, isActive, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
12
|
+
Previous: {
|
|
13
|
+
({ className, children, ...props }: PaginationPreviousProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
Next: {
|
|
17
|
+
({ className, children, ...props }: PaginationNextProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
Ellipsis: {
|
|
21
|
+
({ className, ...props }: PaginationEllipsisProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export { Pagination };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getPaginationClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const getPaginationContentClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const getPaginationEllipsisClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const getPaginationNextClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
export declare const getPaginationPreviousClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from "./Pagination";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VariantProps } from "../../libs";
|
|
3
|
+
import { getButtonClasses } from "../Button/constants";
|
|
4
|
+
export type PaginationProps = React.ComponentProps<"nav">;
|
|
5
|
+
export type PaginationContentProps = React.ComponentProps<"ul">;
|
|
6
|
+
export type PaginationEllipsisProps = React.ComponentProps<"span">;
|
|
7
|
+
export type PaginationItemProps = React.ComponentProps<"li">;
|
|
8
|
+
export type PaginationLinkProps = React.ComponentProps<"a"> & VariantProps<typeof getButtonClasses> & {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type PaginationPreviousProps = PaginationLinkProps;
|
|
12
|
+
export type PaginationNextProps = PaginationLinkProps;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
import type { ScrollAreaProps } from "./types";
|
|
4
|
+
declare const ScrollArea: {
|
|
5
|
+
({ className, children, scrollbar, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string | undefined;
|
|
7
|
+
};
|
|
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;
|
|
10
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { ScrollArea, Scrollbar };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const getScrollAreaClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const getScrollAreaScrollbarClasses: (props?: ({
|
|
3
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
4
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
|
+
export declare const getScrollAreaThumbClasses: (props?: ({
|
|
6
|
+
variant?: "accent" | "error" | "ghost" | "info" | "neutral" | "primary" | "secondary" | "success" | "warning" | "base" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare const getScrollAreaViewportClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScrollArea } from "./ScrollArea";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
import { VariantProps } from "../../libs";
|
|
4
|
+
import { getScrollAreaThumbClasses } from "./constants";
|
|
5
|
+
export type ScrollAreaProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
|
|
6
|
+
scrollbar?: ScrollbarProps;
|
|
7
|
+
};
|
|
8
|
+
export type ScrollbarProps = React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar> & VariantProps<typeof getScrollAreaThumbClasses>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
/** actions */
|
|
2
2
|
export * from "./components/Button";
|
|
3
3
|
export * from "./components/Breadcrumbs";
|
|
4
|
+
export * from "./components/Pagination";
|
|
4
5
|
export * from "./components/Toggle";
|
|
6
|
+
export * from "./components/ToggleGroup";
|
|
5
7
|
/** data display */
|
|
8
|
+
export * from "./components/Accordion";
|
|
6
9
|
export * from "./components/Alert";
|
|
7
10
|
export * from "./components/Avatar";
|
|
8
11
|
export * from "./components/Badge";
|
|
9
12
|
export * from "./components/Card";
|
|
10
13
|
export * from "./components/Calendar";
|
|
14
|
+
export * from "./components/Collapsible";
|
|
11
15
|
export * from "./components/Description";
|
|
12
16
|
export * from "./components/Progress";
|
|
17
|
+
export * from "./components/ScrollArea";
|
|
13
18
|
export * from "./components/Separator";
|
|
14
19
|
export * from "./components/Sonner";
|
|
15
20
|
export * from "./components/Tabs";
|
|
@@ -24,6 +29,7 @@ export * from "./components/Skeleton";
|
|
|
24
29
|
export * from "./components/Tooltip";
|
|
25
30
|
/** composable */
|
|
26
31
|
export * from "./components/AlertDialog";
|
|
27
|
-
export * from "./components/Dialog";
|
|
28
32
|
export * from "./components/Command";
|
|
33
|
+
export * from "./components/Dialog";
|
|
34
|
+
export * from "./components/HoverCard";
|
|
29
35
|
export * from "./components/Popover";
|
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.20",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Ayomide Bakare",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,14 +60,18 @@
|
|
|
60
60
|
"test:coverage": "vitest run --coverage"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@radix-ui/react-accordion": "^1.1.2",
|
|
63
64
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
64
65
|
"@radix-ui/react-avatar": "^1.0.4",
|
|
65
66
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
67
|
+
"@radix-ui/react-collapsible": "^1.0.3",
|
|
66
68
|
"@radix-ui/react-dialog": "^1.0.5",
|
|
69
|
+
"@radix-ui/react-hover-card": "^1.0.7",
|
|
67
70
|
"@radix-ui/react-icons": "^1.3.0",
|
|
68
71
|
"@radix-ui/react-label": "^2.0.2",
|
|
69
72
|
"@radix-ui/react-popover": "^1.0.7",
|
|
70
73
|
"@radix-ui/react-progress": "^1.0.3",
|
|
74
|
+
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
71
75
|
"@radix-ui/react-select": "^2.0.0",
|
|
72
76
|
"@radix-ui/react-separator": "^1.0.3",
|
|
73
77
|
"@radix-ui/react-slider": "^1.1.2",
|
|
@@ -81,11 +85,13 @@
|
|
|
81
85
|
"cmdk": "^1.0.0",
|
|
82
86
|
"daisyui": "^4.6.2",
|
|
83
87
|
"date-fns": "^3.6.0",
|
|
88
|
+
"embla-carousel-react": "^8.0.2",
|
|
84
89
|
"react-day-picker": "^8.10.0",
|
|
85
90
|
"react-international-phone": "^4.2.6",
|
|
86
91
|
"sonner": "^1.4.41",
|
|
87
92
|
"tailwind-merge": "^2.2.1",
|
|
88
|
-
"tailwindcss-animate": "^1.0.7"
|
|
93
|
+
"tailwindcss-animate": "^1.0.7",
|
|
94
|
+
"vaul": "^0.9.0"
|
|
89
95
|
},
|
|
90
96
|
"devDependencies": {
|
|
91
97
|
"@storybook/addon-essentials": "^8.0.6",
|
|
@@ -132,5 +138,5 @@
|
|
|
132
138
|
"react-dom": "^18.2.0",
|
|
133
139
|
"typescript": "^5.2.2"
|
|
134
140
|
},
|
|
135
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "957331eff1e44996fb087ad2feef3052d2e1a3f7"
|
|
136
142
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
5
|
+
import type {
|
|
6
|
+
AccordionProps,
|
|
7
|
+
AccordionContentProps,
|
|
8
|
+
AccordionItemProps,
|
|
9
|
+
AccordionTriggerProps,
|
|
10
|
+
} from "./types";
|
|
11
|
+
import { cn } from "../../utilities";
|
|
12
|
+
import {
|
|
13
|
+
getAccordionContentClasses,
|
|
14
|
+
getAccordionItemClasses,
|
|
15
|
+
getAccordionTriggerClasses,
|
|
16
|
+
} from "./constants";
|
|
17
|
+
|
|
18
|
+
const Accordion = (props: AccordionProps) => (
|
|
19
|
+
<AccordionPrimitive.Root {...props} />
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const AccordionItem = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
24
|
+
AccordionItemProps
|
|
25
|
+
>(({ className, ...props }, ref) => (
|
|
26
|
+
<AccordionPrimitive.Item
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn(getAccordionItemClasses(), className)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
));
|
|
32
|
+
AccordionItem.displayName = "AccordionItem";
|
|
33
|
+
|
|
34
|
+
const AccordionTrigger = React.forwardRef<
|
|
35
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
36
|
+
AccordionTriggerProps
|
|
37
|
+
>(({ className, children, ...props }, ref) => (
|
|
38
|
+
<AccordionPrimitive.Header className="flex">
|
|
39
|
+
<AccordionPrimitive.Trigger
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn(getAccordionTriggerClasses(), className)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</AccordionPrimitive.Trigger>
|
|
46
|
+
</AccordionPrimitive.Header>
|
|
47
|
+
));
|
|
48
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;
|
|
49
|
+
|
|
50
|
+
const AccordionContent = React.forwardRef<
|
|
51
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
52
|
+
AccordionContentProps
|
|
53
|
+
>(({ className, children, ...props }, ref) => (
|
|
54
|
+
<AccordionPrimitive.Content
|
|
55
|
+
ref={ref}
|
|
56
|
+
className={cn(getAccordionContentClasses())}
|
|
57
|
+
{...props}
|
|
58
|
+
>
|
|
59
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
60
|
+
</AccordionPrimitive.Content>
|
|
61
|
+
));
|
|
62
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName;
|
|
63
|
+
|
|
64
|
+
Accordion.Item = AccordionItem;
|
|
65
|
+
Accordion.Trigger = AccordionTrigger;
|
|
66
|
+
Accordion.Content = AccordionContent;
|
|
67
|
+
|
|
68
|
+
export { Accordion };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { cva } from "../../libs";
|
|
2
|
+
|
|
3
|
+
export const getAccordionItemClasses = cva("border-b");
|
|
4
|
+
|
|
5
|
+
export const getAccordionTriggerClasses = cva(
|
|
6
|
+
"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all [&:hover:not(:disabled)]:underline disabled:opacity-50 [&[data-state=open]>svg]:rotate-180"
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export const getAccordionContentClasses = cva(
|
|
10
|
+
"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
11
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion } from "./Accordion";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
2
|
+
|
|
3
|
+
export type AccordionProps = React.ComponentPropsWithoutRef<
|
|
4
|
+
typeof AccordionPrimitive.Root
|
|
5
|
+
>;
|
|
6
|
+
|
|
7
|
+
export type AccordionContentProps = React.ComponentPropsWithoutRef<
|
|
8
|
+
typeof AccordionPrimitive.Content
|
|
9
|
+
>;
|
|
10
|
+
|
|
11
|
+
export type AccordionItemProps = React.ComponentPropsWithoutRef<
|
|
12
|
+
typeof AccordionPrimitive.Item
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export type AccordionTriggerProps = React.ComponentPropsWithoutRef<
|
|
16
|
+
typeof AccordionPrimitive.Trigger
|
|
17
|
+
>;
|