playbook_ui 14.17.0 → 14.18.0.pre.alpha.PLAY20787400

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 (189) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +23 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +67 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +1 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +29 -19
  6. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +67 -128
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +9 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +66 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +10 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +58 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +6 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +64 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +8 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +55 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +3 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +33 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +3 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -2
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +6 -2
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +6 -2
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +7 -2
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +5 -1
  26. data/app/pb_kits/playbook/pb_advanced_table/index.js +7 -0
  27. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +97 -0
  28. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  29. data/app/pb_kits/playbook/pb_background/_background.scss +26 -0
  30. data/app/pb_kits/playbook/pb_background/_background.tsx +5 -3
  31. data/app/pb_kits/playbook/pb_background/background.test.js +5 -0
  32. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +35 -0
  33. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
  34. data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
  35. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  36. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  37. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
  38. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +53 -0
  39. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
  40. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
  41. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
  42. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
  43. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
  44. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
  45. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
  46. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
  47. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
  48. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
  49. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
  50. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
  51. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
  52. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
  53. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
  54. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
  55. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
  56. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +39 -1
  57. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +4 -0
  58. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +9 -1
  59. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +14 -0
  60. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
  61. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
  62. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
  63. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
  64. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  65. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +19 -45
  66. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +54 -0
  67. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +3 -0
  68. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
  69. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
  70. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +2 -0
  71. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -1
  72. data/app/pb_kits/playbook/pb_copy_button/index.js +46 -20
  73. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +45 -0
  74. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +12 -0
  75. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
  76. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +50 -1
  77. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
  78. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  79. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
  80. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
  81. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
  82. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
  83. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
  84. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  85. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  86. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +10 -0
  87. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +10 -1
  88. data/app/pb_kits/playbook/pb_dialog/dialog.rb +2 -0
  89. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
  90. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
  91. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  92. data/app/pb_kits/playbook/pb_dialog/index.js +106 -14
  93. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +43 -20
  94. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +102 -105
  95. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
  96. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +50 -48
  97. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
  98. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +110 -0
  99. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
  100. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +42 -0
  101. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +1 -0
  102. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
  103. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
  104. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +10 -6
  105. data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
  106. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +68 -0
  107. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -3
  108. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
  109. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  110. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +23 -3
  111. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +15 -5
  112. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +39 -6
  113. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
  114. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
  115. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
  116. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  117. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +85 -0
  118. data/app/pb_kits/playbook/pb_layout/_layout.scss +70 -1
  119. data/app/pb_kits/playbook/pb_layout/_layout.tsx +29 -2
  120. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +322 -118
  121. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
  122. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +74 -43
  123. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +79 -0
  124. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +21 -4
  125. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +83 -22
  126. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +39 -7
  127. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +63 -0
  128. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +3 -0
  129. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +1 -7
  130. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
  131. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
  132. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
  133. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
  134. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +39 -0
  135. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +1 -0
  136. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +40 -0
  137. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +5 -0
  138. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +5 -0
  139. data/app/pb_kits/playbook/pb_overlay/docs/index.js +5 -0
  140. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +39 -1
  141. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  142. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -1
  143. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -1
  144. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +3 -1
  145. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +3 -1
  146. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +34 -0
  147. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +1 -0
  148. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +36 -0
  149. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +1 -0
  150. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
  151. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  152. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  153. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +19 -7
  154. data/app/pb_kits/playbook/pb_table/table.rb +13 -1
  155. data/app/pb_kits/playbook/pb_table/table_header.rb +13 -1
  156. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +13 -5
  157. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +94 -0
  158. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +1 -0
  159. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
  160. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  161. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +8 -1
  162. data/dist/chunks/_typeahead-BX8IifKY.js +22 -0
  163. data/dist/chunks/_weekday_stacked-DfMD7HJz.js +45 -0
  164. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  165. data/dist/chunks/lib-96_ZmvAo.js +29 -0
  166. data/dist/chunks/{pb_form_validation-BiHyZedy.js → pb_form_validation-Vv2TqXVC.js} +1 -1
  167. data/dist/chunks/vendor.js +1 -1
  168. data/dist/menu.yml +2 -2
  169. data/dist/playbook-doc.js +19 -1
  170. data/dist/playbook-rails-react-bindings.js +1 -1
  171. data/dist/playbook-rails.js +1 -1
  172. data/dist/playbook.css +1 -1
  173. data/lib/playbook/version.rb +2 -2
  174. metadata +73 -19
  175. data/dist/chunks/_typeahead-CPM091Hj.js +0 -22
  176. data/dist/chunks/_weekday_stacked-BzIANIYX.js +0 -45
  177. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  178. data/dist/chunks/lib-Bg2KFzpz.js +0 -29
  179. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
  180. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
  181. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
  182. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
  183. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
  184. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
  185. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
  186. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
  187. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
  188. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
  189. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import Background from "../../pb_background/_background"
