orcs-design-system 3.2.4 → 3.2.6

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.
Files changed (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. package/package.json +29 -38
@@ -5,104 +5,117 @@ import Flex from "../Flex";
5
5
  import Spacer from "../Spacer";
6
6
  import Icon from "../Icon";
7
7
  import Popover from "../Popover";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
9
  export default {
9
10
  title: "Components/StatusDot",
10
11
  component: StatusDot
11
12
  };
12
- export var defaultStatusDot = function defaultStatusDot() {
13
- return /*#__PURE__*/React.createElement(Box, {
14
- p: "l"
15
- }, /*#__PURE__*/React.createElement(Flex, {
13
+ export const defaultStatusDot = () => /*#__PURE__*/_jsx(Box, {
14
+ p: "l",
15
+ children: /*#__PURE__*/_jsx(Flex, {
16
16
  justifyContent: "center",
17
- alignItems: "center"
18
- }, /*#__PURE__*/React.createElement(Popover, {
19
- direction: "top",
20
- text: "New approvals received",
21
- textAlign: "center",
22
- width: "170px"
23
- }, /*#__PURE__*/React.createElement(StatusDot, null))));
24
- };
17
+ alignItems: "center",
18
+ children: /*#__PURE__*/_jsx(Popover, {
19
+ direction: "top",
20
+ text: "New approvals received",
21
+ textAlign: "center",
22
+ width: "170px",
23
+ children: /*#__PURE__*/_jsx(StatusDot, {})
24
+ })
25
+ })
26
+ });
25
27
  defaultStatusDot.storyName = "Default";
26
- export var colour = function colour() {
27
- return /*#__PURE__*/React.createElement(Box, {
28
- p: "l"
29
- }, /*#__PURE__*/React.createElement(Flex, {
28
+ export const colour = () => /*#__PURE__*/_jsx(Box, {
29
+ p: "l",
30
+ children: /*#__PURE__*/_jsx(Flex, {
30
31
  justifyContent: "center",
31
- alignItems: "center"
32
- }, /*#__PURE__*/React.createElement(Spacer, {
33
- m: "xxs"
34
- }, /*#__PURE__*/React.createElement(Popover, {
35
- direction: "top",
36
- text: "Team has a dedicated Product Owner. STATUS: Met",
37
- textAlign: "left",
38
- width: "250px"
39
- }, /*#__PURE__*/React.createElement(StatusDot, {
40
- variant: "success"
41
- })), /*#__PURE__*/React.createElement(Popover, {
42
- direction: "top",
43
- text: "Team members are in less than 3 locations. STATUS: Not enough data",
44
- textAlign: "left",
45
- width: "250px"
46
- }, /*#__PURE__*/React.createElement(StatusDot, {
47
- variant: "warning"
48
- })), /*#__PURE__*/React.createElement(Popover, {
49
- direction: "top",
50
- text: "Team has a dedicated Engineering Lead. STATUS: Not met",
51
- textAlign: "left",
52
- width: "250px"
53
- }, /*#__PURE__*/React.createElement(StatusDot, {
54
- variant: "danger"
55
- })))));
56
- };
57
- export var withIcon = function withIcon() {
58
- return /*#__PURE__*/React.createElement(Box, {
59
- p: "l"
60
- }, /*#__PURE__*/React.createElement(Flex, {
32
+ alignItems: "center",
33
+ children: /*#__PURE__*/_jsxs(Spacer, {
34
+ m: "xxs",
35
+ children: [/*#__PURE__*/_jsx(Popover, {
36
+ direction: "top",
37
+ text: "Team has a dedicated Product Owner. STATUS: Met",
38
+ textAlign: "left",
39
+ width: "250px",
40
+ children: /*#__PURE__*/_jsx(StatusDot, {
41
+ variant: "success"
42
+ })
43
+ }), /*#__PURE__*/_jsx(Popover, {
44
+ direction: "top",
45
+ text: "Team members are in less than 3 locations. STATUS: Not enough data",
46
+ textAlign: "left",
47
+ width: "250px",
48
+ children: /*#__PURE__*/_jsx(StatusDot, {
49
+ variant: "warning"
50
+ })
51
+ }), /*#__PURE__*/_jsx(Popover, {
52
+ direction: "top",
53
+ text: "Team has a dedicated Engineering Lead. STATUS: Not met",
54
+ textAlign: "left",
55
+ width: "250px",
56
+ children: /*#__PURE__*/_jsx(StatusDot, {
57
+ variant: "danger"
58
+ })
59
+ })]
60
+ })
61
+ })
62
+ });
63
+ export const withIcon = () => /*#__PURE__*/_jsx(Box, {
64
+ p: "l",
65
+ children: /*#__PURE__*/_jsx(Flex, {
61
66
  justifyContent: "center",
62
- alignItems: "center"
63
- }, /*#__PURE__*/React.createElement(Spacer, {
64
- m: "xxs"
65
- }, /*#__PURE__*/React.createElement(Popover, {
66
- direction: "top",
67
- text: "Target met",
68
- textAlign: "center",
69
- width: "110px"
70
- }, /*#__PURE__*/React.createElement(StatusDot, {
71
- variant: "success",
72
- icon: true
73
- }, /*#__PURE__*/React.createElement(Icon, {
74
- icon: ["fas", "check"],
75
- color: "white",
76
- size: "xs",
77
- transform: "up-2"
78
- }))), /*#__PURE__*/React.createElement(Popover, {
79
- direction: "top",
80
- text: "Under allocated",
81
- textAlign: "center",
82
- width: "110px"
83
- }, /*#__PURE__*/React.createElement(StatusDot, {
84
- variant: "warning",
85
- icon: true
86
- }, /*#__PURE__*/React.createElement(Icon, {
87
- icon: ["fas", "exclamation"],
88
- color: "white",
89
- size: "xs",
90
- transform: "up-2"
91
- }))), /*#__PURE__*/React.createElement(Popover, {
92
- direction: "top",
93
- text: "Over allocated",
94
- textAlign: "center",
95
- width: "110px"
96
- }, /*#__PURE__*/React.createElement(StatusDot, {
97
- variant: "danger",
98
- icon: true
99
- }, /*#__PURE__*/React.createElement(Icon, {
100
- icon: ["fas", "bell"],
101
- color: "white",
102
- size: "xs",
103
- transform: "up-2"
104
- }))))));
105
- };
67
+ alignItems: "center",
68
+ children: /*#__PURE__*/_jsxs(Spacer, {
69
+ m: "xxs",
70
+ children: [/*#__PURE__*/_jsx(Popover, {
71
+ direction: "top",
72
+ text: "Target met",
73
+ textAlign: "center",
74
+ width: "110px",
75
+ children: /*#__PURE__*/_jsx(StatusDot, {
76
+ variant: "success",
77
+ icon: true,
78
+ children: /*#__PURE__*/_jsx(Icon, {
79
+ icon: ["fas", "check"],
80
+ color: "white",
81
+ size: "xs",
82
+ transform: "up-2"
83
+ })
84
+ })
85
+ }), /*#__PURE__*/_jsx(Popover, {
86
+ direction: "top",
87
+ text: "Under allocated",
88
+ textAlign: "center",
89
+ width: "110px",
90
+ children: /*#__PURE__*/_jsx(StatusDot, {
91
+ variant: "warning",
92
+ icon: true,
93
+ children: /*#__PURE__*/_jsx(Icon, {
94
+ icon: ["fas", "exclamation"],
95
+ color: "white",
96
+ size: "xs",
97
+ transform: "up-2"
98
+ })
99
+ })
100
+ }), /*#__PURE__*/_jsx(Popover, {
101
+ direction: "top",
102
+ text: "Over allocated",
103
+ textAlign: "center",
104
+ width: "110px",
105
+ children: /*#__PURE__*/_jsx(StatusDot, {
106
+ variant: "danger",
107
+ icon: true,
108
+ children: /*#__PURE__*/_jsx(Icon, {
109
+ icon: ["fas", "bell"],
110
+ color: "white",
111
+ size: "xs",
112
+ transform: "up-2"
113
+ })
114
+ })
115
+ })]
116
+ })
117
+ })
118
+ });
106
119
  defaultStatusDot.__docgenInfo = {
107
120
  "description": "",
108
121
  "methods": [],
@@ -1,51 +1,49 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["icon", "children"];
4
1
  import React from "react";
5
2
  import PropTypes from "prop-types";
6
3
  import styled from "styled-components";
7
4
  import { space, layout, color, compose, variant } from "styled-system";
8
5
  import { css } from "@styled-system/css";
9
6
  import { themeGet } from "@styled-system/theme-get";
10
- var StatusDotStyles = compose(space, layout, color);
11
- var StatusDotItem = styled("div").withConfig({
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const StatusDotStyles = compose(space, layout, color);
9
+ const StatusDotItem = styled("div").withConfig({
12
10
  displayName: "StatusDot__StatusDotItem",
13
11
  componentId: "sc-1esxq7c-0"
14
- })(function (props) {
15
- return css({
16
- width: props.icon ? "18px" : "10px",
17
- height: props.icon ? "18px" : "10px",
18
- borderRadius: "50%",
19
- bg: themeGet("colors.secondary")(props),
20
- fontSize: themeGet("fontSizes.0")(props),
21
- display: "flex",
22
- alignItems: "center",
23
- justifyContent: "center",
24
- lineHeight: "0"
25
- });
26
- }, function (props) {
27
- return variant({
28
- variants: {
29
- "default": {},
30
- success: {
31
- bg: themeGet("colors.success")(props)
32
- },
33
- warning: {
34
- bg: themeGet("colors.warning")(props)
35
- },
36
- danger: {
37
- bg: themeGet("colors.danger")(props)
38
- }
12
+ })(props => css({
13
+ width: props.icon ? "18px" : "10px",
14
+ height: props.icon ? "18px" : "10px",
15
+ borderRadius: "50%",
16
+ bg: themeGet("colors.secondary")(props),
17
+ fontSize: themeGet("fontSizes.0")(props),
18
+ display: "flex",
19
+ alignItems: "center",
20
+ justifyContent: "center",
21
+ lineHeight: "0"
22
+ }), props => variant({
23
+ variants: {
24
+ default: {},
25
+ success: {
26
+ bg: themeGet("colors.success")(props)
27
+ },
28
+ warning: {
29
+ bg: themeGet("colors.warning")(props)
30
+ },
31
+ danger: {
32
+ bg: themeGet("colors.danger")(props)
39
33
  }
40
- });
41
- }, StatusDotStyles);
34
+ }
35
+ }), StatusDotStyles);
42
36
  export default function StatusDot(_ref) {
43
- var icon = _ref.icon,
44
- children = _ref.children,
45
- props = _objectWithoutProperties(_ref, _excluded);
46
- return /*#__PURE__*/React.createElement(StatusDotItem, _extends({}, props, {
47
- icon: icon
48
- }), children);
37
+ let {
38
+ icon,
39
+ children,
40
+ ...props
41
+ } = _ref;
42
+ return /*#__PURE__*/_jsx(StatusDotItem, {
43
+ ...props,
44
+ icon: icon,
45
+ children: children
46
+ });
49
47
  }
50
48
  StatusDot.propTypes = {
51
49
  /** Specifies StatusDot colour. Colours are taken from the standard design system colours. */
@@ -4,59 +4,60 @@ import Box from "../Box";
4
4
  import Flex from "../Flex";
5
5
  import Spacer from "../Spacer";
6
6
  import { BrowserRouter, Route, Switch } from "react-router-dom";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
8
  export default {
8
9
  title: "Components/StyledLink",
9
10
  component: StyledLink,
10
- decorators: [function (storyFn) {
11
- return /*#__PURE__*/React.createElement(Box, {
12
- p: "r"
13
- }, storyFn());
14
- }]
15
- };
16
- export var defaultStyledLink = function defaultStyledLink() {
17
- return /*#__PURE__*/React.createElement(StyledLink, {
18
- href: "#"
19
- }, "Styled Link");
11
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
12
+ p: "r",
13
+ children: storyFn()
14
+ })]
20
15
  };
16
+ export const defaultStyledLink = () => /*#__PURE__*/_jsx(StyledLink, {
17
+ href: "#",
18
+ children: "Styled Link"
19
+ });
21
20
  defaultStyledLink.storyName = "Default";
22
- export var targetStyledLink = function targetStyledLink() {
23
- return /*#__PURE__*/React.createElement(StyledLink, {
24
- href: "#",
25
- target: "_blank"
26
- }, "Targeted Link");
27
- };
21
+ export const targetStyledLink = () => /*#__PURE__*/_jsx(StyledLink, {
22
+ href: "#",
23
+ target: "_blank",
24
+ children: "Targeted Link"
25
+ });
28
26
  targetStyledLink.storyName = "Targeted";
29
- export var boldStyledLink = function boldStyledLink() {
30
- return /*#__PURE__*/React.createElement(StyledLink, {
31
- href: "#",
32
- bold: true
33
- }, "Bold Link");
34
- };
27
+ export const boldStyledLink = () => /*#__PURE__*/_jsx(StyledLink, {
28
+ href: "#",
29
+ bold: true,
30
+ children: "Bold Link"
31
+ });
35
32
  boldStyledLink.storyName = "Bold";
36
- export var invertedStyledLink = function invertedStyledLink() {
37
- return /*#__PURE__*/React.createElement(Box, {
38
- bg: "greyDarkest",
39
- p: "r"
40
- }, /*#__PURE__*/React.createElement(Flex, {
41
- justifyContent: "center"
42
- }, /*#__PURE__*/React.createElement(Spacer, {
43
- mx: "r"
44
- }, /*#__PURE__*/React.createElement(StyledLink, {
45
- href: "#",
46
- white: true
47
- }, "White navigation link on dark background"), /*#__PURE__*/React.createElement(StyledLink, {
48
- href: "#",
49
- white: true,
50
- active: true,
51
- bold: true
52
- }, "Active/selected bold navigation link"), /*#__PURE__*/React.createElement(StyledLink, {
53
- href: "#",
54
- white: true,
55
- bold: true
56
- }, "Bold inverted link"))));
57
- };
33
+ export const invertedStyledLink = () => /*#__PURE__*/_jsx(Box, {
34
+ bg: "greyDarkest",
35
+ p: "r",
36
+ children: /*#__PURE__*/_jsx(Flex, {
37
+ justifyContent: "center",
38
+ children: /*#__PURE__*/_jsxs(Spacer, {
39
+ mx: "r",
40
+ children: [/*#__PURE__*/_jsx(StyledLink, {
41
+ href: "#",
42
+ white: true,
43
+ children: "White navigation link on dark background"
44
+ }), /*#__PURE__*/_jsx(StyledLink, {
45
+ href: "#",
46
+ white: true,
47
+ active: true,
48
+ bold: true,
49
+ children: "Active/selected bold navigation link"
50
+ }), /*#__PURE__*/_jsx(StyledLink, {
51
+ href: "#",
52
+ white: true,
53
+ bold: true,
54
+ children: "Bold inverted link"
55
+ })]
56
+ })
57
+ })
58
+ });
58
59
  invertedStyledLink.storyName = "Inverted";
59
- var routes = [{
60
+ const routes = [{
60
61
  path: "/",
61
62
  label: "React link to home",
62
63
  exact: true
@@ -67,32 +68,30 @@ var routes = [{
67
68
  path: "/cats",
68
69
  label: "React link to cats"
69
70
  }];
70
- export var reactLink = function reactLink() {
71
- return /*#__PURE__*/React.createElement(BrowserRouter, null, routes.map(function (route) {
72
- return /*#__PURE__*/React.createElement(StyledLink, {
73
- key: route.path,
74
- to: route.path
75
- }, route.label);
76
- }), /*#__PURE__*/React.createElement(Switch, null, routes.map(function (route) {
77
- return /*#__PURE__*/React.createElement(Route, {
78
- key: route.path,
71
+ export const reactLink = () => /*#__PURE__*/_jsxs(BrowserRouter, {
72
+ children: [routes.map(route => /*#__PURE__*/_jsx(StyledLink, {
73
+ to: route.path,
74
+ children: route.label
75
+ }, route.path)), /*#__PURE__*/_jsx(Switch, {
76
+ children: routes.map(route => /*#__PURE__*/_jsx(Route, {
79
77
  path: route.path,
80
- exact: route.exact
81
- }, /*#__PURE__*/React.createElement("div", {
82
- style: {
83
- padding: "100px"
84
- }
85
- }, "ROUTE RENDERED: ", route.label));
86
- })));
87
- };
78
+ exact: route.exact,
79
+ children: /*#__PURE__*/_jsxs("div", {
80
+ style: {
81
+ padding: "100px"
82
+ },
83
+ children: ["ROUTE RENDERED: ", route.label]
84
+ })
85
+ }, route.path))
86
+ })]
87
+ });
88
88
  reactLink.storyName = "Using react-router-dom";
89
- export var buttonLink = function buttonLink() {
90
- return /*#__PURE__*/React.createElement(StyledLink, {
91
- href: "https://teamform.co",
92
- target: "_blank",
93
- button: true
94
- }, "Click me");
95
- };
89
+ export const buttonLink = () => /*#__PURE__*/_jsx(StyledLink, {
90
+ href: "https://teamform.co",
91
+ target: "_blank",
92
+ button: true,
93
+ children: "Click me"
94
+ });
96
95
  buttonLink.storyName = "Button";
97
96
  defaultStyledLink.__docgenInfo = {
98
97
  "description": "",
@@ -1,6 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["children", "to", "button"];
4
1
  import React from "react";
5
2
  import PropTypes from "prop-types";
6
3
  import shouldForwardProp from "@styled-system/should-forward-prop";
@@ -10,44 +7,39 @@ import { space, layout, typography } from "styled-system";
10
7
  import { css } from "@styled-system/css";
11
8
  import { themeGet } from "@styled-system/theme-get";
12
9
  import { ButtonLink } from "../Button";
13
- var styleLink = function styleLink(LinkComponent) {
14
- return styled(LinkComponent).withConfig({
15
- shouldForwardProp: shouldForwardProp,
16
- displayName: "StyledLink",
17
- componentId: "sc-1beg6q3-0"
18
- }).attrs(function (props) {
19
- return {
20
- className: "StyledLink",
21
- to: props.to,
22
- target: props.target,
23
- "data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
24
- };
25
- })(function (props) {
26
- return css({
27
- display: props.block ? "block" : "inline-block",
28
- fontSize: props.small ? themeGet("fontSizes.1")(props) : props.large && props.iconOnly ? themeGet("fontSizes.5")(props) : props.large ? themeGet("fontSizes.3")(props) : themeGet("fontSizes.2")(props),
29
- fontWeight: props.bold ? themeGet("fontWeights.2")(props) : "inherit",
30
- color: props.active ? themeGet("colors.primaryLight")(props) : props.white ? themeGet("colors.white")(props) : themeGet("colors.primary")(props),
31
- position: "relative",
32
- textDecoration: "none",
33
- cursor: "pointer",
34
- transition: themeGet("transition.transitionDefault")(props),
35
- "&:hover": {
36
- outline: "0",
37
- textDecoration: "underline"
38
- },
39
- "&:focus": {
40
- outline: "0",
41
- textDecoration: "underline"
42
- }
43
- });
44
- }, space, layout, typography);
45
- };
46
- var Hyperlink = styleLink(styled.a.withConfig({
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const styleLink = LinkComponent => styled(LinkComponent).withConfig({
12
+ shouldForwardProp,
13
+ displayName: "StyledLink__styleLink",
14
+ componentId: "sc-1beg6q3-0"
15
+ }).attrs(props => ({
16
+ className: "StyledLink",
17
+ to: props.to,
18
+ target: props.target,
19
+ "data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
20
+ }))(props => css({
21
+ display: props.block ? "block" : "inline-block",
22
+ fontSize: props.small ? themeGet("fontSizes.1")(props) : props.large && props.iconOnly ? themeGet("fontSizes.5")(props) : props.large ? themeGet("fontSizes.3")(props) : themeGet("fontSizes.2")(props),
23
+ fontWeight: props.bold ? themeGet("fontWeights.2")(props) : "inherit",
24
+ color: props.active ? themeGet("colors.primaryLight")(props) : props.white ? themeGet("colors.white")(props) : themeGet("colors.primary")(props),
25
+ position: "relative",
26
+ textDecoration: "none",
27
+ cursor: "pointer",
28
+ transition: themeGet("transition.transitionDefault")(props),
29
+ "&:hover": {
30
+ outline: "0",
31
+ textDecoration: "underline"
32
+ },
33
+ "&:focus": {
34
+ outline: "0",
35
+ textDecoration: "underline"
36
+ }
37
+ }), space, layout, typography);
38
+ const Hyperlink = styleLink(styled.a.withConfig({
47
39
  displayName: "StyledLink__Hyperlink",
48
40
  componentId: "sc-1beg6q3-1"
49
41
  })([""]));
50
- var ReactLink = styleLink(Link);
42
+ const ReactLink = styleLink(Link);
51
43
 
52
44
  /**
53
45
  * This `StyledLink` component supports both standard html hyperlinks and react Link components (if using react router for example).
@@ -71,18 +63,25 @@ var ReactLink = styleLink(Link);
71
63
  * Dashboard
72
64
  * </HeaderLink>
73
65
  */
74
- var StyledLink = function StyledLink(_ref) {
75
- var children = _ref.children,
76
- to = _ref.to,
77
- button = _ref.button,
78
- props = _objectWithoutProperties(_ref, _excluded);
66
+ const StyledLink = _ref => {
67
+ let {
68
+ children,
69
+ to,
70
+ button,
71
+ ...props
72
+ } = _ref;
79
73
  if (button) {
80
- return /*#__PURE__*/React.createElement(ButtonLink, props, children);
74
+ return /*#__PURE__*/_jsx(ButtonLink, {
75
+ ...props,
76
+ children: children
77
+ });
81
78
  }
82
- var LinkComponent = to ? ReactLink : Hyperlink;
83
- return /*#__PURE__*/React.createElement(LinkComponent, _extends({}, props, {
84
- to: to
85
- }), children);
79
+ const LinkComponent = to ? ReactLink : Hyperlink;
80
+ return /*#__PURE__*/_jsx(LinkComponent, {
81
+ ...props,
82
+ to: to,
83
+ children: children
84
+ });
86
85
  };
87
86
  StyledLink.propTypes = {
88
87
  /** The content wrapped by the link component */