@craftzbay/ui 0.7.1 → 0.8.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/README.md +20 -15
- package/dist-lib/components/ui/Chart.d.ts +10 -7
- package/dist-lib/components/ui/DesignSystemProvider.d.ts +56 -30
- package/dist-lib/components/ui/Toast.d.ts +20 -0
- package/dist-lib/index.cjs +2 -2
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.d.ts +0 -11
- package/dist-lib/index.js +1911 -3034
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/styles.css +1 -1
- package/package.json +20 -20
- package/dist-lib/catalog.d.ts +0 -8
- package/dist-lib/components/patterns/AppShell.d.ts +0 -150
- package/dist-lib/components/patterns/Authentication.d.ts +0 -45
- package/dist-lib/components/patterns/DataTablePage.d.ts +0 -81
- package/dist-lib/components/patterns/FirstRunEmpty.d.ts +0 -39
- package/dist-lib/components/patterns/Onboarding.d.ts +0 -65
- package/dist-lib/components/patterns/Pricing.d.ts +0 -40
- package/dist-lib/components/patterns/RecordDetail.d.ts +0 -48
- package/dist-lib/components/patterns/Settings.d.ts +0 -34
- package/dist-lib/favicon.svg +0 -4
- package/dist-lib/showcase/components/Accordion.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Alert.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Avatar.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Badge.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Breadcrumbs.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Button.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Calendar.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Card.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Carousel.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Chart.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Checkbox.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Combobox.docs.d.ts +0 -3
- package/dist-lib/showcase/components/CommandPalette.docs.d.ts +0 -3
- package/dist-lib/showcase/components/ContextMenu.docs.d.ts +0 -3
- package/dist-lib/showcase/components/DataGrid.docs.d.ts +0 -3
- package/dist-lib/showcase/components/DatePicker.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Dialog.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Drawer.docs.d.ts +0 -3
- package/dist-lib/showcase/components/DropdownMenu.docs.d.ts +0 -3
- package/dist-lib/showcase/components/EmptyState.docs.d.ts +0 -3
- package/dist-lib/showcase/components/ErrorState.docs.d.ts +0 -3
- package/dist-lib/showcase/components/FileUpload.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Form.docs.d.ts +0 -3
- package/dist-lib/showcase/components/IconButton.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Input.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Kbd.docs.d.ts +0 -3
- package/dist-lib/showcase/components/MultiSelect.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Pagination.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Popover.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Progress.docs.d.ts +0 -3
- package/dist-lib/showcase/components/RadioGroup.docs.d.ts +0 -3
- package/dist-lib/showcase/components/ScrollArea.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Select.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Separator.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Sheet.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Sidebar.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Skeleton.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Slider.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Snackbar.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Spinner.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Stepper.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Switch.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Table.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Tabs.docs.d.ts +0 -3
- package/dist-lib/showcase/components/TagInput.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Textarea.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Timeline.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Toast.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Tooltip.docs.d.ts +0 -3
- package/dist-lib/showcase/components/TopNav.docs.d.ts +0 -3
- package/dist-lib/showcase/components/Tree.docs.d.ts +0 -3
- package/dist-lib/showcase/guides/DarkMode.d.ts +0 -1
- package/dist-lib/showcase/guides/Forms.d.ts +0 -1
- package/dist-lib/showcase/guides/Migration.d.ts +0 -1
- package/dist-lib/showcase/guides/Responsive.d.ts +0 -1
- package/dist-lib/showcase/guides/Theming.d.ts +0 -1
- package/dist-lib/showcase/layout/DocLayout.d.ts +0 -28
- package/dist-lib/showcase/layout/DocSidebar.d.ts +0 -41
- package/dist-lib/showcase/layout/ShowcaseFooter.d.ts +0 -5
- package/dist-lib/showcase/layout/ShowcaseTopBar.d.ts +0 -13
- package/dist-lib/showcase/layout/sidebars.d.ts +0 -22
- package/dist-lib/showcase/pages/ComponentDocPage.d.ts +0 -6
- package/dist-lib/showcase/pages/ComponentsIndexPage.d.ts +0 -1
- package/dist-lib/showcase/pages/GuidePage.d.ts +0 -6
- package/dist-lib/showcase/pages/GuidesIndexPage.d.ts +0 -1
- package/dist-lib/showcase/pages/HomePage.d.ts +0 -1
- package/dist-lib/showcase/pages/TemplateDocPage.d.ts +0 -6
- package/dist-lib/showcase/pages/TemplatesIndexPage.d.ts +0 -1
- package/dist-lib/showcase/registry/components.d.ts +0 -4
- package/dist-lib/showcase/registry/guides.d.ts +0 -3
- package/dist-lib/showcase/registry/templates.d.ts +0 -3
- package/dist-lib/showcase/registry/types.d.ts +0 -69
- package/dist-lib/showcase/routing.d.ts +0 -39
- package/dist-lib/showcase/templates/AuthForgot.template.d.ts +0 -3
- package/dist-lib/showcase/templates/AuthMagic.template.d.ts +0 -3
- package/dist-lib/showcase/templates/AuthSignIn.template.d.ts +0 -3
- package/dist-lib/showcase/templates/AuthSignUp.template.d.ts +0 -3
- package/dist-lib/showcase/templates/Dashboard.template.d.ts +0 -3
- package/dist-lib/showcase/templates/DataTable.template.d.ts +0 -3
- package/dist-lib/showcase/templates/FirstRunEmpty.template.d.ts +0 -3
- package/dist-lib/showcase/templates/Onboarding.template.d.ts +0 -3
- package/dist-lib/showcase/templates/Pricing.template.d.ts +0 -3
- package/dist-lib/showcase/templates/RecordDetail.template.d.ts +0 -3
- package/dist-lib/showcase/templates/Settings.template.d.ts +0 -3
- package/dist-lib/showcase/widgets/CodeBlock.d.ts +0 -12
- package/dist-lib/showcase/widgets/CodePreview.d.ts +0 -14
- package/dist-lib/showcase/widgets/PropsTable.d.ts +0 -10
- package/dist-lib/showcase/widgets/SectionAnchor.d.ts +0 -13
- package/dist-lib/test/setup.d.ts +0 -0
- package/dist-lib/theme-init.js +0 -9
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@ A refined-minimal Tailwind v4 + React design system. Production-grade
|
|
|
4
4
|
primitives — Button through DataGrid — plus composed patterns
|
|
5
5
|
(authentication, app shell, settings, etc.).
|
|
6
6
|
|
|
7
|
-
- **Showcase:** [
|
|
8
|
-
- **Components
|
|
9
|
-
- **
|
|
7
|
+
- **Showcase:** [components.runestonetechnologies.com](https://components.runestonetechnologies.com)
|
|
8
|
+
- **Components:** [components.runestonetechnologies.com#components](https://components.runestonetechnologies.com#components)
|
|
9
|
+
- **Templates:** [components.runestonetechnologies.com#templates](https://components.runestonetechnologies.com#templates)
|
|
10
10
|
|
|
11
11
|
> **Aesthetic direction:** Linear / Vercel / Stripe Dashboard / Notion / Raycast.
|
|
12
12
|
> Neutral-dominant, one accent, hairline borders, generous whitespace, fast quiet
|
|
@@ -31,12 +31,19 @@ Peer dependencies: `react@>=18`, `react-dom@>=18`.
|
|
|
31
31
|
|
|
32
32
|
## Local development
|
|
33
33
|
|
|
34
|
+
This package lives in the [`craftzbay-ui`](https://github.com/craftzbay/craftzbay-ui)
|
|
35
|
+
monorepo (`packages/ui`). The showcase site is a separate workspace
|
|
36
|
+
(`apps/site`) that consumes this package's source directly. From the repo root:
|
|
37
|
+
|
|
34
38
|
```bash
|
|
35
39
|
pnpm install
|
|
36
|
-
pnpm dev #
|
|
37
|
-
pnpm build:lib #
|
|
40
|
+
pnpm dev # showcase site (apps/site) — edits to this package hot-reload
|
|
41
|
+
pnpm build:lib # build this library → packages/ui/dist-lib/
|
|
38
42
|
```
|
|
39
43
|
|
|
44
|
+
Inside `packages/ui` itself, `pnpm build` produces the distributable bundle and
|
|
45
|
+
`pnpm test` runs the component tests.
|
|
46
|
+
|
|
40
47
|
## Tech stack
|
|
41
48
|
|
|
42
49
|
- **Tailwind CSS v4** — tokens defined in `@theme` in `src/styles/globals.css`
|
|
@@ -128,16 +135,14 @@ docs/
|
|
|
128
135
|
### Typography
|
|
129
136
|
- [Kbd](./src/components/ui/Kbd.tsx) — keyboard shortcut indicator
|
|
130
137
|
|
|
131
|
-
##
|
|
138
|
+
## Blocks (page templates)
|
|
132
139
|
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- [Pricing](./src/components/patterns/Pricing.tsx) — 3-tier comparison
|
|
140
|
-
- [FirstRunEmpty](./src/components/patterns/FirstRunEmpty.tsx) — hero + 3 next-step cards
|
|
140
|
+
Whole-page compositions — dashboard, settings, auth, pricing, data table,
|
|
141
|
+
record detail, onboarding, first-run — are **not** shipped as importable
|
|
142
|
+
components. They live in the showcase as copy-paste **blocks**: complete pages
|
|
143
|
+
assembled from the primitives above, with the full source on the page. Read it,
|
|
144
|
+
copy it, adapt it — no opaque `<Dashboard />` import. Browse them under
|
|
145
|
+
**Templates** in the [showcase](https://components.runestonetechnologies.com/#templates).
|
|
141
146
|
|
|
142
147
|
## Documentation
|
|
143
148
|
|
|
@@ -154,4 +159,4 @@ docs/
|
|
|
154
159
|
3. Every interactive element ships with: default, hover, focus-visible, active,
|
|
155
160
|
disabled, loading, and (where applicable) error / success states.
|
|
156
161
|
4. Forward refs correctly; set `displayName`.
|
|
157
|
-
5. Run `pnpm typecheck && pnpm
|
|
162
|
+
5. Run `pnpm typecheck && pnpm test` before opening a PR.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* Tiny, dependency-free chart primitives for inline dashboards
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Tiny, dependency-free chart primitives for inline dashboards — sparklines,
|
|
4
|
+
* KPI cards, at-a-glance trends. For heavy interactive visualisations reach for
|
|
5
|
+
* a charting library. These render as responsive SVG (the line/area stretch to
|
|
6
|
+
* the container width; strokes stay crisp via non-scaling-stroke).
|
|
6
7
|
*/
|
|
7
8
|
export interface ChartPoint {
|
|
8
9
|
x: string | number;
|
|
@@ -10,14 +11,16 @@ export interface ChartPoint {
|
|
|
10
11
|
}
|
|
11
12
|
export interface ChartProps {
|
|
12
13
|
data: ChartPoint[];
|
|
13
|
-
/**
|
|
14
|
+
/** Drawing height in px. */
|
|
14
15
|
height?: number;
|
|
15
16
|
/** Defaults to fluid 100%. */
|
|
16
17
|
width?: number | string;
|
|
17
18
|
/** Tooltip / label rendered above the chart. */
|
|
18
19
|
caption?: ReactNode;
|
|
20
|
+
/** Faint horizontal gridlines. Default true. */
|
|
21
|
+
grid?: boolean;
|
|
19
22
|
className?: string;
|
|
20
23
|
}
|
|
21
|
-
export declare function LineChart({ data, height, width, caption, className }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare function AreaChart(
|
|
23
|
-
export declare function BarChart({ data, height, width, caption, className }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function LineChart({ data, height, width, caption, grid, className }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function AreaChart(props: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function BarChart({ data, height, width, caption, grid, className }: ChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,15 +5,12 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
5
5
|
* design system default.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
|
-
* <DesignSystemProvider tokens={{
|
|
8
|
+
* <DesignSystemProvider tokens={{ accent: '#ff5555', 'radius-md': '10px' }}>
|
|
9
9
|
* <App />
|
|
10
10
|
* </DesignSystemProvider>
|
|
11
11
|
*
|
|
12
|
-
* @example
|
|
13
|
-
* <DesignSystemProvider tokens={
|
|
14
|
-
* <Card>...</Card>
|
|
15
|
-
* </DesignSystemProvider>
|
|
16
|
-
* <DesignSystemProvider tokens={geregeBrand}>
|
|
12
|
+
* @example Swap in one of the built-in accent presets
|
|
13
|
+
* <DesignSystemProvider tokens={brandPresets.violet}>
|
|
17
14
|
* <Card>...</Card>
|
|
18
15
|
* </DesignSystemProvider>
|
|
19
16
|
*/
|
|
@@ -26,35 +23,64 @@ export interface DesignSystemProviderProps extends HTMLAttributes<HTMLDivElement
|
|
|
26
23
|
}
|
|
27
24
|
export declare function DesignSystemProvider({ tokens, className, children, style, ...props }: DesignSystemProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
25
|
/**
|
|
29
|
-
* Built-in
|
|
30
|
-
*
|
|
26
|
+
* Built-in accent presets — swap the system's single accent colour without
|
|
27
|
+
* touching anything else.
|
|
28
|
+
*
|
|
29
|
+
* These override the *semantic* tokens the utilities resolve to. globals.css
|
|
30
|
+
* maps the accent utilities with `@theme inline` (e.g. `bg-accent` →
|
|
31
|
+
* `var(--accent)`, `bg-accent-soft` → `var(--accent-subtle)`), so the override
|
|
32
|
+
* must target `--accent` / `--accent-subtle` / `--accent-subtle-foreground` /
|
|
33
|
+
* `--ring` — NOT `--color-accent` (which `inline` never emits). The hover/
|
|
34
|
+
* active steps (`--color-accent-700/800`) come from the raw palette and are
|
|
35
|
+
* overridden directly. `default` is the built-in graphite-indigo.
|
|
31
36
|
*/
|
|
32
37
|
export declare const brandPresets: {
|
|
38
|
+
/** The library default — graphite indigo. */
|
|
33
39
|
readonly default: BrandTokens;
|
|
34
|
-
/**
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly 'color-accent-700': "oklch(0.
|
|
38
|
-
readonly 'color-accent-800': "oklch(0.
|
|
39
|
-
readonly '
|
|
40
|
-
readonly '
|
|
41
|
-
readonly
|
|
40
|
+
/** Blue. */
|
|
41
|
+
readonly blue: {
|
|
42
|
+
readonly accent: "oklch(0.55 0.16 250)";
|
|
43
|
+
readonly 'color-accent-700': "oklch(0.47 0.16 250)";
|
|
44
|
+
readonly 'color-accent-800': "oklch(0.39 0.14 250)";
|
|
45
|
+
readonly 'accent-subtle': "oklch(0.95 0.04 250)";
|
|
46
|
+
readonly 'accent-subtle-foreground': "oklch(0.45 0.15 250)";
|
|
47
|
+
readonly ring: "oklch(0.62 0.16 250)";
|
|
48
|
+
};
|
|
49
|
+
/** Violet. */
|
|
50
|
+
readonly violet: {
|
|
51
|
+
readonly accent: "oklch(0.53 0.20 295)";
|
|
52
|
+
readonly 'color-accent-700': "oklch(0.45 0.18 295)";
|
|
53
|
+
readonly 'color-accent-800': "oklch(0.38 0.16 295)";
|
|
54
|
+
readonly 'accent-subtle': "oklch(0.95 0.04 295)";
|
|
55
|
+
readonly 'accent-subtle-foreground': "oklch(0.45 0.18 295)";
|
|
56
|
+
readonly ring: "oklch(0.60 0.20 295)";
|
|
57
|
+
};
|
|
58
|
+
/** Emerald. */
|
|
59
|
+
readonly emerald: {
|
|
60
|
+
readonly accent: "oklch(0.55 0.13 160)";
|
|
61
|
+
readonly 'color-accent-700': "oklch(0.47 0.13 160)";
|
|
62
|
+
readonly 'color-accent-800': "oklch(0.39 0.12 160)";
|
|
63
|
+
readonly 'accent-subtle': "oklch(0.95 0.04 160)";
|
|
64
|
+
readonly 'accent-subtle-foreground': "oklch(0.42 0.12 160)";
|
|
65
|
+
readonly ring: "oklch(0.60 0.13 160)";
|
|
42
66
|
};
|
|
43
|
-
/**
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
readonly 'color-accent-700': "oklch(0.
|
|
47
|
-
readonly 'color-accent-800': "oklch(0.
|
|
48
|
-
readonly '
|
|
49
|
-
readonly '
|
|
50
|
-
readonly
|
|
67
|
+
/** Rose. */
|
|
68
|
+
readonly rose: {
|
|
69
|
+
readonly accent: "oklch(0.57 0.19 12)";
|
|
70
|
+
readonly 'color-accent-700': "oklch(0.49 0.18 12)";
|
|
71
|
+
readonly 'color-accent-800': "oklch(0.41 0.16 12)";
|
|
72
|
+
readonly 'accent-subtle': "oklch(0.95 0.035 12)";
|
|
73
|
+
readonly 'accent-subtle-foreground': "oklch(0.48 0.18 12)";
|
|
74
|
+
readonly ring: "oklch(0.62 0.19 12)";
|
|
51
75
|
};
|
|
52
|
-
/**
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
55
|
-
readonly 'color-accent-700': "oklch(0.
|
|
56
|
-
readonly 'color-accent-800': "oklch(0.
|
|
57
|
-
readonly '
|
|
76
|
+
/** Amber. */
|
|
77
|
+
readonly amber: {
|
|
78
|
+
readonly accent: "oklch(0.62 0.14 65)";
|
|
79
|
+
readonly 'color-accent-700': "oklch(0.54 0.13 65)";
|
|
80
|
+
readonly 'color-accent-800': "oklch(0.46 0.12 65)";
|
|
81
|
+
readonly 'accent-subtle': "oklch(0.95 0.05 75)";
|
|
82
|
+
readonly 'accent-subtle-foreground': "oklch(0.48 0.12 65)";
|
|
83
|
+
readonly ring: "oklch(0.66 0.14 65)";
|
|
58
84
|
};
|
|
59
85
|
};
|
|
60
86
|
export type BrandName = keyof typeof brandPresets;
|
|
@@ -13,6 +13,26 @@ export declare const ToastTitle: import('react').ForwardRefExoticComponent<Omit<
|
|
|
13
13
|
export declare const ToastDescription: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastDescriptionProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
14
14
|
export declare const ToastAction: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastActionProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
15
15
|
export declare const ToastClose: import('react').ForwardRefExoticComponent<Omit<ToastPrimitive.ToastCloseProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
/**
|
|
17
|
+
* Drop-in host that connects the `useToast()` queue to the Radix primitives.
|
|
18
|
+
* Mount it once near your app root — then `useToast().push({...})` (or the
|
|
19
|
+
* standalone `toast()`) from anywhere renders here. Self-contained: it brings
|
|
20
|
+
* its own ToastProvider + Viewport, so no other Toast wiring is needed.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* function App() {
|
|
24
|
+
* return (
|
|
25
|
+
* <>
|
|
26
|
+
* <Routes />
|
|
27
|
+
* <Toaster />
|
|
28
|
+
* </>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
export declare function Toaster(): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare namespace Toaster {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
16
36
|
export {};
|
|
17
37
|
/**
|
|
18
38
|
* @example
|