carbon-react 118.1.1 → 118.2.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.
- 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-full-screen/menu-full-screen.component.js +18 -0
- package/esm/components/menu/menu-item/menu-item.component.js +1 -1
- package/esm/components/menu/menu-item/menu-item.style.js +13 -11
- 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-full-screen/menu-full-screen.component.js +18 -0
- package/lib/components/menu/menu-item/menu-item.component.js +1 -1
- package/lib/components/menu/menu-item/menu-item.style.js +13 -11
- 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
|
@@ -54,6 +54,7 @@ const StyledButtonToggleLabel = _styledComponents.default.label`
|
|
|
54
54
|
position: relative;
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
max-width: 100%;
|
|
57
|
+
|
|
57
58
|
${({
|
|
58
59
|
size
|
|
59
60
|
}) => (0, _styledComponents.css)`
|
|
@@ -63,19 +64,15 @@ const StyledButtonToggleLabel = _styledComponents.default.label`
|
|
|
63
64
|
`}
|
|
64
65
|
font-weight: 700;
|
|
65
66
|
cursor: pointer;
|
|
66
|
-
|
|
67
67
|
border: 1px solid var(--colorsActionMinor500);
|
|
68
|
-
|
|
69
68
|
${_icon.default} {
|
|
70
69
|
color: var(--colorsActionMinor500);
|
|
71
70
|
}
|
|
72
|
-
|
|
73
71
|
input:checked ~ && {
|
|
74
72
|
background-color: var(--colorsActionMinor300);
|
|
75
73
|
color: var(--colorsActionMinor600);
|
|
76
74
|
cursor: auto;
|
|
77
75
|
}
|
|
78
|
-
|
|
79
76
|
input:focus ~ & {
|
|
80
77
|
outline: 3px solid var(--colorsSemanticFocus500);
|
|
81
78
|
z-index: 100;
|
|
@@ -85,12 +82,10 @@ const StyledButtonToggleLabel = _styledComponents.default.label`
|
|
|
85
82
|
background-color: var(--colorsActionMinor200);
|
|
86
83
|
border-color: var(--colorsActionMinor500);
|
|
87
84
|
color: var(--colorsActionMinor500);
|
|
88
|
-
|
|
89
85
|
${_icon.default} {
|
|
90
86
|
color: var(--colorsActionMinor500);
|
|
91
87
|
}
|
|
92
88
|
}
|
|
93
|
-
|
|
94
89
|
${({
|
|
95
90
|
buttonIcon,
|
|
96
91
|
buttonIconSize,
|
|
@@ -98,19 +93,16 @@ const StyledButtonToggleLabel = _styledComponents.default.label`
|
|
|
98
93
|
}) => buttonIcon && buttonIconSize === "large" && (0, _styledComponents.css)`
|
|
99
94
|
height: ${heightLargeIconConfig[size]}px;
|
|
100
95
|
padding: 0 ${paddingLargeIconConfig[size]}px;
|
|
101
|
-
|
|
102
96
|
${StyledButtonToggleContentWrapper} {
|
|
103
97
|
flex-direction: column;
|
|
104
98
|
}
|
|
105
99
|
`}
|
|
106
|
-
|
|
107
100
|
${({
|
|
108
101
|
disabled
|
|
109
102
|
}) => disabled && (0, _styledComponents.css)`
|
|
110
103
|
& {
|
|
111
104
|
border-color: var(--colorsActionDisabled500);
|
|
112
105
|
color: var(--colorsActionMinorYin030);
|
|
113
|
-
|
|
114
106
|
${_icon.default} {
|
|
115
107
|
color: var(--colorsActionMinorYin030);
|
|
116
108
|
}
|
|
@@ -127,24 +119,20 @@ const StyledButtonToggleIcon = _styledComponents.default.div`
|
|
|
127
119
|
${({
|
|
128
120
|
hasContent
|
|
129
121
|
}) => hasContent && `margin-right: 8px;`}
|
|
130
|
-
|
|
131
122
|
${({
|
|
132
123
|
buttonIconSize
|
|
133
124
|
}) => buttonIconSize === "large" && (0, _styledComponents.css)`
|
|
134
125
|
margin-right: 0;
|
|
135
|
-
|
|
136
126
|
${_icon.default} {
|
|
137
127
|
margin-right: 0;
|
|
138
128
|
margin-bottom: 8px;
|
|
139
129
|
height: ${`${iconFontSizes.largeIcon}px`};
|
|
140
130
|
width: ${`${iconFontSizes.largeIcon}px`};
|
|
141
131
|
}
|
|
142
|
-
|
|
143
132
|
${_icon.default}::before {
|
|
144
133
|
font-size: ${`${iconFontSizes[`${buttonIconSize}Icon`]}px`};
|
|
145
134
|
line-height: ${`${iconFontSizes[`${buttonIconSize}Icon`]}px`};
|
|
146
135
|
}
|
|
147
|
-
|
|
148
136
|
.carbon-icon__svg--credit-card-slash {
|
|
149
137
|
margin-left: 6px;
|
|
150
138
|
}
|
|
@@ -155,6 +143,36 @@ const StyledButtonToggle = _styledComponents.default.div`
|
|
|
155
143
|
display: inline-block;
|
|
156
144
|
vertical-align: middle;
|
|
157
145
|
|
|
146
|
+
${({
|
|
147
|
+
grouped
|
|
148
|
+
}) => (0, _styledComponents.css)`
|
|
149
|
+
${!grouped && (0, _styledComponents.css)`
|
|
150
|
+
&&&& {
|
|
151
|
+
${StyledButtonToggleLabel} {
|
|
152
|
+
border-radius: var(--borderRadius400);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
`}
|
|
156
|
+
|
|
157
|
+
${grouped && (0, _styledComponents.css)`
|
|
158
|
+
&&&& {
|
|
159
|
+
:first-of-type {
|
|
160
|
+
${StyledButtonToggleLabel} {
|
|
161
|
+
border-top-left-radius: var(--borderRadius400);
|
|
162
|
+
border-bottom-left-radius: var(--borderRadius400);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:last-of-type {
|
|
167
|
+
${StyledButtonToggleLabel} {
|
|
168
|
+
border-top-right-radius: var(--borderRadius400);
|
|
169
|
+
border-bottom-right-radius: var(--borderRadius400);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
`}
|
|
174
|
+
`}
|
|
175
|
+
|
|
158
176
|
&:not(:first-of-type) {
|
|
159
177
|
margin-left: 8px;
|
|
160
178
|
}
|
|
@@ -20,6 +20,24 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
20
20
|
const StyledButtonToggleGroup = _styledComponents.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
|
|
23
|
+
${_buttonToggle.StyledButtonToggleLabel}:not(:first-of-type):not(:last-of-type) {
|
|
24
|
+
border-radius: var(--borderRadius000);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
${_buttonToggle.StyledButtonToggle}:first-of-type ${_buttonToggle.StyledButtonToggleLabel} {
|
|
28
|
+
border-top-left-radius: var(--borderRadius400);
|
|
29
|
+
border-bottom-left-radius: var(--borderRadius400);
|
|
30
|
+
border-top-right-radius: var(--borderRadius000);
|
|
31
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${_buttonToggle.StyledButtonToggle}:last-of-type ${_buttonToggle.StyledButtonToggleLabel} {
|
|
35
|
+
border-top-left-radius: var(--borderRadius000);
|
|
36
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
37
|
+
border-top-right-radius: var(--borderRadius400);
|
|
38
|
+
border-bottom-right-radius: var(--borderRadius400);
|
|
39
|
+
}
|
|
40
|
+
|
|
23
41
|
${({
|
|
24
42
|
fullWidth
|
|
25
43
|
}) => fullWidth && (0, _styledComponents.css)`
|
|
@@ -29,20 +47,20 @@ const StyledButtonToggleGroup = _styledComponents.default.div`
|
|
|
29
47
|
${_buttonToggle.StyledButtonToggle} {
|
|
30
48
|
flex: auto;
|
|
31
49
|
}
|
|
32
|
-
`}
|
|
50
|
+
`}
|
|
33
51
|
|
|
34
52
|
${({
|
|
35
53
|
inputWidth
|
|
36
54
|
}) => inputWidth && (0, _styledComponents.css)`
|
|
37
55
|
width: ${`${inputWidth}%`};
|
|
38
|
-
`}
|
|
56
|
+
`}
|
|
39
57
|
|
|
40
58
|
${_buttonToggle.StyledButtonToggleLabel} {
|
|
41
59
|
${({
|
|
42
60
|
info
|
|
43
61
|
}) => info && (0, _styledComponents.css)`
|
|
44
62
|
border-color: var(--colorsSemanticInfo500);
|
|
45
|
-
`}
|
|
63
|
+
`}
|
|
46
64
|
${({
|
|
47
65
|
warning
|
|
48
66
|
}) => warning && (0, _styledComponents.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;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = /*#__PURE__*/_react.default.createContext({});
|
|
13
|
+
|
|
14
|
+
exports.default = _default;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -13,8 +13,14 @@ var _utils = require("../../../style/utils");
|
|
|
13
13
|
|
|
14
14
|
var _cardFooter = _interopRequireDefault(require("./card-footer.style"));
|
|
15
15
|
|
|
16
|
+
var _cardContext = _interopRequireDefault(require("../__internal__/card-context"));
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
20
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
18
24
|
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); }
|
|
19
25
|
|
|
20
26
|
const CardFooter = ({
|
|
@@ -23,12 +29,17 @@ const CardFooter = ({
|
|
|
23
29
|
variant = "default",
|
|
24
30
|
...rest
|
|
25
31
|
}) => {
|
|
32
|
+
const {
|
|
33
|
+
roundness
|
|
34
|
+
} = (0, _react.useContext)(_cardContext.default);
|
|
26
35
|
return /*#__PURE__*/_react.default.createElement(_cardFooter.default, _extends({
|
|
27
36
|
key: "card-footer",
|
|
28
37
|
"data-element": "card-footer",
|
|
29
38
|
spacing: spacing,
|
|
30
39
|
variant: variant
|
|
31
|
-
}, (0, _utils.filterStyledSystemMarginProps)(rest), (0, _utils.filterStyledSystemPaddingProps)(rest)
|
|
40
|
+
}, (0, _utils.filterStyledSystemMarginProps)(rest), (0, _utils.filterStyledSystemPaddingProps)(rest), {
|
|
41
|
+
roundness: roundness
|
|
42
|
+
}), children);
|
|
32
43
|
};
|
|
33
44
|
|
|
34
45
|
CardFooter.propTypes = {
|
|
@@ -341,6 +352,7 @@ CardFooter.propTypes = {
|
|
|
341
352
|
"toString": _propTypes.default.func.isRequired,
|
|
342
353
|
"valueOf": _propTypes.default.func.isRequired
|
|
343
354
|
}), _propTypes.default.string]),
|
|
355
|
+
"roundness": _propTypes.default.oneOf(["default", "large"]),
|
|
344
356
|
"spacing": _propTypes.default.oneOf(["large", "medium", "small"]),
|
|
345
357
|
"variant": _propTypes.default.oneOf(["default", "transparent"])
|
|
346
358
|
};
|
|
@@ -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 */
|
|
@@ -32,7 +32,8 @@ const StyledCardFooter = _styledComponents.default.div`
|
|
|
32
32
|
|
|
33
33
|
${({
|
|
34
34
|
spacing,
|
|
35
|
-
variant
|
|
35
|
+
variant,
|
|
36
|
+
roundness = "default"
|
|
36
37
|
}) => (0, _styledComponents.css)`
|
|
37
38
|
background-color: ${variant === "transparent" ? "transparent" : "var(--colorsUtilityMajor025)"};
|
|
38
39
|
border-top: var(--colorsUtilityMajor100);
|
|
@@ -42,6 +43,14 @@ const StyledCardFooter = _styledComponents.default.div`
|
|
|
42
43
|
font-weight: 700;
|
|
43
44
|
margin: ${marginSizes[spacing]};
|
|
44
45
|
display: flex;
|
|
46
|
+
${roundness === "default" && (0, _styledComponents.css)`
|
|
47
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
48
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
49
|
+
`}
|
|
50
|
+
${roundness === "large" && (0, _styledComponents.css)`
|
|
51
|
+
border-bottom-left-radius: var(--borderRadius200);
|
|
52
|
+
border-bottom-right-radius: var(--borderRadius200);
|
|
53
|
+
`}
|
|
45
54
|
|
|
46
55
|
${_cardColumn.default} {
|
|
47
56
|
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;
|
|
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _utils = require("../../style/utils");
|
|
13
13
|
|
|
14
|
+
var _cardContext = _interopRequireDefault(require("./__internal__/card-context"));
|
|
15
|
+
|
|
14
16
|
var _card = _interopRequireDefault(require("./card.style"));
|
|
15
17
|
|
|
16
18
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
@@ -46,6 +48,7 @@ const Card = ({
|
|
|
46
48
|
spacing = "medium",
|
|
47
49
|
boxShadow,
|
|
48
50
|
hoverBoxShadow,
|
|
51
|
+
roundness = "default",
|
|
49
52
|
...rest
|
|
50
53
|
}) => {
|
|
51
54
|
if (!isDeprecationWarningTriggered && oldDataRole) {
|
|
@@ -86,9 +89,15 @@ const Card = ({
|
|
|
86
89
|
}, interactive && {
|
|
87
90
|
tabIndex: 0,
|
|
88
91
|
type: "button"
|
|
92
|
+
}, {
|
|
93
|
+
roundness: roundness
|
|
89
94
|
}, (0, _utils.filterStyledSystemMarginProps)(rest)), draggable && /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
90
95
|
type: "drag"
|
|
91
|
-
}),
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_cardContext.default.Provider, {
|
|
97
|
+
value: {
|
|
98
|
+
roundness
|
|
99
|
+
}
|
|
100
|
+
}, renderChildren()));
|
|
92
101
|
};
|
|
93
102
|
|
|
94
103
|
Card.propTypes = {
|
|
@@ -257,6 +266,7 @@ Card.propTypes = {
|
|
|
257
266
|
"toString": _propTypes.default.func.isRequired,
|
|
258
267
|
"valueOf": _propTypes.default.func.isRequired
|
|
259
268
|
}), _propTypes.default.string]),
|
|
269
|
+
"roundness": _propTypes.default.oneOf(["default", "large"]),
|
|
260
270
|
"spacing": _propTypes.default.oneOf(["large", "medium", "small"])
|
|
261
271
|
};
|
|
262
272
|
Card.displayName = "Card";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { MarginProps } from "styled-system";
|
|
2
2
|
import * as DesignTokens from "@sage/design-tokens/js/base/common";
|
|
3
3
|
import { CardSpacing } from "./card.config";
|
|
4
|
+
import { CardContextProps } from "./__internal__/card-context";
|
|
4
5
|
declare type DesignTokensType = keyof typeof DesignTokens;
|
|
5
6
|
export declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
|
|
6
|
-
export interface StyledCardProps extends MarginProps {
|
|
7
|
+
export interface StyledCardProps extends MarginProps, CardContextProps {
|
|
7
8
|
cardWidth: string;
|
|
8
9
|
interactive: boolean;
|
|
9
10
|
draggable: boolean;
|
|
@@ -30,10 +30,12 @@ const StyledCard = _styledComponents.default.div`
|
|
|
30
30
|
height,
|
|
31
31
|
spacing,
|
|
32
32
|
boxShadow = "boxShadow050",
|
|
33
|
-
hoverBoxShadow = "boxShadow100"
|
|
33
|
+
hoverBoxShadow = "boxShadow100",
|
|
34
|
+
roundness
|
|
34
35
|
}) => (0, _styledComponents.css)`
|
|
35
36
|
background-color: var(--colorsUtilityYang100);
|
|
36
37
|
border: none;
|
|
38
|
+
border-radius: ${roundness === "default" ? "var(--borderRadius100)" : "var(--borderRadius200)"};
|
|
37
39
|
box-shadow: var(--${boxShadow});
|
|
38
40
|
color: var(--colorsUtilityYin090);
|
|
39
41
|
display: flex;
|
|
@@ -57,7 +57,7 @@ const Carousel = ({
|
|
|
57
57
|
const isTheSameIndex = newIndex === lastSlideIndexProp.current || newIndex === selectedSlideIndex;
|
|
58
58
|
if (isNewIndexUndefined || isTheSameIndex) return;
|
|
59
59
|
|
|
60
|
-
if (newIndex > selectedSlideIndex) {
|
|
60
|
+
if (Number(newIndex) > Number(selectedSlideIndex)) {
|
|
61
61
|
transitionDirection.current = NEXT;
|
|
62
62
|
} else {
|
|
63
63
|
transitionDirection.current = PREVIOUS;
|
|
@@ -22,7 +22,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
22
22
|
const CarouselNavigationStyle = _styledComponents.default.div`
|
|
23
23
|
margin-top: -32.5px;
|
|
24
24
|
position: absolute;
|
|
25
|
-
top:
|
|
25
|
+
top: 52%;
|
|
26
26
|
z-index: 20;
|
|
27
27
|
`;
|
|
28
28
|
exports.CarouselNavigationStyle = CarouselNavigationStyle;
|
|
@@ -58,8 +58,9 @@ const CarouselButtonStyle = _styledComponents.default.button.attrs({
|
|
|
58
58
|
disabled
|
|
59
59
|
}) => (0, _styledComponents.css)`
|
|
60
60
|
border: none;
|
|
61
|
+
border-radius: var(--borderRadius400);
|
|
61
62
|
width: 40px;
|
|
62
|
-
height:
|
|
63
|
+
height: 40px;
|
|
63
64
|
border-width: var(--borderWidth200);
|
|
64
65
|
border-color: var(--colorsActionMajorTransparent);
|
|
65
66
|
background-color: ${disabled ? "var(--colorsActionDisabled500)" : "var(--colorsActionMajor500)"};
|
|
@@ -108,6 +109,7 @@ const CarouselSelectorInputStyle = _styledComponents.default.input`
|
|
|
108
109
|
exports.CarouselSelectorInputStyle = CarouselSelectorInputStyle;
|
|
109
110
|
const CarouselSelectorLabelStyle = _styledComponents.default.label`
|
|
110
111
|
display: inline-block;
|
|
112
|
+
border-radius: var(--borderRadius100);
|
|
111
113
|
width: 10px;
|
|
112
114
|
height: 10px;
|
|
113
115
|
background: var(--colorsActionMinor200);
|
|
@@ -207,6 +207,7 @@ const StyledDayPicker = _styledComponents.default.div`
|
|
|
207
207
|
padding: var(--spacing300);
|
|
208
208
|
text-align: center;
|
|
209
209
|
user-select: none;
|
|
210
|
+
border-radius: var(--borderRadius050);
|
|
210
211
|
}
|
|
211
212
|
|
|
212
213
|
.DayPicker * {
|
|
@@ -226,6 +227,7 @@ const StyledDayPicker = _styledComponents.default.div`
|
|
|
226
227
|
padding: 0;
|
|
227
228
|
&:focus {
|
|
228
229
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
230
|
+
border-radius: var(--borderRadius050);
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
|
|
@@ -264,6 +266,7 @@ const StyledDayPicker = _styledComponents.default.div`
|
|
|
264
266
|
font-weight: var(--fontWeights700);
|
|
265
267
|
font-size: var(--fontSizes100);
|
|
266
268
|
line-height: var(--lineHeights500);
|
|
269
|
+
border-radius: var(--borderRadius400);
|
|
267
270
|
|
|
268
271
|
&:hover {
|
|
269
272
|
background-color: var(--colorsActionMinor050);
|
|
@@ -308,6 +311,7 @@ const StyledDayPicker = _styledComponents.default.div`
|
|
|
308
311
|
.DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
|
|
309
312
|
background-color: var(--colorsActionMajor500);
|
|
310
313
|
color: var(--colorsUtilityYang100);
|
|
314
|
+
border-radius: var(--borderRadius400);
|
|
311
315
|
}
|
|
312
316
|
|
|
313
317
|
.DayPicker-Day--selected.DayPicker-Day--disabled:not(.DayPicker-Day--outside) {
|
|
@@ -23,6 +23,8 @@ const StyledButton = _styledComponents.default.button.attrs({
|
|
|
23
23
|
width: var(--sizing500);
|
|
24
24
|
padding: var(--spacing150);
|
|
25
25
|
box-sizing: border-box;
|
|
26
|
+
border-radius: var(--borderRadius050);
|
|
27
|
+
|
|
26
28
|
&:focus {
|
|
27
29
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
28
30
|
}
|
|
@@ -48,6 +48,7 @@ const StyledDialog = _styledComponents.default.div`
|
|
|
48
48
|
box-shadow: var(--boxShadow300);
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-direction: column;
|
|
51
|
+
border-radius: var(--borderRadius200);
|
|
51
52
|
position: fixed;
|
|
52
53
|
top: 50%;
|
|
53
54
|
z-index: ${({
|
|
@@ -85,6 +86,8 @@ const StyledDialog = _styledComponents.default.div`
|
|
|
85
86
|
${_form.StyledFormFooter}.sticky {
|
|
86
87
|
${_formStyleUtils.calculateWidthValue}
|
|
87
88
|
${props => (0, _formStyleUtils.calculateFormSpacingValues)(props, false)}
|
|
89
|
+
border-bottom-right-radius: var(--borderRadius200);
|
|
90
|
+
border-bottom-left-radius: var(--borderRadius200);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
> ${_iconButton.default} {
|
|
@@ -104,6 +107,8 @@ const StyledDialogTitle = _styledComponents.default.div`
|
|
|
104
107
|
background-color: var(--colorsUtilityYang100);
|
|
105
108
|
padding: 23px ${_dialog.HORIZONTAL_PADDING}px 0;
|
|
106
109
|
border-bottom: 1px solid #ccd6db;
|
|
110
|
+
border-top-right-radius: var(--borderRadius200);
|
|
111
|
+
border-top-left-radius: var(--borderRadius200);
|
|
107
112
|
${({
|
|
108
113
|
showCloseIcon
|
|
109
114
|
}) => showCloseIcon && "padding-right: 85px"};
|
|
@@ -13,5 +13,5 @@ export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxPro
|
|
|
13
13
|
* Please note this component has a minWidth of 600px */
|
|
14
14
|
width?: number | string;
|
|
15
15
|
}
|
|
16
|
-
export declare const DismissibleBox: ({ children, onClose, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
16
|
+
export declare const DismissibleBox: ({ children, onClose, borderRadius, ...rest }: DismissibleBoxProps) => JSX.Element;
|
|
17
17
|
export default DismissibleBox;
|
|
@@ -22,10 +22,12 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
22
22
|
const DismissibleBox = ({
|
|
23
23
|
children,
|
|
24
24
|
onClose,
|
|
25
|
+
borderRadius = "borderRadius100",
|
|
25
26
|
...rest
|
|
26
27
|
}) => /*#__PURE__*/_react.default.createElement(_dismissibleBox.StyledDismissibleBox, _extends({
|
|
27
28
|
p: "20px 24px 20px 20px",
|
|
28
|
-
"data-component": "dismissible-box"
|
|
29
|
+
"data-component": "dismissible-box",
|
|
30
|
+
borderRadius: borderRadius
|
|
29
31
|
}, rest), children, /*#__PURE__*/_react.default.createElement("span", {
|
|
30
32
|
"data-element": "close-button-wrapper"
|
|
31
33
|
}, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
@@ -378,6 +380,7 @@ DismissibleBox.propTypes = {
|
|
|
378
380
|
"toString": _propTypes.default.func.isRequired,
|
|
379
381
|
"valueOf": _propTypes.default.func.isRequired
|
|
380
382
|
}), _propTypes.default.string]),
|
|
383
|
+
"borderRadius": _propTypes.default.any,
|
|
381
384
|
"bottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
382
385
|
"__@iterator": _propTypes.default.func.isRequired,
|
|
383
386
|
"anchor": _propTypes.default.func.isRequired,
|
|
@@ -208,6 +208,7 @@ const StyledSidebarToggleButton = _styledComponents.default.button.attrs({
|
|
|
208
208
|
border: none;
|
|
209
209
|
z-index: 1;
|
|
210
210
|
animation: ${buttonClose} ${animationDuration} ease-in-out;
|
|
211
|
+
border-radius: var(--borderRadius050);
|
|
211
212
|
|
|
212
213
|
&:focus {
|
|
213
214
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
@@ -20,6 +20,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
20
20
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
22
|
const StyledPicklistItem = _styledComponents.default.li`
|
|
23
|
+
border-radius: var(--borderRadius100);
|
|
23
24
|
${({
|
|
24
25
|
locked
|
|
25
26
|
}) => (0, _styledComponents.css)`
|
|
@@ -49,6 +50,25 @@ const StyledPicklistItem = _styledComponents.default.li`
|
|
|
49
50
|
`;
|
|
50
51
|
exports.StyledPicklistItem = StyledPicklistItem;
|
|
51
52
|
const StyledButton = (0, _styledComponents.default)(_button.default)`
|
|
53
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
54
|
+
border-top-right-radius: var(--borderRadius100);
|
|
55
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
56
|
+
border-top-left-radius: var(--borderRadius000);
|
|
57
|
+
|
|
58
|
+
:hover {
|
|
59
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
60
|
+
border-top-right-radius: var(--borderRadius100);
|
|
61
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
62
|
+
border-top-left-radius: var(--borderRadius000);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:focus {
|
|
66
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
67
|
+
border-top-right-radius: var(--borderRadius100);
|
|
68
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
69
|
+
border-top-left-radius: var(--borderRadius000);
|
|
70
|
+
}
|
|
71
|
+
|
|
52
72
|
${({
|
|
53
73
|
iconType
|
|
54
74
|
}) => (0, _styledComponents.css)`
|
|
@@ -210,6 +210,13 @@ const StyledFlatTableRow = _styledComponents.default.tr`
|
|
|
210
210
|
pointer-events: none;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
:last-child {
|
|
214
|
+
:after {
|
|
215
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
216
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
213
220
|
:first-child {
|
|
214
221
|
:after {
|
|
215
222
|
top: 0px;
|