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
@@ -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 var defaultButton = function defaultButton() {
12
- return /*#__PURE__*/React.createElement(Button, null, "Default button");
13
- };
12
+ export const defaultButton = () => /*#__PURE__*/_jsx(Button, {
13
+ children: "Default button"
14
+ });
14
15
  defaultButton.storyName = "Default button";
15
- export var variants = function variants() {
16
- return /*#__PURE__*/React.createElement(Spacer, {
17
- my: "3"
18
- }, Object.keys(VARIANT_COLORS).map(function (variant) {
19
- return /*#__PURE__*/React.createElement(Button, {
20
- large: true,
21
- key: variant,
22
- variant: variant,
23
- onClick: action("clicked")
24
- }, variant);
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
- }, "Small button"), /*#__PURE__*/React.createElement(Button, {
29
+ onClick: action("clicked"),
30
+ children: "Small button"
31
+ }), /*#__PURE__*/_jsx(Button, {
34
32
  large: true,
35
- onClick: action("clicked")
36
- }, "Large button"), /*#__PURE__*/React.createElement(Button, {
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
- width: "100px"
42
- }, "A multiple-line button with specified width"));
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 var alternateColours = function alternateColours() {
46
- return /*#__PURE__*/React.createElement(Spacer, {
47
- my: "3"
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
- }, "Success/green button"), /*#__PURE__*/React.createElement(Button, {
50
+ onClick: action("clicked"),
51
+ children: "Success/green button"
52
+ }), /*#__PURE__*/_jsx(Button, {
52
53
  variant: "danger",
53
- onClick: action("clicked")
54
- }, "Danger/red button"));
55
- };
54
+ onClick: action("clicked"),
55
+ children: "Danger/red button"
56
+ })]
57
+ });
56
58
  alternateColours.storyName = "Alternate colours";
57
- export var ghost = function ghost() {
58
- return /*#__PURE__*/React.createElement(Spacer, {
59
- my: "3"
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
- }, "Small ghost button"), /*#__PURE__*/React.createElement(Button, {
64
+ onClick: action("clicked"),
65
+ children: "Small ghost button"
66
+ }), /*#__PURE__*/_jsx(Button, {
65
67
  variant: "ghost",
66
- onClick: action("clicked")
67
- }, "Regular ghost button"), /*#__PURE__*/React.createElement(Button, {
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
- }, "Large ghost button"));
72
- };
73
+ onClick: action("clicked"),
74
+ children: "Large ghost button"
75
+ })]
76
+ });
73
77
  ghost.storyName = "Ghost style";
74
- export var fullWidth = function fullWidth() {
75
- return /*#__PURE__*/React.createElement(Button, {
76
- fullWidth: true
77
- }, "Full width button");
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 var disabled = function disabled() {
81
- return /*#__PURE__*/React.createElement(Spacer, {
82
- my: "r"
83
- }, /*#__PURE__*/React.createElement(Button, {
84
- disabled: true
85
- }, "Disabled button"), /*#__PURE__*/React.createElement(Button, {
86
- variant: "disabled"
87
- }, "Alternate way of making button disabled"));
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 var loading = function loading() {
91
- return /*#__PURE__*/React.createElement(Spacer, {
92
- my: "3"
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
- variant: "success"
98
- }, "Saving..."), /*#__PURE__*/React.createElement(Button, {
98
+ children: "Loading..."
99
+ }), /*#__PURE__*/_jsx(Button, {
99
100
  isLoading: true,
100
- variant: "danger"
101
- }, "Deleting..."));
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 var withIcon = function withIcon() {
105
- return /*#__PURE__*/React.createElement(Spacer, {
106
- my: "3"
107
- }, /*#__PURE__*/React.createElement(Button, {
108
- iconLeft: true
109
- }, /*#__PURE__*/React.createElement(Icon, {
110
- icon: ["fas", "user-plus"]
111
- }), "Left aligned icon"), /*#__PURE__*/React.createElement(Button, {
112
- iconRight: true
113
- }, "Right aligned icon", /*#__PURE__*/React.createElement(Icon, {
114
- icon: ["fas", "download"]
115
- })), /*#__PURE__*/React.createElement(Button, {
116
- leftIcon: ["fas", "star"]
117
- }, "Left icon magic!"));
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 var iconOnly = function iconOnly() {
121
- return /*#__PURE__*/React.createElement(Spacer, {
122
- my: "3"
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__*/React.createElement(Icon, {
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__*/React.createElement(Icon, {
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
- }, /*#__PURE__*/React.createElement(Icon, {
137
- icon: ["far", "calendar-alt"]
138
- })), /*#__PURE__*/React.createElement(Button, {
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
- }, /*#__PURE__*/React.createElement(Icon, {
144
- icon: ["far", "calendar-alt"]
145
- })), /*#__PURE__*/React.createElement(Flex, {
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
- }, /*#__PURE__*/React.createElement(Spacer, {
149
- mr: "r"
150
- }, /*#__PURE__*/React.createElement(Button, {
151
- iconOnly: true,
152
- variant: "success",
153
- onClick: action("clicked"),
154
- width: "33px",
155
- height: "32px",
156
- ariaLabel: "Confirm"
157
- }, /*#__PURE__*/React.createElement(Icon, {
158
- icon: ["fas", "check"]
159
- })), /*#__PURE__*/React.createElement(Button, {
160
- iconOnly: true,
161
- variant: "successAlternate",
162
- onClick: action("clicked"),
163
- width: "33px",
164
- height: "32px",
165
- ariaLabel: "Confirm"
166
- }, /*#__PURE__*/React.createElement(Icon, {
167
- icon: ["fas", "check"]
168
- })), /*#__PURE__*/React.createElement(Button, {
169
- iconOnly: true,
170
- variant: "danger",
171
- onClick: action("clicked"),
172
- width: "33px",
173
- height: "32px",
174
- ariaLabel: "Cancel"
175
- }, /*#__PURE__*/React.createElement(Icon, {
176
- icon: ["fas", "times"]
177
- })), /*#__PURE__*/React.createElement(Button, {
178
- iconOnly: true,
179
- variant: "dangerAlternate",
180
- onClick: action("clicked"),
181
- width: "33px",
182
- height: "32px",
183
- ariaLabel: "Cancel"
184
- }, /*#__PURE__*/React.createElement(Icon, {
185
- icon: ["fas", "times"]
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": "",