carbon-react 144.4.0 → 144.4.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 (73) hide show
  1. package/esm/__internal__/utils/helpers/events/composedPath.js +1 -6
  2. package/esm/__internal__/utils/helpers/events/events.js +1 -1
  3. package/esm/components/action-popover/action-popover.style.js +8 -8
  4. package/esm/components/breadcrumbs/crumb/crumb.style.js +2 -2
  5. package/esm/components/button-toggle/button-toggle.style.js +19 -19
  6. package/esm/components/card/card.config.d.ts +2 -2
  7. package/esm/components/date/__internal__/date-picker/day-picker.style.js +6 -2
  8. package/esm/components/dialog/dialog.component.d.ts +1 -1
  9. package/esm/components/dialog/dialog.config.d.ts +1 -1
  10. package/esm/components/dialog/dialog.style.js +2 -2
  11. package/esm/components/drawer/drawer.style.js +16 -16
  12. package/esm/components/flat-table/flat-table.style.js +9 -9
  13. package/esm/components/form/form.config.d.ts +1 -1
  14. package/esm/components/hr/hr.component.d.ts +1 -0
  15. package/esm/components/loader-spinner/loader-spinner.config.d.ts +2 -2
  16. package/esm/components/loader-spinner/loader-spinner.style.js +5 -5
  17. package/esm/components/loader-star/internal/star.component.d.ts +1 -0
  18. package/esm/components/loader-star/loader-star.component.d.ts +1 -0
  19. package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  20. package/esm/components/numeral-date/numeral-date.component.d.ts +1 -1
  21. package/esm/components/pager/pager.style.js +2 -2
  22. package/esm/components/pod/pod.config.d.ts +3 -3
  23. package/esm/components/pod/pod.style.js +34 -34
  24. package/esm/components/progress-tracker/progress-tracker.style.js +2 -2
  25. package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
  26. package/esm/components/switch/switch.style.js +8 -8
  27. package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
  28. package/esm/components/textbox/textbox.style.js +8 -8
  29. package/esm/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
  30. package/esm/components/tile/tile.component.d.ts +1 -1
  31. package/esm/components/typography/typography.component.d.ts +1 -1
  32. package/esm/components/typography/typography.style.js +1 -1
  33. package/esm/components/vertical-divider/vertical-divider.component.d.ts +1 -0
  34. package/esm/global.d.ts +1 -1
  35. package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
  36. package/esm/style/utils/box-gap.d.ts +1 -1
  37. package/lib/__internal__/utils/helpers/events/composedPath.js +1 -6
  38. package/lib/__internal__/utils/helpers/events/events.js +1 -1
  39. package/lib/components/action-popover/action-popover.style.js +8 -8
  40. package/lib/components/breadcrumbs/crumb/crumb.style.js +2 -2
  41. package/lib/components/button-toggle/button-toggle.style.js +19 -19
  42. package/lib/components/card/card.config.d.ts +2 -2
  43. package/lib/components/date/__internal__/date-picker/day-picker.style.js +6 -2
  44. package/lib/components/dialog/dialog.component.d.ts +1 -1
  45. package/lib/components/dialog/dialog.config.d.ts +1 -1
  46. package/lib/components/dialog/dialog.style.js +2 -2
  47. package/lib/components/drawer/drawer.style.js +16 -16
  48. package/lib/components/flat-table/flat-table.style.js +9 -9
  49. package/lib/components/form/form.config.d.ts +1 -1
  50. package/lib/components/hr/hr.component.d.ts +1 -0
  51. package/lib/components/loader-spinner/loader-spinner.config.d.ts +2 -2
  52. package/lib/components/loader-spinner/loader-spinner.style.js +5 -5
  53. package/lib/components/loader-star/internal/star.component.d.ts +1 -0
  54. package/lib/components/loader-star/loader-star.component.d.ts +1 -0
  55. package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
  56. package/lib/components/numeral-date/numeral-date.component.d.ts +1 -1
  57. package/lib/components/pager/pager.style.js +2 -2
  58. package/lib/components/pod/pod.config.d.ts +3 -3
  59. package/lib/components/pod/pod.style.js +34 -34
  60. package/lib/components/progress-tracker/progress-tracker.style.js +2 -2
  61. package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
  62. package/lib/components/switch/switch.style.js +8 -8
  63. package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
  64. package/lib/components/textbox/textbox.style.js +8 -8
  65. package/lib/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
  66. package/lib/components/tile/tile.component.d.ts +1 -1
  67. package/lib/components/typography/typography.component.d.ts +1 -1
  68. package/lib/components/typography/typography.style.js +1 -1
  69. package/lib/components/vertical-divider/vertical-divider.component.d.ts +1 -0
  70. package/lib/global.d.ts +1 -1
  71. package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
  72. package/lib/style/utils/box-gap.d.ts +1 -1
  73. package/package.json +3 -10
