Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"@hookform/resolvers": "^5.2.2",
"@tailor-platform/app-shell": "workspace:*",
"lucide-react": "catalog:",
"next": "16.2.6",
"react": "catalog:",
"react-dom": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-app/src/modules/custom-module.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineModule, Link, ResourceComponentProps } from "@tailor-platform/app-shell";
import { useT, labels } from "./i18n-labels";
import { ZapIcon } from "./pages/metric-card-demo";
import { Zap as ZapIcon } from "lucide-react";
import { actionPanelDemoResource } from "./pages/action-panel-demo";
import { metricCardDemoResource } from "./pages/metric-card-demo";
import { activityCardDemoResource } from "./pages/activity-card-demo";
Expand Down
71 changes: 8 additions & 63 deletions examples/nextjs-app/src/modules/pages/action-panel-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,64 +1,9 @@
import { defineResource, ActionPanel, useNavigate, useToast } from "@tailor-platform/app-shell";
import type { SVGProps } from "react";

export const ReceiptIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z" />
<path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8" />
<path d="M12 17.5v-11" />
</svg>
);

export const FileTextIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z" />
<polyline points="14 2 14 8 20 8" />
<line x1="16" x2="8" y1="13" y2="13" />
<line x1="16" x2="8" y1="17" y2="17" />
<line x1="10" x2="8" y1="9" y2="9" />
</svg>
);

export const ExternalLinkIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
<polyline points="15 3 21 3 21 9" />
<line x1="10" x2="21" y1="14" y2="3" />
</svg>
);
import {
Receipt as ReceiptIcon,
FileText as FileTextIcon,
ExternalLink as ExternalLinkIcon,
} from "lucide-react";

const ActionPanelDemoPage = () => {
const navigate = useNavigate();
Expand All @@ -85,23 +30,23 @@ const ActionPanelDemoPage = () => {
{
key: "create-invoice",
label: "Create new sales invoice",
icon: <ReceiptIcon />,
icon: <ReceiptIcon size={16} />,
onClick: () => {
toast("Create invoice clicked");
},
},
{
key: "delivery-note",
label: "Create new delivery note",
icon: <FileTextIcon />,
icon: <FileTextIcon size={16} />,
onClick: () => {
toast("Create delivery note clicked");
},
},
{
key: "view-po-demo",
label: "View Purchase Order Demo",
icon: <ExternalLinkIcon />,
icon: <ExternalLinkIcon size={16} />,
onClick: () => navigate("/custom-page/purchase-order-demo"),
},
]}
Expand Down
28 changes: 3 additions & 25 deletions examples/nextjs-app/src/modules/pages/activity-card-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Button,
Link,
} from "@tailor-platform/app-shell";
import { Check, X } from "lucide-react";

export const activityCardDemoActivities = [
{
Expand Down Expand Up @@ -120,18 +121,7 @@ const ApprovedIcon = () => (
justifyContent: "center",
}}
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="white"
strokeWidth="3"
strokeLinecap="round"
strokeLinejoin="round"
>
<polyline points="20 6 9 17 4 12" />
</svg>
<Check size={14} color="white" strokeWidth={3} />
</div>
);

Expand All @@ -147,19 +137,7 @@ const RejectedIcon = () => (
justifyContent: "center",
}}
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="white"
strokeWidth="3"
strokeLinecap="round"
strokeLinejoin="round"
>
<line x1="18" y1="6" x2="6" y2="18" />
<line x1="6" y1="6" x2="18" y2="18" />
</svg>
<X size={14} color="white" strokeWidth={3} />
</div>
);

Expand Down
24 changes: 2 additions & 22 deletions examples/nextjs-app/src/modules/pages/admin-only.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineResource, hidden, pass, type Guard } from "@tailor-platform/app-shell";
import type { SVGProps } from "react";
import { Shield as ShieldIcon } from "lucide-react";

