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
@@ -1,7 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "direction", "width", "textAlign", "text", "inlineBlock", "theme", "variant", "enableSelectAll", "tabIndex"];
5
1
  import React, { useId, useRef, useState } from "react";
6
2
  import PropTypes from "prop-types";
7
3
  import styled, { css, ThemeProvider } from "styled-components";
@@ -11,62 +7,25 @@ import Icon from "../Icon";
11
7
  import { themeGet } from "@styled-system/theme-get";
12
8
  import { useKeepInView, directions } from "../../hooks/keepInView";
13
9
  import { commonKeys } from "../../hooks/keypress";
14
- var Container = styled.div.withConfig({
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const Container = styled.div.withConfig({
15
12
  displayName: "Popover__Container",
16
13
  componentId: "sc-1bwoak-0"
17
- })(["", " ", " display:", ";position:relative;&:hover,&:focus-within{.popoverText{opacity:1;z-index:100;visibility:visible;pointer-events:auto;}}"], space, layout, function (props) {
18
- return props.inlineBlock ? "inline-block !important" : "block !important";
19
- });
20
- var TooltipControl = styled.div.withConfig({
14
+ })(["", " ", " display:", ";position:relative;&:hover,&:focus-within{.popoverText{opacity:1;z-index:100;visibility:visible;pointer-events:auto;}}"], space, layout, props => props.inlineBlock ? "inline-block !important" : "block !important");
15
+ const TooltipControl = styled.div.withConfig({
21
16
  displayName: "Popover__TooltipControl",
22
17
  componentId: "sc-1bwoak-1"
23
- })(["border:none;background:none;padding:0;cursor:help;font-size:1em;color:", ";transition:", ";&:hover,&:focus{outline:0;color:", ";}"], function (props) {
24
- return themeGet("colors.black")(props);
25
- }, function (props) {
26
- return themeGet("transition.transitionDefault")(props);
27
- }, function (props) {
28
- return themeGet("colors.primary")(props);
29
- });
30
- var Text = styled.div.withConfig({
18
+ })(["border:none;background:none;padding:0;cursor:help;font-size:1em;color:", ";transition:", ";&:hover,&:focus{outline:0;color:", ";}"], props => themeGet("colors.black")(props), props => themeGet("transition.transitionDefault")(props), props => themeGet("colors.primary")(props));
19
+ const Text = styled.div.withConfig({
31
20
  displayName: "Popover__Text",
32
21
  componentId: "sc-1bwoak-2"
33
- })(["position:absolute;font-size:", ";line-height:", ";font-weight:", ";text-align:", ";word-break:break-word;left:100%;top:50%;color:", ";outline:0;padding:", " ", ";border-radius:", ";transform:translateX(10px) translateY(-50%);width:", ";background:", ";border:1px solid ", ";box-shadow:", ";transition:all 300ms ease-in-out;transition-delay:300ms;opacity:0;z-index:-100;visibility:hidden;pointer-events:none;user-select:", ";& a{font-size:", ";}&:before{content:\"\";z-index:2;height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;border-color:transparent;border-right-color:", ";left:-6px;top:50%;margin-top:-6px;position:absolute;}&:after{content:\"\";z-index:1;position:absolute;border-color:transparent;border-right-color:", ";height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;left:-7px;top:50%;margin-top:-6px;}", ";"], function (props) {
34
- return themeGet("fontSizes.0")(props);
35
- }, function (props) {
36
- return themeGet("fontSizes.1")(props);
37
- }, function (props) {
38
- return themeGet("fontWeights.1")(props);
39
- }, function (props) {
40
- return props.textAlign ? props.textAlign : "left";
41
- }, function (props) {
42
- return themeGet("colors.greyDarkest")(props);
43
- }, function (props) {
44
- return themeGet("space.3")(props);
45
- }, function (props) {
46
- return themeGet("space.3")(props);
47
- }, function (props) {
48
- return themeGet("radii.1")(props);
49
- }, function (props) {
50
- return props.width ? props.width : "200px";
51
- }, function (props) {
52
- return themeGet("colors.white")(props);
53
- }, function (props) {
54
- return themeGet("colors.greyLight")(props);
55
- }, function (props) {
56
- return themeGet("shadows.boxDefault")(props);
57
- }, function (props) {
58
- return props.enableSelectAll ? "all" : "auto";
59
- }, function (props) {
60
- return themeGet("fontSizes.0")(props);
61
- }, function (props) {
62
- return themeGet("colors.white")(props);
63
- }, function (props) {
64
- return themeGet("colors.grey")(props);
65
- }, function (_ref) {
66
- var direction = _ref.direction;
22
+ })(["position:absolute;font-size:", ";line-height:", ";font-weight:", ";text-align:", ";word-break:break-word;left:100%;top:50%;color:", ";outline:0;padding:", " ", ";border-radius:", ";transform:translateX(10px) translateY(-50%);width:", ";background:", ";border:1px solid ", ";box-shadow:", ";transition:all 300ms ease-in-out;transition-delay:300ms;opacity:0;z-index:-100;visibility:hidden;pointer-events:none;user-select:", ";& a{font-size:", ";}&:before{content:\"\";z-index:2;height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;border-color:transparent;border-right-color:", ";left:-6px;top:50%;margin-top:-6px;position:absolute;}&:after{content:\"\";z-index:1;position:absolute;border-color:transparent;border-right-color:", ";height:0;width:0;border-style:solid;border-width:6px 6px 6px 0;left:-7px;top:50%;margin-top:-6px;}", ";"], props => themeGet("fontSizes.0")(props), props => themeGet("fontSizes.1")(props), props => themeGet("fontWeights.1")(props), props => props.textAlign ? props.textAlign : "left", props => themeGet("colors.greyDarkest")(props), props => themeGet("space.3")(props), props => themeGet("space.3")(props), props => themeGet("radii.1")(props), props => props.width ? props.width : "200px", props => themeGet("colors.white")(props), props => themeGet("colors.greyLight")(props), props => themeGet("shadows.boxDefault")(props), props => props.enableSelectAll ? "all" : "auto", props => themeGet("fontSizes.0")(props), props => themeGet("colors.white")(props), props => themeGet("colors.grey")(props), _ref => {
23
+ let {
24
+ direction
25
+ } = _ref;
67
26
  return direction === "top" ? css(["left:50%;top:auto;bottom:100%;transform:translateX(-50%) translateY(-10px);&:before{left:50%;top:auto;margin-top:0;bottom:-9px;margin-left:-3px;transform:rotate(-90deg);}&:after{left:50%;top:auto;margin-top:0;bottom:-10px;margin-left:-3px;transform:rotate(-90deg);}"]) : direction === "topRight" ? css(["left:100%;top:auto;bottom:100%;transform:translateX(5px) translateY(-5px);&:before{left:0;top:auto;margin-top:0;bottom:-5px;margin-left:-5px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}&:after{left:0;top:auto;margin-top:0;bottom:-6px;margin-left:-6px;transform:rotate(-45deg);border-width:5px 10px 5px 0;}"]) : direction === "right" ? css([""]) : direction === "bottomRight" ? css(["left:100%;top:100%;bottom:auto;transform:translateX(5px) translateY(5px);&:before{left:0;bottom:auto;margin-top:0;top:-5px;margin-left:-5px;transform:rotate(45deg);border-width:5px 10px 5px 0;}&:after{left:0;bottom:auto;margin-top:0;top:-6px;margin-left:-6px;transform:rotate(45deg);border-width:5px 10px 5px 0;}"]) : direction === "bottom" ? css(["left:50%;top:100%;transform:translateX(-50%) translateY(10px);&:before{left:50%;top:-9px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}&:after{left:50%;top:-10px;margin-top:0;margin-left:-3px;transform:rotate(90deg);}"]) : direction === "bottomLeft" ? css(["right:100%;left:auto;top:100%;bottom:auto;transform:translateX(-5px) translateY(5px);&:before{right:0;left:auto;bottom:auto;margin-top:0;top:-5px;margin-right:-5px;transform:rotate(135deg);border-width:5px 10px 5px 0;}&:after{right:0;left:auto;bottom:auto;margin-top:0;top:-6px;margin-right:-6px;transform:rotate(135deg);border-width:5px 10px 5px 0;}"]) : direction === "left" ? css(["left:auto;right:100%;transform:translateX(-10px) translateY(-50%);&:before{left:auto;right:-6px;transform:rotate(180deg);}&:after{left:auto;right:-7px;transform:rotate(180deg);top:50%;margin-top:-6px;}"]) : direction === "topLeft" ? css(["right:100%;left:auto;top:auto;bottom:100%;transform:translateX(-5px) translateY(-5px);&:before{right:0;left:auto;top:auto;margin-top:0;bottom:-5px;margin-right:-5px;transform:rotate(225deg);border-width:5px 10px 5px 0;}&:after{right:0;left:auto;top:auto;margin-top:0;bottom:-6px;margin-right:-6px;transform:rotate(225deg);border-width:5px 10px 5px 0;}"]) : css([""]);
68
27
  });
69
- var HoverSpacer = styled.div.withConfig({
28
+ const HoverSpacer = styled.div.withConfig({
70
29
  displayName: "Popover__HoverSpacer",
71
30
  componentId: "sc-1bwoak-3"
72
31
  })(["position:absolute;background:transparent;height:calc(100% + 24px);width:calc(100% + 24px);left:-12px;top:-12px;"]);
@@ -78,45 +37,36 @@ var HoverSpacer = styled.div.withConfig({
78
37
  */
79
38
 
80
39
  export default function Popover(_ref2) {
81
- var children = _ref2.children,
82
- direction = _ref2.direction,
83
- width = _ref2.width,
84
- textAlign = _ref2.textAlign,
85
- text = _ref2.text,
86
- inlineBlock = _ref2.inlineBlock,
87
- theme = _ref2.theme,
88
- variant = _ref2.variant,
89
- _ref2$enableSelectAll = _ref2.enableSelectAll,
90
- enableSelectAll = _ref2$enableSelectAll === void 0 ? true : _ref2$enableSelectAll,
91
- _ref2$tabIndex = _ref2.tabIndex,
92
- tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex,
93
- props = _objectWithoutProperties(_ref2, _excluded);
94
- var containerRef = useRef();
95
- var _useState = useState(direction),
96
- _useState2 = _slicedToArray(_useState, 2),
97
- inViewDirection = _useState2[0],
98
- setInViewDirection = _useState2[1];
99
- var _useState3 = useState(false),
100
- _useState4 = _slicedToArray(_useState3, 2),
101
- dismissed = _useState4[0],
102
- setDismissed = _useState4[1];
103
- var toolTipId = useId();
104
- var _useKeepInView = useKeepInView({
105
- direction: direction,
106
- callback: setInViewDirection
107
- }),
108
- _useKeepInView2 = _slicedToArray(_useKeepInView, 2),
109
- ref = _useKeepInView2[0],
110
- setIsShown = _useKeepInView2[1];
111
- var component = /*#__PURE__*/React.createElement(Container, _extends({
40
+ let {
41
+ children,
42
+ direction,
43
+ width,
44
+ textAlign,
45
+ text,
46
+ inlineBlock,
47
+ theme,
48
+ variant,
49
+ enableSelectAll = true,
50
+ tabIndex = 0,
51
+ ...props
52
+ } = _ref2;
53
+ const containerRef = useRef();
54
+ const [inViewDirection, setInViewDirection] = useState(direction);
55
+ const [dismissed, setDismissed] = useState(false);
56
+ const toolTipId = useId();
57
+ const [ref, setIsShown] = useKeepInView({
58
+ direction,
59
+ callback: setInViewDirection
60
+ });
61
+ const component = /*#__PURE__*/_jsxs(Container, {
112
62
  ref: containerRef,
113
- inlineBlock: inlineBlock
114
- }, props, {
115
- onMouseEnter: function onMouseEnter() {
63
+ inlineBlock: inlineBlock,
64
+ ...props,
65
+ onMouseEnter: () => {
116
66
  setIsShown(true);
117
67
  setDismissed(false);
118
68
  },
119
- onKeyDownCapture: function onKeyDownCapture(e) {
69
+ onKeyDownCapture: e => {
120
70
  if ([commonKeys.ESCAPE, commonKeys.ESC].includes(e.key)) {
121
71
  setDismissed(true);
122
72
  if (containerRef !== null && containerRef !== void 0 && containerRef.current.contains(document.activeElement)) {
@@ -124,35 +74,39 @@ export default function Popover(_ref2) {
124
74
  }
125
75
  }
126
76
  },
127
- onBlur: function onBlur() {
77
+ onBlur: () => {
128
78
  setDismissed(false);
129
79
  },
130
- onMouseLeave: function onMouseLeave() {
80
+ onMouseLeave: () => {
131
81
  setIsShown(false);
132
82
  setDismissed(false);
133
83
  },
134
- "aria-describedby": toolTipId
135
- }), variant === "tooltip" && /*#__PURE__*/React.createElement(TooltipControl, {
136
- tabIndex: tabIndex
137
- }, /*#__PURE__*/React.createElement(Icon, {
138
- transform: "grow-4",
139
- icon: ["fas", "question-circle"],
140
- fontSize: "2"
141
- })), !!text && !dismissed && /*#__PURE__*/React.createElement(Text, {
142
- ref: ref,
143
- role: "tooltip",
144
- className: "popoverText",
145
- textAlign: textAlign,
146
- direction: inViewDirection,
147
- width: width,
148
- enableSelectAll: enableSelectAll,
149
- id: toolTipId
150
- }, /*#__PURE__*/React.createElement(HoverSpacer, {
151
- className: "popoverSpacer"
152
- }), text), children);
153
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
154
- theme: theme
155
- }, component) : component;
84
+ "aria-describedby": toolTipId,
85
+ children: [variant === "tooltip" && /*#__PURE__*/_jsx(TooltipControl, {
86
+ tabIndex: tabIndex,
87
+ children: /*#__PURE__*/_jsx(Icon, {
88
+ transform: "grow-4",
89
+ icon: ["fas", "question-circle"],
90
+ fontSize: "2"
91
+ })
92
+ }), !!text && !dismissed && /*#__PURE__*/_jsxs(Text, {
93
+ ref: ref,
94
+ role: "tooltip",
95
+ className: "popoverText",
96
+ textAlign: textAlign,
97
+ direction: inViewDirection,
98
+ width: width,
99
+ enableSelectAll: enableSelectAll,
100
+ id: toolTipId,
101
+ children: [/*#__PURE__*/_jsx(HoverSpacer, {
102
+ className: "popoverSpacer"
103
+ }), text]
104
+ }), children]
105
+ });
106
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
107
+ theme: theme,
108
+ children: component
109
+ }) : component;
156
110
  }
157
111
  Popover.propTypes = {
158
112
  /** The element that requires the popover helper text. */
@@ -2,56 +2,53 @@ import React from "react";
2
2
  import ProgressBar from ".";
3
3
  import Box from "../Box";
4
4
  import Spacer from "../Spacer";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default {
6
7
  title: "Components/ProgressBar",
7
- decorators: [function (storyFn) {
8
- return /*#__PURE__*/React.createElement(Box, {
9
- p: "r"
10
- }, storyFn());
11
- }],
8
+ decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
9
+ p: "r",
10
+ children: storyFn()
11
+ })],
12
12
  component: ProgressBar
13
13
  };
14
- export var defaultProgressBar = function defaultProgressBar() {
15
- return /*#__PURE__*/React.createElement(Spacer, {
16
- m: "r"
17
- }, /*#__PURE__*/React.createElement(ProgressBar, {
14
+ export const defaultProgressBar = () => /*#__PURE__*/_jsxs(Spacer, {
15
+ m: "r",
16
+ children: [/*#__PURE__*/_jsx(ProgressBar, {
18
17
  ariaLabel: "Percent Completed",
19
18
  containerWidth: 100,
20
19
  fillWidth: 40
21
- }), /*#__PURE__*/React.createElement(ProgressBar, {
20
+ }), /*#__PURE__*/_jsx(ProgressBar, {
22
21
  ariaLabel: "Percent Completed",
23
22
  containerWidth: 50,
24
23
  fillWidth: 70
25
- }));
26
- };
24
+ })]
25
+ });
27
26
  defaultProgressBar.storyName = "Default";
28
- export var gradient = function gradient() {
29
- return /*#__PURE__*/React.createElement(ProgressBar, {
30
- ariaLabel: "Percent Completed",
31
- containerWidth: 100,
32
- fillWidth: 40,
33
- gradient: true
34
- });
35
- };
36
- export var onDarkBackground = function onDarkBackground() {
37
- return /*#__PURE__*/React.createElement(Box, {
38
- bg: "greyDarkest",
39
- p: "r"
40
- }, /*#__PURE__*/React.createElement(Spacer, {
41
- m: "r"
42
- }, /*#__PURE__*/React.createElement(ProgressBar, {
43
- ariaLabel: "Percent Completed",
44
- containerWidth: 100,
45
- fillWidth: 40,
46
- inverted: true
47
- }), /*#__PURE__*/React.createElement(ProgressBar, {
48
- ariaLabel: "Percent Completed",
49
- containerWidth: 100,
50
- fillWidth: 70,
51
- gradient: true,
52
- inverted: true
53
- })));
54
- };
27
+ export const gradient = () => /*#__PURE__*/_jsx(ProgressBar, {
28
+ ariaLabel: "Percent Completed",
29
+ containerWidth: 100,
30
+ fillWidth: 40,
31
+ gradient: true
32
+ });
33
+ export const onDarkBackground = () => /*#__PURE__*/_jsx(Box, {
34
+ bg: "greyDarkest",
35
+ p: "r",
36
+ children: /*#__PURE__*/_jsxs(Spacer, {
37
+ m: "r",
38
+ children: [/*#__PURE__*/_jsx(ProgressBar, {
39
+ ariaLabel: "Percent Completed",
40
+ containerWidth: 100,
41
+ fillWidth: 40,
42
+ inverted: true
43
+ }), /*#__PURE__*/_jsx(ProgressBar, {
44
+ ariaLabel: "Percent Completed",
45
+ containerWidth: 100,
46
+ fillWidth: 70,
47
+ gradient: true,
48
+ inverted: true
49
+ })]
50
+ })
51
+ });
55
52
  defaultProgressBar.__docgenInfo = {
56
53
  "description": "",
57
54
  "methods": [],
@@ -1,26 +1,18 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["containerWidth", "fillWidth", "gradient", "theme", "ariaLabel"];
4
1
  import React from "react";
5
2
  import PropTypes from "prop-types";
6
3
  import styled, { css, keyframes, ThemeProvider } from "styled-components";
7
4
  import { space, layout } from "styled-system";
8
5
  import { themeGet } from "@styled-system/theme-get";
9
- var expandWidth = keyframes(["0%{width:0;}"]);
10
- var Background = styled.div.withConfig({
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const expandWidth = keyframes(["0%{width:0;}"]);
8
+ const Background = styled.div.withConfig({
11
9
  displayName: "ProgressBar__Background",
12
10
  componentId: "sc-q9qaaf-0"
13
- })(["", " ", " position:relative;background:", ";height:16px;border-radius:8px;"], space, layout, function (props) {
14
- return themeGet("colors.greyLighter")(props);
15
- });
16
- var Fill = styled.div.withConfig({
11
+ })(["", " ", " position:relative;background:", ";height:16px;border-radius:8px;"], space, layout, props => themeGet("colors.greyLighter")(props));
12
+ const Fill = styled.div.withConfig({
17
13
  displayName: "ProgressBar__Fill",
18
14
  componentId: "sc-q9qaaf-1"
19
- })(["position:absolute;left:3px;top:3px;height:10px;border-radius:5px;animation:", " 1000ms ease-in-out 1;transition:", ";", ";"], expandWidth, function (props) {
20
- return themeGet("transition.transitionDefault")(props);
21
- }, function (props) {
22
- return props.gradient ? css(["background:linear-gradient( to right,", " 0%,", " 50%,", " 100% );"], themeGet("colors.danger")(props), themeGet("colors.warning")(props), themeGet("colors.success")(props)) : css(["background:", ";"], themeGet("colors.primary")(props));
23
- });
15
+ })(["position:absolute;left:3px;top:3px;height:10px;border-radius:5px;animation:", " 1000ms ease-in-out 1;transition:", ";", ";"], expandWidth, props => themeGet("transition.transitionDefault")(props), props => props.gradient ? css(["background:linear-gradient( to right,", " 0%,", " 50%,", " 100% );"], themeGet("colors.danger")(props), themeGet("colors.warning")(props), themeGet("colors.success")(props)) : css(["background:", ";"], themeGet("colors.primary")(props)));
24
16
 
25
17
  /**
26
18
  * Progress bar is not intended to be used for loading (that's what the Loading component is for). The intended use is for indicating progress through steps or progress towards a goal.
@@ -31,31 +23,34 @@ var Fill = styled.div.withConfig({
31
23
  */
32
24
 
33
25
  export default function ProgressBar(_ref) {
34
- var containerWidth = _ref.containerWidth,
35
- fillWidth = _ref.fillWidth,
36
- gradient = _ref.gradient,
37
- theme = _ref.theme,
38
- _ref$ariaLabel = _ref.ariaLabel,
39
- ariaLabel = _ref$ariaLabel === void 0 ? "Progress" : _ref$ariaLabel,
40
- props = _objectWithoutProperties(_ref, _excluded);
41
- var component = /*#__PURE__*/React.createElement(Background, _extends({
26
+ let {
27
+ containerWidth,
28
+ fillWidth,
29
+ gradient,
30
+ theme,
31
+ ariaLabel = "Progress",
32
+ ...props
33
+ } = _ref;
34
+ const component = /*#__PURE__*/_jsx(Background, {
42
35
  style: {
43
36
  width: containerWidth + "%"
44
- }
45
- }, props, {
37
+ },
38
+ ...props,
46
39
  "aria-label": ariaLabel,
47
40
  "aria-valuenow": fillWidth,
48
41
  "aria-valuemin": "0",
49
- "aria-valuemax": "100"
50
- }), /*#__PURE__*/React.createElement(Fill, {
51
- gradient: gradient,
52
- style: {
53
- width: fillWidth + "%"
54
- }
55
- }));
56
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
57
- theme: theme
58
- }, component) : component;
42
+ "aria-valuemax": "100",
43
+ children: /*#__PURE__*/_jsx(Fill, {
44
+ gradient: gradient,
45
+ style: {
46
+ width: fillWidth + "%"
47
+ }
48
+ })
49
+ });
50
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
51
+ theme: theme,
52
+ children: component
53
+ }) : component;
59
54
  }
60
55
  ProgressBar.propTypes = {
61
56
  /** Sets the percentage width of the parent container */
@@ -2,74 +2,69 @@ import React from "react";
2
2
  import RadioButton from ".";
3
3
  import Box from "../Box";
4
4
  import Spacer from "../Spacer";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
6
  export default {
6
7
  title: "Components/RadioButton",
7
8
  component: RadioButton
8
9
  };
9
- export var defaultRadioButton = function defaultRadioButton() {
10
- return /*#__PURE__*/React.createElement(Spacer, {
11
- m: "r"
12
- }, /*#__PURE__*/React.createElement(RadioButton, {
10
+ export const defaultRadioButton = () => /*#__PURE__*/_jsxs(Spacer, {
11
+ m: "r",
12
+ children: [/*#__PURE__*/_jsx(RadioButton, {
13
13
  name: "RadioButtons01",
14
14
  label: "Default radio"
15
- }), /*#__PURE__*/React.createElement(RadioButton, {
15
+ }), /*#__PURE__*/_jsx(RadioButton, {
16
16
  name: "RadioButtons01",
17
17
  label: "Default radio 02"
18
- }));
19
- };
18
+ })]
19
+ });
20
20
  defaultRadioButton.storyName = "Default";
21
- export var checked = function checked() {
22
- return /*#__PURE__*/React.createElement(RadioButton, {
23
- name: "RadioButtons02",
24
- label: "Default checked radio",
25
- checked: true
26
- });
27
- };
28
- export var disabled = function disabled() {
29
- return /*#__PURE__*/React.createElement(Spacer, {
30
- m: "r"
31
- }, /*#__PURE__*/React.createElement(RadioButton, {
21
+ export const checked = () => /*#__PURE__*/_jsx(RadioButton, {
22
+ name: "RadioButtons02",
23
+ label: "Default checked radio",
24
+ checked: true
25
+ });
26
+ export const disabled = () => /*#__PURE__*/_jsxs(Spacer, {
27
+ m: "r",
28
+ children: [/*#__PURE__*/_jsx(RadioButton, {
32
29
  name: "RadioButtons03",
33
30
  label: "Disabled unchecked radio",
34
31
  disabled: true
35
- }), /*#__PURE__*/React.createElement(RadioButton, {
32
+ }), /*#__PURE__*/_jsx(RadioButton, {
36
33
  name: "RadioButtons03",
37
34
  label: "Disabled checked radio",
38
35
  disabled: true,
39
36
  checked: true
40
- }));
41
- };
42
- export var colour = function colour() {
43
- return /*#__PURE__*/React.createElement(Spacer, {
44
- m: "r"
45
- }, /*#__PURE__*/React.createElement(RadioButton, {
37
+ })]
38
+ });
39
+ export const colour = () => /*#__PURE__*/_jsxs(Spacer, {
40
+ m: "r",
41
+ children: [/*#__PURE__*/_jsx(RadioButton, {
46
42
  name: "RadioButtons",
47
43
  label: "Primary colour radio",
48
44
  variant: "primary"
49
- }), /*#__PURE__*/React.createElement(RadioButton, {
45
+ }), /*#__PURE__*/_jsx(RadioButton, {
50
46
  name: "RadioButtons",
51
47
  label: "Success colour radio",
52
48
  variant: "success"
53
- }), /*#__PURE__*/React.createElement(RadioButton, {
49
+ }), /*#__PURE__*/_jsx(RadioButton, {
54
50
  name: "RadioButtons",
55
51
  label: "Warning colour radio",
56
52
  variant: "warning"
57
- }), /*#__PURE__*/React.createElement(RadioButton, {
53
+ }), /*#__PURE__*/_jsx(RadioButton, {
58
54
  name: "RadioButtons",
59
55
  label: "Danger colour radio",
60
56
  variant: "danger"
61
- }));
62
- };
63
- export var inverted = function inverted() {
64
- return /*#__PURE__*/React.createElement(Box, {
65
- p: "r",
66
- bg: "greyDarker"
67
- }, /*#__PURE__*/React.createElement(RadioButton, {
57
+ })]
58
+ });
59
+ export const inverted = () => /*#__PURE__*/_jsx(Box, {
60
+ p: "r",
61
+ bg: "greyDarker",
62
+ children: /*#__PURE__*/_jsx(RadioButton, {
68
63
  name: "RadioButtons04",
69
64
  label: "Inverted radio",
70
65
  variant: "white"
71
- }));
72
- };
66
+ })
67
+ });
73
68
  defaultRadioButton.__docgenInfo = {
74
69
  "description": "",
75
70
  "methods": [],