Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions packages/tables/src/examples/overflow-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ const { zdSpacingSm } = require('@zendeskgarden/css-variables');
const { Menu, Item } = require('@zendeskgarden/react-menus/src');
const { XL } = require('@zendeskgarden/react-typography/src');

const OverflowMenu = ({ isHeader = false }) => (
const OverflowMenu = () => (
<Menu
onChange={selectedKey => alert(selectedKey)}
placement="bottom-end"
style={{ marginTop: 0 }}
popperModifiers={{
preventOverflow: {
boundariesElement: 'viewport'
Expand All @@ -27,10 +28,9 @@ const OverflowMenu = ({ isHeader = false }) => (
offset: {
fn: data => {
/**
* Have to ensure that popper is placed relative
* to the trigger
* Ensure correct placement relative to trigger
**/
data.offsets.popper.top -= isHeader ? 12 : 8;
data.offsets.popper.top -= 2;
return data;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tables/src/views/Cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Cell = styled.div.attrs({
})
})`
&& {
display: block;
display: flex;
width: ${({ width }) => width};
}

Expand Down
8 changes: 8 additions & 0 deletions packages/tables/src/views/HeaderRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import classNames from 'classnames';
import TableStyles from '@zendeskgarden/css-tables';
import { retrieveTheme } from '@zendeskgarden/react-theming';

import { StyledOverflowButton } from './OverflowButton';

const COMPONENT_ID = 'tables.header_row';

const HeaderRow = styled.div.attrs({
Expand All @@ -22,6 +24,12 @@ const HeaderRow = styled.div.attrs({
display: flex;
}

/* stylelint-disable */
${StyledOverflowButton} {
margin-top: auto !important;
}
/* stylelint-enable */

${props => retrieveTheme(COMPONENT_ID, props)};
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/tables/src/views/OverflowButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const COMPONENT_ID = 'tables.overflow_button';
/**
* Accepts all `<button>` props
*/
const StyledOverflowButton = styled.button.attrs({
export const StyledOverflowButton = styled.button.attrs({
'data-garden-id': COMPONENT_ID,
'data-garden-version': PACKAGE_VERSION,
type: 'button',
Expand Down
20 changes: 16 additions & 4 deletions packages/tables/src/views/__snapshots__/Cell.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

exports[`Cell renders default styling 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<div
Expand All @@ -15,7 +18,10 @@ exports[`Cell renders default styling 1`] = `

exports[`Cell renders menu styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<div
Expand All @@ -28,7 +34,10 @@ exports[`Cell renders menu styling if provided 1`] = `

exports[`Cell renders minimum styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<div
Expand All @@ -41,7 +50,10 @@ exports[`Cell renders minimum styling if provided 1`] = `

exports[`Cell renders truncation styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ exports[`HeaderRow applies default styling by default 1`] = `
display: flex;
}

.c0 .c1 {
margin-top: auto !important;
}

<HeaderRow>
<div
className="c-table__row c-table__row--header c0"
Expand Down
35 changes: 28 additions & 7 deletions packages/tables/src/views/__snapshots__/SortableCell.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

exports[`SortableCell applies active styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down Expand Up @@ -43,7 +46,10 @@ exports[`SortableCell applies active styling if provided 1`] = `

exports[`SortableCell applies default styling 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell>
Expand Down Expand Up @@ -80,7 +86,10 @@ exports[`SortableCell applies default styling 1`] = `

exports[`SortableCell applies focused styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down Expand Up @@ -121,7 +130,10 @@ exports[`SortableCell applies focused styling if provided 1`] = `

exports[`SortableCell applies minimum styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down Expand Up @@ -162,7 +174,10 @@ exports[`SortableCell applies minimum styling if provided 1`] = `

exports[`SortableCell applies truncated styling if provided 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down Expand Up @@ -203,7 +218,10 @@ exports[`SortableCell applies truncated styling if provided 1`] = `

exports[`SortableCell sorting applies ascending props when applied 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down Expand Up @@ -244,7 +262,10 @@ exports[`SortableCell sorting applies ascending props when applied 1`] = `

exports[`SortableCell sorting applies descending props when applied 1`] = `
.c0.c0 {
display: block;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}

<SortableCell
Expand Down