@neasg/design-system 0.4.7 → 0.4.8

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/README.md CHANGED
@@ -17,6 +17,127 @@ npm run build
17
17
  npm run storybook
18
18
  ```
19
19
 
20
+ ## Package Usage
21
+
22
+ Import the stylesheet once at your app root before rendering package
23
+ components:
24
+
25
+ ```ts
26
+ import "@neasg/design-system/styles.css";
27
+ ```
28
+
29
+ Use the root package import by default:
30
+
31
+ ```ts
32
+ import {
33
+ Badge,
34
+ Button,
35
+ Card,
36
+ PageHeader,
37
+ Table,
38
+ Typography,
39
+ } from "@neasg/design-system";
40
+ ```
41
+
42
+ For Tailwind-based apps, use the exported preset so you inherit the shared
43
+ colors, font tokens, radius tokens, spacing, and motion defaults:
44
+
45
+ ```ts
46
+ // tailwind.config.ts
47
+ import type { Config } from "tailwindcss";
48
+ import {
49
+ neaDesignSystemContent,
50
+ neaTailwindPreset,
51
+ } from "@neasg/design-system";
52
+
53
+ const config: Config = {
54
+ presets: [neaTailwindPreset],
55
+ content: [
56
+ "./app/**/*.{ts,tsx}",
57
+ "./components/**/*.{ts,tsx}",
58
+ ...neaDesignSystemContent,
59
+ ],
60
+ };
61
+
62
+ export default config;
63
+ ```
64
+
65
+ Theme tokens are provided through the exported stylesheet. If you want to
66
+ change the package base font size, override `--font-size-root` after importing
67
+ the stylesheet:
68
+
69
+ ```css
70
+ :root {
71
+ --font-size-root: 15px;
72
+ }
73
+ ```
74
+
75
+ If you want the package font token to resolve to the actual Inter font in
76
+ Next.js, load it into `--font-sans`:
77
+
78
+ ```ts
79
+ import { Inter } from "next/font/google";
80
+
81
+ const inter = Inter({
82
+ subsets: ["latin"],
83
+ variable: "--font-sans",
84
+ });
85
+ ```
86
+
87
+ Use package components before creating app-local UI copies. If a reusable
88
+ pattern is missing, extract it into the design system instead of duplicating it
89
+ locally. This design system is light-theme only.
90
+
91
+ ## AI Usage
92
+
93
+ This design system includes the
94
+ [Storybook MCP addon](https://storybook.js.org/docs/ai/mcp/overview), which
95
+ lets AI coding assistants read component documentation, props, stories, and
96
+ usage examples from Storybook.
97
+
98
+ 1. Start Storybook in this repo:
99
+
100
+ ```bash
101
+ npm run storybook
102
+ ```
103
+
104
+ Storybook runs on `http://localhost:6007`, with the MCP endpoint at
105
+ `http://localhost:6007/mcp`.
106
+
107
+ 2. In the consuming project, add a `.mcp.json` at the project root:
108
+
109
+ ```json
110
+ {
111
+ "mcpServers": {
112
+ "nea-design-system": {
113
+ "type": "http",
114
+ "url": "http://localhost:6007/mcp"
115
+ }
116
+ }
117
+ }
118
+ ```
119
+
120
+ 3. Restart your MCP-compatible AI tool. The docs toolset can list all
121
+ documentation, fetch documentation for a component, and fetch documentation
122
+ for a specific story. The development toolset can preview stories and fetch
123
+ Storybook story-writing instructions.
124
+
125
+ If you are not using MCP, give your AI coding assistant these instructions:
126
+
127
+ ```text
128
+ Use @neasg/design-system as the source of truth for shared UI.
129
+
130
+ - Use the Storybook MCP server to discover available components and their APIs before writing UI code.
131
+ - Prefer components from @neasg/design-system before creating app-local UI.
132
+ - Import components from the root package:
133
+ import { Button, Input, Card, Table, Typography } from "@neasg/design-system";
134
+ - Use the documented props-driven API. Do not build custom compositions from internal primitives.
135
+ - Use the package theme tokens and Tailwind preset instead of inventing ad hoc colors, spacing, or radius values.
136
+ - Use Typography for headings, body copy, labels, and captions.
137
+ - This design system is light-theme only. Do not generate dark-mode styles, tokens, or examples.
138
+ - If a needed shared pattern is missing, extract it into @neasg/design-system rather than duplicating it locally.
139
+ ```
140
+
20
141
  ## Publishing
21
142
 
22
143
  This package is built to `dist/` before publish. The public package entry points are the compiled files in `dist`, not the raw `src` files.
package/dist/button.js CHANGED
@@ -75,7 +75,7 @@ function attachAnimatedIconRefs(node, refs) {
75
75
  return node;
76
76
  }
77
77
  if (Array.isArray(node)) {
78
- return node.map((child) => attachAnimatedIconRefs(child, refs));
78
+ return React.Children.map(node, (child) => attachAnimatedIconRefs(child, refs));
79
79
  }
80
80
  if (!React.isValidElement(node)) {
81
81
  return node;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neasg/design-system",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "NEA shared design system primitives, theme tokens, and Storybook docs.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",