carbon-react 106.2.2 → 106.3.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 (73) hide show
  1. package/esm/__internal__/input/input-presentation.component.js +13 -0
  2. package/esm/__internal__/input/input.component.js +294 -0
  3. package/esm/__internal__/input-behaviour/input-behaviour.component.js +4 -0
  4. package/esm/__internal__/input-behaviour/input-group-behaviour.component.js +5 -0
  5. package/esm/__internal__/validation-message/validation-message.component.js +5 -0
  6. package/esm/__internal__/validations/validation-icon.component.js +41 -1
  7. package/esm/components/alert/alert.component.js +38 -252
  8. package/esm/components/alert/index.d.ts +1 -0
  9. package/esm/components/badge/badge.component.js +20 -60
  10. package/esm/components/button/button.component.js +760 -3310
  11. package/esm/components/carbon-provider/carbon-provider.component.js +48 -106
  12. package/esm/components/date/__internal__/utils.js +1 -1
  13. package/esm/components/date/date.component.js +3 -1
  14. package/esm/components/heading/heading.style.d.ts +2 -2
  15. package/esm/components/hr/hr.component.js +171 -1305
  16. package/esm/components/hr/index.d.ts +1 -0
  17. package/esm/components/inline-inputs/inline-inputs.component.js +35 -90
  18. package/esm/components/link/index.d.ts +1 -0
  19. package/esm/components/link/link.component.js +123 -1228
  20. package/esm/components/navigation-bar/index.d.ts +1 -0
  21. package/esm/components/navigation-bar/navigation-bar.component.js +1018 -10761
  22. package/esm/components/pager/pager.style.d.ts +1 -1
  23. package/esm/components/pod/pod.style.d.ts +1 -1
  24. package/esm/components/progress-tracker/progress-tracker.component.d.ts +4 -1
  25. package/esm/components/progress-tracker/progress-tracker.component.js +25 -2
  26. package/esm/components/progress-tracker/progress-tracker.config.d.ts +0 -1
  27. package/esm/components/progress-tracker/progress-tracker.config.js +1 -1
  28. package/esm/components/progress-tracker/progress-tracker.d.ts +5 -3
  29. package/esm/components/progress-tracker/progress-tracker.style.js +9 -7
  30. package/esm/components/radio-button/radio-button-svg.component.js +16 -29
  31. package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  32. package/esm/components/tooltip/tooltip.component.js +85 -254
  33. package/esm/components/vertical-divider/index.d.ts +1 -0
  34. package/esm/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  35. package/esm/components/vertical-divider/vertical-divider.component.js +328 -1406
  36. package/esm/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  37. package/lib/__internal__/input/input-presentation.component.js +16 -0
  38. package/lib/__internal__/input/input.component.js +295 -0
  39. package/lib/__internal__/input-behaviour/input-behaviour.component.js +6 -1
  40. package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +7 -1
  41. package/lib/__internal__/validation-message/validation-message.component.js +6 -0
  42. package/lib/__internal__/validations/validation-icon.component.js +39 -0
  43. package/lib/components/alert/alert.component.js +42 -143
  44. package/lib/components/alert/index.d.ts +1 -0
  45. package/lib/components/badge/badge.component.js +24 -50
  46. package/lib/components/button/button.component.js +768 -3378
  47. package/lib/components/carbon-provider/carbon-provider.component.js +54 -110
  48. package/lib/components/date/__internal__/utils.js +1 -1
  49. package/lib/components/date/date.component.js +3 -1
  50. package/lib/components/heading/heading.style.d.ts +2 -2
  51. package/lib/components/hr/hr.component.js +175 -676
  52. package/lib/components/hr/index.d.ts +1 -0
  53. package/lib/components/inline-inputs/inline-inputs.component.js +43 -137
  54. package/lib/components/link/index.d.ts +1 -0
  55. package/lib/components/link/link.component.js +142 -746
  56. package/lib/components/navigation-bar/index.d.ts +1 -0
  57. package/lib/components/navigation-bar/navigation-bar.component.js +1022 -5426
  58. package/lib/components/pager/pager.style.d.ts +1 -1
  59. package/lib/components/pod/pod.style.d.ts +1 -1
  60. package/lib/components/progress-tracker/progress-tracker.component.d.ts +4 -1
  61. package/lib/components/progress-tracker/progress-tracker.component.js +30 -2
  62. package/lib/components/progress-tracker/progress-tracker.config.d.ts +0 -1
  63. package/lib/components/progress-tracker/progress-tracker.config.js +3 -3
  64. package/lib/components/progress-tracker/progress-tracker.d.ts +5 -3
  65. package/lib/components/progress-tracker/progress-tracker.style.js +8 -6
  66. package/lib/components/radio-button/radio-button-svg.component.js +20 -38
  67. package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  68. package/lib/components/tooltip/tooltip.component.js +98 -215
  69. package/lib/components/vertical-divider/index.d.ts +1 -0
  70. package/lib/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  71. package/lib/components/vertical-divider/vertical-divider.component.js +334 -1457
  72. package/lib/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  73. package/package.json +4 -3
