rockin 0.0.34 → 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.
Files changed (90) hide show
  1. package/dist/chunk-3CZ2LLUN.js +198 -0
  2. package/dist/{chunk-7ZCRGTLA.js → chunk-54ZJAEO5.js} +5 -5
  3. package/dist/chunk-5GM3YR42.js +228 -0
  4. package/dist/chunk-6XUTSMTJ.js +183 -0
  5. package/dist/chunk-7JJBATB2.js +35 -0
  6. package/dist/chunk-BITCJZQZ.js +31 -0
  7. package/dist/chunk-COPQJFDI.js +158 -0
  8. package/dist/chunk-D6TULSM6.js +785 -0
  9. package/dist/chunk-DVNTJNDP.js +55 -0
  10. package/dist/chunk-EKDBYSMI.js +87 -0
  11. package/dist/chunk-FGWWRPMR.js +71 -0
  12. package/dist/chunk-G233W3IR.js +17 -0
  13. package/dist/chunk-G4NDAZTB.js +13 -0
  14. package/dist/chunk-GY2BX5SK.js +26 -0
  15. package/dist/chunk-MZBLIA6C.js +20 -0
  16. package/dist/chunk-OSVLAX37.js +101 -0
  17. package/dist/chunk-PRGKTXJU.js +20 -0
  18. package/dist/chunk-RUKQ532H.js +253 -0
  19. package/dist/chunk-S4H2HENE.js +113 -0
  20. package/dist/chunk-UHZTEDHK.js +61 -0
  21. package/dist/chunk-VFDNWPOI.js +293 -0
  22. package/dist/chunk-W4EIJWHF.js +150 -0
  23. package/dist/hooks/index.js +18 -9
  24. package/dist/index.js +4 -4
  25. package/dist/provider.js +3 -3
  26. package/dist/ui/accordion.js +95 -0
  27. package/dist/ui/alert-dialog.js +178 -0
  28. package/dist/ui/apple/english.js +7 -0
  29. package/dist/ui/apple/hindi.js +7 -0
  30. package/dist/ui/apple/index.js +52 -0
  31. package/dist/ui/apple/spanish.js +7 -0
  32. package/dist/ui/ariakit.js +7 -0
  33. package/dist/ui/autocomplete.js +296 -0
  34. package/dist/ui/avatar.js +106 -0
  35. package/dist/ui/badge.js +50 -0
  36. package/dist/ui/bridge.js +109 -0
  37. package/dist/ui/bubble.js +118 -0
  38. package/dist/ui/button-group.js +14 -0
  39. package/dist/ui/button.js +9 -0
  40. package/dist/ui/card.js +102 -0
  41. package/dist/ui/carousel.js +205 -0
  42. package/dist/ui/chart.js +253 -0
  43. package/dist/ui/checkbox.js +34 -0
  44. package/dist/ui/code-block.js +128 -0
  45. package/dist/ui/combobox.js +41 -0
  46. package/dist/ui/command.js +199 -0
  47. package/dist/ui/dashed.js +57 -0
  48. package/dist/ui/data-table/index.js +233 -0
  49. package/dist/ui/dialog.js +26 -0
  50. package/dist/ui/dock.js +86 -0
  51. package/dist/ui/drawer.js +216 -0
  52. package/dist/ui/dropdown-menu.js +35 -0
  53. package/dist/ui/empty.js +17 -0
  54. package/dist/ui/farmer/div.js +38 -0
  55. package/dist/ui/farmer/variants.js +314 -0
  56. package/dist/ui/field.js +224 -0
  57. package/dist/ui/filters.js +1524 -0
  58. package/dist/ui/image.js +88 -0
  59. package/dist/ui/index.d.ts +1 -1
  60. package/dist/ui/index.js +57 -8502
  61. package/dist/ui/input-group.js +20 -0
  62. package/dist/ui/input-otp.js +83 -0
  63. package/dist/ui/input.js +7 -0
  64. package/dist/ui/item.js +200 -0
  65. package/dist/ui/jelly.js +30 -0
  66. package/dist/ui/kbd.js +9 -0
  67. package/dist/ui/label.js +7 -0
  68. package/dist/ui/message-scroller.js +122 -0
  69. package/dist/ui/message.js +93 -0
  70. package/dist/ui/numberstepper.js +416 -0
  71. package/dist/ui/otp.js +403 -0
  72. package/dist/ui/popover.js +83 -0
  73. package/dist/ui/qr-code.js +124 -0
  74. package/dist/ui/quantity.js +48 -0
  75. package/dist/ui/radio-group.js +42 -0
  76. package/dist/ui/resizable.js +52 -0
  77. package/dist/ui/scroll-area.js +9 -0
  78. package/dist/ui/select.js +194 -0
  79. package/dist/ui/separator.js +7 -0
  80. package/dist/ui/skeleton.js +25 -0
  81. package/dist/ui/sonner.js +22 -0
  82. package/dist/ui/sortable.js +503 -0
  83. package/dist/ui/swipe-actions.js +45 -0
  84. package/dist/ui/switch.js +34 -0
  85. package/dist/ui/textarea.js +7 -0
  86. package/dist/ui/theme-toggle.js +141 -0
  87. package/dist/ui/tooltip.js +13 -0
  88. package/package.json +1 -1
  89. package/dist/chunk-4KFB6AJH.js +0 -1330
  90. /package/dist/{chunk-FYFBWCMJ.js → chunk-GBVAFFZR.js} +0 -0
