carbon-react 144.4.0 → 144.5.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 (115) hide show
  1. package/esm/__internal__/checkable-input/checkable-input.style.js +5 -2
  2. package/esm/__internal__/label/label.component.d.ts +4 -2
  3. package/esm/__internal__/label/label.component.js +3 -1
  4. package/esm/__internal__/label/label.style.d.ts +2 -0
  5. package/esm/__internal__/label/label.style.js +5 -1
  6. package/esm/__internal__/utils/helpers/events/composedPath.js +1 -6
  7. package/esm/__internal__/utils/helpers/events/events.js +1 -1
  8. package/esm/__internal__/validation-message/validation-message.component.d.ts +3 -1
  9. package/esm/__internal__/validation-message/validation-message.component.js +4 -2
  10. package/esm/__internal__/validation-message/validation-message.style.d.ts +1 -0
  11. package/esm/__internal__/validation-message/validation-message.style.js +11 -7
  12. package/esm/components/action-popover/action-popover.style.js +8 -8
  13. package/esm/components/breadcrumbs/crumb/crumb.style.js +2 -2
  14. package/esm/components/button-toggle/button-toggle.style.js +19 -19
  15. package/esm/components/card/card.config.d.ts +2 -2
  16. package/esm/components/date/__internal__/date-picker/day-picker.style.js +6 -2
  17. package/esm/components/dialog/dialog.component.d.ts +1 -1
  18. package/esm/components/dialog/dialog.config.d.ts +1 -1
  19. package/esm/components/dialog/dialog.style.js +2 -2
  20. package/esm/components/drawer/drawer.style.js +16 -16
  21. package/esm/components/flat-table/flat-table.component.d.ts +3 -1
  22. package/esm/components/flat-table/flat-table.component.js +3 -1
  23. package/esm/components/flat-table/flat-table.style.js +9 -9
  24. package/esm/components/form/form.config.d.ts +1 -1
  25. package/esm/components/hr/hr.component.d.ts +1 -0
  26. package/esm/components/loader-spinner/loader-spinner.config.d.ts +2 -2
  27. package/esm/components/loader-spinner/loader-spinner.style.js +5 -5
  28. package/esm/components/loader-star/internal/star.component.d.ts +1 -0
  29. package/esm/components/loader-star/loader-star.component.d.ts +1 -0
  30. package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  31. package/esm/components/numeral-date/numeral-date.component.d.ts +1 -1
  32. package/esm/components/pager/pager.style.js +2 -2
  33. package/esm/components/pod/pod.config.d.ts +3 -3
  34. package/esm/components/pod/pod.style.js +34 -34
  35. package/esm/components/progress-tracker/progress-tracker.style.js +2 -2
  36. package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
  37. package/esm/components/switch/__internal__/switch-slider-panel.style.d.ts +1 -0
  38. package/esm/components/switch/__internal__/switch-slider-panel.style.js +6 -4
  39. package/esm/components/switch/__internal__/switch-slider.component.d.ts +2 -1
  40. package/esm/components/switch/__internal__/switch-slider.component.js +6 -3
  41. package/esm/components/switch/__internal__/switch-slider.style.d.ts +2 -1
  42. package/esm/components/switch/__internal__/switch-slider.style.js +7 -6
  43. package/esm/components/switch/switch.component.d.ts +2 -0
  44. package/esm/components/switch/switch.component.js +64 -18
  45. package/esm/components/switch/switch.style.d.ts +6 -1
  46. package/esm/components/switch/switch.style.js +24 -11
  47. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
  48. package/esm/components/textbox/textbox.style.js +8 -8
  49. package/esm/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
  50. package/esm/components/tile/tile.component.d.ts +1 -1
  51. package/esm/components/time/time.style.d.ts +1 -1
  52. package/esm/components/typography/typography.component.d.ts +1 -1
  53. package/esm/components/typography/typography.style.js +1 -1
  54. package/esm/components/vertical-divider/vertical-divider.component.d.ts +1 -0
  55. package/esm/global.d.ts +1 -1
  56. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
  57. package/esm/style/utils/box-gap.d.ts +1 -1
  58. package/lib/__internal__/checkable-input/checkable-input.style.js +5 -2
  59. package/lib/__internal__/label/label.component.d.ts +4 -2
  60. package/lib/__internal__/label/label.component.js +3 -1
  61. package/lib/__internal__/label/label.style.d.ts +2 -0
  62. package/lib/__internal__/label/label.style.js +5 -1
  63. package/lib/__internal__/utils/helpers/events/composedPath.js +1 -6
  64. package/lib/__internal__/utils/helpers/events/events.js +1 -1
  65. package/lib/__internal__/validation-message/validation-message.component.d.ts +3 -1
  66. package/lib/__internal__/validation-message/validation-message.component.js +4 -2
  67. package/lib/__internal__/validation-message/validation-message.style.d.ts +1 -0
  68. package/lib/__internal__/validation-message/validation-message.style.js +11 -7
  69. package/lib/components/action-popover/action-popover.style.js +8 -8
  70. package/lib/components/breadcrumbs/crumb/crumb.style.js +2 -2
  71. package/lib/components/button-toggle/button-toggle.style.js +19 -19
  72. package/lib/components/card/card.config.d.ts +2 -2
  73. package/lib/components/date/__internal__/date-picker/day-picker.style.js +6 -2
  74. package/lib/components/dialog/dialog.component.d.ts +1 -1
  75. package/lib/components/dialog/dialog.config.d.ts +1 -1
  76. package/lib/components/dialog/dialog.style.js +2 -2
  77. package/lib/components/drawer/drawer.style.js +16 -16
  78. package/lib/components/flat-table/flat-table.component.d.ts +3 -1
  79. package/lib/components/flat-table/flat-table.component.js +3 -1
  80. package/lib/components/flat-table/flat-table.style.js +9 -9
  81. package/lib/components/form/form.config.d.ts +1 -1
  82. package/lib/components/hr/hr.component.d.ts +1 -0
  83. package/lib/components/loader-spinner/loader-spinner.config.d.ts +2 -2
  84. package/lib/components/loader-spinner/loader-spinner.style.js +5 -5
  85. package/lib/components/loader-star/internal/star.component.d.ts +1 -0
  86. package/lib/components/loader-star/loader-star.component.d.ts +1 -0
  87. package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  88. package/lib/components/numeral-date/numeral-date.component.d.ts +1 -1
  89. package/lib/components/pager/pager.style.js +2 -2
  90. package/lib/components/pod/pod.config.d.ts +3 -3
  91. package/lib/components/pod/pod.style.js +34 -34
  92. package/lib/components/progress-tracker/progress-tracker.style.js +2 -2
  93. package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
  94. package/lib/components/switch/__internal__/switch-slider-panel.style.d.ts +1 -0
  95. package/lib/components/switch/__internal__/switch-slider-panel.style.js +6 -4
  96. package/lib/components/switch/__internal__/switch-slider.component.d.ts +2 -1
  97. package/lib/components/switch/__internal__/switch-slider.component.js +6 -3
  98. package/lib/components/switch/__internal__/switch-slider.style.d.ts +2 -1
  99. package/lib/components/switch/__internal__/switch-slider.style.js +7 -6
  100. package/lib/components/switch/switch.component.d.ts +2 -0
  101. package/lib/components/switch/switch.component.js +64 -18
  102. package/lib/components/switch/switch.style.d.ts +6 -1
  103. package/lib/components/switch/switch.style.js +24 -11
  104. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
  105. package/lib/components/textbox/textbox.style.js +8 -8
  106. package/lib/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
  107. package/lib/components/tile/tile.component.d.ts +1 -1
  108. package/lib/components/time/time.style.d.ts +1 -1
  109. package/lib/components/typography/typography.component.d.ts +1 -1
  110. package/lib/components/typography/typography.style.js +1 -1
  111. package/lib/components/vertical-divider/vertical-divider.component.d.ts +1 -0
  112. package/lib/global.d.ts +1 -1
  113. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
  114. package/lib/style/utils/box-gap.d.ts +1 -1
  115. package/package.json +3 -10
