@semcore/button 5.42.1 → 16.0.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 +3 -3
- package/lib/cjs/component/AbstractButton/AbstractButton.js.map +1 -1
- package/lib/cjs/component/AbstractButton/AbstractButton.type.js.map +1 -1
- package/lib/cjs/component/Button/Button.js +28 -33
- package/lib/cjs/component/Button/Button.js.map +1 -1
- package/lib/cjs/component/Button/button.shadow.css +1 -9
- package/lib/cjs/component/ButtonLink/ButtonLink.js +22 -27
- package/lib/cjs/component/ButtonLink/ButtonLink.js.map +1 -1
- package/lib/cjs/component/ButtonLink/ButtonLink.type.js.map +1 -1
- package/lib/cjs/component/ButtonLink/buttonLink.shadow.css +1 -10
- package/lib/es6/component/AbstractButton/AbstractButton.js +3 -3
- package/lib/es6/component/AbstractButton/AbstractButton.js.map +1 -1
- package/lib/es6/component/AbstractButton/AbstractButton.type.js.map +1 -1
- package/lib/es6/component/Button/Button.js +28 -31
- package/lib/es6/component/Button/Button.js.map +1 -1
- package/lib/es6/component/Button/button.shadow.css +1 -9
- package/lib/es6/component/ButtonLink/ButtonLink.js +22 -25
- package/lib/es6/component/ButtonLink/ButtonLink.js.map +1 -1
- package/lib/es6/component/ButtonLink/ButtonLink.type.js.map +1 -1
- package/lib/es6/component/ButtonLink/buttonLink.shadow.css +1 -10
- package/lib/esm/component/AbstractButton/AbstractButton.mjs +3 -3
- package/lib/esm/component/Button/Button.mjs +63 -67
- package/lib/esm/component/ButtonLink/ButtonLink.mjs +55 -59
- package/lib/types/component/AbstractButton/AbstractButton.type.d.ts +1 -1
- package/package.json +6 -9
- package/src/component/AbstractButton/AbstractButton.tsx +3 -3
- package/src/component/AbstractButton/AbstractButton.type.ts +1 -1
- package/src/component/Button/Button.tsx +2 -10
- package/src/component/Button/button.shadow.css +1 -9
- package/src/component/ButtonLink/ButtonLink.tsx +2 -4
- package/src/component/ButtonLink/ButtonLink.type.ts +1 -1
- package/src/component/ButtonLink/buttonLink.shadow.css +1 -10
|
@@ -1,82 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { sstyled as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import p from "
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
import m from "@semcore/utils/lib/enhances/resolveColorEnhance";
|
|
14
|
-
var B = (
|
|
1
|
+
import a from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import y from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import d from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import h from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
+
import S from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
+
import r from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
+
import { sstyled as i, createComponent as x, assignProps as v } from "@semcore/core";
|
|
8
|
+
import u from "react";
|
|
9
|
+
import { Box as c } from "@semcore/flex-box";
|
|
10
|
+
import { AbstractButton as p } from "../AbstractButton/AbstractButton.mjs";
|
|
11
|
+
import f from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
12
|
+
var m = (
|
|
15
13
|
/*__reshadow_css_start__*/
|
|
16
|
-
(
|
|
14
|
+
(i.insert(
|
|
17
15
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
19
|
-
"
|
|
16
|
+
".___SButton_vy4nu_gg_{display:inline-flex;font-family:inherit;font-size:var(--intergalactic-fs-200, 14px);color:var(--intergalactic-text-link, #006dca);line-height:normal;position:relative;cursor:pointer;border:0;padding:0;margin:0;box-shadow:none;-webkit-tap-highlight-color:transparent;background:0 0;transition:color .15s ease-in-out}.___SButton_vy4nu_gg_,.___SButton_vy4nu_gg_:active{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SButton_vy4nu_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SButton_vy4nu_gg_::-moz-focus-inner{border:0;padding:0}.___SButton_vy4nu_gg_.__active_vy4nu_gg_,.___SButton_vy4nu_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SButton_vy4nu_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SButton_vy4nu_gg_.__active_vy4nu_gg_ .___SText_vy4nu_gg_,.___SButton_vy4nu_gg_:active .___SText_vy4nu_gg_{border-color:currentColor}@media (hover:hover){.___SButton_vy4nu_gg_:hover .___SText_vy4nu_gg_{border-color:currentColor}}.___SButton_vy4nu_gg_.__enableVisited_vy4nu_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SButton_vy4nu_gg_.__enableVisited_vy4nu_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SButton_vy4nu_gg_ .___SText_vy4nu_gg_{border-bottom-width:1px;border-bottom-style:solid;border-color:transparent;transition:border-bottom-color .15s ease-in-out}.___SButton_vy4nu_gg_.__disabled_vy4nu_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SButton_vy4nu_gg_._use_secondary_vy4nu_gg_{color:var(--intergalactic-text-hint, #6c6e79)}.___SButton_vy4nu_gg_._use_secondary_vy4nu_gg_.__active_vy4nu_gg_,.___SButton_vy4nu_gg_._use_secondary_vy4nu_gg_:active{color:var(--intergalactic-text-hint-hover-active, #484a54)}@media (hover:hover){.___SButton_vy4nu_gg_._use_secondary_vy4nu_gg_:hover{color:var(--intergalactic-text-hint-hover-active, #484a54)}}.___SButton_vy4nu_gg_._use_secondary_vy4nu_gg_ .___SText_vy4nu_gg_{border-bottom-width:1px;border-bottom-style:dashed;border-color:currentColor}.___SAddon_vy4nu_gg_,.___SInner_vy4nu_gg_{display:inline-flex;justify-content:center;align-items:center}.___SInner_vy4nu_gg_{height:100%;width:100%}.___SAddon_vy4nu_gg_{vertical-align:middle;pointer-events:none}.___SButton_vy4nu_gg_ .___SAddon_vy4nu_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SButton_vy4nu_gg_ .___SAddon_vy4nu_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SButton_vy4nu_gg_.__text-color_vy4nu_gg_{color:var(--text-color_vy4nu)}.___SButton_vy4nu_gg_.__text-color_vy4nu_gg_.__active_vy4nu_gg_,.___SButton_vy4nu_gg_.__text-color_vy4nu_gg_:active{color:var(--text-color_vy4nu);filter:brightness(.8)}@media (hover:hover){.___SButton_vy4nu_gg_.__text-color_vy4nu_gg_:hover{color:var(--text-color_vy4nu);filter:brightness(.8)}}.___SButton_vy4nu_gg_._size_100_vy4nu_gg_{font-size:var(--intergalactic-fs-100, 12px);line-height:var(--intergalactic-lh-100, 133%)}.___SButton_vy4nu_gg_._size_200_vy4nu_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SButton_vy4nu_gg_._size_300_vy4nu_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SButton_vy4nu_gg_._size_400_vy4nu_gg_{font-size:var(--intergalactic-fs-400, 20px);line-height:var(--intergalactic-lh-400, 120%)}.___SButton_vy4nu_gg_._size_500_vy4nu_gg_{font-size:var(--intergalactic-fs-500, 24px);line-height:var(--intergalactic-lh-500, 117%)}.___SButton_vy4nu_gg_._size_600_vy4nu_gg_{font-size:var(--intergalactic-fs-600, 32px);line-height:var(--intergalactic-lh-600, 125%)}.___SButton_vy4nu_gg_._size_700_vy4nu_gg_{font-size:var(--intergalactic-fs-700, 36px);line-height:var(--intergalactic-lh-700, 110%)}.___SButton_vy4nu_gg_._size_800_vy4nu_gg_{font-size:var(--intergalactic-fs-800, 48px);line-height:var(--intergalactic-lh-800, 117%)}@media (prefers-reduced-motion){.___SButton_vy4nu_gg_,.___SText_vy4nu_gg_{transition:none}}",
|
|
17
|
+
"vy4nu_gg_"
|
|
20
18
|
), {
|
|
21
|
-
__SButton: "
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"--text-color": "--text-color_15j2k"
|
|
19
|
+
__SButton: "___SButton_vy4nu_gg_",
|
|
20
|
+
_disabled: "__disabled_vy4nu_gg_",
|
|
21
|
+
__SInner: "___SInner_vy4nu_gg_",
|
|
22
|
+
__SAddon: "___SAddon_vy4nu_gg_",
|
|
23
|
+
_size_100: "_size_100_vy4nu_gg_",
|
|
24
|
+
_size_200: "_size_200_vy4nu_gg_",
|
|
25
|
+
_size_300: "_size_300_vy4nu_gg_",
|
|
26
|
+
_size_400: "_size_400_vy4nu_gg_",
|
|
27
|
+
_size_500: "_size_500_vy4nu_gg_",
|
|
28
|
+
_size_600: "_size_600_vy4nu_gg_",
|
|
29
|
+
_size_700: "_size_700_vy4nu_gg_",
|
|
30
|
+
_size_800: "_size_800_vy4nu_gg_",
|
|
31
|
+
__SText: "___SText_vy4nu_gg_",
|
|
32
|
+
_active: "__active_vy4nu_gg_",
|
|
33
|
+
_enableVisited: "__enableVisited_vy4nu_gg_",
|
|
34
|
+
_use_secondary: "_use_secondary_vy4nu_gg_",
|
|
35
|
+
"_text-color": "__text-color_vy4nu_gg_",
|
|
36
|
+
"--text-color": "--text-color_vy4nu"
|
|
40
37
|
})
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var e = h(_);
|
|
38
|
+
), B = {
|
|
39
|
+
resolveColor: f()
|
|
40
|
+
}, n = /* @__PURE__ */ function(t) {
|
|
41
|
+
h(_, t);
|
|
42
|
+
var e = S(_);
|
|
47
43
|
function _() {
|
|
48
|
-
return
|
|
44
|
+
return y(this, _), e.apply(this, arguments);
|
|
49
45
|
}
|
|
50
|
-
return
|
|
46
|
+
return d(_, [{
|
|
51
47
|
key: "getTextColor",
|
|
52
48
|
value: function() {
|
|
53
|
-
var
|
|
54
|
-
return
|
|
49
|
+
var g = this.asProps, l = g.color, s = g.resolveColor;
|
|
50
|
+
return s(l);
|
|
55
51
|
}
|
|
56
52
|
}]), _;
|
|
57
|
-
}(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
}(p);
|
|
54
|
+
r(n, "displayName", "ButtonLink");
|
|
55
|
+
r(n, "enhance", Object.values(B));
|
|
56
|
+
r(n, "style", m);
|
|
57
|
+
r(n, "defaultProps", {
|
|
62
58
|
use: "primary"
|
|
63
59
|
});
|
|
64
|
-
function
|
|
65
|
-
var e = arguments[0], _,
|
|
66
|
-
return _ =
|
|
60
|
+
function b(t) {
|
|
61
|
+
var e = arguments[0], _, o = c;
|
|
62
|
+
return _ = i(t.styles), /* @__PURE__ */ u.createElement(o, _.cn("SText", a({}, v({
|
|
67
63
|
tag: "span"
|
|
68
64
|
}, e))));
|
|
69
65
|
}
|
|
70
66
|
function z(t) {
|
|
71
|
-
var e = arguments[0], _,
|
|
72
|
-
return _ =
|
|
67
|
+
var e = arguments[0], _, o = c;
|
|
68
|
+
return _ = i(t.styles), /* @__PURE__ */ u.createElement(o, _.cn("SAddon", a({}, v({
|
|
73
69
|
tag: "span"
|
|
74
70
|
}, e))));
|
|
75
71
|
}
|
|
76
|
-
var
|
|
77
|
-
Text:
|
|
72
|
+
var R = x(n, {
|
|
73
|
+
Text: b,
|
|
78
74
|
Addon: z
|
|
79
75
|
});
|
|
80
76
|
export {
|
|
81
|
-
|
|
77
|
+
R as ButtonLink
|
|
82
78
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropGetterFn } from '@semcore/core';
|
|
3
|
-
import { KeyboardFocusProps } from '@semcore/
|
|
3
|
+
import { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
|
|
4
4
|
import { BoxProps } from '@semcore/flex-box';
|
|
5
5
|
import { NeighborItemProps } from '@semcore/neighbor-location';
|
|
6
6
|
import { TooltipHintProps } from '@semcore/tooltip';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/button",
|
|
3
3
|
"description": "Semrush Button Component",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.0.0-prerelease.2",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,16 +14,13 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "
|
|
18
|
-
"@semcore/neighbor-location": "
|
|
19
|
-
"@semcore/spin": "
|
|
20
|
-
"@semcore/tooltip": "
|
|
21
|
-
"@semcore/utils": "4.48.1"
|
|
17
|
+
"@semcore/flex-box": "16.0.0-prerelease.2",
|
|
18
|
+
"@semcore/neighbor-location": "16.0.0-prerelease.2",
|
|
19
|
+
"@semcore/spin": "16.0.0-prerelease.2",
|
|
20
|
+
"@semcore/tooltip": "16.0.0-prerelease.2"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
|
-
"@semcore/
|
|
25
|
-
"react": "16.8 - 18",
|
|
26
|
-
"react-dom": "16.8 - 18"
|
|
23
|
+
"@semcore/base-components": "^16.0.0-prerelease.2"
|
|
27
24
|
},
|
|
28
25
|
"repository": {
|
|
29
26
|
"type": "git",
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { Box } from '@semcore/flex-box';
|
|
3
3
|
import { Hint } from '@semcore/tooltip';
|
|
4
4
|
import NeighborLocation from '@semcore/neighbor-location';
|
|
5
|
-
import addonTextChildren from '@semcore/
|
|
6
|
-
import logger from '@semcore/
|
|
5
|
+
import addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';
|
|
6
|
+
import logger from '@semcore/core/lib/utils/logger';
|
|
7
7
|
import SpinButton from './SpinButton';
|
|
8
|
-
import hasLabels from '@semcore/
|
|
8
|
+
import hasLabels from '@semcore/core/lib/utils/hasLabels';
|
|
9
9
|
import { AbstractButtonProps } from './AbstractButton.type';
|
|
10
10
|
import { Component, CORE_INSTANCE, Root, sstyled } from '@semcore/core';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PropGetterFn } from '@semcore/core';
|
|
3
|
-
import { KeyboardFocusProps } from '@semcore/
|
|
3
|
+
import { KeyboardFocusProps } from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
|
|
4
4
|
import { BoxProps } from '@semcore/flex-box';
|
|
5
5
|
import { NeighborItemProps } from '@semcore/neighbor-location';
|
|
6
6
|
import { TooltipHintProps } from '@semcore/tooltip';
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import createComponent,
|
|
2
|
+
import { createComponent, sstyled, Root } from '@semcore/core';
|
|
3
3
|
import { Box } from '@semcore/flex-box';
|
|
4
|
-
import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
5
4
|
|
|
6
5
|
import style from './button.shadow.css';
|
|
7
6
|
import { AbstractButton } from '../AbstractButton/AbstractButton';
|
|
8
|
-
import {
|
|
9
|
-
ButtonAddonProps,
|
|
10
|
-
ButtonChildren,
|
|
11
|
-
ButtonComponent,
|
|
12
|
-
ButtonProps,
|
|
13
|
-
ButtonTextProps,
|
|
14
|
-
} from './Button.type';
|
|
7
|
+
import { ButtonAddonProps, ButtonComponent, ButtonTextProps } from './Button.type';
|
|
15
8
|
|
|
16
9
|
class RootButton extends AbstractButton {
|
|
17
10
|
static displayName = 'Button';
|
|
18
|
-
static enhance = [keyboardFocusEnhance()];
|
|
19
11
|
static style = style;
|
|
20
12
|
static defaultProps = {
|
|
21
13
|
use: 'secondary',
|
|
@@ -12,7 +12,6 @@ SButton {
|
|
|
12
12
|
text-align: center;
|
|
13
13
|
vertical-align: middle;
|
|
14
14
|
border: 1px solid transparent;
|
|
15
|
-
outline: 0;
|
|
16
15
|
box-shadow: none;
|
|
17
16
|
cursor: pointer;
|
|
18
17
|
box-sizing: border-box;
|
|
@@ -30,18 +29,11 @@ SButton {
|
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
&:active,
|
|
33
|
-
&:hover
|
|
34
|
-
&:focus {
|
|
35
|
-
outline: 0;
|
|
32
|
+
&:hover {
|
|
36
33
|
text-decoration: none;
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
|
|
40
|
-
SButton[keyboardFocused] {
|
|
41
|
-
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
|
42
|
-
z-index: 1;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
37
|
SButton[disabled] {
|
|
46
38
|
opacity: var(--intergalactic-disabled-opacity, 0.3);
|
|
47
39
|
cursor: default;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import createComponent,
|
|
2
|
+
import { createComponent, sstyled, Root } from '@semcore/core';
|
|
3
3
|
import style from './buttonLink.shadow.css';
|
|
4
|
-
import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
5
4
|
import { Box } from '@semcore/flex-box';
|
|
6
5
|
import { AbstractButton } from '../AbstractButton/AbstractButton';
|
|
7
|
-
import resolveColorEnhance from '@semcore/
|
|
6
|
+
import resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';
|
|
8
7
|
import { ButtonLinkAddonProps, ButtonLinkComponent, ButtonLinkTextProps } from './ButtonLink.type';
|
|
9
8
|
|
|
10
9
|
const enhance = {
|
|
11
|
-
keyboardFocused: keyboardFocusEnhance(),
|
|
12
10
|
resolveColor: resolveColorEnhance(),
|
|
13
11
|
};
|
|
14
12
|
|
|
@@ -12,14 +12,11 @@ SButton {
|
|
|
12
12
|
margin: 0;
|
|
13
13
|
box-shadow: none;
|
|
14
14
|
-webkit-tap-highlight-color: transparent;
|
|
15
|
-
outline: 0;
|
|
16
15
|
background: none;
|
|
17
16
|
transition: color 0.15s ease-in-out;
|
|
18
17
|
|
|
19
18
|
&:active,
|
|
20
|
-
&:hover
|
|
21
|
-
&:focus {
|
|
22
|
-
outline: 0;
|
|
19
|
+
&:hover {
|
|
23
20
|
text-decoration: none;
|
|
24
21
|
}
|
|
25
22
|
|
|
@@ -51,12 +48,6 @@ SButton {
|
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
SButton[keyboardFocused] {
|
|
55
|
-
outline-color: var(--intergalactic-keyboard-focus-outline, rgba(0, 143, 248, 0.5));
|
|
56
|
-
outline-style: solid;
|
|
57
|
-
outline-width: 3px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
51
|
SButton[disabled] {
|
|
61
52
|
opacity: var(--intergalactic-disabled-opacity, 0.3);
|
|
62
53
|
cursor: default;
|