@@ -1,268 +1,54 @@
1
- function _extends() {
2
- _extends =
3
- Object.assign ||
4
- function (target) {
5
- for (var i = 1; i < arguments.length; i++) {
6
- var source = arguments[i];
7
- for (var key in source) {
8
- if (Object.prototype.hasOwnProperty.call(source, key)) {
9
- target[key] = source[key];
10
- }
11
- }
12
- }
13
- return target;
14
- };
15
- return _extends.apply(this, arguments);
16
- }
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); }
17
2
 
18
3
  import React from "react";
19
4
  import PropTypes from "prop-types";
20
5
  import Dialog from "../dialog";
21
- const Alert = ({ children, size = "extra-small", ...rest }) =>
22
- /*#__PURE__*/ React.createElement(
23
- Dialog,
24
- _extends(
25
- {
26
- "data-component": "alert",
27
- role: "alertdialog",
28
- size: size,
29
- },
30
- rest
31
- ),
32
- children
33
- );
34
6
 
35
- Alert.propTypes = {
36
- /**
37
- * Prop to specify the aria-describedby property of the Dialog component
38
- */
39
- "aria-describedby": PropTypes.string,
40
- /**
41
- * Prop to specify the aria-label of the Dialog component.
42
- * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
43
- */
44
- "aria-label": PropTypes.string,
45
- /**
46
- * Prop to specify the aria-labelledby property of the Dialog component
47
- * To be used when the title prop is a custom React Node,
48
- * or the component is labelled by an internal element other than the title.
49
- */
50
- "aria-labelledby": PropTypes.string,
51
- /**
52
- * The ARIA role to be applied to the modal
53
- */
54
- ariaRole: PropTypes.string,
55
- /**
56
- * Modal content
57
- */
58
- children: PropTypes.node,
59
- /**
60
- * Padding to be set on the Dialog content
61
- */
62
- contentPadding: PropTypes.shape({
63
- p: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
64
- px: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
65
- py: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
66
- }),
67
- disableAutoFocus: PropTypes.bool,
68
- /**
69
- * Determines if the Dialog can be closed
70
- */
71
- disableClose: PropTypes.bool,
72
- /**
73
- * Determines if the Esc Key closes the modal
74
- */
75
- disableEscKey: PropTypes.bool,
76
- disableFocusTrap: PropTypes.bool,
77
- /**
78
- * Determines if the background is disabled when the modal is open
79
- */
80
- enableBackgroundUI: PropTypes.bool,
81
- /**
82
- * Optional reference to an element meant to be focused on open
83
- */
84
- focusFirstElement: PropTypes.shape({
85
- current: function (props, propName) {
86
- if (props[propName] == null) {
87
- return new Error(
88
- "Prop '" + propName + "' is required but wasn't specified"
89
- );
90
- } else if (
91
- typeof props[propName] !== "object" ||
92
- props[propName].nodeType !== 1
93
- ) {
94
- return new Error(
95
- "Expected prop '" + propName + "' to be of type Element"
96
- );
97
- }
98
- },
99
- }),
100
- /**
101
- * Allows developers to specify a specific height for the dialog.
102
- */
103
- height: PropTypes.string,
104
- /**
105
- * Adds Help tooltip to Header
106
- */
107
- help: PropTypes.string,
108
- /**
109
- * A custom close event handler
110
- */
111
- onCancel: PropTypes.func,
112
- /**
113
- * Sets the open state of the modal
114
- */
115
- open: PropTypes.bool.isRequired,
116
- /**
117
- * The ARIA role to be applied to the Dialog container
118
- */
119
- role: PropTypes.string,
120
- /**
121
- * Determines if the close icon is shown
122
- */
123
- showCloseIcon: PropTypes.bool,
124
- /**
125
- * Size of dialog, default size is 750px
126
- */
127
- size: PropTypes.oneOf([
128
- "auto",
129
- "extra-large",
130
- "extra-small",
131
- "large",
132
- "medium-large",
133
- "medium-small",
134
- "medium",
135
- "small",
136
- ]),
137
- /**
138
- * Subtitle displayed at top of dialog
139
- */
140
- subtitle: PropTypes.string,
141
- /**
142
- * Transition time
143
- */
144
- timeout: PropTypes.number,
145
- /**
146
- * Title displayed at top of dialog
147
- */
148
- title: PropTypes.node,
149
- };
7
+ const Alert = ({
8
+ children,
9
+ size = "extra-small",
10
+ ...rest
11
+ }) => /*#__PURE__*/React.createElement(Dialog, _extends({
12
+ "data-component": "alert",
13
+ role: "alertdialog",
14
+ size: size
15
+ }, rest), children);
150
16
 