@@ -4,14 +4,9 @@
4
4
 
5
5
  // https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
6
6
  export default ev => {
7
- // When testing with enzyme, we want to trigger a listener on an element but pretend
8
- // that it bubbled from the enzymeTestingTarget
9
- // e.g. document.dispatchEvent(new MouseClick('click', {
10
- // detail: {enzymeTestingTarget: document.body}
11
- // }))
12
7
  // In this example composedPath would show that the event started at document.body
13
8
  // but it would trigger the eventListener on document
14
- let element = ev.detail && ev.detail.enzymeTestingTarget || ev.target || null;
9
+ let element = ev.target || null;
15
10
  if (!element || !element.parentElement) {
16
11
  return [];
17
12
  }
@@ -108,7 +108,7 @@ const Events = {
108
108
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
109
109
  */
110
110
  composedPath: ev => {
111
- return ev.detail?.enzymeTestingTarget && composedPath(ev) || ev.composedPath && ev.composedPath() || composedPath(ev);
111
+ return ev.composedPath?.() || composedPath(ev);
112
112
  }
113
113
  };
114
114
  export default Events;
@@ -88,18 +88,18 @@ const StyledMenuItem = styled.button`
88
88
  childHasSubmenu,
89
89
  hasSubmenu
90
90
  }) => css`
91
- justify-content: ${horizontalAlignment === "left" ? "flex-start" : "flex-end"};
91
+ justify-content: ${horizontalAlignment === "left" ? "flex-start" : "flex-end"};
92
92
 
93
- ${horizontalAlignment === "left" && submenuPosition === "right" && css`
94
- justify-content: space-between;
95
- `}
93
+ ${horizontalAlignment === "left" && submenuPosition === "right" && css`
94
+ justify-content: space-between;
95
+ `}
96
96
 
97
- ${horizontalAlignment === "right" && submenuPosition === "left" && css`
98
- ${childHasSubmenu && hasSubmenu && css`
99
- justify-content: space-between;
100
- `}
97
+ ${horizontalAlignment === "right" && submenuPosition === "left" && css`
98
+ ${childHasSubmenu && hasSubmenu && css`
99
+ justify-content: space-between;
101
100
  `}
102
101
  `}
102
+ `}
103
103
 
104
104
  text-decoration: none;
105
105
  background-color: var(--colorsActionMajorYang100);
@@ -30,8 +30,8 @@ export const Divider = styled.span`
30
30
  ${({
31
31
  isDarkBackground
32
32
  }) => css`
33
- color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityYin055)"};
34
- `}
33
+ color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityYin055)"};
34
+ `}
35
35
  }
