-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat: Add new props and functionality to components, update styles,…
… and adjust form layout This commit introduces new props and functionality to components, updates styles, and makes adjustments to the form layout. The changes aim to enhance the user experience and improve the overall design of the project.
- Loading branch information
1 parent
551ac66
commit d16f239
Showing
6 changed files
with
138 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,98 @@ | ||
import { createStyles } from 'antd-style'; | ||
import { isNumber } from 'lodash-es'; | ||
|
||
export const useStyles = createStyles(({ css, token }, itemMinWidth?: string | number) => ({ | ||
footer: css` | ||
display: flex; | ||
gap: 8px; | ||
justify-content: flex-end; | ||
`, | ||
formTitle: css` | ||
position: relative; | ||
export const useStyles = createStyles( | ||
({ css, cx, token, isDarkMode }, itemMinWidth?: string | number) => ({ | ||
footer: css` | ||
display: flex; | ||
gap: 8px; | ||
justify-content: flex-end; | ||
`, | ||
formTitle: css` | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 6px; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 6px; | ||
text-align: left; | ||
text-align: left; | ||
> div { | ||
font-weight: 500; | ||
line-height: 1; | ||
} | ||
> div { | ||
font-weight: 500; | ||
line-height: 1; | ||
} | ||
> small { | ||
display: block; | ||
> small { | ||
display: block; | ||
line-height: 1; | ||
color: ${token.colorTextDescription}; | ||
word-wrap: break-word; | ||
white-space: pre-wrap; | ||
} | ||
line-height: 1; | ||
color: ${token.colorTextDescription}; | ||
word-wrap: break-word; | ||
white-space: pre-wrap; | ||
} | ||
`, | ||
group: css` | ||
.ant-collapse-header { | ||
background: ${token.colorFillTertiary}; | ||
border-radius: 0 !important; | ||
} | ||
.ant-tag { | ||
font-family: ${token.fontFamilyCode}; | ||
} | ||
`, | ||
group: cx( | ||
isDarkMode && | ||
css` | ||
.ant-collapse-content { | ||
background: transparent; | ||
} | ||
.ant-collapse-content { | ||
background: transparent; | ||
} | ||
.ant-collapse-header { | ||
background: ${token.colorFillTertiary}; | ||
} | ||
`, | ||
css` | ||
.ant-collapse-header { | ||
border-radius: 0 !important; | ||
} | ||
.ant-collapse-content-box { | ||
padding-top: 0 !important; | ||
padding-bottom: 0 !important; | ||
} | ||
.ant-collapse-content-box { | ||
padding-top: 0 !important; | ||
padding-bottom: 0 !important; | ||
} | ||
.ant-form-item-label { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
`, | ||
item: css` | ||
padding: 8px 0; | ||
.ant-form-item-label { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
} | ||
`, | ||
), | ||
item: css` | ||
padding: 8px 0; | ||
.ant-row { | ||
justify-content: space-between; | ||
.ant-row { | ||
justify-content: space-between; | ||
> div { | ||
flex: unset !important; | ||
flex-grow: unset !important; | ||
> div { | ||
flex: unset !important; | ||
flex-grow: unset !important; | ||
} | ||
} | ||
} | ||
${itemMinWidth && | ||
css` | ||
.ant-form-item-control { | ||
width: ${isNumber(itemMinWidth) ? `${itemMinWidth}px` : itemMinWidth}; | ||
} | ||
`} | ||
`, | ||
title: css` | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
${itemMinWidth && | ||
css` | ||
.ant-form-item-control { | ||
width: ${isNumber(itemMinWidth) ? `${itemMinWidth}px` : itemMinWidth}; | ||
} | ||
`} | ||
`, | ||
title: css` | ||
display: flex; | ||
gap: 8px; | ||
align-items: center; | ||
font-size: 16px; | ||
font-weight: 600; | ||
font-size: 16px; | ||
font-weight: 600; | ||
.anticon { | ||
color: ${token.colorPrimary}; | ||
} | ||
`, | ||
})); | ||
.anticon { | ||
color: ${token.colorPrimary}; | ||
} | ||
`, | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d16f239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
lobe-ui – ./
lobe-ui.vercel.app
lobe-ui-lobehub.vercel.app
lobe-ui-git-master-lobehub.vercel.app
ui.lobehub.com