@valu/block-components 0.1.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 ADDED
@@ -0,0 +1,60 @@
1
+ # @valu/block-components
2
+
3
+ Valu Digital's React component library for the WordPress block editor.
4
+
5
+ Components are designed to feel native to the WordPress admin — built on
6
+ `@wordpress/components` primitives, styled with the admin CSS custom
7
+ properties (`--wp-admin-theme-color`, `--wp-components-color-*`), and
8
+ accessible by default.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm ci
14
+ ```
15
+
16
+ Peer dependencies: `react ^18.3`, `react-dom ^18.3`, and the
17
+ `@wordpress/*` packages listed in `package.json` (available in any
18
+ modern Gutenberg/WP 6.4+ environment).
19
+
20
+ ## Quickstart
21
+
22
+ ```tsx
23
+ import { ContentPicker } from '@valu/block-components/components/content-picker';
24
+
25
+ function Edit({ attributes, setAttributes }) {
26
+ return (
27
+ <ContentPicker
28
+ label="Related posts"
29
+ variant="popover"
30
+ kind="post"
31
+ types={['post', 'page']}
32
+ maxItems={5}
33
+ orderable
34
+ value={attributes.related}
35
+ onChange={(items) => setAttributes({ related: items })}
36
+ />
37
+ );
38
+ }
39
+ ```
40
+
41
+ ## Components
42
+
43
+ - [`ContentPicker`](components/content-picker/readme.md) — search and
44
+ select posts, pages, users, or taxonomy terms with drag-to-reorder,
45
+ thumbnails, status/type badges, and grouped results.
46
+
47
+ ## Scripts
48
+
49
+ ```bash
50
+ npm run build # build ESM + CJS + .d.ts via tsup
51
+ npm run dev # watch-mode build
52
+ npm run typecheck # tsc --noEmit
53
+ npm run test # vitest run
54
+ npm run lint # eslint
55
+ npm run format # prettier --write
56
+ ```
57
+
58
+ ## License
59
+
60
+ GPL-2.0-or-later — same as WordPress core.