@semcore/button 5.42.1 → 5.43.0-prerelease.2
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/CHANGELOG.md +6 -0
- package/lib/cjs/component/AbstractButton/AbstractButton.js +1 -0
- package/lib/cjs/component/AbstractButton/AbstractButton.js.map +1 -1
- package/lib/cjs/component/Button/Button.js +28 -27
- package/lib/cjs/component/Button/Button.js.map +1 -1
- package/lib/cjs/component/Button/Button.type.js.map +1 -1
- package/lib/cjs/component/Button/button.shadow.css +17 -1
- package/lib/cjs/component/ButtonLink/ButtonLink.js +20 -20
- package/lib/es6/component/AbstractButton/AbstractButton.js +1 -0
- package/lib/es6/component/AbstractButton/AbstractButton.js.map +1 -1
- package/lib/es6/component/Button/Button.js +28 -27
- package/lib/es6/component/Button/Button.js.map +1 -1
- package/lib/es6/component/Button/Button.type.js.map +1 -1
- package/lib/es6/component/Button/button.shadow.css +17 -1
- package/lib/es6/component/ButtonLink/ButtonLink.js +20 -20
- package/lib/esm/component/AbstractButton/AbstractButton.mjs +30 -30
- package/lib/esm/component/Button/Button.mjs +66 -65
- package/lib/esm/component/ButtonLink/ButtonLink.mjs +59 -59
- package/lib/types/component/Button/Button.type.d.ts +6 -2
- package/package.json +1 -1
- package/src/component/AbstractButton/AbstractButton.tsx +6 -0
- package/src/component/Button/Button.type.ts +7 -2
- package/src/component/Button/button.shadow.css +17 -1
|
@@ -10,12 +10,16 @@ export type ButtonSize = 'l' | 'm';
|
|
|
10
10
|
* @default secondary
|
|
11
11
|
*/
|
|
12
12
|
type Use = 'primary' | 'secondary' | 'tertiary';
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated don't use it. use `danger` for incorrect or danger behavior and `brand` for the orange one.
|
|
15
|
+
*/
|
|
16
|
+
type DeprecatedTheme = 'warning';
|
|
13
17
|
/** Button theme */
|
|
14
|
-
type Theme = 'info' | 'success' | '
|
|
18
|
+
type Theme = 'info' | 'success' | 'brand' | 'danger' | 'muted' | 'invert';
|
|
15
19
|
/** @deprecated */
|
|
16
20
|
export interface IButtonProps extends ButtonProps, UnknownProperties {
|
|
17
21
|
}
|
|
18
|
-
export type ButtonProps = AbstractButtonProps<ButtonSize, Use, Theme>;
|
|
22
|
+
export type ButtonProps = AbstractButtonProps<ButtonSize, Use, Theme | DeprecatedTheme>;
|
|
19
23
|
/** @deprecated */
|
|
20
24
|
export interface IButtonTextProps extends ButtonTextProps, UnknownProperties {
|
|
21
25
|
}
|
package/package.json
CHANGED
|
@@ -50,6 +50,12 @@ export abstract class AbstractButton extends Component<Props, {}, {}> {
|
|
|
50
50
|
`'title' or 'aria-label' or 'aria-labelledby' are required props for buttons without text content`,
|
|
51
51
|
this.asProps['data-ui-name'] || AbstractButton.displayName,
|
|
52
52
|
);
|
|
53
|
+
|
|
54
|
+
logger.warn(
|
|
55
|
+
this.asProps.theme === 'warning',
|
|
56
|
+
'Warning theme is deprecated and will be removed in the next major release.',
|
|
57
|
+
this.asProps['data-ui-name'] || AbstractButton.displayName,
|
|
58
|
+
);
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
const ariaLabelledby = this.asProps['aria-labelledby'];
|
|
@@ -18,12 +18,17 @@ export type ButtonSize = 'l' | 'm';
|
|
|
18
18
|
*/
|
|
19
19
|
type Use = 'primary' | 'secondary' | 'tertiary';
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated don't use it. use `danger` for incorrect or danger behavior and `brand` for the orange one.
|
|
23
|
+
*/
|
|
24
|
+
type DeprecatedTheme = 'warning';
|
|
25
|
+
|
|
21
26
|
/** Button theme */
|
|
22
|
-
type Theme = 'info' | 'success' | '
|
|
27
|
+
type Theme = 'info' | 'success' | 'brand' | 'danger' | 'muted' | 'invert';
|
|
23
28
|
|
|
24
29
|
/** @deprecated */
|
|
25
30
|
export interface IButtonProps extends ButtonProps, UnknownProperties {}
|
|
26
|
-
export type ButtonProps = AbstractButtonProps<ButtonSize, Use, Theme>;
|
|
31
|
+
export type ButtonProps = AbstractButtonProps<ButtonSize, Use, Theme | DeprecatedTheme>;
|
|
27
32
|
|
|
28
33
|
/** @deprecated */
|
|
29
34
|
export interface IButtonTextProps extends ButtonTextProps, UnknownProperties {}
|
|
@@ -100,6 +100,22 @@ SButton[theme='primary-success'] {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
SButton[theme='primary-brand'] {
|
|
104
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
105
|
+
background-color: var(--intergalactic-control-primary-brand, #ff642d);
|
|
106
|
+
|
|
107
|
+
&:hover {
|
|
108
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
109
|
+
background-color: var(--intergalactic-control-primary-brand-hover, #c33909);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&:active,
|
|
113
|
+
&[active] {
|
|
114
|
+
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
115
|
+
background-color: var(--intergalactic-control-primary-brand-active, #8b1500);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
103
119
|
SButton[theme='primary-warning'] {
|
|
104
120
|
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
105
121
|
background-color: var(--intergalactic-control-primary-brand, #ff642d);
|
|
@@ -112,7 +128,7 @@ SButton[theme='primary-warning'] {
|
|
|
112
128
|
&:active,
|
|
113
129
|
&[active] {
|
|
114
130
|
color: var(--intergalactic-text-primary-invert, #ffffff);
|
|
115
|
-
background-color: var(--intergalactic-control-primary-brand-active, #
|
|
131
|
+
background-color: var(--intergalactic-control-primary-brand-active, #8b1500);
|
|
116
132
|
}
|
|
117
133
|
}
|
|
118
134
|
|