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
|
@@ -4,187 +4,203 @@ import Icon from "../Icon";
|
|
|
4
4
|
import Spacer from "../Spacer";
|
|
5
5
|
import Flex from "../Flex";
|
|
6
6
|
import Button, { VARIANT_COLORS } from ".";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
8
|
export default {
|
|
8
9
|
title: "Components/Buttons/Button",
|
|
9
10
|
component: Button
|
|
10
11
|
};
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
};
|
|
12
|
+
export const defaultButton = () => /*#__PURE__*/_jsx(Button, {
|
|
13
|
+
children: "Default button"
|
|
14
|
+
});
|
|
14
15
|
defaultButton.storyName = "Default button";
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export var alternateSize = function alternateSize() {
|
|
28
|
-
return /*#__PURE__*/React.createElement(Spacer, {
|
|
29
|
-
my: "3"
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
16
|
+
export const variants = () => /*#__PURE__*/_jsx(Spacer, {
|
|
17
|
+
my: "3",
|
|
18
|
+
children: Object.keys(VARIANT_COLORS).map(variant => /*#__PURE__*/_jsx(Button, {
|
|
19
|
+
large: true,
|
|
20
|
+
variant: variant,
|
|
21
|
+
onClick: action("clicked"),
|
|
22
|
+
children: variant
|
|
23
|
+
}, variant))
|
|
24
|
+
});
|
|
25
|
+
export const alternateSize = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
26
|
+
my: "3",
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
31
28
|
small: true,
|
|
32
|
-
onClick: action("clicked")
|
|
33
|
-
|
|
29
|
+
onClick: action("clicked"),
|
|
30
|
+
children: "Small button"
|
|
31
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
34
32
|
large: true,
|
|
35
|
-
onClick: action("clicked")
|
|
36
|
-
|
|
33
|
+
onClick: action("clicked"),
|
|
34
|
+
children: "Large button"
|
|
35
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
37
36
|
height: "xxxl",
|
|
38
|
-
onClick: action("clicked")
|
|
39
|
-
}, "Specified height button"), /*#__PURE__*/React.createElement(Button, {
|
|
40
37
|
onClick: action("clicked"),
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
38
|
+
children: "Specified height button"
|
|
39
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
40
|
+
onClick: action("clicked"),
|
|
41
|
+
width: "100px",
|
|
42
|
+
children: "A multiple-line button with specified width"
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
44
45
|
alternateSize.storyName = "Alternate sizes";
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
46
|
+
export const alternateColours = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
47
|
+
my: "3",
|
|
48
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
49
49
|
variant: "success",
|
|
50
|
-
onClick: action("clicked")
|
|
51
|
-
|
|
50
|
+
onClick: action("clicked"),
|
|
51
|
+
children: "Success/green button"
|
|
52
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
52
53
|
variant: "danger",
|
|
53
|
-
onClick: action("clicked")
|
|
54
|
-
|
|
55
|
-
}
|
|
54
|
+
onClick: action("clicked"),
|
|
55
|
+
children: "Danger/red button"
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
56
58
|
alternateColours.storyName = "Alternate colours";
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
59
|
+
export const ghost = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
60
|
+
my: "3",
|
|
61
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
61
62
|
small: true,
|
|
62
63
|
variant: "ghost",
|
|
63
|
-
onClick: action("clicked")
|
|
64
|
-
|
|
64
|
+
onClick: action("clicked"),
|
|
65
|
+
children: "Small ghost button"
|
|
66
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
65
67
|
variant: "ghost",
|
|
66
|
-
onClick: action("clicked")
|
|
67
|
-
|
|
68
|
+
onClick: action("clicked"),
|
|
69
|
+
children: "Regular ghost button"
|
|
70
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
68
71
|
large: true,
|
|
69
72
|
variant: "ghost",
|
|
70
|
-
onClick: action("clicked")
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
+
onClick: action("clicked"),
|
|
74
|
+
children: "Large ghost button"
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
73
77
|
ghost.storyName = "Ghost style";
|
|
74
|
-
export
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
78
|
+
export const fullWidth = () => /*#__PURE__*/_jsx(Button, {
|
|
79
|
+
fullWidth: true,
|
|
80
|
+
children: "Full width button"
|
|
81
|
+
});
|
|
79
82
|
fullWidth.storyName = "Full width";
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
variant: "disabled"
|
|
87
|
-
|
|
88
|
-
}
|
|
83
|
+
export const disabled = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
84
|
+
my: "r",
|
|
85
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
86
|
+
disabled: true,
|
|
87
|
+
children: "Disabled button"
|
|
88
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
89
|
+
variant: "disabled",
|
|
90
|
+
children: "Alternate way of making button disabled"
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
89
93
|
disabled.storyName = "Disabled state";
|
|
90
|
-
export
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
94
|
-
isLoading: true
|
|
95
|
-
}, "Loading..."), /*#__PURE__*/React.createElement(Button, {
|
|
94
|
+
export const loading = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
95
|
+
my: "3",
|
|
96
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
96
97
|
isLoading: true,
|
|
97
|
-
|
|
98
|
-
}
|
|
98
|
+
children: "Loading..."
|
|
99
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
99
100
|
isLoading: true,
|
|
100
|
-
variant: "
|
|
101
|
-
|
|
102
|
-
}
|
|
101
|
+
variant: "success",
|
|
102
|
+
children: "Saving..."
|
|
103
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
104
|
+
isLoading: true,
|
|
105
|
+
variant: "danger",
|
|
106
|
+
children: "Deleting..."
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
103
109
|
loading.storyName = "Loading state";
|
|
104
|
-
export
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}),
|
|
112
|
-
iconRight: true
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
export const withIcon = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
111
|
+
my: "3",
|
|
112
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
113
|
+
iconLeft: true,
|
|
114
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
115
|
+
icon: ["fas", "user-plus"]
|
|
116
|
+
}), "Left aligned icon"]
|
|
117
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
118
|
+
iconRight: true,
|
|
119
|
+
children: ["Right aligned icon", /*#__PURE__*/_jsx(Icon, {
|
|
120
|
+
icon: ["fas", "download"]
|
|
121
|
+
})]
|
|
122
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
123
|
+
leftIcon: ["fas", "star"],
|
|
124
|
+
children: "Left icon magic!"
|
|
125
|
+
})]
|
|
126
|
+
});
|
|
119
127
|
withIcon.storyName = "With icon";
|
|
120
|
-
export
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
128
|
+
export const iconOnly = () => /*#__PURE__*/_jsxs(Spacer, {
|
|
129
|
+
my: "3",
|
|
130
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
124
131
|
small: true,
|
|
125
132
|
iconOnly: true,
|
|
126
133
|
p: "s",
|
|
127
|
-
ariaLabel: /*#__PURE__*/
|
|
134
|
+
ariaLabel: /*#__PURE__*/_jsx(Icon, {
|
|
128
135
|
icon: ["fas", "download"]
|
|
136
|
+
}),
|
|
137
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
138
|
+
icon: ["far", "calendar-alt"]
|
|
129
139
|
})
|
|
130
|
-
}, /*#__PURE__*/
|
|
131
|
-
icon: ["far", "calendar-alt"]
|
|
132
|
-
})), /*#__PURE__*/React.createElement(Button, {
|
|
140
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
133
141
|
iconOnly: true,
|
|
134
142
|
p: "s",
|
|
135
|
-
ariaLabel: "Show calendar"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
ariaLabel: "Show calendar",
|
|
144
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
145
|
+
icon: ["far", "calendar-alt"]
|
|
146
|
+
})
|
|
147
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
139
148
|
large: true,
|
|
140
149
|
iconOnly: true,
|
|
141
150
|
p: "s",
|
|
142
|
-
ariaLabel: "Show calendar"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
151
|
+
ariaLabel: "Show calendar",
|
|
152
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
153
|
+
icon: ["far", "calendar-alt"]
|
|
154
|
+
})
|
|
155
|
+
}), /*#__PURE__*/_jsx(Flex, {
|
|
146
156
|
alignItems: "center",
|
|
147
|
-
mt: "r"
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
157
|
+
mt: "r",
|
|
158
|
+
children: /*#__PURE__*/_jsxs(Spacer, {
|
|
159
|
+
mr: "r",
|
|
160
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
161
|
+
iconOnly: true,
|
|
162
|
+
variant: "success",
|
|
163
|
+
onClick: action("clicked"),
|
|
164
|
+
width: "33px",
|
|
165
|
+
height: "32px",
|
|
166
|
+
ariaLabel: "Confirm",
|
|
167
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
168
|
+
icon: ["fas", "check"]
|
|
169
|
+
})
|
|
170
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
171
|
+
iconOnly: true,
|
|
172
|
+
variant: "successAlternate",
|
|
173
|
+
onClick: action("clicked"),
|
|
174
|
+
width: "33px",
|
|
175
|
+
height: "32px",
|
|
176
|
+
ariaLabel: "Confirm",
|
|
177
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
178
|
+
icon: ["fas", "check"]
|
|
179
|
+
})
|
|
180
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
181
|
+
iconOnly: true,
|
|
182
|
+
variant: "danger",
|
|
183
|
+
onClick: action("clicked"),
|
|
184
|
+
width: "33px",
|
|
185
|
+
height: "32px",
|
|
186
|
+
ariaLabel: "Cancel",
|
|
187
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
188
|
+
icon: ["fas", "times"]
|
|
189
|
+
})
|
|
190
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
191
|
+
iconOnly: true,
|
|
192
|
+
variant: "dangerAlternate",
|
|
193
|
+
onClick: action("clicked"),
|
|
194
|
+
width: "33px",
|
|
195
|
+
height: "32px",
|
|
196
|
+
ariaLabel: "Cancel",
|
|
197
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
198
|
+
icon: ["fas", "times"]
|
|
199
|
+
})
|
|
200
|
+
})]
|
|
201
|
+
})
|
|
202
|
+
})]
|
|
203
|
+
});
|
|
188
204
|
iconOnly.storyName = "Icon only";
|
|
189
205
|
defaultButton.__docgenInfo = {
|
|
190
206
|
"description": "",
|