playbook_ui 12.17.0 → 12.18.0.pre.alpha.PLAY735mobileheadersfix616
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/index.js +1 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +2 -2
- data/app/pb_kits/playbook/pb_docs/kit_api.html.erb +48 -36
- data/app/pb_kits/playbook/pb_docs/kit_api.rb +97 -9
- data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +1 -1
- data/app/pb_kits/playbook/pb_docs/kit_example.rb +9 -5
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +3 -0
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_compound_component.jsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_current_photo.jsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_custom_header.jsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +1 -1
- data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx +5 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +6 -6
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +4 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +49 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts +9 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +62 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +139 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx +45 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx +59 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +28 -12
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +231 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx +36 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/index.ts +6 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +185 -0
- data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.test.js +85 -0
- data/app/pb_kits/playbook/pb_title/_title.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +45 -0
- data/app/pb_kits/playbook/pb_title_detail/title_detail.test.js +71 -0
- data/app/pb_kits/playbook/pb_toggle/{_toggle.jsx → _toggle.tsx} +20 -22
- data/app/pb_kits/playbook/pb_toggle/toggle.test.js +67 -0
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +11 -6
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +4 -4
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_with_icon_circle.html.erb +1 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/lib/playbook/markdown/helper.rb +50 -71
- data/lib/playbook/markdown.rb +0 -1
- data/lib/playbook/number_spacing.rb +10 -10
- data/lib/playbook/position.rb +10 -10
- data/lib/playbook/spacing.rb +10 -10
- data/lib/playbook/version.rb +2 -2
- data/lib/playbook/z_index.rb +10 -10
- metadata +25 -14
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +0 -172
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +0 -44
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb +0 -9
- data/lib/playbook/markdown/template_handler.rb +0 -47
@@ -8,7 +8,17 @@ require "action_view"
|
|
8
8
|
module Playbook
|
9
9
|
module Markdown
|
10
10
|
module Helper
|
11
|
-
def
|
11
|
+
def self.call(template, _source)
|
12
|
+
markdown(template.source)
|
13
|
+
end
|
14
|
+
|
15
|
+
def render_markdown(text)
|
16
|
+
# rubocop:disable Security/Eval
|
17
|
+
eval(Playbook::Markdown::Helper.markdown(text))
|
18
|
+
# rubocop:enable Security/Eval
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.markdown(text)
|
12
22
|
options = {
|
13
23
|
filter_html: false,
|
14
24
|
hard_wrap: true,
|
@@ -20,6 +30,8 @@ module Playbook
|
|
20
30
|
}
|
21
31
|
|
22
32
|
extensions = {
|
33
|
+
lax_spacing: true,
|
34
|
+
no_intra_emphasis: true,
|
23
35
|
autolink: true,
|
24
36
|
superscript: true,
|
25
37
|
fenced_code_blocks: true,
|
@@ -33,9 +45,11 @@ module Playbook
|
|
33
45
|
}
|
34
46
|
|
35
47
|
renderer = HTMLBlockCode.new(options)
|
48
|
+
# toc_renderer = Redcarpet::Render::HTML_TOC.new(with_toc_data: true)
|
49
|
+
# @TOC = Redcarpet::Markdown.new(toc_renderer)
|
50
|
+
# puts "TOC: #{@TOC.inspect}"
|
36
51
|
markdown = Redcarpet::Markdown.new(renderer, extensions)
|
37
|
-
|
38
|
-
markdown.render(text).html_safe
|
52
|
+
"#{markdown.render(text).inspect}.html_safe;"
|
39
53
|
end
|
40
54
|
|
41
55
|
def rouge(text, language)
|
@@ -44,6 +58,10 @@ module Playbook
|
|
44
58
|
formatter.format(lexer.lex(text))
|
45
59
|
end
|
46
60
|
|
61
|
+
class HTML < Redcarpet::Render::HTML
|
62
|
+
include Rouge::Plugins::Redcarpet
|
63
|
+
end
|
64
|
+
|
47
65
|
def rouge_markdown(text)
|
48
66
|
render_options = {
|
49
67
|
filter_html: true,
|
@@ -65,88 +83,49 @@ module Playbook
|
|
65
83
|
end
|
66
84
|
end
|
67
85
|
|
86
|
+
class HTMLWithPants < Redcarpet::Render::HTML
|
87
|
+
include Redcarpet::Render::SmartyPants
|
88
|
+
end
|
89
|
+
|
68
90
|
class HTML < Redcarpet::Render::HTML
|
69
91
|
include Rouge::Plugins::Redcarpet
|
70
92
|
end
|
71
93
|
|
72
94
|
class HTMLBlockCode < Redcarpet::Render::HTML
|
73
95
|
include ActionView::Helpers::AssetTagHelper
|
74
|
-
def header(title, level)
|
75
|
-
if level == 7
|
76
|
-
@headers ||= []
|
77
|
-
permalink = title.gsub(/\W+/, "-")
|
78
|
-
if @headers.include?(permalink)
|
79
|
-
permalink += "_1"
|
80
|
-
loop do
|
81
|
-
break unless @headers.include?(permalink)
|
82
|
-
|
83
|
-
permalink.gsub!(/_(\d+)$/, "_#{Regexp.last_match(1).to_i + 1}")
|
84
|
-
end
|
85
|
-
end
|
86
|
-
@headers << permalink
|
87
|
-
%(\n<a name="#{permalink}" class="markdown-header-anchor anchor" href="##{permalink}"><span class="fa fa-link anchor-icon"></span></a><h#{level} id=\"#{permalink}\">#{title}</h#{level}>\n)
|
88
|
-
else
|
89
|
-
%(\n<h#{level}>#{title}</h#{level}>\n)
|
90
|
-
end
|
91
|
-
end
|
92
96
|
|
93
|
-
def
|
94
|
-
|
95
|
-
end
|
96
|
-
|
97
|
-
def preprocess(full_document)
|
98
|
-
full_document.gsub(/\[component (.*)\]/) do
|
99
|
-
@string = Regexp.last_match(1)
|
100
|
-
@default_height = "160"
|
101
|
-
@attr = ["", @default_height]
|
97
|
+
# def block_code(code, language)
|
98
|
+
# "\n.nf\n#{normal_text(rouge(code, language))}\n.fi\n"
|
99
|
+
# end
|
102
100
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
101
|
+
def table(header, body)
|
102
|
+
"<table class='pb_table table-sm table-responsive-collapse table-card table-collapse-sm'>" \
|
103
|
+
"<thead>#{header}</thead>" \
|
104
|
+
"<tbody>#{body}</tbody>" \
|
105
|
+
"</table>"
|
106
|
+
end
|
107
107
|
|
108
|
-
|
109
|
-
|
110
|
-
|
108
|
+
def header(title, level)
|
109
|
+
@headers ||= []
|
110
|
+
permalink = title.gsub(/\W+/, "-")
|
111
|
+
if @headers.include?(permalink)
|
112
|
+
permalink += "_1"
|
113
|
+
loop do
|
114
|
+
break unless @headers.include?(permalink)
|
115
|
+
|
116
|
+
permalink.gsub!(/_(\d+)$/, "_#{Regexp.last_match(1).to_i + 1}")
|
111
117
|
end
|
112
|
-
|
113
|
-
%(\n<div class="uix-component-frame"><iframe scrolling="no" id="component-preview" src="#{@attr[0]}" width="100%" height="#{@attr[1]}"></iframe><a href="#{@attr[0]}" target="_blank" class="uix-component-link">View component</a></div>\n)
|
114
118
|
end
|
119
|
+
@headers << permalink
|
120
|
+
permalink_markup = %(<a name="#{permalink}" class="markdown-header-anchor" )
|
121
|
+
permalink_markup += %(href="##{permalink}"><span class="far fa-link markdown-header-anchor-icon"></span></a>)
|
122
|
+
%(\n<h#{level} id="#{permalink}">#{title} #{permalink_markup}</h#{level}>\n)
|
115
123
|
end
|
116
124
|
|
117
|
-
def
|
118
|
-
|
119
|
-
@list_items = contents.split("\n")
|
120
|
-
|
121
|
-
if @list_items[0].include?("[do]") || @list_items[0].include?("[dont]")
|
122
|
-
@element_items = []
|
123
|
-
@list_items.each do |item, _index|
|
124
|
-
item.gsub(%r{<li>(.*)</li>}) do
|
125
|
-
@element_items.push(Regexp.last_match(1))
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
# Doing both because we could have either/both
|
130
|
-
# clean up
|
131
|
-
@dont_items, @trash_items_dont = @element_items.partition { |x, _i| x.include? "[dont]" }
|
132
|
-
@do_items, @trash_items_do = @element_items.partition { |x, _i| x.include? "[do]" }
|
133
|
-
|
134
|
-
@do_list = []
|
135
|
-
@do_items.each do |item, _index|
|
136
|
-
@do_list.push("<li>#{item.sub('[do] ', '')}</li>")
|
137
|
-
end
|
138
|
-
@do_list = "<ul class='uix-ruleset do-list'>#{@do_list.join('')}</ul>"
|
139
|
-
|
140
|
-
@dont_list = []
|
141
|
-
@dont_items.each do |item, _index|
|
142
|
-
@dont_list.push("<li>#{item.sub('[dont] ', '')}</li>")
|
143
|
-
end
|
144
|
-
@dont_list = "<ul class='uix-ruleset dont-list'>#{@dont_list.join('')}</ul>"
|
125
|
+
def image(link, title, alt_text)
|
126
|
+
return nil if link.nil?
|
145
127
|
|
146
|
-
|
147
|
-
else
|
148
|
-
@contents
|
149
|
-
end
|
128
|
+
%(<a href="#{link}" target="_blank">#{image_tag(link, title: title, alt: alt_text, class: 'imageloader lazyload')}</a>)
|
150
129
|
end
|
151
130
|
end
|
152
131
|
end
|
data/lib/playbook/markdown.rb
CHANGED
@@ -6,6 +6,16 @@ module Playbook
|
|
6
6
|
base.prop :number_spacing
|
7
7
|
end
|
8
8
|
|
9
|
+
def number_spacing_values
|
10
|
+
%w[tabular]
|
11
|
+
end
|
12
|
+
|
13
|
+
def number_spacing_options
|
14
|
+
{
|
15
|
+
number_spacing: "ns",
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
9
19
|
private
|
10
20
|
|
11
21
|
def number_spacing_props
|
@@ -17,15 +27,5 @@ module Playbook
|
|
17
27
|
"ns_#{index_value}" if number_spacing_values.include? index_value
|
18
28
|
end.compact.join(" ")
|
19
29
|
end
|
20
|
-
|
21
|
-
def number_spacing_options
|
22
|
-
{
|
23
|
-
number_spacing: "ns",
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
def number_spacing_values
|
28
|
-
%w[tabular]
|
29
|
-
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/playbook/position.rb
CHANGED
@@ -6,6 +6,16 @@ module Playbook
|
|
6
6
|
base.prop :position
|
7
7
|
end
|
8
8
|
|
9
|
+
def position_values
|
10
|
+
%w[relative absolute fixed sticky]
|
11
|
+
end
|
12
|
+
|
13
|
+
def position_options
|
14
|
+
{
|
15
|
+
position: "position",
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
9
19
|
private
|
10
20
|
|
11
21
|
def position_props
|
@@ -19,15 +29,5 @@ module Playbook
|
|
19
29
|
"position_#{value}"
|
20
30
|
end.compact.join(" ")
|
21
31
|
end
|
22
|
-
|
23
|
-
def position_options
|
24
|
-
{
|
25
|
-
position: "position",
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
def position_values
|
30
|
-
%w[relative absolute fixed sticky]
|
31
|
-
end
|
32
32
|
end
|
33
33
|
end
|
data/lib/playbook/spacing.rb
CHANGED
@@ -20,6 +20,16 @@ module Playbook
|
|
20
20
|
base.prop :padding_y
|
21
21
|
end
|
22
22
|
|
23
|
+
def max_width_options
|
24
|
+
{
|
25
|
+
max_width: "mw",
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
def max_width_values
|
30
|
+
%w[xs sm md lg xl 0 none]
|
31
|
+
end
|
32
|
+
|
23
33
|
def spacing_options
|
24
34
|
{
|
25
35
|
margin: "m",
|
@@ -62,15 +72,5 @@ module Playbook
|
|
62
72
|
"max_width_#{width_value}" if max_width_values.include? width_value
|
63
73
|
end.compact.join(" ")
|
64
74
|
end
|
65
|
-
|
66
|
-
def max_width_options
|
67
|
-
{
|
68
|
-
max_width: "mw",
|
69
|
-
}
|
70
|
-
end
|
71
|
-
|
72
|
-
def max_width_values
|
73
|
-
%w[xs sm md lg xl 0 none]
|
74
|
-
end
|
75
75
|
end
|
76
76
|
end
|
data/lib/playbook/version.rb
CHANGED
data/lib/playbook/z_index.rb
CHANGED
@@ -6,6 +6,16 @@ module Playbook
|
|
6
6
|
base.prop :z_index
|
7
7
|
end
|
8
8
|
|
9
|
+
def z_index_values
|
10
|
+
%w[1 2 3 4 5 6 7 8 9 10]
|
11
|
+
end
|
12
|
+
|
13
|
+
def z_index_options
|
14
|
+
{
|
15
|
+
z_index: "z-index",
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
9
19
|
private
|
10
20
|
|
11
21
|
def z_index_props
|
@@ -17,15 +27,5 @@ module Playbook
|
|
17
27
|
"z_index_#{index_value}" if z_index_values.include? index_value
|
18
28
|
end.compact.join(" ")
|
19
29
|
end
|
20
|
-
|
21
|
-
def z_index_options
|
22
|
-
{
|
23
|
-
z_index: "z-index",
|
24
|
-
}
|
25
|
-
end
|
26
|
-
|
27
|
-
def z_index_values
|
28
|
-
%w[1 2 3 4 5 6 7 8 9 10]
|
29
|
-
end
|
30
30
|
end
|
31
31
|
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: 12.
|
4
|
+
version: 12.18.0.pre.alpha.PLAY735mobileheadersfix616
|
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-
|
12
|
+
date: 2023-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -73,14 +73,14 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '3.
|
76
|
+
version: '3.6'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3.
|
83
|
+
version: '3.6'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rouge
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1719,9 +1719,19 @@ files:
|
|
1719
1719
|
- app/pb_kits/playbook/pb_radio/radio.html.erb
|
1720
1720
|
- app/pb_kits/playbook/pb_radio/radio.rb
|
1721
1721
|
- app/pb_kits/playbook/pb_radio/radio.test.js
|
1722
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx
|
1723
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts
|
1724
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx
|
1725
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx
|
1726
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx
|
1727
|
+
- app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx
|
1722
1728
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss
|
1723
1729
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx
|
1730
|
+
- app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss
|
1724
1731
|
- app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss
|
1732
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md
|
1733
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx
|
1734
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md
|
1725
1735
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb
|
1726
1736
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx
|
1727
1737
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb
|
@@ -2074,14 +2084,15 @@ files:
|
|
2074
2084
|
- app/pb_kits/playbook/pb_time/docs/index.js
|
2075
2085
|
- app/pb_kits/playbook/pb_time/time.html.erb
|
2076
2086
|
- app/pb_kits/playbook/pb_time/time.rb
|
2077
|
-
- app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx
|
2078
2087
|
- app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss
|
2088
|
+
- app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx
|
2079
2089
|
- app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_default.html.erb
|
2080
2090
|
- app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_default.jsx
|
2081
2091
|
- app/pb_kits/playbook/pb_time_range_inline/docs/example.yml
|
2082
2092
|
- app/pb_kits/playbook/pb_time_range_inline/docs/index.js
|
2083
2093
|
- app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb
|
2084
2094
|
- app/pb_kits/playbook/pb_time_range_inline/time_range_inline.rb
|
2095
|
+
- app/pb_kits/playbook/pb_time_range_inline/time_range_inline.test.js
|
2085
2096
|
- app/pb_kits/playbook/pb_time_stacked/_time_stacked.scss
|
2086
2097
|
- app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx
|
2087
2098
|
- app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_default.html.erb
|
@@ -2162,8 +2173,8 @@ files:
|
|
2162
2173
|
- app/pb_kits/playbook/pb_title_count/title_count.html.erb
|
2163
2174
|
- app/pb_kits/playbook/pb_title_count/title_count.rb
|
2164
2175
|
- app/pb_kits/playbook/pb_title_count/title_count.test.js
|
2165
|
-
- app/pb_kits/playbook/pb_title_detail/_title_detail.jsx
|
2166
2176
|
- app/pb_kits/playbook/pb_title_detail/_title_detail.scss
|
2177
|
+
- app/pb_kits/playbook/pb_title_detail/_title_detail.tsx
|
2167
2178
|
- app/pb_kits/playbook/pb_title_detail/docs/_description.md
|
2168
2179
|
- app/pb_kits/playbook/pb_title_detail/docs/_footer.md
|
2169
2180
|
- app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.html.erb
|
@@ -2173,8 +2184,9 @@ files:
|
|
2173
2184
|
- app/pb_kits/playbook/pb_title_detail/docs/index.js
|
2174
2185
|
- app/pb_kits/playbook/pb_title_detail/title_detail.html.erb
|
2175
2186
|
- app/pb_kits/playbook/pb_title_detail/title_detail.rb
|
2176
|
-
- app/pb_kits/playbook/
|
2187
|
+
- app/pb_kits/playbook/pb_title_detail/title_detail.test.js
|
2177
2188
|
- app/pb_kits/playbook/pb_toggle/_toggle.scss
|
2189
|
+
- app/pb_kits/playbook/pb_toggle/_toggle.tsx
|
2178
2190
|
- app/pb_kits/playbook/pb_toggle/docs/_description.md
|
2179
2191
|
- app/pb_kits/playbook/pb_toggle/docs/_footer.md
|
2180
2192
|
- app/pb_kits/playbook/pb_toggle/docs/_toggle_custom.html.erb
|
@@ -2190,6 +2202,7 @@ files:
|
|
2190
2202
|
- app/pb_kits/playbook/pb_toggle/docs/index.js
|
2191
2203
|
- app/pb_kits/playbook/pb_toggle/toggle.html.erb
|
2192
2204
|
- app/pb_kits/playbook/pb_toggle/toggle.rb
|
2205
|
+
- app/pb_kits/playbook/pb_toggle/toggle.test.js
|
2193
2206
|
- app/pb_kits/playbook/pb_tooltip/_tooltip.scss
|
2194
2207
|
- app/pb_kits/playbook/pb_tooltip/_tooltip.tsx
|
2195
2208
|
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb
|
@@ -2206,7 +2219,6 @@ files:
|
|
2206
2219
|
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_margin.md
|
2207
2220
|
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_selectors.html.erb
|
2208
2221
|
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_selectors.md
|
2209
|
-
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb
|
2210
2222
|
- app/pb_kits/playbook/pb_tooltip/docs/_tooltip_with_icon_circle.html.erb
|
2211
2223
|
- app/pb_kits/playbook/pb_tooltip/docs/example.yml
|
2212
2224
|
- app/pb_kits/playbook/pb_tooltip/docs/index.js
|
@@ -2442,7 +2454,6 @@ files:
|
|
2442
2454
|
- lib/playbook/line_height.rb
|
2443
2455
|
- lib/playbook/markdown.rb
|
2444
2456
|
- lib/playbook/markdown/helper.rb
|
2445
|
-
- lib/playbook/markdown/template_handler.rb
|
2446
2457
|
- lib/playbook/number_spacing.rb
|
2447
2458
|
- lib/playbook/order.rb
|
2448
2459
|
- lib/playbook/pagination_renderer.rb
|
@@ -2474,7 +2485,7 @@ homepage: http://playbook.powerapp.cloud
|
|
2474
2485
|
licenses:
|
2475
2486
|
- ISC
|
2476
2487
|
metadata: {}
|
2477
|
-
post_install_message:
|
2488
|
+
post_install_message:
|
2478
2489
|
rdoc_options: []
|
2479
2490
|
require_paths:
|
2480
2491
|
- lib
|
@@ -2485,12 +2496,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2485
2496
|
version: '0'
|
2486
2497
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2487
2498
|
requirements:
|
2488
|
-
- - "
|
2499
|
+
- - ">"
|
2489
2500
|
- !ruby/object:Gem::Version
|
2490
|
-
version:
|
2501
|
+
version: 1.3.1
|
2491
2502
|
requirements: []
|
2492
2503
|
rubygems_version: 3.3.7
|
2493
|
-
signing_key:
|
2504
|
+
signing_key:
|
2494
2505
|
specification_version: 4
|
2495
2506
|
summary: Playbook Design System
|
2496
2507
|
test_files: []
|
@@ -1,172 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import classnames from 'classnames'
|
5
|
-
|
6
|
-
import DateTime from '../pb_kit/dateTime'
|
7
|
-
import { globalProps } from '../utilities/globalProps'
|
8
|
-
|
9
|
-
import Body from '../pb_body/_body'
|
10
|
-
import Caption from '../pb_caption/_caption'
|
11
|
-
import Icon from '../pb_icon/_icon'
|
12
|
-
|
13
|
-
type TimeRangeInlineProps = {
|
14
|
-
className?: string,
|
15
|
-
id?: string,
|
16
|
-
data?: string,
|
17
|
-
alignment?: "left" | "center" | "vertical",
|
18
|
-
size?: "sm" | "xs",
|
19
|
-
dark?: boolean,
|
20
|
-
icon?: boolean,
|
21
|
-
timezone?: boolean,
|
22
|
-
startTime: string,
|
23
|
-
endTime: string,
|
24
|
-
}
|
25
|
-
|
26
|
-
const timezoneString = (dateValue) => {
|
27
|
-
const date = new DateTime({ value: dateValue })
|
28
|
-
return `${date.convertToTimezone()}`
|
29
|
-
}
|
30
|
-
|
31
|
-
const dateTimestamp = (dateValue) => {
|
32
|
-
const date = new DateTime({ value: dateValue })
|
33
|
-
return `${date.toHour()}:${date.toMinute()}${date.toMeridian()}`
|
34
|
-
}
|
35
|
-
|
36
|
-
const dateTimeIso = (dateValue) => {
|
37
|
-
const date = new DateTime({ value: dateValue })
|
38
|
-
return date.toIso()
|
39
|
-
}
|
40
|
-
|
41
|
-
const TimeRangeInline = (props: TimeRangeInlineProps) => {
|
42
|
-
const {
|
43
|
-
className,
|
44
|
-
alignment = 'left',
|
45
|
-
size = 'sm',
|
46
|
-
dark = false,
|
47
|
-
icon = false,
|
48
|
-
timezone = false,
|
49
|
-
startTime,
|
50
|
-
endTime,
|
51
|
-
} = props
|
52
|
-
const separator = (
|
53
|
-
<Body color="light">
|
54
|
-
<Icon
|
55
|
-
className="pb_time_range_inline_arrow"
|
56
|
-
dark={dark}
|
57
|
-
fixedWidth
|
58
|
-
icon="long-arrow-right"
|
59
|
-
/>
|
60
|
-
</Body>
|
61
|
-
)
|
62
|
-
|
63
|
-
const iconContent = () => {
|
64
|
-
return (
|
65
|
-
<If condition={icon}>
|
66
|
-
<Body
|
67
|
-
color="light"
|
68
|
-
tag="span"
|
69
|
-
>
|
70
|
-
<Icon
|
71
|
-
className="pb_time_range_inline_icon"
|
72
|
-
dark={dark}
|
73
|
-
fixedWidth
|
74
|
-
icon="clock"
|
75
|
-
size={size}
|
76
|
-
tag="span"
|
77
|
-
/>
|
78
|
-
</Body>
|
79
|
-
</If>
|
80
|
-
)
|
81
|
-
}
|
82
|
-
|
83
|
-
return (
|
84
|
-
<div
|
85
|
-
className={classnames('pb_time_range_inline_kit_' + alignment, globalProps(props), className)}
|
86
|
-
>
|
87
|
-
<div className="pb_time_range_inline_wrapper">
|
88
|
-
<If condition={size == 'xs'}>
|
89
|
-
<Caption
|
90
|
-
dark={dark}
|
91
|
-
tag="span"
|
92
|
-
>
|
93
|
-
{iconContent()}
|
94
|
-
<time dateTime={dateTimeIso(startTime)}>
|
95
|
-
{` ${dateTimestamp(
|
96
|
-
startTime
|
97
|
-
)} `}
|
98
|
-
</time>
|
99
|
-
</Caption>
|
100
|
-
<Caption
|
101
|
-
className="pb_time_range_inline_arrow"
|
102
|
-
dark={dark}
|
103
|
-
tag="span"
|
104
|
-
>
|
105
|
-
{separator}
|
106
|
-
</Caption>
|
107
|
-
<Caption
|
108
|
-
dark={dark}
|
109
|
-
tag="span"
|
110
|
-
>
|
111
|
-
<time dateTime={dateTimeIso(endTime)}>
|
112
|
-
{` ${dateTimestamp(
|
113
|
-
endTime
|
114
|
-
)} `}
|
115
|
-
</time>
|
116
|
-
</Caption>
|
117
|
-
<If condition={timezone}>
|
118
|
-
<Caption
|
119
|
-
className="pb_time_range_inline_timezone"
|
120
|
-
dark={dark}
|
121
|
-
tag="span"
|
122
|
-
>
|
123
|
-
{timezoneString(endTime)}
|
124
|
-
</Caption>
|
125
|
-
</If>
|
126
|
-
</If>
|
127
|
-
<If condition={size == 'sm'}>
|
128
|
-
<Body
|
129
|
-
dark={dark}
|
130
|
-
tag="span"
|
131
|
-
>
|
132
|
-
{iconContent()}
|
133
|
-
<time dateTime={dateTimeIso(startTime)}>
|
134
|
-
{` ${dateTimestamp(
|
135
|
-
startTime
|
136
|
-
)} `}
|
137
|
-
</time>
|
138
|
-
</Body>
|
139
|
-
<Body
|
140
|
-
className="pb_time_range_inline_arrow"
|
141
|
-
dark={dark}
|
142
|
-
tag="span"
|
143
|
-
>
|
144
|
-
{separator}
|
145
|
-
</Body>
|
146
|
-
<Body
|
147
|
-
dark={dark}
|
148
|
-
tag="span"
|
149
|
-
>
|
150
|
-
<time dateTime={dateTimeIso(endTime)}>
|
151
|
-
{` ${dateTimestamp(
|
152
|
-
endTime
|
153
|
-
)} `}
|
154
|
-
</time>
|
155
|
-
</Body>
|
156
|
-
<If condition={timezone}>
|
157
|
-
<Body
|
158
|
-
className="pb_time_range_inline_timezone"
|
159
|
-
color="light"
|
160
|
-
dark={dark}
|
161
|
-
tag="span"
|
162
|
-
>
|
163
|
-
{timezoneString(endTime)}
|
164
|
-
</Body>
|
165
|
-
</If>
|
166
|
-
</If>
|
167
|
-
</div>
|
168
|
-
</div>
|
169
|
-
)
|
170
|
-
}
|
171
|
-
|
172
|
-
export default TimeRangeInline
|
@@ -1,44 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import classnames from 'classnames'
|
5
|
-
|
6
|
-
import { globalProps } from '../utilities/globalProps'
|
7
|
-
import { buildCss, buildDataProps } from '../utilities/props'
|
8
|
-
|
9
|
-
import Body from '../pb_body/_body'
|
10
|
-
import Title from '../pb_title/_title'
|
11
|
-
|
12
|
-
type TitleDetailProps = {
|
13
|
-
align?: "left" | "center" | "right",
|
14
|
-
className?: string,
|
15
|
-
data?: object,
|
16
|
-
detail: string,
|
17
|
-
id?: string,
|
18
|
-
title: string,
|
19
|
-
}
|
20
|
-
|
21
|
-
const TitleDetail = (props: TitleDetailProps) => {
|
22
|
-
const { align = 'left', className, data = {}, detail, id, title } = props
|
23
|
-
const dataProps = buildDataProps(data)
|
24
|
-
const pbCss = buildCss('pb_title_detail_kit', align)
|
25
|
-
|
26
|
-
return (
|
27
|
-
<div
|
28
|
-
{...dataProps}
|
29
|
-
className={classnames(pbCss, globalProps(props), className)}
|
30
|
-
id={id}
|
31
|
-
>
|
32
|
-
<Title
|
33
|
-
size={4}
|
34
|
-
text={title}
|
35
|
-
/>
|
36
|
-
<Body
|
37
|
-
color="light"
|
38
|
-
text={detail}
|
39
|
-
/>
|
40
|
-
</div>
|
41
|
-
)
|
42
|
-
}
|
43
|
-
|
44
|
-
export default TitleDetail
|