carbon-react 106.3.1 → 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 (57) 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/heading/heading.style.d.ts +2 -2
  13. package/esm/components/hr/hr.component.js +171 -1305
  14. package/esm/components/hr/index.d.ts +1 -0
  15. package/esm/components/inline-inputs/inline-inputs.component.js +35 -90
  16. package/esm/components/link/index.d.ts +1 -0
  17. package/esm/components/link/link.component.js +123 -1228
  18. package/esm/components/navigation-bar/index.d.ts +1 -0
  19. package/esm/components/navigation-bar/navigation-bar.component.js +1018 -10761
  20. package/esm/components/pager/pager.style.d.ts +1 -1
  21. package/esm/components/pod/pod.style.d.ts +1 -1
  22. package/esm/components/radio-button/radio-button-svg.component.js +16 -29
  23. package/esm/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  24. package/esm/components/tooltip/tooltip.component.js +85 -254
  25. package/esm/components/vertical-divider/index.d.ts +1 -0
  26. package/esm/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  27. package/esm/components/vertical-divider/vertical-divider.component.js +328 -1406
  28. package/esm/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  29. package/lib/__internal__/input/input-presentation.component.js +16 -0
  30. package/lib/__internal__/input/input.component.js +295 -0
  31. package/lib/__internal__/input-behaviour/input-behaviour.component.js +6 -1
  32. package/lib/__internal__/input-behaviour/input-group-behaviour.component.js +7 -1
  33. package/lib/__internal__/validation-message/validation-message.component.js +6 -0
  34. package/lib/__internal__/validations/validation-icon.component.js +39 -0
  35. package/lib/components/alert/alert.component.js +42 -143
  36. package/lib/components/alert/index.d.ts +1 -0
  37. package/lib/components/badge/badge.component.js +24 -50
  38. package/lib/components/button/button.component.js +768 -3378
  39. package/lib/components/carbon-provider/carbon-provider.component.js +54 -110
  40. package/lib/components/heading/heading.style.d.ts +2 -2
  41. package/lib/components/hr/hr.component.js +175 -676
  42. package/lib/components/hr/index.d.ts +1 -0
  43. package/lib/components/inline-inputs/inline-inputs.component.js +43 -137
  44. package/lib/components/link/index.d.ts +1 -0
  45. package/lib/components/link/link.component.js +142 -746
  46. package/lib/components/navigation-bar/index.d.ts +1 -0
  47. package/lib/components/navigation-bar/navigation-bar.component.js +1022 -5426
  48. package/lib/components/pager/pager.style.d.ts +1 -1
  49. package/lib/components/pod/pod.style.d.ts +1 -1
  50. package/lib/components/radio-button/radio-button-svg.component.js +20 -38
  51. package/lib/components/text-editor/__internal__/editor-link/editor-link.style.d.ts +1 -1
  52. package/lib/components/tooltip/tooltip.component.js +98 -215
  53. package/lib/components/vertical-divider/index.d.ts +1 -0
  54. package/lib/components/vertical-divider/vertical-divider.component.d.ts +2 -2
  55. package/lib/components/vertical-divider/vertical-divider.component.js +334 -1457
  56. package/lib/components/vertical-divider/vertical-divider.style.d.ts +3 -3
  57. package/package.json +4 -3
@@ -1 +1,2 @@
1
1
  export { default } from "./hr.component";
2
+ export type { HrProps } from "./hr.component";
@@ -1,90 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
- value: true,
4
+ value: true
5
5
  });
6
-
7
6
  exports.default = exports.InlineInputsContext = void 0;
8
7
 
9
8
  var _react = _interopRequireWildcard(require("react"));
9
+
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _label = _interopRequireDefault(require("../../__internal__/label"));
13
13
 
14
14
  var _inlineInputs = _interopRequireWildcard(require("./inline-inputs.style"));
15
15
 
16
- var _guid = _interopRequireDefault(
17
- require("../../__internal__/utils/helpers/guid")
18
- );
19
-
20
- function _interopRequireDefault(obj) {
21
- return obj && obj.__esModule ? obj : { default: obj };
22
- }
23
-
24
- function _getRequireWildcardCache() {
25
- if (typeof WeakMap !== "function") return null;
26
- var cache = new WeakMap();
27
- _getRequireWildcardCache = function () {
28
- return cache;
29
- };
30
- return cache;
31
- }
32
-
33
- function _interopRequireWildcard(obj) {
34
- if (obj && obj.__esModule) {
35
- return obj;
36
- }
37
- if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
38
- return { default: obj };
39
- }
40
- var cache = _getRequireWildcardCache();
41
- if (cache && cache.has(obj)) {
42
- return cache.get(obj);
43
- }
44
- var newObj = {};
45
- var hasPropertyDescriptor =
46
- Object.defineProperty && Object.getOwnPropertyDescriptor;
47
- for (var key in obj) {
48
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
49
- var desc = hasPropertyDescriptor
50
- ? Object.getOwnPropertyDescriptor(obj, key)
51
- : null;
52
- if (desc && (desc.get || desc.set)) {
53
- Object.defineProperty(newObj, key, desc);
54
- } else {
55
- newObj[key] = obj[key];
56
- }
57
- }
58
- }
59
- newObj.default = obj;
60
- if (cache) {
61
- cache.set(obj, newObj);
62
- }
63
- return newObj;
64
- }
16
+ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
65
17
 
