playbook_ui 13.8.0.pre.alpha.play845allkitsbytypes1258 → 13.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5c8dbe877503d2a312add43c4ee5319192494aef32945e9a7c2f32dc254ad9d
4
- data.tar.gz: 62a00cbb99b842e8a348dd33da90bedaac35ecc5fff1afc167f882014ef8d76c
3
+ metadata.gz: d2eca7c20f8832218f6db41d2723db43b2350e59a7aad8334da3931c3c0bbb1a
4
+ data.tar.gz: ebc310683144bfef85d081ceb97d118a34974f77e172999fdbb448abaf30291b
5
5
  SHA512:
6
- metadata.gz: 291bc413c5067b82944b7559d216f42a14aba1eb7a750db833c26fc0de76ea8dba1945e71022bc80c104eef3dfc391af8c82de6c0e31673b338625b1b495cbcf
7
- data.tar.gz: 1a4abac14b519af6c39bbcb1a769ff6c7bfc41d6eee534d319fa7716fa2666d7dcc19df39749994853da9a0ac15704dc4ab52500f484f1b1c96622d2d13de846
6
+ metadata.gz: bf3e81b0e87cdb87c08ccff73734d1f1f29eb854d1472fcbef22a366529a6a8c94c4fd0951d4d21f053b1114e84bad839bc90a062c30a15caa3c70f98185da1b
7
+ data.tar.gz: 160a1bcfea2ba6353e6d0469fb9884deb3d28628063fad41bb7e1a2c5e92bac0d7ee45e4e78ab27e14b4b6e5bd584cba1ff3134e74b444064624b25533a5c73b
data/dist/menu.yml CHANGED
@@ -1,282 +1,111 @@
1
- web: &web ["rails", "react"]
2
- all: &all ["rails", "react", "swift"]
3
- rails_only: &rails_only ["rails"]
4
- react_only: &react_only ["react"]
5
-
6
1
  kits:
