@onewelcome/react-lib-components 0.1.5-alpha → 0.1.8-alpha

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 (105) hide show
  1. package/dist/Button/IconButton.d.ts +2 -1
  2. package/dist/ContextMenu/ContextMenu.d.ts +2 -3
  3. package/dist/ContextMenu/ContextMenuItem.d.ts +10 -3
  4. package/dist/DataGrid/DataGrid.d.ts +30 -0
  5. package/dist/DataGrid/DataGridActions/DataGridActions.d.ts +14 -0
  6. package/dist/DataGrid/DataGridActions/DataGridColumnsToggle.d.ts +13 -0
  7. package/dist/DataGrid/DataGridBody/DataGridBody.d.ts +16 -0
  8. package/dist/DataGrid/DataGridBody/DataGridCell.d.ts +6 -0
  9. package/dist/DataGrid/DataGridBody/DataGridRow.d.ts +7 -0
  10. package/dist/DataGrid/DataGridHeader/DataGridHeader.d.ts +10 -0
  11. package/dist/DataGrid/DataGridHeader/DataGridHeaderCell.d.ts +10 -0
  12. package/dist/DataGrid/datagrid.interfaces.d.ts +13 -0
  13. package/dist/Form/Checkbox/Checkbox.d.ts +2 -2
  14. package/dist/Form/Select/Option.d.ts +9 -4
  15. package/dist/Form/Select/Select.d.ts +8 -2
  16. package/dist/Form/Toggle/Toggle.d.ts +1 -1
  17. package/dist/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +1 -1
  18. package/dist/Icon/Icon.d.ts +1 -0
  19. package/dist/Link/Link.d.ts +4 -3
  20. package/dist/Notifications/BaseModal/BaseModal.d.ts +4 -2
  21. package/dist/Notifications/SlideInModal/SlideInModal.d.ts +4 -0
  22. package/dist/StatusIndicator/StatusIndicator.d.ts +9 -0
  23. package/dist/_BaseStyling_/BaseStyling.d.ts +4 -0
  24. package/dist/hooks/useSpacing.d.ts +1 -1
  25. package/dist/hooks/useWrapper.d.ts +1 -1
  26. package/dist/index.d.ts +48 -43
  27. package/dist/react-lib-components.cjs.development.js +2900 -2049
  28. package/dist/react-lib-components.cjs.development.js.map +1 -1
  29. package/dist/react-lib-components.cjs.production.min.js +1 -1
  30. package/dist/react-lib-components.cjs.production.min.js.map +1 -1
  31. package/dist/react-lib-components.esm.js +2897 -2050
  32. package/dist/react-lib-components.esm.js.map +1 -1
  33. package/dist/util/helper.d.ts +1 -1
  34. package/package.json +11 -11
  35. package/src/Button/BaseButton.module.scss +3 -18
  36. package/src/Button/Button.module.scss +4 -311
  37. package/src/Button/IconButton.module.scss +21 -128
  38. package/src/Button/IconButton.test.tsx +24 -0
  39. package/src/Button/IconButton.tsx +6 -1
  40. package/src/ContextMenu/ContextMenu.test.tsx +121 -6
  41. package/src/ContextMenu/ContextMenu.tsx +99 -6
  42. package/src/ContextMenu/ContextMenuItem.tsx +57 -9
  43. package/src/DataGrid/DataGrid.module.scss +21 -0
  44. package/src/DataGrid/DataGrid.test.tsx +276 -0
  45. package/src/DataGrid/DataGrid.tsx +101 -0
  46. package/src/DataGrid/DataGridActions/DataGridActions.module.scss +35 -0
  47. package/src/DataGrid/DataGridActions/DataGridActions.test.tsx +184 -0
  48. package/src/DataGrid/DataGridActions/DataGridActions.tsx +109 -0
  49. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.module.scss +41 -0
  50. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.test.tsx +83 -0
  51. package/src/DataGrid/DataGridActions/DataGridColumnsToggle.tsx +88 -0
  52. package/src/DataGrid/DataGridBody/DataGridBody.module.scss +10 -0
  53. package/src/DataGrid/DataGridBody/DataGridBody.test.tsx +123 -0
  54. package/src/DataGrid/DataGridBody/DataGridBody.tsx +64 -0
  55. package/src/DataGrid/DataGridBody/DataGridCell.module.scss +33 -0
  56. package/src/DataGrid/DataGridBody/DataGridCell.test.tsx +74 -0
  57. package/src/DataGrid/DataGridBody/DataGridCell.tsx +25 -0
  58. package/src/DataGrid/DataGridBody/DataGridRow.module.scss +7 -0
  59. package/src/DataGrid/DataGridBody/DataGridRow.test.tsx +101 -0
  60. package/src/DataGrid/DataGridBody/DataGridRow.tsx +27 -0
  61. package/src/DataGrid/DataGridBody/__snapshots__/DataGridBody.test.tsx.snap +258 -0
  62. package/src/DataGrid/DataGridHeader/DataGridHeader.module.scss +26 -0
  63. package/src/DataGrid/DataGridHeader/DataGridHeader.test.tsx +255 -0
  64. package/src/DataGrid/DataGridHeader/DataGridHeader.tsx +80 -0
  65. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.module.scss +68 -0
  66. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.test.tsx +128 -0
  67. package/src/DataGrid/DataGridHeader/DataGridHeaderCell.tsx +72 -0
  68. package/src/DataGrid/datagrid.interfaces.ts +14 -0
  69. package/src/Form/Checkbox/Checkbox.test.tsx +144 -8
  70. package/src/Form/Checkbox/Checkbox.tsx +8 -8
  71. package/src/Form/Select/Option.tsx +39 -21
  72. package/src/Form/Select/Select.module.scss +1 -1
  73. package/src/Form/Select/Select.test.tsx +235 -56
  74. package/src/Form/Select/Select.tsx +194 -34
  75. package/src/Form/Toggle/Toggle.module.scss +1 -0
  76. package/src/Form/Toggle/Toggle.test.tsx +45 -19
  77. package/src/Form/Toggle/Toggle.tsx +3 -3
  78. package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +1 -1
  79. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +44 -0
  80. package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +4 -2
  81. package/src/Icon/Icon.module.scss +4 -0
  82. package/src/Icon/Icon.tsx +1 -0
  83. package/src/Link/Link.module.scss +20 -0
  84. package/src/Link/Link.test.tsx +33 -0
  85. package/src/Link/Link.tsx +8 -2
  86. package/src/Notifications/BaseModal/BaseModal.module.scss +1 -1
  87. package/src/Notifications/BaseModal/BaseModal.test.tsx +77 -12
  88. package/src/Notifications/BaseModal/BaseModal.tsx +27 -6
  89. package/src/Notifications/Dialog/Dialog.module.scss +1 -1
  90. package/src/Notifications/Dialog/Dialog.tsx +1 -1
  91. package/src/Notifications/SlideInModal/SlideInModal.module.scss +36 -0
  92. package/src/Notifications/SlideInModal/SlideInModal.test.tsx +69 -0
  93. package/src/Notifications/SlideInModal/SlideInModal.tsx +31 -0
  94. package/src/Notifications/Snackbar/SnackbarContainer/SnackbarContainer.module.scss +1 -1
  95. package/src/Notifications/Snackbar/SnackbarItem/SnackbarItem.module.scss +1 -1
  96. package/src/Pagination/Pagination.module.scss +74 -74
  97. package/src/StatusIndicator/StatusIndicator.module.scss +27 -0
  98. package/src/StatusIndicator/StatusIndicator.test.tsx +127 -0
  99. package/src/StatusIndicator/StatusIndicator.tsx +25 -0
  100. package/src/Tiles/Tile.module.scss +1 -1
  101. package/src/Tiles/Tile.test.tsx +4 -4
  102. package/src/_BaseStyling_/BaseStyling.tsx +14 -6
  103. package/src/index.ts +85 -48
  104. package/src/mixins.module.scss +171 -0
  105. package/src/readyclasses.module.scss +0 -30
