@muskanmeet/invoicing-design-system 0.1.1 → 0.1.2

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/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@yourteam/invoicing-ui` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-05-25
11
+
12
+ ### Added
13
+ - Initial extraction of the design system into a publishable npm package.
14
+ - Components: `Avatar`, `Badge`, `Button`, `Card`, `Checkbox`, `Dialog`,
15
+ `DropdownMenu`, `FormField`, `Input`, `Label`, `RadioGroup`, `Select`,
16
+ `Separator`, `Switch`, `Table`, `Tabs`, `Textarea`, `Toast`, `Toaster`,
17
+ `Tooltip`.
18
+ - Hooks: `useToast`, `useMediaQuery`.
19
+ - Utilities: `cn`, `tokens`.
20
+ - Tailwind preset exported as `@yourteam/invoicing-ui/tailwind-preset`.
21
+ - CSS entrypoints: `@yourteam/invoicing-ui/styles.css` and
22
+ `@yourteam/invoicing-ui/tokens.css`.
23
+ - `tsup`-powered build emitting ESM, CJS, and `.d.ts` to `dist/`.
package/README.md CHANGED
@@ -1,121 +1,129 @@
1
- # Invoicing System — Design Reference
1
+ # @yourteam/invoicing-ui
2
2
 
3
- A Next.js + TypeScript reference project for the **Invoicing System** initiative.
4
- It owns the design system, breakpoints, shadcn-based components, and the final
5
- screens the development team will consume.
3
+ Design system powering the Invoicing app design tokens, a Tailwind preset,
4
+ and shadcn-based React components on top of Radix primitives.
6
5
 
7
- > Frontend-only. No Next.js server features (API routes, server actions,
8
- > server-only data fetching) are used. The app exists purely to design, preview,
9
- > and hand off UI.
10
-
11
- ## Quick start
6
+ ## Install
12
7
 
13
8
  ```bash