3
+ import Flex from "../../pb_flex/_flex"
4
+ import FlexItem from "../../pb_flex/_flex_item"
5
+ import Title from "../../pb_title/_title"
6
+
7
+ const BackgroundOverlay = (props) => {
8
+ return (
9
+ <Background
10
+ alt="colorful background"
11
+ backgroundColor="category_21"
12
+ className="background lazyload"
13
+ imageOverlay="opacity_2"
14
+ imageUrl="https://unsplash.it/500/400/?image=633"
15
+ {...props}
16
+ >
17
+ <Flex
18
+ orientation="column"
19
+ vertical="center"
20
+ {...props}
21
+ >
22
+ <FlexItem>
23
+ <Title
24
+ dark
25
+ padding="lg"
26
+ size={1}
27
+ text="Background Kit Image"
28
+ />
29
+ </FlexItem>
30
+ </Flex>
31
+ </Background>
32
+ )
33
+ }
34
+
35
+ export default BackgroundOverlay
@@ -0,0 +1 @@
1
+ An overlay can be added to the background image by setting the `imageOverlay` prop and adding a `backgroundColor`. The `imageOverlay` prop can be set to any opacity ranging from `opacity_1` to `opacity_10`.
@@ -19,3 +19,4 @@ examples:
19
19
  - background_status_subtle: Status Subtle
20
20
  - background_category: Category
21
21
  - background_size: Size
22
+ - background_overlay: Overlay
@@ -6,3 +6,4 @@ 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'
@@ -10,7 +10,7 @@ import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
10
10
  import mapColors from "../pb_dashboard/pbChartsColorsHelper";
11
11
  import { globalProps } from "../utilities/globalProps";
12
12
  import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
13
- import { merge } from '../utilities/object'
13
+ import { merge } from '../utilities/object'
14
14
 
15
15
  type CircleChartProps = {
16
16
  align?: "left" | "right" | "center";
@@ -28,7 +28,7 @@ test('uses exact classname', () => {
28
28
  value: 49,
29
29
  },
30
30
  {
31
- name: 'After call',
31
+ name: 'After Call',
32
32
  value: 10,
33
33
  },
34
34
  ]
@@ -39,7 +39,7 @@ test('uses exact classname', () => {
39
39
  id='circlechartid'
40
40
  />
41
41
  );
42
-
42
+
43
43
  const kit = screen.getByTestId(testId);
44
44
  expect(kit).toHaveClass('pb_circle_chart');
45
45
  });
@@ -0,0 +1,53 @@
1
+ import colors from '../tokens/exports/_colors.module.scss'
2
+ import typography from '../tokens/exports/_typography.module.scss'
3
+
4
+ const circleChartTheme = {
5
+ title: { text: "" },
6
+ chart: {
7
+ type: "pie",
8
+ },
9
+ tooltip: {
10
+ backgroundColor: {
11
+ linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
12
+ stops: [
13
+ [0, colors.bg_dark],
14
+ [1, colors.bg_dark],
15
+ ],
16
+ },
17
+ pointFormat:
18
+ '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
19
+ "<b>{point.y}</b>",
20
+ followPointer: true,
21
+ shadow: false,
22
+ borderWidth: 0,
23
+ borderRadius: 10,
24
+ style: {
25
+ fontFamily: typography.font_family_base,
26
+ color: colors.text_dk_default,
27
+ fontWeight: typography.regular,
28
+ fontSize: typography.text_smaller,
29
+ },
30
+ },
31
+ plotOptions: {
32
+ pie: {
33
+ dataLabels: {
34
+ enabled: false,
35
+ },
36
+ innerSize: '50%',
37
+ borderColor: "",
38
+ borderWidth: null as number | null,
39
+ colors: [
40
+ colors.data_1,
41
+ colors.data_2,
42
+ colors.data_3,
43
+ colors.data_4,
44
+ colors.data_5,
45
+ colors.data_6,
46
+ colors.data_7,
47
+ ],
48
+ },
49
+ },
50
+ credits: { enabled: false }
51
+ }
52
+
53
+ export default circleChartTheme;
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -18,7 +18,7 @@
18
18
  chart_data: data_51,
19
19
  id: "with-a-block-2",
20
20
  rounded: true,
21
- }) do %>
21
+ }) do %>
22
22
  <%= pb_rails('title', props: {text: "83", size: 1, tag: 'div'}) %>
