@craftzbay/ui 0.8.0 → 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.
Files changed (112) hide show
  1. package/README.md +20 -15
  2. package/dist-lib/components/ui/Chart.d.ts +10 -7
  3. package/dist-lib/components/ui/DesignSystemProvider.d.ts +56 -30
  4. package/dist-lib/components/ui/Toast.d.ts +20 -0
  5. package/dist-lib/index.cjs +2 -2
  6. package/dist-lib/index.cjs.map +1 -1
  7. package/dist-lib/index.d.ts +0 -11
  8. package/dist-lib/index.js +1911 -3034
  9. package/dist-lib/index.js.map +1 -1
  10. package/dist-lib/styles.css +1 -1
  11. package/package.json +9 -12
  12. package/dist-lib/catalog.d.ts +0 -8
  13. package/dist-lib/components/patterns/AppShell.d.ts +0 -150
  14. package/dist-lib/components/patterns/Authentication.d.ts +0 -45
  15. package/dist-lib/components/patterns/DataTablePage.d.ts +0 -81
  16. package/dist-lib/components/patterns/FirstRunEmpty.d.ts +0 -39
  17. package/dist-lib/components/patterns/Onboarding.d.ts +0 -65
  18. package/dist-lib/components/patterns/Pricing.d.ts +0 -40
  19. package/dist-lib/components/patterns/RecordDetail.d.ts +0 -48
  20. package/dist-lib/components/patterns/Settings.d.ts +0 -34
  21. package/dist-lib/favicon.svg +0 -4
  22. package/dist-lib/showcase/components/Accordion.docs.d.ts +0 -3
  23. package/dist-lib/showcase/components/Alert.docs.d.ts +0 -3
  24. package/dist-lib/showcase/components/Avatar.docs.d.ts +0 -3
  25. package/dist-lib/showcase/components/Badge.docs.d.ts +0 -3
  26. package/dist-lib/showcase/components/Breadcrumbs.docs.d.ts +0 -3
  27. package/dist-lib/showcase/components/Button.docs.d.ts +0 -3
  28. package/dist-lib/showcase/components/Calendar.docs.d.ts +0 -3
  29. package/dist-lib/showcase/components/Card.docs.d.ts +0 -3
  30. package/dist-lib/showcase/components/Carousel.docs.d.ts +0 -3
  31. package/dist-lib/showcase/components/Chart.docs.d.ts +0 -3
  32. package/dist-lib/showcase/components/Checkbox.docs.d.ts +0 -3
  33. package/dist-lib/showcase/components/Combobox.docs.d.ts +0 -3
  34. package/dist-lib/showcase/components/CommandPalette.docs.d.ts +0 -3
  35. package/dist-lib/showcase/components/ContextMenu.docs.d.ts +0 -3
  36. package/dist-lib/showcase/components/DataGrid.docs.d.ts +0 -3
  37. package/dist-lib/showcase/components/DatePicker.docs.d.ts +0 -3
  38. package/dist-lib/showcase/components/Dialog.docs.d.ts +0 -3
  39. package/dist-lib/showcase/components/Drawer.docs.d.ts +0 -3
  40. package/dist-lib/showcase/components/DropdownMenu.docs.d.ts +0 -3
  41. package/dist-lib/showcase/components/EmptyState.docs.d.ts +0 -3
  42. package/dist-lib/showcase/components/ErrorState.docs.d.ts +0 -3
  43. package/dist-lib/showcase/components/FileUpload.docs.d.ts +0 -3
  44. package/dist-lib/showcase/components/Form.docs.d.ts +0 -3
  45. package/dist-lib/showcase/components/IconButton.docs.d.ts +0 -3
  46. package/dist-lib/showcase/components/Input.docs.d.ts +0 -3
  47. package/dist-lib/showcase/components/Kbd.docs.d.ts +0 -3
  48. package/dist-lib/showcase/components/MultiSelect.docs.d.ts +0 -3
  49. package/dist-lib/showcase/components/Pagination.docs.d.ts +0 -3
  50. package/dist-lib/showcase/components/Popover.docs.d.ts +0 -3
  51. package/dist-lib/showcase/components/Progress.docs.d.ts +0 -3
  52. package/dist-lib/showcase/components/RadioGroup.docs.d.ts +0 -3
  53. package/dist-lib/showcase/components/ScrollArea.docs.d.ts +0 -3
  54. package/dist-lib/showcase/components/Select.docs.d.ts +0 -3
  55. package/dist-lib/showcase/components/Separator.docs.d.ts +0 -3
  56. package/dist-lib/showcase/components/Sheet.docs.d.ts +0 -3
  57. package/dist-lib/showcase/components/Sidebar.docs.d.ts +0 -3
  58. package/dist-lib/showcase/components/Skeleton.docs.d.ts +0 -3
  59. package/dist-lib/showcase/components/Slider.docs.d.ts +0 -3
  60. package/dist-lib/showcase/components/Snackbar.docs.d.ts +0 -3
  61. package/dist-lib/showcase/components/Spinner.docs.d.ts +0 -3
  62. package/dist-lib/showcase/components/Stepper.docs.d.ts +0 -3
  63. package/dist-lib/showcase/components/Switch.docs.d.ts +0 -3
  64. package/dist-lib/showcase/components/Table.docs.d.ts +0 -3
  65. package/dist-lib/showcase/components/Tabs.docs.d.ts +0 -3
  66. package/dist-lib/showcase/components/TagInput.docs.d.ts +0 -3
  67. package/dist-lib/showcase/components/Textarea.docs.d.ts +0 -3
  68. package/dist-lib/showcase/components/Timeline.docs.d.ts +0 -3
  69. package/dist-lib/showcase/components/Toast.docs.d.ts +0 -3
  70. package/dist-lib/showcase/components/Tooltip.docs.d.ts +0 -3
  71. package/dist-lib/showcase/components/TopNav.docs.d.ts +0 -3
  72. package/dist-lib/showcase/components/Tree.docs.d.ts +0 -3
  73. package/dist-lib/showcase/guides/DarkMode.d.ts +0 -1
  74. package/dist-lib/showcase/guides/Forms.d.ts +0 -1
  75. package/dist-lib/showcase/guides/Migration.d.ts +0 -1
  76. package/dist-lib/showcase/guides/Responsive.d.ts +0 -1
  77. package/dist-lib/showcase/guides/Theming.d.ts +0 -1
  78. package/dist-lib/showcase/layout/DocLayout.d.ts +0 -28
  79. package/dist-lib/showcase/layout/DocSidebar.d.ts +0 -41
  80. package/dist-lib/showcase/layout/ShowcaseFooter.d.ts +0 -5
  81. package/dist-lib/showcase/layout/ShowcaseTopBar.d.ts +0 -13
  82. package/dist-lib/showcase/layout/sidebars.d.ts +0 -22
  83. package/dist-lib/showcase/pages/ComponentDocPage.d.ts +0 -6
  84. package/dist-lib/showcase/pages/ComponentsIndexPage.d.ts +0 -1
  85. package/dist-lib/showcase/pages/GuidePage.d.ts +0 -6
  86. package/dist-lib/showcase/pages/GuidesIndexPage.d.ts +0 -1
  87. package/dist-lib/showcase/pages/HomePage.d.ts +0 -1
  88. package/dist-lib/showcase/pages/TemplateDocPage.d.ts +0 -6
  89. package/dist-lib/showcase/pages/TemplatesIndexPage.d.ts +0 -1
  90. package/dist-lib/showcase/registry/components.d.ts +0 -4
  91. package/dist-lib/showcase/registry/generated-props.d.ts +0 -7
  92. package/dist-lib/showcase/registry/guides.d.ts +0 -3
  93. package/dist-lib/showcase/registry/templates.d.ts +0 -3
  94. package/dist-lib/showcase/registry/types.d.ts +0 -69
  95. package/dist-lib/showcase/routing.d.ts +0 -39
  96. package/dist-lib/showcase/templates/AuthForgot.template.d.ts +0 -3
  97. package/dist-lib/showcase/templates/AuthMagic.template.d.ts +0 -3
  98. package/dist-lib/showcase/templates/AuthSignIn.template.d.ts +0 -3
  99. package/dist-lib/showcase/templates/AuthSignUp.template.d.ts +0 -3
  100. package/dist-lib/showcase/templates/Dashboard.template.d.ts +0 -3
  101. package/dist-lib/showcase/templates/DataTable.template.d.ts +0 -3
  102. package/dist-lib/showcase/templates/FirstRunEmpty.template.d.ts +0 -3
  103. package/dist-lib/showcase/templates/Onboarding.template.d.ts +0 -3
  104. package/dist-lib/showcase/templates/Pricing.template.d.ts +0 -3
  105. package/dist-lib/showcase/templates/RecordDetail.template.d.ts +0 -3
  106. package/dist-lib/showcase/templates/Settings.template.d.ts +0 -3
  107. package/dist-lib/showcase/widgets/CodeBlock.d.ts +0 -12
  108. package/dist-lib/showcase/widgets/CodePreview.d.ts +0 -14
  109. package/dist-lib/showcase/widgets/PropsTable.d.ts +0 -10
  110. package/dist-lib/showcase/widgets/SectionAnchor.d.ts +0 -13
  111. package/dist-lib/test/setup.d.ts +0 -0
  112. 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:** [design.runestonetechnologies.com](https://design.runestonetechnologies.com)
8
- - **Components catalog:** [design.runestonetechnologies.com#catalog](https://design.runestonetechnologies.com#catalog)
9
- - **Docs:** [design.runestonetechnologies.com#docs](https://design.runestonetechnologies.com#docs)
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 # Vite showcase at localhost:5173
37
- pnpm build:lib # Build library → dist-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
- ## Patterns (composed layouts)
138
+ ## Blocks (page templates)
132
139
 
133
- - [Authentication](./src/components/patterns/Authentication.tsx)sign-in, sign-up, forgot, magic-link
134
- - [AppShell + Dashboard](./src/components/patterns/AppShell.tsx)sidebar + topnav shell, 4 stat cards + chart + activity table
135
- - [Settings](./src/components/patterns/Settings.tsx) sub-nav + 5 sections
136
- - [DataTablePage](./src/components/patterns/DataTablePage.tsx) filter / search / bulk actions / pagination
137
- - [RecordDetail](./src/components/patterns/RecordDetail.tsx)header + tabs + side panel
138
- - [Onboarding](./src/components/patterns/Onboarding.tsx) — 4-step stepper flow
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 compositionsdashboard, settings, auth, pricing, data table,
141
+ record detail, onboarding, first-runare **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 lint` before opening a PR.
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. For complex
4
- * visualisations reach for a charting library (Recharts, visx). These suffice
5
- * for sparklines, KPI cards, and at-a-glance trends.
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
- /** Defaults to 24px height per point + 60px padding. */
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({ data, height, width, caption, className }: ChartProps): import("react/jsx-runtime").JSX.Element;
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={{ 'color-accent': '#ff5555', 'radius-md': '10px' }}>
8
+ * <DesignSystemProvider tokens={{ accent: '#ff5555', 'radius-md': '10px' }}>
9
9
  * <App />
10
10
  * </DesignSystemProvider>
11
11
  *
12
- * @example Multiple brands in one app
13
- * <DesignSystemProvider tokens={edgelogBrand}>
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 brand presets — drop-in starters showing how a token override
30
- * map is shaped. Consumers can fork or replace any value.
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
- /** Cool indigo accent, slightly rounder corners. */
35
- readonly edgelog: {
36
- readonly 'color-accent': "oklch(0.55 0.18 250)";
37
- readonly 'color-accent-700': "oklch(0.46 0.16 250)";
38
- readonly 'color-accent-800': "oklch(0.38 0.14 250)";
39
- readonly 'color-accent-soft': "oklch(0.95 0.04 250)";
40
- readonly 'radius-md': "8px";
41
- readonly 'radius-lg': "12px";
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
- /** Warm copper accent, tighter geometry. */
44
- readonly gerege: {
45
- readonly 'color-accent': "oklch(0.62 0.16 45)";
46
- readonly 'color-accent-700': "oklch(0.54 0.16 45)";
47
- readonly 'color-accent-800': "oklch(0.46 0.14 45)";
48
- readonly 'color-accent-soft': "oklch(0.95 0.04 45)";
49
- readonly 'radius-md': "4px";
50
- readonly 'radius-lg': "6px";
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
- /** Forest green accent. */
53
- readonly forest: {
54
- readonly 'color-accent': "oklch(0.55 0.14 155)";
55
- readonly 'color-accent-700': "oklch(0.47 0.14 155)";
56
- readonly 'color-accent-800': "oklch(0.39 0.12 155)";
57
- readonly 'color-accent-soft': "oklch(0.95 0.04 155)";
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