@arcblock/ux 1.16.26 → 1.16.27

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.
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Blocklet;
7
+ exports.ActionButton = void 0;
7
8
 
8
9
  var _react = _interopRequireWildcard(require("react"));
9
10
 
@@ -44,7 +45,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
44
45
  const Div = _styledComponents.default.div.withConfig({
45
46
  displayName: "Blocklet__Div",
46
47
  componentId: "sc-3dga5l-0"
47
- })(["&.arcblock-blocklet{padding:0 16px;background:", ";overflow:hidden;&:hover{filter:drop-shadow(0px 4px 12px rgba(92,92,92,0.04));}border-bottom:1px solid #f0f0f0;}.arcblock-blocklet__content{padding:16px 0 0 0;}.arcblock-blocklet__content--main{display:flex;align-items:center;cursor:pointer;}.arcblock-blocklet__content--body{overflow:hidden;flex:1;display:flex;align-items:flex-start;}.arcblock-blocklet__addons{padding:16px 0;}.arcblock-blocklet__cover{width:80px;height:80px;margin-right:12px;overflow:hidden;border-radius:12px;}.arcblock-blocklet__info{flex:1;overflow:hidden;.arcblock-blocklet__button{margin-top:16px;display:inline-block;}}.arcblock-blocklet__button--hover{&:not(.Mui-disabled){position:relative;&::before{content:'';border-radius:100vw;position:absolute;height:100%;width:100%;left:0;top:0;transition:opacity 0.3s;}&:hover::before{opacity:0;}&::after{content:'';position:absolute;height:100%;width:100%;background-color:", ";transform:scale(0.1);opacity:0;z-index:-1;border-radius:100vw;transition:transform 0.3s,opacity 0.3s,background-color 0.3s;}&:hover::after{opacity:1;transform-origin:center;transform:scale(1);}}&:not(.Mui-disabled){background-color:rgba(79,106,246,0.06);color:", ";}&:not(.Mui-disabled){&:hover{color:", ";}}}.arcblock-blocklet__title{margin:0;font-size:18px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__describe{margin:2px 0 0;color:#999;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__addons{display:flex;justify-content:space-between;color:#999;font-size:14px;position:relative;}.arcblock-blocklet__addons--item{white-space:nowrap;}&.arcblock-blocklet--size-md{&:hover{position:relative;}.arcblock-blocklet__content{height:8.58em;}.arcblock-blocklet__title{margin-bottom:3px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:initial;white-space:initial;word-break:break-all;}.arcblock-blocklet__describe{white-space:normal;height:2.86em;}.arcblock-blocklet__button{margin-top:5px;}}&.arcblock-blocklet--size-sm,&.arcblock-blocklet--size-xs{.arcblock-blocklet__cover{width:40px;height:40px;border-radius:6px;}.arcblock-blocklet__content{padding:16px 0;}.arcblock-blocklet__addons{padding:8px 0;.arcblock-blocklet__addons--item{font-size:12px;}}}&.arcblock-blocklet--size-xs{.arcblock-blocklet__addons{display:none !important;}}"], props => props.theme.palette.common.white, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white);
48
+ })(["&.arcblock-blocklet{padding:0 16px;background:", ";overflow:hidden;box-shadow:0px 0px 8px #f0f0f0;&:hover{box-shadow:0px 2px 12px #f0f0f0;}}.arcblock-blocklet__content{padding:16px 0 0 0;}.arcblock-blocklet__content--main{display:flex;align-items:center;cursor:pointer;}.arcblock-blocklet__content--body{overflow:hidden;flex:1;display:flex;align-items:flex-start;}.arcblock-blocklet__addons{padding:16px 0;}.arcblock-blocklet__cover{width:80px;height:80px;margin-right:12px;overflow:hidden;border-radius:12px;transform:translateZ(0);}.arcblock-blocklet__info{flex:1;overflow:hidden;.arcblock-blocklet__button{margin-top:16px;display:inline-block;}}.arcblock-blocklet__button--hover{&:not(.Mui-disabled){position:relative;z-index:1;&::before{content:'';border-radius:100vw;position:absolute;height:100%;width:100%;left:0;top:0;transition:opacity 0.3s;}&:hover::before{opacity:0;}&::after{content:'';position:absolute;height:100%;width:100%;background-color:", ";transform:scale(0.1);opacity:0;z-index:-1;border-radius:100vw;transition:transform 0.3s,opacity 0.3s,background-color 0.3s;}&:hover::after{opacity:1;transform-origin:center;transform:scale(1);}}&:not(.Mui-disabled){background-color:rgba(79,106,246,0.06);color:", ";}&:not(.Mui-disabled){&:hover{color:", ";}}}.arcblock-blocklet__title{margin:0;font-size:18px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__describe{margin:0 0 2px 0;color:#999;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__addons{display:flex;justify-content:space-between;color:#999;font-size:14px;position:relative;}.arcblock-blocklet__addons--item{white-space:nowrap;}&.arcblock-blocklet--size-md{&:hover{position:relative;}.arcblock-blocklet__title{height:2.3em;margin-bottom:3px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:initial;white-space:initial;word-break:break-all;}.arcblock-blocklet__describe{white-space:normal;height:2.86em;}.arcblock-blocklet__button{margin-top:5px;}}&.arcblock-blocklet--size-sm,&.arcblock-blocklet--size-xs{.arcblock-blocklet__cover{width:40px;height:40px;border-radius:6px;}.arcblock-blocklet__content{padding:16px 0;}.arcblock-blocklet__addons{padding:8px 0;.arcblock-blocklet__addons--item{font-size:12px;}}}&.arcblock-blocklet--size-xs{.arcblock-blocklet__addons{display:none !important;}}"], props => props.theme.palette.common.white, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white);
49
+
50
+ const ActionButton = _styledComponents.default.div.withConfig({
51
+ displayName: "Blocklet__ActionButton",
52
+ componentId: "sc-3dga5l-1"
53
+ })(["background-color:transparent !important;& >:not(.Mui-disabled){position:relative;z-index:1;&::before{content:'';border-radius:100vw;position:absolute;height:100%;width:100%;left:0;top:0;transition:opacity 0.3s;}&:hover::before{opacity:0;}&::after{content:'';position:absolute;height:100%;width:100%;background-color:", ";transform:scale(0.1);opacity:0;z-index:-1;border-radius:100vw;transition:transform 0.3s,opacity 0.3s,background-color 0.3s;}&:hover::after{opacity:1;transform-origin:center;transform:scale(1);}}& >:not(.Mui-disabled){background-color:rgba(79,106,246,0.06) !important;color:", "!important;}& >:not(.Mui-disabled){&:hover{color:", "!important;}}"], props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white);
54
+
55
+ exports.ActionButton = ActionButton;
48
56
 
