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

Chore/fave 34158 upgrade antd to v5 #159

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
84ea345
add audit & publish-local commands
AladdinNullptr Dec 28, 2023
c6235e5
Bump react types and add react-dom peer dependency
AladdinNullptr Dec 28, 2023
1e469ba
Bump antd to v5
AladdinNullptr Dec 28, 2023
6ab6e19
update style index and component template
AladdinNullptr Dec 28, 2023
f97be92
Update button style
AladdinNullptr Dec 29, 2023
89470ef
Update input style
AladdinNullptr Dec 29, 2023
e5ceee4
Update select style
AladdinNullptr Dec 29, 2023
0aba5a2
Update menu style
AladdinNullptr Dec 29, 2023
5544160
Remove duplicate form-item style
AladdinNullptr Dec 29, 2023
dfd95cc
Update checkbox style
AladdinNullptr Jan 3, 2024
14c4e5a
Update radio style
AladdinNullptr Jan 3, 2024
4b178df
Update form style
AladdinNullptr Jan 3, 2024
e4a749a
Update tabs style
AladdinNullptr Jan 3, 2024
1917a5e
Update breadcrumb style
AladdinNullptr Jan 3, 2024
14f926c
Update dropdown style
AladdinNullptr Jan 11, 2024
64682fc
Update base style
AladdinNullptr Jan 11, 2024
b71bdcf
Update modal style
AladdinNullptr Jan 11, 2024
5023063
Update mentions style
AladdinNullptr Jan 11, 2024
e1ad8cd
Update steps style
AladdinNullptr Jan 11, 2024
e14877f
Update pagination style
AladdinNullptr Jan 11, 2024
754f598
Update date picker style
AladdinNullptr Jan 11, 2024
ee14a1f
Update message component type
AladdinNullptr Jan 11, 2024
18a1780
Update notification component type
AladdinNullptr Jan 11, 2024
d676b46
Update Comment and PageHeader imports and deprecation messages
AladdinNullptr Jan 11, 2024
d43ac06
Update popover style
AladdinNullptr Jan 11, 2024
3c5cac3
Update List and layout stories
AladdinNullptr Jan 11, 2024
ee30633
Update tag component
AladdinNullptr Jan 11, 2024
92900bf
Update progress style
AladdinNullptr Jan 11, 2024
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
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,27 @@
"clean": "git clean -Xdf",
"storybook": "start-storybook -p 6006",
"create-component": "node ./tools/create-component.js",
"prepare": "husky install"
"prepare": "husky install",
"audit": "yarn audit --groups dependencies",
"publish-local": "yalc publish"
},
"dependencies": {
"@ant-design/compatible": "^5.1.2",
"@ant-design/icons": "^4.7.0",
"@ant-design/pro-layout": "^7.17.16",
"@babel/runtime": "^7.1.2",
"@types/classnames": "^2.3.1",
"@types/react": "^16.9.5",
"antd": "4.20.0",
"@types/react": "17.0.2",
"antd": "5.12.2",
"array-move": "^4.0.0",
"classnames": "^2.3.1",
"date-fns": "^2.28.0",
"react-sortable-hoc": "^2.0.0",
"ui-box": "^5.0.0"
},
"peerDependencies": {
"react": ">=16.9.0"
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
},
"devDependencies": {
"@babel/cli": "^7.1.2",
Expand Down Expand Up @@ -127,3 +132,4 @@
]
}
}

10 changes: 4 additions & 6 deletions src/AutoComplete/stories/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Form, FormItemProps, Input, InputProps } from 'antd'
import Search from 'antd/lib/input/Search'
import { default as AutoComplete, AutoCompleteProps } from '../index'

import '../../assets/style/form-item.css'

