playbook_ui 14.11.0.pre.rc.14 → 14.11.0.pre.rc.16
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_table/_table.tsx +8 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- 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/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-CWnbnW7m.js +45 -0
- 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
- data/dist/chunks/_weekday_stacked-KhE_lsdt.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f633dbdcb566f07aaee2a0db73f298f28aea93dc273c131deb2c116f99979dd5
|
4
|
+
data.tar.gz: 2cc38ae0603b11b9726761391f3224fe8c2040f24015bd7c38106e11039261fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43a49b42952c6ac029e4d51a6f20ea7edd230b9d9001e15be40de1bd7d00bbb0ee6332ced2b9c4c3ec1dee5ddaa97c356cde57a1e3d3e67a477e4a8a3a9d3b79
|
7
|
+
data.tar.gz: 724a6934873b86343459f05368b166d6d7c847fe2e1be8b4395958354303f515a5635a3c2d6bb106b620ad3e2f3f486a5eca3bd40fa34e54ab50fa86941a5a31
|
@@ -69,6 +69,7 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
69
69
|
const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
|
70
70
|
const isTableTag = tag === 'table'
|
71
71
|
const dynamicInlineProps = globalInlineProps(props)
|
72
|
+
const stickyRightColumnReversed = stickyRightColumn.reverse()
|
72
73
|
|
73
74
|
const classNames = classnames(
|
74
75
|
'pb_table',
|
@@ -148,7 +149,7 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
148
149
|
if (!stickyRightColumn.length) return;
|
149
150
|
let accumulatedWidth = 0;
|
150
151
|
|
151
|
-
|
152
|
+
stickyRightColumnReversed.forEach((colId, index) => {
|
152
153
|
const isLastColumn = index === stickyRightColumn.length - 1;
|
153
154
|
const header = document.querySelector(`th[id="${colId}"]`);
|
154
155
|
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
@@ -186,6 +187,12 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
186
187
|
setTimeout(() => {
|
187
188
|
handleStickyRightColumns();
|
188
189
|
}, 10);
|
190
|
+
|
191
|
+
window.addEventListener('resize', handleStickyRightColumns);
|
192
|
+
|
193
|
+
return () => {
|
194
|
+
window.removeEventListener('resize', handleStickyRightColumns);
|
195
|
+
};
|
189
196
|
}, [stickyRightColumn]);
|
190
197
|
|
191
198
|
useEffect(() => {
|
@@ -35,6 +35,8 @@ examples:
|
|
35
35
|
- table_lg: Large
|
36
36
|
- table_sticky: Sticky Header
|
37
37
|
- table_sticky_left_columns: Sticky Left Column
|
38
|
+
- table_sticky_right_columns: Sticky Right Column
|
39
|
+
- table_sticky_columns: Sticky Left and Right Columns
|
38
40
|
- table_alignment_row: Row Alignment
|
39
41
|
- table_alignment_column: Cell Alignment
|
40
42
|
- table_alignment_shift_row: Row Shift
|
@@ -26,6 +26,8 @@ export { default as TableWithSubcomponents } from './_table_with_subcomponents.j
|
|
26
26
|
export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
|
27
27
|
export { default as TableOuterPadding } from './_table_outer_padding.jsx'
|
28
28
|
export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'
|
29
|
+
export { default as TableStickyRightColumns } from './_table_sticky_right_columns.jsx'
|
30
|
+
export { default as TableStickyColumns } from './_table_sticky_columns.jsx'
|
29
31
|
export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
|
30
32
|
export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
|
31
33
|
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
@@ -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
|
@@ -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
|
|