create-bestax 4.2.14 → 4.2.16
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/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +102 -31
- package/dist/project-creator.d.ts +19 -0
- package/dist/project-creator.d.ts.map +1 -1
- package/dist/project-creator.js +91 -38
- package/package.json +2 -2
- package/templates/skills/bestax-form/SKILL.md +19 -8
- package/templates/skills/bestax-form/references/api.md +10 -10
- package/templates/skills/bestax-form/references/patterns.md +22 -3
- package/templates/skills/bestax-icons/references/icon-libraries.md +9 -4
- package/templates/skills/bestax-migrate/references/bulma-classes/component-map.md +8 -0
- package/templates/skills/bestax-migrate/references/bulma-classes/unmappables.md +5 -0
- package/templates/skills/bestax-optimize/references/modular-build.md +9 -7
- package/templates/vite/README.md +5 -6
- package/templates/vite/src/App.css +14 -1
- package/templates/vite/src/App.jsx +128 -100
- package/templates/vite/src/main.jsx +3 -2
- package/templates/vite-ts/README.md +5 -6
- package/templates/vite-ts/src/App.css +14 -1
- package/templates/vite-ts/src/App.tsx +128 -100
- package/templates/vite-ts/src/main.tsx +3 -2
- package/templates/vite-ts/tsconfig.app.json +25 -0
- package/templates/vite-ts/tsconfig.json +6 -25
- package/templates/vite-ts/tsconfig.node.json +2 -2
|
@@ -67,8 +67,11 @@ Set it once on `ConfigProvider` and omit `library` everywhere else.
|
|
|
67
67
|
|
|
68
68
|
## Google Material Icons — `'material-icons'`
|
|
69
69
|
|
|
70
|
-
- **Setup:** `npm install material-icons` and `import 'material-icons'
|
|
71
|
-
|
|
70
|
+
- **Setup:** `npm install material-icons` and `import 'material-icons/iconfont/filled.css';`, the
|
|
71
|
+
style `Icon` renders by default. Add `outlined.css`, `round.css`, `sharp.css` or `two-tone.css`
|
|
72
|
+
from `material-icons/iconfont/` for those variants; the bare `import 'material-icons';` loads
|
|
73
|
+
all five fonts.
|
|
74
|
+
- **Scaffold flag:** `--icon material-icons` (imports `filled.css` only).
|
|
72
75
|
- **Names:** snake_case ligature text: `home`, `rocket_launch`, `shopping_cart`. A kebab-case
|
|
73
76
|
name will not match a ligature and renders as raw text.
|
|
74
77
|
- **Variants:** `filled` (default) / `outlined` / `round` / `sharp` — note **`round`**, not
|
|
@@ -77,8 +80,10 @@ Set it once on `ConfigProvider` and omit `library` everywhere else.
|
|
|
77
80
|
|
|
78
81
|
## Material Symbols — `'material-symbols'`
|
|
79
82
|
|
|
80
|
-
- **Setup:** `npm install material-symbols` and `import 'material-symbols'
|
|
81
|
-
|
|
83
|
+
- **Setup:** `npm install material-symbols` and `import 'material-symbols/outlined.css';`, the
|
|
84
|
+
style `Icon` renders by default. Add `rounded.css` or `sharp.css` for those variants; the bare
|
|
85
|
+
`import 'material-symbols';` loads all three fonts.
|
|
86
|
+
- **Scaffold flag:** `--icon material-symbols` (imports `outlined.css` only).
|
|
82
87
|
- **Names:** snake_case ligature text, same as Material Icons: `rocket_launch`.
|
|
83
88
|
- **Variants:** `outlined` (default) / `rounded` / `sharp` — note **`rounded`** here vs
|
|
84
89
|
Material Icons' `round`.
|
|
@@ -321,6 +321,14 @@ renders `has-text-<color>` too, and so does `is-centered`, which `isCentered` re
|
|
|
321
321
|
beside `isRight`. Anything else keeps it as markup with a `children:File`, `context:File` or
|
|
322
322
|
`attr` TODO.
|
|
323
323
|
|
|
324
|
+
A `has-name` `.file` with no `.file-name` converts only with Bulma's `is-empty` written on it as a
|
|
325
|
+
static class, since `File` renders `is-empty` there itself whatever a condition says, so a
|
|
326
|
+
condition on it can't stand in. The class then goes with the rest of the tree. The `File` gets
|
|
327
|
+
`fileName=""`, which pins its name empty the way a `.file-name`'s text pins it to that text. With
|
|
328
|
+
no `fileName`, `File` would show the name of the file a user picks and drop `is-empty`, which the
|
|
329
|
+
markup never does. Without a static `is-empty` the `.file` stays markup with a `defaults:File` TODO
|
|
330
|
+
that names the class to write.
|
|
331
|
+
|
|
324
332
|
## Families this source leaves as markup
|
|
325
333
|
|
|
326
334
|
Their markup doesn't map element by element (the bestax component renders parts of its own, or
|
|
@@ -88,6 +88,11 @@ element the attribute it's missing.
|
|
|
88
88
|
sets none, and `Card.Header.Icon` renders `aria-label="more options"` too. One whose `type` isn't
|
|
89
89
|
`button`, `submit` or `reset` gets an `attr:type` TODO instead, since bestax writes `button` in its
|
|
90
90
|
place. Write the type you mean, then re-run.
|
|
91
|
+
`File` renders a class rather than an attribute: Bulma's `is-empty`, on a `has-name` `.file` with
|
|
92
|
+
no `.file-name`, whatever a condition says. Write `is-empty` on the `.file` as a static class, then
|
|
93
|
+
re-run: a condition on `is-empty` can't stand in, so one already there still gets this TODO. The
|
|
94
|
+
`File` it becomes gets `fileName=""`, so a file the user picks leaves it as the markup was: no name
|
|
95
|
+
area, and `is-empty` still on.
|
|
91
96
|
|
|
92
97
|
### `drops:<Target>`
|
|
93
98
|
|
|
@@ -153,11 +153,13 @@ not `flexbox` — `flexbox` holds only the alignment props. Verified failure mod
|
|
|
153
153
|
## Worked example — the create-bestax starter app
|
|
154
154
|
|
|
155
155
|
The `npm create bestax` starter renders `Container`, `Section`, `Columns`/`Column`, `Image`,
|
|
156
|
-
`Title`/`SubTitle`, `Box`, `Card`, `Buttons`/`Button`, and `Notification`
|
|
157
|
-
no bestax extras. Its helper props are `display
|
|
158
|
-
`
|
|
159
|
-
compiles to the following
|
|
160
|
-
headless Chromium (light and dark
|
|
156
|
+
`Title`/`SubTitle`, `Box`, `Card`, `Buttons`/`Button`, and `Notification` with its close
|
|
157
|
+
button: all stock Bulma, no bestax extras. Its helper props are `display` (visibility),
|
|
158
|
+
`flexGrow` (flexbox), and `textAlign` (typography); it uses no spacing or color props. That
|
|
159
|
+
inventory compiles to the following, verified pixel-equivalent to the prebuilt `complete`
|
|
160
|
+
flavor in headless Chromium (light and dark, phone and desktop width, notification open), at
|
|
161
|
+
274 KB raw / 30 KB gzip vs 819 KB / 84 KB. Scaffolded with an icon library, the starter also
|
|
162
|
+
needs `bulma/sass/elements/icon` for its `IconText` card titles:
|
|
161
163
|
|
|
162
164
|
```scss
|
|
163
165
|
// src/styles.scss
|
|
@@ -170,6 +172,7 @@ headless Chromium (light and dark), at 453 KB raw / 40 KB gzip vs 813 KB / 83 KB
|
|
|
170
172
|
|
|
171
173
|
@use 'bulma/sass/elements/box';
|
|
172
174
|
@use 'bulma/sass/elements/button'; // Button + Buttons
|
|
175
|
+
@use 'bulma/sass/elements/delete'; // Notification's close button
|
|
173
176
|
@use 'bulma/sass/elements/image';
|
|
174
177
|
@use 'bulma/sass/elements/notification';
|
|
175
178
|
@use 'bulma/sass/elements/title'; // Title + SubTitle
|
|
@@ -179,9 +182,8 @@ headless Chromium (light and dark), at 453 KB raw / 40 KB gzip vs 813 KB / 83 KB
|
|
|
179
182
|
@use 'bulma/sass/layout/section';
|
|
180
183
|
|
|
181
184
|
@use 'bulma/sass/helpers/visibility'; // display="flex"
|
|
182
|
-
@use 'bulma/sass/helpers/flexbox'; //
|
|
185
|
+
@use 'bulma/sass/helpers/flexbox'; // flexGrow
|
|
183
186
|
@use 'bulma/sass/helpers/typography'; // textAlign
|
|
184
|
-
@use 'bulma/sass/helpers/color'; // textColor
|
|
185
187
|
```
|
|
186
188
|
|
|
187
189
|
```tsx
|
package/templates/vite/README.md
CHANGED
|
@@ -6,15 +6,15 @@ This template provides a minimal setup to get React working in Vite with HMR and
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
pnpm install
|
|
9
|
-
pnpm dev
|
|
9
|
+
pnpm run dev
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Available Scripts
|
|
13
13
|
|
|
14
|
-
- `pnpm dev` - Start development server
|
|
15
|
-
- `pnpm build` - Build for production
|
|
16
|
-
- `pnpm preview` - Preview production build
|
|
17
|
-
- `pnpm lint` - Run ESLint
|
|
14
|
+
- `pnpm run dev` - Start development server
|
|
15
|
+
- `pnpm run build` - Build for production
|
|
16
|
+
- `pnpm run preview` - Preview production build
|
|
17
|
+
- `pnpm run lint` - Run ESLint
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
@@ -22,7 +22,6 @@ pnpm dev
|
|
|
22
22
|
- 🎨 Bulma CSS framework
|
|
23
23
|
- 📦 bestax-bulma component library
|
|
24
24
|
- 🔧 ESLint pre-configured
|
|
25
|
-
- 🎯 Font Awesome icons included
|
|
26
25
|
|
|
27
26
|
## Learn More
|
|
28
27
|
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
/* App-specific styles - keep minimal, let Bulma handle the styling */
|
|
1
|
+
/* App-specific styles - keep minimal, let Bulma handle the styling */
|
|
2
|
+
|
|
3
|
+
/* A link inside running text needs more than its color to stand out
|
|
4
|
+
(WCAG 1.4.1), and no helper prop sets an underline. */
|
|
5
|
+
.text-link {
|
|
6
|
+
text-decoration: underline;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Bulma spaces a notification from whatever follows it in the same parent,
|
|
10
|
+
and each notification here is alone in its status region, so the space
|
|
11
|
+
between two showing at once goes between their regions instead. */
|
|
12
|
+
.status-region:not(:empty) + .status-region:not(:empty) {
|
|
13
|
+
margin-top: var(--bulma-block-spacing);
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
Button,
|
|
@@ -18,127 +18,155 @@ import './App.css';
|
|
|
18
18
|
function App() {
|
|
19
19
|
const [showNotification, setShowNotification] = useState(false);
|
|
20
20
|
const [count, setCount] = useState(0);
|
|
21
|
+
// Where focus goes when the button holding it goes away (the notification's
|
|
22
|
+
// close button) or disables itself (Reset, at zero), so a keyboard user is
|
|
23
|
+
// not dropped at the top of the page.
|
|
24
|
+
const toggleRef = useRef(null);
|
|
25
|
+
const countRef = useRef(null);
|
|
21
26
|
|
|
22
27
|
return (
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<Columns isCentered>
|
|
27
|
-
<Column isNarrow
|
|
28
|
+
<main>
|
|
29
|
+
<Section>
|
|
30
|
+
<Container breakpoint="desktop" isMax>
|
|
31
|
+
<Columns isCentered isMobile isMultiline>
|
|
32
|
+
<Column isNarrow>
|
|
28
33
|
<Image src="/bestax.svg" alt="Bestax" size="128x128" />
|
|
29
34
|
</Column>
|
|
30
|
-
<Column isNarrow
|
|
35
|
+
<Column isNarrow>
|
|
31
36
|
<Image src="/vite.svg" alt="Vite" size="128x128" />
|
|
32
37
|
</Column>
|
|
33
|
-
<Column isNarrow
|
|
38
|
+
<Column isNarrow>
|
|
34
39
|
<Image src="/react.svg" alt="React" size="128x128" />
|
|
35
40
|
</Column>
|
|
36
41
|
</Columns>
|
|
37
42
|
<Title size="1" textAlign="centered">
|
|
38
43
|
Bestax + Vite + React
|
|
39
44
|
</Title>
|
|
40
|
-
</Section>
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
<Box>
|
|
47
|
+
<Title as="h2">Get Started</Title>
|
|
48
|
+
<SubTitle as="p" size="5">
|
|
49
|
+
This template includes everything you need to build with
|
|
50
|
+
bestax-bulma
|
|
51
|
+
</SubTitle>
|
|
52
|
+
</Box>
|
|
49
53
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
<Columns>
|
|
55
|
+
<Column display="flex">
|
|
56
|
+
<Card flexGrow="1">
|
|
57
|
+
<Card.Header>
|
|
58
|
+
<Card.Header.Title as="h3">Quick Start</Card.Header.Title>
|
|
59
|
+
</Card.Header>
|
|
60
|
+
<Card.Content>
|
|
61
|
+
Edit src/App.jsx and save to test HMR updates.
|
|
62
|
+
</Card.Content>
|
|
63
|
+
</Card>
|
|
64
|
+
</Column>
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
<Column display="flex">
|
|
67
|
+
<Card flexGrow="1">
|
|
68
|
+
<Card.Header>
|
|
69
|
+
<Card.Header.Title as="h3">Documentation</Card.Header.Title>
|
|
70
|
+
</Card.Header>
|
|
71
|
+
<Card.Content>
|
|
72
|
+
Visit{' '}
|
|
73
|
+
<a
|
|
74
|
+
className="text-link"
|
|
75
|
+
href="https://bestax.io"
|
|
76
|
+
target="_blank"
|
|
77
|
+
rel="noopener noreferrer"
|
|
78
|
+
>
|
|
79
|
+
bestax.io
|
|
80
|
+
</a>{' '}
|
|
81
|
+
for component docs.
|
|
82
|
+
</Card.Content>
|
|
83
|
+
</Card>
|
|
84
|
+
</Column>
|
|
80
85
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
<Column display="flex">
|
|
87
|
+
<Card flexGrow="1">
|
|
88
|
+
<Card.Header>
|
|
89
|
+
<Card.Header.Title as="h3">Examples</Card.Header.Title>
|
|
90
|
+
</Card.Header>
|
|
91
|
+
<Card.Content>
|
|
92
|
+
Check the examples below to see components in action.
|
|
93
|
+
</Card.Content>
|
|
94
|
+
</Card>
|
|
95
|
+
</Column>
|
|
96
|
+
</Columns>
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
<Box>
|
|
99
|
+
<Title as="h2">Interactive Example</Title>
|
|
95
100
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
<Columns isVCentered>
|
|
102
|
+
<Column size="half">
|
|
103
|
+
<Buttons>
|
|
104
|
+
<Button
|
|
105
|
+
ref={toggleRef}
|
|
106
|
+
color="primary"
|
|
107
|
+
onClick={() => setShowNotification(!showNotification)}
|
|
108
|
+
>
|
|
109
|
+
Toggle Notification
|
|
110
|
+
</Button>
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
112
|
+
<Button
|
|
113
|
+
ref={countRef}
|
|
114
|
+
color="info"
|
|
115
|
+
onClick={() => setCount(count + 1)}
|
|
116
|
+
>
|
|
117
|
+
Count: {count}
|
|
118
|
+
</Button>
|
|
109
119
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
<Button
|
|
121
|
+
color="warning"
|
|
122
|
+
onClick={() => {
|
|
123
|
+
setCount(0);
|
|
124
|
+
countRef.current?.focus();
|
|
125
|
+
}}
|
|
126
|
+
disabled={count === 0}
|
|
127
|
+
>
|
|
128
|
+
Reset
|
|
129
|
+
</Button>
|
|
130
|
+
</Buttons>
|
|
131
|
+
</Column>
|
|
119
132
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
{/* A status region reads out all it holds whenever any of it
|
|
134
|
+
changes, so each notification has a region of its own: a
|
|
135
|
+
screen reader hears the one that appeared or changed, and
|
|
136
|
+
not the other with it. The regions stay mounted while their
|
|
137
|
+
content changes: one added along with its content may not
|
|
138
|
+
be announced. */}
|
|
139
|
+
<Column size="half">
|
|
140
|
+
<div role="status" className="status-region">
|
|
141
|
+
{showNotification && (
|
|
142
|
+
<Notification
|
|
143
|
+
color="success"
|
|
144
|
+
isLight
|
|
145
|
+
hasDelete
|
|
146
|
+
onDelete={() => {
|
|
147
|
+
setShowNotification(false);
|
|
148
|
+
toggleRef.current?.focus();
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
<strong>Success!</strong> Your Vite + Bestax setup is
|
|
152
|
+
working perfectly!
|
|
153
|
+
</Notification>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
131
156
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
<div role="status" className="status-region">
|
|
158
|
+
{count > 10 && (
|
|
159
|
+
<Notification color="info" isLight>
|
|
160
|
+
You've clicked the button {count} times!
|
|
161
|
+
</Notification>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
</Column>
|
|
165
|
+
</Columns>
|
|
166
|
+
</Box>
|
|
167
|
+
</Container>
|
|
168
|
+
</Section>
|
|
169
|
+
</main>
|
|
142
170
|
);
|
|
143
171
|
}
|
|
144
172
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { StrictMode } from 'react';
|
|
2
2
|
import { createRoot } from 'react-dom/client';
|
|
3
|
-
import App from './App.jsx';
|
|
4
3
|
|
|
5
|
-
//
|
|
4
|
+
// Bestax's stylesheet loads before the app's own CSS, so a named class in
|
|
5
|
+
// src/App.css wins over a Bulma rule of the same weight.
|
|
6
6
|
import '@allxsmith/bestax-bulma/bestax.css';
|
|
7
7
|
import './index.css';
|
|
8
|
+
import App from './App.jsx';
|
|
8
9
|
|
|
9
10
|
createRoot(document.getElementById('root')).render(
|
|
10
11
|
<StrictMode>
|
|
@@ -6,15 +6,15 @@ This template provides a minimal setup to get React working in Vite with TypeScr
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
pnpm install
|
|
9
|
-
pnpm dev
|
|
9
|
+
pnpm run dev
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
## Available Scripts
|
|
13
13
|
|
|
14
|
-
- `pnpm dev` - Start development server
|
|
15
|
-
- `pnpm build` - Build for production
|
|
16
|
-
- `pnpm preview` - Preview production build
|
|
17
|
-
- `pnpm lint` - Run ESLint
|
|
14
|
+
- `pnpm run dev` - Start development server
|
|
15
|
+
- `pnpm run build` - Build for production
|
|
16
|
+
- `pnpm run preview` - Preview production build
|
|
17
|
+
- `pnpm run lint` - Run ESLint
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
@@ -23,7 +23,6 @@ pnpm dev
|
|
|
23
23
|
- 📦 bestax-bulma component library
|
|
24
24
|
- 📘 TypeScript for type safety
|
|
25
25
|
- 🔧 ESLint pre-configured
|
|
26
|
-
- 🎯 Font Awesome icons included
|
|
27
26
|
|
|
28
27
|
## Learn More
|
|
29
28
|
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
/* App-specific styles - keep minimal, let Bulma handle the styling */
|
|
1
|
+
/* App-specific styles - keep minimal, let Bulma handle the styling */
|
|
2
|
+
|
|
3
|
+
/* A link inside running text needs more than its color to stand out
|
|
4
|
+
(WCAG 1.4.1), and no helper prop sets an underline. */
|
|
5
|
+
.text-link {
|
|
6
|
+
text-decoration: underline;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Bulma spaces a notification from whatever follows it in the same parent,
|
|
10
|
+
and each notification here is alone in its status region, so the space
|
|
11
|
+
between two showing at once goes between their regions instead. */
|
|
12
|
+
.status-region:not(:empty) + .status-region:not(:empty) {
|
|
13
|
+
margin-top: var(--bulma-block-spacing);
|
|
14
|
+
}
|