@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.
Files changed (63) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +201 -0
  3. package/README.md +89 -2
  4. package/dist/button-yvMc7CT-.js +47 -0
  5. package/dist/charts.d.ts +138 -0
  6. package/dist/charts.js +712 -0
  7. package/dist/command-menu.d.ts +3 -0
  8. package/dist/command-menu.js +53 -0
  9. package/dist/components/advanced-controls.d.ts +145 -0
  10. package/dist/components/badge.d.ts +9 -0
  11. package/dist/components/button-group.d.ts +15 -0
  12. package/dist/components/button.d.ts +14 -0
  13. package/dist/components/command-menu.d.ts +42 -0
  14. package/dist/components/data-display.d.ts +100 -0
  15. package/dist/components/data-table.d.ts +113 -0
  16. package/dist/components/date-input.d.ts +36 -0
  17. package/dist/components/date-range-picker.d.ts +23 -0
  18. package/dist/components/field.d.ts +18 -0
  19. package/dist/components/financial.d.ts +83 -0
  20. package/dist/components/form.d.ts +8 -0
  21. package/dist/components/icon-button.d.ts +11 -0
  22. package/dist/components/icons.d.ts +9 -0
  23. package/dist/components/navigation.d.ts +53 -0
  24. package/dist/components/notice.d.ts +11 -0
  25. package/dist/components/number-input.d.ts +44 -0
  26. package/dist/components/overlays.d.ts +91 -0
  27. package/dist/components/select-menu.d.ts +27 -0
  28. package/dist/components/select.d.ts +23 -0
  29. package/dist/components/status-badge.d.ts +9 -0
  30. package/dist/components/surface.d.ts +16 -0
  31. package/dist/components/text-input.d.ts +8 -0
  32. package/dist/components/textarea.d.ts +7 -0
  33. package/dist/components/validation-message.d.ts +8 -0
  34. package/dist/data-display-BA7t1E4G.js +278 -0
  35. package/dist/data-table.d.ts +2 -0
  36. package/dist/data-table.js +346 -0
  37. package/dist/financial.d.ts +1 -0
  38. package/dist/financial.js +178 -0
  39. package/dist/form-Csxly6Es.js +74 -0
  40. package/dist/forms.d.ts +39 -0
  41. package/dist/forms.js +32 -0
  42. package/dist/index.d.ts +23 -0
  43. package/dist/index.js +1411 -0
  44. package/dist/lib/control-density.d.ts +3 -0
  45. package/dist/lib/utils.d.ts +3 -0
  46. package/dist/navigation.d.ts +3 -0
  47. package/dist/navigation.js +224 -0
  48. package/dist/notice-jbY9FQu_.js +49 -0
  49. package/dist/overlays-BleXRtz6.js +219 -0
  50. package/dist/overlays.d.ts +7 -0
  51. package/dist/overlays.js +2 -0
  52. package/dist/reset.css +16 -0
  53. package/dist/styles.css +3 -0
  54. package/dist/tokens.css +157 -0
  55. package/dist/utils-CX-Pz5p6.js +8 -0
  56. package/docs/accessibility.md +154 -0
  57. package/docs/charts.md +47 -0
  58. package/docs/components.md +296 -0
  59. package/docs/data-table.md +87 -0
  60. package/docs/layout-composition.md +224 -0
  61. package/docs/migration.md +91 -0
  62. package/docs/tokens.md +170 -0
  63. package/package.json +118 -4
