@allxsmith/bestax-bulma 5.1.2 → 5.1.3
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/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "A fully-typed React component library for the Bulma CSS framework. Build modern UIs quickly with reusable, accessible, and customizable Bulma-based React components.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# scss/ — styles for the bestax "extras"
|
|
2
|
+
|
|
3
|
+
**Only extras get SCSS.** Components that are stock Bulma (Button, Card, Navbar, …) ship no CSS
|
|
4
|
+
of their own — Bulma provides it. A partial exists only for components that extend beyond Bulma
|
|
5
|
+
(Carousel, Collapse, Dialog, the extended form inputs, …) — or that extend a stock component
|
|
6
|
+
(e.g. `_tabs.scss` adds vertical Tabs). The `_index.scss` files are the authoritative inventory.
|
|
7
|
+
|
|
8
|
+
## Structure
|
|
9
|
+
|
|
10
|
+
- `bestax.scss` — main entrypoint: `@use 'bulma/sass' with ($primary: #1e6b99)` + all the extras
|
|
11
|
+
- `extras.scss` — extras-only entrypoint (builds `dist/extras.css`, for apps bringing their own Bulma)
|
|
12
|
+
- `components/`, `form/`, `elements/`, `helpers/` — one `_foo.scss` partial per extra,
|
|
13
|
+
**registered in that folder's `_index.scss`** (an unregistered partial silently ships nothing)
|
|
14
|
+
- `_variables.scss` — `$extras-*` tokens derived from Bulma's HSL channel vars (`--bulma-primary-h/s/l`)
|
|
15
|
+
- `_mixins.scss` — shared mixins: `extras-transition`, `extras-focus-outline` (a11y), `extras-sr-only`
|
|
16
|
+
- `versions/` — the flavor builds: `bestax-prefixed`, `bestax-no-helpers`, `bestax-no-dark-mode`,
|
|
17
|
+
`bestax-no-helpers-prefixed`. A new partial is included by all of them automatically (they reuse
|
|
18
|
+
the same `_index` imports), but must **work** under each — especially the prefixed build.
|
|
19
|
+
|
|
20
|
+
## The pattern (every partial follows it — `components/_collapse.scss` is the template)
|
|
21
|
+
|
|
22
|
+
```scss
|
|
23
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
24
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
25
|
+
@use '../mixins' as *;
|
|
26
|
+
|
|
27
|
+
// 1. SCSS vars, !default, derived from Bulma tokens — never hardcoded hex
|
|
28
|
+
$collapse-border-color: cv.getVar('border') !default;
|
|
29
|
+
|
|
30
|
+
// 2. Register them as --bulma-* CSS vars on the root class
|
|
31
|
+
.#{iv.$class-prefix}collapse {
|
|
32
|
+
@include cv.register-vars(
|
|
33
|
+
(
|
|
34
|
+
'collapse-border-color': #{$collapse-border-color},
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 3. Consume only via cv.getVar(); class names only via the prefix interpolation
|
|
40
|
+
.#{iv.$class-prefix}collapse.#{iv.$class-prefix}is-bordered {
|
|
41
|
+
border: 1px solid cv.getVar('collapse-border-color');
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Rules the pattern encodes:
|
|
46
|
+
|
|
47
|
+
- **Never a literal class selector** (`.collapse`) — always `.#{iv.$class-prefix}collapse`,
|
|
48
|
+
or the `bestax-prefixed` flavor breaks silently.
|
|
49
|
+
- **Never a raw color/size value** in declarations — derive from Bulma tokens via `cv.getVar()`
|
|
50
|
+
so the extra is themeable exactly like stock Bulma (`--bulma-collapse-border-color: …`).
|
|
51
|
+
This is the contract the `Theme` component and the `bestax-theming` skill rely on.
|
|
52
|
+
- **Reuse `extras-*` mixins** for transitions, focus outlines, and screen-reader-only content
|
|
53
|
+
instead of re-rolling them (focus style consistency is an a11y requirement).
|
|
54
|
+
- New CSS variables should be documented in
|
|
55
|
+
`skills/bestax-theming/references/css-variables.md` alongside the docs page.
|