@beyondcorp/beyond-ui 1.0.5 → 1.0.7

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
@@ -1,2 +1,89 @@
1
1
  # beyond-ui
2
2
  # beyond-ui
3
+
4
+ ## Tailwind CSS Setup Required
5
+
6
+ **beyond-ui** components are styled using Tailwind CSS utility classes. To see the styled components, your app must:
7
+
8
+ 1. Install Tailwind CSS (https://tailwindcss.com/docs/installation).
9
+ 2. Configure your tailwind.config.js to include your source files and also:
10
+ ```js
11
+ content: [
12
+ "./node_modules/@beyondcorp/beyond-ui/dist/**/*.js",
13
+ "./src/**/*.{js,ts,jsx,tsx}",
14
+ // ...your other content paths
15
+ ]
16
+ ```
17
+ 3. Import Tailwind’s stylesheet in your main entry (usually `import './index.css'` or similar).
18
+
19
+ **Note:** No CSS is bundled with the library. The consumer project must build Tailwind to activate all required styles, as with all Tailwind component libraries.
20
+
21
+ ### Do I really need Tailwind in my project for beyond-ui components to be styled?
22
+
23
+ **Yes, for full theme-ability and correct Tailwind utility style application.**
24
+
25
+ - beyond-ui follows [Tailwind library best practices](https://tailwindcss.com/docs/using-with-preprocessors#using-with-libraries) and emits Tailwind class names, NOT bundled CSS.
26
+ - This gives maximum flexibility: consumers can use their own Tailwind theme, purge unused UI classes, and have zero style conflicts.
27
+
28
+ **Alternatives:**
29
+ - If you do NOT want consumers to use Tailwind, you would need to ship a pre-built CSS file with all required styles, and users would have to `import 'beyond-ui/styles.css'`.
30
+ - This breaks Tailwind composability and is discouraged by Tailwind and most major UI libraries.
31
+
32
+ **Summary:**
33
+ To get fully themed, tree-shakable, future-proof components, consumers should add Tailwind. Only in legacy/CSS-bundling approaches should you ship CSS, and that would require a major change to your build and user story.
34
+
35
+ ### Troubleshooting: Styles not applied in consumer project
36
+
37
+ If you have installed Tailwind CSS but your beyond-ui components are unstyled, check:
38
+
39
+ 1. **Tailwind config content:**
40
+ Open your `tailwind.config.js` in the consuming app. Make sure you have something like:
41
+
42
+ ```js
43
+ module.exports = {
44
+ content: [
45
+ "./src/**/*.{js,ts,jsx,tsx}",
46
+ "./node_modules/@beyondcorp/beyond-ui/dist/**/*.{js,jsx,ts,tsx}",
47
+ ],
48
+ theme: {
49
+ // your theme config
50
+ },
51
+ plugins: [],
52
+ }
53
+ ```
54
+
55
+ 2. **Import Tailwind CSS:**
56
+ Make sure your app's entry point (`src/index.js`, `src/main.tsx`, etc.) has:
57
+ ```js
58
+ import './index.css'; // or wherever your Tailwind CSS is output
59
+ ```
60
+
61
+ 3. **Check build output:**
62
+ Look in your compiled site's HTML dev tools. Search for Tailwind utilities (e.g., `class="bg-primary-500"`, `p-4`, etc.) injected into the class attributes of beyond-ui components. If present but not styled, Tailwind CSS is not being loaded.
63
+
64
+ 4. **Purge and rebuild:**
65
+ Delete your build output and `.next`, `dist`, or similar folders and restart the dev server. Sometimes Tailwind's JIT watcher misses node_modules changes the first time.
66
+
67
+ 5. **No duplicate Tailwind instances:**
68
+ Make sure only one Tailwind is present in node_modules (check for accidental hoisting or duplicates).
69
+
70
+ If after these steps styles are still missing, provide your exact consumer project tailwind.config.js and css imports for further support.
71
+
72
+ ### If Tailwind works but beyond-ui components are unstyled
73
+
74
+ - Double-check your tailwind.config.js:
75
+
76
+ - The `content` **must** include the path to the built JS/CJS files in node_modules:
77
+ ```js
78
+ content: [
79
+ "./src/**/*.{js,ts,jsx,tsx}",
80
+ "./node_modules/@beyondcorp/beyond-ui/dist/**/*.{js,jsx,cjs,mjs,ts,tsx}"
81
+ ]
82
+ ```
83
+ - Restart your dev server after every tailwind.config.js/content change, so Tailwind JIT detects new files.
84
+ - Make sure you have no `.npmignore`, `.gitignore`, or other config that would prevent node_modules/** imports or CSS output.
85
+ - If you are using frameworks (Next.js, Vite), confirm your tailwind.config.js is at the project root and not shadowed by a monorepo/hoist.
86
+ - Open the page and inspect beyond-ui elements in dev tools. If their classes look correct but they are not styled, it means Tailwind’s CSS did not include those utility classes (purged).
87
+ - Try temporarily adding a utility like `bg-accent-700` in your consumer src/App.tsx and in a beyond-ui component. If it works in src/ but not in beyond-ui, the content config is misconfigured.
88
+
89
+ If these checks don’t resolve the styling, please paste your consumer project’s tailwind.config.js content and your import statements for additional troubleshooting.