@@ -114,7 +114,7 @@ const Events = {
114
114
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
115
115
  */
116
116
  composedPath: ev => {
117
- return ev.detail?.enzymeTestingTarget && (0, _composedPath.default)(ev) || ev.composedPath && ev.composedPath() || (0, _composedPath.default)(ev);
117
+ return ev.composedPath?.() || (0, _composedPath.default)(ev);
118
118
  }
119
119
  };
120
120
  var _default = exports.default = Events;
@@ -8,6 +8,8 @@ export interface ValidationMessageProps {
8
8
  /** Indicate that warning has occurred
9
9
  Pass string to display hint with warning */
10
10
  warning?: boolean | string;
11
+ /** Whether this component resides on a dark background */
12
+ isDarkBackground?: boolean;
11
13
  }
12
- declare const ValidationMessage: ({ error, validationId, warning, }: ValidationMessageProps) => React.JSX.Element | null;
14
+ declare const ValidationMessage: ({ error, validationId, warning, isDarkBackground, }: ValidationMessageProps) => React.JSX.Element | null;
13
15
  export default ValidationMessage;
@@ -11,14 +11,16 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
11
11
  const ValidationMessage = ({
12
12
  error,
13
13
  validationId,
14
- warning
14
+ warning,
15
+ isDarkBackground
15
16
  }) => {
16
17
  const validation = error || warning;
17
18
  const isStringValidation = typeof validation === "string";
18
19
  return isStringValidation ? /*#__PURE__*/_react.default.createElement(_validationMessage.default, {
19
20
  id: validationId,
20
21
  isWarning: !!(!error && warning),
21
- "data-role": "validation-message"
22
+ "data-role": "validation-message",
23
+ isDarkBackground: isDarkBackground
22
24
  }, validation) : null;
23
25
  };
