@atom-learning/components 6.17.0-beta.1 → 6.17.0
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/components/carousel/Carousel.d.ts +25 -32
- package/dist/components/carousel/Carousel.js +13 -83
- package/dist/components/carousel/Carousel.js.map +1 -1
- package/dist/components/carousel/CarouselArrows.d.ts +6 -5
- package/dist/components/carousel/CarouselArrows.js +9 -25
- package/dist/components/carousel/CarouselArrows.js.map +1 -1
- package/dist/components/carousel/CarouselPagination.d.ts +3 -2
- package/dist/components/carousel/CarouselPagination.js +17 -31
- package/dist/components/carousel/CarouselPagination.js.map +1 -1
- package/dist/components/carousel/CarouselSlide.d.ts +4 -2
- package/dist/components/carousel/CarouselSlide.js +5 -12
- package/dist/components/carousel/CarouselSlide.js.map +1 -1
- package/dist/components/carousel/CarouselSlider.d.ts +4 -6
- package/dist/components/carousel/CarouselSlider.js +5 -12
- package/dist/components/carousel/CarouselSlider.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +5 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +4 -1
- package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuLabel.d.ts +8 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.js +16 -0
- package/dist/components/dropdown-menu/DropdownMenuLabel.js.map +1 -0
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +56 -158
- package/dist/index.cjs.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,48 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CarouselProvider } from 'pure-react-carousel';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
|
|
3
|
+
import { CSSWrapper } from '../../utilities/css-wrapper/CSSWrapper';
|
|
4
4
|
type CarouselProps = {
|
|
5
|
-
|
|
5
|
+
slideHeight: number;
|
|
6
|
+
slideWidth: number;
|
|
7
|
+
numSlides: number;
|
|
6
8
|
};
|
|
7
9
|
export declare const CarouselComponent: {
|
|
8
|
-
({ children,
|
|
10
|
+
({ children, className, slideHeight, slideWidth, numSlides, ...props }: CarouselProps & Omit<React.ComponentProps<typeof CarouselProvider>, "naturalSlideWidth" | "naturalSlideHeight" | "totalSlides"> & React.ComponentProps<typeof CSSWrapper>): React.JSX.Element;
|
|
9
11
|
displayName: string;
|
|
10
12
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
scrollSnaps: number[];
|
|
17
|
-
canScrollPrev: boolean;
|
|
18
|
-
canScrollNext: boolean;
|
|
19
|
-
scrollPrev: () => void;
|
|
20
|
-
scrollNext: () => void;
|
|
21
|
-
scrollTo: (index: number) => void;
|
|
22
|
-
};
|
|
13
|
+
/**
|
|
14
|
+
* Documentation about the hook usage
|
|
15
|
+
* https://github.com/express-labs/pure-react-carousel#hooks-and-usecontext
|
|
16
|
+
*/
|
|
17
|
+
export declare const useCarousel: () => import("pure-react-carousel").CarouselStoreInterface;
|
|
23
18
|
export declare const Carousel: {
|
|
24
|
-
({ children,
|
|
19
|
+
({ children, className, slideHeight, slideWidth, numSlides, ...props }: CarouselProps & Omit<React.ComponentProps<typeof CarouselProvider>, "naturalSlideWidth" | "naturalSlideHeight" | "totalSlides"> & React.ComponentProps<typeof CSSWrapper>): React.JSX.Element;
|
|
25
20
|
displayName: string;
|
|
26
21
|
} & {
|
|
27
|
-
ArrowNext: (props: React.ComponentProps<React.ForwardRefExoticComponent<Omit<
|
|
28
|
-
|
|
29
|
-
}
|
|
22
|
+
ArrowNext: (props: Omit<React.ComponentProps<React.ForwardRefExoticComponent<Omit<import("pure-react-carousel").ButtonNextProps & React.RefAttributes<React.Component<import("pure-react-carousel").ButtonNextProps, any, any>>, never> & {
|
|
23
|
+
as?: React.ElementType;
|
|
24
|
+
}>>, "children">) => React.JSX.Element;
|
|
25
|
+
ArrowPrevious: (props: Omit<React.ComponentProps<React.ForwardRefExoticComponent<Omit<import("pure-react-carousel").ButtonBackProps & React.RefAttributes<React.Component<import("pure-react-carousel").ButtonBackProps, any, any>>, never> & {
|
|
30
26
|
as?: React.ElementType;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
34
|
-
}, never> & {
|
|
27
|
+
}>>, "children">) => React.JSX.Element;
|
|
28
|
+
Pagination: React.ForwardRefExoticComponent<Omit<import("pure-react-carousel").DotGroupProps & React.RefAttributes<React.Component<import("pure-react-carousel").DotGroupProps, any, any>>, never> & {
|
|
35
29
|
as?: React.ElementType;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
}>;
|
|
31
|
+
Slide: ({ children, ...remainingProps }: React.ComponentProps<React.ComponentClass<import("pure-react-carousel").SlideProps, any> | React.FunctionComponent<import("pure-react-carousel").SlideProps>> & {
|
|
32
|
+
className?: string;
|
|
39
33
|
index: number;
|
|
40
|
-
}
|
|
41
|
-
Slider: ({ children, className, overflow,
|
|
42
|
-
|
|
34
|
+
}) => React.JSX.Element;
|
|
35
|
+
Slider: ({ children, className, overflow, ...rest }: React.PropsWithChildren<(React.ComponentClass<import("pure-react-carousel").SliderProps, any> | React.FunctionComponent<import("pure-react-carousel").SliderProps>) & {
|
|
36
|
+
tabIndex?: number;
|
|
43
37
|
className?: string;
|
|
44
38
|
overflow?: boolean;
|
|
45
|
-
|
|
46
|
-
}) => React.JSX.Element;
|
|
39
|
+
}>) => React.JSX.Element;
|
|
47
40
|
};
|
|
48
41
|
export {};
|
|
@@ -1,92 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSWrapper } from "../../utilities/css-wrapper/CSSWrapper.js";
|
|
2
2
|
import { CarouselArrowNext, CarouselArrowPrevious } from "./CarouselArrows.js";
|
|
3
3
|
import { CarouselPagination } from "./CarouselPagination.js";
|
|
4
4
|
import { CarouselSlide } from "./CarouselSlide.js";
|
|
5
5
|
import { CarouselSlider } from "./CarouselSlider.js";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
|
-
import
|
|
7
|
+
import { CarouselContext, CarouselProvider } from "pure-react-carousel";
|
|
8
8
|
//#region src/components/carousel/Carousel.tsx
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
emblaApi?.scrollPrev();
|
|
21
|
-
}, [emblaApi]);
|
|
22
|
-
const scrollNext = React$1.useCallback(() => {
|
|
23
|
-
emblaApi?.scrollNext();
|
|
24
|
-
}, [emblaApi]);
|
|
25
|
-
const scrollTo = React$1.useCallback((index) => {
|
|
26
|
-
emblaApi?.scrollTo(index);
|
|
27
|
-
}, [emblaApi]);
|
|
28
|
-
const onSelect = React$1.useCallback(() => {
|
|
29
|
-
if (!emblaApi) return;
|
|
30
|
-
setSelectedIndex(emblaApi.selectedScrollSnap());
|
|
31
|
-
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
32
|
-
setCanScrollNext(emblaApi.canScrollNext());
|
|
33
|
-
}, [emblaApi]);
|
|
34
|
-
const onInit = React$1.useCallback(() => {
|
|
35
|
-
if (!emblaApi) return;
|
|
36
|
-
setScrollSnaps(emblaApi.scrollSnapList());
|
|
37
|
-
}, [emblaApi]);
|
|
38
|
-
React$1.useEffect(() => {
|
|
39
|
-
if (!emblaApi) return;
|
|
40
|
-
onInit();
|
|
41
|
-
onSelect();
|
|
42
|
-
emblaApi.on("reInit", onInit);
|
|
43
|
-
emblaApi.on("reInit", onSelect);
|
|
44
|
-
emblaApi.on("select", onSelect);
|
|
45
|
-
return () => {
|
|
46
|
-
emblaApi.off("reInit", onInit);
|
|
47
|
-
emblaApi.off("reInit", onSelect);
|
|
48
|
-
emblaApi.off("select", onSelect);
|
|
49
|
-
};
|
|
50
|
-
}, [
|
|
51
|
-
emblaApi,
|
|
52
|
-
onInit,
|
|
53
|
-
onSelect
|
|
54
|
-
]);
|
|
55
|
-
const contextValue = React$1.useMemo(() => ({
|
|
56
|
-
emblaRef,
|
|
57
|
-
emblaApi,
|
|
58
|
-
selectedIndex,
|
|
59
|
-
scrollSnaps,
|
|
60
|
-
canScrollPrev,
|
|
61
|
-
canScrollNext,
|
|
62
|
-
scrollPrev,
|
|
63
|
-
scrollNext,
|
|
64
|
-
scrollTo
|
|
65
|
-
}), [
|
|
66
|
-
emblaRef,
|
|
67
|
-
emblaApi,
|
|
68
|
-
selectedIndex,
|
|
69
|
-
scrollSnaps,
|
|
70
|
-
canScrollPrev,
|
|
71
|
-
canScrollNext,
|
|
72
|
-
scrollPrev,
|
|
73
|
-
scrollNext,
|
|
74
|
-
scrollTo
|
|
75
|
-
]);
|
|
76
|
-
const { className, ...rest } = props;
|
|
77
|
-
return /* @__PURE__ */ React$1.createElement("div", {
|
|
78
|
-
className: cn("relative", "w-full", className),
|
|
79
|
-
...rest
|
|
80
|
-
}, /* @__PURE__ */ React$1.createElement(CarouselContext.Provider, { value: contextValue }, children));
|
|
81
|
-
};
|
|
82
|
-
var useCarousel = () => {
|
|
83
|
-
const context = React$1.useContext(CarouselContext);
|
|
84
|
-
if (!context) throw new Error("useCarousel must be used within a Carousel");
|
|
85
|
-
return {
|
|
86
|
-
...context,
|
|
87
|
-
currentSlide: context.selectedIndex
|
|
88
|
-
};
|
|
89
|
-
};
|
|
9
|
+
var CarouselComponent = ({ children, className, slideHeight, slideWidth, numSlides, ...props }) => /* @__PURE__ */ React$1.createElement(CSSWrapper, { className }, /* @__PURE__ */ React$1.createElement(CarouselProvider, {
|
|
10
|
+
naturalSlideWidth: slideWidth,
|
|
11
|
+
naturalSlideHeight: slideHeight,
|
|
12
|
+
totalSlides: numSlides,
|
|
13
|
+
...props
|
|
14
|
+
}, children));
|
|
15
|
+
/**
|
|
16
|
+
* Documentation about the hook usage
|
|
17
|
+
* https://github.com/express-labs/pure-react-carousel#hooks-and-usecontext
|
|
18
|
+
*/
|
|
19
|
+
var useCarousel = () => React$1.useContext(CarouselContext);
|
|
90
20
|
var Carousel = Object.assign(CarouselComponent, {
|
|
91
21
|
ArrowNext: CarouselArrowNext,
|
|
92
22
|
ArrowPrevious: CarouselArrowPrevious,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/carousel/Carousel.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"Carousel.js","names":[],"sources":["../../../src/components/carousel/Carousel.tsx"],"sourcesContent":["import { CarouselContext, CarouselProvider } from 'pure-react-carousel'\nimport * as React from 'react'\n\nimport { CSSWrapper } from '~/utilities/css-wrapper/CSSWrapper'\n\nimport { CarouselArrowNext, CarouselArrowPrevious } from './CarouselArrows'\nimport { CarouselPagination } from './CarouselPagination'\nimport { CarouselSlide } from './CarouselSlide'\nimport { CarouselSlider } from './CarouselSlider'\n\ntype CarouselProps = {\n slideHeight: number\n slideWidth: number\n numSlides: number\n}\n\nexport const CarouselComponent = ({\n children,\n className,\n slideHeight,\n slideWidth,\n numSlides,\n ...props\n}: CarouselProps &\n Omit<\n React.ComponentProps<typeof CarouselProvider>,\n 'naturalSlideWidth' | 'naturalSlideHeight' | 'totalSlides'\n > &\n React.ComponentProps<typeof CSSWrapper>) => (\n <CSSWrapper className={className}>\n <CarouselProvider\n naturalSlideWidth={slideWidth}\n naturalSlideHeight={slideHeight}\n totalSlides={numSlides}\n {...props}\n >\n {children}\n </CarouselProvider>\n </CSSWrapper>\n)\n\n/**\n * Documentation about the hook usage\n * https://github.com/express-labs/pure-react-carousel#hooks-and-usecontext\n */\nexport const useCarousel = () => React.useContext(CarouselContext)\n\nexport const Carousel = Object.assign(CarouselComponent, {\n ArrowNext: CarouselArrowNext,\n ArrowPrevious: CarouselArrowPrevious,\n Pagination: CarouselPagination,\n Slide: CarouselSlide,\n Slider: CarouselSlider\n})\n\nCarouselComponent.displayName = 'Carousel'\n"],"mappings":";;;;;;;;AAgBA,IAAa,qBAAqB,EAChC,UACA,WACA,aACA,YACA,WACA,GAAG,YAOH,wBAAA,cAAC,YAAD,EAAuB,WASV,EARX,wBAAA,cAAC,kBAAD;CACE,mBAAmB;CACnB,oBAAoB;CACpB,aAAa;CACb,GAAI;CAGa,EADhB,SACgB,CACR;;;;;AAOf,IAAa,oBAAoB,QAAM,WAAW,gBAAgB;AAElE,IAAa,WAAW,OAAO,OAAO,mBAAmB;CACvD,WAAW;CACX,eAAe;CACf,YAAY;CACZ,OAAO;CACP,QAAQ;CACT,CAAC;AAEF,kBAAkB,cAAc"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const
|
|
3
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
|
4
|
-
}, never> & {
|
|
2
|
+
declare const StyledButtonBack: React.ForwardRefExoticComponent<Omit<import("pure-react-carousel").ButtonBackProps & React.RefAttributes<React.Component<import("pure-react-carousel").ButtonBackProps, any, any>>, never> & {
|
|
5
3
|
as?: React.ElementType;
|
|
6
4
|
}>;
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
declare const StyledButtonNext: React.ForwardRefExoticComponent<Omit<import("pure-react-carousel").ButtonNextProps & React.RefAttributes<React.Component<import("pure-react-carousel").ButtonNextProps, any, any>>, never> & {
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const CarouselArrowPrevious: (props: Omit<React.ComponentProps<typeof StyledButtonBack>, "children">) => React.JSX.Element;
|
|
9
|
+
export declare const CarouselArrowNext: (props: Omit<React.ComponentProps<typeof StyledButtonNext>, "children">) => React.JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
2
|
import { Icon } from "../icon/Icon.js";
|
|
3
|
-
import { useCarousel } from "./Carousel.js";
|
|
4
3
|
import * as React$1 from "react";
|
|
5
4
|
import { ChevronLeft, ChevronRight } from "@atom-learning/icons";
|
|
5
|
+
import { ButtonBack, ButtonNext } from "pure-react-carousel";
|
|
6
6
|
//#region src/components/carousel/CarouselArrows.tsx
|
|
7
|
-
var
|
|
7
|
+
var buttonStyles = [
|
|
8
8
|
"items-center",
|
|
9
|
+
"bg-[unset]",
|
|
9
10
|
"text-primary-800",
|
|
10
11
|
"cursor-pointer",
|
|
11
12
|
"flex",
|
|
@@ -18,29 +19,12 @@ var ArrowButton = styled("button", { base: [
|
|
|
18
19
|
"ease-in-out",
|
|
19
20
|
"hover:text-primary-900",
|
|
20
21
|
"active:text-primary-1000",
|
|
21
|
-
"disabled:text-grey-200"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type: "button",
|
|
28
|
-
onClick: scrollPrev,
|
|
29
|
-
disabled: !canScrollPrev,
|
|
30
|
-
"aria-label": "Previous slide",
|
|
31
|
-
...props
|
|
32
|
-
}, /* @__PURE__ */ React$1.createElement(Icon, { is: ChevronLeft }));
|
|
33
|
-
};
|
|
34
|
-
var CarouselArrowNext = (props) => {
|
|
35
|
-
const { scrollNext, canScrollNext } = useCarousel();
|
|
36
|
-
return /* @__PURE__ */ React$1.createElement(ArrowButton, {
|
|
37
|
-
type: "button",
|
|
38
|
-
onClick: scrollNext,
|
|
39
|
-
disabled: !canScrollNext,
|
|
40
|
-
"aria-label": "Next slide",
|
|
41
|
-
...props
|
|
42
|
-
}, /* @__PURE__ */ React$1.createElement(Icon, { is: ChevronRight }));
|
|
43
|
-
};
|
|
22
|
+
"disabled:text-grey-200"
|
|
23
|
+
];
|
|
24
|
+
var StyledButtonBack = styled(ButtonBack, { base: buttonStyles });
|
|
25
|
+
var StyledButtonNext = styled(ButtonNext, { base: buttonStyles });
|
|
26
|
+
var CarouselArrowPrevious = (props) => /* @__PURE__ */ React$1.createElement(StyledButtonBack, props, /* @__PURE__ */ React$1.createElement(Icon, { is: ChevronLeft }));
|
|
27
|
+
var CarouselArrowNext = (props) => /* @__PURE__ */ React$1.createElement(StyledButtonNext, props, /* @__PURE__ */ React$1.createElement(Icon, { is: ChevronRight }));
|
|
44
28
|
//#endregion
|
|
45
29
|
export { CarouselArrowNext, CarouselArrowPrevious };
|
|
46
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselArrows.js","names":[],"sources":["../../../src/components/carousel/CarouselArrows.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\
|
|
1
|
+
{"version":3,"file":"CarouselArrows.js","names":[],"sources":["../../../src/components/carousel/CarouselArrows.tsx"],"sourcesContent":["import { ChevronLeft, ChevronRight } from '@atom-learning/icons'\nimport {\n ButtonBack as BaseButtonBack,\n ButtonNext as BaseButtonNext\n} from 'pure-react-carousel'\nimport * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\nconst buttonStyles = [\n 'items-center',\n 'bg-[unset]',\n 'text-primary-800',\n 'cursor-pointer',\n 'flex',\n 'justify-center',\n 'size-12',\n 'top-1/2',\n '-translate-y-1/2',\n 'transition-colors',\n 'duration-150',\n 'ease-in-out',\n 'hover:text-primary-900',\n 'active:text-primary-1000',\n 'disabled:text-grey-200'\n]\n\nconst StyledButtonBack = styled(BaseButtonBack, {\n base: buttonStyles\n})\n\nconst StyledButtonNext = styled(BaseButtonNext, {\n base: buttonStyles\n})\n\nexport const CarouselArrowPrevious = (\n props: Omit<React.ComponentProps<typeof StyledButtonBack>, 'children'>\n) => (\n <StyledButtonBack {...props}>\n <Icon is={ChevronLeft} />\n </StyledButtonBack>\n)\nexport const CarouselArrowNext = (\n props: Omit<React.ComponentProps<typeof StyledButtonNext>, 'children'>\n) => (\n <StyledButtonNext {...props}>\n <Icon is={ChevronRight} />\n </StyledButtonNext>\n)\n"],"mappings":";;;;;;AAUA,IAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,IAAM,mBAAmB,OAAO,YAAgB,EAC9C,MAAM,cACP,CAAC;AAEF,IAAM,mBAAmB,OAAO,YAAgB,EAC9C,MAAM,cACP,CAAC;AAEF,IAAa,yBACX,UAEA,wBAAA,cAAC,kBAAqB,OACpB,wBAAA,cAAC,MAAD,EAAM,IAAI,aAAe,CAAA,CACR;AAErB,IAAa,qBACX,UAEA,wBAAA,cAAC,kBAAqB,OACpB,wBAAA,cAAC,MAAD,EAAM,IAAI,cAAgB,CAAA,CACT"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
export declare const CarouselPagination: import("react").ForwardRefExoticComponent<Omit<import("pure-react-carousel").DotGroupProps & import("react").RefAttributes<import("react").Component<import("pure-react-carousel").DotGroupProps, any, any>>, never> & {
|
|
2
|
+
as?: import("react").ElementType;
|
|
3
|
+
}>;
|
|
@@ -1,36 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as React$1 from "react";
|
|
1
|
+
import { styled } from "../../styled.js";
|
|
2
|
+
import { DotGroup } from "pure-react-carousel";
|
|
4
3
|
//#region src/components/carousel/CarouselPagination.tsx
|
|
5
|
-
var
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
4
|
+
var CarouselPagination = styled(DotGroup, { base: [
|
|
5
|
+
"justify-center",
|
|
6
|
+
"[&_button]:[[class*=selected]]:bg-primary-800",
|
|
7
|
+
"[&_button]:bg-grey-600",
|
|
8
|
+
"[&_button]:border-none",
|
|
9
|
+
"[&_button]:cursor-pointer",
|
|
10
|
+
"[&_button]:duration-100",
|
|
11
|
+
"[&_button]:ease-in",
|
|
12
|
+
"[&_button]:focus:bg-primary-900",
|
|
13
|
+
"[&_button]:hover:bg-primary-900",
|
|
14
|
+
"[&_button]:mx-1",
|
|
15
|
+
"[&_button]:p-1",
|
|
16
|
+
"[&_button]:rounded-[50%]",
|
|
17
|
+
"[&_button]:size-3",
|
|
18
|
+
"[&_button]:transition-all"
|
|
19
19
|
] });
|
|
20
|
-
var CarouselPagination = ({ className, ...rest }) => {
|
|
21
|
-
const { scrollSnaps, selectedIndex, scrollTo } = useCarousel();
|
|
22
|
-
const dots = Array.from({ length: scrollSnaps.length }, (_, i) => i);
|
|
23
|
-
return /* @__PURE__ */ React$1.createElement("div", {
|
|
24
|
-
className: cn("flex", "justify-center", className),
|
|
25
|
-
...rest
|
|
26
|
-
}, dots.map((index) => /* @__PURE__ */ React$1.createElement(Dot, {
|
|
27
|
-
key: index,
|
|
28
|
-
type: "button",
|
|
29
|
-
onClick: () => scrollTo(index),
|
|
30
|
-
disabled: index === selectedIndex,
|
|
31
|
-
"aria-label": "slide dot"
|
|
32
|
-
})));
|
|
33
|
-
};
|
|
34
20
|
//#endregion
|
|
35
21
|
export { CarouselPagination };
|
|
36
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselPagination.js","names":[],"sources":["../../../src/components/carousel/CarouselPagination.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CarouselPagination.js","names":[],"sources":["../../../src/components/carousel/CarouselPagination.tsx"],"sourcesContent":["import { DotGroup } from 'pure-react-carousel'\n\nimport { styled } from '~/styled'\n\nexport const CarouselPagination = styled(DotGroup, {\n base: [\n 'justify-center',\n '[&_button]:[[class*=selected]]:bg-primary-800',\n '[&_button]:bg-grey-600',\n '[&_button]:border-none',\n '[&_button]:cursor-pointer',\n '[&_button]:duration-100',\n '[&_button]:ease-in',\n '[&_button]:focus:bg-primary-900',\n '[&_button]:hover:bg-primary-900',\n '[&_button]:mx-1',\n '[&_button]:p-1',\n '[&_button]:rounded-[50%]',\n '[&_button]:size-3',\n '[&_button]:transition-all'\n ]\n})\n"],"mappings":";;;AAIA,IAAa,qBAAqB,OAAO,UAAU,EACjD,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EACF,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Slide as BaseSlide } from 'pure-react-carousel';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
export declare const CarouselSlide: ({ children,
|
|
3
|
+
export declare const CarouselSlide: ({ children, ...remainingProps }: React.ComponentProps<typeof BaseSlide> & {
|
|
4
|
+
className?: string;
|
|
3
5
|
index: number;
|
|
4
|
-
}
|
|
6
|
+
}) => React.JSX.Element;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { cn } from "../../styled.js";
|
|
2
|
-
import { useCarousel } from "./Carousel.js";
|
|
3
1
|
import * as React$1 from "react";
|
|
2
|
+
import { Slide } from "pure-react-carousel";
|
|
4
3
|
//#region src/components/carousel/CarouselSlide.tsx
|
|
5
|
-
var CarouselSlide = ({ children,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
role: "option",
|
|
10
|
-
"aria-selected": isSelected,
|
|
11
|
-
className: cn("basis-full", "shrink-0", className),
|
|
12
|
-
...rest
|
|
13
|
-
}, /* @__PURE__ */ React$1.createElement("div", { className: "flex items-center justify-center px-3" }, children));
|
|
14
|
-
};
|
|
4
|
+
var CarouselSlide = ({ children, ...remainingProps }) => /* @__PURE__ */ React$1.createElement(Slide, {
|
|
5
|
+
...remainingProps,
|
|
6
|
+
tag: "div"
|
|
7
|
+
}, /* @__PURE__ */ React$1.createElement("div", { className: "px-3" }, children));
|
|
15
8
|
//#endregion
|
|
16
9
|
export { CarouselSlide };
|
|
17
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselSlide.js","names":[],"sources":["../../../src/components/carousel/CarouselSlide.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CarouselSlide.js","names":[],"sources":["../../../src/components/carousel/CarouselSlide.tsx"],"sourcesContent":["import { Slide as BaseSlide } from 'pure-react-carousel'\nimport * as React from 'react'\n\nexport const CarouselSlide = ({\n children,\n ...remainingProps\n}: React.ComponentProps<typeof BaseSlide> & {\n className?: string\n index: number\n}) => (\n <BaseSlide {...remainingProps} tag=\"div\">\n {/* padding to create the gap between slides */}\n <div className=\"px-3\">{children}</div>\n </BaseSlide>\n)\n"],"mappings":";;;AAGA,IAAa,iBAAiB,EAC5B,UACA,GAAG,qBAKH,wBAAA,cAAC,OAAD;CAAW,GAAI;CAAgB,KAAI;CAGvB,EADV,wBAAA,cAAC,OAAD,EAAK,WAAU,QAAuB,EAAf,SAAe,CAC5B"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
+
import { Slider as BaseSlider } from 'pure-react-carousel';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const CarouselSlider: ({ children, className, overflow, ...rest }: React.PropsWithChildren<typeof BaseSlider & {
|
|
4
|
+
tabIndex?: number;
|
|
4
5
|
className?: string;
|
|
5
6
|
overflow?: boolean;
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export declare const CarouselSlider: ({ children, className, overflow, tabIndex, ...rest }: CarouselSliderProps) => React.JSX.Element;
|
|
9
|
-
export {};
|
|
7
|
+
}>) => React.JSX.Element;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { cn } from "../../styled.js";
|
|
2
|
-
import { useCarousel } from "./Carousel.js";
|
|
3
2
|
import * as React$1 from "react";
|
|
3
|
+
import { Slider } from "pure-react-carousel";
|
|
4
4
|
//#region src/components/carousel/CarouselSlider.tsx
|
|
5
|
-
var CarouselSlider = ({ children, className, overflow,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
className: cn("ml-[50%]", "-translate-x-1/2", "cursor-grab", overflow ? "overflow-visible" : "overflow-hidden", className),
|
|
10
|
-
role: "listbox",
|
|
11
|
-
"aria-live": "polite",
|
|
12
|
-
tabIndex,
|
|
13
|
-
...rest
|
|
14
|
-
}, /* @__PURE__ */ React$1.createElement("div", { className: "flex" }, children));
|
|
15
|
-
};
|
|
5
|
+
var CarouselSlider = ({ children, className, overflow, ...rest }) => /* @__PURE__ */ React$1.createElement(Slider, {
|
|
6
|
+
...rest,
|
|
7
|
+
className: cn(String.raw`ml-[50%] -translate-x-1/2 cursor-grab overflow-hidden **:[[class*=slideInner]]:flex **:[[class*=slideInner]]:justify-center **:[[class*=slide\_]]:float-left **:[[class*=slide\_]]:pb-0! **:[[class*=sliderTray\_]]:transition-transform **:[[class*=sliderTray\_]]:duration-500 **:[[class*=sliderTray\_]]:ease-[cubic-bezier(.645,.045,.355,1)]`, overflow && "overflow-visible", className)
|
|
8
|
+
}, children);
|
|
16
9
|
//#endregion
|
|
17
10
|
export { CarouselSlider };
|
|
18
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CarouselSlider.js","names":[],"sources":["../../../src/components/carousel/CarouselSlider.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"CarouselSlider.js","names":[],"sources":["../../../src/components/carousel/CarouselSlider.tsx"],"sourcesContent":["import { Slider as BaseSlider } from 'pure-react-carousel'\nimport * as React from 'react'\n\nimport { cn } from '~/styled'\n\nexport const CarouselSlider = ({\n children,\n className,\n overflow,\n ...rest\n}: React.PropsWithChildren<\n typeof BaseSlider & {\n tabIndex?: number\n className?: string\n overflow?: boolean\n }\n>) => (\n <BaseSlider\n {...rest}\n className={cn(\n String.raw`ml-[50%] -translate-x-1/2 cursor-grab overflow-hidden **:[[class*=slideInner]]:flex **:[[class*=slideInner]]:justify-center **:[[class*=slide\\_]]:float-left **:[[class*=slide\\_]]:pb-0! **:[[class*=sliderTray\\_]]:transition-transform **:[[class*=sliderTray\\_]]:duration-500 **:[[class*=sliderTray\\_]]:ease-[cubic-bezier(.645,.045,.355,1)]`,\n overflow && 'overflow-visible',\n className\n )}\n >\n {children}\n </BaseSlider>\n)\n"],"mappings":";;;;AAKA,IAAa,kBAAkB,EAC7B,UACA,WACA,UACA,GAAG,WAQH,wBAAA,cAAC,QAAD;CACE,GAAI;CACJ,WAAW,GACT,OAAO,GAAG,qVACV,YAAY,oBACZ,UACD;CAGU,EADV,SACU"}
|
|
@@ -4,9 +4,14 @@ export declare const DropdownMenu: React.FC<import("@radix-ui/react-dropdown-men
|
|
|
4
4
|
Content: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, never> & {
|
|
5
5
|
as?: React.ElementType;
|
|
6
6
|
}>;
|
|
7
|
+
Group: React.ForwardRefExoticComponent<import("@radix-ui/react-dropdown-menu").DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
8
|
Item: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, never> & {
|
|
8
9
|
as?: React.ElementType;
|
|
9
10
|
}>;
|
|
11
|
+
Label: {
|
|
12
|
+
({ className, ...props }: import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>): React.JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
10
15
|
LinkItem: ({ children, href, ...props }: React.ComponentProps<typeof DropdownMenuItem> & {
|
|
11
16
|
href: string;
|
|
12
17
|
}) => React.JSX.Element;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { DropdownMenuContent } from "./DropdownMenuContent.js";
|
|
2
2
|
import { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
3
|
+
import { DropdownMenuLabel } from "./DropdownMenuLabel.js";
|
|
3
4
|
import { DropdownMenuLinkItem } from "./DropdownMenuLinkItem.js";
|
|
4
5
|
import { DropdownMenuSeparator } from "./DropdownMenuSeparator.js";
|
|
5
6
|
import { DropdownMenuTrigger } from "./DropdownMenuTrigger.js";
|
|
6
|
-
import { Portal, Root } from "@radix-ui/react-dropdown-menu";
|
|
7
|
+
import { Group, Portal, Root } from "@radix-ui/react-dropdown-menu";
|
|
7
8
|
//#region src/components/dropdown-menu/DropdownMenu.tsx
|
|
8
9
|
var DropdownMenu = Object.assign(Root, {
|
|
9
10
|
Content: DropdownMenuContent,
|
|
11
|
+
Group,
|
|
10
12
|
Item: DropdownMenuItem,
|
|
13
|
+
Label: DropdownMenuLabel,
|
|
11
14
|
LinkItem: DropdownMenuLinkItem,
|
|
12
15
|
Portal,
|
|
13
16
|
Separator: DropdownMenuSeparator,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":[],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":[],"sources":["../../../src/components/dropdown-menu/DropdownMenu.tsx"],"sourcesContent":["import {\n Group,\n Portal,\n Root as DropdownMenuRoot\n} from '@radix-ui/react-dropdown-menu'\nimport React from 'react'\n\nimport { DropdownMenuContent } from './DropdownMenuContent'\nimport { DropdownMenuItem } from './DropdownMenuItem'\nimport { DropdownMenuLabel } from './DropdownMenuLabel'\nimport { DropdownMenuLinkItem } from './DropdownMenuLinkItem'\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator'\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger'\n\nexport const DropdownMenu = Object.assign(DropdownMenuRoot, {\n Content: DropdownMenuContent,\n Group: Group,\n Item: DropdownMenuItem,\n Label: DropdownMenuLabel,\n LinkItem: DropdownMenuLinkItem,\n Portal: Portal,\n Separator: DropdownMenuSeparator,\n Trigger: DropdownMenuTrigger\n})\n"],"mappings":";;;;;;;;AAcA,IAAa,eAAe,OAAO,OAAO,MAAkB;CAC1D,SAAS;CACF;CACP,MAAM;CACN,OAAO;CACP,UAAU;CACF;CACR,WAAW;CACX,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Label } from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type DropdownMenuLabelProps = React.ComponentProps<typeof Label>;
|
|
4
|
+
export declare const DropdownMenuLabel: {
|
|
5
|
+
({ className, ...props }: DropdownMenuLabelProps): React.JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn } from "../../styled.js";
|
|
2
|
+
import { Text } from "../text/Text.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { Label } from "@radix-ui/react-dropdown-menu";
|
|
5
|
+
//#region src/components/dropdown-menu/DropdownMenuLabel.tsx
|
|
6
|
+
var DropdownMenuLabel = ({ className, ...props }) => /* @__PURE__ */ React$1.createElement(Text, {
|
|
7
|
+
as: Label,
|
|
8
|
+
size: "sm",
|
|
9
|
+
className: cn("px-3", "py-2", "text-text-subtle", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DropdownMenuLabel };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=DropdownMenuLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownMenuLabel.js","names":[],"sources":["../../../src/components/dropdown-menu/DropdownMenuLabel.tsx"],"sourcesContent":["import { Label } from '@radix-ui/react-dropdown-menu'\nimport * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Text } from '../text/Text'\n\ntype DropdownMenuLabelProps = React.ComponentProps<typeof Label>\n\nexport const DropdownMenuLabel = ({\n className,\n ...props\n}: DropdownMenuLabelProps) => (\n <Text\n as={Label}\n size=\"sm\"\n className={cn('px-3', 'py-2', 'text-text-subtle', className)}\n {...props}\n />\n)\n\nDropdownMenuLabel.displayName = 'DropdownMenuLabel'\n"],"mappings":";;;;;AASA,IAAa,qBAAqB,EAChC,WACA,GAAG,YAEH,wBAAA,cAAC,MAAD;CACE,IAAI;CACJ,MAAK;CACL,WAAW,GAAG,QAAQ,QAAQ,oBAAoB,UAAU;CAC5D,GAAI;CACJ,CAAA;AAGJ,kBAAkB,cAAc"}
|