Skip to content

Commit

Permalink
HDS-3945 Fix display of time range so it works the same when used wit…
Browse files Browse the repository at this point in the history
…hout tooltip, add more examples to Showcase
  • Loading branch information
KristinLBradley committed Nov 16, 2024
1 parent efa85d2 commit 65490d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/styles/components/time.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
//

.hds-time-range {
display: flex; // remove excess space between time range elements
display: inline-flex; // remove excess space between time range elements
gap: 2px; // add a bit of space around en dash so it doesn't touch some number characters
}
20 changes: 17 additions & 3 deletions showcase/app/templates/components/time.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,33 @@
<section>
<Shw::Text::H2>Used in context</Shw::Text::H2>

<Shw::Flex @gap="2rem" as |SF|>
<SF.Item @label="Single date">
<Shw::Flex @gap="2rem" @direction="column" as |SF|>
<SF.Item @label="Single date with tooltip">
<Hds::Text::Body @tag="p">
HashiConf 2024 ended
<Hds::Time @date="16 October 2024" @display="relative" />.
</Hds::Text::Body>
</SF.Item>

<SF.Item @label="Date range">
<SF.Item @label="Single date without tooltip">
<Hds::Text::Body @tag="p">
HashiConf 2024 ended
<Hds::Time @date="16 October 2024" @display="relative" @hasTooltip={{false}} />.
</Hds::Text::Body>
</SF.Item>

<SF.Item @label="Date range with tooltip">
<Hds::Text::Body @tag="p">
HashiConf is from
<Hds::Time @startDate="14 October 2024" @endDate="16 October 2024" />.
</Hds::Text::Body>
</SF.Item>

<SF.Item @label="Date range without tooltip">
<Hds::Text::Body @tag="p">
HashiConf is from
<Hds::Time @startDate="14 October 2024" @endDate="16 October 2024" @hasTooltip={{false}} />.
</Hds::Text::Body>
</SF.Item>
</Shw::Flex>
</section>

0 comments on commit 65490d2

Please sign in to comment.