/**
* Guard that checks if the user has admin role.
Expand All @@ -15,25 +15,6 @@ const adminOnlyGuard: Guard = ({ context }) => {
return pass();
};

const ShieldIcon = (props: SVGProps<SVGSVGElement>) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />
</svg>
);
};

export const adminOnlyResource = defineResource({
path: "admin-only",
meta: {
Expand All @@ -53,9 +34,8 @@ export const adminOnlyResource = defineResource({
}}
>
<ShieldIcon
size={24}
style={{
width: "24px",
height: "24px",
color: "hsl(var(--primary))",
}}
/>
Expand Down
6 changes: 5 additions & 1 deletion examples/nextjs-app/src/modules/pages/layout-demos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
import * as React from "react";
import { mockPurchaseOrder } from "./purchase-order-demo";
import { activityCardDemoActivities } from "./activity-card-demo";
import { ReceiptIcon, FileTextIcon, ExternalLinkIcon } from "./action-panel-demo";
import {
Receipt as ReceiptIcon,
FileText as FileTextIcon,
ExternalLink as ExternalLinkIcon,
} from "lucide-react";

/**
* Placeholder component with subtle diagonal lines pattern for empty content areas
Expand Down
23 changes: 2 additions & 21 deletions examples/nextjs-app/src/modules/pages/metric-card-demo.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
import { defineResource, Layout, MetricCard } from "@tailor-platform/app-shell";
import type { SVGProps } from "react";

export const ZapIcon = (props: SVGProps<SVGSVGElement>) => {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<path d="M4 14a1 1 0 0 1-.8-1.6l9-11A1 1 0 0 1 14 2v7h6a1 1 0 0 1 .8 1.6l-9 11A1 1 0 0 1 10 22v-7z" />
</svg>
);
};
import { Zap as ZapIcon } from "lucide-react";

const MetricCardDemoPage = () => (
<Layout>
Expand Down Expand Up @@ -50,7 +31,7 @@ const MetricCardDemoPage = () => (
value="42"
trend={{ direction: "neutral", value: "0%" }}
description="this week"
icon={<ZapIcon style={{ width: 14, height: 14 }} />}
icon={<ZapIcon size={14} />}
/>
</div>
<div className="astw:min-w-[200px] astw:flex-1">
Expand Down
66 changes: 8 additions & 58 deletions examples/nextjs-app/src/modules/pages/primitives-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,13 @@ import {
Table,
Tabs,
} from "@tailor-platform/app-shell";
import {
LayoutDashboard as LayoutDashboardIcon,
FolderKanban as FolderKanbanIcon,
Settings as SettingsIcon,
} from "lucide-react";
import * as React from "react";

const LayoutDashboardIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<rect width="7" height="9" x="3" y="3" rx="1" />
<rect width="7" height="5" x="14" y="3" rx="1" />
<rect width="7" height="5" x="3" y="16" rx="1" />
<rect width="7" height="9" x="14" y="12" rx="1" />
</svg>
);

const FolderKanbanIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z" />
<path d="M8 10v4" />
<path d="M12 10v2" />
<path d="M16 10v6" />
</svg>
);

const SettingsIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
<circle cx="12" cy="12" r="3" />
</svg>
);

export const primitiveComponentsDemoResource = defineResource({
path: "primitives-demo",
meta: {
Expand Down Expand Up @@ -467,13 +417,13 @@ export const primitiveComponentsDemoResource = defineResource({
<Tabs.Root defaultValue="overview" variant="capsule">
<Tabs.List>
<Tabs.Tab value="overview">
<LayoutDashboardIcon />
<LayoutDashboardIcon size={16} />
</Tabs.Tab>
<Tabs.Tab value="projects">
<FolderKanbanIcon />
<FolderKanbanIcon size={16} />
</Tabs.Tab>
<Tabs.Tab value="settings">
<SettingsIcon />
<SettingsIcon size={16} />
</Tabs.Tab>
</Tabs.List>
<Tabs.Panel value="overview">Overview content</Tabs.Panel>
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@tailor-platform/app-shell": "workspace:*",
"lucide-react": "^1.8.0",
"lucide-react": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"tailwindcss": "catalog:"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"encoding-japanese": "^2.2.0",
"es-toolkit": "^1.45.1",
"graphql": "^16.14.0",
"lucide-react": "^1.8.0",
"lucide-react": "catalog:",
"papaparse": "^5.5.3",
"react-hook-form": "^7.71.2",
"react-router": "^7.14.1",
Expand Down
Loading
Loading