@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,52 +0,0 @@
|
|
|
1
|
-
import { Tooltip, TooltipProps, tooltipClasses } from '@mui/material';
|
|
2
|
-
import { mergeSx } from '../../Util/style';
|
|
3
|
-
|
|
4
|
-
export interface TooltipIconProps extends TooltipProps {
|
|
5
|
-
fontSize?: number | string;
|
|
6
|
-
fontWeight?: number | string;
|
|
7
|
-
color?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default function TooltipIcon({
|
|
11
|
-
title,
|
|
12
|
-
sx,
|
|
13
|
-
children,
|
|
14
|
-
slotProps,
|
|
15
|
-
fontSize = 12,
|
|
16
|
-
fontWeight = 500,
|
|
17
|
-
color = 'text.contrast',
|
|
18
|
-
...props
|
|
19
|
-
}: TooltipIconProps) {
|
|
20
|
-
return title ? (
|
|
21
|
-
<Tooltip
|
|
22
|
-
title={title}
|
|
23
|
-
placement="top"
|
|
24
|
-
{...props}
|
|
25
|
-
slotProps={{
|
|
26
|
-
popper: {
|
|
27
|
-
...slotProps?.popper,
|
|
28
|
-
sx: mergeSx(
|
|
29
|
-
{
|
|
30
|
-
[`& .${tooltipClasses.tooltip}`]: {
|
|
31
|
-
fontSize,
|
|
32
|
-
fontWeight,
|
|
33
|
-
boxShadow: 2,
|
|
34
|
-
marginBottom: '6px !important',
|
|
35
|
-
borderRadius: '8px',
|
|
36
|
-
cursor: 'default',
|
|
37
|
-
color,
|
|
38
|
-
display: 'flex',
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
// @ts-expect-error
|
|
43
|
-
slotProps?.popper?.sx
|
|
44
|
-
),
|
|
45
|
-
},
|
|
46
|
-
}}>
|
|
47
|
-
{children}
|
|
48
|
-
</Tooltip>
|
|
49
|
-
) : (
|
|
50
|
-
children
|
|
51
|
-
);
|
|
52
|
-
}
|
package/src/BlockletV2/index.ts
DELETED
package/src/BlockletV2/utils.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { styled } from '../Theme';
|
|
2
|
-
|
|
3
|
-
const ActionButton = styled('div')`
|
|
4
|
-
background-color: transparent !important;
|
|
5
|
-
& > :not(.Mui-disabled) {
|
|
6
|
-
position: relative;
|
|
7
|
-
z-index: 1;
|
|
8
|
-
&::before {
|
|
9
|
-
content: '';
|
|
10
|
-
position: absolute;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
left: 0;
|
|
14
|
-
top: 0;
|
|
15
|
-
transition: opacity 0.3s;
|
|
16
|
-
}
|
|
17
|
-
&:hover::before {
|
|
18
|
-
opacity: 0;
|
|
19
|
-
}
|
|
20
|
-
&::after {
|
|
21
|
-
content: '';
|
|
22
|
-
position: absolute;
|
|
23
|
-
height: 100%;
|
|
24
|
-
width: 100%;
|
|
25
|
-
top: 0;
|
|
26
|
-
left: 0;
|
|
27
|
-
border-radius: 2px;
|
|
28
|
-
background-color: ${(props) => props.theme.palette.primary.main};
|
|
29
|
-
transform: scale(0.1);
|
|
30
|
-
opacity: 0;
|
|
31
|
-
z-index: -1;
|
|
32
|
-
transition:
|
|
33
|
-
transform 0.3s,
|
|
34
|
-
opacity 0.3s,
|
|
35
|
-
background-color 0.3s;
|
|
36
|
-
}
|
|
37
|
-
&:hover::after {
|
|
38
|
-
opacity: 1;
|
|
39
|
-
transform-origin: center;
|
|
40
|
-
transform: scale(1);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
& > :not(.Mui-disabled) {
|
|
44
|
-
background-color: transparent !important;
|
|
45
|
-
color: ${(props) => props.theme.palette.primary.main}!important;
|
|
46
|
-
}
|
|
47
|
-
& > :not(.Mui-disabled) {
|
|
48
|
-
&:hover {
|
|
49
|
-
color: ${(props) => props.theme.palette.common.white}!important;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
|
|
54
|
-
export default ActionButton;
|
|
55
|
-
|
|
56
|
-
export const strippedString = (originalString = '') => {
|
|
57
|
-
return originalString.replace(/(<([^>]+)>)/gi, '').trim();
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const formatDownloadCount = (num = '') => {
|
|
61
|
-
const n = parseInt(num, 10);
|
|
62
|
-
if (Number.isNaN(n)) {
|
|
63
|
-
return num;
|
|
64
|
-
}
|
|
65
|
-
if (n < 1000) {
|
|
66
|
-
return n;
|
|
67
|
-
}
|
|
68
|
-
if (n < 1000000) {
|
|
69
|
-
return `${(n / 1000).toFixed(1)}k`;
|
|
70
|
-
}
|
|
71
|
-
if (n < 1000000000) {
|
|
72
|
-
return `${(n / 1000000).toFixed(1)}m`;
|
|
73
|
-
}
|
|
74
|
-
return `${(n / 1000000000).toFixed(1)}b`;
|
|
75
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Button from '.';
|
|
2
|
-
import Basic from './demo/basic';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Basic/Button',
|
|
6
|
-
component: Button,
|
|
7
|
-
|
|
8
|
-
parameters: {
|
|
9
|
-
docs: {
|
|
10
|
-
description: {
|
|
11
|
-
component:
|
|
12
|
-
'Buttons allow users to initiate an action. They’re typically found in forms, dialog panels, and dialogs.',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
design: {
|
|
16
|
-
type: 'figma',
|
|
17
|
-
url: 'https://www.figma.com/file/E8TSBWCOyXzETmVOjzbqvw/ArcBlock-UI-Kit?node-id=768%3A999',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
Basic.storyName = 'Button';
|
|
23
|
-
|
|
24
|
-
export { Basic };
|
package/src/Button/index.js
DELETED
package/src/Button/wrap.jsx
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import isUndefined from 'lodash/isUndefined';
|
|
3
|
-
|
|
4
|
-
import { CircularProgress } from '@mui/material';
|
|
5
|
-
import colors from '../Colors';
|
|
6
|
-
import { mergeProps } from '../Util';
|
|
7
|
-
|
|
8
|
-
const extendedColors = {
|
|
9
|
-
did: {
|
|
10
|
-
contained: { backgroundColor: colors.did.primary, color: colors.common.white },
|
|
11
|
-
outlined: { borderColor: colors.did.primary, color: colors.did.primary },
|
|
12
|
-
},
|
|
13
|
-
reverse: {
|
|
14
|
-
contained: { backgroundColor: 'rgba(255, 255, 255, 0.9)', color: colors.grey[900] },
|
|
15
|
-
outlined: { borderColor: colors.grey[900], color: colors.grey[900] },
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {import('@mui/material').ButtonProps} MuiButtonProps
|
|
21
|
-
* @typedef {{
|
|
22
|
-
* rounded?: false | true,
|
|
23
|
-
* loading?: false | true,
|
|
24
|
-
* forwardedRef?: import('react').ForwardedRef<any>,
|
|
25
|
-
* color?: MuiButtonProps['color'] | 'reverse' | 'did'
|
|
26
|
-
* }} CustomButtonProps
|
|
27
|
-
* @typedef { CustomButtonProps & Omit<MuiButtonProps, 'color'> } ButtonProps
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>} ButtonComponent
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @description
|
|
36
|
-
* @export
|
|
37
|
-
* @param {import('@mui/material').ExtendButtonBase<import('@mui/material').ButtonTypeMap<{}, "button">>} BaseComponent
|
|
38
|
-
* @return {ButtonComponent}
|
|
39
|
-
*/
|
|
40
|
-
export default function wrap(BaseComponent) {
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {ButtonProps} props
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
function WrappedComponent({ ...rawProps }) {
|
|
47
|
-
const props = Object.assign({}, rawProps);
|
|
48
|
-
if (isUndefined(props.rounded)) {
|
|
49
|
-
props.rounded = false;
|
|
50
|
-
}
|
|
51
|
-
if (isUndefined(props.size)) {
|
|
52
|
-
props.size = 'medium';
|
|
53
|
-
}
|
|
54
|
-
if (isUndefined(props.forwardedRef)) {
|
|
55
|
-
props.forwardedRef = null;
|
|
56
|
-
}
|
|
57
|
-
if (isUndefined(props.style)) {
|
|
58
|
-
props.style = {};
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @type {ButtonProps}
|
|
62
|
-
*/
|
|
63
|
-
const newProps = mergeProps(props, WrappedComponent, ['style']);
|
|
64
|
-
const { children, rounded, loading, disabled, style, forwardedRef, color, ...rest } = newProps;
|
|
65
|
-
|
|
66
|
-
const isDisabled = disabled || loading;
|
|
67
|
-
|
|
68
|
-
let loadingSize = 16;
|
|
69
|
-
switch (rest.size) {
|
|
70
|
-
case 'small':
|
|
71
|
-
loadingSize = 14;
|
|
72
|
-
break;
|
|
73
|
-
case 'large':
|
|
74
|
-
loadingSize = 18;
|
|
75
|
-
break;
|
|
76
|
-
default:
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// mui v4 只支持 4 种 color 值: default/inherit/primary/secondary (传入这 4 种之外的值会报 warning),
|
|
80
|
-
// 这里扩展 danger/warning/reverse/did 四种 color
|
|
81
|
-
// !! 已升级到 mui v5, error/warning 等 color 已经默认支持, extendedColors 只扩展了 did/reverse
|
|
82
|
-
const matched = extendedColors[color] && extendedColors[color][rest.variant];
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @type {import('react').CSSProperties}
|
|
86
|
-
*/
|
|
87
|
-
const styles = Object.assign(
|
|
88
|
-
{},
|
|
89
|
-
{
|
|
90
|
-
boxShadow: 'none',
|
|
91
|
-
textTransform: 'capitalize',
|
|
92
|
-
...matched,
|
|
93
|
-
},
|
|
94
|
-
style
|
|
95
|
-
);
|
|
96
|
-
let _rest = rest;
|
|
97
|
-
if (!matched) {
|
|
98
|
-
// mui button 本身支持的 color 交由 mui 处理
|
|
99
|
-
_rest = { ..._rest, color };
|
|
100
|
-
}
|
|
101
|
-
if (rounded) {
|
|
102
|
-
// styles.borderRadius = { small: 16, medium: 18, large: 20 }[rest.size];
|
|
103
|
-
styles.borderRadius = '100vw';
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<BaseComponent style={styles} ref={forwardedRef} disabled={isDisabled} {..._rest}>
|
|
108
|
-
{loading && <CircularProgress size={loadingSize} style={{ marginRight: 5 }} />}
|
|
109
|
-
{children}
|
|
110
|
-
</BaseComponent>
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
WrappedComponent.propTypes = {
|
|
115
|
-
children: PropTypes.any.isRequired,
|
|
116
|
-
style: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
117
|
-
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
118
|
-
forwardedRef: PropTypes.any,
|
|
119
|
-
rounded: PropTypes.bool,
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// eslint-disable-next-line react/prop-types
|
|
123
|
-
return function WrappedComponentWithRef({ ref, ...props }) {
|
|
124
|
-
return <WrappedComponent {...props} forwardedRef={ref} />;
|
|
125
|
-
};
|
|
126
|
-
}
|
package/src/ButtonGroup/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ButtonGroup } from '@mui/material';
|
|
2
|
-
import wrap from '../Button/wrap';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {import('@mui/material').ButtonGroupProps} MuiButtonGroupProps
|
|
6
|
-
* @typedef {import('../Button/wrap').CustomButtonProps & Omit<MuiButtonGroupProps, 'color'>} ButtonGroupProps
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated 建议直接使用 @mui/material/ButtonGroup
|
|
11
|
-
* @type {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonGroupProps> & React.RefAttributes<HTMLButtonElement>>}
|
|
12
|
-
*/
|
|
13
|
-
const ButtonGroupComponent = wrap(ButtonGroup);
|
|
14
|
-
|
|
15
|
-
// 该定制组件原本目的是调整 ButtonGroup 的圆角, 但最新设计规范已经不再使用较大的圆角, 改为使用 mui button 默认的圆角
|
|
16
|
-
export default ButtonGroupComponent;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import noop from 'lodash/noop';
|
|
4
|
-
|
|
5
|
-
export interface CardSelectorProps {
|
|
6
|
-
list?: Array<{ src: string; name: string }> | Array<(i: number) => React.ReactNode>;
|
|
7
|
-
width?: number;
|
|
8
|
-
height?: number;
|
|
9
|
-
cardSpace?: number;
|
|
10
|
-
onSelect?: (index: number) => void;
|
|
11
|
-
defaultIndex?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default function CardSelector({
|
|
15
|
-
list = [],
|
|
16
|
-
width = 300,
|
|
17
|
-
height = 400,
|
|
18
|
-
cardSpace = 40,
|
|
19
|
-
onSelect = noop,
|
|
20
|
-
defaultIndex = 0,
|
|
21
|
-
}: CardSelectorProps) {
|
|
22
|
-
const [selectedId, setSelectedId] = useState(0);
|
|
23
|
-
const [translateX, setTranslateX] = useState(0);
|
|
24
|
-
const outterCon = useRef<HTMLDivElement | null>(null);
|
|
25
|
-
|
|
26
|
-
// 选择卡片
|
|
27
|
-
const selectedItem = (i: number) => {
|
|
28
|
-
if (i < 0 || i > list.length - 1) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
setSelectedId(i);
|
|
32
|
-
|
|
33
|
-
if (outterCon.current) {
|
|
34
|
-
// 外部容器大小
|
|
35
|
-
const outerWidth = outterCon.current.clientWidth;
|
|
36
|
-
|
|
37
|
-
setTranslateX(i * (width + cardSpace) - (outerWidth - width) / 2 + cardSpace * 0.5);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
onSelect(i);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
selectedItem(defaultIndex);
|
|
45
|
-
|
|
46
|
-
outterCon.current?.addEventListener('touchmove', (e) => e.preventDefault(), { passive: false });
|
|
47
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
-
}, []);
|
|
49
|
-
|
|
50
|
-
let startX: number;
|
|
51
|
-
|
|
52
|
-
const touchstart: React.TouchEventHandler<HTMLDivElement> = (e) => {
|
|
53
|
-
const point = e.touches[0];
|
|
54
|
-
startX = point.clientX;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const touchend: React.TouchEventHandler<HTMLDivElement> = (e) => {
|
|
58
|
-
const point = e.changedTouches[0];
|
|
59
|
-
const diffX = startX - point.clientX;
|
|
60
|
-
|
|
61
|
-
if (Math.abs(diffX) > 60) {
|
|
62
|
-
if (diffX > 0) {
|
|
63
|
-
selectedItem(selectedId + 1);
|
|
64
|
-
} else {
|
|
65
|
-
selectedItem(selectedId - 1);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
<Container ref={outterCon} onTouchStart={touchstart} onTouchEnd={touchend}>
|
|
72
|
-
<div className="card-container" style={{ transform: `translate(${-translateX}px, 0)` }}>
|
|
73
|
-
{list.map((e, i) => {
|
|
74
|
-
if (e instanceof Function) {
|
|
75
|
-
return (
|
|
76
|
-
<div
|
|
77
|
-
className={`card-item ${i === selectedId ? 'selected' : ''}`}
|
|
78
|
-
style={{ width, height, margin: cardSpace / 2 }}
|
|
79
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
80
|
-
key={i}
|
|
81
|
-
onClick={() => selectedItem(i)}>
|
|
82
|
-
{e(i)}
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
return (
|
|
87
|
-
<div
|
|
88
|
-
className={`card-item ${i === selectedId ? 'selected' : ''}`}
|
|
89
|
-
style={{ width, height, margin: cardSpace / 2 }}
|
|
90
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
91
|
-
key={i}
|
|
92
|
-
onClick={() => selectedItem(i)}>
|
|
93
|
-
<img src={e.src} alt={e.name} />
|
|
94
|
-
</div>
|
|
95
|
-
);
|
|
96
|
-
})}
|
|
97
|
-
</div>
|
|
98
|
-
</Container>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const Container = styled.div`
|
|
103
|
-
overflow: hidden;
|
|
104
|
-
mask-image: linear-gradient(to left, transparent, black 3%, black 97%, transparent);
|
|
105
|
-
overflow: hidden;
|
|
106
|
-
.card-container {
|
|
107
|
-
display: flex;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
width: max-content;
|
|
110
|
-
transition: all ease 0.3s;
|
|
111
|
-
}
|
|
112
|
-
.card-item {
|
|
113
|
-
display: inline-flex;
|
|
114
|
-
justify-content: center;
|
|
115
|
-
align-items: center;
|
|
116
|
-
flex-shrink: 0;
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
img,
|
|
119
|
-
svg {
|
|
120
|
-
max-width: 100%;
|
|
121
|
-
max-height: 100%;
|
|
122
|
-
width: auto;
|
|
123
|
-
height: auto;
|
|
124
|
-
outline: #526ded solid 0;
|
|
125
|
-
transition: all ease 0.2s;
|
|
126
|
-
box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px;
|
|
127
|
-
}
|
|
128
|
-
&.selected {
|
|
129
|
-
cursor: default;
|
|
130
|
-
img,
|
|
131
|
-
svg {
|
|
132
|
-
outline: #526ded solid 5px;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import Center from '.';
|
|
2
|
-
|
|
3
|
-
export { default as Basic } from './demo/basic';
|
|
4
|
-
export { default as RelativeParent } from './demo/relative-parent';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Basic/Center',
|
|
8
|
-
component: Center,
|
|
9
|
-
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'fullscreen',
|
|
12
|
-
docs: {
|
|
13
|
-
description: {
|
|
14
|
-
component: 'The Center component centers its content both vertically and horizontally.',
|
|
15
|
-
},
|
|
16
|
-
inlineStories: false,
|
|
17
|
-
iframeHeight: 600,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
package/src/Center/index.tsx
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { styled } from '../Theme';
|
|
2
|
-
|
|
3
|
-
export default function Center({
|
|
4
|
-
children = null,
|
|
5
|
-
relative = 'screen',
|
|
6
|
-
}: {
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* 容器相对尺寸,默认相对屏幕(screen),可设置为父容器(parent)
|
|
10
|
-
*/
|
|
11
|
-
relative?: 'screen' | 'parent';
|
|
12
|
-
}) {
|
|
13
|
-
let style = {};
|
|
14
|
-
|
|
15
|
-
if (relative === 'parent') {
|
|
16
|
-
style = {
|
|
17
|
-
width: '100%',
|
|
18
|
-
height: '100%',
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return <Div style={style}>{children}</Div>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Div = styled('div')`
|
|
26
|
-
flex: 1;
|
|
27
|
-
width: 100vw;
|
|
28
|
-
height: 100vh;
|
|
29
|
-
|
|
30
|
-
display: flex;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
align-items: center;
|
|
33
|
-
`;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import Basic from './demo/basic';
|
|
2
|
-
import WithComplexChild from './demo/with-complex-child';
|
|
3
|
-
import WithCustomParentFontColor from './demo/with-custom-parent-font-color';
|
|
4
|
-
import CopyButton from './demo/copy-button';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Basic/ClickToCopy',
|
|
8
|
-
|
|
9
|
-
parameters: {
|
|
10
|
-
docs: {
|
|
11
|
-
description: {
|
|
12
|
-
component: 'ClickToCopy allows the content that is wrapped in it to be copied with a single click.',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
Basic.argTypes = {
|
|
19
|
-
locale: { control: 'select', options: ['en', 'zh'] },
|
|
20
|
-
tip: { control: 'text' },
|
|
21
|
-
unstyled: { control: 'boolean', defaultValue: false },
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { Basic, WithComplexChild, WithCustomParentFontColor, CopyButton };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
2
|
-
import { Tooltip } from '@mui/material';
|
|
3
|
-
import { green } from '@mui/material/colors';
|
|
4
|
-
import { ContentCopy as CopyIcon, Check as CheckIcon } from '@mui/icons-material';
|
|
5
|
-
import useCopy from './hook';
|
|
6
|
-
import type { Locale } from '../type';
|
|
7
|
-
|
|
8
|
-
export interface CopyButtonProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
-
content?: string;
|
|
10
|
-
locale?: Locale;
|
|
11
|
-
render?: (props: { copyButton: React.ReactNode; containerRef: React.Ref<unknown> }) => JSX.Element | null;
|
|
12
|
-
showTooltip?: true | false;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default function CopyButton({
|
|
16
|
-
content = '',
|
|
17
|
-
locale = 'en',
|
|
18
|
-
render = undefined,
|
|
19
|
-
showTooltip = true,
|
|
20
|
-
...rest
|
|
21
|
-
}: CopyButtonProps) {
|
|
22
|
-
const { containerRef, copied, copy, texts } = useCopy({ content, locale });
|
|
23
|
-
const iconStyle = {
|
|
24
|
-
fontSize: '1em',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const copyButton = (
|
|
28
|
-
<span title={copied ? '' : texts.copy} {...rest} style={{ height: '1em', ...rest.style }}>
|
|
29
|
-
{copied ? (
|
|
30
|
-
<Tooltip title={texts.copied} placement="bottom" arrow open={copied && showTooltip}>
|
|
31
|
-
<CheckIcon sx={{ ...iconStyle, color: green[500] }} />
|
|
32
|
-
</Tooltip>
|
|
33
|
-
) : (
|
|
34
|
-
<CopyIcon onClick={copy} sx={{ ...iconStyle, cursor: 'pointer' }} />
|
|
35
|
-
)}
|
|
36
|
-
</span>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
if (render) {
|
|
40
|
-
return render({ copyButton, containerRef });
|
|
41
|
-
}
|
|
42
|
-
return copyButton;
|
|
43
|
-
}
|
package/src/ClickToCopy/hook.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import Copy from 'copy-to-clipboard';
|
|
3
|
-
import type { Locale, Translations } from '../type';
|
|
4
|
-
|
|
5
|
-
const translations: Translations = {
|
|
6
|
-
en: {
|
|
7
|
-
copy: 'Click To Copy',
|
|
8
|
-
copied: 'Copied!',
|
|
9
|
-
},
|
|
10
|
-
zh: {
|
|
11
|
-
copy: '点击复制',
|
|
12
|
-
copied: '已复制!',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default function useCopy({ content, locale = 'en' }: { content?: string; locale?: Locale }) {
|
|
17
|
-
const [copied, setCopied] = useState(false);
|
|
18
|
-
const containerRef = useRef<HTMLElement | null>(null);
|
|
19
|
-
const copy = (e: React.MouseEvent) => {
|
|
20
|
-
if (e) {
|
|
21
|
-
e.stopPropagation();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Copy(content || (containerRef.current?.textContent ?? ''));
|
|
25
|
-
setCopied(true);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
let timer: ReturnType<typeof setTimeout>;
|
|
30
|
-
if (copied) {
|
|
31
|
-
timer = setTimeout(() => setCopied(false), 2000);
|
|
32
|
-
}
|
|
33
|
-
return () => clearTimeout(timer);
|
|
34
|
-
}, [copied]);
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
containerRef,
|
|
38
|
-
copied,
|
|
39
|
-
copy,
|
|
40
|
-
texts: translations[locale] || translations.en,
|
|
41
|
-
};
|
|
42
|
-
}
|