carbon-react 152.2.0 → 152.3.1

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 (150) hide show
  1. package/esm/__internal__/ai-icon/ai-icon.component.d.ts +4 -0
  2. package/esm/__internal__/ai-icon/ai-icon.component.js +28 -0
  3. package/esm/__internal__/ai-icon/index.d.ts +1 -0
  4. package/esm/__internal__/ai-icon/index.js +1 -0
  5. package/esm/__internal__/fieldset/fieldset.component.js +2 -2
  6. package/esm/__internal__/fieldset/fieldset.style.js +1 -0
  7. package/esm/__internal__/form-field/form-field.component.js +2 -2
  8. package/esm/__internal__/form-field/form-field.style.js +1 -0
  9. package/esm/__internal__/utils/helpers/events/events.d.ts +1 -1
  10. package/esm/components/button/button-types.style.js +11 -1
  11. package/esm/components/button/button.component.js +1 -1
  12. package/esm/components/checkbox/checkbox-group/checkbox-group.component.js +2 -7
  13. package/esm/components/checkbox/checkbox.component.js +2 -2
  14. package/esm/components/checkbox/checkbox.style.js +1 -0
  15. package/esm/components/date/date.component.js +2 -3
  16. package/esm/components/date/date.style.js +1 -0
  17. package/esm/components/date-range/date-range.style.js +1 -0
  18. package/esm/components/fieldset/fieldset.component.js +3 -6
  19. package/esm/components/fieldset/fieldset.style.js +5 -0
  20. package/esm/components/form/form.component.js +3 -6
  21. package/esm/components/form/form.style.d.ts +1 -1
  22. package/esm/components/form/form.style.js +20 -11
  23. package/esm/components/hr/hr.style.js +1 -1
  24. package/esm/components/image/image.style.d.ts +1 -1
  25. package/esm/components/inline-inputs/inline-inputs.component.js +3 -6
  26. package/esm/components/inline-inputs/inline-inputs.style.js +1 -0
  27. package/esm/components/message/message.component.d.ts +5 -1
  28. package/esm/components/message/message.component.js +38 -24
  29. package/esm/components/message/message.style.d.ts +4 -1
  30. package/esm/components/message/message.style.js +39 -13
  31. package/esm/components/numeral-date/numeral-date.component.js +2 -1
  32. package/esm/components/search/search.component.js +3 -3
  33. package/esm/components/search/search.style.js +1 -0
  34. package/esm/components/select/filterable-select/filterable-select.component.js +2 -3
  35. package/esm/components/select/multi-select/multi-select.component.js +2 -3
  36. package/esm/components/select/select.style.js +1 -0
  37. package/esm/components/select/simple-select/simple-select.component.js +2 -3
  38. package/esm/components/split-button/split-button-toggle.style.d.ts +1 -0
  39. package/esm/components/split-button/split-button-toggle.style.js +30 -2
  40. package/esm/components/split-button/split-button.component.d.ts +2 -0
  41. package/esm/components/split-button/split-button.component.js +4 -0
  42. package/esm/components/switch/switch.component.js +2 -2
  43. package/esm/components/switch/switch.style.js +1 -0
  44. package/esm/components/text-editor/text-editor.style.js +1 -0
  45. package/esm/components/textarea/textarea.component.js +4 -3
  46. package/esm/components/textarea/textarea.style.js +1 -0
  47. package/esm/components/textbox/textbox.component.js +1 -1
  48. package/esm/components/time/index.d.ts +1 -1
  49. package/esm/components/time/time.component.js +22 -4
  50. package/esm/components/toast/toast.component.js +2 -1
  51. package/esm/components/toast/toast.style.d.ts +2 -3
  52. package/esm/components/toast/toast.style.js +1 -2
  53. package/esm/components/typography/typography.style.d.ts +1 -1
  54. package/esm/locales/en-gb.js +2 -1
  55. package/esm/locales/locale.d.ts +1 -0
  56. package/lib/__internal__/ai-icon/ai-icon.component.d.ts +4 -0
  57. package/lib/__internal__/ai-icon/ai-icon.component.js +36 -0
  58. package/lib/__internal__/ai-icon/index.d.ts +1 -0
  59. package/lib/__internal__/ai-icon/index.js +13 -0
  60. package/lib/__internal__/{form-spacing-provider → ai-icon}/package.json +1 -1
  61. package/lib/__internal__/fieldset/fieldset.component.js +2 -2
  62. package/lib/__internal__/fieldset/fieldset.style.js +1 -0
  63. package/lib/__internal__/form-field/form-field.component.js +2 -2
  64. package/lib/__internal__/form-field/form-field.style.js +1 -0
  65. package/lib/__internal__/utils/helpers/events/events.d.ts +1 -1
  66. package/lib/components/button/button-types.style.js +11 -1
  67. package/lib/components/button/button.component.js +1 -1
  68. package/lib/components/checkbox/checkbox-group/checkbox-group.component.js +2 -7
  69. package/lib/components/checkbox/checkbox.component.js +2 -2
  70. package/lib/components/checkbox/checkbox.style.js +1 -0
  71. package/lib/components/date/date.component.js +1 -2
  72. package/lib/components/date/date.style.js +1 -0
  73. package/lib/components/date-range/date-range.style.js +1 -0
  74. package/lib/components/fieldset/fieldset.component.js +3 -6
  75. package/lib/components/fieldset/fieldset.style.js +5 -0
  76. package/lib/components/form/form.component.js +3 -6
  77. package/lib/components/form/form.style.d.ts +1 -1
  78. package/lib/components/form/form.style.js +20 -11
  79. package/lib/components/hr/hr.style.js +1 -1
  80. package/lib/components/image/image.style.d.ts +1 -1
  81. package/lib/components/inline-inputs/inline-inputs.component.js +3 -6
  82. package/lib/components/inline-inputs/inline-inputs.style.js +1 -0
  83. package/lib/components/message/message.component.d.ts +5 -1
  84. package/lib/components/message/message.component.js +38 -24
  85. package/lib/components/message/message.style.d.ts +4 -1
  86. package/lib/components/message/message.style.js +38 -13
  87. package/lib/components/numeral-date/numeral-date.component.js +2 -1
  88. package/lib/components/search/search.component.js +3 -3
  89. package/lib/components/search/search.style.js +1 -0
  90. package/lib/components/select/filterable-select/filterable-select.component.js +1 -2
  91. package/lib/components/select/multi-select/multi-select.component.js +1 -2
  92. package/lib/components/select/select.style.js +1 -0
  93. package/lib/components/select/simple-select/simple-select.component.js +1 -2
  94. package/lib/components/split-button/split-button-toggle.style.d.ts +1 -0
  95. package/lib/components/split-button/split-button-toggle.style.js +30 -2
  96. package/lib/components/split-button/split-button.component.d.ts +2 -0
  97. package/lib/components/split-button/split-button.component.js +4 -0
  98. package/lib/components/switch/switch.component.js +2 -2
  99. package/lib/components/switch/switch.style.js +1 -0
  100. package/lib/components/text-editor/text-editor.style.js +1 -0
  101. package/lib/components/textarea/textarea.component.js +4 -3
  102. package/lib/components/textarea/textarea.style.js +1 -0
  103. package/lib/components/textbox/textbox.component.js +1 -1
  104. package/lib/components/time/index.d.ts +1 -1
  105. package/lib/components/time/time.component.js +21 -3
  106. package/lib/components/toast/toast.component.js +2 -1
  107. package/lib/components/toast/toast.style.d.ts +2 -3
  108. package/lib/components/toast/toast.style.js +0 -7
  109. package/lib/components/typography/typography.style.d.ts +1 -1
  110. package/lib/locales/en-gb.js +2 -1
  111. package/lib/locales/locale.d.ts +1 -0
  112. package/package.json +15 -15
  113. package/esm/__internal__/form-spacing-provider/form-spacing-provider.component.d.ts +0 -7
  114. package/esm/__internal__/form-spacing-provider/form-spacing-provider.component.js +0 -11
  115. package/esm/__internal__/form-spacing-provider/form-spacing.context.d.ts +0 -5
  116. package/esm/__internal__/form-spacing-provider/form-spacing.context.js +0 -2
  117. package/esm/__internal__/form-spacing-provider/index.d.ts +0 -3
  118. package/esm/__internal__/form-spacing-provider/index.js +0 -2
  119. package/esm/components/message/__internal__/message-content/message-content.component.d.ts +0 -9
  120. package/esm/components/message/__internal__/message-content/message-content.component.js +0 -19
  121. package/esm/components/message/__internal__/message-content/message-content.style.d.ts +0 -3
  122. package/esm/components/message/__internal__/message-content/message-content.style.js +0 -12
  123. package/esm/components/message/__internal__/type-icon/type-icon.component.d.ts +0 -8
  124. package/esm/components/message/__internal__/type-icon/type-icon.component.js +0 -20
  125. package/esm/components/message/__internal__/type-icon/type-icon.style.d.ts +0 -7
  126. package/esm/components/message/__internal__/type-icon/type-icon.style.js +0 -38
  127. package/esm/hooks/__internal__/useFormSpacing/add-form-spacing/index.d.ts +0 -3
  128. package/esm/hooks/__internal__/useFormSpacing/add-form-spacing/index.js +0 -27
  129. package/esm/hooks/__internal__/useFormSpacing/index.d.ts +0 -3
  130. package/esm/hooks/__internal__/useFormSpacing/index.js +0 -11
  131. package/lib/__internal__/form-spacing-provider/form-spacing-provider.component.d.ts +0 -7
  132. package/lib/__internal__/form-spacing-provider/form-spacing-provider.component.js +0 -18
  133. package/lib/__internal__/form-spacing-provider/form-spacing.context.d.ts +0 -5
  134. package/lib/__internal__/form-spacing-provider/form-spacing.context.js +0 -9
  135. package/lib/__internal__/form-spacing-provider/index.d.ts +0 -3
  136. package/lib/__internal__/form-spacing-provider/index.js +0 -20
  137. package/lib/components/message/__internal__/message-content/message-content.component.d.ts +0 -9
  138. package/lib/components/message/__internal__/message-content/message-content.component.js +0 -26
  139. package/lib/components/message/__internal__/message-content/message-content.style.d.ts +0 -3
  140. package/lib/components/message/__internal__/message-content/message-content.style.js +0 -19
  141. package/lib/components/message/__internal__/type-icon/type-icon.component.d.ts +0 -8
  142. package/lib/components/message/__internal__/type-icon/type-icon.component.js +0 -27
  143. package/lib/components/message/__internal__/type-icon/type-icon.style.d.ts +0 -7
  144. package/lib/components/message/__internal__/type-icon/type-icon.style.js +0 -46
  145. package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/index.d.ts +0 -3
  146. package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/index.js +0 -34
  147. package/lib/hooks/__internal__/useFormSpacing/add-form-spacing/package.json +0 -6
  148. package/lib/hooks/__internal__/useFormSpacing/index.d.ts +0 -3
  149. package/lib/hooks/__internal__/useFormSpacing/index.js +0 -19
  150. package/lib/hooks/__internal__/useFormSpacing/package.json +0 -6
