@getgreenline/blaze-ui 1.0.48 → 1.0.49-beta.1
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/badge.js +6 -6
- package/dist/components/blaze-layout/blaze-layout.d.ts +5 -0
- package/dist/components/blaze-layout/blaze-layout.d.ts.map +1 -0
- package/dist/components/blaze-layout/blaze-layout.js +29 -0
- package/dist/components/blaze-layout/breadcrumbs.d.ts +7 -0
- package/dist/components/blaze-layout/breadcrumbs.d.ts.map +1 -0
- package/dist/components/blaze-layout/breadcrumbs.js +22 -0
- package/dist/components/blaze-layout/default-anchor.d.ts +9 -0
- package/dist/components/blaze-layout/default-anchor.d.ts.map +1 -0
- package/dist/components/blaze-layout/default-anchor.js +10 -0
- package/dist/components/blaze-layout/logo.d.ts +6 -0
- package/dist/components/blaze-layout/logo.d.ts.map +1 -0
- package/dist/components/blaze-layout/logo.js +21 -0
- package/dist/components/blaze-layout/navigation.d.ts +5 -0
- package/dist/components/blaze-layout/navigation.d.ts.map +1 -0
- package/dist/components/blaze-layout/navigation.js +23 -0
- package/dist/components/blaze-layout/page-header.d.ts +5 -0
- package/dist/components/blaze-layout/page-header.d.ts.map +1 -0
- package/dist/components/blaze-layout/page-header.js +10 -0
- package/dist/components/blaze-layout/sidebar-nav.d.ts +10 -0
- package/dist/components/blaze-layout/sidebar-nav.d.ts.map +1 -0
- package/dist/components/blaze-layout/sidebar-nav.js +40 -0
- package/dist/components/blaze-layout/types.d.ts +85 -0
- package/dist/components/blaze-layout/types.d.ts.map +1 -0
- package/dist/components/blaze-layout/user-action.d.ts +6 -0
- package/dist/components/blaze-layout/user-action.d.ts.map +1 -0
- package/dist/components/blaze-layout/user-action.js +18 -0
- package/dist/components/blaze-layout.d.ts +4 -0
- package/dist/components/blaze-layout.d.ts.map +1 -0
- package/dist/components/button-group.js +5 -5
- package/dist/components/button.js +10 -10
- package/dist/components/chart.js +3 -3
- package/dist/components/command.js +4 -4
- package/dist/components/data-table.js +7 -7
- package/dist/components/dropdown-menu.js +6 -6
- package/dist/components/field.js +14 -14
- package/dist/components/form.js +1 -1
- package/dist/components/header-app-switcher.js +2 -2
- package/dist/components/hierarchical-select.js +3 -3
- package/dist/components/item.js +6 -6
- package/dist/components/login-screen.js +3 -3
- package/dist/components/login-screen.views.js +3 -3
- package/dist/components/multi-search-select.js +3 -3
- package/dist/components/multi-select.js +3 -3
- package/dist/components/navigation-menu.js +6 -6
- package/dist/components/pagination.js +3 -3
- package/dist/components/popover.js +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/search-bar.js +1 -1
- package/dist/components/select.js +4 -4
- package/dist/components/sidebar.js +25 -25
- package/dist/components/slider.js +2 -2
- package/dist/components/table.js +6 -6
- package/dist/components/tabs.js +1 -1
- package/dist/components/toggle-group.js +2 -2
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +1 -1
package/dist/components/badge.js
CHANGED
|
@@ -3,14 +3,14 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
|
|
6
|
-
const badgeVariants = cva("tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-md tw:!border tw:!px-2 tw:!py-0.5 tw:!text-[12px] tw:!font-medium tw:!w-fit tw:!whitespace-nowrap tw:!shrink-0 [&>svg]
|
|
6
|
+
const badgeVariants = cva("tw:!inline-flex tw:!items-center tw:!justify-center tw:!rounded-md tw:!border tw:!px-2 tw:!py-0.5 tw:!text-[12px] tw:!font-medium tw:!w-fit tw:!whitespace-nowrap tw:!shrink-0 tw:[&>svg]:!size-3 tw:!gap-1 tw:[&>svg]:!pointer-events-none tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px] tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive tw:!transition-[color,box-shadow] tw:!overflow-hidden", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
|
-
default: "tw:!border-transparent tw:!bg-primary tw:!text-primary-foreground [a&]:hover
|
|
10
|
-
secondary: "tw:!border-transparent tw:!bg-secondary tw:!text-secondary-foreground [a&]:hover
|
|
11
|
-
soft: "tw:!border-primary/20 tw:!bg-primary/10 tw:!text-primary dark
|
|
12
|
-
destructive: "tw:!border-transparent tw:!bg-destructive tw:!text-white [a&]:hover
|
|
13
|
-
outline: "tw:!text-foreground [a&]:hover
|
|
9
|
+
default: "tw:!border-transparent tw:!bg-primary tw:!text-primary-foreground tw:[a&]:hover:!bg-primary/90",
|
|
10
|
+
secondary: "tw:!border-transparent tw:!bg-secondary tw:!text-secondary-foreground tw:[a&]:hover:!bg-secondary/90",
|
|
11
|
+
soft: "tw:!border-primary/20 tw:!bg-primary/10 tw:!text-primary tw:dark:!border-primary/30 tw:dark:!bg-primary/20",
|
|
12
|
+
destructive: "tw:!border-transparent tw:!bg-destructive tw:!text-white tw:[a&]:hover:!bg-destructive/90 tw:focus-visible:!ring-destructive/20 tw:dark:focus-visible:!ring-destructive/40 tw:dark:!bg-destructive/60",
|
|
13
|
+
outline: "tw:!text-foreground tw:[a&]:hover:!bg-accent tw:[a&]:hover:!text-accent-foreground",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BlazeLayoutProps } from "./types";
|
|
2
|
+
declare function BlazeLayout({ className, logo, breadcrumbs, pageHeader, navGroups, activeNavItemIds, pendingNavItemIds, currentPath, renderNavLink, renderBreadcrumbLink, topActions, appSwitcher, user, userAction, shopSwitcher, sidebarCollapsible, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, children, ...props }: BlazeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function BlazeLayoutDummyShopSwitcher(): null;
|
|
4
|
+
export { BlazeLayout, BlazeLayoutDummyShopSwitcher };
|
|
5
|
+
//# sourceMappingURL=blaze-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blaze-layout.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/blaze-layout.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,IAAS,EACT,UAAU,EACV,YAAY,EACZ,kBAA2B,EAC3B,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,gBAAgB,2CAoHlB;AAED,iBAAS,4BAA4B,SAEpC;AAED,OAAO,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { HeaderAppSwitcher } from '../header-app-switcher.js';
|
|
4
|
+
import { PageHeader } from '../page-header.js';
|
|
5
|
+
import { SidebarProvider, Sidebar, SidebarHeader, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarFooter, SidebarInset, SidebarTrigger } from '../sidebar.js';
|
|
6
|
+
import { Separator } from '../separator.js';
|
|
7
|
+
import { cn } from '../../lib/utils.js';
|
|
8
|
+
import { BlazeLayoutBreadcrumbs } from './breadcrumbs.js';
|
|
9
|
+
import { BlazeLayoutLogo } from './logo.js';
|
|
10
|
+
import { toOptionalSet } from './navigation.js';
|
|
11
|
+
import { isPageHeaderConfig } from './page-header.js';
|
|
12
|
+
import { BlazeLayoutNavItemView } from './sidebar-nav.js';
|
|
13
|
+
import { BlazeLayoutUserAction } from './user-action.js';
|
|
14
|
+
|
|
15
|
+
function BlazeLayout({ className, logo, breadcrumbs, pageHeader, navGroups, activeNavItemIds, pendingNavItemIds, currentPath, renderNavLink, renderBreadcrumbLink, topActions, appSwitcher, user = {}, userAction, shopSwitcher, sidebarCollapsible = "none", sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, children, ...props }) {
|
|
16
|
+
const activeIds = React.useMemo(() => toOptionalSet(activeNavItemIds), [activeNavItemIds]);
|
|
17
|
+
const pendingIds = React.useMemo(() => toOptionalSet(pendingNavItemIds), [pendingNavItemIds]);
|
|
18
|
+
const hasSidebarNavigation = Boolean(navGroups?.some((group) => group.items.length));
|
|
19
|
+
const isSidebarCollapsible = sidebarCollapsible !== "none";
|
|
20
|
+
return (jsx("div", { "data-slot": "blaze-layout", className: cn("blaze-ui-root tw:min-h-svh tw:bg-background", className), ...props, children: jsxs(SidebarProvider, { open: sidebarOpen, defaultOpen: defaultSidebarOpen, onOpenChange: onSidebarOpenChange, children: [jsxs(Sidebar, { collapsible: sidebarCollapsible, className: cn("tw:border-r", !isSidebarCollapsible && "tw:sticky tw:top-0 tw:h-svh tw:shrink-0"), children: [jsx(SidebarHeader, { className: "tw:h-14 tw:flex-row tw:items-center tw:border-b tw:px-3 tw:py-0", children: jsx(BlazeLayoutLogo, { logo: logo }) }), jsx(SidebarContent, { children: hasSidebarNavigation
|
|
21
|
+
? navGroups?.map((group, groupIndex) => (jsxs(SidebarGroup, { children: [group.label ? (jsx(SidebarGroupLabel, { children: group.label })) : null, jsx(SidebarGroupContent, { children: jsx(SidebarMenu, { children: group.items.map((item) => (jsx(BlazeLayoutNavItemView, { item: item, activeIds: activeIds, pendingIds: pendingIds, currentPath: currentPath, renderNavLink: renderNavLink }, item.id))) }) })] }, group.id ?? groupIndex)))
|
|
22
|
+
: null }), jsx(SidebarFooter, { children: shopSwitcher })] }), jsxs(SidebarInset, { className: "tw:min-h-0 tw:min-w-0", children: [jsxs("header", { "data-slot": "blaze-layout-topbar", className: "tw:sticky tw:top-0 tw:z-30 tw:flex tw:h-14 tw:shrink-0 tw:items-center tw:gap-3 tw:border-b tw:bg-background tw:px-4", children: [jsxs("div", { className: "tw:flex tw:min-w-0 tw:items-center tw:gap-3", children: [jsx(SidebarTrigger, { className: "tw:-ml-1 tw:size-8" }), isSidebarCollapsible ? (jsx(Separator, { orientation: "vertical", className: "tw:data-[orientation=vertical]:h-4" })) : null, jsx(BlazeLayoutBreadcrumbs, { breadcrumbs: breadcrumbs, renderBreadcrumbLink: renderBreadcrumbLink })] }), jsxs("div", { "data-slot": "blaze-layout-actions", className: "tw:ml-auto tw:flex tw:shrink-0 tw:items-center tw:gap-1", children: [topActions, appSwitcher !== false ? (jsx(HeaderAppSwitcher, { ...appSwitcher })) : null, userAction ??
|
|
23
|
+
(user !== false ? jsx(BlazeLayoutUserAction, { user: user }) : null)] })] }), jsxs("div", { "data-slot": "blaze-layout-content", className: "tw:min-h-0 tw:flex-1 tw:overflow-auto tw:px-6 tw:py-10", children: [pageHeader ? (jsx("div", { "data-slot": "blaze-layout-page-header", className: "tw:mb-8", children: isPageHeaderConfig(pageHeader) ? (jsx(PageHeader, { variant: "plain", ...pageHeader })) : (pageHeader) })) : null, jsx("div", { "data-slot": "blaze-layout-page", className: "tw:min-h-full tw:w-full", children: children })] })] })] }) }));
|
|
24
|
+
}
|
|
25
|
+
function BlazeLayoutDummyShopSwitcher() {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { BlazeLayout, BlazeLayoutDummyShopSwitcher };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlazeLayoutBreadcrumbItem, BlazeLayoutProps } from "./types";
|
|
2
|
+
declare function BlazeLayoutBreadcrumbs({ breadcrumbs, renderBreadcrumbLink, }: {
|
|
3
|
+
breadcrumbs?: BlazeLayoutBreadcrumbItem[];
|
|
4
|
+
renderBreadcrumbLink?: BlazeLayoutProps["renderBreadcrumbLink"];
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export { BlazeLayoutBreadcrumbs };
|
|
7
|
+
//# sourceMappingURL=breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/breadcrumbs.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAE1E,iBAAS,sBAAsB,CAAC,EAC9B,WAAW,EACX,oBAAoB,GACrB,EAAE;IACD,WAAW,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACzC,oBAAoB,CAAC,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,CAAA;CAChE,kDAkDA;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Breadcrumb, BreadcrumbList, BreadcrumbSeparator, BreadcrumbItem, BreadcrumbPage, BreadcrumbLink } from '../breadcrumb.js';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
import { DefaultAnchor } from './default-anchor.js';
|
|
6
|
+
|
|
7
|
+
function BlazeLayoutBreadcrumbs({ breadcrumbs, renderBreadcrumbLink, }) {
|
|
8
|
+
if (!breadcrumbs?.length)
|
|
9
|
+
return null;
|
|
10
|
+
return (jsx(Breadcrumb, { className: "tw:min-w-0", children: jsx(BreadcrumbList, { className: "tw:min-w-0 tw:flex-nowrap", children: breadcrumbs.map((item, index) => {
|
|
11
|
+
const isLast = index === breadcrumbs.length - 1;
|
|
12
|
+
const content = (jsx("span", { className: "tw:block tw:max-w-[140px] tw:truncate tw:sm:max-w-[180px] tw:md:max-w-none", children: item.label }));
|
|
13
|
+
return (jsxs(React.Fragment, { children: [index > 0 ? (jsx(BreadcrumbSeparator, { className: "tw:hidden tw:md:block" })) : null, jsx(BreadcrumbItem, { className: cn(!isLast && "tw:hidden tw:md:inline-flex", "tw:min-w-0"), children: isLast ? (jsx(BreadcrumbPage, { children: content })) : (jsx(BreadcrumbLink, { asChild: true, children: renderBreadcrumbLink ? (renderBreadcrumbLink({
|
|
14
|
+
item,
|
|
15
|
+
isActive: false,
|
|
16
|
+
isPending: false,
|
|
17
|
+
children: content,
|
|
18
|
+
})) : (jsx(DefaultAnchor, { href: item.href, onClick: item.onClick, children: content })) })) })] }, item.id));
|
|
19
|
+
}) }) }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { BlazeLayoutBreadcrumbs };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
declare function DefaultAnchor({ href, disabled, onClick, children, ...props }: React.ComponentProps<"a"> & {
|
|
3
|
+
href?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { DefaultAnchor };
|
|
9
|
+
//# sourceMappingURL=default-anchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-anchor.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/default-anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,iBAAS,aAAa,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,2CAmBA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
function DefaultAnchor({ href, disabled, onClick, children, ...props }) {
|
|
4
|
+
if (disabled || !href) {
|
|
5
|
+
return (jsx("button", { type: "button", disabled: disabled, onClick: onClick, ...props, children: children }));
|
|
6
|
+
}
|
|
7
|
+
return (jsx("a", { href: href, onClick: onClick, ...props, children: children }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { DefaultAnchor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logo.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/logo.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAc9C,iBAAS,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,2CA4C5D;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Badge } from '../badge.js';
|
|
3
|
+
import { BillingLogo } from '../../svgs/header-app-switcher-logos.js';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
|
|
6
|
+
const defaultLogo = {
|
|
7
|
+
label: (jsxs(Fragment, { children: ["BLAZE ", jsx("span", { className: "tw:text-primary", children: "BILLING" })] })),
|
|
8
|
+
};
|
|
9
|
+
function DefaultLogoMark() {
|
|
10
|
+
return jsx(BillingLogo, { className: "tw:size-7" });
|
|
11
|
+
}
|
|
12
|
+
function BlazeLayoutLogo({ logo }) {
|
|
13
|
+
const resolvedLogo = { ...defaultLogo, ...logo };
|
|
14
|
+
const sizeStyle = {
|
|
15
|
+
width: resolvedLogo.width,
|
|
16
|
+
height: resolvedLogo.height,
|
|
17
|
+
};
|
|
18
|
+
return (jsxs("div", { "data-slot": "blaze-layout-logo", className: "tw:flex tw:min-w-0 tw:items-center tw:gap-2", children: [resolvedLogo.node ? (jsx("span", { className: cn("tw:flex tw:shrink-0 tw:items-center", resolvedLogo.className), style: sizeStyle, children: resolvedLogo.node })) : resolvedLogo.src ? (jsx("img", { src: resolvedLogo.src, alt: resolvedLogo.alt ?? "", className: cn("tw:h-7 tw:w-auto tw:shrink-0", resolvedLogo.className), style: sizeStyle })) : (jsx(DefaultLogoMark, {})), resolvedLogo.label ? (jsx("span", { className: "tw:truncate tw:text-sm tw:font-bold tw:tracking-normal", children: resolvedLogo.label })) : null, resolvedLogo.beta ? (jsx(Badge, { variant: "outline", className: "tw:shrink-0 tw:text-[10px]", children: "Beta" })) : null] }));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { BlazeLayoutLogo };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BlazeLayoutNavItem } from "./types";
|
|
2
|
+
declare const toOptionalSet: (values?: Iterable<string>) => Set<string> | undefined;
|
|
3
|
+
declare function isNavItemActive(item: BlazeLayoutNavItem, activeIds?: Set<string>, currentPath?: string): boolean;
|
|
4
|
+
export { isNavItemActive, toOptionalSet };
|
|
5
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAQjD,QAAA,MAAM,aAAa,GAAI,SAAS,QAAQ,CAAC,MAAM,CAAC,4BACV,CAAA;AAEtC,iBAAS,eAAe,CACtB,IAAI,EAAE,kBAAkB,EACxB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAeT;AAED,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const cleanPath = (value) => {
|
|
2
|
+
if (!value)
|
|
3
|
+
return "";
|
|
4
|
+
const normalized = value.split(/[?#]/)[0]?.replace(/\/+$/, "") ?? "";
|
|
5
|
+
return normalized || "/";
|
|
6
|
+
};
|
|
7
|
+
const toOptionalSet = (values) => values ? new Set(values) : undefined;
|
|
8
|
+
function isNavItemActive(item, activeIds, currentPath) {
|
|
9
|
+
if (activeIds?.has(item.id))
|
|
10
|
+
return true;
|
|
11
|
+
if (item.children?.some((child) => isNavItemActive(child, activeIds, currentPath))) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
const path = cleanPath(currentPath);
|
|
15
|
+
const href = cleanPath(item.href);
|
|
16
|
+
if (!path || !href)
|
|
17
|
+
return false;
|
|
18
|
+
if (item.exact)
|
|
19
|
+
return path === href;
|
|
20
|
+
return path === href || path.startsWith(`${href}/`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { isNavItemActive, toOptionalSet };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { PageHeaderProps } from "../page-header";
|
|
3
|
+
declare function isPageHeaderConfig(value: PageHeaderProps | React.ReactNode): value is PageHeaderProps;
|
|
4
|
+
export { isPageHeaderConfig };
|
|
5
|
+
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/page-header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,iBAAS,kBAAkB,CACzB,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,SAAS,GACvC,KAAK,IAAI,eAAe,CAO1B;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BlazeLayoutNavItem, BlazeLayoutProps } from "./types";
|
|
2
|
+
declare function BlazeLayoutNavItemView({ item, activeIds, pendingIds, currentPath, renderNavLink, }: {
|
|
3
|
+
item: BlazeLayoutNavItem;
|
|
4
|
+
activeIds?: Set<string>;
|
|
5
|
+
pendingIds?: Set<string>;
|
|
6
|
+
currentPath?: string;
|
|
7
|
+
renderNavLink?: BlazeLayoutProps["renderNavLink"];
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { BlazeLayoutNavItemView };
|
|
10
|
+
//# sourceMappingURL=sidebar-nav.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-nav.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/sidebar-nav.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAWnE,iBAAS,sBAAsB,CAAC,EAC9B,IAAI,EACJ,SAAS,EACT,UAAU,EACV,WAAW,EACX,aAAa,GACd,EAAE;IACD,IAAI,EAAE,kBAAkB,CAAA;IACxB,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAA;CAClD,2CA6EA;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { SidebarMenuItem, SidebarMenuButton, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton } from '../sidebar.js';
|
|
4
|
+
import { DefaultAnchor } from './default-anchor.js';
|
|
5
|
+
import { isNavItemActive } from './navigation.js';
|
|
6
|
+
|
|
7
|
+
function renderIcon(icon) {
|
|
8
|
+
if (!icon)
|
|
9
|
+
return null;
|
|
10
|
+
if (React.isValidElement(icon))
|
|
11
|
+
return icon;
|
|
12
|
+
const Icon = icon;
|
|
13
|
+
return jsx(Icon, { className: "tw:size-4" });
|
|
14
|
+
}
|
|
15
|
+
function BlazeLayoutNavItemView({ item, activeIds, pendingIds, currentPath, renderNavLink, }) {
|
|
16
|
+
const isActive = isNavItemActive(item, activeIds, currentPath);
|
|
17
|
+
const isPending = Boolean(pendingIds?.has(item.id));
|
|
18
|
+
const content = (jsxs(Fragment, { children: [renderIcon(item.icon), jsx("span", { children: item.label })] }));
|
|
19
|
+
const link = renderNavLink ? (renderNavLink({
|
|
20
|
+
item,
|
|
21
|
+
isActive,
|
|
22
|
+
isPending,
|
|
23
|
+
ariaCurrent: isActive ? "page" : undefined,
|
|
24
|
+
children: content,
|
|
25
|
+
})) : (jsx(DefaultAnchor, { href: item.href, disabled: item.disabled, onClick: item.onClick, children: content }));
|
|
26
|
+
return (jsxs(SidebarMenuItem, { children: [jsx(SidebarMenuButton, { asChild: true, isActive: isActive, tooltip: typeof item.label === "string" ? item.label : undefined, className: "tw:[&>svg]:size-4 tw:data-[active=true]:!bg-sky-500/10 tw:data-[active=true]:!text-sky-500", children: link }), item.children?.length ? (jsx(SidebarMenuSub, { children: item.children.map((child) => {
|
|
27
|
+
const childActive = isNavItemActive(child, activeIds, currentPath);
|
|
28
|
+
const childPending = Boolean(pendingIds?.has(child.id));
|
|
29
|
+
const childContent = (jsxs(Fragment, { children: [renderIcon(child.icon), jsx("span", { children: child.label })] }));
|
|
30
|
+
return (jsx(SidebarMenuSubItem, { children: jsx(SidebarMenuSubButton, { asChild: true, isActive: childActive, children: renderNavLink ? (renderNavLink({
|
|
31
|
+
item: child,
|
|
32
|
+
isActive: childActive,
|
|
33
|
+
isPending: childPending,
|
|
34
|
+
ariaCurrent: childActive ? "page" : undefined,
|
|
35
|
+
children: childContent,
|
|
36
|
+
})) : (jsx(DefaultAnchor, { href: child.href, disabled: child.disabled, onClick: child.onClick, children: childContent })) }) }, child.id));
|
|
37
|
+
}) })) : null] }));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { BlazeLayoutNavItemView };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ComponentProps, ElementType, MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
import type { DropdownMenuItem } from "../dropdown-menu";
|
|
3
|
+
import type { HeaderAppSwitcherProps } from "../header-app-switcher";
|
|
4
|
+
import type { PageHeaderProps } from "../page-header";
|
|
5
|
+
type BlazeLayoutLinkRenderArgs<TItem> = {
|
|
6
|
+
item: TItem;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
isPending: boolean;
|
|
9
|
+
ariaCurrent?: "page";
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
type BlazeLayoutLinkRenderer<TItem> = (args: BlazeLayoutLinkRenderArgs<TItem>) => ReactNode;
|
|
13
|
+
type BlazeLayoutLogo = {
|
|
14
|
+
src?: string;
|
|
15
|
+
alt?: string;
|
|
16
|
+
node?: ReactNode;
|
|
17
|
+
label?: ReactNode;
|
|
18
|
+
beta?: boolean;
|
|
19
|
+
width?: number | string;
|
|
20
|
+
height?: number | string;
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
type BlazeLayoutBreadcrumbItem = {
|
|
24
|
+
id: string;
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
href?: string;
|
|
27
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
28
|
+
};
|
|
29
|
+
type BlazeLayoutNavItem = {
|
|
30
|
+
id: string;
|
|
31
|
+
label: ReactNode;
|
|
32
|
+
href?: string;
|
|
33
|
+
icon?: ElementType<{
|
|
34
|
+
className?: string;
|
|
35
|
+
}> | ReactNode;
|
|
36
|
+
exact?: boolean;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
39
|
+
children?: BlazeLayoutNavItem[];
|
|
40
|
+
};
|
|
41
|
+
type BlazeLayoutNavGroup = {
|
|
42
|
+
id?: string;
|
|
43
|
+
label?: ReactNode;
|
|
44
|
+
items: BlazeLayoutNavItem[];
|
|
45
|
+
};
|
|
46
|
+
type BlazeLayoutUserMenuItem = {
|
|
47
|
+
id: string;
|
|
48
|
+
label: ReactNode;
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
variant?: "default" | "destructive";
|
|
51
|
+
onSelect?: ComponentProps<typeof DropdownMenuItem>["onSelect"];
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
};
|
|
54
|
+
type BlazeLayoutUser = {
|
|
55
|
+
initials?: string;
|
|
56
|
+
name?: ReactNode;
|
|
57
|
+
email?: ReactNode;
|
|
58
|
+
avatarSrc?: string;
|
|
59
|
+
menuItems?: BlazeLayoutUserMenuItem[];
|
|
60
|
+
logoutItem?: BlazeLayoutUserMenuItem | false;
|
|
61
|
+
};
|
|
62
|
+
type BlazeLayoutSidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
63
|
+
type BlazeLayoutProps = ComponentProps<"div"> & {
|
|
64
|
+
logo?: BlazeLayoutLogo;
|
|
65
|
+
breadcrumbs?: BlazeLayoutBreadcrumbItem[];
|
|
66
|
+
pageHeader?: PageHeaderProps | ReactNode;
|
|
67
|
+
navGroups?: BlazeLayoutNavGroup[];
|
|
68
|
+
activeNavItemIds?: Iterable<string>;
|
|
69
|
+
pendingNavItemIds?: Iterable<string>;
|
|
70
|
+
currentPath?: string;
|
|
71
|
+
renderNavLink?: BlazeLayoutLinkRenderer<BlazeLayoutNavItem>;
|
|
72
|
+
renderBreadcrumbLink?: BlazeLayoutLinkRenderer<BlazeLayoutBreadcrumbItem>;
|
|
73
|
+
topActions?: ReactNode;
|
|
74
|
+
appSwitcher?: HeaderAppSwitcherProps | false;
|
|
75
|
+
user?: BlazeLayoutUser | false;
|
|
76
|
+
userAction?: ReactNode;
|
|
77
|
+
shopSwitcher?: ReactNode;
|
|
78
|
+
sidebarCollapsible?: BlazeLayoutSidebarCollapsible;
|
|
79
|
+
sidebarOpen?: boolean;
|
|
80
|
+
defaultSidebarOpen?: boolean;
|
|
81
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
};
|
|
84
|
+
export type { BlazeLayoutBreadcrumbItem, BlazeLayoutLinkRenderArgs, BlazeLayoutLinkRenderer, BlazeLayoutLogo, BlazeLayoutNavGroup, BlazeLayoutNavItem, BlazeLayoutProps, BlazeLayoutSidebarCollapsible, BlazeLayoutUser, BlazeLayoutUserMenuItem, };
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-action.d.ts","sourceRoot":"","sources":["../../../src/components/blaze-layout/user-action.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,iBAAS,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,eAAe,CAAA;CAAE,2CAuElE;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { LogOutIcon } from 'lucide-react';
|
|
3
|
+
import { Avatar, AvatarImage, AvatarFallback } from '../avatar.js';
|
|
4
|
+
import { Button } from '../button.js';
|
|
5
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem } from '../dropdown-menu.js';
|
|
6
|
+
|
|
7
|
+
function BlazeLayoutUserAction({ user }) {
|
|
8
|
+
const resolvedUser = {
|
|
9
|
+
initials: "U",
|
|
10
|
+
name: "User",
|
|
11
|
+
...user,
|
|
12
|
+
};
|
|
13
|
+
const menuItems = resolvedUser.menuItems ?? [];
|
|
14
|
+
const logoutItem = resolvedUser.logoutItem;
|
|
15
|
+
return (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button, { variant: "ghost", size: "icon", "aria-label": "User menu", children: jsxs(Avatar, { className: "tw:size-8", children: [resolvedUser.avatarSrc ? (jsx(AvatarImage, { src: resolvedUser.avatarSrc, alt: "" })) : null, jsx(AvatarFallback, { className: "tw:text-xs tw:font-medium", children: resolvedUser.initials })] }) }) }), jsxs(DropdownMenuContent, { align: "end", className: "tw:w-56", children: [jsxs(DropdownMenuLabel, { className: "tw:flex tw:min-w-0 tw:items-center tw:gap-2", children: [jsxs(Avatar, { children: [resolvedUser.avatarSrc ? (jsx(AvatarImage, { src: resolvedUser.avatarSrc, alt: "" })) : null, jsx(AvatarFallback, { className: "tw:text-xs tw:font-medium", children: resolvedUser.initials })] }), jsxs("span", { className: "tw:min-w-0 tw:leading-tight", children: [jsx("span", { className: "tw:block tw:truncate tw:font-semibold", children: resolvedUser.name }), resolvedUser.email ? (jsx("span", { className: "tw:block tw:truncate tw:text-xs tw:text-muted-foreground", children: resolvedUser.email })) : null] })] }), menuItems.length || logoutItem !== false ? (jsx(DropdownMenuSeparator, {})) : null, menuItems.map((item) => (jsxs(DropdownMenuItem, { variant: item.variant, disabled: item.disabled, onSelect: item.onSelect, children: [item.icon, item.label] }, item.id))), logoutItem !== false ? (jsxs(DropdownMenuItem, { variant: logoutItem?.variant ?? "destructive", disabled: logoutItem?.disabled, onSelect: logoutItem?.onSelect, children: [logoutItem?.icon ?? jsx(LogOutIcon, { className: "tw:size-4" }), logoutItem?.label ?? "Sign out"] })) : null] })] }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { BlazeLayoutUserAction };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { BlazeLayout, BlazeLayoutDummyShopSwitcher, } from "./blaze-layout/blaze-layout";
|
|
2
|
+
export { BlazeLayoutUserAction } from "./blaze-layout/user-action";
|
|
3
|
+
export type { BlazeLayoutBreadcrumbItem, BlazeLayoutLinkRenderArgs, BlazeLayoutLinkRenderer, BlazeLayoutLogo, BlazeLayoutNavGroup, BlazeLayoutNavItem, BlazeLayoutProps, BlazeLayoutSidebarCollapsible, BlazeLayoutUser, BlazeLayoutUserMenuItem, } from "./blaze-layout/types";
|
|
4
|
+
//# sourceMappingURL=blaze-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blaze-layout.d.ts","sourceRoot":"","sources":["../../src/components/blaze-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,4BAA4B,GAC7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,6BAA6B,EAC7B,eAAe,EACf,uBAAuB,GACxB,MAAM,sBAAsB,CAAA"}
|
|
@@ -4,11 +4,11 @@ import { cva } from 'class-variance-authority';
|
|
|
4
4
|
import { cn } from '../lib/utils.js';
|
|
5
5
|
import { Separator } from './separator.js';
|
|
6
6
|
|
|
7
|
-
const buttonGroupVariants = cva("tw:flex tw:w-fit tw:items-stretch [&>*]:focus-visible:
|
|
7
|
+
const buttonGroupVariants = cva("tw:flex tw:w-fit tw:items-stretch tw:[&>*]:focus-visible:z-10 tw:[&>*]:focus-visible:relative tw:[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit tw:[&>input]:flex-1 tw:has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md tw:has-[>[data-slot=button-group]]:gap-2", {
|
|
8
8
|
variants: {
|
|
9
9
|
orientation: {
|
|
10
|
-
horizontal: "[&>*:not(:first-child)]:
|
|
11
|
-
vertical: "tw:flex-col [&>*:not(:first-child)]:
|
|
10
|
+
horizontal: "tw:[&>*:not(:first-child)]:rounded-l-none tw:[&>*:not(:first-child)]:border-l-0 tw:[&>*:not(:last-child)]:rounded-r-none",
|
|
11
|
+
vertical: "tw:flex-col tw:[&>*:not(:first-child)]:rounded-t-none tw:[&>*:not(:first-child)]:border-t-0 tw:[&>*:not(:last-child)]:rounded-b-none",
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: {
|
|
@@ -20,10 +20,10 @@ function ButtonGroup({ className, orientation, ...props }) {
|
|
|
20
20
|
}
|
|
21
21
|
function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
22
22
|
const Comp = asChild ? Slot : "div";
|
|
23
|
-
return (jsx(Comp, { className: cn("tw:bg-muted tw:flex tw:items-center tw:gap-2 tw:rounded-md tw:border tw:px-4 tw:text-sm tw:font-medium tw:shadow-xs [&_svg]:
|
|
23
|
+
return (jsx(Comp, { className: cn("tw:bg-muted tw:flex tw:items-center tw:gap-2 tw:rounded-md tw:border tw:px-4 tw:text-sm tw:font-medium tw:shadow-xs tw:[&_svg]:pointer-events-none tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
26
|
-
return (jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("tw:bg-input tw:relative
|
|
26
|
+
return (jsx(Separator, { "data-slot": "button-group-separator", orientation: orientation, className: cn("tw:bg-input tw:relative tw:!m-0 tw:self-stretch tw:data-[orientation=vertical]:h-auto", className), ...props }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -5,20 +5,20 @@ import { cva } from 'class-variance-authority';
|
|
|
5
5
|
import { LoaderCircleIcon } from 'lucide-react';
|
|
6
6
|
import { cn } from '../lib/utils.js';
|
|
7
7
|
|
|
8
|
-
const buttonVariants = cva("tw:!relative tw:!inline-flex tw:!items-center tw:!justify-center tw:!gap-2 tw:!whitespace-nowrap tw:rounded-md tw:text-sm tw:!font-medium tw:!transition-all tw:!cursor-pointer disabled
|
|
8
|
+
const buttonVariants = cva("tw:!relative tw:!inline-flex tw:!items-center tw:!justify-center tw:!gap-2 tw:!whitespace-nowrap tw:rounded-md tw:text-sm tw:!font-medium tw:!transition-all tw:!cursor-pointer tw:disabled:!cursor-not-allowed tw:disabled:!pointer-events-none tw:data-[disabled]:!pointer-events-none tw:data-[loading]:!pointer-events-none tw:disabled:!opacity-50 tw:data-[disabled]:!opacity-50 tw:[&_svg]:!pointer-events-none tw:[&_svg:not([class*='size-'])]:!size-4 tw:!shrink-0 tw:[&_svg]:!shrink-0 tw:!outline-none tw:focus-visible:!border-ring tw:focus-visible:!ring-ring/50 tw:focus-visible:!ring-[3px] tw:aria-invalid:!ring-destructive/20 tw:dark:aria-invalid:!ring-destructive/40 tw:aria-invalid:!border-destructive", {
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: "tw:!bg-primary tw:!text-primary-foreground tw:!shadow-xs hover
|
|
12
|
-
destructive: "tw:!bg-destructive tw:!text-white tw:!shadow-xs hover
|
|
13
|
-
outline: "tw:!border tw:!bg-background tw:!shadow-xs hover
|
|
14
|
-
secondary: "tw:!bg-secondary tw:!text-secondary-foreground tw:!shadow-xs hover
|
|
15
|
-
ghost: "hover
|
|
16
|
-
link: "tw:!text-primary tw:!underline-offset-4 hover
|
|
11
|
+
default: "tw:!bg-primary tw:!text-primary-foreground tw:!shadow-xs tw:hover:!bg-primary/90",
|
|
12
|
+
destructive: "tw:!bg-destructive tw:!text-white tw:!shadow-xs tw:hover:!bg-destructive/90 tw:focus-visible:!ring-destructive/20 tw:dark:focus-visible:!ring-destructive/40 tw:dark:!bg-destructive/60",
|
|
13
|
+
outline: "tw:!border tw:!bg-background tw:!shadow-xs tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:dark:!bg-input/30 tw:dark:!border-input tw:dark:hover:!bg-input/50",
|
|
14
|
+
secondary: "tw:!bg-secondary tw:!text-secondary-foreground tw:!shadow-xs tw:hover:!bg-secondary/80",
|
|
15
|
+
ghost: "tw:hover:!bg-accent tw:hover:!text-accent-foreground tw:dark:hover:!bg-accent/50",
|
|
16
|
+
link: "tw:!text-primary tw:!underline-offset-4 tw:hover:!underline",
|
|
17
17
|
},
|
|
18
18
|
size: {
|
|
19
|
-
default: "tw:!h-9 tw:!px-4 tw:!py-2 has-[>svg]
|
|
20
|
-
sm: "tw:!h-8 tw:!rounded-md tw:!gap-1.5 tw:!px-3 has-[>svg]
|
|
21
|
-
lg: "tw:!h-10 tw:!rounded-md tw:!px-6 has-[>svg]
|
|
19
|
+
default: "tw:!h-9 tw:!px-4 tw:!py-2 tw:has-[>svg]:!px-3",
|
|
20
|
+
sm: "tw:!h-8 tw:!rounded-md tw:!gap-1.5 tw:!px-3 tw:has-[>svg]:!px-2.5",
|
|
21
|
+
lg: "tw:!h-10 tw:!rounded-md tw:!px-6 tw:has-[>svg]:!px-4",
|
|
22
22
|
icon: "tw:!size-9",
|
|
23
23
|
},
|
|
24
24
|
},
|
package/dist/components/chart.js
CHANGED
|
@@ -16,7 +16,7 @@ function useChart() {
|
|
|
16
16
|
function ChartContainer({ id, className, children, config, ...props }) {
|
|
17
17
|
const uniqueId = React.useId();
|
|
18
18
|
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
19
|
-
return (jsx(ChartContext.Provider, { value: { config }, children: jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("[&_.recharts-cartesian-axis-tick_text]:
|
|
19
|
+
return (jsx(ChartContext.Provider, { value: { config }, children: jsxs("div", { "data-slot": "chart", "data-chart": chartId, className: cn("tw:[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground tw:[&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 tw:[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border tw:[&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border tw:[&_.recharts-radial-bar-background-sector]:fill-muted tw:[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted tw:[&_.recharts-reference-line_[stroke='#ccc']]:stroke-border tw:flex tw:aspect-video tw:justify-center tw:text-xs tw:[&_.recharts-dot[stroke='#fff']]:stroke-transparent tw:[&_.recharts-layer]:outline-hidden tw:[&_.recharts-sector]:outline-hidden tw:[&_.recharts-sector[stroke='#fff']]:stroke-transparent tw:[&_.recharts-surface]:outline-hidden", className), ...props, children: [jsx(ChartStyle, { id: chartId, config: config }), jsx(RechartsPrimitive.ResponsiveContainer, { children: children })] }) }));
|
|
20
20
|
}
|
|
21
21
|
const ChartStyle = ({ id, config }) => {
|
|
22
22
|
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
@@ -78,7 +78,7 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
78
78
|
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
79
79
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
80
80
|
const indicatorColor = color || item.payload?.fill || item.color;
|
|
81
|
-
return (jsx("div", { className: cn("[&>svg]:
|
|
81
|
+
return (jsx("div", { className: cn("tw:[&>svg]:text-muted-foreground tw:flex tw:w-full tw:flex-wrap tw:items-stretch tw:gap-2 tw:[&>svg]:h-2.5 tw:[&>svg]:w-2.5", indicator === "dot" && "tw:items-center"), children: formatter && item?.value !== undefined && item.name ? (formatter(item.value, item.name, item, index, item.payload)) : (jsxs(Fragment, { children: [itemConfig?.icon ? (jsx(itemConfig.icon, {})) : (!hideIndicator && (jsx("div", { className: cn("tw:shrink-0 tw:rounded-[2px] tw:border-(--color-border) tw:bg-(--color-bg)", {
|
|
82
82
|
"tw:h-2.5 tw:w-2.5": indicator === "dot",
|
|
83
83
|
"tw:w-1": indicator === "line",
|
|
84
84
|
"tw:w-0 tw:border-[1.5px] tw:border-dashed tw:bg-transparent": indicator === "dashed",
|
|
@@ -100,7 +100,7 @@ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlig
|
|
|
100
100
|
.map((item) => {
|
|
101
101
|
const key = `${nameKey || item.dataKey || "value"}`;
|
|
102
102
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
103
|
-
return (jsxs("div", { className: cn("[&>svg]:
|
|
103
|
+
return (jsxs("div", { className: cn("tw:[&>svg]:text-muted-foreground tw:flex tw:items-center tw:gap-1.5 tw:[&>svg]:h-3 tw:[&>svg]:w-3"), children: [itemConfig?.icon && !hideIcon ? (jsx(itemConfig.icon, {})) : (jsx("div", { className: "tw:h-2 tw:w-2 tw:shrink-0 tw:rounded-[2px]", style: {
|
|
104
104
|
backgroundColor: item.color,
|
|
105
105
|
} })), itemConfig?.label] }, String(item.value ?? item.dataKey ?? item.name)));
|
|
106
106
|
}) }));
|
|
@@ -8,10 +8,10 @@ function Command({ className, ...props }) {
|
|
|
8
8
|
return (jsx(Command$1, { "data-slot": "command", className: cn("tw:bg-popover tw:text-popover-foreground tw:flex tw:h-full tw:w-full tw:flex-col tw:overflow-hidden tw:rounded-md", className), ...props }));
|
|
9
9
|
}
|
|
10
10
|
function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
|
|
11
|
-
return (jsxs(Dialog, { ...props, children: [jsxs(DialogHeader, { className: "tw:sr-only", children: [jsx(DialogTitle, { children: title }), jsx(DialogDescription, { children: description })] }), jsx(DialogContent, { className: cn("tw:overflow-hidden tw:p-0", className), showCloseButton: showCloseButton, children: jsx(Command, { className: "[&_[cmdk-group-heading]]:
|
|
11
|
+
return (jsxs(Dialog, { ...props, children: [jsxs(DialogHeader, { className: "tw:sr-only", children: [jsx(DialogTitle, { children: title }), jsx(DialogDescription, { children: description })] }), jsx(DialogContent, { className: cn("tw:overflow-hidden tw:p-0", className), showCloseButton: showCloseButton, children: jsx(Command, { className: "tw:[&_[cmdk-group-heading]]:text-muted-foreground tw:**:data-[slot=command-input-wrapper]:h-12 tw:[&_[cmdk-group-heading]]:px-2 tw:[&_[cmdk-group-heading]]:font-medium tw:[&_[cmdk-group]]:px-2 tw:[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 tw:[&_[cmdk-input-wrapper]_svg]:h-5 tw:[&_[cmdk-input-wrapper]_svg]:w-5 tw:[&_[cmdk-input]]:h-12 tw:[&_[cmdk-item]]:px-2 tw:[&_[cmdk-item]]:py-3 tw:[&_[cmdk-item]_svg]:h-5 tw:[&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
12
12
|
}
|
|
13
13
|
function CommandInput({ className, ...props }) {
|
|
14
|
-
return (jsxs("div", { "data-slot": "command-input-wrapper", className: "tw:flex tw:h-9 tw:items-center tw:gap-2 tw:border-b tw:px-3", children: [jsx(SearchIcon, { className: "tw:size-4 tw:shrink-0 tw:opacity-50" }), jsx(Command$1.Input, { "data-slot": "command-input", className: cn("placeholder:
|
|
14
|
+
return (jsxs("div", { "data-slot": "command-input-wrapper", className: "tw:flex tw:h-9 tw:items-center tw:gap-2 tw:border-b tw:px-3", children: [jsx(SearchIcon, { className: "tw:size-4 tw:shrink-0 tw:opacity-50" }), jsx(Command$1.Input, { "data-slot": "command-input", className: cn("tw:placeholder:text-muted-foreground tw:flex tw:h-10 tw:w-full tw:rounded-md tw:bg-transparent tw:py-3 tw:text-sm tw:outline-hidden tw:disabled:cursor-not-allowed tw:disabled:opacity-50", className), ...props })] }));
|
|
15
15
|
}
|
|
16
16
|
function CommandList({ className, ...props }) {
|
|
17
17
|
return (jsx(Command$1.List, { "data-slot": "command-list", className: cn("tw:max-h-[300px] tw:scroll-py-1 tw:overflow-x-hidden tw:overflow-y-auto", className), ...props }));
|
|
@@ -20,13 +20,13 @@ function CommandEmpty({ ...props }) {
|
|
|
20
20
|
return (jsx(Command$1.Empty, { "data-slot": "command-empty", className: "tw:py-6 tw:text-center tw:text-sm", ...props }));
|
|
21
21
|
}
|
|
22
22
|
function CommandGroup({ className, ...props }) {
|
|
23
|
-
return (jsx(Command$1.Group, { "data-slot": "command-group", className: cn("tw:text-foreground [&_[cmdk-group-heading]]:
|
|
23
|
+
return (jsx(Command$1.Group, { "data-slot": "command-group", className: cn("tw:text-foreground tw:[&_[cmdk-group-heading]]:text-muted-foreground tw:overflow-hidden tw:p-1 tw:[&_[cmdk-group-heading]]:px-2 tw:[&_[cmdk-group-heading]]:py-1.5 tw:[&_[cmdk-group-heading]]:text-xs tw:[&_[cmdk-group-heading]]:font-medium", className), ...props }));
|
|
24
24
|
}
|
|
25
25
|
function CommandSeparator({ className, ...props }) {
|
|
26
26
|
return (jsx(Command$1.Separator, { "data-slot": "command-separator", className: cn("tw:bg-border tw:-mx-1 tw:h-px", className), ...props }));
|
|
27
27
|
}
|
|
28
28
|
function CommandItem({ className, ...props }) {
|
|
29
|
-
return (jsx(Command$1.Item, { "data-slot": "command-item", className: cn("data-[selected=true]:
|
|
29
|
+
return (jsx(Command$1.Item, { "data-slot": "command-item", className: cn("tw:data-[selected=true]:bg-accent tw:data-[selected=true]:text-accent-foreground tw:[&_svg:not([class*='text-'])]:text-muted-foreground tw:relative tw:flex tw:cursor-default tw:items-center tw:gap-2 tw:rounded-sm tw:px-2 tw:py-1.5 tw:text-sm tw:outline-hidden tw:select-none tw:data-[disabled=true]:pointer-events-none tw:data-[disabled=true]:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:shrink-0 tw:[&_svg:not([class*='size-'])]:size-4", className), ...props }));
|
|
30
30
|
}
|
|
31
31
|
function CommandShortcut({ className, ...props }) {
|
|
32
32
|
return (jsx("span", { "data-slot": "command-shortcut", className: cn("tw:text-muted-foreground tw:ml-auto tw:text-xs tw:tracking-widest", className), ...props }));
|