@onewelcome/react-lib-components 0.1.0-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.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/BaseModal/BaseModal.d.ts +16 -0
- package/dist/BaseModal/BaseModalActions/BaseModalActions.d.ts +5 -0
- package/dist/BaseModal/BaseModalContent/BaseModalContent.d.ts +8 -0
- package/dist/BaseModal/BaseModalContext.d.ts +2 -0
- package/dist/BaseModal/BaseModalHeader/BaseModalHeader.d.ts +8 -0
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/dist/Button/BaseButton.d.ts +8 -0
- package/dist/Button/Button.d.ts +10 -0
- package/dist/Button/IconButton.d.ts +10 -0
- package/dist/ContextMenu/ContextMenu.d.ts +18 -0
- package/dist/ContextMenu/ContextMenuItem.d.ts +6 -0
- package/dist/Dialog/Dialog.d.ts +18 -0
- package/dist/Dialog/DialogActions/DialogActions.d.ts +6 -0
- package/dist/Dialog/DialogTitle/DialogTitle.d.ts +6 -0
- package/dist/Form/Checkbox/Checkbox.d.ts +13 -0
- package/dist/Form/Fieldset/Fieldset.d.ts +13 -0
- package/dist/Form/Form.d.ts +5 -0
- package/dist/Form/FormControl/FormControl.d.ts +8 -0
- package/dist/Form/FormGroup/FormGroup.d.ts +18 -0
- package/dist/Form/FormHelperText/FormHelperText.d.ts +7 -0
- package/dist/Form/FormSelectorWrapper/FormSelectorWrapper.d.ts +18 -0
- package/dist/Form/Input/Input.d.ts +12 -0
- package/dist/Form/Label/Label.d.ts +6 -0
- package/dist/Form/Radio/Radio.d.ts +11 -0
- package/dist/Form/Select/Option.d.ts +12 -0
- package/dist/Form/Select/Select.d.ts +15 -0
- package/dist/Form/Textarea/Textarea.d.ts +7 -0
- package/dist/Form/Toggle/Toggle.d.ts +6 -0
- package/dist/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.d.ts +8 -0
- package/dist/Form/Wrapper/InputWrapper/InputWrapper.d.ts +17 -0
- package/dist/Form/Wrapper/RadioWrapper/RadioWrapper.d.ts +10 -0
- package/dist/Form/Wrapper/SelectWrapper/SelectWrapper.d.ts +12 -0
- package/dist/Form/Wrapper/TextareaWrapper/TextareaWrapper.d.ts +14 -0
- package/dist/Form/Wrapper/Wrapper/Wrapper.d.ts +28 -0
- package/dist/Form/form.interfaces.d.ts +12 -0
- package/dist/Icon/Icon.d.ts +75 -0
- package/dist/Link/Link.d.ts +15 -0
- package/dist/Modal/Modal.d.ts +1 -0
- package/dist/Modal/ModalActions/ModalActions.d.ts +1 -0
- package/dist/Modal/ModalContent/ModalContent.d.ts +1 -0
- package/dist/Modal/ModalHeader/ModalHeader.d.ts +1 -0
- package/dist/Popover/Popover.d.ts +11 -0
- package/dist/Snackbar/SnackbarContainer/SnackbarContainer.d.ts +12 -0
- package/dist/Snackbar/SnackbarItem/SnackbarItem.d.ts +13 -0
- package/dist/Snackbar/SnackbarProvider/SnackbarProvider.d.ts +18 -0
- package/dist/Snackbar/SnackbarProvider/SnackbarStateProvider.d.ts +14 -0
- package/dist/Snackbar/interfaces.d.ts +10 -0
- package/dist/Snackbar/useSnackbar.d.ts +1 -0
- package/dist/Tiles/Tile.d.ts +16 -0
- package/dist/Tiles/Tiles.d.ts +6 -0
- package/dist/Tooltip/Tooltip.d.ts +11 -0
- package/dist/Typography/Typography.d.ts +12 -0
- package/dist/Wizard/BaseWizardSteps/BaseWizardSteps.d.ts +13 -0
- package/dist/Wizard/Wizard.d.ts +12 -0
- package/dist/Wizard/WizardActions/WizardActions.d.ts +12 -0
- package/dist/Wizard/WizardStateProvider.d.ts +12 -0
- package/dist/Wizard/WizardSteps/WizardSteps.d.ts +5 -0
- package/dist/Wizard/wizardStateReducer.d.ts +26 -0
- package/dist/_BaseStyling_/BaseStyling.d.ts +47 -0
- package/dist/hooks/useAnimation.d.ts +6 -0
- package/dist/hooks/useBodyClick.d.ts +1 -0
- package/dist/hooks/useFormSelector.d.ts +13 -0
- package/dist/hooks/usePosition.d.ts +36 -0
- package/dist/hooks/useScroll.d.ts +2 -0
- package/dist/hooks/useSpacing.d.ts +18 -0
- package/dist/hooks/useWrapper.d.ts +11 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +8 -0
- package/dist/interfaces.d.ts +13 -0
- package/dist/react-lib-components.cjs.development.js +3282 -0
- package/dist/react-lib-components.cjs.development.js.map +1 -0
- package/dist/react-lib-components.cjs.production.min.js +2 -0
- package/dist/react-lib-components.cjs.production.min.js.map +1 -0
- package/dist/react-lib-components.esm.js +3235 -0
- package/dist/react-lib-components.esm.js.map +1 -0
- package/dist/util/helper.d.ts +1 -0
- package/package.json +88 -0
- package/src/BaseModal/BaseModal.module.scss +58 -0
- package/src/BaseModal/BaseModal.test.tsx +59 -0
- package/src/BaseModal/BaseModal.tsx +113 -0
- package/src/BaseModal/BaseModalActions/BaseModalActions.module.scss +9 -0
- package/src/BaseModal/BaseModalActions/BaseModalActions.test.tsx +17 -0
- package/src/BaseModal/BaseModalActions/BaseModalActions.tsx +14 -0
- package/src/BaseModal/BaseModalContent/BaseModalContent.module.scss +6 -0
- package/src/BaseModal/BaseModalContent/BaseModalContent.test.tsx +29 -0
- package/src/BaseModal/BaseModalContent/BaseModalContent.tsx +35 -0
- package/src/BaseModal/BaseModalContext.ts +2 -0
- package/src/BaseModal/BaseModalHeader/BaseModalHeader.module.scss +17 -0
- package/src/BaseModal/BaseModalHeader/BaseModalHeader.test.tsx +30 -0
- package/src/BaseModal/BaseModalHeader/BaseModalHeader.tsx +28 -0
- package/src/Breadcrumbs/Breadcrumbs.module.scss +14 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +42 -0
- package/src/Breadcrumbs/Breadcrumbs.tsx +48 -0
- package/src/Button/BaseButton.module.scss +20 -0
- package/src/Button/BaseButton.test.tsx +59 -0
- package/src/Button/BaseButton.tsx +31 -0
- package/src/Button/Button.module.scss +336 -0
- package/src/Button/Button.test.tsx +76 -0
- package/src/Button/Button.tsx +44 -0
- package/src/Button/IconButton.module.scss +161 -0
- package/src/Button/IconButton.test.tsx +47 -0
- package/src/Button/IconButton.tsx +29 -0
- package/src/ContextMenu/ContextMenu.module.scss +20 -0
- package/src/ContextMenu/ContextMenu.test.tsx +93 -0
- package/src/ContextMenu/ContextMenu.tsx +91 -0
- package/src/ContextMenu/ContextMenuItem.module.scss +31 -0
- package/src/ContextMenu/ContextMenuItem.tsx +15 -0
- package/src/Dialog/Dialog.module.scss +16 -0
- package/src/Dialog/Dialog.test.tsx +79 -0
- package/src/Dialog/Dialog.tsx +96 -0
- package/src/Dialog/DialogActions/DialogActions.module.scss +11 -0
- package/src/Dialog/DialogActions/DialogActions.test.tsx +25 -0
- package/src/Dialog/DialogActions/DialogActions.tsx +21 -0
- package/src/Dialog/DialogTitle/DialogTitle.module.scss +7 -0
- package/src/Dialog/DialogTitle/DialogTitle.test.tsx +18 -0
- package/src/Dialog/DialogTitle/DialogTitle.tsx +18 -0
- package/src/Form/Checkbox/Checkbox.module.scss +65 -0
- package/src/Form/Checkbox/Checkbox.test.tsx +119 -0
- package/src/Form/Checkbox/Checkbox.tsx +145 -0
- package/src/Form/Fieldset/Fieldset.module.scss +19 -0
- package/src/Form/Fieldset/Fieldset.test.tsx +85 -0
- package/src/Form/Fieldset/Fieldset.tsx +55 -0
- package/src/Form/Form.module.scss +3 -0
- package/src/Form/Form.test.tsx +47 -0
- package/src/Form/Form.tsx +14 -0
- package/src/Form/FormControl/FormControl.module.scss +67 -0
- package/src/Form/FormControl/FormControl.test.tsx +56 -0
- package/src/Form/FormControl/FormControl.tsx +47 -0
- package/src/Form/FormGroup/FormGroup.module.scss +29 -0
- package/src/Form/FormGroup/FormGroup.test.tsx +61 -0
- package/src/Form/FormGroup/FormGroup.tsx +78 -0
- package/src/Form/FormHelperText/FormHelperText.module.scss +8 -0
- package/src/Form/FormHelperText/FormHelperText.test.tsx +42 -0
- package/src/Form/FormHelperText/FormHelperText.tsx +22 -0
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.module.scss +33 -0
- package/src/Form/FormSelectorWrapper/FormSelectorWrapper.tsx +65 -0
- package/src/Form/Input/Input.module.scss +65 -0
- package/src/Form/Input/Input.test.tsx +135 -0
- package/src/Form/Input/Input.tsx +72 -0
- package/src/Form/Label/Label.module.scss +5 -0
- package/src/Form/Label/Label.test.tsx +26 -0
- package/src/Form/Label/Label.tsx +19 -0
- package/src/Form/Radio/Radio.module.scss +100 -0
- package/src/Form/Radio/Radio.test.tsx +88 -0
- package/src/Form/Radio/Radio.tsx +98 -0
- package/src/Form/Select/Option.test.tsx +15 -0
- package/src/Form/Select/Option.tsx +57 -0
- package/src/Form/Select/Select.module.scss +189 -0
- package/src/Form/Select/Select.test.tsx +96 -0
- package/src/Form/Select/Select.tsx +217 -0
- package/src/Form/Textarea/Textarea.module.scss +53 -0
- package/src/Form/Textarea/Textarea.test.tsx +76 -0
- package/src/Form/Textarea/Textarea.tsx +33 -0
- package/src/Form/Toggle/Toggle.module.scss +58 -0
- package/src/Form/Toggle/Toggle.test.tsx +29 -0
- package/src/Form/Toggle/Toggle.tsx +20 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.module.scss +12 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +99 -0
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.tsx +62 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.module.scss +24 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.test.tsx +93 -0
- package/src/Form/Wrapper/InputWrapper/InputWrapper.tsx +92 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.module.scss +12 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.test.tsx +101 -0
- package/src/Form/Wrapper/RadioWrapper/RadioWrapper.tsx +74 -0
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.module.scss +14 -0
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.test.tsx +101 -0
- package/src/Form/Wrapper/SelectWrapper/SelectWrapper.tsx +59 -0
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.module.scss +65 -0
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.test.tsx +125 -0
- package/src/Form/Wrapper/TextareaWrapper/TextareaWrapper.tsx +105 -0
- package/src/Form/Wrapper/Wrapper/Wrapper.module.scss +35 -0
- package/src/Form/Wrapper/Wrapper/Wrapper.test.tsx +17 -0
- package/src/Form/Wrapper/Wrapper/Wrapper.tsx +101 -0
- package/src/Form/form.interfaces.ts +14 -0
- package/src/Icon/Icon.module.scss +278 -0
- package/src/Icon/Icon.test.tsx +39 -0
- package/src/Icon/Icon.tsx +94 -0
- package/src/Link/Link.module.scss +46 -0
- package/src/Link/Link.test.tsx +122 -0
- package/src/Link/Link.tsx +80 -0
- package/src/Link/types.d.ts +9 -0
- package/src/Modal/Modal.test.tsx +16 -0
- package/src/Modal/Modal.tsx +1 -0
- package/src/Modal/ModalActions/ModalActions.tsx +4 -0
- package/src/Modal/ModalContent/ModalContent.tsx +4 -0
- package/src/Modal/ModalHeader/ModalHeader.tsx +4 -0
- package/src/Popover/Popover.module.scss +18 -0
- package/src/Popover/Popover.test.tsx +84 -0
- package/src/Popover/Popover.tsx +46 -0
- package/src/Snackbar/SnackbarContainer/SnackbarContainer.module.scss +35 -0
- package/src/Snackbar/SnackbarContainer/SnackbarContainer.test.tsx +37 -0
- package/src/Snackbar/SnackbarContainer/SnackbarContainer.tsx +28 -0
- package/src/Snackbar/SnackbarItem/SnackbarItem.module.scss +135 -0
- package/src/Snackbar/SnackbarItem/SnackbarItem.test.tsx +47 -0
- package/src/Snackbar/SnackbarItem/SnackbarItem.tsx +105 -0
- package/src/Snackbar/SnackbarProvider/SnackbarProvider.test.tsx +179 -0
- package/src/Snackbar/SnackbarProvider/SnackbarProvider.tsx +127 -0
- package/src/Snackbar/SnackbarProvider/SnackbarStateProvider.tsx +25 -0
- package/src/Snackbar/interfaces.ts +11 -0
- package/src/Snackbar/useSnackbar.ts +4 -0
- package/src/Tiles/Tile.module.scss +72 -0
- package/src/Tiles/Tile.test.tsx +129 -0
- package/src/Tiles/Tile.tsx +48 -0
- package/src/Tiles/Tiles.module.scss +11 -0
- package/src/Tiles/Tiles.test.tsx +118 -0
- package/src/Tiles/Tiles.tsx +48 -0
- package/src/Tooltip/Tooltip.module.scss +42 -0
- package/src/Tooltip/Tooltip.test.tsx +72 -0
- package/src/Tooltip/Tooltip.tsx +130 -0
- package/src/Typography/Typography.module.scss +46 -0
- package/src/Typography/Typography.test.tsx +114 -0
- package/src/Typography/Typography.tsx +84 -0
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.module.scss +192 -0
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.test.tsx +75 -0
- package/src/Wizard/BaseWizardSteps/BaseWizardSteps.tsx +86 -0
- package/src/Wizard/Wizard.test.tsx +198 -0
- package/src/Wizard/Wizard.tsx +49 -0
- package/src/Wizard/WizardActions/WizardActions.test.tsx +168 -0
- package/src/Wizard/WizardActions/WizardActions.tsx +100 -0
- package/src/Wizard/WizardStateProvider.tsx +26 -0
- package/src/Wizard/WizardSteps/WizardSteps.test.tsx +110 -0
- package/src/Wizard/WizardSteps/WizardSteps.tsx +30 -0
- package/src/Wizard/wizardStateReducer.ts +51 -0
- package/src/_BaseStyling_/BaseStyling.test.tsx +39 -0
- package/src/_BaseStyling_/BaseStyling.tsx +115 -0
- package/src/hooks/useAnimation.test.tsx +45 -0
- package/src/hooks/useAnimation.ts +20 -0
- package/src/hooks/useBodyClick.test.tsx +39 -0
- package/src/hooks/useBodyClick.ts +20 -0
- package/src/hooks/useFormSelector.test.ts +40 -0
- package/src/hooks/useFormSelector.ts +47 -0
- package/src/hooks/usePosition.test.tsx +494 -0
- package/src/hooks/usePosition.ts +347 -0
- package/src/hooks/useScroll.test.tsx +20 -0
- package/src/hooks/useScroll.ts +16 -0
- package/src/hooks/useSpacing.test.ts +70 -0
- package/src/hooks/useSpacing.ts +42 -0
- package/src/hooks/useWrapper.test.ts +49 -0
- package/src/hooks/useWrapper.ts +35 -0
- package/src/index.ts +52 -0
- package/src/interfaces.ts +15 -0
- package/src/readyclasses.module.scss +77 -0
- package/src/types.d.ts +4 -0
- package/src/util/helper.test.tsx +15 -0
- package/src/util/helper.tsx +80 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseButton, Props } from './BaseButton';
|
|
3
|
+
import { render, getByRole } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
|
|
6
|
+
const createButton = (params?: Props, children = 'This is a button') => {
|
|
7
|
+
const queries = render(<BaseButton {...params}>{children}</BaseButton>);
|
|
8
|
+
const button = getByRole(queries.container, 'button');
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
...queries,
|
|
12
|
+
button,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
describe('BaseButton should render', () => {
|
|
17
|
+
it('renders without crashing', async () => {
|
|
18
|
+
const { findByText } = createButton();
|
|
19
|
+
findByText('This is a button');
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
describe('On click handler', () => {
|
|
24
|
+
it('executes the onclick handler', async () => {
|
|
25
|
+
const onClickHandler = jest.fn();
|
|
26
|
+
const { button } = createButton({ onClick: onClickHandler });
|
|
27
|
+
|
|
28
|
+
userEvent.click(button);
|
|
29
|
+
|
|
30
|
+
expect(onClickHandler).toBeCalled();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('Properties of the button', () => {
|
|
35
|
+
it('should be disabled, function should not have been called', () => {
|
|
36
|
+
const onClickHandler = jest.fn();
|
|
37
|
+
const { button } = createButton({
|
|
38
|
+
disabled: true,
|
|
39
|
+
onClick: onClickHandler,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
userEvent.click(button);
|
|
43
|
+
expect(onClickHandler).toHaveBeenCalledTimes(0);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should have the class "TESTING"', () => {
|
|
47
|
+
const { button } = createButton({
|
|
48
|
+
className: 'TESTING',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
expect(button.classList.contains('TESTING')).toBe(true);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should have a "name" property with the value "button"', () => {
|
|
55
|
+
const { button } = createButton({ name: 'button' });
|
|
56
|
+
|
|
57
|
+
expect(button.getAttribute('name')).toBe('button');
|
|
58
|
+
});
|
|
59
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import classes from './BaseButton.module.scss';
|
|
3
|
+
|
|
4
|
+
export interface Props extends Omit<React.HTMLProps<HTMLButtonElement>, 'ref'> {
|
|
5
|
+
type?: 'submit' | 'button' | 'reset';
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
ref?: RefObject<HTMLButtonElement>;
|
|
8
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'default';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const BaseButton = React.forwardRef<HTMLButtonElement, Props>(
|
|
12
|
+
({ children, type = 'button', className, ...rest }, ref) => {
|
|
13
|
+
const validTypes = ['submit', 'button', 'reset'];
|
|
14
|
+
|
|
15
|
+
if (!validTypes.includes(type))
|
|
16
|
+
throw new Error(
|
|
17
|
+
`You have entered an invalid button type. Expected 'submit', 'button' or 'reset' got ${type}`
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<button
|
|
22
|
+
{...rest}
|
|
23
|
+
ref={ref}
|
|
24
|
+
type={type}
|
|
25
|
+
className={`${classes.button} ${className ? className : ''}`}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</button>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
);
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
@import '../readyclasses.module.scss';
|
|
2
|
+
|
|
3
|
+
.fill {
|
|
4
|
+
color: var(--button-fill-text-color);
|
|
5
|
+
font-weight: bold;
|
|
6
|
+
|
|
7
|
+
&.primary:not(:disabled) {
|
|
8
|
+
background-color: var(--color-primary);
|
|
9
|
+
border-color: var(--color-primary);
|
|
10
|
+
|
|
11
|
+
@include focusOutline(var(--color-primary));
|
|
12
|
+
|
|
13
|
+
&:hover,
|
|
14
|
+
&:focus {
|
|
15
|
+
color: var(--color-primary);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:active {
|
|
19
|
+
position: relative;
|
|
20
|
+
color: var(--color-primary);
|
|
21
|
+
|
|
22
|
+
&:after {
|
|
23
|
+
content: '';
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: calc(-1 * var(--button-border-width));
|
|
26
|
+
left: 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: calc(100% + var(--button-border-width));
|
|
29
|
+
background-color: var(--color-primary);
|
|
30
|
+
border-radius: var(--button-border-radius);
|
|
31
|
+
filter: opacity(0.1);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.secondary:not(:disabled) {
|
|
37
|
+
background-color: var(--color-secondary);
|
|
38
|
+
border-color: var(--color-secondary);
|
|
39
|
+
|
|
40
|
+
@include focusOutline(var(--color-secondary));
|
|
41
|
+
|
|
42
|
+
&:hover,
|
|
43
|
+
&:focus {
|
|
44
|
+
color: var(--color-secondary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:active {
|
|
48
|
+
position: relative;
|
|
49
|
+
color: var(--color-secondary);
|
|
50
|
+
|
|
51
|
+
&:after {
|
|
52
|
+
content: '';
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: calc(-1 * var(--button-border-width));
|
|
55
|
+
left: 0;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: calc(100% + var(--button-border-width));
|
|
58
|
+
background-color: var(--color-secondary);
|
|
59
|
+
border-radius: var(--button-border-radius);
|
|
60
|
+
filter: opacity(0.1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.tertiary:not(:disabled) {
|
|
66
|
+
background-color: var(--color-tertiary);
|
|
67
|
+
border-color: var(--color-tertiary);
|
|
68
|
+
|
|
69
|
+
@include focusOutline(var(--color-tertiary));
|
|
70
|
+
|
|
71
|
+
&:hover,
|
|
72
|
+
&:focus {
|
|
73
|
+
color: var(--color-tertiary);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:active {
|
|
77
|
+
position: relative;
|
|
78
|
+
color: var(--color-tertiary);
|
|
79
|
+
|
|
80
|
+
&:after {
|
|
81
|
+
content: '';
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: calc(-1 * var(--button-border-width));
|
|
84
|
+
left: 0;
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: calc(100% + var(--button-border-width));
|
|
87
|
+
background-color: var(--color-tertiary);
|
|
88
|
+
border-radius: var(--button-border-radius);
|
|
89
|
+
filter: opacity(0.1);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&.default:not(:disabled) {
|
|
95
|
+
background-color: var(--default);
|
|
96
|
+
border-color: var(--default);
|
|
97
|
+
|
|
98
|
+
@include focusOutline(var(--default));
|
|
99
|
+
|
|
100
|
+
&:hover,
|
|
101
|
+
&:focus {
|
|
102
|
+
color: var(--default);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:active {
|
|
106
|
+
position: relative;
|
|
107
|
+
color: var(--default);
|
|
108
|
+
|
|
109
|
+
&:after {
|
|
110
|
+
content: '';
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: calc(-1 * var(--button-border-width));
|
|
113
|
+
left: 0;
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: calc(100% + var(--button-border-width));
|
|
116
|
+
background-color: var(--default);
|
|
117
|
+
border-radius: var(--button-border-radius);
|
|
118
|
+
filter: opacity(0.1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&:hover:not(:disabled),
|
|
124
|
+
&:focus:not(:disabled),
|
|
125
|
+
&:active:not(:disabled) {
|
|
126
|
+
background-color: var(--button-fill-background-color);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&:disabled {
|
|
130
|
+
background-color: var(--disabled);
|
|
131
|
+
border-color: var(--disabled);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.outline {
|
|
136
|
+
background-color: var(--button-fill-background-color);
|
|
137
|
+
font-weight: bold;
|
|
138
|
+
|
|
139
|
+
&.primary:not(:disabled) {
|
|
140
|
+
border-color: var(--color-primary);
|
|
141
|
+
color: var(--color-primary);
|
|
142
|
+
|
|
143
|
+
@include focusOutline(var(--color-primary));
|
|
144
|
+
|
|
145
|
+
&:hover,
|
|
146
|
+
&:focus {
|
|
147
|
+
background-color: var(--color-primary);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&.secondary:not(:disabled) {
|
|
152
|
+
border-color: var(--color-secondary);
|
|
153
|
+
color: var(--color-secondary);
|
|
154
|
+
|
|
155
|
+
@include focusOutline(var(--color-secondary));
|
|
156
|
+
|
|
157
|
+
&:hover,
|
|
158
|
+
&:focus {
|
|
159
|
+
background-color: var(--color-secondary);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.tertiary:not(:disabled) {
|
|
164
|
+
border-color: var(--color-tertiary);
|
|
165
|
+
color: var(--color-tertiary);
|
|
166
|
+
|
|
167
|
+
@include focusOutline(var(--color-tertiary));
|
|
168
|
+
|
|
169
|
+
&:hover,
|
|
170
|
+
&:focus {
|
|
171
|
+
background-color: var(--color-tertiary);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&.default:not(:disabled) {
|
|
176
|
+
border-color: var(--default);
|
|
177
|
+
color: var(--default);
|
|
178
|
+
|
|
179
|
+
@include focusOutline(var(--default));
|
|
180
|
+
|
|
181
|
+
&:hover,
|
|
182
|
+
&:focus {
|
|
183
|
+
background-color: var(--default);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&:hover:not(:disabled),
|
|
188
|
+
&:focus:not(:disabled) {
|
|
189
|
+
color: var(--button-outline-hover-text-color);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&:disabled {
|
|
193
|
+
border-color: var(--greyed-out);
|
|
194
|
+
background-color: transparent;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.text {
|
|
199
|
+
border-color: transparent;
|
|
200
|
+
background-color: transparent;
|
|
201
|
+
|
|
202
|
+
&.primary:not(:disabled) {
|
|
203
|
+
color: var(--color-primary);
|
|
204
|
+
|
|
205
|
+
@include focusOutline(var(--color-primary));
|
|
206
|
+
|
|
207
|
+
&:hover,
|
|
208
|
+
&:focus {
|
|
209
|
+
border-color: var(--color-primary);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&:active {
|
|
213
|
+
background-color: transparent;
|
|
214
|
+
position: relative;
|
|
215
|
+
color: var(--color-primary);
|
|
216
|
+
border-color: var(--button-fill-background-color);
|
|
217
|
+
|
|
218
|
+
&:after {
|
|
219
|
+
content: '';
|
|
220
|
+
position: absolute;
|
|
221
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
222
|
+
left: 0;
|
|
223
|
+
width: 100%;
|
|
224
|
+
height: calc(100% + var(--button-border-width));
|
|
225
|
+
background-color: var(--color-primary);
|
|
226
|
+
border-radius: var(--button-border-radius);
|
|
227
|
+
filter: opacity(0.1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&.secondary:not(:disabled) {
|
|
233
|
+
color: var(--color-secondary);
|
|
234
|
+
|
|
235
|
+
@include focusOutline(var(--color-secondary));
|
|
236
|
+
|
|
237
|
+
&:hover,
|
|
238
|
+
&:focus {
|
|
239
|
+
border-color: var(--color-secondary);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
&:active {
|
|
243
|
+
background-color: transparent;
|
|
244
|
+
position: relative;
|
|
245
|
+
color: var(--color-secondary);
|
|
246
|
+
border-color: var(--button-fill-background-color);
|
|
247
|
+
|
|
248
|
+
&:after {
|
|
249
|
+
content: '';
|
|
250
|
+
position: absolute;
|
|
251
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
252
|
+
left: 0;
|
|
253
|
+
width: 100%;
|
|
254
|
+
height: calc(100% + var(--button-border-width));
|
|
255
|
+
background-color: var(--color-secondary);
|
|
256
|
+
border-radius: var(--button-border-radius);
|
|
257
|
+
filter: opacity(0.1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&.tertiary:not(:disabled) {
|
|
263
|
+
color: var(--color-tertiary);
|
|
264
|
+
|
|
265
|
+
@include focusOutline(var(--color-tertiary));
|
|
266
|
+
|
|
267
|
+
&:hover,
|
|
268
|
+
&:focus {
|
|
269
|
+
border-color: var(--color-tertiary);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&:active {
|
|
273
|
+
background-color: transparent;
|
|
274
|
+
position: relative;
|
|
275
|
+
color: var(--color-tertiary);
|
|
276
|
+
border-color: var(--button-fill-background-color);
|
|
277
|
+
|
|
278
|
+
&:after {
|
|
279
|
+
content: '';
|
|
280
|
+
position: absolute;
|
|
281
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
282
|
+
left: 0;
|
|
283
|
+
width: 100%;
|
|
284
|
+
height: calc(100% + var(--button-border-width));
|
|
285
|
+
background-color: var(--color-tertiary);
|
|
286
|
+
border-radius: var(--button-border-radius);
|
|
287
|
+
filter: opacity(0.1);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&.default:not(:disabled) {
|
|
293
|
+
color: var(--default);
|
|
294
|
+
|
|
295
|
+
@include focusOutline(var(--default));
|
|
296
|
+
|
|
297
|
+
&:hover,
|
|
298
|
+
&:focus {
|
|
299
|
+
border-color: var(--default);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&:active {
|
|
303
|
+
background-color: transparent;
|
|
304
|
+
position: relative;
|
|
305
|
+
color: var(--default);
|
|
306
|
+
border-color: var(--button-fill-background-color);
|
|
307
|
+
|
|
308
|
+
&:after {
|
|
309
|
+
content: '';
|
|
310
|
+
position: absolute;
|
|
311
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
312
|
+
left: 0;
|
|
313
|
+
width: 100%;
|
|
314
|
+
height: calc(100% + var(--button-border-width));
|
|
315
|
+
background-color: var(--default);
|
|
316
|
+
border-radius: var(--button-border-radius);
|
|
317
|
+
filter: opacity(0.1);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.has-icon {
|
|
324
|
+
display: flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
|
|
327
|
+
&.start-icon {
|
|
328
|
+
padding-left: 1rem;
|
|
329
|
+
padding-right: 1.25rem;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
&.end-icon {
|
|
333
|
+
padding-left: 1.25rem;
|
|
334
|
+
padding-right: 1rem;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Props } from './Button';
|
|
3
|
+
import { render, getByRole } from '@testing-library/react';
|
|
4
|
+
import { Icon, Icons } from '../Icon/Icon';
|
|
5
|
+
|
|
6
|
+
const createButton = (params?: Props, children = 'This is a button') => {
|
|
7
|
+
const queries = render(<Button {...params}>{children}</Button>);
|
|
8
|
+
const button = getByRole(queries.container, 'button');
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
...queries,
|
|
12
|
+
button,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
describe('Button should render', () => {
|
|
17
|
+
it('renders without crashing', () => {
|
|
18
|
+
const { button } = createButton();
|
|
19
|
+
|
|
20
|
+
expect(button).toBeDefined();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
describe('Different variants of the button', () => {
|
|
25
|
+
it('should have a class of "primary"', () => {
|
|
26
|
+
const { button } = createButton({ color: 'primary' });
|
|
27
|
+
expect(button.classList.contains('primary')).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should have a class of "secondary"', () => {
|
|
31
|
+
const { button } = createButton({ color: 'secondary' });
|
|
32
|
+
expect(button.classList.contains('secondary')).toBe(true);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should have a class of "tertiary"', () => {
|
|
36
|
+
const { button } = createButton({ color: 'tertiary' });
|
|
37
|
+
expect(button.classList.contains('tertiary')).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should have a class of "fill"', () => {
|
|
41
|
+
const { button } = createButton({ variant: 'fill' });
|
|
42
|
+
expect(button.classList.contains('fill')).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should have a class of "outline"', () => {
|
|
46
|
+
const { button } = createButton({ variant: 'outline' });
|
|
47
|
+
expect(button.classList.contains('outline')).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should have a class of "text"', () => {
|
|
51
|
+
const { button } = createButton({ variant: 'text' });
|
|
52
|
+
expect(button.classList.contains('text')).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('Button contains an icon', () => {
|
|
57
|
+
it('Contains an icon at the start', () => {
|
|
58
|
+
const { button } = createButton({
|
|
59
|
+
startIcon: <Icon icon={Icons.Calendar} />,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
expect(button.classList.contains('has-icon')).toBe(true);
|
|
63
|
+
expect(button.firstElementChild?.nodeName).toBe('I');
|
|
64
|
+
expect(button.querySelector('i + span')!.innerHTML).toBe('This is a button');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('Contains an icon at the end', () => {
|
|
68
|
+
const { button } = createButton({
|
|
69
|
+
endIcon: <Icon icon={Icons.Calendar} />,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
expect(button.classList.contains('has-icon')).toBe(true);
|
|
73
|
+
expect(button.lastElementChild?.nodeName).toBe('I');
|
|
74
|
+
expect(button.querySelector('span')!.innerHTML).toBe('This is a button');
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { BaseButton, Props as BaseButtonProps } from './BaseButton';
|
|
3
|
+
import classes from './Button.module.scss';
|
|
4
|
+
|
|
5
|
+
export interface Props extends Omit<BaseButtonProps, 'ref'> {
|
|
6
|
+
startIcon?: React.ReactNode | false;
|
|
7
|
+
endIcon?: React.ReactNode | false;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
variant?: 'text' | 'fill' | 'outline';
|
|
10
|
+
ref?: RefObject<HTMLButtonElement>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Button = React.forwardRef<HTMLButtonElement, Props>(
|
|
14
|
+
(
|
|
15
|
+
{ children, variant = 'fill', color = 'primary', startIcon = false, endIcon = false, ...rest },
|
|
16
|
+
ref
|
|
17
|
+
) => {
|
|
18
|
+
const additionalClasses = [];
|
|
19
|
+
|
|
20
|
+
if (startIcon || endIcon) {
|
|
21
|
+
additionalClasses.push(classes['has-icon']);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (startIcon) {
|
|
25
|
+
additionalClasses.push(classes['start-icon']);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (endIcon) {
|
|
29
|
+
additionalClasses.push(classes['end-icon']);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<BaseButton
|
|
34
|
+
{...rest}
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={`${classes[color]} ${classes[variant]} ${additionalClasses.join(' ')}`}
|
|
37
|
+
>
|
|
38
|
+
{startIcon && <i>{startIcon} </i>}
|
|
39
|
+
<span>{children}</span>
|
|
40
|
+
{endIcon && <i> {endIcon}</i>}
|
|
41
|
+
</BaseButton>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
@import '../readyclasses.module.scss';
|
|
2
|
+
|
|
3
|
+
.icon-button {
|
|
4
|
+
border: var(--button-border-width) var(--button-border-style) transparent;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
padding: 0;
|
|
7
|
+
border-radius: 50%;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
|
|
12
|
+
svg {
|
|
13
|
+
vertical-align: top;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Sizes **/
|
|
17
|
+
&.button-s {
|
|
18
|
+
svg {
|
|
19
|
+
font-size: 14px;
|
|
20
|
+
}
|
|
21
|
+
width: 30px;
|
|
22
|
+
height: 30px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.button-m {
|
|
26
|
+
svg {
|
|
27
|
+
font-size: 24px;
|
|
28
|
+
}
|
|
29
|
+
width: 40px;
|
|
30
|
+
height: 40px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.button-l {
|
|
34
|
+
svg {
|
|
35
|
+
font-size: 34px;
|
|
36
|
+
}
|
|
37
|
+
width: 50px;
|
|
38
|
+
height: 50px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Colors **/
|
|
42
|
+
&.primary:not(:disabled) {
|
|
43
|
+
color: var(--color-primary);
|
|
44
|
+
|
|
45
|
+
@include focusOutline(var(--color-primary));
|
|
46
|
+
|
|
47
|
+
&:hover,
|
|
48
|
+
&:focus {
|
|
49
|
+
border-color: var(--color-primary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:active {
|
|
53
|
+
background-color: transparent;
|
|
54
|
+
position: relative;
|
|
55
|
+
color: var(--color-primary);
|
|
56
|
+
border-color: var(--button-fill-background-color);
|
|
57
|
+
|
|
58
|
+
&:after {
|
|
59
|
+
content: '';
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
62
|
+
left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
63
|
+
width: calc(100% + var(--button-border-width));
|
|
64
|
+
height: calc(100% + var(--button-border-width));
|
|
65
|
+
background-color: var(--color-primary);
|
|
66
|
+
border-radius: var(--button-border-radius);
|
|
67
|
+
filter: opacity(0.1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.secondary:not(:disabled) {
|
|
73
|
+
color: var(--color-secondary);
|
|
74
|
+
|
|
75
|
+
@include focusOutline(var(--color-secondary));
|
|
76
|
+
|
|
77
|
+
&:hover,
|
|
78
|
+
&:focus {
|
|
79
|
+
border-color: var(--color-secondary);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&:active {
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
position: relative;
|
|
85
|
+
color: var(--color-secondary);
|
|
86
|
+
border-color: var(--button-fill-background-color);
|
|
87
|
+
|
|
88
|
+
&:after {
|
|
89
|
+
content: '';
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
92
|
+
left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
93
|
+
width: calc(100% + var(--button-border-width));
|
|
94
|
+
height: calc(100% + var(--button-border-width));
|
|
95
|
+
background-color: var(--color-secondary);
|
|
96
|
+
border-radius: var(--button-border-radius);
|
|
97
|
+
filter: opacity(0.1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.tertiary:not(:disabled) {
|
|
103
|
+
color: var(--color-tertiary);
|
|
104
|
+
|
|
105
|
+
@include focusOutline(var(--color-tertiary));
|
|
106
|
+
|
|
107
|
+
&:hover,
|
|
108
|
+
&:focus {
|
|
109
|
+
border-color: var(--color-tertiary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:active {
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
position: relative;
|
|
115
|
+
color: var(--color-tertiary);
|
|
116
|
+
border-color: var(--button-fill-background-color);
|
|
117
|
+
|
|
118
|
+
&:after {
|
|
119
|
+
content: '';
|
|
120
|
+
position: absolute;
|
|
121
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
122
|
+
left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
123
|
+
width: calc(100% + var(--button-border-width));
|
|
124
|
+
height: calc(100% + var(--button-border-width));
|
|
125
|
+
background-color: var(--color-tertiary);
|
|
126
|
+
border-radius: var(--button-border-radius);
|
|
127
|
+
filter: opacity(0.1);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.default {
|
|
133
|
+
color: var(--default);
|
|
134
|
+
|
|
135
|
+
@include focusOutline(var(--default));
|
|
136
|
+
|
|
137
|
+
&:hover,
|
|
138
|
+
&:focus {
|
|
139
|
+
border-color: var(--default);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&:active {
|
|
143
|
+
background-color: transparent;
|
|
144
|
+
position: relative;
|
|
145
|
+
color: var(--default);
|
|
146
|
+
border-color: var(--button-fill-background-color);
|
|
147
|
+
|
|
148
|
+
&:after {
|
|
149
|
+
content: '';
|
|
150
|
+
position: absolute;
|
|
151
|
+
top: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
152
|
+
left: calc(-1 * var(--button-border-width) + (var(--button-border-width) / 2));
|
|
153
|
+
width: calc(100% + var(--button-border-width));
|
|
154
|
+
height: calc(100% + var(--button-border-width));
|
|
155
|
+
background-color: var(--default);
|
|
156
|
+
border-radius: var(--button-border-radius);
|
|
157
|
+
filter: opacity(0.1);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|