@wealth-os/design-system 0.0.0-stage → 0.1.0

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 (60) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +81 -2
  3. package/dist/button-MVZPcSXf.js +41 -0
  4. package/dist/charts.d.ts +138 -0
  5. package/dist/charts.js +712 -0
  6. package/dist/command-menu.d.ts +3 -0
  7. package/dist/command-menu.js +41 -0
  8. package/dist/components/advanced-controls.d.ts +138 -0
  9. package/dist/components/badge.d.ts +9 -0
  10. package/dist/components/button-group.d.ts +15 -0
  11. package/dist/components/button.d.ts +11 -0
  12. package/dist/components/command-menu.d.ts +42 -0
  13. package/dist/components/data-display.d.ts +100 -0
  14. package/dist/components/data-table.d.ts +113 -0
  15. package/dist/components/date-input.d.ts +34 -0
  16. package/dist/components/date-range-picker.d.ts +21 -0
  17. package/dist/components/field.d.ts +18 -0
  18. package/dist/components/financial.d.ts +83 -0
  19. package/dist/components/form.d.ts +8 -0
  20. package/dist/components/icon-button.d.ts +11 -0
  21. package/dist/components/icons.d.ts +9 -0
  22. package/dist/components/navigation.d.ts +47 -0
  23. package/dist/components/notice.d.ts +11 -0
  24. package/dist/components/number-input.d.ts +42 -0
  25. package/dist/components/overlays.d.ts +91 -0
  26. package/dist/components/select-menu.d.ts +25 -0
  27. package/dist/components/select.d.ts +21 -0
  28. package/dist/components/status-badge.d.ts +9 -0
  29. package/dist/components/surface.d.ts +15 -0
  30. package/dist/components/text-input.d.ts +6 -0
  31. package/dist/components/textarea.d.ts +5 -0
  32. package/dist/components/validation-message.d.ts +8 -0
  33. package/dist/data-display-BA7t1E4G.js +278 -0
  34. package/dist/data-table.d.ts +2 -0
  35. package/dist/data-table.js +346 -0
  36. package/dist/financial.d.ts +1 -0
  37. package/dist/financial.js +178 -0
  38. package/dist/form-D3G5306m.js +74 -0
  39. package/dist/forms.d.ts +39 -0
  40. package/dist/forms.js +32 -0
  41. package/dist/index.d.ts +22 -0
  42. package/dist/index.js +1382 -0
  43. package/dist/lib/utils.d.ts +3 -0
  44. package/dist/navigation.d.ts +3 -0
  45. package/dist/navigation.js +222 -0
  46. package/dist/notice-D5u9rkFU.js +49 -0
  47. package/dist/overlays-9ArfwHJo.js +219 -0
  48. package/dist/overlays.d.ts +7 -0
  49. package/dist/overlays.js +2 -0
  50. package/dist/reset.css +16 -0
  51. package/dist/styles.css +3 -0
  52. package/dist/tokens.css +118 -0
  53. package/dist/utils-CX-Pz5p6.js +8 -0
  54. package/docs/accessibility.md +128 -0
  55. package/docs/charts.md +47 -0
  56. package/docs/components.md +242 -0
  57. package/docs/data-table.md +87 -0
  58. package/docs/layout-composition.md +224 -0
  59. package/docs/tokens.md +94 -0
  60. package/package.json +116 -4
