@oztix/roadie-components 2.0.1 → 2.1.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/Accordion.d.ts +42 -21
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.js +1 -2
- package/dist/Accordion.js.map +1 -1
- package/dist/Autocomplete.d.ts +101 -60
- package/dist/Autocomplete.d.ts.map +1 -0
- package/dist/Autocomplete.js +1 -2
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.d.ts +27 -16
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Breadcrumb.d.ts +45 -23
- package/dist/Breadcrumb.d.ts.map +1 -0
- package/dist/Breadcrumb.js +1 -1
- package/dist/Breadcrumb.js.map +1 -1
- package/dist/Button-CDQ6ik0P.js +2 -0
- package/dist/Button-CDQ6ik0P.js.map +1 -0
- package/dist/Button-CqyOi1Lf.d.ts +26 -0
- package/dist/Button-CqyOi1Lf.d.ts.map +1 -0
- package/dist/Button.d.ts +3 -17
- package/dist/Button.js +1 -2
- package/dist/Card.d.ts +56 -30
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +1 -1
- package/dist/Card.js.map +1 -1
- package/dist/Carousel.d.ts +257 -0
- package/dist/Carousel.d.ts.map +1 -0
- package/dist/Carousel.js +2 -0
- package/dist/Carousel.js.map +1 -0
- package/dist/Code.d.ts +19 -13
- package/dist/Code.d.ts.map +1 -0
- package/dist/Code.js +1 -1
- package/dist/Code.js.map +1 -1
- package/dist/Combobox.d.ts +111 -63
- package/dist/Combobox.d.ts.map +1 -0
- package/dist/Combobox.js +1 -2
- package/dist/Combobox.js.map +1 -1
- package/dist/Field.d.ts +63 -46
- package/dist/Field.d.ts.map +1 -0
- package/dist/Field.js +1 -2
- package/dist/Field.js.map +1 -1
- package/dist/Fieldset.d.ts +34 -22
- package/dist/Fieldset.d.ts.map +1 -0
- package/dist/Fieldset.js +1 -2
- package/dist/Fieldset.js.map +1 -1
- package/dist/Highlight.d.ts +20 -15
- package/dist/Highlight.d.ts.map +1 -0
- package/dist/Highlight.js +1 -2
- package/dist/Highlight.js.map +1 -1
- package/dist/IconButton-0UdUDm0O.js +2 -0
- package/dist/IconButton-0UdUDm0O.js.map +1 -0
- package/dist/IconButton-Bhg6u3Qm.d.ts +17 -0
- package/dist/IconButton-Bhg6u3Qm.d.ts.map +1 -0
- package/dist/Indicator.d.ts +20 -12
- package/dist/Indicator.d.ts.map +1 -0
- package/dist/Indicator.js +1 -1
- package/dist/Indicator.js.map +1 -1
- package/dist/Input.d.ts +22 -14
- package/dist/Input.d.ts.map +1 -0
- package/dist/Input.js +1 -2
- package/dist/Input.js.map +1 -1
- package/dist/Label.d.ts +12 -8
- package/dist/Label.d.ts.map +1 -0
- package/dist/Label.js +1 -1
- package/dist/Label.js.map +1 -1
- package/dist/LinkButton-9nnOzX_0.js +2 -0
- package/dist/LinkButton-9nnOzX_0.js.map +1 -0
- package/dist/LinkButton.d.ts +2 -35
- package/dist/LinkButton.js +1 -2
- package/dist/Mark.d.ts +19 -12
- package/dist/Mark.d.ts.map +1 -0
- package/dist/Mark.js +1 -1
- package/dist/Mark.js.map +1 -1
- package/dist/Marquee.d.ts +27 -16
- package/dist/Marquee.d.ts.map +1 -0
- package/dist/Marquee.js +5 -2
- package/dist/Marquee.js.map +1 -1
- package/dist/Prose.d.ts +19 -12
- package/dist/Prose.d.ts.map +1 -0
- package/dist/Prose.js +1 -1
- package/dist/Prose.js.map +1 -1
- package/dist/RadioGroup.d.ts +62 -38
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.js +1 -2
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.d.ts +129 -73
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.js +1 -2
- package/dist/Select.js.map +1 -1
- package/dist/Separator.d.ts +17 -12
- package/dist/Separator.d.ts.map +1 -0
- package/dist/Separator.js +1 -1
- package/dist/Separator.js.map +1 -1
- package/dist/SpotIllustration.d.ts +71 -50
- package/dist/SpotIllustration.d.ts.map +1 -0
- package/dist/SpotIllustration.js +1 -2
- package/dist/SpotIllustration.js.map +1 -1
- package/dist/Steps.d.ts +102 -62
- package/dist/Steps.d.ts.map +1 -0
- package/dist/Steps.js +1 -2
- package/dist/Steps.js.map +1 -1
- package/dist/Textarea.d.ts +22 -13
- package/dist/Textarea.d.ts.map +1 -0
- package/dist/Textarea.js +1 -2
- package/dist/Textarea.js.map +1 -1
- package/dist/index-Coj58rPD.d.ts +50 -0
- package/dist/index-Coj58rPD.d.ts.map +1 -0
- package/dist/index.d.ts +48 -49
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -23
- package/dist/index.js.map +1 -1
- package/dist/variants-DTAwzBl3.js +2 -0
- package/dist/variants-DTAwzBl3.js.map +1 -0
- package/package.json +28 -7
- package/dist/Button-fnIVmjIB.d.ts +0 -18
- package/dist/Button.js.map +0 -1
- package/dist/LinkButton.js.map +0 -1
- package/dist/_chunks/chunk-3H22EQQ6.js +0 -2
- package/dist/_chunks/chunk-3H22EQQ6.js.map +0 -1
- package/dist/_chunks/chunk-42UB7PQB.js +0 -3
- package/dist/_chunks/chunk-42UB7PQB.js.map +0 -1
- package/dist/_chunks/chunk-4LGCF3SN.js +0 -3
- package/dist/_chunks/chunk-4LGCF3SN.js.map +0 -1
- package/dist/_chunks/chunk-AFSDN4WI.js +0 -2
- package/dist/_chunks/chunk-AFSDN4WI.js.map +0 -1
- package/dist/_chunks/chunk-BQEJDV7D.js +0 -3
- package/dist/_chunks/chunk-BQEJDV7D.js.map +0 -1
- package/dist/_chunks/chunk-DRVUAPKN.js +0 -2
- package/dist/_chunks/chunk-DRVUAPKN.js.map +0 -1
- package/dist/_chunks/chunk-EKOEXSAP.js +0 -2
- package/dist/_chunks/chunk-EKOEXSAP.js.map +0 -1
- package/dist/_chunks/chunk-FQNVMKKV.js +0 -7
- package/dist/_chunks/chunk-FQNVMKKV.js.map +0 -1
- package/dist/_chunks/chunk-IEDKSZAQ.js +0 -3
- package/dist/_chunks/chunk-IEDKSZAQ.js.map +0 -1
- package/dist/_chunks/chunk-JBHYUOI2.js +0 -3
- package/dist/_chunks/chunk-JBHYUOI2.js.map +0 -1
- package/dist/_chunks/chunk-JGTZ3GCR.js +0 -2
- package/dist/_chunks/chunk-JGTZ3GCR.js.map +0 -1
- package/dist/_chunks/chunk-LHNOY24C.js +0 -2
- package/dist/_chunks/chunk-LHNOY24C.js.map +0 -1
- package/dist/_chunks/chunk-LMV3JECI.js +0 -3
- package/dist/_chunks/chunk-LMV3JECI.js.map +0 -1
- package/dist/_chunks/chunk-MDRAL676.js +0 -3
- package/dist/_chunks/chunk-MDRAL676.js.map +0 -1
- package/dist/_chunks/chunk-N2HGY7W7.js +0 -3
- package/dist/_chunks/chunk-N2HGY7W7.js.map +0 -1
- package/dist/_chunks/chunk-NRVNUMJE.js +0 -2
- package/dist/_chunks/chunk-NRVNUMJE.js.map +0 -1
- package/dist/_chunks/chunk-OIAETOZT.js +0 -3
- package/dist/_chunks/chunk-OIAETOZT.js.map +0 -1
- package/dist/_chunks/chunk-OIZX63GZ.js +0 -2
- package/dist/_chunks/chunk-OIZX63GZ.js.map +0 -1
- package/dist/_chunks/chunk-OPR5JL7N.js +0 -3
- package/dist/_chunks/chunk-OPR5JL7N.js.map +0 -1
- package/dist/_chunks/chunk-SCS7WZ6Z.js +0 -3
- package/dist/_chunks/chunk-SCS7WZ6Z.js.map +0 -1
- package/dist/_chunks/chunk-VSKUGXQG.js +0 -3
- package/dist/_chunks/chunk-VSKUGXQG.js.map +0 -1
- package/dist/_chunks/chunk-WOU2B425.js +0 -3
- package/dist/_chunks/chunk-WOU2B425.js.map +0 -1
- package/dist/_chunks/chunk-XERFFH3S.js +0 -3
- package/dist/_chunks/chunk-XERFFH3S.js.map +0 -1
- package/dist/_chunks/chunk-XRFHVFJ5.js +0 -3
- package/dist/_chunks/chunk-XRFHVFJ5.js.map +0 -1
- package/dist/_chunks/chunk-ZXR32FYA.js +0 -2
- package/dist/_chunks/chunk-ZXR32FYA.js.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Button } from "@base-ui/react/button";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { RefAttributes } from "react";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Button/Button.d.ts
|
|
8
|
+
declare const buttonVariants: (props?: ({
|
|
9
|
+
intent?: "neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null | undefined;
|
|
10
|
+
emphasis?: "strong" | "normal" | "subtle" | "subtler" | null | undefined;
|
|
11
|
+
size?: "sm" | "md" | "lg" | "xs" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
|
|
12
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
|
+
type ButtonProps = Button.Props & RefAttributes<HTMLElement> & VariantProps<typeof buttonVariants>;
|
|
14
|
+
declare function Button$1({
|
|
15
|
+
className,
|
|
16
|
+
intent,
|
|
17
|
+
emphasis,
|
|
18
|
+
size,
|
|
19
|
+
...props
|
|
20
|
+
}: ButtonProps): _$react_jsx_runtime0.JSX.Element;
|
|
21
|
+
declare namespace Button$1 {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ButtonProps as n, buttonVariants as r, Button$1 as t };
|
|
26
|
+
//# sourceMappingURL=Button-CqyOi1Lf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button-CqyOi1Lf.d.ts","names":[],"sources":["../src/components/Button/Button.tsx"],"mappings":";;;;;;;cAWa,cAAA,GAAc,KAAA;;;;IAwBzB,iCAAA,CAAA,SAAA;AAAA,KAEU,WAAA,GAAc,MAAA,CAAgB,KAAA,GACxC,aAAA,CAAc,WAAA,IACd,YAAA,QAAoB,cAAA;AAAA,iBAEN,QAAA,CAAA;EACd,SAAA;EACA,MAAA;EACA,QAAA;EACA,IAAA;EAAA,GACG;AAAA,GACF,WAAA,GAAW,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBANE,QAAA;EAAA,IAAM,WAAA;AAAA"}
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import 'class-variance-authority/types';
|
|
5
|
-
import 'react';
|
|
6
|
-
import '@base-ui/react/button';
|
|
7
|
-
import 'class-variance-authority';
|
|
8
|
-
|
|
9
|
-
type IconButtonProps = Omit<ButtonProps, 'aria-label'> & {
|
|
10
|
-
'aria-label': string;
|
|
11
|
-
};
|
|
12
|
-
declare function IconButton({ size, ...props }: IconButtonProps): react_jsx_runtime.JSX.Element;
|
|
13
|
-
declare namespace IconButton {
|
|
14
|
-
var displayName: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { ButtonProps, IconButton, type IconButtonProps };
|
|
1
|
+
import { n as ButtonProps, r as buttonVariants, t as Button } from "./Button-CqyOi1Lf.js";
|
|
2
|
+
import { n as IconButtonProps, t as IconButton } from "./IconButton-Bhg6u3Qm.js";
|
|
3
|
+
export { Button, type ButtonProps, IconButton, type IconButtonProps, buttonVariants };
|
package/dist/Button.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=Button.js.map
|
|
1
|
+
import{n as e,t}from"./Button-CDQ6ik0P.js";import{t as n}from"./IconButton-0UdUDm0O.js";export{t as Button,n as IconButton,e as buttonVariants};
|
package/dist/Card.d.ts
CHANGED
|
@@ -1,51 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { ComponentProps, ElementType, ImgHTMLAttributes } from "react";
|
|
4
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
5
5
|
|
|
6
|
+
//#region src/components/Card/index.d.ts
|
|
6
7
|
declare const cardVariants: (props?: ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} &
|
|
8
|
+
intent?: "neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null | undefined;
|
|
9
|
+
emphasis?: "normal" | "subtle" | "subtler" | "raised" | null | undefined;
|
|
10
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
11
|
type CardOwnProps<T extends ElementType = 'div'> = {
|
|
11
|
-
|
|
12
|
+
as?: T;
|
|
12
13
|
} & VariantProps<typeof cardVariants>;
|
|
13
14
|
type CardProps<T extends ElementType = 'div'> = CardOwnProps<T> & Omit<ComponentProps<T>, keyof CardOwnProps<T>>;
|
|
14
|
-
declare function CardRoot<T extends ElementType = 'div'>({
|
|
15
|
+
declare function CardRoot<T extends ElementType = 'div'>({
|
|
16
|
+
as,
|
|
17
|
+
className,
|
|
18
|
+
intent,
|
|
19
|
+
emphasis,
|
|
20
|
+
...props
|
|
21
|
+
}: CardProps<T>): _$react_jsx_runtime0.JSX.Element;
|
|
15
22
|
declare namespace CardRoot {
|
|
16
|
-
|
|
23
|
+
var displayName: string;
|
|
17
24
|
}
|
|
18
|
-
declare function CardHeader({
|
|
25
|
+
declare function CardHeader({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
19
29
|
declare namespace CardHeader {
|
|
20
|
-
|
|
30
|
+
var displayName: string;
|
|
21
31
|
}
|
|
22
|
-
declare function CardContent({
|
|
32
|
+
declare function CardContent({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
23
36
|
declare namespace CardContent {
|
|
24
|
-
|
|
37
|
+
var displayName: string;
|
|
25
38
|
}
|
|
26
|
-
declare function CardFooter({
|
|
39
|
+
declare function CardFooter({
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}: ComponentProps<'div'>): _$react_jsx_runtime0.JSX.Element;
|
|
27
43
|
declare namespace CardFooter {
|
|
28
|
-
|
|
44
|
+
var displayName: string;
|
|
29
45
|
}
|
|
30
|
-
declare function CardImage({
|
|
46
|
+
declare function CardImage({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: ImgHTMLAttributes<HTMLImageElement>): _$react_jsx_runtime0.JSX.Element;
|
|
31
50
|
declare namespace CardImage {
|
|
32
|
-
|
|
51
|
+
var displayName: string;
|
|
33
52
|
}
|
|
34
|
-
declare function CardTitle({
|
|
53
|
+
declare function CardTitle({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: ComponentProps<'h3'>): _$react_jsx_runtime0.JSX.Element;
|
|
35
57
|
declare namespace CardTitle {
|
|
36
|
-
|
|
58
|
+
var displayName: string;
|
|
37
59
|
}
|
|
38
|
-
declare function CardDescription({
|
|
60
|
+
declare function CardDescription({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: ComponentProps<'p'>): _$react_jsx_runtime0.JSX.Element;
|
|
39
64
|
declare namespace CardDescription {
|
|
40
|
-
|
|
65
|
+
var displayName: string;
|
|
41
66
|
}
|
|
42
67
|
declare const Card: typeof CardRoot & {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
Header: typeof CardHeader;
|
|
69
|
+
Content: typeof CardContent;
|
|
70
|
+
Footer: typeof CardFooter;
|
|
71
|
+
Image: typeof CardImage;
|
|
72
|
+
Title: typeof CardTitle;
|
|
73
|
+
Description: typeof CardDescription;
|
|
49
74
|
};
|
|
50
|
-
|
|
51
|
-
export { Card,
|
|
75
|
+
//#endregion
|
|
76
|
+
export { Card, CardProps, cardVariants };
|
|
77
|
+
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.d.ts","names":[],"sources":["../src/components/Card/index.tsx"],"mappings":";;;;;;cAQa,YAAA,GAAY,KAAA;;;IAavB,iCAAA,CAAA,SAAA;AAAA,KAEG,YAAA,WAAuB,WAAA;EAC1B,EAAA,GAAK,CAAA;AAAA,IACH,YAAA,QAAoB,YAAA;AAAA,KAEZ,SAAA,WAAoB,WAAA,YAAuB,YAAA,CAAa,CAAA,IAClE,IAAA,CAAK,cAAA,CAAe,CAAA,SAAU,YAAA,CAAa,CAAA;AAAA,iBAEpC,QAAA,WAAmB,WAAA,SAAA,CAAA;EAC1B,EAAA;EACA,SAAA;EACA,MAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,SAAA,CAAU,CAAA,IAAE,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBANN,QAAA;EAAA,IAAQ,WAAA;AAAA;AAAA,iBAwBR,UAAA,CAAA;EAAa,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,UAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAzD,UAAA;EAAA,IAAU,WAAA;AAAA;AAAA,iBAcV,WAAA,CAAA;EAAc,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,UAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA1D,WAAA;EAAA,IAAW,WAAA;AAAA;AAAA,iBAcX,UAAA,CAAA;EAAa,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,UAAqB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAzD,UAAA;EAAA,IAAU,WAAA;AAAA;AAAA,iBAcV,SAAA,CAAA;EACP,SAAA;EAAA,GACG;AAAA,GACF,iBAAA,CAAkB,gBAAA,IAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAH7B,SAAA;EAAA,IAAS,WAAA;AAAA;AAAA,iBAmBT,SAAA,CAAA;EAAY,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,SAAoB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAvD,SAAA;EAAA,IAAS,WAAA;AAAA;AAAA,iBAQT,eAAA,CAAA;EAAkB,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,QAAmB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA5D,eAAA;EAAA,IAAe,WAAA;AAAA;AAAA,cAMX,IAAA,SAOA,QAAA;EACX,MAAA,SAAe,UAAA;EACf,OAAA,SAAgB,WAAA;EAChB,MAAA,SAAe,UAAA;EACf,KAAA,SAAc,SAAA;EACd,KAAA,SAAc,SAAA;EACd,WAAA,SAAoB,eAAA;AAAA"}
|
package/dist/Card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{t as e}from"./variants-DTAwzBl3.js";import{cva as t}from"class-variance-authority";import{cn as n}from"@oztix/roadie-core/utils";import{jsx as r}from"react/jsx-runtime";const i=t(`grid content-start rounded-xl group/card`,{variants:{intent:e,emphasis:{raised:`emphasis-raised`,subtle:`emphasis-subtle`,subtler:`emphasis-subtler p-2 gap-4 -m-2`,normal:`emphasis-normal`}},defaultVariants:{emphasis:`normal`}});function a({as:e,className:t,intent:a,emphasis:o,...s}){let c=s,l=!!c.href||!!c.onClick;return r(e||(c.href?`a`:`div`),{className:n(i({intent:a,emphasis:o}),l&&`is-interactive`,t),...s})}a.displayName=`Card`;function o({className:e,...t}){return r(`div`,{className:n(`grid gap-1.5 px-6 pt-6 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:pt-0`,e),...t})}o.displayName=`Card.Header`;function s({className:e,...t}){return r(`div`,{className:n(`px-6 py-4 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:py-0`,e),...t})}s.displayName=`Card.Content`;function c({className:e,...t}){return r(`div`,{className:n(`flex items-center gap-2 px-6 pb-6 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:pb-0`,e),...t})}c.displayName=`Card.Footer`;function l({className:e,...t}){return r(`div`,{className:`overflow-hidden rounded-xl`,children:r(`img`,{className:n(`aspect-2/1 w-full object-cover transition-transform duration-300 group-hover/card:scale-105`,e),...t})})}l.displayName=`Card.Image`;function u({className:e,...t}){return r(`h3`,{className:n(`text-display-ui-6 text-strong`,e),...t})}u.displayName=`Card.Title`;function d({className:e,...t}){return r(`p`,{className:n(`text-sm text-subtle`,e),...t})}d.displayName=`Card.Description`;const f=Object.assign(a,{Header:o,Content:s,Footer:c,Image:l,Title:u,Description:d});export{f as Card,i as cardVariants};
|
|
2
2
|
//# sourceMappingURL=Card.js.map
|
package/dist/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Card.js","names":[],"sources":["../src/components/Card/index.tsx"],"sourcesContent":["import type { ComponentProps, ElementType, ImgHTMLAttributes } from 'react'\n\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\n\nexport const cardVariants = cva('grid content-start rounded-xl group/card', {\n variants: {\n intent: intentVariants,\n emphasis: {\n raised: 'emphasis-raised',\n subtle: 'emphasis-subtle',\n subtler: 'emphasis-subtler p-2 gap-4 -m-2',\n normal: 'emphasis-normal'\n }\n },\n defaultVariants: {\n emphasis: 'normal'\n }\n})\n\ntype CardOwnProps<T extends ElementType = 'div'> = {\n as?: T\n} & VariantProps<typeof cardVariants>\n\nexport type CardProps<T extends ElementType = 'div'> = CardOwnProps<T> &\n Omit<ComponentProps<T>, keyof CardOwnProps<T>>\n\nfunction CardRoot<T extends ElementType = 'div'>({\n as,\n className,\n intent,\n emphasis,\n ...props\n}: CardProps<T>) {\n const rest = props as Record<string, unknown>\n const isInteractive = !!rest.href || !!rest.onClick\n const Component = as || (rest.href ? 'a' : 'div')\n return (\n <Component\n className={cn(\n cardVariants({ intent, emphasis }),\n isInteractive && 'is-interactive',\n className\n )}\n {...props}\n />\n )\n}\n\nCardRoot.displayName = 'Card'\n\nfunction CardHeader({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'grid gap-1.5 px-6 pt-6 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:pt-0',\n className\n )}\n {...props}\n />\n )\n}\n\nCardHeader.displayName = 'Card.Header'\n\nfunction CardContent({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'px-6 py-4 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:py-0',\n className\n )}\n {...props}\n />\n )\n}\n\nCardContent.displayName = 'Card.Content'\n\nfunction CardFooter({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n className={cn(\n 'flex items-center gap-2 px-6 pb-6 group-[.emphasis-subtler]/card:px-0 group-[.emphasis-subtler]/card:pb-0',\n className\n )}\n {...props}\n />\n )\n}\n\nCardFooter.displayName = 'Card.Footer'\n\nfunction CardImage({\n className,\n ...props\n}: ImgHTMLAttributes<HTMLImageElement>) {\n return (\n <div className='overflow-hidden rounded-xl'>\n <img\n className={cn(\n 'aspect-2/1 w-full object-cover transition-transform duration-300 group-hover/card:scale-105',\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nCardImage.displayName = 'Card.Image'\n\nfunction CardTitle({ className, ...props }: ComponentProps<'h3'>) {\n return (\n <h3 className={cn('text-display-ui-6 text-strong', className)} {...props} />\n )\n}\n\nCardTitle.displayName = 'Card.Title'\n\nfunction CardDescription({ className, ...props }: ComponentProps<'p'>) {\n return <p className={cn('text-sm text-subtle', className)} {...props} />\n}\n\nCardDescription.displayName = 'Card.Description'\n\nexport const Card = Object.assign(CardRoot, {\n Header: CardHeader,\n Content: CardContent,\n Footer: CardFooter,\n Image: CardImage,\n Title: CardTitle,\n Description: CardDescription\n}) as typeof CardRoot & {\n Header: typeof CardHeader\n Content: typeof CardContent\n Footer: typeof CardFooter\n Image: typeof CardImage\n Title: typeof CardTitle\n Description: typeof CardDescription\n}\n"],"mappings":"gLAQA,MAAa,EAAe,EAAI,2CAA4C,CAC1E,SAAU,CACR,OAAQ,EACR,SAAU,CACR,OAAQ,kBACR,OAAQ,kBACR,QAAS,kCACT,OAAQ,kBACT,CACF,CACD,gBAAiB,CACf,SAAU,SACX,CACF,CAAC,CASF,SAAS,EAAwC,CAC/C,KACA,YACA,SACA,WACA,GAAG,GACY,CACf,IAAM,EAAO,EACP,EAAgB,CAAC,CAAC,EAAK,MAAQ,CAAC,CAAC,EAAK,QAE5C,OACE,EAFgB,IAAO,EAAK,KAAO,IAAM,OAEzC,CACE,UAAW,EACT,EAAa,CAAE,SAAQ,WAAU,CAAC,CAClC,GAAiB,iBACjB,EACD,CACD,GAAI,EACJ,CAAA,CAIN,EAAS,YAAc,OAEvB,SAAS,EAAW,CAAE,YAAW,GAAG,GAAgC,CAClE,OACE,EAAC,MAAD,CACE,UAAW,EACT,iGACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc,cAEzB,SAAS,EAAY,CAAE,YAAW,GAAG,GAAgC,CACnE,OACE,EAAC,MAAD,CACE,UAAW,EACT,oFACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,EAAY,YAAc,eAE1B,SAAS,EAAW,CAAE,YAAW,GAAG,GAAgC,CAClE,OACE,EAAC,MAAD,CACE,UAAW,EACT,4GACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,EAAW,YAAc,cAEzB,SAAS,EAAU,CACjB,YACA,GAAG,GACmC,CACtC,OACE,EAAC,MAAD,CAAK,UAAU,sCACb,EAAC,MAAD,CACE,UAAW,EACT,8FACA,EACD,CACD,GAAI,EACJ,CAAA,CACE,CAAA,CAIV,EAAU,YAAc,aAExB,SAAS,EAAU,CAAE,YAAW,GAAG,GAA+B,CAChE,OACE,EAAC,KAAD,CAAI,UAAW,EAAG,gCAAiC,EAAU,CAAE,GAAI,EAAS,CAAA,CAIhF,EAAU,YAAc,aAExB,SAAS,EAAgB,CAAE,YAAW,GAAG,GAA8B,CACrE,OAAO,EAAC,IAAD,CAAG,UAAW,EAAG,sBAAuB,EAAU,CAAE,GAAI,EAAS,CAAA,CAG1E,EAAgB,YAAc,mBAE9B,MAAa,EAAO,OAAO,OAAO,EAAU,CAC1C,OAAQ,EACR,QAAS,EACT,OAAQ,EACR,MAAO,EACP,MAAO,EACP,YAAa,EACd,CAAC"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { n as IconButtonProps } from "./IconButton-Bhg6u3Qm.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
+
import { ComponentProps, ElementType, ReactNode } from "react";
|
|
5
|
+
import * as _$class_variance_authority_types0 from "class-variance-authority/types";
|
|
6
|
+
import { EmblaCarouselType, EmblaOptionsType } from "embla-carousel";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Carousel/index.d.ts
|
|
9
|
+
type CarouselDirection = 'horizontal' | 'vertical';
|
|
10
|
+
type CarouselActions = {
|
|
11
|
+
goToPrev: () => void;
|
|
12
|
+
goToNext: () => void;
|
|
13
|
+
goTo: (index: number) => void;
|
|
14
|
+
play: () => void;
|
|
15
|
+
pause: () => void;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
};
|
|
18
|
+
type CarouselState = {
|
|
19
|
+
direction: CarouselDirection; /** Selected snap index (0-based). Note: a snap may cover multiple slides. */
|
|
20
|
+
selectedIndex: number; /** Number of `Carousel.Item` children. Used for "N of M" slide labels. */
|
|
21
|
+
slideCount: number;
|
|
22
|
+
/**
|
|
23
|
+
* Number of distinct Embla scroll snap positions. May be smaller than
|
|
24
|
+
* `slideCount` for multi-visible layouts (e.g. `basis-1/3` with 4 cards
|
|
25
|
+
* creates 2 snaps), or equal to it for single-slide layouts. Falls back
|
|
26
|
+
* to `slideCount` in environments where Embla can't measure (jsdom).
|
|
27
|
+
*/
|
|
28
|
+
snapCount: number;
|
|
29
|
+
canGoToPrev: boolean;
|
|
30
|
+
canGoToNext: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* True when there is somewhere to scroll to. False when every slide
|
|
33
|
+
* already fits in the viewport (snapCount <= 1) — in which case
|
|
34
|
+
* Previous / Next / Dots / Controls all hide themselves.
|
|
35
|
+
*/
|
|
36
|
+
canScroll: boolean;
|
|
37
|
+
isPlaying: boolean;
|
|
38
|
+
userPaused: boolean;
|
|
39
|
+
labelId: string | undefined;
|
|
40
|
+
rootAriaLabel: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
type UseCarouselReturn = {
|
|
43
|
+
state: CarouselState;
|
|
44
|
+
actions: CarouselActions;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Access the carousel's state and actions. Must be called inside a
|
|
48
|
+
* `<Carousel>` tree.
|
|
49
|
+
*
|
|
50
|
+
* For escape-hatch access to the underlying Embla instance, use
|
|
51
|
+
* `useCarouselUnsafeEmbla()` — it is intentionally separate so raw-Embla
|
|
52
|
+
* coupling is greppable.
|
|
53
|
+
*/
|
|
54
|
+
declare function useCarousel(): UseCarouselReturn;
|
|
55
|
+
/**
|
|
56
|
+
* Escape hatch: read the underlying Embla `api` instance directly.
|
|
57
|
+
*
|
|
58
|
+
* Returning Embla's API hard-couples your code to a specific major version
|
|
59
|
+
* of `embla-carousel`. Prefer `useCarousel()` whenever the public state and
|
|
60
|
+
* actions are sufficient. This hook exists so you can grep for raw-Embla
|
|
61
|
+
* usage when planning an upgrade.
|
|
62
|
+
*/
|
|
63
|
+
declare function useCarouselUnsafeEmbla(): EmblaCarouselType | undefined;
|
|
64
|
+
declare const carouselContentVariants: (props?: ({
|
|
65
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
66
|
+
overflow?: "subtle" | "hidden" | "visible" | null | undefined;
|
|
67
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
68
|
+
declare const carouselContainerVariants: (props?: ({
|
|
69
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
70
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
71
|
+
declare const carouselItemVariants: (props?: ({
|
|
72
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
73
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
74
|
+
declare const carouselDotsVariants: (props?: ({
|
|
75
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
76
|
+
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
77
|
+
interface CarouselProps extends Omit<ComponentProps<'div'>, 'onBlur'> {
|
|
78
|
+
/** Pass-through options for the Embla instance. */
|
|
79
|
+
opts?: EmblaOptionsType;
|
|
80
|
+
/** Scroll direction. @default 'horizontal' */
|
|
81
|
+
direction?: CarouselDirection;
|
|
82
|
+
/**
|
|
83
|
+
* Autoplay delay in milliseconds, or `false` to disable. When set, an
|
|
84
|
+
* autoplay plugin is wired internally and pauses on hover / focus / pointer
|
|
85
|
+
* interaction. A persistent pause control via `<Carousel.PlayPause>` is
|
|
86
|
+
* strongly recommended for WCAG 2.2.2 compliance.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
autoPlay?: number | false;
|
|
90
|
+
/** Accessible name for the carousel region. */
|
|
91
|
+
'aria-label'?: string;
|
|
92
|
+
}
|
|
93
|
+
declare function Carousel({
|
|
94
|
+
opts,
|
|
95
|
+
direction,
|
|
96
|
+
autoPlay,
|
|
97
|
+
children,
|
|
98
|
+
className,
|
|
99
|
+
'aria-label': ariaLabel,
|
|
100
|
+
...props
|
|
101
|
+
}: CarouselProps): _$react_jsx_runtime0.JSX.Element;
|
|
102
|
+
declare namespace Carousel {
|
|
103
|
+
var displayName: string;
|
|
104
|
+
var Header: typeof CarouselHeader;
|
|
105
|
+
var Title: typeof CarouselTitle;
|
|
106
|
+
var TitleLink: typeof CarouselTitleLink;
|
|
107
|
+
var Controls: typeof CarouselControls;
|
|
108
|
+
var Content: typeof CarouselContent;
|
|
109
|
+
var Item: typeof CarouselItem;
|
|
110
|
+
var Previous: typeof CarouselPrevious;
|
|
111
|
+
var Next: typeof CarouselNext;
|
|
112
|
+
var PlayPause: typeof CarouselPlayPause;
|
|
113
|
+
var Dots: typeof CarouselDots;
|
|
114
|
+
}
|
|
115
|
+
type CarouselHeaderProps = ComponentProps<'div'>;
|
|
116
|
+
declare function CarouselHeader({
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}: CarouselHeaderProps): _$react_jsx_runtime0.JSX.Element;
|
|
120
|
+
declare namespace CarouselHeader {
|
|
121
|
+
var displayName: string;
|
|
122
|
+
}
|
|
123
|
+
type CarouselControlsProps = ComponentProps<'div'> & {
|
|
124
|
+
/**
|
|
125
|
+
* Render the controls even when there's nothing to scroll to. Useful
|
|
126
|
+
* when the slot contains custom buttons (filters, share) that aren't
|
|
127
|
+
* gated on slide count.
|
|
128
|
+
*/
|
|
129
|
+
forceVisible?: boolean;
|
|
130
|
+
};
|
|
131
|
+
declare function CarouselControls({
|
|
132
|
+
className,
|
|
133
|
+
forceVisible,
|
|
134
|
+
...props
|
|
135
|
+
}: CarouselControlsProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
136
|
+
declare namespace CarouselControls {
|
|
137
|
+
var displayName: string;
|
|
138
|
+
}
|
|
139
|
+
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
140
|
+
type CarouselTitleProps = ComponentProps<'h2'> & {
|
|
141
|
+
/** Heading level. Defaults to `<h2>`. */as?: HeadingLevel;
|
|
142
|
+
};
|
|
143
|
+
declare function CarouselTitle({
|
|
144
|
+
as: Component,
|
|
145
|
+
className,
|
|
146
|
+
children,
|
|
147
|
+
id,
|
|
148
|
+
...props
|
|
149
|
+
}: CarouselTitleProps): _$react_jsx_runtime0.JSX.Element;
|
|
150
|
+
declare namespace CarouselTitle {
|
|
151
|
+
var displayName: string;
|
|
152
|
+
}
|
|
153
|
+
type CarouselTitleLinkOwnProps<T extends ElementType> = {
|
|
154
|
+
/**
|
|
155
|
+
* Render the link as a custom element/component (e.g. Next.js `Link`).
|
|
156
|
+
* Defaults to `<a>`.
|
|
157
|
+
*/
|
|
158
|
+
as?: T; /** DOM id for `aria-labelledby`. Defaults to a generated id. */
|
|
159
|
+
id?: string;
|
|
160
|
+
};
|
|
161
|
+
type CarouselTitleLinkProps<T extends ElementType = 'a'> = CarouselTitleLinkOwnProps<T> & Omit<ComponentProps<T>, keyof CarouselTitleLinkOwnProps<T>>;
|
|
162
|
+
declare function CarouselTitleLink<T extends ElementType = 'a'>({
|
|
163
|
+
as,
|
|
164
|
+
className,
|
|
165
|
+
children,
|
|
166
|
+
id,
|
|
167
|
+
...props
|
|
168
|
+
}: CarouselTitleLinkProps<T>): _$react_jsx_runtime0.JSX.Element;
|
|
169
|
+
declare namespace CarouselTitleLink {
|
|
170
|
+
var displayName: string;
|
|
171
|
+
}
|
|
172
|
+
type CarouselContentOverflow = 'hidden' | 'visible' | 'subtle';
|
|
173
|
+
type CarouselContentProps = ComponentProps<'div'> & {
|
|
174
|
+
/** Props to forward to the inner Embla container (flex row/col). */containerProps?: ComponentProps<'div'>;
|
|
175
|
+
/**
|
|
176
|
+
* How slides escape the viewport box.
|
|
177
|
+
*
|
|
178
|
+
* - `subtle` (default): slides bleed past the edges by the gutter width
|
|
179
|
+
* and fade to the page background via `::before` / `::after`
|
|
180
|
+
* gradients. Good for most carousels — gives a clear scroll hint
|
|
181
|
+
* without half-clipped cards.
|
|
182
|
+
* - `hidden`: slides are hard-clipped at the viewport edge.
|
|
183
|
+
* - `visible`: slides can extend indefinitely. Useful on wide screens
|
|
184
|
+
* where you deliberately want peeking slides to remain fully
|
|
185
|
+
* rendered in the surrounding margin area.
|
|
186
|
+
*
|
|
187
|
+
* @default 'subtle'
|
|
188
|
+
*/
|
|
189
|
+
overflow?: 'hidden' | 'visible' | 'subtle';
|
|
190
|
+
};
|
|
191
|
+
declare function CarouselContent({
|
|
192
|
+
className,
|
|
193
|
+
children,
|
|
194
|
+
containerProps,
|
|
195
|
+
onKeyDown,
|
|
196
|
+
overflow,
|
|
197
|
+
...props
|
|
198
|
+
}: CarouselContentProps): _$react_jsx_runtime0.JSX.Element;
|
|
199
|
+
declare namespace CarouselContent {
|
|
200
|
+
var displayName: string;
|
|
201
|
+
}
|
|
202
|
+
type CarouselItemProps = ComponentProps<'div'>;
|
|
203
|
+
declare function CarouselItem({
|
|
204
|
+
className,
|
|
205
|
+
children,
|
|
206
|
+
...props
|
|
207
|
+
}: CarouselItemProps): _$react_jsx_runtime0.JSX.Element;
|
|
208
|
+
declare namespace CarouselItem {
|
|
209
|
+
var displayName: string;
|
|
210
|
+
}
|
|
211
|
+
type CarouselNavButtonProps = Omit<IconButtonProps, 'aria-label' | 'children'> & {
|
|
212
|
+
/**
|
|
213
|
+
* Override the default accessible label.
|
|
214
|
+
* Defaults to "Previous slide" / "Next slide" / "Pause carousel" / "Play carousel".
|
|
215
|
+
*/
|
|
216
|
+
'aria-label'?: string; /** Override the default caret/play/pause icon. */
|
|
217
|
+
children?: ReactNode;
|
|
218
|
+
};
|
|
219
|
+
declare function CarouselPrevious({
|
|
220
|
+
className,
|
|
221
|
+
'aria-label': ariaLabel,
|
|
222
|
+
children,
|
|
223
|
+
...props
|
|
224
|
+
}: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
225
|
+
declare namespace CarouselPrevious {
|
|
226
|
+
var displayName: string;
|
|
227
|
+
}
|
|
228
|
+
declare function CarouselNext({
|
|
229
|
+
className,
|
|
230
|
+
'aria-label': ariaLabel,
|
|
231
|
+
children,
|
|
232
|
+
...props
|
|
233
|
+
}: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
234
|
+
declare namespace CarouselNext {
|
|
235
|
+
var displayName: string;
|
|
236
|
+
}
|
|
237
|
+
declare function CarouselPlayPause({
|
|
238
|
+
className,
|
|
239
|
+
'aria-label': ariaLabel,
|
|
240
|
+
children,
|
|
241
|
+
...props
|
|
242
|
+
}: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
243
|
+
declare namespace CarouselPlayPause {
|
|
244
|
+
var displayName: string;
|
|
245
|
+
}
|
|
246
|
+
type CarouselDotsProps = ComponentProps<'div'>;
|
|
247
|
+
declare function CarouselDots({
|
|
248
|
+
className,
|
|
249
|
+
...props
|
|
250
|
+
}: CarouselDotsProps): _$react_jsx_runtime0.JSX.Element | null;
|
|
251
|
+
declare namespace CarouselDots {
|
|
252
|
+
var displayName: string;
|
|
253
|
+
}
|
|
254
|
+
type CarouselVariantProps = VariantProps<typeof carouselContentVariants>;
|
|
255
|
+
//#endregion
|
|
256
|
+
export { Carousel, CarouselActions, CarouselContent, CarouselContentOverflow, CarouselContentProps, CarouselControls, CarouselControlsProps, CarouselDots, CarouselDotsProps, CarouselHeader, CarouselHeaderProps, CarouselItem, CarouselItemProps, CarouselNavButtonProps, CarouselNext, CarouselPlayPause, CarouselPrevious, CarouselProps, CarouselState, CarouselTitle, CarouselTitleLink, CarouselTitleLinkProps, CarouselTitleProps, CarouselVariantProps, UseCarouselReturn, carouselContainerVariants, carouselContentVariants, carouselDotsVariants, carouselItemVariants, useCarousel, useCarouselUnsafeEmbla };
|
|
257
|
+
//# sourceMappingURL=Carousel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","names":[],"sources":["../src/components/Carousel/index.tsx"],"mappings":"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"}
|
package/dist/Carousel.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{t as e}from"./IconButton-0UdUDm0O.js";import{cva as t}from"class-variance-authority";import{cn as n}from"@oztix/roadie-core/utils";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Children as a,createContext as o,isValidElement as s,use as c,useCallback as l,useEffect as u,useId as d,useLayoutEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{ArrowRightIcon as g,CaretDownIcon as _,CaretLeftIcon as v,CaretRightIcon as y,CaretUpIcon as b,PauseIcon as x,PlayIcon as S}from"@phosphor-icons/react/ssr";import C from"embla-carousel-autoplay";import w from"embla-carousel-react";function T(){return typeof process<`u`&&process?.env?.NODE_ENV!==`production`}function E(e){try{e()}catch(e){T()&&console.warn(`[Carousel] Autoplay plugin call failed:`,e)}}function D(){let[e,t]=h(!1);return u(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);t(e.matches);let n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}const O=o(null),k=o(null);function A(){let e=c(O);if(!e)throw Error(`Carousel subcomponent must be used inside <Carousel>`);return e}function j(){let e=c(k);if(!e)throw Error(`<Carousel.Item> must be a direct child of <Carousel.Content>`);return e}function M(){let e=A();return{state:p(()=>({direction:e.direction,selectedIndex:e.selectedIndex,slideCount:e.slideCount,snapCount:e.snapCount,canGoToPrev:e.canGoToPrev,canGoToNext:e.canGoToNext,canScroll:e.canScroll,isPlaying:e.isPlaying,userPaused:e.userPaused,labelId:e.labelId,rootAriaLabel:e.rootAriaLabel}),[e.direction,e.selectedIndex,e.slideCount,e.snapCount,e.canGoToPrev,e.canGoToNext,e.canScroll,e.isPlaying,e.userPaused,e.labelId,e.rootAriaLabel]),actions:p(()=>({goToPrev:e.goToPrev,goToNext:e.goToNext,goTo:e.goTo,play:e.play,pause:e.pause,toggle:e.toggle}),[e.goToPrev,e.goToNext,e.goTo,e.play,e.pause,e.toggle])}}function N(){return A().api}const P=t(`relative focus-visible:outline-none`,{variants:{direction:{horizontal:`-my-4 py-4`,vertical:``},overflow:{hidden:`overflow-clip`,visible:`overflow-visible`,subtle:`overflow-clip`}},compoundVariants:[{overflow:`subtle`,direction:`horizontal`,class:[`-mx-4 px-4 sm:-mx-6 sm:px-6`,`before:pointer-events-none before:absolute before:inset-y-0 before:left-0 before:z-10`,`before:w-4 sm:before:w-6`,`before:bg-linear-to-r before:from-[var(--intent-bg-normal)] before:to-transparent`,`after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:z-10`,`after:w-4 sm:after:w-6`,`after:bg-linear-to-l after:from-[var(--intent-bg-normal)] after:to-transparent`].join(` `)},{overflow:`subtle`,direction:`vertical`,class:[`py-4`,`before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-10`,`before:h-4`,`before:bg-linear-to-b before:from-[var(--intent-bg-normal)] before:to-transparent`,`after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:z-10`,`after:h-4`,`after:bg-linear-to-t after:from-[var(--intent-bg-normal)] after:to-transparent`].join(` `)}],defaultVariants:{direction:`horizontal`,overflow:`subtle`}}),F=t(`flex`,{variants:{direction:{horizontal:`-ml-4`,vertical:`-mt-4 h-full flex-col`}},defaultVariants:{direction:`horizontal`}}),I=t(`min-h-0 min-w-0 shrink-0 grow-0 basis-full`,{variants:{direction:{horizontal:`pl-4`,vertical:`pt-4`}},defaultVariants:{direction:`horizontal`}}),L=t(`flex items-center justify-center`,{variants:{direction:{horizontal:`flex-row gap-1.5`,vertical:`flex-col gap-1.5`}},defaultVariants:{direction:`horizontal`}});function R({opts:e,direction:t=`horizontal`,autoPlay:i=!1,children:a,className:o,"aria-label":s,...c}){let d=D(),f=t===`vertical`?`y`:`x`,g=i!==!1;u(()=>{T()&&i!==!1&&i<2e3&&console.warn(`[Carousel] autoPlay delay < 2000ms may fail WCAG 2.2.1 timing; prefer >= 4000ms.`)},[i]),u(()=>{T()&&e?.axis&&e.axis!==f&&console.warn(`[Carousel] opts.axis="${e.axis}" conflicts with direction="${t}". direction wins.`)},[e?.axis,f,t]);let _=p(()=>!g||d?[]:[C({delay:i,stopOnLastSnap:!1})],[i,d,g]),[v,y]=w(p(()=>({align:`start`,slidesToScroll:`auto`,...e,axis:f,duration:d?0:e?.duration??25}),[e,f,d]),_),[b,x]=h(0),[S,k]=h(0),[A,j]=h(0),[M,N]=h(void 0),[P,F]=h([0]),[I,L]=h(()=>g&&!d),[R,z]=h(!1),B=m(!1),V=e?.loop===!0,H=m(!1),U=l(e=>{H.current=!0,x(e.selectedSnap())},[]);u(()=>{if(y)return U(y),y.on(`reinit`,U).on(`select`,U),()=>{y.off(`reinit`,U).off(`select`,U)}},[y,U]);let W=l(e=>{let t=e.slidesInView();F(t.length>0?t:[e.selectedSnap()]),j(e.snapList().length)},[]);u(()=>{if(y)return W(y),y.on(`reinit`,W).on(`slidesinview`,W).on(`resize`,W).on(`slideschanged`,W),()=>{y.off(`reinit`,W).off(`slidesinview`,W).off(`resize`,W).off(`slideschanged`,W)}},[y,W]),u(()=>{if(!y)return;let e=e=>{if(typeof document>`u`)return;let t=document.activeElement;if(!t||!t.isConnected)return;let n=t.closest(`[aria-roledescription="slide"]`);if(!n||t===n)return;let r=e.selectedSnap();requestAnimationFrame(()=>{e.slideNodes()[r]?.focus({preventScroll:!0})})};return y.on(`select`,e),()=>{y.off(`select`,e)}},[y]),u(()=>{if(!y)return;let e=y.plugins().autoplay;e&&(B.current||E(e.play))},[y,_]),u(()=>{L(g&&!d),(!g||d)&&(z(!1),B.current=!1)},[g,d]),u(()=>{y?.reInit()},[y,S]);let G=A>0?A:S,K=G>0?Math.min(Math.max(0,b),G-1):0,q=G>1&&(V||K>0),J=G>1&&(V||K<G-1),Y=G>1,X=p(()=>({goToPrev:()=>{H.current=!1,y?.goToPrev(),!H.current&&x(e=>e>0?e-1:V?Math.max(0,G-1):e)},goToNext:()=>{H.current=!1,y?.goToNext(),!H.current&&x(e=>e<G-1?e+1:V?0:e)},goTo:e=>{H.current=!1,y?.goTo(e),!H.current&&x(Math.max(0,Math.min(e,G-1)))},play:()=>{if(!g)return;B.current=!1,z(!1),L(!0);let e=y?.plugins().autoplay;e&&E(e.play)},pause:()=>{if(!g)return;B.current=!0,z(!0),L(!1);let e=y?.plugins().autoplay;e&&E(e.stop)},toggle:()=>{if(!g)return;let e=!I;B.current=!e,z(!e),L(e);let t=y?.plugins().autoplay;t&&E(e?t.play:t.stop)}}),[y,g,I,V,G]),Z=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.pause)},[y]),Q=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.play)},[y]),$=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.pause)},[y]),ee=l(e=>{if(B.current)return;let t=e.relatedTarget,n=e.currentTarget,r=()=>{let e=y?.plugins().autoplay;e&&E(e.play)};if(!t){requestAnimationFrame(()=>{n.isConnected&&!n.contains(document.activeElement)&&r()});return}n.contains(t)||r()},[y]),te=p(()=>({direction:t,selectedIndex:K,slideCount:S,snapCount:G,canGoToPrev:q,canGoToNext:J,canScroll:Y,isPlaying:I,userPaused:R,labelId:M,rootAriaLabel:s,goToPrev:X.goToPrev,goToNext:X.goToNext,goTo:X.goTo,play:X.play,pause:X.pause,toggle:X.toggle,api:y,emblaRef:v,setSlideCount:k,setLabelId:N,loop:V,autoPlay:i,slidesInView:P}),[t,K,S,q,J,Y,I,R,M,s,X,y,v,V,i,P]);return r(O.Provider,{value:te,children:r(`div`,{role:`region`,"aria-roledescription":`carousel`,"aria-label":M?void 0:s,"aria-labelledby":M,onMouseEnter:Z,onMouseLeave:Q,onFocus:$,onBlur:ee,className:n(`relative`,o),...c,children:a})})}R.displayName=`Carousel`;function z({className:e,...t}){return r(`div`,{className:n(`mb-4 flex items-center justify-between gap-4`,`md:grid md:grid-cols-[1fr_auto_1fr]`,`md:[&>*:first-child]:justify-self-start`,`md:[&>*:last-child:not(:first-child)]:col-start-3`,`md:[&>*:last-child:not(:first-child)]:justify-self-end`,`md:[&>*:nth-child(2):not(:last-child)]:col-start-2`,`md:[&>*:nth-child(2):not(:last-child)]:justify-self-center`,e),...t})}z.displayName=`Carousel.Header`;function B({className:e,forceVisible:t=!1,...i}){let{canScroll:a}=A();return!t&&!a?null:r(`div`,{className:n(`hidden items-center gap-2 md:flex`,e),...i})}B.displayName=`Carousel.Controls`;function V(e){let{setLabelId:t}=A();u(()=>(t(e),()=>{t(t=>t===e?void 0:t)}),[e,t])}function H({as:e=`h2`,className:t,children:i,id:a,...o}){let s=d(),c=a??s;return V(c),r(e,{id:c,className:n(`text-display-ui-5 text-strong`,t),...o,children:i})}H.displayName=`Carousel.Title`;function U({as:e,className:t,children:a,id:o,...s}){let c=d(),l=o??c;return V(l),i(e??`a`,{id:l,className:n(`group/title is-interactive flex items-center gap-1 text-display-ui-5 text-strong`,t),...s,children:[a,r(g,{weight:`bold`,className:`size-5 text-subtle transition-transform group-hover/title:translate-x-1 group-hover/title:intent-accent`})]})}U.displayName=`Carousel.TitleLink`;function W({className:e,children:t,containerProps:i,onKeyDown:o,overflow:c=`subtle`,...u}){let{direction:d,selectedIndex:m,snapCount:h,slidesInView:g,isPlaying:_,labelId:v,rootAriaLabel:y,goToPrev:b,goToNext:x,goTo:S,emblaRef:C,setSlideCount:w}=A(),T=_?`off`:`polite`,E=a.count(t);f(()=>{w(E)},[E,w]);let D=p(()=>new Set(g),[g]),O=a.map(t,(e,t)=>{if(!s(e))return e;let n={index:t,total:E,isActive:t===m,isInView:D.has(t)};return r(k.Provider,{value:n,children:e},e.key??t)});return r(`div`,{ref:C,tabIndex:0,onKeyDown:l(e=>{if(o?.(e),e.defaultPrevented)return;let t=e.target;if(t!==e.currentTarget){let e=t.closest(`[role="group"][aria-roledescription="slide"]`),n=t.matches(`button, a, input, textarea, select, [tabindex]:not([tabindex="-1"])`);if(e&&n)return}let n=d===`horizontal`,r=n?`ArrowLeft`:`ArrowUp`,i=n?`ArrowRight`:`ArrowDown`;e.key===r?(e.preventDefault(),b()):e.key===i?(e.preventDefault(),x()):e.key===`Home`?(e.preventDefault(),S(0)):e.key===`End`&&(e.preventDefault(),S(Math.max(0,h-1)))},[d,b,x,S,h,o]),"aria-live":T,"aria-label":v?void 0:y,"aria-labelledby":v,className:n(P({direction:d,overflow:c}),e),...u,children:r(`div`,{...i,className:n(F({direction:d}),i?.className),children:O})})}W.displayName=`Carousel.Content`;function G({className:e,children:t,...i}){let{direction:a}=A(),{index:o,total:s,isInView:c}=j();return r(`div`,{role:`group`,"aria-roledescription":`slide`,"aria-label":`${o+1} of ${s}`,tabIndex:-1,inert:!c,className:n(I({direction:a}),e),...i,children:t})}G.displayName=`Carousel.Item`;function K({className:t,"aria-label":n=`Previous slide`,children:i,...a}){let{direction:o,canScroll:s,canGoToPrev:c,goToPrev:l}=A();if(!s)return null;let u=o===`vertical`?b:v;return r(e,{size:`icon-sm`,className:t,"aria-label":n,"aria-disabled":!c||void 0,"data-disabled":!c||void 0,onClick:c?l:void 0,...a,children:i??r(u,{weight:`bold`,className:`size-4`})})}K.displayName=`Carousel.Previous`;function q({className:t,"aria-label":n=`Next slide`,children:i,...a}){let{direction:o,canScroll:s,canGoToNext:c,goToNext:l}=A();if(!s)return null;let u=o===`vertical`?_:y;return r(e,{size:`icon-sm`,className:t,"aria-label":n,"aria-disabled":!c||void 0,"data-disabled":!c||void 0,onClick:c?l:void 0,...a,children:i??r(u,{weight:`bold`,className:`size-4`})})}q.displayName=`Carousel.Next`;function J({className:t,"aria-label":n,children:i,...a}){let{autoPlay:o,isPlaying:s,toggle:c}=A();if(o===!1)return null;let l=n??(s?`Pause carousel`:`Play carousel`);return r(e,{size:`icon-sm`,className:t,"aria-label":l,"aria-pressed":!s,onClick:c,...a,children:i??r(s?x:S,{weight:`bold`,className:`size-4 text-subtle`})})}J.displayName=`Carousel.PlayPause`;function Y({className:e,...t}){let{direction:i,snapCount:a,selectedIndex:o,canScroll:s,goTo:c}=A();return s?r(`div`,{role:`group`,"aria-label":`Choose slide to display`,className:n(L({direction:i}),e),...t,children:Array.from({length:a},(e,t)=>{let i=t===o;return r(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,"aria-current":i?`true`:void 0,"aria-disabled":i||void 0,onClick:()=>c(t),className:n(`is-interactive h-2 rounded-full transition-all`,i?`w-5 emphasis-strong intent-accent`:`w-2 emphasis-normal`)},t)})}):null}Y.displayName=`Carousel.Dots`,R.Header=z,R.Title=H,R.TitleLink=U,R.Controls=B,R.Content=W,R.Item=G,R.Previous=K,R.Next=q,R.PlayPause=J,R.Dots=Y;export{R as Carousel,W as CarouselContent,B as CarouselControls,Y as CarouselDots,z as CarouselHeader,G as CarouselItem,q as CarouselNext,J as CarouselPlayPause,K as CarouselPrevious,H as CarouselTitle,U as CarouselTitleLink,F as carouselContainerVariants,P as carouselContentVariants,L as carouselDotsVariants,I as carouselItemVariants,M as useCarousel,N as useCarouselUnsafeEmbla};
|
|
2
|
+
//# sourceMappingURL=Carousel.js.map
|