@arcblock/ux 2.1.66 → 2.1.69
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/lib/Datatable/TableSearch.js +5 -16
- package/lib/Locale/selector.js +13 -13
- package/package.json +4 -8
- package/src/Datatable/TableSearch.js +5 -14
- package/src/Locale/selector.js +5 -8
- package/lib/Locale/images/globe-dark.png +0 -0
- package/lib/Locale/images/globe-light.png +0 -0
- package/src/ActionButton/ActionButton.stories.js +0 -63
- package/src/ActivityIndicator/ActivityIndicator.stories.js +0 -9
- package/src/ActivityIndicator/demo/basic.js +0 -5
- package/src/ActivityIndicator/demo/with-custom-messages.js +0 -5
- package/src/Alert/Alert.stories.js +0 -100
- package/src/AnimationWaiter/AnimationWaiter.stories.js +0 -22
- package/src/AnimationWaiter/demo/basic.js +0 -5
- package/src/AnimationWaiter/demo/sizes.js +0 -11
- package/src/AnimationWaiter/demo/with-custom-messages.js +0 -5
- package/src/AnimationWaiter/demo/with-maybe-duration.js +0 -11
- package/src/AnimationWaiter/demo/with-more-messages.js +0 -22
- package/src/AnimationWaiter/demo/with-speed.js +0 -18
- package/src/AnimationWaiter/demo/with-tips.js +0 -22
- package/src/Badge/Badge.stories.js +0 -41
- package/src/Blocklet/Blocklet.stories.js +0 -17
- package/src/Blocklet/demo/basic.js +0 -102
- package/src/BlockletNFT/BlockletNFT.stories.js +0 -17
- package/src/BlockletNFT/demo/basic.js +0 -131
- package/src/ClickToCopy/ClickToCopy.stories.js +0 -23
- package/src/ClickToCopy/demo/basic.js +0 -9
- package/src/ClickToCopy/demo/copy-button.js +0 -28
- package/src/ClickToCopy/demo/with-complex-child.js +0 -9
- package/src/ClickToCopy/demo/with-custom-parent-font-color.js +0 -9
- package/src/ContactForm/ContactForm.stories.js +0 -32
- package/src/Earth/Earth.stories.js +0 -39
- package/src/Empty/Empty.stories.js +0 -23
- package/src/Empty/demo/basic.js +0 -5
- package/src/Empty/demo/complex-message.js +0 -13
- package/src/Empty/demo/custom-message.js +0 -5
- package/src/Icon/Icon.stories.js +0 -45
- package/src/Locale/images/globe-dark.png +0 -0
- package/src/Locale/images/globe-light.png +0 -0
- package/src/NFTDisplay/NFTDisplay.stories.js +0 -16
- package/src/NFTDisplay/demo/aspect-ratio.js +0 -33
- package/src/NFTDisplay/demo/basic.js +0 -15
- package/src/NFTDisplay/demo/broken-image.js +0 -84
- package/src/NFTDisplay/demo/custom-loading.js +0 -45
- package/src/NFTDisplay/demo/data/asset-state-display-url.json +0 -7
- package/src/NFTDisplay/demo/data/asset-state-gzipped-svg-1-1.json +0 -10
- package/src/NFTDisplay/demo/data/asset-state-gzipped-svg-374-130.json +0 -10
- package/src/NFTDisplay/demo/data/asset-state-gzipped-svg-with-foreign-object.json +0 -20
- package/src/NFTDisplay/demo/data/asset-state-svg.json +0 -29
- package/src/NFTDisplay/demo/data/asset-state-url.json +0 -10
- package/src/NFTDisplay/demo/fixed-size.js +0 -24
- package/src/NFTDisplay/demo/inset.js +0 -23
- package/src/NFTDisplay/demo/minimum-loading-time.js +0 -68
- package/src/NFTDisplay/demo/nft-type-svg.js +0 -13
- package/src/NFTDisplay/demo/nft-type-url.js +0 -26
- package/src/NFTDisplay/demo/preferred-svg-embedder-prop.js +0 -22
- package/src/NFTDisplay/demo/svg-validation.js +0 -23
- package/src/NFTDisplay/demo/with-foreign-object.js +0 -27
- package/src/PageScroller/story/PageScroller.stories.js +0 -18
- package/src/PricingTable/PricingTable.stories.js +0 -38
- package/src/Spinner/Spinner.stories.js +0 -67
- package/src/SplitButton/SplitButton.stories.js +0 -24
- package/src/SplitButton/demo/basic.js +0 -9
- package/src/TextCollapse/TextCollapse.stories.js +0 -73
@@ -44,14 +44,13 @@ function TableSearch(_ref) {
|
|
44
44
|
searchAlwaysOpen
|
45
45
|
} = options;
|
46
46
|
const [inputExpand, setInputExpand] = (0, _react.useState)(!!searchText || searchOpen || false);
|
47
|
-
const [innerSearchText, setInnerSearchText] = (0, _react.useState)(
|
47
|
+
const [innerSearchText, setInnerSearchText] = (0, _react.useState)(searchText);
|
48
48
|
const inputTimer = (0, _react.useRef)(null);
|
49
49
|
const {
|
50
50
|
loading
|
51
51
|
} = (0, _DatatableContext.useDatatableContext)();
|
52
52
|
const {
|
53
|
-
searchDebounceTime
|
54
|
-
onOutSelfSearch
|
53
|
+
searchDebounceTime
|
55
54
|
} = options;
|
56
55
|
const searchExpand = searchAlwaysOpen || inputExpand;
|
57
56
|
|
@@ -69,14 +68,8 @@ function TableSearch(_ref) {
|
|
69
68
|
clearTimeout(inputTimer.current);
|
70
69
|
setInnerSearchText(value);
|
71
70
|
inputTimer.current = setTimeout(() => {
|
72
|
-
|
73
|
-
onOutSelfSearch(value);
|
74
|
-
} else {
|
75
|
-
searchTextUpdate(value);
|
76
|
-
}
|
71
|
+
searchTextUpdate(value);
|
77
72
|
}, searchDebounceTime);
|
78
|
-
} else if (onOutSelfSearch) {
|
79
|
-
onOutSelfSearch(value);
|
80
73
|
} else {
|
81
74
|
searchTextUpdate(value);
|
82
75
|
}
|
@@ -87,10 +80,6 @@ function TableSearch(_ref) {
|
|
87
80
|
searchClose();
|
88
81
|
setInnerSearchText('');
|
89
82
|
onSearchOpen(false);
|
90
|
-
|
91
|
-
if (onOutSelfSearch) {
|
92
|
-
onOutSelfSearch('');
|
93
|
-
}
|
94
83
|
};
|
95
84
|
|
96
85
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
@@ -116,14 +105,14 @@ function TableSearch(_ref) {
|
|
116
105
|
variant: "standard",
|
117
106
|
spacing: 2,
|
118
107
|
onChange: onChange,
|
119
|
-
value: searchDebounceTime ? innerSearchText : searchText
|
108
|
+
value: searchDebounceTime ? innerSearchText : searchText,
|
120
109
|
placeholder: searchPlaceholder || '',
|
121
110
|
autoFocus: !searchAlwaysOpen
|
122
111
|
}), loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
|
123
112
|
disabled: true,
|
124
113
|
variant: "standard",
|
125
114
|
spacing: 2,
|
126
|
-
value: searchDebounceTime ? innerSearchText : searchText
|
115
|
+
value: searchDebounceTime ? innerSearchText : searchText
|
127
116
|
})]
|
128
117
|
}), !searchAlwaysOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
129
118
|
className: "toolbar-search-close ".concat(searchExpand ? 'toolbar-btn-show' : ''),
|
package/lib/Locale/selector.js
CHANGED
@@ -31,17 +31,15 @@ var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
31
31
|
|
32
32
|
var _Check = _interopRequireDefault(require("@mui/icons-material/Check"));
|
33
33
|
|
34
|
+
var _Globe = _interopRequireDefault(require("@arcblock/icons/lib/Globe"));
|
35
|
+
|
34
36
|
var _Util = require("../Util");
|
35
37
|
|
36
38
|
var _context = require("./context");
|
37
39
|
|
38
|
-
var _globeDark = _interopRequireDefault(require("./images/globe-dark.png"));
|
39
|
-
|
40
|
-
var _globeLight = _interopRequireDefault(require("./images/globe-light.png"));
|
41
|
-
|
42
40
|
var _jsxRuntime = require("react/jsx-runtime");
|
43
41
|
|
44
|
-
const _excluded = ["
|
42
|
+
const _excluded = ["showText", "popperProps", "popperType", "icon"];
|
45
43
|
|
46
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
47
45
|
|
@@ -56,8 +54,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
56
54
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
57
55
|
|
58
56
|
function LocaleSelector(props) {
|
57
|
+
var _theme$palette, _theme$palette2, _theme$palette2$text;
|
58
|
+
|
59
59
|
const {
|
60
|
-
dark,
|
61
60
|
showText,
|
62
61
|
popperProps,
|
63
62
|
popperType,
|
@@ -72,6 +71,7 @@ function LocaleSelector(props) {
|
|
72
71
|
const anchorEl = (0, _react.useRef)(null);
|
73
72
|
const [open, setOpen] = (0, _react.useState)(false);
|
74
73
|
const theme = (0, _styles.useTheme)();
|
74
|
+
const dark = (theme === null || theme === void 0 ? void 0 : (_theme$palette = theme.palette) === null || _theme$palette === void 0 ? void 0 : _theme$palette.mode) === 'dark';
|
75
75
|
|
76
76
|
const onSelect = newLocale => {
|
77
77
|
changeLocale(newLocale);
|
@@ -107,12 +107,14 @@ function LocaleSelector(props) {
|
|
107
107
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {});
|
108
108
|
}
|
109
109
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
111
|
-
|
112
|
-
|
113
|
-
|
110
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Globe.default, {
|
111
|
+
style: {
|
112
|
+
width: 26,
|
113
|
+
height: 24.76,
|
114
|
+
color: theme.palette.text.secondary
|
115
|
+
}
|
114
116
|
});
|
115
|
-
}, [Icon,
|
117
|
+
}, [Icon, theme === null || theme === void 0 ? void 0 : (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 ? void 0 : (_theme$palette2$text = _theme$palette2.text) === null || _theme$palette2$text === void 0 ? void 0 : _theme$palette2$text.secondary]);
|
116
118
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Div, _objectSpread(_objectSpread(_objectSpread({
|
117
119
|
component: "div",
|
118
120
|
dark: dark,
|
@@ -162,7 +164,6 @@ function LocaleSelector(props) {
|
|
162
164
|
}
|
163
165
|
|
164
166
|
LocaleSelector.propTypes = {
|
165
|
-
dark: _propTypes.default.bool,
|
166
167
|
size: _propTypes.default.number,
|
167
168
|
showText: _propTypes.default.bool,
|
168
169
|
popperProps: _propTypes.default.object,
|
@@ -171,7 +172,6 @@ LocaleSelector.propTypes = {
|
|
171
172
|
icon: _propTypes.default.any
|
172
173
|
};
|
173
174
|
LocaleSelector.defaultProps = {
|
174
|
-
dark: false,
|
175
175
|
showText: true,
|
176
176
|
size: 24,
|
177
177
|
popperProps: {},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.69",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -11,10 +11,6 @@
|
|
11
11
|
"homepage": "https://github.com/ArcBlock/ux#readme",
|
12
12
|
"license": "Apache-2.0",
|
13
13
|
"main": "lib/index.js",
|
14
|
-
"files": [
|
15
|
-
"lib",
|
16
|
-
"src"
|
17
|
-
],
|
18
14
|
"repository": {
|
19
15
|
"type": "git",
|
20
16
|
"url": "git+https://github.com/ArcBlock/ux.git"
|
@@ -52,10 +48,10 @@
|
|
52
48
|
"react": ">=18.1.0",
|
53
49
|
"react-ga": "^2.7.0"
|
54
50
|
},
|
55
|
-
"gitHead": "
|
51
|
+
"gitHead": "84373c9197af46cc11f69940e31163e11d55fe6f",
|
56
52
|
"dependencies": {
|
57
|
-
"@arcblock/icons": "^2.1.
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
53
|
+
"@arcblock/icons": "^2.1.69",
|
54
|
+
"@arcblock/react-hooks": "^2.1.69",
|
59
55
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
60
56
|
"@emotion/react": "^11.9.0",
|
61
57
|
"@emotion/styled": "^11.8.1",
|
@@ -12,11 +12,11 @@ import { useDatatableContext } from './DatatableContext';
|
|
12
12
|
export default function TableSearch({ search, options, searchText, searchTextUpdate, searchClose, onSearchOpen }) {
|
13
13
|
const { searchOpen, searchPlaceholder, searchAlwaysOpen } = options;
|
14
14
|
const [inputExpand, setInputExpand] = useState(!!searchText || searchOpen || false);
|
15
|
-
const [innerSearchText, setInnerSearchText] = useState(
|
15
|
+
const [innerSearchText, setInnerSearchText] = useState(searchText);
|
16
16
|
const inputTimer = useRef(null);
|
17
17
|
const { loading } = useDatatableContext();
|
18
18
|
|
19
|
-
const { searchDebounceTime
|
19
|
+
const { searchDebounceTime } = options;
|
20
20
|
|
21
21
|
const searchExpand = searchAlwaysOpen || inputExpand;
|
22
22
|
|
@@ -31,14 +31,8 @@ export default function TableSearch({ search, options, searchText, searchTextUpd
|
|
31
31
|
clearTimeout(inputTimer.current);
|
32
32
|
setInnerSearchText(value);
|
33
33
|
inputTimer.current = setTimeout(() => {
|
34
|
-
|
35
|
-
onOutSelfSearch(value);
|
36
|
-
} else {
|
37
|
-
searchTextUpdate(value);
|
38
|
-
}
|
34
|
+
searchTextUpdate(value);
|
39
35
|
}, searchDebounceTime);
|
40
|
-
} else if (onOutSelfSearch) {
|
41
|
-
onOutSelfSearch(value);
|
42
36
|
} else {
|
43
37
|
searchTextUpdate(value);
|
44
38
|
}
|
@@ -49,9 +43,6 @@ export default function TableSearch({ search, options, searchText, searchTextUpd
|
|
49
43
|
searchClose();
|
50
44
|
setInnerSearchText('');
|
51
45
|
onSearchOpen(false);
|
52
|
-
if (onOutSelfSearch) {
|
53
|
-
onOutSelfSearch('');
|
54
|
-
}
|
55
46
|
};
|
56
47
|
|
57
48
|
return (
|
@@ -81,7 +72,7 @@ export default function TableSearch({ search, options, searchText, searchTextUpd
|
|
81
72
|
variant="standard"
|
82
73
|
spacing={2}
|
83
74
|
onChange={onChange}
|
84
|
-
value={searchDebounceTime ? innerSearchText : searchText
|
75
|
+
value={searchDebounceTime ? innerSearchText : searchText}
|
85
76
|
placeholder={searchPlaceholder || ''}
|
86
77
|
autoFocus={!searchAlwaysOpen}
|
87
78
|
/>
|
@@ -92,7 +83,7 @@ export default function TableSearch({ search, options, searchText, searchTextUpd
|
|
92
83
|
disabled
|
93
84
|
variant="standard"
|
94
85
|
spacing={2}
|
95
|
-
value={searchDebounceTime ? innerSearchText : searchText
|
86
|
+
value={searchDebounceTime ? innerSearchText : searchText}
|
96
87
|
/>
|
97
88
|
)}
|
98
89
|
</div>
|
package/src/Locale/selector.js
CHANGED
@@ -13,20 +13,19 @@ import MenuItem from '@mui/material/MenuItem';
|
|
13
13
|
import MenuList from '@mui/material/MenuList';
|
14
14
|
import Box from '@mui/material/Box';
|
15
15
|
import CheckIcon from '@mui/icons-material/Check';
|
16
|
+
import GlobeIcon from '@arcblock/icons/lib/Globe';
|
16
17
|
|
17
18
|
import { getColor, getBackground } from '../Util';
|
18
19
|
|
19
20
|
import { LocaleContext, languages } from './context';
|
20
21
|
|
21
|
-
import globeDark from './images/globe-dark.png';
|
22
|
-
import globeLight from './images/globe-light.png';
|
23
|
-
|
24
22
|
function LocaleSelector(props) {
|
25
|
-
const {
|
23
|
+
const { showText, popperProps, popperType, icon: Icon, ...rest } = props;
|
26
24
|
const { locale, changeLocale } = useContext(LocaleContext);
|
27
25
|
const anchorEl = useRef(null);
|
28
26
|
const [open, setOpen] = useState(false);
|
29
27
|
const theme = useTheme();
|
28
|
+
const dark = theme?.palette?.mode === 'dark';
|
30
29
|
|
31
30
|
const onSelect = (newLocale) => {
|
32
31
|
changeLocale(newLocale);
|
@@ -64,8 +63,8 @@ function LocaleSelector(props) {
|
|
64
63
|
return <Icon />;
|
65
64
|
}
|
66
65
|
|
67
|
-
return <
|
68
|
-
}, [Icon,
|
66
|
+
return <GlobeIcon style={{ width: 26, height: 24.76, color: theme.palette.text.secondary }} />;
|
67
|
+
}, [Icon, theme?.palette?.text?.secondary]);
|
69
68
|
|
70
69
|
return (
|
71
70
|
<Div component="div" dark={dark} theme={theme} {...rest} {...handleEventProps}>
|
@@ -105,7 +104,6 @@ function LocaleSelector(props) {
|
|
105
104
|
}
|
106
105
|
|
107
106
|
LocaleSelector.propTypes = {
|
108
|
-
dark: PropTypes.bool,
|
109
107
|
size: PropTypes.number,
|
110
108
|
showText: PropTypes.bool,
|
111
109
|
popperProps: PropTypes.object,
|
@@ -115,7 +113,6 @@ LocaleSelector.propTypes = {
|
|
115
113
|
};
|
116
114
|
|
117
115
|
LocaleSelector.defaultProps = {
|
118
|
-
dark: false,
|
119
116
|
showText: true,
|
120
117
|
size: 24,
|
121
118
|
popperProps: {},
|
Binary file
|
Binary file
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { ThemeProvider } from '@mui/material/styles';
|
2
|
-
|
3
|
-
import { create } from '../Theme';
|
4
|
-
import ActionButton from '.';
|
5
|
-
|
6
|
-
export default {
|
7
|
-
title: 'Deprecated/ActionButton',
|
8
|
-
|
9
|
-
parameters: {
|
10
|
-
readme: {
|
11
|
-
sidebar: '<!-- PROPS -->',
|
12
|
-
},
|
13
|
-
},
|
14
|
-
};
|
15
|
-
|
16
|
-
export function WithDifferentColor() {
|
17
|
-
return (
|
18
|
-
<ThemeProvider theme={create()}>
|
19
|
-
<div>
|
20
|
-
<ActionButton href="/" theme="inherit">
|
21
|
-
Default Button
|
22
|
-
</ActionButton>
|
23
|
-
<ActionButton href="/" theme="primary">
|
24
|
-
Primary Button
|
25
|
-
</ActionButton>
|
26
|
-
<ActionButton href="/" theme="secondary">
|
27
|
-
Secondary Button
|
28
|
-
</ActionButton>
|
29
|
-
<ActionButton href="/" theme="reverse">
|
30
|
-
Reverse Button
|
31
|
-
</ActionButton>
|
32
|
-
</div>
|
33
|
-
</ThemeProvider>
|
34
|
-
);
|
35
|
-
}
|
36
|
-
|
37
|
-
WithDifferentColor.storyName = 'with different color';
|
38
|
-
|
39
|
-
export function WithDifferentVariant() {
|
40
|
-
return (
|
41
|
-
<ThemeProvider theme={create()}>
|
42
|
-
<div>
|
43
|
-
<ActionButton href="/" variant="text">
|
44
|
-
Text Button
|
45
|
-
</ActionButton>
|
46
|
-
<ActionButton href="/" variant="outlined">
|
47
|
-
Outlined Button
|
48
|
-
</ActionButton>
|
49
|
-
<ActionButton href="/" variant="contained">
|
50
|
-
Contained Button
|
51
|
-
</ActionButton>
|
52
|
-
|
53
|
-
<div style={{ background: '#222', padding: 12, marginTop: 24 }}>
|
54
|
-
<ActionButton href="/" variant="contained" theme="reverse">
|
55
|
-
Contained Reverse Button
|
56
|
-
</ActionButton>
|
57
|
-
</div>
|
58
|
-
</div>
|
59
|
-
</ThemeProvider>
|
60
|
-
);
|
61
|
-
}
|
62
|
-
|
63
|
-
WithDifferentVariant.storyName = 'with different variant';
|
@@ -1,100 +0,0 @@
|
|
1
|
-
import Alert from '.';
|
2
|
-
|
3
|
-
export default {
|
4
|
-
title: 'Deprecated/Alert',
|
5
|
-
|
6
|
-
parameters: {
|
7
|
-
readme: {
|
8
|
-
sidebar: '<!-- PROPS -->',
|
9
|
-
},
|
10
|
-
},
|
11
|
-
};
|
12
|
-
|
13
|
-
export function WithDifferentType() {
|
14
|
-
return (
|
15
|
-
<div
|
16
|
-
style={{
|
17
|
-
display: 'flex',
|
18
|
-
flexDirection: 'column',
|
19
|
-
width: '300px',
|
20
|
-
justifyContent: 'space-between',
|
21
|
-
}}>
|
22
|
-
<Alert type="error">Error message</Alert>
|
23
|
-
<Alert type="warning">Warning message</Alert>
|
24
|
-
<Alert type="success">Success message</Alert>
|
25
|
-
<Alert type="tip">Default tip</Alert>
|
26
|
-
</div>
|
27
|
-
);
|
28
|
-
}
|
29
|
-
|
30
|
-
WithDifferentType.storyName = 'with different type';
|
31
|
-
|
32
|
-
export function WithDifferentVariant() {
|
33
|
-
return (
|
34
|
-
<div
|
35
|
-
style={{
|
36
|
-
display: 'flex',
|
37
|
-
flexDirection: 'column',
|
38
|
-
width: '300px',
|
39
|
-
justifyContent: 'space-between',
|
40
|
-
}}>
|
41
|
-
<Alert type="error" variant="icon">
|
42
|
-
Error message
|
43
|
-
</Alert>
|
44
|
-
<Alert type="warning" variant="border">
|
45
|
-
Warning message
|
46
|
-
</Alert>
|
47
|
-
</div>
|
48
|
-
);
|
49
|
-
}
|
50
|
-
|
51
|
-
WithDifferentVariant.storyName = 'with different variant';
|
52
|
-
|
53
|
-
export function WithIcon() {
|
54
|
-
return (
|
55
|
-
<div
|
56
|
-
style={{
|
57
|
-
display: 'flex',
|
58
|
-
flexDirection: 'column',
|
59
|
-
width: '300px',
|
60
|
-
justifyContent: 'space-between',
|
61
|
-
}}>
|
62
|
-
<Alert type="error" showIcon>
|
63
|
-
Error message
|
64
|
-
</Alert>
|
65
|
-
<Alert type="warning" showIcon>
|
66
|
-
Warning message
|
67
|
-
</Alert>
|
68
|
-
<Alert type="success" showIcon>
|
69
|
-
Success message
|
70
|
-
</Alert>
|
71
|
-
<Alert type="tip" showIcon>
|
72
|
-
Default tip
|
73
|
-
</Alert>
|
74
|
-
</div>
|
75
|
-
);
|
76
|
-
}
|
77
|
-
|
78
|
-
WithIcon.storyName = 'with icon';
|
79
|
-
|
80
|
-
export function WithDifferentMessage() {
|
81
|
-
return (
|
82
|
-
<div
|
83
|
-
style={{
|
84
|
-
display: 'flex',
|
85
|
-
flexDirection: 'column',
|
86
|
-
width: '300px',
|
87
|
-
justifyContent: 'space-between',
|
88
|
-
}}>
|
89
|
-
<Alert type="error">Error message</Alert>
|
90
|
-
<Alert type="error">
|
91
|
-
<ul>
|
92
|
-
<li>Error message 1</li>
|
93
|
-
<li>Error message 2</li>
|
94
|
-
</ul>
|
95
|
-
</Alert>
|
96
|
-
</div>
|
97
|
-
);
|
98
|
-
}
|
99
|
-
|
100
|
-
WithDifferentMessage.storyName = 'with different message';
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import AnimationWaiter from '.';
|
2
|
-
|
3
|
-
export { default as Basic } from './demo/basic';
|
4
|
-
export { default as WithCustomMessages } from './demo/with-custom-messages';
|
5
|
-
export { default as WithMoreMessages } from './demo/with-more-messages';
|
6
|
-
export { default as Sizes } from './demo/sizes';
|
7
|
-
export { default as WithTips } from './demo/with-tips';
|
8
|
-
export { default as WithSpeed } from './demo/with-speed';
|
9
|
-
export { default as WithMaybeDuration } from './demo/with-maybe-duration';
|
10
|
-
|
11
|
-
export default {
|
12
|
-
title: 'UX/AnimationWaiter',
|
13
|
-
component: AnimationWaiter,
|
14
|
-
parameters: {
|
15
|
-
docs: {
|
16
|
-
description: {
|
17
|
-
component:
|
18
|
-
'AnimationWaiter is a loading component that provides feedback when the user is waiting for a long time to perform an operation.',
|
19
|
-
},
|
20
|
-
},
|
21
|
-
},
|
22
|
-
};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import AnimationWaiter from '..';
|
2
|
-
|
3
|
-
export default function Sizes() {
|
4
|
-
return (
|
5
|
-
<div>
|
6
|
-
<AnimationWaiter message="I am default size" />
|
7
|
-
<AnimationWaiter message="I am size 100" size={100} />
|
8
|
-
<AnimationWaiter message="I am size 400" size={500} />
|
9
|
-
</div>
|
10
|
-
);
|
11
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import AnimationWaiter from '..';
|
2
|
-
|
3
|
-
export default function WithMoreMessages() {
|
4
|
-
return (
|
5
|
-
<div>
|
6
|
-
<AnimationWaiter message={['Message 1', 'Message 2', 'Message 3']} messageDuration={2000} />
|
7
|
-
<AnimationWaiter
|
8
|
-
message={[
|
9
|
-
'Message 1',
|
10
|
-
<div style={{ color: 'red' }}>
|
11
|
-
Custom Element Message More More More Desc More Desc More Desc More Desc More
|
12
|
-
<br />
|
13
|
-
Desc More Desc More Desc
|
14
|
-
</div>,
|
15
|
-
'Message 3',
|
16
|
-
]}
|
17
|
-
messageDuration={2000}
|
18
|
-
/>
|
19
|
-
<AnimationWaiter message={['Message 1', 'Message 2', 'Message 3']} messageDuration={2000} messageLoop={false} />
|
20
|
-
</div>
|
21
|
-
);
|
22
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import AnimationWaiter from '..';
|
2
|
-
|
3
|
-
export default function WithSpeed() {
|
4
|
-
return (
|
5
|
-
<div>
|
6
|
-
<AnimationWaiter
|
7
|
-
increaseSpeed={0.2} // 1+0.2
|
8
|
-
message="Initial speed 1x, increasing to 1.2x in two minute"
|
9
|
-
/>
|
10
|
-
<AnimationWaiter speed={0.5} message="Evening animation 0.5x" />
|
11
|
-
<AnimationWaiter
|
12
|
-
speed={0.5}
|
13
|
-
increaseSpeed={0.2} // 0.5+0.2
|
14
|
-
message="Initial speed 0.5x, increasing to 0.7x in two minute"
|
15
|
-
/>
|
16
|
-
</div>
|
17
|
-
);
|
18
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import AnimationWaiter from '..';
|
2
|
-
|
3
|
-
export default function WithTips() {
|
4
|
-
const tips = [
|
5
|
-
<div style={{ color: 'red', paddingBottom: 14 }}>I am tips 1</div>,
|
6
|
-
<div style={{ color: 'green', paddingBottom: 14 }}>I am tips 2</div>,
|
7
|
-
<div style={{ color: 'blue', paddingBottom: 14 }}>I am tips 3</div>,
|
8
|
-
];
|
9
|
-
|
10
|
-
return (
|
11
|
-
<div
|
12
|
-
style={{
|
13
|
-
width: 375,
|
14
|
-
height: 667,
|
15
|
-
backgroundColor: '#eee',
|
16
|
-
color: '#1dc1c7',
|
17
|
-
textAlign: 'center',
|
18
|
-
}}>
|
19
|
-
<AnimationWaiter message="I am message" tips={tips} tipsDuration={1000} />
|
20
|
-
</div>
|
21
|
-
);
|
22
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import Badge from '.';
|
2
|
-
|
3
|
-
export default {
|
4
|
-
title: 'Deprecated/Badge',
|
5
|
-
|
6
|
-
parameters: {
|
7
|
-
readme: {
|
8
|
-
sidebar: '<!-- PROPS -->',
|
9
|
-
},
|
10
|
-
},
|
11
|
-
};
|
12
|
-
|
13
|
-
export function WithDifferentType() {
|
14
|
-
return (
|
15
|
-
<div
|
16
|
-
style={{
|
17
|
-
display: 'flex',
|
18
|
-
flexDirection: 'column',
|
19
|
-
width: '300px',
|
20
|
-
justifyContent: 'space-between',
|
21
|
-
}}>
|
22
|
-
<Badge type="error" style={{ marginBottom: 16 }}>
|
23
|
-
Error message
|
24
|
-
</Badge>
|
25
|
-
<Badge type="warning" style={{ marginBottom: 16 }}>
|
26
|
-
Warning message
|
27
|
-
</Badge>
|
28
|
-
<Badge type="success" style={{ marginBottom: 16 }}>
|
29
|
-
Success message
|
30
|
-
</Badge>
|
31
|
-
<Badge type="primary" style={{ marginBottom: 16 }}>
|
32
|
-
Default tip
|
33
|
-
</Badge>
|
34
|
-
<Badge type="reverse" style={{ marginBottom: 16 }}>
|
35
|
-
Reverse styling
|
36
|
-
</Badge>
|
37
|
-
</div>
|
38
|
-
);
|
39
|
-
}
|
40
|
-
|
41
|
-
WithDifferentType.storyName = 'with different type';
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import Basic from './demo/basic';
|
2
|
-
|
3
|
-
export default {
|
4
|
-
title: 'UX/Blocklet',
|
5
|
-
|
6
|
-
parameters: {
|
7
|
-
docs: {
|
8
|
-
description: {
|
9
|
-
component: 'Blocklet component is used to display Blocklet Information',
|
10
|
-
},
|
11
|
-
},
|
12
|
-
},
|
13
|
-
};
|
14
|
-
|
15
|
-
Basic.storyName = 'Blocklet';
|
16
|
-
|
17
|
-
export { Basic };
|