carbon-react 138.1.0 → 138.2.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.
Files changed (39) hide show
  1. package/esm/components/carbon-provider/carbon-provider.component.d.ts +2 -4
  2. package/esm/components/checkbox/checkbox-group/checkbox-group.component.d.ts +9 -6
  3. package/esm/components/date-range/date-range.component.d.ts +21 -20
  4. package/esm/components/date-range/date-range.style.d.ts +1 -1
  5. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +13 -5
  6. package/esm/components/menu/menu.config.d.ts +12 -0
  7. package/esm/components/menu/menu.config.js +16 -4
  8. package/esm/components/menu/scrollable-block/scrollable-block.style.js +13 -0
  9. package/esm/components/numeral-date/numeral-date.component.d.ts +12 -9
  10. package/esm/components/radio-button/radio-button-group/radio-button-group.component.d.ts +10 -7
  11. package/esm/components/select/filterable-select/filterable-select.component.d.ts +2 -2
  12. package/esm/components/select/multi-select/multi-select.component.d.ts +2 -2
  13. package/esm/components/select/select-list/select-list.component.js +8 -1
  14. package/esm/components/select/select-textbox/select-textbox.component.d.ts +4 -4
  15. package/esm/components/select/simple-select/simple-select.component.d.ts +2 -2
  16. package/esm/components/switch/switch.component.d.ts +4 -4
  17. package/esm/components/text-editor/text-editor.component.d.ts +1 -1
  18. package/esm/components/textarea/textarea.component.d.ts +26 -19
  19. package/esm/components/textbox/textbox.component.d.ts +11 -10
  20. package/lib/components/carbon-provider/carbon-provider.component.d.ts +2 -4
  21. package/lib/components/checkbox/checkbox-group/checkbox-group.component.d.ts +9 -6
  22. package/lib/components/date-range/date-range.component.d.ts +21 -20
  23. package/lib/components/date-range/date-range.style.d.ts +1 -1
  24. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +13 -5
  25. package/lib/components/menu/menu.config.d.ts +12 -0
  26. package/lib/components/menu/menu.config.js +16 -4
  27. package/lib/components/menu/scrollable-block/scrollable-block.style.js +13 -0
  28. package/lib/components/numeral-date/numeral-date.component.d.ts +12 -9
  29. package/lib/components/radio-button/radio-button-group/radio-button-group.component.d.ts +10 -7
  30. package/lib/components/select/filterable-select/filterable-select.component.d.ts +2 -2
  31. package/lib/components/select/multi-select/multi-select.component.d.ts +2 -2
  32. package/lib/components/select/select-list/select-list.component.js +8 -1
  33. package/lib/components/select/select-textbox/select-textbox.component.d.ts +4 -4
  34. package/lib/components/select/simple-select/simple-select.component.d.ts +2 -2
  35. package/lib/components/switch/switch.component.d.ts +4 -4
  36. package/lib/components/text-editor/text-editor.component.d.ts +1 -1
  37. package/lib/components/textarea/textarea.component.d.ts +26 -19
  38. package/lib/components/textbox/textbox.component.d.ts +11 -10
  39. package/package.json +1 -1
@@ -4,13 +4,11 @@ export interface CarbonProviderProps {
4
4
  children: React.ReactNode;
5
5
  /** Theme which specifies styles to apply to all child components. Set to `sageTheme` by default. */
6
6
  theme?: Partial<ThemeObject>;
7
- /** Feature flag for opting in to the latest validation designs for components that support it.
7
+ /** Feature flag for opting in to the new validation redesign for components that support it.
8
8
  *
9
9
  * NOTE - Will eventually be set to `true` by default in the future. */
10
10
  validationRedesignOptIn?: boolean;
11
- /** Feature flag for opting out of styling components to have rounded corners.
12
- *
13
- * NOTE - Will eventually be set to `false` by default in the future. */
11
+ /** Feature flag for opting out of styling components to have rounded corners. */
14
12
  roundedCornersOptOut?: boolean;
15
13
  focusRedesignOptOut?: boolean;
16
14
  }