36
36
  `;
37
37
  export default {
@@ -162,32 +162,32 @@ const StyledButtonToggleWrapper = styled.div`
162
162
  ${({
163
163
  grouped
164
164
  }) => css`
165
- ${!grouped && css`
166
- &&&& {
167
- ${StyledButtonToggle} {
168
- border-radius: var(--borderRadius050);
169
- }
165
+ ${!grouped && css`
166
+ &&&& {
167
+ ${StyledButtonToggle} {
168
+ border-radius: var(--borderRadius050);
170
169
  }
171
- `}
170
+ }
171
+ `}
172
172
 
173
- ${grouped && css`
174
- &&&& {
175
- :first-of-type {
176
- ${StyledButtonToggle} {
177
- border-top-left-radius: var(--borderRadius050);
178
- border-bottom-left-radius: var(--borderRadius050);
179
- }
173
+ ${grouped && css`
174
+ &&&& {
175
+ :first-of-type {
176
+ ${StyledButtonToggle} {
177
+ border-top-left-radius: var(--borderRadius050);
178
+ border-bottom-left-radius: var(--borderRadius050);
180
179
  }
180
+ }
181
181
 
182
- :last-of-type {
183
- ${StyledButtonToggle} {
184
- border-top-right-radius: var(--borderRadius050);
185
- border-bottom-right-radius: var(--borderRadius050);
186
- }
182
+ :last-of-type {
183
+ ${StyledButtonToggle} {
184
+ border-top-right-radius: var(--borderRadius050);
185
+ border-bottom-right-radius: var(--borderRadius050);
187
186
  }
188
187
  }
189
- `}
188
+ }
190
189
  `}
190
+ `}
191
191
 
192
192
  ${({
193
193
  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];
@@ -312,13 +312,17 @@ const StyledDayPicker = styled.div`
312
312
  }
313
313
  }
314
314
 
315
- .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
315
+ .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(
316
+ .DayPicker-Day--outside
317
+ ) {
316
318
  background-color: var(--colorsActionMajor500);
317
319
  color: var(--colorsUtilityYang100);
318
320
  border-radius: var(--borderRadius400);
319
321
  }
320
322
 
321
- .DayPicker-Day--selected.DayPicker-Day--disabled:not(.DayPicker-Day--outside) {
323
+ .DayPicker-Day--selected.DayPicker-Day--disabled:not(
324
+ .DayPicker-Day--outside
325
+ ) {
322
326
  background-color: var(--colorsActionMajor500);
323
327
  color: var(--colorsUtilityYang100);
324
328
  }
@@ -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];
@@ -54,8 +54,8 @@ const StyledDialog = styled.div`
54
54
  ${({
55
55
  backgroundColor
56
56
  }) => css`
57
- background-color: ${backgroundColor};
58
- `}
57
+ background-color: ${backgroundColor};
58
+ `}
59
59
 
60
60
  ${({
61
61
  dialogHeight
@@ -31,26 +31,26 @@ const StyledDrawerSidebar = styled(Box)`
31
31
  hasControls,
32
32
  isExpanded
33
33
  }) => css`
34
- ${!isExpanded && css`
35
- display: none;
36
- opacity: 0;
37
- `}
34
+ ${!isExpanded && css`
35
+ display: none;
36
+ opacity: 0;
37
+ `}
38
38
 
39
- ${isExpanded && css`
40
- display: flex;
41
- flex-direction: column;
42
- flex: 1 1 0%;
43
- `}
39
+ ${isExpanded && css`
40
+ display: flex;
41
+ flex-direction: column;
42
+ flex: 1 1 0%;
43
+ `}
44
44
 
45
45
  ${hasControls && css`
46
- ${StyledTabs} {
47
- margin-top: 48px;
48
- ${!isExpanded && css`
49
- display: none;
50
- `}
51
- }
52
- `}
46
+ ${StyledTabs} {
47
+ margin-top: 48px;
48
+ ${!isExpanded && css`
49
+ display: none;
50
+ `}
51
+ }
53
52
  `}
53
+ `}
54
54
 
55
55
  &::-webkit-scrollbar {
56
56
  width: 12px;
@@ -128,20 +128,20 @@ const StyledFlatTableWrapper = styled(StyledBox)`
128
128
  theme,
129
129
  isFocused
130
130
  }) => css`
131
- box-sizing: border-box;
131
+ box-sizing: border-box;
132
132
 
133
- /* istanbul ignore next */
134
- ${theme.focusRedesignOptOut && isFocused && /* istanbul ignore next */
133
+ /* istanbul ignore next */
134
+ ${theme.focusRedesignOptOut && isFocused && /* istanbul ignore next */
135
135
  css`
136
- ${oldFocusStyling}
137
- `}
136
+ ${oldFocusStyling}
137
+ `}
138
138
 