66
- const InlineInputsContext = /*#__PURE__*/ _react.default.createContext({});
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
21
+
22
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
+
24
+ const InlineInputsContext = /*#__PURE__*/_react.default.createContext({});
67
25
 
68
26
  exports.InlineInputsContext = InlineInputsContext;
69
27
 
70
28
  const columnWrapper = (children, gutter, labelId) => {
71
- return _react.default.Children.map(children, (input) => {
72
- return /*#__PURE__*/ _react.default.createElement(
73
- InlineInputsContext.Provider,
74
- {
75
- value: {
76
- ariaLabelledBy: labelId,
77
- },
78
- },
79
- /*#__PURE__*/ _react.default.createElement(
80
- _inlineInputs.StyledInlineInput,
81
- {
82
- gutter: gutter,
83
- "data-element": "inline-input",
84
- },
85
- input
86
- )
87
- );
29
+ return _react.default.Children.map(children, input => {
30
+ return /*#__PURE__*/_react.default.createElement(InlineInputsContext.Provider, {
31
+ value: {
32
+ ariaLabelledBy: labelId
33
+ }
34
+ }, /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledInlineInput, {
35
+ gutter: gutter,
36
+ "data-element": "inline-input"
37
+ }, input));
88
38
  });
89
39
  };
90
40
 
@@ -95,84 +45,40 @@ const InlineInputs = ({
95
45
  className = "",
96
46
  gutter = "none",
97
47
  inputWidth,
98
- labelWidth,
48
+ labelWidth
99
49
  }) => {
100
50
  const labelId = (0, _react.useRef)((0, _guid.default)());
101
51
 
102
52
  function renderLabel() {
103
53
  if (!label) return null;
104
- return /*#__PURE__*/ _react.default.createElement(
105
- _label.default,
106
- {
107
- labelId: labelId.current,
108
- inline: true,
109
- htmlFor: htmlFor,
110
- },
111
- label
112
- );
54
+ return /*#__PURE__*/_react.default.createElement(_label.default, {
55
+ labelId: labelId.current,
56
+ inline: true,
57
+ htmlFor: htmlFor
58
+ }, label);
113
59
  }
114
60
 
115
- return /*#__PURE__*/ _react.default.createElement(
116
- _inlineInputs.default,
117
- {
118
- gutter: gutter,
119
- "data-component": "inline-inputs",
120
- className: className,
121
- labelWidth: labelWidth,
122
- },
123
- renderLabel(),
124
- /*#__PURE__*/ _react.default.createElement(
125
- _inlineInputs.StyledContentContainer,
126
- {
127
- gutter: gutter,
128
- "data-element": "inline-inputs-container",
129
- inputWidth: inputWidth,
130
- },
131
- columnWrapper(children, gutter, label ? labelId.current : undefined)
132
- )
133
- );
61
+ return /*#__PURE__*/_react.default.createElement(_inlineInputs.default, {
62
+ gutter: gutter,
63
+ "data-component": "inline-inputs",
64
+ className: className,
65
+ labelWidth: labelWidth
66
+ }, renderLabel(), /*#__PURE__*/_react.default.createElement(_inlineInputs.StyledContentContainer, {
67
+ gutter: gutter,
68
+ "data-element": "inline-inputs-container",
69
+ inputWidth: inputWidth
70
+ }, columnWrapper(children, gutter, label ? labelId.current : undefined)));
134
71
  };
135
72
 
136
73
  InlineInputs.propTypes = {
137
- /**
138
- * Children elements
139
- */
140
- children: _propTypes.default.node,
141
- /**
142
- * [Legacy prop] A custom class name for the component.
143
- */
144
- className: _propTypes.default.string,
145
- /**
146
- * Gutter prop gets passed down to Row component if false gutter value is "none"
147
- */
148
- gutter: _propTypes.default.oneOf([
149
- "extra-large",
150
- "extra-small",
151
- "large",
152
- "medium-large",
153
- "medium-small",
154
- "medium",
155
- "none",
156
- "small",
157
- ]),
158
- /**
159
- * The id of the corresponding input control for the label
160
- */
161
- htmlFor: _propTypes.default.string,
162
- /**
163
- * Width of the inline inputs container in percentage
164
- */
165
- inputWidth: _propTypes.default.number,
166
- /**
167
- * Defines the label text for the heading.
168
- */
169
- label: _propTypes.default.string,
170
- /**
171
- * Width of a label in percentage
172
- */
173
- labelWidth: _propTypes.default.number,
74
+ "children": _propTypes.default.node,
75
+ "className": _propTypes.default.string,
76
+ "gutter": _propTypes.default.oneOf(["extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "none", "small"]),
77
+ "htmlFor": _propTypes.default.string,
78
+ "inputWidth": _propTypes.default.number,
79
+ "label": _propTypes.default.string,
80
+ "labelWidth": _propTypes.default.number
174
81
  };
175
-
176
82
  InlineInputs.displayName = "InlineInputs";
177
83
  var _default = InlineInputs;
178
- exports.default = _default;
84
+ exports.default = _default;
@@ -1 +1,2 @@
1
1
  export { default } from "./link.component";
2
+ export type { LinkProps } from "./link.component";