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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/data/menu.yml +0 -1
  4. data/app/pb_kits/playbook/index.js +1 -2
  5. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +0 -4
  6. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -1
  7. data/app/pb_kits/playbook/pb_button/_button.jsx +3 -3
  8. data/app/pb_kits/playbook/pb_button/_button.scss +1 -18
  9. data/app/pb_kits/playbook/pb_button/button.rb +3 -11
  10. data/app/pb_kits/playbook/pb_button/button.test.js +0 -13
  11. data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
  12. data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
  13. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +0 -3
  14. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -1
  15. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +10 -17
  16. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +0 -3
  17. data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -1
  18. data/app/pb_kits/playbook/pb_image/_image.jsx +1 -1
  19. data/app/pb_kits/playbook/pb_image/_image.scss +3 -3
  20. data/app/pb_kits/playbook/pb_image/image.rb +1 -1
  21. data/app/pb_kits/playbook/pb_image/image.test.js +1 -1
  22. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +0 -4
  23. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -1
  24. data/app/pb_kits/playbook/pb_popover/_popover.jsx +4 -2
  25. data/app/pb_kits/playbook/pb_popover/docs/_popover_close.html.erb +7 -7
  26. data/app/pb_kits/playbook/pb_popover/index.js +9 -4
  27. data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -1
  28. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +0 -4
  29. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +2 -2
  30. data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -14
  31. data/app/pb_kits/playbook/playbook-doc.js +0 -2
  32. data/app/pb_kits/playbook/plugins/pb_chart.js +4 -8
  33. data/lib/playbook/version.rb +2 -2
  34. metadata +2 -27
  35. data/app/pb_kits/playbook/pb_button/docs/_button_size.html.erb +0 -3
  36. data/app/pb_kits/playbook/pb_button/docs/_button_size.jsx +0 -26
  37. data/app/pb_kits/playbook/pb_button/docs/_button_size.md +0 -1
  38. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +0 -215
  39. data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +0 -40
  40. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.jsx +0 -53
  41. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.jsx +0 -53
  42. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx +0 -38
  43. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx +0 -78
  44. data/app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx +0 -58
  45. data/app/pb_kits/playbook/pb_lightbox/Carousel/useSlides.js +0 -66
  46. data/app/pb_kits/playbook/pb_lightbox/_lightbox.jsx +0 -112
  47. data/app/pb_kits/playbook/pb_lightbox/_lightbox_context.jsx +0 -3
  48. data/app/pb_kits/playbook/pb_lightbox/_lightbox_header.jsx +0 -71
  49. data/app/pb_kits/playbook/pb_lightbox/_lightbox_header_icon.jsx +0 -26
  50. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_compound_component.jsx +0 -95
  51. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +0 -64
  52. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +0 -1
  53. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +0 -64
  54. data/app/pb_kits/playbook/pb_lightbox/docs/example.yml +0 -7
  55. data/app/pb_kits/playbook/pb_lightbox/docs/index.js +0 -3
  56. data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +0 -21
  57. data/app/pb_kits/playbook/pb_lightbox/hooks/useWindowSize.js +0 -25
  58. data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +0 -202
  59. 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: d8de309283f70eb32584fd45cd9c8c1d86eb4379dd3268b32c04961a3c1eb78c
4
- data.tar.gz: 5d658516cec5f8eae57b9a5c04375524b9f03bb091171941a30776390130418c
3
+ metadata.gz: c91379a8ff1fbd4421f2d351cfd11cd08cf5dac3b00d275e2b8312b64ab983a9
4
+ data.tar.gz: 80f1bcd2b434b6213116668028aadbce11ef28b54d5ab758aea3d87c00eee109
5
5
  SHA512:
6
- metadata.gz: 4ed16f1d8e6ab09e07dfc3f397700e4f41e90716ad91b61dbc33cc31615325a399affdcfb39448b7f5550784c4706ebeac6dfe1b0e4679a8bdd7207d956effaa
7
- data.tar.gz: 634bc7cdb80465bb4c226a3b8f8f938380d57c44be6d94e0605c3ba3b357724d251c6a014e766b2173d35c2a22cac965637f953a5864f63ecd73eb466b6614b2
6
+ metadata.gz: 10bd2dc160d0cc7ad0cfc921b20b0429611bb628b6203cfa75528bfa32c4a3bf2a57506f4922dbb8fdfc2e75df4e0698759d21312a9a78dac41b3c044a5eea6e
7
+ data.tar.gz: c372e8a2490809b8345cb99230a49cb3c2420bdeec256a05cad5d10688a16ca447b44cbc582ab5cebd1af8517f7a3fc0ed63fdc7f22c54316461930baff3161f
@@ -47,7 +47,6 @@
47
47
  @import 'pb_label_value/label_value';
