-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLAY-1590 | Timeline Small Variant: Add "Gap" Prop to Timeline Kit (#…
…3903) **What does this PR do?** A clear and concise description with your runway ticket url. [PLAY-1590](https://runway.powerhrg.com/backlog_items/PLAY-1590) As a Playbook user, I want to add a gap prop to Timeline kit, So that I can control the spacing between events in my Timeline kit. AC: - A new "Gap" Prop for the [Timeline Kit](https://playbook.powerapp.cloud/kits/timeline/react) - should give us size props like xs, sm, md, lg to change the line_connector length **Screenshots:** Screenshots to visualize your addition/change ![Screenshot 2024-11-13 at 8 26 27 AM](https://github.com/user-attachments/assets/89a3b4b1-8757-4230-87a1-8c3ff3590b49) #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review.
- Loading branch information
Showing
9 changed files
with
346 additions
and
11 deletions.
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
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
94 changes: 94 additions & 0 deletions
94
playbook/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb
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,94 @@ | ||
<%= pb_rails("flex", props: { justify: "evenly" }) do %> | ||
<%= pb_rails("flex/flex_item") do %> | ||
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "xs"}) do %> | ||
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Conversation started", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Trip #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Refund issue #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= pb_rails("flex/flex_item") do %> | ||
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "sm"}) do %> | ||
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Conversation started", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Trip #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Refund issue #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= pb_rails("flex/flex_item") do %> | ||
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "md"}) do %> | ||
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Conversation started", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Trip #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Refund issue #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
||
<%= pb_rails("flex/flex_item") do %> | ||
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "lg"}) do %> | ||
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Conversation started", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "check", icon_color: "teal", line_style: "dotted"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Trip #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<%= pb_rails("timeline/item", props: {icon: "credit-card", icon_color: "red"}) do %> | ||
<%= pb_rails("body", props: { | ||
text: "Refund issue #12422", | ||
color: "light" | ||
}) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
|
180 changes: 180 additions & 0 deletions
180
playbook/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx
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,180 @@ | ||
import React from 'react' | ||
|
||
import Timeline from '../_timeline' | ||
import Flex from "../../pb_flex/_flex" | ||
import FlexItem from "../../pb_flex/_flex_item" | ||
import Body from '../../pb_body/_body' | ||
|
||
const TimelineWithGap = (props) => ( | ||
<div> | ||
<Flex justify="evenly"> | ||
<FlexItem> | ||
<Timeline | ||
gap="xs" | ||
orientation="vertical" | ||
> | ||
<Timeline.Item | ||
icon="user" | ||
iconColor="royal" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Conversation started" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="check" | ||
iconColor="teal" | ||
lineStyle="dotted" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Trip #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="credit-card" | ||
iconColor="red" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Refund issue #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
</Timeline> | ||
</FlexItem> | ||
<FlexItem> | ||
<Timeline | ||
gap="sm" | ||
orientation="vertical" | ||
> | ||
<Timeline.Item | ||
icon="user" | ||
iconColor="royal" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Conversation started" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="check" | ||
iconColor="teal" | ||
lineStyle="dotted" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Trip #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="credit-card" | ||
iconColor="red" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Refund issue #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
</Timeline> | ||
</FlexItem> | ||
<FlexItem> | ||
<Timeline | ||
gap="md" | ||
orientation="vertical" | ||
> | ||
<Timeline.Item | ||
icon="user" | ||
iconColor="royal" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Conversation started" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="check" | ||
iconColor="teal" | ||
lineStyle="dotted" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Trip #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="credit-card" | ||
iconColor="red" | ||
lineStyle="dotted" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Refund issue #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
</Timeline> | ||
</FlexItem> | ||
<FlexItem> | ||
<Timeline | ||
gap="lg" | ||
orientation="vertical" | ||
> | ||
<Timeline.Item | ||
icon="user" | ||
iconColor="royal" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Conversation started" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="check" | ||
iconColor="teal" | ||
lineStyle="dotted" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Trip #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
<Timeline.Item | ||
icon="credit-card" | ||
iconColor="red" | ||
{...props} | ||
> | ||
<Body | ||
color="light" | ||
text="Refund issue #12422" | ||
{...props} | ||
/> | ||
</Timeline.Item> | ||
</Timeline> | ||
</FlexItem> | ||
</Flex> | ||
</div> | ||
) | ||
|
||
export default TimelineWithGap |
1 change: 1 addition & 0 deletions
1
playbook/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md
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 @@ | ||
Use the optional `gap` prop to render the timeline kit with adjusted spacing between nodes. The `gap` prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing. |
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
examples: | ||
|
||
rails: | ||
- timeline_default: Default | ||
- timeline_vertical: Vertical | ||
- timeline_with_date: With Date | ||
- timeline_with_children: With Children | ||
|
||
|
||
- timeline_with_gap: With Gap | ||
|
||
|
||
react: | ||
- timeline_default: Default | ||
- timeline_vertical: Vertical | ||
- timeline_with_date: With Date | ||
- timeline_with_children: With Children | ||
- timeline_with_gap: With Gap |
Oops, something went wrong.