@cashub/ui 0.49.0-beta.3 → 0.49.0-beta.5
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/Tab/TabList.js +12 -5
- package/assets/images/bg-main-vivid.png +0 -0
- package/assets/images/bg-main.png +0 -0
- package/iconbox/IconBox.js +92 -2
- package/index.js +12 -8
- package/layout/Footer.js +1 -1
- package/package.json +1 -1
- package/table/Table.js +18 -17
- package/cashub-ui-0.49.0-beta.1.tgz +0 -0
package/Tab/TabList.js
CHANGED
|
@@ -15,6 +15,7 @@ const TabList = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
children,
|
|
17
17
|
wrap = true,
|
|
18
|
+
noBorder,
|
|
18
19
|
...props
|
|
19
20
|
} = _ref;
|
|
20
21
|
const wrapperRef = (0, _react.useRef)(null);
|
|
@@ -104,6 +105,7 @@ const TabList = _ref => {
|
|
|
104
105
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
|
|
105
106
|
role: "tablist",
|
|
106
107
|
$wrap: wrap,
|
|
108
|
+
$noBorder: noBorder,
|
|
107
109
|
...props,
|
|
108
110
|
children: wrap ? children : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
109
111
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TabWrapper, {
|
|
@@ -131,20 +133,25 @@ const TabList = _ref => {
|
|
|
131
133
|
};
|
|
132
134
|
const Container = _styledComponents.default.div`
|
|
133
135
|
position: relative;
|
|
134
|
-
|
|
136
|
+
${_ref2 => {
|
|
137
|
+
let {
|
|
138
|
+
$noBorder
|
|
139
|
+
} = _ref2;
|
|
140
|
+
return !$noBorder && 'border-bottom: var(--border-width) solid var(--border-color);';
|
|
141
|
+
}}
|
|
135
142
|
margin-bottom: var(--spacing);
|
|
136
143
|
|
|
137
|
-
${
|
|
144
|
+
${_ref3 => {
|
|
138
145
|
let {
|
|
139
146
|
$wrap
|
|
140
|
-
} =
|
|
147
|
+
} = _ref3;
|
|
141
148
|
return !$wrap && 'white-space: nowrap;';
|
|
142
149
|
}}
|
|
143
150
|
|
|
144
|
-
${
|
|
151
|
+
${_ref4 => {
|
|
145
152
|
let {
|
|
146
153
|
noMargin
|
|
147
|
-
} =
|
|
154
|
+
} = _ref4;
|
|
148
155
|
return noMargin && 'margin-bottom: 0;';
|
|
149
156
|
}}
|
|
150
157
|
`;
|
|
Binary file
|
|
Binary file
|
package/iconbox/IconBox.js
CHANGED
|
@@ -11,6 +11,7 @@ var _bgChartTriangle = _interopRequireDefault(require("../assets/images/bg-chart
|
|
|
11
11
|
var _bgImageRegistry = _interopRequireDefault(require("./bgImageRegistry"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const withAlpha = (hex, alphaHex) => hex ? `${hex}${alphaHex}` : undefined;
|
|
14
15
|
const IconBox = _ref => {
|
|
15
16
|
let {
|
|
16
17
|
icon,
|
|
@@ -21,10 +22,37 @@ const IconBox = _ref => {
|
|
|
21
22
|
sizeXS = true,
|
|
22
23
|
sizeS = false,
|
|
23
24
|
size,
|
|
25
|
+
iconSize,
|
|
24
26
|
bgImageKey,
|
|
25
27
|
gradientFrom,
|
|
26
|
-
gradientTo
|
|
28
|
+
gradientTo,
|
|
29
|
+
accentColor
|
|
27
30
|
} = _ref;
|
|
31
|
+
if (accentColor) {
|
|
32
|
+
const circleSize = size || 60;
|
|
33
|
+
const innerIconSize = iconSize || Math.round(circleSize * 0.5);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(AccentWrapper, {
|
|
35
|
+
accentColor: accentColor,
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IconCircle, {
|
|
37
|
+
accentColor: accentColor,
|
|
38
|
+
circleSize: circleSize,
|
|
39
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconBoxImage.default, {
|
|
40
|
+
size: innerIconSize,
|
|
41
|
+
iconKey: iconKey,
|
|
42
|
+
iconColor: accentColor || iconColor,
|
|
43
|
+
src: icon,
|
|
44
|
+
alt: `${title}'s icon`
|
|
45
|
+
})
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextColumn, {
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(IconBoxTitle, {
|
|
48
|
+
children: title
|
|
49
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconBoxBody, {
|
|
50
|
+
accentColor: accentColor,
|
|
51
|
+
children: children
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
28
56
|
const bgImage = bgImageKey && _bgImageRegistry.default[bgImageKey];
|
|
29
57
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
30
58
|
bgImage: bgImage,
|
|
@@ -90,14 +118,76 @@ const IconBoxHead = _styledComponents.default.div`
|
|
|
90
118
|
align-items: center;
|
|
91
119
|
margin-bottom: var(--spacing);
|
|
92
120
|
`;
|
|
121
|
+
const AccentWrapper = _styledComponents.default.div`
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
padding: var(--spacing);
|
|
125
|
+
border-radius: var(--border-radius);
|
|
126
|
+
color: var(--font-on-background);
|
|
127
|
+
background: ${_ref3 => {
|
|
128
|
+
let {
|
|
129
|
+
accentColor
|
|
130
|
+
} = _ref3;
|
|
131
|
+
return withAlpha(accentColor, '0D');
|
|
132
|
+
}};
|
|
133
|
+
border: 2px solid ${_ref4 => {
|
|
134
|
+
let {
|
|
135
|
+
accentColor
|
|
136
|
+
} = _ref4;
|
|
137
|
+
return withAlpha(accentColor, '1A');
|
|
138
|
+
}};
|
|
139
|
+
`;
|
|
140
|
+
const IconCircle = _styledComponents.default.span`
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
border-radius: 50%;
|
|
145
|
+
width: ${_ref5 => {
|
|
146
|
+
let {
|
|
147
|
+
circleSize
|
|
148
|
+
} = _ref5;
|
|
149
|
+
return `${circleSize}px`;
|
|
150
|
+
}};
|
|
151
|
+
height: ${_ref6 => {
|
|
152
|
+
let {
|
|
153
|
+
circleSize
|
|
154
|
+
} = _ref6;
|
|
155
|
+
return `${circleSize}px`;
|
|
156
|
+
}};
|
|
157
|
+
flex-shrink: 0;
|
|
158
|
+
margin-right: var(--spacing-s);
|
|
159
|
+
background: ${_ref7 => {
|
|
160
|
+
let {
|
|
161
|
+
accentColor
|
|
162
|
+
} = _ref7;
|
|
163
|
+
return withAlpha(accentColor, '14');
|
|
164
|
+
}};
|
|
165
|
+
`;
|
|
166
|
+
const TextColumn = _styledComponents.default.div`
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-direction: column;
|
|
169
|
+
`;
|
|
93
170
|
const IconBoxTitle = _styledComponents.default.div`
|
|
94
171
|
font-size: var(--font-h2);
|
|
95
172
|
font-weight: bold;
|
|
173
|
+
line-height: 1.4;
|
|
96
174
|
word-break: break-all;
|
|
97
175
|
`;
|
|
98
176
|
const IconBoxBody = _styledComponents.default.div`
|
|
99
177
|
font-size: var(--font-h1);
|
|
100
178
|
font-weight: bold;
|
|
101
|
-
|
|
179
|
+
line-height: 1.3;
|
|
180
|
+
text-align: ${_ref8 => {
|
|
181
|
+
let {
|
|
182
|
+
accentColor
|
|
183
|
+
} = _ref8;
|
|
184
|
+
return accentColor ? 'left' : 'center';
|
|
185
|
+
}};
|
|
186
|
+
color: ${_ref9 => {
|
|
187
|
+
let {
|
|
188
|
+
accentColor
|
|
189
|
+
} = _ref9;
|
|
190
|
+
return accentColor || 'inherit';
|
|
191
|
+
}};
|
|
102
192
|
`;
|
|
103
193
|
var _default = exports.default = IconBox;
|
package/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Dropdown: true,
|
|
8
|
-
Icon: true,
|
|
9
8
|
Tab: true,
|
|
10
9
|
TabV2: true,
|
|
11
10
|
VerticalTab: true
|
|
@@ -16,12 +15,6 @@ Object.defineProperty(exports, "Dropdown", {
|
|
|
16
15
|
return _dropdown.default;
|
|
17
16
|
}
|
|
18
17
|
});
|
|
19
|
-
Object.defineProperty(exports, "Icon", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _Icon.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
18
|
Object.defineProperty(exports, "Tab", {
|
|
26
19
|
enumerable: true,
|
|
27
20
|
get: function () {
|
|
@@ -292,7 +285,18 @@ Object.keys(_heading).forEach(function (key) {
|
|
|
292
285
|
}
|
|
293
286
|
});
|
|
294
287
|
});
|
|
295
|
-
var
|
|
288
|
+
var _icon = require("./icon");
|
|
289
|
+
Object.keys(_icon).forEach(function (key) {
|
|
290
|
+
if (key === "default" || key === "__esModule") return;
|
|
291
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
292
|
+
if (key in exports && exports[key] === _icon[key]) return;
|
|
293
|
+
Object.defineProperty(exports, key, {
|
|
294
|
+
enumerable: true,
|
|
295
|
+
get: function () {
|
|
296
|
+
return _icon[key];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
});
|
|
296
300
|
var _iconbox = require("./iconbox");
|
|
297
301
|
Object.keys(_iconbox).forEach(function (key) {
|
|
298
302
|
if (key === "default" || key === "__esModule") return;
|
package/layout/Footer.js
CHANGED
|
@@ -12,7 +12,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
13
|
const Footer = _styledComponents.default.footer`
|
|
14
14
|
transition: 0.3s;
|
|
15
|
-
border-top:
|
|
15
|
+
border-top: none;
|
|
16
16
|
color: var(--font-on-mute);
|
|
17
17
|
height: 64px;
|
|
18
18
|
line-height: 64px;
|
package/package.json
CHANGED
package/table/Table.js
CHANGED
|
@@ -44,7 +44,23 @@ const Table = _ref => {
|
|
|
44
44
|
beforeCreateRow,
|
|
45
45
|
popoverContainer,
|
|
46
46
|
centerFooter = false,
|
|
47
|
-
showPager = true
|
|
47
|
+
showPager = true,
|
|
48
|
+
limitOptions = [{
|
|
49
|
+
id: 10,
|
|
50
|
+
text: '10'
|
|
51
|
+
}, {
|
|
52
|
+
id: 20,
|
|
53
|
+
text: '20'
|
|
54
|
+
}, {
|
|
55
|
+
id: 30,
|
|
56
|
+
text: '30'
|
|
57
|
+
}, {
|
|
58
|
+
id: 40,
|
|
59
|
+
text: '40'
|
|
60
|
+
}, {
|
|
61
|
+
id: 50,
|
|
62
|
+
text: '50'
|
|
63
|
+
}]
|
|
48
64
|
} = _ref;
|
|
49
65
|
const tableRef = (0, _react.useRef)(null);
|
|
50
66
|
const {
|
|
@@ -304,22 +320,7 @@ const Table = _ref => {
|
|
|
304
320
|
fill: true,
|
|
305
321
|
fillReverse: backgroundReverse,
|
|
306
322
|
allowSearch: false,
|
|
307
|
-
options:
|
|
308
|
-
id: 10,
|
|
309
|
-
text: '10'
|
|
310
|
-
}, {
|
|
311
|
-
id: 20,
|
|
312
|
-
text: '20'
|
|
313
|
-
}, {
|
|
314
|
-
id: 30,
|
|
315
|
-
text: '30'
|
|
316
|
-
}, {
|
|
317
|
-
id: 40,
|
|
318
|
-
text: '40'
|
|
319
|
-
}, {
|
|
320
|
-
id: 50,
|
|
321
|
-
text: '50'
|
|
322
|
-
}],
|
|
323
|
+
options: limitOptions,
|
|
323
324
|
selected: limit,
|
|
324
325
|
onSelect: onLimitChange
|
|
325
326
|
})]
|
|
Binary file
|