48
48
  @import 'pb_layout/layout';
49
49
  @import 'pb_legend/legend';
50
- @import 'pb_lightbox/lightbox';
51
50
  @import 'pb_line_graph/line_graph';
52
51
  @import 'pb_list/list';
53
52
  @import 'pb_loading_inline/loading_inline';
@@ -51,7 +51,6 @@ kits:
51
51
  - layouts:
52
52
  - flex
53
53
  - layout
54
- - lightbox
55
54
  - list
56
55
  - loading_inline
57
56
  - nav
@@ -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,
@@ -33,7 +33,6 @@ module Playbook
33
33
  id: id,
34
34
  className: classname,
35
35
  chartData: chart_data,
36
- dark: dark ? "dark" : "",
37
36
  type: chart_type,
38
37
  title: title,
39
38
  subtitle: subtitle,
@@ -22,7 +22,7 @@ type ButtonPropTypes = {
22
22
  loading?: boolean,
23
23
  newWindow?: boolean,
24
24
  onClick?: EventHandler,
25
- size?: 'sm' | 'md' | 'lg',
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
- $pb_button_sizes: (
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
- button_class = generate_classname("pb_button_kit", variant, full_width_class, disabled_class, loading_class)
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,
@@ -69,7 +69,6 @@ module Playbook
69
69
  borderColor: rounded_border_color,
70
70
  borderWidth: rounded_border_width,
71
71
  chartData: chart_data_formatted,
72
- dark: dark ? "dark" : "",
73
72
  title: title,
74
73
  height: height,
75
74
  type: chart_type,
@@ -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, buildDataProps, noop } from '../utilities/props'
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 = null,
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
- return accept.map((fileType) => {
41
- if (fileType.startsWith('image/')) {
42
- return fileType.replace('image/', ' ')
43
- } else {
44
- return fileType
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>{accept === null ? 'Choose a file or drag it here' : `Choose a file or drag it here. The accepted file types are: ${acceptedFilesDescription || acceptedFileTypes()}`}</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,
@@ -32,7 +32,6 @@ module Playbook
32
32
  id: id,
33
33
  chartData: chart_data_formatted,
34
34
  circumference: full_circle ? [0, 360] : [-100, 100],
35
- dark: dark ? "dark" : "",
36
35
  disableAnimation: disable_animation,
37
36
  height: height,
38
37
  min: min,
@@ -34,7 +34,7 @@ const Image = (props: ImageProps) => {
34
34
 
35
35
  const ariaProps = buildAriaProps(aria)
36
36
  const classes = classnames(
37
- buildCss('pb_image_kit', size ? `size_${size}` : null),
37
+ buildCss('pb_image_kit', size),
38
38
  'lazyload',
39
39
  transition,
40
40
  { rounded },
@@ -14,7 +14,7 @@ $image-sizes: (
14
14
  object-fit: cover;
15
15
 
16
16
  @each $name, $size in $image-sizes {
17
- &[class*=size_#{$name}] {
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);
@@ -27,7 +27,7 @@ module Playbook
27
27
  end
28
28
 
29
29
  def size_class
30
- size == "none" ? nil : "_size_#{size}"
30
+ size == "none" ? nil : "_#{size}"
31
31
  end
32
32
 
33
33
  def transition_class
@@ -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('pb_image_kit_size_xs lazyload')
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,
@@ -32,7 +32,6 @@ module Playbook
32
32
  id: id,
33
33
  className: classname,
34
34
  chartData: chart_data,
35
- dark: dark ? "dark" : "",
36
35
  type: chart_type,
37
36
  title: title,
38
37
  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 || targetIsReference) {
157
+ if (!targetIsPopover) {
156
158
  shouldClosePopover(true)
157
159
  }
158
160
  break
159
161
  case 'inside':
160
- if (targetIsPopover || targetIsReference) {
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: "inside-popover-1" }) %>
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: "bottom",
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: "outside-popover-1" }) %>
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: "left",
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: "any-popover-1"
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: "top",
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 (!isTooltipElement) {
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 hide" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.z_index_helper %>">
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,