gbs-add-block 2.0.2 → 2.0.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/.gbs/skills/gbs-components/SKILL.md +10 -8
- package/.gbs/skills/gbs-components/references/data-grid.md +0 -1
- package/.gbs/skills/gbs-components/references/install.md +2 -3
- package/.gbs/skills/gbs-components/references/overlays.md +0 -3
- package/.gbs/skills/gbs-components/references/styling.md +9 -7
- package/.gbs/skills/gbs-components/references/toaster.md +0 -1
- package/README.md +7 -3
- package/package.json +1 -1
|
@@ -15,11 +15,14 @@ npx gbs-add-block -a Button,Input,Modal --beta
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Writes `component-lib/<folder>/` plus `component-lib/shared/`. Always pass
|
|
18
|
-
`--beta`. Import the
|
|
18
|
+
`--beta`. Import the barrel in your component; each stylesheet goes in the
|
|
19
|
+
global CSS **once** (Vite: `src/index.css`), never in a component file:
|
|
19
20
|
|
|
20
21
|
```ts
|
|
21
22
|
import { Button } from "component-lib/button";
|
|
22
|
-
|
|
23
|
+
```
|
|
24
|
+
```css
|
|
25
|
+
@import "../component-lib/button/styles.css";
|
|
23
26
|
```
|
|
24
27
|
|
|
25
28
|
Folder = lowercased name, except `data-grid`, `date-picker`, `file-uploader`,
|
|
@@ -78,7 +81,6 @@ import { Input } from "component-lib/input";
|
|
|
78
81
|
import { Select } from "component-lib/combobox";
|
|
79
82
|
import { Modal } from "component-lib/modal";
|
|
80
83
|
import { toast } from "component-lib/toaster";
|
|
81
|
-
// plus each styles.css, once
|
|
82
84
|
|
|
83
85
|
const ROLES = [{ value: "admin", label: "Admin" }, { value: "dev", label: "Dev" }];
|
|
84
86
|
|
|
@@ -121,12 +123,12 @@ export function InviteButton() {
|
|
|
121
123
|
|
|
122
124
|
## Details (in `references/`)
|
|
123
125
|
|
|
124
|
-
- `install.md` — CLI flags, folders,
|
|
125
|
-
- `forms.md` —
|
|
126
|
-
- `pickers.md` — Select, MultiSelect, DatePicker,
|
|
126
|
+
- `install.md` — CLI flags, folders, 1.x vs beta.
|
|
127
|
+
- `forms.md` — fields, controlled state, form posting.
|
|
128
|
+
- `pickers.md` — Select, MultiSelect, DatePicker, Uploader.
|
|
127
129
|
- `overlays.md` — Modal, dialog, Popover, Menu, Tooltip.
|
|
128
130
|
- `toaster.md` — `toast()` and `<Toaster />`.
|
|
129
131
|
- `data-grid.md` — columns, API, export.
|
|
130
|
-
- `data-display.md` — Card, Tabs, Accordion, Badge, Avatar
|
|
131
|
-
- `styling.md` — tokens, layers,
|
|
132
|
+
- `data-display.md` — Card, Tabs, Accordion, Badge, Avatar.
|
|
133
|
+
- `styling.md` — tokens, layers, slots, `data-*`, dark.
|
|
132
134
|
- `accessibility.md` — what is supplied, what you add.
|
|
@@ -5,7 +5,6 @@ A virtualized grid. Import `DataGrid` and `createColumnHelper` from
|
|
|
5
5
|
|
|
6
6
|
```tsx
|
|
7
7
|
import { createColumnHelper, DataGrid } from "component-lib/data-grid";
|
|
8
|
-
import "component-lib/data-grid/styles.css";
|
|
9
8
|
|
|
10
9
|
interface Employee { id: number; name: string; salary: number; active: boolean }
|
|
11
10
|
|
|
@@ -151,14 +151,13 @@ is replaced on update. Put your changes in your own module instead.
|
|
|
151
151
|
|
|
152
152
|
## Importing
|
|
153
153
|
|
|
154
|
-
Import the
|
|
154
|
+
Import the barrel in the component that uses it:
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
157
|
import { Input, OtpInput } from "component-lib/input";
|
|
158
|
-
import "component-lib/input/styles.css";
|
|
159
158
|
```
|
|
160
159
|
|
|
161
|
-
|
|
160
|
+
Put the stylesheet in the project's global CSS, once — never in a component file:
|
|
162
161
|
|
|
163
162
|
```css
|
|
164
163
|
@import "../component-lib/input/styles.css";
|
|
@@ -25,7 +25,6 @@ dismiss rules, a close guard, sizes, drawers and animation.
|
|
|
25
25
|
|
|
26
26
|
```tsx
|
|
27
27
|
import { Modal } from "component-lib/modal";
|
|
28
|
-
import "component-lib/modal/styles.css";
|
|
29
28
|
|
|
30
29
|
const [open, setOpen] = useState(false);
|
|
31
30
|
|
|
@@ -73,7 +72,6 @@ React.
|
|
|
73
72
|
```tsx
|
|
74
73
|
// once, e.g. app/layout.tsx or App.tsx
|
|
75
74
|
import { DialogHost } from "component-lib/dialog";
|
|
76
|
-
import "component-lib/dialog/styles.css";
|
|
77
75
|
<DialogHost />
|
|
78
76
|
|
|
79
77
|
// anywhere
|
|
@@ -142,7 +140,6 @@ import {
|
|
|
142
140
|
Menu, MenuItem, MenuCheckboxItem, MenuRadioGroup, MenuRadioItem,
|
|
143
141
|
MenuGroup, MenuSeparator, MenuSub,
|
|
144
142
|
} from "component-lib/menu";
|
|
145
|
-
import "component-lib/menu/styles.css";
|
|
146
143
|
|
|
147
144
|
<Menu trigger={<Button variant="outline">Actions</Button>} label="Row actions">
|
|
148
145
|
<MenuItem icon={<EditIcon />} shortcut="⌘E" onSelect={edit}>Edit</MenuItem>
|
|
@@ -6,18 +6,20 @@ state attributes.
|
|
|
6
6
|
|
|
7
7
|
## 1. Stylesheets are per component
|
|
8
8
|
|
|
9
|
-
Each folder has its own `styles.css`.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import "component-lib/button/styles.css";
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
or from a root stylesheet:
|
|
9
|
+
Each folder has its own `styles.css`. Put the ones you use in the project's
|
|
10
|
+
**global** stylesheet — `src/index.css` in Vite, the root layout's CSS in Next —
|
|
11
|
+
once each:
|
|
16
12
|
|
|
17
13
|
```css
|
|
18
14
|
@import "../component-lib/button/styles.css";
|
|
19
15
|
```
|
|
20
16
|
|
|
17
|
+
**Never import a stylesheet from a component file.** `import
|
|
18
|
+
"component-lib/button/styles.css"` inside a `.tsx` does bundle, but it makes CSS
|
|
19
|
+
order depend on module import order — which decides whether Tailwind utilities
|
|
20
|
+
still beat the component's own rules — and a lazy-loaded component then pulls its
|
|
21
|
+
styles in late, flashing unstyled. One global import per component, nowhere else.
|
|
22
|
+
|
|
21
23
|
Nothing renders correctly without it — the components emit class names only.
|
|
22
24
|
|
|
23
25
|
## 2. Theme with `--gbs-*` on `:root`
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GBS Building Blocks 2.0 (v2.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v2.0.3)
|
|
2
2
|
|
|
3
3
|
Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
|
|
4
4
|
|
|
@@ -33,9 +33,13 @@ Pick a subset with `--for claude,codex`, or `--for none` for just `.gbs/`.
|
|
|
33
33
|
Commit the result so everyone's agent picks it up. Re-run to update; a file you
|
|
34
34
|
have edited is never replaced without `--force`.
|
|
35
35
|
|
|
36
|
-
## What's New 🎉 (Ver 2.0.
|
|
36
|
+
## What's New 🎉 (Ver 2.0.3)
|
|
37
37
|
|
|
38
|
-
-
|
|
38
|
+
- Agent skill: stylesheets are now documented as a single import in the
|
|
39
|
+
project's global CSS. The previous wording showed the stylesheet import
|
|
40
|
+
beside the component import, which led coding agents to repeat it in every
|
|
41
|
+
component file they wrote — making CSS order depend on module import order,
|
|
42
|
+
and arriving late on lazy-loaded routes.
|
|
39
43
|
|
|
40
44
|
## Authors
|
|
41
45
|
|