-
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
feat(Table, Datagrid): Added new tableTitle
prop
#1541
Open
chris-cedrone-cengage
wants to merge
9
commits into
dev
Choose a base branch
from
feat/tableCaption
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2f81f99
Initial commit, working on docs and tests next
chris-cedrone-cengage affec64
Merge branch 'dev' into feat/tableCaption
chris-cedrone-cengage d41aec2
Adding examples, styling
chris-cedrone-cengage 8e3477e
Adding prop description
chris-cedrone-cengage 7cdf3f2
Removing unused reference
chris-cedrone-cengage 2f8c051
Laura's notes, adding a check for node to accept inherited margins el…
chris-cedrone-cengage fd96e50
Laura's notes
chris-cedrone-cengage 610781f
Moving caption inside of the table tag, Orion's / Laura's notes
chris-cedrone-cengage 9138b7c
Removing display: flex from caption
chris-cedrone-cengage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'react-magma-dom': minor | ||
--- | ||
|
||
feat(Table, Datagrid): Added new prop `tableTitle` to `Table` and `Datagrid` which supports a captioned title above each Table and Datagrid. |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ import { magma } from '../../theme/magma'; | |
import { Spacer, SpacerAxis } from '../Spacer'; | ||
import { Announce } from '../Announce'; | ||
import { VisuallyHidden } from '../VisuallyHidden'; | ||
import { Heading } from '../Heading'; | ||
|
||
const rowsForPagination = [ | ||
{ | ||
|
@@ -282,6 +283,11 @@ export default { | |
type: 'boolean', | ||
}, | ||
}, | ||
tableTitle: { | ||
control: { | ||
type: 'text', | ||
silvalaura marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
}, | ||
} as Meta; | ||
|
||
|
@@ -337,18 +343,23 @@ const defaultArgs = { | |
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = defaultArgs; | ||
Default.args = { ...defaultArgs, tableTitle: 'Default' }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
export const TitleWithNode = Template.bind({}); | ||
TitleWithNode.args = { ...defaultArgs, tableTitle: <Heading level={1}>Title with node</Heading> }; | ||
silvalaura marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export const ColoredRows = Template.bind({}); | ||
ColoredRows.args = { | ||
...defaultArgs, | ||
rows: coloredRows, | ||
tableTitle: 'Colored rows', | ||
}; | ||
|
||
export const Selectable = Template.bind({}); | ||
Selectable.args = { | ||
...defaultArgs, | ||
isSelectable: true, | ||
tableTitle: 'Selectable', | ||
}; | ||
|
||
export const SelectableAndSortable: Story<DatagridProps> = ({ | ||
|
@@ -536,18 +547,21 @@ export const SelectableAndSortable: Story<DatagridProps> = ({ | |
SelectableAndSortable.args = { | ||
isSelectable: true, | ||
isSortableBySelected: true, | ||
tableTitle: 'Selectable and sortable', | ||
}; | ||
|
||
export const ControlledSelectable = ControlledTemplate.bind({}); | ||
ControlledSelectable.args = { | ||
...defaultArgs, | ||
isSelectable: true, | ||
tableTitle: 'Controlled selectable', | ||
}; | ||
|
||
export const DisabledSelectableRow = Template.bind({}); | ||
DisabledSelectableRow.args = { | ||
...defaultArgs, | ||
isSelectable: true, | ||
tableTitle: 'Disabled selectable row', | ||
rows: [ | ||
...defaultArgs.rows, | ||
{ | ||
|
@@ -564,6 +578,7 @@ DisabledSelectableRow.args = { | |
export const PaginationChangedDefaults = Template.bind({}); | ||
PaginationChangedDefaults.args = { | ||
...defaultArgs, | ||
tableTitle: 'Pagination changed defaults', | ||
paginationProps: { | ||
defaultPage: 2, | ||
defaultRowsPerPage: 5, | ||
|
@@ -574,6 +589,7 @@ PaginationChangedDefaults.args = { | |
export const ControlledPagination = ControlledPaginatedTemplate.bind({}); | ||
ControlledPagination.args = { | ||
...defaultArgs, | ||
tableTitle: 'Controlled pagination', | ||
paginationProps: { | ||
rowsPerPageValues: [5, 10, 20], | ||
}, | ||
|
@@ -582,6 +598,7 @@ ControlledPagination.args = { | |
export const WithoutPagination = Template.bind({}); | ||
WithoutPagination.args = { | ||
...defaultArgs, | ||
tableTitle: 'Without pagination', | ||
hasPagination: false, | ||
}; | ||
|
||
|
@@ -627,6 +644,7 @@ const CustomPaginationComponent: React.FunctionComponent< | |
export const PaginationWithCustomComponent = Template.bind({}); | ||
PaginationWithCustomComponent.args = { | ||
...defaultArgs, | ||
tableTitle: 'Pagination with custom component', | ||
components: { | ||
Pagination: CustomPaginationComponent, | ||
}, | ||
|
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we add some examples where
tableTitle
is a node?