@viliha/vui-ui 1.5.2 → 1.5.4

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/AGENT.md CHANGED
@@ -150,6 +150,35 @@ Import the theme once. No extra transpilation needed.
150
150
 
151
151
  ---
152
152
 
153
+ # Upgrading
154
+
155
+ When you bump `@viliha/vui-ui`, follow these steps — the package version and the
156
+ scaffolded files in the repo are two separate things.
157
+
158
+ 1. **Read the [CHANGELOG](./CHANGELOG.md) for the target version.** Note anything
159
+ under *Removed*, *Changed*, or *Breaking*, and any new peer dependency. The
160
+ project follows semver: patch/minor are backward-compatible, major may break.
161
+ 2. **Bump and install** with the project's package manager:
162
+ ```bash
163
+ npm i @viliha/vui-ui@latest # or: pnpm up, yarn up, bun update
164
+ ```
165
+ In a monorepo, install in the specific app (or with a workspace filter, e.g.
166
+ `pnpm --filter <app> up @viliha/vui-ui`), never at the repo root.
167
+ 3. **No rebuild needed.** The package ships TypeScript source, so there's no
168
+ build/dts step — just restart the dev server. If a new version adds a peer
169
+ dependency, install it (the CHANGELOG and the "Module not found" error name it).
170
+ 4. **Scaffolded files are yours.** `init` copies the shell and demo pages into
171
+ the repo once; upgrading the package does **not** touch them. To pull
172
+ scaffolder improvements into an existing project, preview first with
173
+ `npx @viliha/vui-ui@latest init --dry-run`, then re-run with `--force` (commit
174
+ or stash your work first so you can review the diff) or copy in just the files
175
+ you want.
176
+ 5. **Re-check token overrides.** If you overrode any `theme.css` tokens, confirm
177
+ they still line up after the upgrade.
178
+ 6. **Verify** before you commit: run type-check, lint, and build.
179
+
180
+ ---
181
+
153
182
  # Design Tokens
154
183
 
155
184
  VUI is entirely token-driven. Never hardcode colors, spacing, radius, typography, shadows, or borders — reach for the semantic design token instead. For example: `--button-primary`, `--button-primary-hover`, `--background`, `--foreground`, `--border`, `--ring`, `--chart-1`, `--sidebar-primary`.
