diff --git a/package.json b/package.json index 17cd117483a..442f95199fa 100644 --- a/package.json +++ b/package.json @@ -40,11 +40,11 @@ "dependencies": { "@babel/core": "^7.15.8", "@carbon/charts-react": "0.55.0", - "@carbon/elements": "^11.16.0", - "@carbon/icons-react": "^11.13.0", - "@carbon/pictograms": "^12.10.0", - "@carbon/pictograms-react": "^11.36.0", - "@carbon/react": "^1.19.0", + "@carbon/elements": "^11.18.0-rc.0", + "@carbon/icons-react": "^11.15.0-rc.0", + "@carbon/pictograms": "^12.11.0", + "@carbon/pictograms-react": "^11.37.0", + "@carbon/react": "^1.21.0-rc.0", "@loadable/component": "^5.15.2", "@slack/web-api": "^5.11.0", "babel-preset-env": "^1.7.0", diff --git a/src/data/guidelines/color-tokens.js b/src/data/guidelines/color-tokens.js index d88394ad6f3..1cbe524593f 100644 --- a/src/data/guidelines/color-tokens.js +++ b/src/data/guidelines/color-tokens.js @@ -242,19 +242,19 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 80 hover', - hex: '#4c4c4c', + hex: '#474747', }, g100: { name: 'Gray 90 hover', - hex: '#353535', + hex: '#333333', }, }, }, @@ -263,19 +263,19 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 70 hover', - hex: '#656565', + hex: '#636363', }, g100: { name: 'Gray 80 hover', - hex: '#4c4c4c', + hex: '#474747', }, }, }, @@ -284,11 +284,11 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 60 hover', @@ -296,7 +296,7 @@ const colorTokens = { }, g100: { name: 'Gray 70 hover', - hex: '#656565', + hex: '#636363', }, }, }, @@ -792,19 +792,19 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 80 hover', - hex: '#4c4c4c', + hex: '#474747', }, g100: { name: 'Gray 90 hover', - hex: '#353535', + hex: '#333333', }, }, }, @@ -813,11 +813,11 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 70 hover', @@ -834,11 +834,11 @@ const colorTokens = { value: { white: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g10: { name: 'Gray 10 hover', - hex: '#e5e5e5', + hex: '#e8e8e8', }, g90: { name: 'Gray 60 hover', @@ -2266,4 +2266,4 @@ const colorTokens = { }, }; -export default colorTokens; +export default colorTokens; \ No newline at end of file diff --git a/src/pages/components/button/images/button_usage_27.png b/src/pages/components/button/images/button_usage_27.png index 3394e4836d5..1881aa3c441 100644 Binary files a/src/pages/components/button/images/button_usage_27.png and b/src/pages/components/button/images/button_usage_27.png differ diff --git a/src/pages/components/form/images/form-style-1.png b/src/pages/components/form/images/form-style-1.png index 6bd196f045a..4e5eadbbee7 100644 Binary files a/src/pages/components/form/images/form-style-1.png and b/src/pages/components/form/images/form-style-1.png differ diff --git a/src/pages/components/form/images/form-style-4.png b/src/pages/components/form/images/form-style-4.png new file mode 100644 index 00000000000..081ac4d5bf7 Binary files /dev/null and b/src/pages/components/form/images/form-style-4.png differ diff --git a/src/pages/components/form/images/form-usage-1-fluid.png b/src/pages/components/form/images/form-usage-1-fluid.png new file mode 100644 index 00000000000..4c1cdb27432 Binary files /dev/null and b/src/pages/components/form/images/form-usage-1-fluid.png differ diff --git a/src/pages/components/form/images/form-usage-1.png b/src/pages/components/form/images/form-usage-1.png index bf484363fe3..e3a92071404 100644 Binary files a/src/pages/components/form/images/form-usage-1.png and b/src/pages/components/form/images/form-usage-1.png differ diff --git a/src/pages/components/form/images/form-usage-2.png b/src/pages/components/form/images/form-usage-2.png new file mode 100644 index 00000000000..c1bcd1d7caa Binary files /dev/null and b/src/pages/components/form/images/form-usage-2.png differ diff --git a/src/pages/components/form/images/form-usage-3-do.png b/src/pages/components/form/images/form-usage-3-do.png new file mode 100644 index 00000000000..9d776c2f655 Binary files /dev/null and b/src/pages/components/form/images/form-usage-3-do.png differ diff --git a/src/pages/components/form/images/form-usage-3-dont.png b/src/pages/components/form/images/form-usage-3-dont.png new file mode 100644 index 00000000000..114cea29313 Binary files /dev/null and b/src/pages/components/form/images/form-usage-3-dont.png differ diff --git a/src/pages/components/form/images/form-usage-4-do.png b/src/pages/components/form/images/form-usage-4-do.png new file mode 100644 index 00000000000..0f156f6e7c6 Binary files /dev/null and b/src/pages/components/form/images/form-usage-4-do.png differ diff --git a/src/pages/components/form/images/form-usage-4-dont.png b/src/pages/components/form/images/form-usage-4-dont.png new file mode 100644 index 00000000000..cbd8fb46b7c Binary files /dev/null and b/src/pages/components/form/images/form-usage-4-dont.png differ diff --git a/src/pages/components/form/images/form-usage-4.png b/src/pages/components/form/images/form-usage-4.png deleted file mode 100644 index 35405266c23..00000000000 Binary files a/src/pages/components/form/images/form-usage-4.png and /dev/null differ diff --git a/src/pages/components/form/images/form-usage-5.png b/src/pages/components/form/images/form-usage-5.png index ed1dc2fb032..696f170bc47 100644 Binary files a/src/pages/components/form/images/form-usage-5.png and b/src/pages/components/form/images/form-usage-5.png differ diff --git a/src/pages/components/form/images/form-usage-5b.png b/src/pages/components/form/images/form-usage-5b.png new file mode 100644 index 00000000000..8a0a4ab022a Binary files /dev/null and b/src/pages/components/form/images/form-usage-5b.png differ diff --git a/src/pages/components/form/images/form-usage-6.png b/src/pages/components/form/images/form-usage-6.png index a6f8f68b837..7d0779c8db1 100644 Binary files a/src/pages/components/form/images/form-usage-6.png and b/src/pages/components/form/images/form-usage-6.png differ diff --git a/src/pages/components/form/images/form-usage-7.png b/src/pages/components/form/images/form-usage-7.png index 2311f7dca63..ef08bc75e88 100644 Binary files a/src/pages/components/form/images/form-usage-7.png and b/src/pages/components/form/images/form-usage-7.png differ diff --git a/src/pages/components/form/images/form-usage-8.png b/src/pages/components/form/images/form-usage-8.png index f46acde7cd5..d8efaa49a59 100644 Binary files a/src/pages/components/form/images/form-usage-8.png and b/src/pages/components/form/images/form-usage-8.png differ diff --git a/src/pages/components/form/images/form-usage-optional.png b/src/pages/components/form/images/form-usage-optional.png index 873962be428..76253041806 100644 Binary files a/src/pages/components/form/images/form-usage-optional.png and b/src/pages/components/form/images/form-usage-optional.png differ diff --git a/src/pages/components/form/images/form-usage-required.png b/src/pages/components/form/images/form-usage-required.png index b1c482ea554..64aac910e0d 100644 Binary files a/src/pages/components/form/images/form-usage-required.png and b/src/pages/components/form/images/form-usage-required.png differ diff --git a/src/pages/components/form/images/form-usage-states-fixed.png b/src/pages/components/form/images/form-usage-states-fixed.png new file mode 100644 index 00000000000..18834314a8b Binary files /dev/null and b/src/pages/components/form/images/form-usage-states-fixed.png differ diff --git a/src/pages/components/form/images/form-usage-states-fluid.png b/src/pages/components/form/images/form-usage-states-fluid.png new file mode 100644 index 00000000000..5ea20720f3a Binary files /dev/null and b/src/pages/components/form/images/form-usage-states-fluid.png differ diff --git a/src/pages/components/form/style.mdx b/src/pages/components/form/style.mdx index 3b51c71b68f..677d79cb66c 100644 --- a/src/pages/components/form/style.mdx +++ b/src/pages/components/form/style.mdx @@ -20,11 +20,6 @@ for specific typography details on each component. - - Example of light fields with $field-02 (left) and the default version with - $field-01 (right) - - ## Typography Form headings and labels should be set in sentence case with the first letter of @@ -47,20 +42,20 @@ for specific typography details on each component. Forms are made up of several different components. The order in which these elements are arranged is flexible and by default the vertical spacing between -elements should follow the guidelines below. The vertical spacing in a form can +elements follow the guidelines below. The vertical spacing in a fixed form can be adjusted to be smaller than the default depending on the use case or layout. Forms can be one column or two. The width of each column varies based on the content and layout of the design. On mobile, forms can only have one column. -### Recommended +### Recommended for fixed forms | Element | Property | px / rem | Spacing token | | -------------------- | ------------- | -------- | ------------- | | Form items | margin-bottom | 32 / 2 | `$spacing-07` | -| Title area | margin-bottom | 32 / 2 | `$spacing-07` | +| Title area | margin-bottom | 40 / 2.5 | `$spacing-08` | | Gutter between items | – | 32 / 2 | `$spacing-07` | -| Buttons | margin-top | 32 / 2 | `$spacing-07` | +| Buttons | margin-top | 48 / 3 | `$spacing-09` |
@@ -72,9 +67,18 @@ content and layout of the design. On mobile, forms can only have one column. Structure and spacing measurements for a double column form | px / rem +### Recommended for fluid forms + +| Element | Property | px / rem | Spacing token | +| -------------------- | ------------- | -------- | ------------- | +| Form items | margin-bottom | 0 px | – | +| Title area | margin-bottom | 40 / 2.5 | `$spacing-08` | +| Gutter between items | – | 1 px | – | +| Buttons | margin-top | 48 / 3 | `$spacing-09` | +
-![Structure and spacing measurements for a single column form](images/form-style-2.png) +![Structure and spacing measurements for a single column form](images/form-style-4.png)
diff --git a/src/pages/components/form/usage.mdx b/src/pages/components/form/usage.mdx index 07b5ea09a6e..d62b798acbd 100755 --- a/src/pages/components/form/usage.mdx +++ b/src/pages/components/form/usage.mdx @@ -18,23 +18,21 @@ configure options. Overview Live demo Formatting -Form logic -Validation and errors +Content +Behaviors +Additional guidance +Related Feedback ## Overview -Forms are used for submitting data so be as concise as possible when designing. -Keep it short. Think about each field and what value the data will provide. What -do you gain by collecting this information? - -#### Begin by asking: - -- Is this a piece of information that is valuable to us? -- Is this a piece of information that is so valuable that it's worth preventing - the user from continuing if they choose not to provide it? +The form component is configurable to fit various use cases and layouts. It is +purposely simple out of the box, and users are responsible for configuring it to +suit their needs. For in-depth design guidance on the different ways to +configure and extend a form, see the +[form pattern](/patterns/forms-pattern/#spacing). ## Live demo @@ -72,7 +70,7 @@ do you gain by collecting this information? id="test2" invalidText="Invalid error message." labelText="Text input label" - placeholder="Placeholder text" + placeholder="Optional placeholder text" />