playbook_ui 15.4.0.pre.rc.4 → 15.5.0.pre.alpha.draggablefix12557

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 (200) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +2 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +3 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +3 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +2 -1
  8. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +21 -8
  9. data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +6 -2
  10. data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +3 -0
  11. data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +24 -0
  12. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.html.erb +9 -0
  13. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.jsx +24 -0
  14. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_rails.md +1 -0
  15. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_react.md +1 -0
  16. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -2
  17. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +1 -2
  18. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +2 -2
  19. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +2 -0
  20. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +2 -0
  21. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -0
  22. data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +1 -0
  23. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +1 -0
  24. data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +1 -0
  25. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +10 -0
  26. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +10 -0
  27. data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +1 -0
  28. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +1 -0
  29. data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +1 -0
  30. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +7 -0
  31. data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +7 -0
  32. data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
  33. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +25 -11
  34. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +44 -3
  35. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +20 -13
  36. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +6 -4
  37. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +17 -0
  38. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +4 -0
  39. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +43 -0
  40. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +1 -0
  41. data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
  42. data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +3 -2
  43. data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +1 -0
  44. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +6 -4
  45. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +2 -3
  46. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +11 -5
  47. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +26 -9
  48. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +12 -0
  49. data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_not_current_year.jsx → _date_stacked_current_year.jsx} +6 -5
  50. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +1 -0
  51. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.html.erb +1 -1
  52. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_date_stacked/docs/_description.md +1 -1
  54. data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +2 -2
  55. data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -1
  56. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +3 -0
  57. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -0
  58. data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -0
  59. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +4 -0
  60. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +14 -0
  61. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +1 -0
  62. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +1 -0
  63. data/app/pb_kits/playbook/pb_date_time/docs/example.yml +3 -1
  64. data/app/pb_kits/playbook/pb_date_time/docs/index.js +1 -0
  65. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +3 -0
  66. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
  67. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +2 -0
  68. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +33 -0
  69. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +4 -0
  70. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +22 -0
  71. data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +1 -0
  72. data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +3 -1
  73. data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +1 -0
  74. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
  75. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +101 -4
  76. data/app/pb_kits/playbook/pb_draggable/context/types.ts +6 -3
  77. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +179 -0
  78. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
  79. data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
  80. data/app/pb_kits/playbook/pb_dropdown/index.js +32 -14
  81. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +2 -1
  82. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +2 -1
  83. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +2 -1
  84. data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +2 -1
  85. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +31 -9
  86. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +12 -5
  87. data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +1 -0
  88. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +4 -1
  89. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
  90. data/app/pb_kits/playbook/pb_nav/_item.tsx +18 -4
  91. data/app/pb_kits/playbook/pb_nav/_nav.scss +30 -5
  92. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +192 -0
  93. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
  94. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +21 -0
  95. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +113 -0
  96. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +1 -0
  97. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +30 -0
  98. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +117 -0
  99. data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +1 -0
  100. data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
  101. data/app/pb_kits/playbook/pb_nav/docs/index.js +3 -1
  102. data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -4
  103. data/app/pb_kits/playbook/pb_nav/item.rb +11 -2
  104. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -1
  105. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
  106. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
  107. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +1 -0
  108. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
  109. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
  110. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
  111. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +1 -2
  112. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
  113. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +1 -1
  114. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +11 -0
  115. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
  116. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
  117. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +1 -2
  118. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +1 -2
  119. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -1
  120. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +2 -1
  121. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +2 -1
  122. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
  123. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +2 -1
  124. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +2 -1
  125. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
  126. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
  127. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
  128. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +1 -0
  129. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
  130. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +2 -1
  131. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
  132. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
  133. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -1
  134. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -1
  135. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
  136. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +2 -1
  137. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +1 -0
  138. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +2 -1
  139. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +2 -1
  140. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +2 -1
  141. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +2 -1
  142. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +3 -1
  143. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
  144. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +1 -0
  145. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
  146. data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +4 -1
  147. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +384 -262
  148. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -5
  149. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +14 -0
  150. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +29 -0
  151. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +3 -0
  152. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +31 -0
  153. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +1 -0
  154. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +4 -1
  155. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +14 -3
  156. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +3 -0
  157. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +3 -0
  158. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +1 -7
  159. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +1 -0
  160. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +3 -0
  161. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +2 -0
  162. data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +41 -0
  163. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +3 -1
  164. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +3 -1
  165. data/app/pb_kits/playbook/pb_table/_table.tsx +28 -26
  166. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +4 -1
  167. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
  168. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -0
  169. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +2 -1
  170. data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
  171. data/app/pb_kits/playbook/utilities/_truncate.scss +2 -0
  172. data/app/pb_kits/playbook/utilities/globalProps.ts +26 -8
  173. data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +18 -0
  174. data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +18 -0
  175. data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +18 -0
  176. data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +18 -0
  177. data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +18 -0
  178. data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +18 -0
  179. data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +18 -0
  180. data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +18 -0
  181. data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +18 -0
  182. data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +18 -0
  183. data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +18 -0
  184. data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +18 -0
  185. data/dist/chunks/_typeahead-LoB4DX1N.js +6 -0
  186. data/dist/chunks/lib-CgpqUb6l.js +29 -0
  187. data/dist/chunks/vendor.js +37 -1
  188. data/dist/playbook-rails-react-bindings.js +1 -1
  189. data/dist/playbook-rails.js +1 -1
  190. data/dist/playbook.css +1 -1
  191. data/lib/playbook/version.rb +2 -2
  192. metadata +47 -11
  193. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year.html.erb +0 -5
  194. data/dist/chunks/_line_graph-C-AuMGN2.js +0 -1
  195. data/dist/chunks/_typeahead--38pnHwS.js +0 -6
  196. data/dist/chunks/_weekday_stacked-Fx-KHOwY.js +0 -37
  197. data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
  198. data/dist/chunks/lib-BXBHAZMY.js +0 -29
  199. data/dist/chunks/pb_form_validation-BNfSnIUF.js +0 -1
  200. data/dist/playbook-doc.js +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2971aeca06ad7724c6dbfa7d78baf6b50b700f09c1ab2463f74b35785f7d9bc
