@siyahi/ui 0.0.0-stage → 0.1.0-next.3
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/LICENSE +21 -0
- package/README.md +174 -2
- package/THIRD_PARTY_NOTICES.md +51 -0
- package/dist/components/registry/dashboard-01/section-cards.d.ts +17 -0
- package/dist/components/registry/dashboard-01/section-cards.js +39 -0
- package/dist/components/registry/dashboardcn/bar-list.d.ts +24 -0
- package/dist/components/registry/dashboardcn/bar-list.js +71 -0
- package/dist/components/registry/heatmap/calendar-heatmap.d.ts +134 -0
- package/dist/components/registry/heatmap/calendar-heatmap.js +497 -0
- package/dist/components/registry/heatmap/status-heatmap.d.ts +120 -0
- package/dist/components/registry/heatmap/status-heatmap.js +330 -0
- package/dist/components/registry/heatmap/weekday-heatmap.d.ts +145 -0
- package/dist/components/registry/heatmap/weekday-heatmap.js +489 -0
- package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +26 -0
- package/dist/components/registry/niko-table/components/data-table-column-actions.js +32 -0
- package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +13 -0
- package/dist/components/registry/niko-table/components/data-table-column-filter.js +17 -0
- package/dist/components/registry/niko-table/components/data-table-column-header.d.ts +30 -0
- package/dist/components/registry/niko-table/components/data-table-column-header.js +35 -0
- package/dist/components/registry/niko-table/components/data-table-column-sort.d.ts +21 -0
- package/dist/components/registry/niko-table/components/data-table-column-sort.js +36 -0
- package/dist/components/registry/niko-table/components/data-table-column-title.d.ts +12 -0
- package/dist/components/registry/niko-table/components/data-table-column-title.js +18 -0
- package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +108 -0
- package/dist/components/registry/niko-table/components/data-table-empty-state.js +148 -0
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +46 -0
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.js +133 -0
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +111 -0
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.js +77 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +65 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.js +65 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +50 -0
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.js +42 -0
- package/dist/components/registry/niko-table/components/data-table-row-menu.d.ts +51 -0
- package/dist/components/registry/niko-table/components/data-table-row-menu.js +65 -0
- package/dist/components/registry/niko-table/components/data-table-toolbar-section.d.ts +7 -0
- package/dist/components/registry/niko-table/components/data-table-toolbar-section.js +63 -0
- package/dist/components/registry/niko-table/config/data-table.d.ts +156 -0
- package/dist/components/registry/niko-table/config/data-table.js +279 -0
- package/dist/components/registry/niko-table/config/feature-detection.d.ts +39 -0
- package/dist/components/registry/niko-table/config/feature-detection.js +174 -0
- package/dist/components/registry/niko-table/core/data-table-context.d.ts +157 -0
- package/dist/components/registry/niko-table/core/data-table-context.js +326 -0
- package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +85 -0
- package/dist/components/registry/niko-table/core/data-table-error-boundary.js +116 -0
- package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +49 -0
- package/dist/components/registry/niko-table/core/data-table-grouped-row.js +112 -0
- package/dist/components/registry/niko-table/core/data-table-root.d.ts +62 -0
- package/dist/components/registry/niko-table/core/data-table-root.js +406 -0
- package/dist/components/registry/niko-table/core/data-table-structure.d.ts +153 -0
- package/dist/components/registry/niko-table/core/data-table-structure.js +370 -0
- package/dist/components/registry/niko-table/core/data-table.d.ts +30 -0
- package/dist/components/registry/niko-table/core/data-table.js +126 -0
- package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +49 -0
- package/dist/components/registry/niko-table/filters/table-column-actions.js +48 -0
- package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +51 -0
- package/dist/components/registry/niko-table/filters/table-column-sort.js +184 -0
- package/dist/components/registry/niko-table/filters/table-column-title.d.ts +17 -0
- package/dist/components/registry/niko-table/filters/table-column-title.js +20 -0
- package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +40 -0
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +210 -0
- package/dist/components/registry/niko-table/hooks/use-derived-column-title.d.ts +29 -0
- package/dist/components/registry/niko-table/hooks/use-derived-column-title.js +40 -0
- package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +49 -0
- package/dist/components/registry/niko-table/hooks/use-generated-options.js +144 -0
- package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +59 -0
- package/dist/components/registry/niko-table/lib/build-faceted-options.js +82 -0
- package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +33 -0
- package/dist/components/registry/niko-table/lib/column-resize-handle.js +175 -0
- package/dist/components/registry/niko-table/lib/constants.d.ts +128 -0
- package/dist/components/registry/niko-table/lib/constants.js +123 -0
- package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +35 -0
- package/dist/components/registry/niko-table/lib/create-scroll-handler.js +63 -0
- package/dist/components/registry/niko-table/lib/data-table-features.d.ts +218 -0
- package/dist/components/registry/niko-table/lib/data-table-features.js +127 -0
- package/dist/components/registry/niko-table/lib/filter-functions.d.ts +47 -0
- package/dist/components/registry/niko-table/lib/filter-functions.js +309 -0
- package/dist/components/registry/niko-table/lib/filter-rows.d.ts +14 -0
- package/dist/components/registry/niko-table/lib/filter-rows.js +28 -0
- package/dist/components/registry/niko-table/lib/flex-columns.d.ts +48 -0
- package/dist/components/registry/niko-table/lib/flex-columns.js +65 -0
- package/dist/components/registry/niko-table/lib/format.d.ts +33 -0
- package/dist/components/registry/niko-table/lib/format.js +99 -0
- package/dist/components/registry/niko-table/lib/render-cell-content.d.ts +17 -0
- package/dist/components/registry/niko-table/lib/render-cell-content.js +65 -0
- package/dist/components/registry/niko-table/lib/row-click.d.ts +67 -0
- package/dist/components/registry/niko-table/lib/row-click.js +28 -0
- package/dist/components/registry/niko-table/lib/styles.d.ts +6 -0
- package/dist/components/registry/niko-table/lib/styles.js +24 -0
- package/dist/components/registry/niko-table/lib/use-header-min-widths.d.ts +17 -0
- package/dist/components/registry/niko-table/lib/use-header-min-widths.js +82 -0
- package/dist/components/registry/niko-table/types/index.d.ts +141 -0
- package/dist/components/registry/niko-table/types/index.js +2 -0
- package/dist/components/registry/niko-table/ui/table.d.ts +13 -0
- package/dist/components/registry/niko-table/ui/table.js +74 -0
- package/dist/components/registry/sidebar-07/app-sidebar.d.ts +18 -0
- package/dist/components/registry/sidebar-07/app-sidebar.js +26 -0
- package/dist/components/registry/sidebar-07/nav-main.d.ts +15 -0
- package/dist/components/registry/sidebar-07/nav-main.js +25 -0
- package/dist/components/registry/sidebar-07/nav-projects.d.ts +9 -0
- package/dist/components/registry/sidebar-07/nav-projects.js +43 -0
- package/dist/components/registry/sidebar-07/nav-user.d.ts +9 -0
- package/dist/components/registry/sidebar-07/nav-user.js +70 -0
- package/dist/components/registry/sidebar-07/team-switcher.d.ts +10 -0
- package/dist/components/registry/sidebar-07/team-switcher.js +70 -0
- package/dist/components/siyahi/delta.d.ts +10 -0
- package/dist/components/siyahi/delta.js +27 -0
- package/dist/components/siyahi/local-time.d.ts +7 -0
- package/dist/components/siyahi/local-time.js +22 -0
- package/dist/components/siyahi/price-chart.d.ts +12 -0
- package/dist/components/siyahi/price-chart.js +80 -0
- package/dist/components/siyahi/siyahi-provider.d.ts +12 -0
- package/dist/components/siyahi/siyahi-provider.js +31 -0
- package/dist/components/siyahi/treemap.d.ts +14 -0
- package/dist/components/siyahi/treemap.js +58 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +43 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/badge.js +29 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +72 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +44 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +107 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +56 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +149 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +24 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +88 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +79 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +15 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +55 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +43 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +36 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +97 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +89 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +385 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +66 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +52 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +41 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +71 -0
- package/dist/lib/format.d.ts +24 -0
- package/dist/lib/format.js +58 -0
- package/dist/lib/locale.d.ts +12 -0
- package/dist/lib/locale.js +8 -0
- package/dist/lib/recharts.d.ts +2 -0
- package/dist/lib/recharts.js +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +1 -0
- package/package.json +78 -3
- package/registry.lock.json +413 -0
- package/report.css +129 -0
- package/styles/shadcn.css +643 -0
- package/styles/siyahi.css +189 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
|
|
3
|
+
import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../../ui/sidebar.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ArrowRightIcon, FolderIcon, MoreHorizontalIcon, Trash2Icon } from "lucide-react";
|
|
6
|
+
//#region src/components/registry/sidebar-07/nav-projects.tsx
|
|
7
|
+
function NavProjects({ projects }) {
|
|
8
|
+
const { isMobile } = useSidebar();
|
|
9
|
+
return /* @__PURE__ */ jsxs(SidebarGroup, {
|
|
10
|
+
className: "group-data-[collapsible=icon]:hidden",
|
|
11
|
+
children: [/* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Projects" }), /* @__PURE__ */ jsxs(SidebarMenu, { children: [projects.map((item) => /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [/* @__PURE__ */ jsxs(SidebarMenuButton, {
|
|
12
|
+
render: /* @__PURE__ */ jsx("a", { href: item.url }),
|
|
13
|
+
children: [item.icon, /* @__PURE__ */ jsx("span", { children: item.name })]
|
|
14
|
+
}), /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
15
|
+
render: /* @__PURE__ */ jsx(SidebarMenuAction, {
|
|
16
|
+
showOnHover: true,
|
|
17
|
+
className: "aria-expanded:bg-muted"
|
|
18
|
+
}),
|
|
19
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "sr-only",
|
|
21
|
+
children: "More"
|
|
22
|
+
})]
|
|
23
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
24
|
+
className: "w-fit",
|
|
25
|
+
side: isMobile ? "bottom" : "right",
|
|
26
|
+
align: isMobile ? "end" : "start",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(FolderIcon, {}), /* @__PURE__ */ jsx("span", { children: "View Project" })] }),
|
|
29
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(ArrowRightIcon, {}), /* @__PURE__ */ jsx("span", { children: "Share Project" })] }),
|
|
30
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
31
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
32
|
+
variant: "destructive",
|
|
33
|
+
children: [/* @__PURE__ */ jsx(Trash2Icon, {}), /* @__PURE__ */ jsx("span", { children: "Delete Project" })]
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
})] })] }, item.name)), /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
|
|
37
|
+
className: "text-sidebar-foreground/70",
|
|
38
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "text-sidebar-foreground/70" }), /* @__PURE__ */ jsx("span", { children: "More" })]
|
|
39
|
+
}) })] })]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { NavProjects };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../ui/avatar.js";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
|
|
3
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../../ui/sidebar.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { BadgeCheckIcon, BellIcon, ChevronsUpDownIcon, CreditCardIcon, LogOutIcon, SparklesIcon } from "lucide-react";
|
|
6
|
+
//#region src/components/registry/sidebar-07/nav-user.tsx
|
|
7
|
+
function NavUser({ user }) {
|
|
8
|
+
const { isMobile } = useSidebar();
|
|
9
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
10
|
+
render: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
11
|
+
size: "lg",
|
|
12
|
+
className: "aria-expanded:bg-muted"
|
|
13
|
+
}),
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(Avatar, { children: [/* @__PURE__ */ jsx(AvatarImage, {
|
|
16
|
+
src: user.avatar,
|
|
17
|
+
alt: user.name
|
|
18
|
+
}), /* @__PURE__ */ jsx(AvatarFallback, { children: "CN" })] }),
|
|
19
|
+
/* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "grid flex-1 text-left text-sm leading-tight",
|
|
21
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "truncate font-medium",
|
|
23
|
+
children: user.name
|
|
24
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "truncate text-xs",
|
|
26
|
+
children: user.email
|
|
27
|
+
})]
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ml-auto size-4" })
|
|
30
|
+
]
|
|
31
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
32
|
+
className: "w-fit",
|
|
33
|
+
side: isMobile ? "bottom" : "right",
|
|
34
|
+
align: "end",
|
|
35
|
+
sideOffset: 4,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
38
|
+
className: "p-0 font-normal",
|
|
39
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm",
|
|
41
|
+
children: [/* @__PURE__ */ jsxs(Avatar, { children: [/* @__PURE__ */ jsx(AvatarImage, {
|
|
42
|
+
src: user.avatar,
|
|
43
|
+
alt: user.name
|
|
44
|
+
}), /* @__PURE__ */ jsx(AvatarFallback, { children: "CN" })] }), /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "grid flex-1 text-left text-sm leading-tight",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: "truncate font-medium",
|
|
48
|
+
children: user.name
|
|
49
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "truncate text-xs",
|
|
51
|
+
children: user.email
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
})
|
|
55
|
+
}) }),
|
|
56
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
57
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(SparklesIcon, {}), "Upgrade to Pro"] }) }),
|
|
58
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
59
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [
|
|
60
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(BadgeCheckIcon, {}), "Account"] }),
|
|
61
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(CreditCardIcon, {}), "Billing"] }),
|
|
62
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(BellIcon, {}), "Notifications"] })
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
65
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { children: [/* @__PURE__ */ jsx(LogOutIcon, {}), "Log out"] })
|
|
66
|
+
]
|
|
67
|
+
})] }) }) });
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { NavUser };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/registry/sidebar-07/team-switcher.d.ts
|
|
3
|
+
export declare function TeamSwitcher({ teams }: {
|
|
4
|
+
teams: {
|
|
5
|
+
name: string;
|
|
6
|
+
logo: React$1.ReactNode;
|
|
7
|
+
plan: string;
|
|
8
|
+
}[];
|
|
9
|
+
}): React$1.JSX.Element | null;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger } from "../../ui/dropdown-menu.js";
|
|
3
|
+
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../../ui/sidebar.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronsUpDownIcon, PlusIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/registry/sidebar-07/team-switcher.tsx
|
|
8
|
+
function TeamSwitcher({ teams }) {
|
|
9
|
+
const { isMobile } = useSidebar();
|
|
10
|
+
const [activeTeam, setActiveTeam] = React$1.useState(teams[0]);
|
|
11
|
+
if (!activeTeam) return null;
|
|
12
|
+
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
|
|
13
|
+
render: /* @__PURE__ */ jsx(SidebarMenuButton, {
|
|
14
|
+
size: "lg",
|
|
15
|
+
className: "data-open:bg-sidebar-accent data-open:text-sidebar-accent-foreground"
|
|
16
|
+
}),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",
|
|
20
|
+
children: activeTeam.logo
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: "grid flex-1 text-left text-sm leading-tight",
|
|
24
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "truncate font-medium",
|
|
26
|
+
children: activeTeam.name
|
|
27
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: "truncate text-xs",
|
|
29
|
+
children: activeTeam.plan
|
|
30
|
+
})]
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "ml-auto" })
|
|
33
|
+
]
|
|
34
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
35
|
+
className: "w-fit",
|
|
36
|
+
align: "start",
|
|
37
|
+
side: isMobile ? "bottom" : "right",
|
|
38
|
+
sideOffset: 4,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(DropdownMenuGroup, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
41
|
+
className: "text-xs text-muted-foreground",
|
|
42
|
+
children: "Teams"
|
|
43
|
+
}), teams.map((team, index) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
44
|
+
onClick: () => setActiveTeam(team),
|
|
45
|
+
className: "gap-2 p-2",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "flex size-6 items-center justify-center rounded-md border",
|
|
49
|
+
children: team.logo
|
|
50
|
+
}),
|
|
51
|
+
team.name,
|
|
52
|
+
/* @__PURE__ */ jsxs(DropdownMenuShortcut, { children: ["⌘", index + 1] })
|
|
53
|
+
]
|
|
54
|
+
}, team.name))] }),
|
|
55
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
56
|
+
/* @__PURE__ */ jsx(DropdownMenuGroup, { children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
57
|
+
className: "gap-2 p-2",
|
|
58
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: "flex size-6 items-center justify-center rounded-md border bg-transparent",
|
|
60
|
+
children: /* @__PURE__ */ jsx(PlusIcon, { className: "size-4" })
|
|
61
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className: "font-medium text-muted-foreground",
|
|
63
|
+
children: "Add team"
|
|
64
|
+
})]
|
|
65
|
+
}) })
|
|
66
|
+
]
|
|
67
|
+
})] }) }) });
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { TeamSwitcher };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/siyahi/delta.d.ts
|
|
2
|
+
export interface DeltaProps {
|
|
3
|
+
/** The signed change. For `pct`, a fraction: 0.025 is 2.5%. */
|
|
4
|
+
value: number;
|
|
5
|
+
format?: "pct" | "money";
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A signed figure: ▲ in --positive, ▼ in --negative, so colour is never the only cue. */
|
|
9
|
+
export declare function Delta({ value, format, className }: DeltaProps): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useFormat } from "../../lib/format.js";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/siyahi/delta.tsx
|
|
5
|
+
/** A signed figure: ▲ in --positive, ▼ in --negative, so colour is never the only cue. */
|
|
6
|
+
function Delta({ value, format = "pct", className }) {
|
|
7
|
+
const f = useFormat();
|
|
8
|
+
const size = format === "money" ? f.money(Math.abs(value)) : f.pct(Math.abs(value));
|
|
9
|
+
const direction = value > 0 ? "up" : value < 0 ? "down" : null;
|
|
10
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
11
|
+
"data-slot": "delta",
|
|
12
|
+
className: cn("inline-flex items-center gap-1 tabular-nums", direction === "up" && "text-positive", direction === "down" && "text-negative", direction === null && "text-muted-foreground", className),
|
|
13
|
+
children: [
|
|
14
|
+
direction && /* @__PURE__ */ jsx("span", {
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
children: direction === "up" ? "▲" : "▼"
|
|
17
|
+
}),
|
|
18
|
+
direction && /* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "sr-only",
|
|
20
|
+
children: direction
|
|
21
|
+
}),
|
|
22
|
+
size
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Delta };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/components/siyahi/local-time.d.ts
|
|
2
|
+
export interface LocalTimeProps {
|
|
3
|
+
value: Date | number | string;
|
|
4
|
+
}
|
|
5
|
+
/** A time in the configured zone (14:30 IST), with the viewer's own clock in a tooltip. */
|
|
6
|
+
export declare function LocalTime({ value }: LocalTimeProps): import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
2
|
+
import { useFormat } from "../../lib/format.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/siyahi/local-time.tsx
|
|
5
|
+
/** A time in the configured zone (14:30 IST), with the viewer's own clock in a tooltip. */
|
|
6
|
+
function LocalTime({ value }) {
|
|
7
|
+
const { time } = useFormat();
|
|
8
|
+
const date = new Date(value);
|
|
9
|
+
const viewer = new Intl.DateTimeFormat(void 0, {
|
|
10
|
+
dateStyle: "medium",
|
|
11
|
+
timeStyle: "short"
|
|
12
|
+
}).format(date);
|
|
13
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
14
|
+
render: /* @__PURE__ */ jsx("time", {
|
|
15
|
+
dateTime: date.toISOString(),
|
|
16
|
+
className: "tabular-nums"
|
|
17
|
+
}),
|
|
18
|
+
children: time(date)
|
|
19
|
+
}), /* @__PURE__ */ jsxs(TooltipContent, { children: ["Your time: ", viewer] })] });
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { LocalTime };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LineData, Time } from "lightweight-charts";
|
|
2
|
+
//#region src/components/siyahi/price-chart.d.ts
|
|
3
|
+
export interface PriceChartProps {
|
|
4
|
+
data: LineData<Time>[];
|
|
5
|
+
/** Fixed height in pixels. */
|
|
6
|
+
height: number;
|
|
7
|
+
/** TradingView's licence asks for a credit on the page; turn it off on the second chart. */
|
|
8
|
+
credit?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** A TradingView Lightweight Charts price chart in the theme's colours, redrawn when the scheme changes. */
|
|
11
|
+
export declare function PriceChart({ data, height, credit }: PriceChartProps): import("react").JSX.Element;
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AreaSeries, ColorType, LineStyle, createChart } from "lightweight-charts";
|
|
4
|
+
//#region src/components/siyahi/price-chart.tsx
|
|
5
|
+
function toRgba(color) {
|
|
6
|
+
const context = document.createElement("canvas").getContext("2d", { willReadFrequently: true });
|
|
7
|
+
if (!context) return null;
|
|
8
|
+
context.fillStyle = color;
|
|
9
|
+
context.fillRect(0, 0, 1, 1);
|
|
10
|
+
const [r = 0, g = 0, b = 0, a = 0] = context.getImageData(0, 0, 1, 1).data;
|
|
11
|
+
return [
|
|
12
|
+
r,
|
|
13
|
+
g,
|
|
14
|
+
b,
|
|
15
|
+
a / 255
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
/** A TradingView Lightweight Charts price chart in the theme's colours, redrawn when the scheme changes. */
|
|
19
|
+
function PriceChart({ data, height, credit = true }) {
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const element = ref.current;
|
|
23
|
+
if (!element) return;
|
|
24
|
+
const chart = createChart(element, {
|
|
25
|
+
autoSize: true,
|
|
26
|
+
layout: {
|
|
27
|
+
attributionLogo: credit,
|
|
28
|
+
colorParsers: [toRgba],
|
|
29
|
+
background: {
|
|
30
|
+
type: ColorType.Solid,
|
|
31
|
+
color: "transparent"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
rightPriceScale: { borderVisible: false },
|
|
35
|
+
timeScale: { borderVisible: false }
|
|
36
|
+
});
|
|
37
|
+
const series = chart.addSeries(AreaSeries, { priceLineVisible: false });
|
|
38
|
+
series.setData(data);
|
|
39
|
+
chart.timeScale().fitContent();
|
|
40
|
+
const paint = () => {
|
|
41
|
+
const style = getComputedStyle(element);
|
|
42
|
+
const token = (name) => style.getPropertyValue(name).trim();
|
|
43
|
+
const line = token("--chart-1");
|
|
44
|
+
chart.applyOptions({
|
|
45
|
+
layout: {
|
|
46
|
+
textColor: token("--muted-foreground"),
|
|
47
|
+
fontFamily: style.fontFamily,
|
|
48
|
+
fontSize: parseFloat(style.fontSize)
|
|
49
|
+
},
|
|
50
|
+
grid: {
|
|
51
|
+
vertLines: { visible: false },
|
|
52
|
+
horzLines: {
|
|
53
|
+
color: token("--border"),
|
|
54
|
+
style: LineStyle.Dashed
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
series.applyOptions({
|
|
59
|
+
lineColor: line,
|
|
60
|
+
topColor: `color-mix(in oklch, ${line} 30%, transparent)`,
|
|
61
|
+
bottomColor: "transparent"
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
paint();
|
|
65
|
+
const scheme = matchMedia("(prefers-color-scheme: dark)");
|
|
66
|
+
scheme.addEventListener("change", paint);
|
|
67
|
+
return () => {
|
|
68
|
+
scheme.removeEventListener("change", paint);
|
|
69
|
+
chart.remove();
|
|
70
|
+
};
|
|
71
|
+
}, [data, credit]);
|
|
72
|
+
return /* @__PURE__ */ jsx("div", {
|
|
73
|
+
ref,
|
|
74
|
+
"data-slot": "price-chart",
|
|
75
|
+
className: "w-full font-mono text-xs",
|
|
76
|
+
style: { height }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { PriceChart };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SiyahiLocale } from "../../lib/locale.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
//#region src/components/siyahi/siyahi-provider.d.ts
|
|
4
|
+
export interface SiyahiProviderProps {
|
|
5
|
+
/** Any setting left out keeps its default: en-IN, INR, Asia/Kolkata. */
|
|
6
|
+
locale?: Partial<SiyahiLocale>;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Wrap the app once. Carries the locale and the tooltip provider shadcn asks for. */
|
|
10
|
+
export declare function SiyahiProvider({ locale, children }: SiyahiProviderProps): import("react").JSX.Element;
|
|
11
|
+
export declare function useLocale(): SiyahiLocale;
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TooltipProvider } from "../ui/tooltip.js";
|
|
2
|
+
import { defaultLocale } from "../../lib/locale.js";
|
|
3
|
+
import { createContext, use, useMemo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/siyahi/siyahi-provider.tsx
|
|
6
|
+
const LocaleContext = createContext(defaultLocale);
|
|
7
|
+
/** Wrap the app once. Carries the locale and the tooltip provider shadcn asks for. */
|
|
8
|
+
function SiyahiProvider({ locale, children }) {
|
|
9
|
+
const { numberLocale, currency, timeZone } = {
|
|
10
|
+
...defaultLocale,
|
|
11
|
+
...locale
|
|
12
|
+
};
|
|
13
|
+
const value = useMemo(() => ({
|
|
14
|
+
numberLocale,
|
|
15
|
+
currency,
|
|
16
|
+
timeZone
|
|
17
|
+
}), [
|
|
18
|
+
numberLocale,
|
|
19
|
+
currency,
|
|
20
|
+
timeZone
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ jsx(LocaleContext, {
|
|
23
|
+
value,
|
|
24
|
+
children: /* @__PURE__ */ jsx(TooltipProvider, { children })
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function useLocale() {
|
|
28
|
+
return use(LocaleContext);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SiyahiProvider, useLocale };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/siyahi/treemap.d.ts
|
|
2
|
+
export interface TreemapItem {
|
|
3
|
+
name: string;
|
|
4
|
+
/** Tile area, such as the holding's value. */
|
|
5
|
+
weight: number;
|
|
6
|
+
/** Signed change as a fraction; sets the heat. */
|
|
7
|
+
change: number;
|
|
8
|
+
}
|
|
9
|
+
/** Holdings heat map: area by weight, colour by signed change, hand-drawn SVG. */
|
|
10
|
+
export declare function Treemap({ items, height }: {
|
|
11
|
+
items: TreemapItem[];
|
|
12
|
+
height: number;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useFormat } from "../../lib/format.js";
|
|
2
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { hierarchy, treemap, treemapSquarify } from "d3-hierarchy";
|
|
5
|
+
//#region src/components/siyahi/treemap.tsx
|
|
6
|
+
function heat(change) {
|
|
7
|
+
if (change === 0) return "var(--muted)";
|
|
8
|
+
const mix = Math.min(5, Math.ceil(Math.abs(change) * 100)) * 12;
|
|
9
|
+
return `color-mix(in oklab, var(${change > 0 ? "--positive" : "--negative"}) ${mix}%, var(--card))`;
|
|
10
|
+
}
|
|
11
|
+
/** Holdings heat map: area by weight, colour by signed change, hand-drawn SVG. */
|
|
12
|
+
function Treemap({ items, height }) {
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const [width, setWidth] = useState(0);
|
|
15
|
+
const { pct } = useFormat();
|
|
16
|
+
useLayoutEffect(() => {
|
|
17
|
+
const observer = new ResizeObserver(([entry]) => setWidth(entry?.contentRect.width ?? 0));
|
|
18
|
+
if (ref.current) observer.observe(ref.current);
|
|
19
|
+
return () => observer.disconnect();
|
|
20
|
+
}, []);
|
|
21
|
+
const root = hierarchy({ children: items }).sum((d) => d.weight ?? 0);
|
|
22
|
+
const leaves = treemap().size([width, height]).paddingInner(2).tile(treemapSquarify)(root).leaves();
|
|
23
|
+
return /* @__PURE__ */ jsx("div", {
|
|
24
|
+
ref,
|
|
25
|
+
"data-slot": "treemap",
|
|
26
|
+
style: { height },
|
|
27
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
30
|
+
role: "img",
|
|
31
|
+
"aria-label": "Treemap of holdings by weight and change",
|
|
32
|
+
className: "text-xs",
|
|
33
|
+
children: leaves.map(({ data, x0, y0, x1, y1 }) => /* @__PURE__ */ jsxs("g", {
|
|
34
|
+
transform: `translate(${x0},${y0})`,
|
|
35
|
+
children: [/* @__PURE__ */ jsx("rect", {
|
|
36
|
+
width: x1 - x0,
|
|
37
|
+
height: y1 - y0,
|
|
38
|
+
rx: 4,
|
|
39
|
+
style: { fill: heat(data.change ?? 0) }
|
|
40
|
+
}), x1 - x0 > 56 && y1 - y0 > 36 && /* @__PURE__ */ jsxs("text", {
|
|
41
|
+
x: 8,
|
|
42
|
+
y: 18,
|
|
43
|
+
className: "fill-foreground",
|
|
44
|
+
children: [/* @__PURE__ */ jsx("tspan", {
|
|
45
|
+
className: "font-medium",
|
|
46
|
+
children: data.name
|
|
47
|
+
}), /* @__PURE__ */ jsxs("tspan", {
|
|
48
|
+
x: 8,
|
|
49
|
+
dy: 16,
|
|
50
|
+
children: [(data.change ?? 0) > 0 ? "▲ " : (data.change ?? 0) < 0 ? "▼ " : "", pct(Math.abs(data.change ?? 0))]
|
|
51
|
+
})]
|
|
52
|
+
})]
|
|
53
|
+
}, data.name))
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Treemap };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/components/ui/alert.d.ts
|
|
4
|
+
declare const alertVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React$1.JSX.Element;
|
|
8
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
|
+
declare function AlertAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ui/alert.tsx
|
|
6
|
+
const alertVariants = cva("group/alert relative grid w-full gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "bg-card text-card-foreground",
|
|
9
|
+
destructive: "bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { variant: "default" }
|
|
12
|
+
});
|
|
13
|
+
function Alert({ className, variant, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", {
|
|
15
|
+
"data-slot": "alert",
|
|
16
|
+
role: "alert",
|
|
17
|
+
className: cn(alertVariants({ variant }), className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function AlertTitle({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "alert-title",
|
|
24
|
+
className: cn("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function AlertDescription({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "alert-description",
|
|
31
|
+
className: cn("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function AlertAction({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"data-slot": "alert-action",
|
|
38
|
+
className: cn("absolute top-2.5 right-3", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
3
|
+
//#region src/components/ui/avatar.d.ts
|
|
4
|
+
declare function Avatar({ className, size, ...props }: Avatar$1.Root.Props & {
|
|
5
|
+
size?: "default" | "sm" | "lg";
|
|
6
|
+
}): React$1.JSX.Element;
|
|
7
|
+
declare function AvatarImage({ className, ...props }: Avatar$1.Image.Props): React$1.JSX.Element;
|
|
8
|
+
declare function AvatarFallback({ className, ...props }: Avatar$1.Fallback.Props): React$1.JSX.Element;
|
|
9
|
+
declare function AvatarBadge({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
10
|
+
declare function AvatarGroup({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
declare function AvatarGroupCount({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
|
+
//#region src/components/ui/avatar.tsx
|
|
6
|
+
function Avatar({ className, size = "default", ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
8
|
+
"data-slot": "avatar",
|
|
9
|
+
"data-size": size,
|
|
10
|
+
className: cn("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", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function AvatarImage({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
16
|
+
"data-slot": "avatar-image",
|
|
17
|
+
className: cn("aspect-square size-full rounded-full object-cover", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function AvatarFallback({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
23
|
+
"data-slot": "avatar-fallback",
|
|
24
|
+
className: cn("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function AvatarBadge({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("span", {
|
|
30
|
+
"data-slot": "avatar-badge",
|
|
31
|
+
className: cn("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", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function AvatarGroup({ className, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"data-slot": "avatar-group",
|
|
38
|
+
className: cn("group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function AvatarGroupCount({ className, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx("div", {
|
|
44
|
+
"data-slot": "avatar-group-count",
|
|
45
|
+
className: cn("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", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/components/ui/badge.d.ts
|
|
4
|
+
declare const badgeVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Badge, badgeVariants };
|