playbook_ui 15.6.0.pre.alpha.play266013023 → 15.6.0.pre.rc.0

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +163 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +190 -0
  4. data/app/pb_kits/playbook/pb_background/_background.tsx +6 -6
  5. data/app/pb_kits/playbook/pb_background/background.test.js +1 -5
  6. data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +1 -0
  8. data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
  9. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  10. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  11. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
  12. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +8 -10
  13. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +1 -0
  14. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +3 -0
  15. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -24
  16. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +3 -181
  17. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -2
  18. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -1
  20. data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -14
  21. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +4 -5
  22. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -2
  23. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +0 -31
  24. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -2
  25. data/app/pb_kits/playbook/pb_dialog/docs/index.js +1 -2
  26. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  27. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +7 -458
  28. data/app/pb_kits/playbook/pb_draggable/context/types.ts +3 -8
  29. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
  30. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  31. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +1 -77
  32. data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +4 -4
  33. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +22 -34
  34. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +12 -16
  35. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
  36. data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +12 -16
  37. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +12 -16
  38. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -10
  39. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +15 -66
  40. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +0 -1
  41. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
  42. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.test.js +0 -25
  43. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +10 -44
  44. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +4 -34
  45. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +7 -16
  46. data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
  47. data/app/pb_kits/playbook/pb_select/_select.tsx +3 -8
  48. data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
  49. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
  50. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  51. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  52. data/app/pb_kits/playbook/pb_select/select.rb +1 -3
  53. data/app/pb_kits/playbook/pb_select/select.test.js +0 -23
  54. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
  55. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
  56. data/app/pb_kits/playbook/pb_timeline/_item.tsx +0 -3
  57. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md +1 -1
  58. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +0 -2
  59. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  60. data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -1
  61. data/app/pb_kits/playbook/pb_timeline/item.rb +0 -2
  62. data/app/pb_kits/playbook/pb_timeline/label.html.erb +1 -2
  63. data/app/pb_kits/playbook/pb_timeline/label.rb +0 -2
  64. data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -3
  65. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -51
  66. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -15
  67. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -3
  68. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +2 -13
  69. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -6
  70. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -34
  71. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  72. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
  73. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -6
  74. data/app/pb_kits/playbook/tokens/_colors.scss +1 -2
  75. data/dist/chunks/_typeahead-kRdz5zPn.js +6 -0
  76. data/dist/chunks/lib-CgpqUb6l.js +29 -0
  77. data/dist/chunks/vendor.js +2 -2
  78. data/dist/playbook-rails-react-bindings.js +1 -1
  79. data/dist/playbook-rails.js +1 -1
  80. data/dist/playbook.css +1 -1
  81. data/lib/playbook/forms/builder/collection_select_field.rb +1 -9
  82. data/lib/playbook/forms/builder/select_field.rb +1 -9
  83. data/lib/playbook/forms/builder/time_zone_select_field.rb +1 -9
  84. data/lib/playbook/pb_kit_helper.rb +0 -35
  85. data/lib/playbook/version.rb +2 -2
  86. metadata +4 -22
  87. data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
  88. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb +0 -24
  89. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx +0 -60
  90. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md +0 -3
  91. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
  92. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -22
  93. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +0 -42
  94. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +0 -1
  95. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +0 -16
  96. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +0 -30
  97. data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +0 -1
  98. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb +0 -60
  99. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx +0 -118
  100. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md +0 -1
  101. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +0 -30
  102. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +0 -37
  103. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +0 -3
  104. data/app/pb_kits/playbook/utilities/deprecated.ts +0 -73
  105. data/dist/chunks/_typeahead-CYNrKU10.js +0 -6
  106. data/dist/chunks/lib-DDDLiZuu.js +0 -29
@@ -4,18 +4,10 @@ module Playbook
4
4
  module Forms
5
5
  class Builder
6
6
  def collection_select(name, collection, value_method, text_method, options = {}, html_options = {}, props: {})