14
- npm install
15
- npm run dev
9
+ npm install @yourteam/invoicing-ui
10
+ # peer deps
11
+ npm install react react-dom tailwindcss tailwindcss-animate
16
12
  ```
17
13
 
18
- Open <http://localhost:5000>.
19
-
20
- ## Routes
14
+ ## Usage
21
15
 
22
- | Route | What it is |
23
- | ----------------- | --------------------------------------------------------------- |
24
- | `/` | Index of everything in this repo |
25
- | `/design-system` | Living styleguide — tokens, breakpoints, every component |
26
- | `/dashboard` | Final screen: dashboard with KPIs, activity, recent invoices |
27
- | `/invoices` | Final screen: filterable, sortable invoice list with pagination |
28
- | `/login` | Final screen: login |
29
- | `/signup` | Final screen: signup |
16
+ ### 1. Import the CSS once
30
17
 
31
- ## Repo layout
18
+ In your app entry (e.g. `app/layout.tsx`, `pages/_app.tsx`, `main.tsx`):
32
19
 
20
+ ```ts
21
+ import "@yourteam/invoicing-ui/styles.css";
33
22
  ```
34
- app/ → Next.js App Router (preview pages only)
35
- design-system/ → THE design system (future npm package)
36
- tokens/ → Design tokens (TS + CSS variables)
37
- components/ → shadcn-based components, custom-themed
38
- lib/ → Utilities (e.g. cn())
39
- styles.css → Tailwind entry + token import
40
- index.ts → Public barrel — import only from here
41
- screens/ → Final invoicing screens (consumed via GitHub)
42
- _shared/ → Shell layout shared across screens
43
- dashboard/ → DashboardScreen
44
- invoices/ → InvoicesScreen
45
- auth/ → AuthScreen (login + signup)
46
- index.ts → Public barrel
23
+
24
+ `styles.css` includes `@tailwind base/components/utilities` plus the token
25
+ CSS variables. If you already manage your own Tailwind entry, import just
26
+ the tokens instead:
27
+
28
+ ```css
29
+ @import "@yourteam/invoicing-ui/tokens.css";
47
30
  ```
48
31
 
49
- Path aliases:
32
+ ### 2. Extend the Tailwind preset
33
+
34
+ ```ts
35
+ // tailwind.config.ts
36
+ import type { Config } from "tailwindcss";
37
+ import preset from "@yourteam/invoicing-ui/tailwind-preset";
38
+
39
+ export default {
40
+ presets: [preset],
41
+ content: [
42
+ "./app/**/*.{ts,tsx}",
43
+ "./src/**/*.{ts,tsx}",
44
+ // include the package so its class names survive purging
45
+ "./node_modules/@yourteam/invoicing-ui/dist/**/*.{js,mjs,cjs}",
46
+ ],
47
+ } satisfies Config;
48
+ ```
50
49
 
51
- - `@ds/*` `design-system/*`
52
- - `@screens/*` → `screens/*`
50
+ ### 3. Use components
53
51
 
54
- ## Design system
52
+ ```tsx
53
+ import { Button, Card, CardContent, tokens } from "@yourteam/invoicing-ui";
55
54
 
56
- Built on top of **shadcn/ui** primitives (Radix + Tailwind) with a custom
57
- "Modern SaaS" theme: subtle indigo accent, rounded radii, friendly Inter
58
- typography. All colors are HSL CSS variables (`--ds-*`), so retinting the
59
- system requires changing tokens only — no component edits.
55
+ export function Example() {
56
+ return (
57
+ <Card>
58
+ <CardContent>
59
+ <Button>Click me</Button>
60
+ </CardContent>
61
+ </Card>
62
+ );
63
+ }
64
+ ```
60
65
 
61
- Breakpoints (Tailwind `screens`):
66
+ ## Dark mode
62
67
 
63
- | Token | Min width | Target |
64
- | ----- | --------- | --------------- |
65
- | sm | 480px | Large phones |
66
- | md | 768px | Tablets |
67
- | lg | 1024px | Small laptops |
68
- | xl | 1280px | Desktops |
69
- | 2xl | 1536px | Wide displays |
68
+ Toggle the `.dark` class on `<html>` (or any ancestor) — all tokens swap
69
+ to their dark equivalents automatically.
70
70
 
71
- ### Future: extract `design-system/` to an npm package
71
+ ## What ships
72
72
 
73
- The folder is intentionally **self-contained**:
73
+ | Entry | What it is |
74
+ | ------------------------------------------- | ----------------------------------- |
75
+ | `@yourteam/invoicing-ui` | All components, hooks, tokens, `cn` |
76
+ | `@yourteam/invoicing-ui/tailwind-preset` | Tailwind preset (theme + plugins) |
77
+ | `@yourteam/invoicing-ui/styles.css` | Tailwind entry + token CSS vars |
78
+ | `@yourteam/invoicing-ui/tokens.css` | Just the token CSS vars |
74
79
 
75
- - Has its own `tokens/`, `lib/`, `components/`, `styles.css`, and `index.ts`.
76
- - Has **no inbound imports** from `app/` or `screens/`.
77
- - Uses only `clsx`, `tailwind-merge`, `class-variance-authority`, `lucide-react`,
78
- and `@radix-ui/*` — all standard, framework-agnostic.
80
+ ## Development
79
81
 
80
- To publish later:
82
+ ```bash
83
+ npm install
84
+ npm run build # bundle ESM + CJS + d.ts to dist/
85
+ npm run dev # watch mode
86
+ npm run typecheck
87
+ ```
81
88
 
82
- 1. Move `design-system/` to its own repo (e.g. `@yourteam/invoicing-ui`).
83
- 2. Add a `package.json` with the same Radix / Tailwind peer deps.
84
- 3. Move the matching parts of `tailwind.config.ts` into a preset the consumer
85
- extends, and ship `styles.css` + `tokens.css` as the CSS entrypoint.
86
- 4. Publish. Consumers do `import { Button } from "@yourteam/invoicing-ui"`.
89
+ The build uses [`tsup`](https://tsup.egoist.dev/). Output goes to `dist/`
90
+ with `react`, `react-dom`, `tailwindcss`, and `tailwindcss-animate` left
91
+ external.
87
92
 
88
- This project consumes the design system via the `@ds/*` alias today — after
89
- extraction, switching to the published package is a find-and-replace.
93
+ ## Releasing
90
94
 
91
- ## Final screens (for developers)
95
+ This package follows [Semantic Versioning](https://semver.org/) and
96
+ [Keep a Changelog](https://keepachangelog.com/).
92
97
 
93
- The `screens/` folder is what your developers will pull from this GitHub repo.
94
- Each screen:
98
+ 1. Make your changes on a branch.
99
+ 2. Add an entry under `## [Unreleased]` in `CHANGELOG.md`.
100
+ 3. Bump the version:
101
+ - `npm version patch` — bug fixes only
102
+ - `npm version minor` — additive, backward-compatible changes
103
+ - `npm version major` — breaking changes (renamed exports, removed
104
+ components, changed token names, etc.)
105
+ 4. Move the `Unreleased` block under a new `## [x.y.z] - YYYY-MM-DD`
106
+ heading.
107
+ 5. Publish:
95
108
 
96
- - Is a **client component** (`"use client"`) with no Next.js server APIs.
97
- - Imports **only** from `@ds/*`. No imports from `app/` or other framework code.
98
- - Uses mock/static data — wire it to your real API on consumption.
109
+ ```bash
110
+ npm publish
111
+ ```
99
112
 
100
- Consumers can drop these into:
113
+ `prepublishOnly` runs `clean` + `build` automatically.
101
114
 
102
- - A **Next.js + TypeScript** project (just place under `app/` or `pages/` and
103
- import the screen).
104
- - A **plain React + TypeScript** project (Vite, CRA, etc.) — the screens have
105
- no Next-specific dependencies.
115
+ 6. Push the tag created by `npm version` so the release is traceable:
106
116
 
107
- ### Caveat — navigation
117
+ ```bash
118
+ git push --follow-tags
119
+ ```
108
120
 
109
- `AppShell` uses plain `<a>` tags for portability. In a Next.js host, replace
110
- them with `next/link` if you want client-side navigation. The screens
111
- themselves (`DashboardScreen`, `InvoicesScreen`, `AuthScreen`) do not contain
112
- any links that depend on the framework.
121
+ ### What counts as breaking
113
122
 
114
- ## Scripts
123
+ - Removing or renaming an exported component, hook, or token.
124
+ - Changing a component's required props or default behavior.
125
+ - Renaming a CSS variable or Tailwind token (`--ds-*`, color names, etc.).
126
+ - Changing the Tailwind preset in a way that alters existing class output.
115
127
 
116
- | Script | Description |
117
- | --------------- | ---------------------------- |
118
- | `npm run dev` | Start dev server on `:5000` |
119
- | `npm run build` | Production build |
120
- | `npm run start` | Run production build |
121
- | `npm run lint` | Run ESLint |
128
+ Anything else (new components, new props with defaults, new tokens, internal
129
+ refactors) is minor or patch.