@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 +23 -0
- package/README.md +97 -89
- package/dist/index.cjs +1404 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +493 -0
- package/dist/index.d.ts +493 -0
- package/dist/index.js +1281 -0
- package/dist/index.js.map +1 -0
- package/dist/tailwind-preset.cjs +149 -0
- package/dist/tailwind-preset.cjs.map +1 -0
- package/dist/tailwind-preset.d.cts +125 -0
- package/dist/tailwind-preset.d.ts +125 -0
- package/dist/tailwind-preset.js +143 -0
- package/dist/tailwind-preset.js.map +1 -0
- package/package.json +63 -19
- package/styles.css +142 -0
- package/tokens/tokens.css +171 -0
- package/tokens/tokens.ts +190 -0
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
|
-
#
|
|
1
|
+
# @yourteam/invoicing-ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9
|
+
npm install @yourteam/invoicing-ui
|
|
10
|
+
# peer deps
|
|
11
|
+
npm install react react-dom tailwindcss tailwindcss-animate
|
|
16
12
|
```
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Routes
|
|
14
|
+
## Usage
|
|
21
15
|
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
52
|
-
- `@screens/*` → `screens/*`
|
|
50
|
+
### 3. Use components
|
|
53
51
|
|
|
54
|
-
|
|
52
|
+
```tsx
|
|
53
|
+
import { Button, Card, CardContent, tokens } from "@yourteam/invoicing-ui";
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
66
|
+
## Dark mode
|
|
62
67
|
|
|
63
|
-
|
|
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
|
-
|
|
71
|
+
## What ships
|
|
72
72
|
|
|
73
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
89
|
-
extraction, switching to the published package is a find-and-replace.
|
|
93
|
+
## Releasing
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
This package follows [Semantic Versioning](https://semver.org/) and
|
|
96
|
+
[Keep a Changelog](https://keepachangelog.com/).
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
109
|
+
```bash
|
|
110
|
+
npm publish
|
|
111
|
+
```
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
`prepublishOnly` runs `clean` + `build` automatically.
|
|
101
114
|
|
|
102
|
-
|
|
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
|
-
|
|
117
|
+
```bash
|
|
118
|
+
git push --follow-tags
|
|
119
|
+
```
|
|
108
120
|
|
|
109
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|