24
26
  var _default = exports.default = ValidationMessage;
@@ -1,5 +1,6 @@
1
1
  interface StyledValidationMessageProps {
2
2
  isWarning?: boolean;
3
+ isDarkBackground?: boolean;
3
4
  }
4
5
  declare const StyledValidationMessage: import("styled-components").StyledComponent<"p", any, StyledValidationMessageProps, never>;
5
6
  export default StyledValidationMessage;
@@ -9,12 +9,16 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
9
9
  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; }
10
10
  const StyledValidationMessage = _styledComponents.default.p`
11
11
  ${({
12
- isWarning
13
- }) => (0, _styledComponents.css)`
14
- color: ${isWarning ? "var(--colorsSemanticCaution600)" : "var(--colorsSemanticNegative500)"};
15
- font-weight: ${isWarning ? "normal" : "500"};
16
- margin-top: 0px;
17
- margin-bottom: 8px;
18
- `}
12
+ isWarning,
13
+ isDarkBackground
14
+ }) => {
15
+ const darkBgColour = isDarkBackground ? "var(--colorsSemanticNegative450)" : "var(--colorsSemanticNegative500)";
16
+ return (0, _styledComponents.css)`
17
+ color: ${isWarning ? "var(--colorsSemanticCaution600)" : darkBgColour};
18
+ font-weight: ${isWarning ? "normal" : "500"};
19
+ margin-top: 0px;
20
+ margin-bottom: 8px;
21
+ `;
22
+ }}
19
23
  `;
20
24
  var _default = exports.default = StyledValidationMessage;
@@ -97,18 +97,18 @@ const StyledMenuItem = exports.StyledMenuItem = _styledComponents.default.button
97
97
  childHasSubmenu,
98
98
  hasSubmenu
99
99
  }) => (0, _styledComponents.css)`
100
- justify-content: ${horizontalAlignment === "left" ? "flex-start" : "flex-end"};
100
+ justify-content: ${horizontalAlignment === "left" ? "flex-start" : "flex-end"};
101
101
 
102
- ${horizontalAlignment === "left" && submenuPosition === "right" && (0, _styledComponents.css)`
103
- justify-content: space-between;
104
- `}
102
+ ${horizontalAlignment === "left" && submenuPosition === "right" && (0, _styledComponents.css)`
103
+ justify-content: space-between;
104
+ `}
105
105
 
106
- ${horizontalAlignment === "right" && submenuPosition === "left" && (0, _styledComponents.css)`
107
- ${childHasSubmenu && hasSubmenu && (0, _styledComponents.css)`
108
- justify-content: space-between;
109
- `}
106
+ ${horizontalAlignment === "right" && submenuPosition === "left" && (0, _styledComponents.css)`
107
+ ${childHasSubmenu && hasSubmenu && (0, _styledComponents.css)`
108
+ justify-content: space-between;
110
109
  `}
111
110
  `}
111
+ `}
112
112
 
113
113
  text-decoration: none;
114
114
  background-color: var(--colorsActionMajorYang100);
@@ -39,8 +39,8 @@ const Divider = exports.Divider = _styledComponents.default.span`
39
39
  ${({
40
40
  isDarkBackground
41
41
  }) => (0, _styledComponents.css)`
42
- color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityYin055)"};
43
- `}
42
+ color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityYin055)"};
43
+ `}
44
44
  }
45
45
  `;