package/CHANGELOG.md ADDED
@@ -0,0 +1,122 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@viliha/vui-ui` are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/), and the project uses
5
+ [semantic versioning](https://semver.org/): **patch** for fixes, **minor** for
6
+ backward-compatible features, **major** for breaking changes.
7
+
8
+ To upgrade, see [Upgrading](./AGENT.md#upgrading) in the agent guide.
9
+
10
+ ## 1.5.4 — 2026-07-24
11
+
12
+ ### Added
13
+
14
+ - `NEXT_PUBLIC_APP_NAME` env var (in the scaffold) renames the app — the sidebar,
15
+ wordmark, auth screens, and page titles now read from one place (`SITE.name`)
16
+ instead of a hard-coded "Vui Starter".
17
+
18
+ ### Fixed
19
+
20
+ - `ChartContainer` no longer triggers Recharts' "width(0) and height(0) … should
21
+ be greater than 0" warning when it renders inside a hidden container (e.g. a
22
+ kept-alive inactive tab). It waits for a measured size before mounting the
23
+ `ResponsiveContainer`.
24
+
25
+ ## 1.5.3 — 2026-07-24
26
+
27
+ ### Added
28
+
29
+ - The changelog and the **[Upgrading](./AGENT.md#upgrading)** guide now ship in
30
+ the npm package. (They were authored for 1.5.2 but missed that tarball, which
31
+ was published a moment before.)
32
+
33
+ ## 1.5.2 — 2026-07-24
34
+
35
+ ### Changed
36
+
37
+ - **Turborepo guidance throughout.** `init`'s monorepo note now walks you through
38
+ `cd`-ing into the target app (e.g. `apps/web`), installing deps in that app (or
39
+ via a workspace filter), checking workspace globs, and running with a filter —
40
+ and states clearly that turbo mode does not auto-install.
41
+ - **Fuller `AGENT.md`.** Added an "Inside a Turborepo / monorepo" section and
42
+ end-to-end walkthroughs for new-standalone, new-in-monorepo, and existing apps.
43
+
44
+ ## 1.5.1 — 2026-07-24
45
+
46
+ ### Changed
47
+
48
+ - Rewrote the README and `AGENT.md` prose to a clearer, more natural voice. No
49
+ API changes.
50
+
51
+ ## 1.5.0 — 2026-07-24
52
+
53
+ ### Added
54
+
55
+ - **`init` installs dependencies for you**, using the package manager it detects
56
+ from your lockfile (npm, pnpm, yarn, or bun). It prompts first; `--yes` skips
57
+ the prompt and `--no-install` opts out. This ends the "Module not found"
58
+ cascade from running `dev` before installing peers.
59
+
60
+ ## 1.4.3 — 2026-07-24
61
+
62
+ ### Fixed
63
+
64
+ - The scaffolded `globals.css` no longer imports `tw-animate-css`, so the theme
65
+ is self-contained and needs no extra CSS dependency (VUI's own animations live
66
+ in `theme.css`).
67
+
68
+ ## 1.4.1 — 2026-07-24
69
+
70
+ ### Added
71
+
72
+ - **Turborepo support in `init`** (`--turbo` + `--dir`) — scaffolds into a target
73
+ app directory.
74
+ - A `tsconfig.json` in the scaffold (`@/*` → `./*`) so the shell's imports
75
+ resolve, and a TypeScript `next.config.ts` (so a fresh scaffold overwrites
76
+ create-next-app's config instead of leaving two).
77
+
78
+ ### Fixed
79
+
80
+ - Scaffolding into a fresh Next.js app now works end to end.
81
+ - Pinned a patched `postcss` (`^8.5.12`) via pnpm overrides to clear a
82
+ high-severity advisory (GHSA-6g55-p6wh-862q).
83
+
84
+ > 1.4.1 shipped `next.config.mjs` and 1.4.2 was an interim republish; use **1.4.3
85
+ > or later**, which ship `next.config.ts` and the self-contained theme.
86
+
87
+ ## 1.4.0 — 2026-07-24
88
+
89
+ ### Added
90
+
91
+ - **`init` decision tree**: fresh vs. existing project, and pre-built (shell +
92
+ demo) vs. theme-only (`--fresh`/`--existing`, `--prebuilt`/`--theme-only`).
93
+
94
+ ## 1.3.0 — 2026-07-24
95
+
96
+ ### Added
97
+
98
+ - **`RecordFormPanel`** — the standard Add/Edit/View slide-over as a standalone
99
+ export, for use outside a table (e.g. a Kanban board).
100
+ - `RecordField` gains an `input` type (`number`/`date`) and renders a `Select`
101
+ for `options` fields in the Add/Edit form.
102
+
103
+ ## 1.2.0 — 2026-07-23
104
+
105
+ ### Added
106
+
107
+ - **`npx @viliha/vui-ui init`** — a scaffolder that copies the app shell (layout,
108
+ sidebar, open tabs, command palette, nav config, logo) and demo pages into your
109
+ repo. Ships a `bin` and a bundled `template/` regenerated from the reference app
110
+ on publish.
111
+ - Navigation & open-tabs documentation.
112
+
113
+ ## 1.1.8 — 2026-07-23
114
+
115
+ ### Fixed
116
+
117
+ - The slide-over record form auto-sizes its width to the content, so long field
118
+ labels no longer wrap or overflow.
119
+
120
+ ## 1.1.7 — 2026-07-23
121
+
122
+ Baseline release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viliha/vui-ui",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "Vui UI — a clean, token-driven React admin/CRM component library built on Tailwind CSS v4, shadcn-style patterns, and Radix Icons. Ships as TypeScript source (Just-in-Time), compiled by the consuming app.",
5
5
  "license": "MIT",
6
6
  "author": "Suman Bonakurthi",
@@ -36,6 +36,7 @@
36
36
  "bin",
37
37
  "template",
38
38
  "AGENT.md",
39
+ "CHANGELOG.md",
39
40
  "CLAUDE.template.md"
40
41
  ],
41
42
  "bin": {
package/src/chart.tsx CHANGED
@@ -35,18 +35,38 @@ export function ChartContainer({
35
35
  Object.entries(config).map(([key, v]) => [`--color-${key}`, v.color]),
36
36
  ) as React.CSSProperties;
37
37
 
38
+ // Only mount the ResponsiveContainer once the wrapper has a real size.
39
+ // Keep-alive tabs render inactive pages with `display:none` (0×0), which makes
40
+ // Recharts warn "width(0) and height(0) … should be greater than 0"; gating on
41
+ // an observed size avoids that and mounts the chart the moment the tab shows.
42
+ const ref = React.useRef<HTMLDivElement>(null);
43
+ const [sized, setSized] = React.useState(false);
44
+ React.useEffect(() => {
45
+ const el = ref.current;
46
+ if (!el) return;
47
+ const ro = new ResizeObserver(([entry]) => {
48
+ const r = entry?.contentRect;
49
+ setSized(!!r && r.width > 0 && r.height > 0);
50
+ });
51
+ ro.observe(el);
52
+ return () => ro.disconnect();
53
+ }, []);
54
+
38
55
  return (
39
56
  <ChartConfigContext.Provider value={config}>
40
57
  <div
58
+ ref={ref}
41
59
  style={cssVars}
42
60
  className={cn(
43
61
  "aspect-video w-full text-xs [&_.recharts-cartesian-grid_line]:stroke-border/60 [&_.recharts-text]:fill-muted-foreground",
44
62
  className,
45
63
  )}
46
64
  >
47
- <ResponsiveContainer width="100%" height="100%">
48
- {children}
49
- </ResponsiveContainer>
65
+ {sized && (
66
+ <ResponsiveContainer width="100%" height="100%">
67
+ {children}
68
+ </ResponsiveContainer>
69
+ )}
50
70
  </div>
51
71
  </ChartConfigContext.Provider>
52
72
  );
@@ -2,6 +2,9 @@
2
2
  # All are optional; defaults are used when unset. NEXT_PUBLIC_ vars are read at
3
3
  # build time and inlined into the exported site.
4
4
 
5
+ # App / brand name shown in the sidebar, wordmark, auth screens, and page titles.
6
+ NEXT_PUBLIC_APP_NAME="Vui Starter"
7
+
5
8
  NEXT_PUBLIC_COMPANY_NAME="VILIHA PTE. LTD."
6
9
  # Optional — links the company name in the footer:
7
10
  NEXT_PUBLIC_COMPANY_URL="https://viliha.com"
@@ -13,6 +13,7 @@ import {
13
13
  } from "@radix-ui/react-icons";
14
14
 
15
15
  import { cn } from "@/lib/utils";
16
+ import { SITE } from "@/lib/seo";
16
17
  import { Menu as MenuPanel } from "@viliha/vui-ui/menu";
17
18
  import { Logo } from "./logo";
18
19
  import { QuickActionsLauncher } from "./quick-actions";
@@ -369,13 +370,13 @@ function SidebarBody({
369
370
  collapsed ? "w-9 shrink-0 justify-center px-0" : "flex-1",
370
371
  )}
371
372
  aria-label="Switch workspace"
372
- title={collapsed ? "Vui Starter" : undefined}
373
+ title={collapsed ? SITE.name : undefined}
373
374
  >
374
375
  <Logo variant="mark" className="h-6 w-6 shrink-0" />
375
376
  {!collapsed && (
376
377
  <>
377
378
  <span className="min-w-0 flex-1 truncate text-lg font-bold tracking-tight text-foreground">
378
- Vui Starter
379
+ {SITE.name}
379
380
  </span>
380
381
  <ChevronsUpDown className="size-4 shrink-0 text-muted-foreground" />
381
382
  </>
@@ -1,6 +1,7 @@
1
1
  import Image from "next/image";
2
2
 
3
3
  import { cn } from "@/lib/utils";
4
+ import { SITE } from "@/lib/seo";
4
5
 
5
6
  type LogoProps = {
6
7
  /** Kept for call-site compatibility; the mark is the same either way. */
