@pingux/astro 2.131.0 → 2.132.0-alpha.0

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 (65) hide show
  1. package/lib/cjs/components/RockerButton/RockerButton.js +1 -0
  2. package/lib/cjs/components/RockerButton/RockerButton.styles.d.ts +9 -0
  3. package/lib/cjs/components/RockerButton/RockerButton.styles.js +11 -2
  4. package/lib/cjs/components/RockerButtonGroup/stories/NextGenDarkRockerButtonGroup.chromatic.stories.js +2 -2
  5. package/lib/cjs/components/RockerButtonGroup/stories/NextGenRockerButtonGroup.chromatic.stories.js +2 -2
  6. package/lib/cjs/components/RockerButtonGroup/stories/RockerButtonGroup.chromatic.stories.js +2 -12
  7. package/lib/cjs/components/RockerButtonGroup/stories/RockerButtonGroupNextGen.d.ts +3 -0
  8. package/lib/cjs/components/RockerButtonGroup/stories/RockerButtonGroupNextGen.js +25 -0
  9. package/lib/cjs/components/StatusIcon/StatusIcon.d.ts +15 -0
  10. package/lib/cjs/components/StatusIcon/StatusIcon.js +41 -0
  11. package/lib/cjs/components/StatusIcon/StatusIcon.mdx +19 -0
  12. package/lib/cjs/components/StatusIcon/StatusIcon.stories.d.ts +5 -0
  13. package/lib/cjs/components/StatusIcon/StatusIcon.stories.js +198 -0
  14. package/lib/cjs/components/StatusIcon/StatusIcon.styles.d.ts +75 -0
  15. package/lib/cjs/components/StatusIcon/StatusIcon.styles.js +83 -0
  16. package/lib/cjs/components/StatusIcon/StatusIcon.test.d.ts +1 -0
  17. package/lib/cjs/components/StatusIcon/StatusIcon.test.js +30 -0
  18. package/lib/cjs/components/StatusIcon/index.d.ts +1 -0
  19. package/lib/cjs/components/StatusIcon/index.js +14 -0
  20. package/lib/cjs/components/StatusIcon/stories/NextGenDarkStatusIcon.chromatic.stories.d.ts +6 -0
  21. package/lib/cjs/components/StatusIcon/stories/NextGenDarkStatusIcon.chromatic.stories.js +22 -0
  22. package/lib/cjs/components/StatusIcon/stories/NextGenStatusIcon.chromatic.stories.d.ts +6 -0
  23. package/lib/cjs/components/StatusIcon/stories/NextGenStatusIcon.chromatic.stories.js +22 -0
  24. package/lib/cjs/components/StatusIcon/stories/NextGenStatusIcon.d.ts +3 -0
  25. package/lib/cjs/components/StatusIcon/stories/NextGenStatusIcon.js +98 -0
  26. package/lib/cjs/index.d.ts +2 -0
  27. package/lib/cjs/index.js +40 -21
  28. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +73 -12
  29. package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +76 -14
  30. package/lib/cjs/styles/themes/astro/customProperties/icons.js +13 -2
  31. package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +1 -0
  32. package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +3 -2
  33. package/lib/cjs/styles/themes/next-gen/customProperties/icons.js +10 -2
  34. package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +104 -36
  35. package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +104 -36
  36. package/lib/cjs/styles/themes/next-gen/variants/variants.js +109 -39
  37. package/lib/cjs/styles/variants/variants.js +2 -0
  38. package/lib/cjs/utils/designUtils/figmaLinks.d.ts +4 -0
  39. package/lib/cjs/utils/designUtils/figmaLinks.js +4 -0
  40. package/lib/cjs/utils/devUtils/constants/statuses.js +14 -2
  41. package/lib/components/RockerButton/RockerButton.js +1 -0
  42. package/lib/components/RockerButton/RockerButton.styles.js +11 -2
  43. package/lib/components/RockerButtonGroup/stories/NextGenDarkRockerButtonGroup.chromatic.stories.js +1 -1
  44. package/lib/components/RockerButtonGroup/stories/NextGenRockerButtonGroup.chromatic.stories.js +1 -1
  45. package/lib/components/RockerButtonGroup/stories/RockerButtonGroup.chromatic.stories.js +2 -12
  46. package/lib/components/RockerButtonGroup/stories/RockerButtonGroupNextGen.js +16 -0
  47. package/lib/components/StatusIcon/StatusIcon.js +32 -0
  48. package/lib/components/StatusIcon/StatusIcon.mdx +19 -0
  49. package/lib/components/StatusIcon/StatusIcon.stories.js +187 -0
  50. package/lib/components/StatusIcon/StatusIcon.styles.js +75 -0
  51. package/lib/components/StatusIcon/StatusIcon.test.js +27 -0
  52. package/lib/components/StatusIcon/index.js +1 -0
  53. package/lib/components/StatusIcon/stories/NextGenDarkStatusIcon.chromatic.stories.js +12 -0
  54. package/lib/components/StatusIcon/stories/NextGenStatusIcon.chromatic.stories.js +12 -0
  55. package/lib/components/StatusIcon/stories/NextGenStatusIcon.js +89 -0
  56. package/lib/index.js +2 -0
  57. package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +76 -14
  58. package/lib/styles/themes/astro/customProperties/icons.js +8 -2
  59. package/lib/styles/themes/next-gen/convertedComponentList.js +3 -2
  60. package/lib/styles/themes/next-gen/customProperties/icons.js +5 -2
  61. package/lib/styles/themes/next-gen/variants/variants.js +105 -39
  62. package/lib/styles/variants/variants.js +2 -0
  63. package/lib/utils/designUtils/figmaLinks.js +4 -0
  64. package/lib/utils/devUtils/constants/statuses.js +13 -2
  65. package/package.json +1 -1
