diff --git a/.depslintrc.js b/.depslintrc.js index e763e9d5ed..122f41fd75 100644 --- a/.depslintrc.js +++ b/.depslintrc.js @@ -11,15 +11,15 @@ module.exports = { ], modulePattern: [ { - pattern: /ConfigContext.*renderEmpty/ms, + pattern: /ConfigContext.*renderEmpty/s, module: '../empty', }, { - pattern: /ConfigConsumer.*renderEmpty/ms, + pattern: /ConfigConsumer.*renderEmpty/s, module: '../empty', }, { - pattern: /config-provider\/context.*renderEmpty/ms, + pattern: /config-provider\/context.*renderEmpty/s, module: '../empty', }, ], diff --git a/.dumi/components/SemanticPreview.tsx b/.dumi/components/SemanticPreview.tsx index c9a77d7b64..ecdfa5442e 100644 --- a/.dumi/components/SemanticPreview.tsx +++ b/.dumi/components/SemanticPreview.tsx @@ -66,7 +66,7 @@ const useStyle = createStyles(({ token }, markPos: [number, number, number, numb export interface SemanticPreviewProps { semantics: { name: string; desc: string; version?: string }[]; - children: React.ReactElement; + children: React.ReactElement; height?: number; } @@ -97,7 +97,7 @@ const SemanticPreview: React.FC = (props) => { // ======================== Hover ========================= const containerRef = React.useRef(null); - const timerRef = React.useRef>(); + const timerRef = React.useRef>(null); const [positionMotion, setPositionMotion] = React.useState(false); const [hoverSemantic, setHoverSemantic] = React.useState(null); @@ -111,12 +111,14 @@ const SemanticPreview: React.FC = (props) => { const targetElement = containerRef.current?.querySelector(`.${targetClassName}`); const containerRect = containerRef.current?.getBoundingClientRect(); const targetRect = targetElement?.getBoundingClientRect(); + setMarkPos([ (targetRect?.left || 0) - (containerRect?.left || 0), (targetRect?.top || 0) - (containerRect?.top || 0), targetRect?.width || 0, targetRect?.height || 0, ]); + timerRef.current = setTimeout(() => { setPositionMotion(true); }, 10); diff --git a/.dumi/global.css b/.dumi/global.css index 6c32b20c42..41fc9ed943 100644 --- a/.dumi/global.css +++ b/.dumi/global.css @@ -16,5 +16,5 @@ html { scrollbar-width: thin; - scrollbar-color: unset; + scrollbar-color: #eaeaea transparent; } diff --git a/.dumi/hooks/useMenu.tsx b/.dumi/hooks/useMenu.tsx index a3c01e9505..9338510767 100644 --- a/.dumi/hooks/useMenu.tsx +++ b/.dumi/hooks/useMenu.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; import type { MenuProps } from 'antd'; -import { Tag, version } from 'antd'; +import { Space, Tag, version } from 'antd'; import { createStyles } from 'antd-style'; import classnames from 'classnames'; import { useFullSidebarData, useSidebarData } from 'dumi'; @@ -22,7 +22,6 @@ const useStyle = createStyles(({ css, token }) => ({ margin-inline-end: 0; `, subtitle: css` - margin-inline-start: ${token.marginXS}px; font-weight: normal; font-size: ${token.fontSizeSM}px; opacity: 0.8; @@ -46,10 +45,10 @@ const MenuItemLabelWithTag: React.FC = (props) => { if (!before && !after) { return ( - - {title} + + {title} {subtitle && {subtitle}} - + {tag && ( { .startViewTransition(async () => { // wait for theme change end while (colorBgElevated === animateRef.current.colorBgElevated) { - // eslint-disable-next-line no-await-in-loop await new Promise((resolve) => { setTimeout(resolve, 1000 / 60); }); @@ -99,6 +98,7 @@ const useThemeAnimation = () => { root.classList.add(isDark ? 'light' : 'dark'); }) .ready.then(() => { + // eslint-disable-next-line no-console console.log(`Theme transition finished in ${Date.now() - time}ms`); const clipPath = [ `circle(0px at ${x}px ${y}px)`, diff --git a/.dumi/loading.js b/.dumi/loading.js index 23b84ea095..811f63354e 100644 --- a/.dumi/loading.js +++ b/.dumi/loading.js @@ -1,3 +1,3 @@ // must be .js file, can't modify to be .ts file! -// eslint-disable-next-line no-restricted-exports + export { default } from './theme/common/Loading'; diff --git a/.dumi/pages/index/components/BannerRecommends.tsx b/.dumi/pages/index/components/BannerRecommends.tsx index cc223f3b44..8c6dfc16c2 100644 --- a/.dumi/pages/index/components/BannerRecommends.tsx +++ b/.dumi/pages/index/components/BannerRecommends.tsx @@ -36,6 +36,7 @@ const useStyle = createStyles(({ token, css, cx }) => { cardItem: css` &:hover { box-shadow: ${token.boxShadowCard}; + border-color: transparent; } `, sliderItem: css` @@ -112,7 +113,7 @@ export const BannerRecommendsFallback: React.FC = () => { const { isMobile } = useContext(SiteContext); const { styles } = useStyle(); - const list = Array(3).fill(1); + const list = new Array(3).fill(1); return isMobile ? ( @@ -140,7 +141,7 @@ const BannerRecommends: React.FC = () => { const data = useSiteData(); const extras = data?.extras?.[lang]; const icons = data?.icons || []; - const first3 = !extras || extras.length === 0 ? Array(3).fill(null) : extras.slice(0, 3); + const first3 = !extras || extras.length === 0 ? new Array(3).fill(null) : extras.slice(0, 3); if (!data) { return ; diff --git a/.dumi/pages/index/components/ComponentsList.tsx b/.dumi/pages/index/components/ComponentsList.tsx index 7aae7b7881..739355b890 100644 --- a/.dumi/pages/index/components/ComponentsList.tsx +++ b/.dumi/pages/index/components/ComponentsList.tsx @@ -257,7 +257,7 @@ const ComponentsList: React.FC = () => { style={{ width: 400 }} message="Ant Design 5.0" description={locale.sampleContent} - closable + closable={{ closeIcon: true, disabled: true }} /> ), }, diff --git a/.dumi/pages/index/components/Theme/ColorPicker.tsx b/.dumi/pages/index/components/Theme/ColorPicker.tsx index f41295a9e5..68262526b9 100644 --- a/.dumi/pages/index/components/Theme/ColorPicker.tsx +++ b/.dumi/pages/index/components/Theme/ColorPicker.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { ColorPicker, Flex, Input } from 'antd'; -import { createStyles } from 'antd-style'; import type { ColorPickerProps, GetProp } from 'antd'; +import { createStyles } from 'antd-style'; import { generateColor } from 'antd/es/color-picker/util'; import classNames from 'classnames'; @@ -61,7 +61,7 @@ const DebouncedColorPicker: React.FC {children} @@ -102,7 +102,6 @@ const ThemeColorPicker: React.FC = ({ value, onChange, id {matchColors.map(({ color, active, picker }) => { const colorNode = ( - // eslint-disable-next-line jsx-a11y/label-has-associated-control