@zohodesk/components 1.0.0-temp-259.2 → 1.0.0-temp-260
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/README.md +21 -3
- package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +20 -5
- package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +20 -5
- package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +20 -5
- package/es/AdvancedPopup/AdvancedPopup.js +105 -0
- package/es/v1/Button/Button.js +107 -159
- package/es/v1/Button/README.md +2 -3
- package/es/v1/Button/__tests__/Button.spec.js +6 -14
- package/es/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +169 -249
- package/es/v1/Button/constants/index.js +20 -26
- package/es/v1/Button/css/Button_v1.module.css +16 -37
- package/es/v1/Button/css/cssJSLogic.js +28 -56
- package/es/v1/Button/props/defaultProps.js +6 -2
- package/es/v1/Button/props/propTypes.js +8 -26
- package/es/v1/helpers/colorHelpers/background/backgroundColor.module.css +40 -40
- package/es/v1/helpers/colorHelpers/border/borderColor.module.css +25 -25
- package/es/v1/helpers/colorHelpers/colorHelper.js +139 -117
- package/es/v1/helpers/colorHelpers/constants/index.js +4 -45
- package/es/v1/helpers/colorHelpers/text/textColor.module.css +35 -35
- package/lib/AdvancedPopup/AdvancedPopup.js +122 -0
- package/lib/v1/Button/Button.js +119 -178
- package/lib/v1/Button/README.md +2 -3
- package/lib/v1/Button/__tests__/Button.spec.js +52 -66
- package/lib/v1/Button/__tests__/__snapshots__/Button.spec.js.snap +169 -249
- package/lib/v1/Button/constants/index.js +28 -31
- package/lib/v1/Button/css/Button_v1.module.css +16 -37
- package/lib/v1/Button/css/cssJSLogic.js +19 -42
- package/lib/v1/Button/props/defaultProps.js +5 -1
- package/lib/v1/Button/props/propTypes.js +7 -41
- package/lib/v1/helpers/colorHelpers/background/backgroundColor.module.css +40 -40
- package/lib/v1/helpers/colorHelpers/border/borderColor.module.css +25 -25
- package/lib/v1/helpers/colorHelpers/colorHelper.js +153 -127
- package/lib/v1/helpers/colorHelpers/constants/index.js +4 -45
- package/lib/v1/helpers/colorHelpers/text/textColor.module.css +35 -35
- package/package.json +4 -4
- package/es/v1/Button/constants/presets.js +0 -147
- package/lib/v1/Button/constants/presets.js +0 -165
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
export const PALETTE = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
INFO: 'info',
|
|
5
|
-
INFO_LIGHTER: 'infoLighter',
|
|
2
|
+
DEFAULT: 'default',
|
|
3
|
+
PRIMARY: 'primary',
|
|
6
4
|
SECONDARY: 'secondary',
|
|
7
|
-
SECONDARY_LIGHTER: 'secondaryLighter',
|
|
8
5
|
DANGER: 'danger',
|
|
9
|
-
|
|
10
|
-
SUCCESS: 'success',
|
|
11
|
-
SUCCESS_LIGHTER: 'successLighter',
|
|
12
|
-
WARNING: 'warning',
|
|
13
|
-
WARNING_LIGHTER: 'warningLighter'
|
|
6
|
+
SUCCESS: 'success'
|
|
14
7
|
};
|
|
15
|
-
export const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
export const BG_APPEARANCE = {
|
|
9
|
+
DEFAULT: 'default',
|
|
10
|
+
ON_HOVER: 'onHover',
|
|
11
|
+
NONE: 'none'
|
|
12
|
+
};
|
|
13
|
+
export const BORDER_APPEARANCE = {
|
|
14
|
+
DEFAULT: 'default',
|
|
15
|
+
ON_HOVER: 'onHover',
|
|
16
|
+
NONE: 'none'
|
|
19
17
|
};
|
|
20
18
|
export const VARIANT = {
|
|
21
19
|
TEXT: 'text',
|
|
@@ -42,6 +40,10 @@ export const ICON_PLACEMENT = {
|
|
|
42
40
|
LEFT: 'left',
|
|
43
41
|
RIGHT: 'right'
|
|
44
42
|
};
|
|
43
|
+
export const PALETTE_SHADE = {
|
|
44
|
+
DEFAULT: 'default',
|
|
45
|
+
LIGHTER: 'lighter'
|
|
46
|
+
};
|
|
45
47
|
export const SHAPE = {
|
|
46
48
|
PILL: 'pill',
|
|
47
49
|
RECTANGLE: 'rectangle',
|
|
@@ -65,24 +67,16 @@ export const TYPOGRAPHY_SIZE_MAP = {
|
|
|
65
67
|
};
|
|
66
68
|
/** Default values referenced by both defaultProps and cssJSLogic */
|
|
67
69
|
|
|
68
|
-
export const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
export const DEFAULT_HOVER_APPEARANCE = {
|
|
73
|
-
bg: true,
|
|
74
|
-
text: true
|
|
75
|
-
};
|
|
76
|
-
export const DEFAULT_SELECTED_APPEARANCE = {
|
|
77
|
-
bg: true,
|
|
78
|
-
text: true
|
|
79
|
-
};
|
|
70
|
+
export const DEFAULT_PALETTE = PALETTE.DEFAULT;
|
|
71
|
+
export const DEFAULT_BG_APPEARANCE = BG_APPEARANCE.DEFAULT;
|
|
72
|
+
export const DEFAULT_BORDER_APPEARANCE = BORDER_APPEARANCE.DEFAULT;
|
|
80
73
|
export const DEFAULT_VARIANT = VARIANT.TEXT;
|
|
81
74
|
export const DEFAULT_SIZE = SIZE.MEDIUM;
|
|
82
75
|
export const DEFAULT_STATUS = STATUS.DEFAULT;
|
|
83
76
|
export const DEFAULT_LOADER_PLACEMENT = LOADER_PLACEMENT.OVERLAY;
|
|
84
77
|
export const DEFAULT_ICON_PLACEMENT = ICON_PLACEMENT.LEFT;
|
|
85
78
|
export const DEFAULT_ICON_SIZE = 16;
|
|
79
|
+
export const DEFAULT_PALETTE_SHADE = PALETTE_SHADE.DEFAULT;
|
|
86
80
|
export const DEFAULT_SHAPE = SHAPE.ROUNDED_RECTANGLE;
|
|
87
81
|
export const DEFAULT_DISABLED_APPEARANCE = DISABLED_APPEARANCE.DULL;
|
|
88
82
|
export const DEFAULT_BUTTON_TYPE = BUTTON_TYPE.BUTTON;
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
--local-button-gap: var(--zd_size8);
|
|
6
6
|
--local-button-padding-block: var(--zd_size6);
|
|
7
7
|
--local-button-padding-inline: var(--zd_size15);
|
|
8
|
+
--local-button-font-size: var(--zd_font_size13);
|
|
8
9
|
--local-loader-size: 16px;
|
|
9
10
|
--local-tick-size: 16px;
|
|
10
11
|
--local-button-height: auto;
|
|
11
12
|
--local-button-width: auto;
|
|
12
|
-
--local-button-
|
|
13
|
-
--local-button-
|
|
14
|
-
--local-button-transition-duration: var(--zd_transition2);
|
|
15
|
-
--local-button-cursor: pointer;
|
|
16
|
-
--local-button-strike-color: currentColor;
|
|
13
|
+
--local-button-overlay-opacity: 0.48;
|
|
14
|
+
--local-button-transition-duration: var(--zd_transition3);
|
|
17
15
|
}
|
|
18
16
|
|
|
19
17
|
.button {
|
|
@@ -21,20 +19,19 @@
|
|
|
21
19
|
composes: posrel pointer from '../../../common/common.module.css';
|
|
22
20
|
padding-block: var(--local-button-padding-block);
|
|
23
21
|
padding-inline: var(--local-button-padding-inline);
|
|
22
|
+
font-size: var(--local-button-font-size);
|
|
24
23
|
height: var(--local-button-height);
|
|
25
24
|
width: var(--local-button-width);
|
|
26
|
-
min-width: var(--local-button-min-width);
|
|
27
25
|
border-radius: var(--local-button-radius);
|
|
28
26
|
border-style: var(--local-button-border-style);
|
|
29
27
|
border-width: var(--local-button-border-width);
|
|
30
28
|
transition-duration: var(--local-button-transition-duration);
|
|
31
29
|
transition-timing-function: ease;
|
|
32
|
-
cursor: var(--local-button-cursor);
|
|
33
30
|
background-image: none;
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
.disabledPointer {
|
|
37
|
-
|
|
34
|
+
cursor: not-allowed;
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
.disabledOpac {
|
|
@@ -42,20 +39,7 @@
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
.loading {
|
|
45
|
-
|
|
46
|
-
composes: disabledOpac;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.variantText {
|
|
50
|
-
--local-button-min-width: var(--zd_size90);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.variantIcon {
|
|
54
|
-
--local-button-min-width: var(--zd_size28);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.variantIconWithText {
|
|
58
|
-
--local-button-min-width: var(--zd_size118);
|
|
42
|
+
cursor: progress;
|
|
59
43
|
}
|
|
60
44
|
|
|
61
45
|
.sizeSmall {
|
|
@@ -84,14 +68,6 @@
|
|
|
84
68
|
--local-button-width: 100%;
|
|
85
69
|
}
|
|
86
70
|
|
|
87
|
-
.sizeSmall.variantText {
|
|
88
|
-
--local-button-min-width: var(--zd_size50);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.sizeSmall.variantIconWithText {
|
|
92
|
-
--local-button-min-width: var(--zd_size78);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
71
|
.shapeRoundedRectangle {
|
|
96
72
|
--local-button-radius: 4px;
|
|
97
73
|
}
|
|
@@ -104,11 +80,9 @@
|
|
|
104
80
|
--local-button-radius: 0;
|
|
105
81
|
}
|
|
106
82
|
|
|
107
|
-
.
|
|
108
|
-
.loaderOverlay,
|
|
109
|
-
.successOverlay {
|
|
83
|
+
.loaderOverlay {
|
|
110
84
|
inset: 0 ;
|
|
111
|
-
|
|
85
|
+
composes: posab from '../../../common/common.module.css';
|
|
112
86
|
}
|
|
113
87
|
|
|
114
88
|
.contentWrapper {
|
|
@@ -124,17 +98,22 @@
|
|
|
124
98
|
|
|
125
99
|
.strike::after {
|
|
126
100
|
content: '';
|
|
127
|
-
|
|
101
|
+
position: absolute;
|
|
102
|
+
inset: 0 ;
|
|
128
103
|
pointer-events: none;
|
|
129
104
|
border-radius: var(--local-button-radius);
|
|
130
105
|
}
|
|
131
106
|
|
|
132
107
|
[dir=ltr] .strike::after {
|
|
133
|
-
background-image: repeating-linear-gradient(120deg,
|
|
108
|
+
background-image: repeating-linear-gradient(120deg, currentColor 0 1px, var(--dot_mirror) 1px 8px);
|
|
134
109
|
}
|
|
135
110
|
|
|
136
111
|
[dir=rtl] .strike::after {
|
|
137
|
-
background-image: repeating-linear-gradient(-120deg,
|
|
112
|
+
background-image: repeating-linear-gradient(-120deg, currentColor 0 1px, var(--dot_mirror) 1px 8px);
|
|
138
113
|
}
|
|
139
114
|
|
|
115
|
+
.successOverlay {
|
|
116
|
+
inset: 0 ;
|
|
117
|
+
composes: posab from '../../../common/common.module.css';
|
|
118
|
+
}
|
|
140
119
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import style from "./Button_v1.module.css";
|
|
1
2
|
import compileClassNames from '@zohodesk/utils/es/compileClassNames';
|
|
2
|
-
import { DUMMY_OBJECT } from '@zohodesk/dotkit/es/utils/constants';
|
|
3
|
-
import { DISABLED_APPEARANCE, LOADER_PLACEMENT, SHAPE, SIZE, STATUS, DEFAULT_APPEARANCE, DEFAULT_HOVER_APPEARANCE, DEFAULT_SELECTED_APPEARANCE } from "../constants";
|
|
4
3
|
import buttonResetStyle from "../../../semantic/Button/semanticButton.module.css";
|
|
5
4
|
import getPaletteClasses from "../../helpers/colorHelpers/colorHelper";
|
|
6
|
-
import
|
|
5
|
+
import { DUMMY_OBJECT } from '@zohodesk/dotkit/es/utils/constants';
|
|
6
|
+
import { DISABLED_APPEARANCE, LOADER_PLACEMENT, SHAPE, SIZE, STATUS } from "../constants";
|
|
7
7
|
|
|
8
8
|
const capitalize = (value = '') => value.charAt(0).toUpperCase() + value.slice(1);
|
|
9
9
|
|
|
@@ -12,13 +12,13 @@ export default function cssJSLogic({
|
|
|
12
12
|
}) {
|
|
13
13
|
const {
|
|
14
14
|
palette,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
bgAppearance,
|
|
16
|
+
borderAppearance,
|
|
17
|
+
paletteShade,
|
|
18
18
|
size,
|
|
19
|
-
variant,
|
|
20
19
|
status,
|
|
21
20
|
isDisabled,
|
|
21
|
+
isReadOnly,
|
|
22
22
|
isSelected,
|
|
23
23
|
shape,
|
|
24
24
|
loaderPlacement,
|
|
@@ -28,72 +28,54 @@ export default function cssJSLogic({
|
|
|
28
28
|
const {
|
|
29
29
|
wrapper: wrapperClass = '',
|
|
30
30
|
text: textClassCustom = '',
|
|
31
|
-
icon: iconClassCustom = ''
|
|
32
|
-
loader: loaderClassCustom = '',
|
|
33
|
-
success: successClassCustom = ''
|
|
31
|
+
icon: iconClassCustom = ''
|
|
34
32
|
} = customClass;
|
|
35
33
|
const isLoading = status === STATUS.LOADING;
|
|
36
34
|
const isSuccess = status === STATUS.SUCCESS;
|
|
37
|
-
const isInteractive = !isDisabled && !
|
|
35
|
+
const isInteractive = !isDisabled && !isReadOnly;
|
|
38
36
|
const overlayActive = (isLoading || isSuccess) && loaderPlacement === LOADER_PLACEMENT.OVERLAY;
|
|
39
|
-
const mergedAppearance = { ...DEFAULT_APPEARANCE,
|
|
40
|
-
...(appearance || {})
|
|
41
|
-
};
|
|
42
|
-
const mergedHoverAppearance = { ...DEFAULT_HOVER_APPEARANCE,
|
|
43
|
-
...(hoverAppearance || {})
|
|
44
|
-
};
|
|
45
|
-
const mergedSelectedAppearance = { ...DEFAULT_SELECTED_APPEARANCE,
|
|
46
|
-
...(selectedAppearance || {})
|
|
47
|
-
};
|
|
48
37
|
const {
|
|
49
38
|
bg,
|
|
50
|
-
selectedBg,
|
|
51
39
|
hoverBg,
|
|
52
40
|
focusBg,
|
|
53
41
|
activeBg,
|
|
54
42
|
text,
|
|
55
|
-
selectedText,
|
|
56
43
|
hoverText,
|
|
57
44
|
focusText,
|
|
58
45
|
activeText,
|
|
59
46
|
border,
|
|
60
|
-
selectedBorder,
|
|
61
47
|
hoverBorder,
|
|
62
48
|
focusBorder,
|
|
63
49
|
activeBorder
|
|
64
50
|
} = getPaletteClasses({
|
|
65
51
|
palette,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
52
|
+
bgAppearance,
|
|
53
|
+
borderAppearance,
|
|
54
|
+
paletteShade,
|
|
55
|
+
isSelected
|
|
69
56
|
});
|
|
70
57
|
const sizeClass = size ? style[`size${capitalize(size)}`] : '';
|
|
71
58
|
const shapeClass = shape ? style[`shape${capitalize(shape)}`] : '';
|
|
72
|
-
const variantClass = variant ? style[`variant${capitalize(variant)}`] : '';
|
|
73
59
|
const shouldStrike = disabledAppearance === DISABLED_APPEARANCE.STRIKE && isDisabled;
|
|
74
60
|
const buttonClassName = compileClassNames({
|
|
75
61
|
[buttonResetStyle.buttonReset]: true,
|
|
76
62
|
[style.button]: true,
|
|
77
|
-
[bg]: !!bg
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
[
|
|
86
|
-
[
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[hoverBorder]: !!hoverBorder && isInteractive && !isSelected,
|
|
90
|
-
[focusBorder]: !!focusBorder && isInteractive && !isSelected,
|
|
91
|
-
[activeBorder]: !!activeBorder && isInteractive && !isSelected,
|
|
63
|
+
[bg]: !!bg,
|
|
64
|
+
[hoverBg]: !!hoverBg && isInteractive,
|
|
65
|
+
[focusBg]: !!focusBg && isInteractive,
|
|
66
|
+
[activeBg]: !!activeBg && isInteractive,
|
|
67
|
+
[text]: !!text,
|
|
68
|
+
[hoverText]: !!hoverText && isInteractive,
|
|
69
|
+
[focusText]: !!focusText && isInteractive,
|
|
70
|
+
[activeText]: !!activeText && isInteractive,
|
|
71
|
+
[border]: !!border,
|
|
72
|
+
[hoverBorder]: !!hoverBorder && isInteractive,
|
|
73
|
+
[focusBorder]: !!focusBorder && isInteractive,
|
|
74
|
+
[activeBorder]: !!activeBorder && isInteractive,
|
|
92
75
|
[sizeClass]: !!sizeClass,
|
|
93
76
|
[shapeClass]: !!shapeClass,
|
|
94
|
-
[
|
|
95
|
-
[style.
|
|
96
|
-
[style.disabledPointer]: isDisabled,
|
|
77
|
+
[style.disabledOpac]: isReadOnly || isDisabled && disabledAppearance === DISABLED_APPEARANCE.DULL,
|
|
78
|
+
[style.disabledPointer]: isReadOnly || isDisabled,
|
|
97
79
|
[style.loading]: isLoading,
|
|
98
80
|
[style.strike]: shouldStrike,
|
|
99
81
|
[wrapperClass]: !!wrapperClass
|
|
@@ -107,19 +89,9 @@ export default function cssJSLogic({
|
|
|
107
89
|
return {
|
|
108
90
|
buttonClassName,
|
|
109
91
|
textClassName,
|
|
110
|
-
iconClassName,
|
|
111
92
|
contentWrapperClass: overlayActive ? style.overlayHidden : style.contentWrapper,
|
|
112
93
|
loaderOverlayClass: style.loaderOverlay,
|
|
113
94
|
successOverlayClass: style.successOverlay,
|
|
114
|
-
|
|
115
|
-
wrapper: compileClassNames({
|
|
116
|
-
[loaderClassCustom]: !!loaderClassCustom
|
|
117
|
-
})
|
|
118
|
-
},
|
|
119
|
-
successClassName: {
|
|
120
|
-
wrapper: compileClassNames({
|
|
121
|
-
[successClassCustom]: !!successClassCustom
|
|
122
|
-
})
|
|
123
|
-
}
|
|
95
|
+
iconClassName
|
|
124
96
|
};
|
|
125
97
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { DUMMY_FUNCTION, DUMMY_OBJECT } from '@zohodesk/dotkit/es/utils/constants';
|
|
2
|
-
import { DEFAULT_VARIANT, DEFAULT_SIZE, DEFAULT_STATUS, DEFAULT_LOADER_PLACEMENT, DEFAULT_ICON_PLACEMENT, DEFAULT_ICON_SIZE, DEFAULT_SHAPE, DEFAULT_DISABLED_APPEARANCE, DEFAULT_BUTTON_TYPE } from "../constants";
|
|
2
|
+
import { DEFAULT_PALETTE, DEFAULT_BG_APPEARANCE, DEFAULT_BORDER_APPEARANCE, DEFAULT_VARIANT, DEFAULT_SIZE, DEFAULT_STATUS, DEFAULT_LOADER_PLACEMENT, DEFAULT_ICON_PLACEMENT, DEFAULT_ICON_SIZE, DEFAULT_PALETTE_SHADE, DEFAULT_SHAPE, DEFAULT_DISABLED_APPEARANCE, DEFAULT_BUTTON_TYPE } from "../constants";
|
|
3
3
|
const defaultProps = {
|
|
4
|
-
palette:
|
|
4
|
+
palette: DEFAULT_PALETTE,
|
|
5
|
+
bgAppearance: DEFAULT_BG_APPEARANCE,
|
|
6
|
+
borderAppearance: DEFAULT_BORDER_APPEARANCE,
|
|
5
7
|
variant: DEFAULT_VARIANT,
|
|
6
8
|
size: DEFAULT_SIZE,
|
|
7
9
|
status: DEFAULT_STATUS,
|
|
8
10
|
loaderPlacement: DEFAULT_LOADER_PLACEMENT,
|
|
9
11
|
iconPlacement: DEFAULT_ICON_PLACEMENT,
|
|
10
12
|
iconSize: DEFAULT_ICON_SIZE,
|
|
13
|
+
paletteShade: DEFAULT_PALETTE_SHADE,
|
|
11
14
|
disabledAppearance: DEFAULT_DISABLED_APPEARANCE,
|
|
12
15
|
isDisabled: false,
|
|
16
|
+
isReadOnly: false,
|
|
13
17
|
isSelected: false,
|
|
14
18
|
shape: DEFAULT_SHAPE,
|
|
15
19
|
type: DEFAULT_BUTTON_TYPE,
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { PALETTE, VARIANT, SIZE, STATUS, LOADER_PLACEMENT, ICON_PLACEMENT, SHAPE, DISABLED_APPEARANCE, BUTTON_TYPE } from "../constants";
|
|
2
|
+
import { PALETTE, BG_APPEARANCE, BORDER_APPEARANCE, VARIANT, SIZE, STATUS, LOADER_PLACEMENT, ICON_PLACEMENT, PALETTE_SHADE, SHAPE, DISABLED_APPEARANCE, BUTTON_TYPE } from "../constants";
|
|
3
3
|
const renderSlotType = PropTypes.oneOfType([PropTypes.node, PropTypes.func]);
|
|
4
|
-
const paletteNames = Object.values(PALETTE);
|
|
5
|
-
const bgBorderValueType = PropTypes.oneOfType([PropTypes.oneOf([...paletteNames, 'transparent']), PropTypes.bool]);
|
|
6
|
-
const textValueType = PropTypes.oneOfType([PropTypes.oneOf([...paletteNames, 'black', 'white']), PropTypes.bool]);
|
|
7
|
-
const appearanceType = PropTypes.shape({
|
|
8
|
-
bg: bgBorderValueType,
|
|
9
|
-
border: bgBorderValueType,
|
|
10
|
-
text: textValueType
|
|
11
|
-
});
|
|
12
4
|
const propTypes = {
|
|
13
5
|
palette: PropTypes.oneOf(Object.values(PALETTE)),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
selectedAppearance: appearanceType,
|
|
6
|
+
bgAppearance: PropTypes.oneOf(Object.values(BG_APPEARANCE)),
|
|
7
|
+
borderAppearance: PropTypes.oneOf(Object.values(BORDER_APPEARANCE)),
|
|
17
8
|
variant: PropTypes.oneOf(Object.values(VARIANT)),
|
|
18
9
|
size: PropTypes.oneOf(Object.values(SIZE)),
|
|
19
10
|
status: PropTypes.oneOf(Object.values(STATUS)),
|
|
@@ -21,6 +12,7 @@ const propTypes = {
|
|
|
21
12
|
iconName: PropTypes.string,
|
|
22
13
|
iconSize: PropTypes.number,
|
|
23
14
|
iconPlacement: PropTypes.oneOf(Object.values(ICON_PLACEMENT)),
|
|
15
|
+
paletteShade: PropTypes.oneOf(Object.values(PALETTE_SHADE)),
|
|
24
16
|
disabledAppearance: PropTypes.oneOf(Object.values(DISABLED_APPEARANCE)),
|
|
25
17
|
renderIcon: renderSlotType,
|
|
26
18
|
renderBefore: renderSlotType,
|
|
@@ -31,31 +23,21 @@ const propTypes = {
|
|
|
31
23
|
type: PropTypes.oneOf(Object.values(BUTTON_TYPE)),
|
|
32
24
|
onClick: PropTypes.func,
|
|
33
25
|
isDisabled: PropTypes.bool,
|
|
26
|
+
isReadOnly: PropTypes.bool,
|
|
34
27
|
isSelected: PropTypes.bool,
|
|
35
28
|
shape: PropTypes.oneOf(Object.values(SHAPE)),
|
|
36
29
|
title: PropTypes.string,
|
|
37
30
|
customClass: PropTypes.shape({
|
|
38
31
|
wrapper: PropTypes.string,
|
|
39
|
-
text: PropTypes.string
|
|
40
|
-
icon: PropTypes.string,
|
|
41
|
-
loader: PropTypes.string,
|
|
42
|
-
success: PropTypes.string
|
|
32
|
+
text: PropTypes.string
|
|
43
33
|
}),
|
|
44
34
|
customProps: PropTypes.shape({
|
|
45
35
|
text: PropTypes.object,
|
|
46
36
|
icon: PropTypes.object
|
|
47
37
|
}),
|
|
48
|
-
customAttributes: PropTypes.
|
|
49
|
-
button: PropTypes.object,
|
|
50
|
-
contentWrapper: PropTypes.object,
|
|
51
|
-
loader: PropTypes.object,
|
|
52
|
-
success: PropTypes.object,
|
|
53
|
-
icon: PropTypes.object,
|
|
54
|
-
text: PropTypes.object
|
|
55
|
-
}),
|
|
38
|
+
customAttributes: PropTypes.object,
|
|
56
39
|
a11yAttributes: PropTypes.object,
|
|
57
40
|
customId: PropTypes.string,
|
|
58
|
-
testId: PropTypes.string
|
|
59
|
-
dataSelectorId: PropTypes.string
|
|
41
|
+
testId: PropTypes.string
|
|
60
42
|
};
|
|
61
43
|
export default propTypes;
|
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
/* Theme-aware Brand Palette (changes with CTA theme selection) */
|
|
2
2
|
.bg-brand-80 {
|
|
3
|
-
background-color: var(--
|
|
3
|
+
background-color: var(--zdt_v1_palette_brand_bg);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.hover\:bg-brand-80:hover {
|
|
7
|
-
background-color: var(--
|
|
7
|
+
background-color: var(--zdt_v1_palette_brand_bg);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.focus\:bg-brand-80:focus {
|
|
11
|
-
background-color: var(--
|
|
11
|
+
background-color: var(--zdt_v1_palette_brand_bg);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.active\:bg-brand-80:active {
|
|
15
|
-
background-color: var(--
|
|
15
|
+
background-color: var(--zdt_v1_palette_brand_bg);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.selected\:bg-brand-80 {
|
|
19
|
-
background-color: var(--
|
|
19
|
+
background-color: var(--zdt_v1_palette_brand_bg);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.bg-brand-100 {
|
|
23
|
-
background-color: var(--
|
|
23
|
+
background-color: var(--zdt_v1_palette_brand_hover_bg);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.hover\:bg-brand-100:hover {
|
|
27
|
-
background-color: var(--
|
|
27
|
+
background-color: var(--zdt_v1_palette_brand_hover_bg);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.focus\:bg-brand-100:focus {
|
|
31
|
-
background-color: var(--
|
|
31
|
+
background-color: var(--zdt_v1_palette_brand_hover_bg);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.active\:bg-brand-100:active {
|
|
35
|
-
background-color: var(--
|
|
35
|
+
background-color: var(--zdt_v1_palette_brand_hover_bg);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.selected\:bg-brand-100 {
|
|
39
|
-
background-color: var(--
|
|
39
|
+
background-color: var(--zdt_v1_palette_brand_hover_bg);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.bg-brand-10 {
|
|
43
|
-
background-color: var(--
|
|
43
|
+
background-color: var(--zdt_v1_palette_brand_light_bg);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
.hover\:bg-brand-10:hover {
|
|
47
|
-
background-color: var(--
|
|
47
|
+
background-color: var(--zdt_v1_palette_brand_light_bg);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.focus\:bg-brand-10:focus {
|
|
51
|
-
background-color: var(--
|
|
51
|
+
background-color: var(--zdt_v1_palette_brand_light_bg);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.active\:bg-brand-10:active {
|
|
55
|
-
background-color: var(--
|
|
55
|
+
background-color: var(--zdt_v1_palette_brand_light_bg);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.selected\:bg-brand-10 {
|
|
59
|
-
background-color: var(--
|
|
59
|
+
background-color: var(--zdt_v1_palette_brand_light_bg);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/* color not available */
|
|
63
63
|
.bg-brand-20 {
|
|
64
|
-
background-color: var(--
|
|
64
|
+
background-color: var(--zdt_v1_palette_brand_light_hover_bg);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.hover\:bg-brand-20:hover {
|
|
68
|
-
background-color: var(--
|
|
68
|
+
background-color: var(--zdt_v1_palette_brand_light_hover_bg);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.focus\:bg-brand-20:focus {
|
|
72
|
-
background-color: var(--
|
|
72
|
+
background-color: var(--zdt_v1_palette_brand_light_hover_bg);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.active\:bg-brand-20:active {
|
|
76
|
-
background-color: var(--
|
|
76
|
+
background-color: var(--zdt_v1_palette_brand_light_hover_bg);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.selected\:bg-brand-20 {
|
|
80
|
-
background-color: var(--
|
|
80
|
+
background-color: var(--zdt_v1_palette_brand_light_hover_bg);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/* Static Grey Palette */
|
|
@@ -122,64 +122,64 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.bg-grey-10 {
|
|
125
|
-
background-color: var(--
|
|
125
|
+
background-color: var(--zdt_v1_palette_grey_light_bg);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
.hover\:bg-grey-10:hover {
|
|
129
|
-
background-color: var(--
|
|
129
|
+
background-color: var(--zdt_v1_palette_grey_light_bg);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.focus\:bg-grey-10:focus {
|
|
133
|
-
background-color: var(--
|
|
133
|
+
background-color: var(--zdt_v1_palette_grey_light_bg);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
.active\:bg-grey-10:active {
|
|
137
|
-
background-color: var(--
|
|
137
|
+
background-color: var(--zdt_v1_palette_grey_light_bg);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
.selected\:bg-grey-10 {
|
|
141
|
-
background-color: var(--
|
|
141
|
+
background-color: var(--zdt_v1_palette_grey_light_bg);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.bg-grey-
|
|
144
|
+
.bg-grey-15 {
|
|
145
145
|
background-color: var(--zdt_v1_palette_grey_light_hover_bg);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.hover\:bg-grey-
|
|
148
|
+
.hover\:bg-grey-15:hover {
|
|
149
149
|
background-color: var(--zdt_v1_palette_grey_light_hover_bg);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
.focus\:bg-grey-
|
|
152
|
+
.focus\:bg-grey-15:focus {
|
|
153
153
|
background-color: var(--zdt_v1_palette_grey_light_hover_bg);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
.active\:bg-grey-
|
|
156
|
+
.active\:bg-grey-15:active {
|
|
157
157
|
background-color: var(--zdt_v1_palette_grey_light_hover_bg);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
.selected\:bg-grey-
|
|
160
|
+
.selected\:bg-grey-15 {
|
|
161
161
|
background-color: var(--zdt_v1_palette_grey_light_hover_bg);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
/* Static Blue Palette */
|
|
165
165
|
.bg-blue-80 {
|
|
166
|
-
background-color: var(--
|
|
166
|
+
background-color: var(--zdt_v1_palette_blue_bg);
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
.hover\:bg-blue-80:hover {
|
|
170
|
-
background-color: var(--
|
|
170
|
+
background-color: var(--zdt_v1_palette_blue_bg);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
.focus\:bg-blue-80:focus {
|
|
174
|
-
background-color: var(--
|
|
174
|
+
background-color: var(--zdt_v1_palette_blue_bg);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
.active\:bg-blue-80:active {
|
|
178
|
-
background-color: var(--
|
|
178
|
+
background-color: var(--zdt_v1_palette_blue_bg);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
.selected\:bg-blue-80 {
|
|
182
|
-
background-color: var(--
|
|
182
|
+
background-color: var(--zdt_v1_palette_blue_bg);
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
.bg-blue-100 {
|
|
@@ -569,23 +569,23 @@
|
|
|
569
569
|
|
|
570
570
|
/* Utility Colors */
|
|
571
571
|
.bg-transparent {
|
|
572
|
-
background-color: var(--
|
|
572
|
+
background-color: var(--dot_mirror);
|
|
573
573
|
}
|
|
574
574
|
|
|
575
575
|
.hover\:bg-transparent:hover {
|
|
576
|
-
background-color: var(--
|
|
576
|
+
background-color: var(--dot_mirror);
|
|
577
577
|
}
|
|
578
578
|
|
|
579
579
|
.focus\:bg-transparent:focus {
|
|
580
|
-
background-color: var(--
|
|
580
|
+
background-color: var(--dot_mirror);
|
|
581
581
|
}
|
|
582
582
|
|
|
583
583
|
.active\:bg-transparent:active {
|
|
584
|
-
background-color: var(--
|
|
584
|
+
background-color: var(--dot_mirror);
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
.selected\:bg-transparent {
|
|
588
|
-
background-color: var(--
|
|
588
|
+
background-color: var(--dot_mirror);
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
.bg-white {
|