playbook_ui 9.9.0 → 9.11.0
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_background/background.rb +0 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +8 -19
- data/app/pb_kits/playbook/pb_button/button.rb +6 -4
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +9 -10
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +4 -2
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +7 -9
- data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +2 -2
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_flex/flex.rb +4 -4
- data/app/pb_kits/playbook/pb_form/form.rb +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +0 -1
- data/app/pb_kits/playbook/pb_passphrase/useZxcvbn.js +3 -3
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +2 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +1 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +2 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +8 -12
- data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +1 -1
- data/lib/playbook/forms/builder/action_area.rb +2 -2
- data/lib/playbook/forms/builder/collection_select_field.rb +2 -2
- data/lib/playbook/forms/builder/select_field.rb +1 -1
- data/lib/playbook/kit_resolver.rb +1 -1
- data/lib/playbook/markdown/template_handler.rb +4 -2
- data/lib/playbook/pb_doc_helper.rb +4 -2
- data/lib/playbook/props.rb +1 -4
- data/lib/playbook/props/base.rb +1 -2
- data/lib/playbook/version.rb +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11142ed7c777617e2396976979f9d8efaa8d3a8c1ad5bbd5ae4d149bc379c5a8
|
4
|
+
data.tar.gz: 24730f2cff2616c49d86af76a175909ae39b166ba6c99febda0b60fa12834e72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d4022c71355d27a1da0d060bad795c690d2fefe57802b4e09ae196757425745676babdb7516fc1501ea9caf28885ebaba7fdfdd74b63534d0f1811044a5dcd3
|
7
|
+
data.tar.gz: 2a07a2bcdfa41fada1839b1ae25f2335d49f9fed661a0145517d0c257cdb2cfe601e4d00305fc88c6c6b2345533dc5c03399c55922e40e273e3457fdaa1ad1a5
|
@@ -2,16 +2,14 @@
|
|
2
2
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
|
-
import { buildDataProps } from '../utilities/props'
|
5
|
+
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
6
6
|
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
import Icon from '../pb_icon/_icon.jsx'
|
9
9
|
|
10
10
|
type EventHandler = (SyntheticInputEvent<HTMLInputElement>) => void
|
11
11
|
type ButtonPropTypes = {
|
12
|
-
aria?:
|
13
|
-
label: string,
|
14
|
-
},
|
12
|
+
aria?: object,
|
15
13
|
children?: array<React.ReactChild>,
|
16
14
|
className?: string | array<string>,
|
17
15
|
data?: object,
|
@@ -55,20 +53,9 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
55
53
|
return className
|
56
54
|
}
|
57
55
|
|
58
|
-
const buttonAriaProps = (props: ButtonPropTypes) => {
|
59
|
-
const { aria } = props
|
60
|
-
if (typeof aria !== 'object') return {}
|
61
|
-
const { label } = aria
|
62
|
-
|
63
|
-
const ariaProps = {}
|
64
|
-
|
65
|
-
if (label !== null) ariaProps['aria-label'] = label
|
66
|
-
|
67
|
-
return ariaProps
|
68
|
-
}
|
69
|
-
|
70
56
|
const Button = (props: ButtonPropTypes) => {
|
71
57
|
const {
|
58
|
+
aria = {},
|
72
59
|
children,
|
73
60
|
className,
|
74
61
|
data = {},
|
@@ -84,7 +71,7 @@ const Button = (props: ButtonPropTypes) => {
|
|
84
71
|
value,
|
85
72
|
} = props
|
86
73
|
|
87
|
-
const
|
74
|
+
const ariaProps = buildAriaProps(aria)
|
88
75
|
const dataProps = buildDataProps(data)
|
89
76
|
const css = classnames(
|
90
77
|
buttonClassName(props),
|
@@ -114,11 +101,12 @@ const Button = (props: ButtonPropTypes) => {
|
|
114
101
|
return (
|
115
102
|
<If condition={link !== null}>
|
116
103
|
<a
|
117
|
-
{...
|
104
|
+
{...ariaProps}
|
118
105
|
{...dataProps}
|
119
106
|
className={css}
|
120
107
|
href={link}
|
121
108
|
id={id}
|
109
|
+
role="link"
|
122
110
|
target={newWindow ? '_blank' : null}
|
123
111
|
>
|
124
112
|
<If condition={loading}>{loadingIcon}</If>
|
@@ -126,12 +114,13 @@ const Button = (props: ButtonPropTypes) => {
|
|
126
114
|
</a>
|
127
115
|
<Else />
|
128
116
|
<button
|
129
|
-
{...
|
117
|
+
{...ariaProps}
|
130
118
|
{...dataProps}
|
131
119
|
className={css}
|
132
120
|
disabled={disabled}
|
133
121
|
id={id}
|
134
122
|
onClick={onClick}
|
123
|
+
role="button"
|
135
124
|
type={htmlType}
|
136
125
|
value={value}
|
137
126
|
>
|
@@ -21,11 +21,12 @@ module Playbook
|
|
21
21
|
|
22
22
|
def options
|
23
23
|
{
|
24
|
-
|
25
|
-
data: data,
|
24
|
+
aria: aria,
|
26
25
|
class: classname,
|
26
|
+
data: data,
|
27
27
|
disabled: disabled,
|
28
|
-
|
28
|
+
id: id,
|
29
|
+
role: "button",
|
29
30
|
type: type,
|
30
31
|
value: value,
|
31
32
|
}.compact
|
@@ -34,7 +35,8 @@ module Playbook
|
|
34
35
|
def link_options
|
35
36
|
options.merge(
|
36
37
|
href: link,
|
37
|
-
|
38
|
+
role: "link",
|
39
|
+
target: new_window ? "_blank" : "_self",
|
38
40
|
)
|
39
41
|
end
|
40
42
|
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "
|
1
|
+
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com" }) %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "A Tag Button", tag: "a", link: "http://google.com" }) %>
|
2
|
-
<%= pb_rails("button", props: { text: "Open in new Window", new_window: true, link: "http://google.com" }) %>
|
3
|
-
<%= pb_rails("button", props: { text: "A Tag Button Disabled", disabled: true, link: "http://google.com" }) %>
|
1
|
+
<%= pb_rails("button", props: { text: "A Tag Button", aria: { label: "Link to Google" }, tag: "a", link: "http://google.com" }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Open in new Window", aria: { label: "Link to Google in new window" }, new_window: true, link: "http://google.com" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "A Tag Button Disabled", aria: { label: "Disabled link to Google" }, disabled: true, link: "http://google.com" }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLink = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Link to Google' }}
|
7
8
|
link="https://google.com"
|
8
9
|
text="A Tag Button"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Link to Google in new window' }}
|
13
15
|
link="https://google.com"
|
14
16
|
newWindow
|
15
17
|
text="Open in New Window"
|
@@ -17,6 +19,7 @@ const ButtonLink = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Disabled link to Google' }}
|
20
23
|
disabled
|
21
24
|
link="https://google.com"
|
22
25
|
text="A Tag Button Disabled"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button Primary", loading: true }) %>
|
2
|
-
<%= pb_rails("button", props: { text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
-
<%= pb_rails("button", props: { text: "Button Primary", variant: "link", loading: true }) %>
|
1
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", loading: true }) %>
|
2
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "link", loading: true }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLoading = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Loading' }}
|
7
8
|
loading
|
8
9
|
text="Button Primary"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Loading' }}
|
13
15
|
loading
|
14
16
|
text="Button Secondary"
|
15
17
|
variant="secondary"
|
@@ -17,6 +19,7 @@ const ButtonLoading = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Loading' }}
|
20
23
|
loading
|
21
24
|
text="A Tag Button Disabled"
|
22
25
|
variant="link"
|
@@ -6,37 +6,36 @@ module Playbook
|
|
6
6
|
prop :chart_data, type: Playbook::Props::Array,
|
7
7
|
default: []
|
8
8
|
prop :style, type: Playbook::Props::Enum,
|
9
|
-
|
10
|
-
|
9
|
+
values: %w[pie],
|
10
|
+
default: "pie"
|
11
11
|
|
12
12
|
prop :data_labels, type: Playbook::Props::Boolean, default: false
|
13
13
|
prop :min_point_size, type: Playbook::Props::Numeric
|
14
14
|
prop :max_point_size, type: Playbook::Props::Numeric
|
15
15
|
prop :inner_size, type: Playbook::Props::Enum,
|
16
|
-
|
17
|
-
|
16
|
+
values: %w[sm md lg none],
|
17
|
+
default: "md"
|
18
18
|
prop :z_min, type: Playbook::Props::Numeric
|
19
19
|
prop :start_angle, type: Playbook::Props::Numeric
|
20
20
|
prop :header_format
|
21
|
-
prop :data_label_html, default:
|
21
|
+
prop :data_label_html, default: "<div>{point.name}</div>"
|
22
22
|
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">●</span>
|
23
23
|
{point.name}: ' + '<b>{point.y}
|
24
24
|
</b>'
|
25
25
|
prop :use_html, type: Playbook::Props::Boolean, default: false
|
26
26
|
prop :legend, type: Playbook::Props::Boolean, default: false
|
27
|
-
prop :title, default:
|
27
|
+
prop :title, default: ""
|
28
28
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
29
29
|
prop :colors, type: Playbook::Props::Array,
|
30
30
|
default: []
|
31
31
|
|
32
|
-
|
33
32
|
def chart_type
|
34
33
|
style == "variablepie" ? "variablepie" : "pie"
|
35
34
|
end
|
36
35
|
|
37
36
|
def chart_data_formatted
|
38
|
-
chart_data.map{ |hash| hash[:y] = hash.delete :value}
|
39
|
-
|
37
|
+
chart_data.map { |hash| hash[:y] = hash.delete :value }
|
38
|
+
chart_data
|
40
39
|
end
|
41
40
|
|
42
41
|
def inner_size_format
|
@@ -57,7 +56,7 @@ module Playbook
|
|
57
56
|
end
|
58
57
|
|
59
58
|
def rounded_border_color
|
60
|
-
rounded == true ?
|
59
|
+
rounded == true ? "null" : nil
|
61
60
|
end
|
62
61
|
|
63
62
|
def chart_options
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Playbook
|
2
4
|
module PbCircleIconButton
|
3
5
|
class CircleIconButton < Playbook::KitBase
|
@@ -8,11 +10,11 @@ module Playbook
|
|
8
10
|
values: %w[primary secondary link],
|
9
11
|
default: "primary"
|
10
12
|
prop :disabled, type: Playbook::Props::Boolean,
|
11
|
-
|
13
|
+
default: false
|
12
14
|
prop :icon, required: true
|
13
15
|
prop :link
|
14
16
|
prop :new_window, type: Playbook::Props::Boolean,
|
15
|
-
|
17
|
+
default: false
|
16
18
|
def classname
|
17
19
|
generate_classname("pb_circle_icon_button_kit")
|
18
20
|
end
|
@@ -5,13 +5,13 @@ module Playbook
|
|
5
5
|
class DateStacked < Playbook::KitBase
|
6
6
|
prop :date, type: Playbook::Props::Date, required: true
|
7
7
|
prop :align, type: Playbook::Props::Enum,
|
8
|
-
|
9
|
-
|
8
|
+
values: %w[left center right],
|
9
|
+
default: "left"
|
10
10
|
prop :size, type: Playbook::Props::Enum,
|
11
11
|
values: %w[sm md],
|
12
12
|
default: "sm"
|
13
13
|
prop :reverse, type: Playbook::Props::Boolean,
|
14
|
-
|
14
|
+
default: false
|
15
15
|
prop :dark, type: Playbook::Props::Boolean,
|
16
16
|
default: false
|
17
17
|
|
@@ -20,20 +20,20 @@ module Playbook
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def title_size
|
23
|
-
size == "md" ? 3: 4
|
23
|
+
size == "md" ? 3 : 4
|
24
24
|
end
|
25
25
|
|
26
26
|
def day
|
27
27
|
day = Playbook::PbKit::PbDateTime.new(date)
|
28
28
|
content_tag(:time, datetime: day.to_iso) do
|
29
|
-
|
29
|
+
day.to_day.to_s
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
def month
|
34
34
|
month = Playbook::PbKit::PbDateTime.new(date)
|
35
35
|
content_tag(:time, datetime: month.to_iso) do
|
36
|
-
|
36
|
+
month.to_month.to_s
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -42,9 +42,8 @@ module Playbook
|
|
42
42
|
year = Playbook::PbKit::PbDateTime.new(date).to_year.to_i
|
43
43
|
if current_year != year
|
44
44
|
content_tag(:time, datetime: year) do
|
45
|
-
|
45
|
+
year.to_s
|
46
46
|
end
|
47
|
-
else
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
@@ -57,7 +56,6 @@ module Playbook
|
|
57
56
|
def dark_class
|
58
57
|
dark ? "dark" : nil
|
59
58
|
end
|
60
|
-
|
61
59
|
end
|
62
60
|
end
|
63
61
|
end
|
@@ -7,9 +7,9 @@ module Playbook
|
|
7
7
|
values: %w[lg sm],
|
8
8
|
default: "lg"
|
9
9
|
prop :widths, type: Playbook::Props::NumberArray,
|
10
|
-
|
10
|
+
default: [1]
|
11
11
|
prop :colors, type: Playbook::Props::Array,
|
12
|
-
|
12
|
+
default: []
|
13
13
|
|
14
14
|
def classname
|
15
15
|
generate_classname("pb_distribution_bar", size)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbFilter
|
5
5
|
class Filter < Playbook::KitBase
|
6
|
-
prop :filters, type: Playbook::Props::HashArray, default: [{name:
|
6
|
+
prop :filters, type: Playbook::Props::HashArray, default: [{ name: "" }]
|
7
7
|
prop :sort_menu, type: Playbook::Props::HashArray, default: [{}]
|
8
8
|
prop :results, type: Playbook::Props::Numeric
|
9
9
|
prop :template, type: Playbook::Props::Enum,
|
@@ -74,8 +74,8 @@ module Playbook
|
|
74
74
|
def horizontal_class
|
75
75
|
if orientation == "row"
|
76
76
|
"justify_content_#{horizontal}"
|
77
|
-
|
78
|
-
"align_items_#{horizontal}"
|
77
|
+
elsif align == "none"
|
78
|
+
"align_items_#{horizontal}"
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -102,8 +102,8 @@ module Playbook
|
|
102
102
|
def vertical_class
|
103
103
|
if orientation == "row"
|
104
104
|
"align_items_#{vertical}"
|
105
|
-
|
106
|
-
"justify_content_#{vertical}"
|
105
|
+
elsif justify == "none"
|
106
|
+
"justify_content_#{vertical}"
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -15,9 +15,9 @@ export default function useZxcvbn(options) {
|
|
15
15
|
|
16
16
|
useEffect(() => {
|
17
17
|
if (confirmation) return
|
18
|
-
|
19
|
-
setResult(
|
20
|
-
const str =
|
18
|
+
const newResult = calculator(passphrase)
|
19
|
+
setResult(newResult)
|
20
|
+
const str = newResult.score
|
21
21
|
|
22
22
|
const noPassphrase = passphrase.length <= 0
|
23
23
|
const commonPassphrase = common || isPwned
|
@@ -9,7 +9,7 @@ module Playbook
|
|
9
9
|
prop :icon, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
11
|
prop :show_icon, type: Playbook::Props::Boolean,
|
12
|
-
|
12
|
+
default: false
|
13
13
|
prop :variant, type: Playbook::Props::Enum,
|
14
14
|
values: %w[default tracker],
|
15
15
|
default: "default"
|
@@ -10,7 +10,7 @@ module Playbook
|
|
10
10
|
default: false
|
11
11
|
|
12
12
|
prop :sticky, type: Playbook::Props::Boolean,
|
13
|
-
|
13
|
+
default: false
|
14
14
|
|
15
15
|
prop :value
|
16
16
|
prop :template
|
@@ -41,7 +41,7 @@ module Playbook
|
|
41
41
|
sticky: sticky,
|
42
42
|
value: value,
|
43
43
|
template: template,
|
44
|
-
placeholder: placeholder
|
44
|
+
placeholder: placeholder,
|
45
45
|
}
|
46
46
|
end
|
47
47
|
end
|
@@ -21,18 +21,14 @@ module Playbook
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def returned_icon
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
else
|
33
|
-
false
|
34
|
-
end
|
35
|
-
end
|
24
|
+
icon || case change
|
25
|
+
when "increase"
|
26
|
+
"arrow-up"
|
27
|
+
when "decrease"
|
28
|
+
"arrow-down"
|
29
|
+
else
|
30
|
+
false
|
31
|
+
end
|
36
32
|
end
|
37
33
|
|
38
34
|
def classname
|
@@ -1,3 +1,3 @@
|
|
1
|
-
Side highlight can take product, status, and category colors. To view full list of colors, visit <a href="https://playbook.powerapp.cloud/
|
1
|
+
Side highlight can take product, status, and category colors. To view full list of colors, visit <a href="https://playbook.powerapp.cloud/visual_guidelines" target="_blank">token colors</a>.
|
2
2
|
|
3
3
|
Note: Only use category colors for categories. Do not mix it with product or status colors.
|
@@ -16,7 +16,7 @@ module Playbook
|
|
16
16
|
button(value, props: props)
|
17
17
|
end
|
18
18
|
|
19
|
-
def button(
|
19
|
+
def button(_value = nil, props:)
|
20
20
|
view_context.content_tag(:li) do
|
21
21
|
view_context.pb_rails("button", props: props)
|
22
22
|
end
|
@@ -28,4 +28,4 @@ module Playbook
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
31
|
-
end
|
31
|
+
end
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Playbook
|
4
4
|
module Forms
|
5
5
|
class Builder
|
6
|
-
def collection_select(name, collection, value_method, text_method, options = {}, html_options = {}, props: {}
|
6
|
+
def collection_select(name, collection, value_method, text_method, options = {}, html_options = {}, props: {})
|
7
7
|
props[:label] = @template.label(@object_name, name) if props[:label] == true
|
8
|
-
options[:skip_default_ids] = false unless options.
|
8
|
+
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
9
9
|
options[:prompt] = props[:blank_selection] || ""
|
10
10
|
html_options[:required] = "required" if props[:required]
|
11
11
|
input = super(name, collection, value_method, text_method, options, html_options)
|
@@ -5,7 +5,7 @@ module Playbook
|
|
5
5
|
class Builder
|
6
6
|
def select(name, choices = nil, options = {}, html_options = {}, props: {}, &block)
|
7
7
|
props[:label] = @template.label(@object_name, name) if props[:label] == true
|
8
|
-
options[:skip_default_ids] = false unless options.
|
8
|
+
options[:skip_default_ids] = false unless options.key?(:skip_default_ids)
|
9
9
|
options[:prompt] = props[:blank_selection] || ""
|
10
10
|
html_options[:required] = "required" if props[:required]
|
11
11
|
input = super(name, choices, options, html_options, &block)
|
@@ -8,7 +8,7 @@ module Playbook
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize
|
11
|
-
@cache = Hash.new do |
|
11
|
+
@cache = Hash.new do |_cache, kit_name|
|
12
12
|
is_subkit = kit_name.match(%r{[/\\]})
|
13
13
|
folder = is_subkit ? kit_name.split("/")[0] : kit_name
|
14
14
|
item = is_subkit ? kit_name.split("/")[-1] : kit_name
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "redcarpet"
|
2
4
|
|
3
5
|
module Playbook
|
4
6
|
module Markdown
|
@@ -20,7 +22,7 @@ module Playbook
|
|
20
22
|
markdown.render(template).html_safe
|
21
23
|
end
|
22
24
|
|
23
|
-
|
25
|
+
private
|
24
26
|
|
25
27
|
def md_options
|
26
28
|
@md_options ||= {
|
@@ -16,7 +16,7 @@ module Playbook
|
|
16
16
|
example_key: example.keys.first,
|
17
17
|
show_code: show_code,
|
18
18
|
type: type,
|
19
|
-
dark: dark_mode
|
19
|
+
dark: dark_mode,
|
20
20
|
}
|
21
21
|
end.join.yield_self(&method(:raw))
|
22
22
|
end
|
@@ -41,10 +41,12 @@ module Playbook
|
|
41
41
|
raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
|
42
42
|
end
|
43
43
|
|
44
|
+
# rubocop:disable Naming/AccessorMethodName
|
44
45
|
def get_kits
|
45
46
|
menu = YAML.load_file(Playbook::Engine.root.join("app/pb_kits/playbook/data/menu.yml"))
|
46
47
|
menu["kits"]
|
47
48
|
end
|
49
|
+
# rubocop:enable Naming/AccessorMethodName
|
48
50
|
|
49
51
|
def render_pb_doc_kit(kit, type, limit_examples, code = true, dark_mode = false)
|
50
52
|
title = pb_doc_render_clickable_title(kit, type)
|
@@ -78,7 +80,7 @@ module Playbook
|
|
78
80
|
else
|
79
81
|
kit_show_path(kit)
|
80
82
|
end
|
81
|
-
# FIXME this is here because this helper generates a link for playbook website,
|
83
|
+
# FIXME: this is here because this helper generates a link for playbook website,
|
82
84
|
# but shouldn't do anything when used elsewhere
|
83
85
|
rescue
|
84
86
|
puts "Kit Path Not Avaliable"
|
data/lib/playbook/props.rb
CHANGED
@@ -36,9 +36,6 @@ module Playbook
|
|
36
36
|
self.class.props[name].value values[name]
|
37
37
|
end
|
38
38
|
|
39
|
-
attr_accessor :values
|
40
|
-
private :values, :values=
|
41
|
-
|
42
39
|
included do
|
43
40
|
class_attribute :props, default: {}
|
44
41
|
end
|
@@ -50,7 +47,7 @@ module Playbook
|
|
50
47
|
end
|
51
48
|
|
52
49
|
def prop(name, type: Playbook::Props::String, **options)
|
53
|
-
self.props =
|
50
|
+
self.props = props.merge(name => type.new(options.merge(name: name, kit: self)))
|
54
51
|
|
55
52
|
define_method(name) { prop(name) }
|
56
53
|
end
|
data/lib/playbook/props/base.rb
CHANGED
@@ -20,7 +20,7 @@ module Playbook
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def validate!(input_value)
|
23
|
-
warn("#{kit} Kit: The prop '#{name}' is deprecated and will be removed in a future release!") if deprecated && input_value #TODO: add some color for pop
|
23
|
+
warn("#{kit} Kit: The prop '#{name}' is deprecated and will be removed in a future release!") if deprecated && input_value # TODO: add some color for pop
|
24
24
|
|
25
25
|
raise(Playbook::Props::Error, "#{kit} prop '#{name}' of type #{inspect.class} is required and needs a value") if required && input_value.nil?
|
26
26
|
|
@@ -40,7 +40,6 @@ module Playbook
|
|
40
40
|
|
41
41
|
def log(message)
|
42
42
|
logger = ActiveSupport::Logger.new(STDOUT)
|
43
|
-
log_formatter = ::Logger::Formatter.new
|
44
43
|
@logger ||= ActiveSupport::TaggedLogging.new(logger)
|
45
44
|
@logger.log(0, message)
|
46
45
|
end
|
data/lib/playbook/version.rb
CHANGED
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: 9.
|
4
|
+
version: 9.11.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: 2021-04
|
12
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 5.2.4.
|
20
|
+
version: 5.2.4.5
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '7.0'
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 5.2.4.
|
30
|
+
version: 5.2.4.5
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '7.0'
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.2.4.
|
40
|
+
version: 5.2.4.5
|
41
41
|
- - "<"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '7.0'
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 5.2.4.
|
50
|
+
version: 5.2.4.5
|
51
51
|
- - "<"
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '7.0'
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 5.2.4.
|
60
|
+
version: 5.2.4.5
|
61
61
|
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '7.0'
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
requirements:
|
68
68
|
- - ">="
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 5.2.4.
|
70
|
+
version: 5.2.4.5
|
71
71
|
- - "<"
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '7.0'
|
@@ -282,39 +282,39 @@ dependencies:
|
|
282
282
|
- !ruby/object:Gem::Version
|
283
283
|
version: 2.2.2
|
284
284
|
- !ruby/object:Gem::Dependency
|
285
|
-
name: rspec-
|
285
|
+
name: rspec-html-matchers
|
286
286
|
requirement: !ruby/object:Gem::Requirement
|
287
287
|
requirements:
|
288
|
-
- -
|
289
|
-
- !ruby/object:Gem::Version
|
290
|
-
version: '3.8'
|
291
|
-
- - ">="
|
288
|
+
- - '='
|
292
289
|
- !ruby/object:Gem::Version
|
293
|
-
version:
|
290
|
+
version: 0.9.1
|
294
291
|
type: :development
|
295
292
|
prerelease: false
|
296
293
|
version_requirements: !ruby/object:Gem::Requirement
|
297
294
|
requirements:
|
298
|
-
- -
|
299
|
-
- !ruby/object:Gem::Version
|
300
|
-
version: '3.8'
|
301
|
-
- - ">="
|
295
|
+
- - '='
|
302
296
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
297
|
+
version: 0.9.1
|
304
298
|
- !ruby/object:Gem::Dependency
|
305
|
-
name: rspec-
|
299
|
+
name: rspec-rails
|
306
300
|
requirement: !ruby/object:Gem::Requirement
|
307
301
|
requirements:
|
308
|
-
- -
|
302
|
+
- - ">="
|
309
303
|
- !ruby/object:Gem::Version
|
310
|
-
version:
|
304
|
+
version: 3.8.0
|
305
|
+
- - "~>"
|
306
|
+
- !ruby/object:Gem::Version
|
307
|
+
version: '3.8'
|
311
308
|
type: :development
|
312
309
|
prerelease: false
|
313
310
|
version_requirements: !ruby/object:Gem::Requirement
|
314
311
|
requirements:
|
315
|
-
- -
|
312
|
+
- - ">="
|
316
313
|
- !ruby/object:Gem::Version
|
317
|
-
version:
|
314
|
+
version: 3.8.0
|
315
|
+
- - "~>"
|
316
|
+
- !ruby/object:Gem::Version
|
317
|
+
version: '3.8'
|
318
318
|
- !ruby/object:Gem::Dependency
|
319
319
|
name: rubocop
|
320
320
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2123,7 +2123,7 @@ homepage: http://playbook.powerapp.cloud
|
|
2123
2123
|
licenses:
|
2124
2124
|
- MIT
|
2125
2125
|
metadata: {}
|
2126
|
-
post_install_message:
|
2126
|
+
post_install_message:
|
2127
2127
|
rdoc_options: []
|
2128
2128
|
require_paths:
|
2129
2129
|
- lib
|
@@ -2138,8 +2138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2138
2138
|
- !ruby/object:Gem::Version
|
2139
2139
|
version: '0'
|
2140
2140
|
requirements: []
|
2141
|
-
rubygems_version: 3.
|
2142
|
-
signing_key:
|
2141
|
+
rubygems_version: 3.0.3
|
2142
|
+
signing_key:
|
2143
2143
|
specification_version: 4
|
2144
2144
|
summary: Playbook Design System
|
2145
2145
|
test_files: []
|