@semcore/button 3.3.4 → 3.3.7
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 +18 -0
- package/lib/cjs/Button.js +28 -28
- package/lib/cjs/Button.js.map +1 -1
- package/lib/cjs/SpinButton.js.map +1 -1
- package/lib/es6/Button.js +28 -28
- package/lib/es6/Button.js.map +1 -1
- package/lib/es6/SpinButton.js.map +1 -1
- package/package.json +6 -1
- /package/src/{Button.js → Button.jsx} +0 -0
- /package/src/{SpinButton.js → SpinButton.jsx} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [3.3.7] - 2022-03-14
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version patch update due to children dependencies update (`@semcore/utils` [3.31.2 ~> 3.31.2]).
|
|
10
|
+
|
|
11
|
+
## [3.3.6] - 2022-03-04
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Version patch update due to children dependencies update (`@semcore/spin` [3.3.0 ~> 3.4.0]).
|
|
16
|
+
|
|
17
|
+
## [3.3.5] - 2022-02-24
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Added repository field to package.json file.
|
|
22
|
+
|
|
5
23
|
## [3.3.4] - 2021-12-23
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/lib/cjs/Button.js
CHANGED
|
@@ -52,38 +52,38 @@ var style = (
|
|
|
52
52
|
/*__reshadow_css_start__*/
|
|
53
53
|
_core.sstyled.insert(
|
|
54
54
|
/*__inner_css_start__*/
|
|
55
|
-
".
|
|
55
|
+
".___SButton_1gvrk_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#666666;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.___SButton_1gvrk_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_1gvrk_gg_:active,.___SButton_1gvrk_gg_:focus,.___SButton_1gvrk_gg_:hover{outline:0;text-decoration:none}.___SButton_1gvrk_gg_.__disabled_1gvrk_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_1gvrk_gg_.__keyboardFocused_1gvrk_gg_{box-shadow:0 0 0 3px rgba(43, 148, 225, 0.3);z-index:1}.___SButton_1gvrk_gg_._size_s_1gvrk_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_1gvrk_gg_._size_m_1gvrk_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_1gvrk_gg_._size_l_1gvrk_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_1gvrk_gg_._size_xl_1gvrk_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_{color:#fff;background-color:#2b94e1}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_:hover{background-color:#0071bc}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:#006bb3}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_{color:#fff;background-color:#4fae33}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_:hover{background-color:#1d9c00}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_.__active_1gvrk_gg_{background-color:#1c9400}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{background-color:#ff7f00;color:#fff}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_:hover{background-color:#cc6600}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_.__active_1gvrk_gg_{background-color:#c26100}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_{background-color:#ed2d2d;color:#fff}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_:hover{background-color:#d00000}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_.__active_1gvrk_gg_{background-color:#c60000}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{background-color:#fff;color:#333333}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_:hover{background-color:#eeeeee}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:#e4e1e1}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(0,113,188,.3)}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_{color:#0071bc;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(43,148,225,.3)}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_{color:#757575;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_{color:#fff;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1gvrk_gg_._neighborLocation_right_1gvrk_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_{border-radius:0;margin-left:-1px}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-danger_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-info_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-success_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-danger_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-info_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-success_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_1gvrk_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_1gvrk_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_1gvrk_gg_.__loading_1gvrk_gg_{visibility:hidden}.___SText_1gvrk_gg_{display:inline-flex;line-height:1.1}.___SText_1gvrk_gg_._size_s_1gvrk_gg_{margin-left:4px;margin-right:4px}.___SText_1gvrk_gg_._size_m_1gvrk_gg_{margin-left:8px;margin-right:8px}.___SText_1gvrk_gg_._size_l_1gvrk_gg_{margin-left:8px;margin-right:8px}.___SText_1gvrk_gg_._size_xl_1gvrk_gg_{margin-left:12px;margin-right:12px}.___SAddon_1gvrk_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
56
56
|
/*__inner_css_end__*/
|
|
57
57
|
, "1o9hhkh_gg_")
|
|
58
58
|
/*__reshadow_css_end__*/
|
|
59
59
|
, {
|
|
60
|
-
"__SButton": "
|
|
61
|
-
"_disabled": "
|
|
62
|
-
"_keyboardFocused": "
|
|
63
|
-
"_size_s": "
|
|
64
|
-
"_size_m": "
|
|
65
|
-
"_size_l": "
|
|
66
|
-
"_size_xl": "
|
|
67
|
-
"_theme_primary-info": "_theme_primary-
|
|
68
|
-
"_active": "
|
|
69
|
-
"_theme_primary-success": "_theme_primary-
|
|
70
|
-
"_theme_primary-warning": "_theme_primary-
|
|
71
|
-
"_theme_primary-danger": "_theme_primary-
|
|
72
|
-
"_theme_primary-invert": "_theme_primary-
|
|
73
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
74
|
-
"_theme_secondary-info": "_theme_secondary-
|
|
75
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
76
|
-
"_theme_tertiary-info": "_theme_tertiary-
|
|
77
|
-
"_theme_tertiary-muted": "_theme_tertiary-
|
|
78
|
-
"_theme_tertiary-invert": "_theme_tertiary-
|
|
79
|
-
"_neighborLocation_right": "
|
|
80
|
-
"_neighborLocation_both": "
|
|
81
|
-
"_neighborLocation_left": "
|
|
82
|
-
"__SSpin": "
|
|
83
|
-
"__SInner": "
|
|
84
|
-
"_loading": "
|
|
85
|
-
"__SText": "
|
|
86
|
-
"__SAddon": "
|
|
60
|
+
"__SButton": "___SButton_1gvrk_gg_",
|
|
61
|
+
"_disabled": "__disabled_1gvrk_gg_",
|
|
62
|
+
"_keyboardFocused": "__keyboardFocused_1gvrk_gg_",
|
|
63
|
+
"_size_s": "_size_s_1gvrk_gg_",
|
|
64
|
+
"_size_m": "_size_m_1gvrk_gg_",
|
|
65
|
+
"_size_l": "_size_l_1gvrk_gg_",
|
|
66
|
+
"_size_xl": "_size_xl_1gvrk_gg_",
|
|
67
|
+
"_theme_primary-info": "_theme_primary-info_1gvrk_gg_",
|
|
68
|
+
"_active": "__active_1gvrk_gg_",
|
|
69
|
+
"_theme_primary-success": "_theme_primary-success_1gvrk_gg_",
|
|
70
|
+
"_theme_primary-warning": "_theme_primary-warning_1gvrk_gg_",
|
|
71
|
+
"_theme_primary-danger": "_theme_primary-danger_1gvrk_gg_",
|
|
72
|
+
"_theme_primary-invert": "_theme_primary-invert_1gvrk_gg_",
|
|
73
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1gvrk_gg_",
|
|
74
|
+
"_theme_secondary-info": "_theme_secondary-info_1gvrk_gg_",
|
|
75
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1gvrk_gg_",
|
|
76
|
+
"_theme_tertiary-info": "_theme_tertiary-info_1gvrk_gg_",
|
|
77
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_1gvrk_gg_",
|
|
78
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_1gvrk_gg_",
|
|
79
|
+
"_neighborLocation_right": "_neighborLocation_right_1gvrk_gg_",
|
|
80
|
+
"_neighborLocation_both": "_neighborLocation_both_1gvrk_gg_",
|
|
81
|
+
"_neighborLocation_left": "_neighborLocation_left_1gvrk_gg_",
|
|
82
|
+
"__SSpin": "___SSpin_1gvrk_gg_",
|
|
83
|
+
"__SInner": "___SInner_1gvrk_gg_",
|
|
84
|
+
"_loading": "__loading_1gvrk_gg_",
|
|
85
|
+
"__SText": "___SText_1gvrk_gg_",
|
|
86
|
+
"__SAddon": "___SAddon_1gvrk_gg_"
|
|
87
87
|
});
|
|
88
88
|
var MAP_USE_DEFAULT_THEME = {
|
|
89
89
|
primary: 'info',
|
package/lib/cjs/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.
|
|
1
|
+
{"version":3,"sources":["../../src/Button.jsx"],"names":["MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","Box","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","Component","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,IAAMA,qBAAqB,GAAG;AACnCC,EAAAA,OAAO,EAAE,MAD0B;AAEnCC,EAAAA,SAAS,EAAE,OAFwB;AAGnCC,EAAAA,QAAQ,EAAE;AAHyB,CAA9B;;;IAMDC,U;;;;;;;;;;;;WASJ,wBAAe;AACb,UAAQC,IAAR,GAAiB,KAAKC,OAAtB,CAAQD,IAAR;AACA,aAAO;AACLA,QAAAA,IAAI,EAAJA;AADK,OAAP;AAGD;;;WAED,yBAAgB;AACd,UAAQA,I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AAD;AAAA,eAAW;AAAX,uBACE,gCAAC,sBAAD;AAAA;AAAA,gBAA2BV,IAA3B;AAAA,iBAAwCc;AAAxC,SADF,CAPJ,CADF;AAcD;;;EAtDsBI,e;;iCAAnBnB,U,iBACiB,Q;iCADjBA,U,aAEa,CAAC,uCAAD,EAAyB,gDAAzB,C;iCAFbA,U,WAGWoB,K;iCAHXpB,U,kBAIkB;AACpBS,EAAAA,GAAG,EAAE,WADe;AAEpBR,EAAAA,IAAI,EAAE;AAFc,C;;AAqDxB,SAASgB,IAAT,CAAcI,KAAd,EAAqB;AAAA;AAAA;;AACnB,MAAMC,KAAK,GACiClB,YAD5C;AACA,iBAAO,mBAAQiB,KAAK,CAACb,MAAd,CAAP,eAA6B,gCAAC,KAAD;AAAA,WAAwB;AAAxB,cAA7B;AACD;;AAED,SAASU,KAAT,CAAeG,KAAf,EAAsB;AAAA;AAAA;;AACpB,MAAME,MAAM,GACiCnB,YAD7C;AACA,iBAAO,mBAAQiB,KAAK,CAACb,MAAd,CAAP,eAA6B,gCAAC,MAAD;AAAA,WAAyB;AAAzB,cAA7B;AACD;;AAED,IAAMQ,MAAM,GAAG,sBAAgBhB,UAAhB,EAA4B;AACzCiB,EAAAA,IAAI,EAAJA,IADyC;AAEzCC,EAAAA,KAAK,EAALA;AAFyC,CAA5B,CAAf;eAKeF,M","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n return sstyled(styles)(\n <SButton render={Box} type=\"button\" tag=\"button\" disabled={disabled} use:theme={useTheme}>\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"file":"Button.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.
|
|
1
|
+
{"version":3,"sources":["../../src/SpinButton.jsx"],"names":["SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;;AAEO,IAAMA,aAAa,GAAG;AAC3BC,EAAAA,EAAE,EAAE,GADuB;AAE3BC,EAAAA,CAAC,EAAE,GAFwB;AAG3BC,EAAAA,CAAC,EAAE,IAHwB;AAI3BC,EAAAA,CAAC,EAAE;AAJwB,CAAtB;;AAOA,IAAMC,cAAc,GAAG;AAC5B,kBAAgB,QADY;AAE5B,qBAAmB,QAFS;AAG5B,qBAAmB,QAHS;AAI5B,oBAAkB,QAJU;AAK5B,sBAAoB,QALQ;AAM5B,qBAAmB,QANS;AAO5B,oBAAkB,YAPU;AAQ5B,qBAAmB,QARS;AAS5B,mBAAiB;AATW,CAAvB;;;AAYQ,SAASC,UAAT,OAAgD;AAAA,MAA1BC,KAA0B,QAA1BA,KAA0B;AAAA,MAAnBC,IAAmB,QAAnBA,IAAmB;AAAA,MAAVC,MAAU;AAC7D,sBACE,gCAAC,gBAAD;AACE,IAAA,IAAI,EAAE,OAAOD,IAAP,IAAe,QAAf,GAA0BR,aAAa,CAACQ,IAAD,CAAvC,GAAgDA,IADxD;AAEE,IAAA,KAAK,EAAE,OAAOD,KAAP,KAAiB,QAAjB,GAA4BF,cAAc,CAACE,KAAD,CAAd,IAAyB,MAArD,GAA8DA;AAFvE,KAGME,MAHN,EADF;AAOD","sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport const SPIN_THEME_MAP = {\n 'primary-info': 'invert',\n 'primary-success': 'invert',\n 'primary-warning': 'invert',\n 'primary-danger': 'invert',\n 'secondary-invert': 'invert',\n 'secondary-muted': 'gray40',\n 'secondary-info': 'light-blue',\n 'tertiary-invert': 'invert',\n 'tertiary-info': 'light-blue',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size == 'string' ? SPIN_SIZE_MAP[size] : size}\n theme={typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme}\n {...others}\n />\n );\n}\n"],"file":"SpinButton.js"}
|
package/lib/es6/Button.js
CHANGED
|
@@ -30,38 +30,38 @@ var style = (
|
|
|
30
30
|
/*__reshadow_css_start__*/
|
|
31
31
|
_sstyled.insert(
|
|
32
32
|
/*__inner_css_start__*/
|
|
33
|
-
".
|
|
33
|
+
".___SButton_1gvrk_gg_{position:relative;display:inline-block;align-items:center;justify-content:center;padding:0;margin:0;white-space:nowrap;font-family:inherit;font-weight:400;line-height:normal;text-decoration:none;text-align:center;vertical-align:middle;border:1px solid transparent;color:#666666;outline:0;box-shadow:none;cursor:pointer;box-sizing:border-box;overflow:visible;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.___SButton_1gvrk_gg_::-moz-focus-inner{padding:0;border:none}.___SButton_1gvrk_gg_:active,.___SButton_1gvrk_gg_:focus,.___SButton_1gvrk_gg_:hover{outline:0;text-decoration:none}.___SButton_1gvrk_gg_.__disabled_1gvrk_gg_{opacity:0.3;cursor:default;pointer-events:none}.___SButton_1gvrk_gg_.__keyboardFocused_1gvrk_gg_{box-shadow:0 0 0 3px rgba(43, 148, 225, 0.3);z-index:1}.___SButton_1gvrk_gg_._size_s_1gvrk_gg_{height:18px;min-width:18px;border-radius:2px;font-size:10px}.___SButton_1gvrk_gg_._size_m_1gvrk_gg_{height:26px;min-width:26px;border-radius:3px;font-size:12px}.___SButton_1gvrk_gg_._size_l_1gvrk_gg_{height:32px;min-width:32px;border-radius:4px;font-size:14px}.___SButton_1gvrk_gg_._size_xl_1gvrk_gg_{height:42px;min-width:42px;border-radius:5px;font-size:16px}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_{color:#fff;background-color:#2b94e1}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_:hover{background-color:#0071bc}.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:#006bb3}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_{color:#fff;background-color:#4fae33}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_:hover{background-color:#1d9c00}.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-success_1gvrk_gg_.__active_1gvrk_gg_{background-color:#1c9400}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{background-color:#ff7f00;color:#fff}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_:hover{background-color:#cc6600}.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-warning_1gvrk_gg_.__active_1gvrk_gg_{background-color:#c26100}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_{background-color:#ed2d2d;color:#fff}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_:hover{background-color:#d00000}.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-danger_1gvrk_gg_.__active_1gvrk_gg_{background-color:#c60000}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{background-color:#fff;color:#333333}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_:hover{background-color:#eeeeee}.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_primary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:#e4e1e1}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_{color:#757575;border-color:#a6b0b3;background-color:rgba(166,176,179,.1)}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-muted_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_{background-color:rgba(43,148,225,.05);color:#2b94e1;border-color:#2b94e1}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_:hover{background-color:rgba(0,113,188,.2)}.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(0,113,188,.3)}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_{background-color:hsla(0,0%,100%,.05);color:#fff;border-color:#fff}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_secondary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_{color:#0071bc;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_:hover{background-color:rgba(43,148,225,.2)}.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-info_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(43,148,225,.3)}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_{color:#757575;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_:hover{background-color:rgba(166,176,179,.2)}.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-muted_1gvrk_gg_.__active_1gvrk_gg_{background-color:rgba(166,176,179,.3)}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_{color:#fff;background-color:transparent}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_:hover{background-color:hsla(0,0%,100%,.2)}.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_:active,.___SButton_1gvrk_gg_._theme_tertiary-invert_1gvrk_gg_.__active_1gvrk_gg_{background-color:hsla(0,0%,100%,.3)}.___SButton_1gvrk_gg_._neighborLocation_right_1gvrk_gg_{border-top-right-radius:0;border-bottom-right-radius:0}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_{border-radius:0;margin-left:-1px}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-danger_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-info_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-success_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1gvrk_gg_._neighborLocation_both_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{border-left-color:rgba(0,0,0,.5)}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-danger_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-info_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-success_1gvrk_gg_,.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-warning_1gvrk_gg_{border-left-color:hsla(0,0%,100%,.5)}.___SButton_1gvrk_gg_._neighborLocation_left_1gvrk_gg_._theme_primary-invert_1gvrk_gg_{border-left-color:rgba(0,0,0,.5)}.___SSpin_1gvrk_gg_{position:absolute;top:0;left:0;width:100%;height:100%;display:flex}.___SInner_1gvrk_gg_{display:inline-flex;align-items:center;justify-content:center;height:100%;width:100%}.___SInner_1gvrk_gg_.__loading_1gvrk_gg_{visibility:hidden}.___SText_1gvrk_gg_{display:inline-flex;line-height:1.1}.___SText_1gvrk_gg_._size_s_1gvrk_gg_{margin-left:4px;margin-right:4px}.___SText_1gvrk_gg_._size_m_1gvrk_gg_{margin-left:8px;margin-right:8px}.___SText_1gvrk_gg_._size_l_1gvrk_gg_{margin-left:8px;margin-right:8px}.___SText_1gvrk_gg_._size_xl_1gvrk_gg_{margin-left:12px;margin-right:12px}.___SAddon_1gvrk_gg_{display:inline-flex;align-items:center;justify-content:center}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:not(:only-child):first-child{margin-left:4px}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:not(:only-child):last-child{margin-right:4px}.___SAddon_1gvrk_gg_._size_s_1gvrk_gg_:only-child{margin-left:-2px;margin-right:-2px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1gvrk_gg_._size_m_1gvrk_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:not(:only-child):first-child{margin-left:8px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:not(:only-child):last-child{margin-right:8px}.___SAddon_1gvrk_gg_._size_l_1gvrk_gg_:only-child{margin-left:-4px;margin-right:-4px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:not(:only-child):first-child{margin-left:12px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:not(:only-child):last-child{margin-right:12px}.___SAddon_1gvrk_gg_._size_xl_1gvrk_gg_:only-child{margin-left:-6px;margin-right:-6px}"
|
|
34
34
|
/*__inner_css_end__*/
|
|
35
35
|
, "1o9hhkh_gg_")
|
|
36
36
|
/*__reshadow_css_end__*/
|
|
37
37
|
, {
|
|
38
|
-
"__SButton": "
|
|
39
|
-
"_disabled": "
|
|
40
|
-
"_keyboardFocused": "
|
|
41
|
-
"_size_s": "
|
|
42
|
-
"_size_m": "
|
|
43
|
-
"_size_l": "
|
|
44
|
-
"_size_xl": "
|
|
45
|
-
"_theme_primary-info": "_theme_primary-
|
|
46
|
-
"_active": "
|
|
47
|
-
"_theme_primary-success": "_theme_primary-
|
|
48
|
-
"_theme_primary-warning": "_theme_primary-
|
|
49
|
-
"_theme_primary-danger": "_theme_primary-
|
|
50
|
-
"_theme_primary-invert": "_theme_primary-
|
|
51
|
-
"_theme_secondary-muted": "_theme_secondary-
|
|
52
|
-
"_theme_secondary-info": "_theme_secondary-
|
|
53
|
-
"_theme_secondary-invert": "_theme_secondary-
|
|
54
|
-
"_theme_tertiary-info": "_theme_tertiary-
|
|
55
|
-
"_theme_tertiary-muted": "_theme_tertiary-
|
|
56
|
-
"_theme_tertiary-invert": "_theme_tertiary-
|
|
57
|
-
"_neighborLocation_right": "
|
|
58
|
-
"_neighborLocation_both": "
|
|
59
|
-
"_neighborLocation_left": "
|
|
60
|
-
"__SSpin": "
|
|
61
|
-
"__SInner": "
|
|
62
|
-
"_loading": "
|
|
63
|
-
"__SText": "
|
|
64
|
-
"__SAddon": "
|
|
38
|
+
"__SButton": "___SButton_1gvrk_gg_",
|
|
39
|
+
"_disabled": "__disabled_1gvrk_gg_",
|
|
40
|
+
"_keyboardFocused": "__keyboardFocused_1gvrk_gg_",
|
|
41
|
+
"_size_s": "_size_s_1gvrk_gg_",
|
|
42
|
+
"_size_m": "_size_m_1gvrk_gg_",
|
|
43
|
+
"_size_l": "_size_l_1gvrk_gg_",
|
|
44
|
+
"_size_xl": "_size_xl_1gvrk_gg_",
|
|
45
|
+
"_theme_primary-info": "_theme_primary-info_1gvrk_gg_",
|
|
46
|
+
"_active": "__active_1gvrk_gg_",
|
|
47
|
+
"_theme_primary-success": "_theme_primary-success_1gvrk_gg_",
|
|
48
|
+
"_theme_primary-warning": "_theme_primary-warning_1gvrk_gg_",
|
|
49
|
+
"_theme_primary-danger": "_theme_primary-danger_1gvrk_gg_",
|
|
50
|
+
"_theme_primary-invert": "_theme_primary-invert_1gvrk_gg_",
|
|
51
|
+
"_theme_secondary-muted": "_theme_secondary-muted_1gvrk_gg_",
|
|
52
|
+
"_theme_secondary-info": "_theme_secondary-info_1gvrk_gg_",
|
|
53
|
+
"_theme_secondary-invert": "_theme_secondary-invert_1gvrk_gg_",
|
|
54
|
+
"_theme_tertiary-info": "_theme_tertiary-info_1gvrk_gg_",
|
|
55
|
+
"_theme_tertiary-muted": "_theme_tertiary-muted_1gvrk_gg_",
|
|
56
|
+
"_theme_tertiary-invert": "_theme_tertiary-invert_1gvrk_gg_",
|
|
57
|
+
"_neighborLocation_right": "_neighborLocation_right_1gvrk_gg_",
|
|
58
|
+
"_neighborLocation_both": "_neighborLocation_both_1gvrk_gg_",
|
|
59
|
+
"_neighborLocation_left": "_neighborLocation_left_1gvrk_gg_",
|
|
60
|
+
"__SSpin": "___SSpin_1gvrk_gg_",
|
|
61
|
+
"__SInner": "___SInner_1gvrk_gg_",
|
|
62
|
+
"_loading": "__loading_1gvrk_gg_",
|
|
63
|
+
"__SText": "___SText_1gvrk_gg_",
|
|
64
|
+
"__SAddon": "___SAddon_1gvrk_gg_"
|
|
65
65
|
});
|
|
66
66
|
export var MAP_USE_DEFAULT_THEME = {
|
|
67
67
|
primary: 'info',
|
package/lib/es6/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Button.
|
|
1
|
+
{"version":3,"sources":["../../src/Button.jsx"],"names":["React","createComponent","Component","sstyled","Root","Box","neighborLocationEnhance","keyboardFocusEnhance","addonTextChildren","SpinButton","MAP_USE_DEFAULT_THEME","primary","secondary","tertiary","RootButton","size","asProps","SButton","SInner","SSpin","Children","styles","use","theme","loading","disabled","addonLeft","addonRight","useTheme","Button","Text","Addon","style","props","SText","SAddon"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,SAASC,uBAAT,QAAwC,4BAAxC;AACA,OAAOC,oBAAP,MAAiC,kDAAjC;AACA,OAAOC,iBAAP,MAA8B,sCAA9B;AACA,OAAOC,UAAP,MA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;AAFyC,CAAb,CAA9B;AAKA,eAAeF,MAAf","sourcesContent":["import React from 'react';\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { neighborLocationEnhance } from '@semcore/neighbor-location';\nimport keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\nimport addonTextChildren from '@semcore/utils/lib/addonTextChildren';\nimport SpinButton from './SpinButton';\n\nimport style from './style/button.shadow.css';\n\nexport const MAP_USE_DEFAULT_THEME = {\n primary: 'info',\n secondary: 'muted',\n tertiary: 'info',\n};\n\nclass RootButton extends Component {\n static displayName = 'Button';\n static enhance = [keyboardFocusEnhance(), neighborLocationEnhance()];\n static style = style;\n static defaultProps = {\n use: 'secondary',\n size: 'm',\n };\n\n getTextProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n getAddonProps() {\n const { size } = this.asProps;\n return {\n size,\n };\n }\n\n render() {\n const SButton = Root;\n const SInner = Box;\n const SSpin = Box;\n const {\n Children,\n styles,\n use,\n theme = typeof use === 'string' && MAP_USE_DEFAULT_THEME[use],\n loading,\n disabled = loading,\n size,\n addonLeft,\n addonRight,\n } = this.asProps;\n\n const useTheme = use && theme ? `${use}-${theme}` : false;\n return sstyled(styles)(\n <SButton render={Box} type=\"button\" tag=\"button\" disabled={disabled} use:theme={useTheme}>\n <SInner tag=\"span\" loading={loading}>\n {addonLeft ? <Button.Addon tag={addonLeft} /> : null}\n {addonTextChildren(Children, Button.Text, Button.Addon)}\n {addonRight ? <Button.Addon tag={addonRight} /> : null}\n </SInner>\n {loading && (\n <SSpin tag=\"span\">\n <SpinButton centered size={size} theme={useTheme} />\n </SSpin>\n )}\n </SButton>,\n );\n }\n}\n\nfunction Text(props) {\n const SText = Root;\n return sstyled(props.styles)(<SText render={Box} tag=\"span\" />);\n}\n\nfunction Addon(props) {\n const SAddon = Root;\n return sstyled(props.styles)(<SAddon render={Box} tag=\"span\" />);\n}\n\nconst Button = createComponent(RootButton, {\n Text,\n Addon,\n});\n\nexport default Button;\n"],"file":"Button.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/SpinButton.
|
|
1
|
+
{"version":3,"sources":["../../src/SpinButton.jsx"],"names":["React","Spin","SPIN_SIZE_MAP","xl","l","m","s","SPIN_THEME_MAP","SpinButton","theme","size","others"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,IAAP,MAAiB,eAAjB;AAEA,OAAO,IAAMC,aAAa,GAAG;AAC3BC,EAAAA,EAAE,EAAE,GADuB;AAE3BC,EAAAA,CAAC,EAAE,GAFwB;AAG3BC,EAAAA,CAAC,EAAE,IAHwB;AAI3BC,EAAAA,CAAC,EAAE;AAJwB,CAAtB;AAOP,OAAO,IAAMC,cAAc,GAAG;AAC5B,kBAAgB,QADY;AAE5B,qBAAmB,QAFS;AAG5B,qBAAmB,QAHS;AAI5B,oBAAkB,QAJU;AAK5B,sBAAoB,QALQ;AAM5B,qBAAmB,QANS;AAO5B,oBAAkB,YAPU;AAQ5B,qBAAmB,QARS;AAS5B,mBAAiB;AATW,CAAvB;AAYP,eAAe,SAASC,UAAT,OAAgD;AAAA,MAA1BC,KAA0B,QAA1BA,KAA0B;AAAA,MAAnBC,IAAmB,QAAnBA,IAAmB;AAAA,MAAVC,MAAU;;AAC7D,sBACE,oBAAC,IAAD;AACE,IAAA,IAAI,EAAE,OAAOD,IAAP,IAAe,QAAf,GAA0BR,aAAa,CAACQ,IAAD,CAAvC,GAAgDA,IADxD;AAEE,IAAA,KAAK,EAAE,OAAOD,KAAP,KAAiB,QAAjB,GAA4BF,cAAc,CAACE,KAAD,CAAd,IAAyB,MAArD,GAA8DA;AAFvE,KAGME,MAHN,EADF;AAOD","sourcesContent":["import React from 'react';\nimport Spin from '@semcore/spin';\n\nexport const SPIN_SIZE_MAP = {\n xl: 'm',\n l: 's',\n m: 'xs',\n s: 'xxs',\n};\n\nexport const SPIN_THEME_MAP = {\n 'primary-info': 'invert',\n 'primary-success': 'invert',\n 'primary-warning': 'invert',\n 'primary-danger': 'invert',\n 'secondary-invert': 'invert',\n 'secondary-muted': 'gray40',\n 'secondary-info': 'light-blue',\n 'tertiary-invert': 'invert',\n 'tertiary-info': 'light-blue',\n};\n\nexport default function SpinButton({ theme, size, ...others }) {\n return (\n <Spin\n size={typeof size == 'string' ? SPIN_SIZE_MAP[size] : size}\n theme={typeof theme === 'string' ? SPIN_THEME_MAP[theme] || 'dark' : theme}\n {...others}\n />\n );\n}\n"],"file":"SpinButton.js"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/button",
|
|
3
3
|
"description": "SEMRush Button Component",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.7",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -24,5 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"jest": {
|
|
26
26
|
"preset": "@semcore/jest-preset-ui"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/semrush/intergalactic.git",
|
|
31
|
+
"directory": "semcore/button"
|
|
27
32
|
}
|
|
28
33
|
}
|
|
File without changes
|
|
File without changes
|