@audere/ui 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.d.ts +32 -0
- package/dist/ai/index.js +98 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/charts/index.d.ts +78 -0
- package/dist/charts/index.js +388 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/composition/index.d.ts +27 -0
- package/dist/composition/index.js +61 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/data/index.d.ts +73 -0
- package/dist/data/index.js +320 -0
- package/dist/data/index.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +1350 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/index.d.ts +107 -0
- package/dist/layout/index.js +232 -0
- package/dist/layout/index.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/primitives/index.d.ts +29 -0
- package/dist/primitives/index.js +163 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/surface/index.d.ts +16 -0
- package/dist/surface/index.js +38 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/theme/index.d.ts +72 -0
- package/dist/theme/index.js +60 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/workflow/index.d.ts +38 -0
- package/dist/workflow/index.js +101 -0
- package/dist/workflow/index.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/layout/constants.ts","../../src/lib/utils.ts","../../src/layout/AppLayout.tsx","../../src/layout/feeModelerSidebarTokens.ts","../../src/layout/FeeModelerAppSidebar.tsx"],"names":["jsx","jsxs"],"mappings":";;;;;AAIO,IAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,iBAAA,EAAmB,MAAA;AAAA;AAAA,EAEnB,eAAA,EAAiB,OAAA;AAAA;AAAA,EAEjB,oBAAA,EAAsB,WAAA;AAAA;AAAA,E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A,EAAA;AAAA,oCAAAD,GAAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAW,uBAAA,CAAE,UAAA,EAAY,CAAA;AAAA,oBAC9B,IAAA,CAAK;AAAA;AAAA,iBAAA;AAAA,gBARD,IAAA,CAAK;AAAA,eASZ;AAAA,YAEJ,CAAC,CAAA,EACH;AAAA,WAAA,EAAA,EAzCM,MAAM,EA2ChB,CAAA;AAAA,QAEJ,CAAC;AAAA,OAAA,EACH,CAAA;AAAA,sBAEAC,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,wBAAE,YAAA,EAChB,QAAA,EAAA;AAAA,wBAAAA,IAAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,IAAI,QAAA,CAAS,IAAA;AAAA,YACb,SAAA,EAAW,EAAA;AAAA,cACT,uBAAA,CAAE,eAAA;AAAA,cACF,QAAA,KAAa,QAAA,CAAS,IAAA,GAAO,uBAAA,CAAE,wBAAwB,uBAAA,CAAE;AAAA,aAC3D;AAAA,YAEA,QAAA,EAAA;AAAA,8BAAAD,GAAAA,CAAC,YAAA,EAAA,EAAa,SAAA,EAAW,uBAAA,CAAE,WAAA,EAAa,CAAA;AAAA,cACvC,QAAA,CAAS;AAAA;AAAA;AAAA,SACZ;AAAA,QACC,aAAA,IAAiB;AAAA,OAAA,EACpB;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"index.js","sourcesContent":["/**\n * Audere app shell constraints — use these strings in custom layouts so spacing\n * stays aligned with {@link AppLayout}.\n */\nexport const audereShell = {\n /** Sidebar column width (Tailwind `w-64`). */\n sidebarWidthClass: \"w-64\",\n /** Offset for main column beside fixed sidebar. */\n mainGutterClass: \"pl-64\",\n /** Max width of primary content well inside the shell. */\n contentMaxWidthClass: \"max-w-6xl\",\n /** Default padding around the content well. */\n contentPaddingClass: \"p-8 lg:p-12\",\n /** Full outer shell: page canvas + typography base. */\n pageRootClass:\n \"flex min-h-screen bg-muted/30 font-sans text-foreground antialiased\",\n /** Fixed sidebar track (border + background use sidebar tokens). */\n asideTrackClass:\n \"fixed inset-y-0 z-10 flex w-64 flex-shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground\",\n /** Sticky-style header strip above content. */\n headerStripClass: \"border-b border-border bg-card/80 backdrop-blur\",\n} as const;\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import type { ReactNode } from \"react\";\n\nimport { audereShell } from \"./constants\";\nimport { cn } from \"../lib/utils\";\n\nexport type AppLayoutProps = {\n children: ReactNode;\n sidebar?: ReactNode;\n header?: ReactNode;\n};\n\nexport function AppLayout({ sidebar, header, children }: AppLayoutProps) {\n return (\n <div className={audereShell.pageRootClass}>\n <aside className={audereShell.asideTrackClass}>{sidebar}</aside>\n\n <main className={cn(\"flex flex-1 flex-col\", audereShell.mainGutterClass)}>\n <div className={audereShell.headerStripClass}>{header}</div>\n <div\n className={cn(\n \"mx-auto flex flex-1\",\n audereShell.contentMaxWidthClass,\n audereShell.contentPaddingClass,\n )}\n >\n {children}\n </div>\n </main>\n </div>\n );\n}\n","/**\n * Locked Fee Modeler app sidebar visual tokens (Shared UI).\n * Section titles are larger than nested links; nested uses muted slate-400 vs section slate-300.\n */\nexport const feeModelerSidebarTokens = {\n /** Outer aside: deep navy rail */\n /** z-40: stay above main content (cards, sticky toolbars) so nav clicks always register */\n shell: \"fixed inset-y-0 z-40 flex w-64 shrink-0 flex-col bg-slate-800 text-white\",\n /** Brand / top block above nav */\n brandRegion: \"border-b border-slate-700 p-5\",\n /** Scrollable nav region (everything above footer) */\n navScroll:\n \"min-h-0 flex-1 space-y-0.5 overflow-y-auto p-3\",\n /** flex column wrapper: scroll + footer */\n navRoot: \"flex min-h-0 flex-1 flex-col\",\n /** Optional “back” link row */\n backLink:\n \"mb-2 flex items-center gap-2 rounded-md px-3 py-2 text-xs font-medium text-slate-300 hover:bg-slate-700 hover:text-white\",\n /** Home (primary rail, same size as settings footer link) */\n primaryRailLink:\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors\",\n primaryRailLinkInactive: \"text-slate-300 hover:bg-slate-700 hover:text-white\",\n primaryRailLinkActive: \"bg-teal-600 text-white\",\n /** Collapsible section header button */\n sectionTrigger:\n \"flex w-full items-center justify-between rounded-md px-3 py-2 text-left text-sm font-semibold uppercase tracking-wider text-slate-300 hover:bg-slate-700/60\",\n /** Nested item under a section */\n nestedLink:\n \"flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px] font-medium leading-snug transition-colors\",\n nestedLinkInactive: \"text-slate-400 hover:bg-slate-700 hover:text-white\",\n nestedLinkActive: \"bg-teal-600 text-white\",\n nestedIcon: \"h-3.5 w-3.5 shrink-0 opacity-90\",\n primaryIcon: \"h-4 w-4 shrink-0\",\n sectionChevron: \"h-3.5 w-3.5 shrink-0 transition-transform\",\n /** Settings (and similar) pinned footer */\n footerRegion: \"shrink-0 border-t border-slate-700 p-3 pt-2\",\n} as const;\n","import type { ComponentType, ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { feeModelerSidebarTokens as t } from \"./feeModelerSidebarTokens\";\n\nexport type FeeModelerNavItem = {\n path: string;\n label: string;\n icon: ComponentType<{ className?: string }>;\n};\n\nexport type FeeModelerNavGroup = {\n id: string;\n label: string;\n items: FeeModelerNavItem[];\n};\n\nexport type FeeModelerSidebarLinkProps = {\n to: string;\n className?: string;\n children?: ReactNode;\n};\n\nexport type FeeModelerAppSidebarProps = {\n pathname: string;\n navigate: (to: string) => void;\n Link: ComponentType<FeeModelerSidebarLinkProps>;\n /** Logo row, optional badge, etc. */\n branding: ReactNode;\n home: FeeModelerNavItem;\n settings: FeeModelerNavItem;\n groups: FeeModelerNavGroup[];\n isGroupVisible?: (group: FeeModelerNavGroup) => boolean;\n backLink?: { to: string; label: string };\n openGroupId: string | null;\n onOpenGroupChange: (id: string | null) => void;\n /** Optional block below the Settings link (e.g. user / org line) */\n belowSettings?: ReactNode;\n};\n\nfunction ChevronRight({ open }: { open: boolean }) {\n return (\n <svg\n className={cn(t.sectionChevron, open && \"rotate-90\")}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/**\n * Fee Modeler application sidebar: accordion sections, primary Home, Settings footer.\n * Routing-agnostic: pass your router `Link` and `navigate`.\n */\nexport function FeeModelerAppSidebar({\n pathname,\n navigate,\n Link,\n branding,\n home,\n settings,\n groups,\n isGroupVisible,\n backLink,\n openGroupId,\n onOpenGroupChange,\n belowSettings,\n}: FeeModelerAppSidebarProps) {\n const visibleGroups = isGroupVisible ? groups.filter(isGroupVisible) : groups;\n const HomeIcon = home.icon;\n const SettingsIcon = settings.icon;\n\n return (\n <aside className={t.shell}>\n <div className={t.brandRegion}>{branding}</div>\n\n <nav className={t.navRoot}>\n <div className={t.navScroll}>\n {backLink ? (\n <Link to={backLink.to} className={t.backLink}>\n <span className=\"inline-flex items-center gap-2\">\n <svg\n className=\"h-3 w-3\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n aria-hidden\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n {backLink.label}\n </span>\n </Link>\n ) : null}\n\n <Link\n to={home.path}\n className={cn(\n t.primaryRailLink,\n pathname === home.path ? t.primaryRailLinkActive : t.primaryRailLinkInactive,\n )}\n >\n <HomeIcon className={t.primaryIcon} />\n {home.label}\n </Link>\n\n {visibleGroups.map((group) => {\n const isOpen = openGroupId === group.id;\n const only = group.items.length === 1 ? group.items[0] : null;\n\n // Single route per section (e.g. SETUP): use a real Link so navigation always works.\n // Accordion + navigate(first) was easy to miss under overlapping main content (low z-index).\n if (only) {\n const isActive = pathname === only.path;\n const OnlyIcon = only.icon;\n return (\n <div key={group.id} className=\"mt-1\">\n <Link\n to={only.path}\n className={cn(\n t.sectionTrigger,\n \"no-underline\",\n isActive ? \"bg-teal-600 text-white hover:bg-teal-600\" : \"\",\n )}\n >\n <span className=\"flex min-w-0 flex-1 items-center gap-2\">\n <OnlyIcon className={t.nestedIcon} />\n <span>{group.label}</span>\n </span>\n </Link>\n </div>\n );\n }\n\n return (\n <div key={group.id} className=\"mt-1\">\n <button\n type=\"button\"\n onClick={() => {\n if (isOpen) {\n onOpenGroupChange(null);\n return;\n }\n const first = group.items[0];\n if (first) {\n if (pathname !== first.path) {\n navigate(first.path);\n }\n onOpenGroupChange(group.id);\n }\n }}\n className={t.sectionTrigger}\n >\n <span>{group.label}</span>\n <ChevronRight open={isOpen} />\n </button>\n\n {isOpen && (\n <div className=\"space-y-0.5\">\n {group.items.map((item) => {\n const isActive = pathname === item.path;\n const Icon = item.icon;\n return (\n <Link\n key={item.path}\n to={item.path}\n className={cn(\n t.nestedLink,\n isActive ? t.nestedLinkActive : t.nestedLinkInactive,\n )}\n >\n <Icon className={t.nestedIcon} />\n {item.label}\n </Link>\n );\n })}\n </div>\n )}\n </div>\n );\n })}\n </div>\n\n <div className={t.footerRegion}>\n <Link\n to={settings.path}\n className={cn(\n t.primaryRailLink,\n pathname === settings.path ? t.primaryRailLinkActive : t.primaryRailLinkInactive,\n )}\n >\n <SettingsIcon className={t.primaryIcon} />\n {settings.label}\n </Link>\n {belowSettings ?? null}\n </div>\n </nav>\n </aside>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"utils.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
6
|
+
|
|
7
|
+
declare const buttonVariants: (props?: ({
|
|
8
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
9
|
+
size?: "sm" | "default" | "icon" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
|
|
15
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
declare const badgeVariants: (props?: ({
|
|
18
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
19
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
|
+
declare function Badge({ className, variant, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { Badge, Button, Input, Tabs, TabsContent, TabsList, TabsTrigger, badgeVariants, buttonVariants };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
7
|
+
|
|
8
|
+
// src/primitives/button.tsx
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
var buttonVariants = cva(
|
|
13
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
18
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
19
|
+
outline: "border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
20
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
21
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
22
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
26
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
27
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
28
|
+
icon: "size-9 rounded-md"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default",
|
|
33
|
+
size: "default"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
function Button({
|
|
38
|
+
className,
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
asChild = false,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
const Comp = asChild ? Slot : "button";
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Comp,
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "button",
|
|
49
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function Input({ className, type, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"input",
|
|
57
|
+
{
|
|
58
|
+
type,
|
|
59
|
+
"data-slot": "input",
|
|
60
|
+
className: cn(
|
|
61
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
62
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
63
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
var badgeVariants = cva(
|
|
71
|
+
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
72
|
+
{
|
|
73
|
+
variants: {
|
|
74
|
+
variant: {
|
|
75
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
76
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
77
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
78
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
defaultVariants: {
|
|
82
|
+
variant: "default"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
function Badge({
|
|
87
|
+
className,
|
|
88
|
+
variant,
|
|
89
|
+
asChild = false,
|
|
90
|
+
...props
|
|
91
|
+
}) {
|
|
92
|
+
const Comp = asChild ? Slot : "span";
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
Comp,
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "badge",
|
|
97
|
+
className: cn(badgeVariants({ variant }), className),
|
|
98
|
+
...props
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
function Tabs({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}) {
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
TabsPrimitive.Root,
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "tabs",
|
|
110
|
+
className: cn("flex flex-col gap-2", className),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function TabsList({
|
|
116
|
+
className,
|
|
117
|
+
...props
|
|
118
|
+
}) {
|
|
119
|
+
return /* @__PURE__ */ jsx(
|
|
120
|
+
TabsPrimitive.List,
|
|
121
|
+
{
|
|
122
|
+
"data-slot": "tabs-list",
|
|
123
|
+
className: cn(
|
|
124
|
+
"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",
|
|
125
|
+
className
|
|
126
|
+
),
|
|
127
|
+
...props
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function TabsTrigger({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}) {
|
|
135
|
+
return /* @__PURE__ */ jsx(
|
|
136
|
+
TabsPrimitive.Trigger,
|
|
137
|
+
{
|
|
138
|
+
"data-slot": "tabs-trigger",
|
|
139
|
+
className: cn(
|
|
140
|
+
"data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
141
|
+
className
|
|
142
|
+
),
|
|
143
|
+
...props
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
function TabsContent({
|
|
148
|
+
className,
|
|
149
|
+
...props
|
|
150
|
+
}) {
|
|
151
|
+
return /* @__PURE__ */ jsx(
|
|
152
|
+
TabsPrimitive.Content,
|
|
153
|
+
{
|
|
154
|
+
"data-slot": "tabs-content",
|
|
155
|
+
className: cn("flex-1 outline-none", className),
|
|
156
|
+
...props
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export { Badge, Button, Input, Tabs, TabsContent, TabsList, TabsTrigger, badgeVariants, buttonVariants };
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/primitives/button.tsx","../../src/primitives/input.tsx","../../src/primitives/badge.tsx","../../src/primitives/tabs.tsx"],"names":["jsx","cva","Slot"],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB,6bAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,wDAAA;AAAA,QACT,WAAA,EACE,mJAAA;AAAA,QACF,OAAA,EACE,6IAAA;AAAA,QACF,SAAA,EACE,8DAAA;AAAA,QACF,KAAA,EACE,sEAAA;AAAA,QACF,IAAA,EAAM;AAAA,OACR;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,+BAAA;AAAA,QACT,EAAA,EAAI,+CAAA;AAAA,QACJ,EAAA,EAAI,sCAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAEA,SAAS,MAAA,CAAO;AAAA,EACd,SAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,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Content":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9 rounded-md\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n","import * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n","import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"../lib/utils\";\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const surfaceVariants: (props?: ({
|
|
7
|
+
padding?: "none" | "sm" | "md" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
type SurfaceProps = React.ComponentProps<"div"> & VariantProps<typeof surfaceVariants>;
|
|
10
|
+
/**
|
|
11
|
+
* Default elevated panel for tables, metrics, charts, and grouped content.
|
|
12
|
+
* Uses theme CSS variables (`--card`, `--border`); host apps must define :root tokens.
|
|
13
|
+
*/
|
|
14
|
+
declare function Surface({ className, padding, ...props }: SurfaceProps): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { Surface, type SurfaceProps, surfaceVariants };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/surface/Surface.tsx
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var surfaceVariants = cva(
|
|
11
|
+
"rounded-xl border border-border bg-card text-card-foreground shadow-sm",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
padding: {
|
|
15
|
+
none: "p-0",
|
|
16
|
+
sm: "p-4",
|
|
17
|
+
md: "p-6"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
padding: "none"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
function Surface({ className, padding, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "surface",
|
|
30
|
+
className: cn(surfaceVariants({ padding }), className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Surface, surfaceVariants };
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/surface/Surface.tsx"],"names":[],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACAA,IAAM,eAAA,GAAkB,GAAA;AAAA,EACtB,wEAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,KAAA;AAAA,QACN,EAAA,EAAI,KAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ;AASO,SAAS,QAAQ,EAAE,SAAA,EAAW,OAAA,EAAS,GAAG,OAAM,EAAiB;AACtE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,SAAA;AAAA,MACV,WAAW,EAAA,CAAG,eAAA,CAAgB,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,MACpD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../lib/utils\";\n\nconst surfaceVariants = cva(\n \"rounded-xl border border-border bg-card text-card-foreground shadow-sm\",\n {\n variants: {\n padding: {\n none: \"p-0\",\n sm: \"p-4\",\n md: \"p-6\",\n },\n },\n defaultVariants: {\n padding: \"none\",\n },\n },\n);\n\nexport type SurfaceProps = React.ComponentProps<\"div\"> &\n VariantProps<typeof surfaceVariants>;\n\n/**\n * Default elevated panel for tables, metrics, charts, and grouped content.\n * Uses theme CSS variables (`--card`, `--border`); host apps must define :root tokens.\n */\nexport function Surface({ className, padding, ...props }: SurfaceProps) {\n return (\n <div\n data-slot=\"surface\"\n className={cn(surfaceVariants({ padding }), className)}\n {...props}\n />\n );\n}\n\nexport { surfaceVariants };\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical colour system for Audere shared UI
|
|
3
|
+
* -------------------------------------------
|
|
4
|
+
* Runtime styling uses **CSS variables on `:root`** (light / `.dark`), exposed as
|
|
5
|
+
* Tailwind utilities by the host app (`bg-background`, `text-foreground`, `border-border`,
|
|
6
|
+
* `bg-card`, `text-muted-foreground`, `bg-primary`, `bg-sidebar`, …).
|
|
7
|
+
*
|
|
8
|
+
* @audere/ui compound components use those utilities only — not raw hex or `slate-*`,
|
|
9
|
+
* except intentional semantic accents (e.g. status borders) documented on the component.
|
|
10
|
+
*
|
|
11
|
+
* Shared UI app: `src/styles/theme.css`. Other apps: align variable names with shadcn-style tokens.
|
|
12
|
+
*/
|
|
13
|
+
/** Maps to `--${key}` on :root for inline styles, canvas, or third-party charts. */
|
|
14
|
+
declare const cssVarName: {
|
|
15
|
+
readonly background: "--background";
|
|
16
|
+
readonly foreground: "--foreground";
|
|
17
|
+
readonly card: "--card";
|
|
18
|
+
readonly cardForeground: "--card-foreground";
|
|
19
|
+
readonly border: "--border";
|
|
20
|
+
readonly muted: "--muted";
|
|
21
|
+
readonly mutedForeground: "--muted-foreground";
|
|
22
|
+
readonly primary: "--primary";
|
|
23
|
+
readonly primaryForeground: "--primary-foreground";
|
|
24
|
+
readonly destructive: "--destructive";
|
|
25
|
+
readonly accent: "--accent";
|
|
26
|
+
readonly sidebar: "--sidebar";
|
|
27
|
+
readonly sidebarBorder: "--sidebar-border";
|
|
28
|
+
readonly sidebarForeground: "--sidebar-foreground";
|
|
29
|
+
readonly chart1: "--chart-1";
|
|
30
|
+
readonly chart2: "--chart-2";
|
|
31
|
+
readonly chart3: "--chart-3";
|
|
32
|
+
readonly chart4: "--chart-4";
|
|
33
|
+
readonly chart5: "--chart-5";
|
|
34
|
+
};
|
|
35
|
+
type CssVarToken = keyof typeof cssVarName;
|
|
36
|
+
/** `var(--token)` for use in `style={{ color: cssVar("primary") }}` or SVG attributes. */
|
|
37
|
+
declare function cssVar(token: CssVarToken): string;
|
|
38
|
+
|
|
39
|
+
/** Numeric rhythm for JS/layout math. Prefer Tailwind spacing scale in components when possible. */
|
|
40
|
+
declare const spacing: {
|
|
41
|
+
readonly xs: 4;
|
|
42
|
+
readonly sm: 8;
|
|
43
|
+
readonly md: 12;
|
|
44
|
+
readonly lg: 16;
|
|
45
|
+
readonly xl: 24;
|
|
46
|
+
readonly "2xl": 32;
|
|
47
|
+
};
|
|
48
|
+
type SpacingToken = keyof typeof spacing;
|
|
49
|
+
|
|
50
|
+
/** Reference sizes for non-Tailwind contexts. Host sets body font via theme / `font-sans`. */
|
|
51
|
+
declare const typography: {
|
|
52
|
+
readonly fontFamily: "'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif";
|
|
53
|
+
readonly sizes: {
|
|
54
|
+
readonly xs: 12;
|
|
55
|
+
readonly sm: 14;
|
|
56
|
+
readonly md: 16;
|
|
57
|
+
readonly lg: 18;
|
|
58
|
+
readonly xl: 20;
|
|
59
|
+
readonly "2xl": 24;
|
|
60
|
+
readonly "3xl": 30;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type TypographySizeToken = keyof typeof typography.sizes;
|
|
64
|
+
|
|
65
|
+
declare const shadows: {
|
|
66
|
+
readonly subtle: "0 1px 2px 0 rgb(15 23 42 / 0.04)";
|
|
67
|
+
readonly card: "0 1px 3px 0 rgb(15 23 42 / 0.08)";
|
|
68
|
+
readonly popover: "0 10px 40px rgb(15 23 42 / 0.22)";
|
|
69
|
+
};
|
|
70
|
+
type ShadowToken = keyof typeof shadows;
|
|
71
|
+
|
|
72
|
+
export { type CssVarToken, type ShadowToken, type SpacingToken, type TypographySizeToken, cssVar, cssVarName, shadows, spacing, typography };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/theme/colors.ts
|
|
2
|
+
var cssVarName = {
|
|
3
|
+
background: "--background",
|
|
4
|
+
foreground: "--foreground",
|
|
5
|
+
card: "--card",
|
|
6
|
+
cardForeground: "--card-foreground",
|
|
7
|
+
border: "--border",
|
|
8
|
+
muted: "--muted",
|
|
9
|
+
mutedForeground: "--muted-foreground",
|
|
10
|
+
primary: "--primary",
|
|
11
|
+
primaryForeground: "--primary-foreground",
|
|
12
|
+
destructive: "--destructive",
|
|
13
|
+
accent: "--accent",
|
|
14
|
+
sidebar: "--sidebar",
|
|
15
|
+
sidebarBorder: "--sidebar-border",
|
|
16
|
+
sidebarForeground: "--sidebar-foreground",
|
|
17
|
+
chart1: "--chart-1",
|
|
18
|
+
chart2: "--chart-2",
|
|
19
|
+
chart3: "--chart-3",
|
|
20
|
+
chart4: "--chart-4",
|
|
21
|
+
chart5: "--chart-5"
|
|
22
|
+
};
|
|
23
|
+
function cssVar(token) {
|
|
24
|
+
return `var(${cssVarName[token]})`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/theme/spacing.ts
|
|
28
|
+
var spacing = {
|
|
29
|
+
xs: 4,
|
|
30
|
+
sm: 8,
|
|
31
|
+
md: 12,
|
|
32
|
+
lg: 16,
|
|
33
|
+
xl: 24,
|
|
34
|
+
"2xl": 32
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/theme/typography.ts
|
|
38
|
+
var typography = {
|
|
39
|
+
fontFamily: "'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif",
|
|
40
|
+
sizes: {
|
|
41
|
+
xs: 12,
|
|
42
|
+
sm: 14,
|
|
43
|
+
md: 16,
|
|
44
|
+
lg: 18,
|
|
45
|
+
xl: 20,
|
|
46
|
+
"2xl": 24,
|
|
47
|
+
"3xl": 30
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/theme/shadows.ts
|
|
52
|
+
var shadows = {
|
|
53
|
+
subtle: "0 1px 2px 0 rgb(15 23 42 / 0.04)",
|
|
54
|
+
card: "0 1px 3px 0 rgb(15 23 42 / 0.08)",
|
|
55
|
+
popover: "0 10px 40px rgb(15 23 42 / 0.22)"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { cssVar, cssVarName, shadows, spacing, typography };
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/theme/colors.ts","../../src/theme/spacing.ts","../../src/theme/typography.ts","../../src/theme/shadows.ts"],"names":[],"mappings":";AAcO,IAAM,UAAA,GAAa;AAAA,EACxB,UAAA,EAAY,cAAA;AAAA,EACZ,UAAA,EAAY,cAAA;AAAA,EACZ,IAAA,EAAM,QAAA;AAAA,EACN,cAAA,EAAgB,mBAAA;AAAA,EAChB,MAAA,EAAQ,UAAA;AAAA,EACR,KAAA,EAAO,SAAA;AAAA,EACP,eAAA,EAAiB,oBAAA;AAAA,EACjB,OAAA,EAAS,WAAA;AAAA,EACT,iBAAA,EAAmB,sBAAA;AAAA,EACnB,WAAA,EAAa,eAAA;AAAA,EACb,MAAA,EAAQ,UAAA;AAAA,EACR,OAAA,EAAS,WAAA;AAAA,EACT,aAAA,EAAe,kBAAA;AAAA,EACf,iBAAA,EAAmB,sBAAA;AAAA,EACnB,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,MAAA,EAAQ;AACV;AAKO,SAAS,OAAO,KAAA,EAA4B;AACjD,EAAA,OAAO,CAAA,IAAA,EAAO,UAAA,CAAW,KAAK,CAAC,CAAA,CAAA,CAAA;AACjC;;;ACxCO,IAAM,OAAA,GAAU;AAAA,EACrB,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,CAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,EAAA,EAAI,EAAA;AAAA,EACJ,KAAA,EAAO;AACT;;;ACPO,IAAM,UAAA,GAAa;AAAA,EACxB,UAAA,EAAY,kFAAA;AAAA,EACZ,KAAA,EAAO;AAAA,IACL,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO;AAAA;AAEX;;;ACZO,IAAM,OAAA,GAAU;AAAA,EACrB,MAAA,EAAQ,kCAAA;AAAA,EACR,IAAA,EAAM,kCAAA;AAAA,EACN,OAAA,EAAS;AACX","file":"index.js","sourcesContent":["/**\n * Canonical colour system for Audere shared UI\n * -------------------------------------------\n * Runtime styling uses **CSS variables on `:root`** (light / `.dark`), exposed as\n * Tailwind utilities by the host app (`bg-background`, `text-foreground`, `border-border`,\n * `bg-card`, `text-muted-foreground`, `bg-primary`, `bg-sidebar`, …).\n *\n * @audere/ui compound components use those utilities only — not raw hex or `slate-*`,\n * except intentional semantic accents (e.g. status borders) documented on the component.\n *\n * Shared UI app: `src/styles/theme.css`. Other apps: align variable names with shadcn-style tokens.\n */\n\n/** Maps to `--${key}` on :root for inline styles, canvas, or third-party charts. */\nexport const cssVarName = {\n background: \"--background\",\n foreground: \"--foreground\",\n card: \"--card\",\n cardForeground: \"--card-foreground\",\n border: \"--border\",\n muted: \"--muted\",\n mutedForeground: \"--muted-foreground\",\n primary: \"--primary\",\n primaryForeground: \"--primary-foreground\",\n destructive: \"--destructive\",\n accent: \"--accent\",\n sidebar: \"--sidebar\",\n sidebarBorder: \"--sidebar-border\",\n sidebarForeground: \"--sidebar-foreground\",\n chart1: \"--chart-1\",\n chart2: \"--chart-2\",\n chart3: \"--chart-3\",\n chart4: \"--chart-4\",\n chart5: \"--chart-5\",\n} as const;\n\nexport type CssVarToken = keyof typeof cssVarName;\n\n/** `var(--token)` for use in `style={{ color: cssVar(\"primary\") }}` or SVG attributes. */\nexport function cssVar(token: CssVarToken): string {\n return `var(${cssVarName[token]})`;\n}\n","/** Numeric rhythm for JS/layout math. Prefer Tailwind spacing scale in components when possible. */\nexport const spacing = {\n xs: 4,\n sm: 8,\n md: 12,\n lg: 16,\n xl: 24,\n \"2xl\": 32,\n} as const;\n\nexport type SpacingToken = keyof typeof spacing;\n","/** Reference sizes for non-Tailwind contexts. Host sets body font via theme / `font-sans`. */\nexport const typography = {\n fontFamily: \"'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif\",\n sizes: {\n xs: 12,\n sm: 14,\n md: 16,\n lg: 18,\n xl: 20,\n \"2xl\": 24,\n \"3xl\": 30,\n },\n} as const;\n\nexport type TypographySizeToken = keyof typeof typography.sizes;\n","export const shadows = {\n subtle: \"0 1px 2px 0 rgb(15 23 42 / 0.04)\",\n card: \"0 1px 3px 0 rgb(15 23 42 / 0.08)\",\n popover: \"0 10px 40px rgb(15 23 42 / 0.22)\",\n} as const;\n\nexport type ShadowToken = keyof typeof shadows;\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
type TaskStatus = "todo" | "in-progress" | "done";
|
|
5
|
+
type TaskCardProps = {
|
|
6
|
+
status: TaskStatus;
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare function TaskCard({ status, title, description, footer, actions, }: TaskCardProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
type ChecklistItem = {
|
|
15
|
+
id: string | number;
|
|
16
|
+
label: string;
|
|
17
|
+
status: "todo" | "pending" | "done";
|
|
18
|
+
meta?: string;
|
|
19
|
+
};
|
|
20
|
+
type ChecklistProps = {
|
|
21
|
+
title?: string;
|
|
22
|
+
items: ChecklistItem[];
|
|
23
|
+
};
|
|
24
|
+
declare function Checklist({ title, items }: ChecklistProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
type ProgressStep = {
|
|
27
|
+
id: string | number;
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
state: "complete" | "current" | "upcoming";
|
|
31
|
+
};
|
|
32
|
+
type ProgressTrackerProps = {
|
|
33
|
+
title?: string;
|
|
34
|
+
steps: ProgressStep[];
|
|
35
|
+
};
|
|
36
|
+
declare function ProgressTracker({ title, steps }: ProgressTrackerProps): react_jsx_runtime.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { Checklist, type ChecklistItem, type ChecklistProps, type ProgressStep, ProgressTracker, type ProgressTrackerProps, TaskCard, type TaskCardProps, type TaskStatus };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// src/surface/Surface.tsx
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var surfaceVariants = cva(
|
|
11
|
+
"rounded-xl border border-border bg-card text-card-foreground shadow-sm",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
padding: {
|
|
15
|
+
none: "p-0",
|
|
16
|
+
sm: "p-4",
|
|
17
|
+
md: "p-6"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
padding: "none"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
function Surface({ className, padding, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
"data-slot": "surface",
|
|
30
|
+
className: cn(surfaceVariants({ padding }), className),
|
|
31
|
+
...props
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function TaskCard({
|
|
36
|
+
status,
|
|
37
|
+
title,
|
|
38
|
+
description,
|
|
39
|
+
footer,
|
|
40
|
+
actions
|
|
41
|
+
}) {
|
|
42
|
+
const statusLabel = status === "done" ? "Completed" : status === "in-progress" ? "In Progress" : "To Do";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Surface,
|
|
45
|
+
{
|
|
46
|
+
padding: "none",
|
|
47
|
+
className: "transition-colors hover:border-primary/30",
|
|
48
|
+
children: /* @__PURE__ */ jsxs("div", { className: "px-5 pb-5 pt-5", children: [
|
|
49
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-start justify-between gap-3", children: [
|
|
50
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground", children: statusLabel }),
|
|
51
|
+
actions
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-1 text-sm font-semibold leading-snug text-foreground", children: title }),
|
|
54
|
+
description ? /* @__PURE__ */ jsx("p", { className: "mb-4 line-clamp-2 text-xs text-muted-foreground", children: description }) : null,
|
|
55
|
+
footer ? /* @__PURE__ */ jsx("div", { className: "mt-4 border-t border-border pt-4 text-xs text-muted-foreground", children: footer }) : null
|
|
56
|
+
] })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
function Checklist({ title, items }) {
|
|
61
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", children: [
|
|
62
|
+
title ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between rounded-t-[inherit] border-b border-border bg-muted/50 px-4 py-3", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold text-foreground", children: title }) }) : null,
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "p-2", children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: "group flex cursor-pointer items-start gap-3 rounded-md p-3 transition-colors hover:bg-muted/60",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 h-5 w-5 rounded-full border border-border group-hover:border-primary" }),
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
"p",
|
|
72
|
+
{
|
|
73
|
+
className: item.status === "done" ? "text-sm font-medium text-muted-foreground line-through" : "text-sm font-medium text-foreground",
|
|
74
|
+
children: item.label
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
item.meta ? /* @__PURE__ */ jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.meta }) : null
|
|
78
|
+
] })
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
item.id
|
|
82
|
+
)) })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
function ProgressTracker({ title, steps }) {
|
|
86
|
+
return /* @__PURE__ */ jsxs(Surface, { padding: "none", children: [
|
|
87
|
+
title ? /* @__PURE__ */ jsx("div", { className: "px-4 pb-2 pt-4", children: /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: title }) }) : null,
|
|
88
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-6 px-4 pb-6 pt-2", children: /* @__PURE__ */ jsx("div", { className: "relative ml-3 space-y-6 border-l-2 border-border", children: steps.map((step) => /* @__PURE__ */ jsxs("div", { className: "relative pl-6", children: [
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute -left-[9px] top-1 flex h-4 w-4 items-center justify-center rounded-full border-2 border-border bg-card", children: [
|
|
90
|
+
step.state === "complete" ? /* @__PURE__ */ jsx("div", { className: "h-2 w-2 rounded-full bg-primary" }) : null,
|
|
91
|
+
step.state === "current" ? /* @__PURE__ */ jsx("div", { className: "h-2 w-2 animate-pulse rounded-full bg-primary/80" }) : null
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold text-foreground", children: step.title }),
|
|
94
|
+
step.description ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: step.description }) : null
|
|
95
|
+
] }, step.id)) }) })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { Checklist, ProgressTracker, TaskCard };
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
101
|
+
//# sourceMappingURL=index.js.map
|