7
- props[:input_options] ||= {}
8
- props[:input_options][:id] ||= "#{@object_name}_#{name}"
9
-
10
- props[:label] = @template.label(@object_name, name, for: props[:input_options][:id]) if props[:label] == true
11
-
7
+ props[:label] = @template.label(@object_name, name) if props[:label] == true
12
8
  options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
13
9
  options[:prompt] = props[:blank_selection] || ""
14
10
  html_options[:required] = "required" if props[:required]
15
- html_options[:id] = props[:input_options][:id]
16
- html_options[:class] = props[:input_options][:class] if props[:input_options][:class]
17
- html_options[:data] = (html_options[:data] || {}).merge(props[:input_options][:data] || {})
18
-
19
11
  input = super(name, collection, value_method, text_method, options, html_options)
20
12
 
21
13
  @template.pb_rails("select", props: props) do
@@ -4,18 +4,10 @@ module Playbook
4
4
  module Forms
5
5
  class Builder
6
6
  def select(name, choices = nil, options = {}, html_options = {}, props: {}, &block)
7
- props[:input_options] ||= {}
8
- props[:input_options][:id] ||= "#{@object_name}_#{name}"
9
-
10
- props[:label] = @template.label(@object_name, name, for: props[:input_options][:id]) if props[:label] == true
11
-
7
+ props[:label] = @template.label(@object_name, name) if props[:label] == true
12
8
  options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
13
9
  options[:prompt] = props[:blank_selection] || ""
14
10
  html_options[:required] = "required" if props[:required]
15
- html_options[:id] = props[:input_options][:id]
16
- html_options[:class] = props[:input_options][:class] if props[:input_options][:class]
17
- html_options[:data] = (html_options[:data] || {}).merge(props[:input_options][:data] || {})
18
-
19
11
  input = super(name, choices, options, html_options, &block)
20
12
 
21
13
  @template.pb_rails("select", props: props) do
@@ -4,18 +4,10 @@ module Playbook
4
4
  module Forms
5
5
  class Builder
6
6
  def time_zone_select_field(name, choices = {}, options = {}, html_options = {}, props: {})
7
- props[:input_options] ||= {}
8
- props[:input_options][:id] ||= "#{@object_name}_#{name}"
9
-
10
- props[:label] = @template.label(@object_name, name, for: props[:input_options][:id]) if props[:label] == true
11
-
7
+ props[:label] = @template.label(@object_name, name) if props[:label] == true
12
8
  options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
13
9
  options[:prompt] = props[:blank_selection] || ""
14
10
  html_options[:required] = "required" if props[:required]
15
- html_options[:id] = props[:input_options][:id]
16
- html_options[:class] = props[:input_options][:class] if props[:input_options][:class]
17
- html_options[:data] = (html_options[:data] || {}).merge(props[:input_options][:data] || {})
18
-
19
11
  input = @template.time_zone_select(@object_name, name, choices, options, html_options)
20
12
 
21
13
  @template.pb_rails("select", props: props) do
@@ -13,40 +13,5 @@ module Playbook
13
13
  render kit.new(props, &block), &block
14
14
  end
15
15
  end
16
-
17
- def deprecated_kit_warning(kit_name, message = nil)
18
- # Skip in test and production environments
19
- return "".html_safe if Rails.env.test? || Rails.env.production?
20
-
21
- # Build the warning message
22
- base_message = "PLAYBOOK DEPRECATION WARNING\\n ----------------------------\\n The \\\"#{kit_name}\\\" kit is deprecated and will be removed in a future version."
23
-
24
- full_message = if message
25
- "#{base_message} #{message}"
26
- else
27
- "#{base_message} Please migrate to the recommended alternative"
28
- end
29
-
30
- # Escape the message for JavaScript
31
- escaped_message = full_message.gsub("'", "\\\\'").gsub("\n", "\\n")
32
-
33
- # Return a self-executing script that checks if we're already warned
34
- # Uses client-side tracking to ensure one warning per page load
35
- # Only shows warnings on localhost (matching React behavior)
36
- script = "<script type=\"text/javascript\">\n"
37
- script += "(function() {\n"
38
- script += " var hostname = window.location.hostname;\n"
39
- script += " var isLocalDev = hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local') || hostname.includes('local.') || !hostname;\n"
40
- script += " if (!isLocalDev) return;\n"
41
- script += " if (!window.__PB_WARNED_KITS__) window.__PB_WARNED_KITS__ = new Set();\n"
42
- script += " if (!window.__PB_WARNED_KITS__.has('#{kit_name}')) {\n"
43
- script += " window.__PB_WARNED_KITS__.add('#{kit_name}');\n"
44
- script += " console.warn('#{escaped_message}');\n"
45
- script += " }\n"
46
- script += "})();\n"
47
- script += "</script>"
48
-
49
- script.html_safe
50
- end
51
16
  end
