@equinor/eds-core-react 0.15.0-dev.20211116 → 0.15.0-dev.20211116v2
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/dist/core-react.cjs.js +1226 -933
- package/dist/esm/components/Accordion/Accordion.js +5 -4
- package/dist/esm/components/Accordion/AccordionHeader.js +14 -12
- package/dist/esm/components/Accordion/AccordionHeaderTitle.js +5 -3
- package/dist/esm/components/Accordion/AccordionItem.js +5 -4
- package/dist/esm/components/Accordion/AccordionPanel.js +7 -6
- package/dist/esm/components/Avatar/Avatar.js +10 -8
- package/dist/esm/components/Banner/Banner.js +10 -8
- package/dist/esm/components/Banner/BannerActions.js +6 -4
- package/dist/esm/components/Banner/BannerIcon.js +6 -4
- package/dist/esm/components/Banner/BannerMessage.js +6 -4
- package/dist/esm/components/Breadcrumbs/Breadcrumb.js +12 -7
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +37 -25
- package/dist/esm/components/Button/Button.js +11 -3
- package/dist/esm/components/Button/InnerFullWidth.js +8 -4
- package/dist/esm/components/Card/Card.js +5 -4
- package/dist/esm/components/Card/CardActions.js +7 -3
- package/dist/esm/components/Card/CardHeader.js +4 -1
- package/dist/esm/components/Card/CardHeaderTitle.js +4 -1
- package/dist/esm/components/Card/CardMedia.js +4 -1
- package/dist/esm/components/Checkbox/Checkbox.js +13 -9
- package/dist/esm/components/Checkbox/Input.js +34 -27
- package/dist/esm/components/Chip/Chip.js +12 -11
- package/dist/esm/components/Dialog/Actions.js +6 -4
- package/dist/esm/components/Dialog/CustomContent.js +11 -7
- package/dist/esm/components/Dialog/Dialog.js +7 -6
- package/dist/esm/components/Dialog/Title.js +12 -8
- package/dist/esm/components/Divider/Divider.js +3 -3
- package/dist/esm/components/EdsProvider/eds.context.js +5 -3
- package/dist/esm/components/Icon/Icon.js +12 -8
- package/dist/esm/components/Input/Input.js +6 -3
- package/dist/esm/components/Label/Label.js +10 -4
- package/dist/esm/components/List/List.js +6 -4
- package/dist/esm/components/List/ListItem.js +5 -4
- package/dist/esm/components/Menu/Menu.context.js +5 -3
- package/dist/esm/components/Menu/Menu.js +20 -12
- package/dist/esm/components/Menu/MenuItem.js +7 -4
- package/dist/esm/components/Menu/MenuList.js +7 -6
- package/dist/esm/components/Menu/MenuSection.js +14 -6
- package/dist/esm/components/Pagination/Pagination.js +62 -51
- package/dist/esm/components/Pagination/PaginationItem.js +6 -4
- package/dist/esm/components/Paper/Paper.js +3 -3
- package/dist/esm/components/Popover/Popover.js +26 -21
- package/dist/esm/components/Popover/PopoverContent.js +4 -1
- package/dist/esm/components/Popover/PopoverTitle.js +8 -3
- package/dist/esm/components/Progress/Circular/CircularProgress.js +23 -22
- package/dist/esm/components/Progress/Dots/DotProgress.js +17 -16
- package/dist/esm/components/Progress/Linear/LinearProgress.js +7 -6
- package/dist/esm/components/Progress/Star/StarProgress.js +17 -16
- package/dist/esm/components/Radio/Radio.js +36 -28
- package/dist/esm/components/Scrim/Scrim.js +9 -6
- package/dist/esm/components/Search/Search.js +15 -11
- package/dist/esm/components/Select/MultiSelect/MultiSelect.js +64 -52
- package/dist/esm/components/Select/NativeSelect/NativeSelect.js +10 -3
- package/dist/esm/components/Select/SingleSelect/SingleSelect.js +56 -46
- package/dist/esm/components/SideSheet/SideSheet.js +19 -14
- package/dist/esm/components/Slider/MinMax.js +5 -3
- package/dist/esm/components/Slider/Output.js +5 -3
- package/dist/esm/components/Slider/Slider.js +92 -73
- package/dist/esm/components/Slider/SliderInput.js +3 -3
- package/dist/esm/components/Snackbar/Snackbar.js +8 -4
- package/dist/esm/components/Snackbar/SnackbarAction.js +4 -1
- package/dist/esm/components/Switch/Switch.js +27 -23
- package/dist/esm/components/Switch/SwitchDefault.js +13 -9
- package/dist/esm/components/Switch/SwitchSmall.js +11 -7
- package/dist/esm/components/Table/Body.js +8 -6
- package/dist/esm/components/Table/Caption.js +3 -3
- package/dist/esm/components/Table/Cell.js +20 -16
- package/dist/esm/components/Table/DataCell/DataCell.js +8 -6
- package/dist/esm/components/Table/Head/Head.js +8 -6
- package/dist/esm/components/Table/HeaderCell/HeaderCell.js +12 -8
- package/dist/esm/components/Table/Row/Row.js +5 -4
- package/dist/esm/components/Table/Table.js +5 -4
- package/dist/esm/components/TableOfContents/LinkItem.js +5 -4
- package/dist/esm/components/TableOfContents/TableOfContents.js +11 -6
- package/dist/esm/components/Tabs/Tab.js +5 -4
- package/dist/esm/components/Tabs/TabList.js +7 -6
- package/dist/esm/components/Tabs/TabPanel.js +6 -4
- package/dist/esm/components/Tabs/TabPanels.js +6 -4
- package/dist/esm/components/Tabs/Tabs.js +10 -9
- package/dist/esm/components/TextField/Field.js +17 -9
- package/dist/esm/components/TextField/HelperText/HelperText.js +18 -15
- package/dist/esm/components/TextField/Icon/Icon.js +7 -4
- package/dist/esm/components/TextField/TextField.context.js +5 -3
- package/dist/esm/components/TextField/TextField.js +12 -3
- package/dist/esm/components/Textarea/Textarea.js +3 -1
- package/dist/esm/components/Tooltip/Tooltip.js +21 -15
- package/dist/esm/components/TopBar/Actions.js +6 -4
- package/dist/esm/components/TopBar/CustomContent.js +6 -4
- package/dist/esm/components/TopBar/Header.js +6 -4
- package/dist/esm/components/TopBar/TopBar.js +5 -4
- package/dist/esm/components/Typography/Typography.js +6 -4
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, Children, cloneElement } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useId } from '../../hooks/useId.js';
|
|
4
4
|
|
|
5
5
|
const Accordion = /*#__PURE__*/forwardRef(function Accordion({
|
|
@@ -19,9 +19,10 @@ const Accordion = /*#__PURE__*/forwardRef(function Accordion({
|
|
|
19
19
|
chevronPosition
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
ref: ref
|
|
24
|
-
|
|
22
|
+
return /*#__PURE__*/jsx("div", { ...props,
|
|
23
|
+
ref: ref,
|
|
24
|
+
children: AccordionItems
|
|
25
|
+
});
|
|
25
26
|
}); // Accordion.displayName = 'Accordion'
|
|
26
27
|
|
|
27
28
|
export { Accordion };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, Children, isValidElement, cloneElement } from 'react';
|
|
3
2
|
import styled, { css } from 'styled-components';
|
|
4
3
|
import { chevron_up, chevron_down } from '@equinor/eds-icons';
|
|
5
4
|
import { Icon } from '../Icon/index.js';
|
|
6
5
|
import { AccordionHeaderTitle } from './AccordionHeaderTitle.js';
|
|
7
6
|
import { accordion } from './Accordion.tokens.js';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
import { typographyTemplate, spacingsTemplate } from '../../utils/templates/index.js';
|
|
9
9
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
10
10
|
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
@@ -94,19 +94,20 @@ const AccordionHeader = /*#__PURE__*/forwardRef(function AccordionHeader({
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const chevron = /*#__PURE__*/
|
|
98
|
-
key: `${id}-icon`,
|
|
97
|
+
const chevron = /*#__PURE__*/jsx(StyledIcon, {
|
|
99
98
|
data: isExpanded ? chevron_up : chevron_down,
|
|
100
99
|
size: 24,
|
|
101
100
|
chevronPosition: chevronPosition,
|
|
102
101
|
color: disabled ? chevronToken.states.disabled.background : chevronToken.background
|
|
103
|
-
});
|
|
102
|
+
}, `${id}-icon`);
|
|
103
|
+
|
|
104
104
|
const headerChildren = Children.map(children, child => {
|
|
105
105
|
if (typeof child === 'string') {
|
|
106
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/jsx(AccordionHeaderTitle, {
|
|
107
107
|
isExpanded: isExpanded,
|
|
108
|
-
disabled: disabled
|
|
109
|
-
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
children: child
|
|
110
|
+
});
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
if ( /*#__PURE__*/isValidElement(child) && child.type === AccordionHeaderTitle) {
|
|
@@ -119,17 +120,18 @@ const AccordionHeader = /*#__PURE__*/forwardRef(function AccordionHeader({
|
|
|
119
120
|
return child;
|
|
120
121
|
});
|
|
121
122
|
const newChildren = [chevron, headerChildren];
|
|
122
|
-
return /*#__PURE__*/
|
|
123
|
+
return /*#__PURE__*/jsx(StyledAccordionHeader, {
|
|
123
124
|
isExpanded: isExpanded,
|
|
124
125
|
parentIndex: parentIndex,
|
|
125
126
|
as: headerLevel,
|
|
126
|
-
disabled: disabled
|
|
127
|
-
|
|
127
|
+
disabled: disabled,
|
|
128
|
+
...props,
|
|
128
129
|
panelId: panelId,
|
|
129
130
|
onClick: handleClick,
|
|
130
131
|
onKeyDown: handleKeyDown,
|
|
131
|
-
ref: ref
|
|
132
|
-
|
|
132
|
+
ref: ref,
|
|
133
|
+
children: chevronPosition === 'left' ? newChildren : newChildren.reverse()
|
|
134
|
+
});
|
|
133
135
|
}); // AccordionHeader.displayName = 'EdsAccordionHeader'
|
|
134
136
|
|
|
135
137
|
export { AccordionHeader };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { accordion } from './Accordion.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
const StyledAccordionHeaderTitle = styled.span.withConfig({
|
|
6
7
|
displayName: "AccordionHeaderTitle__StyledAccordionHeaderTitle",
|
|
@@ -18,11 +19,12 @@ const AccordionHeaderTitle = /*#__PURE__*/forwardRef(function AccordionHeaderTit
|
|
|
18
19
|
disabled,
|
|
19
20
|
children
|
|
20
21
|
}, ref) {
|
|
21
|
-
return /*#__PURE__*/
|
|
22
|
+
return /*#__PURE__*/jsx(StyledAccordionHeaderTitle, {
|
|
22
23
|
ref: ref,
|
|
23
24
|
isExpanded: isExpanded,
|
|
24
|
-
disabled: disabled
|
|
25
|
-
|
|
25
|
+
disabled: disabled,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
26
28
|
}); // AccordionHeaderTitle.displayName = 'AccordionHeaderTitle'
|
|
27
29
|
|
|
28
30
|
export { AccordionHeaderTitle };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, useState, Children, cloneElement, useEffect } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
const AccordionItem = /*#__PURE__*/forwardRef(function AccordionItem({
|
|
5
5
|
headerLevel,
|
|
@@ -38,9 +38,10 @@ const AccordionItem = /*#__PURE__*/forwardRef(function AccordionItem({
|
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
setExpanded(isExpanded);
|
|
40
40
|
}, [isExpanded]);
|
|
41
|
-
return /*#__PURE__*/
|
|
42
|
-
ref: ref
|
|
43
|
-
|
|
41
|
+
return /*#__PURE__*/jsx("div", { ...props,
|
|
42
|
+
ref: ref,
|
|
43
|
+
children: Children$1
|
|
44
|
+
});
|
|
44
45
|
}); // AccordionItem.displayName = 'AccordionItem'
|
|
45
46
|
|
|
46
47
|
export { AccordionItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import { accordion } from './Accordion.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
6
|
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
@@ -27,13 +27,14 @@ const AccordionPanel = /*#__PURE__*/forwardRef(function AccordionPanel({
|
|
|
27
27
|
children,
|
|
28
28
|
...props
|
|
29
29
|
}, ref) {
|
|
30
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/jsx(StyledAccordionPanel, {
|
|
31
31
|
headerId: headerId,
|
|
32
32
|
id: id,
|
|
33
|
-
hidden: hidden
|
|
34
|
-
|
|
35
|
-
ref: ref
|
|
36
|
-
|
|
33
|
+
hidden: hidden,
|
|
34
|
+
...props,
|
|
35
|
+
ref: ref,
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
37
38
|
}); // AccordionPanel.displayName = 'eds-accordion-panel'
|
|
38
39
|
|
|
39
40
|
export { AccordionPanel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled, { css } from 'styled-components';
|
|
4
3
|
import { avatar } from './Avatar.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
6
|
|
|
7
7
|
const StyledAvatar = styled.div.withConfig({
|
|
@@ -23,15 +23,17 @@ const Avatar = /*#__PURE__*/forwardRef(function Avatar({
|
|
|
23
23
|
disabled = false,
|
|
24
24
|
...rest
|
|
25
25
|
}, ref) {
|
|
26
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/jsx(StyledAvatar, {
|
|
27
27
|
size: size,
|
|
28
28
|
disabled: disabled,
|
|
29
|
-
ref: ref
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
ref: ref,
|
|
30
|
+
...rest,
|
|
31
|
+
children: /*#__PURE__*/jsx(StyledImage, {
|
|
32
|
+
src: src,
|
|
33
|
+
alt: alt,
|
|
34
|
+
disabled: disabled
|
|
35
|
+
})
|
|
36
|
+
});
|
|
35
37
|
});
|
|
36
38
|
Avatar.displayName = 'Avatar';
|
|
37
39
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, Children, isValidElement } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import * as Banner_tokens from './Banner.tokens.js';
|
|
5
4
|
import { BannerIcon } from './BannerIcon.js';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
import { Divider } from '../Divider/Divider.js';
|
|
8
8
|
|
|
@@ -36,14 +36,16 @@ const Banner = /*#__PURE__*/forwardRef(function Banner({
|
|
|
36
36
|
ref,
|
|
37
37
|
...rest
|
|
38
38
|
};
|
|
39
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/jsxs(StyledBanner, { ...props,
|
|
40
40
|
className: className,
|
|
41
|
-
role: "alert"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
role: "alert",
|
|
42
|
+
children: [/*#__PURE__*/jsx(Content, {
|
|
43
|
+
hasIcon: hasIcon,
|
|
44
|
+
children: children
|
|
45
|
+
}), /*#__PURE__*/jsx(NonMarginDivider, {
|
|
46
|
+
color: "light"
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
47
49
|
});
|
|
48
50
|
|
|
49
51
|
export { Banner };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import * as Banner_tokens from './Banner.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
7
|
enabled
|
|
@@ -26,9 +26,11 @@ const BannerActions = /*#__PURE__*/forwardRef(function BannerActions({
|
|
|
26
26
|
ref,
|
|
27
27
|
...rest
|
|
28
28
|
};
|
|
29
|
-
return /*#__PURE__*/
|
|
30
|
-
placement: placement
|
|
31
|
-
|
|
29
|
+
return /*#__PURE__*/jsx(StyledBannerActions, {
|
|
30
|
+
placement: placement,
|
|
31
|
+
...props,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
export { BannerActions };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, Children, isValidElement, cloneElement } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import * as Banner_tokens from './Banner.tokens.js';
|
|
5
4
|
import { Icon } from '../Icon/index.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
@@ -31,9 +31,11 @@ const BannerIcon = /*#__PURE__*/forwardRef(function BannerIcon({
|
|
|
31
31
|
ref,
|
|
32
32
|
...rest
|
|
33
33
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
-
variant: variant
|
|
36
|
-
|
|
34
|
+
return /*#__PURE__*/jsx(StyledBannerIcon, {
|
|
35
|
+
variant: variant,
|
|
36
|
+
...props,
|
|
37
|
+
children: childrenWithColor
|
|
38
|
+
});
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
export { BannerIcon };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { Typography } from '../Typography/Typography.js';
|
|
5
5
|
|
|
6
6
|
const StyledBannerMessage = styled(Typography).withConfig({
|
|
@@ -15,9 +15,11 @@ const BannerMessage = /*#__PURE__*/forwardRef(function BannerMessage({
|
|
|
15
15
|
ref,
|
|
16
16
|
...rest
|
|
17
17
|
};
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
variant: "body_long"
|
|
20
|
-
|
|
18
|
+
return /*#__PURE__*/jsx(StyledBannerMessage, {
|
|
19
|
+
variant: "body_long",
|
|
20
|
+
...props,
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
21
23
|
});
|
|
22
24
|
|
|
23
25
|
export { BannerMessage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled, { css } from 'styled-components';
|
|
4
3
|
import { breadcrumbs } from './Breadcrumbs.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
6
6
|
import { Typography } from '../Typography/Typography.js';
|
|
7
7
|
|
|
@@ -30,15 +30,20 @@ const Breadcrumb = /*#__PURE__*/forwardRef(function Breadcrumb({
|
|
|
30
30
|
};
|
|
31
31
|
const showTooltip = maxWidth > 0;
|
|
32
32
|
const isHrefDefined = href !== undefined;
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
const crumb = /*#__PURE__*/jsx(StyledTypography, {
|
|
34
35
|
link: isHrefDefined,
|
|
35
36
|
as: isHrefDefined ? null : 'span',
|
|
36
|
-
variant: "body_short"
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
variant: "body_short",
|
|
38
|
+
...props,
|
|
39
|
+
children: children
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return showTooltip ? /*#__PURE__*/jsx(Tooltip, {
|
|
39
43
|
title: children,
|
|
40
|
-
placement: "top"
|
|
41
|
-
|
|
44
|
+
placement: "top",
|
|
45
|
+
children: crumb
|
|
46
|
+
}) : crumb;
|
|
42
47
|
});
|
|
43
48
|
|
|
44
49
|
export { Breadcrumb };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef, useState, Children, Fragment } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import { breadcrumbs } from './Breadcrumbs.tokens.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Typography } from '../Typography/Typography.js';
|
|
6
6
|
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
@@ -52,35 +52,47 @@ const Breadcrumbs = /*#__PURE__*/forwardRef(function Breadcrumbs({
|
|
|
52
52
|
return allCrumbs;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
return [allCrumbs[0], /*#__PURE__*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
return [allCrumbs[0], /*#__PURE__*/jsxs(Fragment, {
|
|
56
|
+
children: [/*#__PURE__*/jsx(ListItem, {
|
|
57
|
+
children: /*#__PURE__*/jsx(Collapsed, {
|
|
58
|
+
link: true,
|
|
59
|
+
role: "button",
|
|
60
|
+
variant: "body_short",
|
|
61
|
+
onClick: handleExpandClick,
|
|
62
|
+
onKeyPress: handleExpandClick,
|
|
63
|
+
tabIndex: 0,
|
|
64
|
+
children: "\u2026"
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/jsx("li", {
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
children: /*#__PURE__*/jsx(Separator, {
|
|
69
|
+
variant: "body_short",
|
|
70
|
+
children: "/"
|
|
71
|
+
})
|
|
72
|
+
})]
|
|
73
|
+
}, "collapsed"), allCrumbs[allCrumbs.length - 1]];
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
const allCrumbs = Children.toArray(children).map((child, index) =>
|
|
72
77
|
/*#__PURE__*/
|
|
73
78
|
// eslint-disable-next-line react/no-array-index-key
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
jsxs(Fragment, {
|
|
80
|
+
children: [/*#__PURE__*/jsx(ListItem, {
|
|
81
|
+
children: child
|
|
82
|
+
}), index !== Children.toArray(children).length - 1 && /*#__PURE__*/jsx("li", {
|
|
83
|
+
"aria-hidden": true,
|
|
84
|
+
children: /*#__PURE__*/jsx(Separator, {
|
|
85
|
+
variant: "body_short",
|
|
86
|
+
children: "/"
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
}, `breadcrumb-${index}`));
|
|
90
|
+
return /*#__PURE__*/jsx("nav", { ...props,
|
|
91
|
+
"aria-label": "breadcrumbs",
|
|
92
|
+
children: /*#__PURE__*/jsx(OrderedList, {
|
|
93
|
+
children: collapse && !expanded ? collapsedCrumbs(allCrumbs) : allCrumbs
|
|
94
|
+
})
|
|
95
|
+
});
|
|
84
96
|
}); // Breadcrumbs.displayName = 'eds-breadcrumbs'
|
|
85
97
|
|
|
86
98
|
export { Breadcrumbs };
|
|
@@ -2,6 +2,7 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import styled, { css, ThemeProvider } from 'styled-components';
|
|
3
3
|
import { token } from './tokens/index.js';
|
|
4
4
|
import { InnerFullWidth } from './InnerFullWidth.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
6
|
import { spacingsTemplate, typographyTemplate } from '../../utils/templates/index.js';
|
|
6
7
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
7
8
|
import { outlineTemplate } from '../../utils/templates/focus.js';
|
|
@@ -90,9 +91,16 @@ const Button = /*#__PURE__*/forwardRef(function Button({
|
|
|
90
91
|
tabIndex,
|
|
91
92
|
...other
|
|
92
93
|
};
|
|
93
|
-
return /*#__PURE__*/
|
|
94
|
-
theme: token
|
|
95
|
-
|
|
94
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
95
|
+
theme: token,
|
|
96
|
+
children: /*#__PURE__*/jsx(ButtonBase, { ...buttonProps,
|
|
97
|
+
children: fullWidth ? /*#__PURE__*/jsx(InnerFullWidth, {
|
|
98
|
+
children: children
|
|
99
|
+
}) : /*#__PURE__*/jsx(Inner, {
|
|
100
|
+
children: children
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
});
|
|
96
104
|
});
|
|
97
105
|
|
|
98
106
|
export { Button };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { forwardRef, Children } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
4
|
|
|
4
5
|
const FullWidthCenterContent = styled.span.withConfig({
|
|
5
6
|
displayName: "InnerFullWidth__FullWidthCenterContent",
|
|
@@ -13,10 +14,13 @@ const InnerFullWidth = /*#__PURE__*/forwardRef(function InnerFullWidth({
|
|
|
13
14
|
children
|
|
14
15
|
}, ref) {
|
|
15
16
|
// We need everything in elements for proper flexing 💪
|
|
16
|
-
const updatedChildren = Children.map(children, child => typeof child !== 'object' ? /*#__PURE__*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const updatedChildren = Children.map(children, child => typeof child !== 'object' ? /*#__PURE__*/jsx(FullWidthCenterContent, {
|
|
18
|
+
children: child
|
|
19
|
+
}) : child);
|
|
20
|
+
return /*#__PURE__*/jsx(FullWidthInner, {
|
|
21
|
+
ref: ref,
|
|
22
|
+
children: updatedChildren
|
|
23
|
+
});
|
|
20
24
|
});
|
|
21
25
|
|
|
22
26
|
export { InnerFullWidth };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import * as Card_tokens from './Card.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { bordersTemplate } from '../../utils/templates/borders.js';
|
|
6
6
|
import { spacingsTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
@@ -31,9 +31,10 @@ const Card = /*#__PURE__*/forwardRef(function Card({
|
|
|
31
31
|
cursor,
|
|
32
32
|
...rest
|
|
33
33
|
};
|
|
34
|
-
return /*#__PURE__*/
|
|
35
|
-
onClick: onClick
|
|
36
|
-
|
|
34
|
+
return /*#__PURE__*/jsx(StyledCard, { ...props,
|
|
35
|
+
onClick: onClick,
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
export { Card };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
4
|
import { Typography } from '../Typography/Typography.js';
|
|
4
5
|
|
|
5
6
|
const StyledCardActions = styled.div.withConfig({
|
|
@@ -20,9 +21,12 @@ const CardActions = /*#__PURE__*/forwardRef(function CardActions({
|
|
|
20
21
|
justifyContent,
|
|
21
22
|
...rest
|
|
22
23
|
};
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
return /*#__PURE__*/jsxs(StyledCardActions, { ...props,
|
|
25
|
+
children: [children, meta !== '' && /*#__PURE__*/jsx(Typography, {
|
|
26
|
+
variant: "caption",
|
|
27
|
+
children: meta
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
26
30
|
});
|
|
27
31
|
|
|
28
32
|
export { CardActions };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { primary } from './Card.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
const {
|
|
6
7
|
spacings
|
|
@@ -16,7 +17,9 @@ const CardHeader = /*#__PURE__*/forwardRef(function CardHeader({
|
|
|
16
17
|
const props = { ...rest,
|
|
17
18
|
ref
|
|
18
19
|
};
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/jsx(StyledCardHeader, { ...props,
|
|
21
|
+
children: children
|
|
22
|
+
});
|
|
20
23
|
});
|
|
21
24
|
|
|
22
25
|
export { CardHeader };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
4
|
|
|
4
5
|
const StyledCardHeaderTitle = styled.div.withConfig({
|
|
5
6
|
displayName: "CardHeaderTitle__StyledCardHeaderTitle",
|
|
@@ -12,7 +13,9 @@ const CardHeaderTitle = /*#__PURE__*/forwardRef(function CardHeaderTitle({
|
|
|
12
13
|
const props = { ...rest,
|
|
13
14
|
ref
|
|
14
15
|
};
|
|
15
|
-
return /*#__PURE__*/
|
|
16
|
+
return /*#__PURE__*/jsx(StyledCardHeaderTitle, { ...props,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
16
19
|
});
|
|
17
20
|
|
|
18
21
|
export { CardHeaderTitle };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { primary } from './Card.tokens.js';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
const {
|
|
6
7
|
spacings,
|
|
@@ -21,7 +22,9 @@ const CardMedia = /*#__PURE__*/forwardRef(function CardMedia({
|
|
|
21
22
|
ref,
|
|
22
23
|
fullWidth
|
|
23
24
|
};
|
|
24
|
-
return /*#__PURE__*/
|
|
25
|
+
return /*#__PURE__*/jsx(StyledCardMedia, { ...props,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
25
28
|
});
|
|
26
29
|
|
|
27
30
|
export { CardMedia };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import _extends from '@babel/runtime/helpers/extends';
|
|
2
1
|
import { forwardRef } from 'react';
|
|
3
2
|
import styled from 'styled-components';
|
|
4
3
|
import { checkbox } from './Checkbox.tokens.js';
|
|
5
4
|
import { CheckboxInput } from './Input.js';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { typographyTemplate } from '../../utils/templates/index.js';
|
|
7
7
|
|
|
8
|
+
/* eslint camelcase: "off" */
|
|
8
9
|
const StyledLabel = styled.label.withConfig({
|
|
9
10
|
displayName: "Checkbox__StyledLabel",
|
|
10
11
|
componentId: "sc-yg6l8h-0"
|
|
@@ -22,18 +23,21 @@ const Checkbox = /*#__PURE__*/forwardRef(function Checkbox({
|
|
|
22
23
|
className,
|
|
23
24
|
...rest
|
|
24
25
|
}, ref) {
|
|
25
|
-
return label ? /*#__PURE__*/
|
|
26
|
+
return label ? /*#__PURE__*/jsxs(StyledLabel, {
|
|
26
27
|
disabled: disabled,
|
|
27
|
-
className: className
|
|
28
|
-
|
|
28
|
+
className: className,
|
|
29
|
+
children: [/*#__PURE__*/jsx(CheckboxInput, { ...rest,
|
|
30
|
+
disabled: disabled,
|
|
31
|
+
ref: ref,
|
|
32
|
+
indeterminate: indeterminate
|
|
33
|
+
}), /*#__PURE__*/jsx(LabelText, {
|
|
34
|
+
children: label
|
|
35
|
+
})]
|
|
36
|
+
}) : /*#__PURE__*/jsx(CheckboxInput, { ...rest,
|
|
29
37
|
disabled: disabled,
|
|
30
38
|
ref: ref,
|
|
31
39
|
indeterminate: indeterminate
|
|
32
|
-
})
|
|
33
|
-
disabled: disabled,
|
|
34
|
-
ref: ref,
|
|
35
|
-
indeterminate: indeterminate
|
|
36
|
-
}));
|
|
40
|
+
});
|
|
37
41
|
});
|
|
38
42
|
Checkbox.displayName = 'Checkbox';
|
|
39
43
|
|