@neo4j-ndl/react-charts 1.3.15 → 1.3.17
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-ndl/react-charts",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.17",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "React implementation of charts from Neo4j Design System",
|
|
6
6
|
"keywords": [
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": ">=19.0.0",
|
|
59
59
|
"react-dom": ">=19.0.0",
|
|
60
|
-
"@neo4j-ndl/base": "^4.23.
|
|
61
|
-
"@neo4j-ndl/react": "^4.25.
|
|
60
|
+
"@neo4j-ndl/base": "^4.23.4",
|
|
61
|
+
"@neo4j-ndl/react": "^4.25.3"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"classnames": "2.5.1",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: ndl-react-charts
|
|
3
3
|
metadata:
|
|
4
4
|
package: '@neo4j-ndl/react-charts'
|
|
5
|
-
version: '1.3.
|
|
5
|
+
version: '1.3.17'
|
|
6
6
|
description: >-
|
|
7
7
|
Build data visualizations with the Neo4j Needle React Charts library
|
|
8
8
|
(@neo4j-ndl/react-charts), an Apache ECharts-based charting layer. Use when
|
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
|
|
16
16
|
# Neo4j Needle React Charts (@neo4j-ndl/react-charts)
|
|
17
17
|
|
|
18
|
-
> 📌 Shipped with `@neo4j-ndl/react-charts` v1.3.
|
|
18
|
+
> 📌 Shipped with `@neo4j-ndl/react-charts` v1.3.17. Once installed into your repo (e.g. via
|
|
19
19
|
> `npx skills add`) this folder is detached from the package — the installed
|
|
20
20
|
> package (TypeScript types in `node_modules/@neo4j-ndl/react-charts`) is the source of
|
|
21
21
|
> truth.
|
|
@@ -14,11 +14,30 @@ When checking whether a class or custom property exists, grep the built file —
|
|
|
14
14
|
not the source `.pcss` — because Tailwind tree-shakes classes that no source
|
|
15
15
|
file uses.
|
|
16
16
|
|
|
17
|
+
### What the prebuilt stylesheet contains
|
|
18
|
+
|
|
19
|
+
Besides the `ndl-*` component classes and the CSS custom properties, the
|
|
20
|
+
prebuilt stylesheet ships only two groups of `n-` classes:
|
|
21
|
+
|
|
22
|
+
- **Typography** — `n-display`, `n-title-1` … `n-title-4`,
|
|
23
|
+
`n-subheading-large/medium/small`, `n-body-large/medium/small`, `n-label`,
|
|
24
|
+
`n-code`.
|
|
25
|
+
- **Semantic colors** — `n-text-*`, `n-bg-*`, `n-border-*` for the color
|
|
26
|
+
families below, plus `hover:` variants (and `active:` for `n-bg-*`). These
|
|
27
|
+
are safelisted in the Tailwind preset.
|
|
28
|
+
|
|
29
|
+
**No other Tailwind utility is guaranteed to be in the prebuilt stylesheet.**
|
|
30
|
+
A utility only ships if Needle's component source uses it, and component
|
|
31
|
+
source no longer uses Tailwind utilities. Layout, spacing, sizing, radius and
|
|
32
|
+
shadow utilities (`n-flex`, `n-items-center`, `n-gap-token-8`, `n-p-4`,
|
|
33
|
+
`n-w-full`, `n-rounded-lg`, …) are absent and silently render nothing unless
|
|
34
|
+
the consuming app runs its own Tailwind build with the Needle preset.
|
|
35
|
+
|
|
17
36
|
### Quick verification
|
|
18
37
|
|
|
19
38
|
```sh
|
|
20
39
|
CSS=node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css
|
|
21
|
-
grep -qE '\.n-
|
|
40
|
+
grep -qE '\.n-body-medium\b' "$CSS" && echo "exists" || echo "MISSING"
|
|
22
41
|
grep -qE -- '--space-8:' "$CSS" && echo "exists" || echo "MISSING"
|
|
23
42
|
```
|
|
24
43
|
|
|
@@ -102,23 +121,36 @@ Each family provides: `text`, `icon`, `bg-weak`, `bg-strong`, `bg-status`,
|
|
|
102
121
|
| `--border-radius-full` | 9999px |
|
|
103
122
|
|
|
104
123
|
Prefer `Flex`, `Box`, and `Typography` from `@neo4j-ndl/react` with typed token
|
|
105
|
-
props over raw utility classes for layout.
|
|
124
|
+
props over raw utility classes for layout. Without an app Tailwind build they
|
|
125
|
+
are the only reliable option; for anything they don't cover, use an inline
|
|
126
|
+
`style` with a token, e.g. `style={{ margin: 'var(--space-8)' }}`.
|
|
127
|
+
|
|
128
|
+
## Tailwind builds and the `n-` prefix
|
|
129
|
+
|
|
130
|
+
Whether a utility class works depends on the consuming app:
|
|
106
131
|
|
|
107
|
-
|
|
132
|
+
- **No Tailwind build** — the app only imports `neo4j-ds-styles.css`, so only
|
|
133
|
+
the [typography and color classes](#what-the-prebuilt-stylesheet-contains)
|
|
134
|
+
exist.
|
|
135
|
+
- **Tailwind build with the Needle preset** — any standard utility is generated
|
|
136
|
+
on demand. The preset sets `prefix: 'n-'`, so `n-flex`, `n-gap-4` and
|
|
137
|
+
`n-bg-primary-bg-weak` work. If the app sets its own `prefix` (including
|
|
138
|
+
`prefix: ''`), the app's config wins.
|
|
108
139
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
app sets its own `prefix` (including `prefix: ''`), the app's config wins.
|
|
112
|
-
Check the app's `tailwind.config` before assuming `n-` is correct.
|
|
140
|
+
Check the app's `tailwind.config` — whether it exists, and its `prefix` —
|
|
141
|
+
before writing any utility class.
|
|
113
142
|
|
|
114
143
|
## How to verify before writing
|
|
115
144
|
|
|
116
145
|
1. **Check component props first.** `Flex`, `Box`, `Typography` from
|
|
117
146
|
`@neo4j-ndl/react` accept typed token values — prefer them over classes or
|
|
118
147
|
`htmlAttributes`. See the customization hierarchy below.
|
|
119
|
-
2. **Check the
|
|
148
|
+
2. **Check whether the app has its own Tailwind build** and which `prefix` it
|
|
149
|
+
uses. Without one, only typography and color utilities exist.
|
|
150
|
+
3. **Check the stylesheet**: grep the installed
|
|
151
|
+
`node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css` for the exact class
|
|
120
152
|
or property.
|
|
121
|
-
|
|
153
|
+
4. **Never copy a class from another library** (MUI, Radix, Chakra, plain
|
|
122
154
|
Tailwind). They won't exist in the Needle stylesheet.
|
|
123
155
|
|
|
124
156
|
## Customization hierarchy
|
|
@@ -130,10 +162,11 @@ order. Each level is more error-prone than the one before it:
|
|
|
130
162
|
first choice. Examples: `gap="8"`, `padding="12"`, `variant="danger"`,
|
|
131
163
|
`size="small"`, `ariaLabel`.
|
|
132
164
|
|
|
133
|
-
2. **`className`** — for utility classes the component doesn't cover.
|
|
134
|
-
every class against
|
|
135
|
-
`node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css
|
|
136
|
-
|
|
165
|
+
2. **`className`** — for utility classes the component doesn't cover (e.g.
|
|
166
|
+
`n-text-neutral-text-weak` or `n-body-small`). Verify every class against
|
|
167
|
+
`node_modules/@neo4j-ndl/base/lib/neo4j-ds-styles.css`, or against the app's
|
|
168
|
+
own Tailwind build. Layout utilities such as `n-flex` work only with an app
|
|
169
|
+
Tailwind build. A wrong class compiles and silently renders nothing.
|
|
137
170
|
|
|
138
171
|
3. **`htmlAttributes`** — escape hatch for native HTML attributes, `aria-*`, and
|
|
139
172
|
`data-*` the component doesn't expose as props (e.g. `id` for
|