4
- data.tar.gz: 959e8ac2a178a18f546b82a857edf4296d0e7140027c3dcac0cd199609c27357
3
+ metadata.gz: 919f3350cdd7c157371fd1f02395ef40868156156bc20dda59bdca671ba525b0
4
+ data.tar.gz: 5de0380c738e2aa0e341f4f1a6c20fe09e2c82b87f6f44f298dfc83ac2b3721c
5
5
  SHA512:
6
- metadata.gz: 367fde0cdcc412337c173d02287f795a967adec61f53dbe92c5e92254cef14bf6f49db6eefa209446d0978b76e5c4bf8d4b2ed1c26179c4449744644c629b91f
7
- data.tar.gz: 42b6c57e7d49d4252ce409adc9a7fbc92fcc436248d78a8256974cc0f87eeb6e6066acc9304d17bb8abf8664106fa035d44cced6d0dfa9d8f2282ab21830f726
6
+ metadata.gz: 07f5a7b60a390625121f739b1de7ccb57114b9701099d7c26ad56e27a1421bb9fa137fcc6212b70116d63b4becc3476bc970f6e845255558b4922e956a3a72da
7
+ data.tar.gz: 240c25fb702ebc6820d584fd1be2c302188a914686f5c975d0da6620218b75b9a82d6e1bd78ba0c838ca462d1309b7c2ae3ab107ada47e0bdeb7874bff240247
@@ -1,5 +1,6 @@
1
1
  import React from "react"
2
- import { AdvancedTable, colors } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import colors from '../../tokens/exports/_colors.module.scss'
3
4
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
5
 
5
6
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AdvancedTable } from "playbook-ui";
2
+ import AdvancedTable from '../_advanced_table';
3
3
  import MOCK_DATA from "./advanced_table_mock_data.json";
4
4
 