46
46
  var _default = exports.default = {
@@ -171,32 +171,32 @@ const StyledButtonToggleWrapper = exports.StyledButtonToggleWrapper = _styledCom
171
171
  ${({
172
172
  grouped
173
173
  }) => (0, _styledComponents.css)`
174
- ${!grouped && (0, _styledComponents.css)`
175
- &&&& {
176
- ${StyledButtonToggle} {
177
- border-radius: var(--borderRadius050);
178
- }
174
+ ${!grouped && (0, _styledComponents.css)`
175
+ &&&& {
176
+ ${StyledButtonToggle} {
177
+ border-radius: var(--borderRadius050);
179
178
  }
180
- `}
179
+ }
180
+ `}
181
181
 
182
- ${grouped && (0, _styledComponents.css)`
183
- &&&& {
184
- :first-of-type {
185
- ${StyledButtonToggle} {
186
- border-top-left-radius: var(--borderRadius050);
187
- border-bottom-left-radius: var(--borderRadius050);
188
- }
182
+ ${grouped && (0, _styledComponents.css)`
183
+ &&&& {
184
+ :first-of-type {
185
+ ${StyledButtonToggle} {
186
+ border-top-left-radius: var(--borderRadius050);
187
+ border-bottom-left-radius: var(--borderRadius050);
189
188
  }
189
+ }
190
190
 
191
- :last-of-type {
192
- ${StyledButtonToggle} {
193
- border-top-right-radius: var(--borderRadius050);
194
- border-bottom-right-radius: var(--borderRadius050);
195
- }
191
+ :last-of-type {
192
+ ${StyledButtonToggle} {
193
+ border-top-right-radius: var(--borderRadius050);
194
+ border-bottom-right-radius: var(--borderRadius050);
196
195
  }
197
196
  }
198
- `}
197
+ }
199
198
  `}
199
+ `}
200
200
 
201
201
  ${({
202
202
  grouped
@@ -1,4 +1,4 @@
1
1
  export declare const CARD_SPACING: readonly ["small", "medium", "large"];
2
2
  export declare const CARD_ALIGNS: readonly ["left", "center", "right"];
3
- export declare type CardAlign = typeof CARD_ALIGNS[number];
4
- export declare type CardSpacing = typeof CARD_SPACING[number];
3
+ export declare type CardAlign = (typeof CARD_ALIGNS)[number];
4
+ export declare type CardSpacing = (typeof CARD_SPACING)[number];
@@ -321,13 +321,17 @@ const StyledDayPicker = _styledComponents.default.div`
321
321
  }
322
322
  }
323
323
 
324
- .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
324
+ .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(
325
+ .DayPicker-Day--outside
326
+ ) {
325
327
  background-color: var(--colorsActionMajor500);
326
328
  color: var(--colorsUtilityYang100);
327
329
  border-radius: var(--borderRadius400);
328
330
  }
329
331
 
330
- .DayPicker-Day--selected.DayPicker-Day--disabled:not(.DayPicker-Day--outside) {
332
+ .DayPicker-Day--selected.DayPicker-Day--disabled:not(
333
+ .DayPicker-Day--outside
334
+ ) {
331
335
  background-color: var(--colorsActionMajor500);
332
336
  color: var(--colorsUtilityYang100);
333
337
  }
@@ -4,7 +4,7 @@ import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  import { DialogSizes } from "./dialog.config";
5
5
  import { CustomRefObject } from "../../__internal__/focus-trap";
6
6
  declare const PADDING_VALUES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
7
- declare type PaddingValues = typeof PADDING_VALUES[number];
7
+ declare type PaddingValues = (typeof PADDING_VALUES)[number];
8
8
  export interface ContentPaddingInterface {
9
9
  p?: PaddingValues;
10
10
  py?: PaddingValues;
@@ -1,2 +1,2 @@
1
1
  export declare const DIALOG_SIZES: readonly ["auto", "extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large", "maximise"];
2
- export declare type DialogSizes = typeof DIALOG_SIZES[number];
2
+ export declare type DialogSizes = (typeof DIALOG_SIZES)[number];
@@ -63,8 +63,8 @@ const StyledDialog = exports.StyledDialog = _styledComponents.default.div`
63
63
  ${({
64
64
  backgroundColor
65
65
  }) => (0, _styledComponents.css)`
66
- background-color: ${backgroundColor};
67
- `}
66
+ background-color: ${backgroundColor};
67
+ `}
68
68
 
69
69
  ${({
70
70
  dialogHeight
@@ -40,26 +40,26 @@ const StyledDrawerSidebar = exports.StyledDrawerSidebar = (0, _styledComponents.
40
40
  hasControls,
41
41
  isExpanded
42
42
  }) => (0, _styledComponents.css)`
43
- ${!isExpanded && (0, _styledComponents.css)`
44
- display: none;
45
- opacity: 0;
46
- `}
43
+ ${!isExpanded && (0, _styledComponents.css)`
44
+ display: none;
45
+ opacity: 0;
46
+ `}
47
47
 
48
- ${isExpanded && (0, _styledComponents.css)`
49
- display: flex;
50
- flex-direction: column;
51
- flex: 1 1 0%;
52
- `}
48
+ ${isExpanded && (0, _styledComponents.css)`
49
+ display: flex;
50
+ flex-direction: column;
51
+ flex: 1 1 0%;
52
+ `}
53
53
 
54
54
  ${hasControls && (0, _styledComponents.css)`
55
- ${_tabs.default} {
56
- margin-top: 48px;
57
- ${!isExpanded && (0, _styledComponents.css)`
58
- display: none;
59
- `}
60
- }
61
- `}
55
+ ${_tabs.default} {
56
+ margin-top: 48px;
57
+ ${!isExpanded && (0, _styledComponents.css)`
58
+ display: none;
59
+ `}
60
+ }
62
61
  `}
62
+ `}
63
63
 
64
64
  &::-webkit-scrollbar {
65
65
  width: 12px;
@@ -35,9 +35,11 @@ export interface FlatTableProps extends MarginProps, Omit<TagProps, "data-compon
35
35
  overflowX?: string;
36
36
  /** Width of the table. Any valid CSS string */
37
37
  width?: string;
38
+ /** The title to describe the table when one or more tables are used on a single page */
39
+ title?: string;
38
40
  }
39
41
  export declare const FlatTable: {
40
- ({ caption, children, hasStickyHead, colorTheme, footer, hasStickyFooter, height, isZebra, size, hasMaxHeight, hasOuterVerticalBorders, bottomBorderRadius, ariaDescribedby, minHeight, overflowX, width, ...rest }: FlatTableProps): React.JSX.Element;
42
+ ({ caption, children, hasStickyHead, colorTheme, footer, hasStickyFooter, height, isZebra, size, hasMaxHeight, hasOuterVerticalBorders, bottomBorderRadius, ariaDescribedby, minHeight, overflowX, width, title, ...rest }: FlatTableProps): React.JSX.Element;
41
43
  displayName: string;
42
44
  };
43
45
  export default FlatTable;
@@ -32,6 +32,7 @@ const FlatTable = ({
32
32
  minHeight,
33
33
  overflowX,
34
34
  width,
35
+ title,
35
36
  ...rest
36
37
  }) => {
37
38
  const wrapperRef = (0, _react.useRef)(null);
@@ -171,7 +172,8 @@ const FlatTable = ({
171
172
  onKeyDown: handleKeyDown,
172
173
  isFocused: focused
173
174
  }, rest, {
174
- "data-component": "flat-table-wrapper"
175
+ "data-component": "flat-table-wrapper",
176
+ title: title
175
177
  }), /*#__PURE__*/_react.default.createElement(_flatTable.StyledTableContainer, {
176
178
  ref: container,
177
179
  onFocus: () => {
@@ -137,20 +137,20 @@ const StyledFlatTableWrapper = exports.StyledFlatTableWrapper = (0, _styledCompo
137
137
  theme,
138
138
  isFocused
139
139
  }) => (0, _styledComponents.css)`
140
- box-sizing: border-box;
140
+ box-sizing: border-box;
141
141
 
142
- /* istanbul ignore next */
143
- ${theme.focusRedesignOptOut && isFocused && /* istanbul ignore next */
142
+ /* istanbul ignore next */
143
+ ${theme.focusRedesignOptOut && isFocused && /* istanbul ignore next */
144
144
  (0, _styledComponents.css)`
145
- ${oldFocusStyling}
146
- `}
145
+ ${oldFocusStyling}
146
+ `}
147
147
 
148
- ${!theme.focusRedesignOptOut && isFocused && (0, _styledComponents.css)`
149
- ${(0, _addFocusStyling.default)()}
150
- `}
148
+ ${!theme.focusRedesignOptOut && isFocused && (0, _styledComponents.css)`
149
+ ${(0, _addFocusStyling.default)()}
150
+ `}
151
151
 
152
152
  ${isInSidebar ? "min-width: fit-content;" : ""}
153
- `}
153
+ `}
154
154
 
155
155
  ${({
156
156
  colorTheme
@@ -1,5 +1,5 @@
1
1
  export declare const FORM_BUTTON_ALIGNMENTS: readonly ["left", "right"];
2
- export declare type FormButtonAlignment = typeof FORM_BUTTON_ALIGNMENTS[number];
2
+ export declare type FormButtonAlignment = (typeof FORM_BUTTON_ALIGNMENTS)[number];
3
3
  export declare const formSpacing: {
4
4
  0: string;
5
5
  1: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { MarginProps } from "styled-system";
2
3
  export interface HrProps extends MarginProps {
3
4
  /** Set whether the component should be recognised by assistive technologies */
@@ -1,7 +1,7 @@
1
1
  declare const LOADER_SPINNER_VARIANTS: readonly ["action", "neutral", "inverse", "gradient-grey", "gradient-white"];
2
- declare type LoaderSpinnerVariants = typeof LOADER_SPINNER_VARIANTS[number];
2
+ declare type LoaderSpinnerVariants = (typeof LOADER_SPINNER_VARIANTS)[number];
3
3
  declare const LOADER_SPINNER_SIZES: readonly ["extra-small", "small", "medium", "large", "extra-large"];
4
- declare type LoaderSpinnerSizes = typeof LOADER_SPINNER_SIZES[number];
4
+ declare type LoaderSpinnerSizes = (typeof LOADER_SPINNER_SIZES)[number];
5
5
  declare type LoaderSpinnerSizeParams = Record<LoaderSpinnerSizes, {
6
6
  wrapperDimensions: number;
7
7
  strokeWidth: number;
@@ -36,11 +36,11 @@ const StyledLabel = exports.StyledLabel = (0, _styledComponents.default)(_typogr
36
36
  ${({
37
37
  size
38
38
  }) => (0, _styledComponents.css)`
39
- display: flex;
40
- justify-content: center;
41
- text-align: center;
42
- ${size === "extra-small" ? "margin-left: var(--spacing100)" : `margin-top: ${_loaderSpinner.LOADER_SPINNER_SIZE_PARAMS[size].labelMarginTop}px`};
43
- `}
39
+ display: flex;
40
+ justify-content: center;
41
+ text-align: center;
42
+ ${size === "extra-small" ? "margin-left: var(--spacing100)" : `margin-top: ${_loaderSpinner.LOADER_SPINNER_SIZE_PARAMS[size].labelMarginTop}px`};
43
+ `}
44
44
  `;
45
45
  const StyledSpinnerCircleSvg = exports.StyledSpinnerCircleSvg = _styledComponents.default.svg`
46
46
  ${({
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface StarProps {
2
3
  starContainerClassName: "star-1" | "star-2" | "star-3";
3
4
  gradientId: "gradient1" | "gradient2" | "gradient3";
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
2
3
  export interface LoaderStarProps extends Omit<TagProps, "data-component"> {
3
4
  /**
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { VariantType } from "../menu-item";
3
3
  import { TagProps } from "../../../__internal__/utils/helpers/tags";
4
4
  declare const AS_VALUES: readonly ["h2", "h3", "h4", "h5", "h6"];
5
- declare type AllowedAsValues = typeof AS_VALUES[number];
5
+ declare type AllowedAsValues = (typeof AS_VALUES)[number];
6
6
  export interface MenuTitleProps extends TagProps {
7
7
  children?: React.ReactNode;
8
8
  text: string;
@@ -93,6 +93,6 @@ export interface NumeralDateProps<DateType extends NumeralDateObject = FullDate>
93
93
  /** Flag to configure component as optional. */
94
94
  isOptional?: boolean;
95
95
  }
96
- export declare type ValidDateFormat = typeof ALLOWED_DATE_FORMATS[number];
96
+ export declare type ValidDateFormat = (typeof ALLOWED_DATE_FORMATS)[number];
97
97
  export declare const NumeralDate: <DateType extends NumeralDateObject = FullDate>({ dateFormat, defaultValue, disabled, error, warning, "data-component": dataComponent, "data-element": dataElement, "data-role": dataRole, info, id, name, onBlur, onChange, value, validationOnLabel, label, labelInline, labelWidth, labelAlign, labelHelp, labelSpacing, fieldHelp, adaptiveLabelBreakpoint, required, isOptional, readOnly, size, enableInternalError, enableInternalWarning, tooltipPosition, helpAriaLabel, dayRef, monthRef, yearRef, ...rest }: NumeralDateProps<DateType>) => React.JSX.Element;
98
98
  export default NumeralDate;
@@ -36,8 +36,8 @@ const StyledPagerContainer = exports.StyledPagerContainer = _styledComponents.de
36
36
  ${({
37
37
  variant
38
38
  }) => (0, _styledComponents.css)`
39
- background-color: ${variant === "alternate" ? "var(--colorsUtilityMajor040)" : "var(--colorsUtilityMajor010)"};
40
- `}
39
+ background-color: ${variant === "alternate" ? "var(--colorsUtilityMajor040)" : "var(--colorsUtilityMajor010)"};
40
+ `}
41
41
  `;
42
42
  const StyledPagerSizeOptions = exports.StyledPagerSizeOptions = _styledComponents.default.div`
43
43
  display: flex;
@@ -1,6 +1,6 @@
1
1
  export declare const POD_SIZES: readonly ["extra-small", "small", "medium", "large", "extra-large"];
2
2
  export declare const POD_ALIGNMENTS: readonly ["left", "center", "right"];
3
3
  export declare const POD_VARIANTS: readonly ["primary", "secondary", "tertiary", "tile", "transparent"];
4
- export declare type PodSize = typeof POD_SIZES[number];
5
- export declare type PodAlignment = typeof POD_ALIGNMENTS[number];
6
- export declare type PodVariant = typeof POD_VARIANTS[number];
4
+ export declare type PodSize = (typeof POD_SIZES)[number];
5
+ export declare type PodAlignment = (typeof POD_ALIGNMENTS)[number];
6
+ export declare type PodVariant = (typeof POD_VARIANTS)[number];
@@ -48,52 +48,52 @@ const StyledBlock = exports.StyledBlock = _styledComponents.default.div`
48
48
  isHovered,
49
49
  isFocused
50
50
  }) => (0, _styledComponents.css)`
51
- box-sizing: border-box;
52
- border-radius: var(--borderRadius100);
53
- display: flex;
54
- flex-direction: column;
55
- background-color: ${blockBackgrounds[variant]};
56
- width: 100%;
57
- height: 100%;
51
+ box-sizing: border-box;
52
+ border-radius: var(--borderRadius100);
53
+ display: flex;
54
+ flex-direction: column;
55
+ background-color: ${blockBackgrounds[variant]};
56
+ width: 100%;
57
+ height: 100%;
58
58
 
59
- ${variant === "tile" && "box-shadow: 0 2px 3px 0 rgba(2, 18, 36, 0.2)"};
59
+ ${variant === "tile" && "box-shadow: 0 2px 3px 0 rgba(2, 18, 36, 0.2)"};
60
60
 
61
- ${noBorder ? "border: none" : `border: 1px solid var(--colorsUtilityMajor100)`};
61
+ ${noBorder ? "border: none" : `border: 1px solid var(--colorsUtilityMajor100)`};
62
62
 
63
- ${hasButtons && !(fullWidth || internalEditButton) && "width: auto;"};
63
+ ${hasButtons && !(fullWidth || internalEditButton) && "width: auto;"};
64
64
 
65
- ${contentTriggersEdit && "cursor: pointer"};
65
+ ${contentTriggersEdit && "cursor: pointer"};
66
66
 
67
- ${(isHovered || isFocused) && (0, _styledComponents.css)`
68
- background-color: var(--colorsUtilityMajor075);
67
+ ${(isHovered || isFocused) && (0, _styledComponents.css)`
68
+ background-color: var(--colorsUtilityMajor075);
69
69
 
70
- ${internalEditButton && variant === "tile" && "background-color: var(--colorsUtilityMajorTransparent);"}
70
+ ${internalEditButton && variant === "tile" && "background-color: var(--colorsUtilityMajorTransparent);"}
71
71
 
72
- ${contentTriggersEdit && (0, _styledComponents.css)`
73
- background-color: var(--colorsActionMajor600);
74
- * {
75
- color: var(--colorsUtilityYang100);
76
- }
77
- `}
72
+ ${contentTriggersEdit && (0, _styledComponents.css)`
73
+ background-color: var(--colorsActionMajor600);
74
+ * {
75
+ color: var(--colorsUtilityYang100);
76
+ }
78
77
  `}
78
+ `}
79
79
 
80
- ${(!internalEditButton || contentTriggersEdit) && (isFocused ? (0, _styledComponents.css)`
81
- outline: 3px solid var(--colorsSemanticFocus500);
82
- border: none;
83
- padding: ${noBorder ? 0 : 1}px;
84
- ` : (0, _styledComponents.css)`
85
- outline: none;
86
- `)}
80
+ ${(!internalEditButton || contentTriggersEdit) && (isFocused ? (0, _styledComponents.css)`
81
+ outline: 3px solid var(--colorsSemanticFocus500);
82
+ border: none;
83
+ padding: ${noBorder ? 0 : 1}px;
84
+ ` : (0, _styledComponents.css)`
85
+ outline: none;
86
+ `)}
87
87
 
88
88
  ${softDelete && (0, _styledComponents.css)`
89
- border: none;
90
- background-color: var(--colorsActionDisabled500);
89
+ border: none;
90
+ background-color: var(--colorsActionDisabled500);
91
91
 
92
- & > * {
93
- color: var(--colorsUtilityYin065);
94
- }
95
- `};
96
- `}
92
+ & > * {
93
+ color: var(--colorsUtilityYin065);
94
+ }
95
+ `};
96
+ `}
97
97
  `;
98
98
  const contentPaddings = {
99
99
  "extra-small": "8px",
@@ -44,8 +44,8 @@ const StyledProgressTracker = exports.StyledProgressTracker = _styledComponents.
44
44
  ${({
45
45
  length
46
46
  }) => (0, _styledComponents.css)`
47
- width: ${length};
48
- `};
47
+ width: ${length};
48
+ `};
49
49
  ${({
50
50
  labelsPosition
51
51
  }) => labelsPosition === "left" && (0, _styledComponents.css)`
@@ -11,7 +11,9 @@ const StyledListActionButtonWrapper = _styledComponents.default.div`
11
11
  padding-top: var(--spacing100);
12
12
  padding-bottom: var(--spacing100);
13
13
  border-top: 1px solid var(--colorsUtilityDisabled600);
14
- box-shadow: 0 0px 0 0 rgba(0, 0, 0, 0), 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
14
+ box-shadow:
15
+ 0 0px 0 0 rgba(0, 0, 0, 0),
16
+ 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
15
17
  width: 100%;
16
18
  position: sticky;
17
19
  bottom: 0;
@@ -2,6 +2,7 @@ import { SwitchProps } from "../switch.component";
2
2
  export interface SwitchSliderPanelProps {
3
3
  isLoading?: boolean;
4
4
  size?: SwitchProps["size"];
5
+ isDarkBackground?: boolean;
5
6
  }
6
7
  declare const SwitchSliderPanel: import("styled-components").StyledComponent<"div", any, SwitchSliderPanelProps, never>;
7
8
  export default SwitchSliderPanel;
@@ -5,29 +5,31 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
- var _loader = _interopRequireDefault(require("../../loader/loader.style"));
9
8
  var _loaderSquare = _interopRequireDefault(require("../../loader/loader-square.style"));
9
+ var _loader = _interopRequireDefault(require("../../loader/loader.style"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  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); }
12
12
  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; }
13
13
  const SwitchSliderPanel = _styledComponents.default.div`
14
14
  ${({
15
15
  isLoading,
16
- size
16
+ size,
17
+ isDarkBackground
17
18
  }) => (0, _styledComponents.css)`
18
19
  border: 0;
19
- color: var(--colorsActionMinorYang100);
20
+ color: ${isDarkBackground ? "var(--colorsUtilityYin100)" : "var(--colorsActionMinorYang100)"};
20
21
  margin: auto;
21
22
  position: absolute;
22
23
  left: 0;
23
24
 
24
25
  &[type="on"] {
26
+ color: ${isDarkBackground ? "var(--colorsUtilityYin100)" : "var(--colorsUtilityYang100)"};
25
27
  margin-left: 9px;
26
28
  padding-right: ${size === "large" ? "43px" : "27px"};
27
29
  }
28
30
 
29
31
  &[type="off"] {
30
- color: var(--colorsActionMinor500);
32
+ color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsActionMinor500)"};
31
33
  margin-right: 9px;
32
34
  padding-left: ${size === "large" ? "43px" : "27px"};
33
35
  }
@@ -6,6 +6,7 @@ export interface SwitchSliderProps extends ValidationProps {
6
6
  loading?: boolean;
7
7
  size?: "small" | "large";
8
8
  useValidationIcon?: boolean;
9
+ isDarkBackground?: boolean;
9
10
  }
10
- declare const SwitchSlider: ({ checked, disabled, loading, size, error, warning, info, useValidationIcon, }: SwitchSliderProps) => React.JSX.Element;
11
+ declare const SwitchSlider: ({ checked, disabled, loading, size, error, warning, info, useValidationIcon, isDarkBackground, }: SwitchSliderProps) => React.JSX.Element;
11
12
  export default SwitchSlider;
@@ -21,7 +21,8 @@ const SwitchSlider = ({
21
21
  error,
22
22
  warning,
23
23
  info,
24
- useValidationIcon
24
+ useValidationIcon,
25
+ isDarkBackground
25
26
  }) => {
26
27
  const locale = (0, _useLocale.default)();
27
28
  const onText = locale.switch.on();
@@ -38,13 +39,15 @@ const SwitchSlider = ({
38
39
  size,
39
40
  error,
40
41
  warning,
41
- info
42
+ info,
43
+ isDarkBackground
42
44
  };
43
45
  const sliderPanelStyleProps = {
44
46
  isLoading: loading,
45
47
  size,
46
48
  type: checked ? "on" : "off",
47
- disabled
49
+ disabled,
50
+ isDarkBackground
48
51
  };
49
52
  const loaderProps = {
50
53
  isInsideButton: true,