@arcblock/ux 3.4.15 → 3.5.1
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/package.json.js +1 -1
- package/package.json +10 -7
- package/src/ActionButton/ActionButton.stories.jsx +0 -61
- package/src/ActionButton/index.jsx +0 -106
- package/src/ActivityIndicator/ActivityIndicator.stories.jsx +0 -9
- package/src/ActivityIndicator/index.jsx +0 -140
- package/src/Address/Address.stories.jsx +0 -38
- package/src/Address/compact-text.jsx +0 -76
- package/src/Address/did-address.tsx +0 -223
- package/src/Address/index.tsx +0 -21
- package/src/Address/responsive-did-address.tsx +0 -154
- package/src/Alert/Alert.stories.jsx +0 -100
- package/src/Alert/index.jsx +0 -130
- package/src/AnimationWaiter/AnimationWaiter.stories.jsx +0 -35
- package/src/AnimationWaiter/dark-animation.json +0 -1
- package/src/AnimationWaiter/default-animation.json +0 -1
- package/src/AnimationWaiter/index.jsx +0 -296
- package/src/Async/index.tsx +0 -44
- package/src/Avatar/Avatar.stories.jsx +0 -11
- package/src/Avatar/did-motif.jsx +0 -38
- package/src/Avatar/etherscan-blockies.js +0 -81
- package/src/Avatar/index.jsx +0 -195
- package/src/Badge/Badge.stories.jsx +0 -41
- package/src/Badge/index.jsx +0 -101
- package/src/Blocklet/Blocklet.stories.jsx +0 -21
- package/src/Blocklet/blocklet.jsx +0 -276
- package/src/Blocklet/index.js +0 -5
- package/src/Blocklet/utils.jsx +0 -58
- package/src/BlockletContext/index.tsx +0 -72
- package/src/BlockletNFT/BlockletNFT.stories.jsx +0 -21
- package/src/BlockletNFT/index.jsx +0 -378
- package/src/BlockletV2/Blocklet.stories.jsx +0 -34
- package/src/BlockletV2/blocklet.tsx +0 -247
- package/src/BlockletV2/components/icon-text.tsx +0 -47
- package/src/BlockletV2/components/tooltip-icon.tsx +0 -52
- package/src/BlockletV2/index.ts +0 -6
- package/src/BlockletV2/utils.js +0 -75
- package/src/Button/Button.stories.jsx +0 -24
- package/src/Button/index.js +0 -9
- package/src/Button/wrap.jsx +0 -126
- package/src/ButtonGroup/index.js +0 -16
- package/src/CardSelector/index.tsx +0 -136
- package/src/Center/Center.stories.jsx +0 -20
- package/src/Center/index.tsx +0 -33
- package/src/ClickToCopy/ClickToCopy.stories.jsx +0 -24
- package/src/ClickToCopy/copy-button.tsx +0 -43
- package/src/ClickToCopy/hook.ts +0 -42
- package/src/ClickToCopy/index.tsx +0 -96
- package/src/CloseButton/index.tsx +0 -37
- package/src/CodeBlock/CodeBlock.stories.jsx +0 -22
- package/src/CodeBlock/LightBox.tsx +0 -87
- package/src/CodeBlock/index.tsx +0 -217
- package/src/Colors/Colors.stories.jsx +0 -211
- package/src/Colors/index.ts +0 -4
- package/src/Colors/themes/default.ts +0 -8
- package/src/Colors/themes/did-connect.ts +0 -64
- package/src/Colors/themes/temp.ts +0 -52
- package/src/Config/Config.stories.jsx +0 -16
- package/src/Config/config-provider.tsx +0 -62
- package/src/Config/index.ts +0 -2
- package/src/Config/theme-mode-toggle.tsx +0 -38
- package/src/ContactForm/ContactForm.stories.jsx +0 -32
- package/src/ContactForm/index.tsx +0 -264
- package/src/CookieConsent/CookieConsent.stories.jsx +0 -33
- package/src/CookieConsent/index.tsx +0 -104
- package/src/CountDown/CountDown.stories.jsx +0 -15
- package/src/CountDown/index.tsx +0 -170
- package/src/DID/DID.stories.jsx +0 -37
- package/src/DID/index.tsx +0 -393
- package/src/DIDConnect/app-icon.tsx +0 -37
- package/src/DIDConnect/app-info-item.tsx +0 -93
- package/src/DIDConnect/auth-apps/auth-apps-info.tsx +0 -77
- package/src/DIDConnect/auth-apps/index.tsx +0 -278
- package/src/DIDConnect/auth-apps/switch-role.tsx +0 -47
- package/src/DIDConnect/did-connect-container.tsx +0 -326
- package/src/DIDConnect/did-connect-footer.tsx +0 -76
- package/src/DIDConnect/did-connect-logo.tsx +0 -8
- package/src/DIDConnect/icons/did-wallet-logo.tsx +0 -18
- package/src/DIDConnect/icons/github-logo.tsx +0 -17
- package/src/DIDConnect/index.ts +0 -11
- package/src/DIDConnect/landing-page.tsx +0 -218
- package/src/DIDConnect/powered-by.tsx +0 -48
- package/src/DIDConnect/provider-icon.tsx +0 -62
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +0 -304
- package/src/DIDConnect/with-container.tsx +0 -323
- package/src/DIDConnect/with-ux-theme.tsx +0 -22
- package/src/DIDLogo/Logo.stories.jsx +0 -11
- package/src/DIDLogo/index.tsx +0 -168
- package/src/Datatable/CustomToolbar.jsx +0 -415
- package/src/Datatable/Datatable.stories.jsx +0 -92
- package/src/Datatable/DatatableContext.jsx +0 -35
- package/src/Datatable/TableSearch.jsx +0 -166
- package/src/Datatable/index.jsx +0 -652
- package/src/Datatable/utils.js +0 -161
- package/src/Dialog/Dialog.stories.jsx +0 -21
- package/src/Dialog/confirm.jsx +0 -143
- package/src/Dialog/dialog.jsx +0 -199
- package/src/Dialog/index.js +0 -4
- package/src/Dialog/types.d.ts +0 -20
- package/src/Dialog/use-confirm.jsx +0 -188
- package/src/DriftBot/index.tsx +0 -81
- package/src/Earth/Earth.stories.jsx +0 -39
- package/src/Earth/countries.json +0 -8057
- package/src/Earth/index.tsx +0 -515
- package/src/Earth/util.ts +0 -72
- package/src/Empty/Empty.stories.jsx +0 -23
- package/src/Empty/index.jsx +0 -48
- package/src/ErrorBoundary/ErrorBoundary.stories.jsx +0 -13
- package/src/ErrorBoundary/fallback.tsx +0 -85
- package/src/ErrorBoundary/index.ts +0 -1
- package/src/Footer/Footer.stories.jsx +0 -13
- package/src/Footer/index.tsx +0 -130
- package/src/Header/Header.stories.jsx +0 -30
- package/src/Header/addon-button.tsx +0 -41
- package/src/Header/auto-hidden.tsx +0 -31
- package/src/Header/header-addons.tsx +0 -37
- package/src/Header/header.tsx +0 -214
- package/src/Header/index.ts +0 -3
- package/src/Header/responsive-header.tsx +0 -145
- package/src/Icon/Icon.stories.jsx +0 -45
- package/src/Icon/image.tsx +0 -53
- package/src/Icon/index.tsx +0 -63
- package/src/Img/Img.stories.jsx +0 -17
- package/src/Img/index.jsx +0 -258
- package/src/InfoRow/InfoRow.stories.jsx +0 -14
- package/src/InfoRow/index.tsx +0 -91
- package/src/Layout/Layout.stories.jsx +0 -24
- package/src/Layout/dashboard/external-link.tsx +0 -59
- package/src/Layout/dashboard/full-page.tsx +0 -58
- package/src/Layout/dashboard/index.tsx +0 -260
- package/src/Layout/dashboard/sidebar.tsx +0 -198
- package/src/Layout/dashboard-legacy/header.tsx +0 -156
- package/src/Layout/dashboard-legacy/index.tsx +0 -127
- package/src/Layout/dashboard-legacy/sidebar.tsx +0 -129
- package/src/Layout/index.tsx +0 -310
- package/src/LoadingMask/index.tsx +0 -108
- package/src/Locale/LocaleSelector.stories.jsx +0 -44
- package/src/Locale/browser-lang.ts +0 -65
- package/src/Locale/context.tsx +0 -162
- package/src/Locale/languages.ts +0 -58
- package/src/Locale/selector.tsx +0 -174
- package/src/Locale/util.ts +0 -38
- package/src/Logo/Logo.stories.jsx +0 -23
- package/src/Logo/images/logo-dark-text.svg +0 -3
- package/src/Logo/images/logo-dark-top.svg +0 -6
- package/src/Logo/images/logo-light-text.svg +0 -3
- package/src/Logo/images/logo-light-top.svg +0 -6
- package/src/Logo/index.tsx +0 -58
- package/src/Metric/Metric.stories.jsx +0 -29
- package/src/Metric/index.tsx +0 -130
- package/src/MuiWrap/index.tsx +0 -10
- package/src/NFTDisplay/NFTBroken.svg +0 -34
- package/src/NFTDisplay/NFTDisplay.stories.jsx +0 -30
- package/src/NFTDisplay/README.md +0 -59
- package/src/NFTDisplay/aspect-ratio-container.tsx +0 -36
- package/src/NFTDisplay/broken.tsx +0 -51
- package/src/NFTDisplay/displayApi.ts +0 -43
- package/src/NFTDisplay/index.tsx +0 -393
- package/src/NFTDisplay/loading.tsx +0 -16
- package/src/NFTDisplay/preview.tsx +0 -84
- package/src/NFTDisplay/render-svg.tsx +0 -21
- package/src/NFTDisplay/svg-embedder/img.tsx +0 -27
- package/src/NFTDisplay/svg-embedder/inline-svg.tsx +0 -36
- package/src/NavMenu/NavMenu.stories.jsx +0 -17
- package/src/NavMenu/images/OCAP.svg +0 -1
- package/src/NavMenu/images/abt-network.svg +0 -1
- package/src/NavMenu/images/ai-kit.svg +0 -1
- package/src/NavMenu/images/aigne-image-smith.svg +0 -1
- package/src/NavMenu/images/aigne.svg +0 -1
- package/src/NavMenu/images/aistro.png +0 -0
- package/src/NavMenu/images/arcsphere.svg +0 -1
- package/src/NavMenu/images/blocklet-framework.svg +0 -1
- package/src/NavMenu/images/blocklet-launcher.svg +0 -1
- package/src/NavMenu/images/blocklet-server.svg +0 -1
- package/src/NavMenu/images/blocklet-store.svg +0 -1
- package/src/NavMenu/images/creator-studio.svg +0 -1
- package/src/NavMenu/images/did-wallet.svg +0 -1
- package/src/NavMenu/images/did.svg +0 -1
- package/src/NavMenu/images/nft-studio.svg +0 -1
- package/src/NavMenu/images/payment-kit.png +0 -0
- package/src/NavMenu/images/vc.svg +0 -1
- package/src/NavMenu/images/web3-kit.svg +0 -1
- package/src/NavMenu/index.ts +0 -3
- package/src/NavMenu/nav-menu-context.tsx +0 -30
- package/src/NavMenu/nav-menu.tsx +0 -441
- package/src/NavMenu/products.tsx +0 -830
- package/src/NavMenu/style.ts +0 -258
- package/src/NavMenu/sub-container.tsx +0 -125
- package/src/NavMenu/sub-item-group.tsx +0 -42
- package/src/OrgTransfer/index.tsx +0 -53
- package/src/OrgTransfer/locales.ts +0 -25
- package/src/OrgTransfer/selector.tsx +0 -252
- package/src/OrgTransfer/type.ts +0 -31
- package/src/PageScroller/index.tsx +0 -316
- package/src/PageScroller/story/FifthComponent.jsx +0 -7
- package/src/PageScroller/story/FirstComponent.jsx +0 -7
- package/src/PageScroller/story/FourthComponent.jsx +0 -7
- package/src/PageScroller/story/FullPage.jsx +0 -55
- package/src/PageScroller/story/PageContain.jsx +0 -59
- package/src/PageScroller/story/PageScroller.stories.jsx +0 -18
- package/src/PageScroller/story/SecondComponent.jsx +0 -7
- package/src/PageScroller/story/ThirdComponent.jsx +0 -7
- package/src/PageScroller/story/index.css +0 -115
- package/src/PageScroller/usePrevValue.ts +0 -11
- package/src/Passport/index.ts +0 -3
- package/src/Passport/passport.tsx +0 -118
- package/src/PhoneInput/PhoneInput.stories.jsx +0 -12
- package/src/PhoneInput/country-select.tsx +0 -148
- package/src/PhoneInput/index.tsx +0 -269
- package/src/PoweredByArcBlock/index.tsx +0 -27
- package/src/PricingTable/PricingPlan.tsx +0 -120
- package/src/PricingTable/PricingTable.stories.jsx +0 -38
- package/src/PricingTable/index.tsx +0 -59
- package/src/QRCode/QRCode.stories.jsx +0 -13
- package/src/QRCode/index.tsx +0 -66
- package/src/RelativeTime/RelativeTime.stories.jsx +0 -20
- package/src/RelativeTime/index.tsx +0 -334
- package/src/Result/Result.stories.jsx +0 -61
- package/src/Result/common.tsx +0 -119
- package/src/Result/index.tsx +0 -30
- package/src/Result/result.tsx +0 -65
- package/src/Result/translations.ts +0 -57
- package/src/Screenshot/BaseScreenshot/index.tsx +0 -73
- package/src/Screenshot/BaseScreenshot/shells/Macbook.tsx +0 -38
- package/src/Screenshot/BaseScreenshot/shells/Phone.tsx +0 -35
- package/src/Screenshot/Screenshot.stories.jsx +0 -44
- package/src/Screenshot/devices.css +0 -1366
- package/src/Screenshot/index.tsx +0 -300
- package/src/SessionBlocklet/index.tsx +0 -178
- package/src/SessionManager/SessionManager.stories.jsx +0 -9
- package/src/SessionManager/index.tsx +0 -3
- package/src/SessionPermission/index.tsx +0 -26
- package/src/SessionUser/components/did-space.tsx +0 -68
- package/src/SessionUser/components/logged-in.tsx +0 -338
- package/src/SessionUser/components/quick-login-item.tsx +0 -132
- package/src/SessionUser/components/session-user-item.tsx +0 -93
- package/src/SessionUser/components/session-user-switch.tsx +0 -240
- package/src/SessionUser/components/un-login.tsx +0 -257
- package/src/SessionUser/components/user-info.tsx +0 -201
- package/src/SessionUser/index.tsx +0 -68
- package/src/SessionUser/libs/translation.ts +0 -30
- package/src/SessionUser/libs/utils.ts +0 -39
- package/src/SharedBridge/index.tsx +0 -126
- package/src/SocialShare/index.tsx +0 -194
- package/src/Sparkline/Sparkline.stories.jsx +0 -13
- package/src/Sparkline/index.tsx +0 -231
- package/src/Spinner/Spinner.stories.jsx +0 -98
- package/src/Spinner/index.tsx +0 -20
- package/src/SplitButton/SplitButton.stories.jsx +0 -32
- package/src/SplitButton/index.tsx +0 -116
- package/src/SplitButton/useClickAway.tsx +0 -24
- package/src/Success/index.tsx +0 -175
- package/src/Switch/Switch.stories.jsx +0 -16
- package/src/Switch/index.jsx +0 -79
- package/src/Tabs/Tabs.stories.jsx +0 -18
- package/src/Tabs/index.tsx +0 -255
- package/src/Tag/Tag.stories.jsx +0 -15
- package/src/Tag/index.jsx +0 -106
- package/src/TextCollapse/TextCollapse.stories.jsx +0 -73
- package/src/TextCollapse/index.tsx +0 -85
- package/src/Theme/Theme.stories.jsx +0 -11
- package/src/Theme/index.ts +0 -21
- package/src/Theme/theme-provider.tsx +0 -374
- package/src/Theme/theme.ts +0 -229
- package/src/Toast/Toast.stories.jsx +0 -28
- package/src/Toast/index.tsx +0 -80
- package/src/Typography/index.tsx +0 -124
- package/src/UserCard/Cards/avatar-only.tsx +0 -27
- package/src/UserCard/Cards/basic-info.tsx +0 -43
- package/src/UserCard/Cards/index.tsx +0 -16
- package/src/UserCard/Cards/social-actions.tsx +0 -196
- package/src/UserCard/Container/card.tsx +0 -63
- package/src/UserCard/Container/dialog.tsx +0 -37
- package/src/UserCard/Content/basic.tsx +0 -330
- package/src/UserCard/Content/clock.tsx +0 -82
- package/src/UserCard/Content/minimal.tsx +0 -113
- package/src/UserCard/Content/shorten-label.tsx +0 -32
- package/src/UserCard/Content/tooltip-avatar.tsx +0 -80
- package/src/UserCard/UserCard.stories.jsx +0 -19
- package/src/UserCard/components.tsx +0 -81
- package/src/UserCard/index.tsx +0 -132
- package/src/UserCard/types.ts +0 -165
- package/src/UserCard/use-follow.tsx +0 -111
- package/src/UserCard/utils.ts +0 -155
- package/src/Util/WebWalletOpener.stories.jsx +0 -5
- package/src/Util/client.ts +0 -4
- package/src/Util/constant.ts +0 -70
- package/src/Util/deprecate.tsx +0 -29
- package/src/Util/federated.ts +0 -125
- package/src/Util/iframe.ts +0 -19
- package/src/Util/index.ts +0 -760
- package/src/Util/logger.ts +0 -44
- package/src/Util/passport.ts +0 -127
- package/src/Util/security.ts +0 -72
- package/src/Util/style.ts +0 -17
- package/src/Util/wallet.ts +0 -35
- package/src/VerificationCode/index.tsx +0 -83
- package/src/Video/Video.stories.jsx +0 -6
- package/src/Video/index.tsx +0 -70
- package/src/Wallet/Action.stories.jsx +0 -8
- package/src/Wallet/Action.tsx +0 -118
- package/src/Wallet/Download.stories.jsx +0 -9
- package/src/Wallet/Download.tsx +0 -157
- package/src/Wallet/Open.tsx +0 -47
- package/src/Wallet/OpenInWallet.stories.jsx +0 -5
- package/src/Wallet/images/abtwallet.png +0 -0
- package/src/Wallet/images/android_download.svg +0 -22
- package/src/Wallet/images/app-store.svg +0 -30
- package/src/Wallet/images/google-play.svg +0 -69
- package/src/WalletOSIcon/index.tsx +0 -47
- package/src/WebWalletSWKeeper/index.tsx +0 -117
- package/src/WechatPrompt/images/android.png +0 -0
- package/src/WechatPrompt/images/ios.png +0 -0
- package/src/WechatPrompt/index.tsx +0 -75
- package/src/global.d.ts +0 -28
- package/src/hooks/use-blocklet-logo.tsx +0 -32
- package/src/hooks/use-clock.tsx +0 -62
- package/src/hooks/use-location-state.tsx +0 -117
- package/src/hooks/use-mobile.tsx +0 -6
- package/src/index.ts +0 -79
- package/src/type.d.ts +0 -44
- package/src/withTheme/index.tsx +0 -72
- package/src/withTracker/README.md +0 -37
- package/src/withTracker/action/bind-wallet.tsx +0 -17
- package/src/withTracker/action/login.tsx +0 -18
- package/src/withTracker/action/pay.tsx +0 -14
- package/src/withTracker/action/switch-passport.tsx +0 -20
- package/src/withTracker/constant/index.tsx +0 -3
- package/src/withTracker/env.tsx +0 -1
- package/src/withTracker/error_boundary.jsx +0 -34
- package/src/withTracker/index.tsx +0 -50
- package/src/withTracker/libs/utm.ts +0 -46
- package/vite.config.mjs +0 -37
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/* eslint-disable jsx-a11y/control-has-associated-label */
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
|
|
4
|
-
import Button from '../../Button';
|
|
5
|
-
import PageScroller from '..';
|
|
6
|
-
import FirstComponent from './FirstComponent';
|
|
7
|
-
import SecondComponent from './SecondComponent';
|
|
8
|
-
import ThirdComponent from './ThirdComponent';
|
|
9
|
-
import FourthComponent from './FourthComponent';
|
|
10
|
-
import FifthComponent from './FifthComponent';
|
|
11
|
-
|
|
12
|
-
import './index.css';
|
|
13
|
-
|
|
14
|
-
export default function FullPage() {
|
|
15
|
-
const [current, setCurrent] = useState(0);
|
|
16
|
-
|
|
17
|
-
const pageNumbers = [];
|
|
18
|
-
for (let i = 0; i < 5; i++) {
|
|
19
|
-
pageNumbers.push(
|
|
20
|
-
<Button
|
|
21
|
-
key={i}
|
|
22
|
-
variant={i === current ? 'contained' : 'outlined'}
|
|
23
|
-
size="small"
|
|
24
|
-
onClick={() => setCurrent(i)}
|
|
25
|
-
color={i === current ? 'primary' : 'secondary'}>
|
|
26
|
-
{i + 1}
|
|
27
|
-
</Button>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const progress = (current / (5 - 1)) * 100;
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<div className="demo-page-contain">
|
|
35
|
-
<h3 className="demo-page-contain__hint">
|
|
36
|
-
You need to focus or hover page scroller to make scroll, keys or touch work
|
|
37
|
-
</h3>
|
|
38
|
-
<div style={{ width: 360, height: 640, position: 'relative' }}>
|
|
39
|
-
<PageScroller onChange={(i) => setCurrent(i)} width={360} height={640} customPageNumber={current}>
|
|
40
|
-
<FirstComponent />
|
|
41
|
-
<SecondComponent />
|
|
42
|
-
<ThirdComponent />
|
|
43
|
-
<FourthComponent />
|
|
44
|
-
<FifthComponent />
|
|
45
|
-
</PageScroller>
|
|
46
|
-
<div
|
|
47
|
-
className="progress"
|
|
48
|
-
role="progressbar"
|
|
49
|
-
aria-valuemin="0"
|
|
50
|
-
aria-valuemax="100"
|
|
51
|
-
aria-valuenow={progress}
|
|
52
|
-
aria-valuetext={`Page Scroller Progress: ${progress}`}
|
|
53
|
-
style={{ width: `${progress}%` }}
|
|
54
|
-
/>
|
|
55
|
-
</div>
|
|
56
|
-
<div className="pagination-additional-class">{pageNumbers}</div>
|
|
57
|
-
</div>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import FullPage from './FullPage';
|
|
2
|
-
import PageContain from './PageContain';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Deprecated/PageScroller',
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export function _FullPage() {
|
|
9
|
-
return <FullPage />;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
_FullPage.storyName = 'full page';
|
|
13
|
-
|
|
14
|
-
export function _PageContain() {
|
|
15
|
-
return <PageContain />;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
_PageContain.storyName = 'page contain';
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
html,
|
|
2
|
-
body {
|
|
3
|
-
margin: 0;
|
|
4
|
-
height: 100%;
|
|
5
|
-
width: 100%;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.links {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
margin-left: 50px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.links .link {
|
|
16
|
-
margin-top: 20px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.component {
|
|
20
|
-
height: 100%;
|
|
21
|
-
width: 100%;
|
|
22
|
-
display: flex;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.component.first-component {
|
|
26
|
-
background-color: gray;
|
|
27
|
-
position: relative;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.first-component--inside-scroller {
|
|
31
|
-
position: absolute;
|
|
32
|
-
right: 20px;
|
|
33
|
-
top: 100px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.component.second-component {
|
|
37
|
-
background-color: red;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.component.third-component {
|
|
41
|
-
background-color: blue;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.component.fourth-component {
|
|
45
|
-
background-color: yellow;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.component.fifth-component {
|
|
49
|
-
background-color: purple;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
h2 {
|
|
53
|
-
margin: auto;
|
|
54
|
-
text-align: center;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.pagination-additional-class {
|
|
58
|
-
margin: 0;
|
|
59
|
-
position: fixed;
|
|
60
|
-
top: 20px;
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: center;
|
|
63
|
-
width: 100%;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.pagination-additional-class > li:not(:last-of-type) > a,
|
|
67
|
-
.pagination-additional-class > li:not(:last-of-type) > span {
|
|
68
|
-
margin-right: 50px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.demo-page-contain {
|
|
72
|
-
display: flex;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
align-items: center;
|
|
75
|
-
height: 100vh;
|
|
76
|
-
flex-direction: column;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.demo-page-contain__hint {
|
|
80
|
-
margin-bottom: 20px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
@media (max-width: 768px) {
|
|
84
|
-
.pagination-additional-class > li:not(:last-of-type) > a,
|
|
85
|
-
.pagination-additional-class > li:not(:last-of-type) > span {
|
|
86
|
-
margin-right: 5px;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.demo-page-full {
|
|
91
|
-
position: relative;
|
|
92
|
-
}
|
|
93
|
-
.progress {
|
|
94
|
-
position: absolute;
|
|
95
|
-
left: 0;
|
|
96
|
-
bottom: 0;
|
|
97
|
-
width: 0;
|
|
98
|
-
overflow: hidden;
|
|
99
|
-
transition: all 0.2s linear;
|
|
100
|
-
}
|
|
101
|
-
.progress,
|
|
102
|
-
.progress:before {
|
|
103
|
-
height: 6px;
|
|
104
|
-
}
|
|
105
|
-
.progress:before {
|
|
106
|
-
display: block;
|
|
107
|
-
width: 100%;
|
|
108
|
-
background-color: #4e6af6;
|
|
109
|
-
content: '';
|
|
110
|
-
transform-origin: 0 100%;
|
|
111
|
-
transform: skewX(45deg);
|
|
112
|
-
}
|
|
113
|
-
.progress[style*='100%']:before {
|
|
114
|
-
transform: none;
|
|
115
|
-
}
|
package/src/Passport/index.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import upperFirst from 'lodash/upperFirst';
|
|
2
|
-
import { Box, type BoxProps } from '@mui/material';
|
|
3
|
-
import RevokeIcon from '@arcblock/icons/lib/RevokeIcon';
|
|
4
|
-
|
|
5
|
-
import NFTDisplay from '../NFTDisplay';
|
|
6
|
-
import { useLocaleContext } from '../Locale/context';
|
|
7
|
-
import { Passport as PassportType, User } from '../type';
|
|
8
|
-
|
|
9
|
-
export interface PassportProps extends BoxProps {
|
|
10
|
-
passport: PassportType;
|
|
11
|
-
user: User;
|
|
12
|
-
color: string;
|
|
13
|
-
width?: number;
|
|
14
|
-
icon?: React.ReactNode;
|
|
15
|
-
createPassportSvg: (props: any) => string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default function Passport({
|
|
19
|
-
passport,
|
|
20
|
-
user,
|
|
21
|
-
color,
|
|
22
|
-
width = 150,
|
|
23
|
-
icon = null,
|
|
24
|
-
createPassportSvg,
|
|
25
|
-
// inherit props
|
|
26
|
-
children,
|
|
27
|
-
...rest
|
|
28
|
-
}: PassportProps) {
|
|
29
|
-
const { t } = useLocaleContext();
|
|
30
|
-
return (
|
|
31
|
-
<Box
|
|
32
|
-
{...rest}
|
|
33
|
-
sx={{
|
|
34
|
-
display: 'flex',
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
...rest?.sx,
|
|
37
|
-
}}>
|
|
38
|
-
{!!passport.display && (
|
|
39
|
-
<Box className="passport-item__display" sx={{ width }}>
|
|
40
|
-
<NFTDisplay
|
|
41
|
-
address={passport.id}
|
|
42
|
-
data={passport.display}
|
|
43
|
-
imageFilter={typeof width === 'number' ? { imageFilter: 'resize', w: width } : null}
|
|
44
|
-
/>
|
|
45
|
-
</Box>
|
|
46
|
-
)}
|
|
47
|
-
{!passport.display && (
|
|
48
|
-
<Box
|
|
49
|
-
className="passport-item__display"
|
|
50
|
-
// eslint-disable-next-line react/no-danger
|
|
51
|
-
dangerouslySetInnerHTML={{
|
|
52
|
-
__html: createPassportSvg({
|
|
53
|
-
title: passport.scope === 'kyc' ? passport.name : passport.title,
|
|
54
|
-
issuer: passport.issuer && passport.issuer.name,
|
|
55
|
-
issuerDid: passport.issuer && passport.issuer.id,
|
|
56
|
-
ownerName: user.fullName,
|
|
57
|
-
ownerDid: user.did,
|
|
58
|
-
ownerAvatarUrl: user.avatar,
|
|
59
|
-
revoked: passport.revoked,
|
|
60
|
-
scope: passport.scope,
|
|
61
|
-
role: passport.role,
|
|
62
|
-
display: passport.display,
|
|
63
|
-
preferredColor: color,
|
|
64
|
-
width,
|
|
65
|
-
}),
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
)}
|
|
69
|
-
<Box
|
|
70
|
-
className="passport-item__body"
|
|
71
|
-
sx={{
|
|
72
|
-
p: 0,
|
|
73
|
-
ml: 3,
|
|
74
|
-
mt: 0,
|
|
75
|
-
}}>
|
|
76
|
-
<Box
|
|
77
|
-
className="passport-item__title"
|
|
78
|
-
sx={{
|
|
79
|
-
display: 'flex',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
fontWeight: 400,
|
|
82
|
-
fontSize: '16px',
|
|
83
|
-
lineHeight: 1.1875,
|
|
84
|
-
color: 'text.primary',
|
|
85
|
-
}}>
|
|
86
|
-
{upperFirst(passport.title)}
|
|
87
|
-
<Box
|
|
88
|
-
className="passport-item__status-icon"
|
|
89
|
-
sx={{
|
|
90
|
-
svg: {
|
|
91
|
-
fill: '#bfbfbf',
|
|
92
|
-
height: '1.2em',
|
|
93
|
-
marginLeft: '0.4em',
|
|
94
|
-
},
|
|
95
|
-
}}>
|
|
96
|
-
{icon}
|
|
97
|
-
{passport.revoked && <RevokeIcon />}
|
|
98
|
-
</Box>
|
|
99
|
-
</Box>
|
|
100
|
-
{passport.expirationDate && (
|
|
101
|
-
<Box
|
|
102
|
-
className="passport-item__title"
|
|
103
|
-
sx={{
|
|
104
|
-
display: 'flex',
|
|
105
|
-
alignItems: 'center',
|
|
106
|
-
fontWeight: 400,
|
|
107
|
-
fontSize: '16px',
|
|
108
|
-
lineHeight: 1.1875,
|
|
109
|
-
color: 'text.primary',
|
|
110
|
-
}}>
|
|
111
|
-
{t('team.passport.validUntil', { date: passport.expirationDate })}
|
|
112
|
-
</Box>
|
|
113
|
-
)}
|
|
114
|
-
{children}
|
|
115
|
-
</Box>
|
|
116
|
-
</Box>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState } from 'react';
|
|
2
|
-
import { Box, MenuItem, Select, Typography, SelectProps, TextField, SxProps } from '@mui/material';
|
|
3
|
-
import { FlagEmoji, defaultCountries, parseCountry } from 'react-international-phone';
|
|
4
|
-
import type { CountryIso2 } from 'react-international-phone';
|
|
5
|
-
import { ParsedCountry } from 'react-international-phone/build/types';
|
|
6
|
-
import ArrowDownwardIcon from '@arcblock/icons/lib/ArrowDown';
|
|
7
|
-
import { mergeSx } from '../Util/style';
|
|
8
|
-
|
|
9
|
-
export interface CountryDisplayOptions {
|
|
10
|
-
hideFlag?: boolean;
|
|
11
|
-
hideDialCode?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface CountrySelectProps<T extends keyof ParsedCountry = 'iso2'>
|
|
15
|
-
extends Omit<SelectProps, 'value' | 'onChange'> {
|
|
16
|
-
value: T extends 'iso2' ? CountryIso2 : string;
|
|
17
|
-
onChange?: (value: T extends 'iso2' ? CountryIso2 : string) => void;
|
|
18
|
-
selectCountryProps?: CountryDisplayOptions;
|
|
19
|
-
preview?: boolean;
|
|
20
|
-
valueField?: T;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// 定义组件类型
|
|
24
|
-
type CountrySelectComponent = <T extends keyof ParsedCountry = 'iso2'>(
|
|
25
|
-
props: CountrySelectProps<T> & { ref?: React.ForwardedRef<HTMLDivElement> }
|
|
26
|
-
) => React.ReactElement<any>;
|
|
27
|
-
|
|
28
|
-
// 实现组件
|
|
29
|
-
function CountrySelectInner<T extends keyof ParsedCountry = 'iso2'>({
|
|
30
|
-
ref = undefined,
|
|
31
|
-
value,
|
|
32
|
-
onChange = undefined,
|
|
33
|
-
sx = {},
|
|
34
|
-
selectCountryProps = undefined,
|
|
35
|
-
preview = false,
|
|
36
|
-
valueField = 'iso2' as T,
|
|
37
|
-
...rest
|
|
38
|
-
}: CountrySelectProps<T> & {
|
|
39
|
-
ref?: React.Ref<unknown>;
|
|
40
|
-
}) {
|
|
41
|
-
const { hideFlag = true, hideDialCode = false } = selectCountryProps || {};
|
|
42
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
43
|
-
|
|
44
|
-
const countryDetail = useMemo(() => {
|
|
45
|
-
const item = defaultCountries.find((v) => v[1] === value);
|
|
46
|
-
return value && item ? parseCountry(item) : { name: '', iso2: '', dialCode: '' };
|
|
47
|
-
}, [value]);
|
|
48
|
-
|
|
49
|
-
const filteredCountries = useMemo(() => {
|
|
50
|
-
if (!searchQuery) return defaultCountries;
|
|
51
|
-
|
|
52
|
-
const query = searchQuery.toLowerCase();
|
|
53
|
-
return defaultCountries.filter((country) => {
|
|
54
|
-
const parsed = parseCountry(country);
|
|
55
|
-
return (
|
|
56
|
-
parsed.name.toLowerCase().includes(query) ||
|
|
57
|
-
parsed.iso2.toLowerCase().includes(query) ||
|
|
58
|
-
parsed.dialCode.includes(query)
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
}, [searchQuery]);
|
|
62
|
-
|
|
63
|
-
const renderCountryContent = (
|
|
64
|
-
<Box
|
|
65
|
-
sx={{
|
|
66
|
-
display: 'flex',
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
flexWrap: 'nowrap',
|
|
69
|
-
gap: 0.5,
|
|
70
|
-
cursor: preview ? 'default' : 'pointer',
|
|
71
|
-
}}>
|
|
72
|
-
{hideFlag ? null : <FlagEmoji iso2={value} style={{ display: 'flex', width: 24, color: 'inherit' }} />}
|
|
73
|
-
<Typography component="span" sx={{ lineHeight: 1.5 }}>
|
|
74
|
-
{hideDialCode ? countryDetail?.name : `+${countryDetail?.dialCode}`}
|
|
75
|
-
</Typography>
|
|
76
|
-
</Box>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
if (preview) {
|
|
80
|
-
return renderCountryContent;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<Select
|
|
85
|
-
{...rest}
|
|
86
|
-
ref={ref}
|
|
87
|
-
MenuProps={{
|
|
88
|
-
style: { maxHeight: 400, top: 2, zIndex: 9999 }, // 默认 zIndex 为 1300, 但是在 SwipeableDrawer 中需要设置为 9999
|
|
89
|
-
anchorOrigin: { vertical: 'bottom', horizontal: 'left' },
|
|
90
|
-
transformOrigin: { vertical: 'top', horizontal: 'left' },
|
|
91
|
-
...(rest.MenuProps ?? {}),
|
|
92
|
-
}}
|
|
93
|
-
sx={mergeSx(
|
|
94
|
-
{
|
|
95
|
-
'&.Mui-focused:has(div[aria-expanded="false"])': { fieldset: { display: 'block' } },
|
|
96
|
-
'.MuiSelect-select': { padding: 1, paddingRight: '24px !important' },
|
|
97
|
-
svg: { right: 4, top: 10 },
|
|
98
|
-
'&:hover': {
|
|
99
|
-
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
100
|
-
borderColor: 'divider',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
'fieldset.MuiOutlinedInput-notchedOutline': {
|
|
104
|
-
borderColor: 'divider',
|
|
105
|
-
},
|
|
106
|
-
'.MuiMenuItem-root': { justifyContent: 'flex-start' },
|
|
107
|
-
},
|
|
108
|
-
sx as SxProps
|
|
109
|
-
)}
|
|
110
|
-
value={value}
|
|
111
|
-
onChange={(e) => onChange?.(e.target.value as T extends 'iso2' ? CountryIso2 : string)}
|
|
112
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
113
|
-
IconComponent={(props) => <ArrowDownwardIcon {...props} width={20} height={20} />}
|
|
114
|
-
renderValue={() => renderCountryContent}>
|
|
115
|
-
<Box sx={{ p: 1, position: 'sticky', top: 0, bgcolor: 'background.paper', zIndex: 1 }}>
|
|
116
|
-
<TextField
|
|
117
|
-
size="small"
|
|
118
|
-
fullWidth
|
|
119
|
-
placeholder="Search country..."
|
|
120
|
-
value={searchQuery}
|
|
121
|
-
onChange={(e) => setSearchQuery(e.target.value)}
|
|
122
|
-
onClick={(e) => e.stopPropagation()}
|
|
123
|
-
onKeyDown={(e) => e.stopPropagation()}
|
|
124
|
-
/>
|
|
125
|
-
</Box>
|
|
126
|
-
{filteredCountries.map((c) => {
|
|
127
|
-
const parsed = parseCountry(c);
|
|
128
|
-
return (
|
|
129
|
-
<MenuItem key={parsed.iso2} value={parsed[valueField]}>
|
|
130
|
-
{hideFlag ? null : <FlagEmoji iso2={parsed.iso2} style={{ marginRight: 8, width: 24 }} />}
|
|
131
|
-
<Typography
|
|
132
|
-
sx={{
|
|
133
|
-
marginRight: 1,
|
|
134
|
-
}}>
|
|
135
|
-
{parsed.name}
|
|
136
|
-
</Typography>
|
|
137
|
-
{hideDialCode ? null : <Typography color="gray">(+{parsed.dialCode})</Typography>}
|
|
138
|
-
</MenuItem>
|
|
139
|
-
);
|
|
140
|
-
})}
|
|
141
|
-
</Select>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// 正确导出泛型组件
|
|
146
|
-
const CountrySelect = CountrySelectInner as CountrySelectComponent;
|
|
147
|
-
|
|
148
|
-
export default CountrySelect;
|