49
57
  function BlockletIcon(_ref) {
50
58
  let {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "1.16.26",
3
+ "version": "1.16.27",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -53,10 +53,10 @@
53
53
  "react": ">=16.12.0",
54
54
  "react-ga": "^2.7.0"
55
55
  },
56
- "gitHead": "9802acf803974ca65b45693add35849040ed90e7",
56
+ "gitHead": "2b31a3a7be899aeb694485bec6defd4689dffc51",
57
57
  "dependencies": {
58
- "@arcblock/icons": "^1.16.26",
59
- "@arcblock/react-hooks": "^1.16.26",
58
+ "@arcblock/icons": "^1.16.27",
59
+ "@arcblock/react-hooks": "^1.16.27",
60
60
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
61
61
  "@material-ui/core": "^4.12.3",
62
62
  "@material-ui/icons": "4.11.2",
@@ -17,10 +17,10 @@ const Div = styled.div`
17
17
  padding: 0 16px;
18
18
  background: ${props => props.theme.palette.common.white};
19
19
  overflow: hidden;
20
+ box-shadow: 0px 0px 8px #f0f0f0;
20
21
  &:hover {
21
- filter: drop-shadow(0px 4px 12px rgba(92, 92, 92, 0.04));
22
+ box-shadow: 0px 2px 12px #f0f0f0;
22
23
  }
23
- border-bottom: 1px solid #f0f0f0;
24
24
  }
25
25
  .arcblock-blocklet__content {
26
26
  padding: 16px 0 0 0;
@@ -45,6 +45,8 @@ const Div = styled.div`
45
45
  margin-right: 12px;
46
46
  overflow: hidden;
47
47
  border-radius: 12px;
48
+ /* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
49
+ transform: translateZ(0);
48
50
  }
49
51
 
50
52
  .arcblock-blocklet__info {
@@ -59,6 +61,7 @@ const Div = styled.div`
59
61
  .arcblock-blocklet__button--hover {
60
62
  &:not(.Mui-disabled) {
61
63
  position: relative;
64
+ z-index: 1;
62
65
  &::before {
63
66
  content: '';
64
67
  border-radius: 100vw;
@@ -111,7 +114,7 @@ const Div = styled.div`
111
114
  white-space: nowrap;
112
115
  }
113
116
  .arcblock-blocklet__describe {
114
- margin: 2px 0 0;
117
+ margin: 0 0 2px 0;
115
118
  color: #999;
116
119
  font-size: 14px;
117
120
  overflow: hidden;
@@ -133,10 +136,8 @@ const Div = styled.div`
133
136
  &:hover {
134
137
  position: relative;
135
138
  }
136
- .arcblock-blocklet__content {
137
- height: 8.58em;
138
- }
139
139
  .arcblock-blocklet__title {
140
+ height: 2.3em;
140
141
  margin-bottom: 3px;
141
142
  display: -webkit-box;
142
143
  -webkit-box-orient: vertical;
@@ -177,6 +178,52 @@ const Div = styled.div`
177
178
  }
178
179
  }
179
180
  `;
181
+ const ActionButton = styled.div`
182
+ background-color: transparent !important;
183
+ & > :not(.Mui-disabled) {
184
+ position: relative;
185
+ z-index: 1;
186
+ &::before {
187
+ content: '';
188
+ border-radius: 100vw;
189
+ position: absolute;
190
+ height: 100%;
191
+ width: 100%;
192
+ left: 0;
193
+ top: 0;
194
+ transition: opacity 0.3s;
195
+ }
196
+ &:hover::before {
197
+ opacity: 0;
198
+ }
199
+ &::after {
200
+ content: '';
201
+ position: absolute;
202
+ height: 100%;
203
+ width: 100%;
204
+ background-color: ${props => props.theme.palette.primary.main};
205
+ transform: scale(0.1);
206
+ opacity: 0;
207
+ z-index: -1;
208
+ border-radius: 100vw;
209
+ transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
210
+ }
211
+ &:hover::after {
212
+ opacity: 1;
213
+ transform-origin: center;
214
+ transform: scale(1);
215
+ }
216
+ }
217
+ & > :not(.Mui-disabled) {
218
+ background-color: rgba(79, 106, 246, 0.06) !important;
219
+ color: ${props => props.theme.palette.primary.main}!important;
220
+ }
221
+ & > :not(.Mui-disabled) {
222
+ &:hover {
223
+ color: ${props => props.theme.palette.common.white}!important;
224
+ }
225
+ }
226
+ `;
180
227
  function BlockletIcon({ name }) {
181
228
  return <Icon name={name} color="inherit" size={15} style={{ marginRight: 8 }} />;
182
229
  }
@@ -341,7 +388,7 @@ export default function Blocklet({
341
388
  </Div>
342
389
  );
343
390
  }
344
-
391
+ export { ActionButton };
345
392
  Blocklet.propTypes = {
346
393
  title: PropTypes.string.isRequired,
347
394
  did: PropTypes.string,