@arcblock/ux 3.0.6 → 3.0.8
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/ActionButton/index.d.ts +1 -1
- package/lib/ActionButton/index.js +1 -1
- package/lib/Address/compact-text.d.ts +1 -1
- package/lib/Address/compact-text.js +5 -5
- package/lib/Address/did-address.js +1 -1
- package/lib/Address/index.js +5 -5
- package/lib/Address/responsive-did-address.js +14 -14
- package/lib/Alert/index.d.ts +1 -1
- package/lib/Alert/index.js +1 -1
- package/lib/Avatar/index.d.ts +1 -1
- package/lib/Avatar/index.js +1 -1
- package/lib/Badge/index.js +1 -1
- package/lib/BlockletContext/index.d.ts +1 -1
- package/lib/BlockletNFT/index.js +1 -1
- package/lib/BlockletV2/blocklet.d.ts +1 -1
- package/lib/BlockletV2/blocklet.js +1 -1
- package/lib/BlockletV2/components/icon-text.d.ts +1 -1
- package/lib/BlockletV2/components/icon-text.js +13 -13
- package/lib/BlockletV2/components/tooltip-icon.js +22 -20
- package/lib/Button/wrap.js +1 -1
- package/lib/Center/index.js +3 -3
- package/lib/ClickToCopy/copy-button.js +3 -3
- package/lib/CloseButton/index.js +1 -1
- package/lib/ContactForm/index.js +22 -21
- package/lib/DID/index.js +45 -44
- package/lib/DIDConnect/app-info-item.js +1 -1
- package/lib/DIDConnect/auth-apps/index.js +48 -48
- package/lib/DIDConnect/did-connect-container.js +22 -22
- package/lib/DIDConnect/did-connect-footer.js +1 -1
- package/lib/DIDConnect/landing-page.js +27 -27
- package/lib/DIDConnect/request-storage-access-api-dialog.js +39 -40
- package/lib/Datatable/CustomToolbar.d.ts +3 -1
- package/lib/Datatable/CustomToolbar.js +1 -1
- package/lib/Datatable/index.js +2 -2
- package/lib/Dialog/confirm.d.ts +1 -1
- package/lib/Dialog/confirm.js +12 -12
- package/lib/Earth/index.js +1 -1
- package/lib/Footer/index.d.ts +1 -1
- package/lib/Footer/index.js +5 -5
- package/lib/Header/addon-button.d.ts +1 -1
- package/lib/Header/addon-button.js +11 -6
- package/lib/Header/header.js +1 -1
- package/lib/Header/responsive-header.d.ts +1 -1
- package/lib/Header/responsive-header.js +33 -34
- package/lib/Icon/index.js +12 -12
- package/lib/InfoRow/index.d.ts +1 -1
- package/lib/InfoRow/index.js +0 -1
- package/lib/Layout/dashboard/external-link.d.ts +1 -1
- package/lib/Layout/dashboard/external-link.js +1 -1
- package/lib/Layout/dashboard/full-page.js +8 -8
- package/lib/Layout/dashboard/index.js +1 -1
- package/lib/Layout/dashboard/sidebar.js +1 -1
- package/lib/Layout/dashboard-legacy/header.js +10 -10
- package/lib/Layout/dashboard-legacy/index.js +16 -16
- package/lib/Layout/dashboard-legacy/sidebar.d.ts +1 -1
- package/lib/Layout/dashboard-legacy/sidebar.js +19 -12
- package/lib/Layout/index.js +2 -2
- package/lib/LoadingMask/index.d.ts +1 -1
- package/lib/LoadingMask/index.js +4 -4
- package/lib/Locale/context.js +24 -24
- package/lib/Locale/selector.d.ts +1 -1
- package/lib/Locale/selector.js +1 -1
- package/lib/Logo/index.js +3 -3
- package/lib/NFTDisplay/aspect-ratio-container.d.ts +1 -1
- package/lib/NFTDisplay/index.js +5 -2
- package/lib/NFTDisplay/render-svg.js +3 -3
- package/lib/NavMenu/nav-menu.js +29 -26
- package/lib/NavMenu/products.js +1 -1
- package/lib/PageScroller/index.js +43 -43
- package/lib/PhoneInput/country-select.js +23 -23
- package/lib/PhoneInput/index.js +11 -11
- package/lib/PoweredByArcBlock/index.js +10 -6
- package/lib/QRCode/index.js +5 -5
- package/lib/RelativeTime/index.js +16 -16
- package/lib/Result/result.js +5 -5
- package/lib/Screenshot/index.d.ts +1 -1
- package/lib/Screenshot/index.js +1 -1
- package/lib/SessionUser/components/did-space.d.ts +1 -1
- package/lib/SessionUser/components/session-user-item.js +10 -10
- package/lib/SharedBridge/index.js +6 -6
- package/lib/Spinner/index.js +1 -1
- package/lib/SplitButton/index.d.ts +1 -1
- package/lib/SplitButton/index.js +1 -1
- package/lib/Success/index.js +1 -1
- package/lib/Tabs/index.js +15 -8
- package/lib/Tag/index.d.ts +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/TextCollapse/index.js +1 -1
- package/lib/Theme/theme-provider.js +58 -53
- package/lib/Theme/theme.js +1 -0
- package/lib/Typography/index.js +13 -13
- package/lib/UserCard/Cards/basic-info.d.ts +1 -1
- package/lib/UserCard/Cards/basic-info.js +1 -1
- package/lib/UserCard/Cards/index.d.ts +1 -1
- package/lib/UserCard/Cards/index.js +1 -1
- package/lib/UserCard/Container/card.js +6 -6
- package/lib/UserCard/Container/dialog.js +1 -1
- package/lib/UserCard/Content/basic.js +2 -2
- package/lib/UserCard/Content/minimal.d.ts +1 -1
- package/lib/UserCard/Content/minimal.js +1 -1
- package/lib/UserCard/Content/tooltip-avatar.js +17 -17
- package/lib/VerificationCode/index.js +1 -1
- package/lib/WalletOSIcon/index.d.ts +2 -2
- package/lib/WalletOSIcon/index.js +7 -2
- package/lib/WebWalletSWKeeper/index.d.ts +3 -1
- package/lib/WebWalletSWKeeper/index.js +4 -1
- package/lib/withTheme/index.d.ts +3 -2
- package/lib/withTheme/index.js +16 -16
- package/package.json +7 -7
- package/src/ActionButton/index.jsx +1 -1
- package/src/Address/compact-text.jsx +1 -1
- package/src/Address/did-address.tsx +1 -1
- package/src/Address/index.tsx +1 -1
- package/src/Address/responsive-did-address.tsx +3 -3
- package/src/Alert/index.jsx +1 -1
- package/src/Avatar/index.jsx +1 -1
- package/src/Badge/index.jsx +1 -1
- package/src/BlockletContext/index.tsx +1 -1
- package/src/BlockletNFT/index.jsx +1 -1
- package/src/BlockletV2/blocklet.tsx +1 -1
- package/src/BlockletV2/components/icon-text.tsx +4 -4
- package/src/BlockletV2/components/tooltip-icon.tsx +5 -3
- package/src/Button/wrap.jsx +1 -1
- package/src/Center/index.tsx +1 -1
- package/src/ClickToCopy/copy-button.tsx +1 -1
- package/src/CloseButton/index.tsx +1 -1
- package/src/ContactForm/index.tsx +9 -2
- package/src/DID/index.tsx +5 -4
- package/src/DIDConnect/app-info-item.tsx +1 -1
- package/src/DIDConnect/auth-apps/index.tsx +8 -8
- package/src/DIDConnect/did-connect-container.tsx +2 -2
- package/src/DIDConnect/did-connect-footer.tsx +1 -1
- package/src/DIDConnect/landing-page.tsx +6 -6
- package/src/DIDConnect/request-storage-access-api-dialog.tsx +1 -2
- package/src/Datatable/CustomToolbar.jsx +1 -1
- package/src/Datatable/index.jsx +2 -2
- package/src/Dialog/confirm.jsx +1 -1
- package/src/Earth/index.tsx +1 -1
- package/src/Footer/index.tsx +5 -2
- package/src/Header/addon-button.tsx +7 -2
- package/src/Header/header.tsx +1 -1
- package/src/Header/responsive-header.tsx +1 -2
- package/src/Icon/index.tsx +1 -1
- package/src/InfoRow/index.tsx +1 -2
- package/src/Layout/dashboard/external-link.tsx +1 -1
- package/src/Layout/dashboard/full-page.tsx +1 -1
- package/src/Layout/dashboard/index.tsx +1 -1
- package/src/Layout/dashboard/sidebar.tsx +5 -2
- package/src/Layout/dashboard-legacy/header.tsx +5 -5
- package/src/Layout/dashboard-legacy/index.tsx +3 -3
- package/src/Layout/dashboard-legacy/sidebar.tsx +10 -2
- package/src/Layout/index.tsx +2 -2
- package/src/LoadingMask/index.tsx +5 -5
- package/src/Locale/context.tsx +3 -3
- package/src/Locale/selector.tsx +1 -1
- package/src/Logo/index.tsx +1 -1
- package/src/NFTDisplay/aspect-ratio-container.tsx +1 -1
- package/src/NFTDisplay/index.tsx +2 -1
- package/src/NFTDisplay/render-svg.tsx +1 -1
- package/src/NavMenu/nav-menu.tsx +8 -5
- package/src/NavMenu/products.tsx +3 -1
- package/src/PageScroller/index.tsx +4 -4
- package/src/PhoneInput/country-select.tsx +3 -3
- package/src/PhoneInput/index.tsx +1 -1
- package/src/PoweredByArcBlock/index.tsx +5 -1
- package/src/QRCode/index.tsx +1 -1
- package/src/RelativeTime/index.tsx +3 -3
- package/src/Result/result.tsx +1 -1
- package/src/Screenshot/index.tsx +2 -2
- package/src/SessionUser/components/did-space.tsx +1 -1
- package/src/SessionUser/components/session-user-item.tsx +1 -1
- package/src/SharedBridge/index.tsx +2 -2
- package/src/Spinner/index.tsx +1 -1
- package/src/SplitButton/index.tsx +1 -1
- package/src/Success/index.tsx +1 -1
- package/src/Tabs/index.tsx +10 -3
- package/src/Tag/index.jsx +1 -1
- package/src/TextCollapse/index.tsx +1 -1
- package/src/Theme/theme-provider.tsx +11 -6
- package/src/Theme/theme.ts +5 -0
- package/src/Typography/index.tsx +1 -1
- package/src/UserCard/Cards/basic-info.tsx +1 -1
- package/src/UserCard/Cards/index.tsx +1 -1
- package/src/UserCard/Container/card.tsx +2 -2
- package/src/UserCard/Container/dialog.tsx +1 -1
- package/src/UserCard/Content/basic.tsx +2 -2
- package/src/UserCard/Content/minimal.tsx +1 -1
- package/src/UserCard/Content/tooltip-avatar.tsx +4 -4
- package/src/VerificationCode/index.tsx +1 -1
- package/src/WalletOSIcon/index.tsx +7 -2
- package/src/WebWalletSWKeeper/index.tsx +6 -1
- package/src/withTheme/index.tsx +7 -3
- package/vite.config.mjs +4 -1
- package/lib/ActionButton/ActionButton.stories.d.ts +0 -18
- package/lib/ActivityIndicator/ActivityIndicator.stories.d.ts +0 -8
- package/lib/Address/Address.stories.d.ts +0 -16
- package/lib/Alert/Alert.stories.d.ts +0 -28
- package/lib/AnimationWaiter/AnimationWaiter.stories.d.ts +0 -21
- package/lib/Avatar/Avatar.stories.d.ts +0 -11
- package/lib/Badge/Badge.stories.d.ts +0 -13
- package/lib/Blocklet/Blocklet.stories.d.ts +0 -17
- package/lib/BlockletNFT/BlockletNFT.stories.d.ts +0 -17
- package/lib/BlockletV2/Blocklet.stories.d.ts +0 -18
- package/lib/Button/Button.stories.d.ts +0 -19
- package/lib/Center/Center.stories.d.ts +0 -18
- package/lib/ClickToCopy/ClickToCopy.stories.d.ts +0 -16
- package/lib/CodeBlock/CodeBlock.stories.d.ts +0 -20
- package/lib/Colors/Colors.stories.d.ts +0 -34
- package/lib/Config/Config.stories.d.ts +0 -14
- package/lib/ContactForm/ContactForm.stories.d.ts +0 -23
- package/lib/CookieConsent/CookieConsent.stories.d.ts +0 -18
- package/lib/CountDown/CountDown.stories.d.ts +0 -14
- package/lib/DID/DID.stories.d.ts +0 -15
- package/lib/Datatable/Datatable.stories.d.ts +0 -32
- package/lib/Dialog/Dialog.stories.d.ts +0 -20
- package/lib/DidLogo/Logo.stories.d.ts +0 -8
- package/lib/Earth/Earth.stories.d.ts +0 -18
- package/lib/Empty/Empty.stories.d.ts +0 -17
- package/lib/ErrorBoundary/ErrorBoundary.stories.d.ts +0 -12
- package/lib/Footer/Footer.stories.d.ts +0 -12
- package/lib/Header/Header.stories.d.ts +0 -21
- package/lib/Icon/Icon.stories.d.ts +0 -23
- package/lib/Img/Img.stories.d.ts +0 -13
- package/lib/InfoRow/InfoRow.stories.d.ts +0 -14
- package/lib/Layout/Layout.stories.d.ts +0 -23
- package/lib/Locale/LocaleSelector.stories.d.ts +0 -22
- package/lib/Logo/Logo.stories.d.ts +0 -22
- package/lib/Metric/Metric.stories.d.ts +0 -14
- package/lib/NFTDisplay/NFTDisplay.stories.d.ts +0 -15
- package/lib/NavMenu/NavMenu.stories.d.ts +0 -17
- package/lib/PageScroller/story/PageScroller.stories.d.ts +0 -13
- package/lib/PhoneInput/PhoneInput.stories.d.ts +0 -12
- package/lib/PricingTable/PricingTable.stories.d.ts +0 -8
- package/lib/QRCode/QRCode.stories.d.ts +0 -13
- package/lib/RelativeTime/RelativeTime.stories.d.ts +0 -20
- package/lib/Result/Result.stories.d.ts +0 -21
- package/lib/Screenshot/Screenshot.stories.d.ts +0 -13
- package/lib/SessionManager/SessionManager.stories.d.ts +0 -9
- package/lib/Sparkline/Sparkline.stories.d.ts +0 -12
- package/lib/Spinner/Spinner.stories.d.ts +0 -18
- package/lib/SplitButton/SplitButton.stories.d.ts +0 -15
- package/lib/Switch/Switch.stories.d.ts +0 -13
- package/lib/Tabs/Tabs.stories.d.ts +0 -14
- package/lib/Tag/Tag.stories.d.ts +0 -13
- package/lib/TextCollapse/TextCollapse.stories.d.ts +0 -28
- package/lib/Theme/Theme.stories.d.ts +0 -10
- package/lib/Toast/Toast.stories.d.ts +0 -15
- package/lib/UserCard/UserCard.stories.d.ts +0 -18
- package/lib/Util/WebWalletOpener.stories.d.ts +0 -5
- package/lib/Video/Video.stories.d.ts +0 -6
- package/lib/Wallet/Action.stories.d.ts +0 -8
- package/lib/Wallet/Download.stories.d.ts +0 -9
- package/lib/Wallet/OpenInWallet.stories.d.ts +0 -5
package/src/Success/index.tsx
CHANGED
@@ -7,7 +7,7 @@ export interface SuccessProps {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
// FIXME: @zhanghan 目前无法适配各种 size,后续优化
|
10
|
-
export default function Success({ size = 64, backgroundColor, borderWidth = 4 }: SuccessProps) {
|
10
|
+
export default function Success({ size = 64, backgroundColor = undefined, borderWidth = 4 }: SuccessProps) {
|
11
11
|
const { palette } = useTheme();
|
12
12
|
const contentSize = size - borderWidth * 2;
|
13
13
|
const _backgroundColor = backgroundColor || palette.background.default;
|
package/src/Tabs/index.tsx
CHANGED
@@ -27,7 +27,7 @@ interface CardTabsProps extends Omit<MuiTabsProps, 'onChange'> {
|
|
27
27
|
iconPosition?: TabProps['iconPosition'];
|
28
28
|
}
|
29
29
|
|
30
|
-
function CardTabs({ tabs, current, onChange, iconPosition, ...rest }: CardTabsProps) {
|
30
|
+
function CardTabs({ tabs, current, onChange, iconPosition = undefined, ...rest }: CardTabsProps) {
|
31
31
|
return (
|
32
32
|
<MuiTabs
|
33
33
|
scrollButtons="auto"
|
@@ -97,7 +97,7 @@ interface LineTabsProps extends Omit<MuiTabsProps, 'onChange'> {
|
|
97
97
|
iconPosition?: TabProps['iconPosition'];
|
98
98
|
}
|
99
99
|
|
100
|
-
function LineTabs({ tabs, current, onChange, iconPosition, ...rest }: LineTabsProps) {
|
100
|
+
function LineTabs({ tabs, current, onChange, iconPosition = undefined, ...rest }: LineTabsProps) {
|
101
101
|
return (
|
102
102
|
<MuiTabs
|
103
103
|
scrollButtons="auto"
|
@@ -176,7 +176,14 @@ interface TabsProps extends Omit<MuiTabsProps, 'variant' | 'onChange'> {
|
|
176
176
|
iconPosition?: TabProps['iconPosition'];
|
177
177
|
}
|
178
178
|
|
179
|
-
export default function Tabs({
|
179
|
+
export default function Tabs({
|
180
|
+
tabs,
|
181
|
+
current,
|
182
|
+
onChange,
|
183
|
+
variant = undefined,
|
184
|
+
iconPosition = undefined,
|
185
|
+
...rest
|
186
|
+
}: TabsProps) {
|
180
187
|
if (variant === 'card') {
|
181
188
|
return <CardTabs {...rest} tabs={tabs} current={current} onChange={onChange} iconPosition={iconPosition} />;
|
182
189
|
}
|
package/src/Tag/index.jsx
CHANGED
@@ -46,7 +46,7 @@ const types = {
|
|
46
46
|
* @param {TagProps} props
|
47
47
|
* @return {import('react').ReactNode}
|
48
48
|
*/
|
49
|
-
function Tag(rawProps) {
|
49
|
+
function Tag({ ...rawProps }) {
|
50
50
|
const props = Object.assign({}, rawProps);
|
51
51
|
if (isUndefined(props.type)) {
|
52
52
|
props.type = 'primary';
|
@@ -44,7 +44,7 @@ const resolveMode = (prefer?: Prefer): PaletteMode => {
|
|
44
44
|
};
|
45
45
|
|
46
46
|
/** 深色模式全局样式 */
|
47
|
-
function DarkSchemeStyles({ className }: { className?: string }) {
|
47
|
+
function DarkSchemeStyles({ className = undefined }: { className?: string }) {
|
48
48
|
const theme = useTheme();
|
49
49
|
|
50
50
|
if (theme.palette.mode === 'dark') {
|
@@ -122,7 +122,7 @@ interface BaseThemeProviderProps {
|
|
122
122
|
|
123
123
|
/** 快速配置 MUI 主题 */
|
124
124
|
function BaseThemeProvider({
|
125
|
-
children,
|
125
|
+
children = null,
|
126
126
|
theme = defaultTheme,
|
127
127
|
injectFirst = true,
|
128
128
|
darkSchemeClass = '',
|
@@ -157,9 +157,9 @@ interface ColorSchemeProviderProps extends BaseThemeProviderProps {
|
|
157
157
|
|
158
158
|
/** 配置带颜色模式切换功能的 MUI 主题 */
|
159
159
|
function ColorSchemeProvider({
|
160
|
-
children,
|
161
|
-
theme: themeInput,
|
162
|
-
prefer,
|
160
|
+
children = null,
|
161
|
+
theme: themeInput = undefined,
|
162
|
+
prefer = undefined,
|
163
163
|
disableBlockletTheme = false,
|
164
164
|
...rest
|
165
165
|
}: ThemeProviderProps) {
|
@@ -276,7 +276,12 @@ export interface ThemeProviderProps extends ColorSchemeProviderProps {
|
|
276
276
|
enableColorScheme?: boolean;
|
277
277
|
}
|
278
278
|
|
279
|
-
export default function ThemeProvider({
|
279
|
+
export default function ThemeProvider({
|
280
|
+
children = null,
|
281
|
+
prefer = undefined,
|
282
|
+
enableColorScheme = false,
|
283
|
+
...props
|
284
|
+
}: ThemeProviderProps) {
|
280
285
|
const { toggleMode } = useColorScheme();
|
281
286
|
|
282
287
|
if (enableColorScheme || prefer || !toggleMode) {
|
package/src/Theme/theme.ts
CHANGED
@@ -33,6 +33,7 @@ export function isTheme(obj: any): obj is Theme {
|
|
33
33
|
|
34
34
|
/** 是否是 UX Theme 对象 */
|
35
35
|
export function isUxTheme(obj: any): obj is Theme {
|
36
|
+
// @ts-expect-error
|
36
37
|
return isTheme(obj) && obj.__isUxTheme__ === true;
|
37
38
|
}
|
38
39
|
|
@@ -118,6 +119,7 @@ export function lazyCreateDefaultTheme(mode: PaletteMode) {
|
|
118
119
|
}
|
119
120
|
|
120
121
|
// 主要处理 overrides
|
122
|
+
// @ts-expect-error
|
121
123
|
const normalizeUserThemeOptions = ({ palette, components, overrides, ...rest }: UxThemeOptions) => {
|
122
124
|
const result: UxThemeOptions = {
|
123
125
|
palette,
|
@@ -132,6 +134,7 @@ const normalizeUserThemeOptions = ({ palette, components, overrides, ...rest }:
|
|
132
134
|
};
|
133
135
|
|
134
136
|
const defaultUxThemeOptions: UxThemeOptions = {
|
137
|
+
// @ts-expect-error
|
135
138
|
themeName: 'ArcBlock',
|
136
139
|
pageWidth: 'md',
|
137
140
|
disableBlockletTheme: false,
|
@@ -167,6 +170,7 @@ export const create = (...args: Array<UxThemeOptions | ((baseTheme: Theme) => Ux
|
|
167
170
|
deepmerge(acc, normalizeUserThemeOptions(typeof curr === 'function' ? curr(createBaseTheme()) : curr)),
|
168
171
|
normalizeUserThemeOptions(defaultUxThemeOptions)
|
169
172
|
);
|
173
|
+
// @ts-expect-error
|
170
174
|
const prefer = userThemeOptions.mode || userThemeOptions.palette?.mode || defaultPrefer;
|
171
175
|
const blockletThemeOptions = getBlockletThemeOptions(prefer);
|
172
176
|
const defaultThemeOptions = createDefaultThemeOptions(prefer);
|
@@ -188,6 +192,7 @@ export const create = (...args: Array<UxThemeOptions | ((baseTheme: Theme) => Ux
|
|
188
192
|
|
189
193
|
// 创建主题
|
190
194
|
const theme = _createTheme(mergedThemeOptions);
|
195
|
+
// @ts-expect-error
|
191
196
|
theme.__isUxTheme__ = true;
|
192
197
|
|
193
198
|
// 异步加载字体
|
package/src/Typography/index.tsx
CHANGED
@@ -10,7 +10,7 @@ interface DetailedCardProps extends Omit<UserCardProps, 'user'> {
|
|
10
10
|
}
|
11
11
|
|
12
12
|
// DetailedCard组件,根据infoType选择不同的卡片组件进行渲染
|
13
|
-
function DetailedCard(props: DetailedCardProps) {
|
13
|
+
function DetailedCard({ ...props }: DetailedCardProps) {
|
14
14
|
const { infoType = InfoType.Minimal } = props;
|
15
15
|
|
16
16
|
// 根据信息类型选择合适的卡片组件
|
@@ -11,7 +11,7 @@ interface DialogContainerProps {
|
|
11
11
|
/**
|
12
12
|
* 统一的卡片容器组件,处理常见的布局容器样式
|
13
13
|
*/
|
14
|
-
function DialogContainer({ children, sx }: DialogContainerProps) {
|
14
|
+
function DialogContainer({ children, sx = {} }: DialogContainerProps) {
|
15
15
|
// Box变体,用于Minimal和NameOnly类型卡片
|
16
16
|
const theme = useTheme();
|
17
17
|
return (
|
@@ -99,7 +99,7 @@ function LinkField({ value }: { value: string }) {
|
|
99
99
|
);
|
100
100
|
}
|
101
101
|
|
102
|
-
function BasicField({ field, value, children }: { field: string; value: string; children?: React.ReactNode }) {
|
102
|
+
function BasicField({ field, value, children = null }: { field: string; value: string; children?: React.ReactNode }) {
|
103
103
|
const Icon = IconMap[field as keyof typeof IconMap];
|
104
104
|
const theme = useTheme();
|
105
105
|
const isDark = theme.palette.mode === 'dark';
|
@@ -125,7 +125,7 @@ function BasicField({ field, value, children }: { field: string; value: string;
|
|
125
125
|
);
|
126
126
|
}
|
127
127
|
|
128
|
-
function BasicContent({ user, renderFields }: BasicContentProps) {
|
128
|
+
function BasicContent({ user, renderFields = undefined }: BasicContentProps) {
|
129
129
|
const fields = useCreation(() => {
|
130
130
|
return renderFields ?? ['bio', 'email', 'phone', 'location', 'timezone', 'link'];
|
131
131
|
}, [renderFields]);
|
@@ -15,7 +15,7 @@ interface MinimalContentProps extends UserCardProps {
|
|
15
15
|
shortenLabelProps?: UserCardProps['shortenLabelProps'];
|
16
16
|
}
|
17
17
|
|
18
|
-
function MinimalContent(props: MinimalContentProps) {
|
18
|
+
function MinimalContent({ ...props }: MinimalContentProps) {
|
19
19
|
const {
|
20
20
|
user,
|
21
21
|
showDid,
|
@@ -22,10 +22,10 @@ function TooltipAvatar({
|
|
22
22
|
user,
|
23
23
|
avatarSize,
|
24
24
|
shouldShowHoverCard,
|
25
|
-
renderCardContent,
|
26
|
-
tooltipTitle,
|
27
|
-
tooltipProps,
|
28
|
-
avatarProps,
|
25
|
+
renderCardContent = undefined,
|
26
|
+
tooltipTitle = undefined,
|
27
|
+
tooltipProps = undefined,
|
28
|
+
avatarProps = undefined,
|
29
29
|
onAvatarClick,
|
30
30
|
}: TooltipAvatarProps) {
|
31
31
|
const avatarElement = renderAvatar(
|
@@ -10,12 +10,17 @@ import { LOGIN_PROVIDER } from '../Util/constant';
|
|
10
10
|
|
11
11
|
export interface WalletOSIconProps {
|
12
12
|
loading?: false | true;
|
13
|
-
walletOS
|
13
|
+
walletOS: string;
|
14
14
|
provider?: string;
|
15
15
|
color?: string;
|
16
16
|
}
|
17
17
|
|
18
|
-
export default function WalletOSIcon({
|
18
|
+
export default function WalletOSIcon({
|
19
|
+
loading = false,
|
20
|
+
walletOS,
|
21
|
+
provider = 'wallet',
|
22
|
+
color = 'black',
|
23
|
+
}: WalletOSIconProps) {
|
19
24
|
if (loading) {
|
20
25
|
return <Icon icon={QuestionMarkRoundedIcon} style={{ color: 'transparent' }} />;
|
21
26
|
}
|
@@ -55,7 +55,12 @@ interface WebWalletSWKeeperProps {
|
|
55
55
|
}
|
56
56
|
|
57
57
|
// 该组件通过嵌入一个 web wallet iframe 帮助 web wallet service worker 延最大空闲时间
|
58
|
-
function WebWalletSWKeeper({
|
58
|
+
function WebWalletSWKeeper({
|
59
|
+
webWalletUrl,
|
60
|
+
maxIdleTime = DEFAULT_MAX_IDLE_TIME,
|
61
|
+
}: WebWalletSWKeeperProps & {
|
62
|
+
maxIdleTime?: number;
|
63
|
+
}) {
|
59
64
|
// 渲染前先记录是否已经存在一个 WebWalletSWKeeper 实例
|
60
65
|
const instanceExists = useRef(!!id);
|
61
66
|
const isIdle = useIdle(maxIdleTime);
|
package/src/withTheme/index.tsx
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { useEffect } from 'react';
|
2
2
|
import { Global, css } from '@emotion/react';
|
3
|
-
import { CssBaseline, Breakpoint, type PaletteMode, type PaletteOptions
|
3
|
+
import { CssBaseline, Breakpoint, type PaletteMode, type PaletteOptions } from '@mui/material';
|
4
|
+
import { TypographyStyleOptions } from '@mui/material/styles/createTypography';
|
4
5
|
|
5
6
|
import { createTheme, ThemeProvider } from '../Theme';
|
6
7
|
|
@@ -11,13 +12,16 @@ function withTheme<P extends object>(
|
|
11
12
|
pageWidth = 'md',
|
12
13
|
palette,
|
13
14
|
typography,
|
14
|
-
}: { mode?: PaletteMode; pageWidth?: Breakpoint; palette?: PaletteOptions; typography?:
|
15
|
+
}: { mode?: PaletteMode; pageWidth?: Breakpoint; palette?: PaletteOptions; typography?: TypographyStyleOptions } = {}
|
15
16
|
) {
|
17
|
+
// @ts-expect-error
|
16
18
|
const theme = createTheme({ mode, pageWidth, palette, typography });
|
17
19
|
|
20
|
+
// @ts-expect-error
|
21
|
+
const color = theme.typography.color.main;
|
18
22
|
const globalStyles = css`
|
19
23
|
font-family: ${theme.typography.fontFamily};
|
20
|
-
color: ${
|
24
|
+
color: ${color};
|
21
25
|
|
22
26
|
a,
|
23
27
|
a:hover,
|
package/vite.config.mjs
CHANGED
@@ -11,7 +11,10 @@ export default defineConfig({
|
|
11
11
|
svgr({
|
12
12
|
include: ['**/*.svg', '**/*.svg?react'],
|
13
13
|
}),
|
14
|
-
dts(
|
14
|
+
dts({
|
15
|
+
entryRoot: 'src',
|
16
|
+
exclude: ['**/*.stories.*', '**/*.test.*', '**/demo/**'],
|
17
|
+
}),
|
15
18
|
noBundlePlugin({
|
16
19
|
root: 'src',
|
17
20
|
copy: ['**/*.png', '**/*.gif', '**/*.jpg', '**/*.jpeg', '**/*.d.ts'],
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export function WithDifferentColor(): import("react/jsx-runtime").JSX.Element;
|
2
|
-
export namespace WithDifferentColor {
|
3
|
-
let storyName: string;
|
4
|
-
}
|
5
|
-
export function WithDifferentVariant(): import("react/jsx-runtime").JSX.Element;
|
6
|
-
export namespace WithDifferentVariant {
|
7
|
-
let storyName_1: string;
|
8
|
-
export { storyName_1 as storyName };
|
9
|
-
}
|
10
|
-
declare namespace _default {
|
11
|
-
let title: string;
|
12
|
-
namespace parameters {
|
13
|
-
namespace readme {
|
14
|
-
let sidebar: string;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
}
|
18
|
-
export default _default;
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import { default as ActivityIndicator } from '.';
|
2
|
-
export { default as Basic } from './demo/basic';
|
3
|
-
export { default as WithCustomMessages } from './demo/with-custom-messages';
|
4
|
-
declare namespace _default {
|
5
|
-
export let title: string;
|
6
|
-
export { ActivityIndicator as component };
|
7
|
-
}
|
8
|
-
export default _default;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
export { default as WithDifferentSizes } from './demo/with-different-sizes';
|
2
|
-
export { default as Copyable } from './demo/copyable';
|
3
|
-
export { default as CompactMode } from './demo/compact-mode';
|
4
|
-
export { default as WithInheritSize } from './demo/with-inherit-size';
|
5
|
-
export { default as ResponsiveFontSize } from './demo/responsive-font-size';
|
6
|
-
export { default as InlineElementBlockElement } from './demo/inline-element-block-element';
|
7
|
-
export { default as DynamicTagname } from './demo/dynamic-tagname';
|
8
|
-
export { default as NonResponsiveCompact } from './demo/non-responsive-compact';
|
9
|
-
export { default as CopyTextI18N } from './demo/copy-text-i18n';
|
10
|
-
export { default as PrependAppend } from './demo/prepend-append';
|
11
|
-
declare namespace _default {
|
12
|
-
let title: string;
|
13
|
-
let parameters: {};
|
14
|
-
let decorators: ((StoryFn: any) => import("react/jsx-runtime").JSX.Element)[];
|
15
|
-
}
|
16
|
-
export default _default;
|
@@ -1,28 +0,0 @@
|
|
1
|
-
export function WithDifferentType(): import("react/jsx-runtime").JSX.Element;
|
2
|
-
export namespace WithDifferentType {
|
3
|
-
let storyName: string;
|
4
|
-
}
|
5
|
-
export function WithDifferentVariant(): import("react/jsx-runtime").JSX.Element;
|
6
|
-
export namespace WithDifferentVariant {
|
7
|
-
let storyName_1: string;
|
8
|
-
export { storyName_1 as storyName };
|
9
|
-
}
|
10
|
-
export function WithIcon(): import("react/jsx-runtime").JSX.Element;
|
11
|
-
export namespace WithIcon {
|
12
|
-
let storyName_2: string;
|
13
|
-
export { storyName_2 as storyName };
|
14
|
-
}
|
15
|
-
export function WithDifferentMessage(): import("react/jsx-runtime").JSX.Element;
|
16
|
-
export namespace WithDifferentMessage {
|
17
|
-
let storyName_3: string;
|
18
|
-
export { storyName_3 as storyName };
|
19
|
-
}
|
20
|
-
declare namespace _default {
|
21
|
-
let title: string;
|
22
|
-
namespace parameters {
|
23
|
-
namespace readme {
|
24
|
-
let sidebar: string;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
}
|
28
|
-
export default _default;
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { default as AnimationWaiter } from '.';
|
2
|
-
export { default as Basic } from './demo/basic';
|
3
|
-
export { default as WithCustomMessages } from './demo/with-custom-messages';
|
4
|
-
export { default as WithMoreMessages } from './demo/with-more-messages';
|
5
|
-
export { default as Sizes } from './demo/sizes';
|
6
|
-
export { default as WithTips } from './demo/with-tips';
|
7
|
-
export { default as WithSpeed } from './demo/with-speed';
|
8
|
-
export { default as WithMaybeDuration } from './demo/with-maybe-duration';
|
9
|
-
declare namespace _default {
|
10
|
-
export let title: string;
|
11
|
-
export { AnimationWaiter as component };
|
12
|
-
export namespace parameters {
|
13
|
-
namespace docs {
|
14
|
-
namespace description {
|
15
|
-
let component: string;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
20
|
-
}
|
21
|
-
export default _default;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export { default as WithDifferentSizes } from './demo/with-different-sizes';
|
2
|
-
export { default as WithDifferentDid } from './demo/with-different-did';
|
3
|
-
export { default as WithSpecifiedMotifShape } from './demo/with-specified-motif-shape';
|
4
|
-
export { default as ResponsiveDidMotif } from './demo/responsive-did-motif';
|
5
|
-
export { default as EthAddresses } from './demo/eth-addresses';
|
6
|
-
export { default as WithAnimation } from './demo/with-animation';
|
7
|
-
export { default as WithEmptyDidErrorFallback } from './demo/with-empty-did-error-fallback';
|
8
|
-
declare namespace _default {
|
9
|
-
let title: string;
|
10
|
-
}
|
11
|
-
export default _default;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
export function WithDifferentType(): import("react/jsx-runtime").JSX.Element;
|
2
|
-
export namespace WithDifferentType {
|
3
|
-
let storyName: string;
|
4
|
-
}
|
5
|
-
declare namespace _default {
|
6
|
-
let title: string;
|
7
|
-
namespace parameters {
|
8
|
-
namespace readme {
|
9
|
-
let sidebar: string;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
13
|
-
export default _default;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { default as Basic } from './demo/basic';
|
2
|
-
declare namespace _default {
|
3
|
-
let title: string;
|
4
|
-
namespace parameters {
|
5
|
-
namespace docs {
|
6
|
-
namespace description {
|
7
|
-
let component: string;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
namespace design {
|
11
|
-
let type: string;
|
12
|
-
let url: string;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
16
|
-
export default _default;
|
17
|
-
export { Basic };
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { default as Basic } from './demo/basic';
|
2
|
-
declare namespace _default {
|
3
|
-
let title: string;
|
4
|
-
namespace parameters {
|
5
|
-
namespace docs {
|
6
|
-
namespace description {
|
7
|
-
let component: string;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
namespace design {
|
11
|
-
let type: string;
|
12
|
-
let url: string;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
}
|
16
|
-
export default _default;
|
17
|
-
export { Basic };
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { default as Basic } from './demo/basic';
|
2
|
-
declare namespace _default {
|
3
|
-
let title: string;
|
4
|
-
namespace parameters {
|
5
|
-
namespace docs {
|
6
|
-
namespace description {
|
7
|
-
let component: string;
|
8
|
-
}
|
9
|
-
}
|
10
|
-
namespace design {
|
11
|
-
let type: string;
|
12
|
-
let url: string;
|
13
|
-
}
|
14
|
-
}
|
15
|
-
let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
16
|
-
}
|
17
|
-
export default _default;
|
18
|
-
export { Basic };
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { default as Button } from '.';
|
2
|
-
import { default as Basic } from './demo/basic';
|
3
|
-
declare namespace _default {
|
4
|
-
export let title: string;
|
5
|
-
export { Button as component };
|
6
|
-
export namespace parameters {
|
7
|
-
namespace docs {
|
8
|
-
namespace description {
|
9
|
-
let component: string;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
namespace design {
|
13
|
-
let type: string;
|
14
|
-
let url: string;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
}
|
18
|
-
export default _default;
|
19
|
-
export { Basic };
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { default as Center } from '.';
|
2
|
-
export { default as Basic } from './demo/basic';
|
3
|
-
export { default as RelativeParent } from './demo/relative-parent';
|
4
|
-
declare namespace _default {
|
5
|
-
export let title: string;
|
6
|
-
export { Center as component };
|
7
|
-
export namespace parameters {
|
8
|
-
let layout: string;
|
9
|
-
namespace docs {
|
10
|
-
namespace description {
|
11
|
-
let component: string;
|
12
|
-
}
|
13
|
-
let inlineStories: boolean;
|
14
|
-
let iframeHeight: number;
|
15
|
-
}
|
16
|
-
}
|
17
|
-
}
|
18
|
-
export default _default;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { default as Basic } from './demo/basic';
|
2
|
-
import { default as WithComplexChild } from './demo/with-complex-child';
|
3
|
-
import { default as WithCustomParentFontColor } from './demo/with-custom-parent-font-color';
|
4
|
-
import { default as CopyButton } from './demo/copy-button';
|
5
|
-
declare namespace _default {
|
6
|
-
let title: string;
|
7
|
-
namespace parameters {
|
8
|
-
namespace docs {
|
9
|
-
namespace description {
|
10
|
-
let component: string;
|
11
|
-
}
|
12
|
-
}
|
13
|
-
}
|
14
|
-
}
|
15
|
-
export default _default;
|
16
|
-
export { Basic, WithComplexChild, WithCustomParentFontColor, CopyButton };
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { default as CodeBlock } from '.';
|
2
|
-
export { default as Protobuf } from './demo/protobuf';
|
3
|
-
export { default as Javascript } from './demo/javascript';
|
4
|
-
export { default as Json } from './demo/json';
|
5
|
-
export { default as SingleLineOfCode } from './demo/single-line-of-code';
|
6
|
-
export { default as Typescript } from './demo/typescript';
|
7
|
-
export { default as Markdown } from './demo/markdown';
|
8
|
-
export { default as lightMode } from './demo/light-mode';
|
9
|
-
declare namespace _default {
|
10
|
-
export let title: string;
|
11
|
-
export { CodeBlock as component };
|
12
|
-
export namespace parameters {
|
13
|
-
namespace docs {
|
14
|
-
namespace description {
|
15
|
-
let component: string;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
}
|
19
|
-
}
|
20
|
-
export default _default;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
export function DefaultAbtColors(): import("react/jsx-runtime").JSX.Element;
|
2
|
-
export namespace DefaultAbtColors {
|
3
|
-
let storyName: string;
|
4
|
-
}
|
5
|
-
export function MuiThemePalette(): import("react/jsx-runtime").JSX.Element;
|
6
|
-
export namespace MuiThemePalette {
|
7
|
-
let storyName_1: string;
|
8
|
-
export { storyName_1 as storyName };
|
9
|
-
}
|
10
|
-
export function ColorsStyledComponents(): import("react/jsx-runtime").JSX.Element;
|
11
|
-
export namespace ColorsStyledComponents {
|
12
|
-
let storyName_2: string;
|
13
|
-
export { storyName_2 as storyName };
|
14
|
-
}
|
15
|
-
export function MuiThemeBoxButton(): import("react/jsx-runtime").JSX.Element;
|
16
|
-
export namespace MuiThemeBoxButton {
|
17
|
-
let storyName_3: string;
|
18
|
-
export { storyName_3 as storyName };
|
19
|
-
}
|
20
|
-
declare namespace _default {
|
21
|
-
let title: string;
|
22
|
-
namespace parameters {
|
23
|
-
namespace docs {
|
24
|
-
namespace description {
|
25
|
-
let component: string;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
namespace design {
|
29
|
-
let type: string;
|
30
|
-
let url: string;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
export default _default;
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { default as SwitchMode } from './demo/switch-mode';
|
2
|
-
import { default as NestedColorScheme } from './demo/nested-color-scheme';
|
3
|
-
declare namespace _default {
|
4
|
-
let title: string;
|
5
|
-
namespace parameters {
|
6
|
-
namespace docs {
|
7
|
-
namespace description {
|
8
|
-
let component: string;
|
9
|
-
}
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
13
|
-
export default _default;
|
14
|
-
export { SwitchMode, NestedColorScheme };
|