playbook_ui 12.31.0.pre.alpha.customiconsfa928 → 12.31.0.pre.alpha.hoverrails948
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 -2
- data/app/pb_kits/playbook/pb_button/docs/_button_hover.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +9 -9
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +3 -9
- data/app/pb_kits/playbook/pb_icon/icon.rb +2 -8
- data/app/pb_kits/playbook/pb_message/docs/_message_hover.html.erb +25 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +1 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +1 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/border_radius.rb +29 -0
- data/lib/playbook/classnames.rb +2 -0
- data/lib/playbook/hover.rb +62 -0
- data/lib/playbook/kit_base.rb +4 -0
- data/lib/playbook/version.rb +1 -1
- metadata +6 -3
- data/app/pb_kits/playbook/custom-icons.js +0 -355
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 254f8095f89f90a26b48bf1de3f6ebe8457f324bfaf89d2c0a44921b3dae9b0f
|
4
|
+
data.tar.gz: b1980a1c1d435f4b34c7e4ba81ae9eecdb2b7afea98b71e00f3cace1e2d0375d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef083fc09e3d71541460a673a3aa189d079cb856e617e1d8d2d38240e1dcfa9155f85563eb0fb26f778497211671ff439ea1f9132233a8487b28cd0cd0d75d73
|
7
|
+
data.tar.gz: ea8fde568dad79fd58c452af6850c7fed616b8fe339a71ccbe60cd2e0aee0ecd225e347469242a73878dde5a327120f2080bbc670394934b9078aa3f30f5c392
|
@@ -2,7 +2,6 @@
|
|
2
2
|
import './_playbook.scss'
|
3
3
|
import 'lazysizes/plugins/attrchange/ls.attrchange'
|
4
4
|
import 'lazysizes'
|
5
|
-
import './custom-icons'
|
6
5
|
|
7
6
|
// vvv React Component JSX Imports from the React Kits vvv
|
8
7
|
export { default as Avatar } from './pb_avatar/_avatar'
|
@@ -130,4 +129,4 @@ export { default as PbTypeahead } from './pb_typeahead'
|
|
130
129
|
export { default as dialogHelper } from './pb_dialog/dialogHelper'
|
131
130
|
|
132
131
|
//Theming
|
133
|
-
export {default as mapTheme} from './pb_map/pbMapTheme'
|
132
|
+
export {default as mapTheme} from './pb_map/pbMapTheme'
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<%= pb_rails("button", props: { hover: { shadow: "deep"}, text: "Shadow Deep", margin_right: "lg" }) %>
|
2
|
+
<%= pb_rails("button", props: { hover: { shadow: "deeper"}, text: "Shadow Deeper", margin_right: "lg" }) %>
|
3
|
+
<%= pb_rails("button", props: { hover: { shadow: "deepest"}, text: "Shadow Deepest", margin_right: "lg" }) %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
3
|
- button_default: Button Variants
|
4
|
-
- button_full_width: Button Full Width
|
5
|
-
- button_link: Button Links
|
6
|
-
- button_loading: Button Loading
|
7
|
-
- button_block_content: Button Block Content
|
8
|
-
- button_icon_options: Button Icon Options
|
9
|
-
- button_accessibility: Button Accessibility Options
|
10
|
-
- button_options: Button Additional Options
|
11
|
-
- button_size: Button Size
|
12
|
-
- button_form: Button Form Attribute
|
4
|
+
# - button_full_width: Button Full Width
|
5
|
+
# - button_link: Button Links
|
6
|
+
# - button_loading: Button Loading
|
7
|
+
# - button_block_content: Button Block Content
|
8
|
+
# - button_icon_options: Button Icon Options
|
9
|
+
# - button_accessibility: Button Accessibility Options
|
10
|
+
# - button_options: Button Additional Options
|
11
|
+
# - button_size: Button Size
|
12
|
+
# - button_form: Button Form Attribute
|
13
13
|
react:
|
14
14
|
- button_default: Button Variants
|
15
15
|
- button_full_width: Button Full Width
|
@@ -34,7 +34,7 @@ type IconProps = {
|
|
34
34
|
pulse?: boolean,
|
35
35
|
rotation?: 90 | 180 | 270,
|
36
36
|
size?: IconSizes,
|
37
|
-
fontStyle?: 'far' | 'fas' | 'fab'
|
37
|
+
fontStyle?: 'far' | 'fas' | 'fab',
|
38
38
|
spin?: boolean,
|
39
39
|
} & GlobalProps
|
40
40
|
|
@@ -76,7 +76,6 @@ const Icon = (props: IconProps) => {
|
|
76
76
|
[`fa-${size}`]: size,
|
77
77
|
[`fa-pull-${pull}`]: pull,
|
78
78
|
[`fa-rotate-${rotation}`]: rotation,
|
79
|
-
|
80
79
|
}
|
81
80
|
|
82
81
|
// Lets check and see if the icon prop is referring to a custom Power icon...
|
@@ -84,15 +83,11 @@ const Icon = (props: IconProps) => {
|
|
84
83
|
// this ensures the JS will not do any further operations
|
85
84
|
// faClasses[`fa-${icon}`] = customIcon ? 'custom' : icon
|
86
85
|
if (!customIcon) faClasses[`fa-${icon}`] = icon
|
87
|
-
|
88
|
-
const whiteList = [
|
89
|
-
'greensky', 'powergon'
|
90
|
-
]
|
91
|
-
|
86
|
+
|
92
87
|
const classes = classnames(
|
93
88
|
flipMap[flip],
|
94
89
|
'pb_icon_kit',
|
95
|
-
customIcon ? '' :
|
90
|
+
customIcon ? '' : fontStyle,
|
96
91
|
faClasses,
|
97
92
|
globalProps(props),
|
98
93
|
className
|
@@ -115,7 +110,6 @@ const Icon = (props: IconProps) => {
|
|
115
110
|
return emojiRegex.test(emoji);
|
116
111
|
};
|
117
112
|
|
118
|
-
|
119
113
|
// Add a conditional here to show only the SVG if custom
|
120
114
|
const displaySVG = (customIcon: any) => {
|
121
115
|
if (customIcon)
|
@@ -33,7 +33,7 @@ module Playbook
|
|
33
33
|
values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
|
34
34
|
default: nil
|
35
35
|
prop :font_style, type: Playbook::Props::Enum,
|
36
|
-
values: %w[far fas fab
|
36
|
+
values: %w[far fas fab],
|
37
37
|
default: "far"
|
38
38
|
prop :spin, type: Playbook::Props::Boolean,
|
39
39
|
default: false
|
@@ -140,13 +140,7 @@ module Playbook
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def font_style_class
|
143
|
-
|
144
|
-
|
145
|
-
if white_list.include?(icon)
|
146
|
-
"fak"
|
147
|
-
elsif font_style
|
148
|
-
font_style.to_s
|
149
|
-
end
|
143
|
+
font_style ? font_style.to_s : "far"
|
150
144
|
end
|
151
145
|
|
152
146
|
def spin_class
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= pb_rails("message", props: {
|
2
|
+
avatar_name: "Mike Bishop",
|
3
|
+
avatar_status: "online",
|
4
|
+
avatar_url: "https://randomuser.me/api/portraits/men/50.jpg",
|
5
|
+
border_radius: "rounded",
|
6
|
+
hover: { background: "success_subtle" },
|
7
|
+
label: "Anna Black",
|
8
|
+
message: "How can we assist you today?",
|
9
|
+
padding: "xs",
|
10
|
+
}) %>
|
11
|
+
|
12
|
+
<br><br>
|
13
|
+
|
14
|
+
<%= pb_rails("message", props: {
|
15
|
+
align_timestamp: "left",
|
16
|
+
avatar_name: "Lucille Sanchez",
|
17
|
+
avatar_url: "https://randomuser.me/api/portraits/women/50.jpg",
|
18
|
+
border_radius: "rounded",
|
19
|
+
hover: { shadow: "deepest" },
|
20
|
+
label: "Becca Jacobs",
|
21
|
+
message: "Application for Kate Smith is waiting for your approval",
|
22
|
+
padding: "xs",
|
23
|
+
}) %>
|
24
|
+
|
25
|
+
<br><br>
|
@@ -147,7 +147,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
147
147
|
let css = '';
|
148
148
|
if (!hover) return css;
|
149
149
|
css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
|
150
|
-
css += hover.background ? `
|
150
|
+
css += hover.background ? `hover_background_${hover.background } ` : '';
|
151
151
|
css += hover.scale ? `hover_scale_${hover.scale} ` : '';
|
152
152
|
return css;
|
153
153
|
},
|