@fluxwp/ui 0.3.2 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +55 -2
  2. package/package.json +20 -5
package/README.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # @fluxwp/ui
2
2
 
3
- @fluxwp/ui (FluxWP)
3
+ [![npm](https://img.shields.io/npm/v/@fluxwp/ui)](https://www.npmjs.com/package/@fluxwp/ui)
4
+ [![license](https://img.shields.io/npm/l/@fluxwp/ui)](#license)
4
5
 
5
- Part of [FluxWP](https://fluxwp.com). Plugin screens: [@fluxwp/plugin-kit](https://www.npmjs.com/package/@fluxwp/plugin-kit).
6
+ **The React UI kit of FluxWP screens.** Accessible, theme-aware components that look the same in
7
+ wp-admin, the FluxWP desktop app and the web, and match the PHP side (`flx_check()`, the date picker of
8
+ `flx-brand`), so classic and React screens of a plugin look alike.
9
+
10
+ | Component | |
11
+ |---|---|
12
+ | `Check` | Checkbox, radio and switch in one (`switch`, `radio`, `indeterminate`, `note`, `error`) |
13
+ | `DatePicker`, `DateCalendar` | Date picker with quick ranges and an Apply button, a sheet on phones; `formatDate`, `parseDate` |
14
+ | `Modal`, `useOverlay` | Dialogs and overlays |
15
+ | `Icon`, `MenuIcon` | Icons (Lucide) and the FluxWP plugin menu icons |
16
+ | `Avatar`, `Empty`, `Loading` | Small building blocks |
17
+ | `sanitizeHtml`, `openSanitizedLink` | Safe HTML from the server |
18
+
19
+ ## Install
20
+
21
+ ```sh
22
+ npm i @fluxwp/ui react
23
+ ```
24
+
25
+ ```ts
26
+ import '@fluxwp/ui/styles.css'; // not needed inside wp-admin with Flux GraphQL: the styles are on the page
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ import { Check, DatePicker, Modal } from '@fluxwp/ui';
33
+
34
+ <Check checked={on} onChange={setOn} switch>Send e-mail</Check>
35
+ <DatePicker value={date} onChange={setDate} />
36
+ ```
37
+
38
+ Colours, spacing and dark mode come from [`@fluxwp/tokens`](https://www.npmjs.com/package/@fluxwp/tokens)
39
+ CSS variables (`--flux-*`).
40
+
41
+ ## The FluxWP packages
42
+
43
+ | Package | What it is |
44
+ |---|---|
45
+ | [`@fluxwp/plugin-kit`](https://www.npmjs.com/package/@fluxwp/plugin-kit) | Build wp-admin React screens for your own WordPress plugin (Vite preset + `flx-kit` codegen) |
46
+ | [`@fluxwp/graphql`](https://www.npmjs.com/package/@fluxwp/graphql) | Typed GraphQL client and React hooks for Flux GraphQL (WPGraphQL) |
47
+ | [`@fluxwp/host`](https://www.npmjs.com/package/@fluxwp/host) | Host context of a screen: site client, user, locale |
48
+ | [`@fluxwp/ui`](https://www.npmjs.com/package/@fluxwp/ui) | React UI kit of FluxWP screens: Check, DatePicker, Modal, Icon … |
49
+ | [`@fluxwp/core`](https://www.npmjs.com/package/@fluxwp/core) | WordPress REST client, sign-in (OAuth PKCE, app passwords), accounts, i18n |
50
+ | [`@fluxwp/tokens`](https://www.npmjs.com/package/@fluxwp/tokens) | Design tokens: colours, spacing, radius, type, light / dark |
51
+
52
+ [FluxWP](https://fluxwp.com) is an open-source, all-in-one WordPress suite (donations, forms, e-commerce,
53
+ CRM, e-mail, AI, SEO) with a desktop and mobile app. Source:
54
+ [github.com/FluxWP/FluxWP](https://github.com/FluxWP/FluxWP). Questions and ideas: info@fluxwp.com.
55
+
56
+ ## License
57
+
58
+ GPL-2.0-or-later
package/package.json CHANGED
@@ -1,16 +1,31 @@
1
1
  {
2
2
  "name": "@fluxwp/ui",
3
- "version": "0.3.2",
4
- "description": "@fluxwp/ui (FluxWP)",
3
+ "version": "0.3.3",
4
+ "description": "React UI kit of FluxWP wp-admin screens: checkbox/switch, date picker, modal, icons; light and dark.",
5
+ "keywords": [
6
+ "fluxwp",
7
+ "wordpress",
8
+ "typescript",
9
+ "react",
10
+ "ui",
11
+ "components",
12
+ "wp-admin",
13
+ "date-picker",
14
+ "checkbox",
15
+ "switch",
16
+ "dark-mode"
17
+ ],
18
+ "author": "FluxWP <info@fluxwp.com> (https://fluxwp.com)",
5
19
  "type": "module",
6
20
  "license": "GPL-2.0-or-later",
7
- "homepage": "https://fluxwp.com",
21
+ "homepage": "https://github.com/FluxWP/FluxWP/tree/main/packages/ui#readme",
8
22
  "repository": {
9
23
  "type": "git",
10
24
  "url": "git+https://github.com/FluxWP/FluxWP.git",
11
25
  "directory": "packages/ui"
12
26
  },
13
27
  "bugs": {
28
+ "url": "https://github.com/FluxWP/FluxWP/issues",
14
29
  "email": "info@fluxwp.com"
15
30
  },
16
31
  "exports": {
@@ -33,8 +48,8 @@
33
48
  "*.css"
34
49
  ],
35
50
  "dependencies": {
36
- "@fluxwp/core": "^0.4.5",
37
- "@fluxwp/tokens": "^0.4.0",
51
+ "@fluxwp/core": "^0.4.6",
52
+ "@fluxwp/tokens": "^0.4.1",
38
53
  "lucide-react": "^1.66.0",
39
54
  "react": "19.3.0",
40
55
  "zustand": "^5.0.16"