@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,96 +0,0 @@
|
|
|
1
|
-
import { useSize } from 'ahooks';
|
|
2
|
-
import { Tooltip, type TooltipProps } from '@mui/material';
|
|
3
|
-
import isUndefined from 'lodash/isUndefined';
|
|
4
|
-
import { useSnackbar } from 'notistack';
|
|
5
|
-
import useCopy from './hook';
|
|
6
|
-
import Toast, { ToastProvider } from '../Toast';
|
|
7
|
-
import { mergeProps } from '../Util';
|
|
8
|
-
import { styled } from '../Theme';
|
|
9
|
-
import type { Locale } from '../type';
|
|
10
|
-
|
|
11
|
-
export { default as CopyButton } from './copy-button';
|
|
12
|
-
|
|
13
|
-
const Container = styled('span')`
|
|
14
|
-
display: inline;
|
|
15
|
-
white-space: pre-wrap;
|
|
16
|
-
word-wrap: break-word;
|
|
17
|
-
overflow-wrap: break-word;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: start;
|
|
20
|
-
border-radius: 15px;
|
|
21
|
-
padding: 1px 12px;
|
|
22
|
-
background-color: rgba(0, 0, 0, 0.08);
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
const UnstyledContainer = styled('span')`
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
export interface ClickToCopyProps extends TooltipProps {
|
|
31
|
-
content?: string;
|
|
32
|
-
locale?: Locale;
|
|
33
|
-
tip?: string;
|
|
34
|
-
tipPlacement?: string;
|
|
35
|
-
copiedTip?: string;
|
|
36
|
-
unstyled?: false | true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default function ClickToCopy(rawProps: ClickToCopyProps) {
|
|
40
|
-
const props = Object.assign({}, rawProps);
|
|
41
|
-
// eslint-disable-next-line react/prop-types
|
|
42
|
-
if (isUndefined(props.content)) {
|
|
43
|
-
props.content = '';
|
|
44
|
-
}
|
|
45
|
-
// eslint-disable-next-line react/prop-types
|
|
46
|
-
if (isUndefined(props.tip)) {
|
|
47
|
-
props.tip = '';
|
|
48
|
-
}
|
|
49
|
-
// eslint-disable-next-line react/prop-types
|
|
50
|
-
if (isUndefined(props.copiedTip)) {
|
|
51
|
-
props.copiedTip = '';
|
|
52
|
-
}
|
|
53
|
-
// eslint-disable-next-line react/prop-types
|
|
54
|
-
if (isUndefined(props.tipPlacement)) {
|
|
55
|
-
props.tipPlacement = 'right';
|
|
56
|
-
}
|
|
57
|
-
// eslint-disable-next-line react/prop-types
|
|
58
|
-
if (isUndefined(props.locale)) {
|
|
59
|
-
props.locale = 'en';
|
|
60
|
-
}
|
|
61
|
-
// eslint-disable-next-line react/prop-types
|
|
62
|
-
if (isUndefined(props.unstyled)) {
|
|
63
|
-
props.unstyled = false;
|
|
64
|
-
}
|
|
65
|
-
const newProps = mergeProps(props, ClickToCopy, ['style']);
|
|
66
|
-
const { children, content, tip, copiedTip, tipPlacement, locale, style, unstyled, ...rest } = newProps;
|
|
67
|
-
const { containerRef, copied, copy, texts } = useCopy({ content, locale });
|
|
68
|
-
const _tip = tip || texts.copy;
|
|
69
|
-
const _copiedTip = copiedTip || texts.copied;
|
|
70
|
-
const snackbarContext = useSnackbar();
|
|
71
|
-
|
|
72
|
-
const size = useSize(document.body);
|
|
73
|
-
const width = size?.width || 0;
|
|
74
|
-
|
|
75
|
-
const onCopy = (e: React.MouseEvent<HTMLElement>) => {
|
|
76
|
-
copy(e);
|
|
77
|
-
|
|
78
|
-
if (width < 600) {
|
|
79
|
-
Toast.success(_copiedTip);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const ContainerComponent = unstyled ? UnstyledContainer : Container;
|
|
84
|
-
const contentChild = (
|
|
85
|
-
<Tooltip title={copied ? _copiedTip : _tip} {...rest} placement={tipPlacement} disableFocusListener>
|
|
86
|
-
<ContainerComponent ref={containerRef} style={style} onClick={onCopy}>
|
|
87
|
-
{children || content}
|
|
88
|
-
</ContainerComponent>
|
|
89
|
-
</Tooltip>
|
|
90
|
-
);
|
|
91
|
-
if (!snackbarContext) {
|
|
92
|
-
return <ToastProvider>{contentChild}</ToastProvider>;
|
|
93
|
-
}
|
|
94
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
95
|
-
return <>{contentChild}</>;
|
|
96
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Box } from '@mui/material';
|
|
2
|
-
import type { SxProps } from '@mui/material';
|
|
3
|
-
import { Icon } from '@iconify/react';
|
|
4
|
-
import CloseRoundedIcon from '@iconify-icons/material-symbols/close-rounded';
|
|
5
|
-
import noop from 'lodash/noop';
|
|
6
|
-
|
|
7
|
-
import { mergeSx } from '../Util/style';
|
|
8
|
-
|
|
9
|
-
export default function CloseButton({
|
|
10
|
-
onClose = noop,
|
|
11
|
-
sx = {},
|
|
12
|
-
size = 20,
|
|
13
|
-
}: {
|
|
14
|
-
onClose?: () => void;
|
|
15
|
-
sx?: SxProps;
|
|
16
|
-
size?: string | number;
|
|
17
|
-
}) {
|
|
18
|
-
return (
|
|
19
|
-
<Box
|
|
20
|
-
onClick={onClose}
|
|
21
|
-
sx={mergeSx(
|
|
22
|
-
{
|
|
23
|
-
fontSize: 0,
|
|
24
|
-
cursor: 'pointer',
|
|
25
|
-
color: 'text.secondary',
|
|
26
|
-
transition: 'transform 0.25s ease-in-out 0s',
|
|
27
|
-
transformOrigin: 'center',
|
|
28
|
-
'&:hover': {
|
|
29
|
-
transform: 'rotate(90deg)',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
sx
|
|
33
|
-
)}>
|
|
34
|
-
<Icon icon={CloseRoundedIcon} fontSize={size} />
|
|
35
|
-
</Box>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import CodeBlock from '.';
|
|
2
|
-
|
|
3
|
-
export { default as Protobuf } from './demo/protobuf';
|
|
4
|
-
export { default as Javascript } from './demo/javascript';
|
|
5
|
-
export { default as Json } from './demo/json';
|
|
6
|
-
export { default as SingleLineOfCode } from './demo/single-line-of-code';
|
|
7
|
-
export { default as Typescript } from './demo/typescript';
|
|
8
|
-
export { default as Markdown } from './demo/markdown';
|
|
9
|
-
export { default as lightMode } from './demo/light-mode';
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Data Display/CodeBlock',
|
|
13
|
-
component: CodeBlock,
|
|
14
|
-
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component: 'CodeBlock is used to render an isolated code snippet or block.',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// highlight.js/styles/atom-one-light.css
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
|
|
4
|
-
const LightBox = styled('div')`
|
|
5
|
-
display: block;
|
|
6
|
-
pre code.hljs {
|
|
7
|
-
display: block;
|
|
8
|
-
overflow-x: auto;
|
|
9
|
-
padding: 1em;
|
|
10
|
-
}
|
|
11
|
-
code.hljs {
|
|
12
|
-
padding: 3px 5px;
|
|
13
|
-
}
|
|
14
|
-
.hljs {
|
|
15
|
-
color: #383a42;
|
|
16
|
-
background: #fafafa;
|
|
17
|
-
}
|
|
18
|
-
.hljs-comment,
|
|
19
|
-
.hljs-quote {
|
|
20
|
-
color: #a0a1a7;
|
|
21
|
-
font-style: italic;
|
|
22
|
-
}
|
|
23
|
-
.hljs-doctag,
|
|
24
|
-
.hljs-formula,
|
|
25
|
-
.hljs-keyword {
|
|
26
|
-
color: #a626a4;
|
|
27
|
-
}
|
|
28
|
-
.hljs-deletion,
|
|
29
|
-
.hljs-name,
|
|
30
|
-
.hljs-section,
|
|
31
|
-
.hljs-selector-tag,
|
|
32
|
-
.hljs-subst {
|
|
33
|
-
color: #e45649;
|
|
34
|
-
}
|
|
35
|
-
.hljs-literal {
|
|
36
|
-
color: #0184bb;
|
|
37
|
-
}
|
|
38
|
-
.hljs-addition,
|
|
39
|
-
.hljs-attribute,
|
|
40
|
-
.hljs-meta .hljs-string,
|
|
41
|
-
.hljs-regexp,
|
|
42
|
-
.hljs-string {
|
|
43
|
-
color: #50a14f;
|
|
44
|
-
}
|
|
45
|
-
.hljs-attr,
|
|
46
|
-
.hljs-number,
|
|
47
|
-
.hljs-selector-attr,
|
|
48
|
-
.hljs-selector-class,
|
|
49
|
-
.hljs-selector-pseudo,
|
|
50
|
-
.hljs-template-variable,
|
|
51
|
-
.hljs-type,
|
|
52
|
-
.hljs-variable {
|
|
53
|
-
color: #986801;
|
|
54
|
-
}
|
|
55
|
-
.hljs-bullet,
|
|
56
|
-
.hljs-link,
|
|
57
|
-
.hljs-meta,
|
|
58
|
-
.hljs-selector-id,
|
|
59
|
-
.hljs-symbol,
|
|
60
|
-
.hljs-title {
|
|
61
|
-
color: #4078f2;
|
|
62
|
-
}
|
|
63
|
-
.hljs-built_in,
|
|
64
|
-
.hljs-class .hljs-title,
|
|
65
|
-
.hljs-title.class_ {
|
|
66
|
-
color: #c18401;
|
|
67
|
-
}
|
|
68
|
-
.hljs-emphasis {
|
|
69
|
-
font-style: italic;
|
|
70
|
-
}
|
|
71
|
-
.hljs-strong {
|
|
72
|
-
font-weight: 700;
|
|
73
|
-
}
|
|
74
|
-
.hljs-link {
|
|
75
|
-
text-decoration: underline;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
pre {
|
|
79
|
-
.copy-button {
|
|
80
|
-
> .default-text {
|
|
81
|
-
color: #222;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
export default LightBox;
|
package/src/CodeBlock/index.tsx
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-danger */
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import Copy from 'copy-to-clipboard';
|
|
4
|
-
import { type SxProps } from '@mui/material';
|
|
5
|
-
|
|
6
|
-
import hljs from 'highlight.js/lib/core';
|
|
7
|
-
import javascript from 'highlight.js/lib/languages/javascript';
|
|
8
|
-
import typescript from 'highlight.js/lib/languages/typescript';
|
|
9
|
-
import json from 'highlight.js/lib/languages/json';
|
|
10
|
-
import elixir from 'highlight.js/lib/languages/elixir';
|
|
11
|
-
import java from 'highlight.js/lib/languages/java';
|
|
12
|
-
import swift from 'highlight.js/lib/languages/swift';
|
|
13
|
-
import objectivec from 'highlight.js/lib/languages/objectivec';
|
|
14
|
-
import kotlin from 'highlight.js/lib/languages/kotlin';
|
|
15
|
-
import protobuf from 'highlight.js/lib/languages/protobuf';
|
|
16
|
-
import python from 'highlight.js/lib/languages/python';
|
|
17
|
-
import yaml from 'highlight.js/lib/languages/yaml';
|
|
18
|
-
import shell from 'highlight.js/lib/languages/shell';
|
|
19
|
-
import diff from 'highlight.js/lib/languages/diff';
|
|
20
|
-
import plaintext from 'highlight.js/lib/languages/plaintext';
|
|
21
|
-
import markdown from 'highlight.js/lib/languages/markdown';
|
|
22
|
-
|
|
23
|
-
import 'highlight.js/styles/atom-one-dark.css';
|
|
24
|
-
|
|
25
|
-
import { FileCopy as CopyIcon, Check as CheckIcon } from '@mui/icons-material';
|
|
26
|
-
import colors from '../Colors';
|
|
27
|
-
import { styled } from '../Theme';
|
|
28
|
-
import LightBox from './LightBox';
|
|
29
|
-
|
|
30
|
-
hljs.registerLanguage('javascript', javascript);
|
|
31
|
-
hljs.registerLanguage('js', javascript);
|
|
32
|
-
hljs.registerLanguage('jsx', javascript);
|
|
33
|
-
hljs.registerLanguage('typescript', typescript);
|
|
34
|
-
hljs.registerLanguage('ts', typescript);
|
|
35
|
-
hljs.registerLanguage('tsx', typescript);
|
|
36
|
-
hljs.registerLanguage('json', json);
|
|
37
|
-
hljs.registerLanguage('elixir', elixir);
|
|
38
|
-
hljs.registerLanguage('java', java);
|
|
39
|
-
hljs.registerLanguage('kotlin', kotlin);
|
|
40
|
-
hljs.registerLanguage('kt', kotlin);
|
|
41
|
-
hljs.registerLanguage('protobuf', protobuf);
|
|
42
|
-
hljs.registerLanguage('protobuffer', protobuf);
|
|
43
|
-
hljs.registerLanguage('python', python);
|
|
44
|
-
hljs.registerLanguage('py', python);
|
|
45
|
-
hljs.registerLanguage('yaml', yaml);
|
|
46
|
-
hljs.registerLanguage('yml', yaml);
|
|
47
|
-
hljs.registerLanguage('shell', shell);
|
|
48
|
-
hljs.registerLanguage('sh', shell);
|
|
49
|
-
hljs.registerLanguage('plaintext', plaintext);
|
|
50
|
-
hljs.registerLanguage('text', plaintext);
|
|
51
|
-
hljs.registerLanguage('patch', diff);
|
|
52
|
-
hljs.registerLanguage('diff', diff);
|
|
53
|
-
hljs.registerLanguage('swift', swift);
|
|
54
|
-
hljs.registerLanguage('objectivec', objectivec);
|
|
55
|
-
hljs.registerLanguage('oc', objectivec);
|
|
56
|
-
hljs.registerLanguage('markdown', markdown);
|
|
57
|
-
|
|
58
|
-
export interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
|
|
59
|
-
code?: string;
|
|
60
|
-
language?: string;
|
|
61
|
-
children?: React.ReactNode;
|
|
62
|
-
dark?: true | false;
|
|
63
|
-
showDefaultText?: true | false;
|
|
64
|
-
sx?: SxProps;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export default function CodeBlock({
|
|
68
|
-
code = '',
|
|
69
|
-
language = 'text',
|
|
70
|
-
children = null,
|
|
71
|
-
dark = true,
|
|
72
|
-
showDefaultText = true,
|
|
73
|
-
...rest
|
|
74
|
-
}: CodeBlockProps) {
|
|
75
|
-
const [copied, setCopied] = useState(false);
|
|
76
|
-
const source = code || (children as string);
|
|
77
|
-
|
|
78
|
-
const onCopy = () => {
|
|
79
|
-
if (copied) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
Copy(source);
|
|
83
|
-
setCopied(true);
|
|
84
|
-
// 恢复 copied 状态
|
|
85
|
-
setTimeout(() => {
|
|
86
|
-
setCopied(false);
|
|
87
|
-
}, 1500);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const originEl = (
|
|
91
|
-
<Pre {...rest}>
|
|
92
|
-
<span className="codeblock__inner">
|
|
93
|
-
<code
|
|
94
|
-
className={`hljs ${language}`}
|
|
95
|
-
dangerouslySetInnerHTML={{ __html: hljs.highlightAuto(source, [language]).value }}
|
|
96
|
-
/>
|
|
97
|
-
</span>
|
|
98
|
-
<div className="copy-button" onClick={onCopy}>
|
|
99
|
-
{showDefaultText && <span className="default-text">{language}</span>}
|
|
100
|
-
<span className="hover-text">
|
|
101
|
-
{!copied ? (
|
|
102
|
-
<>
|
|
103
|
-
<CopyIcon className="copy-icon" />
|
|
104
|
-
<span className="button-lang-text">copy</span>
|
|
105
|
-
</>
|
|
106
|
-
) : (
|
|
107
|
-
<>
|
|
108
|
-
<CheckIcon className="copy-icon" />
|
|
109
|
-
<span className="button-lang-text">copied</span>
|
|
110
|
-
</>
|
|
111
|
-
)}
|
|
112
|
-
</span>
|
|
113
|
-
</div>
|
|
114
|
-
</Pre>
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
if (!dark) {
|
|
118
|
-
return <LightBox>{originEl}</LightBox>;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return originEl;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const fontFamily = 'source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important';
|
|
125
|
-
const Pre = styled('pre', {
|
|
126
|
-
shouldForwardProp: (prop) => prop !== 'sx',
|
|
127
|
-
})`
|
|
128
|
-
font-family: ${fontFamily};
|
|
129
|
-
display: block;
|
|
130
|
-
font-size: 14px;
|
|
131
|
-
line-height: 1.42857143;
|
|
132
|
-
margin: 0 0 32px;
|
|
133
|
-
word-break: break-word;
|
|
134
|
-
word-wrap: break-word;
|
|
135
|
-
text-align: left;
|
|
136
|
-
border-radius: 5px;
|
|
137
|
-
border: 1px solid;
|
|
138
|
-
border-color: ${({ theme }) => theme.palette.divider};
|
|
139
|
-
background: ${({ theme }) => theme.palette.background.default};
|
|
140
|
-
color: ${({ theme }) => theme.palette.common.white};
|
|
141
|
-
position: relative;
|
|
142
|
-
|
|
143
|
-
.codeblock__inner {
|
|
144
|
-
display: block;
|
|
145
|
-
width: 100%;
|
|
146
|
-
max-height: 46.25rem;
|
|
147
|
-
overflow: auto;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.copy-button {
|
|
151
|
-
display: flex;
|
|
152
|
-
justify-content: center;
|
|
153
|
-
align-items: center;
|
|
154
|
-
position: absolute;
|
|
155
|
-
top: 8px;
|
|
156
|
-
right: 24px;
|
|
157
|
-
padding: 4px;
|
|
158
|
-
min-width: 72px;
|
|
159
|
-
height: 24px;
|
|
160
|
-
border-radius: 4px;
|
|
161
|
-
background: transparent;
|
|
162
|
-
cursor: pointer;
|
|
163
|
-
transition: all ease 0.2s;
|
|
164
|
-
|
|
165
|
-
.copy-icon {
|
|
166
|
-
font-size: 16px;
|
|
167
|
-
color: ${colors.common.white};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.hover-text {
|
|
171
|
-
display: none;
|
|
172
|
-
}
|
|
173
|
-
.default-text {
|
|
174
|
-
font-size: 12px;
|
|
175
|
-
color: ${colors.common.white};
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
&:hover {
|
|
180
|
-
.copy-button {
|
|
181
|
-
display: flex;
|
|
182
|
-
background: ${colors.primary.main};
|
|
183
|
-
|
|
184
|
-
.hover-text {
|
|
185
|
-
display: flex;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
align-items: center;
|
|
188
|
-
color: ${colors.common.white};
|
|
189
|
-
}
|
|
190
|
-
.default-text {
|
|
191
|
-
display: none;
|
|
192
|
-
font-size: 12px;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.button-lang-text {
|
|
198
|
-
margin-left: 4px;
|
|
199
|
-
font-size: 12px;
|
|
200
|
-
color: ${colors.common.white};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
code {
|
|
204
|
-
counter-reset: line;
|
|
205
|
-
counter-increment: line;
|
|
206
|
-
padding: 16px;
|
|
207
|
-
font-family: ${fontFamily};
|
|
208
|
-
color: ${colors.common.white};
|
|
209
|
-
* {
|
|
210
|
-
font-family: ${fontFamily};
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.hljs * {
|
|
215
|
-
white-space: normal; // autowrap
|
|
216
|
-
}
|
|
217
|
-
`;
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/no-array-index-key */
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Box, Button } from '@mui/material';
|
|
4
|
-
import { createTheme, ThemeProvider, styled } from '../Theme';
|
|
5
|
-
import colors from '.';
|
|
6
|
-
|
|
7
|
-
const colorDescriptions = {
|
|
8
|
-
primary:
|
|
9
|
-
"Primary is used to represent primary interface elements for a user. It's the color displayed most frequently across your app's screens and components",
|
|
10
|
-
secondary:
|
|
11
|
-
'Secondary is used to represent secondary interface elements for a user. It provides more ways to accent and distinguish your product. Having it is optional.',
|
|
12
|
-
error: 'Used to represent error, danger, wrong.',
|
|
13
|
-
warning: 'Used to represent potentially dangerous actions or important messages',
|
|
14
|
-
info: 'Used to present information to the user that is neutral and not necessarily important',
|
|
15
|
-
success: 'Used to indicate the successful completion of an action that user triggered.',
|
|
16
|
-
grey: 'Grey (neutral color) is mainly used in a large part of the text interface, in addition to the background, borders, dividing lines, and other scenes are also very common.',
|
|
17
|
-
did: 'For DID-related products or components.',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line no-shadow
|
|
21
|
-
function ColorsViewer({ colors: tmpColors, prefix = '', itemWidth = 240 }) {
|
|
22
|
-
// 优先展示的一些颜色
|
|
23
|
-
const keys = ['primary', 'secondary', 'error', 'warning', 'info', 'success'];
|
|
24
|
-
const colorKeys = keys.concat(Object.keys(tmpColors).filter((key) => !keys.includes(key)));
|
|
25
|
-
return (
|
|
26
|
-
<Box
|
|
27
|
-
sx={{
|
|
28
|
-
p: 2,
|
|
29
|
-
}}>
|
|
30
|
-
{colorKeys.map((colorKey, index) => {
|
|
31
|
-
const colorValue = colors[colorKey];
|
|
32
|
-
let colorArray;
|
|
33
|
-
// 考虑 2 层颜色
|
|
34
|
-
if (typeof colorValue === 'object') {
|
|
35
|
-
colorArray = Object.keys(colorValue).map((item) => ({
|
|
36
|
-
name: `${prefix ? `${prefix}.` : ''}${colorKey}.${item}`,
|
|
37
|
-
value: colorValue[item],
|
|
38
|
-
}));
|
|
39
|
-
} else {
|
|
40
|
-
colorArray = [{ name: `${prefix ? `${prefix}.` : ''}${colorKey}`, value: colorValue }];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// 过滤不是 color 的值
|
|
44
|
-
colorArray = colorArray.filter(
|
|
45
|
-
(item) => typeof item.value === 'string' && (item.value.startsWith('#') || item.value.startsWith('rgb'))
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
if (colorArray.length === 0) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<Box
|
|
54
|
-
key={index}
|
|
55
|
-
style={{ borderBottom: '1px solid #ddd' }}
|
|
56
|
-
sx={{
|
|
57
|
-
p: 2,
|
|
58
|
-
}}>
|
|
59
|
-
{colorDescriptions[colorKey] && (
|
|
60
|
-
<Box
|
|
61
|
-
style={{ borderLeft: '2px solid #bbb' }}
|
|
62
|
-
sx={{
|
|
63
|
-
color: 'grey.700',
|
|
64
|
-
fontSize: 16,
|
|
65
|
-
m: 1,
|
|
66
|
-
pl: 1,
|
|
67
|
-
}}>
|
|
68
|
-
{colorDescriptions[colorKey]}
|
|
69
|
-
</Box>
|
|
70
|
-
)}
|
|
71
|
-
<Box
|
|
72
|
-
sx={{
|
|
73
|
-
display: 'flex',
|
|
74
|
-
flexWrap: 'wrap',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
}}>
|
|
77
|
-
{colorArray.map(({ name, value }) => (
|
|
78
|
-
<Box
|
|
79
|
-
key={name}
|
|
80
|
-
sx={{
|
|
81
|
-
display: 'flex',
|
|
82
|
-
width: itemWidth,
|
|
83
|
-
m: 1,
|
|
84
|
-
}}>
|
|
85
|
-
<Box
|
|
86
|
-
sx={{
|
|
87
|
-
flexShrink: 0,
|
|
88
|
-
width: 40,
|
|
89
|
-
height: 40,
|
|
90
|
-
bgcolor: value,
|
|
91
|
-
boxShadow: 1,
|
|
92
|
-
}}
|
|
93
|
-
/>
|
|
94
|
-
<Box
|
|
95
|
-
sx={{
|
|
96
|
-
display: 'flex',
|
|
97
|
-
flexDirection: 'column',
|
|
98
|
-
ml: 1,
|
|
99
|
-
fontSize: 14,
|
|
100
|
-
color: '#999',
|
|
101
|
-
}}>
|
|
102
|
-
<Box>{name}</Box>
|
|
103
|
-
<Box>{value}</Box>
|
|
104
|
-
</Box>
|
|
105
|
-
</Box>
|
|
106
|
-
))}
|
|
107
|
-
</Box>
|
|
108
|
-
</Box>
|
|
109
|
-
);
|
|
110
|
-
})}
|
|
111
|
-
</Box>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
ColorsViewer.propTypes = {
|
|
116
|
-
colors: PropTypes.object.isRequired,
|
|
117
|
-
prefix: PropTypes.string,
|
|
118
|
-
itemWidth: PropTypes.number,
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default {
|
|
122
|
-
title: 'Theme/Colors',
|
|
123
|
-
parameters: {
|
|
124
|
-
docs: {
|
|
125
|
-
description: {
|
|
126
|
-
component: 'A collection of common colors that are compatible with the Material UI theme palette.',
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
design: {
|
|
130
|
-
type: 'figma',
|
|
131
|
-
url: 'https://www.figma.com/file/E8TSBWCOyXzETmVOjzbqvw/ArcBlock-UI-Kit?node-id=740%3A1506',
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export function DefaultAbtColors() {
|
|
137
|
-
return <ColorsViewer colors={colors} />;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
DefaultAbtColors.storyName = 'default (ABT colors)';
|
|
141
|
-
|
|
142
|
-
export function MuiThemePalette() {
|
|
143
|
-
const _muiTheme = createTheme();
|
|
144
|
-
return <ColorsViewer colors={_muiTheme.palette} />;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
MuiThemePalette.storyName = 'mui theme#palette';
|
|
148
|
-
|
|
149
|
-
export function ColorsStyledComponents() {
|
|
150
|
-
return (
|
|
151
|
-
<StyledComponentTestBox>
|
|
152
|
-
<pre>{`
|
|
153
|
-
const StyledComponentTestBox = styled('div')\`
|
|
154
|
-
padding: 16px;
|
|
155
|
-
background-color: \${colors.success.main};
|
|
156
|
-
\`;
|
|
157
|
-
`}</pre>
|
|
158
|
-
</StyledComponentTestBox>
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
ColorsStyledComponents.storyName = 'colors & styled-components';
|
|
163
|
-
|
|
164
|
-
export function MuiThemeBoxButton() {
|
|
165
|
-
const _muiTheme = createTheme();
|
|
166
|
-
return (
|
|
167
|
-
<ThemeProvider theme={_muiTheme}>
|
|
168
|
-
<Box
|
|
169
|
-
sx={{
|
|
170
|
-
m: 1,
|
|
171
|
-
}}>
|
|
172
|
-
<Button variant="contained" color="primary">
|
|
173
|
-
Button[color="primary"]
|
|
174
|
-
</Button>
|
|
175
|
-
</Box>
|
|
176
|
-
<Box
|
|
177
|
-
sx={{
|
|
178
|
-
m: 1,
|
|
179
|
-
}}>
|
|
180
|
-
<Button variant="contained" color="secondary">
|
|
181
|
-
Button[color="secondary"]
|
|
182
|
-
</Button>
|
|
183
|
-
</Box>
|
|
184
|
-
<Box
|
|
185
|
-
variant="contained"
|
|
186
|
-
sx={{
|
|
187
|
-
bgcolor: 'warning.main',
|
|
188
|
-
m: 1,
|
|
189
|
-
p: 1,
|
|
190
|
-
}}>
|
|
191
|
-
Box[bgcolor="warning.main"]
|
|
192
|
-
</Box>
|
|
193
|
-
<Box
|
|
194
|
-
variant="contained"
|
|
195
|
-
sx={{
|
|
196
|
-
bgcolor: 'error.light',
|
|
197
|
-
m: 1,
|
|
198
|
-
p: 1,
|
|
199
|
-
}}>
|
|
200
|
-
Box[bgcolor="error.light"]
|
|
201
|
-
</Box>
|
|
202
|
-
</ThemeProvider>
|
|
203
|
-
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
MuiThemeBoxButton.storyName = 'mui theme & Box/Button';
|
|
207
|
-
|
|
208
|
-
const StyledComponentTestBox = styled('div')`
|
|
209
|
-
padding: 16px;
|
|
210
|
-
background-color: ${colors.success.main};
|
|
211
|
-
`;
|
package/src/Colors/index.ts
DELETED