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,162 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
+
function NavigationMenu({
|
|
7
|
+
align = "start",
|
|
8
|
+
className,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
NavigationMenuPrimitive.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "navigation-menu",
|
|
16
|
+
className: cn(
|
|
17
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props,
|
|
21
|
+
children: [
|
|
22
|
+
children,
|
|
23
|
+
/* @__PURE__ */ jsx(NavigationMenuPositioner, { align })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function NavigationMenuList({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
NavigationMenuPrimitive.List,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "navigation-menu-list",
|
|
36
|
+
className: cn(
|
|
37
|
+
"group flex flex-1 list-none items-center justify-center gap-0",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function NavigationMenuItem({
|
|
45
|
+
className,
|
|
46
|
+
...props
|
|
47
|
+
}) {
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
NavigationMenuPrimitive.Item,
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "navigation-menu-item",
|
|
52
|
+
className: cn("relative", className),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
const navigationMenuTriggerStyle = cva(
|
|
58
|
+
"group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-2xl px-4.5 py-2.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted"
|
|
59
|
+
);
|
|
60
|
+
function NavigationMenuTrigger({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ jsxs(
|
|
66
|
+
NavigationMenuPrimitive.Trigger,
|
|
67
|
+
{
|
|
68
|
+
"data-slot": "navigation-menu-trigger",
|
|
69
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
70
|
+
...props,
|
|
71
|
+
children: [
|
|
72
|
+
children,
|
|
73
|
+
" ",
|
|
74
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "relative top-px ml-1 size-3 transition duration-(--ds-motion-slow) group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180", "aria-hidden": "true" })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function NavigationMenuContent({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}) {
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
NavigationMenuPrimitive.Content,
|
|
85
|
+
{
|
|
86
|
+
"data-slot": "navigation-menu-content",
|
|
87
|
+
className: cn(
|
|
88
|
+
"data-ending-style:data-activation-direction=left:translate-x-[50%] data-ending-style:data-activation-direction=right:translate-x-[-50%] data-starting-style:data-activation-direction=left:translate-x-[-50%] data-starting-style:data-activation-direction=right:translate-x-[50%] isolate z-(--ds-z-overlay) h-full w-auto p-2.5 pr-3 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-2xl group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-popover group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/5 group-data-[viewport=false]/navigation-menu:duration-(--ds-motion-slow) data-ending-style:opacity-0 data-starting-style:opacity-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
...props
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function NavigationMenuPositioner({
|
|
96
|
+
className,
|
|
97
|
+
side = "bottom",
|
|
98
|
+
sideOffset = 8,
|
|
99
|
+
align = "start",
|
|
100
|
+
alignOffset = 0,
|
|
101
|
+
...props
|
|
102
|
+
}) {
|
|
103
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
104
|
+
NavigationMenuPrimitive.Positioner,
|
|
105
|
+
{
|
|
106
|
+
side,
|
|
107
|
+
sideOffset,
|
|
108
|
+
align,
|
|
109
|
+
alignOffset,
|
|
110
|
+
className: cn(
|
|
111
|
+
"isolate z-(--ds-z-overlay) h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
...props,
|
|
115
|
+
children: /* @__PURE__ */ jsx(NavigationMenuPrimitive.Popup, { className: "data-[ending-style]:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-2xl bg-popover text-popover-foreground shadow-popover ring-1 ring-foreground/5 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-(--ds-motion-fast) data-starting-style:scale-90 data-starting-style:opacity-0", children: /* @__PURE__ */ jsx(NavigationMenuPrimitive.Viewport, { className: "relative size-full overflow-hidden" }) })
|
|
116
|
+
}
|
|
117
|
+
) });
|
|
118
|
+
}
|
|
119
|
+
function NavigationMenuLink({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}) {
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
NavigationMenuPrimitive.Link,
|
|
125
|
+
{
|
|
126
|
+
"data-slot": "navigation-menu-link",
|
|
127
|
+
className: cn(
|
|
128
|
+
"flex items-center gap-1.5 rounded-2xl p-3 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-xl data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
129
|
+
className
|
|
130
|
+
),
|
|
131
|
+
...props
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
function NavigationMenuIndicator({
|
|
136
|
+
className,
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
NavigationMenuPrimitive.Icon,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "navigation-menu-indicator",
|
|
143
|
+
className: cn(
|
|
144
|
+
"top-full z-(--ds-z-raised) flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
|
|
145
|
+
className
|
|
146
|
+
),
|
|
147
|
+
...props,
|
|
148
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-overlay" })
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
NavigationMenu,
|
|
154
|
+
NavigationMenuContent,
|
|
155
|
+
NavigationMenuIndicator,
|
|
156
|
+
NavigationMenuItem,
|
|
157
|
+
NavigationMenuLink,
|
|
158
|
+
NavigationMenuList,
|
|
159
|
+
NavigationMenuPositioner,
|
|
160
|
+
NavigationMenuTrigger,
|
|
161
|
+
navigationMenuTriggerStyle
|
|
162
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
import 'class-variance-authority/types';
|
|
4
|
+
import '@base-ui/react/use-render';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
8
|
+
declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
9
|
+
declare function PaginationItem({ ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
10
|
+
type PaginationLinkProps = {
|
|
11
|
+
isActive?: boolean;
|
|
12
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> & React.ComponentProps<"a">;
|
|
13
|
+
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): React.JSX.Element;
|
|
14
|
+
declare function PaginationPrevious({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
|
|
15
|
+
text?: string;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
declare function PaginationNext({ className, text, ...props }: React.ComponentProps<typeof PaginationLink> & {
|
|
18
|
+
text?: string;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
5
|
+
function Pagination({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"nav",
|
|
8
|
+
{
|
|
9
|
+
role: "navigation",
|
|
10
|
+
"aria-label": "pagination",
|
|
11
|
+
"data-slot": "pagination",
|
|
12
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function PaginationContent({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"ul",
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "pagination-content",
|
|
25
|
+
className: cn("flex items-center gap-1", className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function PaginationItem({ ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
|
|
32
|
+
}
|
|
33
|
+
function PaginationLink({
|
|
34
|
+
className,
|
|
35
|
+
isActive,
|
|
36
|
+
size = "icon",
|
|
37
|
+
...props
|
|
38
|
+
}) {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
Button,
|
|
41
|
+
{
|
|
42
|
+
variant: isActive ? "outline" : "ghost",
|
|
43
|
+
size,
|
|
44
|
+
className: cn(className),
|
|
45
|
+
nativeButton: false,
|
|
46
|
+
render: /* @__PURE__ */ jsx(
|
|
47
|
+
"a",
|
|
48
|
+
{
|
|
49
|
+
"aria-current": isActive ? "page" : void 0,
|
|
50
|
+
"data-slot": "pagination-link",
|
|
51
|
+
"data-active": isActive,
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function PaginationPrevious({
|
|
59
|
+
className,
|
|
60
|
+
text = "Previous",
|
|
61
|
+
...props
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ jsxs(
|
|
64
|
+
PaginationLink,
|
|
65
|
+
{
|
|
66
|
+
"aria-label": "Go to previous page",
|
|
67
|
+
size: "default",
|
|
68
|
+
className: cn("pl-2!", className),
|
|
69
|
+
...props,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(ChevronLeftIcon, { "data-icon": "inline-start" }),
|
|
72
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function PaginationNext({
|
|
78
|
+
className,
|
|
79
|
+
text = "Next",
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
83
|
+
PaginationLink,
|
|
84
|
+
{
|
|
85
|
+
"aria-label": "Go to next page",
|
|
86
|
+
size: "default",
|
|
87
|
+
className: cn("pr-2!", className),
|
|
88
|
+
...props,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: text }),
|
|
91
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { "data-icon": "inline-end" })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
function PaginationEllipsis({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}) {
|
|
100
|
+
return /* @__PURE__ */ jsxs(
|
|
101
|
+
"span",
|
|
102
|
+
{
|
|
103
|
+
"aria-hidden": true,
|
|
104
|
+
"data-slot": "pagination-ellipsis",
|
|
105
|
+
className: cn(
|
|
106
|
+
"flex size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...props,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx(
|
|
112
|
+
MoreHorizontalIcon,
|
|
113
|
+
{}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
Pagination,
|
|
122
|
+
PaginationContent,
|
|
123
|
+
PaginationEllipsis,
|
|
124
|
+
PaginationItem,
|
|
125
|
+
PaginationLink,
|
|
126
|
+
PaginationNext,
|
|
127
|
+
PaginationPrevious
|
|
128
|
+
};
|
package/dist/ui/popover.js
CHANGED
|
@@ -21,13 +21,13 @@ function PopoverContent({
|
|
|
21
21
|
align,
|
|
22
22
|
side,
|
|
23
23
|
sideOffset,
|
|
24
|
-
className: "z-(--z-overlay)",
|
|
24
|
+
className: "z-(--ds-z-overlay)",
|
|
25
25
|
children: /* @__PURE__ */ jsx(
|
|
26
26
|
PopoverPrimitive.Popup,
|
|
27
27
|
{
|
|
28
28
|
"data-slot": "popover-content",
|
|
29
29
|
className: cn(
|
|
30
|
-
"flex w-72 origin-(--transform-origin) flex-col gap-
|
|
30
|
+
"flex w-72 origin-(--transform-origin) flex-col gap-(--ds-popover-p) rounded-2xl bg-popover p-(--ds-popover-p) text-sm text-popover-foreground shadow-popover ring-1 ring-foreground/5 outline-hidden duration-(--ds-motion-fast) data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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",
|
|
31
31
|
className
|
|
32
32
|
),
|
|
33
33
|
...props
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Questionnaire as Questionnaire$1 } from '@shadcn/react/questionnaire';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import '@base-ui/react/use-render';
|
|
6
|
+
import 'class-variance-authority';
|
|
7
|
+
|
|
8
|
+
declare function Questionnaire({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Root>): React.JSX.Element;
|
|
9
|
+
declare function QuestionnaireProgress({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Progress>): React.JSX.Element;
|
|
10
|
+
declare function QuestionnaireItem({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Item>): React.JSX.Element;
|
|
11
|
+
declare function QuestionnaireTitle({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Title>): React.JSX.Element;
|
|
12
|
+
declare function QuestionnaireDescription({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Description>): React.JSX.Element;
|
|
13
|
+
declare function QuestionnaireChoices({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Choices>): React.JSX.Element;
|
|
14
|
+
declare function QuestionnaireChoice({ children, className, ...props }: React.ComponentProps<typeof Questionnaire$1.Choice>): React.JSX.Element;
|
|
15
|
+
declare function QuestionnaireChoiceDescription({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
16
|
+
declare function QuestionnaireInput({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Input>): React.JSX.Element;
|
|
17
|
+
declare function QuestionnaireError({ className, ...props }: React.ComponentProps<typeof Questionnaire$1.Error>): React.JSX.Element;
|
|
18
|
+
declare function QuestionnaireActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function QuestionnairePrevious({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Previous> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
20
|
+
declare function QuestionnaireSkip({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Skip> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
21
|
+
declare function QuestionnaireNext({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Next> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
22
|
+
declare function QuestionnaireSubmit({ children, className, size, variant, ...props }: React.ComponentProps<typeof Questionnaire$1.Submit> & Pick<React.ComponentProps<typeof Button>, "size" | "variant">): React.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle };
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Questionnaire as QuestionnairePrimitive } from "@shadcn/react/questionnaire";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { buttonVariants } from "./button";
|
|
6
|
+
import { CheckIcon } from "lucide-react";
|
|
7
|
+
function Questionnaire({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
QuestionnairePrimitive.Root,
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "questionnaire",
|
|
15
|
+
className: cn("flex w-full min-w-0 flex-col gap-6", className),
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function QuestionnaireProgress({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
QuestionnairePrimitive.Progress,
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "questionnaire-progress",
|
|
28
|
+
className: cn(
|
|
29
|
+
"min-h-[1lh] w-fit min-w-[14ch] text-xs font-medium text-muted-foreground tabular-nums",
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function QuestionnaireItem({
|
|
37
|
+
className,
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
QuestionnairePrimitive.Item,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "questionnaire-item",
|
|
44
|
+
className: cn(
|
|
45
|
+
"flex min-w-0 flex-col gap-5 border-0 p-0 outline-none",
|
|
46
|
+
className
|
|
47
|
+
),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function QuestionnaireTitle({
|
|
53
|
+
className,
|
|
54
|
+
...props
|
|
55
|
+
}) {
|
|
56
|
+
return /* @__PURE__ */ jsx(
|
|
57
|
+
QuestionnairePrimitive.Title,
|
|
58
|
+
{
|
|
59
|
+
"data-slot": "questionnaire-title",
|
|
60
|
+
className: cn(
|
|
61
|
+
"text-base font-semibold text-pretty [&:not(:has(~[data-slot=questionnaire-description]))]:mb-5",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function QuestionnaireDescription({
|
|
69
|
+
className,
|
|
70
|
+
...props
|
|
71
|
+
}) {
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
QuestionnairePrimitive.Description,
|
|
74
|
+
{
|
|
75
|
+
"data-slot": "questionnaire-description",
|
|
76
|
+
className: cn("text-sm text-pretty text-muted-foreground", className),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function QuestionnaireChoices({
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}) {
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
QuestionnairePrimitive.Choices,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "questionnaire-choices",
|
|
89
|
+
className: cn(
|
|
90
|
+
"group/questionnaire-choices grid min-w-0 gap-3",
|
|
91
|
+
className
|
|
92
|
+
),
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function QuestionnaireChoice({
|
|
98
|
+
children,
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
}) {
|
|
102
|
+
return /* @__PURE__ */ jsxs(
|
|
103
|
+
QuestionnairePrimitive.Choice,
|
|
104
|
+
{
|
|
105
|
+
"data-slot": "questionnaire-choice",
|
|
106
|
+
className: cn(
|
|
107
|
+
"group/questionnaire-choice relative flex min-h-11 cursor-pointer items-start gap-3 rounded-control border border-input px-4 py-3.5 text-start text-sm transition-colors outline-none select-none hover:bg-input/40 has-[>input:focus-visible]:border-ring has-[>input:focus-visible]:ring-(length:--ds-ring-width) has-[>input:focus-visible]:ring-ring/50 data-invalid:border-destructive data-checked:border-primary/40 data-checked:bg-primary/10",
|
|
108
|
+
"data-disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
109
|
+
className
|
|
110
|
+
),
|
|
111
|
+
...props,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(
|
|
114
|
+
QuestionnairePrimitive.ChoiceInput,
|
|
115
|
+
{
|
|
116
|
+
"data-slot": "questionnaire-choice-input",
|
|
117
|
+
className: "absolute inset-0 z-(--ds-z-raised) size-full cursor-pointer opacity-0"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxs(
|
|
121
|
+
"span",
|
|
122
|
+
{
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
"data-slot": "questionnaire-choice-indicator",
|
|
125
|
+
className: "pointer-events-none relative flex size-4 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-[6px] border border-input group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[type=radio]/questionnaire-choice:rounded-full group-data-checked/questionnaire-choice:border-primary group-data-checked/questionnaire-choice:bg-primary group-data-checked/questionnaire-choice:text-primary-foreground dark:bg-input/30 dark:group-data-checked/questionnaire-choice:bg-primary",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx(
|
|
128
|
+
"span",
|
|
129
|
+
{
|
|
130
|
+
"data-slot": "questionnaire-choice-indicator-dot",
|
|
131
|
+
className: "hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(CheckIcon, { "data-slot": "questionnaire-choice-indicator-check", className: "hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block" })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx(
|
|
139
|
+
QuestionnairePrimitive.ChoiceLabel,
|
|
140
|
+
{
|
|
141
|
+
"data-slot": "questionnaire-choice-label",
|
|
142
|
+
className: "flex min-w-0 flex-1 flex-col gap-1 leading-snug",
|
|
143
|
+
children
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ jsx(
|
|
147
|
+
QuestionnairePrimitive.ChoiceShortcut,
|
|
148
|
+
{
|
|
149
|
+
"data-slot": "questionnaire-choice-shortcut",
|
|
150
|
+
className: "pointer-events-none ms-auto hidden size-5 shrink-0 translate-y-[--spacing(0.45)] items-center justify-center rounded-full border border-input bg-background/80 font-mono text-[0.625rem] leading-none font-medium text-muted-foreground group-has-data-[slot=questionnaire-choice-description]/questionnaire-choice:translate-y-0.5 group-data-[shortcut]/questionnaire-choice:inline-flex"
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function QuestionnaireChoiceDescription({
|
|
158
|
+
className,
|
|
159
|
+
...props
|
|
160
|
+
}) {
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
162
|
+
"span",
|
|
163
|
+
{
|
|
164
|
+
"data-slot": "questionnaire-choice-description",
|
|
165
|
+
className: cn("text-muted-foreground", className),
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function QuestionnaireInput({
|
|
171
|
+
className,
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
return /* @__PURE__ */ jsx(
|
|
175
|
+
"div",
|
|
176
|
+
{
|
|
177
|
+
"data-slot": "questionnaire-input-wrapper",
|
|
178
|
+
className: "group/questionnaire-input relative w-full min-w-0",
|
|
179
|
+
children: /* @__PURE__ */ jsx(
|
|
180
|
+
QuestionnairePrimitive.Input,
|
|
181
|
+
{
|
|
182
|
+
"data-slot": "questionnaire-input",
|
|
183
|
+
className: cn(
|
|
184
|
+
"h-9 min-h-11 w-full min-w-0 rounded-control border border-input bg-input/30 px-3 py-1 text-base transition-[color,box-shadow,background-color] outline-none focus-visible:border-ring focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-(length:--ds-ring-width) aria-invalid:ring-destructive/20 sm:min-h-0 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
185
|
+
"selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground",
|
|
186
|
+
className
|
|
187
|
+
),
|
|
188
|
+
...props
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function QuestionnaireError({
|
|
195
|
+
className,
|
|
196
|
+
...props
|
|
197
|
+
}) {
|
|
198
|
+
return /* @__PURE__ */ jsx(
|
|
199
|
+
QuestionnairePrimitive.Error,
|
|
200
|
+
{
|
|
201
|
+
"data-slot": "questionnaire-error",
|
|
202
|
+
className: cn("mt-2 text-sm text-destructive", className),
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
function QuestionnaireActions({
|
|
208
|
+
className,
|
|
209
|
+
...props
|
|
210
|
+
}) {
|
|
211
|
+
return /* @__PURE__ */ jsx(
|
|
212
|
+
"div",
|
|
213
|
+
{
|
|
214
|
+
"data-slot": "questionnaire-actions",
|
|
215
|
+
className: cn(
|
|
216
|
+
"grid min-h-11 w-full grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2 sm:min-h-9",
|
|
217
|
+
className
|
|
218
|
+
),
|
|
219
|
+
...props
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
function QuestionnairePrevious({
|
|
224
|
+
children,
|
|
225
|
+
className,
|
|
226
|
+
size = "default",
|
|
227
|
+
variant = "outline",
|
|
228
|
+
...props
|
|
229
|
+
}) {
|
|
230
|
+
return /* @__PURE__ */ jsx(
|
|
231
|
+
QuestionnairePrimitive.Previous,
|
|
232
|
+
{
|
|
233
|
+
"data-slot": "questionnaire-previous",
|
|
234
|
+
"data-size": size,
|
|
235
|
+
"data-variant": variant,
|
|
236
|
+
className: cn(
|
|
237
|
+
buttonVariants({ size, variant }),
|
|
238
|
+
"col-start-1 row-start-1 min-h-11 justify-self-start sm:min-h-0",
|
|
239
|
+
className
|
|
240
|
+
),
|
|
241
|
+
...props,
|
|
242
|
+
children: children ?? "Previous"
|
|
243
|
+
}
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
function QuestionnaireSkip({
|
|
247
|
+
children,
|
|
248
|
+
className,
|
|
249
|
+
size = "default",
|
|
250
|
+
variant = "outline",
|
|
251
|
+
...props
|
|
252
|
+
}) {
|
|
253
|
+
return /* @__PURE__ */ jsx(
|
|
254
|
+
QuestionnairePrimitive.Skip,
|
|
255
|
+
{
|
|
256
|
+
"data-slot": "questionnaire-skip",
|
|
257
|
+
"data-size": size,
|
|
258
|
+
"data-variant": variant,
|
|
259
|
+
className: cn(
|
|
260
|
+
buttonVariants({ size, variant }),
|
|
261
|
+
"col-start-2 row-start-1 min-h-11 justify-self-end sm:min-h-0",
|
|
262
|
+
className
|
|
263
|
+
),
|
|
264
|
+
...props,
|
|
265
|
+
children: children ?? "Skip"
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
function QuestionnaireNext({
|
|
270
|
+
children,
|
|
271
|
+
className,
|
|
272
|
+
size = "default",
|
|
273
|
+
variant = "default",
|
|
274
|
+
...props
|
|
275
|
+
}) {
|
|
276
|
+
return /* @__PURE__ */ jsx(
|
|
277
|
+
QuestionnairePrimitive.Next,
|
|
278
|
+
{
|
|
279
|
+
"data-slot": "questionnaire-next",
|
|
280
|
+
"data-size": size,
|
|
281
|
+
"data-variant": variant,
|
|
282
|
+
className: cn(
|
|
283
|
+
buttonVariants({ size, variant }),
|
|
284
|
+
"col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
|
|
285
|
+
className
|
|
286
|
+
),
|
|
287
|
+
...props,
|
|
288
|
+
children: children ?? "Next"
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
function QuestionnaireSubmit({
|
|
293
|
+
children,
|
|
294
|
+
className,
|
|
295
|
+
size = "default",
|
|
296
|
+
variant = "default",
|
|
297
|
+
...props
|
|
298
|
+
}) {
|
|
299
|
+
return /* @__PURE__ */ jsx(
|
|
300
|
+
QuestionnairePrimitive.Submit,
|
|
301
|
+
{
|
|
302
|
+
"data-slot": "questionnaire-submit",
|
|
303
|
+
"data-size": size,
|
|
304
|
+
"data-variant": variant,
|
|
305
|
+
className: cn(
|
|
306
|
+
buttonVariants({ size, variant }),
|
|
307
|
+
"col-start-3 row-start-1 min-h-11 justify-self-end sm:min-h-0",
|
|
308
|
+
className
|
|
309
|
+
),
|
|
310
|
+
...props,
|
|
311
|
+
children: children ?? "Submit"
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
export {
|
|
316
|
+
Questionnaire,
|
|
317
|
+
QuestionnaireActions,
|
|
318
|
+
QuestionnaireChoice,
|
|
319
|
+
QuestionnaireChoiceDescription,
|
|
320
|
+
QuestionnaireChoices,
|
|
321
|
+
QuestionnaireDescription,
|
|
322
|
+
QuestionnaireError,
|
|
323
|
+
QuestionnaireInput,
|
|
324
|
+
QuestionnaireItem,
|
|
325
|
+
QuestionnaireNext,
|
|
326
|
+
QuestionnairePrevious,
|
|
327
|
+
QuestionnaireProgress,
|
|
328
|
+
QuestionnaireSkip,
|
|
329
|
+
QuestionnaireSubmit,
|
|
330
|
+
QuestionnaireTitle
|
|
331
|
+
};
|