playbook_ui 14.17.0.pre.alpha.PLAY20547327 → 14.17.0.pre.alpha.alphaforaudiences7167

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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +3 -23
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -67
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +2 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +19 -29
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +128 -67
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -9
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -7
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -5
  16. data/app/pb_kits/playbook/pb_background/_background.scss +0 -26
  17. data/app/pb_kits/playbook/pb_background/_background.tsx +3 -5
  18. data/app/pb_kits/playbook/pb_background/background.test.js +0 -5
  19. data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
  20. data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
  21. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +45 -19
  22. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -1
  23. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -2
  24. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +20 -43
  25. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +105 -102
  26. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
  27. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +48 -50
  28. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
  29. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.jsx → _draggable_with_table_react.jsx} +1 -1
  30. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +1 -3
  31. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +6 -9
  32. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -4
  33. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +0 -68
  34. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +3 -4
  35. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
  36. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  37. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +3 -23
  38. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
  39. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +6 -39
  40. data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -70
  41. data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -29
  42. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +118 -322
  43. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
  44. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +43 -74
  45. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
  46. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -49
  47. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +4 -15
  48. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
  49. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  50. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -3
  51. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
  52. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  53. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +1 -3
  54. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +1 -3
  55. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -3
  56. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -3
  57. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
  58. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -2
  59. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  60. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +7 -19
  61. data/app/pb_kits/playbook/pb_table/table.rb +1 -13
  62. data/app/pb_kits/playbook/pb_table/table_header.rb +1 -13
  63. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
  64. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -2
  65. data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
  66. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
  67. data/dist/chunks/_typeahead-7W5Ha5Td.js +22 -0
  68. data/dist/chunks/_weekday_stacked-DSKatW3m.js +45 -0
  69. data/dist/chunks/lib-BGzBzFZX.js +29 -0
  70. data/dist/chunks/{pb_form_validation-Bx1OK6xs.js → pb_form_validation-BvNy9Bd6.js} +1 -1
  71. data/dist/chunks/vendor.js +1 -1
  72. data/dist/playbook-doc.js +1 -1
  73. data/dist/playbook-rails-react-bindings.js +1 -1
  74. data/dist/playbook-rails.js +1 -1
  75. data/dist/playbook.css +1 -1
  76. data/lib/playbook/version.rb +1 -1
  77. metadata +18 -49
  78. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +0 -66
  79. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +0 -10
  80. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
  81. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
  82. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
  83. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
  84. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
  85. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
  86. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
  87. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
  88. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
  89. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +0 -35
  90. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +0 -1
  91. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +0 -54
  92. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +0 -3
  93. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +0 -45
  94. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +0 -110
  95. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +0 -5
  96. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +0 -79
  97. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
  98. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
  99. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
  100. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
  101. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
  102. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
  103. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +0 -34
  104. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +0 -1
  105. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +0 -36
  106. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +0 -1
  107. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +0 -94
  108. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +0 -1
  109. data/dist/chunks/_typeahead-aRwivA3u.js +0 -22
  110. data/dist/chunks/_weekday_stacked-Bm5175-u.js +0 -45
  111. data/dist/chunks/lib-Cj4H6j1c.js +0 -29
  112. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_react.md → _draggable_default.md} +0 -0
  113. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.html.erb → _draggable_default_rails.html.erb} +0 -0
  114. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_react.md → _draggable_multiple_containers.md} +0 -0
  115. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.html.erb → _draggable_multiple_containers_rails.html.erb} +0 -0
  116. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_react.md → _draggable_with_cards.md} +0 -0
  117. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.html.erb → _draggable_with_cards_rails.html.erb} +0 -0
  118. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_react.md → _draggable_with_list.md} +0 -0
  119. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.html.erb → _draggable_with_list_rails.html.erb} +0 -0
  120. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_react.md → _draggable_with_selectable_list.md} +0 -0
  121. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.html.erb → _draggable_with_selectable_list_rails.html.erb} +0 -0
  122. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_rails.md → _draggable_with_table.md} +0 -0
