rockin 0.0.33 → 0.0.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/dist/chunk-3CZ2LLUN.js +198 -0
- package/dist/{chunk-7ZCRGTLA.js → chunk-54ZJAEO5.js} +5 -5
- package/dist/chunk-5GM3YR42.js +228 -0
- package/dist/chunk-6XUTSMTJ.js +183 -0
- package/dist/chunk-7JJBATB2.js +35 -0
- package/dist/chunk-BITCJZQZ.js +31 -0
- package/dist/chunk-COPQJFDI.js +158 -0
- package/dist/chunk-D6TULSM6.js +785 -0
- package/dist/chunk-DVNTJNDP.js +55 -0
- package/dist/chunk-EKDBYSMI.js +87 -0
- package/dist/chunk-FGWWRPMR.js +71 -0
- package/dist/chunk-G233W3IR.js +17 -0
- package/dist/chunk-G4NDAZTB.js +13 -0
- package/dist/chunk-GY2BX5SK.js +26 -0
- package/dist/chunk-MZBLIA6C.js +20 -0
- package/dist/chunk-OSVLAX37.js +101 -0
- package/dist/chunk-PRGKTXJU.js +20 -0
- package/dist/chunk-RUKQ532H.js +253 -0
- package/dist/chunk-S4H2HENE.js +113 -0
- package/dist/chunk-UHZTEDHK.js +61 -0
- package/dist/chunk-VFDNWPOI.js +293 -0
- package/dist/chunk-W4EIJWHF.js +150 -0
- package/dist/hooks/index.js +23 -16
- package/dist/index.js +4 -4
- package/dist/provider.js +3 -3
- package/dist/ui/accordion.js +95 -0
- package/dist/ui/alert-dialog.js +178 -0
- package/dist/ui/apple/english.js +7 -0
- package/dist/ui/apple/hindi.js +7 -0
- package/dist/ui/apple/index.js +52 -0
- package/dist/ui/apple/spanish.js +7 -0
- package/dist/ui/ariakit.js +7 -0
- package/dist/ui/autocomplete.js +296 -0
- package/dist/ui/avatar.js +106 -0
- package/dist/ui/badge.js +50 -0
- package/dist/ui/bridge.js +109 -0
- package/dist/ui/bubble.js +118 -0
- package/dist/ui/button-group.js +14 -0
- package/dist/ui/button.js +9 -0
- package/dist/ui/card.js +102 -0
- package/dist/ui/carousel.js +205 -0
- package/dist/ui/chart.js +253 -0
- package/dist/ui/checkbox.js +34 -0
- package/dist/ui/code-block.js +128 -0
- package/dist/ui/combobox.js +41 -0
- package/dist/ui/command.js +199 -0
- package/dist/ui/dashed.js +57 -0
- package/dist/ui/data-table/index.js +233 -0
- package/dist/ui/dialog.js +26 -0
- package/dist/ui/dock.js +86 -0
- package/dist/ui/drawer.js +216 -0
- package/dist/ui/dropdown-menu.js +35 -0
- package/dist/ui/empty.js +17 -0
- package/dist/ui/farmer/div.js +38 -0
- package/dist/ui/farmer/variants.js +314 -0
- package/dist/ui/field.js +224 -0
- package/dist/ui/filters.js +1524 -0
- package/dist/ui/image.js +88 -0
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +57 -8502
- package/dist/ui/input-group.js +20 -0
- package/dist/ui/input-otp.js +83 -0
- package/dist/ui/input.js +7 -0
- package/dist/ui/item.js +200 -0
- package/dist/ui/jelly.js +30 -0
- package/dist/ui/kbd.js +9 -0
- package/dist/ui/label.js +7 -0
- package/dist/ui/message-scroller.js +122 -0
- package/dist/ui/message.js +93 -0
- package/dist/ui/numberstepper.js +416 -0
- package/dist/ui/otp.js +403 -0
- package/dist/ui/popover.js +83 -0
- package/dist/ui/qr-code.js +124 -0
- package/dist/ui/quantity.js +48 -0
- package/dist/ui/radio-group.js +42 -0
- package/dist/ui/resizable.js +52 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/select.js +194 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/skeleton.js +25 -0
- package/dist/ui/sonner.js +22 -0
- package/dist/ui/sortable.js +503 -0
- package/dist/ui/swipe-actions.js +45 -0
- package/dist/ui/switch.js +34 -0
- package/dist/ui/textarea.js +7 -0
- package/dist/ui/theme-toggle.js +141 -0
- package/dist/ui/tooltip.js +13 -0
- package/package.json +1 -1
- package/dist/chunk-4KFB6AJH.js +0 -1330
- /package/dist/{chunk-FYFBWCMJ.js → chunk-GBVAFFZR.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Provider,
|
|
4
4
|
browserThemeColors
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-54ZJAEO5.js";
|
|
6
|
+
import "./chunk-GBVAFFZR.js";
|
|
7
7
|
import {
|
|
8
8
|
TopLoader
|
|
9
9
|
} from "./chunk-3ZGQJTWY.js";
|
|
10
|
-
import "./chunk-FYFBWCMJ.js";
|
|
11
|
-
import "./chunk-ATPUW3SQ.js";
|
|
12
10
|
import {
|
|
13
11
|
BellIcon,
|
|
14
12
|
IconSwap,
|
|
15
13
|
Loader
|
|
16
14
|
} from "./chunk-5QSYZSVL.js";
|
|
15
|
+
import "./chunk-RT2YVQ2Y.js";
|
|
16
|
+
import "./chunk-ATPUW3SQ.js";
|
|
17
17
|
|
|
18
18
|
// src/index.ts
|
|
19
19
|
import { default as default2 } from "@number-flow/react";
|
package/dist/provider.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Provider,
|
|
4
4
|
browserThemeColors
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-54ZJAEO5.js";
|
|
6
|
+
import "./chunk-GBVAFFZR.js";
|
|
7
7
|
import "./chunk-3ZGQJTWY.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-RT2YVQ2Y.js";
|
|
9
9
|
import "./chunk-ATPUW3SQ.js";
|
|
10
10
|
export {
|
|
11
11
|
Provider,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/ui/accordion.tsx
|
|
4
|
+
import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
import { ChevronDown, ChevronUp } from "@gravity-ui/icons";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Accordion({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
AccordionPrimitive.Root,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "accordion",
|
|
13
|
+
className: cn("flex w-full flex-col", className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function AccordionItem({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
AccordionPrimitive.Item,
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "accordion-item",
|
|
23
|
+
className: cn("not-last:border-b", className),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
function AccordionTrigger({
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
endContent,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
return /* @__PURE__ */ jsxs(AccordionPrimitive.Header, { className: "flex items-center", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(
|
|
36
|
+
AccordionPrimitive.Trigger,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "accordion-trigger",
|
|
39
|
+
className: cn(
|
|
40
|
+
"group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
children,
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
ChevronDown,
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "accordion-trigger-icon",
|
|
50
|
+
className: "pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
ChevronUp,
|
|
55
|
+
{
|
|
56
|
+
"data-slot": "accordion-trigger-icon",
|
|
57
|
+
className: "pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
endContent ? /* @__PURE__ */ jsx("div", { className: cn("flex shrink-0 items-center gap-2", className), children: endContent }) : null
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
function AccordionContent({
|
|
67
|
+
className,
|
|
68
|
+
children,
|
|
69
|
+
...props
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
AccordionPrimitive.Panel,
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "accordion-content",
|
|
75
|
+
className: "overflow-hidden text-sm data-open:animate-accordion-down data-closed:animate-accordion-up",
|
|
76
|
+
...props,
|
|
77
|
+
children: /* @__PURE__ */ jsx(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: cn(
|
|
81
|
+
"h-(--accordion-panel-height) pt-0 pb-2.5 data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
children
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
Accordion,
|
|
92
|
+
AccordionContent,
|
|
93
|
+
AccordionItem,
|
|
94
|
+
AccordionTrigger
|
|
95
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "../chunk-DVNTJNDP.js";
|
|
5
|
+
|
|
6
|
+
// src/ui/alert-dialog.tsx
|
|
7
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
8
|
+
import { cn } from "cn";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
function AlertDialog({ ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
12
|
+
}
|
|
13
|
+
function AlertDialogTrigger({ ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
15
|
+
}
|
|
16
|
+
function AlertDialogPortal({ ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
18
|
+
}
|
|
19
|
+
function AlertDialogOverlay({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
AlertDialogPrimitive.Backdrop,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "alert-dialog-overlay",
|
|
27
|
+
className: cn(
|
|
28
|
+
"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",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function AlertDialogContent({
|
|
36
|
+
className,
|
|
37
|
+
size = "default",
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
41
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
AlertDialogPrimitive.Popup,
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "alert-dialog-content",
|
|
46
|
+
"data-size": size,
|
|
47
|
+
className: cn(
|
|
48
|
+
"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-background 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",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] });
|
|
55
|
+
}
|
|
56
|
+
function AlertDialogHeader({
|
|
57
|
+
className,
|
|
58
|
+
...props
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "alert-dialog-header",
|
|
64
|
+
className: cn(
|
|
65
|
+
"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]",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function AlertDialogFooter({
|
|
73
|
+
className,
|
|
74
|
+
...props
|
|
75
|
+
}) {
|
|
76
|
+
return /* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
"data-slot": "alert-dialog-footer",
|
|
80
|
+
className: cn(
|
|
81
|
+
"-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",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
function AlertDialogMedia({
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}) {
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
"data-slot": "alert-dialog-media",
|
|
96
|
+
className: cn(
|
|
97
|
+
"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",
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function AlertDialogTitle({
|
|
105
|
+
className,
|
|
106
|
+
...props
|
|
107
|
+
}) {
|
|
108
|
+
return /* @__PURE__ */ jsx(
|
|
109
|
+
AlertDialogPrimitive.Title,
|
|
110
|
+
{
|
|
111
|
+
"data-slot": "alert-dialog-title",
|
|
112
|
+
className: cn(
|
|
113
|
+
"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",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function AlertDialogDescription({
|
|
121
|
+
className,
|
|
122
|
+
...props
|
|
123
|
+
}) {
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
AlertDialogPrimitive.Description,
|
|
126
|
+
{
|
|
127
|
+
"data-slot": "alert-dialog-description",
|
|
128
|
+
className: cn(
|
|
129
|
+
"text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function AlertDialogAction({
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}) {
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
Button,
|
|
142
|
+
{
|
|
143
|
+
"data-slot": "alert-dialog-action",
|
|
144
|
+
className: cn(className),
|
|
145
|
+
...props
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function AlertDialogCancel({
|
|
150
|
+
className,
|
|
151
|
+
variant = "outline",
|
|
152
|
+
size = "default",
|
|
153
|
+
...props
|
|
154
|
+
}) {
|
|
155
|
+
return /* @__PURE__ */ jsx(
|
|
156
|
+
AlertDialogPrimitive.Close,
|
|
157
|
+
{
|
|
158
|
+
"data-slot": "alert-dialog-cancel",
|
|
159
|
+
className: cn(className),
|
|
160
|
+
render: /* @__PURE__ */ jsx(Button, { variant, size }),
|
|
161
|
+
...props
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
AlertDialog,
|
|
167
|
+
AlertDialogAction,
|
|
168
|
+
AlertDialogCancel,
|
|
169
|
+
AlertDialogContent,
|
|
170
|
+
AlertDialogDescription,
|
|
171
|
+
AlertDialogFooter,
|
|
172
|
+
AlertDialogHeader,
|
|
173
|
+
AlertDialogMedia,
|
|
174
|
+
AlertDialogOverlay,
|
|
175
|
+
AlertDialogPortal,
|
|
176
|
+
AlertDialogTitle,
|
|
177
|
+
AlertDialogTrigger
|
|
178
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
AppleHelloEffectSpanish
|
|
4
|
+
} from "../../chunk-S4H2HENE.js";
|
|
5
|
+
import {
|
|
6
|
+
AppleHelloEffectEnglish
|
|
7
|
+
} from "../../chunk-FGWWRPMR.js";
|
|
8
|
+
import {
|
|
9
|
+
AppleHelloEffectHindi
|
|
10
|
+
} from "../../chunk-6XUTSMTJ.js";
|
|
11
|
+
|
|
12
|
+
// src/ui/apple/index.tsx
|
|
13
|
+
import { AnimatePresence } from "motion/react";
|
|
14
|
+
import { useState } from "react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function Apple() {
|
|
17
|
+
const [index, setIndex] = useState(0);
|
|
18
|
+
const handleAnimationEnd = () => {
|
|
19
|
+
setIndex((prevIndex) => (prevIndex + 1) % 3);
|
|
20
|
+
};
|
|
21
|
+
const demos = [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
AppleHelloEffectHindi,
|
|
24
|
+
{
|
|
25
|
+
onAnimationComplete: handleAnimationEnd
|
|
26
|
+
},
|
|
27
|
+
"hindi"
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
AppleHelloEffectEnglish,
|
|
31
|
+
{
|
|
32
|
+
onAnimationComplete: handleAnimationEnd
|
|
33
|
+
},
|
|
34
|
+
"english"
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
AppleHelloEffectSpanish,
|
|
38
|
+
{
|
|
39
|
+
durationScale: 0.8,
|
|
40
|
+
onAnimationComplete: handleAnimationEnd
|
|
41
|
+
},
|
|
42
|
+
"spanish"
|
|
43
|
+
)
|
|
44
|
+
];
|
|
45
|
+
return /* @__PURE__ */ jsx("main", { className: "m-auto flex grow items-center justify-center", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: demos[index] }) });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
Apple,
|
|
49
|
+
AppleHelloEffectEnglish,
|
|
50
|
+
AppleHelloEffectHindi,
|
|
51
|
+
AppleHelloEffectSpanish
|
|
52
|
+
};
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ScrollArea
|
|
4
|
+
} from "../chunk-UHZTEDHK.js";
|
|
5
|
+
import {
|
|
6
|
+
Input
|
|
7
|
+
} from "../chunk-7JJBATB2.js";
|
|
8
|
+
|
|
9
|
+
// src/ui/autocomplete.tsx
|
|
10
|
+
import { cn } from "cn";
|
|
11
|
+
import { Autocomplete as AutocompletePrimitive } from "@base-ui/react/autocomplete";
|
|
12
|
+
import { ChevronsExpandVertical, Xmark } from "@gravity-ui/icons";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
var Autocomplete = AutocompletePrimitive.Root;
|
|
15
|
+
function AutocompleteInput({
|
|
16
|
+
className,
|
|
17
|
+
showTrigger = false,
|
|
18
|
+
showClear = false,
|
|
19
|
+
startAddon,
|
|
20
|
+
size,
|
|
21
|
+
triggerProps,
|
|
22
|
+
clearProps,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const sizeValue = size ?? "default";
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
AutocompletePrimitive.InputGroup,
|
|
28
|
+
{
|
|
29
|
+
className: "relative w-full text-foreground not-has-[>*.w-full]:w-fit has-disabled:opacity-64",
|
|
30
|
+
"data-slot": "autocomplete-input-group",
|
|
31
|
+
children: [
|
|
32
|
+
startAddon && /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
"aria-hidden": "true",
|
|
36
|
+
className: "pointer-events-none absolute inset-y-0 inset-s-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg]:-mx-0.5 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
|
|
37
|
+
"data-slot": "autocomplete-start-addon",
|
|
38
|
+
children: startAddon
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
AutocompletePrimitive.Input,
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
startAddon && "*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)]",
|
|
46
|
+
sizeValue === "sm" ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
"data-slot": "autocomplete-input",
|
|
50
|
+
render: /* @__PURE__ */ jsx(Input, {}),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
showTrigger && /* @__PURE__ */ jsx(
|
|
55
|
+
AutocompleteTrigger,
|
|
56
|
+
{
|
|
57
|
+
className: cn(
|
|
58
|
+
"absolute top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 transition-colors outline-none hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
|
|
59
|
+
sizeValue === "sm" ? "inset-e-0" : "inset-e-0.5"
|
|
60
|
+
),
|
|
61
|
+
...triggerProps,
|
|
62
|
+
children: /* @__PURE__ */ jsx(AutocompletePrimitive.Icon, { "data-slot": "autocomplete-icon", children: /* @__PURE__ */ jsx(ChevronsExpandVertical, {}) })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
showClear && /* @__PURE__ */ jsx(
|
|
66
|
+
AutocompleteClear,
|
|
67
|
+
{
|
|
68
|
+
className: cn(
|
|
69
|
+
"absolute top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 transition-colors outline-none hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
|
|
70
|
+
sizeValue === "sm" ? "inset-e-0" : "inset-e-0.5"
|
|
71
|
+
),
|
|
72
|
+
...clearProps,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Xmark, {})
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function AutocompletePopup({
|
|
81
|
+
className,
|
|
82
|
+
children,
|
|
83
|
+
side = "bottom",
|
|
84
|
+
sideOffset = 4,
|
|
85
|
+
alignOffset,
|
|
86
|
+
align = "start",
|
|
87
|
+
anchor,
|
|
88
|
+
portalProps,
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
return /* @__PURE__ */ jsx(AutocompletePrimitive.Portal, { ...portalProps, children: /* @__PURE__ */ jsx(
|
|
92
|
+
AutocompletePrimitive.Positioner,
|
|
93
|
+
{
|
|
94
|
+
align,
|
|
95
|
+
alignOffset,
|
|
96
|
+
anchor,
|
|
97
|
+
className: "z-50 select-none",
|
|
98
|
+
"data-slot": "autocomplete-positioner",
|
|
99
|
+
side,
|
|
100
|
+
sideOffset,
|
|
101
|
+
children: /* @__PURE__ */ jsx(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
className: cn(
|
|
105
|
+
"relative flex max-h-full max-w-(--available-width) min-w-(--anchor-width) origin-(--transform-origin) rounded-lg border bg-background shadow-lg/5 transition-[scale,opacity] not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
|
|
106
|
+
className
|
|
107
|
+
),
|
|
108
|
+
children: /* @__PURE__ */ jsx(
|
|
109
|
+
AutocompletePrimitive.Popup,
|
|
110
|
+
{
|
|
111
|
+
className: "flex max-h-[min(var(--available-height),23rem)] flex-1 flex-col text-foreground",
|
|
112
|
+
"data-slot": "autocomplete-popup",
|
|
113
|
+
...props,
|
|
114
|
+
children
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
) });
|
|
121
|
+
}
|
|
122
|
+
function AutocompleteItem({
|
|
123
|
+
className,
|
|
124
|
+
children,
|
|
125
|
+
...props
|
|
126
|
+
}) {
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
AutocompletePrimitive.Item,
|
|
129
|
+
{
|
|
130
|
+
className: cn(
|
|
131
|
+
"flex min-h-8 cursor-default items-center rounded-sm px-2 py-1 text-base outline-none select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground sm:min-h-7 sm:text-sm data-disabled:pointer-events-none data-disabled:opacity-64",
|
|
132
|
+
className
|
|
133
|
+
),
|
|
134
|
+
"data-slot": "autocomplete-item",
|
|
135
|
+
...props,
|
|
136
|
+
children
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
function AutocompleteSeparator({
|
|
141
|
+
className,
|
|
142
|
+
...props
|
|
143
|
+
}) {
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
145
|
+
AutocompletePrimitive.Separator,
|
|
146
|
+
{
|
|
147
|
+
className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
|
|
148
|
+
"data-slot": "autocomplete-separator",
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
function AutocompleteGroup({
|
|
154
|
+
className,
|
|
155
|
+
...props
|
|
156
|
+
}) {
|
|
157
|
+
return /* @__PURE__ */ jsx(
|
|
158
|
+
AutocompletePrimitive.Group,
|
|
159
|
+
{
|
|
160
|
+
className: cn("[[role=group]+&]:mt-1.5", className),
|
|
161
|
+
"data-slot": "autocomplete-group",
|
|
162
|
+
...props
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function AutocompleteGroupLabel({
|
|
167
|
+
className,
|
|
168
|
+
...props
|
|
169
|
+
}) {
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
AutocompletePrimitive.GroupLabel,
|
|
172
|
+
{
|
|
173
|
+
className: cn(
|
|
174
|
+
"px-2 py-1.5 text-xs font-medium text-muted-foreground",
|
|
175
|
+
className
|
|
176
|
+
),
|
|
177
|
+
"data-slot": "autocomplete-group-label",
|
|
178
|
+
...props
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function AutocompleteEmpty({
|
|
183
|
+
className,
|
|
184
|
+
...props
|
|
185
|
+
}) {
|
|
186
|
+
return /* @__PURE__ */ jsx(
|
|
187
|
+
AutocompletePrimitive.Empty,
|
|
188
|
+
{
|
|
189
|
+
className: cn(
|
|
190
|
+
"text-center text-base text-muted-foreground not-empty:p-2 sm:text-sm",
|
|
191
|
+
className
|
|
192
|
+
),
|
|
193
|
+
"data-slot": "autocomplete-empty",
|
|
194
|
+
...props
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function AutocompleteRow({
|
|
199
|
+
className,
|
|
200
|
+
...props
|
|
201
|
+
}) {
|
|
202
|
+
return /* @__PURE__ */ jsx(
|
|
203
|
+
AutocompletePrimitive.Row,
|
|
204
|
+
{
|
|
205
|
+
className,
|
|
206
|
+
"data-slot": "autocomplete-row",
|
|
207
|
+
...props
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
var AutocompleteValue = AutocompletePrimitive.Value;
|
|
212
|
+
function AutocompleteList({
|
|
213
|
+
className,
|
|
214
|
+
...props
|
|
215
|
+
}) {
|
|
216
|
+
return /* @__PURE__ */ jsx(ScrollArea, { children: /* @__PURE__ */ jsx(
|
|
217
|
+
AutocompletePrimitive.List,
|
|
218
|
+
{
|
|
219
|
+
className: cn(
|
|
220
|
+
"not-empty:scroll-py-1 not-empty:p-1 in-data-has-overflow-y:pe-3",
|
|
221
|
+
className
|
|
222
|
+
),
|
|
223
|
+
"data-slot": "autocomplete-list",
|
|
224
|
+
...props
|
|
225
|
+
}
|
|
226
|
+
) });
|
|
227
|
+
}
|
|
228
|
+
function AutocompleteClear({
|
|
229
|
+
className,
|
|
230
|
+
...props
|
|
231
|
+
}) {
|
|
232
|
+
return /* @__PURE__ */ jsx(
|
|
233
|
+
AutocompletePrimitive.Clear,
|
|
234
|
+
{
|
|
235
|
+
className: cn(
|
|
236
|
+
"absolute inset-e-0.5 top-1/2 inline-flex size-8 shrink-0 -translate-y-1/2 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 transition-[color,background-color,box-shadow,opacity] outline-none hover:opacity-100 sm:size-7 pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
|
|
237
|
+
className
|
|
238
|
+
),
|
|
239
|
+
"data-slot": "autocomplete-clear",
|
|
240
|
+
...props,
|
|
241
|
+
children: /* @__PURE__ */ jsx(Xmark, {})
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
function AutocompleteStatus({
|
|
246
|
+
className,
|
|
247
|
+
...props
|
|
248
|
+
}) {
|
|
249
|
+
return /* @__PURE__ */ jsx(
|
|
250
|
+
AutocompletePrimitive.Status,
|
|
251
|
+
{
|
|
252
|
+
className: cn(
|
|
253
|
+
"px-3 py-2 text-xs font-medium text-muted-foreground empty:m-0 empty:p-0",
|
|
254
|
+
className
|
|
255
|
+
),
|
|
256
|
+
"data-slot": "autocomplete-status",
|
|
257
|
+
...props
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
var AutocompleteCollection = AutocompletePrimitive.Collection;
|
|
262
|
+
function AutocompleteTrigger({
|
|
263
|
+
className,
|
|
264
|
+
children,
|
|
265
|
+
...props
|
|
266
|
+
}) {
|
|
267
|
+
return /* @__PURE__ */ jsx(
|
|
268
|
+
AutocompletePrimitive.Trigger,
|
|
269
|
+
{
|
|
270
|
+
className,
|
|
271
|
+
"data-slot": "autocomplete-trigger",
|
|
272
|
+
...props,
|
|
273
|
+
children
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
var useAutocompleteFilter = AutocompletePrimitive.useFilter;
|
|
278
|
+
export {
|
|
279
|
+
Autocomplete,
|
|
280
|
+
AutocompleteClear,
|
|
281
|
+
AutocompleteCollection,
|
|
282
|
+
AutocompleteEmpty,
|
|
283
|
+
AutocompleteGroup,
|
|
284
|
+
AutocompleteGroupLabel,
|
|
285
|
+
AutocompleteInput,
|
|
286
|
+
AutocompleteItem,
|
|
287
|
+
AutocompleteList,
|
|
288
|
+
AutocompletePopup,
|
|
289
|
+
AutocompletePrimitive,
|
|
290
|
+
AutocompleteRow,
|
|
291
|
+
AutocompleteSeparator,
|
|
292
|
+
AutocompleteStatus,
|
|
293
|
+
AutocompleteTrigger,
|
|
294
|
+
AutocompleteValue,
|
|
295
|
+
useAutocompleteFilter
|
|
296
|
+
};
|