@@ -23,7 +23,8 @@ var innerContainer = {
23
23
  };
24
24
  var thumbSwitch = _objectSpread(_objectSpread({}, base), {}, {
25
25
  border: '0',
26
- display: 'inline-flex',
26
+ display: 'flex',
27
+ gap: 'sm',
27
28
  height: '26px',
28
29
  lineHeight: '26px',
29
30
  fontSize: '13px',
@@ -37,7 +38,15 @@ var thumbSwitch = _objectSpread(_objectSpread({}, base), {}, {
37
38
  '&.is-selected': {
38
39
  bg: 'accent.20',
39
40
  color: 'white',
40
- zIndex: '1'
41
+ zIndex: '1',
42
+ '& > div.status-icon': {
43
+ bg: 'white',
44
+ '& > svg': {
45
+ path: {
46
+ fill: 'accent.30'
47
+ }
48
+ }
49
+ }
41
50
  },
42
51
  '&.is-focused': _objectSpread({}, defaultFocus),
43
52
  '&.is-hovered': {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AstroProvider, NextGenDarkTheme } from '../../..';
3
- import { Default as RockerButtonGroupNextGen } from './RockerButtonGroup.chromatic.stories';
3
+ import RockerButtonGroupNextGen from './RockerButtonGroupNextGen';
4
4
  import { jsx as ___EmotionJSX } from "@emotion/react";
5
5
  export default {
6
6
  title: 'Chromatic Only Onyx Dark RockerButtonGroup'
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AstroProvider, NextGenTheme } from '../../..';
3
- import { Default as RockerButtonGroupNextGen } from './RockerButtonGroup.chromatic.stories';
3
+ import RockerButtonGroupNextGen from './RockerButtonGroupNextGen';
4
4
  import { jsx as ___EmotionJSX } from "@emotion/react";
5
5
  export default {
6
6
  title: 'Chromatic Only Onyx RockerButtonGroup'
@@ -1,21 +1,11 @@
1
1
  import React from 'react';
2
- import { RockerButton, RockerButtonGroup } from '../../../index';
3
2
  import WithUiLibraryCss from '../../../styles/themeOverrides/withUiLibraryCss';
3
+ import RockerButtonGroupNextGen from './RockerButtonGroupNextGen';
4
4
  import { jsx as ___EmotionJSX } from "@emotion/react";
5
5
  export default {
6
6
  title: 'Chromatic Only RockerButtonGroup',
7
- component: RockerButtonGroup,
8
7
  decorators: [WithUiLibraryCss]
9
8
  };
10
9
  export var Default = function Default() {
11
- return ___EmotionJSX(RockerButtonGroup, null, ___EmotionJSX(RockerButton, {
12
- name: "and",
13
- key: "and"
14
- }, "And"), ___EmotionJSX(RockerButton, {
15
- name: "or",
16
- key: "or"
17
- }, "Or"), ___EmotionJSX(RockerButton, {
18
- name: "maybe",
19
- key: "maybe"
20
- }, "Maybe"));
10
+ return ___EmotionJSX(RockerButtonGroupNextGen, null);
21
11
  };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { RockerButton, RockerButtonGroup } from '../../../index';
3
+ import { jsx as ___EmotionJSX } from "@emotion/react";
4
+ var RockerButtonGroupNextGen = function RockerButtonGroupNextGen() {
5
+ return ___EmotionJSX(RockerButtonGroup, null, ___EmotionJSX(RockerButton, {
6
+ name: "and",
7
+ key: "and"
8
+ }, "And"), ___EmotionJSX(RockerButton, {
9
+ name: "or",
10
+ key: "or"
11
+ }, "Or"), ___EmotionJSX(RockerButton, {
12
+ name: "maybe",
13
+ key: "maybe"
14
+ }, "Maybe"));
15
+ };
16
+ export default RockerButtonGroupNextGen;
@@ -0,0 +1,32 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
3
+ import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
4
+ var _excluded = ["status", "className", "isSelected", "iconProps"];
5
+ import React from 'react';
6
+ import { Box, Icon } from '../..';
7
+ import { useGetTheme, useStatusClasses } from '../../hooks';
8
+ import { jsx as ___EmotionJSX } from "@emotion/react";
9
+ var StatusIcon = function StatusIcon(props) {
10
+ var _useStatusClasses2;
11
+ var _props$status = props.status,
12
+ status = _props$status === void 0 ? 'default' : _props$status,
13
+ className = props.className,
14
+ isSelected = props.isSelected,
15
+ iconProps = props.iconProps,
16
+ others = _objectWithoutProperties(props, _excluded);
17
+ var _useGetTheme = useGetTheme(),
18
+ icons = _useGetTheme.icons;
19
+ var _useStatusClasses = useStatusClasses(className, (_useStatusClasses2 = {
20
+ 'status-icon': true
21
+ }, _defineProperty(_useStatusClasses2, "is-".concat(status), true), _defineProperty(_useStatusClasses2, 'is-selected', isSelected), _useStatusClasses2)),
22
+ classNames = _useStatusClasses.classNames;
23
+ return ___EmotionJSX(Box, _extends({
24
+ variant: "statusIcon.base",
25
+ className: classNames
26
+ }, others), ___EmotionJSX(Icon, _extends({
27
+ icon: icons[status],
28
+ "data-testid": "status-icon-".concat(status)
29
+ }, iconProps)));
30
+ };
31
+ StatusIcon.displayName = 'StatusIcon';
32
+ export default StatusIcon;
@@ -0,0 +1,19 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="Components/StatusIcon" />
4
+
5
+ # StatusIcon
6
+
7
+ StatusIcon are small images that represent status of an item, often providing visual feedback to users.
8
+
9
+ Import icons from the [Material UI Icon Library](https://materialdesignicons.com/)
10
+
11
+ It is built on top of the [Box from Theme-UI](https://theme-ui.com/components/box/) and uses the available [props from Theme-UI](https://theme-ui.com/sx-prop).
12
+
13
+ ### Required Components
14
+
15
+ This component can be used independently and does not require additional components.
16
+
17
+ #### Screen Readers
18
+
19
+ If the icon has a title associated with it, the **`aria-labelledby`** attribute is used to provide the label ID.
@@ -0,0 +1,187 @@
1
+ import _objectDestructuringEmpty from "@babel/runtime-corejs3/helpers/esm/objectDestructuringEmpty";
2
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
+ import React from 'react';
4
+ import { withDesign } from 'storybook-addon-designs';
5
+ import DocsLayout from '../../../.storybook/storybookDocsLayout';
6
+ import { Box, RockerButton, RockerButtonGroup, StatusIcon, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../..';
7
+ import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
8
+ import { statusIcon } from '../../utils/devUtils/constants/statuses';
9
+ import StatusIconReadme from './StatusIcon.mdx';
10
+ import { jsx as ___EmotionJSX } from "@emotion/react";
11
+ export default {
12
+ title: 'Components/StatusIcon',
13
+ component: StatusIcon,
14
+ decorators: [withDesign],
15
+ parameters: {
16
+ docs: {
17
+ page: function page() {
18
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(StatusIconReadme, null), ___EmotionJSX(DocsLayout, null));
19
+ }
20
+ },
21
+ codesandbox: {
22
+ mapComponent: {
23
+ '@pingux/astro': ['RockerButton', 'RockerButtonGroup', 'StatusIcon', 'Table', 'TableBody', 'TableCell', 'TableRow', 'Text']
24
+ }
25
+ }
26
+ }
27
+ };
28
+ var sx = {
29
+ tableHead: {
30
+ justifyContent: 'center'
31
+ },
32
+ tableCell: {
33
+ alignItems: 'center'
34
+ }
35
+ };
36
+ export var Default = function Default(_ref) {
37
+ var args = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
38
+ return ___EmotionJSX(Table, {
39
+ width: "500px"
40
+ }, ___EmotionJSX(TableHead, null, ___EmotionJSX(TableRow, {
41
+ key: "head"
42
+ }, ___EmotionJSX(TableCell, {
43
+ isHeading: true
44
+ }), ___EmotionJSX(TableCell, {
45
+ isHeading: true,
46
+ sx: sx.tableHead
47
+ }, ___EmotionJSX(Text, null, "Normal")), ___EmotionJSX(TableCell, {
48
+ isHeading: true,
49
+ sx: sx.tableHead
50
+ }, ___EmotionJSX(Box, null, ___EmotionJSX(Text, null, "Selected"), ___EmotionJSX(Text, null, "(in button)"))))), ___EmotionJSX(TableBody, {
51
+ sx: {
52
+ border: 'unset'
53
+ }
54
+ }, ___EmotionJSX(TableRow, {
55
+ sx: {
56
+ borderBottom: 'none !important'
57
+ }
58
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Critical")), ___EmotionJSX(TableCell, {
59
+ sx: sx.tableCell
60
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
61
+ status: statusIcon.CRITICAL
62
+ }))), ___EmotionJSX(TableCell, {
63
+ sx: sx.tableCell
64
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
65
+ status: statusIcon.CRITICAL,
66
+ isSelected: true
67
+ }))))), ___EmotionJSX(TableRow, {
68
+ sx: {
69
+ borderBottom: 'none !important'
70
+ }
71
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Major")), ___EmotionJSX(TableCell, {
72
+ sx: sx.tableCell
73
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
74
+ status: statusIcon.MAJOR
75
+ }))), ___EmotionJSX(TableCell, {
76
+ sx: sx.tableCell
77
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
78
+ status: statusIcon.MAJOR,
79
+ isSelected: true
80
+ }))))), ___EmotionJSX(TableRow, {
81
+ sx: {
82
+ borderBottom: 'none !important'
83
+ }
84
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Minor")), ___EmotionJSX(TableCell, {
85
+ sx: sx.tableCell
86
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
87
+ status: statusIcon.MINOR
88
+ }))), ___EmotionJSX(TableCell, {
89
+ sx: sx.tableCell
90
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
91
+ status: statusIcon.MINOR,
92
+ isSelected: true
93
+ }))))), ___EmotionJSX(TableRow, {
94
+ sx: {
95
+ borderBottom: 'none !important'
96
+ }
97
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Warning Neutral")), ___EmotionJSX(TableCell, {
98
+ sx: sx.tableCell
99
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
100
+ status: statusIcon.WARNING_NEUTRAL
101
+ }))), ___EmotionJSX(TableCell, {
102
+ sx: sx.tableCell
103
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
104
+ status: statusIcon.WARNING_NEUTRAL,
105
+ isSelected: true
106
+ }))))), ___EmotionJSX(TableRow, {
107
+ sx: {
108
+ borderBottom: 'none !important'
109
+ }
110
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Info")), ___EmotionJSX(TableCell, {
111
+ sx: sx.tableCell
112
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
113
+ status: statusIcon.INFO
114
+ }))), ___EmotionJSX(TableCell, {
115
+ sx: sx.tableCell
116
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
117
+ status: statusIcon.INFO,
118
+ isSelected: true
119
+ }))))), ___EmotionJSX(TableRow, {
120
+ sx: {
121
+ borderBottom: 'none !important'
122
+ }
123
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Warning")), ___EmotionJSX(TableCell, {
124
+ sx: sx.tableCell
125
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
126
+ status: statusIcon.WARNING
127
+ }))), ___EmotionJSX(TableCell, {
128
+ sx: sx.tableCell
129
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
130
+ status: statusIcon.WARNING,
131
+ isSelected: true
132
+ }))))), ___EmotionJSX(TableRow, {
133
+ sx: {
134
+ borderBottom: 'none !important'
135
+ }
136
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Fatal")), ___EmotionJSX(TableCell, {
137
+ sx: sx.tableCell
138
+ }, ___EmotionJSX(StatusIcon, _extends({}, args, {
139
+ status: statusIcon.FATAL
140
+ }))), ___EmotionJSX(TableCell, {
141
+ sx: sx.tableCell
142
+ }, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, _extends({}, args, {
143
+ status: statusIcon.FATAL,
144
+ isSelected: true
145
+ })))))));
146
+ };
147
+ Default.parameters = {
148
+ design: {
149
+ type: 'figma',
150
+ url: FIGMA_LINKS.statusIcon.onyx
151
+ }
152
+ };
153
+ export var InRockerButton = function InRockerButton(_ref2) {
154
+ var args = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
155
+ return ___EmotionJSX(RockerButtonGroup, _extends({}, args, {
156
+ defaultSelectedKeys: ['all']
157
+ }), ___EmotionJSX(RockerButton, {
158
+ name: "all",
159
+ key: "all"
160
+ }, "Show All"), ___EmotionJSX(RockerButton, {
161
+ name: "critical",
162
+ key: "critical"
163
+ }, ___EmotionJSX(StatusIcon, {
164
+ status: statusIcon.CRITICAL
165
+ }), "0 Criticals"), ___EmotionJSX(RockerButton, {
166
+ name: "major",
167
+ key: "major"
168
+ }, ___EmotionJSX(StatusIcon, {
169
+ status: statusIcon.MAJOR
170
+ }), "0 Majors"), ___EmotionJSX(RockerButton, {
171
+ name: "minor",
172
+ key: "minor"
173
+ }, ___EmotionJSX(StatusIcon, {
174
+ status: statusIcon.MINOR
175
+ }), "0 Minors"), ___EmotionJSX(RockerButton, {
176
+ name: "warning",
177
+ key: "warning"
178
+ }, ___EmotionJSX(StatusIcon, {
179
+ status: statusIcon.WARNING
180
+ }), "0 Warnings"));
181
+ };
182
+ InRockerButton.parameters = {
183
+ design: {
184
+ type: 'figma',
185
+ url: FIGMA_LINKS.statusIcon.inRockerButton
186
+ }
187
+ };
@@ -0,0 +1,75 @@
1
+ var base = {
2
+ width: '20px',
3
+ height: '20px',
4
+ minWidth: '20px',
5
+ minHeight: '20px',
6
+ alignItems: 'center',
7
+ justifyContent: 'center',
8
+ borderRadius: '50%',
9
+ p: '0',
10
+ '& > svg': {
11
+ width: '16px',
12
+ height: '16px',
13
+ minWidth: '16px',
14
+ minHeight: '16px'
15
+ },
16
+ '&.is-default': {
17
+ bg: 'neutral.90',
18
+ path: {
19
+ fill: 'text.primary'
20
+ }
21
+ },
22
+ '&.is-critical': {
23
+ bg: 'critical.light',
24
+ path: {
25
+ fill: 'critical.bright'
26
+ }
27
+ },
28
+ '&.is-warning': {
29
+ bg: 'warning.light',
30
+ path: {
31
+ fill: 'warning.bright'
32
+ }
33
+ },
34
+ '&.is-info': {
35
+ bg: 'accent.95',
36
+ path: {
37
+ fill: 'active'
38
+ }
39
+ },
40
+ '&.is-major': {
41
+ bg: 'critical.light',
42
+ path: {
43
+ fill: 'critical.bright'
44
+ }
45
+ },
46
+ '&.is-minor': {
47
+ bg: 'warning.light',
48
+ path: {
49
+ fill: 'warning.bright'
50
+ }
51
+ },
52
+ '&.is-warning-neutral': {
53
+ bg: 'neutral.90',
54
+ path: {
55
+ fill: 'text.secondary'
56
+ }
57
+ },
58
+ '&.is-fatal': {
59
+ bg: 'neutral.10',
60
+ path: {
61
+ fill: 'white'
62
+ }
63
+ },
64
+ '&.is-selected.is-selected': {
65
+ bg: 'white',
66
+ '& > svg': {
67
+ path: {
68
+ fill: 'accent.30'
69
+ }
70
+ }
71
+ }
72
+ };
73
+ export default {
74
+ base: base
75
+ };
@@ -0,0 +1,27 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
2
+ import React from 'react';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { statusIcon } from '../../utils/devUtils/constants/statuses';
5
+ import StatusIcon from './StatusIcon';
6
+ import { jsx as ___EmotionJSX } from "@emotion/react";
7
+ var testId = 'test-icon';
8
+ var defaultProps = {
9
+ 'data-testid': testId
10
+ };
11
+ var getComponent = function getComponent() {
12
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
13
+ return render(___EmotionJSX(StatusIcon, _extends({}, defaultProps, props)));
14
+ };
15
+ describe('StatusIcon', function () {
16
+ test('renders', function () {
17
+ getComponent();
18
+ screen.getByTestId(testId);
19
+ });
20
+ test.each([[statusIcon.DEFAULT, 'default'], [statusIcon.CRITICAL, 'critical'], [statusIcon.MAJOR, 'major'], [statusIcon.MINOR, 'minor'], [statusIcon.WARNING, 'warning'], [statusIcon.INFO, 'info'], [statusIcon.WARNING_NEUTRAL, 'warningNeutral'], [statusIcon.FATAL, 'fatal']])('when given status %s it renders icon with %s', function (status, icon) {
21
+ getComponent({
22
+ status: status,
23
+ 'data-testid': icon
24
+ });
25
+ screen.getByTestId(icon);
26
+ });
27
+ });
@@ -0,0 +1 @@
1
+ export { default } from './StatusIcon';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AstroProvider, NextGenDarkTheme } from '../../..';
3
+ import NextGenStatusIcon from './NextGenStatusIcon';
4
+ import { jsx as ___EmotionJSX } from "@emotion/react";
5
+ export default {
6
+ title: 'Chromatic Only Onyx Dark StatusIcon'
7
+ };
8
+ export var Default = function Default() {
9
+ return ___EmotionJSX(AstroProvider, {
10
+ themeOverrides: [NextGenDarkTheme]
11
+ }, ___EmotionJSX(NextGenStatusIcon, null));
12
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { AstroProvider, NextGenTheme } from '../../..';
3
+ import NextGenStatusIcon from './NextGenStatusIcon';
4
+ import { jsx as ___EmotionJSX } from "@emotion/react";
5
+ export default {
6
+ title: 'Chromatic Only Onyx StatusIcon'
7
+ };
8
+ export var Default = function Default() {
9
+ return ___EmotionJSX(AstroProvider, {
10
+ themeOverrides: [NextGenTheme]
11
+ }, ___EmotionJSX(NextGenStatusIcon, null));
12
+ };
@@ -0,0 +1,89 @@
1
+ import React from 'react';
2
+ import { StatusIcon, Table, TableBody, TableCell, TableRow, Text } from '../../..';
3
+ import { statusIcon } from '../../../utils/devUtils/constants/statuses';
4
+ import { jsx as ___EmotionJSX } from "@emotion/react";
5
+ var NextGenStatusIcon = function NextGenStatusIcon() {
6
+ return ___EmotionJSX(Table, null, ___EmotionJSX(TableBody, {
7
+ sx: {
8
+ border: 'unset'
9
+ }
10
+ }, ___EmotionJSX(TableRow, {
11
+ height: "45px",
12
+ bg: "transparent !important",
13
+ sx: {
14
+ borderBottom: 'none !important'
15
+ }
16
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Critical")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
17
+ status: statusIcon.CRITICAL
18
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
19
+ status: statusIcon.CRITICAL,
20
+ isSelected: true
21
+ })))), ___EmotionJSX(TableRow, {
22
+ height: "45px",
23
+ bg: "transparent !important",
24
+ sx: {
25
+ borderBottom: 'none !important'
26
+ }
27
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Major")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
28
+ status: statusIcon.MAJOR
29
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
30
+ status: statusIcon.MAJOR,
31
+ isSelected: true
32
+ })))), ___EmotionJSX(TableRow, {
33
+ height: "45px",
34
+ bg: "transparent !important",
35
+ sx: {
36
+ borderBottom: 'none !important'
37
+ }
38
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Minor")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
39
+ status: statusIcon.MINOR
40
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
41
+ status: statusIcon.MINOR,
42
+ isSelected: true
43
+ })))), ___EmotionJSX(TableRow, {
44
+ height: "45px",
45
+ bg: "transparent !important",
46
+ sx: {
47
+ borderBottom: 'none !important'
48
+ }
49
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Warning Neutral")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
50
+ status: statusIcon.WARNING_NEUTRAL
51
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
52
+ status: statusIcon.WARNING_NEUTRAL,
53
+ isSelected: true
54
+ })))), ___EmotionJSX(TableRow, {
55
+ height: "45px",
56
+ bg: "transparent !important",
57
+ sx: {
58
+ borderBottom: 'none !important'
59
+ }
60
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Info")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
61
+ status: statusIcon.INFO
62
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
63
+ status: statusIcon.INFO,
64
+ isSelected: true
65
+ })))), ___EmotionJSX(TableRow, {
66
+ height: "45px",
67
+ bg: "transparent !important",
68
+ sx: {
69
+ borderBottom: 'none !important'
70
+ }
71
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Warning")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
72
+ status: statusIcon.WARNING
73
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
74
+ status: statusIcon.WARNING,
75
+ isSelected: true
76
+ })))), ___EmotionJSX(TableRow, {
77
+ height: "45px",
78
+ bg: "transparent !important",
79
+ sx: {
80
+ borderBottom: 'none !important'
81
+ }
82
+ }, ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, "Fatal")), ___EmotionJSX(TableCell, null, ___EmotionJSX(StatusIcon, {
83
+ status: statusIcon.FATAL
84
+ })), ___EmotionJSX(TableCell, null, ___EmotionJSX(Text, null, ___EmotionJSX(StatusIcon, {
85
+ status: statusIcon.FATAL,
86
+ isSelected: true
87
+ }))))));
88
+ };
89
+ export default NextGenStatusIcon;
package/lib/index.js CHANGED
@@ -179,6 +179,8 @@ export * from './components/Separator';
179
179
  export { default as Skeleton } from './components/Skeleton';