@@ -4,15 +4,18 @@ import { ValidationProps } from "../../../__internal__/validations";
4
4
  export interface CheckboxGroupProps extends ValidationProps, MarginProps {
5
5
  /** The content for the CheckboxGroup Legend */
6
6
  legend?: string;
7
- /** The content for the CheckboxGroup Legend Help text */
7
+ /**
8
+ * The content for the CheckboxGroup Help tooltip,
9
+ * will be rendered as hint text when `validationRedesignOptIn` is true.
10
+ */
8
11
  legendHelp?: string;
9
- /** When true, legend is placed inline with the checkboxes */
12
+ /** [Legacy] When true, legend is placed inline with the checkboxes */
10
13
  legendInline?: boolean;
11
- /** Percentage width of legend (only when legend is inline) */
14
+ /** [Legacy] Percentage width of legend (only when legend is inline) */
12
15
  legendWidth?: number;
13
- /** Text alignment of legend when inline */
16
+ /** [Legacy] Text alignment of legend when inline */
14
17
  legendAlign?: "left" | "right";
15
- /** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
18
+ /** [Legacy] Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
16
19
  legendSpacing?: 1 | 2;
17
20
  /** The Checkboxes to be rendered in the group */
18
21
  children: React.ReactNode;
@@ -22,7 +25,7 @@ export interface CheckboxGroupProps extends ValidationProps, MarginProps {
22
25
  required?: boolean;
23
26
  /** Flag to configure component as optional. */
24
27
  isOptional?: boolean;
25
- /** Overrides the default tooltip */
28
+ /** [Legacy] Overrides the default tooltip */
26
29
  tooltipPosition?: "top" | "bottom" | "left" | "right";
27
30
  /** When true, Checkboxes are in line */
28
31
  inline?: boolean;
@@ -20,21 +20,21 @@ export interface DateRangeProps extends StyledDateRangeProps, MarginProps, TagPr
20
20
  /** Optional label for endDate field */
21
21
  endLabel?: string;
22
22
  /**
23
- * Indicate that error has occurred on end date
24
- * Pass string to display icon, tooltip and red border
25
- * Pass true boolean to only display red border
23
+ * Indicate that error has occurred on end date.
24
+ * Pass string to display icon, tooltip and red border.
25
+ * Pass true boolean to only display red border.
26
26
  */
27
27
  endError?: boolean | string;
28
28
  /**
29
- * Indicate additional information for end date
30
- * Pass string to display icon, tooltip and blue border
31
- * Pass true boolean to only display blue border
29
+ * [Legacy] Indicate additional information for end date.
30
+ * Pass string to display icon, tooltip and blue border.
31
+ * Pass true boolean to only display blue border.
32
32
  */
33
33
  endInfo?: boolean | string;
34
34
  /**
35
- * Indicate that warning has occurred on end date
36
- * Pass string to display icon, tooltip and orange border
37
- * Pass true boolean to only display orange border
35
+ * Indicate that warning has occurred on end date.
36
+ * Pass string to display icon, tooltip and orange border.
37
+ * Pass true boolean to only display orange border.
38
38
  */
39
39
  endWarning?: boolean | string;
40
40
  /**
@@ -54,20 +54,21 @@ export interface DateRangeProps extends StyledDateRangeProps, MarginProps, TagPr
54
54
  /** Optional label for startDate field */
55
55
  startLabel?: string;
56
56
  /**
57
- * Indicate that error has occurred on start date
58
- * Pass string to display icon, tooltip and red border
59
- * Pass true boolean to only display red border
57
+ * Indicate that error has occurred on start date.
58
+ * Pass string to display icon, tooltip and red border.
59
+ * Pass true boolean to only display red border.
60
60
  */
61
61
  startError?: boolean | string;
62
62
  /**
63
- * Indicate that warning has occurred on start date
64
- * Pass string to display icon, tooltip and orange border
65
- * Pass true boolean to only display orange border
63
+ * Indicate that warning has occurred on start date.
64
+ * Pass string to display icon, tooltip and orange border.
65
+ * Pass true boolean to only display orange border.
66
66
  */
67
67
  startWarning?: boolean | string;
68
- /** Indicate additional information for start date
69
- * Pass string to display icon, tooltip and blue border
70
- * Pass true boolean to only display blue border
68
+ /**
69
+ * [Legacy] Indicate additional information for start date.
70
+ * Pass string to display icon, tooltip and blue border.
71
+ * Pass true boolean to only display blue border.
71
72
  */
72
73
  startInfo?: boolean | string;
73
74
  /**
@@ -76,9 +77,9 @@ export interface DateRangeProps extends StyledDateRangeProps, MarginProps, TagPr
76
77
  startRef?: React.ForwardedRef<HTMLInputElement>;
77
78
  /** An array containing the value of startDate and endDate */
78
79
  value: string[];
79
- /** When true, validation icons will be placed on labels instead of being placed on the inputs */
80
+ /** [Legacy] When true, validation icons will be placed on labels instead of being placed on the inputs */
80
81
  validationOnLabel?: boolean;
81
- /** Overrides the default tooltip position */
82
+ /** [Legacy] Overrides the default tooltip position */
82
83
  tooltipPosition?: "top" | "bottom" | "left" | "right";
83
84
  /** Flag to configure component as mandatory. */
84
85
  required?: boolean;
@@ -1,5 +1,5 @@
1
1
  export interface StyledDateRangeProps {
2
- /** Display labels inline */
2
+ /** [Legacy] Display labels inline */
3
3
  labelsInline?: boolean;
4
4
  }
5
5
  declare const StyledDateRange: import("styled-components").StyledComponent<"div", any, StyledDateRangeProps, never>;
@@ -94,13 +94,21 @@ const StyledMenuModal = styled.div`
94
94
  }
95
95
  }
96
96
  }
97
- `}
98
97
 
99
- ${StyledBox} {
100
- &::-webkit-scrollbar {
101
- width: 16px;
98
+ ${StyledBox} {
99
+ scrollbar-color: ${menuConfigVariants[menuType].scrollbarColor};
100
+
101
+ &::-webkit-scrollbar {
102
+ width: var(--sizing150);
103
+ }
104
+ &::-webkit-scrollbar-thumb {
105
+ background-color: ${menuConfigVariants[menuType].scrollbarThumb};
106
+ }
107
+ &::-webkit-scrollbar-track {
108
+ background-color: ${menuConfigVariants[menuType].scrollbarTrack};
109
+ }
102
110
  }
103
- }
111
+ `}
104
112
  `;
105
113
  const StyledMenuFullscreenHeader = styled.div`
106
114
  height: 40px;
@@ -12,6 +12,9 @@ declare const _default: {
12
12
  alternate: string;
13
13
  alternateHover: string;
14
14
  divider: string;
15
+ scrollbarThumb: string;
16
+ scrollbarTrack: string;
17
+ scrollbarColor: string;
15
18
  };
16
19
  dark: {
17
20
  background: string;
@@ -26,6 +29,9 @@ declare const _default: {
26
29
  alternate: string;
27
30
  alternateHover: string;
28
31
  divider: string;
32
+ scrollbarThumb: string;
33
+ scrollbarTrack: string;
34
+ scrollbarColor: string;
29
35
  };
30
36
  black: {
31
37
  background: string;
@@ -40,6 +46,9 @@ declare const _default: {
40
46
  alternate: string;
41
47
  alternateHover: string;
42
48
  divider: string;
49
+ scrollbarThumb: string;
50
+ scrollbarTrack: string;
51
+ scrollbarColor: string;
43
52
  };
44
53
  white: {
45
54
  background: string;
@@ -54,6 +63,9 @@ declare const _default: {
54
63
  alternate: string;
55
64
  alternateHover: string;
56
65
  divider: string;
66
+ scrollbarThumb: string;
67
+ scrollbarTrack: string;
68
+ scrollbarColor: string;
57
69
  };
58
70
  };
59
71
  export default _default;
@@ -11,7 +11,10 @@ export default {
11
11
  title: "var(--colorsComponentsMenuYin065)",
12
12
  alternate: "var(--colorsComponentsMenuSpringChildAlt500)",
13
13
  alternateHover: "var(--colorsComponentsMenuSpringChildAlt600)",
14
- divider: "var(--colorsComponentsMenuSpringChild400)"
14
+ divider: "var(--colorsComponentsMenuSpringChild400)",
15
+ scrollbarThumb: "#597a8b",
16
+ scrollbarTrack: "#f2f5f6",
17
+ scrollbarColor: "#597a8b #f2f5f6"
15
18
  },
16
19
  dark: {
17
20
  background: "var(--colorsComponentsMenuAutumnStandard500)",
@@ -25,7 +28,10 @@ export default {
25
28
  title: "var(--colorsComponentsMenuYang080)",
26
29
  alternate: "var(--colorsComponentsMenuAutumnChildAlt500)",
27
30
  alternateHover: "var(--colorsComponentsMenuAutumnChildAlt600)",
28
- divider: "var(--colorsComponentsMenuAutumnChild400)"
31
+ divider: "var(--colorsComponentsMenuAutumnChild400)",
32
+ scrollbarThumb: "#597a8b",
33
+ scrollbarTrack: "#f2f5f6",
34
+ scrollbarColor: "#597a8b #f2f5f6"
29
35
  },
30
36
  black: {
31
37
  background: "var(--colorsComponentsMenuWinterStandard500)",
@@ -39,7 +45,10 @@ export default {
39
45
  title: "var(--colorsComponentsMenuYang080)",
40
46
  alternate: "var(--colorsComponentsMenuWinterChildAlt500)",
41
47
  alternateHover: "var(--colorsComponentsMenuWinterChildAlt600)",
42
- divider: "var(--colorsComponentsMenuWinterChild400)"
48
+ divider: "var(--colorsComponentsMenuWinterChild400)",
49
+ scrollbarThumb: "#CCCCCC",
50
+ scrollbarTrack: "#808080",
51
+ scrollbarColor: "#CCCCCC #808080"
43
52
  },
44
53
  white: {
45
54
  background: "var(--colorsComponentsMenuSummerStandard500)",
@@ -53,6 +62,9 @@ export default {
53
62
  title: "var(--colorsComponentsMenuYin065)",
54
63
  alternate: "var(--colorsComponentsMenuSummerChildAlt500)",
55
64
  alternateHover: "var(--colorsComponentsMenuSummerChildAlt600)",
56
- divider: "var(--colorsComponentsMenuSummerChild400)"
65
+ divider: "var(--colorsComponentsMenuSummerChild400)",
66
+ scrollbarThumb: "#597a8b",
67
+ scrollbarTrack: "#f2f5f6",
68
+ scrollbarColor: "#597a8b #f2f5f6"
57
69
  }
58
70
  };
@@ -11,6 +11,7 @@ const StyledScrollableBlock = styled.li`
11
11
  }) => css`
12
12
  && ${StyledMenuItemWrapper} {
13
13
  background-color: ${variant === "default" ? menuConfigVariants[menuType].submenuItemBackground : menuConfigVariants[menuType].alternate};
14
+ padding-right: var(--spacing150);
14
15
  }
15
16
 
16
17
  ${StyledBox} {
@@ -23,6 +24,18 @@ const StyledScrollableBlock = styled.li`
23
24
  border-bottom-left-radius: var(--borderRadius100);