@@ -32,7 +33,7 @@ export function Logo({ className }: LogoProps) {
32
33
  <svg
33
34
  viewBox="0 0 24 24"
34
35
  role="img"
35
- aria-label="Vui Starter"
36
+ aria-label={SITE.name}
36
37
  className={cn("h-6 w-6", className)}
37
38
  >
38
39
  <rect width="24" height="24" rx="6" fill="var(--brand-indigo)" />
@@ -1,6 +1,7 @@
1
1
  import Link from "next/link";
2
2
 
3
3
  import { cn } from "@/lib/utils";
4
+ import { SITE } from "@/lib/seo";
4
5
  import { Logo } from "./logo";
5
6
 
6
7
  /**
@@ -29,14 +30,14 @@ export function Wordmark({
29
30
  textClassName,
30
31
  )}
31
32
  >
32
- Vui Starter
33
+ {SITE.name}
33
34
  </span>
34
35
  </>
35
36
  );
36
37
  const classes = cn("flex items-center gap-2", className);
37
38
 
38
39
  return href ? (
39
- <Link href={href} aria-label="Vui Starter" className={classes}>
40
+ <Link href={href} aria-label={SITE.name} className={classes}>
40
41
  {content}
41
42
  </Link>
42
43
  ) : (
@@ -3,7 +3,9 @@ import type { Metadata } from "next";
3
3
  /** Single source of truth for site-wide SEO. Deployed as a static export to a
4
4
  * custom domain (see ../CNAME), so URLs are absolute against SITE.url. */
5
5
  export const SITE = {
6
- name: "Vui Starter",
6
+ // App/brand name shown in the sidebar, wordmark, auth screens, and page
7
+ // titles. Override per deployment via env (NEXT_PUBLIC_ = inlined at build).
8
+ name: process.env.NEXT_PUBLIC_APP_NAME ?? "Vui Starter",
7
9
  tagline: "React Admin & CRM Design System",
8
10
  url: "https://vui.viliha.com",
9
11
  description: