@turtleclub/ui 0.7.0-beta.32 → 0.7.0-beta.34
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/index.cjs +10331 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7652 -47844
- package/dist/index.js.map +1 -1
- package/dist/types/components/features/sidebar-layout.d.ts +2 -0
- package/dist/types/components/features/sidebar-layout.d.ts.map +1 -1
- package/dist/types/components/ui/chart.d.ts +1 -1
- package/dist/types/components/ui/chart.d.ts.map +1 -1
- package/package.json +26 -22
- package/.prettierrc.json +0 -4
- package/.turbo/turbo-build.log +0 -182
- package/CHANGELOG.md +0 -795
- package/components.json +0 -21
- package/src/components/charts/QUICK_REFERENCE.md +0 -323
- package/src/components/charts/README.md +0 -658
- package/src/components/charts/RECHARTS_FEATURES.md +0 -458
- package/src/components/charts/area-chart.tsx +0 -248
- package/src/components/charts/bar-chart.tsx +0 -362
- package/src/components/charts/index.ts +0 -4
- package/src/components/charts/pie-chart.tsx +0 -277
- package/src/components/charts/radial-chart.tsx +0 -312
- package/src/components/features/api-status/index.tsx +0 -23
- package/src/components/features/data-table/data-table.tsx +0 -538
- package/src/components/features/data-table/expand-toggle.tsx +0 -17
- package/src/components/features/data-table/fuzzy-filter.tsx +0 -34
- package/src/components/features/data-table/index.ts +0 -3
- package/src/components/features/data-table/item-info.tsx +0 -19
- package/src/components/features/data-table/skeleton.tsx +0 -23
- package/src/components/features/data-table/sort-dropdown.tsx +0 -118
- package/src/components/features/data-table/sortable-header.tsx +0 -37
- package/src/components/features/index.ts +0 -6
- package/src/components/features/page-heading.tsx +0 -27
- package/src/components/features/search-bar.tsx +0 -55
- package/src/components/features/segmented-navigation.tsx +0 -18
- package/src/components/features/sidebar-layout.tsx +0 -193
- package/src/components/features/turtle-tooltip.tsx +0 -67
- package/src/components/icons/arrow.tsx +0 -23
- package/src/components/icons/beta.tsx +0 -95
- package/src/components/icons/dot.tsx +0 -102
- package/src/components/icons/index.ts +0 -7
- package/src/components/icons/issue.tsx +0 -106
- package/src/components/icons/turtle.tsx +0 -156
- package/src/components/icons/update.tsx +0 -113
- package/src/components/icons/warning.tsx +0 -95
- package/src/components/molecules/index.ts +0 -9
- package/src/components/molecules/opportunity/index.ts +0 -10
- package/src/components/molecules/opportunity/opportunity-apr.tsx +0 -129
- package/src/components/molecules/opportunity/opportunity-disclaimer.tsx +0 -46
- package/src/components/molecules/opportunity/opportunity-rate-estimator.tsx +0 -62
- package/src/components/molecules/opportunity/opportunity-section.tsx +0 -113
- package/src/components/molecules/opportunity/opportunity-selector.tsx +0 -30
- package/src/components/molecules/opportunity/opportunity-type.tsx +0 -16
- package/src/components/molecules/route-details.tsx +0 -112
- package/src/components/molecules/slippage-selector.tsx +0 -200
- package/src/components/molecules/swap-details.tsx +0 -55
- package/src/components/molecules/swap-input.tsx +0 -186
- package/src/components/molecules/tabs.tsx +0 -79
- package/src/components/molecules/token-selector.tsx +0 -180
- package/src/components/molecules/tx-status.tsx +0 -312
- package/src/components/molecules/widget/asset-list/asset-filters.tsx +0 -113
- package/src/components/molecules/widget/asset-list/asset-list.tsx +0 -178
- package/src/components/molecules/widget/asset-list/asset-row.tsx +0 -45
- package/src/components/molecules/widget/asset-list/hooks/index.ts +0 -2
- package/src/components/molecules/widget/asset-list/hooks/use-asset-filtering.ts +0 -44
- package/src/components/molecules/widget/asset-list/hooks/use-asset-grouping.ts +0 -87
- package/src/components/molecules/widget/asset-list/index.ts +0 -3
- package/src/components/molecules/widget/base-selector.tsx +0 -121
- package/src/components/molecules/widget/campaign-item.tsx +0 -82
- package/src/components/molecules/widget/deal-item.tsx +0 -92
- package/src/components/molecules/widget/index.ts +0 -36
- package/src/components/molecules/widget/opportunity-item.tsx +0 -105
- package/src/components/molecules/widget/widget-item-stats.tsx +0 -50
- package/src/components/molecules/widget/widget-item.tsx +0 -139
- package/src/components/molecules/widget/widget-list-items.tsx +0 -86
- package/src/components/ui/alert-dialog.tsx +0 -163
- package/src/components/ui/animated-background/animated-background.tsx +0 -182
- package/src/components/ui/animated-background/index.ts +0 -1
- package/src/components/ui/avatar.tsx +0 -73
- package/src/components/ui/badge.tsx +0 -59
- package/src/components/ui/banner.tsx +0 -84
- package/src/components/ui/button.tsx +0 -100
- package/src/components/ui/card.tsx +0 -119
- package/src/components/ui/chart.tsx +0 -346
- package/src/components/ui/checkbox.tsx +0 -32
- package/src/components/ui/chip.tsx +0 -52
- package/src/components/ui/collapsible.tsx +0 -34
- package/src/components/ui/combobox.tsx +0 -730
- package/src/components/ui/command.tsx +0 -184
- package/src/components/ui/dialog.tsx +0 -129
- package/src/components/ui/dropdown.tsx +0 -316
- package/src/components/ui/field.tsx +0 -244
- package/src/components/ui/heading.tsx +0 -74
- package/src/components/ui/hover-card.tsx +0 -139
- package/src/components/ui/icon-animation.tsx +0 -82
- package/src/components/ui/icon-list.tsx +0 -168
- package/src/components/ui/index.ts +0 -48
- package/src/components/ui/info-card.tsx +0 -110
- package/src/components/ui/input-group.tsx +0 -170
- package/src/components/ui/input.tsx +0 -72
- package/src/components/ui/label-with-icon.tsx +0 -122
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/multi-select.tsx +0 -1090
- package/src/components/ui/navigation-bar.tsx +0 -153
- package/src/components/ui/navigation-menu.tsx +0 -188
- package/src/components/ui/opportunity-details-v1.tsx +0 -104
- package/src/components/ui/pagination.tsx +0 -127
- package/src/components/ui/popover.tsx +0 -48
- package/src/components/ui/scroll-area.tsx +0 -64
- package/src/components/ui/segment-control.tsx +0 -146
- package/src/components/ui/select.tsx +0 -199
- package/src/components/ui/separator.tsx +0 -26
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/sidebar.tsx +0 -728
- package/src/components/ui/skeleton.tsx +0 -14
- package/src/components/ui/slider.tsx +0 -58
- package/src/components/ui/sonner.tsx +0 -24
- package/src/components/ui/switch.tsx +0 -29
- package/src/components/ui/table-shadcn.tsx +0 -110
- package/src/components/ui/table.tsx +0 -117
- package/src/components/ui/textarea.tsx +0 -22
- package/src/components/ui/toggle-group.tsx +0 -71
- package/src/components/ui/toggle.tsx +0 -47
- package/src/components/ui/tooltip.tsx +0 -66
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useIsMobile.ts +0 -77
- package/src/index.ts +0 -16
- package/src/lib/utils.ts +0 -6
- package/src/styles/globals.css +0 -181
- package/src/styles/themes/index.css +0 -9
- package/src/styles/themes/semantic.css +0 -117
- package/src/styles/tokens/colors.css +0 -124
- package/src/styles/tokens/index.css +0 -15
- package/src/styles/tokens/radius.css +0 -18
- package/src/styles/tokens/spacing.css +0 -58
- package/src/styles/tokens/typography.css +0 -87
- package/src/tokens/index.ts +0 -108
- package/tsconfig.json +0 -20
- package/vite.config.js +0 -49
- /package/{src/images/enso.png → dist/enso-22FJ4GNK.png} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
|
|
4
|
-
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
data-slot="skeleton"
|
|
8
|
-
className={cn("bg-muted animate-pulse rounded-md", className)}
|
|
9
|
-
{...props}
|
|
10
|
-
/>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { Skeleton };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
5
|
-
|
|
6
|
-
import { cn } from "@/lib/utils";
|
|
7
|
-
|
|
8
|
-
function Slider({
|
|
9
|
-
className,
|
|
10
|
-
defaultValue,
|
|
11
|
-
value,
|
|
12
|
-
min = 0,
|
|
13
|
-
max = 100,
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
16
|
-
const _values = React.useMemo(
|
|
17
|
-
() => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),
|
|
18
|
-
[value, defaultValue, min, max]
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<SliderPrimitive.Root
|
|
23
|
-
data-slot="slider"
|
|
24
|
-
defaultValue={defaultValue}
|
|
25
|
-
value={value}
|
|
26
|
-
min={min}
|
|
27
|
-
max={max}
|
|
28
|
-
className={cn(
|
|
29
|
-
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
30
|
-
className
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
<SliderPrimitive.Track
|
|
35
|
-
data-slot="slider-track"
|
|
36
|
-
className={cn(
|
|
37
|
-
"bg-secondary relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
38
|
-
)}
|
|
39
|
-
>
|
|
40
|
-
<SliderPrimitive.Range
|
|
41
|
-
data-slot="slider-range"
|
|
42
|
-
className={cn(
|
|
43
|
-
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
44
|
-
)}
|
|
45
|
-
/>
|
|
46
|
-
</SliderPrimitive.Track>
|
|
47
|
-
{Array.from({ length: _values.length }, (_, index) => (
|
|
48
|
-
<SliderPrimitive.Thumb
|
|
49
|
-
data-slot="slider-thumb"
|
|
50
|
-
key={index}
|
|
51
|
-
className="bg-primary ring-primary/20 border-background block size-3 shrink-0 rounded-full border-2 ring-2 transition-[color,box-shadow] hover:ring-[6px] focus-visible:ring-[6px] focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
52
|
-
/>
|
|
53
|
-
))}
|
|
54
|
-
</SliderPrimitive.Root>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { Slider };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useTheme } from "next-themes";
|
|
3
|
-
import { Toaster as Sonner, ToasterProps } from "sonner";
|
|
4
|
-
|
|
5
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
6
|
-
const { theme = "system" } = useTheme();
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<Sonner
|
|
10
|
-
theme={theme as ToasterProps["theme"]}
|
|
11
|
-
className="toaster group"
|
|
12
|
-
style={
|
|
13
|
-
{
|
|
14
|
-
"--normal-bg": "var(--popover)",
|
|
15
|
-
"--normal-text": "var(--popover-foreground)",
|
|
16
|
-
"--normal-border": "var(--border)",
|
|
17
|
-
} as React.CSSProperties
|
|
18
|
-
}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { Toaster };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
function Switch({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof SwitchPrimitive.Root>) {
|
|
10
|
-
return (
|
|
11
|
-
<SwitchPrimitive.Root
|
|
12
|
-
data-slot="switch"
|
|
13
|
-
className={cn(
|
|
14
|
-
"peer group data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 border-border inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
{...props}
|
|
18
|
-
>
|
|
19
|
-
<SwitchPrimitive.Thumb
|
|
20
|
-
data-slot="switch-thumb"
|
|
21
|
-
className={cn(
|
|
22
|
-
"bg-muted-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0",
|
|
23
|
-
)}
|
|
24
|
-
/>
|
|
25
|
-
</SwitchPrimitive.Root>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { Switch };
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
7
|
-
return (
|
|
8
|
-
<div
|
|
9
|
-
data-slot="table-container"
|
|
10
|
-
className="relative w-full overflow-x-auto"
|
|
11
|
-
>
|
|
12
|
-
<table
|
|
13
|
-
data-slot="table"
|
|
14
|
-
className={cn(
|
|
15
|
-
"w-full caption-bottom text-sm",
|
|
16
|
-
"border-separate border-spacing-y-2",
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
26
|
-
return (
|
|
27
|
-
<thead data-slot="table-header" className={cn(className)} {...props} />
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
32
|
-
return (
|
|
33
|
-
<tbody data-slot="table-body" className={cn("", className)} {...props} />
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
38
|
-
return (
|
|
39
|
-
<tfoot
|
|
40
|
-
data-slot="table-footer"
|
|
41
|
-
className={cn("border-t font-medium [&>tr]:last:border-b-0", className)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
48
|
-
return (
|
|
49
|
-
<tr
|
|
50
|
-
data-slot="table-row"
|
|
51
|
-
className={cn(
|
|
52
|
-
'hover:[&>[data-slot="table-cell"]]:bg-neutral-alpha-5 data-[state=selected]:bg-neutral-alpha-10 transition-colors',
|
|
53
|
-
className,
|
|
54
|
-
)}
|
|
55
|
-
{...props}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
61
|
-
return (
|
|
62
|
-
<th
|
|
63
|
-
data-slot="table-head"
|
|
64
|
-
className={cn(
|
|
65
|
-
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
66
|
-
"text-xs",
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function ShadTableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
75
|
-
return (
|
|
76
|
-
<td
|
|
77
|
-
data-slot="table-cell"
|
|
78
|
-
className={cn(
|
|
79
|
-
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
80
|
-
"bg-neutral-alpha-2 first:rounded-l-full first:pl-4 last:rounded-r-full last:pr-4",
|
|
81
|
-
className,
|
|
82
|
-
)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function TableCaption({
|
|
89
|
-
className,
|
|
90
|
-
...props
|
|
91
|
-
}: React.ComponentProps<"caption">) {
|
|
92
|
-
return (
|
|
93
|
-
<caption
|
|
94
|
-
data-slot="table-caption"
|
|
95
|
-
className={cn("text-muted-foreground mt-4 text-sm", className)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export {
|
|
102
|
-
Table,
|
|
103
|
-
TableHeader,
|
|
104
|
-
TableBody,
|
|
105
|
-
TableFooter,
|
|
106
|
-
TableHead,
|
|
107
|
-
TableRow,
|
|
108
|
-
ShadTableCell,
|
|
109
|
-
TableCaption,
|
|
110
|
-
};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
interface Column<T> {
|
|
7
|
-
name: string;
|
|
8
|
-
comparator?: {
|
|
9
|
-
value: (item: T) => any;
|
|
10
|
-
cmp: (a: any, b: any) => number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface ManagedTableProps<T> {
|
|
15
|
-
items: T[];
|
|
16
|
-
itemKey: (item: T) => string | number;
|
|
17
|
-
columns: Column<T>[];
|
|
18
|
-
defaultComparator?: string;
|
|
19
|
-
hasScrollableContainer?: boolean;
|
|
20
|
-
render: (item: T) => React.ReactNode;
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function ManagedTable<T>({
|
|
25
|
-
items,
|
|
26
|
-
itemKey,
|
|
27
|
-
columns,
|
|
28
|
-
defaultComparator,
|
|
29
|
-
hasScrollableContainer,
|
|
30
|
-
render,
|
|
31
|
-
className,
|
|
32
|
-
}: ManagedTableProps<T>) {
|
|
33
|
-
const [sortColumn, setSortColumn] = useState<string | null>(
|
|
34
|
-
defaultComparator || null,
|
|
35
|
-
);
|
|
36
|
-
const [sortDirection, setSortDirection] = useState<"asc" | "desc">("desc");
|
|
37
|
-
|
|
38
|
-
const handleSort = (columnName: string) => {
|
|
39
|
-
if (sortColumn === columnName) {
|
|
40
|
-
setSortDirection(sortDirection === "asc" ? "desc" : "asc");
|
|
41
|
-
} else {
|
|
42
|
-
setSortColumn(columnName);
|
|
43
|
-
setSortDirection("desc");
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const sortedItems = [...items].sort((a, b) => {
|
|
48
|
-
if (!sortColumn) return 0;
|
|
49
|
-
|
|
50
|
-
const column = columns.find((col) => col.name === sortColumn);
|
|
51
|
-
if (!column?.comparator) return 0;
|
|
52
|
-
|
|
53
|
-
const aValue = column.comparator.value(a);
|
|
54
|
-
const bValue = column.comparator.value(b);
|
|
55
|
-
const result = column.comparator.cmp(aValue, bValue);
|
|
56
|
-
|
|
57
|
-
return sortDirection === "asc" ? result : -result;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<div
|
|
62
|
-
className={cn(
|
|
63
|
-
"w-full overflow-auto",
|
|
64
|
-
hasScrollableContainer && "max-h-[600px] overflow-y-auto",
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
>
|
|
68
|
-
<table className="managed-table w-full">
|
|
69
|
-
<thead>
|
|
70
|
-
<tr>
|
|
71
|
-
{columns.map((column) => (
|
|
72
|
-
<th
|
|
73
|
-
key={column.name}
|
|
74
|
-
className={cn(
|
|
75
|
-
"text-muted-foreground h-6 px-3 py-1 text-left text-xs font-normal",
|
|
76
|
-
column.comparator && "cursor-pointer select-none",
|
|
77
|
-
)}
|
|
78
|
-
onClick={() => column.comparator && handleSort(column.name)}
|
|
79
|
-
>
|
|
80
|
-
<span className="flex items-center gap-1">
|
|
81
|
-
{column.name}
|
|
82
|
-
{column.comparator && sortColumn === column.name && (
|
|
83
|
-
<span className="text-xs">
|
|
84
|
-
{sortDirection === "asc" ? "↑" : "↓"}
|
|
85
|
-
</span>
|
|
86
|
-
)}
|
|
87
|
-
</span>
|
|
88
|
-
</th>
|
|
89
|
-
))}
|
|
90
|
-
</tr>
|
|
91
|
-
</thead>
|
|
92
|
-
<tbody>
|
|
93
|
-
{sortedItems.map((item) => (
|
|
94
|
-
<tr key={itemKey(item)} className="text-base font-medium">
|
|
95
|
-
{render(item)}
|
|
96
|
-
</tr>
|
|
97
|
-
))}
|
|
98
|
-
</tbody>
|
|
99
|
-
</table>
|
|
100
|
-
</div>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
105
|
-
children: React.ReactNode;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function TableCell({ children, className, ...props }: TableCellProps) {
|
|
109
|
-
return (
|
|
110
|
-
<td
|
|
111
|
-
className={cn("text-foreground p-2 align-middle", className)}
|
|
112
|
-
{...props}
|
|
113
|
-
>
|
|
114
|
-
{children}
|
|
115
|
-
</td>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
6
|
-
return (
|
|
7
|
-
<textarea
|
|
8
|
-
data-slot="control"
|
|
9
|
-
className={cn(
|
|
10
|
-
"bg-neutral-alpha-2 placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full rounded-lg border border-none px-4 py-2.5 text-base md:text-sm",
|
|
11
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 transition-[color,box-shadow] outline-none focus-visible:ring-2",
|
|
12
|
-
"aria-invalid:ring-destructive/20 aria-invalid:border-destructive",
|
|
13
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
-
"caret-primary shadow",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { Textarea };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
import { toggleVariants } from "@/components/ui/toggle";
|
|
7
|
-
|
|
8
|
-
const ToggleGroupContext = React.createContext<
|
|
9
|
-
VariantProps<typeof toggleVariants>
|
|
10
|
-
>({
|
|
11
|
-
size: "default",
|
|
12
|
-
variant: "default",
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
function ToggleGroup({
|
|
16
|
-
className,
|
|
17
|
-
variant,
|
|
18
|
-
size,
|
|
19
|
-
children,
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
22
|
-
VariantProps<typeof toggleVariants>) {
|
|
23
|
-
return (
|
|
24
|
-
<ToggleGroupPrimitive.Root
|
|
25
|
-
data-slot="toggle-group"
|
|
26
|
-
data-variant={variant}
|
|
27
|
-
data-size={size}
|
|
28
|
-
className={cn(
|
|
29
|
-
"group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
35
|
-
{children}
|
|
36
|
-
</ToggleGroupContext.Provider>
|
|
37
|
-
</ToggleGroupPrimitive.Root>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function ToggleGroupItem({
|
|
42
|
-
className,
|
|
43
|
-
children,
|
|
44
|
-
variant,
|
|
45
|
-
size,
|
|
46
|
-
...props
|
|
47
|
-
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
48
|
-
VariantProps<typeof toggleVariants>) {
|
|
49
|
-
const context = React.useContext(ToggleGroupContext);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<ToggleGroupPrimitive.Item
|
|
53
|
-
data-slot="toggle-group-item"
|
|
54
|
-
data-variant={context.variant || variant}
|
|
55
|
-
data-size={context.size || size}
|
|
56
|
-
className={cn(
|
|
57
|
-
toggleVariants({
|
|
58
|
-
variant: context.variant || variant,
|
|
59
|
-
size: context.size || size,
|
|
60
|
-
}),
|
|
61
|
-
"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
|
|
62
|
-
className,
|
|
63
|
-
)}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
</ToggleGroupPrimitive.Item>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils";
|
|
8
|
-
|
|
9
|
-
const toggleVariants = cva(
|
|
10
|
-
"hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
default: "bg-transparent",
|
|
15
|
-
outline:
|
|
16
|
-
"border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs",
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: "h-9 min-w-9 px-2",
|
|
20
|
-
sm: "h-8 min-w-8 px-1.5",
|
|
21
|
-
lg: "h-10 min-w-10 px-2.5",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
defaultVariants: {
|
|
25
|
-
variant: "default",
|
|
26
|
-
size: "default",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
function Toggle({
|
|
32
|
-
className,
|
|
33
|
-
variant,
|
|
34
|
-
size,
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
37
|
-
VariantProps<typeof toggleVariants>) {
|
|
38
|
-
return (
|
|
39
|
-
<TogglePrimitive.Root
|
|
40
|
-
data-slot="toggle"
|
|
41
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
function TooltipProvider({
|
|
8
|
-
delayDuration = 0,
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
11
|
-
return (
|
|
12
|
-
<TooltipPrimitive.Provider
|
|
13
|
-
data-slot="tooltip-provider"
|
|
14
|
-
delayDuration={delayDuration}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function Tooltip({
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
23
|
-
return (
|
|
24
|
-
<TooltipProvider>
|
|
25
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
26
|
-
</TooltipProvider>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function TooltipTrigger({
|
|
31
|
-
...props
|
|
32
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
33
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function TooltipContent({
|
|
37
|
-
className,
|
|
38
|
-
sideOffset = 2,
|
|
39
|
-
gradient,
|
|
40
|
-
children,
|
|
41
|
-
container = document.querySelector(".turtle-widget-root") ?? document.body,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content> & {
|
|
44
|
-
gradient?: "primary" | "white";
|
|
45
|
-
container?: HTMLElement;
|
|
46
|
-
}) {
|
|
47
|
-
return (
|
|
48
|
-
<TooltipPrimitive.Portal container={container}>
|
|
49
|
-
<TooltipPrimitive.Content
|
|
50
|
-
data-slot="tooltip-content"
|
|
51
|
-
sideOffset={sideOffset}
|
|
52
|
-
className={cn(
|
|
53
|
-
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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 bg-neutral-alpha-10 border-border z-50 max-w-xs origin-(--radix-tooltip-content-transform-origin) rounded-lg border p-2 text-xs backdrop-blur-lg transition-all",
|
|
54
|
-
gradient === "primary" && "border-gradient-primary",
|
|
55
|
-
gradient === "white" && "border-gradient-white",
|
|
56
|
-
className,
|
|
57
|
-
)}
|
|
58
|
-
{...props}
|
|
59
|
-
>
|
|
60
|
-
{children}
|
|
61
|
-
</TooltipPrimitive.Content>
|
|
62
|
-
</TooltipPrimitive.Portal>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/src/hooks/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./useIsMobile";
|
package/src/hooks/useIsMobile.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
|
|
5
|
-
interface UseIsMobileReturn {
|
|
6
|
-
isMobile: boolean;
|
|
7
|
-
isLoading: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const useIsMobile = (): UseIsMobileReturn => {
|
|
11
|
-
const [isMobile, setIsMobile] = useState(false);
|
|
12
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const checkIsMobile = () => {
|
|
16
|
-
// Check using media query
|
|
17
|
-
const mediaQuery = window.matchMedia("(max-width: 768px)");
|
|
18
|
-
|
|
19
|
-
// Check using user agent (additional detection)
|
|
20
|
-
const userAgent = navigator.userAgent.toLowerCase();
|
|
21
|
-
const mobileKeywords = [
|
|
22
|
-
"android",
|
|
23
|
-
"webos",
|
|
24
|
-
"iphone",
|
|
25
|
-
"ipad",
|
|
26
|
-
"ipod",
|
|
27
|
-
"blackberry",
|
|
28
|
-
"windows phone",
|
|
29
|
-
"mobile",
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
const isMobileUA = mobileKeywords.some((keyword) =>
|
|
33
|
-
userAgent.includes(keyword),
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
// Combine both checks - prioritize media query but consider user agent
|
|
37
|
-
const isMobileDevice =
|
|
38
|
-
mediaQuery.matches || (isMobileUA && window.innerWidth <= 768);
|
|
39
|
-
|
|
40
|
-
setIsMobile(isMobileDevice);
|
|
41
|
-
setIsLoading(false);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Initial check
|
|
45
|
-
checkIsMobile();
|
|
46
|
-
|
|
47
|
-
// Listen for media query changes
|
|
48
|
-
const mediaQuery = window.matchMedia("(max-width: 768px)");
|
|
49
|
-
const handleChange = () => checkIsMobile();
|
|
50
|
-
|
|
51
|
-
if (mediaQuery.addEventListener) {
|
|
52
|
-
mediaQuery.addEventListener("change", handleChange);
|
|
53
|
-
} else {
|
|
54
|
-
// Fallback for older browsers
|
|
55
|
-
mediaQuery.addListener(handleChange);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// Listen for window resize
|
|
59
|
-
window.addEventListener("resize", checkIsMobile);
|
|
60
|
-
|
|
61
|
-
return () => {
|
|
62
|
-
if (mediaQuery.removeEventListener) {
|
|
63
|
-
mediaQuery.removeEventListener("change", handleChange);
|
|
64
|
-
} else {
|
|
65
|
-
mediaQuery.removeListener(handleChange);
|
|
66
|
-
}
|
|
67
|
-
window.removeEventListener("resize", checkIsMobile);
|
|
68
|
-
};
|
|
69
|
-
}, []);
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
isMobile,
|
|
73
|
-
isLoading,
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default useIsMobile;
|
package/src/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// TODO: delete - prerelease trigger
|
|
2
|
-
// Re-export components
|
|
3
|
-
export * from "./components/ui";
|
|
4
|
-
export * from "./components/molecules";
|
|
5
|
-
export * from "./components/icons";
|
|
6
|
-
export * from "./components/features";
|
|
7
|
-
export * from "./components/charts";
|
|
8
|
-
|
|
9
|
-
// Re-export utilities
|
|
10
|
-
export * from "./lib/utils";
|
|
11
|
-
|
|
12
|
-
// Re-export design tokens
|
|
13
|
-
export * from "./tokens";
|
|
14
|
-
|
|
15
|
-
// Re-export hooks
|
|
16
|
-
export * from "./hooks";
|