139
- ${!theme.focusRedesignOptOut && isFocused && css`
140
- ${addFocusStyling()}
141
- `}
139
+ ${!theme.focusRedesignOptOut && isFocused && css`
140
+ ${addFocusStyling()}
141
+ `}
142
142
 
143
143
  ${isInSidebar ? "min-width: fit-content;" : ""}
144
- `}
144
+ `}
145
145
 
146
146
  ${({
147
147
  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;
@@ -27,11 +27,11 @@ export const StyledLabel = styled(Typography)`
27
27
  ${({
28
28
  size
29
29
  }) => css`
30
- display: flex;
31
- justify-content: center;
32
- text-align: center;
33
- ${size === "extra-small" ? "margin-left: var(--spacing100)" : `margin-top: ${LOADER_SPINNER_SIZE_PARAMS[size].labelMarginTop}px`};
34
- `}
30
+ display: flex;
31
+ justify-content: center;
32
+ text-align: center;
33
+ ${size === "extra-small" ? "margin-left: var(--spacing100)" : `margin-top: ${LOADER_SPINNER_SIZE_PARAMS[size].labelMarginTop}px`};
34
+ `}
35
35
  `;
36
36
  export const StyledSpinnerCircleSvg = styled.svg`
37
37
  ${({
@@ -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;
@@ -27,8 +27,8 @@ const StyledPagerContainer = styled.div`
27
27
  ${({
28
28
  variant
29
29
  }) => css`
30
- background-color: ${variant === "alternate" ? "var(--colorsUtilityMajor040)" : "var(--colorsUtilityMajor010)"};
31
- `}
30
+ background-color: ${variant === "alternate" ? "var(--colorsUtilityMajor040)" : "var(--colorsUtilityMajor010)"};
31
+ `}
32
32
  `;
33
33
  const StyledPagerSizeOptions = styled.div`
34
34
  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];
@@ -39,52 +39,52 @@ const StyledBlock = styled.div`
39
39
  isHovered,
40
40
  isFocused
41
41
  }) => css`
42
- box-sizing: border-box;
43
- border-radius: var(--borderRadius100);
44
- display: flex;
45
- flex-direction: column;
46
- background-color: ${blockBackgrounds[variant]};
47
- width: 100%;
48
- height: 100%;
42
+ box-sizing: border-box;
43
+ border-radius: var(--borderRadius100);
44
+ display: flex;
45
+ flex-direction: column;
46
+ background-color: ${blockBackgrounds[variant]};
47
+ width: 100%;
48
+ height: 100%;
49
49
 
50
- ${variant === "tile" && "box-shadow: 0 2px 3px 0 rgba(2, 18, 36, 0.2)"};
50
+ ${variant === "tile" && "box-shadow: 0 2px 3px 0 rgba(2, 18, 36, 0.2)"};
51
51
 
52
- ${noBorder ? "border: none" : `border: 1px solid var(--colorsUtilityMajor100)`};
52
+ ${noBorder ? "border: none" : `border: 1px solid var(--colorsUtilityMajor100)`};
53
53
 
54
- ${hasButtons && !(fullWidth || internalEditButton) && "width: auto;"};
54
+ ${hasButtons && !(fullWidth || internalEditButton) && "width: auto;"};
55
55
 
56
- ${contentTriggersEdit && "cursor: pointer"};
56
+ ${contentTriggersEdit && "cursor: pointer"};
57
57
 
58
- ${(isHovered || isFocused) && css`
59
- background-color: var(--colorsUtilityMajor075);
58
+ ${(isHovered || isFocused) && css`
59
+ background-color: var(--colorsUtilityMajor075);
60
60
 
61
- ${internalEditButton && variant === "tile" && "background-color: var(--colorsUtilityMajorTransparent);"}
61
+ ${internalEditButton && variant === "tile" && "background-color: var(--colorsUtilityMajorTransparent);"}
62
62
 
63
- ${contentTriggersEdit && css`
64
- background-color: var(--colorsActionMajor600);
65
- * {
66
- color: var(--colorsUtilityYang100);
67
- }
68
- `}
63
+ ${contentTriggersEdit && css`
64
+ background-color: var(--colorsActionMajor600);
65
+ * {
66
+ color: var(--colorsUtilityYang100);
67
+ }
69
68
  `}
69
+ `}
70
70
 
71
- ${(!internalEditButton || contentTriggersEdit) && (isFocused ? css`
72
- outline: 3px solid var(--colorsSemanticFocus500);
73
- border: none;
74
- padding: ${noBorder ? 0 : 1}px;
75
- ` : css`
76
- outline: none;
77
- `)}
71
+ ${(!internalEditButton || contentTriggersEdit) && (isFocused ? css`
72
+ outline: 3px solid var(--colorsSemanticFocus500);
73
+ border: none;
74
+ padding: ${noBorder ? 0 : 1}px;
75
+ ` : css`
76
+ outline: none;
77
+ `)}
78
78
 
79
79
  ${softDelete && css`
80
- border: none;
81
- background-color: var(--colorsActionDisabled500);
80
+ border: none;
81
+ background-color: var(--colorsActionDisabled500);
82
82
 
83
- & > * {
84
- color: var(--colorsUtilityYin065);
85
- }
86
- `};
87
- `}
83
+ & > * {
84
+ color: var(--colorsUtilityYin065);
85
+ }
86
+ `};
87
+ `}
88
88
  `;
89
89
  const contentPaddings = {
90
90
  "extra-small": "8px",
@@ -35,8 +35,8 @@ const StyledProgressTracker = styled.div`
35
35
  ${({
36
36
  length
37
37
  }) => css`
38
- width: ${length};
39
- `};
38
+ width: ${length};
39
+ `};
40
40
  ${({
41
41
  labelsPosition
42
42
  }) => labelsPosition === "left" && css`
@@ -4,7 +4,9 @@ const StyledListActionButtonWrapper = styled.div`
4
4
  padding-top: var(--spacing100);
5
5
  padding-bottom: var(--spacing100);
6
6
  border-top: 1px solid var(--colorsUtilityDisabled600);
7
- box-shadow: 0 0px 0 0 rgba(0, 0, 0, 0), 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
7
+ box-shadow:
8
+ 0 0px 0 0 rgba(0, 0, 0, 0),
9
+ 0 -8px 8px 0 rgba(0, 0, 0, 0.03);
8
10
  width: 100%;
9
11
  position: sticky;
10
12
  bottom: 0;
@@ -16,14 +16,14 @@ export const ErrorBorder = styled.span`
16
16
  ${({
17
17
  warning
18
18
  }) => css`
19
- position: absolute;
20
- z-index: 6;
21
- width: 2px;
22
- background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
23
- left: -12px;
24
- bottom: -4px;
25
- top: 2px;
26
- `}
19
+ position: absolute;
20
+ z-index: 6;
21
+ width: 2px;
22
+ background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
23
+ left: -12px;
24
+ bottom: -4px;
25
+ top: 2px;
26
+ `}
27
27
  `;
28
28
  export const StyledHintText = styled.div`
29
29
  margin-top: 8px;
@@ -20,7 +20,8 @@ const ToolbarButton = /*#__PURE__*/React.forwardRef(({
20
20
  onKeyDown: onKeyDown,
21
21
  onMouseDown: onMouseDown,
22
22
  isActive: activated,
23
- "aria-label": ariaLabel
23
+ "aria-label": ariaLabel,
24
+ "aria-pressed": activated
24
25
  }, !tabbable && {
25
26
  tabIndex: -1
26
27
  }, {
@@ -4,14 +4,14 @@ const ErrorBorder = styled.span`
4
4
  warning,
5
5
  inline
6
6
  }) => css`
7
- position: absolute;
8
- z-index: 6;
9
- width: 2px;
10
- background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
11
- left: -12px;
12
- bottom: ${inline ? "10px" : "0px"};
13
- top: 0px;
14
- `}
7
+ position: absolute;
8
+ z-index: 6;
9
+ width: 2px;
10
+ background-color: ${warning ? "var(--colorsSemanticCaution500)" : "var(--colorsSemanticNegative500)"};
11
+ left: -12px;
12
+ bottom: ${inline ? "10px" : "0px"};
13
+ top: 0px;
14
+ `}
15
15
  `;