@@ -1,19 +1,17 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import { margin } from "styled-system";
3
3
  import BaseTheme from "../../style/themes/base";
4
- import StyledIconButton from "../icon-button/icon-button.style";
5
4
  const messageVariants = {
6
5
  error: "var(--colorsSemanticNegative500)",
7
6
  info: "var(--colorsSemanticInfo500)",
8
7
  success: "var(--colorsSemanticPositive500)",
9
8
  warning: "var(--colorsSemanticCaution500)",
10
- neutral: "var(--colorsSemanticNeutral500)"
9
+ neutral: "var(--colorsSemanticNeutral500)",
10
+ ai: "var(--colorsUtilityYin100)"
11
11
  };
12
12
  const MessageStyle = styled.div`
13
13
  position: relative;
14
14
  display: flex;
15
- justify-content: flex-start;
16
- align-content: center;
17
15
  border-radius: var(--borderRadius100);
18
16
  overflow: hidden;
19
17
  border: 1px solid ${({
@@ -33,20 +31,48 @@ const MessageStyle = styled.div`
33
31
  background: transparent;
34
32
  `}
35
33
 
36
- ${StyledIconButton} {
37
- position: absolute;
38
- right: 20px;
39
- top: 50%;
40
- transform: translateY(-50%);
41
- }
42
-
43
34
  ${({
44
35
  width
45
36
  }) => width && `width: ${width};`}
46
-
47
37
  ${margin}
48
38
  `;