23
23
  <% end %>
24
24
 
@@ -13,7 +13,7 @@ const dataWithABlock = [
13
13
  value: 49,
14
14
  },
15
15
  {
16
- name: 'After call',
16
+ name: 'After Call',
17
17
  value: 10,
18
18
  },
19
19
  ]
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -12,7 +12,7 @@ const dataWithColors = [
12
12
  value: 49,
13
13
  },
14
14
  {
15
- name: 'After call',
15
+ name: 'After Call',
16
16
  value: 10,
17
17
  },
18
18
  ]
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -12,7 +12,7 @@ const data = [
12
12
  value: 49,
13
13
  },
14
14
  {
15
- name: 'After call',
15
+ name: 'After Call',
16
16
  value: 10,
17
17
  },
18
18
  ]
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -12,7 +12,7 @@ const data = [
12
12
  value: 49,
13
13
  },
14
14
  {
15
- name: 'After call',
15
+ name: 'After Call',
16
16
  value: 10,
17
17
  },
18
18
  ]
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -14,7 +14,7 @@ const data = [
14
14
  value: 49,
15
15
  },
16
16
  {
17
- name: 'After call',
17
+ name: 'After Call',
18
18
  value: 10,
19
19
  },
20
20
  ]
@@ -14,7 +14,7 @@ const CircleChartLiveData = (props) => {
14
14
  value: 49,
15
15
  },
16
16
  {
17
- name: 'After call',
17
+ name: 'After Call',
18
18
  value: 10,
19
19
  },
20
20
  ])
@@ -29,7 +29,7 @@ const CircleChartLiveData = (props) => {
29
29
  value: 12,
30
30
  },
31
31
  {
32
- name: 'After call',
32
+ name: 'After Call',
33
33
  value: 140,
34
34
  },
35
35
  ]
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import circleChartTheme from '../circleChartTheme'
3
+ import Highcharts from "highcharts"
4
+ import HighchartsReact from "highcharts-react-official"
5
+
6
+ const data = [
7
+ {
8
+ name: 'Waiting for Calls',
9
+ y: 41,
10
+ },
11
+ {
12
+ name: 'On Call',
13
+ y: 49,
14
+ },
15
+ {
16
+ name: 'After Call',
17
+ y: 10,
18
+ },
19
+ ]
20
+
21
+ const baseOptions = {
22
+ series: [{ data: data }],
23
+ }
24
+
25
+ const CircleChartPbStyles = () => {
26
+ const options = Highcharts.merge({}, circleChartTheme, baseOptions )
27
+
28
+ return (
29
+ <div>
30
+ <HighchartsReact
31
+ highcharts={Highcharts}
32
+ options={options}
33
+ />
34
+ </div>
35
+ );
36
+ };
37
+
38
+ export default CircleChartPbStyles;
@@ -0,0 +1 @@
1
+ You don't need to use the Circle Chart Kit to apply Playbook styles to your Highcharts circle chart. Just import circleChartTheme.ts and merge it with your chart options—Playbook’s styling will apply automatically.
@@ -7,7 +7,7 @@
7
7
  value: 49,
8
8
  },
9
9
  {
10
- name: 'After call',
10
+ name: 'After Call',
11
11
  value: 10,
12
12
  }
13
13
  ] %>
@@ -12,7 +12,7 @@ const dataRounded = [
12
12
  value: 49,
13
13
  },
14
14
  {
15
- name: 'After call',
15
+ name: 'After Call',
16
16
  value: 10,
17
17
  },
18
18
  ]
@@ -14,6 +14,7 @@ examples:
14
14
 
15
15
  react:
16
16
  - circle_chart_default: Default Style
17
+ - circle_chart_pb_styles: Playbook Styles
17
18
  - circle_chart_live_data: Live Data
18
19
  - circle_chart_rounded: Rounded Corners
19
20
  - circle_chart_block: Accepts Any Block
@@ -22,7 +23,5 @@ examples:
22
23
  - circle_chart_with_legend_kit: Legend
23
24
  - circle_chart_legend_position: Legend Position
24
25
  - circle_chart_with_title: Title
25
- - circle_chart_inner_sizes: Inner Circle Size Options
26
+ - circle_chart_inner_sizes: Inner Circle Size Options
26
27
  - circle_chart_custom_tooltip: Tooltip Customization
27
-
28
-
@@ -8,4 +8,5 @@ export { default as CircleChartWithLegendKit } from './_circle_chart_with_legend
8
8
  export { default as CircleChartLegendPosition } from './_circle_chart_legend_position.jsx'
