orbital-ds 0.1.0 → 0.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/contract.json +38 -0
- package/dist/styles.css +98 -18
- package/dist/themes/qratia.css +13 -13
- package/dist/themes/zyro.css +189 -0
- package/dist/ui/accordion.d.ts +9 -0
- package/dist/ui/accordion.js +79 -0
- package/dist/ui/alert-dialog.d.ts +23 -0
- package/dist/ui/alert-dialog.js +173 -0
- package/dist/ui/alert.d.ts +13 -0
- package/dist/ui/alert.js +77 -0
- package/dist/ui/aspect-ratio.d.ts +7 -0
- package/dist/ui/aspect-ratio.js +22 -0
- package/dist/ui/attachment.d.ts +26 -0
- package/dist/ui/attachment.js +197 -0
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/bubble.d.ts +19 -0
- package/dist/ui/bubble.js +115 -0
- package/dist/ui/button-group.d.ts +15 -0
- package/dist/ui/button-group.js +82 -0
- package/dist/ui/button.d.ts +5 -3
- package/dist/ui/button.js +9 -6
- package/dist/ui/calendar.d.ts +15 -0
- package/dist/ui/calendar.js +190 -0
- package/dist/ui/card.js +4 -4
- package/dist/ui/carousel.d.ts +33 -0
- package/dist/ui/carousel.js +199 -0
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/combobox.d.ts +26 -0
- package/dist/ui/combobox.js +281 -0
- package/dist/ui/command.d.ts +22 -0
- package/dist/ui/command.js +183 -0
- package/dist/ui/context-menu.d.ts +31 -0
- package/dist/ui/context-menu.js +242 -0
- package/dist/ui/dialog.js +2 -2
- package/dist/ui/direction.d.ts +1 -0
- package/dist/ui/direction.js +8 -0
- package/dist/ui/drawer.d.ts +18 -0
- package/dist/ui/drawer.js +208 -0
- package/dist/ui/dropdown-menu.d.ts +1 -1
- package/dist/ui/dropdown-menu.js +13 -9
- package/dist/ui/empty.d.ts +15 -0
- package/dist/ui/empty.js +102 -0
- package/dist/ui/field.d.ts +28 -0
- package/dist/ui/field.js +217 -0
- package/dist/ui/hover-card.d.ts +8 -0
- package/dist/ui/hover-card.js +45 -0
- package/dist/ui/input-group.d.ts +22 -0
- package/dist/ui/input-group.js +145 -0
- package/dist/ui/input-otp.d.ts +13 -0
- package/dist/ui/input-otp.js +82 -0
- package/dist/ui/input.js +1 -1
- package/dist/ui/item.d.ts +26 -0
- package/dist/ui/item.js +195 -0
- package/dist/ui/kbd.d.ts +6 -0
- package/dist/ui/kbd.js +29 -0
- package/dist/ui/marker.d.ts +13 -0
- package/dist/ui/marker.js +71 -0
- package/dist/ui/menubar.d.ts +31 -0
- package/dist/ui/menubar.js +259 -0
- package/dist/ui/message-scroller.d.ts +16 -0
- package/dist/ui/message-scroller.js +120 -0
- package/dist/ui/message.d.ts +12 -0
- package/dist/ui/message.js +90 -0
- package/dist/ui/native-select.d.ts +10 -0
- package/dist/ui/native-select.js +63 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.js +162 -0
- package/dist/ui/pagination.d.ts +22 -0
- package/dist/ui/pagination.js +128 -0
- package/dist/ui/popover.js +2 -2
- package/dist/ui/questionnaire.d.ts +24 -0
- package/dist/ui/questionnaire.js +331 -0
- package/dist/ui/radio-group.d.ts +8 -0
- package/dist/ui/radio-group.js +39 -0
- package/dist/ui/resizable.d.ts +10 -0
- package/dist/ui/resizable.js +46 -0
- package/dist/ui/scroll-area.js +1 -1
- package/dist/ui/select.js +5 -5
- package/dist/ui/sheet.js +4 -4
- package/dist/ui/sidebar.js +4 -4
- package/dist/ui/slider.d.ts +6 -0
- package/dist/ui/slider.js +53 -0
- package/dist/ui/spinner.d.ts +5 -0
- package/dist/ui/spinner.js +9 -0
- package/dist/ui/switch.d.ts +8 -0
- package/dist/ui/switch.js +32 -0
- package/dist/ui/table.js +2 -2
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/toast.d.ts +19 -0
- package/dist/ui/toast.js +193 -0
- package/dist/ui/toggle-group.d.ts +14 -0
- package/dist/ui/toggle-group.js +77 -0
- package/dist/ui/toggle.d.ts +12 -0
- package/dist/ui/toggle.js +43 -0
- package/dist/ui/tooltip.js +3 -3
- package/docs/CONTRACT.md +113 -0
- package/package.json +50 -12
- package/scripts/doctor.mjs +142 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
function AlertDialog({ ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
7
|
+
}
|
|
8
|
+
function AlertDialogTrigger({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
function AlertDialogPortal({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
13
|
+
}
|
|
14
|
+
function AlertDialogOverlay({
|
|
15
|
+
className,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
AlertDialogPrimitive.Backdrop,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "alert-dialog-overlay",
|
|
22
|
+
className: cn(
|
|
23
|
+
"fixed inset-0 isolate z-(--ds-z-overlay) bg-scrim duration-(--ds-motion-fast) supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function AlertDialogContent({
|
|
31
|
+
className,
|
|
32
|
+
size = "default",
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
AlertDialogPrimitive.Popup,
|
|
39
|
+
{
|
|
40
|
+
"data-slot": "alert-dialog-content",
|
|
41
|
+
"data-size": size,
|
|
42
|
+
className: cn(
|
|
43
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-(--ds-z-overlay) grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-control bg-popover p-6 text-popover-foreground ring-1 ring-foreground/5 duration-(--ds-motion-fast) outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md 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",
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
...props
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
function AlertDialogHeader({
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "alert-dialog-header",
|
|
59
|
+
className: cn(
|
|
60
|
+
"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-6 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]",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function AlertDialogFooter({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "alert-dialog-footer",
|
|
75
|
+
className: cn(
|
|
76
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function AlertDialogMedia({
|
|
84
|
+
className,
|
|
85
|
+
...props
|
|
86
|
+
}) {
|
|
87
|
+
return /* @__PURE__ */ jsx(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
"data-slot": "alert-dialog-media",
|
|
91
|
+
className: cn(
|
|
92
|
+
"mb-2 inline-flex size-16 items-center justify-center rounded-full bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",
|
|
93
|
+
className
|
|
94
|
+
),
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function AlertDialogTitle({
|
|
100
|
+
className,
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
return /* @__PURE__ */ jsx(
|
|
104
|
+
AlertDialogPrimitive.Title,
|
|
105
|
+
{
|
|
106
|
+
"data-slot": "alert-dialog-title",
|
|
107
|
+
className: cn(
|
|
108
|
+
"text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function AlertDialogDescription({
|
|
116
|
+
className,
|
|
117
|
+
...props
|
|
118
|
+
}) {
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
AlertDialogPrimitive.Description,
|
|
121
|
+
{
|
|
122
|
+
"data-slot": "alert-dialog-description",
|
|
123
|
+
className: cn(
|
|
124
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function AlertDialogAction({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}) {
|
|
135
|
+
return /* @__PURE__ */ jsx(
|
|
136
|
+
Button,
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "alert-dialog-action",
|
|
139
|
+
className: cn(className),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function AlertDialogCancel({
|
|
145
|
+
className,
|
|
146
|
+
variant = "outline",
|
|
147
|
+
size = "default",
|
|
148
|
+
...props
|
|
149
|
+
}) {
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
151
|
+
AlertDialogPrimitive.Close,
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "alert-dialog-cancel",
|
|
154
|
+
className: cn(className),
|
|
155
|
+
render: /* @__PURE__ */ jsx(Button, { variant, size }),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
AlertDialog,
|
|
162
|
+
AlertDialogAction,
|
|
163
|
+
AlertDialogCancel,
|
|
164
|
+
AlertDialogContent,
|
|
165
|
+
AlertDialogDescription,
|
|
166
|
+
AlertDialogFooter,
|
|
167
|
+
AlertDialogHeader,
|
|
168
|
+
AlertDialogMedia,
|
|
169
|
+
AlertDialogOverlay,
|
|
170
|
+
AlertDialogPortal,
|
|
171
|
+
AlertDialogTitle,
|
|
172
|
+
AlertDialogTrigger
|
|
173
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const alertVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
7
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
8
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
9
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
package/dist/ui/alert.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
const alertVariants = cva(
|
|
5
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-card text-card-foreground",
|
|
10
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
function Alert({
|
|
19
|
+
className,
|
|
20
|
+
variant,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "alert",
|
|
27
|
+
role: "alert",
|
|
28
|
+
className: cn(alertVariants({ variant }), className),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function AlertTitle({ className, ...props }) {
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "alert-title",
|
|
38
|
+
className: cn(
|
|
39
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
40
|
+
className
|
|
41
|
+
),
|
|
42
|
+
...props
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function AlertDescription({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "alert-description",
|
|
54
|
+
className: cn(
|
|
55
|
+
"text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
56
|
+
className
|
|
57
|
+
),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function AlertAction({ className, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "alert-action",
|
|
67
|
+
className: cn("absolute top-2.5 right-3", className),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
Alert,
|
|
74
|
+
AlertAction,
|
|
75
|
+
AlertDescription,
|
|
76
|
+
AlertTitle
|
|
77
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
function AspectRatio({
|
|
4
|
+
ratio,
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "aspect-ratio",
|
|
12
|
+
style: {
|
|
13
|
+
"--ratio": ratio
|
|
14
|
+
},
|
|
15
|
+
className: cn("relative aspect-(--ratio)", className),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
AspectRatio
|
|
22
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
|
|
7
|
+
declare const attachmentVariants: (props?: ({
|
|
8
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
9
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
|
|
12
|
+
state?: "idle" | "uploading" | "processing" | "error" | "done";
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare const attachmentMediaVariants: (props?: ({
|
|
15
|
+
variant?: "image" | "icon" | null | undefined;
|
|
16
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
+
declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): React.JSX.Element;
|
|
18
|
+
declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
20
|
+
declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
|
+
declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
|
+
declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
23
|
+
declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
24
|
+
declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
import { Button } from "./button";
|
|
7
|
+
const attachmentVariants = cva(
|
|
8
|
+
"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-2xl 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",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
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",
|
|
13
|
+
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",
|
|
14
|
+
xs: "gap-1.5 rounded-xl text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
15
|
+
},
|
|
16
|
+
orientation: {
|
|
17
|
+
horizontal: "min-w-40 items-center",
|
|
18
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
function Attachment({
|
|
24
|
+
className,
|
|
25
|
+
state = "done",
|
|
26
|
+
size = "default",
|
|
27
|
+
orientation = "horizontal",
|
|
28
|
+
...props
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "attachment",
|
|
34
|
+
"data-state": state,
|
|
35
|
+
"data-size": size,
|
|
36
|
+
"data-orientation": orientation,
|
|
37
|
+
className: cn(attachmentVariants({ size, orientation }), className),
|
|
38
|
+
...props
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
const attachmentMediaVariants = cva(
|
|
43
|
+
"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-xl 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-lg 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",
|
|
44
|
+
{
|
|
45
|
+
variants: {
|
|
46
|
+
variant: {
|
|
47
|
+
icon: "",
|
|
48
|
+
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"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "icon"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
function AttachmentMedia({
|
|
57
|
+
className,
|
|
58
|
+
variant = "icon",
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
"data-slot": "attachment-media",
|
|
65
|
+
"data-variant": variant,
|
|
66
|
+
className: cn(attachmentMediaVariants({ variant }), className),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function AttachmentContent({
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}) {
|
|
75
|
+
return /* @__PURE__ */ jsx(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
"data-slot": "attachment-content",
|
|
79
|
+
className: cn(
|
|
80
|
+
"max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1",
|
|
81
|
+
className
|
|
82
|
+
),
|
|
83
|
+
...props
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function AttachmentTitle({
|
|
88
|
+
className,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
"span",
|
|
93
|
+
{
|
|
94
|
+
"data-slot": "attachment-title",
|
|
95
|
+
className: cn(
|
|
96
|
+
"block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
function AttachmentDescription({
|
|
104
|
+
className,
|
|
105
|
+
...props
|
|
106
|
+
}) {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "attachment-description",
|
|
111
|
+
className: cn(
|
|
112
|
+
"mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80",
|
|
113
|
+
"max-w-full",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function AttachmentActions({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "attachment-actions",
|
|
128
|
+
className: cn(
|
|
129
|
+
"relative z-(--ds-z-sticky) 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",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function AttachmentAction({
|
|
137
|
+
className,
|
|
138
|
+
variant,
|
|
139
|
+
size = "icon-xs",
|
|
140
|
+
...props
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
Button,
|
|
144
|
+
{
|
|
145
|
+
"data-slot": "attachment-action",
|
|
146
|
+
variant: variant ?? "ghost",
|
|
147
|
+
size,
|
|
148
|
+
className: cn(className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
function AttachmentTrigger({
|
|
154
|
+
className,
|
|
155
|
+
render,
|
|
156
|
+
type,
|
|
157
|
+
...props
|
|
158
|
+
}) {
|
|
159
|
+
return useRender({
|
|
160
|
+
defaultTagName: "button",
|
|
161
|
+
props: mergeProps(
|
|
162
|
+
{
|
|
163
|
+
type: render ? type : type ?? "button",
|
|
164
|
+
className: cn("absolute inset-0 z-(--ds-z-raised) outline-none", className)
|
|
165
|
+
},
|
|
166
|
+
props
|
|
167
|
+
),
|
|
168
|
+
render,
|
|
169
|
+
state: {
|
|
170
|
+
slot: "attachment-trigger"
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function AttachmentGroup({ className, ...props }) {
|
|
175
|
+
return /* @__PURE__ */ jsx(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
"data-slot": "attachment-group",
|
|
179
|
+
className: cn(
|
|
180
|
+
"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",
|
|
181
|
+
className
|
|
182
|
+
),
|
|
183
|
+
...props
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
export {
|
|
188
|
+
Attachment,
|
|
189
|
+
AttachmentAction,
|
|
190
|
+
AttachmentActions,
|
|
191
|
+
AttachmentContent,
|
|
192
|
+
AttachmentDescription,
|
|
193
|
+
AttachmentGroup,
|
|
194
|
+
AttachmentMedia,
|
|
195
|
+
AttachmentTitle,
|
|
196
|
+
AttachmentTrigger
|
|
197
|
+
};
|
package/dist/ui/avatar.js
CHANGED
|
@@ -54,7 +54,7 @@ function AvatarBadge({ className, ...props }) {
|
|
|
54
54
|
{
|
|
55
55
|
"data-slot": "avatar-badge",
|
|
56
56
|
className: cn(
|
|
57
|
-
"absolute right-0 bottom-0 z-(--z-raised) inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
57
|
+
"absolute right-0 bottom-0 z-(--ds-z-raised) inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
|
|
58
58
|
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
59
59
|
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
60
60
|
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
6
|
declare const badgeVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "
|
|
7
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
10
10
|
|
package/dist/ui/badge.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../lib/utils";
|
|
5
5
|
const badgeVariants = cva(
|
|
6
|
-
"group/badge inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-
|
|
6
|
+
"group/badge inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border border-transparent px-(--ds-badge-px) py-1 text-xs font-semibold whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare const bubbleVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "muted" | "tinted" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare function BubbleContent({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
14
|
+
declare function BubbleReactions({ side, align, className, ...props }: React.ComponentProps<"div"> & {
|
|
15
|
+
align?: "start" | "end";
|
|
16
|
+
side?: "top" | "bottom";
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
|
|
19
|
+
export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
|