@allxsmith/bestax-bulma 5.1.2 → 5.2.0
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 +57 -34
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/types/elements/Button.d.ts +1 -1
- package/dist/types/elements/Link.d.ts +1 -0
- package/package.json +1 -1
- package/src/scss/CLAUDE.md +55 -0
package/README.md
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@allxsmith/bestax-bulma)
|
|
5
5
|
[](https://bundlephobia.com/package/@allxsmith/bestax-bulma)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](https://github.com/allxsmith/bestax)
|
|
7
|
+
[](https://github.com/allxsmith/bestax/blob/main/bulma-ui/jest.config.js)
|
|
8
8
|
[](https://bulma.io)
|
|
9
9
|
[](https://opensource.org/licenses/MIT)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
TypeScript-first React component library for the **Bulma v1** CSS framework — 80+ fully typed, tree-shakeable components, including extras like Carousel, Dialog, Sidebar, Steps, and date/time pickers.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Requires React `^18 || ^19`.** Bulma v1 is the only runtime dependency and installs automatically.
|
|
14
|
+
|
|
15
|
+
Part of the [bestax monorepo](https://github.com/allxsmith/bestax) — see also [`create-bestax`](https://www.npmjs.com/package/create-bestax) for scaffolding new projects.
|
|
14
16
|
|
|
15
17
|
---
|
|
16
18
|
|
|
@@ -25,79 +27,91 @@ A modern, flexible React component library built with the latest Bulma v1 and Ty
|
|
|
25
27
|
|
|
26
28
|
## 🚀 Getting Started
|
|
27
29
|
|
|
30
|
+
Starting fresh? Scaffold a ready-to-go app instead: `npm create bestax@latest my-app`.
|
|
31
|
+
|
|
28
32
|
### 1. Install the package
|
|
29
33
|
|
|
30
34
|
```bash
|
|
31
35
|
npm install @allxsmith/bestax-bulma
|
|
32
36
|
# or
|
|
33
|
-
|
|
37
|
+
pnpm add @allxsmith/bestax-bulma
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
### 2. Import
|
|
40
|
+
### 2. Import the CSS
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
The library bundles its own CSS (Bulma v1 + the bestax extras). Import it once in your main JS/TS file:
|
|
39
43
|
|
|
40
44
|
```js
|
|
41
|
-
import 'bulma/
|
|
45
|
+
import '@allxsmith/bestax-bulma/bestax.css';
|
|
42
46
|
```
|
|
43
47
|
|
|
44
|
-
|
|
48
|
+
Prefer stock Bulma? That works too — add `extras.css` for the bestax-only components' styles:
|
|
45
49
|
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
href="https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css"
|
|
50
|
-
/>
|
|
50
|
+
```js
|
|
51
|
+
import 'bulma/css/bulma.min.css';
|
|
52
|
+
import '@allxsmith/bestax-bulma/extras.css';
|
|
51
53
|
```
|
|
52
54
|
|
|
55
|
+
More flavors are shipped as subpath exports — prefixed classes (`versions/bestax-prefixed.css` + `<ConfigProvider classPrefix="bestax-">`), no-helpers, no-dark-mode, and raw SCSS at `@allxsmith/bestax-bulma/scss/*`. See the [installation guide](https://bestax.io/docs/guides/getting-started/installation).
|
|
56
|
+
|
|
53
57
|
### 3. (Optional) Add an Icon Library
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
Five icon libraries are supported as optional peer dependencies: [Font Awesome](https://fontawesome.com/) (`@fortawesome/fontawesome-free`), Material Design Icons (`@mdi/font`), `ionicons`, `material-icons`, and `material-symbols`.
|
|
56
60
|
|
|
57
61
|
```bash
|
|
58
62
|
npm install @fortawesome/fontawesome-free
|
|
59
63
|
```
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
Set the default for your whole app with [`ConfigProvider`](https://bestax.io/docs/api/helpers/config), e.g. `<ConfigProvider iconLibrary="fa">`.
|
|
62
66
|
|
|
63
67
|
### 4. Quick Example
|
|
64
68
|
|
|
65
|
-
Here’s how to use the `Button` component:
|
|
66
|
-
|
|
67
69
|
```tsx
|
|
68
|
-
import
|
|
70
|
+
import '@allxsmith/bestax-bulma/bestax.css';
|
|
69
71
|
import { Button } from '@allxsmith/bestax-bulma';
|
|
70
|
-
import 'bulma/css/bulma.min.css';
|
|
71
72
|
|
|
72
73
|
function App() {
|
|
73
74
|
return (
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</Button>
|
|
78
|
-
</div>
|
|
75
|
+
<Button color="primary" onClick={() => alert('Clicked!')}>
|
|
76
|
+
Click Me
|
|
77
|
+
</Button>
|
|
79
78
|
);
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
export default App;
|
|
83
82
|
```
|
|
84
83
|
|
|
84
|
+
### 5. Theming and Dark Mode
|
|
85
|
+
|
|
86
|
+
Wrap your app in [`Theme`](https://bestax.io/docs/api/helpers/theme) to override Bulma's `--bulma-*` CSS variables and control the color scheme:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { Theme } from '@allxsmith/bestax-bulma';
|
|
90
|
+
|
|
91
|
+
<Theme isRoot colorMode="system">
|
|
92
|
+
{/* colorMode: 'light' | 'dark' | 'system' */}
|
|
93
|
+
<App />
|
|
94
|
+
</Theme>;
|
|
95
|
+
```
|
|
96
|
+
|
|
85
97
|
---
|
|
86
98
|
|
|
87
99
|
## ⭐ Why Choose bestax-bulma?
|
|
88
100
|
|
|
89
|
-
- **Ultra-lightweight: Only 21KB gzipped** ✨
|
|
90
|
-
3-20x smaller than most popular React UI libraries (which range from 60-500KB+ gzipped)
|
|
91
101
|
- **Supports the latest Bulma v1.x**
|
|
92
102
|
Other React Bulma libraries are stuck on Bulma 0.9.4 — bestax-bulma is built for the future.
|
|
103
|
+
- **80+ components**
|
|
104
|
+
All of Bulma v1, plus extras: Carousel, Dialog, Sidebar, Steps, Autocomplete, Taginput, DateInput/TimeInput/DateTimeInput pickers, and more. (Migrating from v2? Snackbar merged into [Toast](https://bestax.io/docs/api/components/toast).)
|
|
105
|
+
- **Dark mode & theming built in**
|
|
106
|
+
`Theme colorMode`, `--bulma-*` variable overrides, and prefixed-class builds via `ConfigProvider`.
|
|
93
107
|
- **Just one dependency: Bulma**
|
|
94
|
-
Every Bulma library depends on it — we ship it automatically. Clean install,
|
|
108
|
+
Every Bulma library depends on it — we ship it automatically. Clean install, fewer security concerns.
|
|
109
|
+
- **Tree-shakeable ESM + CJS**
|
|
110
|
+
Import only what you use — see the live [bundle size](https://bundlephobia.com/package/@allxsmith/bestax-bulma).
|
|
95
111
|
- **99% unit test coverage**
|
|
96
|
-
|
|
112
|
+
Enforced in CI by the [jest config](https://github.com/allxsmith/bestax/blob/main/bulma-ui/jest.config.js) — not just claimed.
|
|
97
113
|
- **100% TypeScript**
|
|
98
114
|
Full type safety for you and your team.
|
|
99
|
-
- **100% Bulma Implementation**
|
|
100
|
-
Complete bulma implementation.
|
|
101
115
|
- **Active developer support**
|
|
102
116
|
Issues? Questions? PRs? Get fast responses and real improvements.
|
|
103
117
|
|
|
@@ -117,7 +131,7 @@ View the package on npmjs:
|
|
|
117
131
|
👉 [https://bestax.io](https://bestax.io)
|
|
118
132
|
|
|
119
133
|
> **Always refer to the [documentation site](https://bestax.io) first:**
|
|
120
|
-
> It
|
|
134
|
+
> It's the most complete and up-to-date source for everything bestax-bulma!
|
|
121
135
|
|
|
122
136
|
---
|
|
123
137
|
|
|
@@ -134,13 +148,22 @@ Explore live, interactive component examples in our Storybook:
|
|
|
134
148
|
Building with an AI agent (Claude Code, Cursor, Copilot)? bestax-bulma ships LLM-optimized docs:
|
|
135
149
|
|
|
136
150
|
- 📘 **[LLMs guide](https://bestax.io/docs/guides/llms)** — how to use the library with AI tools
|
|
137
|
-
- 📄 **[llms.txt](https://bestax.io/llms.txt)** — curated index · **[llms-full.txt](https://bestax.io/llms-full.txt)** — the full docs in one file
|
|
151
|
+
- 📄 **[llms.txt](https://bestax.io/llms.txt)** — curated index · **[llms-full.txt](https://bestax.io/llms-full.txt)** — the full docs in one file · every docs page is also served as raw markdown
|
|
138
152
|
- 🧩 **[Agent Skills](https://bestax.io/docs/skills/intro)** — teach your agent the bestax way:
|
|
139
153
|
|
|
154
|
+
| Skill | Use it when… |
|
|
155
|
+
| ------------------------- | -------------------------------------------------------------------------------- |
|
|
156
|
+
| `bestax-layout-scaffold` | Turning a high-level request (dashboard, landing page, …) into a responsive page |
|
|
157
|
+
| `bestax-form` | Building forms — Field/Control composition and the full input inventory |
|
|
158
|
+
| `bestax-theming` | Customizing colors, fonts, dark mode via `Theme` and `--bulma-*` variables |
|
|
159
|
+
| `bestax-custom-component` | Building a new custom component beyond stock Bulma, the bestax way |
|
|
160
|
+
|
|
140
161
|
```bash
|
|
141
162
|
npx skills add https://github.com/allxsmith/bestax --skill bestax-layout-scaffold
|
|
142
163
|
```
|
|
143
164
|
|
|
165
|
+
New projects get the skills automatically with `npm create bestax@latest my-app --skills` (plus a generated `CLAUDE.md`).
|
|
166
|
+
|
|
144
167
|
---
|
|
145
168
|
|
|
146
169
|
## 🙏 Special Thanks
|
|
@@ -151,7 +174,7 @@ bestax-bulma is built on top of the incredible [@jgthms/bulma](https://github.co
|
|
|
151
174
|
|
|
152
175
|
If you find Bulma useful, please consider [sponsoring Jeremy Thomas](https://github.com/sponsors/jgthms) to support the continued development of Bulma.
|
|
153
176
|
|
|
154
|
-
_Note: We are not affiliated with Bulma or Jeremy Thomas in any way...We
|
|
177
|
+
_Note: We are not affiliated with Bulma or Jeremy Thomas in any way...We're just big fans of the Bulma framework!_
|
|
155
178
|
|
|
156
179
|
---
|
|
157
180
|
|
|
@@ -160,7 +183,7 @@ _Note: We are not affiliated with Bulma or Jeremy Thomas in any way...We’re ju
|
|
|
160
183
|
- The [Bulma CSS framework](https://bulma.io) is © Jeremy Thomas and licensed under the [MIT License](https://github.com/jgthms/bulma/blob/master/LICENSE).
|
|
161
184
|
- Some example content and documentation in this site is adapted from the Bulma website ([CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)), © Jeremy Thomas.
|
|
162
185
|
|
|
163
|
-
See [Bulma
|
|
186
|
+
See [Bulma's license page](https://github.com/jgthms/bulma/blob/main/LICENSE) for more details.
|
|
164
187
|
|
|
165
188
|
## License
|
|
166
189
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -2239,7 +2239,7 @@ const DialogContainer = () => {
|
|
|
2239
2239
|
};
|
|
2240
2240
|
|
|
2241
2241
|
const validButtonColors = [...validColors, 'text', 'ghost'];
|
|
2242
|
-
const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWidth, isOutlined, isInverted, isFocused, isActive, isHovered, isDisabled, className, children, textColor, bgColor, as = 'button', href, onClick, target, rel, ...props }) => {
|
|
2242
|
+
const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWidth, isOutlined, isInverted, isFocused, isActive, isHovered, isDisabled, className, children, textColor, bgColor, as: Component = 'button', href, onClick, target, rel, ...props }) => {
|
|
2243
2243
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
2244
2244
|
color: textColor,
|
|
2245
2245
|
backgroundColor: bgColor,
|
|
@@ -2262,9 +2262,9 @@ const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWi
|
|
|
2262
2262
|
'is-fullwidth': isFullWidth,
|
|
2263
2263
|
});
|
|
2264
2264
|
const buttonClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
2265
|
-
if (
|
|
2265
|
+
if (Component !== 'button') {
|
|
2266
2266
|
const { type: _type, disabled: _disabled, form: _form, formAction: _formAction, formEncType: _formEncType, formMethod: _formMethod, formNoValidate: _formNoValidate, formTarget: _formTarget, name: _name, value: _value, autoFocus: _autoFocus, ...anchorRest } = rest;
|
|
2267
|
-
return (jsxRuntime.jsx(
|
|
2267
|
+
return (jsxRuntime.jsx(Component, { className: buttonClasses, href: href, target: target, rel: rel, "aria-disabled": isDisabled, tabIndex: isDisabled ? -1 : undefined, onClick: isDisabled
|
|
2268
2268
|
? (e) => e.preventDefault()
|
|
2269
2269
|
: onClick, ...anchorRest, children: children }));
|
|
2270
2270
|
}
|
|
@@ -2677,7 +2677,7 @@ const Image = ({ as, className, textColor, bgColor, size, isRounded, isRetina, s
|
|
|
2677
2677
|
return (jsxRuntime.jsx(Tag, { className: imageClasses, ...rest, children: content }));
|
|
2678
2678
|
};
|
|
2679
2679
|
|
|
2680
|
-
const Link = ({ className, textColor, bgColor, isActive, children, ...props }) => {
|
|
2680
|
+
const Link = ({ className, textColor, bgColor, isActive, as: Component = 'a', children, ...props }) => {
|
|
2681
2681
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
2682
2682
|
color: textColor,
|
|
2683
2683
|
backgroundColor: bgColor,
|
|
@@ -2687,7 +2687,7 @@ const Link = ({ className, textColor, bgColor, isActive, children, ...props }) =
|
|
|
2687
2687
|
'is-active': isActive,
|
|
2688
2688
|
});
|
|
2689
2689
|
const linkClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
|
|
2690
|
-
return (jsxRuntime.jsx(
|
|
2690
|
+
return (jsxRuntime.jsx(Component, { className: linkClasses || undefined, ...rest, children: children }));
|
|
2691
2691
|
};
|
|
2692
2692
|
|
|
2693
2693
|
const ListItem = ({ className, textColor, bgColor, children, ...props }) => {
|