package/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 — release candidate (prepared 2026-11-17; unpublished)
4
+
5
+ This release updates the existing WealthOS design system using the approved landing reference. It is an intentional visual migration from 0.1.0; applications should adopt it explicitly and review their screens.
6
+
7
+ ### Foundations
8
+
9
+ - Replace dominant violet actions with landing navy (`#061b31`) and the landing-derived hover/selection/surface mixes. Keep meaningful informational, success, warning, error and categorical chart colors.
10
+ - Separate action, link, focus, selection, control-border and overlay roles. Keep existing primary/accent and shadcn compatibility names; primary overrides no longer recolor unrelated focus, selection or charts.
11
+ - Use 8px main control radii and opt-in Surface/Card radii of 16px and 24px. Embedded controls use a named 4px inner-radius token; select popups now use the shared 8px control radius.
12
+ - Add explicit compact product typography and medium-weight financial figures with tabular numerals. Marketing headings remain opt-in; hero sizes are not applied globally.
13
+
14
+ ### Components
15
+
16
+ - Add optional `density="compact" | "comfortable"` (36px/14px and 44px/15px) to supported controls. Omission preserves legacy heights, including 32px small/compact variants. Composite chip fields and wrapped rows can grow.
17
+ - Apply consistent neutral interaction roles across advanced choices, tabs, navigation, tables, menus, command palette, progress and calendar selection. Keep semantic feedback independent.
18
+ - Wrap tabs within narrow columns and retain visible invalid/disabled/focus states. Calendar unavailable dates use the shared disabled opacity.
19
+ - Restore focus to a connected, enabled external CommandMenu launcher after Escape or item-selection closure. Respect deliberate post-close focus destinations; no new required prop or keyboard/value model is introduced.
20
+ - Keep non-destructive confirmation actions on action tokens, including host primary-color overrides; destructive confirmations keep their semantic error treatment.
21
+
22
+ ### Compatibility
23
+
24
+ - No existing runtime export, public subpath, required component prop, peer range or dependency version is removed or changed. `ControlDensity` and `TabsTriggerProps` are additive type exports.
25
+ - Financial formatting, numeric/date parsing, precision, unavailable/estimate meaning, native form values and default Button submission intent are unchanged.
26
+ - Appearance is intentionally different: action/selection colors, control radii, type weights, surface borders and narrow tab wrapping change. Consumers that theme everything through `--primary` must adopt the separate roles.
27
+ - `AllocationBar` retains its public color name `primary`, now mapped to `--chart-1` rather than action primary. Theme chart series separately.
28
+ - No application migration or dark theme is included. See [migration guidance](docs/migration.md), [tokens](docs/tokens.md), and [accessibility](docs/accessibility.md).
29
+
30
+ ### Packaging
31
+
32
+ - Include this changelog and the migration guide in the public npm archive. Keep release operations, agent instructions, review evidence, tests, playground, Lab and diagnostics outside the archive.
33
+
34
+ ## 0.1.0
35
+
36
+ Previous published baseline, with the existing public component families and optional module exports.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,90 @@
1
- # Temporary Holding Version
1
+ # @wealth-os/design-system
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Standalone React component library and token package for WealthOS products. It provides typed, presentation-focused components, design tokens, and optional integrations for React applications.
4
+
5
+ ## 0.2.0 refresh (release candidate)
6
+
7
+ Landing-derived navy actions, independent interaction roles, shared typography, optional compact/comfortable densities and opt-in larger surfaces update the existing system. Semantic/chart colors and financial formatting remain intact. Component APIs are additive, but visual/theme output intentionally changes; this is not an appearance-preserving patch.
8
+
9
+ Read the [changelog](CHANGELOG.md) and [migration guide](docs/migration.md) before adoption. Source version metadata is 0.2.0 for review; npm publication is pending separate approval. No warm-charcoal or dark palette is included.
10
+
11
+ ## Requirements
12
+
13
+ - React 19 and React DOM 19 or later
14
+ - TypeScript 5.8 or later for typed consumers
15
+ - Tailwind CSS 4 when using the package token and utility stylesheet
16
+
17
+ ## Installation
18
+
19
+ ```sh
20
+ npm install @wealth-os/design-system
21
+ ```
22
+
23
+ Import the host application's Tailwind stylesheet first, then the consumer-safe package stylesheet, then any host overrides. The package stylesheet contains its tokens, Tailwind theme mappings, component utilities, and type/layout utilities. It does not include Tailwind preflight or set document background, root sizing, global typography, or global focus rules.
24
+
25
+ ```css
26
+ /* app.css */
27
+ @import "tailwindcss";
28
+ @import "@wealth-os/design-system/styles.css" layer(components);
29
+
30
+ /* Optional host-specific token overrides come after the package. */
31
+ :root { --action-background: #0f766e; }
32
+ ```
33
+
34
+ Import the package stylesheet once. Add `@import "@wealth-os/design-system/reset.css";` only when you explicitly want WealthOS document defaults (canvas, text, font, and root minimum height). That optional file does not include preflight and does not set global focus styles. Do not import it when the host owns those values. `@wealth-os/design-system/tokens.css` exposes only canonical custom properties for non-Tailwind contexts; do not import it alongside `styles.css` because the package stylesheet already includes it.
35
+
36
+ Then import typed public components:
37
+
38
+ ```tsx
39
+ // The stylesheet is already imported once through app.css above.
40
+ import { Button, Field, TextInput, Surface, StatusBadge } from "@wealth-os/design-system";
41
+
42
+ export function ContactField() {
43
+ return (
44
+ <Surface className="p-5">
45
+ <Field label="Contact email" help="Used for account updates.">
46
+ <TextInput type="email" autoComplete="email" />
47
+ </Field>
48
+ <StatusBadge status="confirmed">Confirmed</StatusBadge>
49
+ <Button className="mt-4">Save changes</Button>
50
+ </Surface>
51
+ );
52
+ }
53
+ ```
54
+
55
+ The package exports compiled ESM, declaration files, the consumer-safe compiled stylesheet, optional document defaults, and the canonical token source. Do not import from `src/` or from a private component file.
56
+
57
+ ## Public component families
58
+
59
+ - Actions: `Button`, `IconButton`, `ButtonGroup`, `buttonVariants`
60
+ - Fields: `Field`, `TextInput`, `Textarea`, `NumberInput`, `MoneyInput`, `QuantityInput`
61
+ - Choice and date controls: `Select`, `SelectMenu`, `Combobox`, `Autocomplete`, `MultiSelect`, `SearchInput`, `Checkbox`, `RadioGroup`, `Switch`, `Slider`, `Toggle`, `ToggleGroup`, `SegmentedControl`, `DateInput`, `UsDateInput`, `DateRangePicker`
62
+ - Form controls: `Form`, `FormField`, `InputOTP`, `FileUpload`
63
+ - Surfaces: `Surface`, `Card`, `CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter`
64
+ - State: `Badge`, `StatusBadge`, `Notice`, `ValidationMessage`
65
+ - Tables and data display: `Table` anatomy, `Avatar`, `AvatarGroup`, `DescriptionList`, `EmptyState`, `Skeleton`, `Progress`, `CircularProgress`, `Separator`, `ScrollArea`, `AspectRatio`, `Stat`, `MetricCard`, `Timeline`, `DataList`, `KeyValue`
66
+ - Financial presentation (`@wealth-os/design-system/financial`): `CurrencyValue`, `PercentageValue`, `ShareQuantity`, `FinancialMetric`, `EstimateIndicator`, `AllocationBar`, `FinancialDataTable`, `AssumptionNotice`
67
+ - Utility: `cn`
68
+
69
+ Optional interaction families are available from `@wealth-os/design-system/overlays` (Radix-backed overlays), `@wealth-os/design-system/navigation` (tabs, breadcrumbs, pagination, navigation menu, and sidebar primitives), `@wealth-os/design-system/command-menu` (the `cmdk` command palette), and `@wealth-os/design-system/forms` (an optional React Hook Form `register` bridge). These subpaths keep optional integrations out of the core root entry.
70
+
71
+ The advanced table engine is isolated at `@wealth-os/design-system/data-table`. It uses TanStack Table v9 and is intentionally absent from the root JavaScript entry. See the [data table guide](docs/data-table.md) for typed columns, controlled state, server-side modes, and accessibility behavior.
72
+
73
+ Charts are isolated at `@wealth-os/design-system/charts` and use Recharts 3.10.1. The root entry does not load the charting engine. See the [charts guide](docs/charts.md) for the typed API, data and accessibility contracts, compatibility notes, and examples.
74
+
75
+ The package keeps common components in the root entry and exposes heavier optional integrations through separate entry points. See [components](docs/components.md) for the public API and [charts](docs/charts.md) and [data tables](docs/data-table.md) for optional modules.
76
+
77
+ ## Documentation
78
+
79
+ - [Layout composition recipes](docs/layout-composition.md)
80
+ - [Migration from 0.1.0](docs/migration.md)
81
+ - [Changelog](CHANGELOG.md)
82
+ - [Token reference](docs/tokens.md)
83
+ - [Component catalog and usage](docs/components.md)
84
+ - [Accessibility contracts](docs/accessibility.md)
85
+
86
+ ## Current limitations
87
+
88
+ - The package provides the light WealthOS theme. A dark palette has not been designed.
89
+ - The documentation examples use illustrative values and do not connect to accounts or financial engines.
90
+ - Examples in this package are illustrative; consuming applications remain responsible for data access, financial calculations, and product-specific rules.
@@ -0,0 +1,47 @@
1
+ import { t as e } from "./utils-CX-Pz5p6.js";
2
+ import * as t from "react";
3
+ import { Slot as n } from "@radix-ui/react-slot";
4
+ import { cva as r } from "class-variance-authority";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/lib/control-density.ts
7
+ function a(e) {
8
+ return e === "compact" ? "wos-density-compact" : e === "comfortable" ? "wos-density-comfortable" : void 0;
9
+ }
10
+ //#endregion
11
+ //#region src/components/button.tsx
12
+ var o = r("wos-button inline-flex shrink-0 items-center gap-1.5 font-semibold transition-colors disabled:pointer-events-none", {
13
+ variants: {
14
+ variant: {
15
+ primary: "bg-primary text-primary-foreground hover:bg-primary-hover",
16
+ secondary: "border border-control-border bg-surface text-foreground hover:border-control-border-hover",
17
+ ghost: "bg-transparent text-secondary-foreground hover:bg-interaction-hover",
18
+ destructive: "bg-transparent text-destructive hover:bg-destructive-subtle",
19
+ outline: "border border-control-border bg-transparent text-foreground hover:border-control-border-hover hover:bg-interaction-hover",
20
+ link: "h-auto bg-transparent p-0 text-link hover:text-link-hover underline-offset-4 hover:underline"
21
+ },
22
+ size: {
23
+ sm: "h-8 px-2.5 text-[length:var(--type-size-caption)]",
24
+ md: "px-3.5",
25
+ lg: "h-10 px-5",
26
+ icon: "h-[var(--control-height)] w-[var(--control-height)] p-0",
27
+ "icon-sm": "h-8 w-8 p-0",
28
+ "icon-lg": "h-10 w-10 p-0"
29
+ }
30
+ },
31
+ defaultVariants: {
32
+ variant: "primary",
33
+ size: "md"
34
+ }
35
+ }), s = t.forwardRef(({ className: t, variant: r, size: s, asChild: c = !1, type: l, density: u, ...d }, f) => /* @__PURE__ */ i(c ? n : "button", {
36
+ className: e(o({
37
+ variant: r,
38
+ size: s
39
+ }), a(u), u && "text-[length:var(--wos-control-font-size)]", u && r !== "link" && "h-[var(--wos-control-height)]", u && s?.startsWith("icon") && "w-[var(--wos-control-height)]", t),
40
+ "data-density": u,
41
+ ref: f,
42
+ type: c ? void 0 : l ?? "button",
43
+ ...d
44
+ }));
45
+ s.displayName = "Button";
46
+ //#endregion
47
+ export { o as n, a as r, s as t };
@@ -0,0 +1,138 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ import { CartesianGrid, XAxis, YAxis, type TooltipContentProps } from "recharts";
3
+ export type ChartDatum = Record<string, unknown>;
4
+ export type ChartConfig = Record<string, {
5
+ label: string;
6
+ color?: string;
7
+ /** Optional pattern hint for an adjacent legend marker. */
8
+ marker?: "circle" | "square" | "diamond" | "line";
9
+ }>;
10
+ export type ChartSeries = {
11
+ dataKey: string;
12
+ label: string;
13
+ color?: string;
14
+ marker?: ChartConfig[string]["marker"];
15
+ hidden?: boolean;
16
+ stackId?: string;
17
+ yAxisId?: string;
18
+ type?: "line" | "area" | "bar";
19
+ connectNulls?: boolean;
20
+ };
21
+ export type ChartFormatters = {
22
+ formatValue?: (value: unknown, datum?: ChartDatum, dataKey?: string) => ReactNode;
23
+ formatLabel?: (value: unknown) => ReactNode;
24
+ };
25
+ export type ChartReferenceLine = {
26
+ value: number | string;
27
+ axis?: "x" | "y";
28
+ label?: string;
29
+ color?: string;
30
+ dashed?: boolean;
31
+ };
32
+ export type ChartReferenceArea = {
33
+ x1: number | string;
34
+ x2: number | string;
35
+ y1?: number;
36
+ y2?: number;
37
+ label?: string;
38
+ color?: string;
39
+ };
40
+ export type ChartContainerProps = {
41
+ title: string;
42
+ description: string;
43
+ data?: readonly ChartDatum[];
44
+ config?: ChartConfig;
45
+ series?: readonly ChartSeries[];
46
+ height?: number;
47
+ className?: string;
48
+ children: ReactNode;
49
+ tableLabel?: string;
50
+ /** Accessible summary for complex visualizations. */
51
+ summary?: string;
52
+ };
53
+ export declare function ChartContainer({ title, description, data, config, series, height, className, children, tableLabel, summary }: ChartContainerProps): import("react").JSX.Element;
54
+ export type ChartLegendItem = {
55
+ key: string;
56
+ label: string;
57
+ color: string;
58
+ marker?: ChartConfig[string]["marker"];
59
+ hidden?: boolean;
60
+ };
61
+ export declare function ChartLegend({ items, onToggle, highlightedKey, onHighlight, label }: {
62
+ items: readonly ChartLegendItem[];
63
+ onToggle?: (key: string) => void;
64
+ highlightedKey?: string | null;
65
+ onHighlight?: (key: string | null) => void;
66
+ label?: string;
67
+ }): import("react").JSX.Element | null;
68
+ export type ChartTooltipProps = ChartFormatters & {
69
+ active?: boolean;
70
+ payload?: TooltipContentProps["payload"];
71
+ label?: unknown;
72
+ config?: ChartConfig;
73
+ labelFormatter?: (label: unknown) => ReactNode;
74
+ };
75
+ export declare function ChartTooltip({ active, payload, label, config, formatValue, formatLabel, labelFormatter }: ChartTooltipProps): import("react").JSX.Element | null;
76
+ export declare function ChartEmptyState({ title, description }: {
77
+ title?: string;
78
+ description?: string;
79
+ }): import("react").JSX.Element;
80
+ export declare function ChartLoadingState({ label }: {
81
+ label?: string;
82
+ }): import("react").JSX.Element;
83
+ export declare function ChartErrorState({ title, description }: {
84
+ title?: string;
85
+ description?: string;
86
+ }): import("react").JSX.Element;
87
+ export type ChartBaseProps = ChartFormatters & {
88
+ data: readonly ChartDatum[];
89
+ series: readonly ChartSeries[];
90
+ title: string;
91
+ description: string;
92
+ height?: number;
93
+ className?: string;
94
+ xKey?: string;
95
+ showGrid?: boolean;
96
+ showLegend?: boolean;
97
+ interactiveLegend?: boolean;
98
+ showTooltip?: boolean;
99
+ showDataLabels?: boolean;
100
+ xAxis?: boolean;
101
+ yAxis?: boolean;
102
+ xAxisLabel?: string;
103
+ yAxisLabel?: string;
104
+ xAxisOptions?: Partial<ComponentProps<typeof XAxis>>;
105
+ yAxisOptions?: Partial<ComponentProps<typeof YAxis>>;
106
+ gridOptions?: Partial<ComponentProps<typeof CartesianGrid>>;
107
+ referenceLines?: readonly ChartReferenceLine[];
108
+ referenceAreas?: readonly ChartReferenceArea[];
109
+ emptyState?: ReactNode;
110
+ loading?: boolean;
111
+ error?: ReactNode;
112
+ config?: ChartConfig;
113
+ stacked?: boolean;
114
+ connectNulls?: boolean;
115
+ /** Disable Recharts shape animations for deterministic or reduced-motion contexts. */
116
+ isAnimationActive?: boolean;
117
+ };
118
+ export declare function LineChart(props: ChartBaseProps): import("react").JSX.Element;
119
+ export declare function AreaChart(props: ChartBaseProps): import("react").JSX.Element;
120
+ export declare function BarChart(props: ChartBaseProps): import("react").JSX.Element;
121
+ export declare function StackedBarChart(props: ChartBaseProps): import("react").JSX.Element;
122
+ export declare function ComposedChart(props: ChartBaseProps): import("react").JSX.Element;
123
+ export declare function Sparkline(props: ChartBaseProps): import("react").JSX.Element;
124
+ export type PieChartProps = Omit<ChartBaseProps, "xAxis" | "yAxis" | "xKey" | "referenceLines" | "referenceAreas" | "stacked"> & {
125
+ nameKey?: string;
126
+ valueKey?: string;
127
+ innerRadius?: number | string;
128
+ outerRadius?: number | string;
129
+ dataLabels?: boolean;
130
+ };
131
+ export declare function PieChart(props: PieChartProps): import("react").JSX.Element;
132
+ export declare function DonutChart(props: PieChartProps): import("react").JSX.Element;
133
+ export type ScatterChartProps = Omit<ChartBaseProps, "xKey"> & {
134
+ xKey?: string;
135
+ yKey?: string;
136
+ };
137
+ export declare function ScatterChart(props: ScatterChartProps): import("react").JSX.Element;
138
+ export declare function RadialChart(props: PieChartProps): import("react").JSX.Element;