24
25
  border-bottom-right-radius: var(--borderRadius000);
25
26
  }
27
+
28
+ scrollbar-color: ${menuConfigVariants[menuType].scrollbarColor};
29
+
30
+ &::-webkit-scrollbar {
31
+ width: var(--sizing150);
32
+ }
33
+ &::-webkit-scrollbar-thumb {
34
+ background-color: ${menuConfigVariants[menuType].scrollbarThumb};
35
+ }
36
+ &::-webkit-scrollbar-track {
37
+ background-color: ${menuConfigVariants[menuType].scrollbarTrack};
38
+ }
26
39
  }
27
40
  `}
28
41
  `;
@@ -43,7 +43,7 @@ export interface NumeralDateProps<DateType extends NumeralDateObject = FullDate>
43
43
  enableInternalError?: boolean;
44
44
  /** When true, enables the internal warnings to be displayed */
45
45
  enableInternalWarning?: boolean;
46
- /** Help content to be displayed under an input */
46
+ /** [Legacy] Help content to be displayed under an input */
47
47
  fieldHelp?: React.ReactNode;
48
48
  /** `id` for events */
49
49
  id?: string;
@@ -51,15 +51,18 @@ export interface NumeralDateProps<DateType extends NumeralDateObject = FullDate>
51
51
  name?: string;