16
16
  const StyledHintText = styled.div`
17
17
  ::after {
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  export declare const FlexTileDivider: () => JSX.Element;
2
3
  export default FlexTileDivider;
@@ -4,7 +4,7 @@ import { SpaceProps, WidthProps } from "styled-system";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags";
5
5
  import { TILE_HIGHLIGHT_VARIANTS } from "./tile.config";
6
6
  declare type DesignTokensType = keyof typeof DesignTokens;
7
- declare type HighlightVariantType = typeof TILE_HIGHLIGHT_VARIANTS[number];
7
+ declare type HighlightVariantType = (typeof TILE_HIGHLIGHT_VARIANTS)[number];
8
8
  export interface TileProps extends SpaceProps, WidthProps, TagProps {
9
9
  /** Sets the theme of the tile */
10
10
  variant?: "tile" | "transparent" | "active" | "grey";
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  export declare const VARIANT_TYPES: readonly ["h1-large", "h1", "h2", "h3", "h4", "h5", "segment-header", "segment-header-small", "segment-subheader", "segment-subheader-alt", "p", "span", "small", "big", "sup", "sub", "strong", "b", "em", "ul", "ol"];
5
- export declare type VariantTypes = typeof VARIANT_TYPES[number];
5
+ export declare type VariantTypes = (typeof VARIANT_TYPES)[number];
6
6
  export interface TypographyProps extends SpaceProps, TagProps {
7
7
  /** Override the variant component */
8
8
  as?: React.ElementType;
@@ -182,7 +182,7 @@ const StyledTypography = styled.span.attrs(({
182
182
  ${variant === "sup" && "vertical-align: super;"};
183
183
  ${variant === "sub" && "vertical-align: sub;"};
184
184
  ${display && `display: ${display};`};
185
- ${listStyleType && `list-style-type: ${listStyleType};`}; ;
185
+ ${listStyleType && `list-style-type: ${listStyleType};`};
186
186
  `}
