-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add data table #281
Add data table #281
Conversation
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.
some initial comments on the api
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.
more of a DX question, can take this back for discussion with RBS and your team since you guys will be consuming this component
would devs prefer to work with separate props to configure header and row (current state)
or have a combined config e.g.
columns={[
{
header: "Status", // or ReactNode
fieldKey: "status", // maps to the object property
sort: "asc", // or "desc"
onHeaderClick: () => {},
renderRowCell: (value, item, renderProps) => {},
}
]}
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.
As discussed we will keep the header and row configs separated
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.
Still find the current approach awkward. Puts alot of onus on the user to make sure they specify the matching number of header cols and row cols. Let me think more if there is a better way
…gn-system into add-data-table
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.
- is it intended for the non-first cells to not have horizontal padding? they are misaligned with the headers which do have padding
Screen.Recording.2023-08-22.at.9.31.51.AM.mov
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.
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.
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.
src/data-table/data-table.styles.tsx
Outdated
|
||
const sortIconStyles = css` | ||
color: ${Color.Neutral[1]}; | ||
font-weight: bold; |
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.
this can be removed as there's no font weight for icons
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.
On this same note, if the styles applied are the same for both icons, can consider adding it in the parent element instead and use the svg
selector
svg {
// your styles here...
}
|
||
const basicEmptyView = () => { | ||
return ( | ||
<ErrorDisplay |
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.
is there a default title/description?
also note that the ErrorDisplay currently doesn't allow empty title/description (it will revert to the placeholder copy). if this functionality is needed, please make the change in a separate PR
separately, the header in ErrorDisplay is H1 but Figma shows H3 for the table. can check with UX if this is ok, otherwise you can override the text styling
src/data-table/data-table.styles.tsx
Outdated
|
||
const sortIconStyles = css` | ||
color: ${Color.Neutral[1]}; | ||
font-weight: bold; |
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.
On this same note, if the styles applied are the same for both icons, can consider adding it in the parent element instead and use the svg
selector
svg {
// your styles here...
}
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.
noting down the outstanding items that should be covered separately:
- props changes and error display enhancements (follow up PR)
- style changes to match Figma (part 2 PR)
- any new features (part 3 PR)
- storybook documentation (final PR if needed)
src/data-table/data-table.styles.tsx
Outdated
max-width: ${(props) => (props.$maxWidth ? props.$maxWidth : "auto")}; | ||
vertical-align: middle; | ||
${TextStyleHelper.getFontFamily("H5", "bold")} | ||
color: ${Color.Neutral[1]} |
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.
to add the semicolon here
src/data-table/data-table.styles.tsx
Outdated
justify-content: center; | ||
`; | ||
|
||
export const CheckBox = styled(Checkbox)``; |
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.
can be removed if no special styling is required
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.
src/data-table/data-table.styles.tsx
Outdated
align-items: center; | ||
`; | ||
|
||
export const EmptyDataElement = styled.div` |
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.
this seems to be unused
src/data-table/data-table.styles.tsx
Outdated
div { | ||
h1 { | ||
${TextStyleHelper.getFontFamily("H3", "bold")} | ||
} | ||
} |
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.
not ideal way to style the text elements but will take this for now. let's clarify with UX if h3 is the standard size for an inline error display. we can introduce a prop like displayType: "default" | "small"
as part of the follow up PR.
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.
I'll remove the font size and weight change. Follow up URL, I'll get update from UX and do the changes.
Changes
Added component data table
[Delete] branch
Additional information