52
52
  /** Label */
53
53
  label?: string;
54
- /** Label alignment. Works only when labelInline is true */
54
+ /** [Legacy] Label alignment. Works only when labelInline is true */
55
55
  labelAlign?: "left" | "right";
56
- /** Text applied to label help tooltip */
56
+ /**
57
+ * Text applied to label help tooltip, will be rendered as
58
+ * hint text when `validationRedesignOptIn` is true.
59
+ */
57
60
  labelHelp?: React.ReactNode;
58
- /** When true, label is placed in line with an input */
61
+ /** [Legacy] When true, label is placed in line with an input */
59
62
  labelInline?: boolean;
60
- /** Label width */
63
+ /** [Legacy] Label width */
61
64
  labelWidth?: number;
62
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
65
+ /** [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
63
66
  labelSpacing?: 1 | 2;
64
67
  /** Blur event handler */
65
68
  onBlur?: (ev: NumeralDateEvent<DateType>) => void;
@@ -69,11 +72,11 @@ export interface NumeralDateProps<DateType extends NumeralDateObject = FullDate>
69
72
  required?: boolean;
70
73
  /** Size of an input */
71
74
  size?: "small" | "medium" | "large";
72
- /** When true, validation icons will be placed on labels instead of being placed on the inputs */
75
+ /** [Legacy] When true, validation icons will be placed on labels instead of being placed on the inputs */
73
76
  validationOnLabel?: boolean;