@@ -1,7 +1,3 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `table_props` and giving the AdvancedTable a `max_height` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop.
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `table_props` and giving the AdvancedTable a `max_height` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `max_height` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
2
2
 
3
- **NOTE**: This behavior requires a `max_height` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
-
5
- Expand the table above to see this in action.
6
-
7
- A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table#sticky-header) doc example above.
3
+ A sticky header on a nonresponsive table is demonstrated in the ["Table Props"](https://playbook.powerapp.cloud/kits/advanced_table#table-props) doc example above.
@@ -1,7 +1,3 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop.
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/visual_guidelines/max_height) global prop. This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
2
2
 
3
- **NOTE**: This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
-
5
- Expand the table above to see this in action.
6
-
7
- A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#sticky-header) doc example above.
3
+ A sticky header on a nonresponsive table is demonstrated in the ["Table Props"](https://playbook.powerapp.cloud/kits/advanced_table/react#table-props) doc example above.
@@ -5,8 +5,7 @@ examples:
5
5
  - advanced_table_beta_subrow_headers: SubRow Headers
6
6
  - advanced_table_collapsible_trail_rails: Collapsible Trail
7
7
  - advanced_table_table_props: Table Props
8
- - advanced_table_sticky_header_rails: Sticky Header
9
- - advanced_table_table_props_sticky_header: Sticky Header for Responsive Table
8
+ - advanced_table_table_props_sticky_header: Table Props Sticky Header
10
9
  - advanced_table_beta_sort: Enable Sorting
11
10
  - advanced_table_responsive: Responsive Tables
12
11
  - advanced_table_custom_cell_rails: Custom Components for Cells
@@ -22,15 +21,11 @@ examples:
22
21
  - advanced_table_sort: Enable Sorting
23
22
  - advanced_table_sort_control: Sort Control
24
23
  - advanced_table_expanded_control: Expanded Control
25
- - advanced_table_expand_by_depth: Expand by Depth
26
24
  - advanced_table_subrow_headers: SubRow Headers
27
25
  - advanced_table_collapsible_trail: Collapsible Trail
28
26
  - advanced_table_table_options: Table Options
29
27
  - advanced_table_table_props: Table Props
30
- - advanced_table_sticky_header: Sticky Header
31
- - advanced_table_table_props_sticky_header: Sticky Header for Responsive Table
32
- - advanced_table_sticky_columns: Sticky Columns
33
- - advanced_table_sticky_columns_and_header: Sticky Columns with Sticky Header
28
+ - advanced_table_table_props_sticky_header: Table Props Sticky Header
34
29
  - advanced_table_inline_row_loading: Inline Row Loading
35
30
  - advanced_table_responsive: Responsive Tables
36
31
  - advanced_table_custom_cell: Custom Components for Cells
@@ -22,8 +22,4 @@ export { default as AdvancedTableSelectableRowsActions } from './_advanced_table
22
22
  export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_table_table_props_sticky_header.jsx'
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
24
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
25
- export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
26
- export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
27
- export { default as AdvancedTableStickyHeader } from './_advanced_table_sticky_header.jsx'
28
- export { default as AdvancedTableStickyColumnsAndHeader } from './_advanced_table_sticky_columns_and_header.jsx'
29
- export { default as AdvancedTableExpandByDepth } from './_advanced_table_expand_by_depth.jsx'
25
+ export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
@@ -55,30 +55,4 @@ $background_colors: map-merge($additional_colors, $merge_kits7);
55
55
  transition: 700ms ease-in;
56
56
  }
57
57
  }
