Skip to content

Commit

Permalink
Improve visual balance for shorter "now" values
Browse files Browse the repository at this point in the history
- other values are significantly longer and don't have the same visual imbalance
  • Loading branch information
cee-chen committed Oct 31, 2024
1 parent 8a3d1b0 commit cc95efe
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ exports[`EuiSuperDatePicker renders an EuiDatePickerRange 1`] = `
</span>
</div>
<div
class="euiPopover euiFormControlLayoutDelimited__input emotion-euiPopover-block-euiFormControlLayoutDelimited__input-euiSuperDatePicker__rangeInput"
class="euiPopover euiFormControlLayoutDelimited__input emotion-euiPopover-block-now-euiFormControlLayoutDelimited__input-euiSuperDatePicker__rangeInput"
>
<button
class="euiDatePopoverButton euiDatePopoverButton--end emotion-euiDatePopoverButton"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ export const euiDatePopoverButtonStyles = (euiThemeContext: UseEuiTheme) => {
euiDatePopoverButton: css`
${_buttonStyles(euiThemeContext)}
`,
now: css`
/* !important needed to override date range picker nested styles */
flex-grow: 0.5 !important; /* stylelint-disable-line declaration-no-important */
`,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export const EuiDatePopoverButton: FunctionComponent<
display="block"
panelPaddingSize="none"
{...rest}
css={value === 'now' && styles.now}
>
<EuiDatePopoverContent
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ function CustomPanel({ applyTime }: { applyTime?: ApplyTime }) {
/**
* VRT only
*/
export const RangeInputs: Story = {
tags: ['vrt-only'],
args: {
start: 'now-15s',
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
await fireEvent.click(
canvas.getByTestSubject('superDatePickerShowDatesButton')
);
},
};

export const OverflowingChildren: Story = {
tags: ['vrt-only'],
args: {
Expand Down

0 comments on commit cc95efe

Please sign in to comment.