151
17
  Alert.propTypes = {
152
- /**
153
- * Prop to specify the aria-describedby property of the Dialog component
154
- */
155
18
  "aria-describedby": PropTypes.string,
156
- /**
157
- * Prop to specify the aria-label of the Dialog component.
158
- * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
159
- */
160
19
  "aria-label": PropTypes.string,
161
- /**
162
- * Prop to specify the aria-labelledby property of the Dialog component
163
- * To be used when the title prop is a custom React Node,
164
- * or the component is labelled by an internal element other than the title.
165
- */
166
20
  "aria-labelledby": PropTypes.string,
167
- /**
168
- * The ARIA role to be applied to the modal
169
- */
170
- ariaRole: PropTypes.string,
171
- /**
172
- * Modal content
173
- */
174
- children: PropTypes.node,
175
- /**
176
- * Padding to be set on the Dialog content
177
- */
178
- contentPadding: PropTypes.shape({
179
- p: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
180
- px: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
181
- py: PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
21
+ "ariaRole": PropTypes.string,
22
+ "children": PropTypes.node,
23
+ "contentPadding": PropTypes.shape({
24
+ "p": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
25
+ "px": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8]),
26
+ "py": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7, 8])
182
27
  }),
183
- disableAutoFocus: PropTypes.bool,
184
- /**
185
- * Determines if the Dialog can be closed
186
- */
187
- disableClose: PropTypes.bool,
188
- /**
189
- * Determines if the Esc Key closes the modal
190
- */
191
- disableEscKey: PropTypes.bool,
192
- disableFocusTrap: PropTypes.bool,
193
- /**
194
- * Determines if the background is disabled when the modal is open
195
- */
196
- enableBackgroundUI: PropTypes.bool,
197
- /**
198
- * Optional reference to an element meant to be focused on open
199
- */
200
- focusFirstElement: PropTypes.shape({
201
- current: function (props, propName) {
28
+ "disableAutoFocus": PropTypes.bool,
29
+ "disableClose": PropTypes.bool,
30
+ "disableEscKey": PropTypes.bool,
31
+ "disableFocusTrap": PropTypes.bool,
32
+ "enableBackgroundUI": PropTypes.bool,
33
+ "focusFirstElement": PropTypes.shape({
34
+ "current": function (props, propName) {
202
35
  if (props[propName] == null) {
203
- return new Error(
204
- "Prop '" + propName + "' is required but wasn't specified"
205
- );
206
- } else if (
207
- typeof props[propName] !== "object" ||
208
- props[propName].nodeType !== 1
209
- ) {
210
- return new Error(
211
- "Expected prop '" + propName + "' to be of type Element"
212
- );
36
+ return new Error("Prop '" + propName + "' is required but wasn't specified");
37
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
38
+ return new Error("Expected prop '" + propName + "' to be of type Element");
213
39
  }
214
- },
40
+ }
215
41
  }),
216
- /**
217
- * Allows developers to specify a specific height for the dialog.
218
- */
219
- height: PropTypes.string,
220
- /**
221
- * Adds Help tooltip to Header
222
- */
223
- help: PropTypes.string,
224
- /**
225
- * A custom close event handler
226
- */
227
- onCancel: PropTypes.func,
228
- /**
229
- * Sets the open state of the modal
230
- */
231
- open: PropTypes.bool.isRequired,
232
- /**
233
- * The ARIA role to be applied to the Dialog container
234
- */
235
- role: PropTypes.string,
236
- /**
237
- * Determines if the close icon is shown
238
- */
239
- showCloseIcon: PropTypes.bool,
240
- /**
241
- * Size of dialog, default size is 750px
242
- */
243
- size: PropTypes.oneOf([
244
- "auto",
245
- "extra-large",
246
- "extra-small",
247
- "large",
248
- "medium-large",
249
- "medium-small",
250
- "medium",
251
- "small",
252
- ]),
253
- /**
254
- * Subtitle displayed at top of dialog
255
- */
256
- subtitle: PropTypes.string,
257
- /**
258
- * Transition time
259
- */
260
- timeout: PropTypes.number,
261
- /**
262
- * Title displayed at top of dialog
263
- */
264
- title: PropTypes.node,
42
+ "height": PropTypes.string,
43
+ "help": PropTypes.string,
44
+ "onCancel": PropTypes.func,
45
+ "open": PropTypes.bool.isRequired,
46
+ "role": PropTypes.string,
47
+ "showCloseIcon": PropTypes.bool,
48
+ "size": PropTypes.oneOf(["auto", "extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "small"]),
49
+ "subtitle": PropTypes.string,
50
+ "timeout": PropTypes.number,
51
+ "title": PropTypes.node
265
52
  };
266
-
267
53
  export { Alert };
268
- export default Alert;
54
+ export default Alert;
@@ -1 +1,2 @@
1
1
  export { default } from "./alert.component";
2
+ export type { DialogProps as AlertProps } from "../dialog/dialog";
@@ -1,68 +1,28 @@
1
1
  import React from "react";
2
2
  import PropTypes from "prop-types";
3
- import {
4
- StyledBadgeWrapper,
5
- StyledButton,
6
- StyledCrossIcon,
7
- StyledCounter,
8
- } from "./badge.style";
9
- const Badge = ({ children, counter = 0, onClick }) => {
10
- return /*#__PURE__*/ React.createElement(
11
- StyledBadgeWrapper,
12
- null,
13
- counter > 0 &&
14
- /*#__PURE__*/ React.createElement(
15
- StyledButton,
16
- {
17
- "data-component": "badge",
18
- buttonType: "secondary",
19
- onClick: onClick,
20
- },
21
- /*#__PURE__*/ React.createElement(StyledCrossIcon, {
22
- "data-element": "badge-cross-icon",
23
- type: "cross",
24
- }),
25
- /*#__PURE__*/ React.createElement(
26
- StyledCounter,
27
- {
28
- "data-element": "badge-counter",
29
- },
30
- counter > 99 ? 99 : counter
31
- )
32
- ),
33
- children
34
- );
35
- };
3
+ import { StyledBadgeWrapper, StyledButton, StyledCrossIcon, StyledCounter } from "./badge.style";
36
4
 
37
- Badge.propTypes = {
38
- /**
39
- * The badge will be added to this element
40
- */
41
- children: PropTypes.node,
42
- /**
43
- * The number rendered in the badge component
44
- */
45
- counter: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
46
- /**
47
- * Callback fired when badge is clicked
48
- */
49
- onClick: PropTypes.func,
5
+ const Badge = ({
6
+ children,
7
+ counter = 0,
8
+ onClick
9
+ }) => {
10
+ return /*#__PURE__*/React.createElement(StyledBadgeWrapper, null, counter > 0 && /*#__PURE__*/React.createElement(StyledButton, {
11
+ "data-component": "badge",
12
+ buttonType: "secondary",
13
+ onClick: onClick
14
+ }, /*#__PURE__*/React.createElement(StyledCrossIcon, {
15
+ "data-element": "badge-cross-icon",
16
+ type: "cross"
17
+ }), /*#__PURE__*/React.createElement(StyledCounter, {
18
+ "data-element": "badge-counter"
19
+ }, counter > 99 ? 99 : counter)), children);
50
20
  };
51
21
 
52
22
  Badge.propTypes = {
53
- /**
54
- * The badge will be added to this element
55
- */
56
- children: PropTypes.node,
57
- /**
58
- * The number rendered in the badge component
59
- */
60
- counter: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
61
- /**
62
- * Callback fired when badge is clicked
63
- */
64
- onClick: PropTypes.func,
23
+ "children": PropTypes.node,
24
+ "counter": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
25
+ "onClick": PropTypes.func
65
26
  };
66
-
67
27
  export { Badge };
68
- export default Badge;
28
+ export default Badge;