carbon-react 109.5.0 → 109.6.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 (51) 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/button-types.style.js +4 -0
  9. package/esm/components/button-toggle-group/button-toggle-group.component.js +9 -10
  10. package/esm/components/button-toggle-group/button-toggle-group.d.ts +3 -1
  11. package/esm/components/dialog/dialog.d.ts +1 -1
  12. package/esm/components/dialog-full-screen/dialog-full-screen.d.ts +1 -1
  13. package/esm/components/loader/loader-square.style.d.ts +2 -0
  14. package/esm/components/loader/loader.config.d.ts +1 -0
  15. package/esm/components/modal/__internal__/modal-manager.d.ts +19 -6
  16. package/esm/components/modal/__internal__/modal-manager.js +23 -40
  17. package/esm/components/modal/index.d.ts +1 -0
  18. package/esm/components/modal/modal.component.d.ts +44 -33
  19. package/esm/components/modal/modal.component.js +10 -14
  20. package/esm/components/modal/modal.style.d.ts +7 -2
  21. package/esm/components/switch/switch.component.js +0 -3
  22. package/esm/components/switch/switch.d.ts +0 -2
  23. package/esm/components/tabs/tab/tab.d.ts +3 -3
  24. package/lib/__internal__/form-field/form-field.component.d.ts +59 -0
  25. package/lib/__internal__/form-field/form-field.component.js +201 -57
  26. package/lib/__internal__/form-field/form-field.style.d.ts +7 -0
  27. package/lib/__internal__/form-field/form-field.style.js +9 -13
  28. package/lib/__internal__/form-field/index.d.ts +2 -5
  29. package/lib/__internal__/label/label.component.d.ts +2 -4
  30. package/lib/__internal__/label/label.component.js +0 -3
  31. package/lib/components/button/button-types.style.js +5 -0
  32. package/lib/components/button-toggle-group/button-toggle-group.component.js +9 -10
  33. package/lib/components/button-toggle-group/button-toggle-group.d.ts +3 -1
  34. package/lib/components/dialog/dialog.d.ts +1 -1
  35. package/lib/components/dialog-full-screen/dialog-full-screen.d.ts +1 -1
  36. package/lib/components/loader/loader-square.style.d.ts +2 -0
  37. package/lib/components/loader/loader.config.d.ts +1 -0
  38. package/lib/components/modal/__internal__/modal-manager.d.ts +19 -6
  39. package/lib/components/modal/__internal__/modal-manager.js +23 -41
  40. package/lib/components/modal/index.d.ts +1 -0
  41. package/lib/components/modal/modal.component.d.ts +44 -33
  42. package/lib/components/modal/modal.component.js +9 -14
  43. package/lib/components/modal/modal.style.d.ts +7 -2
  44. package/lib/components/switch/switch.component.js +0 -3
  45. package/lib/components/switch/switch.d.ts +0 -2
  46. package/lib/components/tabs/tab/tab.d.ts +3 -3
  47. package/package.json +3 -3
  48. package/esm/__internal__/form-field/form-field.d.ts +0 -66
  49. package/esm/components/modal/modal.d.ts +0 -35
  50. package/lib/__internal__/form-field/form-field.d.ts +0 -66
  51. package/lib/components/modal/modal.d.ts +0 -35
@@ -13,44 +13,27 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
13
13
 
14
14
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
15
 
