@ciridae/ui 0.2.4 → 0.2.5
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PageHeader } from "@ciridae/ui/page-header";
|
|
3
|
+
type AppShellPageBrand = {
|
|
4
|
+
name: string;
|
|
5
|
+
iconLight: string;
|
|
6
|
+
iconDark?: string;
|
|
7
|
+
};
|
|
8
|
+
type AppShellPageProps = React.ComponentProps<"div">;
|
|
9
|
+
type AppShellPageHeaderProps = Omit<React.ComponentProps<typeof PageHeader>, "children"> & {
|
|
10
|
+
actions?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
type AppShellWelcomeProps = Omit<React.ComponentProps<"div">, "title"> & {
|
|
15
|
+
brand?: AppShellPageBrand;
|
|
16
|
+
description?: React.ReactNode;
|
|
17
|
+
title: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare function AppShellPage({ className, ...props }: AppShellPageProps): React.JSX.Element;
|
|
20
|
+
declare function AppShellPageHeader({ actions, className, description, title, ...props }: AppShellPageHeaderProps): React.JSX.Element;
|
|
21
|
+
declare function AppShellWelcome({ brand, children, className, description, title, ...props }: AppShellWelcomeProps): React.JSX.Element;
|
|
22
|
+
export { AppShellPage, type AppShellPageBrand, AppShellPageHeader, type AppShellPageHeaderProps, type AppShellPageProps, AppShellWelcome, type AppShellWelcomeProps, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "@ciridae/ui/utils";
|
|
3
|
+
import { PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderMain, PageHeaderTitle, } from "@ciridae/ui/page-header";
|
|
4
|
+
import { SidebarTrigger } from "@ciridae/ui/sidebar";
|
|
5
|
+
function AppShellPage({ className, ...props }) {
|
|
6
|
+
return (_jsx("div", { "data-slot": "app-shell-page", className: cn("flex min-h-0 flex-1 flex-col bg-background text-foreground", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function AppShellPageHeader({ actions, className, description, title, ...props }) {
|
|
9
|
+
return (_jsx(PageHeader, { className: className, ...props, children: _jsxs(PageHeaderMain, { className: "relative pl-14 md:pl-6 lg:pl-8", children: [_jsx(SidebarTrigger, { className: "absolute top-1/2 left-4 -translate-y-1/2 md:hidden" }), _jsxs(PageHeaderContent, { children: [_jsx(PageHeaderTitle, { children: title }), description ? _jsx(PageHeaderDescription, { children: description }) : null] }), actions ? _jsx(PageHeaderActions, { children: actions }) : null] }) }));
|
|
10
|
+
}
|
|
11
|
+
function AppShellWelcome({ brand, children, className, description, title, ...props }) {
|
|
12
|
+
return (_jsx("div", { "data-slot": "app-shell-welcome", className: cn("flex min-h-0 flex-1 items-center justify-center p-6", className), ...props, children: _jsxs("div", { className: "flex max-w-md flex-col items-center gap-4 text-center", children: [brand ? _jsx(AppShellWelcomeBrand, { brand: brand }) : null, _jsxs("div", { className: "flex flex-col items-center gap-2", children: [_jsx("h2", { className: "text-2xl font-heading tracking-normal", children: title }), description ? (_jsx("div", { className: "text-sm text-muted-foreground [&>a]:font-medium [&>a]:text-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-foreground/72", children: description })) : null] }), children] }) }));
|
|
13
|
+
}
|
|
14
|
+
function AppShellWelcomeBrand({ brand }) {
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx("img", { alt: brand.name, className: "h-24 w-auto dark:hidden", src: brand.iconLight }), brand.iconDark ? (_jsx("img", { alt: brand.name, className: "hidden h-24 w-auto dark:block", src: brand.iconDark })) : null] }));
|
|
16
|
+
}
|
|
17
|
+
export { AppShellPage, AppShellPageHeader, AppShellWelcome, };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciridae/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
@@ -275,6 +275,10 @@
|
|
|
275
275
|
"types": "./dist/components/ui/alert.d.ts",
|
|
276
276
|
"default": "./dist/components/ui/alert.js"
|
|
277
277
|
},
|
|
278
|
+
"./app-shell-page": {
|
|
279
|
+
"types": "./dist/components/ui/app-shell-page.d.ts",
|
|
280
|
+
"default": "./dist/components/ui/app-shell-page.js"
|
|
281
|
+
},
|
|
278
282
|
"./app-shell": {
|
|
279
283
|
"types": "./dist/components/ui/app-shell.d.ts",
|
|
280
284
|
"default": "./dist/components/ui/app-shell.js"
|