52
17
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "15.6.0"
5
- VERSION = "15.6.0.pre.alpha.play266013023"
4
+ PREVIOUS_VERSION = "15.5.0"
5
+ VERSION = "15.6.0.pre.rc.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.6.0.pre.alpha.play266013023
4
+ version: 15.6.0.pre.rc.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-12-11 00:00:00.000000000 Z
12
+ date: 2025-11-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -487,7 +487,6 @@ files:
487
487
  - app/pb_kits/playbook/pb_background/docs/_background_image.md
488
488
  - app/pb_kits/playbook/pb_background/docs/_background_light.html.erb
489
489
  - app/pb_kits/playbook/pb_background/docs/_background_light.jsx
490
- - app/pb_kits/playbook/pb_background/docs/_background_light.md
491
490
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx
492
491
  - app/pb_kits/playbook/pb_background/docs/_background_overlay.md
493
492
  - app/pb_kits/playbook/pb_background/docs/_background_size.html.erb
@@ -1251,9 +1250,6 @@ files:
1251
1250
  - app/pb_kits/playbook/pb_dialog/dialog_footer.rb
1252
1251
  - app/pb_kits/playbook/pb_dialog/dialog_header.html.erb
1253
1252
  - app/pb_kits/playbook/pb_dialog/dialog_header.rb
1254
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.html.erb
1255
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.jsx
1256
- - app/pb_kits/playbook/pb_dialog/docs/_dialog_closeable.md
1257
1253
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb
1258
1254
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx
1259
1255
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md
@@ -1334,8 +1330,6 @@ files:
1334
1330
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md
1335
1331
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.html.erb
1336
1332
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
1337
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx
1338
- - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md
1339
1333
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md
1340
1334
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md
1341
1335
  - app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.html.erb
@@ -2253,8 +2247,6 @@ files:
2253
2247
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.jsx
2254
2248
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.md
2255
2249
  - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md
2256
- - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx
2257
- - app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md
2258
2250
  - app/pb_kits/playbook/pb_multiple_users/docs/example.yml
2259
2251
  - app/pb_kits/playbook/pb_multiple_users/docs/index.js
2260
2252
  - app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb
@@ -2938,9 +2930,6 @@ files:
2938
2930
  - app/pb_kits/playbook/pb_select/docs/_select_inline_compact.jsx
2939
2931
  - app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb
2940
2932
  - app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.jsx
2941
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb
2942
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx
2943
- - app/pb_kits/playbook/pb_select/docs/_select_input_options.md
2944
2933
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.html.erb
2945
2934
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.jsx
2946
2935
  - app/pb_kits/playbook/pb_select/docs/_select_multiple.md
@@ -3432,9 +3421,6 @@ files:
3432
3421
  - app/pb_kits/playbook/pb_timeline/docs/_description.md
3433
3422
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb
3434
3423
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx
3435
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.html.erb
3436
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.jsx
3437
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_show_current_year.md
3438
3424
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb
3439
3425
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx
3440
3426
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb
@@ -3664,9 +3650,6 @@ files:
3664
3650
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
3665
3651
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.html.erb
3666
3652
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.jsx
3667
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb
3668
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx
3669
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md
3670
3653
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb
3671
3654
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx
3672
3655
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb
@@ -3831,7 +3814,6 @@ files:
3831
3814
  - app/pb_kits/playbook/utilities/_truncate.scss