58
-
59
- &[class*=imageoverlay] {
60
- position: relative;
61
-
62
- &:before {
63
- content: "";
64
- position: absolute;
65
- top: 0;
66
- left: 0;
67
- right: 0;
68
- bottom: 0;
69
- z-index: 1;
70
- background-color: inherit;
71
- }
72
-
73
- * {
74
- position: relative;
75
- z-index: 2;
76
- }
77
- }
78
-
79
- @each $key, $value in $opacity {
80
- &.imageoverlay_#{$key}::before {
81
- opacity: $value;
82
- }
83
- }
84
58
  }
@@ -25,7 +25,6 @@ type BackgroundProps = {
25
25
  backgroundPosition?: ResponsiveProp<string> | string,
26
26
  backgroundRepeat?: ResponsiveProp<BackgroundRepeat> | BackgroundRepeat,
27
27
  imageUrl?: ResponsiveProp<string> | string,
28
- imageOverlay?: 'opacity_1' | 'opacity_2' | 'opacity_3' | 'opacity_4' | 'opacity_5' | 'opacity_6' | 'opacity_7' | 'opacity_8' | 'opacity_9' | 'opacity_10',
29
28
  children?: React.ReactChild[] | React.ReactNode,
30
29
  className?: string,
31
30
  customColor?: string,
@@ -84,12 +83,11 @@ const Background = (props: BackgroundProps): React.ReactElement => {
84
83
  data = {},
85
84
  htmlOptions = {},
86
85
  id,
87
- imageOverlay,
88
86
  imageUrl = '',
89
87
  tag = 'div',
90
88
  transition = '',
91
89
  } = props
92
-
90
+
93
91
  const [responsiveProps, setResponsiveProps] = useState({
94
92
  backgroundSize: getResponsiveValue(backgroundSize),
95
93
  backgroundPosition: getResponsiveValue(backgroundPosition),
@@ -134,7 +132,6 @@ const Background = (props: BackgroundProps): React.ReactElement => {
134
132
  [`pb_background_color_${resBackgroundColor}`]: resBackgroundColor && !customColor,
135
133
  [`pb_background_custom_color`]: !!customColor,
136
134
  },
137
- imageOverlay ? `imageoverlay_${imageOverlay}` : "",
138
135
  className
139
136
  );
140
137
 
@@ -158,7 +155,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
158
155
  const ariaProps = buildAriaProps(aria);
159
156
  const dataProps = buildDataProps(data);
160
157
  const htmlProps = buildHtmlProps(htmlOptions);
161
-
158
+
162
159
  return (
163
160
  <Tag
164
161
  {...ariaProps}
@@ -171,6 +168,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
171
168
  >
172
169
  {children}
173
170
  </Tag>
171
+
174
172
  )
175
173
  }
176
174
 
@@ -37,8 +37,3 @@ test('backgroundSize = auto', () => {
37
37
  const kit = renderKit(Background, props, { classname: "background-image", imageUrl: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", backgroundSize: 'auto' })
38
38
  expect(kit).toHaveStyle('background-size: auto')
39
39
  })
40
-
41
- test('applies correct overlay class when imageOverlay prop is provided', () => {
42
- const kit = renderKit(Background, props, { imageOverlay: 'opacity_6' });
43
- expect(kit).toHaveClass('imageoverlay_opacity_6');
44
- });
@@ -19,4 +19,3 @@ examples:
19
19
  - background_status_subtle: Status Subtle
20
20
  - background_category: Category
21
21
  - background_size: Size
22
- - background_overlay: Overlay
@@ -6,4 +6,3 @@ export { default as BackgroundStatus } from './_background_status.jsx'
6
6
  export { default as BackgroundStatusSubtle } from './_background_status_subtle.jsx'
7
7
  export { default as BackgroundCategory } from './_background_category.jsx'
8
8
  export { default as BackgroundSize } from './_background_size.jsx'
9
- export { default as BackgroundOverlay } from './_background_overlay.jsx'
@@ -1,4 +1,5 @@
1
- import React from 'react'
1
+
2
+ import React, { useState } from 'react'
2
3
  import classnames from 'classnames'
3
4
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
5
  import { globalProps } from '../utilities/globalProps'
@@ -6,19 +7,16 @@ import { globalProps } from '../utilities/globalProps'
6
7
  import Button from '../pb_button/_button'
7
8
  import Tooltip from '../pb_tooltip/_tooltip'
8
9
 
9
- import usePBCopy from './usePBCopy'
10
-
11
10
  type CopyButtonProps = {
12
- aria?: { [key: string]: string }
13
- className?: string
14
- data?: { [key: string]: string }
15
- id?: string
16
- from?: string
17
- text?: string
18
- tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left'
19
- tooltipText?: string
20
- value?: string
21
- timeout?: number
11
+ aria?: { [key: string]: string },
12
+ className?: string,
13
+ data?: { [key: string]: string },
14
+ id?: string,
15
+ from?: string,
16
+ text?: string,
17
+ tooltipPlacement?: "top" | "right" | "bottom" | "left",
18
+ tooltipText?: string,
19
+ value?: string,
22
20
  }
23
21
 
24
22
  const CopyButton = (props: CopyButtonProps) => {
@@ -29,34 +27,62 @@ const CopyButton = (props: CopyButtonProps) => {
29
27
  from = '',
30
28
  id,
31
29
  text= 'Copy',
32
- timeout = 1000,
33
30
  tooltipPlacement= 'bottom',
34
31
  tooltipText = 'Copied!',
35
32
  value = '',
36
33
  } = props
37
34
 
38
- const [copied, copy] = usePBCopy({ value, from, timeout })
35
+ const [copied, setCopied] = useState(false)
39
36
 
40
37
  const ariaProps = buildAriaProps(aria)
41
38
  const dataProps = buildDataProps(data)
42
39
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
43
40
 
41
+ const copy = () => {
42
+ if (!from && !value) {
43
+ return
44
+ }
45
+
46
+ if (value) {
47
+ navigator.clipboard.writeText(value)
48
+ } else if (from) {
49
+ const copyElement = document.getElementById(from);
50
+ let copyText = copyElement?.innerText
51
+
52
+ if (copyElement instanceof HTMLTextAreaElement || copyElement instanceof HTMLInputElement) {
53
+ copyText = copyElement.value;
54
+ }
55
+
56
+ if (copyText) {
57
+ navigator.clipboard.writeText(copyText)
58
+ }
59
+ }
60
+
61
+ setCopied(true)
62
+
63
+ setTimeout(() => {
64
+ setCopied(false)
65
+ }, 1000);
66
+ }
67
+
44
68
  return (
45
- <div {...ariaProps}
69
+ <div
70
+ {...ariaProps}
46
71
  {...dataProps}
47
72
  className={classes}
48
73
  id={id}
49
74
  >
50
- <Tooltip
75
+ <Tooltip
51
76
  forceOpenTooltip={copied}
52
77
  placement={tooltipPlacement}
53
78
  showTooltip={false}
54
79
  text={tooltipText}
55
80
  >
56
- <Button icon="copy"
81
+ <Button
82
+ icon='copy'
57
83
  onClick={copy}
58
84
  >
59
- {text}
85
+ { text }
60
86
  </Button>
61
87
  </Tooltip>
62
88
  </div>
@@ -6,4 +6,3 @@ examples:
6
6
  react:
7
7
  - copy_button_default: Default
8
8
  - copy_button_from: Copy From
9
- - copy_button_hook: Copy Hook
@@ -1,3 +1,2 @@
1
1
  export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
- export { default as CopyButtonFrom } from './_copy_button_from.jsx'
3
- export { default as CopyButtonHook } from './_copy_button_hook.jsx'
2
+ export { default as CopyButtonFrom } from './_copy_button_from.jsx'
@@ -1,6 +1,5 @@
1
1
  @import "../tokens/colors";
2
2
  @import "../tokens/opacity";
3
- @import "../tokens/border_radius";
4
3
 
5
4
  .pb_draggable_container {
6
5
  .pb_draggable_item {
@@ -35,7 +34,7 @@
35
34
  width: 100%;
36
35
  height: 100%;
37
36
  border: 2px dashed $neutral;
38
- border-radius: $border_radius_sm;
37
+ border-radius: $border-radius-sm;
39
38
  box-sizing: border-box;
40
39
  z-index: 10;
41
40
  pointer-events: none;
@@ -65,7 +64,7 @@
65
64
  width: 100%;
66
65
  height: 100%;
67
66
  background-color: rgba($neutral, $opacity_5);
68
- border-radius: $border_radius_sm;
67
+ border-radius: $border-radius-sm;
69
68
  z-index: 10;
70
69
  pointer-events: none;
71
70
  }
@@ -74,70 +73,48 @@
74
73
  &.drop_zone_color_primary::before { background-color: rgba($primary, $opacity_5); }
75
74
  &.drop_zone_color_purple::before { background-color: rgba($purple, $opacity_5); }
76
75
  }
77
- }
78
- }
79
- // Line default - Vertical orientation (horizontal line for draggable items in vertical layout)
80
- &.line_vertical {
81
- .pb_draggable_item {
82
- position: relative;
76
+
77
+ // Line variant
83
78
  &.drop_zone_line {
84
- // Hide the original content to show the line only (held draggable item should not take up space in drop zone)
85
- position: relative;
86
- z-index: 2;
79
+ // Hide the original content to show the line
87
80
  & > * {
88
81
  opacity: 0;
89
82
  }
90
- height: 4px;
83
+
91
84
  // Style for horizontal line (default)
92
85
  &::before {
93
86
  content: '';
94
87
  position: absolute;
95
88
  left: 0;
96
89
  top: 0;
97
- width: 100%;
98
- height: 4px;
90
+ width: 4px;
91
+ height: 100%;
99
92
  background-color: $neutral;
100
- border-radius: $border_radius_rounded;
93
+ border-radius: 1000px;
101
94
  z-index: 10;
102
95
  pointer-events: none;
103
- transform: translateY(-50%);
104
96
  }
105
- // Apply color variants to the ::before element
97
+
98
+ // Apply color variants
106
99
  &.drop_zone_color_primary::before { background-color: $primary; }
107
100
  &.drop_zone_color_purple::before { background-color: $purple; }
108
101
  }
109
102
  }
110
103
  }
111
- // Line variant - Horizontal orientation (vertical line for draggable items in horizontal layout)
112
- &.line_horizontal {
113
- .pb_draggable_item {
114
- position: relative;
104
+ }
105
+
106
+ // Support for vertical layouts (horizontal line)
107
+ .pb_draggable_container.vertical {
108
+ .pb_draggable_item {
109
+ &.is_dragging {
110
+ // Line variant for vertical layouts (horizontal line)
115
111
  &.drop_zone_line {
116
- position: relative;
117
- z-index: 2;
118
- & > * {
119
- opacity: 0;
120
- }
121
- width: 4px;
122
- height: auto;
123
- // Style for vertical line
124
112
  &::before {
125
- content: '';
126
- position: absolute;
113
+ width: 100%;
114
+ height: 4px;
127
115
  left: 0;
128
116
  top: 0;
129
- width: 4px;
130
- height: 100%;
131
- background-color: $neutral;
132
- border-radius: $border_radius_rounded;
133
- z-index: 10;
134
- pointer-events: none;
135
- transform: translateX(-50%);
136
117
  }
137
-
138
- // Apply color variants to the ::before element
139
- &.drop_zone_color_primary::before { background-color: $primary; }
140
- &.drop_zone_color_purple::before { background-color: $purple; }
141
118
  }
142
119
  }
143
120
  }
@@ -60,120 +60,123 @@ const DraggableDropZones = (props) => {
60
60
 
61
61
  return (
62
62
  <>
63
- <Flex justify="between"
64
- {...props}
65
- >
66
- <FlexItem marginRight="xl">
67
- <DraggableProvider
68
- dropZone={{type: "shadow"}}
69
- initialItems={dataShadow}
70
- onReorder={(items) => setInitialShadowState(items)}
71
- >
72
- <Caption
63
+ <Flex justify="between"
64
+ {...props}
65
+ >
66
+ <FlexItem marginRight="xl">
67
+ <DraggableProvider
68
+ dropZone={{type: "shadow"}}
69
+ initialItems={dataShadow}
70
+ onReorder={(items) => setInitialShadowState(items)}
71
+ >
72
+ <Caption
73
+ marginBottom="xs"
74
+ textAlign="center"
75
+ >
76
+ {"Shadow"}
77
+ </Caption>
78
+ <Draggable.Container
79
+ htmlOptions={{style:{ width: "200px"}}}
80
+ {...props}
81
+ >
82
+ {initialShadowState.map(({ id, text }) => (
83
+ <Card dragId={id}
84
+ draggableItem
85
+ key={id}
73
86
  marginBottom="xs"
74
- text="Shadow"
75
- textAlign="center"
76
- />
77
- <Draggable.Container
78
- htmlOptions={{style:{ width: "200px"}}}
87
+ padding="xs"
79
88
  {...props}
80
89
  >
81
- {initialShadowState.map(({ id, text }) => (
82
- <Card dragId={id}
83
- draggableItem
84
- key={id}
85
- marginBottom="xs"
86
- padding="xs"
87
- {...props}
90
+ <Flex alignItems="stretch"
91
+ flexDirection="column"
88
92
  >
89
- <Flex alignItems="stretch"
90
- flexDirection="column"
91
- >
92
- <Body
93
- text={text}
94
- {...props}
95
- />
96
- </Flex>
97
- </Card>
98
- ))}
99
- </Draggable.Container>
100
- </DraggableProvider>
101
- </FlexItem>
102
- <FlexItem marginRight="xl">
103
- <DraggableProvider
104
- dropZone={{type: "outline"}}
105
- initialItems={dataOutline}
106
- onReorder={(items) => setInitialOutlineState(items)}
107
- >
108
- <Caption
93
+ <Body
94
+ text={text}
95
+ {...props}
96
+ />
97
+ </Flex>
98
+ </Card>
99
+ ))}
100
+ </Draggable.Container>
101
+ </DraggableProvider>
102
+ </FlexItem>
103
+ <FlexItem marginRight="xl">
104
+ <DraggableProvider
105
+ dropZone={{type: "outline"}}
106
+ initialItems={dataOutline}
107
+ onReorder={(items) => setInitialOutlineState(items)}
108
+ >
109
+ <Caption
110
+ marginBottom="xs"
111
+ textAlign="center"
112
+ >
113
+ {"Outline"}
114
+ </Caption>
115
+ <Draggable.Container
116
+ htmlOptions={{style:{ width: "200px"}}}
117
+ {...props}
118
+ >
119
+ {initialOutlineState.map(({ id, text }) => (
120
+ <Card
121
+ dragId={id}
122
+ draggableItem
123
+ key={id}
109
124
  marginBottom="xs"
110
- text="Outline"
111
- textAlign="center"
112
- />
113
- <Draggable.Container
114
- htmlOptions={{style:{ width: "200px"}}}
125
+ padding="xs"
115
126
  {...props}
116
127
  >
117
- {initialOutlineState.map(({ id, text }) => (
118
- <Card
119
- dragId={id}
120
- draggableItem
121
- key={id}
122
- marginBottom="xs"
123
- padding="xs"
124
- {...props}
128
+ <Flex
129
+ alignItems="stretch"
130
+ flexDirection="column"
125
131
  >
126
- <Flex
127
- alignItems="stretch"
128
- flexDirection="column"
129
- >
130
- <Body
131
- text={text}
132
- {...props}
133
- />
134
- </Flex>
135
- </Card>
136
- ))}
137
- </Draggable.Container>
138
- </DraggableProvider>
139
- </FlexItem>
140
- <FlexItem>
141
- <DraggableProvider
142
- dropZone={{type: "line"}}
143
- initialItems={dataLine}
144
- onReorder={(items) => setInitialLineState(items)}
145
- >
146
- <Caption
132
+ <Body
133
+ text={text}
134
+ {...props}
135
+ />
136
+ </Flex>
137
+ </Card>
138
+ ))}
139
+ </Draggable.Container>
140
+ </DraggableProvider>
141
+ </FlexItem>
142
+ <FlexItem>
143
+ <DraggableProvider
144
+ dropZone={{type: "line"}}
145
+ initialItems={dataLine}
146
+ onReorder={(items) => setInitialLineState(items)}
147
+ >
148
+ <Caption
149
+ marginBottom="xs"
150
+ textAlign="center"
151
+ >
152
+ {"Line"}
153
+ </Caption>
154
+ <Draggable.Container
155
+ htmlOptions={{style:{ width: "200px"}}}
156
+ {...props}
157
+ >
158
+ {initialLineState.map(({ id, text }) => (
159
+ <Card dragId={id}
160
+ draggableItem
161
+ key={id}
147
162
  marginBottom="xs"
148
- text="Line"
149
- textAlign="center"
150
- />
151
- <Draggable.Container
152
- htmlOptions={{style:{ width: "200px"}}}
163
+ padding="xs"
153
164
  {...props}
154
165
  >
155
- {initialLineState.map(({ id, text }) => (
156
- <Card dragId={id}
157
- draggableItem
158
- key={id}
159
- marginBottom="xs"
160
- padding="xs"
161
- {...props}
166
+ <Flex alignItems="stretch"
167
+ flexDirection="column"
162
168
  >
163
- <Flex alignItems="stretch"
164
- flexDirection="column"
165
- >
166
- <Body
167
- text={text}
168
- {...props}
169
- />
170
- </Flex>
171
- </Card>
172
- ))}
173
- </Draggable.Container>
174
- </DraggableProvider>
175
- </FlexItem>
176
- </Flex>
169
+ <Body
170
+ text={text}
171
+ {...props}
172
+ />
173
+ </Flex>
174
+ </Card>
175
+ ))}
176
+ </Draggable.Container>
177
+ </DraggableProvider>
178
+ </FlexItem>
179
+ </Flex>
177
180
  </>
178
181
  );
179
182
  };
@@ -1,5 +1,5 @@
1
- The Draggable kit lets you customize the style of drop zones that appear when dragging an item.
1
+ The Draggable kit allows you to choose the style of drop zones that appear when dragging an item.
2
2
 
3
- By default, drop zones are in the "ghost" style, but you can also choose from "shadow," "outline," and "line."
3
+ By default, the Draggable kit utilizes the "ghost" style for drop zones, but you can also choose between "shadow", "outline", and "line".
4
4
 
5
- When using the "line" type, make sure to set the appropriate `direction` attribute within the `dropZone` prop based on the orientation of your draggable view. By default, this is set to "vertical," but it can also be adjusted to "horizontal." Note that the direction attribute only applies to the "line" type and does not affect other drop zone styles. For more on the "line" style in particular, check out the [Draggable Drop Zones Line doc example](https://playbook.powerapp.cloud/kits/draggable/react#draggable-drop-zones-line).
5
+ Additionally, when using the "line" style, be sure to set the proper `direction` attribute within the `dropZone` prop depending on the orentation of your draggable view. By default, this attribute is set to "vertical", but can also be used with a "horizontal" direction. The `direction` attribute only applies to the "line" style and will not affect other drop zone styles.