@onewelcome/react-lib-components 0.1.6-alpha → 0.1.7-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/dist/Button/IconButton.d.ts +2 -1
- package/dist/ContextMenu/ContextMenu.d.ts +2 -3
- package/dist/ContextMenu/ContextMenuItem.d.ts +10 -3
- package/dist/Form/Checkbox/Checkbox.d.ts +2 -2
- package/dist/Form/Toggle/Toggle.d.ts +1 -1
- package/dist/Link/Link.d.ts +4 -3
- package/dist/Notifications/BaseModal/BaseModal.d.ts +4 -2
- package/dist/Notifications/SlideInModal/SlideInModal.d.ts +4 -0
- package/dist/StatusIndicator/StatusIndicator.d.ts +9 -0
- package/dist/index.d.ts +43 -43
- package/dist/react-lib-components.cjs.development.js +2210 -2037
- package/dist/react-lib-components.cjs.development.js.map +1 -1
- package/dist/react-lib-components.cjs.production.min.js +1 -1
- package/dist/react-lib-components.cjs.production.min.js.map +1 -1
- package/dist/react-lib-components.esm.js +2210 -2038
- package/dist/react-lib-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Button/BaseButton.module.scss +3 -18
- package/src/Button/Button.module.scss +4 -311
- package/src/Button/IconButton.module.scss +21 -128
- package/src/Button/IconButton.test.tsx +24 -0
- package/src/Button/IconButton.tsx +6 -1
- package/src/ContextMenu/ContextMenu.test.tsx +121 -6
- package/src/ContextMenu/ContextMenu.tsx +84 -6
- package/src/ContextMenu/ContextMenuItem.tsx +57 -9
- package/src/Form/Checkbox/Checkbox.test.tsx +144 -8
- package/src/Form/Checkbox/Checkbox.tsx +8 -8
- package/src/Form/Toggle/Toggle.tsx +1 -1
- package/src/Form/Wrapper/CheckboxWrapper/CheckboxWrapper.test.tsx +1 -1
- package/src/Link/Link.module.scss +20 -0
- package/src/Link/Link.test.tsx +33 -0
- package/src/Link/Link.tsx +8 -2
- package/src/Notifications/BaseModal/BaseModal.test.tsx +75 -11
- package/src/Notifications/BaseModal/BaseModal.tsx +27 -6
- package/src/Notifications/Dialog/Dialog.tsx +1 -1
- package/src/Notifications/SlideInModal/SlideInModal.module.scss +36 -0
- package/src/Notifications/SlideInModal/SlideInModal.test.tsx +69 -0
- package/src/Notifications/SlideInModal/SlideInModal.tsx +31 -0
- package/src/StatusIndicator/StatusIndicator.module.scss +27 -0
- package/src/StatusIndicator/StatusIndicator.test.tsx +127 -0
- package/src/StatusIndicator/StatusIndicator.tsx +25 -0
- package/src/Tiles/Tile.module.scss +1 -1
- package/src/Tiles/Tile.test.tsx +4 -4
- package/src/index.ts +79 -48
- package/src/mixins.module.scss +171 -0
- package/src/readyclasses.module.scss +0 -30
package/src/index.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/* Components */
|
|
2
2
|
export { BaseStyling } from './_BaseStyling_/BaseStyling';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
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,79 @@ 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 {
|
|
42
|
-
export { Fieldset } from './Form/Fieldset/Fieldset';
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
48
|
-
export {
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export {
|
|
52
|
-
export { RadioWrapper } from './Form/Wrapper/RadioWrapper/RadioWrapper';
|
|
53
|
-
export {
|
|
54
|
-
export {
|
|
55
|
-
export {
|
|
56
|
-
export {
|
|
57
|
-
|
|
58
|
-
|
|
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';
|
|
@@ -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
|
}
|