carbon-react 118.1.1 → 118.2.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__/input/input-presentation.style.js +1 -0
- package/esm/__internal__/input/input.style.js +1 -0
- package/esm/components/action-popover/action-popover.style.js +3 -0
- package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -0
- package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -0
- package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +6 -2
- package/esm/components/badge/badge.style.js +1 -1
- package/esm/components/batch-selection/batch-selection.style.js +6 -0
- package/esm/components/box/box.component.d.ts +3 -0
- package/esm/components/box/box.component.js +4 -0
- package/esm/components/button/button.style.js +10 -9
- package/esm/components/button-bar/button-bar.style.js +19 -0
- package/esm/components/button-minor/button-minor.style.js +42 -40
- package/esm/components/button-toggle/button-toggle.component.js +2 -1
- package/esm/components/button-toggle/button-toggle.style.d.ts +1 -0
- package/esm/components/button-toggle/button-toggle.style.js +31 -13
- package/esm/components/button-toggle-group/button-toggle-group.style.js +21 -3
- package/esm/components/card/__internal__/card-context/index.d.ts +7 -0
- package/esm/components/card/__internal__/card-context/index.js +2 -0
- package/esm/components/card/card-footer/card-footer.component.js +9 -2
- package/esm/components/card/card-footer/card-footer.style.d.ts +2 -1
- package/esm/components/card/card-footer/card-footer.style.js +10 -1
- package/esm/components/card/card.component.d.ts +3 -2
- package/esm/components/card/card.component.js +10 -1
- package/esm/components/card/card.style.d.ts +2 -1
- package/esm/components/card/card.style.js +3 -1
- package/esm/components/carousel/carousel.component.js +1 -1
- package/esm/components/carousel/carousel.style.js +4 -2
- package/esm/components/carousel/slide/slide.style.js +2 -0
- package/esm/components/checkbox/checkbox.style.js +2 -0
- package/esm/components/date/__internal__/date-picker/day-picker.style.js +4 -0
- package/esm/components/date/__internal__/navbar/button.style.js +2 -0
- package/esm/components/dialog/dialog.style.js +5 -0
- package/esm/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/esm/components/dismissible-box/dismissible-box.component.js +4 -1
- package/esm/components/drawer/drawer.style.js +1 -0
- package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +20 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +7 -0
- package/esm/components/flat-table/flat-table.component.js +56 -2
- package/esm/components/flat-table/flat-table.style.js +101 -1
- package/esm/components/flat-table/sort/sort.style.js +1 -0
- package/esm/components/icon-button/icon-button.style.js +1 -0
- package/esm/components/inline-inputs/inline-inputs.style.js +18 -0
- package/esm/components/link/link.style.js +1 -0
- package/esm/components/link-preview/__internal__/placeholder.component.d.ts +3 -1
- package/esm/components/link-preview/__internal__/placeholder.component.js +4 -1
- package/esm/components/link-preview/link-preview.style.js +1 -0
- package/esm/components/loader/loader-square.style.js +5 -0
- package/esm/components/loader-bar/loader-bar.style.js +1 -0
- package/esm/components/menu/__internal__/submenu/submenu.style.js +13 -0
- package/esm/components/menu/menu.style.js +13 -6
- package/esm/components/menu/scrollable-block/scrollable-block.style.js +15 -0
- package/esm/components/message/message.style.js +2 -0
- package/esm/components/multi-action-button/multi-action-button.style.js +4 -0
- package/esm/components/note/note.style.js +1 -0
- package/esm/components/numeral-date/numeral-date.component.js +2 -0
- package/esm/components/numeral-date/numeral-date.style.d.ts +1 -0
- package/esm/components/numeral-date/numeral-date.style.js +12 -0
- package/esm/components/pager/pager.style.js +2 -0
- package/esm/components/pill/pill.style.js +5 -15
- package/esm/components/pod/pod.style.js +6 -0
- package/esm/components/popover-container/popover-container.style.js +1 -0
- package/esm/components/portrait/portrait-gravatar.component.js +1 -1
- package/esm/components/portrait/portrait-initials.component.js +1 -1
- package/esm/components/portrait/portrait.component.js +1 -1
- package/esm/components/portrait/portrait.style.js +1 -3
- package/esm/components/profile/profile.component.js +1 -1
- package/esm/components/progress-tracker/progress-tracker.style.js +2 -2
- package/esm/components/radio-button/radio-button.style.js +1 -1
- package/esm/components/search/search-button.style.js +5 -0
- package/esm/components/search/search.style.js +7 -0
- package/esm/components/select/select-list/select-list-container.style.js +1 -0
- package/esm/components/split-button/split-button-children.style.d.ts +1 -0
- package/esm/components/split-button/split-button-children.style.js +28 -0
- package/esm/components/split-button/split-button-toggle.style.js +6 -1
- package/esm/components/split-button/split-button.style.js +5 -2
- package/esm/components/switch/__internal__/switch-slider.style.js +1 -2
- package/esm/components/tabs/__internal__/tab-title/tab-title.style.js +22 -2
- package/esm/components/tabs/__internal__/tabs-header/tabs-header.style.js +5 -0
- package/esm/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +3 -0
- package/esm/components/text-editor/text-editor.style.js +3 -0
- package/esm/components/tile/tile.component.d.ts +3 -1
- package/esm/components/tile/tile.component.js +3 -1
- package/esm/components/tile/tile.style.d.ts +1 -1
- package/esm/components/tile/tile.style.js +4 -1
- package/esm/components/tile-select/tile-select.style.d.ts +1 -0
- package/esm/components/tile-select/tile-select.style.js +8 -0
- package/esm/components/tooltip/tooltip.style.js +1 -0
- package/esm/components/vertical-menu/vertical-menu.style.js +1 -0
- package/lib/__internal__/input/input-presentation.style.js +1 -0
- package/lib/__internal__/input/input.style.js +1 -0
- package/lib/components/action-popover/action-popover.style.js +3 -0
- package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -0
- package/lib/components/advanced-color-picker/advanced-color-picker.style.js +1 -0
- package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +6 -2
- package/lib/components/badge/badge.style.js +1 -1
- package/lib/components/batch-selection/batch-selection.style.js +6 -0
- package/lib/components/box/box.component.d.ts +3 -0
- package/lib/components/box/box.component.js +4 -0
- package/lib/components/button/button.style.js +10 -9
- package/lib/components/button-bar/button-bar.style.js +19 -0
- package/lib/components/button-minor/button-minor.style.js +42 -40
- package/lib/components/button-toggle/button-toggle.component.js +2 -1
- package/lib/components/button-toggle/button-toggle.style.d.ts +1 -0
- package/lib/components/button-toggle/button-toggle.style.js +31 -13
- package/lib/components/button-toggle-group/button-toggle-group.style.js +21 -3
- package/lib/components/card/__internal__/card-context/index.d.ts +7 -0
- package/lib/components/card/__internal__/card-context/index.js +14 -0
- package/lib/components/card/__internal__/card-context/package.json +6 -0
- package/lib/components/card/card-footer/card-footer.component.js +14 -2
- package/lib/components/card/card-footer/card-footer.style.d.ts +2 -1
- package/lib/components/card/card-footer/card-footer.style.js +10 -1
- package/lib/components/card/card.component.d.ts +3 -2
- package/lib/components/card/card.component.js +11 -1
- package/lib/components/card/card.style.d.ts +2 -1
- package/lib/components/card/card.style.js +3 -1
- package/lib/components/carousel/carousel.component.js +1 -1
- package/lib/components/carousel/carousel.style.js +4 -2
- package/lib/components/carousel/slide/slide.style.js +2 -0
- package/lib/components/checkbox/checkbox.style.js +2 -0
- package/lib/components/date/__internal__/date-picker/day-picker.style.js +4 -0
- package/lib/components/date/__internal__/navbar/button.style.js +2 -0
- package/lib/components/dialog/dialog.style.js +5 -0
- package/lib/components/dismissible-box/dismissible-box.component.d.ts +1 -1
- package/lib/components/dismissible-box/dismissible-box.component.js +4 -1
- package/lib/components/drawer/drawer.style.js +1 -0
- package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +20 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +7 -0
- package/lib/components/flat-table/flat-table.component.js +60 -2
- package/lib/components/flat-table/flat-table.style.js +102 -1
- package/lib/components/flat-table/sort/sort.style.js +1 -0
- package/lib/components/icon-button/icon-button.style.js +1 -0
- package/lib/components/inline-inputs/inline-inputs.style.js +18 -0
- package/lib/components/link/link.style.js +1 -0
- package/lib/components/link-preview/__internal__/placeholder.component.d.ts +3 -1
- package/lib/components/link-preview/__internal__/placeholder.component.js +6 -1
- package/lib/components/link-preview/link-preview.style.js +1 -0
- package/lib/components/loader/loader-square.style.js +5 -0
- package/lib/components/loader-bar/loader-bar.style.js +1 -0
- package/lib/components/menu/__internal__/submenu/submenu.style.js +13 -0
- package/lib/components/menu/menu.style.js +13 -6
- package/lib/components/menu/scrollable-block/scrollable-block.style.js +18 -0
- package/lib/components/message/message.style.js +2 -0
- package/lib/components/multi-action-button/multi-action-button.style.js +5 -0
- package/lib/components/note/note.style.js +1 -0
- package/lib/components/numeral-date/numeral-date.component.js +2 -0
- package/lib/components/numeral-date/numeral-date.style.d.ts +1 -0
- package/lib/components/numeral-date/numeral-date.style.js +12 -0
- package/lib/components/pager/pager.style.js +2 -0
- package/lib/components/pill/pill.style.js +5 -15
- package/lib/components/pod/pod.style.js +6 -0
- package/lib/components/popover-container/popover-container.style.js +1 -0
- package/lib/components/portrait/portrait-gravatar.component.js +1 -1
- package/lib/components/portrait/portrait-initials.component.js +1 -1
- package/lib/components/portrait/portrait.component.js +1 -1
- package/lib/components/portrait/portrait.style.js +1 -3
- package/lib/components/profile/profile.component.js +1 -1
- package/lib/components/progress-tracker/progress-tracker.style.js +2 -2
- package/lib/components/radio-button/radio-button.style.js +1 -1
- package/lib/components/search/search-button.style.js +5 -0
- package/lib/components/search/search.style.js +7 -0
- package/lib/components/select/select-list/select-list-container.style.js +1 -0
- package/lib/components/split-button/split-button-children.style.d.ts +1 -0
- package/lib/components/split-button/split-button-children.style.js +30 -1
- package/lib/components/split-button/split-button-toggle.style.js +6 -1
- package/lib/components/split-button/split-button.style.js +5 -2
- package/lib/components/switch/__internal__/switch-slider.style.js +1 -2
- package/lib/components/tabs/__internal__/tab-title/tab-title.style.js +22 -2
- package/lib/components/tabs/__internal__/tabs-header/tabs-header.style.js +5 -0
- package/lib/components/text-editor/__internal__/toolbar/toolbar-button/toolbar-button.style.js +3 -0
- package/lib/components/text-editor/text-editor.style.js +3 -0
- package/lib/components/tile/tile.component.d.ts +3 -1
- package/lib/components/tile/tile.component.js +3 -1
- package/lib/components/tile/tile.style.d.ts +1 -1
- package/lib/components/tile/tile.style.js +4 -1
- package/lib/components/tile-select/tile-select.style.d.ts +1 -0
- package/lib/components/tile-select/tile-select.style.js +8 -0
- package/lib/components/tooltip/tooltip.style.js +1 -0
- package/lib/components/vertical-menu/vertical-menu.style.js +1 -0
- package/package.json +1 -1
|
@@ -46,6 +46,7 @@ const InputPresentationStyle = styled.div`
|
|
|
46
46
|
align-items: stretch;
|
|
47
47
|
background: var(--colorsUtilityYang100);
|
|
48
48
|
border: 1px solid var(--colorsUtilityMajor300);
|
|
49
|
+
border-radius: var(--borderRadius050);
|
|
49
50
|
box-sizing: border-box;
|
|
50
51
|
cursor: text;
|
|
51
52
|
display: flex;
|
|
@@ -12,6 +12,7 @@ const Menu = styled.div`
|
|
|
12
12
|
padding: var(--spacing100) 0;
|
|
13
13
|
box-shadow: var(--boxShadow100);
|
|
14
14
|
position: absolute;
|
|
15
|
+
border-radius: var(--borderRadius100);
|
|
15
16
|
background-color: var(--colorsUtilityYang100);
|
|
16
17
|
z-index: ${({
|
|
17
18
|
theme
|
|
@@ -41,6 +42,7 @@ const StyledMenuItem = styled.button`
|
|
|
41
42
|
&:focus {
|
|
42
43
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
43
44
|
z-index: 1;
|
|
45
|
+
border-radius: var(--borderRadius000);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
${({
|
|
@@ -93,6 +95,7 @@ const ButtonIcon = styled(Icon)`
|
|
|
93
95
|
const StyledButtonIcon = styled.div`
|
|
94
96
|
&:focus {
|
|
95
97
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
98
|
+
border-radius: var(--borderRadius050);
|
|
96
99
|
}
|
|
97
100
|
`;
|
|
98
101
|
const MenuItemIcon = styled(Icon)`
|
package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js
CHANGED
|
@@ -11,15 +11,19 @@ const StyledNavigationItem = styled.li`
|
|
|
11
11
|
border-left: var(--sizing050) solid var(--colorsActionMinor100);
|
|
12
12
|
font-weight: 700;
|
|
13
13
|
padding: 12px 24px;
|
|
14
|
+
border-top-right-radius: var(--borderRadius100);
|
|
15
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
14
16
|
|
|
15
17
|
&:focus {
|
|
16
18
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
&:hover {
|
|
20
|
-
|
|
22
|
+
${({
|
|
21
23
|
isSelected
|
|
22
|
-
}) => !isSelected &&
|
|
24
|
+
}) => !isSelected && css`
|
|
25
|
+
background-color: var(--colorsActionMinor100);
|
|
26
|
+
`};
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
${({
|
|
@@ -9,6 +9,7 @@ const StyledBatchSelection = styled.div`
|
|
|
9
9
|
}) => css`
|
|
10
10
|
align-items: center;
|
|
11
11
|
display: inline-flex;
|
|
12
|
+
border-radius: var(--borderRadius100);
|
|
12
13
|
|
|
13
14
|
${hidden && "opacity: 0;"}
|
|
14
15
|
|
|
@@ -42,12 +43,17 @@ const StyledBatchSelection = styled.div`
|
|
|
42
43
|
|
|
43
44
|
${StyledIconButton}:hover {
|
|
44
45
|
background-color: var(--colorsActionMajor500);
|
|
46
|
+
border-radius: var(--borderRadius100);
|
|
45
47
|
|
|
46
48
|
${StyledIcon} {
|
|
47
49
|
color: var(--colorsActionMajorYang100);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
${StyledIconButton}:focus {
|
|
54
|
+
border-radius: var(--borderRadius100);
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
${disabled && css`
|
|
52
58
|
background: transparent;
|
|
53
59
|
color: var(--colorsUtilityYin030);
|
|
@@ -9,6 +9,7 @@ export declare type AllowedNumericalValues = typeof GAP_VALUES[number];
|
|
|
9
9
|
export declare type Gap = AllowedNumericalValues | string;
|
|
10
10
|
declare type DesignTokensType = keyof typeof DesignTokens;
|
|
11
11
|
declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
|
|
12
|
+
declare type BorderRadiusType = Extract<DesignTokensType, `borderRadius${string}`>;
|
|
12
13
|
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps, Omit<PositionProps, "zIndex"> {
|
|
13
14
|
as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
14
15
|
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
|
|
@@ -27,6 +28,8 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
|
|
|
27
28
|
rowGap?: Gap;
|
|
28
29
|
/** Design Token for Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Box component. */
|
|
29
30
|
boxShadow?: BoxShadowsType;
|
|
31
|
+
/** Design Token for Border Radius. Note: please check that the border radius design token you are using is compatible with the Box component. */
|
|
32
|
+
borderRadius?: BorderRadiusType;
|
|
30
33
|
}
|
|
31
34
|
export declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
|
32
35
|
export default Box;
|
|
@@ -39,14 +39,6 @@ function stylingForType({
|
|
|
39
39
|
destructive
|
|
40
40
|
}) {
|
|
41
41
|
return css`
|
|
42
|
-
border: 2px solid transparent;
|
|
43
|
-
box-sizing: border-box;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
text-decoration: none;
|
|
46
|
-
&:focus {
|
|
47
|
-
outline: solid 3px var(--colorsSemanticFocus500);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
42
|
${buttonTypes(disabled, destructive)[buttonType]};
|
|
51
43
|
|
|
52
44
|
${size === "small" && css`
|
|
@@ -77,11 +69,20 @@ const StyledButton = styled.button`
|
|
|
77
69
|
align-items: center;
|
|
78
70
|
cursor: ${disabled ? "not-allowed" : "pointer"};
|
|
79
71
|
display: inline-flex;
|
|
80
|
-
border-radius: 0;
|
|
81
72
|
${noWrap ? "white-space: nowrap;" : "flex-flow: wrap;"}
|
|
82
73
|
justify-content: center;
|
|
83
74
|
vertical-align: middle;
|
|
84
75
|
outline-offset: 0;
|
|
76
|
+
border: 2px solid transparent;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
text-decoration: none;
|
|
80
|
+
border-radius: var(--borderRadius400);
|
|
81
|
+
|
|
82
|
+
&:focus {
|
|
83
|
+
outline: solid 3px var(--colorsSemanticFocus500);
|
|
84
|
+
}
|
|
85
|
+
|
|
85
86
|
${stylingForType}
|
|
86
87
|
`}
|
|
87
88
|
|
|
@@ -26,20 +26,38 @@ const StyledButtonBar = styled.div`
|
|
|
26
26
|
margin: 0;
|
|
27
27
|
border: 2px solid var(--colorsActionMajor500);
|
|
28
28
|
|
|
29
|
+
:not(:first-child):not(:last-child) {
|
|
30
|
+
border-radius: var(--borderRadius000);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:first-child:not(:last-child) {
|
|
34
|
+
border-top-right-radius: var(--borderRadius000);
|
|
35
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:last-child:not(:first-child) {
|
|
39
|
+
border-top-left-radius: var(--borderRadius000);
|
|
40
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
&:not(:last-of-type) {
|
|
30
44
|
border-right-color: transparent;
|
|
31
45
|
}
|
|
46
|
+
|
|
32
47
|
&:not(:first-of-type) {
|
|
33
48
|
margin-left: -2px;
|
|
34
49
|
}
|
|
50
|
+
|
|
35
51
|
&:focus {
|
|
36
52
|
position: relative;
|
|
37
53
|
z-index: 2;
|
|
38
54
|
border-right-color: var(--colorsActionMajor500);
|
|
39
55
|
}
|
|
56
|
+
|
|
40
57
|
&:hover {
|
|
41
58
|
background-color: var(--colorsActionMajor600);
|
|
42
59
|
border-color: var(--colorsActionMajor600);
|
|
60
|
+
|
|
43
61
|
& + button {
|
|
44
62
|
border-left-color: var(--colorsActionMajor600);
|
|
45
63
|
}
|
|
@@ -47,6 +65,7 @@ const StyledButtonBar = styled.div`
|
|
|
47
65
|
color: white;
|
|
48
66
|
}
|
|
49
67
|
}
|
|
68
|
+
|
|
50
69
|
& ${StyledIcon} {
|
|
51
70
|
color: var(--colorsActionMajor500);
|
|
52
71
|
}
|
|
@@ -5,17 +5,19 @@ import StyledLoaderSquare from "../loader/loader-square.style";
|
|
|
5
5
|
|
|
6
6
|
function makeColors(color) {
|
|
7
7
|
return `
|
|
8
|
-
color: ${color};
|
|
9
|
-
${StyledIcon} {
|
|
10
8
|
color: ${color};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
${StyledIcon} {
|
|
10
|
+
color: ${color};
|
|
11
|
+
}
|
|
12
|
+
${StyledLoaderSquare} {
|
|
13
|
+
background-color: ${color};
|
|
14
|
+
}
|
|
15
15
|
`;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const StyledButtonMinor = styled(Button)`
|
|
19
|
+
border-radius: var(--borderRadius050);
|
|
20
|
+
|
|
19
21
|
${({
|
|
20
22
|
children
|
|
21
23
|
}) => !children && css`
|
|
@@ -30,54 +32,54 @@ const StyledButtonMinor = styled(Button)`
|
|
|
30
32
|
disabled
|
|
31
33
|
}) => !destructive && !disabled && css`
|
|
32
34
|
${buttonType === "primary" && `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
background: var(--colorsActionMinor500);
|
|
36
|
+
border-color: var(--colorsActionMinorTransparent);
|
|
37
|
+
${makeColors("var(--colorsActionMinorYang100)")}
|
|
38
|
+
&:hover {
|
|
39
|
+
background: var(--colorsActionMinor600);
|
|
40
|
+
}
|
|
41
|
+
`}
|
|
40
42
|
|
|
41
43
|
${buttonType === "secondary" && `
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
background: transparent;
|
|
45
|
+
padding: var(--spacing100);
|
|
46
|
+
border-color: var(--colorsActionMinor500);
|
|
47
|
+
${makeColors("var(--colorsActionMinor500)")}
|
|
48
|
+
&:hover {
|
|
49
|
+
color: var(--colorsActionMinorYang100);
|
|
50
|
+
background: var(--colorsActionMinor600);
|
|
51
|
+
}
|
|
52
|
+
`}
|
|
51
53
|
|
|
52
54
|
${buttonType === "tertiary" && `
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
background: transparent;
|
|
56
|
+
padding: var(--spacing100);
|
|
57
|
+
${makeColors("var(--colorsActionMinor500)")}
|
|
58
|
+
&:hover {
|
|
59
|
+
color: var(--colorsActionMinorYang100);
|
|
60
|
+
background: var(--colorsActionMinor600);
|
|
61
|
+
}
|
|
62
|
+
`}
|
|
61
63
|
`}
|
|
62
64
|
|
|
63
65
|
${({
|
|
64
66
|
size
|
|
65
67
|
}) => css`
|
|
66
68
|
${size === "small" && `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
min-height: 32px;
|
|
70
|
+
padding: var(--spacing000) var(--spacing100) var(--spacing000)
|
|
71
|
+
var(--spacing100);
|
|
72
|
+
`}
|
|
71
73
|
|
|
72
74
|
${size === "medium" && `
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
padding-left: var(--spacing150);
|
|
76
|
+
padding-right: var(--spacing150);
|
|
77
|
+
`}
|
|
76
78
|
|
|
77
79
|
${size === "large" && `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
padding-left: var(--spacing200);
|
|
81
|
+
padding-right: var(--spacing200);
|
|
82
|
+
`}
|
|
81
83
|
`}
|
|
82
84
|
`;
|
|
83
85
|
export default StyledButtonMinor;
|
|
@@ -83,7 +83,8 @@ const ButtonToggle = ({
|
|
|
83
83
|
htmlFor: inputGuid,
|
|
84
84
|
onMouseEnter: onMouseEnter,
|
|
85
85
|
onMouseLeave: onMouseLeave,
|
|
86
|
-
size: size
|
|
86
|
+
size: size,
|
|
87
|
+
grouped: grouped
|
|
87
88
|
}, /*#__PURE__*/React.createElement(StyledButtonToggleContentWrapper, null, icon, children)));
|
|
88
89
|
};
|
|
89
90
|
|
|
@@ -10,6 +10,7 @@ export interface StyledButtonToggleLabelProps {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
/** ButtonToggle size */
|
|
12
12
|
size: "small" | "medium" | "large";
|
|
13
|
+
grouped?: boolean;
|
|
13
14
|
}
|
|
14
15
|
declare const StyledButtonToggleLabel: import("styled-components").StyledComponent<"label", any, StyledButtonToggleLabelProps, never>;
|
|
15
16
|
export interface StyledButtonToggleIconProps {
|
|
@@ -38,6 +38,7 @@ const StyledButtonToggleLabel = styled.label`
|
|
|
38
38
|
position: relative;
|
|
39
39
|
box-sizing: border-box;
|
|
40
40
|
max-width: 100%;
|
|
41
|
+
|
|
41
42
|
${({
|
|
42
43
|
size
|
|
43
44
|
}) => css`
|
|
@@ -47,19 +48,15 @@ const StyledButtonToggleLabel = styled.label`
|
|
|
47
48
|
`}
|
|
48
49
|
font-weight: 700;
|
|
49
50
|
cursor: pointer;
|
|
50
|
-
|
|
51
51
|
border: 1px solid var(--colorsActionMinor500);
|
|
52
|
-
|
|
53
52
|
${StyledIcon} {
|
|
54
53
|
color: var(--colorsActionMinor500);
|
|
55
54
|
}
|
|
56
|
-
|
|
57
55
|
input:checked ~ && {
|
|
58
56
|
background-color: var(--colorsActionMinor300);
|
|
59
57
|
color: var(--colorsActionMinor600);
|
|
60
58
|
cursor: auto;
|
|
61
59
|
}
|
|
62
|
-
|
|
63
60
|
input:focus ~ & {
|
|
64
61
|
outline: 3px solid var(--colorsSemanticFocus500);
|
|
65
62
|
z-index: 100;
|
|
@@ -69,12 +66,10 @@ const StyledButtonToggleLabel = styled.label`
|
|
|
69
66
|
background-color: var(--colorsActionMinor200);
|
|
70
67
|
border-color: var(--colorsActionMinor500);
|
|
71
68
|
color: var(--colorsActionMinor500);
|
|
72
|
-
|
|
73
69
|
${StyledIcon} {
|
|
74
70
|
color: var(--colorsActionMinor500);
|
|
75
71
|
}
|
|
76
72
|
}
|
|
77
|
-
|
|
78
73
|
${({
|
|
79
74
|
buttonIcon,
|
|
80
75
|
buttonIconSize,
|
|
@@ -82,19 +77,16 @@ const StyledButtonToggleLabel = styled.label`
|
|
|
82
77
|
}) => buttonIcon && buttonIconSize === "large" && css`
|
|
83
78
|
height: ${heightLargeIconConfig[size]}px;
|
|
84
79
|
padding: 0 ${paddingLargeIconConfig[size]}px;
|
|
85
|
-
|
|
86
80
|
${StyledButtonToggleContentWrapper} {
|
|
87
81
|
flex-direction: column;
|
|
88
82
|
}
|
|
89
83
|
`}
|
|
90
|
-
|
|
91
84
|
${({
|
|
92
85
|
disabled
|
|
93
86
|
}) => disabled && css`
|
|
94
87
|
& {
|
|
95
88
|
border-color: var(--colorsActionDisabled500);
|
|
96
89
|
color: var(--colorsActionMinorYin030);
|
|
97
|
-
|
|
98
90
|
${StyledIcon} {
|
|
99
91
|
color: var(--colorsActionMinorYin030);
|
|
100
92
|
}
|
|
@@ -110,24 +102,20 @@ const StyledButtonToggleIcon = styled.div`
|
|
|
110
102
|
${({
|
|
111
103
|
hasContent
|
|
112
104
|
}) => hasContent && `margin-right: 8px;`}
|
|
113
|
-
|
|
114
105
|
${({
|
|
115
106
|
buttonIconSize
|
|
116
107
|
}) => buttonIconSize === "large" && css`
|
|
117
108
|
margin-right: 0;
|
|
118
|
-
|
|
119
109
|
${StyledIcon} {
|
|
120
110
|
margin-right: 0;
|
|
121
111
|
margin-bottom: 8px;
|
|
122
112
|
height: ${`${iconFontSizes.largeIcon}px`};
|
|
123
113
|
width: ${`${iconFontSizes.largeIcon}px`};
|
|
124
114
|
}
|
|
125
|
-
|
|
126
115
|
${StyledIcon}::before {
|
|
127
116
|
font-size: ${`${iconFontSizes[`${buttonIconSize}Icon`]}px`};
|
|
128
117
|
line-height: ${`${iconFontSizes[`${buttonIconSize}Icon`]}px`};
|
|
129
118
|
}
|
|
130
|
-
|
|
131
119
|
.carbon-icon__svg--credit-card-slash {
|
|
132
120
|
margin-left: 6px;
|
|
133
121
|
}
|
|
@@ -137,6 +125,36 @@ const StyledButtonToggle = styled.div`
|
|
|
137
125
|
display: inline-block;
|
|
138
126
|
vertical-align: middle;
|
|
139
127
|
|
|
128
|
+
${({
|
|
129
|
+
grouped
|
|
130
|
+
}) => css`
|
|
131
|
+
${!grouped && css`
|
|
132
|
+
&&&& {
|
|
133
|
+
${StyledButtonToggleLabel} {
|
|
134
|
+
border-radius: var(--borderRadius400);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`}
|
|
138
|
+
|
|
139
|
+
${grouped && css`
|
|
140
|
+
&&&& {
|
|
141
|
+
:first-of-type {
|
|
142
|
+
${StyledButtonToggleLabel} {
|
|
143
|
+
border-top-left-radius: var(--borderRadius400);
|
|
144
|
+
border-bottom-left-radius: var(--borderRadius400);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:last-of-type {
|
|
149
|
+
${StyledButtonToggleLabel} {
|
|
150
|
+
border-top-right-radius: var(--borderRadius400);
|
|
151
|
+
border-bottom-right-radius: var(--borderRadius400);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
`}
|
|
156
|
+
`}
|
|
157
|
+
|
|
140
158
|
&:not(:first-of-type) {
|
|
141
159
|
margin-left: 8px;
|
|
142
160
|
}
|
|
@@ -4,6 +4,24 @@ import ValidationIconStyle from "../../__internal__/validations/validation-icon.
|
|
|
4
4
|
const StyledButtonToggleGroup = styled.div`
|
|
5
5
|
display: flex;
|
|
6
6
|
|
|
7
|
+
${StyledButtonToggleLabel}:not(:first-of-type):not(:last-of-type) {
|
|
8
|
+
border-radius: var(--borderRadius000);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
${StyledButtonToggle}:first-of-type ${StyledButtonToggleLabel} {
|
|
12
|
+
border-top-left-radius: var(--borderRadius400);
|
|
13
|
+
border-bottom-left-radius: var(--borderRadius400);
|
|
14
|
+
border-top-right-radius: var(--borderRadius000);
|
|
15
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${StyledButtonToggle}:last-of-type ${StyledButtonToggleLabel} {
|
|
19
|
+
border-top-left-radius: var(--borderRadius000);
|
|
20
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
21
|
+
border-top-right-radius: var(--borderRadius400);
|
|
22
|
+
border-bottom-right-radius: var(--borderRadius400);
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
${({
|
|
8
26
|
fullWidth
|
|
9
27
|
}) => fullWidth && css`
|
|
@@ -13,20 +31,20 @@ const StyledButtonToggleGroup = styled.div`
|
|
|
13
31
|
${StyledButtonToggle} {
|
|
14
32
|
flex: auto;
|
|
15
33
|
}
|
|
16
|
-
`}
|
|
34
|
+
`}
|
|
17
35
|
|
|
18
36
|
${({
|
|
19
37
|
inputWidth
|
|
20
38
|
}) => inputWidth && css`
|
|
21
39
|
width: ${`${inputWidth}%`};
|
|
22
|
-
`}
|
|
40
|
+
`}
|
|
23
41
|
|
|
24
42
|
${StyledButtonToggleLabel} {
|
|
25
43
|
${({
|
|
26
44
|
info
|
|
27
45
|
}) => info && css`
|
|
28
46
|
border-color: var(--colorsSemanticInfo500);
|
|
29
|
-
`}
|
|
47
|
+
`}
|
|
30
48
|
${({
|
|
31
49
|
warning
|
|
32
50
|
}) => warning && css`
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface CardContextProps {
|
|
3
|
+
/** Sets the level of roundness of the corners, "default" is 8px and "large" is 16px */
|
|
4
|
+
roundness?: "default" | "large";
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.Context<CardContextProps>;
|
|
7
|
+
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import React from "react";
|
|
3
|
+
import React, { useContext } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { filterStyledSystemMarginProps, filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
6
6
|
import StyledCardFooter from "./card-footer.style";
|
|
7
|
+
import CardContext from "../__internal__/card-context";
|
|
7
8
|
|
|
8
9
|
const CardFooter = ({
|
|
9
10
|
spacing = "medium",
|
|
@@ -11,12 +12,17 @@ const CardFooter = ({
|
|
|
11
12
|
variant = "default",
|
|
12
13
|
...rest
|
|
13
14
|
}) => {
|
|
15
|
+
const {
|
|
16
|
+
roundness
|
|
17
|
+
} = useContext(CardContext);
|
|
14
18
|
return /*#__PURE__*/React.createElement(StyledCardFooter, _extends({
|
|
15
19
|
key: "card-footer",
|
|
16
20
|
"data-element": "card-footer",
|
|
17
21
|
spacing: spacing,
|
|
18
22
|
variant: variant
|
|
19
|
-
}, filterStyledSystemMarginProps(rest), filterStyledSystemPaddingProps(rest)
|
|
23
|
+
}, filterStyledSystemMarginProps(rest), filterStyledSystemPaddingProps(rest), {
|
|
24
|
+
roundness: roundness
|
|
25
|
+
}), children);
|
|
20
26
|
};
|
|
21
27
|
|
|
22
28
|
CardFooter.propTypes = {
|
|
@@ -329,6 +335,7 @@ CardFooter.propTypes = {
|
|
|
329
335
|
"toString": PropTypes.func.isRequired,
|
|
330
336
|
"valueOf": PropTypes.func.isRequired
|
|
331
337
|
}), PropTypes.string]),
|
|
338
|
+
"roundness": PropTypes.oneOf(["default", "large"]),
|
|
332
339
|
"spacing": PropTypes.oneOf(["large", "medium", "small"]),
|
|
333
340
|
"variant": PropTypes.oneOf(["default", "transparent"])
|
|
334
341
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SpaceProps } from "styled-system";
|
|
2
2
|
import { CardSpacing } from "../card.config";
|
|
3
|
-
|
|
3
|
+
import { CardContextProps } from "../__internal__/card-context";
|
|
4
|
+
export interface StyledCardFooterProps extends SpaceProps, CardContextProps {
|
|
4
5
|
/** Predefined size of CardFooter for applying padding. For more granular control, this prop can be over-ridden by the spacing props from styled-system */
|
|
5
6
|
spacing: CardSpacing;
|
|
6
7
|
/** Specify styling variant to render */
|
|
@@ -16,7 +16,8 @@ const StyledCardFooter = styled.div`
|
|
|
16
16
|
|
|
17
17
|
${({
|
|
18
18
|
spacing,
|
|
19
|
-
variant
|
|
19
|
+
variant,
|
|
20
|
+
roundness = "default"
|
|
20
21
|
}) => css`
|
|
21
22
|
background-color: ${variant === "transparent" ? "transparent" : "var(--colorsUtilityMajor025)"};
|
|
22
23
|
border-top: var(--colorsUtilityMajor100);
|
|
@@ -26,6 +27,14 @@ const StyledCardFooter = styled.div`
|
|
|
26
27
|
font-weight: 700;
|
|
27
28
|
margin: ${marginSizes[spacing]};
|
|
28
29
|
display: flex;
|
|
30
|
+
${roundness === "default" && css`
|
|
31
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
32
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
33
|
+
`}
|
|
34
|
+
${roundness === "large" && css`
|
|
35
|
+
border-bottom-left-radius: var(--borderRadius200);
|
|
36
|
+
border-bottom-right-radius: var(--borderRadius200);
|
|
37
|
+
`}
|
|
29
38
|
|
|
30
39
|
${StyledCardColumn} {
|
|
31
40
|
margin: 0;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { MarginProps } from "styled-system";
|
|
3
3
|
import * as DesignTokens from "@sage/design-tokens/js/base/common";
|
|
4
|
+
import { CardContextProps } from "./__internal__/card-context";
|
|
4
5
|
import { CardSpacing } from "./card.config";
|
|
5
6
|
declare type DesignTokensType = keyof typeof DesignTokens;
|
|
6
7
|
declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
|
|
7
|
-
export interface CardProps extends MarginProps {
|
|
8
|
+
export interface CardProps extends MarginProps, CardContextProps {
|
|
8
9
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
9
10
|
"data-element"?: string;
|
|
10
11
|
/** Identifier used for testing purposes, applied to the root element of the component. */
|
|
@@ -34,7 +35,7 @@ export interface CardProps extends MarginProps {
|
|
|
34
35
|
hoverBoxShadow?: BoxShadowsType;
|
|
35
36
|
}
|
|
36
37
|
declare const Card: {
|
|
37
|
-
({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, height, interactive, spacing, boxShadow, hoverBoxShadow, ...rest }: CardProps): JSX.Element;
|
|
38
|
+
({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, height, interactive, spacing, boxShadow, hoverBoxShadow, roundness, ...rest }: CardProps): JSX.Element;
|
|
38
39
|
displayName: string;
|
|
39
40
|
};
|
|
40
41
|
export default Card;
|