@surfnet/curve-react 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/dist/components/ui/avatar/avatar.d.ts +12 -0
- package/dist/components/ui/avatar/avatar.js +52 -0
- package/dist/components/ui/avatar/index.d.ts +1 -0
- package/dist/components/ui/avatar/index.js +1 -0
- package/dist/components/ui/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/components/ui/breadcrumb/breadcrumb.js +74 -0
- package/dist/components/ui/breadcrumb/index.d.ts +1 -0
- package/dist/components/ui/breadcrumb/index.js +1 -0
- package/dist/components/ui/button/button.d.ts +8 -0
- package/dist/components/ui/button/button.js +46 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button/index.js +1 -0
- package/dist/components/ui/card/card.d.ts +11 -0
- package/dist/components/ui/card/card.js +56 -0
- package/dist/components/ui/card/index.d.ts +1 -0
- package/dist/components/ui/card/index.js +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox/checkbox.js +21 -0
- package/dist/components/ui/checkbox/index.d.ts +1 -0
- package/dist/components/ui/checkbox/index.js +1 -0
- package/dist/components/ui/data-table/data-table.d.ts +23 -0
- package/dist/components/ui/data-table/data-table.js +61 -0
- package/dist/components/ui/data-table/index.d.ts +2 -0
- package/dist/components/ui/data-table/index.js +2 -0
- package/dist/components/ui/data-table/use-data-table.d.ts +11 -0
- package/dist/components/ui/data-table/use-data-table.js +33 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +1 -0
- package/dist/components/ui/dropdown-menu/index.js +1 -0
- package/dist/components/ui/field/field.d.ts +24 -0
- package/dist/components/ui/field/field.js +111 -0
- package/dist/components/ui/field/index.d.ts +1 -0
- package/dist/components/ui/field/index.js +1 -0
- package/dist/components/ui/input/index.d.ts +1 -0
- package/dist/components/ui/input/index.js +1 -0
- package/dist/components/ui/input/input.d.ts +3 -0
- package/dist/components/ui/input/input.js +17 -0
- package/dist/components/ui/input-group/index.d.ts +1 -0
- package/dist/components/ui/input-group/index.js +1 -0
- package/dist/components/ui/input-group/input-group.d.ts +18 -0
- package/dist/components/ui/input-group/input-group.js +80 -0
- package/dist/components/ui/label/index.d.ts +1 -0
- package/dist/components/ui/label/index.js +1 -0
- package/dist/components/ui/label/label.d.ts +3 -0
- package/dist/components/ui/label/label.js +15 -0
- package/dist/components/ui/select/index.d.ts +1 -0
- package/dist/components/ui/select/index.js +1 -0
- package/dist/components/ui/select/select.d.ts +16 -0
- package/dist/components/ui/select/select.js +99 -0
- package/dist/components/ui/separator/index.d.ts +1 -0
- package/dist/components/ui/separator/index.js +1 -0
- package/dist/components/ui/separator/separator.d.ts +3 -0
- package/dist/components/ui/separator/separator.js +16 -0
- package/dist/components/ui/sidebar/index.d.ts +1 -0
- package/dist/components/ui/sidebar/index.js +1 -0
- package/dist/components/ui/sidebar/sheet.d.ts +14 -0
- package/dist/components/ui/sidebar/sheet.js +72 -0
- package/dist/components/ui/sidebar/sidebar.d.ts +63 -0
- package/dist/components/ui/sidebar/sidebar.js +362 -0
- package/dist/components/ui/sidebar/skeleton.d.ts +2 -0
- package/dist/components/ui/sidebar/skeleton.js +12 -0
- package/dist/components/ui/sidebar/tooltip.d.ts +6 -0
- package/dist/components/ui/sidebar/tooltip.js +35 -0
- package/dist/components/ui/sidebar/use-mobile.d.ts +1 -0
- package/dist/components/ui/sidebar/use-mobile.js +14 -0
- package/dist/components/ui/table/index.d.ts +1 -0
- package/dist/components/ui/table/index.js +1 -0
- package/dist/components/ui/table/table.d.ts +10 -0
- package/dist/components/ui/table/table.js +68 -0
- package/dist/components/ui/textarea/index.d.ts +1 -0
- package/dist/components/ui/textarea/index.js +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.js +13 -0
- package/dist/curve-react.css +3 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +36 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/package.json +66 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
2
|
+
import { AvatarSizeName } from '@surfnet/curve-contracts';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare function Avatar({ className, size, ...props }: AvatarPrimitive.Root.Props & {
|
|
5
|
+
size?: AvatarSizeName;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
declare function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props): React.JSX.Element;
|
|
8
|
+
declare function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props): React.JSX.Element;
|
|
9
|
+
declare function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
10
|
+
declare function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
declare function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Avatar as t } from "@base-ui/react/avatar";
|
|
6
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/avatar/avatar.tsx
|
|
8
|
+
function r({ className: r, size: i = "default", ...a }) {
|
|
9
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
10
|
+
"data-slot": "avatar",
|
|
11
|
+
"data-size": i,
|
|
12
|
+
className: e("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten", r),
|
|
13
|
+
...a
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function i({ className: r, ...i }) {
|
|
17
|
+
return /* @__PURE__ */ n(t.Image, {
|
|
18
|
+
"data-slot": "avatar-image",
|
|
19
|
+
className: e("aspect-square size-full rounded-full object-cover", r),
|
|
20
|
+
...i
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function a({ className: r, ...i }) {
|
|
24
|
+
return /* @__PURE__ */ n(t.Fallback, {
|
|
25
|
+
"data-slot": "avatar-fallback",
|
|
26
|
+
className: e("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", r),
|
|
27
|
+
...i
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function o({ className: t, ...r }) {
|
|
31
|
+
return /* @__PURE__ */ n("span", {
|
|
32
|
+
"data-slot": "avatar-badge",
|
|
33
|
+
className: e("absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", t),
|
|
34
|
+
...r
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function s({ className: t, ...r }) {
|
|
38
|
+
return /* @__PURE__ */ n("div", {
|
|
39
|
+
"data-slot": "avatar-group",
|
|
40
|
+
className: e("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", t),
|
|
41
|
+
...r
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function c({ className: t, ...r }) {
|
|
45
|
+
return /* @__PURE__ */ n("div", {
|
|
46
|
+
"data-slot": "avatar-group-count",
|
|
47
|
+
className: e("relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3", t),
|
|
48
|
+
...r
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { r as Avatar, o as AvatarBadge, a as AvatarFallback, s as AvatarGroup, c as AvatarGroupCount, i as AvatarImage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./avatar.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Breadcrumb({ className, ...props }: React.ComponentProps<'nav'>): React.JSX.Element;
|
|
4
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>): React.JSX.Element;
|
|
5
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
6
|
+
declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<'a'>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
7
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
8
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>): React.JSX.Element;
|
|
9
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
10
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
6
|
+
import { mergeProps as r } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender as i } from "@base-ui/react/use-render";
|
|
8
|
+
import { CaretRightIcon as a, DotsThreeIcon as o } from "@phosphor-icons/react";
|
|
9
|
+
//#region src/components/ui/breadcrumb/breadcrumb.tsx
|
|
10
|
+
function s({ className: n, ...r }) {
|
|
11
|
+
return /* @__PURE__ */ t("nav", {
|
|
12
|
+
"aria-label": "breadcrumb",
|
|
13
|
+
"data-slot": "breadcrumb",
|
|
14
|
+
className: e(n),
|
|
15
|
+
...r
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function c({ className: n, ...r }) {
|
|
19
|
+
return /* @__PURE__ */ t("ol", {
|
|
20
|
+
"data-slot": "breadcrumb-list",
|
|
21
|
+
className: e("flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground sm:gap-2.5", n),
|
|
22
|
+
...r
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function l({ className: n, ...r }) {
|
|
26
|
+
return /* @__PURE__ */ t("li", {
|
|
27
|
+
"data-slot": "breadcrumb-item",
|
|
28
|
+
className: e("inline-flex items-center gap-1.5", n),
|
|
29
|
+
...r
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function u({ className: t, render: n, ...a }) {
|
|
33
|
+
return i({
|
|
34
|
+
defaultTagName: "a",
|
|
35
|
+
props: r({ className: e("transition-colors hover:text-foreground", t) }, a),
|
|
36
|
+
render: n,
|
|
37
|
+
state: { slot: "breadcrumb-link" }
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function d({ className: n, ...r }) {
|
|
41
|
+
return /* @__PURE__ */ t("span", {
|
|
42
|
+
"data-slot": "breadcrumb-page",
|
|
43
|
+
role: "link",
|
|
44
|
+
"aria-disabled": "true",
|
|
45
|
+
"aria-current": "page",
|
|
46
|
+
className: e("font-normal text-foreground", n),
|
|
47
|
+
...r
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function f({ children: n, className: r, ...i }) {
|
|
51
|
+
return /* @__PURE__ */ t("li", {
|
|
52
|
+
"data-slot": "breadcrumb-separator",
|
|
53
|
+
role: "presentation",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: e("[&>svg]:size-3.5", r),
|
|
56
|
+
...i,
|
|
57
|
+
children: n ?? /* @__PURE__ */ t(a, {})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function p({ className: r, ...i }) {
|
|
61
|
+
return /* @__PURE__ */ n("span", {
|
|
62
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
63
|
+
role: "presentation",
|
|
64
|
+
"aria-hidden": "true",
|
|
65
|
+
className: e("flex size-5 items-center justify-center [&>svg]:size-4", r),
|
|
66
|
+
...i,
|
|
67
|
+
children: [/* @__PURE__ */ t(o, {}), /* @__PURE__ */ t("span", {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: "More"
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { s as Breadcrumb, p as BreadcrumbEllipsis, l as BreadcrumbItem, u as BreadcrumbLink, c as BreadcrumbList, d as BreadcrumbPage, f as BreadcrumbSeparator };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './breadcrumb';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./breadcrumb.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
|
|
5
|
+
size?: "sm" | "default" | "lg" | "xs" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
8
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
import { Button as n } from "@base-ui/react/button";
|
|
6
|
+
import { cva as r } from "class-variance-authority";
|
|
7
|
+
//#region src/components/ui/button/button.tsx
|
|
8
|
+
var i = r("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
12
|
+
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
14
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
15
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
16
|
+
link: "text-link underline-offset-4 hover:underline"
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
20
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
21
|
+
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
22
|
+
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
23
|
+
icon: "size-9",
|
|
24
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
25
|
+
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
26
|
+
"icon-lg": "size-10"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
function a({ className: r, variant: a = "default", size: o = "default", ...s }) {
|
|
35
|
+
return /* @__PURE__ */ t(n, {
|
|
36
|
+
"data-slot": "button",
|
|
37
|
+
className: e(i({
|
|
38
|
+
variant: a,
|
|
39
|
+
size: o,
|
|
40
|
+
className: r
|
|
41
|
+
})),
|
|
42
|
+
...s
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { a as Button, i as buttonVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./button.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<'div'> & {
|
|
3
|
+
size?: 'default' | 'sm';
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/card/card.tsx
|
|
5
|
+
function n({ className: n, size: r = "default", ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"data-slot": "card",
|
|
8
|
+
"data-size": r,
|
|
9
|
+
className: e("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl", n),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function r({ className: n, ...r }) {
|
|
14
|
+
return /* @__PURE__ */ t("div", {
|
|
15
|
+
"data-slot": "card-header",
|
|
16
|
+
className: e("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", n),
|
|
17
|
+
...r
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function i({ className: n, ...r }) {
|
|
21
|
+
return /* @__PURE__ */ t("div", {
|
|
22
|
+
"data-slot": "card-title",
|
|
23
|
+
className: e("font-heading text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", n),
|
|
24
|
+
...r
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function a({ className: n, ...r }) {
|
|
28
|
+
return /* @__PURE__ */ t("div", {
|
|
29
|
+
"data-slot": "card-description",
|
|
30
|
+
className: e("text-sm text-muted-foreground", n),
|
|
31
|
+
...r
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function o({ className: n, ...r }) {
|
|
35
|
+
return /* @__PURE__ */ t("div", {
|
|
36
|
+
"data-slot": "card-action",
|
|
37
|
+
className: e("col-start-2 row-span-2 row-start-1 self-start justify-self-end", n),
|
|
38
|
+
...r
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function s({ className: n, ...r }) {
|
|
42
|
+
return /* @__PURE__ */ t("div", {
|
|
43
|
+
"data-slot": "card-content",
|
|
44
|
+
className: e("px-(--card-spacing)", n),
|
|
45
|
+
...r
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function c({ className: n, ...r }) {
|
|
49
|
+
return /* @__PURE__ */ t("div", {
|
|
50
|
+
"data-slot": "card-footer",
|
|
51
|
+
className: e("flex items-center rounded-b-xl px-(--card-spacing) [.border-t]:pt-(--card-spacing)", n),
|
|
52
|
+
...r
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { n as Card, o as CardAction, s as CardContent, a as CardDescription, c as CardFooter, r as CardHeader, i as CardTitle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./card.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
5
|
+
import { CheckIcon as n } from "@phosphor-icons/react";
|
|
6
|
+
import { Checkbox as r } from "@base-ui/react/checkbox";
|
|
7
|
+
//#region src/components/ui/checkbox/checkbox.tsx
|
|
8
|
+
function i({ className: i, ...a }) {
|
|
9
|
+
return /* @__PURE__ */ t(r.Root, {
|
|
10
|
+
"data-slot": "checkbox",
|
|
11
|
+
className: e("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary", i),
|
|
12
|
+
...a,
|
|
13
|
+
children: /* @__PURE__ */ t(r.Indicator, {
|
|
14
|
+
"data-slot": "checkbox-indicator",
|
|
15
|
+
className: "grid place-content-center text-current transition-none [&>svg]:size-3.5",
|
|
16
|
+
children: /* @__PURE__ */ t(n, {})
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as Checkbox };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./checkbox.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ColumnDef, Table as TanStackTable } from '@tanstack/react-table';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface DataTableToolbarProps extends React.ComponentProps<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare function DataTableToolbar({ className, ...props }: DataTableToolbarProps): React.JSX.Element;
|
|
6
|
+
interface DataTableContentProps<TData> extends React.ComponentProps<'div'> {
|
|
7
|
+
table: TanStackTable<TData>;
|
|
8
|
+
columns: ColumnDef<TData, unknown>[];
|
|
9
|
+
/** Content shown in the body when there are no rows. */
|
|
10
|
+
noResultsLabel?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function DataTableContent<TData>({ table, columns, noResultsLabel, className, ...props }: DataTableContentProps<TData>): React.JSX.Element;
|
|
13
|
+
interface DataTablePaginationProps<TData> extends React.ComponentProps<'div'> {
|
|
14
|
+
table: TanStackTable<TData>;
|
|
15
|
+
/** Label for the "previous page" button. */
|
|
16
|
+
previousLabel?: React.ReactNode;
|
|
17
|
+
/** Label for the "next page" button. */
|
|
18
|
+
nextLabel?: React.ReactNode;
|
|
19
|
+
/** Builds the selection-summary text from the selected and total row counts. */
|
|
20
|
+
selectionLabel?: (selectedCount: number, totalCount: number) => React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare function DataTablePagination<TData>({ table, previousLabel, nextLabel, selectionLabel, className, ...props }: DataTablePaginationProps<TData>): React.JSX.Element;
|
|
23
|
+
export { DataTableContent, DataTablePagination, DataTableToolbar, type DataTableContentProps, type DataTablePaginationProps, type DataTableToolbarProps, };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as t } from "../button/button.js";
|
|
5
|
+
import "../button/index.js";
|
|
6
|
+
import { Table as n, TableBody as r, TableCell as i, TableHead as a, TableHeader as o, TableRow as s } from "../table/table.js";
|
|
7
|
+
import "../table/index.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
import { flexRender as u } from "@tanstack/react-table";
|
|
11
|
+
//#region src/components/ui/data-table/data-table.tsx
|
|
12
|
+
function d({ className: t, ...n }) {
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
"data-slot": "data-table-toolbar",
|
|
15
|
+
className: e("flex items-center gap-2 py-4", t),
|
|
16
|
+
...n
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function f({ table: t, columns: d, noResultsLabel: f = "No results.", className: p, ...m }) {
|
|
20
|
+
return /* @__PURE__ */ c("div", {
|
|
21
|
+
"data-slot": "data-table-content",
|
|
22
|
+
className: e("overflow-hidden rounded-md border", p),
|
|
23
|
+
...m,
|
|
24
|
+
children: /* @__PURE__ */ l(n, { children: [/* @__PURE__ */ c(o, { children: t.getHeaderGroups().map((e) => /* @__PURE__ */ c(s, { children: e.headers.map((e) => /* @__PURE__ */ c(a, { children: e.isPlaceholder ? null : u(e.column.columnDef.header, e.getContext()) }, e.id)) }, e.id)) }), /* @__PURE__ */ c(r, { children: t.getRowModel().rows?.length ? t.getRowModel().rows.map((e) => /* @__PURE__ */ c(s, {
|
|
25
|
+
"data-state": e.getIsSelected() && "selected",
|
|
26
|
+
children: e.getVisibleCells().map((e) => /* @__PURE__ */ c(i, { children: u(e.column.columnDef.cell, e.getContext()) }, e.id))
|
|
27
|
+
}, e.id)) : /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c(i, {
|
|
28
|
+
colSpan: d.length,
|
|
29
|
+
className: "h-24 text-center",
|
|
30
|
+
children: f
|
|
31
|
+
}) }) })] })
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function p({ table: n, previousLabel: r = "Previous", nextLabel: i = "Next", selectionLabel: a = (e, t) => `${e} of ${t} row(s) selected.`, className: o, ...s }) {
|
|
35
|
+
return /* @__PURE__ */ l("div", {
|
|
36
|
+
"data-slot": "data-table-pagination",
|
|
37
|
+
className: e("flex items-center justify-end gap-2 py-4", o),
|
|
38
|
+
...s,
|
|
39
|
+
children: [/* @__PURE__ */ c("div", {
|
|
40
|
+
className: "flex-1 text-sm text-muted-foreground",
|
|
41
|
+
children: a(n.getFilteredSelectedRowModel().rows.length, n.getFilteredRowModel().rows.length)
|
|
42
|
+
}), /* @__PURE__ */ l("div", {
|
|
43
|
+
className: "flex gap-2",
|
|
44
|
+
children: [/* @__PURE__ */ c(t, {
|
|
45
|
+
variant: "outline",
|
|
46
|
+
size: "sm",
|
|
47
|
+
onClick: () => n.previousPage(),
|
|
48
|
+
disabled: !n.getCanPreviousPage(),
|
|
49
|
+
children: r
|
|
50
|
+
}), /* @__PURE__ */ c(t, {
|
|
51
|
+
variant: "outline",
|
|
52
|
+
size: "sm",
|
|
53
|
+
onClick: () => n.nextPage(),
|
|
54
|
+
disabled: !n.getCanNextPage(),
|
|
55
|
+
children: i
|
|
56
|
+
})]
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { f as DataTableContent, p as DataTablePagination, d as DataTableToolbar };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDef, ColumnFiltersState, PaginationState, SortingState, Table as TanStackTable, VisibilityState } from '@tanstack/react-table';
|
|
2
|
+
interface UseDataTableOptions<TData> {
|
|
3
|
+
data: TData[];
|
|
4
|
+
columns: ColumnDef<TData, unknown>[];
|
|
5
|
+
initialSorting?: SortingState;
|
|
6
|
+
initialColumnFilters?: ColumnFiltersState;
|
|
7
|
+
initialColumnVisibility?: VisibilityState;
|
|
8
|
+
initialPagination?: PaginationState;
|
|
9
|
+
}
|
|
10
|
+
declare function useDataTable<TData>({ data, columns, initialSorting, initialColumnFilters, initialColumnVisibility, initialPagination, }: UseDataTableOptions<TData>): TanStackTable<TData>;
|
|
11
|
+
export { useDataTable, type UseDataTableOptions };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import * as e from "react";
|
|
4
|
+
import { getCoreRowModel as t, getFilteredRowModel as n, getPaginationRowModel as r, getSortedRowModel as i, useReactTable as a } from "@tanstack/react-table";
|
|
5
|
+
//#region src/components/ui/data-table/use-data-table.ts
|
|
6
|
+
function o({ data: o, columns: s, initialSorting: c = [], initialColumnFilters: l = [], initialColumnVisibility: u = {}, initialPagination: d = {
|
|
7
|
+
pageIndex: 0,
|
|
8
|
+
pageSize: 10
|
|
9
|
+
} }) {
|
|
10
|
+
let [f, p] = e.useState(c), [m, h] = e.useState(l), [g, _] = e.useState(u), [v, y] = e.useState({}), [b, x] = e.useState(d);
|
|
11
|
+
return a({
|
|
12
|
+
data: o,
|
|
13
|
+
columns: s,
|
|
14
|
+
onSortingChange: p,
|
|
15
|
+
onColumnFiltersChange: h,
|
|
16
|
+
getCoreRowModel: t(),
|
|
17
|
+
getPaginationRowModel: r(),
|
|
18
|
+
getSortedRowModel: i(),
|
|
19
|
+
getFilteredRowModel: n(),
|
|
20
|
+
onColumnVisibilityChange: _,
|
|
21
|
+
onRowSelectionChange: y,
|
|
22
|
+
onPaginationChange: x,
|
|
23
|
+
state: {
|
|
24
|
+
sorting: f,
|
|
25
|
+
columnFilters: m,
|
|
26
|
+
columnVisibility: g,
|
|
27
|
+
rowSelection: v,
|
|
28
|
+
pagination: b
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { o as useDataTable };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
2
|
+
import { DropdownMenuItemVariantName } from '@surfnet/curve-contracts';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare function DropdownMenu({ ...props }: MenuPrimitive.Root.Props): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuContent({ align, alignOffset, side, sideOffset, className, ...props }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props): React.JSX.Element;
|
|
9
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: MenuPrimitive.GroupLabel.Props & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: MenuPrimitive.Item.Props & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
variant?: DropdownMenuItemVariantName;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
|
|
17
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: MenuPrimitive.SubmenuTrigger.Props & {
|
|
18
|
+
inset?: boolean;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuSubContent({ align, alignOffset, side, sideOffset, className, ...props }: React.ComponentProps<typeof DropdownMenuContent>): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: MenuPrimitive.CheckboxItem.Props & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: MenuPrimitive.RadioItem.Props & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props): React.JSX.Element;
|
|
29
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
|
|
30
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|