74
- /** Overrides the default tooltip position */
77
+ /** [Legacy] Overrides the default tooltip position */
75
78
  tooltipPosition?: "top" | "bottom" | "left" | "right";
76
- /** Aria label for rendered help component */
79
+ /** [Legacy] Aria label for rendered help component */
77
80
  helpAriaLabel?: string;
78
81
  /**
79
82
  * A React ref to pass to the input corresponding to the day
@@ -8,21 +8,24 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
8
8
  adaptiveSpacingBreakpoint?: number;
9
9
  /** The RadioButton objects to be rendered in the group */
10
10
  children: React.ReactNode;
11
- /** When true, RadioButtons are in line */
11
+ /** When true, RadioButtons children are in line */
12
12
  inline?: boolean;
13
13
  /** Spacing between labels and radio buttons, given number will be multiplied by base spacing unit (8) */
14
14
  labelSpacing?: 1 | 2;
15
15
  /** The content for the RadioGroup Legend */
16
16
  legend?: string;
17
- /** The content for the hint text of the RadioGroup Legend */
17
+ /**
18
+ * The content for the RadioButtonGroup Legend Help tooltip,
19
+ * will be rendered as hint text when `validationRedesignOptIn` is true.
20
+ */
18
21
  legendHelp?: string;
19
- /** Text alignment of legend when inline */
22
+ /** [Legacy] Text alignment of legend when inline */
20
23
  legendAlign?: "left" | "right";
21
- /** When true, legend is placed in line with the radiobuttons */
24
+ /** [Legacy] When true, legend is placed in line with the RadioButtons */
22
25
  legendInline?: boolean;
23
- /** Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
26
+ /** [Legacy] Spacing between legend and field for inline legend, number multiplied by base spacing unit (8) */
24
27
  legendSpacing?: 1 | 2;
25
- /** Percentage width of legend (only when legend is inline) */
28
+ /** [Legacy] Percentage width of legend (only when legend is inline) */
26
29
  legendWidth?: number;
27
30
  /** Specifies the name prop to be applied to each button in the group */
28
31
  name: string;
@@ -36,7 +39,7 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps {
36
39
  isOptional?: boolean;
37
40
  /** value of the selected RadioButton */
38
41
  value?: string;
39
- /** Overrides the default tooltip position */
42
+ /** [Legacy] Overrides the default tooltip position */
40
43
  tooltipPosition?: "top" | "bottom" | "left" | "right";
41
44
  }
