playbook_ui 10.21.0.pre.alpha.lightbox.2 → 10.21.0.pre.alpha.na1
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 +0 -1
- data/app/pb_kits/playbook/data/menu.yml +0 -1
- data/app/pb_kits/playbook/index.js +1 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +0 -4
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -18
- data/app/pb_kits/playbook/pb_button/button.rb +3 -11
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +0 -3
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +10 -17
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -3
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -1
- data/app/pb_kits/playbook/pb_image/_image.jsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
- data/app/pb_kits/playbook/pb_image/image.rb +1 -1
- data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +0 -4
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -1
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +4 -2
- data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
- data/app/pb_kits/playbook/pb_popover/index.js +9 -4
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +0 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +2 -2
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -14
- data/app/pb_kits/playbook/playbook-doc.js +0 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +4 -8
- data/lib/playbook/version.rb +2 -2
- metadata +2 -27
- data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +0 -26
- data/app/pb_kits/playbook/pb_button/docs/_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -215
- data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +0 -40
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.jsx +0 -53
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.jsx +0 -53
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx +0 -38
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx +0 -78
- data/app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx +0 -58
- data/app/pb_kits/playbook/pb_lightbox/Carousel/useSlides.js +0 -66
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.jsx +0 -112
- data/app/pb_kits/playbook/pb_lightbox/_lightbox_context.jsx +0 -3
- data/app/pb_kits/playbook/pb_lightbox/_lightbox_header.jsx +0 -71
- data/app/pb_kits/playbook/pb_lightbox/_lightbox_header_icon.jsx +0 -26
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_compound_component.jsx +0 -95
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +0 -64
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +0 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +0 -64
- data/app/pb_kits/playbook/pb_lightbox/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_lightbox/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +0 -21
- data/app/pb_kits/playbook/pb_lightbox/hooks/useWindowSize.js +0 -25
- data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +0 -202
- data/app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c91379a8ff1fbd4421f2d351cfd11cd08cf5dac3b00d275e2b8312b64ab983a9
|
4
|
+
data.tar.gz: 80f1bcd2b434b6213116668028aadbce11ef28b54d5ab758aea3d87c00eee109
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10bd2dc160d0cc7ad0cfc921b20b0429611bb628b6203cfa75528bfa32c4a3bf2a57506f4922dbb8fdfc2e75df4e0698759d21312a9a78dac41b3c044a5eea6e
|
7
|
+
data.tar.gz: c372e8a2490809b8345cb99230a49cb3c2420bdeec256a05cad5d10688a16ca447b44cbc582ab5cebd1af8517f7a3fc0ed63fdc7f22c54316461930baff3161f
|
@@ -4,6 +4,7 @@ import 'lazysizes/plugins/attrchange/ls.attrchange'
|
|
4
4
|
import 'lazysizes'
|
5
5
|
|
6
6
|
// vvv React Component JSX Imports from the React Kits vvv
|
7
|
+
export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
|
7
8
|
export { default as Avatar } from './pb_avatar/_avatar'
|
8
9
|
export { default as AvatarActionButton } from './pb_avatar_action_button/_avatar_action_button'
|
9
10
|
export { default as Background } from './pb_background/_background'
|
@@ -54,7 +55,6 @@ export { default as Layout } from './pb_layout/_layout'
|
|
54
55
|
export { default as Legend } from './pb_legend/_legend'
|
55
56
|
export { default as LineGraph } from './pb_line_graph/_line_graph'
|
56
57
|
export { default as List } from './pb_list/_list'
|
57
|
-
export { default as Lightbox } from './pb_lightbox/_lightbox'
|
58
58
|
export { default as ListItem } from './pb_list/_list_item'
|
59
59
|
export { default as LoadingInline } from './pb_loading_inline/_loading_inline'
|
60
60
|
export { default as Message } from './pb_message/_message'
|
@@ -101,7 +101,6 @@ export { default as Toggle } from './pb_toggle/_toggle'
|
|
101
101
|
export { default as Typeahead } from './pb_typeahead/_typeahead'
|
102
102
|
export { default as User } from './pb_user/_user'
|
103
103
|
export { default as UserBadge } from './pb_user_badge/_user_badge'
|
104
|
-
export { default as Walkthrough } from './pb_walkthrough/_walkthrough'
|
105
104
|
export { default as WeekdayStacked } from './pb_weekday_stacked/_weekday_stacked'
|
106
105
|
// ^^^ React Component JSX Imports from the React Kits ^^^
|
107
106
|
|
@@ -8,7 +8,6 @@ import pbChart from '../plugins/pb_chart'
|
|
8
8
|
|
9
9
|
type BarGraphProps = {
|
10
10
|
axisTitle: string,
|
11
|
-
dark?: Boolean,
|
12
11
|
xAxisCategories: array,
|
13
12
|
yAxisMin: number,
|
14
13
|
yAxisMax: number,
|
@@ -31,7 +30,6 @@ type BarGraphProps = {
|
|
31
30
|
export default class BarGraph extends React.Component<BarGraphProps> {
|
32
31
|
static defaultProps = {
|
33
32
|
className: 'pb_bar_graph',
|
34
|
-
dark: false,
|
35
33
|
type: 'column',
|
36
34
|
legend: false,
|
37
35
|
toggleLegendClick: true,
|
@@ -40,7 +38,6 @@ export default class BarGraph extends React.Component<BarGraphProps> {
|
|
40
38
|
componentDidMount() {
|
41
39
|
const {
|
42
40
|
axisTitle,
|
43
|
-
dark,
|
44
41
|
xAxisCategories,
|
45
42
|
yAxisMin,
|
46
43
|
yAxisMax,
|
@@ -59,7 +56,6 @@ export default class BarGraph extends React.Component<BarGraphProps> {
|
|
59
56
|
|
60
57
|
new pbChart(`.${className}`, {
|
61
58
|
axisTitle: axisTitle,
|
62
|
-
dark,
|
63
59
|
chartData: chartData,
|
64
60
|
colors: colors,
|
65
61
|
id: id,
|
@@ -22,7 +22,7 @@ type ButtonPropTypes = {
|
|
22
22
|
loading?: boolean,
|
23
23
|
newWindow?: boolean,
|
24
24
|
onClick?: EventHandler,
|
25
|
-
size
|
25
|
+
size: 'large' | 'medium' | 'small',
|
26
26
|
text?: string,
|
27
27
|
type: 'inline' | null,
|
28
28
|
htmlType: string | 'button',
|
@@ -36,19 +36,19 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
36
36
|
disabled = false,
|
37
37
|
fullWidth = false,
|
38
38
|
loading = false,
|
39
|
+
size = null,
|
39
40
|
type = 'inline',
|
40
41
|
variant = 'primary',
|
41
|
-
size = null,
|
42
42
|
} = props
|
43
43
|
|
44
44
|
let className = 'pb_button_kit'
|
45
45
|
|
46
46
|
className += `${variant !== null ? `_${variant}` : ''}`
|
47
47
|
className += `${type !== null ? `_${type}` : ''}`
|
48
|
+
className += `${size !== null ? `_${size}` : ''}`
|
48
49
|
className += `${fullWidth ? '_block' : ''}`
|
49
50
|
className += disabled ? '_disabled' : '_enabled'
|
50
51
|
className += loading ? '_loading' : ''
|
51
|
-
className += `${size !== null ? ` size_${size}` : ''}`
|
52
52
|
|
53
53
|
return className
|
54
54
|
}
|
@@ -1,24 +1,7 @@
|
|
1
1
|
@import "./button_mixins";
|
2
2
|
|
3
|
-
|
4
|
-
"sm": 0.75rem,
|
5
|
-
"md": 0.875rem,
|
6
|
-
"lg": 1.125rem,
|
7
|
-
);
|
8
|
-
|
9
|
-
[class*=pb_button_kit]{
|
3
|
+
[class^=pb_button_kit]{
|
10
4
|
@include pb_button;
|
11
|
-
// Size =================
|
12
|
-
@each $name, $size in $pb_button_sizes {
|
13
|
-
&[class*=size_#{$name}] {
|
14
|
-
font-size: $size;
|
15
|
-
padding: calc(#{$size} / 2) calc(#{$size} * 2.42) !important;
|
16
|
-
}
|
17
|
-
@if $name == "sm" {
|
18
|
-
min-height: 0;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
22
5
|
// Variants =================
|
23
6
|
&[class*=_primary] {
|
24
7
|
@include pb_button_primary;
|
@@ -18,9 +18,6 @@ module Playbook
|
|
18
18
|
prop :text
|
19
19
|
prop :type
|
20
20
|
prop :value
|
21
|
-
prop :size, type: Playbook::Props::Enum,
|
22
|
-
values: ["sm", "md", "lg", nil],
|
23
|
-
default: nil
|
24
21
|
|
25
22
|
def options
|
26
23
|
{
|
@@ -47,13 +44,12 @@ module Playbook
|
|
47
44
|
link ? "a" : "button"
|
48
45
|
end
|
49
46
|
|
47
|
+
private
|
48
|
+
|
50
49
|
def classname
|
51
|
-
|
52
|
-
button_class + size_class
|
50
|
+
generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class)
|
53
51
|
end
|
54
52
|
|
55
|
-
private
|
56
|
-
|
57
53
|
def disabled_class
|
58
54
|
disabled ? "disabled" : "enabled"
|
59
55
|
end
|
@@ -65,10 +61,6 @@ module Playbook
|
|
65
61
|
def loading_class
|
66
62
|
loading ? "loading" : nil
|
67
63
|
end
|
68
|
-
|
69
|
-
def size_class
|
70
|
-
size ? " size_#{size}" : ""
|
71
|
-
end
|
72
64
|
end
|
73
65
|
end
|
74
66
|
end
|
@@ -89,16 +89,3 @@ test('click event', async () => {
|
|
89
89
|
|
90
90
|
expect(screen.getByText('clicked button!')).toBeInTheDocument()
|
91
91
|
})
|
92
|
-
|
93
|
-
test('size prop', () => {
|
94
|
-
render(
|
95
|
-
<Button
|
96
|
-
data={{ testid: 'size-test' }}
|
97
|
-
size="sm"
|
98
|
-
/>
|
99
|
-
)
|
100
|
-
|
101
|
-
const kit = screen.getByTestId('size-test')
|
102
|
-
|
103
|
-
expect(kit).toHaveClass('pb_button_kit_primary_inline_enabled size_sm')
|
104
|
-
})
|
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- button_block_content: Button Block Content
|
8
8
|
- button_accessibility: Button Accessibility Options
|
9
9
|
- button_options: Button Additional Options
|
10
|
-
- button_size: Button Size
|
11
10
|
react:
|
12
11
|
- button_default: Button Variants
|
13
12
|
- button_full_width: Button Full Width
|
@@ -16,4 +15,3 @@ examples:
|
|
16
15
|
- button_block_content: Button Block Content
|
17
16
|
- button_accessibility: Button Accessibility Options
|
18
17
|
- button_options: Button Additional Options (onClick)
|
19
|
-
- button_size: Button Size
|
@@ -5,4 +5,3 @@ export { default as ButtonLoading } from './_button_loading.jsx'
|
|
5
5
|
export { default as ButtonBlockContent } from './_button_block_content.jsx'
|
6
6
|
export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
7
7
|
export { default as ButtonOptions } from './_button_options.jsx'
|
8
|
-
export { default as ButtonSize } from './_button_size.jsx'
|
@@ -14,7 +14,6 @@ type CircleChartProps = {
|
|
14
14
|
children: Node,
|
15
15
|
className?: string,
|
16
16
|
colors: array,
|
17
|
-
dark?: Boolean,
|
18
17
|
data?: Object,
|
19
18
|
dataLabelHtml: string,
|
20
19
|
dataLabels: boolean,
|
@@ -41,7 +40,6 @@ const CircleChart = (props: CircleChartProps) => {
|
|
41
40
|
children,
|
42
41
|
className,
|
43
42
|
colors = [],
|
44
|
-
dark = false,
|
45
43
|
data = {},
|
46
44
|
dataLabelHtml = '<div>{point.name}</div>',
|
47
45
|
dataLabels = false,
|
@@ -83,7 +81,6 @@ const CircleChart = (props: CircleChartProps) => {
|
|
83
81
|
borderColor: roundedBorderColor,
|
84
82
|
borderWidth: roundedBorderWidth,
|
85
83
|
chartData: formattedChartData,
|
86
|
-
dark,
|
87
84
|
title,
|
88
85
|
type: style,
|
89
86
|
showInLegend: legend,
|
@@ -4,7 +4,7 @@ import React, { useCallback } from 'react'
|
|
4
4
|
import { useDropzone } from 'react-dropzone'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
|
7
|
-
import { buildCss,
|
7
|
+
import { buildCss, noop } from '../utilities/props'
|
8
8
|
import { globalProps } from '../utilities/globalProps'
|
9
9
|
import type { Callback } from '../types'
|
10
10
|
|
@@ -14,17 +14,15 @@ import Card from '../pb_card/_card'
|
|
14
14
|
type FileUploadProps = {
|
15
15
|
accept?: array<string>,
|
16
16
|
className?: string,
|
17
|
-
data?: object,
|
18
17
|
acceptedFilesDescription?: string,
|
19
18
|
onFilesAccepted: Callback,
|
20
19
|
}
|
21
20
|
|
22
21
|
const FileUpload = (props: FileUploadProps) => {
|
23
22
|
const {
|
24
|
-
accept =
|
23
|
+
accept = ['*'],
|
25
24
|
acceptedFilesDescription = '',
|
26
25
|
className,
|
27
|
-
data = {},
|
28
26
|
onFilesAccepted = noop,
|
29
27
|
} = props
|
30
28
|
const onDrop = useCallback((files) => {
|
@@ -36,22 +34,17 @@ const FileUpload = (props: FileUploadProps) => {
|
|
36
34
|
onDrop,
|
37
35
|
})
|
38
36
|
|
39
|
-
const acceptedFileTypes = () => {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
})
|
47
|
-
}
|
48
|
-
|
49
|
-
const dataProps = buildDataProps(data)
|
37
|
+
const acceptedFileTypes = accept.map((fileType) => {
|
38
|
+
if (fileType.startsWith('image/')) {
|
39
|
+
return fileType.replace('image/', ' ')
|
40
|
+
} else {
|
41
|
+
return fileType
|
42
|
+
}
|
43
|
+
})
|
50
44
|
|
51
45
|
return (
|
52
46
|
<div
|
53
47
|
className={classnames(buildCss('pb_file_upload_kit'), globalProps(props), className)}
|
54
|
-
{...dataProps}
|
55
48
|
{...getRootProps()}
|
56
49
|
>
|
57
50
|
<Card>
|
@@ -60,7 +53,7 @@ const FileUpload = (props: FileUploadProps) => {
|
|
60
53
|
<If condition={isDragActive}>
|
61
54
|
<p>{'Drop the files here ...'}</p>
|
62
55
|
<Else />
|
63
|
-
<p>{
|
56
|
+
<p>{`Choose a file or drag it here. The accepted file types are: ${acceptedFilesDescription || acceptedFileTypes}`}</p>
|
64
57
|
</If>
|
65
58
|
</Body>
|
66
59
|
</Card>
|
@@ -12,7 +12,6 @@ type GaugeProps = {
|
|
12
12
|
aria: Object,
|
13
13
|
className?: string,
|
14
14
|
chartData?: array,
|
15
|
-
dark?: Boolean,
|
16
15
|
data?: Object,
|
17
16
|
disableAnimation: boolean,
|
18
17
|
fullCircle: boolean,
|
@@ -34,7 +33,6 @@ const Gauge = (props: GaugeProps) => {
|
|
34
33
|
aria = {},
|
35
34
|
className,
|
36
35
|
chartData = [{ name: 'Name', value: 0 }],
|
37
|
-
dark = false,
|
38
36
|
data = {},
|
39
37
|
disableAnimation = false,
|
40
38
|
fullCircle = false,
|
@@ -69,7 +67,6 @@ const Gauge = (props: GaugeProps) => {
|
|
69
67
|
id: id,
|
70
68
|
chartData: formattedChartData,
|
71
69
|
circumference: fullCircle ? [0, 360] : [-100, 100],
|
72
|
-
dark,
|
73
70
|
disableAnimation: disableAnimation,
|
74
71
|
height: height,
|
75
72
|
min: min,
|
@@ -14,7 +14,7 @@ $image-sizes: (
|
|
14
14
|
object-fit: cover;
|
15
15
|
|
16
16
|
@each $name, $size in $image-sizes {
|
17
|
-
&[class*=
|
17
|
+
&[class*=_#{$name}] {
|
18
18
|
width: $size;
|
19
19
|
height: $size;
|
20
20
|
object-fit: cover;
|
@@ -35,7 +35,7 @@ $image-sizes: (
|
|
35
35
|
transition: opacity 300ms ease-in;
|
36
36
|
}
|
37
37
|
}
|
38
|
-
|
38
|
+
|
39
39
|
&.blur {
|
40
40
|
filter: blur(5px);
|
41
41
|
&.lazyloaded {
|
@@ -44,7 +44,7 @@ $image-sizes: (
|
|
44
44
|
transition: filter 300ms ease-in;
|
45
45
|
}
|
46
46
|
}
|
47
|
-
|
47
|
+
|
48
48
|
&.scale {
|
49
49
|
opacity: 0;
|
50
50
|
transform: scale(0.9);
|
@@ -26,7 +26,7 @@ test('default classname', () => {
|
|
26
26
|
|
27
27
|
test('size = xs', () => {
|
28
28
|
const kit = renderKit(Image, props, { size: 'xs' })
|
29
|
-
expect(kit).toHaveClass('
|
29
|
+
expect(kit).toHaveClass('pb_image_kit_xs lazyload')
|
30
30
|
})
|
31
31
|
|
32
32
|
test('transition = blur', () => {
|
@@ -8,7 +8,6 @@ import pbChart from '../plugins/pb_chart'
|
|
8
8
|
|
9
9
|
type LineGraphProps = {
|
10
10
|
axisTitle?: string,
|
11
|
-
dark?: Boolean,
|
12
11
|
xAxisCategories: array,
|
13
12
|
yAxisMin: number,
|
14
13
|
yAxisMax: number,
|
@@ -32,7 +31,6 @@ type LineGraphProps = {
|
|
32
31
|
export default class LineGraph extends React.Component<LineGraphProps> {
|
33
32
|
static defaultProps = {
|
34
33
|
className: 'pb_bar_graph',
|
35
|
-
dark: false,
|
36
34
|
gradient: false,
|
37
35
|
type: 'line',
|
38
36
|
legend: false,
|
@@ -42,7 +40,6 @@ export default class LineGraph extends React.Component<LineGraphProps> {
|
|
42
40
|
componentDidMount() {
|
43
41
|
const {
|
44
42
|
axisTitle,
|
45
|
-
dark,
|
46
43
|
xAxisCategories,
|
47
44
|
yAxisMin,
|
48
45
|
yAxisMax,
|
@@ -63,7 +60,6 @@ export default class LineGraph extends React.Component<LineGraphProps> {
|
|
63
60
|
axisTitle: axisTitle,
|
64
61
|
chartData: chartData,
|
65
62
|
colors: colors,
|
66
|
-
dark,
|
67
63
|
id: id,
|
68
64
|
pointStart: pointStart,
|
69
65
|
subtitle: subTitle,
|
@@ -150,14 +150,16 @@ export default class PbReactPopover extends React.Component<PbPopoverProps> {
|
|
150
150
|
const targetIsReference =
|
151
151
|
target.closest('.pb_popover_reference_wrapper') !== null
|
152
152
|
|
153
|
+
if (targetIsReference) return
|
154
|
+
|
153
155
|
switch (closeOnClick) {
|
154
156
|
case 'outside':
|
155
|
-
if (!targetIsPopover
|
157
|
+
if (!targetIsPopover) {
|
156
158
|
shouldClosePopover(true)
|
157
159
|
}
|
158
160
|
break
|
159
161
|
case 'inside':
|
160
|
-
if (targetIsPopover
|
162
|
+
if (targetIsPopover) {
|
161
163
|
shouldClosePopover(true)
|
162
164
|
}
|
163
165
|
break
|
@@ -1,23 +1,23 @@
|
|
1
1
|
<%= pb_rails("flex", props: {classname: "flex-container", spacing: "between"}) do %>
|
2
2
|
<span>
|
3
|
-
<%= pb_rails("button", props: { text: "Click Inside", variant: "secondary", id:
|
3
|
+
<%= pb_rails("button", props: { text: "Click Inside", variant: "secondary", id: 'inside-popover-1' }) %>
|
4
4
|
<%= pb_rails("popover", props: {
|
5
5
|
close_on_click: "inside",
|
6
6
|
trigger_element_id: "inside-popover-1",
|
7
7
|
tooltip_id: "inside-tooltip-1",
|
8
|
-
position:
|
8
|
+
position: 'bottom',
|
9
9
|
offset: true
|
10
10
|
}) do %>
|
11
11
|
Click on me!
|
12
12
|
<% end %>
|
13
13
|
</span>
|
14
14
|
<span>
|
15
|
-
<%= pb_rails("button", props: { text: "Click Outside", variant: "secondary", id:
|
15
|
+
<%= pb_rails("button", props: { text: "Click Outside", variant: "secondary", id: 'outside-popover-1' }) %>
|
16
16
|
<%= pb_rails("popover", props: {
|
17
17
|
close_on_click: "outside",
|
18
18
|
trigger_element_id: "outside-popover-1",
|
19
19
|
tooltip_id: "outside-tooltip-1",
|
20
|
-
position:
|
20
|
+
position: 'left',
|
21
21
|
offset: true
|
22
22
|
}) do %>
|
23
23
|
Click anywhere but me!
|
@@ -27,16 +27,16 @@
|
|
27
27
|
<%= pb_rails("button", props: {
|
28
28
|
text: "Click Anywhere",
|
29
29
|
variant: "secondary",
|
30
|
-
id:
|
30
|
+
id: 'any-popover-1'
|
31
31
|
}) %>
|
32
32
|
<%= pb_rails("popover", props: {
|
33
33
|
close_on_click: "any",
|
34
34
|
trigger_element_id: "any-popover-1",
|
35
35
|
tooltip_id: "any-tooltip-1",
|
36
|
-
position:
|
36
|
+
position: 'top',
|
37
37
|
offset: true
|
38
38
|
}) do %>
|
39
39
|
Click anything!
|
40
40
|
<% end %>
|
41
41
|
</span>
|
42
|
-
<% end %>
|
42
|
+
<% end %>
|
@@ -36,14 +36,15 @@ export default class PbPopover extends PbEnhancedElement {
|
|
36
36
|
}
|
37
37
|
|
38
38
|
setTimeout(() => {
|
39
|
-
this.toggleTooltip()
|
40
39
|
this.popper.update()
|
40
|
+
this.toggleTooltip()
|
41
41
|
}, 0)
|
42
42
|
})
|
43
43
|
}
|
44
44
|
|
45
45
|
checkCloseTooltip() {
|
46
46
|
document.querySelector('body').addEventListener('click', ({ target }) => {
|
47
|
+
const isTriggerElement = target.closest(`#${this.triggerElementId}`) !== null
|
47
48
|
const isTooltipElement = target.closest(`#${this.tooltipId}`) !== null
|
48
49
|
|
49
50
|
switch (this.closeOnClick) {
|
@@ -51,17 +52,21 @@ export default class PbPopover extends PbEnhancedElement {
|
|
51
52
|
this.hideTooltip()
|
52
53
|
break
|
53
54
|
case 'outside':
|
54
|
-
if (
|
55
|
+
if (isTooltipElement) {
|
56
|
+
this.checkCloseTooltip()
|
57
|
+
} else {
|
55
58
|
this.hideTooltip()
|
56
59
|
}
|
57
60
|
break
|
58
61
|
case 'inside':
|
59
|
-
if (isTooltipElement) {
|
62
|
+
if (isTooltipElement || isTriggerElement) {
|
60
63
|
this.hideTooltip()
|
64
|
+
} else {
|
65
|
+
this.checkCloseTooltip()
|
61
66
|
}
|
62
67
|
break
|
63
68
|
}
|
64
|
-
}, true)
|
69
|
+
}, { once: true })
|
65
70
|
}
|
66
71
|
|
67
72
|
hideTooltip() {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
class: object.classname,
|
4
4
|
data: object.data,
|
5
5
|
id: object.id) do %>
|
6
|
-
<div class="pb_popover_tooltip
|
6
|
+
<div class="pb_popover_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
|
7
7
|
<div class="pb_popover_body <%= object.width_height_class_helper %> <%= object.popover_spacing_helper %>" style="<%= object.width_height_helper %>">
|
8
8
|
<%= content.presence %>
|
9
9
|
</div>
|
@@ -129,10 +129,6 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
129
129
|
trixRef.current.addEventListener('click', handleClick)
|
130
130
|
}, [])
|
131
131
|
|
132
|
-
useEffect(() => {
|
133
|
-
trixRef.current.editor.loadHTML(value)
|
134
|
-
}, [value])
|
135
|
-
|
136
132
|
const RichTextEditorClass = 'pb_rich_text_editor_kit'
|
137
133
|
const SimpleClass = simple ? 'simple' : ''
|
138
134
|
const FocusClass = focus ? 'focus-editor-targets' : ''
|
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
[class^=pb_text_input_kit] {
|
7
|
-
margin-bottom: $space_sm;
|
8
7
|
.pb_text_input_kit_label {
|
9
8
|
margin-bottom: $space_xs;
|
10
9
|
display: block;
|
11
10
|
}
|
12
11
|
.text_input_wrapper {
|
12
|
+
margin-bottom: $space_sm;
|
13
13
|
display: block;
|
14
14
|
input::placeholder,
|
15
15
|
.text_input .placeholder {
|
@@ -169,7 +169,7 @@
|
|
169
169
|
&-card {
|
170
170
|
height: 45px;
|
171
171
|
margin: 0;
|
172
|
-
padding: 0;
|
172
|
+
padding: 0 !important;
|
173
173
|
align-items: center;
|
174
174
|
justify-content: center;
|
175
175
|
width: 45px;
|
@@ -75,17 +75,3 @@ test('returns additional class name', () => {
|
|
75
75
|
const kit = screen.getByTestId(testId)
|
76
76
|
expect(kit).toHaveClass(`${kitClass} dark error`)
|
77
77
|
})
|
78
|
-
|
79
|
-
test('returns additional class name', () => {
|
80
|
-
render(
|
81
|
-
<TextInput
|
82
|
-
data={{ testid: testId }}
|
83
|
-
label="First Name"
|
84
|
-
marginBottom="lg"
|
85
|
-
placeholder="Enter first name"
|
86
|
-
/>
|
87
|
-
)
|
88
|
-
|
89
|
-
const kit = screen.getByTestId(testId)
|
90
|
-
expect(kit).toHaveClass(`${kitClass} mb_lg`)
|
91
|
-
})
|
@@ -51,7 +51,6 @@ import * as LabelPill from 'pb_label_pill/docs'
|
|
51
51
|
import * as LabelValue from 'pb_label_value/docs'
|
52
52
|
import * as Layout from 'pb_layout/docs'
|
53
53
|
import * as LegendDocs from 'pb_legend/docs'
|
54
|
-
import * as Lightbox from 'pb_lightbox/docs'
|
55
54
|
import * as LineGraphDocs from 'pb_line_graph/docs'
|
56
55
|
import * as List from 'pb_list/docs'
|
57
56
|
import * as LoadingInline from 'pb_loading_inline/docs'
|
@@ -146,7 +145,6 @@ WebpackerReact.setup({
|
|
146
145
|
...LabelValue,
|
147
146
|
...Layout,
|
148
147
|
...LegendDocs,
|
149
|
-
...Lightbox,
|
150
148
|
...LineGraphDocs,
|
151
149
|
...List,
|
152
150
|
...LoadingInline,
|