16
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
17
-
18
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
19
-
20
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
21
-
22
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
23
-
24
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
25
-
26
- function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
27
-
28
- var _modalList = /*#__PURE__*/new WeakMap();
29
-
30
- var _getTopModal = /*#__PURE__*/new WeakSet();
31
-
32
16
  let ModalManagerInstance = /*#__PURE__*/function () {
33
17
  function ModalManagerInstance() {
34
18
  _classCallCheck(this, ModalManagerInstance);
35
19
 
36
- _getTopModal.add(this);
37
-
38
- _modalList.set(this, {
39
- writable: true,
40
- value: void 0
41
- });
20
+ _defineProperty(this, "modalList", void 0);
42
21
 
43
22
  _defineProperty(this, "addModal", (modal, setTriggerRefocusFlag) => {
23
+ if (!modal) {
24
+ return;
25
+ }
26
+
44
27
  const {
45
28
  modal: topModal,
46
29
  setTriggerRefocusFlag: setTrapFlag
47
- } = _classPrivateMethodGet(this, _getTopModal, _getTopModal2).call(this);
30
+ } = this.getTopModal();
48
31
 
49
32
  if (topModal && setTrapFlag) {
50
33
  setTrapFlag(false);
51
34
  }
52
35
 
53
- _classPrivateFieldGet(this, _modalList).push({
36
+ this.modalList.push({
54
37
  modal,
55
38
  setTriggerRefocusFlag
56
39
  });
@@ -62,15 +45,24 @@ let ModalManagerInstance = /*#__PURE__*/function () {
62
45
  window.__CARBON_INTERNALS_MODAL_LIST = [];
63
46
  }
64
47
 
65
- _classPrivateFieldSet(this, _modalList, window.__CARBON_INTERNALS_MODAL_LIST);
48
+ this.modalList = window.__CARBON_INTERNALS_MODAL_LIST;
66
49
  }
67
50
 
68
51
  _createClass(ModalManagerInstance, [{
52
+ key: "getTopModal",
53
+ value: function getTopModal() {
54
+ if (!this.modalList.length) {
55
+ return {};
56
+ }
57
+
58
+ return this.modalList[this.modalList.length - 1];
59
+ }
60
+ }, {
69
61
  key: "isTopmost",
70
62
  value: function isTopmost(modal) {
71
63
  const {
72
64
  modal: topModal
73
- } = _classPrivateMethodGet(this, _getTopModal, _getTopModal2).call(this);
65
+ } = this.getTopModal();
74
66
 
75
67
  if (!modal || !topModal) {
76
68
  return false;
@@ -81,7 +73,7 @@ let ModalManagerInstance = /*#__PURE__*/function () {
81
73
  }, {
82
74
  key: "removeModal",
83
75
  value: function removeModal(modal) {
84
- const modalIndex = _classPrivateFieldGet(this, _modalList).findIndex(({
76
+ const modalIndex = this.modalList.findIndex(({
85
77
  modal: m
86
78
  }) => m === modal);
87
79
 
@@ -89,15 +81,15 @@ let ModalManagerInstance = /*#__PURE__*/function () {
89
81
  return;
90
82
  }
91
83
 
92
- _classPrivateFieldGet(this, _modalList).splice(modalIndex, 1);
84
+ this.modalList.splice(modalIndex, 1);
93
85
 
94
- if (!_classPrivateFieldGet(this, _modalList).length) {
86
+ if (!this.modalList.length) {
95
87
  return;
96
88
  }
97
89
 
98
90
  const {
99
91
  setTriggerRefocusFlag
100
- } = _classPrivateMethodGet(this, _getTopModal, _getTopModal2).call(this);
92
+ } = this.getTopModal();
101
93
 
102
94
  if (setTriggerRefocusFlag) {
103
95
  setTriggerRefocusFlag(true);
@@ -107,8 +99,7 @@ let ModalManagerInstance = /*#__PURE__*/function () {
107
99
  key: "clearList",
108
100
  value: function clearList() {
109
101
  window.__CARBON_INTERNALS_MODAL_LIST = [];
110
-
111
- _classPrivateFieldSet(this, _modalList, window.__CARBON_INTERNALS_MODAL_LIST);
102
+ this.modalList = window.__CARBON_INTERNALS_MODAL_LIST;
112
103
  }
113
104
  }]);
114
105
 
@@ -116,15 +107,6 @@ let ModalManagerInstance = /*#__PURE__*/function () {
116
107
  }();
117
108
 
118
109
  exports.ModalManagerInstance = ModalManagerInstance;
119
-
120
- function _getTopModal2() {
121
- if (!_classPrivateFieldGet(this, _modalList).length) {
122
- return {};
123
- }
124
-
125
- return _classPrivateFieldGet(this, _modalList)[_classPrivateFieldGet(this, _modalList).length - 1];
126
- }
127
-
128
110
  const ModalManager = new ModalManagerInstance();
129
111
  var _default = ModalManager;
130
112
  exports.default = _default;
@@ -1 +1,2 @@
1
1
  export { default, ModalContext } from "./modal.component";
2
+ export type { ModalProps, ModalContextProps } from "./modal.component";
@@ -1,35 +1,46 @@
1
- export const ModalContext: React.Context<{}>;
2
- export default Modal;
3
1
  import React from "react";
4
- declare function Modal({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: {
5
- [x: string]: any;
6
- children: any;
7
- open: any;
8
- onCancel: any;
9
- disableEscKey: any;
10
- disableClose: any;
11
- enableBackgroundUI: any;
12
- timeout: any;
13
- }): JSX.Element;
14
- declare namespace Modal {
15
- namespace propTypes {
16
- const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
17
- const onCancel: PropTypes.Requireable<(...args: any[]) => any>;
18
- const open: PropTypes.Validator<boolean>;
19
- const enableBackgroundUI: PropTypes.Requireable<boolean>;
20
- const disableEscKey: PropTypes.Requireable<boolean>;
21
- const disableClose: PropTypes.Requireable<boolean>;
22
- const timeout: PropTypes.Requireable<number>;
23
- }
24
- namespace defaultProps {
25
- const onCancel_1: null;
26
- export { onCancel_1 as onCancel };
27
- const enableBackgroundUI_1: boolean;
28
- export { enableBackgroundUI_1 as enableBackgroundUI };
29
- const disableEscKey_1: boolean;
30
- export { disableEscKey_1 as disableEscKey };
31
- const timeout_1: number;
32
- export { timeout_1 as timeout };
33
- }
34
- }
35
2
  import PropTypes from "prop-types";
3
+ export interface ModalContextProps {
4
+ isInModal?: boolean;
5
+ isAnimationComplete?: boolean;
6
+ triggerRefocusFlag?: boolean;
7
+ }
8
+ export declare const ModalContext: React.Context<ModalContextProps>;
9
+ export interface ModalProps {
10
+ /** Modal content */
11
+ children?: React.ReactNode;
12
+ /** The ARIA role to be applied to the modal */
13
+ ariaRole?: string;
14
+ /** Determines if the Esc Key closes the modal */
15
+ disableEscKey?: boolean;
16
+ /** Determines if the Dialog can be closed */
17
+ disableClose?: boolean;
18
+ /** Determines if the background is disabled when the modal is open */
19
+ enableBackgroundUI?: boolean;
20
+ /** A custom close event handler */
21
+ onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
22
+ /** Sets the open state of the modal */
23
+ open: boolean;
24
+ /** Transition time */
25
+ timeout?: number;
26
+ }
27
+ declare const Modal: {
28
+ ({ children, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, timeout, ...rest }: ModalProps): JSX.Element;
29
+ propTypes: {
30
+ /** Modal content */
31
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
32
+ /** A custom close event handler */
33
+ onCancel: PropTypes.Requireable<(...args: any[]) => any>;
34
+ /** Controls the open state of the modal */
35
+ open: PropTypes.Validator<boolean>;
36
+ /** Determines if the background is disabled when the modal is open */
37
+ enableBackgroundUI: PropTypes.Requireable<boolean>;
38
+ /** Determines if the Esc Key closes the modal */
39
+ disableEscKey: PropTypes.Requireable<boolean>;
40
+ /** Determines if the Dialog can be closed */
41
+ disableClose: PropTypes.Requireable<boolean>;
42
+ /** Transition time */
43
+ timeout: PropTypes.Requireable<number>;
44
+ };
45
+ };
46
+ export default Modal;
@@ -37,15 +37,15 @@ const Modal = ({
37
37
  children,
38
38
  open,
39
39
  onCancel,
40
- disableEscKey,
40
+ disableEscKey = false,
41
41
  disableClose,
42
- enableBackgroundUI,
43
- timeout,
42
+ enableBackgroundUI = false,
43
+ timeout = 300,
44
44
  ...rest
45
45
  }) => {
46
- const ref = (0, _react.useRef)();
47
- const backgroundNodeRef = (0, _react.useRef)();
48
- const contentNodeRef = (0, _react.useRef)();
46
+ const ref = (0, _react.useRef)(null);
47
+ const backgroundNodeRef = (0, _react.useRef)(null);
48
+ const contentNodeRef = (0, _react.useRef)(null);
49
49
  const [isAnimationComplete, setAnimationComplete] = (0, _react.useState)(false);
50
50
  const [triggerRefocusFlag, setTriggerRefocusFlag] = (0, _react.useState)(false);
51
51
  const {
@@ -113,9 +113,10 @@ const Modal = ({
113
113
  isAnimationComplete,
114
114
  triggerRefocusFlag,
115
115
  isInModal: true
116
- },
116
+ }
117
+ }, /*#__PURE__*/_react.default.createElement("div", {
117
118
  ref: contentNodeRef
118
- }, content)))));
119
+ }, content))))));
119
120
  };
120
121
 
121
122
  Modal.propTypes = {
@@ -140,11 +141,5 @@ Modal.propTypes = {
140
141
  /** Transition time */
141
142
  timeout: _propTypes.default.number
142
143
  };
143
- Modal.defaultProps = {
144
- onCancel: null,
145
- enableBackgroundUI: false,
146
- disableEscKey: false,
147
- timeout: 300
148
- };
149
144
  var _default = Modal;
150
145
  exports.default = _default;
@@ -1,2 +1,7 @@
1
- export const StyledModal: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export const StyledModalBackground: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ declare type TransitionProps = {
2
+ transitionName: string;
3
+ transitionTime: number;
4
+ };
5
+ declare const StyledModalBackground: import("styled-components").StyledComponent<"div", any, TransitionProps, never>;
6
+ declare const StyledModal: import("styled-components").StyledComponent<"div", any, TransitionProps, never>;
7
+ export { StyledModal, StyledModalBackground };
@@ -207,9 +207,6 @@ Switch.propTypes = {
207
207
  /** When true, validation icon will be placed on label instead of being placed by the input */
208
208
  validationOnLabel: _propTypes.default.bool,
209
209
 
210
- /** Override tab index on the validation and help icon */
211
- helpTabIndex: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
212
-
213
210
  /** Triggers loading animation */
214
211
  loading: _propTypes.default.bool,
215
212
 
@@ -15,8 +15,6 @@ export interface SwitchProps extends CommonCheckableInputProps, MarginProps {
15
15
  adaptiveLabelBreakpoint?: number;
16
16
  /** Set the default value of the Switch if component is meant to be used as uncontrolled */
17
17
  defaultChecked?: boolean;
18
- /** Overrides the default tabindex of the Help component */
19
- helpTabIndex?: number | string;
20
18
  /** Text alignment of the label */
21
19
  labelAlign?: LabelAlign;
22
20
  /** When true label is inline */
@@ -2,9 +2,9 @@ import * as React from "react";
2
2
  import { PaddingProps } from "styled-system";
3
3
 
4
4
  export interface TabContextProps {
5
- setError: (childId: string, hasError: boolean) => void;
6
- setWarning: (childId: string, hasWarning: boolean) => void;
7
- setInfo: (childId: string, hasInfo: boolean) => void;
5
+ setError?: (childId: string, hasError: boolean) => void;
6
+ setWarning?: (childId: string, hasWarning: boolean) => void;
7
+ setInfo?: (childId: string, hasInfo: boolean) => void;
8
8
  }
9
9
 
10
10
  export interface TabProps extends PaddingProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "109.5.0",
3
+ "version": "109.6.0",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -98,7 +98,7 @@
98
98
  "@types/react-dom": "^17.0.2",
99
99
  "@types/react-is": "^17.0.3",
100
100
  "@types/react-test-renderer": "^17.0.1",
101
- "@types/react-transition-group": "^4.4.4",
101
+ "@types/react-transition-group": "^4.4.5",
102
102
  "@types/sprintf-js": "^1.1.2",
103
103
  "@types/styled-components": "^5.1.9",
104
104
  "@types/uuid": "^8.3.3",
@@ -192,7 +192,7 @@
192
192
  "react-dnd": "^15.1.1",
193
193
  "react-dnd-html5-backend": "^15.1.2",
194
194
  "react-is": "^17.0.2",
195
- "react-transition-group": "^4.4.1",
195
+ "react-transition-group": "^4.4.2",
196
196
  "styled-system": "^5.1.5",
197
197
  "wait-on": "^5.2.1"
198
198
  },
@@ -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;
@@ -1,35 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ModalContextProps {
4
- value?: {
5
- isInModal?: boolean;
6
- isAnimationComplete?: boolean;
7
- triggerRefocusFlag?: boolean;
8
- };
9
- ref?: React.MutableRefObject<React.ReactNode>;
10
- }
11
-
12
- export interface ModalProps {
13
- /** Modal content */
14
- children?: React.ReactNode;
15
- /** The ARIA role to be applied to the modal */
16
- ariaRole?: string;
17
- /** Determines if the Esc Key closes the modal */
18
- disableEscKey?: boolean;
19
- /** Determines if the Dialog can be closed */
20
- disableClose?: boolean;
21
- /** Determines if the background is disabled when the modal is open */
22
- enableBackgroundUI?: boolean;
23
- /** A custom close event handler */
24
- onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
25
- /** Sets the open state of the modal */
26
- open: boolean;
27
- /** Transition time */
28
- timeout?: number;
29
- }
30
-
31
- declare const ModelContext: React.Context<ModalContextProps>;
32
- declare function Modal(props: ModalProps): JSX.Element;
33
-
34
- export { ModalContext };
35
- export default Modal;
@@ -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;
@@ -1,35 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface ModalContextProps {
4
- value?: {
5
- isInModal?: boolean;
6
- isAnimationComplete?: boolean;
7
- triggerRefocusFlag?: boolean;
8
- };
9
- ref?: React.MutableRefObject<React.ReactNode>;
10
- }
11
-
12
- export interface ModalProps {
13
- /** Modal content */
14
- children?: React.ReactNode;
15
- /** The ARIA role to be applied to the modal */
16
- ariaRole?: string;
17
- /** Determines if the Esc Key closes the modal */
18
- disableEscKey?: boolean;
19
- /** Determines if the Dialog can be closed */
20
- disableClose?: boolean;
21
- /** Determines if the background is disabled when the modal is open */
22
- enableBackgroundUI?: boolean;
23
- /** A custom close event handler */
24
- onCancel?: (ev: React.KeyboardEvent<HTMLElement>) => void;
25
- /** Sets the open state of the modal */
26
- open: boolean;
27
- /** Transition time */
28
- timeout?: number;
29
- }
30
-
31
- declare const ModelContext: React.Context<ModalContextProps>;
32
- declare function Modal(props: ModalProps): JSX.Element;
33
-
34
- export { ModalContext };
35
- export default Modal;