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,214 +1,200 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["name", "value", "label", "variant", "disabled", "checked", "onChange", "theme", "ariaLabel"];
5
1
  import React from "react";
6
2
  import PropTypes from "prop-types";
7
3
  import styled, { ThemeProvider } from "styled-components";
8
4
  import { space, layout, compose, variant } from "styled-system";
9
5
  import { css } from "@styled-system/css";
10
6
  import { themeGet } from "@styled-system/theme-get";
11
- var RadioButtonStyles = compose(space, layout);
12
- var RadioButtonItem = styled("div").withConfig({
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const RadioButtonStyles = compose(space, layout);
9
+ const RadioButtonItem = styled("div").withConfig({
13
10
  displayName: "RadioButton__RadioButtonItem",
14
11
  componentId: "sc-d2jy6y-0"
15
- })(function (props) {
16
- return css({
17
- color: themeGet("colors.greyDarkest")(props)
18
- });
19
- }, function (props) {
20
- return variant({
21
- variants: {
22
- "default": {},
23
- white: {
24
- color: themeGet("colors.white")(props)
25
- }
12
+ })(props => css({
13
+ color: themeGet("colors.greyDarkest")(props)
14
+ }), props => variant({
15
+ variants: {
16
+ default: {},
17
+ white: {
18
+ color: themeGet("colors.white")(props)
26
19
  }
27
- });
28
- }, RadioButtonStyles);
29
- var RadioButtonLabel = styled("label").withConfig({
20
+ }
21
+ }), RadioButtonStyles);
22
+ const RadioButtonLabel = styled("label").withConfig({
30
23
  displayName: "RadioButton__RadioButtonLabel",
31
24
  componentId: "sc-d2jy6y-1"
32
- })(function (props) {
33
- return css({
34
- display: "flex",
35
- alignItems: "center",
36
- cursor: props.disabled ? "default" : "pointer",
37
- opacity: props.disabled ? "0.5" : "1"
38
- });
39
- });
40
- var RadioButtonControl = styled.input.attrs({
25
+ })(props => css({
26
+ display: "flex",
27
+ alignItems: "center",
28
+ cursor: props.disabled ? "default" : "pointer",
29
+ opacity: props.disabled ? "0.5" : "1"
30
+ }));
31
+ const RadioButtonControl = styled.input.attrs({
41
32
  type: "radio"
42
33
  }).withConfig({
43
34
  displayName: "RadioButton__RadioButtonControl",
44
35
  componentId: "sc-d2jy6y-2"
45
- })(function (props) {
46
- return css({
47
- opacity: "0",
48
- position: "absolute",
49
- margin: "0",
50
- zIndex: "-1",
51
- width: "0",
52
- height: "0",
53
- overflow: "hidden",
54
- pointerEvents: "none",
55
- "+ div > div": {
56
- transform: "scale(0)"
36
+ })(props => css({
37
+ opacity: "0",
38
+ position: "absolute",
39
+ margin: "0",
40
+ zIndex: "-1",
41
+ width: "0",
42
+ height: "0",
43
+ overflow: "hidden",
44
+ pointerEvents: "none",
45
+ "+ div > div": {
46
+ transform: "scale(0)"
47
+ },
48
+ "&:checked + div > div": {
49
+ transform: "scale(1)"
50
+ },
51
+ "&:focus + div": {
52
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.black30")(props)
53
+ }
54
+ }), props => variant({
55
+ variants: {
56
+ default: {},
57
+ white: {
58
+ "&:focus + div": {
59
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.white30")(props)
60
+ }
57
61
  },
58
- "&:checked + div > div": {
59
- transform: "scale(1)"
62
+ primary: {
63
+ "&:focus + div": {
64
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.primary30")(props)
65
+ }
60
66
  },
61
- "&:focus + div": {
62
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.black30")(props)
63
- }
64
- });
65
- }, function (props) {
66
- return variant({
67
- variants: {
68
- "default": {},
69
- white: {
70
- "&:focus + div": {
71
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.white30")(props)
72
- }
73
- },
74
- primary: {
75
- "&:focus + div": {
76
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.primary30")(props)
77
- }
78
- },
79
- success: {
80
- "&:focus + div": {
81
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.success30")(props)
82
- }
83
- },
84
- warning: {
85
- "&:focus + div": {
86
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.warning30")(props)
87
- }
88
- },
89
- danger: {
90
- "&:focus + div": {
91
- boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.danger30")(props)
92
- }
67
+ success: {
68
+ "&:focus + div": {
69
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.success30")(props)
70
+ }
71
+ },
72
+ warning: {
73
+ "&:focus + div": {
74
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.warning30")(props)
75
+ }
76
+ },
77
+ danger: {
78
+ "&:focus + div": {
79
+ boxShadow: themeGet("shadows.thickOutline")(props) + " " + themeGet("colors.danger30")(props)
93
80
  }
94
81
  }
95
- });
96
- });
97
- var RadioButtonCircle = styled("div").withConfig({
82
+ }
83
+ }));
84
+ const RadioButtonCircle = styled("div").withConfig({
98
85
  displayName: "RadioButton__RadioButtonCircle",
99
86
  componentId: "sc-d2jy6y-3"
100
- })(function (props) {
101
- return css({
102
- position: "relative",
103
- display: "flex",
104
- alignItems: "center",
105
- justifyContent: "center",
106
- width: "20px",
107
- height: "20px",
108
- borderRadius: "10px",
109
- border: "solid 2px",
110
- borderColor: themeGet("colors.greyDarker")(props),
111
- transition: themeGet("transition.transitionDefault")(props)
112
- });
113
- }, function (props) {
114
- return variant({
115
- variants: {
116
- "default": {},
117
- white: {
118
- borderColor: themeGet("colors.white")(props)
119
- },
120
- primary: {
121
- borderColor: themeGet("colors.primary")(props)
122
- },
123
- success: {
124
- borderColor: themeGet("colors.success")(props)
125
- },
126
- warning: {
127
- borderColor: themeGet("colors.warning")(props)
128
- },
129
- danger: {
130
- borderColor: themeGet("colors.danger")(props)
131
- }
87
+ })(props => css({
88
+ position: "relative",
89
+ display: "flex",
90
+ alignItems: "center",
91
+ justifyContent: "center",
92
+ width: "20px",
93
+ height: "20px",
94
+ borderRadius: "10px",
95
+ border: "solid 2px",
96
+ borderColor: themeGet("colors.greyDarker")(props),
97
+ transition: themeGet("transition.transitionDefault")(props)
98
+ }), props => variant({
99
+ variants: {
100
+ default: {},
101
+ white: {
102
+ borderColor: themeGet("colors.white")(props)
103
+ },
104
+ primary: {
105
+ borderColor: themeGet("colors.primary")(props)
106
+ },
107
+ success: {
108
+ borderColor: themeGet("colors.success")(props)
109
+ },
110
+ warning: {
111
+ borderColor: themeGet("colors.warning")(props)
112
+ },
113
+ danger: {
114
+ borderColor: themeGet("colors.danger")(props)
132
115
  }
133
- });
134
- });
135
- var RadioButtonDot = styled("div").withConfig({
116
+ }
117
+ }));
118
+ const RadioButtonDot = styled("div").withConfig({
136
119
  displayName: "RadioButton__RadioButtonDot",
137
120
  componentId: "sc-d2jy6y-4"
138
- })(function (props) {
139
- return css({
140
- position: "absolute",
141
- display: "block",
142
- width: "10px",
143
- height: "10px",
144
- borderRadius: "8px",
145
- transform: "scale(0)",
146
- backgroundColor: themeGet("colors.greyDarker")(props),
147
- transition: themeGet("transition.transitionDefault")(props)
148
- });
149
- }, function (props) {
150
- return variant({
151
- variants: {
152
- "default": {},
153
- white: {
154
- backgroundColor: themeGet("colors.white")(props)
155
- },
156
- primary: {
157
- backgroundColor: themeGet("colors.primary")(props)
158
- },
159
- success: {
160
- backgroundColor: themeGet("colors.success")(props)
161
- },
162
- warning: {
163
- backgroundColor: themeGet("colors.warning")(props)
164
- },
165
- danger: {
166
- backgroundColor: themeGet("colors.danger")(props)
167
- }
121
+ })(props => css({
122
+ position: "absolute",
123
+ display: "block",
124
+ width: "10px",
125
+ height: "10px",
126
+ borderRadius: "8px",
127
+ transform: "scale(0)",
128
+ backgroundColor: themeGet("colors.greyDarker")(props),
129
+ transition: themeGet("transition.transitionDefault")(props)
130
+ }), props => variant({
131
+ variants: {
132
+ default: {},
133
+ white: {
134
+ backgroundColor: themeGet("colors.white")(props)
135
+ },
136
+ primary: {
137
+ backgroundColor: themeGet("colors.primary")(props)
138
+ },
139
+ success: {
140
+ backgroundColor: themeGet("colors.success")(props)
141
+ },
142
+ warning: {
143
+ backgroundColor: themeGet("colors.warning")(props)
144
+ },
145
+ danger: {
146
+ backgroundColor: themeGet("colors.danger")(props)
168
147
  }
169
- });
170
- });
171
- var RadioButtonText = styled("div").withConfig({
148
+ }
149
+ }));
150
+ const RadioButtonText = styled("div").withConfig({
172
151
  displayName: "RadioButton__RadioButtonText",
173
152
  componentId: "sc-d2jy6y-5"
174
- })(function (props) {
175
- return css({
176
- paddingLeft: "s",
177
- fontSize: themeGet("fontSizes.2")(props),
178
- fontWeight: themeGet("fontWeights.1")(props)
179
- });
180
- });
153
+ })(props => css({
154
+ paddingLeft: "s",
155
+ fontSize: themeGet("fontSizes.2")(props),
156
+ fontWeight: themeGet("fontWeights.1")(props)
157
+ }));
181
158
  export default function RadioButton(_ref) {
182
- var name = _ref.name,
183
- value = _ref.value,
184
- label = _ref.label,
185
- variant = _ref.variant,
186
- disabled = _ref.disabled,
187
- checked = _ref.checked,
188
- onChange = _ref.onChange,
189
- theme = _ref.theme,
190
- ariaLabel = _ref.ariaLabel,
191
- props = _objectWithoutProperties(_ref, _excluded);
192
- var component = /*#__PURE__*/React.createElement(RadioButtonItem, _extends({
193
- variant: variant
194
- }, props), /*#__PURE__*/React.createElement(RadioButtonLabel, {
195
- disabled: disabled
196
- }, /*#__PURE__*/React.createElement(RadioButtonControl, {
197
- name: name,
159
+ let {
160
+ name,
161
+ value,
162
+ label,
163
+ variant,
164
+ disabled,
165
+ checked,
166
+ onChange,
167
+ theme,
168
+ ariaLabel,
169
+ ...props
170
+ } = _ref;
171
+ const component = /*#__PURE__*/_jsx(RadioButtonItem, {
198
172
  variant: variant,
199
- value: value,
200
- disabled: disabled,
201
- checked: checked,
202
- onChange: onChange,
203
- "aria-label": ariaLabel
204
- }), /*#__PURE__*/React.createElement(RadioButtonCircle, {
205
- variant: variant
206
- }, /*#__PURE__*/React.createElement(RadioButtonDot, {
207
- variant: variant
208
- })), /*#__PURE__*/React.createElement(RadioButtonText, null, label)));
209
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
210
- theme: theme
211
- }, component) : component;
173
+ ...props,
174
+ children: /*#__PURE__*/_jsxs(RadioButtonLabel, {
175
+ disabled: disabled,
176
+ children: [/*#__PURE__*/_jsx(RadioButtonControl, {
177
+ name: name,
178
+ variant: variant,
179
+ value: value,
180
+ disabled: disabled,
181
+ checked: checked,
182
+ onChange: onChange,
183
+ "aria-label": ariaLabel
184
+ }), /*#__PURE__*/_jsx(RadioButtonCircle, {
185
+ variant: variant,
186
+ children: /*#__PURE__*/_jsx(RadioButtonDot, {
187
+ variant: variant
188
+ })
189
+ }), /*#__PURE__*/_jsx(RadioButtonText, {
190
+ children: label
191
+ })]
192
+ })
193
+ });
194
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
195
+ theme: theme,
196
+ children: component
197
+ }) : component;
212
198
  }
213
199
  RadioButton.propTypes = {
214
200
  /** Sets a name to define the radio button group */
@@ -218,12 +204,12 @@ RadioButton.propTypes = {
218
204
  /** Sets the label of the radio button */
219
205
  label: PropTypes.string,
220
206
  // ariaLabel prop must be specified if label is not provided
221
- ariaLabel: function ariaLabel(props, propName) {
207
+ ariaLabel: (props, propName) => {
222
208
  if (!props.label && (props[propName] == null || props[propName] === "")) {
223
209
  return new Error("Missing prop `".concat(propName, "` not specified for Radio component. When `label` is not provided, `").concat(propName, "` is required."));
224
210
  }
225
211
  if (props[propName] && typeof props[propName] !== "string") {
226
- return new Error("Invalid propType `".concat(propName, "` supplied to Radio component. Expected `string`, received `").concat(_typeof(props[propName]), "`."));
212
+ return new Error("Invalid propType `".concat(propName, "` supplied to Radio component. Expected `string`, received `").concat(typeof props[propName], "`."));
227
213
  }
228
214
  return null;
229
215
  },
@@ -1,31 +1,31 @@
1
1
  import React from "react";
2
2
  import Range from ".";
3
3
  import Box from "../Box";
4
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
4
5
  export default {
5
6
  title: "Components/Range",
6
7
  component: Range
7
8
  };
8
- export var defaultRange = function defaultRange() {
9
- return /*#__PURE__*/React.createElement(Range, {
10
- min: 0,
11
- max: 20,
12
- defaultValue: 10,
13
- ariaLabel: "Default range slider"
14
- });
15
- };
9
+ export const defaultRange = () => /*#__PURE__*/_jsx(Range, {
10
+ min: 0,
11
+ max: 20,
12
+ defaultValue: 10,
13
+ ariaLabel: "Default range slider"
14
+ });
16
15
  defaultRange.storyName = "Default";
17
- export var inverted = function inverted() {
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
16
+ export const inverted = () => /*#__PURE__*/_jsx(_Fragment, {
17
+ children: /*#__PURE__*/_jsx(Box, {
19
18
  bg: "greyDarker",
20
- p: "r"
21
- }, /*#__PURE__*/React.createElement(Range, {
22
- min: 0,
23
- max: 20,
24
- defaultValue: 10,
25
- ariaLabel: "Inverted range slider",
26
- inverted: true
27
- })));
28
- };
19
+ p: "r",
20
+ children: /*#__PURE__*/_jsx(Range, {
21
+ min: 0,
22
+ max: 20,
23
+ defaultValue: 10,
24
+ ariaLabel: "Inverted range slider",
25
+ inverted: true
26
+ })
27
+ })
28
+ });
29
29
  defaultRange.__docgenInfo = {
30
30
  "description": "",
31
31
  "methods": [],
@@ -1,70 +1,60 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["min", "max", "inverted", "defaultValue", "theme", "ariaLabel"];
4
1
  import React from "react";
5
2
  import PropTypes from "prop-types";
6
3
  import styled, { css, ThemeProvider } from "styled-components";
7
4
  import { space, layout } from "styled-system";
8
5
  import { themeGet } from "@styled-system/theme-get";
9
- var vars = {
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ const vars = {
10
8
  trackHeight: "4px",
11
9
  thumbDiameter: "20px"
12
10
  };
13
- var thumb = function thumb(props) {
14
- return "\n margin-top: -8px;\n box-sizing: border-box;\n border: none;\n width: ".concat(vars.thumbDiameter, ";\n height: ").concat(vars.thumbDiameter, ";\n border-radius: ").concat(vars.thumbDiameter, ";\n background: ").concat(themeGet("colors.primary")(props), ";\n");
15
- };
16
- var track = function track(props) {
17
- return "\n box-sizing: border-box;\n border: none;\n width: 100%;\n height: ".concat(vars.trackHeight, ";\n\t background: ").concat(themeGet("colors.greyLight")(props), ";\n border-radius: 4px;\n");
18
- };
19
- var Wrapper = styled.div.withConfig({
11
+ const thumb = props => "\n margin-top: -8px;\n box-sizing: border-box;\n border: none;\n width: ".concat(vars.thumbDiameter, ";\n height: ").concat(vars.thumbDiameter, ";\n border-radius: ").concat(vars.thumbDiameter, ";\n background: ").concat(themeGet("colors.primary")(props), ";\n");
12
+ const track = props => "\n box-sizing: border-box;\n border: none;\n width: 100%;\n height: ".concat(vars.trackHeight, ";\n\t background: ").concat(themeGet("colors.greyLight")(props), ";\n border-radius: 4px;\n");
13
+ const Wrapper = styled.div.withConfig({
20
14
  displayName: "Range__Wrapper",
21
15
  componentId: "sc-zb0zps-0"
22
- })(["", " ", " position:relative;width:100%;display:flex;flex-wrap:wrap;align-items:center;&:before{content:\"", "\";font-size:10px;font-weight:bold;}&:after{content:\"", "\";font-size:10px;font-weight:bold;}", ""], space, layout, function (props) {
23
- return props.minValue;
24
- }, function (props) {
25
- return props.maxValue;
26
- }, function (props) {
27
- return props.inverted ? css(["&:before,&:after{color:", ";}input{&:focus{background:rgba(255,255,255,0.1);}&::-webkit-slider-runnable-track{background:", ";}&::-moz-range-track{background:", ";}&::-ms-track{background:", ";}}output{color:", ";}"], themeGet("colors.white")(props), themeGet("colors.greyDark")(props), themeGet("colors.greyDark")(props), themeGet("colors.greyDark")(props), themeGet("colors.white")(props)) : css([""]);
28
- });
29
- var Input = styled.input.attrs({
16
+ })(["", " ", " position:relative;width:100%;display:flex;flex-wrap:wrap;align-items:center;&:before{content:\"", "\";font-size:10px;font-weight:bold;}&:after{content:\"", "\";font-size:10px;font-weight:bold;}", ""], space, layout, props => props.minValue, props => props.maxValue, props => props.inverted ? css(["&:before,&:after{color:", ";}input{&:focus{background:rgba(255,255,255,0.1);}&::-webkit-slider-runnable-track{background:", ";}&::-moz-range-track{background:", ";}&::-ms-track{background:", ";}}output{color:", ";}"], themeGet("colors.white")(props), themeGet("colors.greyDark")(props), themeGet("colors.greyDark")(props), themeGet("colors.greyDark")(props), themeGet("colors.white")(props)) : css([""]));
17
+ const Input = styled.input.attrs({
30
18
  type: "range"
31
19
  }).withConfig({
32
20
  displayName: "Range__Input",
33
21
  componentId: "sc-zb0zps-1"
34
- })(["flex:1;margin:0;padding:0;width:100%;min-height:", ";background:transparent;cursor:ew-resize;padding:10px 10px;border-radius:25px;transition:", ";&:focus{outline:none;background:rgba(0,0,0,0.05);}&,&::-webkit-slider-thumb{-moz-appearance:none;-webkit-appearance:none;appearance:none;}&::-webkit-slider-runnable-track{", ";}&::-moz-range-track{", ";}&::-ms-track{", ";}&::-webkit-slider-thumb{", ";}&::-moz-range-thumb{", ";}&::-ms-thumb{", ";}&::-ms-tooltip{display:none;}"], vars.thumbDiameter, function (props) {
35
- return themeGet("transition.transitionDefault")(props);
36
- }, track, track, track, thumb, thumb, thumb);
37
- var Output = styled.output.withConfig({
22
+ })(["flex:1;margin:0;padding:0;width:100%;min-height:", ";background:transparent;cursor:ew-resize;padding:10px 10px;border-radius:25px;transition:", ";&:focus{outline:none;background:rgba(0,0,0,0.05);}&,&::-webkit-slider-thumb{-moz-appearance:none;-webkit-appearance:none;appearance:none;}&::-webkit-slider-runnable-track{", ";}&::-moz-range-track{", ";}&::-ms-track{", ";}&::-webkit-slider-thumb{", ";}&::-moz-range-thumb{", ";}&::-ms-thumb{", ";}&::-ms-tooltip{display:none;}"], vars.thumbDiameter, props => themeGet("transition.transitionDefault")(props), track, track, track, thumb, thumb, thumb);
23
+ const Output = styled.output.withConfig({
38
24
  displayName: "Range__Output",
39
25
  componentId: "sc-zb0zps-2"
40
- })(["display:block;user-select:none;font-weight:bold;text-align:center;font-size:14px;pointer-events:none;text-align:center;flex:1 1 100%;order:4;color:", ";"], function (props) {
41
- return themeGet("colors.greyDarker")(props);
42
- });
26
+ })(["display:block;user-select:none;font-weight:bold;text-align:center;font-size:14px;pointer-events:none;text-align:center;flex:1 1 100%;order:4;color:", ";"], props => themeGet("colors.greyDarker")(props));
43
27
  /**
44
28
  * Range component is pretty self explanatory, used to select a number out of a range, make sure to set a min, max and default value.
45
29
  */
46
30
  export default function Range(_ref) {
47
- var min = _ref.min,
48
- max = _ref.max,
49
- inverted = _ref.inverted,
50
- defaultValue = _ref.defaultValue,
51
- theme = _ref.theme,
52
- ariaLabel = _ref.ariaLabel,
53
- props = _objectWithoutProperties(_ref, _excluded);
54
- var component = /*#__PURE__*/React.createElement(Wrapper, {
31
+ let {
32
+ min,
33
+ max,
34
+ inverted,
35
+ defaultValue,
36
+ theme,
37
+ ariaLabel,
38
+ ...props
39
+ } = _ref;
40
+ const component = /*#__PURE__*/_jsxs(Wrapper, {
55
41
  minValue: min,
56
42
  maxValue: max,
57
- inverted: inverted
58
- }, /*#__PURE__*/React.createElement(Input, _extends({
59
- min: min,
60
- max: max,
61
- "aria-label": ariaLabel
62
- }, props)), /*#__PURE__*/React.createElement(Output, {
63
- "aria-hidden": "true"
64
- }, defaultValue));
65
- return theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
66
- theme: theme
67
- }, component) : component;
43
+ inverted: inverted,
44
+ children: [/*#__PURE__*/_jsx(Input, {
45
+ min: min,
46
+ max: max,
47
+ "aria-label": ariaLabel,
48
+ ...props
49
+ }), /*#__PURE__*/_jsx(Output, {
50
+ "aria-hidden": "true",
51
+ children: defaultValue
52
+ })]
53
+ });
54
+ return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
55
+ theme: theme,
56
+ children: component
57
+ }) : component;
68
58
  }
69
59
  Range.propTypes = {
70
60
  /** Sets the minimum value for the range */