@wealth-os/design-system 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +36 -0
- package/LICENSE +201 -0
- package/README.md +89 -2
- package/dist/button-yvMc7CT-.js +47 -0
- package/dist/charts.d.ts +138 -0
- package/dist/charts.js +712 -0
- package/dist/command-menu.d.ts +3 -0
- package/dist/command-menu.js +53 -0
- package/dist/components/advanced-controls.d.ts +145 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/button-group.d.ts +15 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/command-menu.d.ts +42 -0
- package/dist/components/data-display.d.ts +100 -0
- package/dist/components/data-table.d.ts +113 -0
- package/dist/components/date-input.d.ts +36 -0
- package/dist/components/date-range-picker.d.ts +23 -0
- package/dist/components/field.d.ts +18 -0
- package/dist/components/financial.d.ts +83 -0
- package/dist/components/form.d.ts +8 -0
- package/dist/components/icon-button.d.ts +11 -0
- package/dist/components/icons.d.ts +9 -0
- package/dist/components/navigation.d.ts +53 -0
- package/dist/components/notice.d.ts +11 -0
- package/dist/components/number-input.d.ts +44 -0
- package/dist/components/overlays.d.ts +91 -0
- package/dist/components/select-menu.d.ts +27 -0
- package/dist/components/select.d.ts +23 -0
- package/dist/components/status-badge.d.ts +9 -0
- package/dist/components/surface.d.ts +16 -0
- package/dist/components/text-input.d.ts +8 -0
- package/dist/components/textarea.d.ts +7 -0
- package/dist/components/validation-message.d.ts +8 -0
- package/dist/data-display-BA7t1E4G.js +278 -0
- package/dist/data-table.d.ts +2 -0
- package/dist/data-table.js +346 -0
- package/dist/financial.d.ts +1 -0
- package/dist/financial.js +178 -0
- package/dist/form-Csxly6Es.js +74 -0
- package/dist/forms.d.ts +39 -0
- package/dist/forms.js +32 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1411 -0
- package/dist/lib/control-density.d.ts +3 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/navigation.d.ts +3 -0
- package/dist/navigation.js +224 -0
- package/dist/notice-jbY9FQu_.js +49 -0
- package/dist/overlays-BleXRtz6.js +219 -0
- package/dist/overlays.d.ts +7 -0
- package/dist/overlays.js +2 -0
- package/dist/reset.css +16 -0
- package/dist/styles.css +3 -0
- package/dist/tokens.css +157 -0
- package/dist/utils-CX-Pz5p6.js +8 -0
- package/docs/accessibility.md +154 -0
- package/docs/charts.md +47 -0
- package/docs/components.md +296 -0
- package/docs/data-table.md +87 -0
- package/docs/layout-composition.md +224 -0
- package/docs/migration.md +91 -0
- package/docs/tokens.md +170 -0
- package/package.json +118 -4
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Migrating from 0.1.0 to 0.2.0
|
|
2
|
+
|
|
3
|
+
The refresh evolves `@wealth-os/design-system`; it does not create a second system. It is an explicit visual upgrade, not an appearance-preserving patch. Source metadata is 0.2.0 for release review. Install from npm only after publication is approved and verified.
|
|
4
|
+
|
|
5
|
+
## What changes
|
|
6
|
+
|
|
7
|
+
| Area | 0.1.0 → 0.2.0 |
|
|
8
|
+
|---|---|
|
|
9
|
+
| Actions | Violet → approved landing navy `#061b31`, with its exact derived hover |
|
|
10
|
+
| Focus / links / selection | Independent roles instead of inheriting primary action color |
|
|
11
|
+
| Main control radius | 4px → 8px |
|
|
12
|
+
| Embedded radius | Named 4px inner token; menu items use it; select popup adopts shared 8px outer radius |
|
|
13
|
+
| Product typography | Existing compact size anchors, medium heading/figure weights, shared label roles |
|
|
14
|
+
| Marketing typography | Opt-in heading role; no global hero scaling |
|
|
15
|
+
| Density | Optional compact 36px/14px and comfortable 44px/15px; omission keeps prior heights |
|
|
16
|
+
| Surface/Card radius | Default 8px retained; optional `lg` 16px / `xl` 24px |
|
|
17
|
+
| Feedback / charts | Preserve meaningful palettes; AllocationBar primary maps to chart one |
|
|
18
|
+
| CommandMenu | Capture the focused external launcher on open and restore on close when still usable |
|
|
19
|
+
|
|
20
|
+
No existing runtime export/subpath/required prop/dependency range is removed. Theme behavior and visual output intentionally change; review custom CSS and snapshots even when TypeScript compiles.
|
|
21
|
+
|
|
22
|
+
## Consumer installation — after release approval and publication
|
|
23
|
+
|
|
24
|
+
Pin the exact approved npm version. For Active Beta, use Bun and commit `package.json` with `bun.lock` in a separately authorized application PR:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
bun add --exact @wealth-os/design-system@0.2.0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Do not change Active Beta, install a local package there, copy component implementations, or add another lockfile during design-system-only work.
|
|
31
|
+
|
|
32
|
+
Import the consumer's Tailwind first and the package stylesheet once:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@import "tailwindcss" source(none);
|
|
36
|
+
@source "../src";
|
|
37
|
+
@import "tw-animate-css";
|
|
38
|
+
@import "@wealth-os/design-system/styles.css" layer(components);
|
|
39
|
+
/* Deliberate host token overrides follow, outside the layer. */
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The explicit sources/animation import above describe Active Beta's existing setup; other hosts use their own Tailwind sources. Keep its existing `layer(components)` boundary. An unlayered import can change utility precedence. Existing unlayered hosts should compare their cascade before adopting layering.
|
|
43
|
+
|
|
44
|
+
The package stylesheet includes tokens but no preflight or document defaults. Do not import `tokens.css` alongside it. `reset.css` remains opt-in, and hosts retain global font, background and focus ownership. Use documented public imports, including optional subpaths; never private `src/` files.
|
|
45
|
+
|
|
46
|
+
## Theme overrides
|
|
47
|
+
|
|
48
|
+
Use the semantic role that owns the change:
|
|
49
|
+
|
|
50
|
+
- Actions: `--action-background`, `--action-hover`, `--action-foreground` (primary compatibility utilities remain available).
|
|
51
|
+
- Links: `--link-color`, `--link-hover`.
|
|
52
|
+
- Focus: `--focus-color`, exposed through `--ring` for compatibility.
|
|
53
|
+
- Flat selection: `--selection-background`, `--selection-foreground`.
|
|
54
|
+
- Solid selected indicators: `--selection-indicator`, `--selection-indicator-foreground`; raised tabs use `--selection-surface`.
|
|
55
|
+
- Controls: `--control-border`, `--control-border-hover`, `--control-border-focus`.
|
|
56
|
+
- Decorative surfaces: `--surface-border`; never substitute it for an input boundary.
|
|
57
|
+
- Charts and semantic feedback: their dedicated chart/info/success/warning/destructive families.
|
|
58
|
+
|
|
59
|
+
Overriding `--primary` still themes primary Buttons and non-destructive confirmation actions. It intentionally no longer recolors unrelated focus/selection, link Buttons, informational notices or allocation series. Legacy accent/state aliases remain available; migrate deliberate host overrides to canonical roles rather than expecting one brand color to control every state.
|
|
60
|
+
|
|
61
|
+
## Typography and density
|
|
62
|
+
|
|
63
|
+
Use `type-product-page-title` / `type-product-section-title` (existing names `type-page-title` / `type-section-title` remain), plus body, supporting, label and figure roles. Product titles retain 32px/26px responsive anchors, sections 22px and figures 28px. Medium weights and line heights change intentionally. Financial text/formatters and tabular numerals retain their meaning. Legacy light display roles remain; marketing heading sizes are opt-in.
|
|
64
|
+
|
|
65
|
+
Use the same explicit density across a reviewed form. Omission preserves Button size variants, old Select/Date `compact` 32px geometry and established advanced-control defaults. Explicit `density="compact"` means 36px, not the legacy 32px compact boolean. Explicit density takes precedence over legacy size/compact heights; caller classes can still intentionally override dimensions.
|
|
66
|
+
|
|
67
|
+
Supported: Button/IconButton, TextInput/Textarea, NumberInput/MoneyInput/QuantityInput, Select/SelectMenu, date controls/range, Combobox/Autocomplete/SearchInput, MultiSelect, Checkbox, RadioGroup, Toggle/ToggleGroup/SegmentedControl and TabsTrigger. Textarea stays multiline. Chip fields and described/wrapped choice rows grow; checkbox/radio indicators stay 16px. Nested clear/calendar targets, TabsList/group padding and calendar day cells do not all become fixed 44px boxes. Switch/Slider/OTP/FileUpload and table/overlay size APIs remain unchanged.
|
|
68
|
+
|
|
69
|
+
Surface/Card larger radii are opt-in and do not add clipping or change padding. Tabs now wrap within narrow columns while keeping logical keyboard order.
|
|
70
|
+
|
|
71
|
+
## Interaction and financial contracts
|
|
72
|
+
|
|
73
|
+
- Button still defaults to `type="button"`; submit explicitly where needed. The application's legacy adapter may default to submit and must not be mechanically removed.
|
|
74
|
+
- Number inputs keep controlled strings, incomplete drafts and existing optional blur formatting. Date input keeps US text / ISO value masking, invalid drafts and its existing calendar bounds behavior. No financial calculations or rates belong in UI components.
|
|
75
|
+
- Select-only controls are not interchangeable with searchable controls. Preserve required/disabled state, value types, refs, descriptions, errors, focus return and keyboard models.
|
|
76
|
+
- CommandMenu now restores the element focused before opening when that element is connected, enabled and usable. Removed/disabled/inert launchers are not focused, and deliberate post-close focus is respected. Programmatic opens with no focused launcher still require consumer-specific destination decisions; no launcher identity is invented.
|
|
77
|
+
- Financial values, precision, units, approximation, zero/unknown distinctions, caveats and engine outputs remain consumer-owned. Status includes text; ordinary money is not automatically green/red.
|
|
78
|
+
|
|
79
|
+
Specialized parity notes retained: SelectMenu and Date calendars remain local, non-portaled popups; an overflow-clipping ancestor can clip them. Date min/max constrain calendar choices; typed out-of-range ISO values still require consumer validation. Number formatting uses en-US Intl grouping on blur without validating financial meaning. Do not change these contracts as part of visual adoption.
|
|
80
|
+
|
|
81
|
+
## WealthOS application compatibility and migration order
|
|
82
|
+
|
|
83
|
+
The session's application audit found package 0.1.0 pinned, layered CSS, React 19/Tailwind 4, legacy UI adapters, duplicated `.btn`/`.field` recipes, local primary-colored links/brand treatments, landing overrides and a chart-five override. That is a static compatibility assessment, not a fresh app validation run. This task does not modify or execute the application.
|
|
84
|
+
|
|
85
|
+
1. Reverify the current remote base and landing divergence on a separately approved integration branch. Earlier 2-ahead/169-behind measurements are historical, not a current merge plan.
|
|
86
|
+
2. Upgrade the exact published package and lockfile while preserving CSS layering, adapters and app-owned financial behavior.
|
|
87
|
+
3. Review a bounded form/result pilot, then migrate duplicated recipes component family by family. Do not combine the refresh with Recharts/dependency upgrades or copy package components into routes.
|
|
88
|
+
4. Review desktop/mobile/zoom, long labels and values, validation/disabled/empty/loading states, numeric/date editing, form submission, keyboard focus, tables and all required application/engine gates.
|
|
89
|
+
5. Retire old utilities/adapters only when callers and indirect dependencies are accounted for. Verify Lovable's connected branch and preview workflow separately.
|
|
90
|
+
|
|
91
|
+
The existing app's Recharts 2 and the optional package charts module's Recharts 3 remain separate. Publication does not upgrade the app or deploy Lovable. Native input rendering, faint control-boundary contrast and consumer overrides still need target-platform review. Light theme only; no claim of a complete accessibility audit.
|
package/docs/tokens.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# WealthOS token reference
|
|
2
|
+
|
|
3
|
+
`src/tokens.css` is the single canonical source for semantic and component tokens. The first landing refresh slice separates interaction roles and adopts the approved landing action treatment. Text, semantic feedback, chart colors, layout measures and control heights are retained. 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" layer(components);
|
|
10
|
+
/* Keep host token overrides after the package, outside the layer. */
|
|
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
|
+
| `--action-background` | `var(--foreground)` → `#061b31` | Dark landing primary action. |
|
|
28
|
+
| `--action-hover` | `color-mix(in srgb, var(--surface) 12%, var(--foreground))` | Exact landing hover; approximately `#24364a` over default tokens. |
|
|
29
|
+
| `--action-foreground` | `#ffffff` | Text on primary actions. |
|
|
30
|
+
| `--link-color`, `--link-hover` | Foreground / secondary foreground | Independent link text roles (`#061b31` / `#273951`). |
|
|
31
|
+
| `--focus-color` | `var(--foreground)` | Independent keyboard focus (`#061b31`). |
|
|
32
|
+
| `--selection-background` | `color-mix(in srgb, var(--foreground) 8%, var(--surface))` | Landing calculator track mix; approximately `#ebedef`. |
|
|
33
|
+
| `--selection-foreground` | `var(--foreground)` | Selected text. |
|
|
34
|
+
| `--control-border` | `var(--border)` | Preserve existing control boundary (`#e5edf5`). |
|
|
35
|
+
| `--control-border-hover` | `var(--muted-foreground)` | Existing landing feature hover color (`#5f6f86`). |
|
|
36
|
+
| `--control-border-focus` | `var(--focus-color)` | Focused field border. |
|
|
37
|
+
| `--surface-border` | `color-mix(in srgb, var(--foreground) 7%, transparent)` | Exact decorative landing frame border; approximately `#eeeff1` over white. Not a control border. |
|
|
38
|
+
| `--primary`, `--primary-hover`, `--primary-foreground` | Action background / hover / foreground | Compatibility aliases; Button primary utilities still honor host primary overrides. |
|
|
39
|
+
| `--primary-subdued` | Control border hover | Legacy hover-border alias, no longer lilac. |
|
|
40
|
+
| `--accent`, `--accent-subtle`, `--accent-foreground` | Selection background / background / foreground | Neutral selection compatibility aliases; not informational feedback. |
|
|
41
|
+
| `--success` | `#0b6b32` | Explicit success status. |
|
|
42
|
+
| `--success-foreground` | `#ffffff` | Text on success fill. |
|
|
43
|
+
| `--success-subtle` | `rgb(21 190 83 / 20%)` | Quiet success fill. |
|
|
44
|
+
| `--warning` | `#8a5a22` | Warning and stale-data status. |
|
|
45
|
+
| `--warning-foreground` | `#ffffff` | Text on warning fill. |
|
|
46
|
+
| `--warning-subtle` | `#fff7e8` | Quiet warning fill. |
|
|
47
|
+
| `--destructive` | `#b42342` | Errors and destructive actions. |
|
|
48
|
+
| `--destructive-foreground` | `#ffffff` | Text on destructive fill. |
|
|
49
|
+
| `--destructive-subtle` | `#fff0f2` | Quiet destructive fill. |
|
|
50
|
+
| `--info`, `--info-subtle`, `--info-border` | `#2e2b8c`, `rgb(83 58 253 / 6%)`, `#533afd` | Retained informational/estimated feedback, independent of action and selection colors. |
|
|
51
|
+
|
|
52
|
+
Chart palette: `--chart-1 #533afd`, `--chart-2 #5f6f86`, `--chart-3 #665efd`, `--chart-4 #273951`, `--chart-5 #8656c8`.
|
|
53
|
+
|
|
54
|
+
Shadcn aliases map `card` and `popover` to surface, `secondary` to subtle surface, `input` to control border, `ring` to focus, 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.
|
|
55
|
+
|
|
56
|
+
### Landing provenance and customization
|
|
57
|
+
|
|
58
|
+
Reference: application `design/landing` commit `1a77e2f`, `src/components/landing/LandingTheme.css`, `Landing.css`, `CalculatorPreview.css`, and `ProductDiscovery.css`. These values are extracted from CSS, not screenshot samples. The hover and decorative border preserve the exact mix expressions; hex equivalents are rounded illustrations. No warm-charcoal palette has been introduced.
|
|
59
|
+
|
|
60
|
+
Shared selection uses the landing calculator's neutral track mix as an explicitly promoted role; it does not reproduce the calculator's white active-tab composition everywhere. Control hover promotes the existing feature-card hover color. Both need visual review across the full component catalog.
|
|
61
|
+
|
|
62
|
+
Override the role you intend to change: `--action-background` for actions, `--link-color` for links, `--focus-color` for focus, `--selection-background` for selection, and `--control-border` for controls. `--primary` overrides still affect primary Button utilities; they intentionally no longer recolor link Buttons, basic field focus, semantic notices or AllocationBar. Retheme those through their own roles. Slice 3 also migrates advanced native accents, focus, navigation, calendar selection, tables and overlays to independent interaction roles.
|
|
63
|
+
|
|
64
|
+
`Notice` information and estimated `StatusBadge` explicitly use info roles. AllocationBar keeps the public color name `primary`, but maps it to `--chart-1`, preserving its financial chart color when actions become neutral.
|
|
65
|
+
|
|
66
|
+
Use `layer(components)` for Tailwind consumers so host utilities retain precedence; do not mix layered and unlayered package imports. Existing unlayered consumers should compare their cascade before changing import strategy.
|
|
67
|
+
|
|
68
|
+
### Semantic rules
|
|
69
|
+
|
|
70
|
+
- A financial value uses the ordinary foreground. A gain/loss or positive/negative number is not automatically a success/error state.
|
|
71
|
+
- A status must include text or another non-color cue. Color can reinforce meaning but cannot be its only carrier.
|
|
72
|
+
- Green and red are reserved for explicit success and error meaning; they do not represent money itself.
|
|
73
|
+
- Current theme support is light only. A Tailwind dark variant is not a supported dark theme until a full palette is designed and reviewed.
|
|
74
|
+
|
|
75
|
+
## Typography
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
| Utility | Size / weight / line-height | Responsive behavior |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| `type-display` | 48px / 300 / 1.15; −0.96px tracking | 32px below 768px. |
|
|
82
|
+
| `type-display-section` | 32px / 300 / 1.1; −0.64px tracking | 26px / 1.12 / −0.26px below 768px. |
|
|
83
|
+
| `type-page-title`, `type-product-page-title` | 32px / 500 / 1.15; −0.64px tracking | 26px / 1.12 / −0.26px below 768px. |
|
|
84
|
+
| `type-section-title`, `type-product-section-title` | 22px / 500 / 1.25; −0.22px tracking | Fixed. |
|
|
85
|
+
| `type-subsection` | 18px / 500 / 1.4 | Fixed. |
|
|
86
|
+
| `type-body` | 16px / 400 / 1.4 | Fixed. |
|
|
87
|
+
| `type-label` | 14px / 500 / 1.4 | Fixed. |
|
|
88
|
+
| `type-supporting` | 14px / 400 / 1.4 | Fixed. |
|
|
89
|
+
| `type-caption` | 13px / 400 / 1.4 | Fixed. |
|
|
90
|
+
| `type-metadata` | 12px / 400 / 1.4 | Fixed. |
|
|
91
|
+
| `type-control` | 14px / 400 / 1 | Fixed. |
|
|
92
|
+
| `type-figure` | 28px / 500 / 1.2; tabular numerals | Fixed; no marketing hero scaling. |
|
|
93
|
+
| `type-marketing-heading` | 48px / 500 / 1.15; −0.02em | 32px below 640px; opt-in only. |
|
|
94
|
+
| `type-eyebrow` | 12px / 500 / 1.2; 0.5px tracking, uppercase | Fixed. |
|
|
95
|
+
| `tabular` | Tabular numerals | Use for aligned amounts, quantities, dates and rates. |
|
|
96
|
+
|
|
97
|
+
## Layout, spacing, radius and elevation
|
|
98
|
+
|
|
99
|
+
| Role | Value |
|
|
100
|
+
|---|---|
|
|
101
|
+
| Page gutter | `--page-gutter: 20px` |
|
|
102
|
+
| Sidebar / rail | `--sidebar-width: 248px`, `--sidebar-rail: 64px` |
|
|
103
|
+
| Top bar | `--topbar-height: 56px` |
|
|
104
|
+
| Wide / standard / focused / readable measure | 1152px / 1024px / 512px / 672px (`--content-width-*`) |
|
|
105
|
+
| Base radius | `--radius: 0.5rem` (8px) |
|
|
106
|
+
| Derived radius | 4px (`sm`), 6px (`md`), 8px (`lg`), 12px (`xl`) |
|
|
107
|
+
| Working surface | White, subtle border, 8px radius, `--shadow-working` |
|
|
108
|
+
| Working shadow | `0 3px 6px rgb(23 23 23 / 0.04), 0 15px 35px -12px rgb(23 23 23 / 0.045)` |
|
|
109
|
+
| Focus | 2px independent focus outline; components use a 2px offset, while fields retain 0px; the host application owns any global focus rule |
|
|
110
|
+
|
|
111
|
+
`--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: 8px`, `--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.
|
|
112
|
+
|
|
113
|
+
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.
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## First refresh slice: geometry and scope
|
|
119
|
+
|
|
120
|
+
Controls now use `--control-radius: 8px`, matching landing action geometry. `--surface-radius` remains 8px; existing surface shadow, padding, default 36px height, and legacy 32/40px Button sizes are unchanged. Button weight is 600, as on the landing. Working, quiet and raised Surface variants use the decorative landing frame border; raised/working keep their existing elevation.
|
|
121
|
+
|
|
122
|
+
Slice 1 introduced no density prop or broader typography migration. Slice 2 below adds explicit density and product type roles; it does not change the 36px default or introduce a larger surface-radius API or layout/spacing migration. Tailwind radius arithmetic is retained for compatibility; basic Button/Surface use explicit role tokens.
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## Typography and density — slice 2 (unreleased)
|
|
126
|
+
|
|
127
|
+
Product type uses existing 32/26px page-title, 22px section, 18px subsection, 16px body, 14px supporting/label and 28px figure anchors. Landing-derived weights are explicit tokens: page/section/subsection/label/figure 500, body/supporting 400. `--type-line-height-figure` is 1.2. Field labels now consume `type-label` (500 rather than a local 600 override). FinancialMetric and Stat figure containers share the figure weight/line height and tabular numerals; inline CurrencyValue/PercentageValue/ShareQuantity continue inheriting surrounding size and preserve their existing formatting.
|
|
128
|
+
|
|
129
|
+
`type-product-page-title` aliases the established `type-page-title` role; `type-product-section-title` aliases `type-section-title`. Page/section/subsection/figure weights intentionally change, but legacy `type-display` and `type-display-section` keep their existing light display treatment. The new opt-in `type-marketing-heading` reproduces the landing section heading, not its fluid hero. No hero sizes or global document typography are applied to products. The package safelists the public product/marketing utilities so consumers need no scan of library source.
|
|
130
|
+
|
|
131
|
+
| Density token | Value |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `--control-height-compact` | 36px |
|
|
134
|
+
| `--control-height-comfortable` | 44px |
|
|
135
|
+
| `--type-size-control-compact` | 14px |
|
|
136
|
+
| `--type-size-control-comfortable` | 15px |
|
|
137
|
+
|
|
138
|
+
`density="compact"` / `"comfortable"` is explicit. Omitting it preserves each control’s previous sizing, including Button sm/lg/icon variants and legacy `compact` 32px Select/Date triggers. Explicit density takes precedence over legacy height choices; Button size still supplies padding, while explicit density supplies the single-line height and text size. IconButtons become 36/44px squares. Link Buttons retain automatic height. Textarea keeps its existing multiline minimum height and rows behavior; density changes control font size and vertical padding (8/12px), not a 36/44px fixed textarea height.
|
|
139
|
+
|
|
140
|
+
Supported: Button/IconButton, TextInput/Textarea, NumberInput/MoneyInput/QuantityInput, Select/SelectMenu, DateInput/UsDateInput/DateRangePicker. Select popup rows use the explicit density; the date calendar grid remains unchanged. Slice 2 left advanced widgets unchanged; the additional supported controls in slice 3 are documented below. Switches, sliders, OTP, file upload, overlay and table density APIs remain unchanged.
|
|
141
|
+
|
|
142
|
+
Density uses local `--wos-control-*` implementation variables, not root overrides. External layout classes remain last so deliberate host sizing overrides are possible. Existing root `--control-height` and `--type-size-control` still govern omitted-density controls. Density does not modify validation, parsing, formatting, focus policy or event handlers.
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## Remaining shared foundations — slice 3 (unreleased)
|
|
146
|
+
|
|
147
|
+
| Role | Canonical value | Consumers |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| `--selection-indicator` | `var(--foreground)` (`#061b31`) | Native checked accents, solid calendar selection, table selection controls, progress and timeline markers |
|
|
150
|
+
| `--selection-indicator-foreground` | `#ffffff` | Text on solid selection |
|
|
151
|
+
| `--selection-surface` | `var(--surface)` (`#ffffff`) | Raised active tabs, following the landing calculator pattern |
|
|
152
|
+
| `--interaction-hover` | `var(--surface-subtle)` (`#f8fafc`) | Hover and active-option surfaces |
|
|
153
|
+
| `--overlay-backdrop` | `color-mix(in srgb, var(--foreground) 35%, transparent)` | Existing backdrop opacity, now a semantic token |
|
|
154
|
+
| `--surface-radius-large` | 16px | Opt-in `Surface` / `Card` `radius="lg"` |
|
|
155
|
+
| `--surface-radius-presentation` | 24px | Opt-in `Surface` / `Card` `radius="xl"` |
|
|
156
|
+
|
|
157
|
+
Selected chips/segments/menu items use the existing 8% selection fill and foreground. Raised tabs deliberately use a white active surface instead of the flat selection fill, preserving the landing hierarchy. Focus is `--focus-color` via `--ring`, not the primary action alias. Disabled opacity uses `--state-disabled-opacity`; native control/platform disabled rendering still applies. Invalid controls retain destructive borders or an additional destructive cue without recoloring their keyboard focus. Decorative panel borders and input boundaries remain separate.
|
|
158
|
+
|
|
159
|
+
Combobox/Autocomplete/SearchInput, MultiSelect, Checkbox, RadioGroup, Toggle, ToggleGroup/SegmentedControl and TabsTrigger now accept optional `density`. Omission preserves their existing geometry. Explicit density gives text-entry/trigger heights of 36/44px; option/choice rows are minimum heights so descriptions and wrapped labels can grow. MultiSelect is a growing composite, not a forced 44px box: selected chips and multiple lines increase its height. Checkbox/radio indicators stay 16px; density changes their label-row minimum, not indicator size. Tabs lists and segmented containers include their existing padding around density-sized triggers.
|
|
160
|
+
|
|
161
|
+
Surface/Card `radius` accepts `default`, `lg`, `xl` (8/16/24px). Padding, working/quiet/raised variants, shadow, semantic container behavior and omission defaults remain. A larger radius does not imply clipping or change content layout. Existing host `--surface-radius` overrides still control default surfaces; the two larger options have independent tokens.
|
|
162
|
+
|
|
163
|
+
Button primary utilities remain compatible with host `--primary` overrides. Other shared interactions no longer infer focus/selection from primary; use the new roles for intentional overrides. Financial chart series and success/warning/error/info values are unchanged. No hardcoded product colors remain in component implementations; canonical values stay in `tokens.css`.
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## Release audit refinements
|
|
167
|
+
|
|
168
|
+
`--control-radius-inner: 4px` owns embedded calendar buttons, selected chips/clear controls and dense menu-row rounding. Main control frames and SelectMenu popups use `--control-radius: 8px`; default surfaces stay 8px with optional 16/24px variants. Existing calendar inner geometry is preserved; menu-row radius moves from 3px to the named 4px role, and SelectMenu popup from 6px to shared 8px. Calendar unavailable dates now use the shared 0.6 disabled opacity. This completes the documented geometry/state contracts without changing calendar selection behavior.
|
|
169
|
+
|
|
170
|
+
Primary action compatibility utilities are intentional on Button and non-destructive ConfirmationDialog actions. They are not legacy violet styling: the default value is landing navy. Focus, selection, status and charts remain independent.
|
package/package.json
CHANGED
|
@@ -1,6 +1,120 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wealth-os/design-system",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.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
|
+
"CHANGELOG.md",
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"docs/accessibility.md",
|
|
17
|
+
"docs/charts.md",
|
|
18
|
+
"docs/components.md",
|
|
19
|
+
"docs/data-table.md",
|
|
20
|
+
"docs/layout-composition.md",
|
|
21
|
+
"docs/tokens.md",
|
|
22
|
+
"docs/migration.md"
|
|
23
|
+
],
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./overlays": {
|
|
33
|
+
"types": "./dist/overlays.d.ts",
|
|
34
|
+
"import": "./dist/overlays.js"
|
|
35
|
+
},
|
|
36
|
+
"./navigation": {
|
|
37
|
+
"types": "./dist/navigation.d.ts",
|
|
38
|
+
"import": "./dist/navigation.js"
|
|
39
|
+
},
|
|
40
|
+
"./command-menu": {
|
|
41
|
+
"types": "./dist/command-menu.d.ts",
|
|
42
|
+
"import": "./dist/command-menu.js"
|
|
43
|
+
},
|
|
44
|
+
"./forms": {
|
|
45
|
+
"types": "./dist/forms.d.ts",
|
|
46
|
+
"import": "./dist/forms.js"
|
|
47
|
+
},
|
|
48
|
+
"./data-table": {
|
|
49
|
+
"types": "./dist/data-table.d.ts",
|
|
50
|
+
"import": "./dist/data-table.js"
|
|
51
|
+
},
|
|
52
|
+
"./charts": {
|
|
53
|
+
"types": "./dist/charts.d.ts",
|
|
54
|
+
"import": "./dist/charts.js"
|
|
55
|
+
},
|
|
56
|
+
"./financial": {
|
|
57
|
+
"types": "./dist/financial.d.ts",
|
|
58
|
+
"import": "./dist/financial.js"
|
|
59
|
+
},
|
|
60
|
+
"./styles.css": "./dist/styles.css",
|
|
61
|
+
"./tokens.css": "./dist/tokens.css",
|
|
62
|
+
"./reset.css": "./dist/reset.css"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"dev": "npm run build:lib && vite",
|
|
66
|
+
"build": "npm run build:lib && npm run build:playground",
|
|
67
|
+
"clean:dist": "node scripts/clean-dist.mjs",
|
|
68
|
+
"build:lib": "npm run clean:dist && tsc -p tsconfig.build.json && vite build --config vite.lib.config.ts && node scripts/copy-tokens.mjs",
|
|
69
|
+
"prepack": "npm run build:lib",
|
|
70
|
+
"build:playground": "vite build --config vite.config.ts",
|
|
71
|
+
"preview": "vite preview --config vite.config.ts",
|
|
72
|
+
"typecheck": "npm run build:lib && tsc --noEmit -p tsconfig.json",
|
|
73
|
+
"test": "npm run build:lib && node --test --test-concurrency=1 tests/*.test.mjs",
|
|
74
|
+
"build:consumer-fixture": "npm run build:lib && node scripts/prepare-consumer-fixture.mjs && vite build --config fixtures/consumer/vite.config.ts",
|
|
75
|
+
"typecheck:consumer-fixture": "npm run build:lib && tsc --noEmit -p fixtures/consumer/tsconfig.json",
|
|
76
|
+
"test:consumer-fixture": "npm run typecheck:consumer-fixture && npm run build:consumer-fixture && node scripts/smoke-consumer-fixture.mjs",
|
|
77
|
+
"build:chart-fixture": "npm run build:lib && tsc --noEmit -p fixtures/charts/tsconfig.json && vite build --config fixtures/charts/vite.config.ts",
|
|
78
|
+
"test:chart-fixture": "npm run build:chart-fixture && node scripts/smoke-chart-fixture.mjs",
|
|
79
|
+
"test:playground": "npm run build && node scripts/smoke-playground.mjs",
|
|
80
|
+
"dev:lab": "npm run build:lib && npm run dev --prefix lab",
|
|
81
|
+
"dev:chart-diagnostics": "npm run build:lib && vite --config vite.chart-diagnostics.config.ts",
|
|
82
|
+
"build:chart-diagnostics": "npm run build:lib && vite build --config vite.chart-diagnostics.config.ts",
|
|
83
|
+
"build:lab": "npm run build:lib && npm run build --prefix lab",
|
|
84
|
+
"typecheck:lab": "npm run build:lib && npm run typecheck --prefix lab",
|
|
85
|
+
"test:lab": "npm run build:lab && node scripts/smoke-lab.mjs"
|
|
86
|
+
},
|
|
87
|
+
"peerDependencies": {
|
|
88
|
+
"react": ">=19.0.0",
|
|
89
|
+
"react-dom": ">=19.0.0"
|
|
90
|
+
},
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"@radix-ui/react-alert-dialog": "^1.1.24",
|
|
93
|
+
"@radix-ui/react-dialog": "^1.2.0",
|
|
94
|
+
"@radix-ui/react-dropdown-menu": "^2.1.25",
|
|
95
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
96
|
+
"@radix-ui/react-navigation-menu": "^1.3.0",
|
|
97
|
+
"@radix-ui/react-popover": "^1.2.0",
|
|
98
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
99
|
+
"@radix-ui/react-tabs": "^1.1.22",
|
|
100
|
+
"@radix-ui/react-tooltip": "^1.3.0",
|
|
101
|
+
"@tanstack/react-table": "^9.2.6",
|
|
102
|
+
"class-variance-authority": "^0.7.1",
|
|
103
|
+
"clsx": "^2.1.1",
|
|
104
|
+
"cmdk": "^1.1.1",
|
|
105
|
+
"recharts": "^3.10.1",
|
|
106
|
+
"tailwind-merge": "^3.5.0"
|
|
107
|
+
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
110
|
+
"@types/react": "^19.2.0",
|
|
111
|
+
"@types/react-dom": "^19.2.0",
|
|
112
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
113
|
+
"jsdom": "^30.1.2",
|
|
114
|
+
"react": "^19.2.0",
|
|
115
|
+
"react-dom": "^19.2.0",
|
|
116
|
+
"tailwindcss": "^4.2.1",
|
|
117
|
+
"typescript": "^5.8.3",
|
|
118
|
+
"vite": "^8.1.5"
|
|
119
|
+
}
|
|
120
|
+
}
|