Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ant-design:master #49

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5ddec3a
chore: CI of PR welcome (#44184)
zombieJ Aug 11, 2023
56f2bc5
fix: (tabs)Unexpected color change in the click area of the mobile ta…
electroluxcode Aug 14, 2023
72b449a
docs: update faq (#44198)
zombieJ Aug 14, 2023
ee984fe
fix: Modal open should not block dropdown hidden (#44204)
zombieJ Aug 14, 2023
d1bd2d0
docs: Update recommendation (#44207)
afc163 Aug 14, 2023
e0e373f
fix(badge): fix badge number is rtl (#43998)
NotEvenANeko Aug 14, 2023
41cb8be
fix(DatePicker): optimize RangePicker's range area style (#44206)
kiner-tang Aug 14, 2023
16f0738
chore(deps-dev): bump lint-staged from 13.3.0 to 14.0.0 (#44212)
dependabot[bot] Aug 14, 2023
d493594
docs: fix menu sider-current demo (#44222)
MadCcc Aug 15, 2023
aff2bb7
chore: update pagination (#44226)
zombieJ Aug 15, 2023
9ec8534
docs(cascader): fix allowClear default value in doc (#44230)
zbw-zbw Aug 15, 2023
4fb448f
doc: upload doc line break (#44234)
1587315093 Aug 15, 2023
3f0e747
docs: fix theme editor page (#44232)
MadCcc Aug 15, 2023
8a65ad6
docs: fix font color (#44236)
MadCcc Aug 15, 2023
83e3b52
docs(Tabs): update animated prop's description (#44227)
kovsu Aug 15, 2023
a92a883
docs: render china mirror link before hydration (#44233)
afc163 Aug 16, 2023
9ba9da2
fix: ColorPicker HEX input cursor jump bug (#44137)
gouge666 Aug 16, 2023
808452e
fix(DataPicker):fix picker content is not centered (#44245)
Zian502 Aug 17, 2023
f1c38bf
site(Calendar): add lunar calendar demo (#44166)
kiner-tang Aug 17, 2023
3525966
docs: Update faq.zh-CN.md (#44274)
afc163 Aug 17, 2023
7179dc8
docs: update footer links (#44272)
afc163 Aug 17, 2023
73cfd37
fix: `Descriptions` key prop issue (#44278)
RedJue Aug 17, 2023
affd62f
chore(deps-dev): bump @testing-library/jest-dom from 5.17.0 to 6.0.0 …
dependabot[bot] Aug 17, 2023
ce687c5
fix(ColorPicker): color clear deformation (#44258) (#44273)
kouchao Aug 18, 2023
3b913cf
site: add internationalization for docs (#44263)
li-jia-nan Aug 18, 2023
7226c53
docs: add third-party library to the development section (#44283)
ArtyomVancyan Aug 18, 2023
8177c52
docs: add changelog 5.8.4 (#44293)
xrkffgg Aug 18, 2023
80bd54f
chore: redirect with rest url (#44298)
iola1999 Aug 18, 2023
8afbe69
docs(demo): Replace backticks with single quotes (#44302)
thinkasany Aug 20, 2023
65fd05c
style: add prettier-plugin-sort-imports (#44287)
crazyair Aug 21, 2023
3b5e3e8
docs(tabs): remove useless string in Description (#44307)
thinkasany Aug 21, 2023
b50928f
chore: split previewer (#44310)
MadCcc Aug 21, 2023
e02e53b
docs: link preload => prefetch (#44320)
afc163 Aug 21, 2023
21a2265
docs: show mirror modal on page load (#44291)
MadCcc Aug 21, 2023
b26e3a7
fix: WaterMark clip logic (#44321)
zombieJ Aug 21, 2023
da699b1
docs: add fallback for previewer (#44327)
MadCcc Aug 21, 2023
06d1c9a
docs: font flash in home page (#44333)
afc163 Aug 22, 2023
af301a9
fix(date-picker):fix format type processing for showTime. (#44306)
Zian502 Aug 22, 2023
80e1bc8
style: remove importOrderSeparation from prettier config (#44336)
crazyair Aug 22, 2023
70d9a90
docs: fix anchor positioning (#44348)
MadCcc Aug 22, 2023
0295322
docs: prevent highlight code initially (#44344)
afc163 Aug 22, 2023
4d12efe
chore: Update pr-contributor-welcome.yml (#44340)
afc163 Aug 22, 2023
24d055e
chore(deps-dev): bump vanilla-jsoneditor from 0.17.10 to 0.18.0 (#44352)
dependabot[bot] Aug 22, 2023
f5fcb70
fix: rm useless form inline style (#44360)
zombieJ Aug 22, 2023
5d522a3
chore: remove duplicate styles (#44368)
Wxh16144 Aug 23, 2023
79825c0
fix: Table should not crash if filterDropdown is boolean (#44357)
MadCcc Aug 23, 2023
e91f927
fix: radio should work in tree (#44380)
MadCcc Aug 24, 2023
eaa8635
ColorPresets: fix duplicate keys (#44370)
xr0master Aug 24, 2023
0dd651c
docs: Fix Form provider demo (#44391)
zombieJ Aug 24, 2023
9312b00
chore: update icon snapshot (#44414)
MadCcc Aug 24, 2023
3405450
fix: Form xs breakpoint (#44388)
zombieJ Aug 24, 2023
d7d493e
refactor(notification): reduce the configuration parameter code (#44372)
Yuiai01 Aug 25, 2023
94339be
feat: lunisolar => lunar-typescript (#44420)
kiner-tang Aug 25, 2023
4e9ac02
fix: Tour panel token & home support dark mode (#44428)
zombieJ Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dumi/hooks/useDark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

export const DarkContext = React.createContext(false);

export default function useDark() {
return React.useContext(DarkContext);
}
172 changes: 172 additions & 0 deletions .dumi/mirror-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
(function createMirrorModal() {
if (
(navigator.languages.includes('zh') || navigator.languages.includes('zh-CN')) &&
/-cn\/?$/.test(window.location.pathname) &&
!['ant-design.gitee.io', 'ant-design.antgroup.com'].includes(window.location.hostname)
) {
const ANTD_DOT_NOT_SHOW_MIRROR_MODAL = 'ANT_DESIGN_DO_NOT_OPEN_MIRROR_MODAL';

const lastShowTime = window.localStorage.getItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL);
if (
lastShowTime &&
lastShowTime !== 'true' &&
Date.now() - new Date(lastShowTime).getTime() < 7 * 24 * 60 * 60 * 1000
) {
return;
}

const style = document.createElement('style');
style.innerHTML = `
@keyframes mirror-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

@keyframes mirror-zoom-in {
from {
transform: scale(0.8);
}
to {
transform: scale(1);
}
}

.mirror-modal-mask {
position: fixed;
inset: 0;
height: '100vh';
width: '100vw';
background: rgba(0, 0, 0, 0.3);
z-index: 9999;
animation: mirror-fade-in 0.3s forwards;
}

.mirror-modal-dialog {
position: fixed;
inset: 0;
top: 120px;
margin-left: auto;
margin-right: auto;
width: 400px;
height: 120px;
display: flex;
align-items: center;
flex-direction: column;
border-radius: 8px;
border: 1px solid #eee;
background: #fff;
padding: 20px 24px;
box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
animation: mirror-zoom-in 0.3s forwards;
}

.mirror-modal-title {
font-size: 16px;
font-weight: 500;
align-self: flex-start;
margin-bottom: 8px;
}

.mirror-modal-content {
font-size: 14px;
align-self: flex-start;
margin-bottom: 16px;
}

.mirror-modal-btns {
align-self: flex-end;
margin-top: auto;
display: flex;
align-items: center;
}

.mirror-modal-btn {
border-radius: 6px;
cursor: pointer;
height: 32px;
box-sizing: border-box;
font-size: 14px;
padding: 4px 16px;
display: inline-flex;
align-items: center;
text-decoration: none;
transition: all 0.2s;
}

.mirror-modal-confirm-btn {
background: #1677ff;
color: #fff;
}

.mirror-modal-confirm-btn:hover {
background: #4096ff;
}

.mirror-modal-confirm-btn:active {
background: #0958d9;
}

.mirror-modal-cancel-btn {
border: 1px solid #eee;
color: #000;
margin-right: 8px;
}

.mirror-modal-cancel-btn:hover {
border-color: #4096ff;
color: #4096ff
}

.mirror-modal-cancel-btn:active {
border-color: #0958d9;
color: #0958d9;
}
`;
document.head.append(style);

const modal = document.createElement('div');
modal.className = 'mirror-modal-mask';

const dialog = document.createElement('div');
dialog.className = 'mirror-modal-dialog';
modal.append(dialog);

const title = document.createElement('div');
title.className = 'mirror-modal-title';
title.innerText = '提示';
dialog.append(title);

const content = document.createElement('div');
content.className = 'mirror-modal-content';
content.innerText = '国内用户推荐访问国内镜像以获得极速体验~';
dialog.append(content);

const btnWrapper = document.createElement('div');
btnWrapper.className = 'mirror-modal-btns';
dialog.append(btnWrapper);

const cancelBtn = document.createElement('a');
cancelBtn.className = 'mirror-modal-cancel-btn mirror-modal-btn';
cancelBtn.innerText = '7 天内不再显示';
btnWrapper.append(cancelBtn);
cancelBtn.addEventListener('click', () => {
window.localStorage.setItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL, new Date().toISOString());
document.body.removeChild(modal);
document.head.removeChild(style);
document.body.style.overflow = '';
});

const confirmBtn = document.createElement('a');
confirmBtn.className = 'mirror-modal-confirm-btn mirror-modal-btn';
confirmBtn.href = window.location.href.replace(window.location.host, 'ant-design.antgroup.com');
confirmBtn.innerText = '🚀 立刻前往';
btnWrapper.append(confirmBtn);

document.body.append(modal);
document.body.style.overflow = 'hidden';
}
})();
89 changes: 48 additions & 41 deletions .dumi/pages/index/components/ComponentsList.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
/* eslint-disable react/jsx-pascal-case */
import React, { useContext } from 'react';
import dayjs from 'dayjs';
import { CustomerServiceOutlined, QuestionCircleOutlined, SyncOutlined } from '@ant-design/icons';
import { createStyles, css, useTheme } from 'antd-style';
import classNames from 'classnames';
import {
Space,
Typography,
Tour,
Tag,
DatePicker,
Alert,
Modal,
Carousel,
DatePicker,
FloatButton,
Modal,
Progress,
Carousel,
Space,
Tag,
Tour,
Typography,
} from 'antd';
import { createStyles, css, useTheme } from 'antd-style';
import classNames from 'classnames';
import dayjs from 'dayjs';

import useDark from '../../../hooks/useDark';
import useLocale from '../../../hooks/useLocale';
import SiteContext from '../../../theme/slots/SiteContext';
import { getCarouselStyle } from './util';
Expand Down Expand Up @@ -55,40 +57,45 @@ const locales = {
},
};

const useStyle = createStyles(({ token }) => {
const { carousel } = getCarouselStyle();
const useStyle = () => {
const isRootDark = useDark();

return {
card: css`
border-radius: ${token.borderRadius}px;
background: #f5f8ff;
padding: ${token.paddingXL}px;
flex: none;
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;
return createStyles(({ token }) => {
const { carousel } = getCarouselStyle();

> * {
return {
card: css`
border-radius: ${token.borderRadius}px;
border: 1px solid ${isRootDark ? token.colorBorder : 'transparent'};
background: ${isRootDark ? token.colorBgContainer : '#f5f8ff'};
padding: ${token.paddingXL}px;
flex: none;
}
`,
cardCircle: css`
position: absolute;
width: 120px;
height: 120px;
background: #1677ff;
border-radius: 50%;
filter: blur(40px);
opacity: 0.1;
`,
mobileCard: css`
height: 395px;
`,
carousel,
};
});
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
align-items: stretch;

> * {
flex: none;
}
`,
cardCircle: css`
position: absolute;
width: 120px;
height: 120px;
background: #1677ff;
border-radius: 50%;
filter: blur(40px);
opacity: 0.1;
`,
mobileCard: css`
height: 395px;
`,
carousel,
};
})();
};

const ComponentItem: React.FC<ComponentItemProps> = ({ title, node, type, index }) => {
const tagColor = type === 'new' ? 'processing' : 'warning';
Expand Down
28 changes: 18 additions & 10 deletions .dumi/pages/index/components/DesignFramework.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React, { useContext } from 'react';
import { Col, Row, Typography } from 'antd';
import { createStyles, useTheme } from 'antd-style';
import { Link, useLocation } from 'dumi';
import { Col, Row, Typography } from 'antd';

import useDark from '../../../hooks/useDark';
import useLocale from '../../../hooks/useLocale';
import * as utils from '../../../theme/utils';
import SiteContext from '../../../theme/slots/SiteContext';
import * as utils from '../../../theme/utils';

const SECONDARY_LIST = [
{
Expand Down Expand Up @@ -60,12 +62,17 @@ const locales = {
},
};

const useStyle = createStyles(({ token, css }) => ({
card: css`
const useStyle = () => {
const isRootDark = useDark();

return createStyles(({ token, css }) => ({
card: css`
padding: ${token.paddingSM}px;
border-radius: ${token.borderRadius * 2}px;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02),
background: ${isRootDark ? 'rgba(0,0,0,0.45)' : token.colorBgElevated};
box-shadow:
0 1px 2px rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px rgba(0, 0, 0, 0.02);

img {
Expand All @@ -75,18 +82,19 @@ const useStyle = createStyles(({ token, css }) => ({
}
`,

cardMini: css`
cardMini: css`
display: block;
border-radius: ${token.borderRadius * 2}px;
padding: ${token.paddingMD}px ${token.paddingLG}px;
background: rgba(0, 0, 0, 0.02);
border: 1px solid rgba(0, 0, 0, 0.06);
background: ${isRootDark ? 'rgba(0,0,0,0.25)' : 'rgba(0, 0, 0, 0.02)'};
border: 1px solid ${isRootDark ? 'rgba(255,255,255, 0.45)' : 'rgba(0, 0, 0, 0.06)'};

img {
height: 48px;
}
`,
}));
}))();
};

export default function DesignFramework() {
const [locale] = useLocale(locales);
Expand Down
Loading
Loading