39
+ const MessageContent = styled.div`
40
+ width: 100%;
41
+ display: flex;
42
+ justify-content: space-between;
43
+ align-items: center;
44
+ padding: var(--spacing200);
45
+ gap: var(--spacing300);
46
+ `;
47
+ const TypeIconStyle = styled.div`
48
+ display: flex;
49
+ justify-content: center;
50
+ align-items: center;
51
+ background-color: ${({
52
+ variant
53
+ }) => messageVariants[variant]};
54
+ min-width: 30px;
55
+
56
+ span {
57
+ &:before {
58
+ color: var(--colorsUtilityYang100);
59
+ }
60
+ }
61
+
62
+ ${({
63
+ transparent,
64
+ variant
65
+ }) => transparent && css`
66
+ background-color: transparent;
67
+ span {
68
+ &:before {
69
+ color: ${messageVariants[variant]};
70
+ }
71
+ }
72
+ `}
73
+ `;
49
74
  MessageStyle.defaultProps = {
50
75
  theme: BaseTheme
51
76
  };
52
- export default MessageStyle;
77
+ export default MessageStyle;
78
+ export { MessageContent, TypeIconStyle };
@@ -285,7 +285,8 @@ export const NumeralDate = /*#__PURE__*/forwardRef(({
285
285
  info
286
286
  }, {
287
287
  tooltipPosition: tooltipPosition,
288
- tooltipId: validationId
288
+ tooltipId: validationId,
289
+ my: 0 // prevents any form spacing being applied
289
290
  }))));
290
291
  }));
291
292
  };