187
187
  ${space}
188
188
  ${({
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SpaceProps } from "styled-system";
2
3
  declare type TintRange = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100;
3
4
  export interface VerticalDividerProps extends SpaceProps {
package/esm/global.d.ts CHANGED
@@ -7,7 +7,7 @@ declare global {
7
7
  interface Window {
8
8
  __CARBON_INTERNALS_MODAL_LIST?: ModalList;
9
9
  __CARBON_INTERNALS_MODAL_SETTER_LIST?: ((
10
- topModal: HTMLElement | null
10
+ topModal: HTMLElement | null,
11
11
  ) => void)[];
12
12
  __CARBON_INTERNALS_SCROLL_BLOCKERS?: {
13
13
  components: {
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useCharacterCount: (value?: string, characterLimit?: number, characterCountAriaLive?: "off" | "polite") => [JSX.Element | null, string | undefined];
2
3
  export default useCharacterCount;
@@ -1,5 +1,5 @@
1
1
  export declare const GAP_VALUES: number[];
2
- export declare type AllowedNumericalValues = typeof GAP_VALUES[number];
2
+ export declare type AllowedNumericalValues = (typeof GAP_VALUES)[number];
3
3
  export declare type Gap = AllowedNumericalValues | string;
4
4
  export declare const getGapValue: (gapValue: number | string) => string;
5
5
  export default function gap(gapValue: number | string): string;
@@ -9,14 +9,9 @@ exports.default = void 0;
9
9
  // IE does not support composedPath
10
10
  // https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath
11
11
  var _default = ev => {
12
- // When testing with enzyme, we want to trigger a listener on an element but pretend
13
- // that it bubbled from the enzymeTestingTarget
14
- // e.g. document.dispatchEvent(new MouseClick('click', {
15
- // detail: {enzymeTestingTarget: document.body}
16
- // }))
17
12
  // In this example composedPath would show that the event started at document.body
18
13
  // but it would trigger the eventListener on document
19
- let element = ev.detail && ev.detail.enzymeTestingTarget || ev.target || null;
14
+ let element = ev.target || null;
20
15
  if (!element || !element.parentElement) {
21
16
  return [];
22
17
  }
@@ -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;