carbon-react 109.5.0 → 109.5.1

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 (27) hide show
  1. package/esm/__internal__/form-field/form-field.component.d.ts +59 -0
  2. package/esm/__internal__/form-field/form-field.component.js +202 -57
  3. package/esm/__internal__/form-field/form-field.style.d.ts +7 -0
  4. package/esm/__internal__/form-field/form-field.style.js +6 -12
  5. package/esm/__internal__/form-field/index.d.ts +2 -5
  6. package/esm/__internal__/label/label.component.d.ts +2 -4
  7. package/esm/__internal__/label/label.component.js +0 -3
  8. package/esm/components/button-toggle-group/button-toggle-group.component.js +9 -10
  9. package/esm/components/button-toggle-group/button-toggle-group.d.ts +3 -1
  10. package/esm/components/switch/switch.component.js +0 -3
  11. package/esm/components/switch/switch.d.ts +0 -2
  12. package/esm/components/tabs/tab/tab.d.ts +3 -3
  13. package/lib/__internal__/form-field/form-field.component.d.ts +59 -0
  14. package/lib/__internal__/form-field/form-field.component.js +201 -57
  15. package/lib/__internal__/form-field/form-field.style.d.ts +7 -0
  16. package/lib/__internal__/form-field/form-field.style.js +9 -13
  17. package/lib/__internal__/form-field/index.d.ts +2 -5
  18. package/lib/__internal__/label/label.component.d.ts +2 -4
  19. package/lib/__internal__/label/label.component.js +0 -3
  20. package/lib/components/button-toggle-group/button-toggle-group.component.js +9 -10
  21. package/lib/components/button-toggle-group/button-toggle-group.d.ts +3 -1
  22. package/lib/components/switch/switch.component.js +0 -3
  23. package/lib/components/switch/switch.d.ts +0 -2
  24. package/lib/components/tabs/tab/tab.d.ts +3 -3
  25. package/package.json +1 -1
  26. package/esm/__internal__/form-field/form-field.d.ts +0 -66
  27. package/lib/__internal__/form-field/form-field.d.ts +0 -66
@@ -1,66 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { ValidationProps } from "../validations";
4
-
5
- export interface CommonFormFieldPropTypes extends MarginProps, ValidationProps {
6
- /** If true, the component will be disabled */
7
- disabled?: boolean;
8
- /** Help content to be displayed under an input */
9
- fieldHelp?: React.ReactNode;
10
- /** The unique id of the Help component tooltip, used for accessibility */
11
- tooltipId?: string;
12
- /** The unique id of the FieldHelp component */
13
- fieldHelpId?: string;
14
- /** Overrides the default tabindex of the Help component */
15
- helpTabIndex?: number | string;
16
- /** Label content */
17
- label?: React.ReactNode;
18
- /** Text alignment of the label */
19
- labelAlign?: "left" | "right";
20
- /** A message that the Help component will display */
21
- labelHelp?: React.ReactNode;
22
- /** Help Icon type */
23
- labelHelpIcon?: string;
24
- /** The unique id of the label element */
25
- labelId?: string;
26
- /** When true label is inline */
27
- labelInline?: boolean;
28
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
29
- labelSpacing?: 1 | 2;
30
- /** Label width */
31
- labelWidth?: number;
32
- /** If true the label switches position with the input */
33
- reverse?: boolean;
34
- /** Id of the validation icon */
35
- validationIconId?: string;
36
- }
37
-
38
- export interface FormFieldPropTypes extends CommonFormFieldPropTypes {
39
- /** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
40
- adaptiveLabelBreakpoint?: number;
41
- /** Content to be rendered inside the FormField */
42
- children?: React.ReactNode;
43
- /**
44
- * If true, the FieldHelp will be displayed inline
45
- * To be used with labelInline prop set to true
46
- */
47
- fieldHelpInline?: boolean;
48
- /** Id of the element a label should be bound to */
49
- id: string;
50
- /** [Legacy] Flag to configure component as optional in Form */
51
- isOptional?: boolean;
52
- /** Flag to configure component as mandatory */
53
- isRequired?: boolean;
54
- /** Whether to show the validation icon */
55
- useValidationIcon?: boolean;
56
- /** Identifier used for testing purposes, applied to the root element of the component. */
57
- "data-component"?: string;
58
- /** Identifier used for testing purposes, applied to the root element of the component. */
59
- "data-element"?: string;
60
- /** Identifier used for testing purposes, applied to the root element of the component. */
61
- "data-role"?: string;
62
- }
63
-
64
- declare function FormField(props: FormFieldPropTypes): JSX.Element;
65
-
66
- export default FormField;