-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): add history list for desktop
- Loading branch information
1 parent
e5478c2
commit 004fae4
Showing
32 changed files
with
358 additions
and
73 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
75 changes: 38 additions & 37 deletions
75
packages/client/src/elements/buttons/CloseButton/CloseButton.styled.ts
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,50 +1,51 @@ | ||
import styled, { css } from 'styled-components'; | ||
|
||
const size = '21px'; | ||
|
||
export const baseLineStyle = css` | ||
background: ${({ theme: { palette } }) => palette.text.secondary}; | ||
border-radius: 2px; | ||
height: 3px; | ||
margin-top: 8px; | ||
position: absolute; | ||
transition: all 0.3s ease-in; | ||
width: ${size}; | ||
`; | ||
import { getCssColor } from '../../../utils'; | ||
import { StyledCloseButtonProps } from './CloseButton.types'; | ||
|
||
export const LeftRight = styled.div` | ||
${baseLineStyle}; | ||
transform: rotate(45deg); | ||
`; | ||
|
||
export const RightLeft = styled.div` | ||
${baseLineStyle}; | ||
transform: rotate(-45deg); | ||
`; | ||
|
||
export const StyledButton = styled.button` | ||
align-items: center; | ||
background: transparent; | ||
border: none; | ||
cursor: pointer; | ||
display: flex; | ||
flex-direction: column; | ||
height: ${size}; | ||
outline: none; | ||
position: relative; | ||
width: ${size}; | ||
export const StyledButton = styled.button<StyledCloseButtonProps>( | ||
({ theme, size, color }) => css` | ||
align-items: center; | ||
background: transparent; | ||
border: none; | ||
cursor: pointer; | ||
display: flex; | ||
flex-direction: column; | ||
height: ${size}; | ||
outline: none; | ||
position: relative; | ||
width: ${size}; | ||
:focus-visible { | ||
box-shadow: 0 0 0 2px ${({ theme: { palette } }) => palette.primary.main}; | ||
transition: box-shadow 150ms ease-in-out; | ||
} | ||
:focus-visible { | ||
box-shadow: 0 0 0 2px ${theme.palette.primary.main}; | ||
transition: box-shadow 150ms ease-in-out; | ||
} | ||
&:hover ${LeftRight} { | ||
background: ${({ theme: { palette } }) => palette.colors.red}; | ||
transform: rotate(-45deg); | ||
} | ||
&:hover ${RightLeft} { | ||
background: ${({ theme: { palette } }) => palette.colors.red}; | ||
transform: rotate(45deg); | ||
} | ||
`; | ||
${LeftRight}, ${RightLeft} { | ||
border-radius: 2px; | ||
height: 3px; | ||
margin-top: 8px; | ||
position: absolute; | ||
transition: all 0.3s ease-in; | ||
width: ${size}; | ||
background: ${getCssColor({ theme, color })}; | ||
} | ||
&:hover ${LeftRight} { | ||
background: ${theme.palette.colors.red}; | ||
transform: rotate(-45deg); | ||
} | ||
&:hover ${RightLeft} { | ||
background: ${theme.palette.colors.red}; | ||
transform: rotate(45deg); | ||
} | ||
`, | ||
); |
12 changes: 11 additions & 1 deletion
12
packages/client/src/elements/buttons/CloseButton/CloseButton.types.d.ts
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 +1,11 @@ | ||
type CloseButtonProps = ButtonHTMLAttributes<HTMLButtonElement>; | ||
import { ButtonHTMLAttributes } from 'react'; | ||
|
||
interface CloseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
size?: string; | ||
color?: string; | ||
} | ||
|
||
interface StyledCloseButtonProps { | ||
size: string; | ||
color: string; | ||
} |
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
6 changes: 6 additions & 0 deletions
6
packages/client/src/elements/fields/FunctionField/FunctionField.styled.ts
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const FunctionFieldParagraph = styled.p` | ||
display: flex; | ||
align-items: center; | ||
`; |
13 changes: 11 additions & 2 deletions
13
packages/client/src/elements/fields/FunctionField/index.tsx
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
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
7 changes: 5 additions & 2 deletions
7
packages/client/src/elements/lists/DetailedList/DetailedList.types.d.ts
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,13 +1,16 @@ | ||
import { MouseEvent, ReactNode } from 'react'; | ||
import { CSSProperties, MouseEvent, ReactNode } from 'react'; | ||
|
||
import { ITheme } from '../../../theme/Theme'; | ||
|
||
export interface DetailedListProps { | ||
onRowClick?: (event: MouseEvent) => void; | ||
resource: string; | ||
children: ReactNode; | ||
noDataLabel?: string; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
rowStyle?: (record: any, theme: ITheme) => CSSProperties; | ||
rowStyle?: (record: any, theme: ITheme) => CSSProperties | undefined; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
rowCellsStyle?: (record: any, theme: ITheme) => CSSProperties | undefined; | ||
} | ||
|
||
type PerPage = 5 | 10 | 15 | 25; |
25 changes: 25 additions & 0 deletions
25
packages/client/src/elements/lists/DetailedList/NoData/NoData.styled.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import styled, { css } from 'styled-components'; | ||
|
||
import { NoDataIcon } from '../../../../icons'; | ||
import Card from '../../../Card'; | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
justify-content: flex-start; | ||
`; | ||
|
||
export const StyledNoDataIcon = styled(NoDataIcon)( | ||
({ theme: { palette } }) => css` | ||
color: ${palette.primary.mainInvert}; | ||
`, | ||
); | ||
|
||
export const NoDataCard = styled(Card)` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 40px; | ||
width: 600px; | ||
padding: 40px 0; | ||
`; |
3 changes: 3 additions & 0 deletions
3
packages/client/src/elements/lists/DetailedList/NoData/NoData.types.d.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
interface NoDataProps { | ||
label: string | undefined; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/client/src/elements/lists/DetailedList/NoData/index.tsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { NoDataCard, StyledNoDataIcon, Wrapper } from './NoData.styled'; | ||
|
||
const NoData = ({ label }: NoDataProps) => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Wrapper> | ||
<NoDataCard> | ||
<h2>{t(label as never) ?? t('lists.general.noData')}</h2> | ||
<StyledNoDataIcon /> | ||
</NoDataCard> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default NoData; |
Oops, something went wrong.