@blakesteve/roster 5.0.1 → 5.2.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/README.md +110 -9
- package/dist/components/atoms/Chip/Chip.cjs +1 -1
- package/dist/components/atoms/Chip/Chip.js +27 -27
- package/dist/components/atoms/Disclosure/Disclosure.cjs +1 -1
- package/dist/components/atoms/Disclosure/Disclosure.js +42 -44
- package/dist/components/atoms/Input/Input.cjs +1 -1
- package/dist/components/atoms/Input/Input.js +46 -41
- package/dist/components/atoms/Spinner/Spinner.cjs +1 -1
- package/dist/components/atoms/Spinner/Spinner.d.ts +6 -1
- package/dist/components/atoms/Spinner/Spinner.js +9 -8
- package/dist/components/atoms/Stat/Stat.cjs +1 -1
- package/dist/components/atoms/Stat/Stat.d.ts +27 -2
- package/dist/components/atoms/Stat/Stat.js +38 -13
- package/dist/components/atoms/Switch/Switch.cjs +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts +11 -1
- package/dist/components/atoms/Switch/Switch.js +38 -36
- package/dist/components/atoms/Switch/switch-variants.cjs +1 -1
- package/dist/components/atoms/Switch/switch-variants.js +1 -1
- package/dist/components/molecules/Carousel/Carousel.cjs +1 -0
- package/dist/components/molecules/Carousel/Carousel.d.ts +146 -0
- package/dist/components/molecules/Carousel/Carousel.js +363 -0
- package/dist/components/molecules/Carousel/carousel-layout.cjs +1 -0
- package/dist/components/molecules/Carousel/carousel-layout.d.ts +23 -0
- package/dist/components/molecules/Carousel/carousel-layout.js +22 -0
- package/dist/components/molecules/Carousel/carousel-math.cjs +1 -0
- package/dist/components/molecules/Carousel/carousel-math.d.ts +60 -0
- package/dist/components/molecules/Carousel/carousel-math.js +58 -0
- package/dist/components/molecules/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/molecules/EmptyState/EmptyState.d.ts +7 -1
- package/dist/components/molecules/EmptyState/EmptyState.js +18 -14
- package/dist/components/molecules/LiquidTabs/LiquidNav.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/LiquidNav.d.ts +62 -0
- package/dist/components/molecules/LiquidTabs/LiquidNav.js +78 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.d.ts +69 -0
- package/dist/components/molecules/LiquidTabs/LiquidTabs.js +92 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.d.ts +56 -0
- package/dist/components/molecules/LiquidTabs/liquid-pill.js +129 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.cjs +1 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.d.ts +12 -0
- package/dist/components/molecules/LiquidTabs/liquid-tab-id.js +6 -0
- package/dist/components/molecules/Toast/Toaster.cjs +1 -1
- package/dist/components/molecules/Toast/Toaster.d.ts +7 -0
- package/dist/components/molecules/Toast/Toaster.js +67 -45
- package/dist/components/organisms/Dialog/Dialog.cjs +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +102 -79
- package/dist/components/organisms/Navbar/Navbar.cjs +1 -1
- package/dist/components/organisms/Navbar/Navbar.js +157 -157
- package/dist/components/organisms/Sheet/Sheet.cjs +1 -0
- package/dist/components/organisms/Sheet/Sheet.d.ts +85 -0
- package/dist/components/organisms/Sheet/Sheet.js +304 -0
- package/dist/components/organisms/Sheet/sheet-drag.cjs +1 -0
- package/dist/components/organisms/Sheet/sheet-drag.d.ts +40 -0
- package/dist/components/organisms/Sheet/sheet-drag.js +22 -0
- package/dist/components/organisms/Sheet/sheet-title.cjs +1 -0
- package/dist/components/organisms/Sheet/sheet-title.d.ts +10 -0
- package/dist/components/organisms/Sheet/sheet-title.js +17 -0
- package/dist/index.d.ts +5 -1
- package/dist/internal/motion.cjs +1 -0
- package/dist/internal/motion.d.ts +12 -0
- package/dist/internal/motion.js +21 -0
- package/dist/internal/page-inert.cjs +1 -0
- package/dist/internal/page-inert.d.ts +51 -0
- package/dist/internal/page-inert.js +36 -0
- package/dist/meta.json +3 -3
- package/dist/roster.cjs +1 -1
- package/dist/roster.css +1 -1
- package/dist/roster.js +130 -122
- package/package.json +1 -1
- package/dist/components/atoms/LiquidTabs/LiquidTabs.cjs +0 -1
- package/dist/components/atoms/LiquidTabs/LiquidTabs.d.ts +0 -39
- package/dist/components/atoms/LiquidTabs/LiquidTabs.js +0 -120
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { Description as
|
|
5
|
-
import { Field as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Label as
|
|
2
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import g from "react";
|
|
4
|
+
import { Description as j } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
5
|
+
import { Field as P } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
|
|
6
|
+
import { Input as R } from "../../../node_modules/@headlessui/react/dist/components/input/input.js";
|
|
7
|
+
import { Label as V } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
|
|
8
8
|
import { cn as r } from "../../../lib/utils.js";
|
|
9
|
-
import { iconVariants as
|
|
10
|
-
const
|
|
9
|
+
import { iconVariants as f, inputVariants as _ } from "./input-variants.js";
|
|
10
|
+
const D = g.forwardRef(
|
|
11
11
|
({
|
|
12
|
-
className:
|
|
13
|
-
type:
|
|
14
|
-
label:
|
|
15
|
-
helperText:
|
|
16
|
-
errorMessage:
|
|
17
|
-
variant:
|
|
18
|
-
size:
|
|
19
|
-
error:
|
|
20
|
-
startIcon:
|
|
21
|
-
endIcon:
|
|
12
|
+
className: x,
|
|
13
|
+
type: u,
|
|
14
|
+
label: n,
|
|
15
|
+
helperText: d,
|
|
16
|
+
errorMessage: i,
|
|
17
|
+
variant: e,
|
|
18
|
+
size: a,
|
|
19
|
+
error: v,
|
|
20
|
+
startIcon: o,
|
|
21
|
+
endIcon: l,
|
|
22
22
|
disabled: p,
|
|
23
23
|
inputClassName: N,
|
|
24
24
|
...h
|
|
25
25
|
}, y) => {
|
|
26
|
-
const s = !!
|
|
26
|
+
const s = !!i || v, {
|
|
27
|
+
"aria-invalid": m,
|
|
28
|
+
invalid: b,
|
|
29
|
+
...k
|
|
30
|
+
} = h, w = !!b || m !== void 0 && m !== !1 && m !== "false";
|
|
27
31
|
return (
|
|
28
32
|
/* No `space-y-*` here, deliberately. Headless UI's Field appends a
|
|
29
33
|
hidden zero-height <span> after the control, and Tailwind v4 applies
|
|
@@ -38,72 +42,73 @@ const R = b.forwardRef(
|
|
|
38
42
|
DisabledProvider stays false and the Label and Description never dim.
|
|
39
43
|
Fixed in both rather than one, because a form with a disabled Input
|
|
40
44
|
and a disabled Select that grey differently is worse than neither. */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
/* @__PURE__ */ c(P, { disabled: p, className: r("rst:w-full", x), children: [
|
|
46
|
+
n && /* @__PURE__ */ t(
|
|
47
|
+
V,
|
|
44
48
|
{
|
|
45
49
|
className: r(
|
|
46
50
|
"rst:block rst:text-sm rst:font-medium rst:leading-none rst:text-left rst:mb-1.5 rst:transition-colors",
|
|
47
51
|
"rst:text-[var(--roster-control-text)]",
|
|
48
52
|
"rst:peer-disabled:cursor-not-allowed rst:peer-disabled:opacity-70"
|
|
49
53
|
),
|
|
50
|
-
children:
|
|
54
|
+
children: n
|
|
51
55
|
}
|
|
52
56
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
57
|
+
/* @__PURE__ */ c("div", { className: "rst:relative", children: [
|
|
58
|
+
o && /* @__PURE__ */ t(
|
|
55
59
|
"div",
|
|
56
60
|
{
|
|
57
61
|
className: r(
|
|
58
|
-
|
|
62
|
+
f({ variant: e, error: s }),
|
|
59
63
|
"rst:left-3"
|
|
60
64
|
),
|
|
61
|
-
children:
|
|
65
|
+
children: o
|
|
62
66
|
}
|
|
63
67
|
),
|
|
64
68
|
/* @__PURE__ */ t(
|
|
65
|
-
|
|
69
|
+
R,
|
|
66
70
|
{
|
|
67
71
|
ref: y,
|
|
68
|
-
type:
|
|
72
|
+
type: u,
|
|
69
73
|
disabled: p,
|
|
70
74
|
className: r(
|
|
71
|
-
|
|
75
|
+
_({ variant: e, size: a, error: s }),
|
|
72
76
|
/* Icon inset tracks the size's own padding: sm is px-3, so it
|
|
73
77
|
needs one step less clearance than the 16px sizes. */
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
o && (a === "sm" ? "rst:pl-9" : "rst:pl-10"),
|
|
79
|
+
l && (a === "sm" ? "rst:pr-9" : "rst:pr-10"),
|
|
76
80
|
N
|
|
77
81
|
),
|
|
78
|
-
...
|
|
82
|
+
...k,
|
|
83
|
+
invalid: w
|
|
79
84
|
}
|
|
80
85
|
),
|
|
81
|
-
|
|
86
|
+
l && /* @__PURE__ */ t(
|
|
82
87
|
"div",
|
|
83
88
|
{
|
|
84
89
|
className: r(
|
|
85
|
-
|
|
90
|
+
f({ variant: e, error: s }),
|
|
86
91
|
"rst:right-3"
|
|
87
92
|
),
|
|
88
|
-
children:
|
|
93
|
+
children: l
|
|
89
94
|
}
|
|
90
95
|
)
|
|
91
96
|
] }),
|
|
92
|
-
(
|
|
93
|
-
|
|
97
|
+
(d || i) && /* @__PURE__ */ t(
|
|
98
|
+
j,
|
|
94
99
|
{
|
|
95
100
|
className: r(
|
|
96
101
|
"rst:text-xs rst:text-left rst:mt-1.5",
|
|
97
102
|
s ? "rst:text-error-600 rst:dark:text-error-400 rst:font-medium" : "rst:text-gray-500 rst:dark:text-gray-400"
|
|
98
103
|
),
|
|
99
|
-
children:
|
|
104
|
+
children: i || d
|
|
100
105
|
}
|
|
101
106
|
)
|
|
102
107
|
] })
|
|
103
108
|
);
|
|
104
109
|
}
|
|
105
110
|
);
|
|
106
|
-
|
|
111
|
+
D.displayName = "Input";
|
|
107
112
|
export {
|
|
108
|
-
|
|
113
|
+
D as Input
|
|
109
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("../../../node_modules/class-variance-authority/dist/index.cjs"),o=require("../../../lib/utils.cjs"),i=d.cva("rst:animate-spin rst:motion-reduce:animate-none rst:rounded-full rst:transition-colors",{variants:{variant:{primary:"rst:border-primary-600 rst:dark:border-primary-500",neutral:"rst:border-gray-600 rst:dark:border-gray-400",danger:"rst:border-error-600 rst:dark:border-error-500",white:"rst:border-white",current:"rst:border-current"},size:{sm:"rst:h-4 rst:w-4 rst:border-2",md:"rst:h-6 rst:w-6 rst:border-[3px]",lg:"rst:h-8 rst:w-8 rst:border-4"},animation:{classic:"rst:border-solid rst:border-r-transparent rst:dark:border-r-transparent",half:"rst:border-solid rst:border-r-transparent rst:border-b-transparent rst:dark:border-r-transparent rst:dark:border-b-transparent",dashed:"rst:border-dashed",dotted:"rst:border-dotted rst:border-r-transparent rst:dark:border-r-transparent"}},defaultVariants:{variant:"primary",size:"md",animation:"classic"}}),b=({variant:r,size:t,animation:e,className:s,label:a="loading"})=>n.jsx("div",{className:o.cn(i({variant:r,size:t,animation:e}),s),role:"status","aria-label":a});exports.Spinner=b;
|
|
@@ -6,6 +6,11 @@ declare const spinnerVariants: (props?: ({
|
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface SpinnerProps extends VariantProps<typeof spinnerVariants> {
|
|
8
8
|
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* What a screen reader hears: "loading" by default. Say what is loading
|
|
11
|
+
* ("Loading results") when there is more than one on screen.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
9
14
|
}
|
|
10
|
-
export declare const Spinner: ({ variant, size, animation, className, }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const Spinner: ({ variant, size, animation, className, label, }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
16
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
2
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { cva as o } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
4
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
5
|
+
const i = /* @__PURE__ */ o("rst:animate-spin rst:motion-reduce:animate-none rst:rounded-full rst:transition-colors", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
primary: "rst:border-primary-600 rst:dark:border-primary-500",
|
|
@@ -36,13 +36,14 @@ const n = /* @__PURE__ */ d("rst:animate-spin rst:rounded-full rst:transition-co
|
|
|
36
36
|
variant: r,
|
|
37
37
|
size: t,
|
|
38
38
|
animation: s,
|
|
39
|
-
className: a
|
|
40
|
-
|
|
39
|
+
className: a,
|
|
40
|
+
label: e = "loading"
|
|
41
|
+
}) => /* @__PURE__ */ d(
|
|
41
42
|
"div",
|
|
42
43
|
{
|
|
43
|
-
className:
|
|
44
|
+
className: n(i({ variant: r, size: t, animation: s }), a),
|
|
44
45
|
role: "status",
|
|
45
|
-
"aria-label":
|
|
46
|
+
"aria-label": e
|
|
46
47
|
}
|
|
47
48
|
);
|
|
48
49
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),u=require("react"),t=require("../../../lib/utils.cjs"),h=require("./stat-variants.cjs"),o=require("../Eyebrow/Eyebrow.cjs"),d="rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400",x=u.forwardRef(({value:a,label:n,source:r,size:m,colorScheme:j,semantics:g="definition",className:c,...i},l)=>{const e=h.statValueVariants({size:m,colorScheme:j});return g==="standalone"?s.jsxs("div",{ref:l,className:t.cn("rst:flex rst:flex-col rst:gap-[3px]",c),...i,children:[s.jsx("span",{className:e,children:a}),s.jsx(o.Eyebrow,{size:"xs",children:n}),r&&s.jsx("span",{className:d,children:r})]}):s.jsxs("div",{ref:l,className:t.cn("rst:grid rst:content-start rst:gap-[3px]",c),...i,children:[s.jsx("dt",{className:"rst:relative rst:col-start-1 rst:row-start-2",children:s.jsx(o.Eyebrow,{size:"xs",children:n})}),r?s.jsxs("dd",{className:t.cn("rst:m-0",e,"rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"),children:[s.jsx("span",{className:"rst:row-start-1",children:a}),s.jsx("span",{className:t.cn(d,"rst:row-start-3"),children:r})]}):s.jsx("dd",{className:t.cn("rst:m-0 rst:col-start-1 rst:row-start-1",e),children:a})]})});x.displayName="Stat";exports.Stat=x;
|
|
@@ -12,10 +12,35 @@ export interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "c
|
|
|
12
12
|
* stated reads very differently from one that is merely asserted.
|
|
13
13
|
*/
|
|
14
14
|
source?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* `"definition"` (default): a `dt` and `dd` pair in a `div`, for a row of
|
|
17
|
+
* Stats inside a `<dl>`. Only valid there.
|
|
18
|
+
*
|
|
19
|
+
* `"standalone"`: plain spans, for a Stat that is not in a list.
|
|
20
|
+
*/
|
|
21
|
+
semantics?: "definition" | "standalone";
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
24
|
+
* A figure with its label, and optionally where it came from.
|
|
25
|
+
*
|
|
26
|
+
* By default a `div` holding a `dt` (the label) then a `dd` (the value, with
|
|
27
|
+
* the source inside it), which is what a group inside a `<dl>` must be: a
|
|
28
|
+
* group is its terms and then its details. The value still shows first,
|
|
29
|
+
* because the grid places it there, not the DOM order.
|
|
30
|
+
*
|
|
31
|
+
* With a source, the `dd` spans three rows as a subgrid, so the source can
|
|
32
|
+
* sit below the label while staying inside the `dd` it describes. Both are
|
|
33
|
+
* pinned to column 1: placed by row alone, the `dd` would find the `dt` in
|
|
34
|
+
* its way at row 2 and move to a new column, beside the label. The `dt` is
|
|
35
|
+
* `relative` because the `dd`'s box covers its row, and without it the label
|
|
36
|
+
* would lose clicks and text selection to that box.
|
|
37
|
+
*
|
|
38
|
+
* A `[&>dd]` selector on the Stat reaches the value and the source. The
|
|
39
|
+
* source sets its own family, size, weight, figures, tracking, leading and
|
|
40
|
+
* color; anything else on the `dd` (`uppercase`, `italic`, `opacity`) reaches
|
|
41
|
+
* it too.
|
|
42
|
+
*
|
|
43
|
+
* A Stat outside a list takes `semantics="standalone"`, which renders spans.
|
|
19
44
|
*/
|
|
20
45
|
declare const Stat: React.ForwardRefExoticComponent<StatProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
46
|
export { Stat };
|
|
@@ -1,17 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import { statValueVariants as
|
|
6
|
-
import { Eyebrow as
|
|
7
|
-
const
|
|
8
|
-
({ value:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import h from "react";
|
|
4
|
+
import { cn as r } from "../../../lib/utils.js";
|
|
5
|
+
import { statValueVariants as g } from "./stat-variants.js";
|
|
6
|
+
import { Eyebrow as d } from "../Eyebrow/Eyebrow.js";
|
|
7
|
+
const m = "rst:block rst:font-mono rst:text-[0.53125rem] rst:font-normal rst:normal-nums rst:leading-none rst:tracking-[0.06em] rst:text-gray-500 rst:opacity-75 rst:dark:text-gray-400", w = h.forwardRef(
|
|
8
|
+
({ value: a, label: i, source: s, size: p, colorScheme: f, semantics: x = "definition", className: o, ...l }, c) => {
|
|
9
|
+
const e = g({ size: p, colorScheme: f });
|
|
10
|
+
return x === "standalone" ? /* @__PURE__ */ n("div", { ref: c, className: r("rst:flex rst:flex-col rst:gap-[3px]", o), ...l, children: [
|
|
11
|
+
/* @__PURE__ */ t("span", { className: e, children: a }),
|
|
12
|
+
/* @__PURE__ */ t(d, { size: "xs", children: i }),
|
|
13
|
+
s && /* @__PURE__ */ t("span", { className: m, children: s })
|
|
14
|
+
] }) : (
|
|
15
|
+
/* `content-start`: a Stat in a row of taller siblings is stretched to
|
|
16
|
+
their height, and a grid shares that height out among its auto rows,
|
|
17
|
+
which pushed the label of a Stat without a source down to meet
|
|
18
|
+
nothing. The flex column this replaced never did. */
|
|
19
|
+
/* @__PURE__ */ n("div", { ref: c, className: r("rst:grid rst:content-start rst:gap-[3px]", o), ...l, children: [
|
|
20
|
+
/* @__PURE__ */ t("dt", { className: "rst:relative rst:col-start-1 rst:row-start-2", children: /* @__PURE__ */ t(d, { size: "xs", children: i }) }),
|
|
21
|
+
s ? /* @__PURE__ */ n(
|
|
22
|
+
"dd",
|
|
23
|
+
{
|
|
24
|
+
className: r(
|
|
25
|
+
"rst:m-0",
|
|
26
|
+
e,
|
|
27
|
+
"rst:col-start-1 rst:row-span-3 rst:row-start-1 rst:grid rst:grid-rows-subgrid"
|
|
28
|
+
),
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ t("span", { className: "rst:row-start-1", children: a }),
|
|
31
|
+
/* @__PURE__ */ t("span", { className: r(m, "rst:row-start-3"), children: s })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
) : /* @__PURE__ */ t("dd", { className: r("rst:m-0 rst:col-start-1 rst:row-start-1", e), children: a })
|
|
35
|
+
] })
|
|
36
|
+
);
|
|
37
|
+
}
|
|
13
38
|
);
|
|
14
|
-
|
|
39
|
+
w.displayName = "Stat";
|
|
15
40
|
export {
|
|
16
|
-
|
|
41
|
+
w as Stat
|
|
17
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("../../../node_modules/@headlessui/react/dist/components/description/description.cjs"),g=require("../../../node_modules/@headlessui/react/dist/components/field/field.cjs"),p=require("../../../node_modules/@headlessui/react/dist/components/label/label.cjs"),j=require("../../../node_modules/@headlessui/react/dist/components/switch/switch.cjs"),s=require("../../../lib/utils.cjs"),n=require("./switch-variants.cjs"),y=({checked:o,onChange:u,label:r,description:c,disabled:e=!1,labelClickable:i=!0,size:a,variant:l,className:x,ariaLabel:h})=>{const m=r?void 0:h||"Toggle setting";return t.jsxs(g.Field,{as:"div",className:s.cn("rst:flex rst:items-center rst:justify-between rst:gap-4",x),children:[(r||c)&&t.jsxs("span",{className:"rst:flex rst:flex-col",children:[r&&t.jsx(p.Label,{passive:!i,className:s.cn("rst:text-sm rst:font-medium rst:text-gray-900 rst:dark:text-gray-100",i&&!e&&"rst:cursor-pointer",e&&"rst:opacity-50"),children:r}),c&&t.jsx(d.Description,{className:s.cn("rst:text-xs rst:text-gray-500 rst:dark:text-gray-400",e&&"rst:opacity-50"),children:c})]}),t.jsx(j.Switch,{checked:o,onChange:u,disabled:e,"aria-label":m,className:s.cn(n.switchTrackVariants({variant:l,size:a})),children:t.jsx("span",{"aria-hidden":"true",className:s.cn(n.switchThumbVariants({size:a}))})})]})};exports.Switch=y;
|
|
@@ -6,8 +6,18 @@ export interface SwitchProps extends VariantProps<typeof switchTrackVariants> {
|
|
|
6
6
|
label?: string;
|
|
7
7
|
description?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether clicking the label toggles the switch, as clicking any other
|
|
11
|
+
* control's label does. On by default.
|
|
12
|
+
*
|
|
13
|
+
* Turn it off when an ancestor already has a click handler of its own that
|
|
14
|
+
* toggles. With both, one click on the label reaches that handler twice
|
|
15
|
+
* (the label's click, then the one forwarded to the switch, both bubbling)
|
|
16
|
+
* and `onChange` once.
|
|
17
|
+
*/
|
|
18
|
+
labelClickable?: boolean;
|
|
9
19
|
className?: string;
|
|
10
20
|
ariaLabel?: string;
|
|
11
21
|
}
|
|
12
|
-
declare const Switch: ({ checked, onChange, label, description, disabled, size, variant, className, ariaLabel, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const Switch: ({ checked, onChange, label, description, disabled, labelClickable, size, variant, className, ariaLabel, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
23
|
export { Switch };
|
|
@@ -1,65 +1,67 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { Description as
|
|
4
|
-
import { Field as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { Switch as
|
|
2
|
+
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { Description as l } from "../../../node_modules/@headlessui/react/dist/components/description/description.js";
|
|
4
|
+
import { Field as u } from "../../../node_modules/@headlessui/react/dist/components/field/field.js";
|
|
5
|
+
import { Label as g } from "../../../node_modules/@headlessui/react/dist/components/label/label.js";
|
|
6
|
+
import { Switch as y } from "../../../node_modules/@headlessui/react/dist/components/switch/switch.js";
|
|
7
7
|
import { cn as t } from "../../../lib/utils.js";
|
|
8
|
-
import { switchThumbVariants as
|
|
9
|
-
const
|
|
8
|
+
import { switchThumbVariants as d, switchTrackVariants as N } from "./switch-variants.js";
|
|
9
|
+
const V = ({
|
|
10
10
|
checked: c,
|
|
11
|
-
onChange:
|
|
11
|
+
onChange: n,
|
|
12
12
|
label: r,
|
|
13
|
-
description:
|
|
14
|
-
disabled:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
description: e,
|
|
14
|
+
disabled: s = !1,
|
|
15
|
+
labelClickable: i = !0,
|
|
16
|
+
size: m,
|
|
17
|
+
variant: p,
|
|
18
|
+
className: f,
|
|
19
|
+
ariaLabel: x
|
|
19
20
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
21
|
+
const h = r ? void 0 : x || "Toggle setting";
|
|
22
|
+
return /* @__PURE__ */ o(
|
|
23
|
+
u,
|
|
23
24
|
{
|
|
24
25
|
as: "div",
|
|
25
|
-
className: t("rst:flex rst:items-center rst:justify-between rst:gap-4",
|
|
26
|
+
className: t("rst:flex rst:items-center rst:justify-between rst:gap-4", f),
|
|
26
27
|
children: [
|
|
27
|
-
(r ||
|
|
28
|
-
r && /* @__PURE__ */
|
|
29
|
-
|
|
28
|
+
(r || e) && /* @__PURE__ */ o("span", { className: "rst:flex rst:flex-col", children: [
|
|
29
|
+
r && /* @__PURE__ */ a(
|
|
30
|
+
g,
|
|
30
31
|
{
|
|
31
|
-
passive: !
|
|
32
|
+
passive: !i,
|
|
32
33
|
className: t(
|
|
33
34
|
"rst:text-sm rst:font-medium rst:text-gray-900 rst:dark:text-gray-100",
|
|
34
|
-
|
|
35
|
+
i && !s && "rst:cursor-pointer",
|
|
36
|
+
s && "rst:opacity-50"
|
|
35
37
|
),
|
|
36
38
|
children: r
|
|
37
39
|
}
|
|
38
40
|
),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
e && /* @__PURE__ */ a(
|
|
42
|
+
l,
|
|
41
43
|
{
|
|
42
44
|
className: t(
|
|
43
45
|
"rst:text-xs rst:text-gray-500 rst:dark:text-gray-400",
|
|
44
|
-
|
|
46
|
+
s && "rst:opacity-50"
|
|
45
47
|
),
|
|
46
|
-
children:
|
|
48
|
+
children: e
|
|
47
49
|
}
|
|
48
50
|
)
|
|
49
51
|
] }),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
+
/* @__PURE__ */ a(
|
|
53
|
+
y,
|
|
52
54
|
{
|
|
53
55
|
checked: c,
|
|
54
|
-
onChange:
|
|
55
|
-
disabled:
|
|
56
|
-
"aria-label":
|
|
57
|
-
className: t(
|
|
58
|
-
children: /* @__PURE__ */
|
|
56
|
+
onChange: n,
|
|
57
|
+
disabled: s,
|
|
58
|
+
"aria-label": h,
|
|
59
|
+
className: t(N({ variant: p, size: m })),
|
|
60
|
+
children: /* @__PURE__ */ a(
|
|
59
61
|
"span",
|
|
60
62
|
{
|
|
61
63
|
"aria-hidden": "true",
|
|
62
|
-
className: t(
|
|
64
|
+
className: t(d({ size: m }))
|
|
63
65
|
}
|
|
64
66
|
)
|
|
65
67
|
}
|
|
@@ -69,5 +71,5 @@ const S = ({
|
|
|
69
71
|
);
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
V as Switch
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",{variants:{variant:{primary:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-primary-500 rst:focus-visible:ring-ring",success:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-green-500 rst:focus-visible:ring-ring",danger:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-error-500 rst:focus-visible:ring-ring",neutral:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-gray-600 rst:dark:data-[checked]:bg-gray-500 rst:focus-visible:ring-ring"},size:{xs:"rst:h-4 rst:w-7",sm:"rst:h-5 rst:w-9",md:"rst:h-6 rst:w-11",lg:"rst:h-7 rst:w-14"}},defaultVariants:{variant:"primary",size:"md"}}),s=r.cva("rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:shadow rst:ring-0 rst:transition rst:duration-200 rst:ease-in-out rst:transform",{variants:{size:{xs:"rst:h-3 rst:w-3 rst:translate-x-0 rst:group-data-[checked]:translate-x-3",sm:"rst:h-4 rst:w-4 rst:translate-x-0 rst:group-data-[checked]:translate-x-4",md:"rst:h-5 rst:w-5 rst:translate-x-0 rst:group-data-[checked]:translate-x-5",lg:"rst:h-6 rst:w-6 rst:translate-x-0 rst:group-data-[checked]:translate-x-7"}},defaultVariants:{size:"md"}});exports.switchThumbVariants=s;exports.switchTrackVariants=t;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../node_modules/class-variance-authority/dist/index.cjs"),t=r.cva("rst:before:absolute rst:before:top-1/2 rst:before:left-1/2 rst:before:size-11 rst:before:-translate-x-1/2 rst:before:-translate-y-1/2 rst:before:content-[''] rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",{variants:{variant:{primary:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-primary-500 rst:focus-visible:ring-ring",success:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-green-500 rst:focus-visible:ring-ring",danger:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-error-500 rst:focus-visible:ring-ring",neutral:"rst:bg-gray-200 rst:dark:bg-gray-700 rst:data-[checked]:bg-gray-600 rst:dark:data-[checked]:bg-gray-500 rst:focus-visible:ring-ring"},size:{xs:"rst:h-4 rst:w-7",sm:"rst:h-5 rst:w-9",md:"rst:h-6 rst:w-11",lg:"rst:h-7 rst:w-14"}},defaultVariants:{variant:"primary",size:"md"}}),s=r.cva("rst:pointer-events-none rst:inline-block rst:rounded-full rst:bg-white rst:shadow rst:ring-0 rst:transition rst:duration-200 rst:ease-in-out rst:transform",{variants:{size:{xs:"rst:h-3 rst:w-3 rst:translate-x-0 rst:group-data-[checked]:translate-x-3",sm:"rst:h-4 rst:w-4 rst:translate-x-0 rst:group-data-[checked]:translate-x-4",md:"rst:h-5 rst:w-5 rst:translate-x-0 rst:group-data-[checked]:translate-x-5",lg:"rst:h-6 rst:w-6 rst:translate-x-0 rst:group-data-[checked]:translate-x-7"}},defaultVariants:{size:"md"}});exports.switchThumbVariants=s;exports.switchTrackVariants=t;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva as r } from "../../../node_modules/class-variance-authority/dist/index.js";
|
|
2
2
|
const s = /* @__PURE__ */ r(
|
|
3
|
-
"rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",
|
|
3
|
+
"rst:before:absolute rst:before:top-1/2 rst:before:left-1/2 rst:before:size-11 rst:before:-translate-x-1/2 rst:before:-translate-y-1/2 rst:before:content-[''] rst:font-ui rst:group rst:relative rst:inline-flex rst:shrink-0 rst:cursor-pointer rst:rounded-full rst:border-2 rst:border-transparent rst:transition-colors rst:duration-200 rst:ease-in-out rst:focus:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-offset-2 rst:ring-offset-background rst:disabled:cursor-not-allowed rst:disabled:opacity-50",
|
|
4
4
|
{
|
|
5
5
|
variants: {
|
|
6
6
|
variant: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Fe=require("react"),qe=require("../../atoms/Button/Button.cjs"),T=require("../../../lib/utils.cjs"),$e=require("../../../internal/motion.cjs"),u=require("./carousel-math.cjs"),U=require("./carousel-layout.cjs");function Be(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const d in a)if(d!=="default"){const b=Object.getOwnPropertyDescriptor(a,d);Object.defineProperty(i,d,b.get?b:{enumerable:!0,get:()=>a[d]})}}return i.default=a,Object.freeze(i)}const n=Be(Fe),ze=a=>Math.min(3e3,500+a*.35),He='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]:not([contenteditable="false"])',V=a=>typeof a=="number"?`${a}px`:a;function ne(a){const i=parseFloat(a);return Number.isFinite(i)?i:0}const Ue="rst:hidden rst:[@media(any-hover:hover)]:inline-flex",Ve="rst:hidden rst:[@media(any-hover:hover)]:flex";function se({direction:a}){return l.jsx("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 20 20",className:"rst:h-5 rst:w-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:l.jsx("path",{d:a==="prev"?"M12.5 4.5 7 10l5.5 5.5":"M7.5 4.5 13 10l-5.5 5.5"})})}const oe={overflowing:null,canScrollPrev:!1,canScrollNext:!1,index:0},We=n.forwardRef(function({"aria-label":i,"aria-labelledby":d,children:b,itemWidth:I,perView:k,gap:W=12,gutter:X=16,bleed:le=!1,snap:L="start",snapStrictness:ce="mandatory",oneAtATime:ae=!1,arrows:j="hover",arrowPlacement:M="controls",renderArrows:P,prevLabel:ie,nextLabel:ue,prevIcon:de,nextIcon:fe,arrowButtonProps:ge,fade:ve=!1,scrollbar:pe=!1,showPosition:G=!1,onIndexChange:J,onScrollStateChange:K,itemClassName:me,listClassName:xe,className:be,style:he,...Se},ye){const v=n.useRef(null),Q=`${n.useId()}-list`,Y=n.Children.toArray(b),E=Y.length,[o,we]=n.useState(oe),Z=n.useRef(oe),[Ne,Te]=n.useState(""),[Ie,Pe]=n.useState(!1),O=n.useRef({onIndexChange:J,onScrollStateChange:K});n.useEffect(()=>{O.current={onIndexChange:J,onScrollStateChange:K}});const f=n.useCallback(()=>{const e=v.current;if(!e)return null;const t=e.getBoundingClientRect(),r=getComputedStyle(e),s=t.left+e.clientLeft-e.scrollLeft;return{items:Array.from(e.children).map(g=>{const x=g.getBoundingClientRect();return{start:x.left-s,end:x.right-s}}),scrollLeft:e.scrollLeft,clientWidth:e.clientWidth,scrollWidth:e.scrollWidth,paddingStart:ne(r.scrollPaddingInlineStart||r.scrollPaddingLeft),paddingEnd:ne(r.scrollPaddingInlineEnd||r.scrollPaddingRight),align:L}},[L]),h=n.useCallback(()=>{const e=f();if(!e)return;const t={overflowing:u.overflows(e),canScrollPrev:u.canScrollPrev(e),canScrollNext:u.canScrollNext(e),index:e.items.length?u.currentIndex(e):0},r=Z.current;r.overflowing===t.overflowing&&r.canScrollPrev===t.canScrollPrev&&r.canScrollNext===t.canScrollNext&&r.index===t.index||(Z.current=t,we(t),r.index!==t.index&&O.current.onIndexChange?.(t.index),(r.canScrollPrev!==t.canScrollPrev||r.canScrollNext!==t.canScrollNext)&&O.current.onScrollStateChange?.({canScrollPrev:t.canScrollPrev,canScrollNext:t.canScrollNext}))},[f]),Ee=JSON.stringify([W,X,I,k]);n.useLayoutEffect(()=>{const e=v.current;if(!e)return;h();let t=0;const r=()=>{t||(t=requestAnimationFrame(()=>{t=0,h()}))};e.addEventListener("scroll",r,{passive:!0});const s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>h()),c=()=>{s?.observe(e),Array.from(e.children).forEach(x=>s?.observe(x))};c();const g=typeof MutationObserver>"u"?null:new MutationObserver(()=>{c(),h()});return g?.observe(e,{childList:!0}),()=>{e.removeEventListener("scroll",r),s?.disconnect(),g?.disconnect(),t&&cancelAnimationFrame(t)}},[h,E,Ee]),n.useLayoutEffect(()=>{const e=v.current;if(e&&(Pe(!e.querySelector(He)),d)){const t=d.split(/\s+/).map(r=>document.getElementById(r)?.textContent?.trim()??"").filter(Boolean).join(" ");Te(t)}},[b,d]);const S=n.useRef(null),p=n.useCallback(()=>{const e=v.current,t=S.current;t&&(S.current=null,window.clearTimeout(t.timer),e?.removeEventListener("scrollend",t.done),e&&(e.style.scrollSnapType="",delete e.dataset.settling))},[]),m=n.useCallback((e,t)=>{const r=v.current;if(!r)return;if(p(),t!=="smooth"||$e.prefersReducedMotion()||Math.abs(r.scrollLeft-e)<1){r.style.scrollSnapType="none",r.scrollTo({left:e,behavior:"instant"}),r.style.scrollSnapType="";return}r.style.scrollSnapType="none",r.dataset.settling="";const c=()=>p();S.current={timer:window.setTimeout(c,ze(Math.abs(r.scrollLeft-e))),done:c,target:e},r.addEventListener("scrollend",c,{once:!0}),r.scrollTo({left:e,behavior:"smooth"})},[p]),C=n.useCallback(e=>{const t=f();if(!t)return;const r=S.current?{...t,scrollLeft:S.current.target}:t;m(u.pageTarget(r,e),"smooth")},[f,m]);n.useImperativeHandle(ye,()=>({scrollToIndex:(e,t)=>{const r=f();if(!r||!r.items.length)return;const s=Math.min(Math.max(0,Math.round(e)),r.items.length-1);m(u.snapPosition(r,s),t?.behavior??"smooth")},scrollPrev:()=>C(-1),scrollNext:()=>C(1)}),[f,C,m]),n.useEffect(()=>p,[p]);const D=n.useRef(null),_=n.useRef(null),A=n.useRef(null);n.useLayoutEffect(()=>{const e=A.current;if(!e)return;const t=e==="prev"?D.current:_.current,r=e==="prev"?_.current:D.current,s=e==="prev"?!o.canScrollPrev:!o.canScrollNext,c=document.activeElement;s&&(c!==t&&c!==document.body&&c!==null||r&&!r.disabled&&r.focus())},[o.canScrollPrev,o.canScrollNext]);const y=n.useRef(null),w=n.useRef(!1),Ce=e=>{e.pointerType!=="mouse"||e.button!==0||o.overflowing&&(p(),w.current=!1,y.current={pointerId:e.pointerId,x0:e.clientX,scroll0:e.currentTarget.scrollLeft,dragging:!1})},Re=e=>{const t=y.current;if(!t||e.pointerId!==t.pointerId)return;const r=e.currentTarget,s=e.clientX-t.x0;if(!t.dragging){if(Math.abs(s)<=u.CAROUSEL_DRAG_THRESHOLD)return;t.dragging=!0,r.dataset.dragging="",r.style.scrollSnapType="none",window.getSelection?.()?.removeAllRanges();try{r.setPointerCapture(e.pointerId)}catch{}}r.scrollLeft=t.scroll0-s},F=e=>{const t=y.current;if(!t||e.pointerId!==t.pointerId||(y.current=null,!t.dragging))return;const r=e.currentTarget;delete r.dataset.dragging,w.current=e.type==="pointerup",window.setTimeout(()=>{w.current=!1},0);const s=f();s?m(u.snapPosition(s,u.nearestIndex(s)),"smooth"):r.style.scrollSnapType=""},ke=e=>{!w.current||e.detail===0||(w.current=!1,e.preventDefault(),e.stopPropagation())},Le=e=>{o.overflowing&&e.preventDefault()},je=e=>{const t=e.currentTarget,r=e.target;if(r===t||y.current?.dragging)return;let s=!1;try{s=r.matches(":focus-visible")}catch{s=!1}if(!s)return;const c=r.closest("[data-carousel-item]");if(!c||c.parentElement!==t)return;const g=f();if(!g)return;const x=Array.prototype.indexOf.call(t.children,c);m(u.snapPosition(g,x),"instant")},[Me,Oe]=n.useState(0);n.useEffect(()=>{const e=window.setTimeout(()=>Oe(o.index),150);return()=>window.clearTimeout(e)},[o.index]);const ee=i??Ne,te=e=>ee?`${e} ${ee}`:e,q=j!=="none"&&o.overflowing!==!1,De=j==="hover"?Ue:"rst:inline-flex",re=e=>{const t=e==="prev",{className:r,...s}=ge??{};return l.jsx(qe.Button,{type:"button",variant:"outline",colorScheme:"neutral",size:"icon",...s,"aria-label":t?ie??te("Previous"):ue??te("Next"),"aria-controls":Q,disabled:t?!o.canScrollPrev:!o.canScrollNext,onClick:()=>C(t?-1:1),ref:t?D:_,onFocus:()=>{A.current=e},onBlur:c=>{c.relatedTarget&&(A.current=null)},"data-carousel-arrow":e,className:T.cn("rst:size-11 rst:shrink-0 rst:rounded-full",M==="overlay"&&!P&&"rst:bg-[var(--roster-popover-bg)] rst:elevation-raised rst:hover:bg-[var(--roster-popover-bg)] rst:disabled:invisible",De,r),children:t?de??l.jsx(se,{direction:"prev"}):fe??l.jsx(se,{direction:"next"})})},R=q?re("prev"):null,$=q?re("next"):null,N=G&&E?l.jsxs("p",{"aria-live":"polite",className:"rst:font-ui rst:m-0 rst:text-sm rst:tabular-nums rst:opacity-75","data-carousel-position":"",children:[Me+1," of ",E]}):null;let B=null;P?B=P({prev:R,next:$,position:N}):M==="controls"&&(R||N)&&(B=l.jsxs("div",{className:T.cn("rst:mb-2 rst:items-center rst:justify-end rst:gap-2",!N&&j==="hover"?Ve:"rst:flex"),"data-carousel-controls":"",children:[N&&l.jsx("div",{className:"rst:mr-auto",children:N}),R,$]}));const z=ve&&o.overflowing&&(o.canScrollPrev||o.canScrollNext)?`linear-gradient(to right, ${o.canScrollPrev?"transparent, black 48px":"black"}, ${o.canScrollNext?"black calc(100% - 48px), transparent":"black"})`:void 0,H=I===void 0&&k!==void 0,_e={"--rst-cv-gap":V(W),"--rst-cv-gutter":V(X),...H?U.perViewVars(k):{},...z?{maskImage:z,WebkitMaskImage:z}:{}},Ae=I!==void 0?{width:V(I)}:H?{width:U.FLUID_ITEM_WIDTH}:void 0;return l.jsxs("div",{className:T.cn("rst:min-w-0",be),style:he,...Se,children:[B,l.jsxs("div",{className:"rst:relative",children:[l.jsx("ul",{ref:v,id:Q,role:"list","aria-label":i,"aria-labelledby":i?void 0:d,tabIndex:Ie&&o.overflowing?0:void 0,"data-overflowing":o.overflowing?"":void 0,onPointerDown:Ce,onPointerMove:Re,onPointerUp:F,onPointerCancel:F,onLostPointerCapture:F,onClickCapture:ke,onDragStart:Le,onFocus:je,style:_e,className:T.cn("rst:m-0 rst:flex rst:list-none rst:overflow-x-auto rst:overflow-y-hidden","rst:gap-(--rst-cv-gap) rst:px-(--rst-cv-gutter) rst:py-1 rst:scroll-px-(--rst-cv-gutter)","rst:overscroll-x-contain",ce==="mandatory"?"rst:snap-x rst:snap-mandatory":"rst:snap-x rst:snap-proximity",le&&"rst:-mx-(--rst-cv-gutter)",!pe&&"rst:[scrollbar-width:none] rst:[&::-webkit-scrollbar]:hidden",H&&U.FLUID_CLASSES,"rst:data-overflowing:cursor-grab rst:data-dragging:cursor-grabbing rst:data-dragging:select-none","rst:focus-visible:outline-hidden rst:focus-visible:ring-2 rst:focus-visible:ring-ring rst:focus-visible:ring-inset",xe),children:Y.map((e,t)=>l.jsx("li",{"data-carousel-item":"","aria-label":G?`${t+1} of ${E}`:void 0,style:Ae,className:T.cn("rst:shrink-0",L==="start"?"rst:snap-start":"rst:snap-center",ae&&"rst:snap-always",me),children:e},n.isValidElement(e)&&e.key!=null?e.key:t))}),!P&&M==="overlay"&&q&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"rst:pointer-events-none rst:absolute rst:inset-y-0 rst:start-1 rst:flex rst:items-center",children:l.jsx("div",{className:"rst:pointer-events-auto",children:R})}),l.jsx("div",{className:"rst:pointer-events-none rst:absolute rst:inset-y-0 rst:end-1 rst:flex rst:items-center",children:l.jsx("div",{className:"rst:pointer-events-auto",children:$})})]})]})]})});exports.Carousel=We;
|