playbook_ui 14.15.0.pre.rc.2 → 14.15.0.pre.rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +11 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_overlay/index.js +61 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +5 -3
- data/app/pb_kits/playbook/pb_overlay/overlay.rb +9 -0
- data/app/pb_kits/playbook/pb_title/_title.scss +0 -35
- data/app/pb_kits/playbook/pb_title/_title.tsx +1 -10
- data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +2 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_title/title.rb +1 -10
- data/dist/chunks/{_typeahead-_d2af7Id.js → _typeahead-BGTMEmj7.js} +1 -1
- data/dist/chunks/{_weekday_stacked-BZe1DgW-.js → _weekday_stacked-De2TduOp.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -2
- 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/version.rb +1 -1
- metadata +7 -7
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +0 -7
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +0 -54
- data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68ebeb6b2f4b515c08bf2dd769eb60a513ef6cde846b288d0f10bab8803d7043
|
4
|
+
data.tar.gz: a76ce30f5f97d13c0034df663fcd7c04fcd3b6eb39a2c7cdb009e62ce2d346d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84af923e5d28d3ebe143c5559e1d3967d5e531adfd5cc1be67d2ed9008be88cc6ce211efc8e785f1f4725cfdba5ca3666f76c8bc6706b04141631d6e7e18c289
|
7
|
+
data.tar.gz: 75897a73b719c2bd7ee1581e6fce74ad0d0aea1e68d270cc74404e30612920f41c90a3bf620fab8cf5cc40d847345ccefff6b90ef222b6c0bc54d11477089efb
|
data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light", dynamic: true }) do %>
|
2
|
+
<%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
|
3
|
+
<% 15.times do %>
|
4
|
+
<%= pb_rails("flex/flex_item") do %>
|
5
|
+
<%= pb_rails("card") do %>
|
6
|
+
Card content
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import PbEnhancedElement from '../pb_enhanced_element'
|
2
|
+
|
3
|
+
const OVERLAY_SELECTOR = '[data-pb-overlay]'
|
4
|
+
const OVERLAY_SCROLL_ELEMENT = '[data-overlay-scroll-element]'
|
5
|
+
const PREVIOUS_OVERLAY_CLASSNAME = '[data-previous-overlay-classname]'
|
6
|
+
const SUBSEQUENT_OVERLAY_CLASSNAME = '[data-subsequent-overlay-classname]'
|
7
|
+
|
8
|
+
export default class PbOverlay extends PbEnhancedElement {
|
9
|
+
static get selector() {
|
10
|
+
return OVERLAY_SELECTOR
|
11
|
+
}
|
12
|
+
|
13
|
+
get target() {
|
14
|
+
return this.element.querySelector(OVERLAY_SCROLL_ELEMENT).children[0]
|
15
|
+
}
|
16
|
+
|
17
|
+
connect() {
|
18
|
+
this.handleOverlayDynamic()
|
19
|
+
}
|
20
|
+
|
21
|
+
handleOverlayDynamic() {
|
22
|
+
const isOverlayDynamic = this.element.dataset?.overlayDynamic
|
23
|
+
|
24
|
+
if (isOverlayDynamic) {
|
25
|
+
const previousOverlayElement = this.element.querySelector(PREVIOUS_OVERLAY_CLASSNAME)
|
26
|
+
const previousOverlayClassname = previousOverlayElement?.dataset?.previousOverlayClassname
|
27
|
+
const subsequentOverlayElement = this.element.querySelector(SUBSEQUENT_OVERLAY_CLASSNAME)
|
28
|
+
const subsequentOverlayClassname = subsequentOverlayElement?.dataset?.subsequentOverlayClassname
|
29
|
+
|
30
|
+
const handleScrollChange = (target) => {
|
31
|
+
const { scrollLeft, scrollWidth, clientWidth } = target
|
32
|
+
const isScrollAtStart = scrollLeft === 0
|
33
|
+
const isScrollAtEnd = scrollLeft + clientWidth >= scrollWidth - 1
|
34
|
+
|
35
|
+
if (isScrollAtStart) {
|
36
|
+
previousOverlayElement.classList.remove(previousOverlayClassname)
|
37
|
+
} else {
|
38
|
+
previousOverlayElement.classList.add(previousOverlayClassname)
|
39
|
+
}
|
40
|
+
|
41
|
+
if (isScrollAtEnd) {
|
42
|
+
subsequentOverlayElement.classList.remove(subsequentOverlayClassname)
|
43
|
+
} else {
|
44
|
+
subsequentOverlayElement.classList.add(subsequentOverlayClassname)
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
this.target.addEventListener('scroll', (event) => {
|
49
|
+
handleScrollChange(event.target)
|
50
|
+
})
|
51
|
+
|
52
|
+
handleScrollChange(this.target)
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
disconnect() {
|
57
|
+
if (this.element.dataset?.overlayDynamic) {
|
58
|
+
this.target.removeEventListener('scroll')
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
@@ -16,12 +16,14 @@ id: object.id,
|
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<% else %>
|
19
|
-
<div class="<%= previous_overlay_class_name %>"></div>
|
19
|
+
<div class="<%= previous_overlay_class_name %>" data-previous-overlay-classname="<%= previous_overlay_class_name %>"></div>
|
20
20
|
|
21
|
-
|
21
|
+
<div data-overlay-scroll-element="true">
|
22
|
+
<%= content.presence %>
|
23
|
+
</div>
|
22
24
|
|
23
25
|
<% if has_subsequent_overlay %>
|
24
|
-
<div class="<%= subsequent_overlay_class_name %>"></div>
|
26
|
+
<div class="<%= subsequent_overlay_class_name %>" data-subsequent-overlay-classname="<%= subsequent_overlay_class_name %>"></div>
|
25
27
|
<% end %>
|
26
28
|
<% end %>
|
27
29
|
<% end %>
|
@@ -8,6 +8,8 @@ module Playbook
|
|
8
8
|
default: "card_light"
|
9
9
|
prop :layout, type: Playbook::Props::HashProp,
|
10
10
|
default: { "bottom": "full" }
|
11
|
+
prop :dynamic, type: Playbook::Props::Boolean,
|
12
|
+
default: false
|
11
13
|
|
12
14
|
def classname
|
13
15
|
generate_classname("pb_overlay")
|
@@ -105,6 +107,13 @@ module Playbook
|
|
105
107
|
"bg_dark": "#0a0527",
|
106
108
|
}
|
107
109
|
end
|
110
|
+
|
111
|
+
def data_attributes
|
112
|
+
data ||= {}
|
113
|
+
data.merge!("data-pb-overlay" => true)
|
114
|
+
data.merge!("data-overlay-dynamic" => true) if dynamic
|
115
|
+
data
|
116
|
+
end
|
108
117
|
end
|
109
118
|
end
|
110
119
|
end
|
@@ -31,41 +31,6 @@
|
|
31
31
|
@include pb_title_thin;
|
32
32
|
}
|
33
33
|
|
34
|
-
&[class*=_display] {
|
35
|
-
font-size: clamp(
|
36
|
-
24px,
|
37
|
-
calc(24px + (128 - 24) * ((100vw - 320px) / (1920 - 320))),
|
38
|
-
128px
|
39
|
-
);
|
40
|
-
}
|
41
|
-
|
42
|
-
&[class*=_dynamic] {
|
43
|
-
&[class*=_xs] {
|
44
|
-
font-size: min(2vw, 5rem);
|
45
|
-
}
|
46
|
-
|
47
|
-
&[class*=_sm] {
|
48
|
-
font-size: min(2.5vw, 6rem);
|
49
|
-
}
|
50
|
-
|
51
|
-
&[class*=_md] {
|
52
|
-
font-size: min(4vw, 10rem);
|
53
|
-
}
|
54
|
-
|
55
|
-
&[class*=_lg] {
|
56
|
-
font-size: min(5vw, 12rem);
|
57
|
-
}
|
58
|
-
|
59
|
-
&[class*=_xl] {
|
60
|
-
font-size: min(6vw, 14rem);
|
61
|
-
}
|
62
|
-
|
63
|
-
&[class*=_xxl] {
|
64
|
-
font-size: min(8vw, 16rem);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
34
|
@each $size, $size_value in $breakpoints_grid {
|
70
35
|
@for $title_size_value from 1 through 4 {
|
71
36
|
$min_size: map-get($size_value, "min");
|
@@ -3,7 +3,7 @@ import classnames from 'classnames'
|
|
3
3
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
4
4
|
import { deprecatedProps, GlobalProps, globalProps } from '../utilities/globalProps'
|
5
5
|
|
6
|
-
type SizeType = 1 | 2 | 3 | 4 | "1" | "2" | "3" | "4"
|
6
|
+
type SizeType = 1 | 2 | 3 | 4 | "1" | "2" | "3" | "4"
|
7
7
|
type SizeResponsiveType = {[key: string]: SizeType}
|
8
8
|
|
9
9
|
type TitleProps = {
|
@@ -16,7 +16,6 @@ type TitleProps = {
|
|
16
16
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
size?: SizeType | SizeResponsiveType,
|
19
|
-
displaySize?: null | "xs" | "sm" | "md" | "lg" | "xl" | "xxl",
|
20
19
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span",
|
21
20
|
text?: string,
|
22
21
|
variant?: null | "link",
|
@@ -33,7 +32,6 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
33
32
|
htmlOptions = {},
|
34
33
|
id,
|
35
34
|
size = 3,
|
36
|
-
displaySize = null,
|
37
35
|
bold = true,
|
38
36
|
tag = 'h3',
|
39
37
|
text,
|
@@ -58,16 +56,9 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
58
56
|
return css.trim()
|
59
57
|
}
|
60
58
|
|
61
|
-
const buildDisplaySize = () => {
|
62
|
-
if (displaySize) {
|
63
|
-
return `pb_title_kit_dynamic_${displaySize}`
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
59
|
const classes = classnames(
|
68
60
|
buildCss('pb_title_kit', isSizeNumberOrString ? `size_${size}` : "", variant, color, getBold),
|
69
61
|
globalProps(props),
|
70
|
-
buildDisplaySize(),
|
71
62
|
buildResponsiveSizeCss(),
|
72
63
|
className
|
73
64
|
)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
<%= pb_rails("title", props: {
|
2
|
-
margin_bottom: "md"
|
3
2
|
}) do %>
|
4
3
|
Default Title
|
5
4
|
<% end %>
|
6
5
|
|
6
|
+
<br/>
|
7
|
+
|
7
8
|
<%= pb_rails("title", props: { text: "Title 1", tag: "h1", size: 1 }) %>
|
8
9
|
<%= pb_rails("title", props: { text: "Title 2", tag: "h2", size: 2 }) %>
|
9
10
|
<%= pb_rails("title", props: { text: "Title 3", tag: "h3", size: 3 }) %>
|
@@ -5,7 +5,6 @@ examples:
|
|
5
5
|
- title_colors: Colors
|
6
6
|
- title_responsive: Responsive
|
7
7
|
- title_truncate: Truncate
|
8
|
-
- title_display_size: Display Size
|
9
8
|
|
10
9
|
react:
|
11
10
|
- title_default: Default UI
|
@@ -13,4 +12,3 @@ examples:
|
|
13
12
|
- title_colors: Colors
|
14
13
|
- title_responsive: Responsive
|
15
14
|
- title_truncate: Truncate
|
16
|
-
- title_display_size: Display Size
|
@@ -3,4 +3,3 @@ export { default as TitleLightWeight } from './_title_light_weight.jsx'
|
|
3
3
|
export { default as TitleColors } from './_title_colors.jsx'
|
4
4
|
export { default as TitleResponsive } from './_title_responsive.jsx'
|
5
5
|
export { default as TitleTruncate } from './_title_truncate.jsx'
|
6
|
-
export { default as TitleDisplaySize } from './_title_display_size.jsx'
|
@@ -16,15 +16,12 @@ module Playbook
|
|
16
16
|
default: nil,
|
17
17
|
deprecated: true
|
18
18
|
prop :bold, type: Playbook::Props::Boolean, default: true
|
19
|
-
prop :display_size, type: Playbook::Props::Enum,
|
20
|
-
values: [nil, "xs", "sm", "md", "lg", "xl", "xxl"],
|
21
|
-
default: nil
|
22
19
|
|
23
20
|
def classname
|
24
21
|
if is_size_responsive
|
25
22
|
generate_classname("pb_title_kit", variant, color, is_bold) + generate_responsive_size_classname
|
26
23
|
else
|
27
|
-
generate_classname("pb_title_kit", size, variant, color, is_bold)
|
24
|
+
generate_classname("pb_title_kit", size, variant, color, is_bold)
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
@@ -32,12 +29,6 @@ module Playbook
|
|
32
29
|
bold ? nil : "thin"
|
33
30
|
end
|
34
31
|
|
35
|
-
def generate_display_size
|
36
|
-
return "" if display_size.nil?
|
37
|
-
|
38
|
-
" pb_title_kit_dynamic_#{display_size}"
|
39
|
-
end
|
40
|
-
|
41
32
|
def is_size_responsive
|
42
33
|
try(:size).is_a?(::Hash)
|
43
34
|
end
|