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.
- package/esm/__internal__/checkable-input/checkable-input.style.js +5 -2
- package/esm/__internal__/label/label.component.d.ts +4 -2
- package/esm/__internal__/label/label.component.js +3 -1
- package/esm/__internal__/label/label.style.d.ts +2 -0
- package/esm/__internal__/label/label.style.js +5 -1
- package/esm/__internal__/utils/helpers/events/composedPath.js +1 -6
- package/esm/__internal__/utils/helpers/events/events.js +1 -1
- package/esm/__internal__/validation-message/validation-message.component.d.ts +3 -1
- package/esm/__internal__/validation-message/validation-message.component.js +4 -2
- package/esm/__internal__/validation-message/validation-message.style.d.ts +1 -0
- package/esm/__internal__/validation-message/validation-message.style.js +11 -7
- package/esm/components/action-popover/action-popover.style.js +8 -8
- package/esm/components/breadcrumbs/crumb/crumb.style.js +2 -2
- package/esm/components/button-toggle/button-toggle.style.js +19 -19
- package/esm/components/card/card.config.d.ts +2 -2
- package/esm/components/date/__internal__/date-picker/day-picker.style.js +6 -2
- package/esm/components/dialog/dialog.component.d.ts +1 -1
- package/esm/components/dialog/dialog.config.d.ts +1 -1
- package/esm/components/dialog/dialog.style.js +2 -2
- package/esm/components/drawer/drawer.style.js +16 -16
- package/esm/components/flat-table/flat-table.component.d.ts +3 -1
- package/esm/components/flat-table/flat-table.component.js +3 -1
- package/esm/components/flat-table/flat-table.style.js +9 -9
- package/esm/components/form/form.config.d.ts +1 -1
- package/esm/components/hr/hr.component.d.ts +1 -0
- package/esm/components/loader-spinner/loader-spinner.config.d.ts +2 -2
- package/esm/components/loader-spinner/loader-spinner.style.js +5 -5
- package/esm/components/loader-star/internal/star.component.d.ts +1 -0
- package/esm/components/loader-star/loader-star.component.d.ts +1 -0
- package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
- package/esm/components/numeral-date/numeral-date.component.d.ts +1 -1
- package/esm/components/pager/pager.style.js +2 -2
- package/esm/components/pod/pod.config.d.ts +3 -3
- package/esm/components/pod/pod.style.js +34 -34
- package/esm/components/progress-tracker/progress-tracker.style.js +2 -2
- package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
- package/esm/components/switch/__internal__/switch-slider-panel.style.d.ts +1 -0
- package/esm/components/switch/__internal__/switch-slider-panel.style.js +6 -4
- package/esm/components/switch/__internal__/switch-slider.component.d.ts +2 -1
- package/esm/components/switch/__internal__/switch-slider.component.js +6 -3
- package/esm/components/switch/__internal__/switch-slider.style.d.ts +2 -1
- package/esm/components/switch/__internal__/switch-slider.style.js +7 -6
- package/esm/components/switch/switch.component.d.ts +2 -0
- package/esm/components/switch/switch.component.js +64 -18
- package/esm/components/switch/switch.style.d.ts +6 -1
- package/esm/components/switch/switch.style.js +24 -11
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
- package/esm/components/textbox/textbox.style.js +8 -8
- package/esm/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
- package/esm/components/tile/tile.component.d.ts +1 -1
- package/esm/components/time/time.style.d.ts +1 -1
- package/esm/components/typography/typography.component.d.ts +1 -1
- package/esm/components/typography/typography.style.js +1 -1
- package/esm/components/vertical-divider/vertical-divider.component.d.ts +1 -0
- package/esm/global.d.ts +1 -1
- package/esm/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
- package/esm/style/utils/box-gap.d.ts +1 -1
- package/lib/__internal__/checkable-input/checkable-input.style.js +5 -2
- package/lib/__internal__/label/label.component.d.ts +4 -2
- package/lib/__internal__/label/label.component.js +3 -1
- package/lib/__internal__/label/label.style.d.ts +2 -0
- package/lib/__internal__/label/label.style.js +5 -1
- package/lib/__internal__/utils/helpers/events/composedPath.js +1 -6
- package/lib/__internal__/utils/helpers/events/events.js +1 -1
- package/lib/__internal__/validation-message/validation-message.component.d.ts +3 -1
- package/lib/__internal__/validation-message/validation-message.component.js +4 -2
- package/lib/__internal__/validation-message/validation-message.style.d.ts +1 -0
- package/lib/__internal__/validation-message/validation-message.style.js +11 -7
- package/lib/components/action-popover/action-popover.style.js +8 -8
- package/lib/components/breadcrumbs/crumb/crumb.style.js +2 -2
- package/lib/components/button-toggle/button-toggle.style.js +19 -19
- package/lib/components/card/card.config.d.ts +2 -2
- package/lib/components/date/__internal__/date-picker/day-picker.style.js +6 -2
- package/lib/components/dialog/dialog.component.d.ts +1 -1
- package/lib/components/dialog/dialog.config.d.ts +1 -1
- package/lib/components/dialog/dialog.style.js +2 -2
- package/lib/components/drawer/drawer.style.js +16 -16
- package/lib/components/flat-table/flat-table.component.d.ts +3 -1
- package/lib/components/flat-table/flat-table.component.js +3 -1
- package/lib/components/flat-table/flat-table.style.js +9 -9
- package/lib/components/form/form.config.d.ts +1 -1
- package/lib/components/hr/hr.component.d.ts +1 -0
- package/lib/components/loader-spinner/loader-spinner.config.d.ts +2 -2
- package/lib/components/loader-spinner/loader-spinner.style.js +5 -5
- package/lib/components/loader-star/internal/star.component.d.ts +1 -0
- package/lib/components/loader-star/loader-star.component.d.ts +1 -0
- package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +1 -1
- package/lib/components/numeral-date/numeral-date.component.d.ts +1 -1
- package/lib/components/pager/pager.style.js +2 -2
- package/lib/components/pod/pod.config.d.ts +3 -3
- package/lib/components/pod/pod.style.js +34 -34
- package/lib/components/progress-tracker/progress-tracker.style.js +2 -2
- package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +3 -1
- package/lib/components/switch/__internal__/switch-slider-panel.style.d.ts +1 -0
- package/lib/components/switch/__internal__/switch-slider-panel.style.js +6 -4
- package/lib/components/switch/__internal__/switch-slider.component.d.ts +2 -1
- package/lib/components/switch/__internal__/switch-slider.component.js +6 -3
- package/lib/components/switch/__internal__/switch-slider.style.d.ts +2 -1
- package/lib/components/switch/__internal__/switch-slider.style.js +7 -6
- package/lib/components/switch/switch.component.d.ts +2 -0
- package/lib/components/switch/switch.component.js +64 -18
- package/lib/components/switch/switch.style.d.ts +6 -1
- package/lib/components/switch/switch.style.js +24 -11
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.component.js +2 -1
- package/lib/components/textbox/textbox.style.js +8 -8
- package/lib/components/tile/flex-tile-divider/flex-tile-divider.component.d.ts +1 -0
- package/lib/components/tile/tile.component.d.ts +1 -1
- package/lib/components/time/time.style.d.ts +1 -1
- package/lib/components/typography/typography.component.d.ts +1 -1
- package/lib/components/typography/typography.style.js +1 -1
- package/lib/components/vertical-divider/vertical-divider.component.d.ts +1 -0
- package/lib/global.d.ts +1 -1
- package/lib/hooks/__internal__/useCharacterCount/useCharacterCount.d.ts +1 -0
- package/lib/style/utils/box-gap.d.ts +1 -1
- package/package.json +3 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import FieldHelpStyle from "../field-help/field-help.style";
|
|
3
3
|
import { FieldLineStyle } from "../form-field/form-field.style";
|
|
4
|
-
import HiddenCheckableInputStyle from "./hidden-checkable-input.style";
|
|
5
4
|
import LabelStyle, { StyledLabelContainer } from "../label/label.style";
|
|
6
|
-
import StyledHelp from "../../components/help/help.style";
|
|
7
5
|
import StyledValidationIcon from "../validations/validation-icon.style";
|
|
6
|
+
import StyledHelp from "../../components/help/help.style";
|
|
7
|
+
import HiddenCheckableInputStyle from "./hidden-checkable-input.style";
|
|
8
8
|
const StyledCheckableInput = styled.div`
|
|
9
9
|
display: inline-block;
|
|
10
10
|
position: relative;
|
|
@@ -18,6 +18,8 @@ const StyledCheckableInputWrapper = styled.div`
|
|
|
18
18
|
labelInline,
|
|
19
19
|
reverse
|
|
20
20
|
}) => css`
|
|
21
|
+
width: 100% !important;
|
|
22
|
+
|
|
21
23
|
${FieldLineStyle} {
|
|
22
24
|
display: flex;
|
|
23
25
|
}
|
|
@@ -86,6 +88,7 @@ const StyledCheckableInputWrapper = styled.div`
|
|
|
86
88
|
${inputWidth !== undefined && inputWidth !== 0 && css`
|
|
87
89
|
${StyledCheckableInput} {
|
|
88
90
|
width: ${inputWidth}% !important;
|
|
91
|
+
min-width: 67px;
|
|
89
92
|
}
|
|
90
93
|
`}
|
|
91
94
|
|
|
@@ -24,7 +24,9 @@ export interface LabelProps extends ValidationProps, StyledLabelProps, StyledLab
|
|
|
24
24
|
className?: string;
|
|
25
25
|
/** Sets aria-label for label element */
|
|
26
26
|
"aria-label"?: string;
|
|
27
|
+
/** Whether this component is shown against a dark background */
|
|
28
|
+
isDarkBackground?: boolean;
|
|
27
29
|
}
|
|
28
|
-
export declare const Label: ({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isRequired, labelId, optional, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, }: LabelProps) => React.JSX.Element;
|
|
29
|
-
declare const _default: React.MemoExoticComponent<({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isRequired, labelId, optional, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, }: LabelProps) => React.JSX.Element>;
|
|
30
|
+
export declare const Label: ({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, optional, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, }: LabelProps) => React.JSX.Element;
|
|
31
|
+
declare const _default: React.MemoExoticComponent<({ align, as, children, disabled, error, help, helpIcon, htmlFor, info, inline, isDarkBackground, isRequired, labelId, optional, pr, pl, tooltipId, useValidationIcon, validationIconId, warning, width, className, "aria-label": ariaLabel, }: LabelProps) => React.JSX.Element>;
|
|
30
32
|
export default _default;
|
|
@@ -34,6 +34,7 @@ export const Label = ({
|
|
|
34
34
|
htmlFor,
|
|
35
35
|
info,
|
|
36
36
|
inline,
|
|
37
|
+
isDarkBackground = false,
|
|
37
38
|
isRequired,
|
|
38
39
|
labelId,
|
|
39
40
|
optional,
|
|
@@ -116,7 +117,8 @@ export const Label = ({
|
|
|
116
117
|
onMouseLeave: handleMouseLeave,
|
|
117
118
|
isRequired: isRequired,
|
|
118
119
|
as: as,
|
|
119
|
-
"aria-label": ariaLabel
|
|
120
|
+
"aria-label": ariaLabel,
|
|
121
|
+
isDarkBackground: isDarkBackground
|
|
120
122
|
}), children), icon());
|
|
121
123
|
};
|
|
122
124
|
export default /*#__PURE__*/React.memo(Label);
|
|
@@ -3,6 +3,8 @@ export interface StyledLabelProps {
|
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
/** Flag to configure component as mandatory */
|
|
5
5
|
isRequired?: boolean;
|
|
6
|
+
/** Flag to determine whether to use colours for dark backgrounds */
|
|
7
|
+
isDarkBackground?: boolean;
|
|
6
8
|
}
|
|
7
9
|
declare const StyledLabel: import("styled-components").StyledComponent<"label", any, StyledLabelProps, never>;
|
|
8
10
|
export interface StyledLabelContainerProps {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
const StyledLabel = styled.label`
|
|
3
|
-
|
|
3
|
+
${({
|
|
4
|
+
isDarkBackground
|
|
5
|
+
}) => css`
|
|
6
|
+
color: ${isDarkBackground ? "var(--colorsUtilityYang100)" : "var(--colorsUtilityYin090)"};
|
|
7
|
+
`}
|
|
4
8
|
display: block;
|
|
5
9
|
font-weight: var(--fontWeights500);
|
|
6
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.
|
|
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.
|
|
111
|
+
return ev.composedPath?.() || composedPath(ev);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
export 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;
|
|
@@ -4,14 +4,16 @@ import StyledValidationMessage from "./validation-message.style";
|
|
|
4
4
|
const ValidationMessage = ({
|
|
5
5
|
error,
|
|
6
6
|
validationId,
|
|
7
|
-
warning
|
|
7
|
+
warning,
|
|
8
|
+
isDarkBackground
|
|
8
9
|
}) => {
|
|
9
10
|
const validation = error || warning;
|
|
10
11
|
const isStringValidation = typeof validation === "string";
|
|
11
12
|
return isStringValidation ? /*#__PURE__*/React.createElement(StyledValidationMessage, {
|
|
12
13
|
id: validationId,
|
|
13
14
|
isWarning: !!(!error && warning),
|
|
14
|
-
"data-role": "validation-message"
|
|
15
|
+
"data-role": "validation-message",
|
|
16
|
+
isDarkBackground: isDarkBackground
|
|
15
17
|
}, validation) : null;
|
|
16
18
|
};
|
|
17
19
|
export 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;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
const StyledValidationMessage = styled.p`
|
|
3
3
|
${({
|
|
4
|
-
isWarning
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
isWarning,
|
|
5
|
+
isDarkBackground
|
|
6
|
+
}) => {
|
|
7
|
+
const darkBgColour = isDarkBackground ? "var(--colorsSemanticNegative450)" : "var(--colorsSemanticNegative500)";
|
|
8
|
+
return css`
|
|
9
|
+
color: ${isWarning ? "var(--colorsSemanticCaution600)" : darkBgColour};
|
|
10
|
+
font-weight: ${isWarning ? "normal" : "500"};
|
|
11
|
+
margin-top: 0px;
|
|
12
|
+
margin-bottom: 8px;
|
|
13
|
+
`;
|
|
14
|
+
}}
|
|
11
15
|
`;
|
|
12
16
|
export default StyledValidationMessage;
|
|
@@ -88,18 +88,18 @@ const StyledMenuItem = styled.button`
|
|
|
88
88
|
childHasSubmenu,
|
|
89
89
|
hasSubmenu
|
|
90
90
|
}) => css`
|
|
91
|
-
|
|
91
|
+
justify-content: ${horizontalAlignment === "left" ? "flex-start" : "flex-end"};
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
${horizontalAlignment === "left" && submenuPosition === "right" && css`
|
|
94
|
+
justify-content: space-between;
|
|
95
|
+
`}
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
165
|
+
${!grouped && css`
|
|
166
|
+
&&&& {
|
|
167
|
+
${StyledButtonToggle} {
|
|
168
|
+
border-radius: var(--borderRadius050);
|
|
170
169
|
}
|
|
171
|
-
|
|
170
|
+
}
|
|
171
|
+
`}
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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(
|
|
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(
|
|
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];
|
|
@@ -31,26 +31,26 @@ const StyledDrawerSidebar = styled(Box)`
|
|
|
31
31
|
hasControls,
|
|
32
32
|
isExpanded
|
|
33
33
|
}) => css`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
${!isExpanded && css`
|
|
35
|
+
display: none;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
`}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
${isExpanded && css`
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
flex: 1 1 0%;
|
|
43
|
+
`}
|
|
44
44
|
|
|
45
45
|
${hasControls && css`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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;
|
|
@@ -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;
|
|
@@ -23,6 +23,7 @@ export const FlatTable = ({
|
|
|
23
23
|
minHeight,
|
|
24
24
|
overflowX,
|
|
25
25
|
width,
|
|
26
|
+
title,
|
|
26
27
|
...rest
|
|
27
28
|
}) => {
|
|
28
29
|
const wrapperRef = useRef(null);
|
|
@@ -162,7 +163,8 @@ export const FlatTable = ({
|
|
|
162
163
|
onKeyDown: handleKeyDown,
|
|
163
164
|
isFocused: focused
|
|
164
165
|
}, rest, {
|
|
165
|
-
"data-component": "flat-table-wrapper"
|
|
166
|
+
"data-component": "flat-table-wrapper",
|
|
167
|
+
title: title
|
|
166
168
|
}), /*#__PURE__*/React.createElement(StyledTableContainer, {
|
|
167
169
|
ref: container,
|
|
168
170
|
onFocus: () => {
|
|
@@ -128,20 +128,20 @@ const StyledFlatTableWrapper = styled(StyledBox)`
|
|
|
128
128
|
theme,
|
|
129
129
|
isFocused
|
|
130
130
|
}) => css`
|
|
131
|
-
|
|
131
|
+
box-sizing: border-box;
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
/* istanbul ignore next */
|
|
134
|
+
${theme.focusRedesignOptOut && isFocused && /* istanbul ignore next */
|
|
135
135
|
css`
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
${oldFocusStyling}
|
|
137
|
+
`}
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
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,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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
${({
|
|
@@ -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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
50
|
+
${variant === "tile" && "box-shadow: 0 2px 3px 0 rgba(2, 18, 36, 0.2)"};
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
${noBorder ? "border: none" : `border: 1px solid var(--colorsUtilityMajor100)`};
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
${hasButtons && !(fullWidth || internalEditButton) && "width: auto;"};
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
${contentTriggersEdit && "cursor: pointer"};
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
${(isHovered || isFocused) && css`
|
|
59
|
+
background-color: var(--colorsUtilityMajor075);
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
${internalEditButton && variant === "tile" && "background-color: var(--colorsUtilityMajorTransparent);"}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`}
|
|
63
|
+
${contentTriggersEdit && css`
|
|
64
|
+
background-color: var(--colorsActionMajor600);
|
|
65
|
+
* {
|
|
66
|
+
color: var(--colorsUtilityYang100);
|
|
67
|
+
}
|
|
69
68
|
`}
|
|
69
|
+
`}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
|
|
80
|
+
border: none;
|
|
81
|
+
background-color: var(--colorsActionDisabled500);
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
& > * {
|
|
84
|
+
color: var(--colorsUtilityYin065);
|
|
85
|
+
}
|
|
86
|
+
`};
|
|
87
|
+
`}
|
|
88
88
|
`;
|
|
89
89
|
const contentPaddings = {
|
|
90
90
|
"extra-small": "8px",
|