@dynamicnorway/react 1.0.0 → 1.0.2
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 +20 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -16,10 +16,27 @@ pnpm add @dynamicnorway/react @dynamicnorway/tokens tailwindcss react react-dom
|
|
|
16
16
|
|
|
17
17
|
## Setup
|
|
18
18
|
|
|
19
|
-
Import tokens in your global CSS:
|
|
19
|
+
Import tokens and tell Tailwind to scan the component library in your global CSS:
|
|
20
20
|
|
|
21
21
|
```css
|
|
22
22
|
@import "@dynamicnorway/tokens";
|
|
23
|
+
|
|
24
|
+
/* Required — path is relative to this CSS file */
|
|
25
|
+
@source "../node_modules/@dynamicnorway/react/dist/**/*.js";
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Without `@source`, Tailwind only scans your app files. Component utilities (`pl-10`, `text-white`, `sm:inline-block`, etc.) will be missing and components will look unstyled or broken.
|
|
29
|
+
|
|
30
|
+
**Monorepo / linked checkout** — point at source or dist in the design-system repo:
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
@source "../../../dynamic-design-system/packages/react/src/**/*.{ts,tsx}";
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**pnpm/npm from registry** — the published package ships `dist/` only:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
@source "../node_modules/@dynamicnorway/react/dist/**/*.js";
|
|
23
40
|
```
|
|
24
41
|
|
|
25
42
|
For Next.js, add to `transpilePackages`:
|
|
@@ -28,6 +45,8 @@ For Next.js, add to `transpilePackages`:
|
|
|
28
45
|
transpilePackages: ["@dynamicnorway/react"],
|
|
29
46
|
```
|
|
30
47
|
|
|
48
|
+
Restart the dev server after changing `@source` paths.
|
|
49
|
+
|
|
31
50
|
## Usage
|
|
32
51
|
|
|
33
52
|
```tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicnorway/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "React component library for Dynamic",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"tailwind-merge": "^3.5.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
+
"@dynamicnorway/tokens": "^1.0.2",
|
|
31
32
|
"react": "^18.0.0 || ^19.0.0",
|
|
32
33
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
33
|
-
"tailwindcss": "^4.0.0"
|
|
34
|
-
"@dynamicnorway/tokens": "1.0.0"
|
|
34
|
+
"tailwindcss": "^4.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tsup": "^8.5.0",
|
|
49
49
|
"typescript": "^6.0.3",
|
|
50
50
|
"vitest": "^4.1.0",
|
|
51
|
-
"@dynamicnorway/tokens": "1.0.
|
|
51
|
+
"@dynamicnorway/tokens": "1.0.2"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|