@canonical/react-ds-global-form 0.27.0 → 0.28.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.
Files changed (2) hide show
  1. package/README.md +12 -3
  2. package/package.json +15 -12
package/README.md CHANGED
@@ -9,9 +9,18 @@ Form components for the Pragma design system. This package provides a field syst
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- bun add @canonical/react-ds-global-form
12
+ bun add @canonical/react-ds-global-form @canonical/styles
13
13
  ```
14
14
 
15
+ Import the global styles and the form component styles in your application's root stylesheet:
16
+
17
+ ```css
18
+ @import url("@canonical/styles");
19
+ @import url("@canonical/react-ds-global-form/dist/esm/index.css");
20
+ ```
21
+
22
+ The global styles provide the CSS reset, typography baseline, and design tokens (colour, spacing, surfaces, states) that all form components depend on. The form stylesheet provides input chrome, field layout, and component-specific styles.
23
+
15
24
  The package builds on top of `@canonical/react-ds-global`.
16
25
 
17
26
  ## Dependencies
@@ -84,7 +93,7 @@ import { MyColorPicker } from "./MyColorPicker";
84
93
  />
85
94
  ```
86
95
 
87
- Custom components must be wrapped with `withWrapper`. See [docs/creating-custom-fields.md](docs/creating-custom-fields.md) for the complete guide.
96
+ Custom components must be wrapped with `withWrapper`. Custom components must satisfy the `InputProps` type and integrate with react-hook-form via `useFormContext`.
88
97
 
89
98
  ## Middleware Pattern
90
99
 
@@ -136,7 +145,7 @@ import { addRESTValidation } from "@canonical/react-ds-global-form";
136
145
  />
137
146
  ```
138
147
 
139
- See [docs/creating-middleware.md](docs/creating-middleware.md) for creating custom middleware.
148
+ Custom middleware follows the same factory pattern: an outer function accepts configuration and returns a HOC.
140
149
 
141
150
  ## Conditional Display
142
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-global-form",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "type": "module",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -21,6 +21,9 @@
21
21
  "url": "https://github.com/canonical/pragma/issues"
22
22
  },
23
23
  "homepage": "https://github.com/canonical/pragma#readme",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
24
27
  "scripts": {
25
28
  "build": "bun run build:package",
26
29
  "build:all": "bun run build:package && bun run build:storybook",
@@ -40,10 +43,10 @@
40
43
  "test:vitest:watch": "vitest"
41
44
  },
42
45
  "dependencies": {
43
- "@canonical/react-ds-global": "^0.27.0",
44
- "@canonical/storybook-config": "^0.27.0",
45
- "@canonical/styles": "^0.27.0",
46
- "@canonical/utils": "^0.27.0",
46
+ "@canonical/react-ds-global": "^0.28.0",
47
+ "@canonical/storybook-config": "^0.28.0",
48
+ "@canonical/styles": "^0.28.0",
49
+ "@canonical/utils": "^0.28.0",
47
50
  "downshift": "^9.3.2",
48
51
  "react": "^19.2.4",
49
52
  "react-dom": "^19.2.4",
@@ -51,13 +54,13 @@
51
54
  },
52
55
  "devDependencies": {
53
56
  "@biomejs/biome": "2.4.9",
54
- "@canonical/biome-config": "^0.27.0",
57
+ "@canonical/biome-config": "^0.28.0",
55
58
  "@canonical/design-tokens": "^0.6.0",
56
- "@canonical/storybook-addon-form-state": "^0.27.0",
57
- "@canonical/storybook-addon-msw": "^0.27.0",
58
- "@canonical/storybook-helpers": "^0.27.0",
59
- "@canonical/typescript-config-react": "^0.27.0",
60
- "@canonical/webarchitect": "^0.27.0",
59
+ "@canonical/storybook-addon-form-state": "^0.28.0",
60
+ "@canonical/storybook-addon-msw": "^0.28.0",
61
+ "@canonical/storybook-helpers": "^0.28.0",
62
+ "@canonical/typescript-config-react": "^0.28.0",
63
+ "@canonical/webarchitect": "^0.28.0",
61
64
  "@chromatic-com/storybook": "^5.0.1",
62
65
  "@storybook/addon-docs": "^10.3.1",
63
66
  "@storybook/react-vite": "^10.3.1",
@@ -77,5 +80,5 @@
77
80
  "vite": "^8.0.1",
78
81
  "vitest": "^4.0.18"
79
82
  },
80
- "gitHead": "5df5709bf7cb6f2016be2f6eba8391637e2e2a0c"
83
+ "gitHead": "8297d72122bcba903f7e8833cb23ccbaa164ed56"
81
84
  }