playbook_ui 14.11.0.pre.rc.15 → 14.11.0.pre.rc.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +2 -4
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +4 -6
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -3
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -3
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -5
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -4
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +4 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
- data/app/pb_kits/playbook/utilities/_gap.scss +29 -0
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +1 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +18 -9
- data/dist/chunks/{_typeahead-DPsPSYxe.js → _typeahead-C2iCBqxQ.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CJTPh4if.js → _weekday_stacked-CWnbnW7m.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/spacing.rb +21 -0
- data/lib/playbook/version.rb +1 -1
- metadata +4 -3
@@ -1,4 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
1
|
|
3
2
|
[class^=pb_time_range_inline_kit] {
|
4
3
|
&[class*=_center] {
|
@@ -23,14 +22,14 @@
|
|
23
22
|
display: flex;
|
24
23
|
align-items: center;
|
25
24
|
[class*=pb_time_range_inline_arrow] {
|
26
|
-
margin-left:
|
27
|
-
margin-right:
|
25
|
+
margin-left: $space_xs/2;
|
26
|
+
margin-right: $space_xs/2;
|
28
27
|
}
|
29
28
|
[class*=pb_time_range_inline_timezone] {
|
30
|
-
margin-left:
|
29
|
+
margin-left: $space_xs/2;
|
31
30
|
}
|
32
31
|
[class*=pb_time_range_inline_icon] {
|
33
|
-
margin-right:
|
32
|
+
margin-right: $space_xs/2;
|
34
33
|
}
|
35
34
|
}
|
36
35
|
}
|
@@ -1,14 +1,12 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
@import "../tokens/spacing";
|
5
3
|
@import "../tokens/opacity";
|
6
4
|
@import "../tokens/typography";
|
7
5
|
|
8
6
|
$connector_width: 2px;
|
9
|
-
$icon_margin:
|
7
|
+
$icon_margin: $space_xs/2;
|
10
8
|
$icon_height: 28px;
|
11
|
-
$height_from_top:
|
9
|
+
$height_from_top: $icon_height/2 - $connector_width/2;
|
12
10
|
|
13
11
|
// Add gap variables
|
14
12
|
$gap_xs: $height_from_top + $space_xs;
|
@@ -20,7 +20,7 @@ type TimelineProps = {
|
|
20
20
|
id?: string,
|
21
21
|
orientation?: string,
|
22
22
|
showDate?: boolean,
|
23
|
-
|
23
|
+
itemGap?: 'xs' | 'sm' | 'md' | 'lg' | 'none',
|
24
24
|
} & GlobalProps
|
25
25
|
|
26
26
|
const Timeline = ({
|
@@ -32,15 +32,15 @@ const Timeline = ({
|
|
32
32
|
id,
|
33
33
|
orientation = 'horizontal',
|
34
34
|
showDate = false,
|
35
|
-
|
35
|
+
itemGap = 'none',
|
36
36
|
...props
|
37
37
|
}: TimelineProps): React.ReactElement => {
|
38
38
|
const ariaProps = buildAriaProps(aria)
|
39
39
|
const dataProps = buildDataProps(data)
|
40
40
|
const htmlProps = buildHtmlProps(htmlOptions)
|
41
41
|
const dateStyle = showDate === true ? '_with_date' : ''
|
42
|
-
const
|
43
|
-
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle,
|
42
|
+
const itemGapStyle = itemGap === 'none' ? '' : `gap_${itemGap}`
|
43
|
+
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle, itemGapStyle)
|
44
44
|
|
45
45
|
return (
|
46
46
|
<div
|
@@ -60,4 +60,4 @@ Timeline.Step = TimelineStep
|
|
60
60
|
Timeline.Label = TimelineLabel
|
61
61
|
Timeline.Detail = TimelineDetail
|
62
62
|
|
63
|
-
export default Timeline
|
63
|
+
export default Timeline
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_rails("flex", props: { justify: "evenly" }) do %>
|
2
2
|
<%= pb_rails("flex/flex_item") do %>
|
3
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
3
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "xs"}) do %>
|
4
4
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
5
5
|
<%= pb_rails("body", props: {
|
6
6
|
text: "Conversation started",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
|
25
25
|
<%= pb_rails("flex/flex_item") do %>
|
26
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
26
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "sm"}) do %>
|
27
27
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
28
28
|
<%= pb_rails("body", props: {
|
29
29
|
text: "Conversation started",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<% end %>
|
47
47
|
|
48
48
|
<%= pb_rails("flex/flex_item") do %>
|
49
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
49
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "md"}) do %>
|
50
50
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
51
51
|
<%= pb_rails("body", props: {
|
52
52
|
text: "Conversation started",
|
@@ -69,7 +69,7 @@
|
|
69
69
|
<% end %>
|
70
70
|
|
71
71
|
<%= pb_rails("flex/flex_item") do %>
|
72
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
72
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", item_gap: "lg"}) do %>
|
73
73
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
74
74
|
<%= pb_rails("body", props: {
|
75
75
|
text: "Conversation started",
|
@@ -91,4 +91,3 @@
|
|
91
91
|
<% end %>
|
92
92
|
<% end %>
|
93
93
|
<% end %>
|
94
|
-
|
@@ -10,7 +10,7 @@ const TimelineWithGap = (props) => (
|
|
10
10
|
<Flex justify="evenly">
|
11
11
|
<FlexItem>
|
12
12
|
<Timeline
|
13
|
-
|
13
|
+
itemGap="xs"
|
14
14
|
orientation="vertical"
|
15
15
|
>
|
16
16
|
<Timeline.Item
|
@@ -51,7 +51,7 @@ const TimelineWithGap = (props) => (
|
|
51
51
|
</FlexItem>
|
52
52
|
<FlexItem>
|
53
53
|
<Timeline
|
54
|
-
|
54
|
+
itemGap="sm"
|
55
55
|
orientation="vertical"
|
56
56
|
>
|
57
57
|
<Timeline.Item
|
@@ -92,7 +92,7 @@ const TimelineWithGap = (props) => (
|
|
92
92
|
</FlexItem>
|
93
93
|
<FlexItem>
|
94
94
|
<Timeline
|
95
|
-
|
95
|
+
itemGap="md"
|
96
96
|
orientation="vertical"
|
97
97
|
>
|
98
98
|
<Timeline.Item
|
@@ -134,7 +134,7 @@ const TimelineWithGap = (props) => (
|
|
134
134
|
</FlexItem>
|
135
135
|
<FlexItem>
|
136
136
|
<Timeline
|
137
|
-
|
137
|
+
itemGap="lg"
|
138
138
|
orientation="vertical"
|
139
139
|
>
|
140
140
|
<Timeline.Item
|
@@ -1 +1 @@
|
|
1
|
-
Use the optional `
|
1
|
+
Use the optional `itemGap` prop to render the timeline kit with adjusted spacing between nodes. The `itemGap` prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing.
|
@@ -8,15 +8,15 @@ module Playbook
|
|
8
8
|
default: "horizontal"
|
9
9
|
prop :show_date, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
|
-
prop :
|
12
|
-
|
13
|
-
|
11
|
+
prop :item_gap, type: Playbook::Props::Enum,
|
12
|
+
values: %w[xs sm md lg none],
|
13
|
+
default: "none"
|
14
14
|
|
15
15
|
def classname
|
16
16
|
generate_classname("pb_timeline_kit",
|
17
17
|
orientation,
|
18
18
|
date_class,
|
19
|
-
|
19
|
+
item_gap_class)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -25,8 +25,8 @@ module Playbook
|
|
25
25
|
show_date ? "with_date" : nil
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
28
|
+
def item_gap_class
|
29
|
+
item_gap == "none" ? nil : "gap_#{item_gap}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
|
5
3
|
$color_checkbox_success: $data_1;
|
@@ -10,7 +8,7 @@ $transition: .2s ease-in-out;
|
|
10
8
|
[class^=pb_toggle_kit] {
|
11
9
|
position: relative;
|
12
10
|
$width: 44px;
|
13
|
-
$height:
|
11
|
+
$height: $width / 2;
|
14
12
|
$border_success: 3px solid $color_checkbox_success;
|
15
13
|
$border_default: 3px solid $color_checkbox_default;
|
16
14
|
|
@@ -29,7 +27,7 @@ $transition: .2s ease-in-out;
|
|
29
27
|
&:after {
|
30
28
|
transition: $transition;
|
31
29
|
content: "";
|
32
|
-
width:
|
30
|
+
width: $width / 2 - 4px;
|
33
31
|
height: $height - 4px;
|
34
32
|
background-color: $color_checkbox_default;
|
35
33
|
border-radius: 50%;
|
@@ -70,7 +68,7 @@ $transition: .2s ease-in-out;
|
|
70
68
|
background-color: $color_checkbox_success;
|
71
69
|
|
72
70
|
&:after {
|
73
|
-
left:
|
71
|
+
left: $width / 2 + 2px;
|
74
72
|
background-color: $white;
|
75
73
|
}
|
76
74
|
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
@import "spacing";
|
2
|
+
|
3
|
+
.gap_none {
|
4
|
+
gap: 0;
|
5
|
+
}
|
6
|
+
|
7
|
+
.gap_xxs {
|
8
|
+
gap: $space_xxs;
|
9
|
+
}
|
10
|
+
|
11
|
+
.gap_xs {
|
12
|
+
gap: $space_xs;
|
13
|
+
}
|
14
|
+
|
15
|
+
.gap_sm {
|
16
|
+
gap: $space_sm;
|
17
|
+
}
|
18
|
+
|
19
|
+
.gap_md {
|
20
|
+
gap: $space_md;
|
21
|
+
}
|
22
|
+
|
23
|
+
.gap_lg {
|
24
|
+
gap: $space_lg;
|
25
|
+
}
|
26
|
+
|
27
|
+
.gap_xl {
|
28
|
+
gap: $space_xl;
|
29
|
+
}
|
@@ -108,6 +108,10 @@ type MinWidth = {
|
|
108
108
|
minWidth?: string,
|
109
109
|
}
|
110
110
|
|
111
|
+
type Gap = {
|
112
|
+
gap?: string,
|
113
|
+
}
|
114
|
+
|
111
115
|
type NumberSpacing = {
|
112
116
|
numberSpacing?: "tabular",
|
113
117
|
}
|
@@ -196,7 +200,7 @@ type MinHeight = {
|
|
196
200
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
197
201
|
BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
198
202
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
199
|
-
LineHeight & Margin & Width & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
|
203
|
+
LineHeight & Margin & Width & MinWidth & MaxWidth & Gap & NumberSpacing & Order & Overflow & Padding &
|
200
204
|
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
|
201
205
|
|
202
206
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
@@ -372,6 +376,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
372
376
|
css += maxWidth ? `max_width_${filterClassName(maxWidth)} ` : ''
|
373
377
|
return css.trimEnd()
|
374
378
|
},
|
379
|
+
gapProps: ({ gap }: Gap) => {
|
380
|
+
let css = ''
|
381
|
+
css += gap ? `gap_${gap} ` : ''
|
382
|
+
return css.trimEnd()
|
383
|
+
},
|
375
384
|
minHeightProps: ({ minHeight }: MinHeight) => {
|
376
385
|
const heightValues = ["auto", "xs", "sm", "md", "lg", "xl", "xxl", "xxxl"]
|
377
386
|
if (heightValues.includes(minHeight)) {
|
@@ -530,15 +539,15 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
530
539
|
},
|
531
540
|
|
532
541
|
|
533
|
-
topProps: ({top}) => getPositioningPropsClasses('top', top),
|
542
|
+
topProps: ({top}) => getPositioningPropsClasses('top', top),
|
543
|
+
|
544
|
+
rightProps: ({right}) => getPositioningPropsClasses('right', right),
|
534
545
|
|
535
|
-
|
546
|
+
bottomProps:({bottom}) => getPositioningPropsClasses('bottom', bottom),
|
536
547
|
|
537
|
-
bottomProps:({bottom}) => getPositioningPropsClasses('bottom', bottom),
|
538
|
-
|
539
548
|
leftProps: ({left}) => getPositioningPropsClasses('left', left),
|
540
|
-
|
541
|
-
|
549
|
+
|
550
|
+
|
542
551
|
textAlignProps: ({ textAlign }: TextAlign) => {
|
543
552
|
if (typeof textAlign === 'object') {
|
544
553
|
return getResponsivePropClasses(textAlign, 'text_align')
|
@@ -558,7 +567,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
558
567
|
|
559
568
|
const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[key: string]: any}} = {
|
560
569
|
heightProps: ({ height }: Height) => {
|
561
|
-
return height ? { height } : {};
|
570
|
+
return height ? { height } : {};
|
562
571
|
},
|
563
572
|
|
564
573
|
maxHeightProps: ({ maxHeight }: MaxHeight) => {
|
@@ -566,7 +575,7 @@ const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[
|
|
566
575
|
},
|
567
576
|
|
568
577
|
minHeightProps: ({ minHeight }: MinHeight) => {
|
569
|
-
return minHeight ? { minHeight } : {};
|
578
|
+
return minHeight ? { minHeight } : {};
|
570
579
|
},
|
571
580
|
}
|
572
581
|
|