playbook_ui 15.6.0.pre.alpha.play265012993 → 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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +163 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +190 -0
- data/app/pb_kits/playbook/pb_background/_background.tsx +6 -6
- data/app/pb_kits/playbook/pb_background/background.test.js +1 -5
- data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +1 -1
- data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +1 -0
- data/app/pb_kits/playbook/pb_background/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -6
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +8 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +1 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +0 -24
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +3 -181
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +0 -31
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +7 -458
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +3 -8
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +1 -77
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +4 -4
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +22 -34
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +12 -16
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -6
- data/app/pb_kits/playbook/pb_legend/legend.html.erb +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -10
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +15 -66
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.test.js +0 -25
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +10 -44
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +4 -34
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +7 -16
- data/app/pb_kits/playbook/pb_radio/docs/_radio_error.md +1 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +3 -8
- data/app/pb_kits/playbook/pb_select/docs/_select_error.md +1 -1
- data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
- data/app/pb_kits/playbook/pb_select/select.rb +1 -3
- data/app/pb_kits/playbook/pb_select/select.test.js +0 -23
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.md +1 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.md +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -15
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -3
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +2 -13
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -6
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +7 -34
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -6
- data/app/pb_kits/playbook/tokens/_colors.scss +1 -2
- data/dist/chunks/_typeahead-kRdz5zPn.js +6 -0
- data/dist/chunks/lib-CgpqUb6l.js +29 -0
- data/dist/chunks/vendor.js +2 -2
- data/dist/menu.yml +2 -3
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/collection_select_field.rb +1 -9
- data/lib/playbook/forms/builder/select_field.rb +1 -9
- data/lib/playbook/forms/builder/time_zone_select_field.rb +1 -9
- data/lib/playbook/pb_kit_helper.rb +0 -35
- data/lib/playbook/version.rb +2 -2
- metadata +4 -16
- data/app/pb_kits/playbook/pb_background/docs/_background_light.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +0 -180
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md +0 -22
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +0 -42
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +0 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb +0 -16
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx +0 -30
- data/app/pb_kits/playbook/pb_select/docs/_select_input_options.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb +0 -30
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx +0 -37
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md +0 -3
- data/app/pb_kits/playbook/utilities/deprecated.ts +0 -73
- data/dist/chunks/_typeahead-DMyvWpig.js +0 -6
- 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[:
|
|
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[:
|
|
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[:
|
|
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
|
data/lib/playbook/version.rb
CHANGED
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.
|
|
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
|
+
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
|
|
@@ -1331,8 +1330,6 @@ files:
|
|
|
1331
1330
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_react.md
|
|
1332
1331
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.html.erb
|
|
1333
1332
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx
|
|
1334
|
-
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx
|
|
1335
|
-
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.md
|
|
1336
1333
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md
|
|
1337
1334
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md
|
|
1338
1335
|
- app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.html.erb
|
|
@@ -2250,8 +2247,6 @@ files:
|
|
|
2250
2247
|
- app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.jsx
|
|
2251
2248
|
- app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size.md
|
|
2252
2249
|
- app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md
|
|
2253
|
-
- app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx
|
|
2254
|
-
- app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md
|
|
2255
2250
|
- app/pb_kits/playbook/pb_multiple_users/docs/example.yml
|
|
2256
2251
|
- app/pb_kits/playbook/pb_multiple_users/docs/index.js
|
|
2257
2252
|
- app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb
|
|
@@ -2935,9 +2930,6 @@ files:
|
|
|
2935
2930
|
- app/pb_kits/playbook/pb_select/docs/_select_inline_compact.jsx
|
|
2936
2931
|
- app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb
|
|
2937
2932
|
- app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.jsx
|
|
2938
|
-
- app/pb_kits/playbook/pb_select/docs/_select_input_options.html.erb
|
|
2939
|
-
- app/pb_kits/playbook/pb_select/docs/_select_input_options.jsx
|
|
2940
|
-
- app/pb_kits/playbook/pb_select/docs/_select_input_options.md
|
|
2941
2933
|
- app/pb_kits/playbook/pb_select/docs/_select_multiple.html.erb
|
|
2942
2934
|
- app/pb_kits/playbook/pb_select/docs/_select_multiple.jsx
|
|
2943
2935
|
- app/pb_kits/playbook/pb_select/docs/_select_multiple.md
|
|
@@ -3658,9 +3650,6 @@ files:
|
|
|
3658
3650
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.md
|
|
3659
3651
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.html.erb
|
|
3660
3652
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.jsx
|
|
3661
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.html.erb
|
|
3662
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.jsx
|
|
3663
|
-
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_input_display.md
|
|
3664
3653
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb
|
|
3665
3654
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx
|
|
3666
3655
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb
|
|
@@ -3825,7 +3814,6 @@ files:
|
|
|
3825
3814
|
- app/pb_kits/playbook/utilities/_truncate.scss
|
|
3826
3815
|
- app/pb_kits/playbook/utilities/_vertical_align.scss
|
|
3827
3816
|
- app/pb_kits/playbook/utilities/_width.scss
|
|
3828
|
-
- app/pb_kits/playbook/utilities/deprecated.ts
|
|
3829
3817
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_content.scss
|
|
3830
3818
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_items.scss
|
|
3831
3819
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_align_self.scss
|
|
@@ -3865,9 +3853,9 @@ files:
|
|
|
3865
3853
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
|
3866
3854
|
- app/pb_kits/playbook/utilities/text.ts
|
|
3867
3855
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
|
3868
|
-
- dist/chunks/_typeahead-
|
|
3856
|
+
- dist/chunks/_typeahead-kRdz5zPn.js
|
|
3869
3857
|
- dist/chunks/lazysizes-B7xYodB-.js
|
|
3870
|
-
- dist/chunks/lib-
|
|
3858
|
+
- dist/chunks/lib-CgpqUb6l.js
|
|
3871
3859
|
- dist/chunks/vendor.js
|
|
3872
3860
|
- dist/menu.yml
|
|
3873
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,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.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<%
|
|
2
|
-
options = [
|
|
3
|
-
{ label: 'Orange', value: '#FFA500' },
|
|
4
|
-
{ label: 'Red', value: '#FF0000' },
|
|
5
|
-
{ label: 'Green', value: '#00FF00' },
|
|
6
|
-
{ label: 'Blue', value: '#0000FF' },
|
|
7
|
-
{ label: 'Yellow', value: '#FFFF00' },
|
|
8
|
-
{ label: 'Purple', value: '#800080' },
|
|
9
|
-
{ label: 'Cyan', value: '#00FFFF' },
|
|
10
|
-
{ label: 'Magenta', value: '#FF00FF' }
|
|
11
|
-
]
|
|
12
|
-
%>
|
|
13
|
-
|
|
14
|
-
<%= pb_rails("typeahead", props: {
|
|
15
|
-
id: "typeahead-input-display-none",
|
|
16
|
-
label: "With Input Display None",
|
|
17
|
-
options: options,
|
|
18
|
-
name: :foo,
|
|
19
|
-
input_display: "none",
|
|
20
|
-
})
|
|
21
|
-
%>
|
|
22
|
-
<br/>
|
|
23
|
-
<%= pb_rails("typeahead", props: {
|
|
24
|
-
id: "typeahead-input-display-pills",
|
|
25
|
-
label: "With Input Display Pills (Default)",
|
|
26
|
-
options: options,
|
|
27
|
-
name: :foo,
|
|
28
|
-
pills: true,
|
|
29
|
-
})
|
|
30
|
-
%>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import Typeahead from '../_typeahead'
|
|
4
|
-
|
|
5
|
-
const options = [
|
|
6
|
-
{ label: 'Orange', value: '#FFA500' },
|
|
7
|
-
{ label: 'Red', value: '#FF0000' },
|
|
8
|
-
{ label: 'Green', value: '#00FF00' },
|
|
9
|
-
{ label: 'Blue', value: '#0000FF' },
|
|
10
|
-
{ label: 'Yellow', value: '#FFFF00' },
|
|
11
|
-
{ label: 'Purple', value: '#800080' },
|
|
12
|
-
{ label: 'Cyan', value: '#00FFFF' },
|
|
13
|
-
{ label: 'Magenta', value: '#FF00FF' }
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
const TypeaheadInputDisplay = (props) => {
|
|
17
|
-
return (
|
|
18
|
-
<>
|
|
19
|
-
<Typeahead
|
|
20
|
-
inputDisplay="none"
|
|
21
|
-
isMulti
|
|
22
|
-
label="With Input Display None"
|
|
23
|
-
options={options}
|
|
24
|
-
{...props}
|
|
25
|
-
/>
|
|
26
|
-
<br/>
|
|
27
|
-
<Typeahead
|
|
28
|
-
isMulti
|
|
29
|
-
label="With Input Display Pills (Default)"
|
|
30
|
-
options={options}
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
</>
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export default TypeaheadInputDisplay
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks which deprecated kits have already logged warnings in this session
|
|
3
|
-
* to ensure we only log once per page load per kit
|
|
4
|
-
*/
|
|
5
|
-
const warnedKits = new Set<string>();
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Logs a deprecation warning for a Playbook kit
|
|
9
|
-
* - Only logs once per kit per page load (prevents spam on re-renders)
|
|
10
|
-
* - Only logs in development mode (not in production or test environments)
|
|
11
|
-
*
|
|
12
|
-
* @param kitName - The name of the deprecated kit (e.g., 'BarGraph', 'RichTextEditor')
|
|
13
|
-
* @param message - Optional custom deprecation message. If not provided, uses a default message.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // In your kit component:
|
|
17
|
-
* useEffect(() => {
|
|
18
|
-
* deprecatedKitWarning('BarGraph');
|
|
19
|
-
* }, []);
|
|
20
|
-
*/
|
|
21
|
-
export const deprecatedKitWarning = (
|
|
22
|
-
kitName: string,
|
|
23
|
-
message?: string
|
|
24
|
-
): void => {
|
|
25
|
-
// Skip in test environments (Jest sets NODE_ENV to 'test')
|
|
26
|
-
if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'test') {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// In browser environments, check if we're on localhost/dev
|
|
31
|
-
if (typeof window !== 'undefined') {
|
|
32
|
-
const hostname = window.location?.hostname;
|
|
33
|
-
const isLocalDev = hostname === 'localhost' ||
|
|
34
|
-
hostname === '127.0.0.1' ||
|
|
35
|
-
hostname?.endsWith('.local') ||
|
|
36
|
-
hostname?.includes('local.') ||
|
|
37
|
-
!hostname; // file:// protocol
|
|
38
|
-
|
|
39
|
-
// Only show warnings in local development
|
|
40
|
-
if (!isLocalDev) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Only warn once per kit per page load
|
|
46
|
-
if (warnedKits.has(kitName)) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Mark this kit as warned
|
|
51
|
-
warnedKits.add(kitName);
|
|
52
|
-
|
|
53
|
-
// Build the warning message
|
|
54
|
-
const baseMessage = `PLAYBOOK DEPRECATION WARNING
|
|
55
|
-
----------------------------
|
|
56
|
-
The "${kitName}" kit is deprecated and will be removed in a future version.`;
|
|
57
|
-
|
|
58
|
-
const fullMessage = message
|
|
59
|
-
? `${baseMessage} ${message}`
|
|
60
|
-
: `${baseMessage} Please migrate to the recommended alternative
|
|
61
|
-
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
console.warn(fullMessage);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Resets the warned kits tracker (useful for testing)
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
export const resetDeprecationWarnings = (): void => {
|
|
72
|
-
warnedKits.clear();
|
|
73
|
-
};
|