42
45
  export declare const RadioButtonGroup: {
@@ -5,7 +5,7 @@ import { FormInputPropTypes } from "../select-textbox";
5
5
  export interface FilterableSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
6
6
  /** Prop to specify the aria-label attribute of the component input */
7
7
  "aria-label"?: string;
8
- /** Prop to specify the aria-labeledby property of the component input */
8
+ /** Prop to specify the aria-labelledby property of the component input */
9
9
  "aria-labelledby"?: string;
10
10
  /** Identifier used for testing purposes, applied to the root element of the component. */
11
11
  "data-component"?: string;
@@ -43,7 +43,7 @@ export interface FilterableSelectProps extends Omit<FormInputPropTypes, "default
43
43
  tableHeader?: React.ReactNode;
44
44
  /** The selected value(s), when the component is operating in controlled mode */
45
45
  value?: string | Record<string, unknown>;
46
- /** Overrides the default tooltip position */
46
+ /** [Legacy] Overrides the default tooltip position */
47
47
  tooltipPosition?: "top" | "bottom" | "left" | "right";
48
48
  /** Maximum list height - defaults to 180 */
49
49
  listMaxHeight?: number;
@@ -4,7 +4,7 @@ import { FormInputPropTypes } from "../select-textbox";
4
4
  export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
5
5
  /** Prop to specify the aria-label attribute of the component input */
6
6
  "aria-label"?: string;
7
- /** Prop to specify the aria-labeledby property of the component input */
7
+ /** Prop to specify the aria-labelledby property of the component input */
8
8
  "aria-labelledby"?: string;
9
9
  /** Identifier used for testing purposes, applied to the root element of the component. */
10
10
  "data-component"?: string;
@@ -38,7 +38,7 @@ export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue
38
38
  tableHeader?: React.ReactNode;
39
39
  /** The selected value(s), when the component is operating in controlled mode */
40
40
  value?: string[] | Record<string, unknown>[];
41
- /** Overrides the default tooltip position */
41
+ /** [Legacy] Overrides the default tooltip position */
42
42
  tooltipPosition?: "top" | "bottom" | "left" | "right";
43
43
  /** Maximum list height - defaults to 180 */
44
44
  listMaxHeight?: number;
@@ -118,7 +118,14 @@ const SelectList = /*#__PURE__*/React.forwardRef(({
118
118
  });
119
119
  }
120
120
  }
