@canonical/react-ds-global-form 0.27.1-experimental.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.
- package/README.md +12 -3
- package/package.json +12 -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`.
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"test:vitest:watch": "vitest"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@canonical/react-ds-global": "^0.
|
|
47
|
-
"@canonical/storybook-config": "^0.
|
|
48
|
-
"@canonical/styles": "^0.
|
|
49
|
-
"@canonical/utils": "^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",
|
|
50
50
|
"downshift": "^9.3.2",
|
|
51
51
|
"react": "^19.2.4",
|
|
52
52
|
"react-dom": "^19.2.4",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@biomejs/biome": "2.4.9",
|
|
57
|
-
"@canonical/biome-config": "^0.
|
|
57
|
+
"@canonical/biome-config": "^0.28.0",
|
|
58
58
|
"@canonical/design-tokens": "^0.6.0",
|
|
59
|
-
"@canonical/storybook-addon-form-state": "^0.
|
|
60
|
-
"@canonical/storybook-addon-msw": "^0.
|
|
61
|
-
"@canonical/storybook-helpers": "^0.
|
|
62
|
-
"@canonical/typescript-config-react": "^0.
|
|
63
|
-
"@canonical/webarchitect": "^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",
|
|
64
64
|
"@chromatic-com/storybook": "^5.0.1",
|
|
65
65
|
"@storybook/addon-docs": "^10.3.1",
|
|
66
66
|
"@storybook/react-vite": "^10.3.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"vite": "^8.0.1",
|
|
81
81
|
"vitest": "^4.0.18"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "8297d72122bcba903f7e8833cb23ccbaa164ed56"
|
|
84
84
|
}
|