carbon-react 109.0.2 → 109.1.2

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 (66) hide show
  1. package/esm/__internal__/focus-trap/focus-trap.component.js +8 -11
  2. package/esm/__internal__/label/label.component.d.ts +1 -1
  3. package/esm/__internal__/label/label.component.js +2 -2
  4. package/esm/components/checkbox/checkbox-group.component.js +0 -5
  5. package/esm/components/checkbox/checkbox-group.d.ts +0 -2
  6. package/esm/components/checkbox/checkbox.component.js +1 -3
  7. package/esm/components/date/date.component.js +4 -7
  8. package/esm/components/flat-table/sort/sort.component.js +2 -1
  9. package/esm/components/flat-table/sort/sort.style.js +0 -1
  10. package/esm/components/help/help.component.d.ts +43 -0
  11. package/esm/components/help/help.component.js +194 -84
  12. package/esm/components/help/help.config.d.ts +1 -0
  13. package/esm/components/help/help.style.d.ts +4 -1
  14. package/esm/components/help/index.d.ts +2 -1
  15. package/esm/components/inline-inputs/inline-inputs.component.d.ts +5 -9
  16. package/esm/components/inline-inputs/inline-inputs.component.js +14 -2
  17. package/esm/components/inline-inputs/inline-inputs.style.d.ts +18 -3
  18. package/esm/components/inline-inputs/inline-inputs.style.js +6 -2
  19. package/esm/components/menu/__internal__/submenu/submenu.component.js +4 -6
  20. package/esm/components/multi-action-button/multi-action-button.component.js +4 -13
  21. package/esm/components/popover-container/popover-container.component.d.ts +1 -1
  22. package/esm/components/popover-container/popover-container.component.js +5 -9
  23. package/esm/components/split-button/split-button.component.js +4 -11
  24. package/esm/hooks/__internal__/useClickAwayListener/index.d.ts +1 -0
  25. package/esm/hooks/__internal__/useClickAwayListener/index.js +1 -0
  26. package/esm/hooks/__internal__/useClickAwayListener/useClickAwayListener.d.ts +3 -0
  27. package/esm/hooks/__internal__/useClickAwayListener/useClickAwayListener.js +23 -0
  28. package/lib/__internal__/focus-trap/focus-trap.component.js +8 -11
  29. package/lib/__internal__/label/label.component.d.ts +1 -1
  30. package/lib/__internal__/label/label.component.js +2 -2
  31. package/lib/components/checkbox/checkbox-group.component.js +0 -5
  32. package/lib/components/checkbox/checkbox-group.d.ts +0 -2
  33. package/lib/components/checkbox/checkbox.component.js +1 -3
  34. package/lib/components/date/date.component.js +4 -7
  35. package/lib/components/flat-table/sort/sort.component.js +2 -1
  36. package/lib/components/flat-table/sort/sort.style.js +0 -1
  37. package/lib/components/help/help.component.d.ts +43 -0
  38. package/lib/components/help/help.component.js +194 -87
  39. package/lib/components/help/help.config.d.ts +1 -0
  40. package/lib/components/help/help.style.d.ts +4 -1
  41. package/lib/components/help/index.d.ts +2 -1
  42. package/lib/components/inline-inputs/inline-inputs.component.d.ts +5 -9
  43. package/lib/components/inline-inputs/inline-inputs.component.js +15 -2
  44. package/lib/components/inline-inputs/inline-inputs.style.d.ts +18 -3
  45. package/lib/components/inline-inputs/inline-inputs.style.js +6 -2
  46. package/lib/components/menu/__internal__/submenu/submenu.component.js +4 -6
  47. package/lib/components/multi-action-button/multi-action-button.component.js +5 -13
  48. package/lib/components/popover-container/popover-container.component.d.ts +1 -1
  49. package/lib/components/popover-container/popover-container.component.js +5 -9
  50. package/lib/components/split-button/split-button.component.js +5 -11
  51. package/lib/hooks/__internal__/useClickAwayListener/index.d.ts +1 -0
  52. package/lib/{__internal__/click-away-wrapper → hooks/__internal__/useClickAwayListener}/index.js +2 -2
  53. package/lib/hooks/__internal__/useClickAwayListener/package.json +6 -0
  54. package/lib/hooks/__internal__/useClickAwayListener/useClickAwayListener.d.ts +3 -0
  55. package/lib/hooks/__internal__/useClickAwayListener/useClickAwayListener.js +33 -0
  56. package/package.json +1 -1
  57. package/esm/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +0 -12
  58. package/esm/__internal__/click-away-wrapper/click-away-wrapper.component.js +0 -43
  59. package/esm/__internal__/click-away-wrapper/index.d.ts +0 -2
  60. package/esm/__internal__/click-away-wrapper/index.js +0 -1
  61. package/esm/components/help/help.d.ts +0 -41
  62. package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.d.ts +0 -12
  63. package/lib/__internal__/click-away-wrapper/click-away-wrapper.component.js +0 -59
  64. package/lib/__internal__/click-away-wrapper/index.d.ts +0 -2
  65. package/lib/__internal__/click-away-wrapper/package.json +0 -6
  66. package/lib/components/help/help.d.ts +0 -41
