playbook_ui 14.13.0.pre.alpha.PBNTR5596084 → 14.13.0.pre.alpha.PLAY1856doc6166

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -1
  3. data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +58 -0
  4. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
  5. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
  6. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
  7. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  8. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +71 -36
  9. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
  10. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
  11. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +1 -6
  12. data/app/pb_kits/playbook/pb_nav/item.html.erb +7 -19
  13. data/app/pb_kits/playbook/pb_nav/nav.html.erb +3 -8
  14. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -6
  15. data/app/pb_kits/playbook/pb_popover/popover.html.erb +1 -6
  16. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +2 -1
  17. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  18. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  19. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  20. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
  21. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +51 -0
  22. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +2 -0
  23. data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -0
  24. data/app/pb_kits/playbook/pb_table/index.ts +41 -9
  25. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +4 -0
  26. data/app/pb_kits/playbook/pb_table/table_row.html.erb +1 -0
  27. data/app/pb_kits/playbook/pb_table/table_row.rb +10 -1
  28. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +14 -0
  29. data/app/pb_kits/playbook/pb_text_input/index.js +9 -0
  30. data/app/pb_kits/playbook/pb_text_input/text_input.rb +5 -2
  31. data/dist/chunks/{_typeahead-C_q1qAtC.js → _typeahead-CAIQfP7X.js} +2 -2
  32. data/dist/chunks/_weekday_stacked-Dq02Kbeo.js +45 -0
  33. data/dist/chunks/{lib-WQEeEj3t.js → lib-D3us1bGD.js} +1 -1
  34. data/dist/chunks/{pb_form_validation-Cq64l4zn.js → pb_form_validation-BpihMSOQ.js} +1 -1
  35. data/dist/chunks/vendor.js +1 -1
  36. data/dist/menu.yml +0 -7
  37. data/dist/playbook-doc.js +1 -1
  38. data/dist/playbook-rails-react-bindings.js +1 -1
  39. data/dist/playbook-rails.js +1 -1
  40. data/dist/playbook.css +1 -1
  41. data/lib/playbook/version.rb +1 -1
  42. metadata +13 -23
  43. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +0 -66
  44. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +0 -98
  45. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +0 -28
  46. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -42
  47. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
  48. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
  49. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
  50. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
  51. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
  52. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
  53. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
  54. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
  55. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
  56. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
  57. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
  58. data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
  59. data/dist/chunks/_weekday_stacked-DCeouuO3.js +0 -45
  60. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click.md → _table_with_collapsible_with_custom_click_react.md} +0 -0
@@ -27,6 +27,20 @@
27
27
  placeholder: "123-45-6789"
28
28
  }) %>
29
29
 
30
+ <%= pb_rails("text_input", props: {
31
+ label: "Credit Card",
32
+ mask: "credit_card",
33
+ margin_bottom: "md",
34
+ placeholder: "1234 5678 9012 3456"
35
+ }) %>
36
+
37
+ <%= pb_rails("text_input", props: {
38
+ label: "CVV",
39
+ mask: "cvv",
40
+ margin_bottom: "md",
41
+ placeholder: "123"
42
+ }) %>
43
+
30
44
  <%= pb_rails("title" , props: {
31
45
  text: "Hidden Input Under The Hood",
32
46
  padding_bottom: "sm"
@@ -27,6 +27,8 @@ export default class PbTextInput extends PbEnhancedElement {
27
27
  ssn: 'ssn',
28
28
  postal_code: 'postalCode',
29
29
  zip_code: 'zipCode',
30
+ credit_card: 'creditCard',
31
+ cvv: 'cvv',
30
32
  }[maskType];
31
33
 
32
34
  if (maskKey && INPUTMASKS[maskKey]) {
@@ -45,6 +47,9 @@ export default class PbTextInput extends PbEnhancedElement {
45
47
  case "currency":
46
48
  sanitizedInput.value = sanitizeCurrency(formattedValue);
47
49
  break;
50
+ case "credit_card":
51
+ sanitizedInput.value = sanitizeCreditCard(formattedValue);
52
+ break;
48
53
  default:
49
54
  sanitizedInput.value = formattedValue;
50
55
  }
@@ -63,6 +68,10 @@ function sanitizeCurrency(input) {
63
68
  return input.replace(/[$,]/g, "");
64
69
  }
65
70
 
71
+ function sanitizeCreditCard(input) {
72
+ return input.replace(/\D/g, "");
73
+ }
74
+
66
75
  function setCursorPosition(inputElement, cursorPosition, rawValue, formattedValue) {
67
76
  const difference = formattedValue.length - rawValue.length;
68
77
  const newPosition = Math.max(0, cursorPosition + difference);
@@ -4,13 +4,15 @@
4
4
  module Playbook
5
5
  module PbTextInput
6
6
  class TextInput < Playbook::KitBase
7
- VALID_MASKS = %w[currency zipCode postalCode ssn].freeze
7
+ VALID_MASKS = %w[currency zip_code postal_code ssn credit_card cvv].freeze
8
8
 
9
9
  MASK_PATTERNS = {
10
10
  "currency" => '^\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?$',
11
11
  "zip_code" => '\d{5}',
12
12
  "postal_code" => '\d{5}-\d{4}',
13
13
  "ssn" => '\d{3}-\d{2}-\d{4}',
14
+ "credit_card" => '\d{4} \d{4} \d{4} \d{4}',
15
+ "cvv" => '\d{3,4}',
14
16
  }.freeze
15
17
 
16
18
  prop :autocomplete, type: Playbook::Props::Boolean,
@@ -34,7 +36,8 @@ module Playbook
34
36
  prop :add_on, type: Playbook::Props::NestedProps,
35
37
  nested_kit: Playbook::PbTextInput::AddOn
36
38
 
37
- prop :mask, type: Playbook::Props::String,
39
+ prop :mask, type: Playbook::Props::Enum,
40
+ values: ["currency", "zip_code", "postal_code", "ssn", "credit_card", "cvv", nil],
38
41
  default: nil
39
42
 
40
43
  def classname