playbook_ui 13.8.0.pre.alpha.play845allkitsbytypes1258 → 13.9.0.pre.alpha.PLAY962SingleSelect1261
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_button/_button.tsx +1 -6
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -7
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +27 -22
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +2 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +258 -111
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.html.erb +6 -7
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb +73 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx +87 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +7 -0
- data/app/pb_kits/playbook/utilities/validEmojiChecker.ts +6 -0
- data/dist/menu.yml +110 -281
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/pb_doc_helper.rb +28 -61
- data/lib/playbook/version.rb +2 -2
- metadata +5 -2
@@ -26,75 +26,42 @@ module Playbook
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# Deal with lists of kits, used in Playbook doc and Externally
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
kits.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# Filter kits that have at least one component compatible with the type
|
42
|
-
kits["kits"].select do |kit|
|
43
|
-
kit["components"].any? { |component| component["platforms"].include?(type) }
|
29
|
+
# rubocop:disable Style/StringConcatenation
|
30
|
+
def pb_kits(type: "rails", limit_examples: false, dark_mode: false, method: get_kits)
|
31
|
+
display_kits = []
|
32
|
+
kits = method
|
33
|
+
kits.each do |kit|
|
34
|
+
if kit.is_a?(Hash)
|
35
|
+
nav_hash_array(kit).each do |sub_kit|
|
36
|
+
display_kits << render_pb_doc_kit(sub_kit, type, limit_examples, false, dark_mode)
|
37
|
+
end
|
38
|
+
else
|
39
|
+
display_kits << render_pb_doc_kit(kit, type, limit_examples, false, dark_mode)
|
40
|
+
end
|
44
41
|
end
|
42
|
+
raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
|
45
43
|
end
|
44
|
+
# rubocop:enable Style/StringConcatenation
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
components = kit["components"].map { |c| c["name"] }
|
53
|
-
|
54
|
-
all_kits << if components.size == 1
|
55
|
-
components.first
|
56
|
-
else
|
57
|
-
{ kit_name => components }
|
58
|
-
end
|
59
|
-
end
|
46
|
+
# rubocop:disable Naming/AccessorMethodName
|
47
|
+
def get_kits
|
48
|
+
menu = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))
|
49
|
+
menu["kits"]
|
50
|
+
end
|
60
51
|
|
61
|
-
|
52
|
+
def get_kits_pb_website
|
53
|
+
menu = YAML.load_file(Rails.root.join("config/menu.yml"))
|
54
|
+
menu["kits"]
|
62
55
|
end
|
56
|
+
# rubocop:enable Naming/AccessorMethodName
|
63
57
|
|
64
58
|
# rubocop:disable Style/OptionalBooleanParameter
|
65
|
-
def render_pb_doc_kit(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
# Check if parent_kit is not nil
|
72
|
-
# Check if type is not "swift"
|
73
|
-
if parent_kit && type != "swift"
|
74
|
-
# Filter components based on the specified type
|
75
|
-
components = parent_kit["components"].select { |component| component["platforms"].include?(type) }
|
76
|
-
|
77
|
-
# If it's a parent with components, accumulate the UI content for child components
|
78
|
-
if components.any?
|
79
|
-
component_content = components.map do |component|
|
80
|
-
component_name = component["name"]
|
81
|
-
title = pb_doc_render_clickable_title(component_name, type) # Use component_name for the title
|
82
|
-
|
83
|
-
# Render the component UI content with the same styles/tags as the parent
|
84
|
-
component_ui = raw("<div class='pb--docItem-ui'>
|
85
|
-
#{pb_kit(kit: component_name, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}
|
86
|
-
</div>")
|
87
|
-
|
88
|
-
# Combine the component name and component UI content
|
89
|
-
"#{title}#{component_ui}"
|
90
|
-
end.join.to_s
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
# Return the component_content
|
95
|
-
component_content.to_s
|
59
|
+
def render_pb_doc_kit(kit, type, limit_examples, code = true, dark_mode = false)
|
60
|
+
title = pb_doc_render_clickable_title(kit, type)
|
61
|
+
ui = raw("<div class='pb--docItem-ui'>
|
62
|
+
#{pb_kit(kit: kit, type: type, show_code: code, limit_examples: limit_examples, dark_mode: dark_mode)}</div>")
|
63
|
+
title + ui
|
96
64
|
end
|
97
|
-
|
98
65
|
# rubocop:enable Style/OptionalBooleanParameter
|
99
66
|
|
100
67
|
private
|
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: 13.
|
4
|
+
version: 13.9.0.pre.alpha.PLAY962SingleSelect1261
|
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: 2023-10-
|
12
|
+
date: 2023-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1498,6 +1498,8 @@ files:
|
|
1498
1498
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.html.erb
|
1499
1499
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx
|
1500
1500
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.md
|
1501
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.html.erb
|
1502
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single.jsx
|
1501
1503
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_form.html.erb
|
1502
1504
|
- app/pb_kits/playbook/pb_multi_level_select/docs/example.yml
|
1503
1505
|
- app/pb_kits/playbook/pb_multi_level_select/docs/index.js
|
@@ -2571,6 +2573,7 @@ files:
|
|
2571
2573
|
- app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js
|
2572
2574
|
- app/pb_kits/playbook/utilities/test/globalProps/order.test.js
|
2573
2575
|
- app/pb_kits/playbook/utilities/text.ts
|
2576
|
+
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
2574
2577
|
- dist/menu.yml
|
2575
2578
|
- dist/playbook-rails.js
|
2576
2579
|
- dist/reset.css
|