180
180
  export * from './components/Skeleton';
181
181
  export { default as SliderField } from './components/SliderField/SliderField';
182
+ export { default as StatusIcon } from './components/StatusIcon';
183
+ export * from './components/StatusIcon';
182
184
  export { Step, default as Stepper } from './components/Stepper';
183
185
  export * from './components/Stepper';
184
186
  export { default as Switch } from './components/Switch';
@@ -58,21 +58,22 @@ var modal = {
58
58
  };
59
59
  var rockerButton = {
60
60
  innerContainer: {
61
- border: 0,
62
- boxShadow: 'none',
63
- backgroundColor: 'gray-900',
64
- 'button': {
65
- backgroundColor: 'gray-900',
66
- color: 'blue-400',
67
- '&.is-selected': {
68
- color: 'black'
69
- },
70
- '&.is-hovered': {
71
- color: 'black'
72
- },
73
- '&.is-pressed': {
74
- color: 'black'
61
+ backgroundColor: 'background.base'
62
+ },
63
+ thumbSwitch: {
64
+ backgroundColor: 'background.base',
65
+ color: 'blue-400',
66
+ '&.is-selected': {
67
+ color: 'black',
68
+ '& > div.status-icon': {
69
+ bg: 'black'
75
70
  }
71
+ },
72
+ '&.is-hovered': {
73
+ color: 'black'
74
+ },
75
+ '&.is-pressed': {
76
+ color: 'black'
76
77
  }
77
78
  }
78
79
  };
@@ -87,6 +88,66 @@ var tooltip = {
87
88
  color: 'blue-400'
88
89
  }
89
90
  };
91
+ var statusIcon = {
92
+ base: {
93
+ '&.is-default': {
94
+ bg: 'gray-100',
95
+ path: {
96
+ fill: 'black'
97
+ }
98
+ },
99
+ '&.is-critical': {
100
+ bg: 'red-500',
101
+ path: {
102
+ fill: 'black'
103
+ }
104
+ },
105
+ '&.is-warning': {
106
+ bg: 'yellow-500',
107
+ path: {
108
+ fill: 'black'
109
+ }
110
+ },
111
+ '&.is-info': {
112
+ bg: 'blue-500',
113
+ path: {
114
+ fill: 'black'
115
+ }
116
+ },
117
+ '&.is-major': {
118
+ bg: 'orange-500',
119
+ path: {
120
+ fill: 'black'
121
+ }
122
+ },
123
+ '&.is-minor': {
124
+ bg: 'yellow-500',
125
+ path: {
126
+ fill: 'black'
127
+ }
128
+ },
129
+ '&.is-warning-neutral': {
130
+ bg: 'gray-700',
131
+ path: {
132
+ fill: 'gray-100'
133
+ }
134
+ },
135
+ '&.is-fatal': {
136
+ bg: 'gray-100',
137
+ path: {
138
+ fill: 'gray-700'
139
+ }
140
+ },
141
+ '&.is-selected.is-selected': {
142
+ bg: 'black',
143
+ '& > svg': {
144
+ path: {
145
+ fill: 'active'
146
+ }
147
+ }
148
+ }
149
+ }
150
+ };
90
151
  export default {
91
152
  rockerButton: rockerButton,
92
153
  attachment: attachment,
@@ -141,6 +202,7 @@ export default {
141
202
  color: 'text.secondary'
142
203
  }
143
204
  },
205
+ statusIcon: statusIcon,
144
206
  fieldHelperText: {
145
207
  title: {
146
208
  '&.is-default': {