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
|
@@ -3,6 +3,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { filterStyledSystemMarginProps } from "../../style/utils";
|
|
6
|
+
import CardContext from "./__internal__/card-context";
|
|
6
7
|
import StyledCard from "./card.style";
|
|
7
8
|
import Icon from "../icon";
|
|
8
9
|
import { CardRow, CardFooter } from ".";
|
|
@@ -27,6 +28,7 @@ const Card = ({
|
|
|
27
28
|
spacing = "medium",
|
|
28
29
|
boxShadow,
|
|
29
30
|
hoverBoxShadow,
|
|
31
|
+
roundness = "default",
|
|
30
32
|
...rest
|
|
31
33
|
}) => {
|
|
32
34
|
if (!isDeprecationWarningTriggered && oldDataRole) {
|
|
@@ -66,9 +68,15 @@ const Card = ({
|
|
|
66
68
|
}, interactive && {
|
|
67
69
|
tabIndex: 0,
|
|
68
70
|
type: "button"
|
|
71
|
+
}, {
|
|
72
|
+
roundness: roundness
|
|
69
73
|
}, filterStyledSystemMarginProps(rest)), draggable && /*#__PURE__*/React.createElement(Icon, {
|
|
70
74
|
type: "drag"
|
|
71
|
-
}),
|
|
75
|
+
}), /*#__PURE__*/React.createElement(CardContext.Provider, {
|
|
76
|
+
value: {
|
|
77
|
+
roundness
|
|
78
|
+
}
|
|
79
|
+
}, renderChildren()));
|
|
72
80
|
};
|
|
73
81
|
|
|
74
82
|
Card.propTypes = {
|
|
@@ -237,6 +245,7 @@ Card.propTypes = {
|
|
|
237
245
|
"toString": PropTypes.func.isRequired,
|
|
238
246
|
"valueOf": PropTypes.func.isRequired
|
|
239
247
|
}), PropTypes.string]),
|
|
248
|
+
"roundness": PropTypes.oneOf(["default", "large"]),
|
|
240
249
|
"spacing": PropTypes.oneOf(["large", "medium", "small"])
|
|
241
250
|
};
|
|
242
251
|
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;
|
|
@@ -14,10 +14,12 @@ const StyledCard = styled.div`
|
|
|
14
14
|
height,
|
|
15
15
|
spacing,
|
|
16
16
|
boxShadow = "boxShadow050",
|
|
17
|
-
hoverBoxShadow = "boxShadow100"
|
|
17
|
+
hoverBoxShadow = "boxShadow100",
|
|
18
|
+
roundness
|
|
18
19
|
}) => css`
|
|
19
20
|
background-color: var(--colorsUtilityYang100);
|
|
20
21
|
border: none;
|
|
22
|
+
border-radius: ${roundness === "default" ? "var(--borderRadius100)" : "var(--borderRadius200)"};
|
|
21
23
|
box-shadow: var(--${boxShadow});
|
|
22
24
|
color: var(--colorsUtilityYin090);
|
|
23
25
|
display: flex;
|
|
@@ -39,7 +39,7 @@ const Carousel = ({
|
|
|
39
39
|
const isTheSameIndex = newIndex === lastSlideIndexProp.current || newIndex === selectedSlideIndex;
|
|
40
40
|
if (isNewIndexUndefined || isTheSameIndex) return;
|
|
41
41
|
|
|
42
|
-
if (newIndex > selectedSlideIndex) {
|
|
42
|
+
if (Number(newIndex) > Number(selectedSlideIndex)) {
|
|
43
43
|
transitionDirection.current = NEXT;
|
|
44
44
|
} else {
|
|
45
45
|
transitionDirection.current = PREVIOUS;
|
|
@@ -5,7 +5,7 @@ import { SlideStyle } from "./slide/slide.style";
|
|
|
5
5
|
const CarouselNavigationStyle = styled.div`
|
|
6
6
|
margin-top: -32.5px;
|
|
7
7
|
position: absolute;
|
|
8
|
-
top:
|
|
8
|
+
top: 52%;
|
|
9
9
|
z-index: 20;
|
|
10
10
|
`;
|
|
11
11
|
const CarouselPreviousButtonWrapperStyle = styled(CarouselNavigationStyle)`
|
|
@@ -35,8 +35,9 @@ const CarouselButtonStyle = styled.button.attrs({
|
|
|
35
35
|
disabled
|
|
36
36
|
}) => css`
|
|
37
37
|
border: none;
|
|
38
|
+
border-radius: var(--borderRadius400);
|
|
38
39
|
width: 40px;
|
|
39
|
-
height:
|
|
40
|
+
height: 40px;
|
|
40
41
|
border-width: var(--borderWidth200);
|
|
41
42
|
border-color: var(--colorsActionMajorTransparent);
|
|
42
43
|
background-color: ${disabled ? "var(--colorsActionDisabled500)" : "var(--colorsActionMajor500)"};
|
|
@@ -83,6 +84,7 @@ const CarouselSelectorInputStyle = styled.input`
|
|
|
83
84
|
`;
|
|
84
85
|
const CarouselSelectorLabelStyle = styled.label`
|
|
85
86
|
display: inline-block;
|
|
87
|
+
border-radius: var(--borderRadius100);
|
|
86
88
|
width: 10px;
|
|
87
89
|
height: 10px;
|
|
88
90
|
background: var(--colorsActionMinor200);
|
|
@@ -196,6 +196,7 @@ const StyledDayPicker = styled.div`
|
|
|
196
196
|
padding: var(--spacing300);
|
|
197
197
|
text-align: center;
|
|
198
198
|
user-select: none;
|
|
199
|
+
border-radius: var(--borderRadius050);
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
.DayPicker * {
|
|
@@ -215,6 +216,7 @@ const StyledDayPicker = styled.div`
|
|
|
215
216
|
padding: 0;
|
|
216
217
|
&:focus {
|
|
217
218
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
219
|
+
border-radius: var(--borderRadius050);
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
|
@@ -253,6 +255,7 @@ const StyledDayPicker = styled.div`
|
|
|
253
255
|
font-weight: var(--fontWeights700);
|
|
254
256
|
font-size: var(--fontSizes100);
|
|
255
257
|
line-height: var(--lineHeights500);
|
|
258
|
+
border-radius: var(--borderRadius400);
|
|
256
259
|
|
|
257
260
|
&:hover {
|
|
258
261
|
background-color: var(--colorsActionMinor050);
|
|
@@ -297,6 +300,7 @@ const StyledDayPicker = styled.div`
|
|
|
297
300
|
.DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
|
|
298
301
|
background-color: var(--colorsActionMajor500);
|
|
299
302
|
color: var(--colorsUtilityYang100);
|
|
303
|
+
border-radius: var(--borderRadius400);
|
|
300
304
|
}
|
|
301
305
|
|
|
302
306
|
.DayPicker-Day--selected.DayPicker-Day--disabled:not(.DayPicker-Day--outside) {
|
|
@@ -13,6 +13,8 @@ const StyledButton = styled.button.attrs({
|
|
|
13
13
|
width: var(--sizing500);
|
|
14
14
|
padding: var(--spacing150);
|
|
15
15
|
box-sizing: border-box;
|
|
16
|
+
border-radius: var(--borderRadius050);
|
|
17
|
+
|
|
16
18
|
&:focus {
|
|
17
19
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
18
20
|
}
|
|
@@ -27,6 +27,7 @@ const StyledDialog = styled.div`
|
|
|
27
27
|
box-shadow: var(--boxShadow300);
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-direction: column;
|
|
30
|
+
border-radius: var(--borderRadius200);
|
|
30
31
|
position: fixed;
|
|
31
32
|
top: 50%;
|
|
32
33
|
z-index: ${({
|
|
@@ -64,6 +65,8 @@ const StyledDialog = styled.div`
|
|
|
64
65
|
${StyledFormFooter}.sticky {
|
|
65
66
|
${calculateWidthValue}
|
|
66
67
|
${props => calculateFormSpacingValues(props, false)}
|
|
68
|
+
border-bottom-right-radius: var(--borderRadius200);
|
|
69
|
+
border-bottom-left-radius: var(--borderRadius200);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
> ${StyledIconButton} {
|
|
@@ -82,6 +85,8 @@ const StyledDialogTitle = styled.div`
|
|
|
82
85
|
background-color: var(--colorsUtilityYang100);
|
|
83
86
|
padding: 23px ${HORIZONTAL_PADDING}px 0;
|
|
84
87
|
border-bottom: 1px solid #ccd6db;
|
|
88
|
+
border-top-right-radius: var(--borderRadius200);
|
|
89
|
+
border-top-left-radius: var(--borderRadius200);
|
|
85
90
|
${({
|
|
86
91
|
showCloseIcon
|
|
87
92
|
}) => 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;
|
|
@@ -9,10 +9,12 @@ import Icon from "../icon";
|
|
|
9
9
|
const DismissibleBox = ({
|
|
10
10
|
children,
|
|
11
11
|
onClose,
|
|
12
|
+
borderRadius = "borderRadius100",
|
|
12
13
|
...rest
|
|
13
14
|
}) => /*#__PURE__*/React.createElement(StyledDismissibleBox, _extends({
|
|
14
15
|
p: "20px 24px 20px 20px",
|
|
15
|
-
"data-component": "dismissible-box"
|
|
16
|
+
"data-component": "dismissible-box",
|
|
17
|
+
borderRadius: borderRadius
|
|
16
18
|
}, rest), children, /*#__PURE__*/React.createElement("span", {
|
|
17
19
|
"data-element": "close-button-wrapper"
|
|
18
20
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
@@ -364,6 +366,7 @@ DismissibleBox.propTypes = {
|
|
|
364
366
|
"toString": PropTypes.func.isRequired,
|
|
365
367
|
"valueOf": PropTypes.func.isRequired
|
|
366
368
|
}), PropTypes.string]),
|
|
369
|
+
"borderRadius": PropTypes.any,
|
|
367
370
|
"bottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
368
371
|
"__@iterator": PropTypes.func.isRequired,
|
|
369
372
|
"anchor": PropTypes.func.isRequired,
|
|
@@ -186,6 +186,7 @@ const StyledSidebarToggleButton = styled.button.attrs({
|
|
|
186
186
|
border: none;
|
|
187
187
|
z-index: 1;
|
|
188
188
|
animation: ${buttonClose} ${animationDuration} ease-in-out;
|
|
189
|
+
border-radius: var(--borderRadius050);
|
|
189
190
|
|
|
190
191
|
&:focus {
|
|
191
192
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
@@ -3,6 +3,7 @@ import Button from "../../button";
|
|
|
3
3
|
import Icon from "../../icon";
|
|
4
4
|
import StyledIcon from "../../icon/icon.style";
|
|
5
5
|
const StyledPicklistItem = styled.li`
|
|
6
|
+
border-radius: var(--borderRadius100);
|
|
6
7
|
${({
|
|
7
8
|
locked
|
|
8
9
|
}) => css`
|
|
@@ -31,6 +32,25 @@ const StyledPicklistItem = styled.li`
|
|
|
31
32
|
`}
|
|
32
33
|
`;
|
|
33
34
|
const StyledButton = styled(Button)`
|
|
35
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
36
|
+
border-top-right-radius: var(--borderRadius100);
|
|
37
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
38
|
+
border-top-left-radius: var(--borderRadius000);
|
|
39
|
+
|
|
40
|
+
:hover {
|
|
41
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
42
|
+
border-top-right-radius: var(--borderRadius100);
|
|
43
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
44
|
+
border-top-left-radius: var(--borderRadius000);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:focus {
|
|
48
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
49
|
+
border-top-right-radius: var(--borderRadius100);
|
|
50
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
51
|
+
border-top-left-radius: var(--borderRadius000);
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
${({
|
|
35
55
|
iconType
|
|
36
56
|
}) => css`
|
|
@@ -189,6 +189,13 @@ const StyledFlatTableRow = styled.tr`
|
|
|
189
189
|
pointer-events: none;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
:last-child {
|
|
193
|
+
:after {
|
|
194
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
195
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
192
199
|
:first-child {
|
|
193
200
|
:after {
|
|
194
201
|
top: 0px;
|
|
@@ -1,6 +1,6 @@
|
|
|
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, { useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
6
6
|
import { StyledFlatTableWrapper, StyledFlatTable, StyledFlatTableFooter, StyledTableContainer } from "./flat-table.style";
|
|
@@ -26,6 +26,12 @@ const FlatTable = ({
|
|
|
26
26
|
width,
|
|
27
27
|
...rest
|
|
28
28
|
}) => {
|
|
29
|
+
const wrapperRef = useRef(null);
|
|
30
|
+
const tableRef = useRef(null);
|
|
31
|
+
const [hasVerticalScrollbar, setHasVerticalScrollbar] = useState(false);
|
|
32
|
+
const [hasHorizontalScrollbar, setHasHorizontalScrollbar] = useState(false);
|
|
33
|
+
const [firstColRowSpanIndex, setFirstColRowSpanIndex] = useState(-1);
|
|
34
|
+
const [lastColRowSpanIndex, setLastColRowSpanIndex] = useState(-1);
|
|
29
35
|
const addDefaultHeight = !height && (hasStickyHead || hasStickyFooter);
|
|
30
36
|
const tableStylingProps = {
|
|
31
37
|
caption,
|
|
@@ -37,9 +43,50 @@ const FlatTable = ({
|
|
|
37
43
|
tableStylingProps["aria-describedby"] = ariaDescribedby;
|
|
38
44
|
}
|
|
39
45
|
|
|
46
|
+
useLayoutEffect(() => {
|
|
47
|
+
const findRow = (rows, isFirstCol) => rows.find((row, index) => {
|
|
48
|
+
const cells = Array.from(row.querySelectorAll("td, th"));
|
|
49
|
+
const cell = isFirstCol ? cells.shift() : cells.pop();
|
|
50
|
+
const rowSpan = cell === null || cell === void 0 ? void 0 : cell.getAttribute("rowspan");
|
|
51
|
+
return rowSpan >= index + 1;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (wrapperRef.current && tableRef.current) {
|
|
55
|
+
var _tableRef$current;
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
offsetHeight,
|
|
59
|
+
offsetWidth
|
|
60
|
+
} = wrapperRef.current;
|
|
61
|
+
const {
|
|
62
|
+
top,
|
|
63
|
+
bottom,
|
|
64
|
+
right,
|
|
65
|
+
left
|
|
66
|
+
} = (_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : _tableRef$current.getBoundingClientRect();
|
|
67
|
+
setHasVerticalScrollbar(bottom - top > offsetHeight);
|
|
68
|
+
setHasHorizontalScrollbar(right - left > offsetWidth);
|
|
69
|
+
const body = tableRef.current.querySelector("tbody");
|
|
70
|
+
const bodyRows = body ? Array.from(body === null || body === void 0 ? void 0 : body.querySelectorAll("tr")) : [];
|
|
71
|
+
const {
|
|
72
|
+
length
|
|
73
|
+
} = bodyRows;
|
|
74
|
+
const targetRowFirstCol = findRow(bodyRows.slice(0, length - 1).reverse(), true);
|
|
75
|
+
const targetRowLastCol = findRow(bodyRows.slice(0, length - 1).reverse());
|
|
76
|
+
|
|
77
|
+
if (targetRowFirstCol) {
|
|
78
|
+
setFirstColRowSpanIndex(bodyRows.indexOf(targetRowFirstCol));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (targetRowLastCol) {
|
|
82
|
+
setLastColRowSpanIndex(bodyRows.indexOf(targetRowLastCol));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}, [footer, children, height, minHeight]);
|
|
40
86
|
return /*#__PURE__*/React.createElement(DrawerSidebarContext.Consumer, null, ({
|
|
41
87
|
isInSidebar
|
|
42
88
|
}) => /*#__PURE__*/React.createElement(StyledFlatTableWrapper, _extends({
|
|
89
|
+
ref: wrapperRef,
|
|
43
90
|
"data-component": "flat-table-wrapper",
|
|
44
91
|
isInSidebar: isInSidebar,
|
|
45
92
|
hasStickyHead: hasStickyHead,
|
|
@@ -54,11 +101,18 @@ const FlatTable = ({
|
|
|
54
101
|
tabIndex: "0",
|
|
55
102
|
role: "region",
|
|
56
103
|
overflowX: width ? "hidden" : undefined,
|
|
57
|
-
width: width
|
|
104
|
+
width: width,
|
|
105
|
+
hasStickyFooter: hasStickyFooter,
|
|
106
|
+
hasVerticalScrollbar: hasVerticalScrollbar,
|
|
107
|
+
hasHorizontalScrollbar: hasHorizontalScrollbar,
|
|
108
|
+
hasFooter: !!footer,
|
|
109
|
+
firstColRowSpanIndex: firstColRowSpanIndex,
|
|
110
|
+
lastColRowSpanIndex: lastColRowSpanIndex
|
|
58
111
|
}, rest), /*#__PURE__*/React.createElement(StyledTableContainer, {
|
|
59
112
|
overflowX: overflowX,
|
|
60
113
|
width: width
|
|
61
114
|
}, /*#__PURE__*/React.createElement(StyledFlatTable, _extends({
|
|
115
|
+
ref: tableRef,
|
|
62
116
|
"data-component": "flat-table"
|
|
63
117
|
}, tableStylingProps), caption ? /*#__PURE__*/React.createElement("caption", null, caption) : null, /*#__PURE__*/React.createElement(FlatTableThemeContext.Provider, {
|
|
64
118
|
value: {
|
|
@@ -8,6 +8,7 @@ import { baseTheme } from "../../style/themes";
|
|
|
8
8
|
import { StyledFlatTableCell } from "./flat-table-cell/flat-table-cell.style";
|
|
9
9
|
import cellSizes from "./cell-sizes.style";
|
|
10
10
|
import Box from "../box";
|
|
11
|
+
import { StyledPagerContainer } from "../pager/pager.style";
|
|
11
12
|
const HEADER_OVERLAY_INCREMENT = 3;
|
|
12
13
|
const STICKY_FOOTER_OVERLAY_INCREMENT = 1;
|
|
13
14
|
const ROW_HEADER_OVERLAY_INCREMENT = 5;
|
|
@@ -26,10 +27,15 @@ const StyledTableContainer = styled.div`
|
|
|
26
27
|
`;
|
|
27
28
|
const StyledFlatTable = styled.table`
|
|
28
29
|
border-collapse: separate;
|
|
29
|
-
border-radius: 0px;
|
|
30
30
|
border-spacing: 0;
|
|
31
31
|
width: 100%;
|
|
32
32
|
|
|
33
|
+
@-moz-document url-prefix() {
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
border-top-left-radius: var(--borderRadius100);
|
|
36
|
+
border-top-right-radius: var(--borderRadius100);
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
${({
|
|
34
40
|
caption
|
|
35
41
|
}) => caption && css`
|
|
@@ -90,6 +96,16 @@ StyledFlatTable.defaultProps = {
|
|
|
90
96
|
size: "medium"
|
|
91
97
|
};
|
|
92
98
|
const StyledFlatTableWrapper = styled(Box)`
|
|
99
|
+
border-top-left-radius: var(--borderRadius100);
|
|
100
|
+
border-top-right-radius: var(--borderRadius100);
|
|
101
|
+
${({
|
|
102
|
+
hasStickyFooter,
|
|
103
|
+
hasHorizontalScrollbar
|
|
104
|
+
}) => !hasStickyFooter && !hasHorizontalScrollbar && css`
|
|
105
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
106
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
107
|
+
`}
|
|
108
|
+
|
|
93
109
|
${({
|
|
94
110
|
isInSidebar
|
|
95
111
|
}) => css`
|
|
@@ -187,6 +203,9 @@ const StyledFlatTableWrapper = styled(Box)`
|
|
|
187
203
|
${({
|
|
188
204
|
isInSidebar
|
|
189
205
|
}) => isInSidebar && css`
|
|
206
|
+
${StyledFlatTableHead} {
|
|
207
|
+
background-color: var(--colorsUtilityMajor040);
|
|
208
|
+
}
|
|
190
209
|
${StyledFlatTableHeader}, ${StyledFlatTableHead} ${StyledFlatTableRowHeader},
|
|
191
210
|
${StyledFlatTableHead} ${StyledFlatTableCheckbox} {
|
|
192
211
|
background-color: var(--colorsUtilityMajor040);
|
|
@@ -226,6 +245,21 @@ const StyledFlatTableWrapper = styled(Box)`
|
|
|
226
245
|
}) => theme.zIndex.overlay + HEADER_OVERLAY_INCREMENT};
|
|
227
246
|
}
|
|
228
247
|
|
|
248
|
+
thead {
|
|
249
|
+
${StyledFlatTableRow}:first-of-type {
|
|
250
|
+
th:first-of-type {
|
|
251
|
+
border-top-left-radius: var(--borderRadius100);
|
|
252
|
+
}
|
|
253
|
+
${({
|
|
254
|
+
hasVerticalScrollbar
|
|
255
|
+
}) => !hasVerticalScrollbar && css`
|
|
256
|
+
th:last-of-type {
|
|
257
|
+
border-top-right-radius: var(--borderRadius100);
|
|
258
|
+
}
|
|
259
|
+
`}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
229
263
|
tbody
|
|
230
264
|
${StyledFlatTableRowHeader},
|
|
231
265
|
${StyledFlatTableCell}.isSticky,
|
|
@@ -235,6 +269,67 @@ const StyledFlatTableWrapper = styled(Box)`
|
|
|
235
269
|
theme
|
|
236
270
|
}) => theme.zIndex.overlay};
|
|
237
271
|
}
|
|
272
|
+
|
|
273
|
+
${({
|
|
274
|
+
hasFooter
|
|
275
|
+
}) => hasFooter && css`
|
|
276
|
+
tr:last-child:focus {
|
|
277
|
+
:after {
|
|
278
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
279
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
280
|
+
}
|
|
281
|
+
`}
|
|
282
|
+
|
|
283
|
+
${({
|
|
284
|
+
hasFooter
|
|
285
|
+
}) => !hasFooter && css`
|
|
286
|
+
tbody {
|
|
287
|
+
${({
|
|
288
|
+
firstColRowSpanIndex
|
|
289
|
+
}) => firstColRowSpanIndex >= 0 && css`
|
|
290
|
+
${StyledFlatTableRow}:nth-of-type(${firstColRowSpanIndex + 1}) {
|
|
291
|
+
th:first-child,
|
|
292
|
+
td:first-child {
|
|
293
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
`}
|
|
297
|
+
|
|
298
|
+
${({
|
|
299
|
+
lastColRowSpanIndex,
|
|
300
|
+
hasHorizontalScrollbar
|
|
301
|
+
}) => lastColRowSpanIndex >= 0 && !hasHorizontalScrollbar && css`
|
|
302
|
+
${StyledFlatTableRow}:nth-of-type(${lastColRowSpanIndex + 1}) {
|
|
303
|
+
th:last-child,
|
|
304
|
+
td:last-child {
|
|
305
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
`}
|
|
309
|
+
|
|
310
|
+
${StyledFlatTableRow}:last-of-type {
|
|
311
|
+
${({
|
|
312
|
+
hasHorizontalScrollbar,
|
|
313
|
+
firstColRowSpanIndex
|
|
314
|
+
}) => !hasHorizontalScrollbar && firstColRowSpanIndex === -1 && css`
|
|
315
|
+
th:first-child,
|
|
316
|
+
td:first-child {
|
|
317
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
318
|
+
}
|
|
319
|
+
`}
|
|
320
|
+
${({
|
|
321
|
+
hasVerticalScrollbar,
|
|
322
|
+
hasHorizontalScrollbar,
|
|
323
|
+
lastColRowSpanIndex
|
|
324
|
+
}) => !hasVerticalScrollbar && !hasHorizontalScrollbar && lastColRowSpanIndex === -1 && css`
|
|
325
|
+
th:last-child,
|
|
326
|
+
td:last-child {
|
|
327
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
328
|
+
}
|
|
329
|
+
`}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
`}
|
|
238
333
|
`;
|
|
239
334
|
StyledFlatTableWrapper.defaultProps = {
|
|
240
335
|
theme: baseTheme
|
|
@@ -247,6 +342,11 @@ const StyledFlatTableFooter = styled.div`
|
|
|
247
342
|
position: sticky;
|
|
248
343
|
bottom: 0px;
|
|
249
344
|
z-index: ${theme.zIndex.overlay + STICKY_FOOTER_OVERLAY_INCREMENT};
|
|
345
|
+
|
|
346
|
+
${StyledPagerContainer} {
|
|
347
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
348
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
349
|
+
}
|
|
250
350
|
`}
|
|
251
351
|
`;
|
|
252
352
|
StyledFlatTableFooter.defaultProps = {
|
|
@@ -39,6 +39,24 @@ const StyledContentContainer = styled.div`
|
|
|
39
39
|
${StyledInlineInput} + ${StyledInlineInput} ${InputPresentation} {
|
|
40
40
|
border-left: none;
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
${StyledInlineInput}:not(:first-of-type):not(:last-of-type) ${InputPresentation} {
|
|
44
|
+
border-radius: var(--borderRadius000);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
${StyledInlineInput}:first-of-type:not(:last-of-type) ${InputPresentation} {
|
|
48
|
+
border-top-right-radius: var(--borderRadius000);
|
|
49
|
+
border-bottom-right-radius: var(--borderRadius000);
|
|
50
|
+
border-top-left-radius: var(--borderRadius050);
|
|
51
|
+
border-bottom-left-radius: var(--borderRadius050);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
${StyledInlineInput}:last-of-type:not(:first-of-type) ${InputPresentation} {
|
|
55
|
+
border-top-left-radius: var(--borderRadius000);
|
|
56
|
+
border-bottom-left-radius: var(--borderRadius000);
|
|
57
|
+
border-top-right-radius: var(--borderRadius050);
|
|
58
|
+
border-bottom-right-radius: var(--borderRadius050);
|
|
59
|
+
}
|
|
42
60
|
`}
|
|
43
61
|
`}
|
|
44
62
|
`;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import styled from "styled-components";
|
|
3
|
-
const StyledPlaceHolder = styled.div`
|
|
4
|
+
export const StyledPlaceHolder = styled.div`
|
|
4
5
|
overflow: hidden;
|
|
5
6
|
position: relative;
|
|
6
7
|
height: 152px;
|
|
7
8
|
min-width: 152px;
|
|
8
9
|
background-color: var(--colorsUtilityMajor025);
|
|
10
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
11
|
+
border-top-left-radius: var(--borderRadius100);
|
|
9
12
|
`;
|
|
10
13
|
const Circle = styled.div`
|
|
11
14
|
height: 22px;
|
|
@@ -13,27 +13,32 @@ const loaderAnimation = keyframes`
|
|
|
13
13
|
const getDimentions = size => {
|
|
14
14
|
let width;
|
|
15
15
|
let marginRight;
|
|
16
|
+
let borderRadius;
|
|
16
17
|
|
|
17
18
|
switch (size) {
|
|
18
19
|
case "medium":
|
|
19
20
|
width = "16px";
|
|
20
21
|
marginRight = "8px";
|
|
22
|
+
borderRadius = "var(--borderRadiusCircle)";
|
|
21
23
|
break;
|
|
22
24
|
|
|
23
25
|
case "large":
|
|
24
26
|
width = "20px";
|
|
25
27
|
marginRight = "8px";
|
|
28
|
+
borderRadius = "var(--borderRadiusCircle)";
|
|
26
29
|
break;
|
|
27
30
|
|
|
28
31
|
default:
|
|
29
32
|
width = "12px";
|
|
30
33
|
marginRight = "6px";
|
|
34
|
+
borderRadius = "var(--borderRadiusCircle)";
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
return css`
|
|
34
38
|
width: ${width};
|
|
35
39
|
height: ${width};
|
|
36
40
|
margin-right: ${marginRight};
|
|
41
|
+
border-radius: ${borderRadius};
|
|
37
42
|
`;
|
|
38
43
|
};
|
|
39
44
|
|
|
@@ -58,6 +58,19 @@ const StyledSubmenu = styled.ul`
|
|
|
58
58
|
}
|
|
59
59
|
`}
|
|
60
60
|
|
|
61
|
+
${!inFullscreenView && css`
|
|
62
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
63
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
64
|
+
|
|
65
|
+
${StyledMenuItem}:last-child a,
|
|
66
|
+
${StyledMenuItem}:last-child button,
|
|
67
|
+
${StyledMenuItem}:last-child > span,
|
|
68
|
+
${StyledMenuItem}:last-child > div {
|
|
69
|
+
border-bottom-left-radius: var(--borderRadius100);
|
|
70
|
+
border-bottom-right-radius: var(--borderRadius100);
|
|
71
|
+
}
|
|
72
|
+
`}
|
|
73
|
+
|
|
61
74
|
display: block;
|
|
62
75
|
list-style: none;
|
|
63
76
|
margin: 0;
|