121
- const listHeight = virtualizer.getTotalSize();
121
+ const totalSize = virtualizer.getTotalSize();
122
+ // virtualizer.getTotalSize() returns the total size in pixels for the virtualized items. If nothing is loaded,
123
+ // then the list height is set to 0 (line 21 of src/components/select/select-list/select-list.style.ts) as
124
+ // the method always returns a number and never undefined, it seems.
125
+ // https://github.com/TanStack/virtual/commit/e43e03e500588b2da36f184ecaba2b8e5a506596 suggests that items are
126
+ // never returned regardless if the container height it 0, so the below line ensures that a container of at
127
+ // least 1px is always available to render into.
128
+ const listHeight = totalSize === 0 ? 1 : totalSize;
122
129
  useEffect(() => {
123
130
  if (isOpen) {
124
131
  blockScroll();
@@ -7,7 +7,7 @@ export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxP
7
7
  adaptiveLabelBreakpoint?: number;
8
8
  /** Prop to specify the aria-label attribute of the component input */
9
9
  ariaLabel?: string;
10
- /** Prop to specify the aria-labeledby property of the component input */
10
+ /** Prop to specify the aria-labelledby property of the component input */
11
11
  ariaLabelledby?: string;
12
12
  /** If true the Component will be focused when rendered */
13
13
  autoFocus?: boolean;
@@ -19,11 +19,11 @@ export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxP
19
19
  inputWidth?: number;
20
20
  /** Label content */
21
21
  label?: string;
22
- /** A message that the Help component will display */
22
+ /** [Legacy] A message that the Help component will display */
23
23
  labelHelp?: React.ReactNode;
24
- /** When true label is inline */
24
+ /** [Legacy] When true label is inline */
25
25
  labelInline?: boolean;
26
- /** Label width */
26
+ /** [Legacy] Label width */
27
27
  labelWidth?: number;
28
28
  /** Name attribute of the input element */
29
29
  name?: string;
@@ -14,7 +14,7 @@ export interface CustomSelectChangeEvent extends React.ChangeEvent<HTMLInputElem
14
14
  export interface SimpleSelectProps extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
15
15
  /** Prop to specify the aria-label attribute of the component input */
16
16
  "aria-label"?: string;
17
- /** Prop to specify the aria-labeledby property of the component input */
17
+ /** Prop to specify the aria-labelledby property of the component input */
18
18
  "aria-labelledby"?: string;
19
19
  /** Identifier used for testing purposes, applied to the root element of the component. */
20
20
  "data-component"?: string;
@@ -46,7 +46,7 @@ export interface SimpleSelectProps extends Omit<FormInputPropTypes, "defaultValu
46
46
  transparent?: boolean;
47
47
  /** The selected value(s), when the component is operating in controlled mode */
48
48
  value?: string | Record<string, unknown>;
49
- /** Overrides the default tooltip position */
49
+ /** [Legacy] Overrides the default tooltip position */
50
50
  tooltipPosition?: "top" | "bottom" | "left" | "right";
51
51
  /** Maximum list height - defaults to 180 */
52
52
  listMaxHeight?: number;
@@ -12,17 +12,17 @@ export interface SwitchProps extends CommonCheckableInputProps, MarginProps {
12
12
  adaptiveLabelBreakpoint?: number;
13
13
  /** Set the default value of the Switch if component is meant to be used as uncontrolled */
14
14
  defaultChecked?: boolean;
15
- /** When true label is inline */
15
+ /** [Legacy] When true label is inline */
16
16
  labelInline?: boolean;
17
17
  /** Triggers loading animation */
18
18
  loading?: boolean;
19
- /** When true, validation icon will be placed on label instead of being placed on the input */
19
+ /** [Legacy] When true, validation icon will be placed on label instead of being placed on the input */
20
20
  validationOnLabel?: boolean;
21
21
  /** The value of the switch, passed on form submit */
22
22
  value?: string;
23
- /** Overrides the default tooltip position */
23
+ /** [Legacy] Overrides the default tooltip position */
24
24
  tooltipPosition?: "top" | "bottom" | "left" | "right";
25
- /** Aria label for rendered help component */
25
+ /** [Legacy] Aria label for rendered help component */
26
26
  helpAriaLabel?: string;
27
27
  }
28
28
  export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
@@ -24,7 +24,7 @@ export interface TextEditorProps extends MarginProps {
24
24
  error?: string;
25
25
  /** Message to be displayed when there is a warning */
26
26
  warning?: string;
27
- /** Message to be displayed when there is an info */
27
+ /** [Legacy] Message to be displayed when there is an info */
28
28
  info?: string;
29
29
  /** Number greater than 2 multiplied by line-height (21px) to override the default min-height of the editor */
30
30
  rows?: number;
@@ -25,21 +25,25 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
25
25
  children?: React.ReactNode;
26
26
  /** If true, the component will be disabled */
27
27
  disabled?: boolean;
28
- /** Indicate that error has occurred
29
- Pass string to display icon, tooltip and red border
30
- Pass true boolean to only display red border */
28
+ /**
29
+ * Indicate that error has occurred.
30
+ * Pass string to display icon, tooltip and red border.
31
+ * Pass true boolean to only display red border.
32
+ */
31
33
  error?: boolean | string;
32
34
  /** Allows the Textareas Height to change based on user input */
33
35
  expandable?: boolean;
34
36
  /** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input. */
35
37
  inputHint?: string;
36
- /** Help content to be displayed under an input */
38
+ /** [Legacy] Help content to be displayed under an input */
37
39
  fieldHelp?: React.ReactNode;
38
- /** Aria label for rendered help component */
40
+ /** [Legacy] Aria label for rendered help component */
39
41
  helpAriaLabel?: string;
40
- /** Indicate additional information
41
- Pass string to display icon, tooltip and blue border
42
- Pass true boolean to only display blue border */
42
+ /**
43
+ * [Legacy] Indicate additional information.
44
+ * Pass string to display icon, tooltip and blue border.
45
+ * Pass true boolean to only display blue border.
46
+ */
43
47
  info?: boolean | string;
44
48
  /**
45
49
  * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
@@ -47,7 +51,7 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
47
51
  * Icon to display inside of the Textarea
48
52
  */
49
53
  inputIcon?: IconType;
50
- /** Width of an input in percentage. Works only when labelInline is true */
54
+ /** [Legacy] Width of an input in percentage. Works only when labelInline is true */
51
55
  inputWidth?: number;
52
56
  /**
53
57
  * Prop for specifying the max width of the input.
@@ -56,18 +60,19 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
56
60
  maxWidth?: string;
57
61
  /** The content of the label for the input */
58
62
  label?: string;
59
- /** Inline label alignment */
63
+ /** [Legacy] Inline label alignment */
60
64
  labelAlign?: "left" | "right";
61
- /** [Legacy] Text applied to label help tooltip. When opted into new design validations
65
+ /**
66
+ * [Legacy] Text applied to label help tooltip. When opted into new design validations
62
67
  * it will render as a hint above the input, unless an `inputHint`
63
68
  * prop is also passed
64
69
  */
65
70
  labelHelp?: React.ReactNode;
66
- /** When true, label is placed in line an input */
71
+ /** [Legacy] When true, label is placed in line an input */
67
72
  labelInline?: boolean;
68
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
73
+ /** [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
69
74
  labelSpacing?: 1 | 2;
70
- /** Width of a label in percentage. Works only when labelInline is true */
75
+ /** [Legacy] Width of a label in percentage. Works only when labelInline is true */
71
76
  labelWidth?: number;
72
77
  /** Name of the input */
73
78
  name?: string;
@@ -81,15 +86,17 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
81
86
  isOptional?: boolean;
82
87
  /** The number of visible text lines for the control */
83
88
  rows?: number;
84
- /** Overrides the default tooltip position */
89
+ /** [Legacy] Overrides the default tooltip position */
85
90
  tooltipPosition?: "top" | "bottom" | "left" | "right";
86
- /** When true, validation icon will be placed on label instead of being placed on the input */
91
+ /** [Legacy] When true, validation icon will be placed on label instead of being placed on the input */
87
92
  validationOnLabel?: boolean;
88
93
  /** The value of the Textbox */
89
94
  value?: string;
90
- /** Indicate that warning has occurred
91
- Pass string to display icon, tooltip and orange border
92
- Pass true boolean to only display orange border */
95
+ /**
96
+ * Indicate that warning has occurred.
97
+ * Pass string to display icon, tooltip and orange border.
98
+ * Pass true boolean to only display orange border.
99
+ */
93
100
  warning?: boolean | string;
94
101
  /** Specify a custom border radius for the component. Any valid border-radius design token, or an array of border-radius design tokens. */
95
102
  borderRadius?: BorderRadiusType | BorderRadiusType[];
@@ -22,7 +22,7 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
22
22
  deferTimeout?: number;
23
23
  /** A hint string rendered before the input but after the label. Intended to describe the purpose or content of the input. */
24
24
  inputHint?: string;
25
- /** Help content to be displayed under an input */
25
+ /** [Legacy] Help content to be displayed under an input. */
26
26
  fieldHelp?: React.ReactNode;
27
27
  /**
28
28
  * An optional alternative for props.value, this is useful if the
@@ -54,18 +54,19 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
54
54
  leftChildren?: React.ReactNode;
55
55
  /** Label content */
56
56
  label?: string;
57
- /** Inline label alignment */
57
+ /** [Legacy] Inline label alignment */
58
58
  labelAlign?: "left" | "right";
59
- /** [Legacy] Text applied to label help tooltip. When opted into new design validations
59
+ /**
60
+ * [Legacy] Text applied to label help tooltip. When opted into new design validations
60
61
  * it will render as a hint above the input, unless an `inputHint`
61
- * prop is also passed
62
+ * prop is also passed.
62
63
  */
63
64
  labelHelp?: React.ReactNode;
64
- /** When true label is inline */
65
+ /** [Legacy] When true label is inline. */
65
66
  labelInline?: boolean;
66
- /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
67
+ /** [Legacy] Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8). */
67
68
  labelSpacing?: 1 | 2;
68
- /** Label width */
69
+ /** [Legacy] Label width. */
69
70
  labelWidth?: number;
70
71
  /** Specify a callback triggered on change */
71
72
  onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
@@ -85,11 +86,11 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
85
86
  reverse?: boolean;
86
87
  /** Size of an input */
87
88
  size?: "small" | "medium" | "large";
88
- /** When true, validation icon will be placed on label instead of being placed on the input */
89
+ /** [Legacy] When true, validation icon will be placed on label instead of being placed on the input. */
89
90
  validationOnLabel?: boolean;
90
- /** Overrides the default tooltip position */
91
+ /** [Legacy] Overrides the default tooltip position. */
91
92
  tooltipPosition?: "top" | "bottom" | "left" | "right";
92
- /** Aria label for rendered help component */
93
+ /** [Legacy] Aria label for rendered help component. */
93
94
  helpAriaLabel?: string;
94
95
  /** Flag to configure component as optional. */
95
96
  isOptional?: boolean;