@@ -154,8 +154,7 @@ export const Search = /*#__PURE__*/React.forwardRef(({
154
154
  maxWidth: maxWidth,
155
155
  searchHasValue: searchHasValue,
156
156
  showSearchButton: !!searchButton,
157
- variant: variant,
158
- mb: 0
157
+ variant: variant
159
158
  }, filterStyledSystemMarginProps(rest), {
160
159
  id: id,
161
160
  name: name
@@ -180,7 +179,8 @@ export const Search = /*#__PURE__*/React.forwardRef(({
180
179
  type: "search",
181
180
  ml: 1
182
181
  }) : undefined,
183
- tooltipPosition: tooltipPosition
182
+ tooltipPosition: tooltipPosition,
183
+ my: 0 // prevents any form spacing being applied
184
184
  }), searchButton && /*#__PURE__*/React.createElement(StyledSearchButton, null, /*#__PURE__*/React.createElement(Button, _extends({
185
185
  "aria-label": searchButtonAriaLabel || searchButtonText,
186
186
  size: "medium",
@@ -19,6 +19,7 @@ const StyledSearch = styled.div`
19
19
  const darkVariant = variant === "dark";
20
20
  const variantColor = darkVariant ? "var(--colorsUtilityYang080)" : "var(--colorsUtilityMajor300)";
21
21
  return css`
22
+ margin-bottom: var(--fieldSpacing);
22
23
  ${margin}
23
24
  width: ${searchWidth ? `${searchWidth}` : "100%"};
24
25
  max-width: ${maxWidth ? `${maxWidth}` : "100%"};
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState, useEffect, useRef, useCallback } from "react";
3
3
  import invariant from "invariant";
4
- import { filterOutStyledSystemSpacingProps } from "../../../style/utils";
4
+ import { filterOutStyledSystemSpacingProps, filterStyledSystemMarginProps } from "../../../style/utils";
5
5
  import SelectTextbox from "../__internal__/select-textbox";
6
6
  import guid from "../../../__internal__/utils/helpers/guid";
7
7
  import withFilter from "../__internal__/utils/with-filter.hoc";
@@ -12,7 +12,6 @@ import areObjectsEqual from "../__internal__/utils/are-objects-equal";
12
12
  import isNavigationKey from "../__internal__/utils/is-navigation-key";
13
13
  import Logger from "../../../__internal__/utils/logger";
14
14
  import useStableCallback from "../../../hooks/__internal__/useStableCallback";
15
- import useFormSpacing from "../../../hooks/__internal__/useFormSpacing";
16
15
  import useInputAccessibility from "../../../hooks/__internal__/useInputAccessibility/useInputAccessibility";
17
16
  let deprecateUncontrolledWarnTriggered = false;
18
17
  const FilterableSelectList = withFilter(SelectList);
@@ -457,7 +456,7 @@ export const FilterableSelect = /*#__PURE__*/React.forwardRef(({
457
456
  listWidth
458
457
  };
459
458
  const selectList = disableDefaultFiltering ? /*#__PURE__*/React.createElement(SelectList, selectListProps, children) : /*#__PURE__*/React.createElement(FilterableSelectList, selectListProps, children);
460
- const marginProps = useFormSpacing(textboxProps);
459
+ const marginProps = filterStyledSystemMarginProps(textboxProps);
461
460
  return /*#__PURE__*/React.createElement(StyledSelect, _extends({
462
461
  hasTextCursor: true,
463
462
  readOnly: readOnly,
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState, useEffect, useRef, useCallback, useMemo } from "react";
3
3
  import invariant from "invariant";
4
- import { filterOutStyledSystemSpacingProps } from "../../../style/utils";
4
+ import { filterOutStyledSystemSpacingProps, filterStyledSystemMarginProps } from "../../../style/utils";
5
5
  import SelectTextbox from "../__internal__/select-textbox";
6
6
  import guid from "../../../__internal__/utils/helpers/guid";
7
7
  import withFilter from "../__internal__/utils/with-filter.hoc";
@@ -13,7 +13,6 @@ import isExpectedValue from "../__internal__/utils/is-expected-value";
13
13
  import isNavigationKey from "../__internal__/utils/is-navigation-key";
14
14
  import Logger from "../../../__internal__/utils/logger";
15
15
  import useStableCallback from "../../../hooks/__internal__/useStableCallback";
16
- import useFormSpacing from "../../../hooks/__internal__/useFormSpacing";
17
16
  import useInputAccessibility from "../../../hooks/__internal__/useInputAccessibility/useInputAccessibility";
18
17
  let deprecateUncontrolledWarnTriggered = false;
19
18
  const FilterableSelectList = withFilter(SelectList);
@@ -461,7 +460,7 @@ export const MultiSelect = /*#__PURE__*/React.forwardRef(({
461
460
  virtualScrollOverscan: virtualScrollOverscan,
462
461
  listWidth: listWidth
463
462
  }, children);
464
- const marginProps = useFormSpacing(textboxProps);
463
+ const marginProps = filterStyledSystemMarginProps(textboxProps);
465
464
  return /*#__PURE__*/React.createElement(StyledSelectMultiSelect, _extends({
466
465
  disabled: disabled,
467
466
  readOnly: readOnly,
@@ -13,6 +13,7 @@ const StyledSelect = styled.div`
13
13
  transparent,
14
14
  isOpen
15
15
  }) => css`
16
+ margin-bottom: var(--fieldSpacing);
16
17
  ${margin}
17
18
 
18
19
  position: relative;
@@ -1,7 +1,7 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import React, { useState, useEffect, useRef, useCallback, useMemo } from "react";
3
3
  import invariant from "invariant";
4
- import { filterOutStyledSystemSpacingProps } from "../../../style/utils";
4
+ import { filterOutStyledSystemSpacingProps, filterStyledSystemMarginProps } from "../../../style/utils";
5
5
  import StyledSelect from "../select.style";
6
6
  import SelectTextbox from "../__internal__/select-textbox";
7
7
  import SelectList from "../__internal__/select-list/select-list.component";
@@ -10,7 +10,6 @@ import getNextChildByText from "../__internal__/utils/get-next-child-by-text";
10
10
  import isExpectedOption from "../__internal__/utils/is-expected-option";
11
11
  import isNavigationKey from "../__internal__/utils/is-navigation-key";
12
12
  import Logger from "../../../__internal__/utils/logger";
13
- import useFormSpacing from "../../../hooks/__internal__/useFormSpacing";
14
13
  import useInputAccessibility from "../../../hooks/__internal__/useInputAccessibility/useInputAccessibility";
15
14
  let deprecateUncontrolledWarnTriggered = false;
16
15
  export const SimpleSelect = /*#__PURE__*/React.forwardRef(({
@@ -326,7 +325,7 @@ export const SimpleSelect = /*#__PURE__*/React.forwardRef(({
326
325
  virtualScrollOverscan: virtualScrollOverscan,
327
326
  listWidth: listWidth
328
327
  }, children);
329
- const marginProps = useFormSpacing(props);
328
+ const marginProps = filterStyledSystemMarginProps(props);
330
329
  return /*#__PURE__*/React.createElement(StyledSelect, _extends({
331
330
  transparent: transparent,
332
331
  disabled: disabled,
@@ -3,6 +3,7 @@ declare type StyledSplitButtonToggleProps = {
3
3
  disabled: boolean;
4
4
  displayed: boolean;
5
5
  size: "small" | "medium" | "large";
6
+ isWhite?: boolean;
6
7
  };
7
8
  declare const StyledSplitButtonToggle: import("styled-components").StyledComponent<"button", any, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & Omit<import("../button").ButtonProps, "buttonType"> & {
8
9
  iconOnly?: boolean | undefined;
@@ -12,12 +12,13 @@ const StyledSplitButtonToggle = styled(StyledButton)`
12
12
  buttonType,
13
13
  disabled,
14
14
  displayed,
15
- size
15
+ size,
16
+ isWhite
16
17
  }) => css`
17
18
  border-top-left-radius: var(--borderRadius000);
18
19
  border-bottom-left-radius: var(--borderRadius000);
19
20
 
20
- ${!disabled && displayed ? css`
21
+ ${!disabled && displayed && !isWhite ? css`
21
22
  background-color: var(--colorsActionMajor500);
22
23
  border-color: var(--colorsActionMajor500);
23
24
 
@@ -30,6 +31,21 @@ const StyledSplitButtonToggle = styled(StyledButton)`
30
31
  border-left-color: var(--colorsSemanticFocus500);
31
32
  }
32
33
  ` : ""}
34
+
35
+ ${!disabled && displayed && isWhite ? css`
36
+ background-color: var(--colorsActionMajorYang100);
37
+ border-color: var(--colorsActionMajorYang100);
38
+
39
+ &,
40
+ ${StyledIcon} {
41
+ color: var(--colorsYin100);
42
+ }
43
+
44
+ &:focus {
45
+ border-left-color: var(--colorsSemanticFocus500);
46
+ }
47
+ ` : ""}
48
+
33
49
  ${!disabled && buttonType === "primary" && `
34
50
  position: relative;
35
51
  &::before {
@@ -63,6 +79,18 @@ const StyledSplitButtonToggle = styled(StyledButton)`
63
79
  color: var(--colorsActionMajorYang100);
64
80
  }
65
81
  }
82
+
83
+ ${!disabled && isWhite && `
84
+ &:focus {
85
+ background-color: var(--colorsActionMajorYang100);
86
+ border-color: var(--colorsActionMajorYang100);
87
+
88
+ &,
89
+ ${StyledIcon} {
90
+ color: var(--colorsYin100);
91
+ }
92
+ }
93
+ `}
66
94
  `}
67
95
  `;
68
96
  StyledSplitButtonToggle.defaultProps = {
@@ -25,6 +25,8 @@ export interface SplitButtonProps extends React.ButtonHTMLAttributes<HTMLButtonE
25
25
  text: string;
26
26
  /** Sets rendering position of menu */
27
27
  position?: "left" | "right";
28
+ /** Renders the white variant of the secondary split button */
29
+ isWhite?: boolean;
28
30
  }
29
31
  export declare type SplitButtonHandle = {
30
32
  /** Programmatically focus the main button */
@@ -32,6 +32,7 @@ export const SplitButton = /*#__PURE__*/forwardRef(({
32
32
  "data-element": dataElement,
33
33
  "data-role": dataRole,
34
34
  "aria-label": ariaLabel,
35
+ isWhite = false,
35
36
  ...rest
36
37
  }, ref) => {
37
38
  const locale = useLocale();
@@ -42,6 +43,7 @@ export const SplitButton = /*#__PURE__*/forwardRef(({
42
43
  const {
43
44
  isInFlatTable
44
45
  } = useContext(FlatTableContext);
46
+ const shouldRenderIsWhiteVariant = buttonType === "secondary" && isWhite;
45
47
  useImperativeHandle(ref, () => ({
46
48
  focusMainButton() {
47
49
  mainButtonRef.current?.focus();
@@ -76,12 +78,14 @@ export const SplitButton = /*#__PURE__*/forwardRef(({
76
78
  onClick: handleMainClick,
77
79
  size,
78
80
  subtext,
81
+ isWhite: shouldRenderIsWhiteVariant,
79
82
  ...filterOutStyledSystemSpacingProps(rest)
80
83
  };
81
84
  const handleToggleClick = () => {
82
85
  showButtons();
83
86
  };
84
87
  const toggleButtonProps = {
88
+ isWhite: shouldRenderIsWhiteVariant,
85
89
  disabled,
86
90
  displayed: showAdditionalButtons,
87
91
  onTouchStart: showButtons,
@@ -7,12 +7,12 @@ import { TooltipProvider } from "../../__internal__/tooltip-provider";
7
7
  import NewValidationContext from "../carbon-provider/__internal__/new-validation.context";
8
8
  import Logger from "../../__internal__/utils/logger";
9
9
  import ValidationMessage from "../../__internal__/validation-message/validation-message.component";
10
- import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
11
10
  import useIsAboveBreakpoint from "../../hooks/__internal__/useIsAboveBreakpoint";
12
11
  import StyledSwitch, { ErrorBorder } from "./switch.style";
13
12
  import SwitchSlider from "./__internal__/switch-slider.component";
14
13
  import guid from "../../__internal__/utils/helpers/guid";
15
14
  import HintText from "../../__internal__/hint-text";
15
+ import { filterStyledSystemMarginProps } from "../../style/utils";
16
16
  let deprecateUncontrolledWarnTriggered = false;
17
17
  export const Switch = /*#__PURE__*/React.forwardRef(({
18
18
  autoFocus,
@@ -71,7 +71,7 @@ export const Switch = /*#__PURE__*/React.forwardRef(({
71
71
  shouldLabelBeInline = largeScreen;
72
72
  }
73
73
  const shouldValidationBeOnLabel = labelInline && !reverse ? true : validationOnLabel;
74
- const marginProps = useFormSpacing(rest);
74
+ const marginProps = filterStyledSystemMarginProps(rest);
75
75
  const switchStyleProps = {
76
76
  "data-component": "switch",
77
77
  "data-role": dataRole,
@@ -34,6 +34,7 @@ const StyledSwitch = styled.div`
34
34
  reverse,
35
35
  size
36
36
  }) => css`
37
+ margin-bottom: var(--fieldSpacing);
37
38
  ${margin}
38
39
  ${FieldLineStyle} {
39
40
  display: flex;
@@ -6,6 +6,7 @@ export const StyledTextEditor = styled(Box)`
6
6
  position: relative;
7
7
  `;
8
8
  export const StyledTextEditorWrapper = styled.div`
9
+ margin-bottom: var(--fieldSpacing);
9
10
  ${margin}
10
11
  `;
11
12
  export const StyledWrapper = styled.div`
@@ -16,8 +16,8 @@ import ErrorBorder from "../textbox/textbox.style";
16
16
  import ValidationMessage from "../../__internal__/validation-message";
17
17
  import Box from "../box";
18
18
  import Logger from "../../__internal__/utils/logger";
19
- import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
20
19
  import HintText from "../../__internal__/hint-text";
20
+ import { filterStyledSystemMarginProps } from "../../style/utils";
21
21
  let deprecateUncontrolledWarnTriggered = false;
22
22
  let warnBorderRadiusArrayTooLarge = false;
23
23
  export const Textarea = /*#__PURE__*/React.forwardRef(({
@@ -213,7 +213,7 @@ export const Textarea = /*#__PURE__*/React.forwardRef(({
213
213
  validationIconId: validationRedesignOptIn ? undefined : validationId,
214
214
  useValidationIcon: !(validationRedesignOptIn || validationOnLabel)
215
215
  }));
216
- const marginProps = useFormSpacing(rest);
216
+ const marginProps = filterStyledSystemMarginProps(rest);
217
217
  return /*#__PURE__*/React.createElement(TooltipProvider, {
218
218
  tooltipPosition: tooltipPosition,
219
219
  helpAriaLabel: helpAriaLabel
@@ -243,7 +243,8 @@ export const Textarea = /*#__PURE__*/React.forwardRef(({
243
243
  isOptional: isOptional,
244
244
  useValidationIcon: computeLabelPropValues(validationOnLabel),
245
245
  adaptiveLabelBreakpoint: adaptiveLabelBreakpoint,
246
- validationRedesignOptIn: validationRedesignOptIn
246
+ validationRedesignOptIn: validationRedesignOptIn,
247
+ my: 0 // prevents any form spacing being applied
247
248
  }, (inputHint || labelHelp && validationRedesignOptIn) && /*#__PURE__*/React.createElement(HintText, {
248
249
  align: labelAlign,
249
250
  id: inputHintId,
@@ -6,6 +6,7 @@ import InputIconToggleStyle from "../../__internal__/input-icon-toggle/input-ico
6
6
  import BaseTheme from "../../style/themes/base";
7
7
  export const DEFAULT_MIN_HEIGHT = 64;
8
8
  const StyledTextarea = styled.div`
9
+ margin-bottom: var(--fieldSpacing);
9
10
  ${margin};
10
11
 
11
12
  ${StyledInput} {
@@ -220,7 +220,7 @@ export const Textbox = /*#__PURE__*/React.forwardRef(({
220
220
  warning: warning
221
221
  }), !disableErrorBorder && (error || warning) && /*#__PURE__*/React.createElement(ErrorBorder, {
222
222
  warning: !!(!error && warning)
223
- }), input) : input), characterCount));
223
+ }), input) : input, characterCount)));
224
224
  });
225
225
  Textbox.displayName = "Textbox";
226
226
  export default Textbox;
@@ -1,2 +1,2 @@
1
1
  export { default as Time } from "./time.component";
2
- export type { TimeValue, TimeProps, TimeHandle, ToggleValue, } from "./time.component";
2
+ export type { TimeValue, TimeProps, TimeHandle, ToggleValue, TimeInputEvent, } from "./time.component";
@@ -1,9 +1,10 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, useImperativeHandle, useRef, useState } from "react";
2
+ import React, { useCallback, useImperativeHandle, useRef, useState, useEffect } from "react";
3
3
  import guid from "../../__internal__/utils/helpers/guid";
4
4
  import useLocale from "../../hooks/__internal__/useLocale";
5
5
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
6
6
  import useInputAccessibility from "../../hooks/__internal__/useInputAccessibility";
7
+ import { filterStyledSystemMarginProps } from "../../style/utils";
7
8
  import Fieldset from "../../__internal__/fieldset";
8
9
  import Box from "../box";
9
10
  import ErrorBorder from "../textbox/textbox.style";
@@ -68,6 +69,21 @@ const Time = /*#__PURE__*/React.forwardRef(({
68
69
  const minsAriaLabel = minutesAriaLabel || locale.time.minutesAriaLabelText();
69
70
  const hoursRef = useRef(null);
70
71
  const minsRef = useRef(null);
72
+ useEffect(() => {
73
+ const updates = [...inputValues];
74
+ if (inputValues[0] !== hourValue) {
75
+ updates[0] = hourValue;
76
+ }
77
+ if (inputValues[1] !== minuteValue) {
78
+ updates[1] = minuteValue;
79
+ }
80
+ if (inputValues[0] !== hourValue || inputValues[1] !== minuteValue) {
81
+ setInputValues(updates);
82
+ const formattedHours = hourValue.length ? hourValue.padStart(2, "0") : hourValue;
83
+ const formattedMinutes = minuteValue.length ? minuteValue.padStart(2, "0") : minuteValue;
84
+ setFormattedInputValues([formattedHours, formattedMinutes]);
85
+ }
86
+ }, [hourValue, minuteValue, inputValues]);
71
87
  const computedValidations = (hrs, mins) => {
72
88
  const hoursIsString = typeof hrs === "string";
73
89
  const minutesIsString = typeof mins === "string";
@@ -170,7 +186,7 @@ const Time = /*#__PURE__*/React.forwardRef(({
170
186
  isDisabled: disabled,
171
187
  name: name,
172
188
  id: internalId.current
173
- }, rest, tagComponent("time", rest), {
189
+ }, rest, filterStyledSystemMarginProps(rest), tagComponent("time", rest), {
174
190
  "aria-describedby": inputHint ? combinedAriaDescribedBy : ariaDescribedBy
175
191
  }), inputHint && /*#__PURE__*/React.createElement(HintText, {
176
192
  align: labelAlign,
@@ -204,7 +220,8 @@ const Time = /*#__PURE__*/React.forwardRef(({
204
220
  error: !!hoursError,
205
221
  warning: !!hoursWarning,
206
222
  disabled: disabled,
207
- readOnly: readOnly
223
+ readOnly: readOnly,
224
+ my: 0 // prevents any form spacing being applied
208
225
  }))), /*#__PURE__*/React.createElement(Box, {
209
226
  display: "flex",
210
227
  flexDirection: "column",
@@ -232,7 +249,8 @@ const Time = /*#__PURE__*/React.forwardRef(({
232
249
  error: !!minutesError,
233
250
  warning: !!minutesWarning,
234
251
  disabled: disabled,
235
- readOnly: readOnly
252
+ readOnly: readOnly,
253
+ my: 0 // prevents any form spacing being applied
236
254
  }))), showToggle && /*#__PURE__*/React.createElement(Box, {
237
255
  display: "flex",
238
256
  flexDirection: "column",
@@ -3,7 +3,8 @@ import React, { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { TransitionGroup, CSSTransition } from "react-transition-group";
4
4
  import Icon from "../icon";
5
5
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
6
- import { StyledToast, TypeIcon, StyledToastContent, ToastWrapper, StyledPortal } from "./toast.style";
6
+ import { StyledToast, StyledToastContent, ToastWrapper, StyledPortal } from "./toast.style";
7
+ import { TypeIconStyle as TypeIcon } from "../message/message.style";
7
8
  import IconButton from "../icon-button";
8
9
  import Events from "../../__internal__/utils/helpers/events";
9
10
  import useLocale from "../../hooks/__internal__/useLocale";
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
- import TypeIcon from "../message/__internal__/type-icon/type-icon.style";
3
2
  import { MessageVariant } from "../message/message.component";
4
3
  declare const StyledPortal: import("styled-components").StyledComponent<({ children, className, id, onReposition, inertOptOut, }: import("../portal/portal").PortalProps) => import("react").JSX.Element, any, {
5
4
  align?: "center" | "left" | "right" | undefined;
6
5
  alignY?: "center" | "top" | "bottom" | undefined;
7
6
  isNotice?: boolean | undefined;
8
7
  }, never>;
9
- declare type ToastVariants = MessageVariant;
8
+ declare type ToastVariants = Exclude<MessageVariant, "ai">;
10
9
  declare type ToastStyleProps = {
11
10
  align?: "left" | "center" | "right";
12
11
  alignY?: "top" | "center" | "bottom";
@@ -24,4 +23,4 @@ declare const ToastWrapper: import("styled-components").StyledComponent<"div", a
24
23
  align?: "center" | "left" | "right" | undefined;
25
24
  isNotice?: boolean | undefined;
26
25
  }, never>;
27
- export { StyledPortal, StyledToast, TypeIcon, StyledToastContent, ToastWrapper, };
26
+ export { StyledPortal, StyledToast, StyledToastContent, ToastWrapper };
@@ -1,5 +1,4 @@
1
1
  import styled, { css } from "styled-components";
2
- import TypeIcon from "../message/__internal__/type-icon/type-icon.style";
3
2
  import StyledIconButton from "../icon-button/icon-button.style";
4
3
  import Portal from "../portal/portal";
5
4
  import baseTheme from "../../style/themes/base";
@@ -224,4 +223,4 @@ const ToastWrapper = styled.div`
224
223
  display: block;
225
224
  `}
226
225
  `;
227
- export { StyledPortal, StyledToast, TypeIcon, StyledToastContent, ToastWrapper };
226
+ export { StyledPortal, StyledToast, StyledToastContent, ToastWrapper };
@@ -8,5 +8,5 @@ declare const StyledTypography: import("styled-components").StyledComponent<"spa
8
8
  textDecoration: string;
9
9
  lineHeight: string;
10
10
  defaultMargin: string;
11
- } & TypographyProps, "textDecoration" | "size" | "as" | "weight" | "textTransform" | "lineHeight" | "defaultMargin">;
11
+ } & TypographyProps, "textDecoration" | "as" | "size" | "weight" | "textTransform" | "lineHeight" | "defaultMargin">;
12
12
  export default StyledTypography;
@@ -109,7 +109,8 @@ const enGB = {
109
109
  info: () => "Information",
110
110
  success: () => "Success",
111
111
  warning: () => "Warning",
112
- neutral: () => "Information"
112
+ neutral: () => "Information",
113
+ ai: () => "AI Information"
113
114
  },
114
115
  numeralDate: {
115
116
  validation: {
@@ -93,6 +93,7 @@ interface Locale {
93
93
  success: () => string;
94
94
  warning: () => string;
95
95
  neutral: () => string;
96
+ ai?: () => string;
96
97
  };
97
98
  numeralDate: {
98
99
  validation: {
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
3
+ export declare const AiIcon: ({ ...rest }: TagProps) => React.JSX.Element;
4
+ export default AiIcon;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.AiIcon = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
11
+ const AiIcon = ({
12
+ ...rest
13
+ }) => /*#__PURE__*/_react.default.createElement("svg", _extends({}, (0, _tags.default)("ai-icon", rest), {
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ width: "20",
16
+ height: "20",
17
+ fill: "none",
18
+ viewBox: "0 0 20 20"
19
+ }), /*#__PURE__*/_react.default.createElement("g", {
20
+ clipPath: "url(#a)"
21
+ }, /*#__PURE__*/_react.default.createElement("path", {
22
+ "data-role": "white-star",
23
+ fill: "#fff",
24
+ d: "m16.378 9.799-3.776-1.49a1.615 1.615 0 0 1-.91-.91l-1.49-3.775c-.537-1.364-2.466-1.364-3.004 0L5.708 7.4a1.615 1.615 0 0 1-.91.91L1.022 9.799c-1.363.537-1.363 2.466 0 3.004l3.776 1.49c.417.163.746.493.91.91l1.49 3.775c.538 1.363 2.467 1.363 3.005 0l1.489-3.776c.164-.416.494-.745.91-.91l3.776-1.489c1.364-.538 1.364-2.467 0-3.004Z"
25
+ }), /*#__PURE__*/_react.default.createElement("path", {
26
+ "data-role": "green-circle",
27
+ fill: "#00D639",
28
+ d: "M17.172 5.655a2.827 2.827 0 1 0 0-5.655 2.827 2.827 0 0 0 0 5.655Z"
29
+ })), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
30
+ id: "a"
31
+ }, /*#__PURE__*/_react.default.createElement("path", {
32
+ fill: "#fff",
33
+ d: "M0 0h20v20H0z"
34
+ }))));
35
+ exports.AiIcon = AiIcon;
36
+ var _default = exports.default = AiIcon;
@@ -0,0 +1 @@
1
+ export { default } from "./ai-icon.component";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "default", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _aiIcon.default;
10
+ }
11
+ });
12
+ var _aiIcon = _interopRequireDefault(require("./ai-icon.component"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sideEffects": false,
3
- "module": "../../../esm/__internal__/form-spacing-provider/index.js",
3
+ "module": "../../../esm/__internal__/ai-icon/index.js",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts"
6
6
  }
@@ -9,9 +9,9 @@ var _fieldset = require("./fieldset.style");
9
9
  var _validationIcon = _interopRequireDefault(require("../validations/validation-icon.component"));
10
10
  var _newValidation = _interopRequireDefault(require("../../components/carbon-provider/__internal__/new-validation.context"));
11
11
  var _inputBehaviour = require("../input-behaviour");
12
- var _useFormSpacing = _interopRequireDefault(require("../../hooks/__internal__/useFormSpacing"));
13
12
  var _help = _interopRequireDefault(require("../../components/help"));
14
13
  var _typography = _interopRequireDefault(require("../../components/typography"));
14
+ var _utils = require("../../style/utils");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -38,7 +38,7 @@ const Fieldset = ({
38
38
  const {
39
39
  validationRedesignOptIn
40
40
  } = (0, _react.useContext)(_newValidation.default);
41
- const marginProps = (0, _useFormSpacing.default)(rest);
41
+ const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
42
42
  const [ref, setRef] = (0, _react.useState)(null);
43
43
  const [isFocused, setFocus] = (0, _react.useState)(false);
44
44
  (0, _react.useEffect)(() => {