@@ -0,0 +1,127 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { StatusIndicator, Props } from './StatusIndicator';
3
+ import { render } from '@testing-library/react';
4
+
5
+ const defaultParams: Props = {
6
+ status: 'active',
7
+ };
8
+
9
+ const createStatusIndicator = (params?: (defaultParams: Props) => Props) => {
10
+ let parameters: Props = defaultParams;
11
+ if (params) {
12
+ parameters = params(defaultParams);
13
+ }
14
+ const queries = render(
15
+ <StatusIndicator {...parameters} data-testid="StatusIndicator">
16
+ content
17
+ </StatusIndicator>
18
+ );
19
+ const statusIndicator = queries.getByTestId('StatusIndicator');
20
+
21
+ return {
22
+ ...queries,
23
+ statusIndicator,
24
+ };
25
+ };
26
+
27
+ describe('StatusIndicator should render', () => {
28
+ it('renders without crashing', () => {
29
+ const { statusIndicator, getByText } = createStatusIndicator();
30
+
31
+ expect(statusIndicator).toBeDefined();
32
+ expect(getByText('content')).toBeInTheDocument();
33
+ });
34
+
35
+ it('passes through custom typography props', () => {
36
+ const { statusIndicator, getByText } = createStatusIndicator((params) => ({
37
+ ...params,
38
+ typographyProps: {
39
+ variant: 'body',
40
+ children: <strong>custom children</strong>,
41
+ },
42
+ }));
43
+
44
+ expect(statusIndicator).toBeDefined();
45
+ expect(getByText('custom children')).toBeInTheDocument();
46
+ });
47
+
48
+ it('passes through custom props', () => {
49
+ const { statusIndicator } = createStatusIndicator((params) => ({
50
+ ...params,
51
+ 'aria-label': 'status indicator',
52
+ }));
53
+
54
+ expect(statusIndicator).toBeDefined();
55
+ expect(statusIndicator).toHaveAttribute('aria-label', 'status indicator');
56
+ });
57
+
58
+ it('should set "active" class on status badge', () => {
59
+ const { statusIndicator } = createStatusIndicator((params) => ({
60
+ ...params,
61
+ status: 'active',
62
+ }));
63
+
64
+ expect(statusIndicator.firstChild).toHaveClass('active');
65
+ });
66
+
67
+ it('should set "error" class on status badge', () => {
68
+ const { statusIndicator } = createStatusIndicator((params) => ({ ...params, status: 'error' }));
69
+
70
+ expect(statusIndicator.firstChild).toHaveClass('error');
71
+ });
72
+
73
+ it('should set "neutral" class on status badge', () => {
74
+ const { statusIndicator } = createStatusIndicator((params) => ({
75
+ ...params,
76
+ status: 'neutral',
77
+ }));
78
+
79
+ expect(statusIndicator.firstChild).toHaveClass('neutral');
80
+ });
81
+
82
+ it('should pass "warning" class to status badge', () => {
83
+ const { statusIndicator } = createStatusIndicator((params) => ({
84
+ ...params,
85
+ status: 'warning',
86
+ }));
87
+
88
+ expect(statusIndicator.firstChild).toHaveClass('warning');
89
+ });
90
+
91
+ it('should pass custom class to status badge', () => {
92
+ const { statusIndicator } = createStatusIndicator((params) => ({
93
+ ...params,
94
+ badgeProps: { className: 'custom' },
95
+ }));
96
+
97
+ expect(statusIndicator.firstChild).toHaveClass('custom');
98
+ });
99
+ });
100
+
101
+ describe('ref should work', () => {
102
+ it('should give back the proper data prop, this also checks if the component propagates ...rest properly', () => {
103
+ const ExampleComponent = ({
104
+ propagateRef,
105
+ }: {
106
+ propagateRef?: (ref: React.RefObject<HTMLElement>) => void;
107
+ }) => {
108
+ const ref = useRef(null);
109
+
110
+ useEffect(() => {
111
+ if (ref.current) {
112
+ propagateRef && propagateRef(ref);
113
+ }
114
+ }, [ref]);
115
+
116
+ return (
117
+ <StatusIndicator id="test" children="test" data-ref="testing" ref={ref} status="active" />
118
+ );
119
+ };
120
+
121
+ const refCheck = (ref: React.RefObject<HTMLElement>) => {
122
+ expect(ref.current).toHaveAttribute('data-ref', 'testing');
123
+ };
124
+
125
+ render(<ExampleComponent propagateRef={refCheck} />);
126
+ });
127
+ });
@@ -0,0 +1,25 @@
1
+ import React, { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { Typography, Props as TypographyProps } from '../Typography/Typography';
3
+ import classes from './StatusIndicator.module.scss';
4
+
5
+ export interface Props extends ComponentPropsWithRef<'div'> {
6
+ children?: ReactNode;
7
+ status: 'active' | 'error' | 'neutral' | 'warning';
8
+ badgeProps?: ComponentPropsWithRef<'div'>;
9
+ typographyProps?: TypographyProps;
10
+ }
11
+
12
+ export const StatusIndicator = React.forwardRef<HTMLDivElement, Props>(
13
+ ({ children, status, badgeProps, typographyProps, ...rest }: Props, ref) => {
14
+ return (
15
+ <div {...rest} className={classes['status-indicator']} ref={ref}>
16
+ <div
17
+ className={`${classes['status-badge']} ${classes[status]} ${badgeProps?.className ?? ''}`}
18
+ />
19
+ <Typography {...typographyProps} spacing={{ margin: '0' }} variant="body" tag="div">
20
+ {typographyProps?.children || children}
21
+ </Typography>
22
+ </div>
23
+ );
24
+ }
25
+ );
@@ -1,4 +1,4 @@
1
- @import '../readyclasses.module.scss';
1
+ @import '../mixins.module.scss';
2
2
 
3
3
  .tile {
4
4
  border: 1px solid #e9e9eb;
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
  import { Tile, Props } from './Tile';
3
- import { render, getByRole } from '@testing-library/react';
3
+ import { render } from '@testing-library/react';
4
4
  import { Icon, Icons } from '../Icon/Icon';
5
5
  import { ContextMenu } from '../ContextMenu/ContextMenu';
6
6
  import { IconButton } from '../Button/IconButton';
@@ -130,9 +130,9 @@ describe('contextmenu', () => {
130
130
  expect(popover).toHaveClass('show');
131
131
  expect(popover).toHaveStyle({ opacity: '1;' });
132
132
 
133
- userEvent.click(getByRole(menuitem1, 'button'));
134
- userEvent.click(getByRole(menuitem2, 'button'));
135
- userEvent.click(getByRole(menuitem3, 'button'));
133
+ userEvent.click(menuitem1);
134
+ userEvent.click(menuitem2);
135
+ userEvent.click(menuitem3);
136
136
 
137
137
  expect(contextMenuItemOnClick).toHaveBeenCalledTimes(3);
138
138
  });
@@ -26,6 +26,10 @@ interface CSSProperties {
26
26
  snackbarSuccessBackgroundColor?: string;
27
27
  snackbarErrorBackgroundColor?: string;
28
28
  snackbarBorderRadius?: string;
29
+ dataGridRowBackgroundColor?: string;
30
+ dataGridRowHoverBackgroundColor?: string;
31
+ cardBackgroundColor?: string;
32
+ cardBorderRadius?: string;
29
33
  tabsBackgroundColor?: string;
30
34
  tabBorderWidth?: string;
31
35
  tabBorderStyle?: string;
@@ -66,22 +70,26 @@ export const BaseStyling = ({ children, properties = {} }: Props) => {
66
70
  buttonBorderWidth: '2px',
67
71
  buttonFontSize: '1rem',
68
72
  buttonBorderStyle: 'solid',
69
- buttonFillTextColor: '#FFF',
70
- buttonFillBackgroundColor: '#FFF',
71
- buttonOutlineHoverTextColor: '#FFF',
73
+ buttonFillTextColor: '#fff',
74
+ buttonFillBackgroundColor: '#fff',
75
+ buttonOutlineHoverTextColor: '#fff',
72
76
  inputBorderColor: '#e9e9eb',
73
77
  inputBorderRadius: '8px',
74
78
  inputBorderWidth: '1px',
75
79
  inputBorderStyle: 'solid',
76
- inputBackgroundColor: '#FFF',
80
+ inputBackgroundColor: '#fff',
77
81
  modalShadowColor: 'rgba(0, 0, 0, 0.16)',
78
- modalBackgroundColor: '#F5F8F8',
79
- modalHeaderBackgroundColor: '#FFF',
82
+ modalBackgroundColor: '#f5f8f8',
83
+ modalHeaderBackgroundColor: '#fff',
80
84
  snackbarTextColor: '#fff',
81
85
  snackbarInfoBackgroundColor: '#003b5e',
82
86
  snackbarSuccessBackgroundColor: '#008a28',
83
87
  snackbarErrorBackgroundColor: '#e22a1d',
84
88
  snackbarBorderRadius: '8px',
89
+ dataGridRowBackgroundColor: 'transparent',
90
+ dataGridRowHoverBackgroundColor: '#f5e6f0',
91
+ cardBackgroundColor: '#fff',
92
+ cardBorderRadius: '8px',
85
93
  tabsBackgroundColor: '#FFF',
86
94
  tabBorderWidth: '2px',
87
95
  tabBorderStyle: 'solid',
package/src/index.ts CHANGED
@@ -1,9 +1,19 @@
1
- /** Components */
1
+ /* Components */
2
2
  export { BaseStyling } from './_BaseStyling_/BaseStyling';
3
- export { Typography } from './Typography/Typography';
4
- export { Button } from './Button/Button';
5
- export { Link } from './Link/Link';
6
- export { IconButton } from './Button/IconButton';
3
+ export { Button, Props as ButtonProps } from './Button/Button';
4
+ export { Breadcrumbs, Props as BreadcrumbsProps } from './Breadcrumbs/Breadcrumbs';
5
+ export { ContextMenu, Props as ContextMenuProps } from './ContextMenu/ContextMenu';
6
+ export { ContextMenuItem, Props as ContextMenuItemProps } from './ContextMenu/ContextMenuItem';
7
+ export { Link, Props as LinkProps, AnchorType } from './Link/Link';
8
+ export { Icon, Icons, Props as IconProps } from './Icon/Icon';
9
+ export { IconButton, Props as IconButtonProps } from './Button/IconButton';
10
+ export { Tab, Props as TabProps } from './Tabs/Tab';
11
+ export { Tabs, Props as TabsProps } from './Tabs/Tabs';
12
+ export { TextEllipsis, Props as TextEllipsisProps } from './TextEllipsis/TextEllipsis';
13
+ export { Tile, Props as TileProps } from './Tiles/Tile';
14
+ export { Tiles, Props as TilesProps } from './Tiles/Tiles';
15
+ export { Tooltip, Props as TooltipProps } from './Tooltip/Tooltip';
16
+ export { Typography, Variant, Props as TypographyProps } from './Typography/Typography';
7
17
  export {
8
18
  Pagination,
9
19
  Props as PaginationProps,
@@ -11,58 +21,85 @@ export {
11
21
  PaginationTranslations,
12
22
  PageSize,
13
23
  } from './Pagination/Pagination';
14
- export { Icon, Icons } from './Icon/Icon';
15
-
16
- export { Tabs, Props as TabsProps } from './Tabs/Tabs';
17
- export { Tab, Props as TabProps } from './Tabs/Tab';
18
-
19
- export { Dialog } from './Notifications/Dialog/Dialog';
20
- export { Modal } from './Notifications/Modal/Modal';
21
- export { ModalActions } from './Notifications/Modal/ModalActions/ModalActions';
22
- export { ModalContent } from './Notifications/Modal/ModalContent/ModalContent';
23
- export { ModalHeader } from './Notifications/Modal/ModalHeader/ModalHeader';
24
- export { DiscardChangesModal } from './Notifications/DiscardChangesModal/DiscardChangesModal';
25
- export { TextEllipsis, Props as TextEllipsisProps } from './TextEllipsis/TextEllipsis';
26
- export { Tooltip } from './Tooltip/Tooltip';
27
- export { Tiles } from './Tiles/Tiles';
28
- export { Tile } from './Tiles/Tile';
29
- export { ContextMenu } from './ContextMenu/ContextMenu';
30
- export { ContextMenuItem } from './ContextMenu/ContextMenuItem';
31
- export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs';
32
-
33
- export { SnackbarProvider } from './Notifications/Snackbar/SnackbarProvider/SnackbarProvider';
34
- export { useSnackbar } from './Notifications/Snackbar/useSnackbar';
35
24
 
25
+ /* Utils */
36
26
  export { useRepeater } from './hooks/useRepeater';
37
-
38
27
  export { generateID } from './util/helper';
39
28
 
29
+ /* Notifications */
30
+ export { Modal, Props as ModalProps } from './Notifications/Modal/Modal';
31
+ export { useSnackbar } from './Notifications/Snackbar/useSnackbar';
32
+ export {
33
+ Dialog,
34
+ Props as DialogProps,
35
+ Action as DialogAction,
36
+ } from './Notifications/Dialog/Dialog';
37
+ export {
38
+ DiscardChangesModal,
39
+ Props as DiscardChangesModalProps,
40
+ } from './Notifications/DiscardChangesModal/DiscardChangesModal';
41
+ export {
42
+ ModalActions,
43
+ Props as ModalActionsProps,
44
+ } from './Notifications/Modal/ModalActions/ModalActions';
45
+ export {
46
+ ModalContent,
47
+ Props as ModalContentProps,
48
+ } from './Notifications/Modal/ModalContent/ModalContent';
49
+ export {
50
+ ModalHeader,
51
+ Props as ModalHeaderProps,
52
+ } from './Notifications/Modal/ModalHeader/ModalHeader';
53
+ export {
54
+ SlideInModal,
55
+ Props as SlideInModalProps,
56
+ } from './Notifications/SlideInModal/SlideInModal';
57
+ export {
58
+ SnackbarProvider,
59
+ Props as SnackbarProviderProps,
60
+ } from './Notifications/Snackbar/SnackbarProvider/SnackbarProvider';
61
+
40
62
  /** Form components */
41
- export { Form } from './Form/Form';
42
- export { Fieldset } from './Form/Fieldset/Fieldset';
43
- export { FormControl } from './Form/FormControl/FormControl';
44
- export { FormGroup } from './Form/FormGroup/FormGroup';
45
- export { FormHelperText } from './Form/FormHelperText/FormHelperText';
46
- export { Label } from './Form/Label/Label';
47
- export { Select } from './Form/Select/Select';
48
- export { Option } from './Form/Select/Option';
49
- export { Textarea } from './Form/Textarea/Textarea';
50
- export { CheckboxWrapper } from './Form/Wrapper/CheckboxWrapper/CheckboxWrapper';
51
- export { InputWrapper } from './Form/Wrapper/InputWrapper/InputWrapper';
52
- export { RadioWrapper } from './Form/Wrapper/RadioWrapper/RadioWrapper';
53
- export { SelectWrapper } from './Form/Wrapper/SelectWrapper/SelectWrapper';
54
- export { TextareaWrapper } from './Form/Wrapper/TextareaWrapper/TextareaWrapper';
55
- export { Input } from './Form/Input/Input';
56
- export { Radio } from './Form/Radio/Radio';
57
- export { Checkbox } from './Form/Checkbox/Checkbox';
58
- export { Toggle } from './Form/Toggle/Toggle';
63
+ export { Checkbox, Props as CheckboxProps } from './Form/Checkbox/Checkbox';
64
+ export { Fieldset, Props as FieldsetProps } from './Form/Fieldset/Fieldset';
65
+ export { Form, Props as FormProps } from './Form/Form';
66
+ export { FormControl, Props as FormControlProps } from './Form/FormControl/FormControl';
67
+ export { FormGroup, Props as FormGroupProps } from './Form/FormGroup/FormGroup';
68
+ export { FormHelperText, Props as FormHelperTextProps } from './Form/FormHelperText/FormHelperText';
69
+ export { Input, Props as InputProps, Type as InputType } from './Form/Input/Input';
70
+ export { InputWrapper, Props as InputWrapperProps } from './Form/Wrapper/InputWrapper/InputWrapper';
71
+ export { Label, Props as LabelProps } from './Form/Label/Label';
72
+ export { Option, Props as OptionProps } from './Form/Select/Option';
73
+ export { Radio, Props as RadioProps } from './Form/Radio/Radio';
74
+ export { RadioWrapper, Props as RadioWrapperProps } from './Form/Wrapper/RadioWrapper/RadioWrapper';
75
+ export { Select, Props as SelectProps } from './Form/Select/Select';
76
+ export { Textarea, Props as TextareaProps } from './Form/Textarea/Textarea';
77
+ export { Toggle, Props as ToggleProps } from './Form/Toggle/Toggle';
78
+ export {
79
+ CheckboxWrapper,
80
+ Props as CheckboxWrapperProps,
81
+ } from './Form/Wrapper/CheckboxWrapper/CheckboxWrapper';
82
+ export {
83
+ TextareaWrapper,
84
+ Props as TextareaWrapperProps,
85
+ } from './Form/Wrapper/TextareaWrapper/TextareaWrapper';
86
+ export {
87
+ SelectWrapper,
88
+ Props as SelectWrapperProps,
89
+ } from './Form/Wrapper/SelectWrapper/SelectWrapper';
59
90
 
60
91
  /** Wizard */
92
+ export { Wizard, Props as WizardProps } from './Wizard/Wizard';
93
+ export { WizardActions, Props as WizardActionsProps } from './Wizard/WizardActions/WizardActions';
94
+ export { WizardSteps, Props as WizardStepsProps } from './Wizard/WizardSteps/WizardSteps';
61
95
  export {
62
96
  BaseWizardSteps,
63
97
  Props as BaseWizardStepsProps,
64
98
  Step as WizardStep,
65
99
  } from './Wizard/BaseWizardSteps/BaseWizardSteps';
66
- export { WizardActions } from './Wizard/WizardActions/WizardActions';
67
- export { WizardSteps } from './Wizard/WizardSteps/WizardSteps';
68
- export { Wizard, Props as WizardProps } from './Wizard/Wizard';
100
+
101
+ /** DataGrid */
102
+ export { HeaderCell } from './DataGrid/datagrid.interfaces';
103
+ export { DataGrid, Props as DataGridProps } from './DataGrid/DataGrid';
104
+ export { DataGridRow, Props as DataGridRowProps } from './DataGrid/DataGridBody/DataGridRow';
105
+ export { DataGridCell, Props as DataGridCellProps } from './DataGrid/DataGridBody/DataGridCell';
@@ -0,0 +1,171 @@
1
+ @import './readyclasses.module.scss';
2
+
3
+ @mixin button($variant: 'text', $type: 'default') {
4
+ $disabledSelector: if($type == 'link', '.disabled', ':disabled');
5
+
6
+ @if $variant == 'text' {
7
+ border-color: transparent;
8
+ background-color: transparent;
9
+ } @else if $variant == 'fill' {
10
+ @if $type == 'default' {
11
+ color: var(--button-fill-text-color);
12
+ } @else if $type == 'icon' or $type == 'link' {
13
+ &:not(#{$disabledSelector}) {
14
+ color: var(--button-fill-text-color);
15
+ }
16
+ }
17
+ font-weight: bold;
18
+ } @else if $variant == 'outline' {
19
+ background-color: var(--button-fill-background-color);
20
+ font-weight: bold;
21
+ }
22
+
23
+ &.primary:not(#{$disabledSelector}) {
24
+ @include buttonStyles(var(--color-primary), $variant, $type);
25
+ }
26
+ &.secondary:not(#{$disabledSelector}) {
27
+ @include buttonStyles(var(--color-secondary), $variant, $type);
28
+ }
29
+ &.tertiary:not(#{$disabledSelector}) {
30
+ @include buttonStyles(var(--color-tertiary), $variant, $type);
31
+ }
32
+ &.default:not(#{$disabledSelector}) {
33
+ @include buttonStyles(var(--default), $variant, $type);
34
+ }
35
+
36
+ @if $variant == 'fill' {
37
+ &:hover:not(#{$disabledSelector}),
38
+ &:focus:not(#{$disabledSelector}),
39
+ &:active:not(#{$disabledSelector}) {
40
+ background-color: var(--button-fill-background-color);
41
+ }
42
+
43
+ &#{$disabledSelector} {
44
+ background-color: var(--disabled);
45
+ border-color: var(--disabled);
46
+ }
47
+ } @else if $variant == 'outline' {
48
+ &:hover:not(#{$disabledSelector}),
49
+ &:focus:not(#{$disabledSelector}) {
50
+ color: var(--button-outline-hover-text-color);
51
+ }
52
+
53
+ &#{$disabledSelector} {
54
+ border-color: var(--greyed-out);
55
+ background-color: transparent;
56
+ }
57
+ }
58
+ }
59
+
60
+ @mixin buttonStyles($color, $variant: 'text', $type: 'default') {
61
+ @if $variant == 'text' {
62
+ color: $color;
63
+ } @else if $variant == 'fill' {
64
+ border-color: $color;
65
+ background-color: $color;
66
+ } @else if $variant == 'outline' {
67
+ border-color: $color;
68
+ color: $color;
69
+ }
70
+
71
+ @include focusOutline($color);
72
+
73
+ &:hover:not(.disabled),
74
+ &:focus:not(.disabled) {
75
+ @if $variant == 'text' {
76
+ border-color: $color;
77
+ } @else if $variant == 'fill' {
78
+ color: $color;
79
+ } @else if $variant == 'outline' {
80
+ background-color: $color;
81
+ }
82
+ }
83
+
84
+ @if $variant == 'text' or $variant == 'fill' {
85
+ &:active:not(.disabled) {
86
+ @if $variant == 'text' {
87
+ background-color: transparent;
88
+ position: relative;
89
+ color: $color;
90
+ border-color: var(--button-fill-background-color);
91
+ } @else if $variant == 'fill' {
92
+ position: relative;
93
+ color: $color;
94
+ }
95
+
96
+ &:after {
97
+ content: '';
98
+ position: absolute;
99
+ @if $variant == 'fill' {
100
+ top: calc(-1 * var(--button-border-width));
101
+ } @else {
102
+ top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
103
+ }
104
+ @if $type == 'default' or $type == 'link' {
105
+ left: 0;
106
+ width: 100%;
107
+ } @else if $type == 'icon' {
108
+ left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
109
+ width: calc(100% + var(--button-border-width));
110
+ }
111
+ height: calc(100% + var(--button-border-width));
112
+ background-color: $color;
113
+ border-radius: var(--button-border-radius);
114
+ filter: opacity(0.1);
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ @mixin buttonBase($type: 'default') {
121
+ $disabledSelector: if($type == 'link', '.disabled', ':disabled');
122
+
123
+ border-width: var(--button-border-width);
124
+ border-style: var(--button-border-style);
125
+ border-radius: var(--button-border-radius);
126
+ font-size: var(--button-font-size);
127
+ line-height: var(--button-font-size);
128
+ margin: 0;
129
+ padding: 0.5rem 1.25rem;
130
+ min-height: 2.5rem;
131
+ cursor: pointer;
132
+ transition-property: color, background-color, border-color;
133
+ transition-duration: 0.2s;
134
+ transition-timing-function: ease-in-out;
135
+ font-family: var(--font-family);
136
+
137
+ &#{$disabledSelector} {
138
+ color: var(--greyed-out);
139
+ cursor: not-allowed;
140
+ }
141
+ }
142
+
143
+ @mixin skeletonLoading() {
144
+ position: relative;
145
+ overflow: hidden;
146
+ background-color: var(--disabled);
147
+
148
+ &::after {
149
+ position: absolute;
150
+ top: 0;
151
+ right: 0;
152
+ bottom: 0;
153
+ left: 0;
154
+ transform: translateX(-100%);
155
+ background-image: linear-gradient(
156
+ 90deg,
157
+ rgba(#fff, 0) 0,
158
+ rgba(#fff, 0.2) 20%,
159
+ rgba(#fff, 0.5) 60%,
160
+ rgba(#fff, 0)
161
+ );
162
+ animation: shimmer 2s infinite;
163
+ content: '';
164
+ }
165
+
166
+ @keyframes shimmer {
167
+ 100% {
168
+ transform: translateX(100%);
169
+ }
170
+ }
171
+ }
@@ -9,36 +9,6 @@
9
9
  border: 0;
10
10
  }
11
11
 
12
- @mixin skeletonLoading() {
13
- position: relative;
14
- overflow: hidden;
15
- background-color: var(--disabled);
16
-
17
- &::after {
18
- position: absolute;
19
- top: 0;
20
- right: 0;
21
- bottom: 0;
22
- left: 0;
23
- transform: translateX(-100%);
24
- background-image: linear-gradient(
25
- 90deg,
26
- rgba(#fff, 0) 0,
27
- rgba(#fff, 0.2) 20%,
28
- rgba(#fff, 0.5) 60%,
29
- rgba(#fff, 0)
30
- );
31
- animation: shimmer 2s infinite;
32
- content: '';
33
- }
34
-
35
- @keyframes shimmer {
36
- 100% {
37
- transform: translateX(100%);
38
- }
39
- }
40
- }
41
-
42
12
  .hidden {
43
13
  display: none;
44
14
  }