@@ -0,0 +1,199 @@
1
+ "use client";
2
+ import {
3
+ Dialog,
4
+ DialogContent,
5
+ DialogDescription,
6
+ DialogHeader,
7
+ DialogTitle
8
+ } from "../chunk-W4EIJWHF.js";
9
+ import {
10
+ InputGroup,
11
+ InputGroupAddon
12
+ } from "../chunk-COPQJFDI.js";
13
+ import "../chunk-MZBLIA6C.js";
14
+ import "../chunk-7JJBATB2.js";
15
+ import "../chunk-DVNTJNDP.js";
16
+
17
+ // src/ui/command.tsx
18
+ import { Command as CommandPrimitive, useCommandState } from "cmdk";
19
+ import { cn } from "cn";
20
+ import { Magnifier } from "@gravity-ui/icons";
21
+ import { jsx, jsxs } from "react/jsx-runtime";
22
+ function Command({
23
+ className,
24
+ ...props
25
+ }) {
26
+ return /* @__PURE__ */ jsx(
27
+ CommandPrimitive,
28
+ {
29
+ "data-slot": "command",
30
+ className: cn(
31
+ "flex size-full flex-col overflow-hidden rounded-xl! bg-background text-popover-foreground outline-none",
32
+ className
33
+ ),
34
+ ...props
35
+ }
36
+ );
37
+ }
38
+ function CommandDialog({
39
+ title = "Command Palette",
40
+ description = "Search for a command to run...",
41
+ children,
42
+ className,
43
+ showCloseButton = false,
44
+ ...props
45
+ }) {
46
+ return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
47
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
48
+ /* @__PURE__ */ jsx(DialogTitle, { children: title }),
49
+ /* @__PURE__ */ jsx(DialogDescription, { children: description })
50
+ ] }),
51
+ /* @__PURE__ */ jsx(
52
+ DialogContent,
53
+ {
54
+ className: cn(
55
+ "top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
56
+ className
57
+ ),
58
+ showCloseButton,
59
+ children
60
+ }
61
+ )
62
+ ] });
63
+ }
64
+ function CommandInput({
65
+ className,
66
+ startContent,
67
+ endContent,
68
+ focusAddon = true,
69
+ ...props
70
+ }) {
71
+ return /* @__PURE__ */ jsxs(
72
+ InputGroup,
73
+ {
74
+ "data-slot": "command-input-wrapper",
75
+ className: cn(
76
+ "h-8! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",
77
+ className
78
+ ),
79
+ children: [
80
+ startContent ? /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-start", focusInput: false, children: startContent }) : null,
81
+ /* @__PURE__ */ jsx(InputGroupAddon, { focusInput: focusAddon, children: /* @__PURE__ */ jsx(Magnifier, {}) }),
82
+ /* @__PURE__ */ jsx(
83
+ CommandPrimitive.Input,
84
+ {
85
+ "data-no-ring": true,
86
+ "data-slot": "command-input",
87
+ className: "w-full outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
88
+ ...props
89
+ }
90
+ ),
91
+ endContent ? /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", focusInput: false, children: endContent }) : null
92
+ ]
93
+ }
94
+ );
95
+ }
96
+ function CommandList({
97
+ className,
98
+ ...props
99
+ }) {
100
+ return /* @__PURE__ */ jsx(
101
+ CommandPrimitive.List,
102
+ {
103
+ "data-slot": "command-list",
104
+ className: cn(
105
+ "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
106
+ className
107
+ ),
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function CommandEmpty({
113
+ className,
114
+ ...props
115
+ }) {
116
+ return /* @__PURE__ */ jsx(
117
+ CommandPrimitive.Empty,
118
+ {
119
+ "data-slot": "command-empty",
120
+ className: cn("py-6 text-center text-sm", className),
121
+ ...props
122
+ }
123
+ );
124
+ }
125
+ function CommandGroup({
126
+ className,
127
+ ...props
128
+ }) {
129
+ return /* @__PURE__ */ jsx(
130
+ CommandPrimitive.Group,
131
+ {
132
+ "data-slot": "command-group",
133
+ className: cn(
134
+ "overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
135
+ className
136
+ ),
137
+ ...props
138
+ }
139
+ );
140
+ }
141
+ function CommandSeparator({
142
+ className,
143
+ ...props
144
+ }) {
145
+ return /* @__PURE__ */ jsx(
146
+ CommandPrimitive.Separator,
147
+ {
148
+ "data-slot": "command-separator",
149
+ className: cn("-mx-1 h-px bg-border", className),
150
+ ...props
151
+ }
152
+ );
153
+ }
154
+ function CommandItem({
155
+ className,
156
+ children,
157
+ ...props
158
+ }) {
159
+ return /* @__PURE__ */ jsx(
160
+ CommandPrimitive.Item,
161
+ {
162
+ "data-slot": "command-item",
163
+ className: cn(
164
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
165
+ className
166
+ ),
167
+ ...props,
168
+ children
169
+ }
170
+ );
171
+ }
172
+ function CommandShortcut({
173
+ className,
174
+ ...props
175
+ }) {
176
+ return /* @__PURE__ */ jsx(
177
+ "span",
178
+ {
179
+ "data-slot": "command-shortcut",
180
+ className: cn(
181
+ "ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
182
+ className
183
+ ),
184
+ ...props
185
+ }
186
+ );
187
+ }
188
+ export {
189
+ Command,
190
+ CommandDialog,
191
+ CommandEmpty,
192
+ CommandGroup,
193
+ CommandInput,
194
+ CommandItem,
195
+ CommandList,
196
+ CommandSeparator,
197
+ CommandShortcut,
198
+ useCommandState
199
+ };
@@ -0,0 +1,57 @@
1
+ "use client";
2
+
3
+ // src/ui/dashed.tsx
4
+ import * as React from "react";
5
+ import { cn } from "cn";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function DashedSeparator({
8
+ className,
9
+ dashWidth = 12,
10
+ minimumGap = 8,
11
+ thickness = 1
12
+ }) {
13
+ const containerRef = React.useRef(null);
14
+ const [dashCount, setDashCount] = React.useState(0);
15
+ React.useEffect(() => {
16
+ const element = containerRef.current;
17
+ if (!element) return;
18
+ const updateDashCount = () => {
19
+ const width = element.getBoundingClientRect().width;
20
+ const count = Math.max(
21
+ 2,
22
+ Math.floor((width + minimumGap) / (dashWidth + minimumGap))
23
+ );
24
+ setDashCount(count);
25
+ };
26
+ updateDashCount();
27
+ const observer = new ResizeObserver(updateDashCount);
28
+ observer.observe(element);
29
+ return () => observer.disconnect();
30
+ }, [dashWidth, minimumGap]);
31
+ return /* @__PURE__ */ jsx(
32
+ "div",
33
+ {
34
+ ref: containerRef,
35
+ "aria-hidden": "true",
36
+ className: cn(
37
+ "flex w-full items-center justify-between overflow-hidden text-border",
38
+ className
39
+ ),
40
+ style: { height: thickness },
41
+ children: Array.from({ length: dashCount }).map((_, index) => /* @__PURE__ */ jsx(
42
+ "span",
43
+ {
44
+ className: "shrink-0 bg-current",
45
+ style: {
46
+ width: dashWidth,
47
+ height: thickness
48
+ }
49
+ },
50
+ index
51
+ ))
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ DashedSeparator
57
+ };
@@ -0,0 +1,233 @@
1
+ "use client";
2
+ import {
3
+ Skeleton
4
+ } from "../../chunk-3CZ2LLUN.js";
5
+ import {
6
+ DataGrid,
7
+ DataGridCell,
8
+ DataGridClipboard,
9
+ DataGridColumn,
10
+ DataGridFillHandle,
11
+ DataGridMove,
12
+ DataGridRow,
13
+ DataTableColumnResize,
14
+ DataTableRoot,
15
+ GridAsyncComboboxCell,
16
+ GridComboboxCell,
17
+ GridNumberCell,
18
+ GridTextCell,
19
+ useDataTable,
20
+ useDataTablePagination,
21
+ useDataTableRows,
22
+ useDataTableSearch
23
+ } from "../../chunk-D6TULSM6.js";
24
+ import "../../chunk-VFDNWPOI.js";
25
+ import "../../chunk-COPQJFDI.js";
26
+ import "../../chunk-MZBLIA6C.js";
27
+ import {
28
+ Input
29
+ } from "../../chunk-7JJBATB2.js";
30
+ import {
31
+ Button
32
+ } from "../../chunk-DVNTJNDP.js";
33
+
34
+ // src/ui/data-table/core/data-table.tsx
35
+ import { cn } from "cn";
36
+ import { jsx } from "react/jsx-runtime";
37
+ function DataTable({
38
+ className,
39
+ children,
40
+ ...props
41
+ }) {
42
+ return /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ className: cn("overflow-x-auto rounded-lg border", className),
46
+ ...props,
47
+ children: /* @__PURE__ */ jsx("table", { className: "w-full text-sm", children })
48
+ }
49
+ );
50
+ }
51
+ function DataTableCell({
52
+ className,
53
+ ...props
54
+ }) {
55
+ return /* @__PURE__ */ jsx("td", { className: cn("px-3 py-2.5 align-middle", className), ...props });
56
+ }
57
+ function DataTableRow({
58
+ className,
59
+ ...props
60
+ }) {
61
+ return /* @__PURE__ */ jsx("tr", { className: cn("border-b last:border-0", className), ...props });
62
+ }
63
+ function DataTableRows() {
64
+ const { columns, pageData, getRowId } = useDataTable();
65
+ return /* @__PURE__ */ jsx("tbody", { children: pageData.map((row, rowIndex) => /* @__PURE__ */ jsx(DataTableRow, { children: columns.map((column, columnIndex) => {
66
+ const value = column.accessorFn ? column.accessorFn(row) : column.accessorKey ? row[column.accessorKey] : void 0;
67
+ return /* @__PURE__ */ jsx(
68
+ DataTableCell,
69
+ {
70
+ children: column.cell ? column.cell(value, row, rowIndex) : String(value ?? "\u2014")
71
+ },
72
+ column.id ?? column.accessorKey ?? columnIndex
73
+ );
74
+ }) }, getRowId(row, rowIndex))) });
75
+ }
76
+
77
+ // src/ui/data-table/core/data-table-structure.tsx
78
+ import { cn as cn2 } from "cn";
79
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
80
+ function DataTableHeader({ className }) {
81
+ const { columns } = useDataTable();
82
+ return /* @__PURE__ */ jsx2("thead", { className: cn2("bg-muted/60", className), children: /* @__PURE__ */ jsx2(DataTableRow, { children: columns.map((column, index) => /* @__PURE__ */ jsx2(
83
+ "th",
84
+ {
85
+ className: "px-3 py-2.5 text-left text-xs font-medium text-muted-foreground",
86
+ children: typeof column.header === "function" ? column.header(column) : column.header
87
+ },
88
+ column.id ?? column.accessorKey ?? index
89
+ )) }) });
90
+ }
91
+ function DataTableBody({ children }) {
92
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
93
+ /* @__PURE__ */ jsx2(DataTableRows, {}),
94
+ children
95
+ ] });
96
+ }
97
+ function DataTableSkeleton({ rows = 3 }) {
98
+ const { columns, isLoading } = useDataTable();
99
+ if (!isLoading) return null;
100
+ return /* @__PURE__ */ jsx2("tbody", { "aria-label": "Loading rows", children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ jsx2(DataTableRow, { children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx2(DataTableCell, { children: /* @__PURE__ */ jsx2(Skeleton, { className: "h-4" }) }, column.id ?? column.accessorKey ?? columnIndex)) }, rowIndex)) });
101
+ }
102
+ function DataTableEmptyBody({
103
+ children = "No results found."
104
+ }) {
105
+ const { pageData, isLoading } = useDataTable();
106
+ if (isLoading || pageData.length > 0) return null;
107
+ return /* @__PURE__ */ jsx2("tbody", { children: /* @__PURE__ */ jsx2(DataTableRow, { children: /* @__PURE__ */ jsx2(
108
+ DataTableCell,
109
+ {
110
+ className: "h-24 text-center text-muted-foreground",
111
+ colSpan: 100,
112
+ children
113
+ }
114
+ ) }) });
115
+ }
116
+
117
+ // src/ui/data-table/components/data-table-pagination.tsx
118
+ import { ChevronLeft, ChevronRight } from "lucide-react";
119
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
120
+ function DataTablePagination() {
121
+ const { totalRows } = useDataTableRows();
122
+ const {
123
+ pageIndex,
124
+ pageSize,
125
+ pageCount,
126
+ canPreviousPage,
127
+ canNextPage,
128
+ previousPage,
129
+ nextPage
130
+ } = useDataTablePagination();
131
+ const first = totalRows === 0 ? 0 : pageIndex * pageSize + 1;
132
+ const last = Math.min((pageIndex + 1) * pageSize, totalRows);
133
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between gap-3 text-sm text-muted-foreground", children: [
134
+ /* @__PURE__ */ jsx3("span", { children: totalRows ? `${first}\u2013${last} of ${totalRows}` : "0 results" }),
135
+ /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-1", children: [
136
+ /* @__PURE__ */ jsx3(
137
+ Button,
138
+ {
139
+ "aria-label": "Previous page",
140
+ disabled: !canPreviousPage,
141
+ onClick: previousPage,
142
+ size: "icon-sm",
143
+ variant: "outline",
144
+ children: /* @__PURE__ */ jsx3(ChevronLeft, {})
145
+ }
146
+ ),
147
+ /* @__PURE__ */ jsxs2("span", { className: "min-w-16 text-center text-xs", children: [
148
+ "Page ",
149
+ pageIndex + 1,
150
+ " of ",
151
+ pageCount
152
+ ] }),
153
+ /* @__PURE__ */ jsx3(
154
+ Button,
155
+ {
156
+ "aria-label": "Next page",
157
+ disabled: !canNextPage,
158
+ onClick: nextPage,
159
+ size: "icon-sm",
160
+ variant: "outline",
161
+ children: /* @__PURE__ */ jsx3(ChevronRight, {})
162
+ }
163
+ )
164
+ ] })
165
+ ] });
166
+ }
167
+
168
+ // src/ui/data-table/components/data-table-search-filter.tsx
169
+ import { Search } from "lucide-react";
170
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
171
+ function DataTableSearchFilter({
172
+ placeholder = "Search...",
173
+ className
174
+ }) {
175
+ const { search, setSearch } = useDataTableSearch();
176
+ return /* @__PURE__ */ jsxs3("div", { className: `relative w-full max-w-sm ${className ?? ""}`, children: [
177
+ /* @__PURE__ */ jsx4(Search, { className: "pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground" }),
178
+ /* @__PURE__ */ jsx4(
179
+ Input,
180
+ {
181
+ "aria-label": placeholder,
182
+ className: "pl-8",
183
+ onChange: (event) => setSearch(event.target.value),
184
+ placeholder,
185
+ value: search
186
+ }
187
+ )
188
+ ] });
189
+ }
190
+
191
+ // src/ui/data-table/components/data-table-toolbar-section.tsx
192
+ import { cn as cn3 } from "cn";
193
+ import { jsx as jsx5 } from "react/jsx-runtime";
194
+ function DataTableToolbarSection({
195
+ className,
196
+ ...props
197
+ }) {
198
+ return /* @__PURE__ */ jsx5(
199
+ "div",
200
+ {
201
+ className: cn3(
202
+ "flex flex-wrap items-center justify-between gap-2",
203
+ className
204
+ ),
205
+ ...props
206
+ }
207
+ );
208
+ }
209
+ export {
210
+ DataGrid,
211
+ DataGridCell,
212
+ DataGridClipboard,
213
+ DataGridColumn,
214
+ DataGridFillHandle,
215
+ DataGridMove,
216
+ DataGridRow,
217
+ DataTable,
218
+ DataTableBody,
219
+ DataTableCell,
220
+ DataTableColumnResize,
221
+ DataTableEmptyBody,
222
+ DataTableHeader,
223
+ DataTablePagination,
224
+ DataTableRoot,
225
+ DataTableRow,
226
+ DataTableSearchFilter,
227
+ DataTableSkeleton,
228
+ DataTableToolbarSection,
229
+ GridAsyncComboboxCell,
230
+ GridComboboxCell,
231
+ GridNumberCell,
232
+ GridTextCell
233
+ };
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import {
3
+ Dialog,
4
+ DialogClose,
5
+ DialogContent,
6
+ DialogDescription,
7
+ DialogFooter,
8
+ DialogHeader,
9
+ DialogOverlay,
10
+ DialogPortal,
11
+ DialogTitle,
12
+ DialogTrigger
13
+ } from "../chunk-W4EIJWHF.js";
14
+ import "../chunk-DVNTJNDP.js";
15
+ export {
16
+ Dialog,
17
+ DialogClose,
18
+ DialogContent,
19
+ DialogDescription,
20
+ DialogFooter,
21
+ DialogHeader,
22
+ DialogOverlay,
23
+ DialogPortal,
24
+ DialogTitle,
25
+ DialogTrigger
26
+ };
@@ -0,0 +1,86 @@
1
+ "use client";
2
+
3
+ // src/ui/dock.tsx
4
+ import { cn } from "cn";
5
+ import { motion } from "motion/react";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ var floatingAnimation = {
9
+ initial: { y: 0 },
10
+ animate: {
11
+ y: [-2, 2, -2],
12
+ transition: {
13
+ duration: 4,
14
+ repeat: Infinity,
15
+ ease: "easeInOut"
16
+ }
17
+ }
18
+ };
19
+ var DockIconButton = React.forwardRef(
20
+ ({ icon: Icon, label, onClick, className }, ref) => {
21
+ return /* @__PURE__ */ jsxs(
22
+ motion.button,
23
+ {
24
+ ref,
25
+ whileHover: { scale: 1.1, y: -2 },
26
+ whileTap: { scale: 0.95 },
27
+ onClick,
28
+ className: cn(
29
+ "group relative rounded-lg p-3",
30
+ "transition-colors hover:bg-secondary",
31
+ className
32
+ ),
33
+ children: [
34
+ /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5 text-foreground" }),
35
+ /* @__PURE__ */ jsx(
36
+ "span",
37
+ {
38
+ className: cn(
39
+ "absolute -top-8 left-1/2 -translate-x-1/2",
40
+ "rounded px-2 py-1 text-xs",
41
+ "bg-background text-popover-foreground",
42
+ "opacity-0 group-hover:opacity-100",
43
+ "pointer-events-none whitespace-nowrap transition-opacity"
44
+ ),
45
+ children: label
46
+ }
47
+ )
48
+ ]
49
+ }
50
+ );
51
+ }
52
+ );
53
+ DockIconButton.displayName = "DockIconButton";
54
+ var Dock = React.forwardRef(
55
+ ({ items, className }, ref) => {
56
+ return /* @__PURE__ */ jsx(
57
+ "div",
58
+ {
59
+ ref,
60
+ className: cn(
61
+ "flex h-64 w-full items-center justify-center p-2",
62
+ className
63
+ ),
64
+ children: /* @__PURE__ */ jsx("div", { className: "relative flex h-64 w-full max-w-4xl items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsx(
65
+ motion.div,
66
+ {
67
+ initial: "initial",
68
+ animate: "animate",
69
+ variants: floatingAnimation,
70
+ className: cn(
71
+ "flex items-center gap-1 rounded-2xl p-2",
72
+ "border shadow-lg backdrop-blur-lg",
73
+ "border-border bg-background/90",
74
+ "transition-shadow duration-300 hover:shadow-xl"
75
+ ),
76
+ children: items.map((item) => /* @__PURE__ */ jsx(DockIconButton, { ...item }, item.label))
77
+ }
78
+ ) })
79
+ }
80
+ );
81
+ }
82
+ );
83
+ Dock.displayName = "Dock";
84
+ export {
85
+ Dock
86
+ };