@craftzbay/ui 0.4.0 → 0.6.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/README.md +2 -2
- package/dist-lib/catalog.d.ts +8 -0
- package/dist-lib/components/patterns/AppShell.d.ts +142 -4
- package/dist-lib/components/patterns/DataTablePage.d.ts +81 -1
- package/dist-lib/components/patterns/FirstRunEmpty.d.ts +39 -1
- package/dist-lib/components/patterns/Onboarding.d.ts +65 -1
- package/dist-lib/components/patterns/Pricing.d.ts +40 -1
- package/dist-lib/components/patterns/RecordDetail.d.ts +48 -1
- package/dist-lib/components/patterns/Settings.d.ts +34 -1
- package/dist-lib/components/ui/EmptyState.d.ts +22 -7
- package/dist-lib/components/ui/ErrorState.d.ts +15 -4
- package/dist-lib/icons/index.d.ts +1 -1
- package/dist-lib/index.cjs +2 -4
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.js +2973 -4944
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/showcase/components/Accordion.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Alert.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Avatar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Badge.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Breadcrumbs.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Button.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Calendar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Card.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Carousel.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Chart.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Checkbox.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Combobox.docs.d.ts +3 -0
- package/dist-lib/showcase/components/CommandPalette.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ContextMenu.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DataGrid.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DatePicker.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Dialog.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Drawer.docs.d.ts +3 -0
- package/dist-lib/showcase/components/DropdownMenu.docs.d.ts +3 -0
- package/dist-lib/showcase/components/EmptyState.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ErrorState.docs.d.ts +3 -0
- package/dist-lib/showcase/components/FileUpload.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Form.docs.d.ts +3 -0
- package/dist-lib/showcase/components/IconButton.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Input.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Kbd.docs.d.ts +3 -0
- package/dist-lib/showcase/components/MultiSelect.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Pagination.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Popover.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Progress.docs.d.ts +3 -0
- package/dist-lib/showcase/components/RadioGroup.docs.d.ts +3 -0
- package/dist-lib/showcase/components/ScrollArea.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Select.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Separator.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Sheet.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Sidebar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Skeleton.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Slider.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Snackbar.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Spinner.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Stepper.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Switch.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Table.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tabs.docs.d.ts +3 -0
- package/dist-lib/showcase/components/TagInput.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Textarea.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Timeline.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Toast.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tooltip.docs.d.ts +3 -0
- package/dist-lib/showcase/components/TopNav.docs.d.ts +3 -0
- package/dist-lib/showcase/components/Tree.docs.d.ts +3 -0
- package/dist-lib/showcase/guides/DarkMode.d.ts +1 -0
- package/dist-lib/showcase/guides/Forms.d.ts +1 -0
- package/dist-lib/showcase/guides/Responsive.d.ts +1 -0
- package/dist-lib/showcase/guides/Theming.d.ts +1 -0
- package/dist-lib/showcase/layout/DocLayout.d.ts +22 -0
- package/dist-lib/showcase/layout/DocSidebar.d.ts +27 -0
- package/dist-lib/showcase/layout/ShowcaseTopBar.d.ts +13 -0
- package/dist-lib/showcase/layout/sidebars.d.ts +14 -0
- package/dist-lib/showcase/pages/ComponentDocPage.d.ts +6 -0
- package/dist-lib/showcase/pages/ComponentsIndexPage.d.ts +1 -0
- package/dist-lib/showcase/pages/GuidePage.d.ts +6 -0
- package/dist-lib/showcase/pages/GuidesIndexPage.d.ts +1 -0
- package/dist-lib/showcase/pages/HomePage.d.ts +1 -0
- package/dist-lib/showcase/pages/TemplateDocPage.d.ts +6 -0
- package/dist-lib/showcase/pages/TemplatesIndexPage.d.ts +1 -0
- package/dist-lib/showcase/registry/components.d.ts +4 -0
- package/dist-lib/showcase/registry/guides.d.ts +3 -0
- package/dist-lib/showcase/registry/templates.d.ts +3 -0
- package/dist-lib/showcase/registry/types.d.ts +69 -0
- package/dist-lib/showcase/routing.d.ts +39 -0
- package/dist-lib/showcase/templates/AuthForgot.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthMagic.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthSignIn.template.d.ts +3 -0
- package/dist-lib/showcase/templates/AuthSignUp.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Dashboard.template.d.ts +3 -0
- package/dist-lib/showcase/templates/DataTable.template.d.ts +3 -0
- package/dist-lib/showcase/templates/FirstRunEmpty.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Onboarding.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Pricing.template.d.ts +3 -0
- package/dist-lib/showcase/templates/RecordDetail.template.d.ts +3 -0
- package/dist-lib/showcase/templates/Settings.template.d.ts +3 -0
- package/dist-lib/showcase/widgets/CodeBlock.d.ts +12 -0
- package/dist-lib/showcase/widgets/CodePreview.d.ts +14 -0
- package/dist-lib/showcase/widgets/PropsTable.d.ts +10 -0
- package/dist-lib/showcase/widgets/SectionAnchor.d.ts +13 -0
- package/package.json +16 -22
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DarkModeBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FormsBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ResponsiveBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ThemingBody(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DocSidebarSection } from './DocSidebar';
|
|
3
|
+
import { Route } from '../routing';
|
|
4
|
+
interface DocLayoutProps {
|
|
5
|
+
sidebar: DocSidebarSection[];
|
|
6
|
+
topLinks?: {
|
|
7
|
+
label: string;
|
|
8
|
+
route: Route;
|
|
9
|
+
}[];
|
|
10
|
+
current: {
|
|
11
|
+
kind: Route['kind'];
|
|
12
|
+
slug?: string;
|
|
13
|
+
};
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Two-column doc shell: left sidebar (sticky), right scrollable content.
|
|
18
|
+
* The sticky ShowcaseTopBar sits above this in App.tsx, so the sidebar
|
|
19
|
+
* top offset is 3.5rem (h-14).
|
|
20
|
+
*/
|
|
21
|
+
export declare function DocLayout({ sidebar, topLinks, current, children }: DocLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Route } from '../routing';
|
|
2
|
+
export interface DocSidebarEntry {
|
|
3
|
+
slug: string;
|
|
4
|
+
label: string;
|
|
5
|
+
group: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DocSidebarSection {
|
|
8
|
+
/** Heading rendered above the section. Use 'top' for the "Get started" links. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** kind = 'component' | 'template' | 'guide' — used to build the URL. */
|
|
11
|
+
kind: 'component' | 'template' | 'guide';
|
|
12
|
+
entries: DocSidebarEntry[];
|
|
13
|
+
}
|
|
14
|
+
interface DocSidebarProps {
|
|
15
|
+
sections: DocSidebarSection[];
|
|
16
|
+
current?: {
|
|
17
|
+
kind: Route['kind'];
|
|
18
|
+
slug?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Top links: Overview / Components index / Templates index / Guides index. */
|
|
21
|
+
topLinks?: {
|
|
22
|
+
label: string;
|
|
23
|
+
route: Route;
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
export declare function DocSidebar({ sections, current, topLinks }: DocSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Route } from '../routing';
|
|
2
|
+
interface ShowcaseTopBarProps {
|
|
3
|
+
theme: 'light' | 'dark';
|
|
4
|
+
onToggleTheme: () => void;
|
|
5
|
+
onOpenPalette: () => void;
|
|
6
|
+
current: Route;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Persistent top bar shared by Home + docs pages. Hidden in full-bleed
|
|
10
|
+
* preview routes (templates rendered for screenshot / live use).
|
|
11
|
+
*/
|
|
12
|
+
export declare function ShowcaseTopBar({ theme, onToggleTheme, onOpenPalette, current, }: ShowcaseTopBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Route } from '../routing';
|
|
2
|
+
import { DocSidebarSection } from './DocSidebar';
|
|
3
|
+
/**
|
|
4
|
+
* Build the sidebar sections + top links for each page kind.
|
|
5
|
+
* Same sidebar shape across components / templates / guides — only the
|
|
6
|
+
* active highlight differs.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildComponentSidebar(): DocSidebarSection[];
|
|
9
|
+
export declare function buildTemplateSidebar(): DocSidebarSection[];
|
|
10
|
+
export declare function buildGuideSidebar(): DocSidebarSection[];
|
|
11
|
+
export declare const docTopLinks: {
|
|
12
|
+
label: string;
|
|
13
|
+
route: Route;
|
|
14
|
+
}[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ComponentsIndexPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GuidesIndexPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function HomePage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TemplatesIndexPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PropRow {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
default?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PropGroup {
|
|
10
|
+
title?: string;
|
|
11
|
+
rows: PropRow[];
|
|
12
|
+
}
|
|
13
|
+
export interface Example {
|
|
14
|
+
/** Short title used as the section heading on the doc page. */
|
|
15
|
+
title: string;
|
|
16
|
+
/** Optional 1–2 sentence explainer rendered above the demo. */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** Live, fully interactive React node rendered in the Preview tab. */
|
|
19
|
+
preview: ReactNode;
|
|
20
|
+
/** Verbatim source code shown in the Code tab + Copy button. */
|
|
21
|
+
code: string;
|
|
22
|
+
/** Optional override for the preview surface (e.g. add height / padding). */
|
|
23
|
+
surfaceClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
export type ComponentGroup = 'Buttons' | 'Inputs' | 'Feedback' | 'Overlays' | 'Navigation' | 'Layout' | 'Data Display' | 'Typography';
|
|
26
|
+
export interface ComponentDoc {
|
|
27
|
+
/** URL slug — e.g. 'button'. */
|
|
28
|
+
slug: string;
|
|
29
|
+
/** Display name — e.g. 'Button'. */
|
|
30
|
+
name: string;
|
|
31
|
+
group: ComponentGroup;
|
|
32
|
+
/** One-line tagline shown under the title and in lists. */
|
|
33
|
+
description: string;
|
|
34
|
+
/** Names re-exported from `@craftzbay/ui` for this component. */
|
|
35
|
+
exports: string[];
|
|
36
|
+
/** Path under src/components/ui/ — used for the GitHub source link. */
|
|
37
|
+
sourceFile: string;
|
|
38
|
+
examples: Example[];
|
|
39
|
+
/** Each table is rendered with its own optional title. */
|
|
40
|
+
api?: PropGroup[];
|
|
41
|
+
accessibility?: string[];
|
|
42
|
+
/** Cross-links rendered at the bottom of the page. */
|
|
43
|
+
related?: {
|
|
44
|
+
slug: string;
|
|
45
|
+
reason: string;
|
|
46
|
+
}[];
|
|
47
|
+
}
|
|
48
|
+
export interface TemplateDoc {
|
|
49
|
+
slug: string;
|
|
50
|
+
name: string;
|
|
51
|
+
/** One-line tagline. */
|
|
52
|
+
description: string;
|
|
53
|
+
/** Names re-exported from `@craftzbay/ui` (or component path). */
|
|
54
|
+
exports: string[];
|
|
55
|
+
sourceFile: string;
|
|
56
|
+
/** Full-bleed preview slug (#preview/<slug>). */
|
|
57
|
+
previewSlug?: string;
|
|
58
|
+
examples: Example[];
|
|
59
|
+
api?: PropGroup[];
|
|
60
|
+
/** What flows / pages this template is intended for. */
|
|
61
|
+
useCases?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface GuideDoc {
|
|
64
|
+
slug: string;
|
|
65
|
+
title: string;
|
|
66
|
+
description: string;
|
|
67
|
+
/** Rendered as the body of the guide page. */
|
|
68
|
+
body: ReactNode;
|
|
69
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Showcase routing — hash-based, two-segment.
|
|
3
|
+
*
|
|
4
|
+
* # → home
|
|
5
|
+
* #components → components index
|
|
6
|
+
* #components/button → individual component doc
|
|
7
|
+
* #templates → templates index
|
|
8
|
+
* #templates/auth-signin → individual template page
|
|
9
|
+
* #guides → guides index
|
|
10
|
+
* #guides/theming → individual guide
|
|
11
|
+
* #catalog → legacy: full mini-demo wall
|
|
12
|
+
* #preview/auth-signin → full-bleed live preview of a template
|
|
13
|
+
*/
|
|
14
|
+
export type Route = {
|
|
15
|
+
kind: 'home';
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'catalog';
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'components-index';
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'component';
|
|
22
|
+
slug: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'templates-index';
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'template';
|
|
27
|
+
slug: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'guides-index';
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'guide';
|
|
32
|
+
slug: string;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'preview';
|
|
35
|
+
slug: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function parseHash(hash: string): Route;
|
|
38
|
+
export declare function routeToHash(route: Route): string;
|
|
39
|
+
export declare function isFullBleedRoute(route: Route): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface CodeBlockProps {
|
|
2
|
+
code: string;
|
|
3
|
+
/** Display language label (tsx, css, bash, …) shown in the top-right. */
|
|
4
|
+
language?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Minimal pre/code block with a copy-to-clipboard button.
|
|
9
|
+
* No syntax highlighting — keeps the showcase bundle small.
|
|
10
|
+
*/
|
|
11
|
+
export declare function CodeBlock({ code, language, className }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface CodePreviewProps {
|
|
3
|
+
preview: ReactNode;
|
|
4
|
+
code: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
/** Tweak the preview surface — e.g. add min-height for overlays. */
|
|
7
|
+
surfaceClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* shadcn-style "Preview / Code" tab widget. Tabs hold their own state per
|
|
11
|
+
* instance so a page can flip individual examples without affecting others.
|
|
12
|
+
*/
|
|
13
|
+
export declare function CodePreview({ preview, code, language, surfaceClassName, }: CodePreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropGroup } from '../registry/types';
|
|
2
|
+
interface PropsTableProps {
|
|
3
|
+
groups: PropGroup[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Renders one or more prop-reference tables. Types are shown as inline
|
|
7
|
+
* `code` so long unions wrap cleanly.
|
|
8
|
+
*/
|
|
9
|
+
export declare function PropsTable({ groups }: PropsTableProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|