7
- - name: "avatars"
8
- components:
9
- - name: "avatar"
10
- platforms: *all
11
- - name: "avatar_action_button"
12
- platforms: *web
13
- - name: "multiple_users"
14
- platforms: *web
15
- - name: "multiple_users_stacked"
16
- platforms: *web
17
- - name: "user"
18
- platforms: *web
19
- - name: "background"
20
- components:
21
- - name: "background"
22
- platforms: *web
23
- - name: "bread_crumbs"
24
- components:
25
- - name: "bread_crumbs"
26
- platforms: *web
27
- - name: "buttons"
28
- components:
29
- - name: "button"
30
- platforms: *web
31
- - name: "button_toolbar"
32
- platforms: *web
33
- - name: "circle_icon_button"
34
- platforms: *web
35
- - name: "card"
36
- components:
37
- - name: "card"
38
- platforms: *all
39
- - name: "collapsible"
40
- components:
41
- - name: "collapsible"
42
- platforms: *web
43
- - name: "charts_and_graphs"
44
- components:
45
- - name: "bar_graph"
46
- platforms: *web
47
- - name: "circle_chart"
48
- platforms: *web
49
- - name: "distribution_bar"
50
- platforms: *web
51
- - name: "gauge"
52
- platforms: *web
53
- - name: "legend"
54
- platforms: *web
55
- - name: "line_graph"
56
- platforms: *web
57
- - name: "treemap_chart"
58
- platforms: *web
59
- - name: "dialog"
60
- components:
61
- - name: "dialog"
62
- platforms: *web
63
- - name: "filter"
64
- components:
65
- - name: "filter"
66
- platforms: *web
67
- - name: "fixed_confirmation_toast"
68
- components:
69
- - name: "fixed_confirmation_toast"
70
- platforms: *web
71
- - name: "forms"
72
- components:
73
- - name: "checkbox"
74
- platforms: *web
75
- - name: "date_picker"
76
- platforms: *web
77
- - name: "file_upload"
78
- platforms: *web
79
- - name: "form"
80
- platforms: *rails_only
81
- - name: "form_group"
82
- platforms: *web
83
- - name: "form_pill"
84
- platforms: *web
85
- - name: "multi_level_select"
86
- platforms: *web
87
- - name: "passphrase"
88
- platforms: *web
89
- - name: "phone_number_input"
90
- platforms: *web
91
- - name: "radio"
92
- platforms: *all
93
- - name: "rich_text_editor"
94
- platforms: *web
95
- - name: "select"
96
- platforms: *web
97
- - name: "selectable_card"
98
- platforms: *web
99
- - name: "selectable_card_icon"
100
- platforms: *web
101
- - name: "selectable_icon"
102
- platforms: *web
103
- - name: "selectable_list"
104
- platforms: *web
105
- - name: "text_input"
106
- platforms: *web
107
- - name: "textarea"
108
- platforms: *web
109
- - name: "toggle"
110
- platforms: *web
111
- - name: "typeahead"
112
- platforms: *web
113
- - name: "highlight"
114
- components:
115
- - name: "highlight"
116
- platforms: *web
117
- - name: "icon"
118
- components:
119
- - name: "icon"
120
- platforms: *web
121
- - name: "icon_circle"
122
- components:
123
- - name: "icon_circle"
124
- platforms: *web
125
- - name: "icon_stat_value"
126
- components:
127
- - name: "icon_stat_value"
128
- platforms: *web
129
- - name: "icon_value"
130
- components:
131
- - name: "icon_value"
132
- platforms: *web
133
- - name: "image"
134
- components:
135
- - name: "image"
136
- platforms: *web
137
- - name: "layouts"
138
- components:
139
- - name: "flex"
140
- platforms: *web
141
- - name: "layout"
142
- platforms: *web
143
- - name: "lightbox"
144
- components:
145
- - name: "lightbox"
146
- platforms: *react_only
147
- - name: "list"
148
- components:
149
- - name: "list"
150
- platforms: *web
151
- - name: "loading_inline"
152
- components:
153
- - name: "loading_inline"
154
- platforms: *web
155
- - name: "map"
156
- components:
157
- - name: "map"
158
- platforms: *react_only
159
- - name: "nav"
160
- components:
161
- - name: "nav"
162
- platforms: *web
163
- - name: "pagination"
164
- components:
165
- - name: "pagination"
166
- platforms: *rails_only
167
- - name: "popover"
168
- components:
169
- - name: "popover"
170
- platforms: *web
171
- - name: "progress"
172
- components:
173
- - name: "progress_pills"
174
- platforms: *web
175
- - name: "progress_simple"
176
- platforms: *web
177
- - name: "progress_step"
178
- platforms: *web
179
- - name: "section_separator"
180
- components:
181
- - name: "section_separator"
182
- platforms: *web
183
- - name: "star_rating"
184
- components:
185
- - name: "star_rating"
186
- platforms: *web
187
- - name: "table"
188
- components:
189
- - name: "table"
190
- platforms: *web
191
- - name: "tags"
192
- components:
193
- - name: "tags"
194
- platforms: *web
195
- - name: "badge"
196
- platforms: *web
197
- - name: "hashtag"
198
- platforms: *web
199
- - name: "pill"
200
- platforms: *all
201
- - name: "timeline"
202
- components:
203
- - name: "timeline"
204
- platforms: *web
205
- - name: "time_and_date"
206
- components:
207
- - name: "date"
208
- platforms: *web
209
- - name: "date_range_inline"
210
- platforms: *web
211
- - name: "date_range_stacked"
212
- platforms: *web
213
- - name: "date_stacked"
214
- platforms: *web
215
- - name: "date_time"
216
- platforms: *web
217
- - name: "date_time_stacked"
218
- platforms: *web
219
- - name: "date_year_stacked"
220
- platforms: *web
221
- - name: "time"
222
- platforms: *web
223
- - name: "time_range_inline"
224
- platforms: *web
225
- - name: "time_stacked"
226
- platforms: *web
227
- - name: "timestamp"
228
- platforms: *all
229
- - name: "weekday_stacked"
230
- platforms: *web
231
- - name: "tooltip"
232
- components:
233
- - name: "tooltip"
234
- platforms: *web
235
- - name: "typography"
236
- components:
237
- - name: "body"
238
- platforms: *web
239
- - name: "caption"
240
- platforms: *web
241
- - name: "detail"
242
- platforms: *web
243
- - name: "title"
244
- platforms: *web
245
- - name: "typography_patterns"
246
- components:
247
- - name: "contact"
248
- platforms: *web
249
- - name: "currency"
250
- platforms: *web
251
- - name: "dashboard_value"
252
- platforms: *web
253
- - name: "home_address_street"
254
- platforms: *web
255
- - name: "label_pill"
256
- platforms: *web
257
- - name: "label_value"
258
- platforms: *web
259
- - name: "message"
260
- platforms: *web
261
- - name: "person"
262
- platforms: *web
263
- - name: "person_contact"
264
- platforms: *web
265
- - name: "source"
266
- platforms: *web
267
- - name: "stat_change"
268
- platforms: *web
269
- - name: "stat_value"
270
- platforms: *web
271
- - name: "title_count"
272
- platforms: *web
273
- - name: "title_detail"
274
- platforms: *web
275
- - name: "user_badge"
276
- components:
277
- - name: "user_badge"
278
- platforms: *web
279
- - name: "walkthrough"
280
- components:
281
- - name: "walkthrough"
282
- platforms: *web
2
+ - avatars:
3
+ - avatar
4
+ - avatar_action_button
5
+ - multiple_users
6
+ - multiple_users_stacked
7
+ - user
8
+ - background
9
+ - bread_crumbs
10
+ - buttons:
11
+ - button
12
+ - button_toolbar
13
+ - circle_icon_button
14
+ - card
15
+ - collapsible
16
+ - charts_and_graphs:
17
+ - bar_graph
18
+ - circle_chart
19
+ - distribution_bar
20
+ - gauge
21
+ - legend
22
+ - line_graph
23
+ - treemap_chart
24
+ - dialog
25
+ - filter
26
+ - fixed_confirmation_toast
27
+ - forms:
28
+ - checkbox
29
+ - date_picker
30
+ - file_upload
31
+ - form
32
+ - form_group
33
+ - form_pill
34
+ - multi_level_select
35
+ - passphrase
36
+ - phone_number_input
37
+ - radio
38
+ - rich_text_editor
39
+ - select
40
+ - selectable_card
41
+ - selectable_card_icon
42
+ - selectable_icon
43
+ - selectable_list
44
+ - text_input
45
+ - textarea
46
+ - toggle
47
+ - typeahead
48
+ - highlight
49
+ - icon
50
+ - icon_circle
51
+ - icon_stat_value
52
+ - icon_value
53
+ - image
54
+ - layouts:
55
+ - flex
56
+ - layout
57
+ - lightbox
58
+ - list
59
+ - loading_inline
60
+ - map
61
+ - nav
62
+ - tags:
63
+ - badge
64
+ - hashtag
65
+ - pill
66
+ - pagination
67
+ - popover
68
+ - progress:
69
+ - progress_pills
70
+ - progress_simple
71
+ - progress_step
72
+ - section_separator
73
+ - star_rating
74
+ - table
75
+ - timeline
76
+ - time_and_date:
77
+ - date
78
+ - date_range_inline
79
+ - date_range_stacked
80
+ - date_stacked
81
+ - date_time
82
+ - date_time_stacked
83
+ - date_year_stacked
84
+ - time
85
+ - time_range_inline
86
+ - time_stacked
87
+ - timestamp
88
+ - weekday_stacked
89
+ - tooltip
90
+ - typography:
91
+ - body
92
+ - caption
93
+ - detail
94
+ - title
95
+ - typography_patterns:
96
+ - contact
97
+ - currency
98
+ - dashboard_value
99
+ - home_address_street
100
+ - label_pill
101
+ - label_value
102
+ - message
103
+ - person
104
+ - person_contact
105
+ - source
106
+ - stat_change
107
+ - stat_value
108
+ - title_count
109
+ - title_detail
110
+ - user_badge
111
+ - walkthrough
@@ -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
- def pb_kits(type: "rails", limit_examples: false, dark_mode: false)
30
- kits = get_kits(type)
31
-
32
- # Iterate through the filtered kits and render them
33
- kits.map do |kit|
34
- render_pb_doc_kit(kit["name"], type, limit_examples, true, dark_mode)
35
- end.join.html_safe
36
- end
37
-
38
- def get_kits(type = "rails")
39
- kits = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml")) || []
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
- def aggregate_kits
48
- all_kits = []
49
-
50
- YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))["kits"].each do |kit|
51
- kit_name = kit["name"]
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
- all_kits
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(kit_name, type, limit_examples, code = true, dark_mode = false)
66
- parent_kit = YAML.load_file(Playbook::Engine.root.join("dist/menu.yml"))["kits"].find { |kit| kit["name"] == kit_name }
67
-
68
- # Initialize component_content as an empty string
69
- component_content = ""
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
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "13.8.0"
5
- VERSION = "13.8.0.pre.alpha.play845allkitsbytypes1258"
4
+ PREVIOUS_VERSION = "13.7.0"
5
+ VERSION = "13.8.0"
6
6
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.8.0.pre.alpha.play845allkitsbytypes1258
4
+ version: 13.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
8
8
  - Power Devs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-10-04 00:00:00.000000000 Z
12
+ date: 2023-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2638,7 +2638,7 @@ homepage: https://playbook.powerapp.cloud/
2638
2638
  licenses:
2639
2639
  - ISC
2640
2640
  metadata: {}
2641
- post_install_message:
2641
+ post_install_message:
2642
2642
  rdoc_options: []
2643
2643
  require_paths:
2644
2644
  - lib
@@ -2649,12 +2649,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2649
2649
  version: '0'
2650
2650
  required_rubygems_version: !ruby/object:Gem::Requirement
2651
2651
  requirements:
2652
- - - ">"
2652
+ - - ">="
2653
2653
  - !ruby/object:Gem::Version
2654
- version: 1.3.1
2654
+ version: '0'
2655
2655
  requirements: []
2656
2656
  rubygems_version: 3.3.7
2657
- signing_key:
2657
+ signing_key:
2658
2658
  specification_version: 4
2659
2659
  summary: Playbook Design System
2660
2660
  test_files: []