@instructure/ui-form-field 11.7.5 → 11.7.6-snapshot-11

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 (44) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/es/FormFieldGroup/v2/props.js +1 -1
  3. package/es/FormFieldLayout/v2/index.js +4 -8
  4. package/lib/FormFieldGroup/v2/props.js +1 -1
  5. package/lib/FormFieldLayout/v2/index.js +3 -7
  6. package/package.json +14 -14
  7. package/src/FormFieldGroup/v2/README.md +1 -0
  8. package/src/FormFieldGroup/v2/props.ts +12 -1
  9. package/src/FormFieldLayout/v2/index.tsx +4 -9
  10. package/tsconfig.build.tsbuildinfo +1 -1
  11. package/types/FormField/v1/index.d.ts.map +1 -1
  12. package/types/FormField/v2/index.d.ts.map +1 -1
  13. package/types/FormFieldGroup/v1/index.d.ts +5 -5
  14. package/types/FormFieldGroup/v1/index.d.ts.map +1 -1
  15. package/types/FormFieldGroup/v1/styles.d.ts.map +1 -1
  16. package/types/FormFieldGroup/v1/theme.d.ts.map +1 -1
  17. package/types/FormFieldGroup/v2/index.d.ts +6 -5
  18. package/types/FormFieldGroup/v2/index.d.ts.map +1 -1
  19. package/types/FormFieldGroup/v2/props.d.ts +7 -1
  20. package/types/FormFieldGroup/v2/props.d.ts.map +1 -1
  21. package/types/FormFieldGroup/v2/styles.d.ts.map +1 -1
  22. package/types/FormFieldLabel/v1/index.d.ts +1 -1
  23. package/types/FormFieldLabel/v1/index.d.ts.map +1 -1
  24. package/types/FormFieldLabel/v1/styles.d.ts.map +1 -1
  25. package/types/FormFieldLabel/v1/theme.d.ts.map +1 -1
  26. package/types/FormFieldLayout/v1/index.d.ts +3 -3
  27. package/types/FormFieldLayout/v1/index.d.ts.map +1 -1
  28. package/types/FormFieldLayout/v1/styles.d.ts.map +1 -1
  29. package/types/FormFieldLayout/v1/theme.d.ts.map +1 -1
  30. package/types/FormFieldLayout/v2/index.d.ts +2 -2
  31. package/types/FormFieldLayout/v2/index.d.ts.map +1 -1
  32. package/types/FormFieldLayout/v2/styles.d.ts +1 -1
  33. package/types/FormFieldLayout/v2/styles.d.ts.map +1 -1
  34. package/types/FormFieldMessage/v1/index.d.ts.map +1 -1
  35. package/types/FormFieldMessage/v1/styles.d.ts.map +1 -1
  36. package/types/FormFieldMessage/v1/theme.d.ts.map +1 -1
  37. package/types/FormFieldMessage/v2/index.d.ts.map +1 -1
  38. package/types/FormFieldMessage/v2/styles.d.ts +1 -1
  39. package/types/FormFieldMessage/v2/styles.d.ts.map +1 -1
  40. package/types/FormFieldMessages/v1/index.d.ts.map +1 -1
  41. package/types/FormFieldMessages/v1/styles.d.ts.map +1 -1
  42. package/types/FormFieldMessages/v1/theme.d.ts.map +1 -1
  43. package/types/FormFieldMessages/v2/index.d.ts.map +1 -1
  44. package/types/FormFieldMessages/v2/styles.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.7.6-snapshot-11](https://github.com/instructure/instructure-ui/compare/v11.7.5...v11.7.6-snapshot-11) (2026-08-31)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** generate deterministic ids with React useId ([83aa25a](https://github.com/instructure/instructure-ui/commit/83aa25aebd41720fd09beac025dbf961e1f413c2))
12
+
13
+
14
+ ### Features
15
+
16
+ * **many:** add margin prop to v2 FormFieldGroup, CheckboxGroup, RadioInputGroup, Checkbox, RadioInput, RangeInput, Text, and ToggleButton ([fea952f](https://github.com/instructure/instructure-ui/commit/fea952f22e553745c299eeba1a2700dbb3b9d296))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [11.7.5](https://github.com/instructure/instructure-ui/compare/v11.7.4...v11.7.5) (2026-08-25)
7
23
 
8
24
  **Note:** Version bump only for package @instructure/ui-form-field
@@ -22,5 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- const allowedProps = ['description', 'as', 'messages', 'messagesId', 'disabled', 'readOnly', 'children', 'layout', 'rowSpacing', 'colSpacing', 'vAlign', 'startAt', 'elementRef'];
25
+ const allowedProps = ['description', 'as', 'messages', 'messagesId', 'disabled', 'readOnly', 'children', 'layout', 'rowSpacing', 'colSpacing', 'vAlign', 'startAt', 'margin', 'elementRef'];
26
26
  export { allowedProps };
@@ -22,7 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { forwardRef, useEffect, useState, useCallback } from 'react';
25
+ import { forwardRef, useCallback } from 'react';
26
26
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
27
27
  import { omitProps, useDeterministicId } from '@instructure/ui-react-utils';
28
28
  import { useStyleNew } from '@instructure/emotion';
@@ -59,16 +59,12 @@ const FormFieldLayout = /*#__PURE__*/forwardRef((props, ref) => {
59
59
  ...rest
60
60
  } = props;
61
61
 
62
- // Deterministic ID generation
63
- const [deterministicId, setDeterministicId] = useState();
64
- const getId = useDeterministicId('FormFieldLayout');
65
- useEffect(() => {
66
- setDeterministicId(getId());
67
- }, []);
62
+ // SSR-safe deterministic ID generation (stable across server/client render)
63
+ const deterministicId = useDeterministicId('FormFieldLayout')();
68
64
  const messagesId = messagesIdProp || deterministicId;
69
65
  // Give the label an id so controls can reference only the label text via
70
66
  // `aria-labelledby`, keeping messages out of the accessible name.
71
- const labelId = labelIdProp || (deterministicId ? `${deterministicId}-Label` : undefined);
67
+ const labelId = labelIdProp || `${deterministicId}-Label`;
72
68
 
73
69
  // Filter out error and success messages when disabled or readOnly
74
70
  const filteredMessages = disabled || readOnly ? messages?.filter(msg => msg.type !== 'error' && msg.type !== 'newError' && msg.type !== 'success') : messages;
@@ -28,4 +28,4 @@ exports.allowedProps = void 0;
28
28
  * SOFTWARE.
29
29
  */
30
30
 
31
- const allowedProps = exports.allowedProps = ['description', 'as', 'messages', 'messagesId', 'disabled', 'readOnly', 'children', 'layout', 'rowSpacing', 'colSpacing', 'vAlign', 'startAt', 'elementRef'];
31
+ const allowedProps = exports.allowedProps = ['description', 'as', 'messages', 'messagesId', 'disabled', 'readOnly', 'children', 'layout', 'rowSpacing', 'colSpacing', 'vAlign', 'startAt', 'margin', 'elementRef'];
@@ -74,16 +74,12 @@ const FormFieldLayout = exports.FormFieldLayout = /*#__PURE__*/(0, _react.forwar
74
74
  ...rest
75
75
  } = props;
76
76
 
77
- // Deterministic ID generation
78
- const [deterministicId, setDeterministicId] = (0, _react.useState)();
79
- const getId = (0, _useDeterministicId.useDeterministicId)('FormFieldLayout');
80
- (0, _react.useEffect)(() => {
81
- setDeterministicId(getId());
82
- }, []);
77
+ // SSR-safe deterministic ID generation (stable across server/client render)
78
+ const deterministicId = (0, _useDeterministicId.useDeterministicId)('FormFieldLayout')();
83
79
  const messagesId = messagesIdProp || deterministicId;
84
80
  // Give the label an id so controls can reference only the label text via
85
81
  // `aria-labelledby`, keeping messages out of the accessible name.
86
- const labelId = labelIdProp || (deterministicId ? `${deterministicId}-Label` : undefined);
82
+ const labelId = labelIdProp || `${deterministicId}-Label`;
87
83
 
88
84
  // Filter out error and success messages when disabled or readOnly
89
85
  const filteredMessages = disabled || readOnly ? messages?.filter(msg => msg.type !== 'error' && msg.type !== 'newError' && msg.type !== 'success') : messages;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-form-field",
3
- "version": "11.7.5",
3
+ "version": "11.7.6-snapshot-11",
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.29.7",
18
- "@instructure/console": "11.7.5",
19
- "@instructure/emotion": "11.7.5",
20
- "@instructure/ui-a11y-content": "11.7.5",
21
- "@instructure/ui-a11y-utils": "11.7.5",
22
- "@instructure/shared-types": "11.7.5",
23
- "@instructure/ui-grid": "11.7.5",
24
- "@instructure/ui-icons": "11.7.5",
25
- "@instructure/ui-react-utils": "11.7.5",
26
- "@instructure/ui-themes": "11.7.5",
27
- "@instructure/uid": "11.7.5",
28
- "@instructure/ui-utils": "11.7.5"
18
+ "@instructure/console": "11.7.6-snapshot-11",
19
+ "@instructure/emotion": "11.7.6-snapshot-11",
20
+ "@instructure/ui-a11y-content": "11.7.6-snapshot-11",
21
+ "@instructure/shared-types": "11.7.6-snapshot-11",
22
+ "@instructure/ui-a11y-utils": "11.7.6-snapshot-11",
23
+ "@instructure/ui-grid": "11.7.6-snapshot-11",
24
+ "@instructure/ui-themes": "11.7.6-snapshot-11",
25
+ "@instructure/ui-utils": "11.7.6-snapshot-11",
26
+ "@instructure/uid": "11.7.6-snapshot-11",
27
+ "@instructure/ui-react-utils": "11.7.6-snapshot-11",
28
+ "@instructure/ui-icons": "11.7.6-snapshot-11"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@testing-library/jest-dom": "^6.9.1",
32
32
  "@testing-library/react": "16.3.2",
33
33
  "vitest": "^4.1.9",
34
- "@instructure/ui-axe-check": "11.7.5",
35
- "@instructure/ui-babel-preset": "11.7.5"
34
+ "@instructure/ui-axe-check": "11.7.6-snapshot-11",
35
+ "@instructure/ui-babel-preset": "11.7.6-snapshot-11"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": ">=18 <=19"
@@ -17,6 +17,7 @@ type: example
17
17
  rowSpacing="small"
18
18
  layout="inline"
19
19
  vAlign="middle"
20
+ margin="general.spaceMd 0"
20
21
  >
21
22
  <TextInput renderLabel="Favorite Breakfast Eatery"
22
23
  messages={[
@@ -26,7 +26,11 @@ import type {
26
26
  AsElementType,
27
27
  OtherHTMLAttributes
28
28
  } from '@instructure/shared-types'
29
- import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
29
+ import type {
30
+ WithStyleProps,
31
+ ComponentStyle,
32
+ Spacing
33
+ } from '@instructure/emotion'
30
34
  import type { FormFieldLayoutOwnProps } from '../../FormFieldLayout/v2/props'
31
35
  import type { FormMessage } from '../../utils/v1/FormPropTypes'
32
36
 
@@ -62,6 +66,12 @@ type FormFieldGroupOwnProps = {
62
66
  colSpacing?: 'none' | 'small' | 'medium' | 'large'
63
67
  vAlign?: 'top' | 'middle' | 'bottom'
64
68
  startAt?: 'small' | 'medium' | 'large' | 'x-large' | null
69
+ /**
70
+ * Valid values are `0`, `none`, `auto`, and Spacing token values,
71
+ * see https://instructure.design/layout-spacing. Apply these values via
72
+ * familiar CSS-like shorthand. For example, `margin="general.spaceMd auto"`.
73
+ */
74
+ margin?: Spacing
65
75
  /**
66
76
  * provides a reference to the underlying html root element
67
77
  */
@@ -96,6 +106,7 @@ const allowedProps: AllowedPropKeys = [
96
106
  'colSpacing',
97
107
  'vAlign',
98
108
  'startAt',
109
+ 'margin',
99
110
  'elementRef'
100
111
  ]
101
112
 
@@ -22,7 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { forwardRef, useEffect, useState, useCallback } from 'react'
25
+ import { forwardRef, useCallback } from 'react'
26
26
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils'
27
27
  import { omitProps, useDeterministicId } from '@instructure/ui-react-utils'
28
28
 
@@ -62,18 +62,13 @@ const FormFieldLayout = forwardRef<Element, FormFieldLayoutProps>(
62
62
  ...rest
63
63
  } = props
64
64
 
65
- // Deterministic ID generation
66
- const [deterministicId, setDeterministicId] = useState<string | undefined>()
67
- const getId = useDeterministicId('FormFieldLayout')
68
- useEffect(() => {
69
- setDeterministicId(getId())
70
- }, [])
65
+ // SSR-safe deterministic ID generation (stable across server/client render)
66
+ const deterministicId = useDeterministicId('FormFieldLayout')()
71
67
 
72
68
  const messagesId = messagesIdProp || deterministicId
73
69
  // Give the label an id so controls can reference only the label text via
74
70
  // `aria-labelledby`, keeping messages out of the accessible name.
75
- const labelId =
76
- labelIdProp || (deterministicId ? `${deterministicId}-Label` : undefined)
71
+ const labelId = labelIdProp || `${deterministicId}-Label`
77
72
 
78
73
  // Filter out error and success messages when disabled or readOnly
79
74
  const filteredMessages =