@instructure/ui-form-field 11.6.0 → 11.6.1-snapshot-129
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/CHANGELOG.md +46 -300
- package/es/FormField/{index.js → v1/index.js} +1 -1
- package/es/FormField/v2/index.js +78 -0
- package/es/FormField/v2/props.js +26 -0
- package/es/FormFieldGroup/{index.js → v1/index.js} +5 -4
- package/es/FormFieldGroup/v2/index.js +130 -0
- package/es/FormFieldGroup/v2/props.js +26 -0
- package/es/FormFieldGroup/v2/styles.js +49 -0
- package/es/FormFieldLabel/{index.js → v1/index.js} +1 -1
- package/es/FormFieldLabel/v2/index.js +83 -0
- package/es/FormFieldLabel/v2/props.js +26 -0
- package/es/FormFieldLabel/v2/styles.js +62 -0
- package/es/FormFieldLabel/v2/theme.js +52 -0
- package/es/FormFieldLayout/{index.js → v1/index.js} +2 -2
- package/es/FormFieldLayout/{styles.js → v1/styles.js} +2 -2
- package/es/FormFieldLayout/v2/index.js +207 -0
- package/es/FormFieldLayout/v2/props.js +26 -0
- package/es/FormFieldLayout/v2/styles.js +171 -0
- package/es/FormFieldMessage/{index.js → v1/index.js} +1 -1
- package/es/FormFieldMessage/v2/index.js +96 -0
- package/es/FormFieldMessage/v2/props.js +26 -0
- package/es/FormFieldMessage/v2/styles.js +69 -0
- package/es/FormFieldMessages/{index.js → v1/index.js} +2 -2
- package/es/FormFieldMessages/v2/index.js +88 -0
- package/es/FormFieldMessages/v2/props.js +26 -0
- package/es/FormFieldMessages/v2/styles.js +50 -0
- package/es/{index.js → exports/a.js} +6 -6
- package/es/exports/b.js +29 -0
- package/lib/FormField/{index.js → v1/index.js} +3 -3
- package/lib/FormField/v2/index.js +85 -0
- package/lib/FormField/v2/props.js +31 -0
- package/lib/FormFieldGroup/{index.js → v1/index.js} +11 -10
- package/lib/FormFieldGroup/v2/index.js +136 -0
- package/lib/FormFieldGroup/v2/props.js +31 -0
- package/lib/FormFieldGroup/v2/styles.js +55 -0
- package/lib/FormFieldLabel/{index.js → v1/index.js} +1 -1
- package/lib/FormFieldLabel/v2/index.js +89 -0
- package/lib/FormFieldLabel/v2/props.js +31 -0
- package/lib/FormFieldLabel/v2/styles.js +68 -0
- package/lib/FormFieldLabel/v2/theme.js +58 -0
- package/lib/FormFieldLayout/{index.js → v1/index.js} +3 -3
- package/lib/FormFieldLayout/{styles.js → v1/styles.js} +1 -1
- package/lib/FormFieldLayout/v2/index.js +220 -0
- package/lib/FormFieldLayout/v2/props.js +31 -0
- package/lib/FormFieldLayout/v2/styles.js +177 -0
- package/lib/FormFieldMessage/{index.js → v1/index.js} +2 -2
- package/lib/FormFieldMessage/v2/index.js +101 -0
- package/lib/FormFieldMessage/v2/props.js +31 -0
- package/lib/FormFieldMessage/v2/styles.js +75 -0
- package/lib/FormFieldMessages/{index.js → v1/index.js} +3 -3
- package/lib/FormFieldMessages/v2/index.js +93 -0
- package/lib/FormFieldMessages/v2/props.js +31 -0
- package/lib/FormFieldMessages/v2/styles.js +56 -0
- package/lib/{index.js → exports/a.js} +12 -12
- package/lib/exports/b.js +47 -0
- package/package.json +43 -21
- package/src/FormField/{index.tsx → v1/index.tsx} +1 -1
- package/src/FormField/{props.ts → v1/props.ts} +1 -1
- package/src/FormField/v2/README.md +43 -0
- package/src/FormField/v2/index.tsx +87 -0
- package/src/FormField/v2/props.ts +104 -0
- package/src/FormFieldGroup/{index.tsx → v1/index.tsx} +6 -4
- package/src/FormFieldGroup/{props.ts → v1/props.ts} +2 -2
- package/src/FormFieldGroup/v2/README.md +114 -0
- package/src/FormFieldGroup/v2/index.tsx +182 -0
- package/src/FormFieldGroup/v2/props.ts +103 -0
- package/src/FormFieldGroup/v2/styles.ts +58 -0
- package/src/FormFieldLabel/{index.tsx → v1/index.tsx} +1 -1
- package/src/FormFieldLabel/v2/index.tsx +95 -0
- package/src/FormFieldLabel/v2/props.ts +49 -0
- package/src/FormFieldLabel/v2/styles.ts +74 -0
- package/src/FormFieldLabel/v2/theme.ts +56 -0
- package/src/FormFieldLayout/{index.tsx → v1/index.tsx} +2 -2
- package/src/FormFieldLayout/{props.ts → v1/props.ts} +1 -1
- package/src/FormFieldLayout/{styles.ts → v1/styles.ts} +2 -2
- package/src/FormFieldLayout/v2/index.tsx +237 -0
- package/src/FormFieldLayout/v2/props.ts +157 -0
- package/src/FormFieldLayout/v2/styles.ts +209 -0
- package/src/FormFieldMessage/{index.tsx → v1/index.tsx} +1 -1
- package/src/FormFieldMessage/{props.ts → v1/props.ts} +4 -1
- package/src/FormFieldMessage/{styles.ts → v1/styles.ts} +2 -3
- package/src/FormFieldMessage/v2/index.tsx +104 -0
- package/src/FormFieldMessage/v2/props.ts +48 -0
- package/src/FormFieldMessage/v2/styles.ts +76 -0
- package/src/FormFieldMessages/{index.tsx → v1/index.tsx} +2 -2
- package/src/FormFieldMessages/{props.ts → v1/props.ts} +1 -1
- package/src/FormFieldMessages/v2/index.tsx +99 -0
- package/src/FormFieldMessages/v2/props.ts +59 -0
- package/src/FormFieldMessages/v2/styles.ts +55 -0
- package/src/{index.ts → exports/a.ts} +17 -13
- package/src/exports/b.ts +43 -0
- package/tsconfig.build.json +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/FormField/v1/index.d.ts.map +1 -0
- package/types/FormField/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/FormField/v1/props.d.ts.map +1 -0
- package/types/FormField/v2/index.d.ts +23 -0
- package/types/FormField/v2/index.d.ts.map +1 -0
- package/types/FormField/v2/props.d.ts +57 -0
- package/types/FormField/v2/props.d.ts.map +1 -0
- package/types/FormFieldGroup/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/FormFieldGroup/v1/index.d.ts.map +1 -0
- package/types/FormFieldGroup/{props.d.ts → v1/props.d.ts} +2 -2
- package/types/FormFieldGroup/v1/props.d.ts.map +1 -0
- package/types/FormFieldGroup/v1/styles.d.ts.map +1 -0
- package/types/FormFieldGroup/v1/theme.d.ts.map +1 -0
- package/types/FormFieldGroup/v2/index.d.ts +45 -0
- package/types/FormFieldGroup/v2/index.d.ts.map +1 -0
- package/types/FormFieldGroup/v2/props.d.ts +48 -0
- package/types/FormFieldGroup/v2/props.d.ts.map +1 -0
- package/types/FormFieldGroup/v2/styles.d.ts +14 -0
- package/types/FormFieldGroup/v2/styles.d.ts.map +1 -0
- package/types/FormFieldLabel/v1/index.d.ts.map +1 -0
- package/types/FormFieldLabel/v1/props.d.ts.map +1 -0
- package/types/FormFieldLabel/v1/styles.d.ts.map +1 -0
- package/types/FormFieldLabel/v1/theme.d.ts.map +1 -0
- package/types/FormFieldLabel/v2/index.d.ts +38 -0
- package/types/FormFieldLabel/v2/index.d.ts.map +1 -0
- package/types/FormFieldLabel/v2/props.d.ts +14 -0
- package/types/FormFieldLabel/v2/props.d.ts.map +1 -0
- package/types/FormFieldLabel/v2/styles.d.ts +15 -0
- package/types/FormFieldLabel/v2/styles.d.ts.map +1 -0
- package/types/FormFieldLabel/v2/theme.d.ts +10 -0
- package/types/FormFieldLabel/v2/theme.d.ts.map +1 -0
- package/types/FormFieldLayout/v1/index.d.ts.map +1 -0
- package/types/FormFieldLayout/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/FormFieldLayout/v1/props.d.ts.map +1 -0
- package/types/FormFieldLayout/v1/styles.d.ts.map +1 -0
- package/types/FormFieldLayout/v1/theme.d.ts.map +1 -0
- package/types/FormFieldLayout/v2/index.d.ts +14 -0
- package/types/FormFieldLayout/v2/index.d.ts.map +1 -0
- package/types/FormFieldLayout/v2/props.d.ts +90 -0
- package/types/FormFieldLayout/v2/props.d.ts.map +1 -0
- package/types/FormFieldLayout/v2/styles.d.ts +25 -0
- package/types/FormFieldLayout/v2/styles.d.ts.map +1 -0
- package/types/FormFieldMessage/{index.d.ts → v1/index.d.ts} +2 -2
- package/types/FormFieldMessage/v1/index.d.ts.map +1 -0
- package/types/FormFieldMessage/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/FormFieldMessage/v1/props.d.ts.map +1 -0
- package/types/FormFieldMessage/v1/styles.d.ts.map +1 -0
- package/types/FormFieldMessage/v1/theme.d.ts.map +1 -0
- package/types/FormFieldMessage/v2/index.d.ts +24 -0
- package/types/FormFieldMessage/v2/index.d.ts.map +1 -0
- package/types/FormFieldMessage/v2/props.d.ts +16 -0
- package/types/FormFieldMessage/v2/props.d.ts.map +1 -0
- package/types/FormFieldMessage/v2/styles.d.ts +18 -0
- package/types/FormFieldMessage/v2/styles.d.ts.map +1 -0
- package/types/FormFieldMessages/{index.d.ts → v1/index.d.ts} +1 -1
- package/types/FormFieldMessages/v1/index.d.ts.map +1 -0
- package/types/FormFieldMessages/{props.d.ts → v1/props.d.ts} +1 -1
- package/types/FormFieldMessages/v1/props.d.ts.map +1 -0
- package/types/FormFieldMessages/v1/styles.d.ts.map +1 -0
- package/types/FormFieldMessages/v1/theme.d.ts.map +1 -0
- package/types/FormFieldMessages/v2/index.d.ts +36 -0
- package/types/FormFieldMessages/v2/index.d.ts.map +1 -0
- package/types/FormFieldMessages/v2/props.d.ts +25 -0
- package/types/FormFieldMessages/v2/props.d.ts.map +1 -0
- package/types/FormFieldMessages/v2/styles.d.ts +14 -0
- package/types/FormFieldMessages/v2/styles.d.ts.map +1 -0
- package/types/exports/a.d.ts +14 -0
- package/types/exports/a.d.ts.map +1 -0
- package/types/exports/b.d.ts +14 -0
- package/types/exports/b.d.ts.map +1 -0
- package/types/utils/v1/FormPropTypes.d.ts.map +1 -0
- package/types/FormField/index.d.ts.map +0 -1
- package/types/FormField/props.d.ts.map +0 -1
- package/types/FormFieldGroup/index.d.ts.map +0 -1
- package/types/FormFieldGroup/props.d.ts.map +0 -1
- package/types/FormFieldGroup/styles.d.ts.map +0 -1
- package/types/FormFieldGroup/theme.d.ts.map +0 -1
- package/types/FormFieldLabel/index.d.ts.map +0 -1
- package/types/FormFieldLabel/props.d.ts.map +0 -1
- package/types/FormFieldLabel/styles.d.ts.map +0 -1
- package/types/FormFieldLabel/theme.d.ts.map +0 -1
- package/types/FormFieldLayout/index.d.ts.map +0 -1
- package/types/FormFieldLayout/props.d.ts.map +0 -1
- package/types/FormFieldLayout/styles.d.ts.map +0 -1
- package/types/FormFieldLayout/theme.d.ts.map +0 -1
- package/types/FormFieldMessage/index.d.ts.map +0 -1
- package/types/FormFieldMessage/props.d.ts.map +0 -1
- package/types/FormFieldMessage/styles.d.ts.map +0 -1
- package/types/FormFieldMessage/theme.d.ts.map +0 -1
- package/types/FormFieldMessages/index.d.ts.map +0 -1
- package/types/FormFieldMessages/props.d.ts.map +0 -1
- package/types/FormFieldMessages/styles.d.ts.map +0 -1
- package/types/FormFieldMessages/theme.d.ts.map +0 -1
- package/types/FormPropTypes.d.ts.map +0 -1
- package/types/index.d.ts +0 -14
- package/types/index.d.ts.map +0 -1
- /package/es/FormField/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldGroup/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldGroup/{styles.js → v1/styles.js} +0 -0
- /package/es/FormFieldGroup/{theme.js → v1/theme.js} +0 -0
- /package/es/FormFieldLabel/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldLabel/{styles.js → v1/styles.js} +0 -0
- /package/es/FormFieldLabel/{theme.js → v1/theme.js} +0 -0
- /package/es/FormFieldLayout/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldLayout/{theme.js → v1/theme.js} +0 -0
- /package/es/FormFieldMessage/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldMessage/{styles.js → v1/styles.js} +0 -0
- /package/es/FormFieldMessage/{theme.js → v1/theme.js} +0 -0
- /package/es/FormFieldMessages/{props.js → v1/props.js} +0 -0
- /package/es/FormFieldMessages/{styles.js → v1/styles.js} +0 -0
- /package/es/FormFieldMessages/{theme.js → v1/theme.js} +0 -0
- /package/es/{FormPropTypes.js → utils/v1/FormPropTypes.js} +0 -0
- /package/lib/FormField/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldGroup/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldGroup/{styles.js → v1/styles.js} +0 -0
- /package/lib/FormFieldGroup/{theme.js → v1/theme.js} +0 -0
- /package/lib/FormFieldLabel/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldLabel/{styles.js → v1/styles.js} +0 -0
- /package/lib/FormFieldLabel/{theme.js → v1/theme.js} +0 -0
- /package/lib/FormFieldLayout/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldLayout/{theme.js → v1/theme.js} +0 -0
- /package/lib/FormFieldMessage/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldMessage/{styles.js → v1/styles.js} +0 -0
- /package/lib/FormFieldMessage/{theme.js → v1/theme.js} +0 -0
- /package/lib/FormFieldMessages/{props.js → v1/props.js} +0 -0
- /package/lib/FormFieldMessages/{styles.js → v1/styles.js} +0 -0
- /package/lib/FormFieldMessages/{theme.js → v1/theme.js} +0 -0
- /package/lib/{FormPropTypes.js → utils/v1/FormPropTypes.js} +0 -0
- /package/src/FormField/{README.md → v1/README.md} +0 -0
- /package/src/FormFieldGroup/{README.md → v1/README.md} +0 -0
- /package/src/FormFieldGroup/{styles.ts → v1/styles.ts} +0 -0
- /package/src/FormFieldGroup/{theme.ts → v1/theme.ts} +0 -0
- /package/src/FormFieldLabel/{props.ts → v1/props.ts} +0 -0
- /package/src/FormFieldLabel/{styles.ts → v1/styles.ts} +0 -0
- /package/src/FormFieldLabel/{theme.ts → v1/theme.ts} +0 -0
- /package/src/FormFieldLayout/{theme.ts → v1/theme.ts} +0 -0
- /package/src/FormFieldMessage/{theme.ts → v1/theme.ts} +0 -0
- /package/src/FormFieldMessages/{styles.ts → v1/styles.ts} +0 -0
- /package/src/FormFieldMessages/{theme.ts → v1/theme.ts} +0 -0
- /package/src/{FormPropTypes.ts → utils/v1/FormPropTypes.ts} +0 -0
- /package/types/FormField/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/FormFieldGroup/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/FormFieldGroup/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/FormFieldLabel/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/FormFieldLabel/{props.d.ts → v1/props.d.ts} +0 -0
- /package/types/FormFieldLabel/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/FormFieldLabel/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/FormFieldLayout/{index.d.ts → v1/index.d.ts} +0 -0
- /package/types/FormFieldLayout/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/FormFieldLayout/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/FormFieldMessage/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/FormFieldMessage/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/FormFieldMessages/{styles.d.ts → v1/styles.d.ts} +0 -0
- /package/types/FormFieldMessages/{theme.d.ts → v1/theme.d.ts} +0 -0
- /package/types/{FormPropTypes.d.ts → utils/v1/FormPropTypes.d.ts} +0 -0
package/lib/exports/b.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "FormField", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _v.FormField;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "FormFieldGroup", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _v6.FormFieldGroup;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "FormFieldLabel", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _v2.FormFieldLabel;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "FormFieldLayout", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _v5.FormFieldLayout;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "FormFieldMessage", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _v3.FormFieldMessage;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "FormFieldMessages", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _v4.FormFieldMessages;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var _v = require("../FormField/v2");
|
|
43
|
+
var _v2 = require("../FormFieldLabel/v2");
|
|
44
|
+
var _v3 = require("../FormFieldMessage/v2");
|
|
45
|
+
var _v4 = require("../FormFieldMessages/v2");
|
|
46
|
+
var _v5 = require("../FormFieldLayout/v2");
|
|
47
|
+
var _v6 = require("../FormFieldGroup/v2");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-form-field",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.1-snapshot-129",
|
|
4
4
|
"description": "Form layout components.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -15,24 +15,24 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "^7.27.6",
|
|
18
|
-
"@instructure/
|
|
19
|
-
"@instructure/
|
|
20
|
-
"@instructure/
|
|
21
|
-
"@instructure/ui-a11y-
|
|
22
|
-
"@instructure/
|
|
23
|
-
"@instructure/ui-grid": "11.6.
|
|
24
|
-
"@instructure/ui-
|
|
25
|
-
"@instructure/ui-utils": "11.6.
|
|
26
|
-
"@instructure/
|
|
27
|
-
"@instructure/
|
|
18
|
+
"@instructure/shared-types": "11.6.1-snapshot-129",
|
|
19
|
+
"@instructure/ui-a11y-content": "11.6.1-snapshot-129",
|
|
20
|
+
"@instructure/console": "11.6.1-snapshot-129",
|
|
21
|
+
"@instructure/ui-a11y-utils": "11.6.1-snapshot-129",
|
|
22
|
+
"@instructure/emotion": "11.6.1-snapshot-129",
|
|
23
|
+
"@instructure/ui-grid": "11.6.1-snapshot-129",
|
|
24
|
+
"@instructure/ui-icons": "11.6.1-snapshot-129",
|
|
25
|
+
"@instructure/ui-react-utils": "11.6.1-snapshot-129",
|
|
26
|
+
"@instructure/ui-utils": "11.6.1-snapshot-129",
|
|
27
|
+
"@instructure/uid": "11.6.1-snapshot-129"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
31
|
"@testing-library/react": "15.0.7",
|
|
32
32
|
"vitest": "^3.2.2",
|
|
33
|
-
"@instructure/ui-axe-check": "11.6.
|
|
34
|
-
"@instructure/ui-themes": "11.6.
|
|
35
|
-
"@instructure/ui-babel-preset": "11.6.
|
|
33
|
+
"@instructure/ui-axe-check": "11.6.1-snapshot-129",
|
|
34
|
+
"@instructure/ui-themes": "11.6.1-snapshot-129",
|
|
35
|
+
"@instructure/ui-babel-preset": "11.6.1-snapshot-129"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=18 <=19"
|
|
@@ -41,17 +41,39 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"exports": {
|
|
44
|
-
".": {
|
|
45
|
-
"types": "./types/index.d.ts",
|
|
46
|
-
"import": "./es/index.js",
|
|
47
|
-
"require": "./lib/index.js",
|
|
48
|
-
"default": "./es/index.js"
|
|
49
|
-
},
|
|
50
44
|
"./lib/*": "./lib/*",
|
|
51
45
|
"./es/*": "./es/*",
|
|
52
46
|
"./types/*": "./types/*",
|
|
53
47
|
"./package.json": "./package.json",
|
|
54
|
-
"./src/*": "./src/*"
|
|
48
|
+
"./src/*": "./src/*",
|
|
49
|
+
".": {
|
|
50
|
+
"src": "./src/exports/a.ts",
|
|
51
|
+
"types": "./types/exports/a.d.ts",
|
|
52
|
+
"import": "./es/exports/a.js",
|
|
53
|
+
"require": "./lib/exports/a.js",
|
|
54
|
+
"default": "./es/exports/a.js"
|
|
55
|
+
},
|
|
56
|
+
"./v11_6": {
|
|
57
|
+
"src": "./src/exports/a.ts",
|
|
58
|
+
"types": "./types/exports/a.d.ts",
|
|
59
|
+
"import": "./es/exports/a.js",
|
|
60
|
+
"require": "./lib/exports/a.js",
|
|
61
|
+
"default": "./es/exports/a.js"
|
|
62
|
+
},
|
|
63
|
+
"./v11_7": {
|
|
64
|
+
"src": "./src/exports/b.ts",
|
|
65
|
+
"types": "./types/exports/b.d.ts",
|
|
66
|
+
"import": "./es/exports/b.js",
|
|
67
|
+
"require": "./lib/exports/b.js",
|
|
68
|
+
"default": "./es/exports/b.js"
|
|
69
|
+
},
|
|
70
|
+
"./latest": {
|
|
71
|
+
"src": "./src/exports/b.ts",
|
|
72
|
+
"types": "./types/exports/b.d.ts",
|
|
73
|
+
"import": "./es/exports/b.js",
|
|
74
|
+
"require": "./lib/exports/b.js",
|
|
75
|
+
"default": "./es/exports/b.js"
|
|
76
|
+
}
|
|
55
77
|
},
|
|
56
78
|
"scripts": {
|
|
57
79
|
"lint": "ui-scripts lint",
|
|
@@ -26,7 +26,7 @@ import { Component } from 'react'
|
|
|
26
26
|
|
|
27
27
|
import { omitProps, pickProps } from '@instructure/ui-react-utils'
|
|
28
28
|
|
|
29
|
-
import { FormFieldLayout } from '
|
|
29
|
+
import { FormFieldLayout } from '../../FormFieldLayout/v1'
|
|
30
30
|
|
|
31
31
|
import { allowedProps } from './props'
|
|
32
32
|
import type { FormFieldProps } from './props'
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import React from 'react'
|
|
26
26
|
|
|
27
27
|
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
28
|
-
import type { FormMessage } from '
|
|
28
|
+
import type { FormMessage } from '../../utils/v1/FormPropTypes'
|
|
29
29
|
import type { Spacing } from '@instructure/emotion'
|
|
30
30
|
|
|
31
31
|
type FormFieldOwnProps = {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
describes: FormField
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
This is a helper component that is used by most of the custom form
|
|
6
|
+
components. In most cases it shouldn't be used directly.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
---
|
|
10
|
+
type: example
|
|
11
|
+
---
|
|
12
|
+
<div>
|
|
13
|
+
<FormField id="_foo121" label="Stacked layout" width="400px" layout="stacked"
|
|
14
|
+
messages={[{type:'success', text: 'This is a success message'}, {type:'error', text: 'An error message. It will wrap if the text is longer than the width of the container.'}]}>
|
|
15
|
+
<TextInput id="_foo121"/>
|
|
16
|
+
</FormField>
|
|
17
|
+
test
|
|
18
|
+
<hr/>
|
|
19
|
+
<FormField id="_foo122" label="Stacked layout (inline=true)" width="400px" layout="stacked" inline
|
|
20
|
+
messages={[{type:'success', text: 'This is a success message'}, {type:'error', text: 'An error message. It will wrap if the text is longer than the width of the container.'}]}>
|
|
21
|
+
<TextInput id="_foo122"/>
|
|
22
|
+
</FormField>
|
|
23
|
+
test
|
|
24
|
+
<hr/>
|
|
25
|
+
<FormField id="_foo123" label="Inline layout" width="400px" layout="inline"
|
|
26
|
+
messages={[{type:'success', text: 'success!'}, {type:'error', text: 'An error message. It will wrap if the text is longer than the width of the container.'}]}>
|
|
27
|
+
<TextInput id="_foo123"/>
|
|
28
|
+
</FormField>
|
|
29
|
+
test
|
|
30
|
+
<hr/>
|
|
31
|
+
<FormField id="_foo124" label="Inline layout (inline=true)" width="400px" layout="inline" inline
|
|
32
|
+
messages={[{type:'success', text: 'success!'}, {type:'error', text: 'An error message. It will wrap if the text is longer than the width of the container.'}]}>
|
|
33
|
+
<TextInput id="_foo124"/>
|
|
34
|
+
</FormField>
|
|
35
|
+
test
|
|
36
|
+
<hr/>
|
|
37
|
+
<FormField id="_foo121" label={<ScreenReaderContent>hidden text</ScreenReaderContent>} width="400px" layout="stacked">
|
|
38
|
+
<TextInput id="_foo121" />
|
|
39
|
+
</FormField>
|
|
40
|
+
test
|
|
41
|
+
<hr/>
|
|
42
|
+
</div>
|
|
43
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { Component } from 'react'
|
|
26
|
+
|
|
27
|
+
import { omitProps, pickProps } from '@instructure/ui-react-utils'
|
|
28
|
+
|
|
29
|
+
import { allowedProps as formFieldLayoutAllowedProps } from '../../FormFieldLayout/v2/props'
|
|
30
|
+
|
|
31
|
+
import { FormFieldLayout } from '../../FormFieldLayout/v2'
|
|
32
|
+
|
|
33
|
+
import { allowedProps } from './props'
|
|
34
|
+
import type { FormFieldProps } from './props'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
---
|
|
38
|
+
category: components
|
|
39
|
+
---
|
|
40
|
+
**/
|
|
41
|
+
class FormField extends Component<FormFieldProps> {
|
|
42
|
+
static readonly componentId = 'FormField'
|
|
43
|
+
|
|
44
|
+
static allowedProps = allowedProps
|
|
45
|
+
static defaultProps = {
|
|
46
|
+
inline: false,
|
|
47
|
+
layout: 'stacked',
|
|
48
|
+
labelAlign: 'end',
|
|
49
|
+
vAlign: 'middle'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ref: Element | null = null
|
|
53
|
+
|
|
54
|
+
handleRef = (el: Element | null) => {
|
|
55
|
+
const { elementRef } = this.props
|
|
56
|
+
|
|
57
|
+
this.ref = el
|
|
58
|
+
|
|
59
|
+
if (typeof elementRef === 'function') {
|
|
60
|
+
elementRef(el)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
render() {
|
|
65
|
+
return (
|
|
66
|
+
<FormFieldLayout
|
|
67
|
+
{...omitProps(this.props, FormField.allowedProps)}
|
|
68
|
+
{...pickProps(this.props, formFieldLayoutAllowedProps)}
|
|
69
|
+
label={this.props.label}
|
|
70
|
+
vAlign={this.props.vAlign}
|
|
71
|
+
as="label"
|
|
72
|
+
// This makes the control in focus when the label is clicked
|
|
73
|
+
// This is needed to prevent the wrong element to be focused, e.g.
|
|
74
|
+
// multi selects Tag-s
|
|
75
|
+
htmlFor={this.props.id}
|
|
76
|
+
elementRef={this.handleRef}
|
|
77
|
+
margin={this.props.margin}
|
|
78
|
+
isRequired={this.props.isRequired}
|
|
79
|
+
disabled={this.props.disabled}
|
|
80
|
+
readOnly={this.props.readOnly}
|
|
81
|
+
/>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default FormField
|
|
87
|
+
export { FormField }
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import React from 'react'
|
|
26
|
+
|
|
27
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
28
|
+
import type { FormMessage } from '../../utils/v1/FormPropTypes'
|
|
29
|
+
import type { Spacing } from '@instructure/emotion'
|
|
30
|
+
|
|
31
|
+
type FormFieldOwnProps = {
|
|
32
|
+
label: React.ReactNode
|
|
33
|
+
/**
|
|
34
|
+
* the id of the input (to link it to its label for a11y).
|
|
35
|
+
* Applied as the `for` HTML prop on the label.
|
|
36
|
+
*/
|
|
37
|
+
id: string
|
|
38
|
+
/**
|
|
39
|
+
* Array of objects with shape: `{
|
|
40
|
+
* text: React.ReactNode,
|
|
41
|
+
* type: One of: ['newError', 'error', 'hint', 'success', 'screenreader-only']
|
|
42
|
+
* }`
|
|
43
|
+
*/
|
|
44
|
+
messages?: FormMessage[]
|
|
45
|
+
/**
|
|
46
|
+
* id for the form field messages
|
|
47
|
+
*/
|
|
48
|
+
messagesId?: string
|
|
49
|
+
children?: React.ReactNode
|
|
50
|
+
inline?: boolean
|
|
51
|
+
layout?: 'stacked' | 'inline'
|
|
52
|
+
labelAlign?: 'start' | 'end'
|
|
53
|
+
vAlign?: 'top' | 'middle' | 'bottom'
|
|
54
|
+
width?: string
|
|
55
|
+
inputContainerRef?: (element: HTMLSpanElement | null) => void
|
|
56
|
+
/**
|
|
57
|
+
* provides a reference to the underlying html root element
|
|
58
|
+
*/
|
|
59
|
+
elementRef?: (element: Element | null) => void
|
|
60
|
+
/**
|
|
61
|
+
* If `true`, displays an asterisk after the label to indicate the field is required
|
|
62
|
+
*/
|
|
63
|
+
isRequired?: boolean
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Margin around the component. Accepts a `Spacing` token. See token values and example usage in [this guide](https://instructure.design/#layout-spacing).
|
|
67
|
+
*/
|
|
68
|
+
margin?: Spacing
|
|
69
|
+
/**
|
|
70
|
+
* Whether the field is disabled. When true, error and success messages will be hidden.
|
|
71
|
+
*/
|
|
72
|
+
disabled?: boolean
|
|
73
|
+
/**
|
|
74
|
+
* Whether the field is read-only. When true, error and success messages will be hidden.
|
|
75
|
+
*/
|
|
76
|
+
readOnly?: boolean
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type PropKeys = keyof FormFieldOwnProps
|
|
80
|
+
|
|
81
|
+
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
82
|
+
|
|
83
|
+
type FormFieldProps = FormFieldOwnProps & OtherHTMLAttributes<FormFieldOwnProps>
|
|
84
|
+
const allowedProps: AllowedPropKeys = [
|
|
85
|
+
'label',
|
|
86
|
+
'id',
|
|
87
|
+
'messages',
|
|
88
|
+
'messagesId',
|
|
89
|
+
'children',
|
|
90
|
+
'inline',
|
|
91
|
+
'layout',
|
|
92
|
+
'labelAlign',
|
|
93
|
+
'vAlign',
|
|
94
|
+
'width',
|
|
95
|
+
'inputContainerRef',
|
|
96
|
+
'elementRef',
|
|
97
|
+
'isRequired',
|
|
98
|
+
'margin',
|
|
99
|
+
'disabled',
|
|
100
|
+
'readOnly'
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
export type { FormFieldOwnProps, FormFieldProps }
|
|
104
|
+
export { allowedProps }
|
|
@@ -24,11 +24,13 @@
|
|
|
24
24
|
|
|
25
25
|
import { Component, Children, ReactElement, AriaAttributes } from 'react'
|
|
26
26
|
|
|
27
|
-
import { Grid } from '@instructure/ui-grid'
|
|
27
|
+
import { Grid } from '@instructure/ui-grid/v11_6'
|
|
28
28
|
import { pickProps, omitProps } from '@instructure/ui-react-utils'
|
|
29
|
-
import { withStyle } from '@instructure/emotion'
|
|
29
|
+
import { withStyleLegacy as withStyle } from '@instructure/emotion'
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import { allowedProps as FormFieldLayoutAllowedProps } from '../../FormFieldLayout/v1/props'
|
|
32
|
+
|
|
33
|
+
import { FormFieldLayout } from '../../FormFieldLayout/v1'
|
|
32
34
|
|
|
33
35
|
import generateStyle from './styles'
|
|
34
36
|
import generateComponentTheme from './theme'
|
|
@@ -172,7 +174,7 @@ class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
|
172
174
|
return (
|
|
173
175
|
<FormFieldLayout
|
|
174
176
|
{...omitProps(props, FormFieldGroup.allowedProps)}
|
|
175
|
-
{...pickProps(props,
|
|
177
|
+
{...pickProps(props, FormFieldLayoutAllowedProps)}
|
|
176
178
|
vAlign={props.vAlign}
|
|
177
179
|
layout={props.layout === 'inline' ? 'inline' : 'stacked'}
|
|
178
180
|
label={props.description}
|
|
@@ -28,8 +28,8 @@ import type {
|
|
|
28
28
|
OtherHTMLAttributes
|
|
29
29
|
} from '@instructure/shared-types'
|
|
30
30
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
31
|
-
import type { FormFieldLayoutOwnProps } from '
|
|
32
|
-
import type { FormMessage } from '
|
|
31
|
+
import type { FormFieldLayoutOwnProps } from '../../FormFieldLayout/v1/props'
|
|
32
|
+
import type { FormMessage } from '../../utils/v1/FormPropTypes'
|
|
33
33
|
|
|
34
34
|
type FormFieldGroupOwnProps = {
|
|
35
35
|
description: React.ReactNode
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
describes: FormFieldGroup
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
This is a helper component that is used by most of the custom form
|
|
6
|
+
components. Perfect if you need to wrap a complex group of form fields
|
|
7
|
+
(Play with the different properties inside the code editor
|
|
8
|
+
to see how they affect the overall look and feel). The first example
|
|
9
|
+
sets the `layout to inline` and sets the `vAlign to middle` and `small rowSpacing`
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
---
|
|
13
|
+
type: example
|
|
14
|
+
---
|
|
15
|
+
<FormFieldGroup
|
|
16
|
+
description="Breakfast"
|
|
17
|
+
rowSpacing="small"
|
|
18
|
+
layout="inline"
|
|
19
|
+
vAlign="middle"
|
|
20
|
+
>
|
|
21
|
+
<TextInput renderLabel="Favorite Breakfast Eatery"
|
|
22
|
+
messages={[
|
|
23
|
+
{ text: 'Invalid name', type: 'error' }
|
|
24
|
+
]}
|
|
25
|
+
/>
|
|
26
|
+
<TextInput renderLabel="Favorite Side Dish" />
|
|
27
|
+
<RadioInputGroup
|
|
28
|
+
name="beverage"
|
|
29
|
+
description="Beverage of Choice"
|
|
30
|
+
defaultValue="coffee"
|
|
31
|
+
layout="columns"
|
|
32
|
+
>
|
|
33
|
+
<RadioInput label="Juice" value="juice" />
|
|
34
|
+
<RadioInput label="Water" value="water" />
|
|
35
|
+
<RadioInput label="Coffee" value="coffee" />
|
|
36
|
+
<RadioInput label="Milk" value="milk" />
|
|
37
|
+
<RadioInput label="Soda" value="soda" />
|
|
38
|
+
<RadioInput label="Hot Tea" value="tea" />
|
|
39
|
+
</RadioInputGroup>
|
|
40
|
+
</FormFieldGroup>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This example sets the `layout to columns` and sets the `vAlign to top`
|
|
44
|
+
and the `colSpacing to medium`
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
---
|
|
48
|
+
type: example
|
|
49
|
+
---
|
|
50
|
+
<FormFieldGroup
|
|
51
|
+
description="Lunch"
|
|
52
|
+
colSpacing="medium"
|
|
53
|
+
layout="columns"
|
|
54
|
+
vAlign="top"
|
|
55
|
+
>
|
|
56
|
+
<TextInput renderLabel="Dining Style" />
|
|
57
|
+
<TextInput renderLabel="Favorite Lunch Outing"/>
|
|
58
|
+
<CheckboxGroup name="times"
|
|
59
|
+
layout="stacked"
|
|
60
|
+
onChange={function (value) { console.log(value) }}
|
|
61
|
+
defaultValue={['afternoon']}
|
|
62
|
+
description="Best Time to Head Out for Lunch"
|
|
63
|
+
>
|
|
64
|
+
<Checkbox label="Between 11:00 and 11:30" value="morning" />
|
|
65
|
+
<Checkbox label="Between 11:30 and Noon" value="early-afternoon" />
|
|
66
|
+
<Checkbox label="Between Noon and 1:00" value="afternoon" />
|
|
67
|
+
<Checkbox label="Between 1:00 and 2:00" value="late-afternoon" />
|
|
68
|
+
</CheckboxGroup>
|
|
69
|
+
</FormFieldGroup>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This example sets the `layout to stacked` and sets the `rowSpacing to large`
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
---
|
|
76
|
+
type: example
|
|
77
|
+
---
|
|
78
|
+
<FormFieldGroup
|
|
79
|
+
description="Dinner"
|
|
80
|
+
layout="stacked"
|
|
81
|
+
rowSpacing="large"
|
|
82
|
+
messages={[
|
|
83
|
+
{ text: 'Complete All Fields', type: 'error' }
|
|
84
|
+
]}
|
|
85
|
+
>
|
|
86
|
+
<RadioInputGroup
|
|
87
|
+
name="diningstyle"
|
|
88
|
+
description="Size of Your Meal"
|
|
89
|
+
defaultValue="grill"
|
|
90
|
+
layout="stacked"
|
|
91
|
+
>
|
|
92
|
+
<RadioInput label="Keep it light" value="light" />
|
|
93
|
+
<RadioInput label="Anything cooked on the grill" value="grill" />
|
|
94
|
+
<RadioInput label="Bring it on... Ready for the full course" value="full-course" />
|
|
95
|
+
<RadioInput label="Breakfast for dinner" value="breakfast" />
|
|
96
|
+
</RadioInputGroup>
|
|
97
|
+
<TextInput renderLabel="If Not At Home - I'd Like To Eat Dinner At"
|
|
98
|
+
/>
|
|
99
|
+
<Checkbox label="Love to Eat Dessert After Dinner" value="medium" variant="toggle" />
|
|
100
|
+
</FormFieldGroup>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Guidelines
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
---
|
|
107
|
+
type: embed
|
|
108
|
+
---
|
|
109
|
+
<Guidelines>
|
|
110
|
+
<Figure recommendation="a11y" title="Accessibility">
|
|
111
|
+
<Figure.Item>Avoid placeholder text (it creates usability problems by increasing cognitive load, low contrast, lack of screen reader compatibility, etc.)</Figure.Item>
|
|
112
|
+
</Figure>
|
|
113
|
+
</Guidelines>
|
|
114
|
+
```
|