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.
- package/es/GlobalStyles.js +1 -31
- package/es/SystemThemeProvider.js +11 -5
- package/es/assets/Colour/Colour.stories.js +211 -0
- package/es/assets/Colour/index.js +3 -3
- package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
- package/es/components/ActionsMenu/index.js +144 -229
- package/es/components/Avatar/Avatar.stories.js +212 -196
- package/es/components/Avatar/index.js +280 -307
- package/es/components/Badge/Badge.stories.js +71 -46
- package/es/components/Badge/index.js +71 -74
- package/es/components/Box/Box.stories.js +51 -35
- package/es/components/Box/index.js +33 -34
- package/es/components/Button/Button.stories.js +161 -145
- package/es/components/Button/ButtonLink.stories.js +152 -139
- package/es/components/Button/index.js +79 -99
- package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
- package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
- package/es/components/ButtonGroup/index.js +103 -99
- package/es/components/Card/Card.stories.js +94 -62
- package/es/components/Card/index.js +50 -71
- package/es/components/Checkbox/Checkbox.stories.js +37 -43
- package/es/components/Checkbox/index.js +61 -76
- package/es/components/DatePicker/DatePicker.stories.js +86 -118
- package/es/components/DatePicker/index.js +71 -187
- package/es/components/Divider/Divider.stories.js +39 -42
- package/es/components/Divider/index.js +21 -27
- package/es/components/Expandable/Expandable.stories.js +46 -36
- package/es/components/Expandable/index.js +55 -82
- package/es/components/Flex/Flex.stories.js +19 -5
- package/es/components/Flex/FlexItem.stories.js +10 -9
- package/es/components/Flex/index.js +34 -27
- package/es/components/Grid/Grid.stories.js +129 -55
- package/es/components/Grid/index.js +25 -24
- package/es/components/Header/Header.stories.js +101 -92
- package/es/components/Header/index.js +433 -436
- package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
- package/es/components/HeaderSimple/index.js +73 -68
- package/es/components/Icon/Icon.stories.js +58 -57
- package/es/components/Icon/index.js +48 -46
- package/es/components/Loading/Loading.stories.js +32 -39
- package/es/components/Loading/index.js +44 -51
- package/es/components/Modal/Modal.stories.js +172 -153
- package/es/components/Modal/index.js +126 -134
- package/es/components/Notification/Notification.stories.js +59 -58
- package/es/components/Notification/index.js +123 -133
- package/es/components/Popover/Popover.stories.js +134 -102
- package/es/components/Popover/index.js +65 -111
- package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
- package/es/components/ProgressBar/index.js +29 -34
- package/es/components/RadioButton/RadioButton.stories.js +32 -37
- package/es/components/RadioButton/index.js +170 -184
- package/es/components/Range/Range.stories.js +19 -19
- package/es/components/Range/index.js +35 -45
- package/es/components/Select/Select.stories.js +107 -128
- package/es/components/Select/index.js +324 -336
- package/es/components/SideNav/NavItem.js +112 -122
- package/es/components/SideNav/SideNav.stories.js +84 -57
- package/es/components/SideNav/index.js +161 -185
- package/es/components/Sidebar/Sidebar.stories.js +50 -33
- package/es/components/Sidebar/index.js +152 -155
- package/es/components/Spacer/Spacer.stories.js +35 -32
- package/es/components/Spacer/index.js +20 -20
- package/es/components/StatusDot/StatusDot.stories.js +103 -90
- package/es/components/StatusDot/index.js +36 -38
- package/es/components/StyledLink/StyledLink.stories.js +68 -69
- package/es/components/StyledLink/index.js +47 -48
- package/es/components/Table/Table.stories.js +118 -112
- package/es/components/Table/getExpandColumnConfig.js +67 -62
- package/es/components/Table/index.js +24 -27
- package/es/components/Table/muiStyleOverrides.js +10 -8
- package/es/components/Tabs/Tab.stories.js +55 -38
- package/es/components/Tabs/TabsContainer.stories.js +30 -22
- package/es/components/Tabs/index.js +95 -92
- package/es/components/Tag/Tag.stories.js +250 -220
- package/es/components/Tag/index.js +118 -190
- package/es/components/TextArea/TextArea.stories.js +76 -89
- package/es/components/TextArea/index.js +117 -115
- package/es/components/TextInput/TextInput.stories.js +41 -61
- package/es/components/TextInput/index.js +127 -171
- package/es/components/Toggle/Toggle.stories.js +63 -62
- package/es/components/Toggle/index.js +43 -77
- package/es/components/TreeNav/TreeNav.stories.js +7 -8
- package/es/components/TreeNav/index.js +72 -69
- package/es/components/Typography/Typography.stories.js +174 -0
- package/es/components/Typography/index.js +252 -308
- package/es/components.test.js +1 -1
- package/es/hooks/isVisible.js +6 -10
- package/es/hooks/keepInView.js +27 -32
- package/es/hooks/keypress.js +14 -14
- package/es/hooks/useInputFocus.js +5 -5
- package/es/hooks/usePrevious.js +3 -3
- package/es/systemThemeCollapsed.js +53 -53
- package/es/systemtheme.js +53 -53
- package/es/utils/selectUtil.js +1 -1
- package/es/utils/selectUtil.test.js +6 -6
- 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 = ["icon", "colour", "floating", "children", "top", "right", "bottom", "left", "centered", "closable", "onDismiss", "theme", "iconProps", "loading"];
|
|
5
1
|
import React, { useState } from "react";
|
|
6
2
|
import PropTypes from "prop-types";
|
|
7
3
|
import styled, { ThemeProvider } from "styled-components";
|
|
@@ -11,57 +7,52 @@ import { css } from "@styled-system/css";
|
|
|
11
7
|
import shouldForwardProp from "@styled-system/should-forward-prop";
|
|
12
8
|
import { space, layout, position, variant, compose } from "styled-system";
|
|
13
9
|
import { themeGet } from "@styled-system/theme-get";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const NotificationStyles = compose(space, layout, position);
|
|
12
|
+
const NotificationWrapper = styled("div").withConfig({
|
|
13
|
+
shouldForwardProp,
|
|
17
14
|
displayName: "Notification__NotificationWrapper",
|
|
18
15
|
componentId: "sc-1p26rkq-0"
|
|
19
|
-
}).attrs(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
16
|
+
}).attrs(props => ({
|
|
17
|
+
className: props.notifClass
|
|
18
|
+
}))(props => css({
|
|
19
|
+
position: "relative",
|
|
20
|
+
color: themeGet("colors.white")(props),
|
|
21
|
+
fontSize: themeGet("fontSizes.1")(props),
|
|
22
|
+
fontWeight: themeGet("fontWeights.2")(props),
|
|
23
|
+
px: "s",
|
|
24
|
+
py: "s",
|
|
25
|
+
cursor: "default",
|
|
26
|
+
display: "flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "flex-start",
|
|
29
|
+
borderRadius: themeGet("radii.1")(props),
|
|
30
|
+
bg: themeGet("colors.primaryDark")(props),
|
|
31
|
+
"&.floating": {
|
|
32
|
+
zIndex: "13",
|
|
33
|
+
position: "fixed"
|
|
34
|
+
},
|
|
35
|
+
"&.centered": {
|
|
36
|
+
left: "50%",
|
|
37
|
+
transform: "translateX(-50%)",
|
|
38
|
+
right: "auto"
|
|
39
|
+
}
|
|
40
|
+
}), props => variant({
|
|
41
|
+
prop: "colour",
|
|
42
|
+
variants: {
|
|
43
|
+
success: {
|
|
44
|
+
bg: themeGet("colors.successDark")(props)
|
|
40
45
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
success: {
|
|
52
|
-
bg: themeGet("colors.successDark")(props)
|
|
53
|
-
},
|
|
54
|
-
danger: {
|
|
55
|
-
bg: themeGet("colors.dangerDark")(props)
|
|
56
|
-
},
|
|
57
|
-
warning: {
|
|
58
|
-
bg: themeGet("colors.warningLight")(props),
|
|
59
|
-
color: themeGet("colors.black80")(props)
|
|
60
|
-
},
|
|
61
|
-
"default": {}
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}, variant({
|
|
46
|
+
danger: {
|
|
47
|
+
bg: themeGet("colors.dangerDark")(props)
|
|
48
|
+
},
|
|
49
|
+
warning: {
|
|
50
|
+
bg: themeGet("colors.warningLight")(props),
|
|
51
|
+
color: themeGet("colors.black80")(props)
|
|
52
|
+
},
|
|
53
|
+
default: {}
|
|
54
|
+
}
|
|
55
|
+
}), variant({
|
|
65
56
|
variants: {
|
|
66
57
|
success: {
|
|
67
58
|
bg: themeGet("colors.successDark")
|
|
@@ -73,73 +64,66 @@ var NotificationWrapper = styled("div").withConfig({
|
|
|
73
64
|
bg: themeGet("colors.warningLight"),
|
|
74
65
|
color: themeGet("colors.black80")
|
|
75
66
|
},
|
|
76
|
-
|
|
67
|
+
default: {
|
|
77
68
|
bg: themeGet("colors.primaryDark")
|
|
78
69
|
}
|
|
79
70
|
}
|
|
80
71
|
}), NotificationStyles);
|
|
81
|
-
|
|
72
|
+
const NotificationContent = styled("p").withConfig({
|
|
82
73
|
displayName: "Notification__NotificationContent",
|
|
83
74
|
componentId: "sc-1p26rkq-1"
|
|
84
|
-
})(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
});
|
|
90
|
-
var CloseButton = styled("button").withConfig({
|
|
75
|
+
})(props => css({
|
|
76
|
+
lineHeight: themeGet("fontSizes.3")(props),
|
|
77
|
+
pr: props.closable === false ? "0" : "s"
|
|
78
|
+
}));
|
|
79
|
+
const CloseButton = styled("button").withConfig({
|
|
91
80
|
displayName: "Notification__CloseButton",
|
|
92
81
|
componentId: "sc-1p26rkq-2"
|
|
93
|
-
})(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
112
|
-
var NotificationIcon = styled(Icon).withConfig({
|
|
82
|
+
})(props => css({
|
|
83
|
+
appearance: "none",
|
|
84
|
+
bg: "transparent",
|
|
85
|
+
p: "0",
|
|
86
|
+
paddingLeft: "1",
|
|
87
|
+
paddingRight: "1",
|
|
88
|
+
border: "none",
|
|
89
|
+
ml: "auto",
|
|
90
|
+
cursor: "pointer",
|
|
91
|
+
opacity: "0.7",
|
|
92
|
+
transition: themeGet("transition.transitionDefault")(props),
|
|
93
|
+
color: themeGet("colors.white")(props),
|
|
94
|
+
"&:hover, &:focus": {
|
|
95
|
+
outline: "0",
|
|
96
|
+
opacity: "1"
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
const NotificationIcon = styled(Icon).withConfig({
|
|
113
100
|
displayName: "Notification__NotificationIcon",
|
|
114
101
|
componentId: "sc-1p26rkq-3"
|
|
115
|
-
})(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
121
|
-
});
|
|
102
|
+
})(props => css({
|
|
103
|
+
color: props.colour === "warning" ? themeGet("colors.black80")(props) : themeGet("colors.white")(props),
|
|
104
|
+
fontSize: themeGet("fontSizes.2")(props),
|
|
105
|
+
mr: "s"
|
|
106
|
+
}));
|
|
122
107
|
export default function Notification(_ref) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var onToggle = function onToggle() {
|
|
108
|
+
let {
|
|
109
|
+
icon,
|
|
110
|
+
colour,
|
|
111
|
+
floating,
|
|
112
|
+
children,
|
|
113
|
+
top,
|
|
114
|
+
right,
|
|
115
|
+
bottom,
|
|
116
|
+
left,
|
|
117
|
+
centered,
|
|
118
|
+
closable,
|
|
119
|
+
onDismiss,
|
|
120
|
+
theme,
|
|
121
|
+
iconProps,
|
|
122
|
+
loading,
|
|
123
|
+
...props
|
|
124
|
+
} = _ref;
|
|
125
|
+
const [dismissed, handleDismiss] = useState(false);
|
|
126
|
+
const onToggle = () => {
|
|
143
127
|
if (!dismissed) {
|
|
144
128
|
handleDismiss(true);
|
|
145
129
|
if (onDismiss) {
|
|
@@ -149,7 +133,7 @@ export default function Notification(_ref) {
|
|
|
149
133
|
handleDismiss(false);
|
|
150
134
|
}
|
|
151
135
|
};
|
|
152
|
-
|
|
136
|
+
let notifClass;
|
|
153
137
|
if (floating) {
|
|
154
138
|
if (centered) {
|
|
155
139
|
notifClass = "floating centered";
|
|
@@ -162,7 +146,7 @@ export default function Notification(_ref) {
|
|
|
162
146
|
if (dismissed) {
|
|
163
147
|
return null;
|
|
164
148
|
}
|
|
165
|
-
|
|
149
|
+
const component = /*#__PURE__*/_jsxs(NotificationWrapper, {
|
|
166
150
|
colour: colour,
|
|
167
151
|
floating: floating,
|
|
168
152
|
top: top,
|
|
@@ -172,29 +156,35 @@ export default function Notification(_ref) {
|
|
|
172
156
|
centered: centered,
|
|
173
157
|
iconProps: iconProps,
|
|
174
158
|
notifClass: notifClass,
|
|
175
|
-
role: "alert"
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
159
|
+
role: "alert",
|
|
160
|
+
...props,
|
|
161
|
+
children: [icon && /*#__PURE__*/_jsx(NotificationIcon, {
|
|
162
|
+
colour: colour,
|
|
163
|
+
icon: icon,
|
|
164
|
+
...iconProps
|
|
165
|
+
}), loading && /*#__PURE__*/_jsx(Loading, {
|
|
166
|
+
small: true,
|
|
167
|
+
inverted: colour != "warning",
|
|
168
|
+
mr: "s"
|
|
169
|
+
}), /*#__PURE__*/_jsx(NotificationContent, {
|
|
170
|
+
closable: closable,
|
|
171
|
+
children: children
|
|
172
|
+
}), closable && /*#__PURE__*/_jsx(CloseButton, {
|
|
173
|
+
className: "close-button",
|
|
174
|
+
tabIndex: "0",
|
|
175
|
+
onClick: onToggle,
|
|
176
|
+
"aria-label": "Close Notification",
|
|
177
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
178
|
+
icon: ["fas", "times"],
|
|
179
|
+
size: "lg",
|
|
180
|
+
color: colour === "warning" ? "black80" : "white"
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
return theme ? /*#__PURE__*/_jsx(ThemeProvider, {
|
|
185
|
+
theme: theme,
|
|
186
|
+
children: component
|
|
187
|
+
}) : component;
|
|
198
188
|
}
|
|
199
189
|
Notification.propTypes = {
|
|
200
190
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
@@ -5,132 +5,164 @@ import Box from "../Box";
|
|
|
5
5
|
import Grid from "../Grid";
|
|
6
6
|
import Flex from "../Flex";
|
|
7
7
|
import StyledLink from "../StyledLink";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
9
|
export default {
|
|
9
10
|
title: "Components/Popover",
|
|
10
|
-
decorators: [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}],
|
|
11
|
+
decorators: [storyFn => /*#__PURE__*/_jsx(Box, {
|
|
12
|
+
p: "6",
|
|
13
|
+
children: /*#__PURE__*/_jsx(Flex, {
|
|
14
|
+
justifyContent: "space-around",
|
|
15
|
+
children: storyFn()
|
|
16
|
+
})
|
|
17
|
+
})],
|
|
17
18
|
component: Popover
|
|
18
19
|
};
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
20
|
+
export const defaultPopover = () => /*#__PURE__*/_jsx(Popover, {
|
|
21
|
+
text: "Description that explains child element",
|
|
22
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
23
|
+
children: "Hover Me!"
|
|
24
|
+
})
|
|
25
|
+
});
|
|
24
26
|
defaultPopover.storyName = "Default";
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Popover, {
|
|
27
|
+
export const direction = () => /*#__PURE__*/_jsxs(Grid, {
|
|
28
|
+
gridTemplateColumns: "1fr 1fr 1fr",
|
|
29
|
+
gridAutoFlow: "row",
|
|
30
|
+
gridGap: "r",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
children: [/*#__PURE__*/_jsx(Popover, {
|
|
33
34
|
direction: "topLeft",
|
|
34
|
-
text: "Description that explains child element"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
text: "Description that explains child element",
|
|
36
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
37
|
+
width: "125px",
|
|
38
|
+
children: "Top left"
|
|
39
|
+
})
|
|
40
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
38
41
|
direction: "top",
|
|
39
|
-
text: "Description that explains child element"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
text: "Description that explains child element",
|
|
43
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
44
|
+
width: "125px",
|
|
45
|
+
children: "Top"
|
|
46
|
+
})
|
|
47
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
43
48
|
direction: "topRight",
|
|
44
|
-
text: "Description that explains child element"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
text: "Description that explains child element",
|
|
50
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
51
|
+
width: "125px",
|
|
52
|
+
children: "Top right"
|
|
53
|
+
})
|
|
54
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
48
55
|
direction: "left",
|
|
49
|
-
text: "Description that explains child element"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
text: "Description that explains child element",
|
|
57
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
58
|
+
width: "125px",
|
|
59
|
+
children: "Left"
|
|
60
|
+
})
|
|
61
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
53
62
|
width: "125px",
|
|
54
63
|
bg: "greyLighter",
|
|
55
64
|
m: "auto"
|
|
56
|
-
}), /*#__PURE__*/
|
|
65
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
57
66
|
direction: "right",
|
|
58
|
-
text: "Description that explains child element"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
text: "Description that explains child element",
|
|
68
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
69
|
+
width: "125px",
|
|
70
|
+
children: "Right"
|
|
71
|
+
})
|
|
72
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
62
73
|
direction: "bottomLeft",
|
|
63
|
-
text: "Description that explains child element"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
text: "Description that explains child element",
|
|
75
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
76
|
+
width: "125px",
|
|
77
|
+
children: "Bottom left"
|
|
78
|
+
})
|
|
79
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
67
80
|
direction: "bottom",
|
|
68
|
-
text: "Description that explains child element"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
text: "Description that explains child element",
|
|
82
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
83
|
+
width: "125px",
|
|
84
|
+
children: "Bottom"
|
|
85
|
+
})
|
|
86
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
72
87
|
direction: "bottomRight",
|
|
73
|
-
text: "Description that explains child element"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
88
|
+
text: "Description that explains child element",
|
|
89
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
90
|
+
width: "125px",
|
|
91
|
+
children: "Bottom right"
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
});
|
|
78
95
|
direction.storyName = "Direction";
|
|
79
|
-
export
|
|
80
|
-
|
|
96
|
+
export const specifiedWidth = () => /*#__PURE__*/_jsx(Popover, {
|
|
97
|
+
text: "Description that explains child element",
|
|
98
|
+
width: "240px",
|
|
99
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
100
|
+
children: "Hover Me"
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
export const textAlignment = () => /*#__PURE__*/_jsx(Popover, {
|
|
104
|
+
textAlign: "center",
|
|
105
|
+
text: "Centered description that explains child element",
|
|
106
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
107
|
+
children: "Hover Me"
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
export const DisplayInlineBlock = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
|
+
children: [/*#__PURE__*/_jsx(Popover, {
|
|
81
112
|
text: "Description that explains child element",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
textAlign: "center",
|
|
88
|
-
text: "Centered description that explains child element"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(Button, null, "Hover Me"));
|
|
90
|
-
};
|
|
91
|
-
export var DisplayInlineBlock = function DisplayInlineBlock() {
|
|
92
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Popover, {
|
|
113
|
+
inlineBlock: true,
|
|
114
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
115
|
+
children: "Inline Block Set"
|
|
116
|
+
})
|
|
117
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
93
118
|
text: "Description that explains child element",
|
|
94
|
-
inlineBlock: true
|
|
95
|
-
|
|
119
|
+
inlineBlock: true,
|
|
120
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
121
|
+
children: "Inline Block Set"
|
|
122
|
+
})
|
|
123
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
96
124
|
text: "Description that explains child element",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
125
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
126
|
+
children: "Not Inline"
|
|
127
|
+
})
|
|
128
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
|
101
129
|
direction: "top",
|
|
102
|
-
text: "Description that explains child element"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
text: "Description that explains child element",
|
|
131
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
132
|
+
children: "Not Inline"
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
export const tooltipExample = () => /*#__PURE__*/_jsx(Popover, {
|
|
137
|
+
text: "This tooltip helps explain stuff",
|
|
138
|
+
direction: "top",
|
|
139
|
+
variant: "tooltip"
|
|
140
|
+
});
|
|
112
141
|
tooltipExample.storyName = "Tooltip Example";
|
|
113
|
-
export
|
|
114
|
-
|
|
115
|
-
|
|
142
|
+
export const tooltipWithLinkExample = () => /*#__PURE__*/_jsx(Popover, {
|
|
143
|
+
text: /*#__PURE__*/_jsxs("span", {
|
|
144
|
+
children: ["Test tooltip with a", " ", /*#__PURE__*/_jsx(StyledLink, {
|
|
116
145
|
href: "https://www.teamform.co",
|
|
117
|
-
target: "_blank"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
146
|
+
target: "_blank",
|
|
147
|
+
children: "link to TeamForm"
|
|
148
|
+
})]
|
|
149
|
+
}),
|
|
150
|
+
arialLabel: "Link to TeamForm",
|
|
151
|
+
direction: "right",
|
|
152
|
+
variant: "tooltip",
|
|
153
|
+
enableSelectAll: false
|
|
154
|
+
});
|
|
125
155
|
tooltipWithLinkExample.storyName = "Tooltip with link Example";
|
|
126
|
-
export
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
156
|
+
export const keepInViewExample = () => /*#__PURE__*/_jsx(Flex, {
|
|
157
|
+
justifyContent: "flex-end",
|
|
158
|
+
width: "100%",
|
|
159
|
+
children: /*#__PURE__*/_jsx(Popover, {
|
|
160
|
+
text: "Description that explains child element",
|
|
161
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
162
|
+
children: "Hover Me!"
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
});
|
|
134
166
|
keepInViewExample.storyName = "Keep In View Example";
|
|
135
167
|
defaultPopover.__docgenInfo = {
|
|
136
168
|
"description": "",
|