package/docs/tokens.md ADDED
@@ -0,0 +1,94 @@
1
+ # WealthOS token reference
2
+
3
+ `src/tokens.css` is the single canonical source for semantic and component tokens. It preserves current product palette and dimensional values, with shared geometry/type-role variables added for customization. Do not copy token declarations into component files. `src/styles.css` imports these tokens and maps them to Tailwind CSS 4 theme names and reusable type/layout/component utilities.
4
+
5
+ Consumer applications import their own Tailwind stylesheet first and the compiled package stylesheet once:
6
+
7
+ ```css
8
+ @import "tailwindcss";
9
+ @import "@wealth-os/design-system/styles.css";
10
+ /* Host overrides follow the package import. */
11
+ ```
12
+
13
+ The package stylesheet is consumer-safe: it includes the canonical variables, Tailwind 4 theme mapping, generated component classes, and type/layout utilities, but no Tailwind preflight or global document selectors. The separately exported `@wealth-os/design-system/tokens.css` contains only custom properties for environments that provide their own utility compilation. Do not import both `styles.css` and `tokens.css`; the stylesheet already includes the token source. `reset.css` is optional document defaults only and does not include preflight or global focus rules.
14
+
15
+ ## Colors
16
+
17
+ | Token | Value | Intended role |
18
+ |---|---|---|
19
+ | `--background` | `#f8f8f7` | Page canvas. |
20
+ | `--foreground` | `#061b31` | Main text and ordinary financial figures. |
21
+ | `--surface`, `--surface-raised` | `#ffffff` | Working and raised surfaces. |
22
+ | `--surface-subtle`, `--muted` | `#f8fafc` | Quiet fill and metadata backgrounds. |
23
+ | `--muted-foreground` | `#5f6f86` | Supporting text. |
24
+ | `--secondary-foreground` | `#273951` | Body and label text on surfaces. |
25
+ | `--border`, `--separator` | `#e5edf5` | Standard borders and separators. |
26
+ | `--border-subtle` | `#f0f0ef` | Quiet surface borders. |
27
+ | `--primary` | `#533afd` | Primary action, selection, focus. |
28
+ | `--primary-hover` | `#4434d4` | Primary action hover. |
29
+ | `--primary-subdued` | `#b9b9f9` | Subdued border/selection treatment. |
30
+ | `--primary-foreground` | `#ffffff` | Text on primary. |
31
+ | `--accent`, `--accent-foreground` | `#f5f3ff`, `#2e2b8c` | Accent selection fill and text. |
32
+ | `--accent-subtle` | `rgb(83 58 253 / 6%)` | Quiet accent fill. |
33
+ | `--success` | `#0b6b32` | Explicit success status. |
34
+ | `--success-foreground` | `#ffffff` | Text on success fill. |
35
+ | `--success-subtle` | `rgb(21 190 83 / 20%)` | Quiet success fill. |
36
+ | `--warning` | `#8a5a22` | Warning and stale-data status. |
37
+ | `--warning-foreground` | `#ffffff` | Text on warning fill. |
38
+ | `--warning-subtle` | `#fff7e8` | Quiet warning fill. |
39
+ | `--destructive` | `#b42342` | Errors and destructive actions. |
40
+ | `--destructive-foreground` | `#ffffff` | Text on destructive fill. |
41
+ | `--destructive-subtle` | `#fff0f2` | Quiet destructive fill. |
42
+ | `--info`, `--info-subtle` | Accent foreground and subtle accent aliases | Informational text and quiet informational fill; reuses the established accent palette. |
43
+
44
+ Chart palette: `--chart-1 #533afd`, `--chart-2 #5f6f86`, `--chart-3 #665efd`, `--chart-4 #273951`, `--chart-5 #b9b9f9`.
45
+
46
+ Shadcn aliases map `card` and `popover` to surface, `secondary` to subtle surface, `input` to border, `ring` to primary, and sidebar aliases to the corresponding WealthOS roles. These are compatibility names, not a second palette source. `--muted` currently shares the value of `--surface-subtle`; `--separator` shares `--border`; keep their roles distinct in code while changing their values only through this canonical file.
47
+
48
+ ### Semantic rules
49
+
50
+ - A financial value uses the ordinary foreground. A gain/loss or positive/negative number is not automatically a success/error state.
51
+ - A status must include text or another non-color cue. Color can reinforce meaning but cannot be its only carrier.
52
+ - Green and red are reserved for explicit success and error meaning; they do not represent money itself.
53
+ - Current theme support is light only. A Tailwind dark variant is not a supported dark theme until a full palette is designed and reviewed.
54
+
55
+ ## Typography
56
+
57
+ Font stack: `Inter`, `ui-sans-serif`, `system-ui`, `-apple-system`, `"Segoe UI"`, `sans-serif`. The host application controls font loading; this package does not make a remote font request.
58
+
59
+ | Utility | Size / weight / line-height | Responsive behavior |
60
+ |---|---|---|
61
+ | `type-display` | 48px / 300 / 1.15; −0.96px tracking | 32px below 768px. |
62
+ | `type-display-section` | 32px / 300 / 1.1; −0.64px tracking | 26px / 1.12 / −0.26px below 768px. |
63
+ | `type-page-title` | 32px / 300 / 1.1; −0.64px tracking | 26px / 1.12 / −0.26px below 768px. |
64
+ | `type-section-title` | 22px / 300 / 1.1; −0.22px tracking | Fixed. |
65
+ | `type-subsection` | 18px / 400 / 1.4 | Fixed. |
66
+ | `type-body` | 16px / 400 / 1.4 | Fixed. |
67
+ | `type-label` | 14px / 500 / 1.4 | Fixed. |
68
+ | `type-supporting` | 14px / 400 / 1.4 | Fixed. |
69
+ | `type-caption` | 13px / 400 / 1.4 | Fixed. |
70
+ | `type-metadata` | 12px / 400 / 1.4 | Fixed. |
71
+ | `type-control` | 14px / 400 / 1 | Fixed. |
72
+ | `type-eyebrow` | 12px / 500 / 1.2; 0.5px tracking, uppercase | Fixed. |
73
+ | `type-figure` | 28px / 300 / 1; tabular numerals | Fixed. For prominent display-ready amounts and quantities. |
74
+ | `tabular` | Tabular numerals | Use for aligned amounts, quantities, dates and rates. |
75
+
76
+ ## Layout, spacing, radius and elevation
77
+
78
+ | Role | Value |
79
+ |---|---|
80
+ | Page gutter | `--page-gutter: 20px` |
81
+ | Sidebar / rail | `--sidebar-width: 248px`, `--sidebar-rail: 64px` |
82
+ | Top bar | `--topbar-height: 56px` |
83
+ | Wide / standard / focused / readable measure | 1152px / 1024px / 512px / 672px (`--content-width-*`) |
84
+ | Base radius | `--radius: 0.5rem` (8px) |
85
+ | Derived radius | 4px (`sm`), 6px (`md`), 8px (`lg`), 12px (`xl`) |
86
+ | Working surface | White, subtle border, 8px radius, `--shadow-working` |
87
+ | Working shadow | `0 3px 6px rgb(23 23 23 / 0.04), 0 15px 35px -12px rgb(23 23 23 / 0.045)` |
88
+ | Focus | 2px primary outline; components use a 2px offset, while fields retain 0px; the host application owns any global focus rule |
89
+
90
+ `--surface-shadow` owns the single shadow value. `--shadow-working` remains a backward-compatible semantic alias. The Tailwind `shadow-working` utility maps directly to `--surface-shadow`. Shared component geometry is `--control-height: 36px`, `--control-radius: 4px`, `--surface-radius: 8px`; focus dimensions use `--focus-width`, `--focus-color`, `--focus-offset`, and `--control-focus-offset`. Existing small/large button dimensions remain named component variants, rather than creating a general spacing scale.
91
+
92
+ Interaction tokens include `--state-disabled-opacity`, `--state-disabled-action-opacity`, `--state-selected`, and `--state-selected-subtle`. Motion uses `--motion-duration-fast`, `--motion-duration-standard`, and `--motion-ease-standard`; reduced-motion preferences set durations to zero. The responsive layout recipes accept explicit per-instance custom properties for their gaps and grid minimum.
93
+
94
+ The current product uses Tailwind's default spacing utilities rather than a separate semantic spacing scale. Keep current layout roles; do not invent a new spacing or radius scale as part of a component implementation.
package/package.json CHANGED
@@ -1,6 +1,118 @@
1
1
  {
2
2
  "name": "@wealth-os/design-system",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Shared React components and design tokens for WealthOS products",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "types": "./dist/index.d.ts",
8
+ "sideEffects": [
9
+ "**/*.css"
10
+ ],
11
+ "files": [
12
+ "dist",
13
+ "README.md",
14
+ "LICENSE",
15
+ "docs/accessibility.md",
16
+ "docs/charts.md",
17
+ "docs/components.md",
18
+ "docs/data-table.md",
19
+ "docs/layout-composition.md",
20
+ "docs/tokens.md"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./overlays": {
31
+ "types": "./dist/overlays.d.ts",
32
+ "import": "./dist/overlays.js"
33
+ },
34
+ "./navigation": {
35
+ "types": "./dist/navigation.d.ts",
36
+ "import": "./dist/navigation.js"
37
+ },
38
+ "./command-menu": {
39
+ "types": "./dist/command-menu.d.ts",
40
+ "import": "./dist/command-menu.js"
41
+ },
42
+ "./forms": {
43
+ "types": "./dist/forms.d.ts",
44
+ "import": "./dist/forms.js"
45
+ },
46
+ "./data-table": {
47
+ "types": "./dist/data-table.d.ts",
48
+ "import": "./dist/data-table.js"
49
+ },
50
+ "./charts": {
51
+ "types": "./dist/charts.d.ts",
52
+ "import": "./dist/charts.js"
53
+ },
54
+ "./financial": {
55
+ "types": "./dist/financial.d.ts",
56
+ "import": "./dist/financial.js"
57
+ },
58
+ "./styles.css": "./dist/styles.css",
59
+ "./tokens.css": "./dist/tokens.css",
60
+ "./reset.css": "./dist/reset.css"
61
+ },
62
+ "scripts": {
63
+ "dev": "npm run build:lib && vite",
64
+ "build": "npm run build:lib && npm run build:playground",
65
+ "clean:dist": "node scripts/clean-dist.mjs",
66
+ "build:lib": "npm run clean:dist && tsc -p tsconfig.build.json && vite build --config vite.lib.config.ts && node scripts/copy-tokens.mjs",
67
+ "prepack": "npm run build:lib",
68
+ "build:playground": "vite build --config vite.config.ts",
69
+ "preview": "vite preview --config vite.config.ts",
70
+ "typecheck": "npm run build:lib && tsc --noEmit -p tsconfig.json",
71
+ "test": "npm run build:lib && node --test --test-concurrency=1 tests/*.test.mjs",
72
+ "build:consumer-fixture": "npm run build:lib && node scripts/prepare-consumer-fixture.mjs && vite build --config fixtures/consumer/vite.config.ts",
73
+ "typecheck:consumer-fixture": "npm run build:lib && tsc --noEmit -p fixtures/consumer/tsconfig.json",
74
+ "test:consumer-fixture": "npm run typecheck:consumer-fixture && npm run build:consumer-fixture && node scripts/smoke-consumer-fixture.mjs",
75
+ "build:chart-fixture": "npm run build:lib && tsc --noEmit -p fixtures/charts/tsconfig.json && vite build --config fixtures/charts/vite.config.ts",
76
+ "test:chart-fixture": "npm run build:chart-fixture && node scripts/smoke-chart-fixture.mjs",
77
+ "test:playground": "npm run build && node scripts/smoke-playground.mjs",
78
+ "dev:lab": "npm run build:lib && npm run dev --prefix lab",
79
+ "dev:chart-diagnostics": "npm run build:lib && vite --config vite.chart-diagnostics.config.ts",
80
+ "build:chart-diagnostics": "npm run build:lib && vite build --config vite.chart-diagnostics.config.ts",
81
+ "build:lab": "npm run build:lib && npm run build --prefix lab",
82
+ "typecheck:lab": "npm run build:lib && npm run typecheck --prefix lab",
83
+ "test:lab": "npm run build:lab && node scripts/smoke-lab.mjs"
84
+ },
85
+ "peerDependencies": {
86
+ "react": ">=19.0.0",
87
+ "react-dom": ">=19.0.0"
88
+ },
89
+ "dependencies": {
90
+ "@radix-ui/react-alert-dialog": "^1.1.24",
91
+ "@radix-ui/react-dialog": "^1.2.0",
92
+ "@radix-ui/react-dropdown-menu": "^2.1.25",
93
+ "@radix-ui/react-label": "^2.1.8",
94
+ "@radix-ui/react-navigation-menu": "^1.3.0",
95
+ "@radix-ui/react-popover": "^1.2.0",
96
+ "@radix-ui/react-slot": "^1.2.4",
97
+ "@radix-ui/react-tabs": "^1.1.22",
98
+ "@radix-ui/react-tooltip": "^1.3.0",
99
+ "@tanstack/react-table": "^9.2.6",
100
+ "class-variance-authority": "^0.7.1",
101
+ "clsx": "^2.1.1",
102
+ "cmdk": "^1.1.1",
103
+ "recharts": "^3.10.1",
104
+ "tailwind-merge": "^3.5.0"
105
+ },
106
+ "devDependencies": {
107
+ "@tailwindcss/vite": "^4.2.1",
108
+ "@types/react": "^19.2.0",
109
+ "@types/react-dom": "^19.2.0",
110
+ "@vitejs/plugin-react": "^5.2.0",
111
+ "jsdom": "^30.1.2",
112
+ "react": "^19.2.0",
113
+ "react-dom": "^19.2.0",
114
+ "tailwindcss": "^4.2.1",
115
+ "typescript": "^5.8.3",
116
+ "vite": "^8.1.5"
117
+ }
118
+ }