9
9
  export { default as CircleChartWithTitle } from './_circle_chart_with_title.jsx'
10
10
  export { default as CircleChartInnerSizes } from './_circle_chart_inner_sizes.jsx'
11
- export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
11
+ export { default as CircleChartCustomTooltip } from "./_circle_chart_custom_tooltip.jsx"
12
+ export { default as CircleChartPbStyles } from "./_circle_chart_pb_styles.jsx"
@@ -53,4 +53,42 @@ $pb_button_styles: (
53
53
  }
54
54
  }
55
55
  }
56
- }
56
+ &.size_small {
57
+ @each $style in $pb_button_styles {
58
+ [class^=pb_button_kit][class*=_#{$style}] {
59
+ width: 20px;
60
+ height: 20px;
61
+ min-height: 20px;
62
+ border-radius: 10px;
63
+ line-height: 20px;
64
+ flex-basis: 20px;
65
+ min-width: 20px;
66
+ padding: 0;
67
+ }
68
+ }
69
+ // centering small icon svg
70
+ .pb_button_content {
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ // rails
75
+ svg.pb_custom_icon {
76
+ height: 14px;
77
+ width: 14px;
78
+ vertical-align: middle;
79
+ }
80
+ // react (nested within an additional span)
81
+ > span {
82
+ display: flex;
83
+ align-items: center;
84
+ justify-content: center;
85
+ > svg.pb_custom_icon {
86
+ height: 14px;
87
+ width: 14px;
88
+ vertical-align: middle;
89
+ display: inline-block;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -22,6 +22,7 @@ type CircleIconButtonProps = {
22
22
  type?: 'button' | 'submit' | 'reset' | undefined,
23
23
  target?: string
24
24
  variant?: 'primary' | 'secondary' | 'link',
25
+ size?: 'default' | 'sm',
25
26
  }
26
27
 
27
28
  const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
@@ -41,13 +42,16 @@ const CircleIconButton = (props: CircleIconButtonProps): React.ReactElement => {
41
42
  link,
42
43
  newWindow,
43
44
  variant,
45
+ size = 'default',
44
46
  } = props
45
47
 
46
48
  const ariaProps = buildAriaProps(aria)
47
49
  const dataProps = buildDataProps(data)
48
50
  const htmlProps = buildHtmlProps(htmlOptions)
51
+ const sizeClass = size === 'sm' ? 'size_small' : ''
49
52
  const classes = classnames(
50
53
  buildCss('pb_circle_icon_button_kit'),
54
+ sizeClass,
51
55
  globalProps(props),
52
56
  className
53
57
  )
@@ -18,8 +18,16 @@ module Playbook
18
18
  prop :new_window, type: Playbook::Props::Boolean,
19
19
  default: false
20
20
  prop :target
21
+ prop :size, type: Playbook::Props::Enum,
22
+ values: %w[default sm],
23
+ default: "default"
24
+
21
25
  def classname
22
- generate_classname("pb_circle_icon_button_kit")
26
+ generate_classname("pb_circle_icon_button_kit") + size_class
27
+ end
28
+
29
+ def size_class
30
+ size == "sm" ? " size_small" : ""
23
31
  end
24
32
  end
25
33
  end
@@ -30,3 +30,17 @@ test('passes loading prop to button', () => {
30
30
 
31
31
  expect(button).toBeInTheDocument()
32
32
  })
33
+
34
+ test('adds size_small class when size is sm', () => {
35
+ render(
36
+ <CircleIconButton
37
+ data={{ testid: 'small-size-test' }}
38
+ icon="plus"
39
+ size="sm"
40
+ />
41
+ )
42
+
43
+ const kit = screen.getByTestId('small-size-test')
44
+
45
+ expect(kit).toHaveClass('pb_circle_icon_button_kit size_small')
46
+ })
@@ -0,0 +1,28 @@
1
+ <%= pb_rails("flex", props: { orientation: "column", gap: "sm" }) do %>
2
+ <%= pb_rails("circle_icon_button", props: {
3
+ icon: "plus",
4
+ size: "sm",
5
+ variant: "primary"
6
+ }) %>
7
+
8
+ <%= pb_rails("circle_icon_button", props: {
9
+ icon: "pen",
10
+ loading: true,
11
+ size: "sm",
12
+ variant: "secondary"
13
+ }) %>
14
+
15
+ <%= pb_rails("circle_icon_button", props: {
16
+ disabled: true,
17
+ icon: "times",
18
+ size: "sm"
19
+ }) %>
20
+
21
+ <%= pb_rails("circle_icon_button", props: {
22
+ icon: "info",
23
+ link: "https://playbook.powerapp.cloud/",
24
+ size: "sm",
25
+ target: "child",
26
+ variant: "link"
27
+ }) %>
28
+ <% end %>
@@ -0,0 +1,42 @@
1
+ import React from 'react'
2
+
3
+ import CircleIconButton from '../_circle_icon_button'
4
+ import Flex from '../../pb_flex/_flex'
5
+
6
+ const CircleIconButtonSize = (props) => (
7
+ <>
8
+ <Flex gap="sm"
9
+ orientation="column"
10
+ >
11
+ <CircleIconButton
12
+ icon="plus"
13
+ size="sm"
14
+ variant="primary"
15
+ {...props}
16
+ />
17
+ <CircleIconButton
18
+ icon="pen"
19
+ loading
20
+ size="sm"
21
+ variant="secondary"
22
+ {...props}
23
+ />
24
+ <CircleIconButton
25
+ disabled
26
+ icon="times"
27
+ size="sm"
28
+ {...props}
29
+ />
30
+ <CircleIconButton
31
+ icon="info"
32
+ link="https://playbook.powerapp.cloud/"
33
+ size="sm"
34
+ target="child"
35
+ variant="link"
36
+ {...props}
37
+ />
38
+ </Flex>
39
+ </>
40
+ )
41
+
42
+ export default CircleIconButtonSize
@@ -0,0 +1 @@
1
+ The `size` prop accepts "sm" as a value to make the Circle Icon Button 20px x 20px instead of the default 40px x 40px size.
@@ -4,9 +4,11 @@ examples:
4
4
  - circle_icon_button_default: Default
5
5
  - circle_icon_button_link: Link
6
6
  - circle_icon_button_loading: Loading
7
+ - circle_icon_button_size: Size
7
8
 
8
9
  react:
9
10
  - circle_icon_button_default: Default
10
11
  - circle_icon_button_click: Click Handler
11
12
  - circle_icon_button_link: Link
12
13
  - circle_icon_button_loading: Loading
14
+ - circle_icon_button_size: Size
@@ -2,3 +2,4 @@ export { default as CircleIconButtonDefault } from './_circle_icon_button_defaul
2
2
  export { default as CircleIconButtonClick } from './_circle_icon_button_click.jsx'
3
3
  export { default as CircleIconButtonLink } from './_circle_icon_button_link.jsx'
4
4
  export { default as CircleIconButtonLoading } from './_circle_icon_button_loading.jsx'
5
+ export { default as CircleIconButtonSize } from './_circle_icon_button_size.jsx'
@@ -1,5 +1,4 @@
1
-
2
- import React, { useState } from 'react'
1
+ import React from 'react'
3
2
  import classnames from 'classnames'
4
3
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
4
  import { globalProps } from '../utilities/globalProps'
@@ -7,16 +6,19 @@ import { globalProps } from '../utilities/globalProps'
7
6
  import Button from '../pb_button/_button'
8
7
  import Tooltip from '../pb_tooltip/_tooltip'
9
8
 
9
+ import usePBCopy from './usePBCopy'
10
+
10
11
  type CopyButtonProps = {
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,
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
20
22
  }
21
23
 
22
24
  const CopyButton = (props: CopyButtonProps) => {
@@ -27,62 +29,34 @@ const CopyButton = (props: CopyButtonProps) => {
27
29
  from = '',
28
30
  id,
29
31
  text= 'Copy',
32
+ timeout = 1000,
30
33
  tooltipPlacement= 'bottom',
31
34
  tooltipText = 'Copied!',
32
35
  value = '',
33
36
  } = props
34
37
 
35
- const [copied, setCopied] = useState(false)
38
+ const [copied, copy] = usePBCopy({ value, from, timeout })
36
39
 
37
40
  const ariaProps = buildAriaProps(aria)
38
41
  const dataProps = buildDataProps(data)
39
42
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
40
43
 
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
-
68
44
  return (
69
- <div
70
- {...ariaProps}
45
+ <div {...ariaProps}
71
46
  {...dataProps}
72
47
  className={classes}
73
48
  id={id}
74
49
  >
75
- <Tooltip
50
+ <Tooltip
76
51
  forceOpenTooltip={copied}
77
52
  placement={tooltipPlacement}
78
53
  showTooltip={false}
79
54
  text={tooltipText}
80
55
  >
81
- <Button
82
- icon='copy'
56
+ <Button icon="copy"
83
57
  onClick={copy}
84
58
  >
85
- { text }
59
+ {text}
86
60
  </Button>
87
61
  </Tooltip>
88
62
  </div>