@@ -109,12 +109,6 @@ const FocusTrap = ({
109
109
  setCurrentFocusedElement(element);
110
110
  }
111
111
  }, [focusableElements]);
112
- useEffect(() => {
113
- document.addEventListener("focusin", updateCurrentFocusedElement);
114
- return () => {
115
- document.removeEventListener("focusin", updateCurrentFocusedElement);
116
- };
117
- }, [updateCurrentFocusedElement]);
118
112
  const refocusTrap = useCallback(() => {
119
113
  var _wrapperRef$current;
120
114
 
@@ -148,13 +142,16 @@ const FocusTrap = ({
148
142
  }
149
143
  };
150
144
 
151
- const focusProps = {
152
- tabIndex,
153
- onBlur
154
- }; // passes focusProps if no tabindex has been explicitly set on the wrapper
145
+ const focusProps = hasNoTabIndex => ({ ...(hasNoTabIndex && {
146
+ tabIndex,
147
+ onBlur
148
+ }),
149
+ onFocus: updateCurrentFocusedElement
150
+ }); // passes focusProps, sets tabIndex and onBlur if no tabIndex has been expicitly set on child
151
+
155
152
 
156
153
  const clonedChildren = React.Children.map(children, child => {
157
- return child.props.tabIndex === undefined ? /*#__PURE__*/React.cloneElement(child, focusProps) : child;
154
+ return /*#__PURE__*/React.cloneElement(child, focusProps(child.props.tabIndex === undefined));
158
155
  });
159
156
  return /*#__PURE__*/React.createElement("div", {
160
157
  ref: trapRef
@@ -10,7 +10,7 @@ export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLab
10
10
  /** Icon type */
11
11
  helpIcon?: IconType;
12
12
  /** Overrides the default tabindex of the Help component */
13
- helpTabIndex?: string;
13
+ helpTabIndex?: number | string;
14
14
  /** A string that represents the ID of another form element */
15
15
  htmlFor?: string;
16
16
  /** The unique id of the label element */
@@ -98,7 +98,7 @@ const Label = ({
98
98
 
99
99
  return help && /*#__PURE__*/React.createElement(StyledIconWrapper, wrapperProps, /*#__PURE__*/React.createElement(Help, {
100
100
  tooltipId: tooltipId,
101
- tabIndex: helpTabIndex,
101
+ tabIndex: Number(helpTabIndex),
102
102
  type: helpIcon,
103
103
  isFocused: isFocused
104
104
  }, help));
@@ -129,7 +129,7 @@ Label.propTypes = {
129
129
  "error": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
130
130
  "help": PropTypes.node,
131
131
  "helpIcon": PropTypes.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
132
- "helpTabIndex": PropTypes.string,
132
+ "helpTabIndex": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
133
133
  "htmlFor": PropTypes.string,
134
134
  "info": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
135
135
  "inline": PropTypes.bool,
@@ -14,7 +14,6 @@ export const CheckboxGroupContext = /*#__PURE__*/React.createContext({});
14
14
  const CheckboxGroup = props => {
15
15
  const {
16
16
  children,
17
- groupName,
18
17
  legend,
19
18
  error,
20
19
  warning,
@@ -45,7 +44,6 @@ const CheckboxGroup = props => {
45
44
  legendInline: legendInline
46
45
  }, /*#__PURE__*/React.createElement(CheckboxGroupContext.Provider, {
47
46
  value: {
48
- inputName: groupName,
49
47
  error: !!error,
50
48
  warning: !!warning,
51
49
  info: !!info
@@ -75,9 +73,6 @@ CheckboxGroup.propTypes = {
75
73
  /** The Checkboxes to be rendered in the group */
76
74
  children: PropTypes.node.isRequired,
77
75
 
78
- /** Specifies the name prop to be applied to each button in the group */
79
- groupName: PropTypes.string.isRequired,
80
-
81
76
  /** Indicate that error has occurred
82
77
  Pass string to display icon, tooltip and red border
83
78
  Pass true boolean to only display red border */
@@ -15,8 +15,6 @@ interface CheckboxGroupProps extends ValidationProps, MarginProps {
15
15
  legendSpacing?: 1 | 2;
16
16
  /** The Checkboxes to be rendered in the group */
17
17
  children: React.ReactNode;
18
- /** Specifies the name prop to be applied to each button in the group */
19
- groupName: string;
20
18
  /** Spacing between label and a field for inline label, given number will be multiplied by base spacing unit (8) */
21
19
  labelSpacing?: 1 | 2;
22
20
  /** Flag to configure component as mandatory */
@@ -51,8 +51,7 @@ const Checkbox = ({
51
51
  const {
52
52
  error: contextError,
53
53
  warning: contextWarning,
54
- info: contextInfo,
55
- inputName
54
+ info: contextInfo
56
55
  } = useContext(CheckboxGroupContext);
57
56
  const inputProps = {
58
57
  onClick,
@@ -80,7 +79,6 @@ const Checkbox = ({
80
79
  inputWidth,
81
80
  labelWidth,
82
81
  tooltipPosition,
83
- inputName,
84
82
  ...props
85
83
  };
86
84
  return /*#__PURE__*/React.createElement(TooltipProvider, {
@@ -12,7 +12,7 @@ import StyledDateInput from "./date.style";
12
12
  import Textbox from "../textbox";
13
13
  import DatePicker from "./__internal__/date-picker";
14
14
  import DateRangeContext from "../date-range/date-range.context";
15
- import ClickAwayWrapper from "../../__internal__/click-away-wrapper";
15
+ import useClickAwayListener from "../../hooks/__internal__/useClickAwayListener";
16
16
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
17
17
 
18
18
  const DateInput = ({
@@ -277,11 +277,8 @@ const DateInput = ({
277
277
  }
278
278
  };
279
279
 
280
- return /*#__PURE__*/React.createElement(ClickAwayWrapper, {
281
- handleClickAway: handleClickAway,
282
- eventTypeId: "mousedown",
283
- targets: [parentRef, pickerRef]
284
- }, /*#__PURE__*/React.createElement(StyledDateInput, _extends({
280
+ useClickAwayListener([parentRef, pickerRef], handleClickAway, "mousedown");
281
+ return /*#__PURE__*/React.createElement(StyledDateInput, _extends({
285
282
  ref: wrapperRef,
286
283
  role: "presentation",
287
284
  size: size,
@@ -321,7 +318,7 @@ const DateInput = ({
321
318
  ref: pickerRef,
322
319
  pickerMouseDown: handlePickerMouseDown,
323
320
  open: open
324
- })));
321
+ }));
325
322
  };
326
323
 
327
324
  DateInput.propTypes = { ...Textbox.propTypes,
@@ -33,7 +33,8 @@ const Sort = ({
33
33
  sortType: sortType,
34
34
  "aria-labelledby": id.current
35
35
  }, children, sortType && /*#__PURE__*/React.createElement(Icon, {
36
- type: sortType === "ascending" ? "sort_up" : "sort_down"
36
+ type: sortType === "ascending" ? "sort_up" : "sort_down",
37
+ color: "--colorsUtilityMajor200"
37
38
  })), !sortType && /*#__PURE__*/React.createElement(StyledSpaceHolder, null));
38
39
  };
39
40
 
@@ -12,7 +12,6 @@ const StyledSort = styled.div`
12
12
  width: 16px;
13
13
  height: 16px;
14
14
  padding-left: 6px;
15
- color: var(--colorsUtilityMajor200);
16
15
  }
17
16
 
18
17
  :hover {
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import { MarginProps } from "styled-system";
3
+ import { IconType } from "../icon";
4
+ import { TooltipPositions } from "../tooltip/tooltip.config";
5
+ export interface HelpProps extends MarginProps {
6
+ /** Overrides the default 'as' attribute of the Help component */
7
+ as?: keyof JSX.IntrinsicElements;
8
+ /** Aria label */
9
+ ariaLabel?: string;
10
+ /** The message to be displayed within the tooltip */
11
+ children?: React.ReactNode;
12
+ /** [Legacy] A custom class name for the component. */
13
+ className?: string;
14
+ /** The unique id of the component (used with aria-describedby for accessibility) */
15
+ helpId?: string;
16
+ /** A path for the anchor */
17
+ href?: string;
18
+ /** A boolean received from IconWrapper */
19
+ isFocused?: boolean;
20
+ /** Overrides the default tabindex of the component */
21
+ tabIndex?: number;
22
+ /** Override background color of the Tooltip, provide any color from palette or any valid css color value. */
23
+ tooltipBgColor?: string;
24
+ /** Override font color of the Tooltip, provide any color from palette or any valid css color value. */
25
+ tooltipFontColor?: string;
26
+ /** Overrides the default flip behaviour of the Tooltip,
27
+ * must be an array containing some or all of ["top", "bottom", "left", "right"]
28
+ * (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
29
+ */
30
+ tooltipFlipOverrides?: TooltipPositions[];
31
+ /** Id passed to the tooltip container, used for accessibility purposes */
32
+ tooltipId?: string;
33
+ /** Position of tooltip relative to target */
34
+ tooltipPosition?: TooltipPositions;
35
+ /** Help Icon type */
36
+ type?: IconType;
37
+ [key: string]: any;
38
+ }
39
+ export declare const Help: {
40
+ ({ as, ariaLabel, children, className, href, helpId, isFocused, tabIndex, tooltipBgColor, tooltipFontColor, tooltipFlipOverrides, tooltipId, tooltipPosition, type, ...rest }: HelpProps): JSX.Element;
41
+ displayName: string;
42
+ };
43
+ export default Help;
@@ -1,33 +1,30 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- import React, { useContext, useEffect, useState, useRef } from "react";
3
+ import React, { useContext, useEffect, useRef, useState } from "react";
4
4
  import PropTypes from "prop-types";
5
- import styledSystemPropTypes from "@styled-system/prop-types";
6
5
  import Icon from "../icon";
7
6
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
8
7
  import StyledHelp from "./help.style";
9
8
  import Events from "../../__internal__/utils/helpers/events";
10
9
  import { TooltipContext } from "../../__internal__/tooltip-provider";
11
10
  import { filterStyledSystemMarginProps } from "../../style/utils";
12
- import { HELP_POSITIONS } from "./help.config";
13
11
  import guid from "../../__internal__/utils/helpers/guid";
14
- const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
15
12
 
16
13
  const Help = ({
14
+ as,
15
+ ariaLabel = "help",
16
+ children,
17
17
  className,
18
18
  href,
19
19
  helpId,
20
- children,
21
- tabIndex,
22
- as,
23
- tooltipPosition,
24
20
  isFocused,
25
- type,
26
- tooltipId,
21
+ tabIndex = 0,
27
22
  tooltipBgColor,
28
23
  tooltipFontColor,
29
24
  tooltipFlipOverrides,
30
- ariaLabel = "help",
25
+ tooltipId,
26
+ tooltipPosition = "top",
27
+ type = "help",
31
28
  ...rest
32
29
  }) => {
33
30
  const defaultTooltipId = useRef(guid());
@@ -37,23 +34,25 @@ const Help = ({
37
34
  helpAriaLabel
38
35
  } = useContext(TooltipContext);
39
36
  useEffect(() => {
37
+ function handleKeyPress(ev) {
38
+ if (Events.isEscKey(ev)) {
39
+ var _helpElement$current;
40
+
41
+ helpElement === null || helpElement === void 0 ? void 0 : (_helpElement$current = helpElement.current) === null || _helpElement$current === void 0 ? void 0 : _helpElement$current.blur();
42
+ updateTooltipVisible(false);
43
+ }
44
+ }
45
+
40
46
  document.addEventListener("keydown", handleKeyPress);
41
47
  return function cleanup() {
42
48
  document.removeEventListener("keydown", handleKeyPress);
43
49
  };
44
50
  });
45
- const tagType = as || href && "a";
46
-
47
- function handleKeyPress(ev) {
48
- if (Events.isEscKey(ev)) {
49
- helpElement.current.blur();
50
- updateTooltipVisible(false);
51
- }
52
- }
51
+ const tagType = as || href && "a" || "div";
53
52
 
54
- function handleFocusBlur(bool) {
53
+ function handleFocusBlur(isVisible) {
55
54
  return () => {
56
- updateTooltipVisible(bool);
55
+ updateTooltipVisible(isVisible);
57
56
  };
58
57
  }
59
58
 
@@ -66,7 +65,9 @@ const Help = ({
66
65
  id: helpId,
67
66
  ref: helpElement,
68
67
  onClick: () => {
69
- helpElement.current.focus();
68
+ var _helpElement$current2;
69
+
70
+ helpElement === null || helpElement === void 0 ? void 0 : (_helpElement$current2 = helpElement.current) === null || _helpElement$current2 === void 0 ? void 0 : _helpElement$current2.focus();
70
71
  },
71
72
  onFocus: handleFocusBlur(true),
72
73
  onBlur: handleFocusBlur(false),
@@ -93,67 +94,176 @@ const Help = ({
93
94
  }));
94
95
  };
95
96
 
96
- Help.propTypes = { ...marginPropTypes,
97
-
98
- /** [Legacy] A custom class name for the component. */
99
- className: PropTypes.string,
100
-
101
- /** Message to display in tooltip */
102
- children: PropTypes.node,
103
-
104
- /** The unique id of the component */
105
- helpId: PropTypes.string,
106
-
107
- /** Overrides the default tabindex of the component */
108
- tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
109
-
110
- /** Overrides the default 'as' attribute of the Help component */
111
- as: PropTypes.string,
112
-
113
- /** Position of tooltip relative to target */
114
- tooltipPosition: PropTypes.oneOf(["bottom", "left", "right", "top"]),
115
-
116
- /** A path for the anchor */
117
- href: PropTypes.string,
118
-
119
- /** A boolean received from IconWrapper */
120
- isFocused: PropTypes.bool,
121
-
122
- /** <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
123
- *
124
- * Icon to display, can be received from label component
125
- *
126
- */
127
- type: PropTypes.string,
128
-
129
- /** Override background color of the Tooltip, provide any color from palette or any valid css color value. */
130
- tooltipBgColor: PropTypes.string,
131
-
132
- /** Override font color of the Tooltip, provide any color from palette or any valid css color value. */
133
- tooltipFontColor: PropTypes.string,
134
-
135
- /** Overrides the default flip behaviour of the Tooltip, must be an array containing some or all of ["top", "bottom", "left", "right"] (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements) */
136
- tooltipFlipOverrides: (props, propName, componentName) => {
137
- const prop = props[propName];
138
- const isValid = prop && Array.isArray(prop) && prop.every(placement => HELP_POSITIONS.includes(placement));
139
-
140
- if (!prop || isValid) {
141
- return null;
142
- }
143
-
144
- return new Error( // eslint-disable-next-line max-len
145
- `The \`${propName}\` prop supplied to \`${componentName}\` must be an array containing some or all of ["top", "bottom", "left", "right"].`);
146
- },
147
-
148
- /** Id passed to the tooltip container, used for accessibility purposes. */
149
- tooltipId: PropTypes.string,
150
-
151
- /** Aria label */
152
- ariaLabel: PropTypes.string
153
- };
154
- Help.defaultProps = {
155
- tooltipPosition: "top",
156
- tabIndex: 0,
157
- type: "help"
97
+ Help.propTypes = {
98
+ "ariaLabel": PropTypes.string,
99
+ "as": PropTypes.oneOf(["a", "abbr", "address", "animate", "animateMotion", "animateTransform", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "circle", "cite", "clipPath", "code", "col", "colgroup", "data", "datalist", "dd", "defs", "del", "desc", "details", "dfn", "dialog", "div", "dl", "dt", "ellipse", "em", "embed", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "fieldset", "figcaption", "figure", "filter", "footer", "foreignObject", "form", "g", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "image", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "line", "linearGradient", "link", "main", "map", "mark", "marker", "mask", "menu", "menuitem", "meta", "metadata", "meter", "mpath", "nav", "noindex", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "path", "pattern", "picture", "polygon", "polyline", "pre", "progress", "q", "radialGradient", "rect", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "stop", "strong", "style", "sub", "summary", "sup", "svg", "switch", "symbol", "table", "tbody", "td", "template", "text", "textarea", "textPath", "tfoot", "th", "thead", "time", "title", "tr", "track", "tspan", "u", "ul", "use", "var", "video", "view", "wbr", "webview"]),
100
+ "children": PropTypes.node,
101
+ "className": PropTypes.string,
102
+ "helpId": PropTypes.string,
103
+ "href": PropTypes.string,
104
+ "isFocused": PropTypes.bool,
105
+ "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
106
+ "__@toStringTag": PropTypes.string.isRequired,
107
+ "description": PropTypes.string,
108
+ "toString": PropTypes.func.isRequired,
109
+ "valueOf": PropTypes.func.isRequired
110
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
111
+ "__@toStringTag": PropTypes.string.isRequired,
112
+ "description": PropTypes.string,
113
+ "toString": PropTypes.func.isRequired,
114
+ "valueOf": PropTypes.func.isRequired
115
+ }), PropTypes.string]),
116
+ "margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
117
+ "__@toStringTag": PropTypes.string.isRequired,
118
+ "description": PropTypes.string,
119
+ "toString": PropTypes.func.isRequired,
120
+ "valueOf": PropTypes.func.isRequired
121
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
122
+ "__@toStringTag": PropTypes.string.isRequired,
123
+ "description": PropTypes.string,
124
+ "toString": PropTypes.func.isRequired,
125
+ "valueOf": PropTypes.func.isRequired
126
+ }), PropTypes.string]),
127
+ "marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
128
+ "__@toStringTag": PropTypes.string.isRequired,
129
+ "description": PropTypes.string,
130
+ "toString": PropTypes.func.isRequired,
131
+ "valueOf": PropTypes.func.isRequired
132
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
133
+ "__@toStringTag": PropTypes.string.isRequired,
134
+ "description": PropTypes.string,
135
+ "toString": PropTypes.func.isRequired,
136
+ "valueOf": PropTypes.func.isRequired
137
+ }), PropTypes.string]),
138
+ "marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
139
+ "__@toStringTag": PropTypes.string.isRequired,
140
+ "description": PropTypes.string,
141
+ "toString": PropTypes.func.isRequired,
142
+ "valueOf": PropTypes.func.isRequired
143
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
144
+ "__@toStringTag": PropTypes.string.isRequired,
145
+ "description": PropTypes.string,
146
+ "toString": PropTypes.func.isRequired,
147
+ "valueOf": PropTypes.func.isRequired
148
+ }), PropTypes.string]),
149
+ "marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
150
+ "__@toStringTag": PropTypes.string.isRequired,
151
+ "description": PropTypes.string,
152
+ "toString": PropTypes.func.isRequired,
153
+ "valueOf": PropTypes.func.isRequired
154
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
155
+ "__@toStringTag": PropTypes.string.isRequired,
156
+ "description": PropTypes.string,
157
+ "toString": PropTypes.func.isRequired,
158
+ "valueOf": PropTypes.func.isRequired
159
+ }), PropTypes.string]),
160
+ "marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
161
+ "__@toStringTag": PropTypes.string.isRequired,
162
+ "description": PropTypes.string,
163
+ "toString": PropTypes.func.isRequired,
164
+ "valueOf": PropTypes.func.isRequired
165
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
166
+ "__@toStringTag": PropTypes.string.isRequired,
167
+ "description": PropTypes.string,
168
+ "toString": PropTypes.func.isRequired,
169
+ "valueOf": PropTypes.func.isRequired
170
+ }), PropTypes.string]),
171
+ "marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
172
+ "__@toStringTag": PropTypes.string.isRequired,
173
+ "description": PropTypes.string,
174
+ "toString": PropTypes.func.isRequired,
175
+ "valueOf": PropTypes.func.isRequired
176
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
177
+ "__@toStringTag": PropTypes.string.isRequired,
178
+ "description": PropTypes.string,
179
+ "toString": PropTypes.func.isRequired,
180
+ "valueOf": PropTypes.func.isRequired
181
+ }), PropTypes.string]),
182
+ "marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
183
+ "__@toStringTag": PropTypes.string.isRequired,
184
+ "description": PropTypes.string,
185
+ "toString": PropTypes.func.isRequired,
186
+ "valueOf": PropTypes.func.isRequired
187
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
188
+ "__@toStringTag": PropTypes.string.isRequired,
189
+ "description": PropTypes.string,
190
+ "toString": PropTypes.func.isRequired,
191
+ "valueOf": PropTypes.func.isRequired
192
+ }), PropTypes.string]),
193
+ "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
194
+ "__@toStringTag": PropTypes.string.isRequired,
195
+ "description": PropTypes.string,
196
+ "toString": PropTypes.func.isRequired,
197
+ "valueOf": PropTypes.func.isRequired
198
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
199
+ "__@toStringTag": PropTypes.string.isRequired,
200
+ "description": PropTypes.string,
201
+ "toString": PropTypes.func.isRequired,
202
+ "valueOf": PropTypes.func.isRequired
203
+ }), PropTypes.string]),
204
+ "ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
205
+ "__@toStringTag": PropTypes.string.isRequired,
206
+ "description": PropTypes.string,
207
+ "toString": PropTypes.func.isRequired,
208
+ "valueOf": PropTypes.func.isRequired
209
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
210
+ "__@toStringTag": PropTypes.string.isRequired,
211
+ "description": PropTypes.string,
212
+ "toString": PropTypes.func.isRequired,
213
+ "valueOf": PropTypes.func.isRequired
214
+ }), PropTypes.string]),
215
+ "mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
216
+ "__@toStringTag": PropTypes.string.isRequired,
217
+ "description": PropTypes.string,
218
+ "toString": PropTypes.func.isRequired,
219
+ "valueOf": PropTypes.func.isRequired
220
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
221
+ "__@toStringTag": PropTypes.string.isRequired,
222
+ "description": PropTypes.string,
223
+ "toString": PropTypes.func.isRequired,
224
+ "valueOf": PropTypes.func.isRequired
225
+ }), PropTypes.string]),
226
+ "mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
227
+ "__@toStringTag": PropTypes.string.isRequired,
228
+ "description": PropTypes.string,
229
+ "toString": PropTypes.func.isRequired,
230
+ "valueOf": PropTypes.func.isRequired
231
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
232
+ "__@toStringTag": PropTypes.string.isRequired,
233
+ "description": PropTypes.string,
234
+ "toString": PropTypes.func.isRequired,
235
+ "valueOf": PropTypes.func.isRequired
236
+ }), PropTypes.string]),
237
+ "mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
238
+ "__@toStringTag": PropTypes.string.isRequired,
239
+ "description": PropTypes.string,
240
+ "toString": PropTypes.func.isRequired,
241
+ "valueOf": PropTypes.func.isRequired
242
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
243
+ "__@toStringTag": PropTypes.string.isRequired,
244
+ "description": PropTypes.string,
245
+ "toString": PropTypes.func.isRequired,
246
+ "valueOf": PropTypes.func.isRequired
247
+ }), PropTypes.string]),
248
+ "my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
249
+ "__@toStringTag": PropTypes.string.isRequired,
250
+ "description": PropTypes.string,
251
+ "toString": PropTypes.func.isRequired,
252
+ "valueOf": PropTypes.func.isRequired
253
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
254
+ "__@toStringTag": PropTypes.string.isRequired,
255
+ "description": PropTypes.string,
256
+ "toString": PropTypes.func.isRequired,
257
+ "valueOf": PropTypes.func.isRequired
258
+ }), PropTypes.string]),
259
+ "tabIndex": PropTypes.number,
260
+ "tooltipBgColor": PropTypes.string,
261
+ "tooltipFlipOverrides": PropTypes.arrayOf(PropTypes.oneOf(["bottom", "left", "right", "top"])),
262
+ "tooltipFontColor": PropTypes.string,
263
+ "tooltipId": PropTypes.string,
264
+ "tooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
265
+ "type": PropTypes.oneOf(["add", "admin", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick", "true_tick", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"])
158
266
  };
