react-bootstrap-plugins 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
CHANGED
|
@@ -39,6 +39,46 @@ npm install react react-dom bootstrap
|
|
|
39
39
|
import 'bootstrap/dist/css/bootstrap.min.css'
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
### CSS Imports
|
|
43
|
+
|
|
44
|
+
DatePicker requires a small CSS file for its popover calendar layout. Import it **once** in your app (e.g., in your root component or entry point):
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
// Recommended — uses the package exports map (works with Vite, webpack 5+, Turbopack, Rollup)
|
|
48
|
+
import 'react-bootstrap-plugins/css/datepicker.css'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This resolves to `dist/css/datepicker.css` via the package's `exports` map. No additional configuration is needed for modern bundlers.
|
|
52
|
+
|
|
53
|
+
#### Troubleshooting CSS import issues
|
|
54
|
+
|
|
55
|
+
If your bundler reports **"Cannot find module"** or fails to resolve the CSS import:
|
|
56
|
+
|
|
57
|
+
- **Ensure you're on the latest version** — prior versions may have had a packaging issue with nested CSS directories.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pnpm update react-bootstrap-plugins
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- **For older webpack (v4)** — you may need to use the full path if your version doesn't support the `exports` field.
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
import 'react-bootstrap-plugins/dist/css/datepicker.css'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
- **For Next.js** — add the package to `transpilePackages` in `next.config.mjs` if not already present.
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
transpilePackages: ['react-bootstrap-plugins']
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- **For TypeScript** — if you get a type error on the CSS import, add a declaration file (most projects already have this for CSS modules).
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
// src/types/css.d.ts
|
|
79
|
+
declare module '*.css' { const content: string; export default content }
|
|
80
|
+
```
|
|
81
|
+
|
|
42
82
|
---
|
|
43
83
|
|
|
44
84
|
## Components
|
|
@@ -408,7 +448,7 @@ src/
|
|
|
408
448
|
│ ├── Label.jsx Form label
|
|
409
449
|
│ └── *.d.ts TypeScript declarations
|
|
410
450
|
└── css/
|
|
411
|
-
└── datepicker
|
|
451
|
+
└── datepicker.css
|
|
412
452
|
```
|
|
413
453
|
|
|
414
454
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-bootstrap-plugins",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Production-grade Bootstrap 5 UI plugins for React — DatePicker, SearchSelect, Label, and more. Zero runtime dependencies beyond React.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"default": "./dist/Label.cjs"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"./css/datepicker.css": "./dist/css/datepicker
|
|
55
|
+
"./css/datepicker.css": "./dist/css/datepicker.css"
|
|
56
56
|
},
|
|
57
57
|
"sideEffects": [
|
|
58
58
|
"*.css",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"CHANGELOG.md"
|
|
67
67
|
],
|
|
68
68
|
"scripts": {
|
|
69
|
-
"build": "tsup && node scripts/copy-types.mjs && cp -r src/css dist/css",
|
|
69
|
+
"build": "tsup && node scripts/copy-types.mjs && rm -rf dist/css && cp -r src/css dist/css",
|
|
70
70
|
"build:types": "node scripts/copy-types.mjs",
|
|
71
71
|
"dev": "tsup --watch",
|
|
72
72
|
"prepublishOnly": "pnpm run build",
|
|
File without changes
|
|
File without changes
|