3832
3815
  - app/pb_kits/playbook/utilities/_vertical_align.scss
3833
3816
  - app/pb_kits/playbook/utilities/_width.scss
3834
- - app/pb_kits/playbook/utilities/deprecated.ts
3835
3817
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
3836
3818
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
3837
3819
  - app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
@@ -3871,9 +3853,9 @@ files:
3871
3853
  - app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
3872
3854
  - app/pb_kits/playbook/utilities/text.ts
3873
3855
  - app/pb_kits/playbook/utilities/validEmojiChecker.ts
3874
- - dist/chunks/_typeahead-CYNrKU10.js
3856
+ - dist/chunks/_typeahead-kRdz5zPn.js
3875
3857
  - dist/chunks/lazysizes-B7xYodB-.js
3876
- - dist/chunks/lib-DDDLiZuu.js
3858
+ - dist/chunks/lib-CgpqUb6l.js
3877
3859
  - dist/chunks/vendor.js
3878
3860
  - dist/menu.yml
3879
3861
  - dist/playbook-rails-react-bindings.js
@@ -1 +0,0 @@
1
- By default, the Background kit sets background color to 'light' as seen here.
@@ -1,24 +0,0 @@
1
- <%= pb_rails("flex", props:{wrap:true}) do %>
2
- <%= pb_rails("button", props: { text: "Open Simple Dialog", data: {"open-dialog": "dialog-simple"}, margin_right:"md" }) %>
3
- <%= pb_rails("button", props: { text: "Open Complex Dialog", data: {"open-dialog": "dialog-complex2"} }) %>
4
- <% end %>
5
-
6
- <%= pb_rails("dialog", props: {
7
- id:"dialog-simple",
8
- size: "sm",
9
- title: "Header Title is the Title Prop",
10
- text: "Hello Body Text, Nice to meet ya.",
11
- cancel_button: "Cancel Button",
12
- closeable: false,
13
- confirm_button: "Okay",
14
- confirm_button_id: "confirm-button-simple"
15
- }) %>
16
-
17
- <%= pb_rails("dialog", props: {
18
- id:"dialog-complex2",
19
- size: "sm"
20
- }) do %>
21
- <%= pb_rails("dialog/dialog_header", props: { id: "dialog-complex2", title:"Header Title inside Dialog Header", closeable: false } ) %>
22
- <%= pb_rails("dialog/dialog_body", props:{text: "Hello Body Text, Nice to meet ya."}) %>
23
- <%= pb_rails("dialog/dialog_footer", props: {cancel_button: "Cancel Button", confirm_button: "Okay", confirm_button_id:"confirm-complex2", id: "dialog-complex2"}) %>
24
- <% end %>
@@ -1,60 +0,0 @@
1
- import React, { useState } from 'react'
2
- import Button from '../../pb_button/_button'
3
- import Dialog from '../../pb_dialog/_dialog'
4
-
5
-
6
- const DialogCloseable = () => {
7
- // Simple example
8
- const [isOpenSimple, setIsOpenSimple] = useState(false)
9
- const closeSimple = () => setIsOpenSimple(false)
10
- const openSimple = () => setIsOpenSimple(true)
11
-
12
- // Complex example
13
- const [isOpenComplex, setIsOpenComplex] = useState(false)
14
- const closeComplex = () => setIsOpenComplex(false)
15
- const openComplex = () => setIsOpenComplex(true)
16
-
17
- return (
18
- <>
19
- <Button
20
- marginRight='md'
21
- onClick={openSimple}
22
- >
23
- {'Open Simple Dialog'}
24
- </Button>
25
- <Button onClick={openComplex}>{'Open Complex Dialog'}</Button>
26
-
27
- <Dialog
28
- cancelButton="Cancel Button"
29
- closeable={false}
30
- confirmButton="Okay"
31
- onCancel={closeSimple}
32
- onClose={closeSimple}
33
- onConfirm={closeSimple}
34
- opened={isOpenSimple}
35
- size="sm"
36
- text="Hello Body Text, Nice to meet ya."
37
- title="Header Title is the Title Prop"
38
- />
39
- <Dialog
40
- onClose={closeComplex}
41
- opened={isOpenComplex}
42
- size="sm"
43
- >
44
- <Dialog.Header closeable={false}>{'Header Title inside Dialog.Header'}</Dialog.Header>
45
- <Dialog.Body>{'Hello Body Text, Nice to meet ya.'}</Dialog.Body>
46
- <Dialog.Footer>
47
- <Button onClick={closeComplex}>{'Okay'}</Button>
48
- <Button
49
- onClick={closeComplex}
50
- variant="link"
51
- >
52
- {'Cancel Button'}
53
- </Button>
54
- </Dialog.Footer>
55
- </Dialog>
56
- </>
57
- )
58
- }
59
-
60
- export default DialogCloseable
@@ -1,3 +0,0 @@
1
- The `closeable` prop can be set to false to optionally render the Dialog header without the close “X” button. `closeable` is set to true by default.
2
-
3
- This prop can be used with the simple as well as the complex version of the Dialog as can be seen here.
@@ -1,180 +0,0 @@
1
- import React, { useState } from "react";
2
-
3
- import Flex from '../../pb_flex/_flex'
4
- import Draggable from '../../pb_draggable/_draggable'
5
- import { DraggableProvider } from '../../pb_draggable/context'
6
- import Badge from '../../pb_badge/_badge'
7
- import Title from '../../pb_title/_title'
8
- import Caption from '../../pb_caption/_caption'
9
- import Card from '../../pb_card/_card'
10
- import FlexItem from '../../pb_flex/_flex_item'
11
- import Avatar from '../../pb_avatar/_avatar'
12
- import Body from '../../pb_body/_body'
13
-
14
- // Initial groups to drag between
15
- const containers = ["To Do", "In Progress", "Done"];
16
-
17
- // Initial items to be dragged
18
- const data = [
19
- {
20
- id: "11",
21
- container: "To Do",
22
- title: "Task 1",
23
- description: "Bug fixes",
24
- assignee_name: "Terry Miles",
25
- assignee_img: "https://randomuser.me/api/portraits/men/44.jpg",
26
- },
27
- {
28
- id: "12",
29
- container: "To Do",
30
- title: "Task 2",
31
- description: "Documentation",
32
- assignee_name: "Sophia Miles",
33
- assignee_img: "https://randomuser.me/api/portraits/women/8.jpg",
34
- },
35
- {
36
- id: "13",
37
- container: "In Progress",
38
- title: "Task 3",
39
- description: "Add a variant",
40
- assignee_name: "Alice Jones",
41
- assignee_img: "https://randomuser.me/api/portraits/women/10.jpg",
42
- },
43
- {
44
- id: "14",
45
- container: "To Do",
46
- title: "Task 4",
47
- description: "Add jest tests",
48
- assignee_name: "Mike James",
49
- assignee_img: "https://randomuser.me/api/portraits/men/8.jpg",
50
- },
51
- {
52
- id: "15",
53
- container: "Done",
54
- title: "Task 5",
55
- description: "Alpha testing",
56
- assignee_name: "James Guy",
57
- assignee_img: "https://randomuser.me/api/portraits/men/18.jpg",
58
- },
59
- {
60
- id: "16",
61
- container: "In Progress",
62
- title: "Task 6",
63
- description: "Release",
64
- assignee_name: "Sally Jones",
65
- assignee_img: "https://randomuser.me/api/portraits/women/28.jpg",
66
- },
67
- ];
68
-
69
- const DraggableMultipleContainersDropzone = (props) => {
70
- const [initialState, setInitialState] = useState(data);
71
-
72
- const badgeProperties = (container) => {
73
- switch (container) {
74
- case "To Do":
75
- return { text: "queue", color: "warning" };
76
- case "In Progress":
77
- return { text: "progress", color: "primary" };
78
- default:
79
- return { text: "done", color: "success" };
80
- }
81
- };
82
-
83
- return (
84
- <DraggableProvider
85
- dropZone={{type: "outline"}}
86
- enableCrossContainerPreview
87
- initialItems={data}
88
- onDragEnd={(draggedItemId, finalContainer, originalContainer, itemAbove, itemBelow) => {
89
- console.log(`Dragged Item ID: ${draggedItemId}`);
90
- console.log(`Final Container: ${finalContainer}`);
91
- console.log(`Original Container: ${originalContainer}`);
92
- console.log('Item Above:', itemAbove);
93
- console.log('Item Below:', itemBelow);
94
- }}
95
- onDrop={(draggedItemId, droppedContainer, originalContainer, item, itemAbove, itemBelow) => {
96
- console.log(`Dragged Item ID: ${draggedItemId}`);
97
- console.log(`Dropped Container: ${droppedContainer}`);
98
- console.log(`Original Container: ${originalContainer}`);
99
- console.log('Dropped Item:', item);
100
- console.log('Item Above:', itemAbove);
101
- console.log('Item Below:', itemBelow);
102
- }}
103
- onReorder={(items) => setInitialState(items)}
104
- >
105
- <Flex
106
- justifyContent="center"
107
- {...props}
108
- >
109
- {containers?.map((container) => (
110
- <Draggable.Container
111
- container={container}
112
- htmlOptions={{style:{ width: "200px", height: "70vh"}}}
113
- key={container}
114
- padding="sm"
115
- >
116
- <Caption textAlign="center">{container}</Caption>
117
- <Flex
118
- alignItems="stretch"
119
- gap="sm"
120
- orientation="column"
121
- >
122
- {initialState
123
- .filter((item) => item.container === container)
124
- .map(
125
- ({
126
- assignee_img,
127
- assignee_name,
128
- description,
129
- id,
130
- title,
131
- }) => (
132
- <Draggable.Item
133
- container={container}
134
- dragId={id}
135
- key={id}
136
- >
137
- <Card
138
- padding="sm"
139
- {...props}
140
- >
141
- <Flex justify="between">
142
- <FlexItem>
143
- <Flex>
144
- <Avatar
145
- imageUrl={assignee_img}
146
- name={assignee_name}
147
- size="xxs"
148
- />
149
- <Title paddingLeft="xs"
150
- size={4}
151
- text={title}
152
- {...props}
153
- />
154
- </Flex>
155
- </FlexItem>
156
- <Badge
157
- marginLeft="sm"
158
- rounded
159
- text={badgeProperties(container).text}
160
- variant={badgeProperties(container).color}
161
- {...props}
162
- />
163
- </Flex>
164
- <Body paddingTop="xs"
165
- text={description}
166
- {...props}
167
- />
168
- </Card>
169
- </Draggable.Item>
170
- )
171
- )}
172
- </Flex>
173
- </Draggable.Container>
174
- ))}
175
- </Flex>
176
- </DraggableProvider>
177
- );
178
- };
179
-
180
- export default DraggableMultipleContainersDropzone;
@@ -1,22 +0,0 @@
1
- The multiple container functionality also supports customized dropzone styling as shown here.
2
-
3
- In addition to this, the `enableCrossContainerPreview` prop can be used on the `DraggableProvider` as shown here to enable dropzone preview for cross-container dragging.
4
-
5
- With `enableCrossContainerPreview`, the `onDrop` and `onDragEnd` event listeners will also provide several arguments to allow developers more context from the drag event.
6
-
7
- The `onDrop` callback is triggered when an item is successfully dropped into a container. It provides the following arguments:
8
-
9
- - `draggedItemId` - The ID of the item that was dragged
10
- - `droppedContainer` - The container where the item was dropped
11
- - `originalContainer` - The container where the drag started
12
- - `item` - The complete item object with all properties (including the updated container)
13
- - `itemAbove` - The item directly above the dropped item in the final position (null if at the top)
14
- - `itemBelow` - The item directly below the dropped item in the final position (null if at the bottom)
15
-
16
- The `onDragEnd` callback is triggered when a drag operation ends, whether it was dropped or cancelled. It provides the following arguments:
17
-
18
- - `draggedItemId` - The ID of the item that was dragged
19
- - `finalContainer` - The container where the item ended up (could be same as original if drag was cancelled)
20
- - `originalContainer` - The container where the drag started
21
- - `itemAbove` - The item directly above the dragged item in the final position (null if at the top)
22
- - `itemBelow` - The item directly below the dragged item in the final position (null if at the bottom)
@@ -1,42 +0,0 @@
1
- import React from 'react'
2
- import MultipleUsers from '../../pb_multiple_users/_multiple_users'
3
-
4
- const MultipleUsersWithTooltip = (props) => {
5
- return (
6
- <div>
7
- <MultipleUsers
8
- users={[
9
- {
10
- name: 'Patrick Welch',
11
- imageUrl: 'https://randomuser.me/api/portraits/men/9.jpg',
12
- tooltip: "Patrick Welch - Online"
13
- },
14
- {
15
- name: 'Lucille Sanchez',
16
- imageUrl: 'https://randomuser.me/api/portraits/women/6.jpg',
17
- tooltip: "Lucille Sanchez - Offline"
18
- },
19
- {
20
- name: 'Beverly Reyes',
21
- imageUrl: 'https://randomuser.me/api/portraits/women/74.jpg',
22
- tooltip: "Beverly Reyes - Online"
23
- },
24
- {
25
- name: 'Keith Craig',
26
- imageUrl: 'https://randomuser.me/api/portraits/men/40.jpg',
27
- tooltip: "Keith Craig - Away"
28
- },
29
- {
30
- name: 'Alicia Cooper',
31
- imageUrl: 'https://randomuser.me/api/portraits/women/46.jpg',
32
- tooltip: "Alicia Cooper - Busy"
33
- },
34
- ]}
35
- withTooltip
36
- {...props}
37
- />
38
- </div>
39
- )
40
- }
41
- ``
42
- export default MultipleUsersWithTooltip
@@ -1 +0,0 @@
1
- Use the `withTooltip` boolean prop to enable setting user-specific tooltip content via the `tooltip` property in the users array.
@@ -1,16 +0,0 @@
1
- <%= pb_rails("select", props: {
2
- label: "Favorite Food",
3
- name: "favorite_food",
4
- options: [
5
- { value: "pizza", value_text: "Pizza" },
6
- { value: "tacos", value_text: "Tacos" },
7
- { value: "sushi", value_text: "Sushi" }
8
- ],
9
- input_options: {
10
- 'aria-label': "Select your favorite food",
11
- class: "custom-select-class",
12
- data: { controller: "search", action: "change->search#filter" },
13
- id: "favorite-food-select"
14
- }
15
- }) %>
16
-
@@ -1,30 +0,0 @@
1
- import React from 'react'
2
-
3
- import Select from '../_select'
4
-
5
- const SelectInputOptions = (props) => {
6
- const options = [
7
- { value: 'pizza', text: 'Pizza' },
8
- { value: 'tacos', text: 'Tacos' },
9
- { value: 'sushi', text: 'Sushi' },
10
- ]
11
-
12
- return (
13
- <>
14
- <Select
15
- inputOptions={{
16
- 'aria-label': 'Select your favorite food',
17
- className: 'custom-select-class',
18
- id: 'favorite-food-select',
19
- }}
20
- label="Favorite Food"
21
- name="favorite_food"
22
- options={options}
23
- {...props}
24
- />
25
- </>
26
- )
27
- }
28
-
29
- export default SelectInputOptions
30
-
@@ -1 +0,0 @@
1
- Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<select>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, or other HTML attributes that need to be on the select element itself.