export default {
title: 'AutoComplete',
component: AutoComplete
Expand All @@ -22,10 +20,10 @@ const Template: Story<Args> = (args: Args) => (
<AutoComplete
{...args.autoComplete}
filterOption={(inputValue, option) =>
option!.value
.toString()
.toUpperCase()
.indexOf(inputValue.toUpperCase()) !== -1
option!.value
.toString()
.toUpperCase()
.indexOf(inputValue.toUpperCase()) !== -1
}
>
<Input {...args.input} />
Expand Down
7 changes: 4 additions & 3 deletions src/Breadcrumb/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @import '../Menu/style.css';
@import '../Dropdown/style.css'; */

.ant-breadcrumb {
& > ol {
@apply mb-[1em];
}

li a {
@apply text-sm font-inter text-neutral-400;
@apply hover:text-neutral-400 hover:underline;
Expand Down
64 changes: 37 additions & 27 deletions src/Button/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,71 @@
&.icon-start {
@apply pl-2;

svg:first-child {
svg:first-of-type {
@apply mr-1;
}
}

&.icon-end {
@apply pr-2;

svg:last-child {
svg:last-of-type {
@apply ml-1;
}
}

&-sm {
&&-sm {
@apply px-3 py-1 text-xs font-semibold rounded;

&.icon-start {
@apply pl-2;

svg:first-child {
svg:first-of-type {
@apply mr-1;
}
}

&.icon-end {
@apply pr-1;

svg:last-child {
svg:last-of-type {
@apply ml-1;
}
}
}

&-lg {
&&-lg {
@apply px-4 py-2.5 text-sm font-bold;

&.icon-start {
@apply pl-2;

svg:first-child {
svg:first-of-type {
@apply mr-1;
}
}

&.icon-end {
@apply pr-2;

svg:last-child {
svg:last-of-type {
@apply ml-1;
}
}
}

&-circle {
@apply text-primary h-auto px-3 py-3;
@apply hover:text-primary hover:outline-primary hover:outline-1;
@apply focus:text-primary;
&:not(:disabled):not(.ant-btn-disabled) {
@apply text-primary bg-white border-neutral-300;

&:active {
@apply text-primary;
&:focus,
&:active {
@apply text-primary border-primary;
}

&:hover {
@apply text-primary border-neutral-300;
}
}

&.ant-btn-lg {
Expand All @@ -75,28 +80,33 @@
}

&-primary {
@apply bg-primary text-white;
@apply hover:bg-primary hover:bg-opacity-70 hover:text-white;
@apply focus:bg-primary focus:text-white focus:outline-none;

&:active {
@apply bg-primary text-white bg-opacity-70;
&:not(:disabled):not(.ant-btn-disabled) {
@apply bg-primary text-white;
@apply hover:bg-primary hover:bg-opacity-70 hover:text-white;
@apply focus:bg-primary focus:text-white focus:outline-none;
@apply active:bg-primary active:text-white active:bg-opacity-70;
}
}

&-text {
@apply text-primary;
@apply hover:text-primary;
@apply focus:text-primary;

&:active {
&:not(:disabled):not(.ant-btn-disabled) {
@apply text-primary;

&:hover,
&:focus,
&:active {
@apply text-primary;
}
}
}

&-link {
@apply text-primary;
@apply hover:text-primary;
@apply focus:text-primary;
&:not(:disabled):not(.ant-btn-disabled) {
&:hover,
&:focus,
&:active {
@apply text-primary;
}
}
}
}
83 changes: 27 additions & 56 deletions src/Checkbox/style.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,39 @@
.ant-checkbox {
&:hover {
.ant-checkbox-inner {
@apply border-slate-700;
@apply font-inter;

&:not(.ant-checkbox-disabled) {
&:hover {
.ant-checkbox-inner {
@apply border-slate-700;
}
}
}

&-wrapper {
@apply text-slate-700 font-inter font-normal;
}

&-wrapper:hover {
.ant-checkbox-inner {
@apply border-slate-700;
}
}
&:not(&-disabled) {
.ant-checkbox-inner {
@apply border-slate-700;
}

&-checked {
.ant-checkbox-inner {
@apply bg-slate-700 border-slate-700;
}
.ant-checkbox-inner::after {
@apply box-border;
}
}
&:hover {
.ant-checkbox-inner {
@apply border-slate-700;
}

&-checked::after {
@apply border-none;
}
.ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner {
@apply bg-slate-700 border-slate-700;
}
}

&-disabled {
.ant-checkbox-inner {
@apply bg-white border-neutral-200;
& .ant-checkbox-checked {
.ant-checkbox-inner {
@apply bg-slate-700 border-slate-700;
}
}
}
.ant-checkbox-inner::after {
@apply border-white;
}
}

&-disabled.ant-checkbox-checked .ant-checkbox-inner {
@apply bg-neutral-300;
}

&-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
@apply border-white;
}

&-input {
@apply m-0;
}

&-input:focus + &-inner {
@apply border-slate-700;
}

&-input + &-inner {
@apply border-slate-700 rounded;
}
}

&-indeterminate {
.ant-checkbox-inner::after {
@apply bg-slate-700 border-neutral-300;
}
.ant-checkbox-inner {
@apply border-neutral-300;
}
}
.ant-checkbox-indeterminate .ant-checkbox-inner:after {
@apply bg-slate-700;
}
7 changes: 6 additions & 1 deletion src/Comment/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import { Comment as AntComment, CommentProps as AntCommentProps, Form } from 'antd'
import { Comment as AntComment, Form } from '@ant-design/compatible'
import { CommentProps as AntCommentProps } from '@ant-design/compatible/lib/comment'

import './style.css'
import Avatar from '../Avatar'
Expand Down Expand Up @@ -53,6 +54,10 @@ export type CommentListProps = CommentLoggedInUserProps &
setReplyToID: (value: string | undefined) => void
}

// todo: create an alternative component for this.
/**
* @deprecated deprecated in antd v5.0. It is used from compatibility package. consider using an alternative component
*/
export const Comment: React.FC<CommentProps> = props => <AntComment {...props} />

const authorInitials = (name: string) => {
Expand Down
2 changes: 0 additions & 2 deletions src/DatePicker/stories/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Form, FormItemProps } from 'antd'
import { differenceInDays } from 'date-fns'
import { DatePicker } from '../index'

import '../../assets/style/form-item.css'

export default {
title: 'DatePicker/Basic',
component: DatePicker
Expand Down
2 changes: 0 additions & 2 deletions src/DatePicker/stories/quarterPicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Form, FormItemProps } from 'antd'
import { differenceInDays } from 'date-fns'
import { QuarterPicker } from '../index'

import '../../assets/style/form-item.css'

export default {
title: 'DatePicker/QuarterPicker',
component: QuarterPicker
Expand Down
2 changes: 0 additions & 2 deletions src/DatePicker/stories/rangePicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { differenceInDays } from 'date-fns'
import { ArrowRight } from 'phosphor-react'
import { DateRangePicker } from '../index'

import '../../assets/style/form-item.css'

export default {
title: 'DatePicker/RangePicker',
component: DateRangePicker
Expand Down
6 changes: 5 additions & 1 deletion src/DatePicker/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
@apply h-10 px-4 border-transparent shadow-none rounded-lg;
@apply hover:border-neutral-300 focus:border-neutral-300;

&&-focused {
@apply border-transparent shadow-none;
}

&-panel-container {
@apply rounded-lg;
}
Expand All @@ -28,7 +32,7 @@
@apply px-4 text-slate-300;
}

&-suffix {
& &-suffix {
@apply text-neutral-500;
}

Expand Down
Loading
Loading