5
5
  const AdvancedTableColumnStylingColumnHeaders = (props) => {
@@ -1,5 +1,7 @@
1
1
  import React, { useState } from "react"
2
- import { AdvancedTable, Button, Flex } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
+ import Flex from '../../pb_flex/_flex'
4
+ import Button from '../../pb_button/_button'
3
5
  import MOCK_DATA from "./advanced_table_mock_data.json"
4
6
  import PAGINATION_MOCK_DATA from "./advanced_table_pagination_mock_data.json"
5
7
 
@@ -1,5 +1,5 @@
1
1
  import React from "react"
2
- import { AdvancedTable } from "playbook-ui"
2
+ import AdvancedTable from '../_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data_infinite_scroll.json"
4
4
 
5
5
  const AdvancedTableInfiniteScroll = (props) => {
@@ -1,5 +1,7 @@
1
1
  import React, { useState } from "react";
2
- import { AdvancedTable, TextInput, Body } from "playbook-ui";
2
+ import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
+ import TextInput from '../../pb_text_input/_text_input'
4
+ import Body from '../../pb_body/_body'
3
5
  import MOCK_DATA from "./advanced_table_mock_data.json";
4
6
 
5
7
  const AdvancedTableInlineEditing = (props) => {
@@ -1,7 +1,8 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../_advanced_table'
3
3
  import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
4
- import { colors } from "playbook-ui"
4
+ import colors from '../../tokens/exports/_colors.module.scss'
5
+
5
6
 
6
7
  const AdvancedTableRowStyling = (props) => {
7
8
  const columnDefinitions = [
@@ -5,6 +5,7 @@ import { globalProps } from '../utilities/globalProps'
5
5
 
6
6
  import Button from '../pb_button/_button'
7
7
  import Tooltip from '../pb_tooltip/_tooltip'
8
+ import CircleIconButton from '../pb_circle_icon_button/_circle_icon_button'
8
9
 
9
10
  import usePBCopy from './usePBCopy'
10
11
 
@@ -18,6 +19,7 @@ type CopyButtonProps = {
18
19
  tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left'
19
20
  tooltipText?: string
20
21
  value?: string
22
+ variant?: 'button' | 'icon'
21
23
  timeout?: number
22
24
  }
23
25
 
@@ -28,11 +30,12 @@ const CopyButton = (props: CopyButtonProps) => {
28
30
  data = {},
29
31
  from = '',
30
32
  id,
31
- text= 'Copy',
33
+ text = 'Copy',
32
34
  timeout = 1000,
33
- tooltipPlacement= 'bottom',
35
+ tooltipPlacement = 'bottom',
34
36
  tooltipText = 'Copied!',
35
37
  value = '',
38
+ variant = 'icon',
36
39
  } = props
37
40
 
38
41
  const [copied, copy] = usePBCopy({ value, from, timeout })
@@ -42,7 +45,8 @@ const CopyButton = (props: CopyButtonProps) => {
42
45
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
43
46
 
44
47
  return (
45
- <div {...ariaProps}
48
+ <div
49
+ {...ariaProps}
46
50
  {...dataProps}
47
51
  className={classes}
48
52
  id={id}
@@ -53,11 +57,20 @@ const CopyButton = (props: CopyButtonProps) => {
53
57
  showTooltip={false}
54
58
  text={tooltipText}
55
59
  >
56
- <Button icon="copy"
57
- onClick={copy}
58
- >
59
- {text}
60
- </Button>
60
+ {variant === 'icon' ? (
61
+ <CircleIconButton
62
+ icon="copy"
63
+ onClick={copy}
64
+ variant="link"
65
+ />
66
+ ) : (
67
+ <Button
68
+ icon="copy"
69
+ onClick={copy}
70
+ >
71
+ {text}
72
+ </Button>
73
+ )}
61
74
  </Tooltip>
62
75
  </div>
63
76
  )
@@ -1,6 +1,10 @@
1
1
  <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: { icon: "copy" }) do %>
3
- <%= object.text %>
2
+ <% if object.variant == "icon" %>
3
+ <%= pb_rails("circle_icon_button", props: { icon: "copy", variant: "link" }) %>
4
+ <% else %>
5
+ <%= pb_rails("button", props: { icon: "copy" }) do %>
6
+ <%= object.text %>
7
+ <% end %>
4
8
  <% end %>
5
9
  <% if object.id %>
6
10
  <%= pb_rails("tooltip", props: {
@@ -12,6 +12,9 @@ module Playbook
12
12
  default: "Copied!"
13
13
  prop :value
14
14
  prop :from
15
+ prop :variant, type: Playbook::Props::Enum,
16
+ values: %w[button icon],
17
+ default: "icon"
15
18
 
16
19
  def classname
17
20
  generate_classname("pb_copy_button_kit")
@@ -37,6 +37,29 @@ it('copies the value to clipboard and pastes it into an input', async () => {
37
37
  expect(navigator.clipboard.writeText).toHaveBeenCalledWith("copy");
38
38
  })
39
39
 
40
+ test('passes text and tooltip props to icon variant', () => {
41
+ render(
42
+ <CopyButton
43
+ data={{ testid: 'text-test' }}
44
+ tooltipPlacement="right"
45
+ tooltipText="Text copied!"
46
+ value="copy"
47
+ />
48
+ )
49
+
50
+ const kit = screen.getByTestId('text-test')
51
+ const button = kit.querySelector('.pb_button_kit.pb_button_link.pb_button_inline.pb_button_enabled')
52
+ expect(button).toBeInTheDocument()
53
+
54
+ fireEvent.click(button)
55
+ const tooltipContent = screen.getByText("Text copied!")
56
+ expect(tooltipContent).toHaveTextContent("Text copied!")
57
+
58
+ const tooltip = kit.querySelector('.pb_tooltip_kit')
59
+ expect(tooltip).toBeInTheDocument()
60
+ })
61
+
62
+
40
63
  test('passes text and tooltip props to button', () => {
41
64
  render(
42
65
  <CopyButton
@@ -45,6 +68,7 @@ test('passes text and tooltip props to button', () => {
45
68
  tooltipPlacement="right"
46
69
  tooltipText="Text copied!"
47
70
  value="copy"
71
+ variant="button"
48
72
  />
49
73
  )
50
74
 
@@ -0,0 +1,9 @@
1
+ <%= pb_rails("copy_button", props: {
2
+ text: "Copy Text",
3
+ tooltip_position: "right",
4
+ tooltip_text: "Text copied!",
5
+ value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook's 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease.",
6
+ variant: "button",
7
+ }) %>
8
+
9
+ <%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+
3
+ import CopyButton from '../_copy_button'
4
+ import Textarea from '../../pb_textarea/_textarea'
5
+
6
+ const CopyButtonVariant = (props) => (
7
+ <div>
8
+ <CopyButton
9
+ {...props}
10
+ text="Copy Text"
11
+ tooltipPlacement="right"
12
+ tooltipText="Text copied!"
13
+ value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
14
+ variant="button"
15
+ />
16
+
17
+ <Textarea
18
+ {...props}
19
+ placeholder="Copy and paste here"
20
+ />
21
+ </div>
22
+ )
23
+
24
+ export default CopyButtonVariant
@@ -0,0 +1 @@
1
+ Pass in `variant: "button"` to replace the Circle Icon Button with the Button kit. Set the button's text with the `text` prop.
@@ -0,0 +1 @@
1
+ Pass in `variant="button"` to replace the Circle Icon Button with the Button kit. Set the button's text with the `text` prop.
@@ -1,2 +1,2 @@
1
- <%= pb_rails("copy_button", props: { id: "default-copy-button", text: "Copy Text", value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease." } ) %>
2
- <%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
1
+ <%= pb_rails("copy_button", props: { id: "default-copy-button", value: "Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease." } ) %>
2
+ <%= pb_rails("textarea", props: { margin_top: "xs", placeholder: "Click the icon above to copy and paste here" }) %>
@@ -7,7 +7,6 @@ const CopyButtonDefault = (props) => (
7
7
  <div>
8
8
  <CopyButton
9
9
  {...props}
10
- text="Copy Text"
11
10
  tooltipPlacement="right"
12
11
  tooltipText="Text copied!"
13
12
  value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
@@ -15,7 +14,7 @@ const CopyButtonDefault = (props) => (
15
14
 
16
15
  <Textarea
17
16
  {...props}
18
- placeholder="Copy and paste here"
17
+ placeholder="Click the icon above to copy and paste here"
19
18
  />
20
19
  </div>
21
20
  )
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("body", props: { id: "body", text: "Copy this body text!"}) %>
2
- <%= pb_rails("copy_button", props: { text: "Copy Body text", from: "body", id: "copy-body-button" }) %>
2
+ <%= pb_rails("copy_button", props: { text: "Copy Body text", from: "body", id: "copy-body-button", variant: "button" }) %>
3
3
  <%= pb_rails("text_input", props: { margin_top: "xs", placeholder: "Copy and paste here" }) %>
4
- <%= pb_rails("copy_button", props: { text: "Copy Text Input", from: "copy-input", id: "copy-input-button" }) %>
4
+ <%= pb_rails("copy_button", props: { text: "Copy Text Input", from: "copy-input", id: "copy-input-button", variant: "button" }) %>
5
5
  <%= pb_rails("text_input", props: { margin_top: "xs", id: "copy-input" , value: "Copy and paste here" }) %>
@@ -21,6 +21,7 @@ const CopyButtonFrom = (props) => {
21
21
  text="Copy Body text"
22
22
  tooltipPlacement="right"
23
23
  tooltipText="Body text copied!"
24
+ variant="button"
24
25
  />
25
26
 
26
27
  <TextInput
@@ -36,6 +37,7 @@ const CopyButtonFrom = (props) => {
36
37
  text="Copy Text Input"
37
38
  tooltipPlacement="right"
38
39
  tooltipText="Text input copied!"
40
+ variant="button"
39
41
  />
40
42
 
41
43
  <Textarea
@@ -1,10 +1,12 @@
1
1
  examples:
2
2
  rails:
3
3
  - copy_button_default: Default
4
+ - copy_button_button_variant: Button Variant
4
5
  - copy_button_from: Copy From
5
6
  - copy_button_hook_rails: Copy Hook
6
7
 
7
8
  react:
8
9
  - copy_button_default: Default
10
+ - copy_button_button_variant: Button Variant
9
11
  - copy_button_from: Copy From
10
12
  - copy_button_hook: Copy Hook
@@ -1,3 +1,4 @@
1
1
  export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
2
  export { default as CopyButtonFrom } from './_copy_button_from.jsx'
3
3
  export { default as CopyButtonHook } from './_copy_button_hook.jsx'
4
+ export { default as CopyButtonButtonVariant } from './_copy_button_button_variant.jsx'
@@ -0,0 +1 @@
1
+ Abbreviate larger amounts into thousands (K), millions (M), billions (B), and even trillions (T).
@@ -0,0 +1 @@
1
+ Use `decimals: "matching"` when you want the full decimal amount displayed as a single number rather than split visually.
@@ -0,0 +1 @@
1
+ Use `decimals="matching"` when you want the full decimal amount displayed as a single number rather than split visually.
@@ -1,4 +1,14 @@
1
1
  <%= pb_rails("currency", props: {
2
2
  amount: "-2,000.50",
3
3
  size: "sm",
4
+ }) %>
5
+
6
+ <%= pb_rails("currency", props: {
7
+ amount: "-2,000.50",
8
+ size: "md",
9
+ }) %>
10
+
11
+ <%= pb_rails("currency", props: {
12
+ amount: "-2,000.50",
13
+ size: "lg",
4
14
  }) %>
@@ -9,6 +9,16 @@ const CurrencyNegative = (props) => {
9
9
  amount="-2,000.50"
10
10
  {...props}
11
11
  />
12
+ <Currency
13
+ amount="-2,000.50"
14
+ size="md"
15
+ {...props}
16
+ />
17
+ <Currency
18
+ amount="-2,000.50"
19
+ size="lg"
20
+ {...props}
21
+ />
12
22
  </>
13
23
  )
14
24
  }
@@ -0,0 +1 @@
1
+ Small `Currency` kits have the negative sign on the lefthand side of the "$" symbol.
@@ -0,0 +1 @@
1
+ Remove the "$" symbol by setting an empty string: `symbol: ""`.
@@ -0,0 +1 @@
1
+ Remove the "$" symbol by setting an empty string: `symbol=""`.
@@ -1,3 +1,10 @@
1
+ <%= pb_rails("currency", props: {
2
+ amount: "30,327.43",
3
+ label: "Default",
4
+ size: "sm",
5
+ margin_bottom: "md",
6
+ }) %>
7
+
1
8
  <%= pb_rails("currency", props: {
2
9
  amount: "2,000.50",
3
10
  emphasized: false,
@@ -5,6 +5,13 @@ import Currency from '../_currency'
5
5
  const CurrencyVariants = (props) => {
6
6
  return (
7
7
  <>
8
+ <Currency
9
+ amount="30,327.43"
10
+ label="Default"
11
+ marginBottom="md"
12
+ size="sm"
13
+ {...props}
14
+ />
8
15
  <Currency
9
16
  amount="2,000.50"
10
17
  emphasized={false}
@@ -1,2 +1,2 @@
1
- Use to display monetary amounts, typically on dashboards or other layouts to show an overview or summary. User understanding increase when paired with labels.
2
- Cents is automatically ".00" unless other wise overwritten (i.e. unit prop).
1
+ Use this kit to display monetary amounts, typically on dashboards or other layouts to show an overview or summary. Pairing it with labels improves user understanding.
2
+ Cents are automatically ".00" unless otherwise overwritten (i.e. `unit` prop).
@@ -70,22 +70,36 @@
70
70
  <%= javascript_tag do %>
71
71
  (function() {
72
72
  const loadDatePicker = () => {
73
- datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
73
+ const input = document.getElementById("<%= object.picker_id %>");
74
+ if (input && !input._flatpickr) {
75
+ datePickerHelper(<%= object.date_picker_config %>, "<%= object.scroll_container %>")
74
76
 
75
- if (<%= object.selection_type == "quickpick" %>) {
76
- document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
77
- const startDate = document.getElementById("<%= object.start_date_id %>")
78
- const endDate = document.getElementById("<%= object.end_date_id %>")
79
- const splittedValue = target.value.split(" to ")
80
- startDate.value = splittedValue[0]
81
- endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
82
- })
77
+ if (<%= object.selection_type == "quickpick" %>) {
78
+ document.getElementById("<%= object.picker_id %>").addEventListener("change", ({ target }) => {
79
+ const startDate = document.getElementById("<%= object.start_date_id %>")
80
+ const endDate = document.getElementById("<%= object.end_date_id %>")
81
+ const splittedValue = target.value.split(" to ")
82
+ startDate.value = splittedValue[0]
83
+ endDate.value = splittedValue[1] ? splittedValue[1] : splittedValue[0]
84
+ })
85
+ }
83
86
  }
84
87
  }
85
88
 
86
- window.addEventListener("DOMContentLoaded", () => {
89
+ // Try to initialize immediately if DOM is ready
90
+ if (document.readyState === "loading") {
91
+ window.addEventListener("DOMContentLoaded", loadDatePicker)
92
+ } else {
87
93
  loadDatePicker()
88
- })
94
+ }
95
+
96
+ // For dynamically added content (modals, etc.), check again after a brief delay
97
+ setTimeout(() => {
98
+ const input = document.getElementById("<%= object.picker_id %>");
99
+ if (input && !input._flatpickr) {
100
+ loadDatePicker();
101
+ }
102
+ }, 100);
89
103
 
90
104
  if (<%= !object.custom_event_type.empty? %>) {
91
105
  window.addEventListener("<%= object.custom_event_type %>", () => {
@@ -182,6 +182,33 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
182
182
  }
183
183
  }
184
184
 
185
+ const positionCalendarIfNeeded = (fp: Instance) => {
186
+ const cal = document.querySelector(`#cal-${pickerId}`) as HTMLElement
187
+ if (!cal) return
188
+
189
+ const inputRect = fp.input.getBoundingClientRect()
190
+ const h = cal.getBoundingClientRect().height || 300
191
+ const spaceBelow = window.innerHeight - inputRect.bottom
192
+ const spaceAbove = inputRect.top
193
+
194
+ if (spaceBelow < h + 10 && spaceAbove >= h + 10) {
195
+ if (staticPosition) {
196
+ cal.style.top = 'auto'
197
+ cal.style.bottom = 'calc(100% + 5px)'
198
+ } else {
199
+ cal.style.position = 'fixed'
200
+ cal.style.top = `${Math.max(10, inputRect.top - h - 5)}px`
201
+ cal.style.left = `${inputRect.left}px`
202
+ }
203
+ } else if (staticPosition) {
204
+ cal.style.top = ''
205
+ cal.style.bottom = ''
206
+ } else {
207
+ Object.assign(cal.style, { position: '', top: '', left: '', bottom: '', right: '', transform: '' })
208
+ fp._positionCalendar()
209
+ }
210
+ }
211
+
185
212
  const setPlugins = (thisRangesEndToday: boolean, customQuickPickDates: any) => {
186
213
  const pluginList = []
187
214
 
@@ -239,6 +266,9 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
239
266
  }
240
267
  }
241
268
 
269
+ // Store resize / position handler reference for cleanup
270
+ let resizeRepositionHandlerRef: (() => void) | null = null
271
+
242
272
  // ===========================================================
243
273
  // | Flatpickr initializer w/ config |
244
274
  // ===========================================================
@@ -260,13 +290,24 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
260
290
  minDate: setMinDate,
261
291
  mode,
262
292
  nextArrow: '<i class="far fa-angle-right"></i>',
263
- onOpen: [() => {
293
+ onOpen: [(_selectedDates, _dateStr, fp) => {
264
294
  calendarResizer()
265
- window.addEventListener('resize', calendarResizer)
295
+ if (resizeRepositionHandlerRef) {
296
+ window.removeEventListener('resize', resizeRepositionHandlerRef)
297
+ }
298
+ resizeRepositionHandlerRef = () => {
299
+ calendarResizer()
300
+ positionCalendarIfNeeded(fp)
301
+ }
302
+ window.addEventListener('resize', resizeRepositionHandlerRef)
266
303
  if (!staticPosition && scrollContainer) attachToScroll(scrollContainer)
304
+ positionCalendarIfNeeded(fp)
267
305
  }],
268
306
  onClose: [(selectedDates, dateStr) => {
269
- window.removeEventListener('resize', calendarResizer)
307
+ if (resizeRepositionHandlerRef) {
308
+ window.removeEventListener('resize', resizeRepositionHandlerRef)
309
+ resizeRepositionHandlerRef = null
310
+ }
270
311
  if (!staticPosition && scrollContainer) detachFromScroll(scrollContainer as HTMLElement)
271
312
  onClose(selectedDates, dateStr)
272
313
  }],
@@ -19,6 +19,7 @@ type DateRangeInlineProps = {
19
19
  icon?: boolean;
20
20
  id?: string;
21
21
  size?: "sm" | "xs";
22
+ showCurrentYear?: boolean;
22
23
  startDate?: Date;
23
24
  };
24
25
 
@@ -45,6 +46,7 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
45
46
  icon = false,
46
47
  size = "sm",
47
48
  startDate,
49
+ showCurrentYear = false,
48
50
  } = props;
49
51
 
50
52
  const dateInCurrentYear = () => {
@@ -60,13 +62,10 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
60
62
  const htmlProps = buildHtmlProps(htmlOptions);
61
63
 
62
64
  const renderTime = (date: Date) => {
65
+ const includeYear = showCurrentYear || !dateInCurrentYear();
63
66
  return (
64
67
  <time dateTime={dateTimeIso(date)}>
65
- {dateInCurrentYear() ? (
66
- ` ${dateTimestamp(date, false)} `
67
- ) : (
68
- ` ${dateTimestamp(date, true)} `
69
- )}
68
+ {` ${dateTimestamp(date, includeYear)} `}
70
69
  </time>
71
70
  );
72
71
  };
@@ -83,7 +82,8 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
83
82
  {icon && (
84
83
  <Caption
85
84
  dark={dark}
86
- tag="span">
85
+ tag="span"
86
+ >
87
87
  <Icon
88
88
  className="pb_date_range_inline_icon"
89
89
  dark={dark}
@@ -96,12 +96,14 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
96
96
  )}
97
97
  <Caption
98
98
  dark={dark}
99
- tag="span">
99
+ tag="span"
100
+ >
100
101
  {renderTime(startDate)}
101
102
  </Caption>
102
103
  <Caption
103
104
  dark={dark}
104
- tag="span">
105
+ tag="span"
106
+ >
105
107
  <Icon
106
108
  className="pb_date_range_inline_arrow"
107
109
  dark={dark}
@@ -112,7 +114,8 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
112
114
  </Caption>
113
115
  <Caption
114
116
  dark={dark}
115
- tag="span">
117
+ tag="span"
118
+ >
116
119
  {renderTime(endDate)}
117
120
  </Caption>
118
121
  </>
@@ -124,7 +127,8 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
124
127
  <Body
125
128
  color={"light"}
126
129
  dark={dark}
127
- tag="span">
130
+ tag="span"
131
+ >
128
132
  <Icon
129
133
  className="pb_date_range_inline_icon"
130
134
  dark={dark}
@@ -137,13 +141,15 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
137
141
  )}
138
142
  <Body
139
143
  dark={dark}
140
- tag="span">
144
+ tag="span"
145
+ >
141
146
  {renderTime(startDate)}
142
147
  </Body>
143
148
  <Body
144
149
  color={"light"}
145
150
  dark={dark}
146
- tag="span">
151
+ tag="span"
152
+ >
147
153
  <Icon
148
154
  className="pb_date_range_inline_arrow"
149
155
  dark={dark}
@@ -154,7 +160,8 @@ const DateRangeInline = (props: DateRangeInlineProps): React.ReactElement => {
154
160
  </Body>
155
161
  <Body
156
162
  dark={dark}
157
- tag="span">
163
+ tag="span"
164
+ >
158
165
  {renderTime(endDate)}
159
166
  </Body>
160
167
  </>