267
+ export { Help };
268
+ Help.displayName = "Help";
159
269
  export default Help;
@@ -0,0 +1 @@
1
+ export declare const HELP_POSITIONS: string[];
@@ -1,2 +1,5 @@
1
+ interface StyledHelpProps {
2
+ href?: string;
3
+ }
4
+ declare const StyledHelp: import("styled-components").StyledComponent<"div", any, StyledHelpProps, never>;
1
5
  export default StyledHelp;
2
- declare const StyledHelp: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1 +1,2 @@
1
- export { default } from "./help";
1
+ export { default } from "./help.component";
2
+ export type { HelpProps } from "./help.component";
@@ -1,27 +1,23 @@
1
1
  import React from "react";
2
+ import { StyledContentContainerProps, StyledInlineInputsProps } from "./inline-inputs.style";
2
3
  interface InlineInputsContextProps {
3
4
  ariaLabelledBy?: string;
4
5
  }
5
- declare type GutterOptions = "none" | "extra-small" | "small" | "medium-small" | "medium" | "medium-large" | "large" | "extra-large";
6
- export interface InlineInputsProps {
6
+ export interface InlineInputsProps extends StyledContentContainerProps, StyledInlineInputsProps {
7
+ /** Breakpoint for adaptive label (inline label change to top aligned). Enables the adaptive behaviour when set */
8
+ adaptiveLabelBreakpoint?: number;
7
9
  /** Children elements */
8
10
  children?: React.ReactNode;
9
11
  /** [Legacy prop] A custom class name for the component. */
10
12
  className?: string;
11
- /** Gutter prop gets passed down to Row component if false gutter value is "none" */
12
- gutter?: GutterOptions;
13
13
  /** The id of the corresponding input control for the label */
14
14
  htmlFor?: string;
15
- /** Width of the inline inputs container in percentage */
16
- inputWidth?: number;
17
15
  /** Defines the label text for the heading. */
18
16
  label?: string;
19
- /** Width of a label in percentage */
20
- labelWidth?: number;
21
17
  }
22
18
  export declare const InlineInputsContext: React.Context<InlineInputsContextProps>;
23
19
  declare const InlineInputs: {
24
- ({ label, htmlFor, children, className, gutter, inputWidth, labelWidth, }: InlineInputsProps): JSX.Element;
20
+ ({ adaptiveLabelBreakpoint, label, htmlFor, children, className, gutter, inputWidth, labelInline, labelWidth, }: InlineInputsProps): JSX.Element;
25
21
  displayName: string;
26
22
  };
27
23
  export default InlineInputs;