@siyahi/ui 0.1.9-next.34 → 0.1.9-next.35
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/DESIGN.md +6 -5
- package/README.md +5 -5
- package/agents/examples/app-sidebar.tsx +0 -2
- package/agents/manifest.json +0 -2
- package/dist/components/registry/niko-table/core/data-table-error-boundary.js +1 -1
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +2 -2
- package/dist/components/siyahi/scatter-chart.js +1 -1
- package/dist/components/siyahi/status-badge.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +94 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +104 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +73 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +162 -0
- package/dist/components/ui/command.js +1 -1
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +1 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +121 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +43 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +136 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +60 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +49 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +38 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +80 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +170 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +123 -0
- package/dist/components/ui/trace.d.ts +20 -0
- package/dist/components/ui/trace.js +75 -0
- package/dist/index.d.ts +31 -1
- package/dist/index.js +34 -4
- package/package.json +5 -3
- package/styles/siyahi.css +198 -47
- package/agents/report-rules.json +0 -7
- package/report.css +0 -146
package/DESIGN.md
CHANGED
|
@@ -88,12 +88,13 @@ mono face and the link colour, so the text can point to one.
|
|
|
88
88
|
toggles, menus, bars and tracks (data bars, progress, a slider's track and
|
|
89
89
|
thumb, a scrollbar's thumb), heatmap cells, treemap tiles and the colour
|
|
90
90
|
chips of charts and legends alike (`--radius` is 0). Only what is round by
|
|
91
|
-
nature stays round: an avatar, a status dot, a line's end dot, a
|
|
92
|
-
and a signed calendar heatmap's loss day, whose shape carries its
|
|
91
|
+
nature stays round: an avatar, a radio, a status dot, a line's end dot, a
|
|
92
|
+
spinner, and a signed calendar heatmap's loss day, whose shape carries its
|
|
93
|
+
sign. The theme squares every other rounding, on any component.
|
|
93
94
|
Never add a `rounded-*` class to a box.
|
|
94
|
-
- **Floating surfaces lie flat.**
|
|
95
|
-
dialog, a sheet and a chart's tooltip take
|
|
96
|
-
hairline for their edge, so they read as a sheet of the page.
|
|
95
|
+
- **Floating surfaces lie flat.** Nothing casts a drop shadow: a menu, a
|
|
96
|
+
list, a popover, a dialog, a sheet, a hover card and a chart's tooltip take
|
|
97
|
+
the card's hairline for their edge, so they read as a sheet of the page.
|
|
97
98
|
- **Joined toggles.** The items of a `ToggleGroup` sit flush and share their
|
|
98
99
|
borders, one control; the pressed item fills with the foreground.
|
|
99
100
|
- **A code block's copy button sits in a header row** (`CodeBlockHeader`),
|
package/README.md
CHANGED
|
@@ -58,8 +58,8 @@ createRoot(root).render(
|
|
|
58
58
|
|
|
59
59
|
`preloadFonts()` loads Geist and Geist Mono with the scripts. Add `lucide-react`
|
|
60
60
|
only when your own code imports icons. Next.js compiles the stylesheet through
|
|
61
|
-
`@tailwindcss/postcss` instead of the Vite plugin.
|
|
62
|
-
|
|
61
|
+
`@tailwindcss/postcss` instead of the Vite plugin. To host one page as a single
|
|
62
|
+
HTML file, build it with `siyahi-page` from `@siyahi/tools`.
|
|
63
63
|
|
|
64
64
|
If npm is unreachable, both package tarballs are attached to
|
|
65
65
|
[GitHub releases](https://github.com/jatinbansal1998/siyahi/releases).
|
|
@@ -136,8 +136,8 @@ Set `color-scheme` on `<html>` as well so native controls match.
|
|
|
136
136
|
## Tools
|
|
137
137
|
|
|
138
138
|
`@siyahi/tools` provides theme lint rules, font preload, layout screenshots
|
|
139
|
-
(`siyahi-shots`), loading-shift checks (`siyahi-cls`)
|
|
140
|
-
(`siyahi-contrast`). See the
|
|
139
|
+
(`siyahi-shots`), loading-shift checks (`siyahi-cls`), contrast checks
|
|
140
|
+
(`siyahi-contrast`) and a one-file page build (`siyahi-page`). See the
|
|
141
141
|
[tools guide](https://github.com/jatinbansal1998/siyahi/blob/main/packages/tools/README.md)
|
|
142
142
|
for configuration and commands.
|
|
143
143
|
|
|
@@ -146,7 +146,7 @@ for configuration and commands.
|
|
|
146
146
|
```sh
|
|
147
147
|
pnpm install
|
|
148
148
|
pnpm --filter @siyahi/tools exec playwright install chromium
|
|
149
|
-
pnpm check
|
|
149
|
+
pnpm check:static # the full suite runs on each pull request's CI
|
|
150
150
|
pnpm dev
|
|
151
151
|
```
|
|
152
152
|
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
BlocksIcon,
|
|
4
4
|
ChartAreaIcon,
|
|
5
5
|
CodeIcon,
|
|
6
|
-
FileTextIcon,
|
|
7
6
|
HouseIcon,
|
|
8
7
|
LayersIcon,
|
|
9
8
|
PaletteIcon,
|
|
@@ -18,7 +17,6 @@ const views = [
|
|
|
18
17
|
{ title: "Inputs and overlays", url: "#/inputs", icon: <SlidersHorizontalIcon /> },
|
|
19
18
|
{ title: "Data", url: "#/data", icon: <ChartAreaIcon /> },
|
|
20
19
|
{ title: "Blocks", url: "#/blocks", icon: <BlocksIcon />, isActive: true },
|
|
21
|
-
{ title: "Reports", url: "#/reports", icon: <FileTextIcon /> },
|
|
22
20
|
// linkProps go onto the anchor: here a new tab, in an app often onMouseEnter to prefetch the view's data.
|
|
23
21
|
{
|
|
24
22
|
title: "Source",
|
package/agents/manifest.json
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
"props": "dist/index.d.ts",
|
|
5
5
|
"setup": "README.md#install",
|
|
6
6
|
"layout": "README.md#surfaces",
|
|
7
|
-
"report": "report.css",
|
|
8
|
-
"reportRules": "agents/report-rules.json",
|
|
9
7
|
"recipes": {
|
|
10
8
|
"dashboard": "agents/examples/surfaces.tsx",
|
|
11
9
|
"table": "agents/examples/data-table.tsx",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Alert, AlertDescription, AlertTitle } from "../../../ui/alert.js";
|
|
3
2
|
import { Button } from "../../../ui/button.js";
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from "../../../ui/alert.js";
|
|
4
4
|
import { AlertCircle } from "lucide-react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import React from "react";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Badge } from "../../../ui/badge.js";
|
|
3
2
|
import { Button } from "../../../ui/button.js";
|
|
4
|
-
import {
|
|
3
|
+
import { Badge } from "../../../ui/badge.js";
|
|
5
4
|
import { Separator } from "../../../ui/separator.js";
|
|
5
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../../../ui/command.js";
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from "../../../ui/popover.js";
|
|
7
7
|
import { cn } from "../../../../lib/utils.js";
|
|
8
8
|
import { FILTER_OPERATORS, FILTER_VARIANTS, JOIN_OPERATORS } from "../lib/constants.js";
|
|
@@ -245,7 +245,7 @@ function PointTooltip({ active, payload, details }) {
|
|
|
245
245
|
const point = active ? payload?.[0]?.payload : void 0;
|
|
246
246
|
if (!point) return null;
|
|
247
247
|
return /* @__PURE__ */ jsxs("div", {
|
|
248
|
-
className: "grid min-w-32 gap-1.5
|
|
248
|
+
className: "grid min-w-32 gap-1.5 border border-border bg-background px-2.5 py-1.5 text-xs",
|
|
249
249
|
children: [/* @__PURE__ */ jsx("span", {
|
|
250
250
|
className: "font-medium",
|
|
251
251
|
children: point.name
|
|
@@ -16,6 +16,7 @@ function StatusBadge({ tone = "neutral", className, children, ...props }) {
|
|
|
16
16
|
...props,
|
|
17
17
|
children: [/* @__PURE__ */ jsx("span", {
|
|
18
18
|
"aria-hidden": "true",
|
|
19
|
+
"data-slot": "status-dot",
|
|
19
20
|
className: cn("size-1.5 rounded-full", TONES[tone].dot)
|
|
20
21
|
}), children]
|
|
21
22
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
4
|
+
//#region src/components/ui/alert-dialog.d.ts
|
|
5
|
+
declare function AlertDialog({ ...props }: AlertDialog$1.Root.Props): React$1.JSX.Element;
|
|
6
|
+
declare function AlertDialogTrigger({ ...props }: AlertDialog$1.Trigger.Props): React$1.JSX.Element;
|
|
7
|
+
declare function AlertDialogPortal({ ...props }: AlertDialog$1.Portal.Props): React$1.JSX.Element;
|
|
8
|
+
declare function AlertDialogOverlay({ className, ...props }: AlertDialog$1.Backdrop.Props): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDialogContent({ className, size, ...props }: AlertDialog$1.Popup.Props & {
|
|
10
|
+
size?: "default" | "sm";
|
|
11
|
+
}): React$1.JSX.Element;
|
|
12
|
+
declare function AlertDialogHeader({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
13
|
+
declare function AlertDialogFooter({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
14
|
+
declare function AlertDialogMedia({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
15
|
+
declare function AlertDialogTitle({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Title>): React$1.JSX.Element;
|
|
16
|
+
declare function AlertDialogDescription({ className, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Description>): React$1.JSX.Element;
|
|
17
|
+
declare function AlertDialogAction({ className, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
18
|
+
declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialog$1.Close.Props & Pick<React$1.ComponentProps<typeof Button>, "variant" | "size">): React$1.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
6
|
+
//#region src/components/ui/alert-dialog.tsx
|
|
7
|
+
function AlertDialog({ ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Root, {
|
|
9
|
+
"data-slot": "alert-dialog",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function AlertDialogTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
15
|
+
"data-slot": "alert-dialog-trigger",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function AlertDialogPortal({ ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Portal, {
|
|
21
|
+
"data-slot": "alert-dialog-portal",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function AlertDialogOverlay({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
27
|
+
"data-slot": "alert-dialog-overlay",
|
|
28
|
+
className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function AlertDialogContent({ className, size = "default", ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogOverlay, {}), /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
34
|
+
"data-slot": "alert-dialog-content",
|
|
35
|
+
"data-size": size,
|
|
36
|
+
className: cn("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
37
|
+
...props
|
|
38
|
+
})] });
|
|
39
|
+
}
|
|
40
|
+
function AlertDialogHeader({ className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx("div", {
|
|
42
|
+
"data-slot": "alert-dialog-header",
|
|
43
|
+
className: cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function AlertDialogFooter({ className, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
"data-slot": "alert-dialog-footer",
|
|
50
|
+
className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", className),
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function AlertDialogMedia({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
"data-slot": "alert-dialog-media",
|
|
57
|
+
className: cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className),
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function AlertDialogTitle({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
63
|
+
"data-slot": "alert-dialog-title",
|
|
64
|
+
className: cn("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className),
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function AlertDialogDescription({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
70
|
+
"data-slot": "alert-dialog-description",
|
|
71
|
+
className: cn("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function AlertDialogAction({ className, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
77
|
+
"data-slot": "alert-dialog-action",
|
|
78
|
+
className: cn(className),
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
84
|
+
"data-slot": "alert-dialog-cancel",
|
|
85
|
+
className: cn(className),
|
|
86
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
87
|
+
variant,
|
|
88
|
+
size
|
|
89
|
+
}),
|
|
90
|
+
...props
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/aspect-ratio.tsx
|
|
4
|
+
function AspectRatio({ ratio, className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
"data-slot": "aspect-ratio",
|
|
7
|
+
style: { "--ratio": ratio },
|
|
8
|
+
className: cn("relative aspect-(--ratio)", className),
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/ui/attachment.d.ts
|
|
6
|
+
declare const attachmentVariants: (props?: ({
|
|
7
|
+
size?: "default" | "sm" | "xs" | null | undefined;
|
|
8
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare function Attachment({ className, state, size, orientation, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
11
|
+
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
12
|
+
}): React$1.JSX.Element;
|
|
13
|
+
declare const attachmentMediaVariants: (props?: ({
|
|
14
|
+
variant?: "icon" | "image" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
declare function AttachmentMedia({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React$1.JSX.Element;
|
|
17
|
+
declare function AttachmentContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
18
|
+
declare function AttachmentTitle({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
19
|
+
declare function AttachmentDescription({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
20
|
+
declare function AttachmentActions({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
21
|
+
declare function AttachmentAction({ className, variant, size, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
22
|
+
declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
23
|
+
declare function AttachmentGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/ui/attachment.tsx
|
|
9
|
+
const attachmentVariants = cva("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", { variants: {
|
|
10
|
+
size: {
|
|
11
|
+
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
12
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
13
|
+
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
14
|
+
},
|
|
15
|
+
orientation: {
|
|
16
|
+
horizontal: "min-w-40 items-center",
|
|
17
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
18
|
+
}
|
|
19
|
+
} });
|
|
20
|
+
function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
"data-slot": "attachment",
|
|
23
|
+
"data-state": state,
|
|
24
|
+
"data-size": size,
|
|
25
|
+
"data-orientation": orientation,
|
|
26
|
+
className: cn(attachmentVariants({
|
|
27
|
+
size,
|
|
28
|
+
orientation
|
|
29
|
+
}), className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const attachmentMediaVariants = cva("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
|
|
34
|
+
variants: { variant: {
|
|
35
|
+
icon: "",
|
|
36
|
+
image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
|
|
37
|
+
} },
|
|
38
|
+
defaultVariants: { variant: "icon" }
|
|
39
|
+
});
|
|
40
|
+
function AttachmentMedia({ className, variant = "icon", ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx("div", {
|
|
42
|
+
"data-slot": "attachment-media",
|
|
43
|
+
"data-variant": variant,
|
|
44
|
+
className: cn(attachmentMediaVariants({ variant }), className),
|
|
45
|
+
...props
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function AttachmentContent({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-slot": "attachment-content",
|
|
51
|
+
className: cn("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function AttachmentTitle({ className, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx("span", {
|
|
57
|
+
"data-slot": "attachment-title",
|
|
58
|
+
className: cn("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer", className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function AttachmentDescription({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("span", {
|
|
64
|
+
"data-slot": "attachment-description",
|
|
65
|
+
className: cn("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", "max-w-full", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function AttachmentActions({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx("div", {
|
|
71
|
+
"data-slot": "attachment-actions",
|
|
72
|
+
className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function AttachmentAction({ className, variant, size = "icon-xs", ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
78
|
+
"data-slot": "attachment-action",
|
|
79
|
+
variant: variant ?? "ghost",
|
|
80
|
+
size,
|
|
81
|
+
className: cn(className),
|
|
82
|
+
...props
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function AttachmentTrigger({ className, render, type, ...props }) {
|
|
86
|
+
return useRender({
|
|
87
|
+
defaultTagName: "button",
|
|
88
|
+
props: mergeProps({
|
|
89
|
+
type: render ? type : type ?? "button",
|
|
90
|
+
className: cn("absolute inset-0 z-10 outline-none", className)
|
|
91
|
+
}, props),
|
|
92
|
+
render,
|
|
93
|
+
state: { slot: "attachment-trigger" }
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function AttachmentGroup({ className, ...props }) {
|
|
97
|
+
return /* @__PURE__ */ jsx("div", {
|
|
98
|
+
"data-slot": "attachment-group",
|
|
99
|
+
className: cn("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className),
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/ui/bubble.d.ts
|
|
5
|
+
declare function BubbleGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
6
|
+
declare const bubbleVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "destructive" | "ghost" | "muted" | "outline" | "secondary" | "tinted" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
declare function Bubble({ variant, align, className, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
10
|
+
align?: "start" | "end";
|
|
11
|
+
}): React$1.JSX.Element;
|
|
12
|
+
declare function BubbleContent({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
13
|
+
declare function BubbleReactions({ side, align, className, ...props }: React$1.ComponentProps<"div"> & {
|
|
14
|
+
align?: "start" | "end";
|
|
15
|
+
side?: "top" | "bottom";
|
|
16
|
+
}): React$1.JSX.Element;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
//#region src/components/ui/bubble.tsx
|
|
8
|
+
function BubbleGroup({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("div", {
|
|
10
|
+
"data-slot": "bubble-group",
|
|
11
|
+
className: cn("flex min-w-0 flex-col gap-2", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const bubbleVariants = cva("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full", {
|
|
16
|
+
variants: { variant: {
|
|
17
|
+
default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
|
|
18
|
+
secondary: "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
|
|
19
|
+
muted: "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
|
|
20
|
+
tinted: "*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",
|
|
21
|
+
outline: "*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",
|
|
22
|
+
ghost: "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
|
|
23
|
+
destructive: "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { variant: "default" }
|
|
26
|
+
});
|
|
27
|
+
function Bubble({ variant = "default", align = "start", className, ...props }) {
|
|
28
|
+
return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
"data-slot": "bubble",
|
|
30
|
+
"data-variant": variant,
|
|
31
|
+
"data-align": align,
|
|
32
|
+
className: cn(bubbleVariants({ variant }), className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function BubbleContent({ className, render, ...props }) {
|
|
37
|
+
return useRender({
|
|
38
|
+
defaultTagName: "div",
|
|
39
|
+
props: mergeProps({ className: cn("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50", className) }, props),
|
|
40
|
+
render,
|
|
41
|
+
state: { slot: "bubble-content" }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const bubbleReactionsVariants = cva("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0", {
|
|
45
|
+
variants: {
|
|
46
|
+
side: {
|
|
47
|
+
top: "top-0 -translate-y-3/4",
|
|
48
|
+
bottom: "bottom-0 translate-y-3/4"
|
|
49
|
+
},
|
|
50
|
+
align: {
|
|
51
|
+
start: "left-3",
|
|
52
|
+
end: "right-3"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
side: "bottom",
|
|
57
|
+
align: "end"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
function BubbleReactions({ side = "bottom", align = "end", className, ...props }) {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
"data-slot": "bubble-reactions",
|
|
63
|
+
"data-align": align,
|
|
64
|
+
"data-side": side,
|
|
65
|
+
className: cn(bubbleReactionsVariants({
|
|
66
|
+
side,
|
|
67
|
+
align
|
|
68
|
+
}), className),
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Separator } from "./separator.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/ui/button-group.d.ts
|
|
5
|
+
declare const buttonGroupVariants: (props?: ({
|
|
6
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
|
9
|
+
declare function ButtonGroupText({ className, render, ...props }: useRender.ComponentProps<"div">): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
10
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Separator } from "./separator.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
//#region src/components/ui/button-group.tsx
|
|
8
|
+
const buttonGroupVariants = cva("flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
9
|
+
variants: { orientation: {
|
|
10
|
+
horizontal: "*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
|
|
11
|
+
vertical: "flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0"
|
|
12
|
+
} },
|
|
13
|
+
defaultVariants: { orientation: "horizontal" }
|
|
14
|
+
});
|
|
15
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
role: "group",
|
|
18
|
+
"data-slot": "button-group",
|
|
19
|
+
"data-orientation": orientation,
|
|
20
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function ButtonGroupText({ className, render, ...props }) {
|
|
25
|
+
return useRender({
|
|
26
|
+
defaultTagName: "div",
|
|
27
|
+
props: mergeProps({ className: cn("flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className) }, props),
|
|
28
|
+
render,
|
|
29
|
+
state: { slot: "button-group-text" }
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
34
|
+
"data-slot": "button-group-separator",
|
|
35
|
+
orientation,
|
|
36
|
+
className: cn("relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto", className),
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
1
|
import { Button as Button$1 } from "@base-ui/react/button";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/ui/button.d.ts
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
5
|
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "cn";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
3
|
import { Button as Button$1 } from "@base-ui/react/button";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
5
|
//#region src/components/ui/button.tsx
|
|
6
6
|
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
7
|
variants: {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from "embla-carousel-react";
|
|
4
|
+
//#region src/components/ui/carousel.d.ts
|
|
5
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
6
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
7
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
8
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
9
|
+
type CarouselProps = {
|
|
10
|
+
opts?: CarouselOptions;
|
|
11
|
+
plugins?: CarouselPlugin;
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
setApi?: (api: CarouselApi) => void;
|
|
14
|
+
};
|
|
15
|
+
type CarouselContextProps = {
|
|
16
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
17
|
+
api: ReturnType<typeof useEmblaCarousel>[1];
|
|
18
|
+
scrollPrev: () => void;
|
|
19
|
+
scrollNext: () => void;
|
|
20
|
+
canScrollPrev: boolean;
|
|
21
|
+
canScrollNext: boolean;
|
|
22
|
+
} & CarouselProps;
|
|
23
|
+
declare function useCarousel(): CarouselContextProps;
|
|
24
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React$1.ComponentProps<"div"> & CarouselProps): React$1.JSX.Element;
|
|
25
|
+
declare function CarouselContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
26
|
+
declare function CarouselItem({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
27
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
28
|
+
declare function CarouselNext({ className, variant, size, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
|