playbook_ui 12.31.0.pre.alpha.datepickerdisableddatefix931 → 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/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_date_picker/date_picker_helper.ts +31 -37
- 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 +2 -2
- 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 -2
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
|
@@ -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
|
@@ -71,42 +71,13 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
71
71
|
}
|
72
72
|
}
|
73
73
|
const disabledParser = () => {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
82
|
-
|
83
|
-
const disabledWeekDays = () => {
|
84
|
-
return (
|
85
|
-
[
|
86
|
-
(date:any) => {
|
87
|
-
const weekdayObj: {
|
88
|
-
[day: string]: number
|
89
|
-
} = {
|
90
|
-
Sunday: 0,
|
91
|
-
Monday: 1,
|
92
|
-
Tuesday: 2,
|
93
|
-
Wednesday: 3,
|
94
|
-
Thursday: 4,
|
95
|
-
Friday: 5,
|
96
|
-
Saturday: 6,
|
97
|
-
}
|
98
|
-
return (
|
99
|
-
date.getDay() === weekdayObj[disableWeekdays[0]] ||
|
100
|
-
date.getDay() === weekdayObj[disableWeekdays[1]] ||
|
101
|
-
date.getDay() === weekdayObj[disableWeekdays[2]] ||
|
102
|
-
date.getDay() === weekdayObj[disableWeekdays[3]] ||
|
103
|
-
date.getDay() === weekdayObj[disableWeekdays[4]] ||
|
104
|
-
date.getDay() === weekdayObj[disableWeekdays[5]] ||
|
105
|
-
date.getDay() === weekdayObj[disableWeekdays[6]]
|
106
|
-
)
|
107
|
-
},
|
108
|
-
]
|
109
|
-
)
|
74
|
+
if (disableDate && disableDate.length > 0) {
|
75
|
+
return disableDate
|
76
|
+
} else if (disableRange && disableRange.length > 0) {
|
77
|
+
return disableRange
|
78
|
+
} else {
|
79
|
+
return []
|
80
|
+
}
|
110
81
|
}
|
111
82
|
const calendarResizer = () => {
|
112
83
|
const cal = document.querySelector(`#cal-${pickerId}.open`) as HTMLElement
|
@@ -156,7 +127,30 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
|
|
156
127
|
disableMobile: true,
|
157
128
|
dateFormat: getDateFormat(),
|
158
129
|
defaultDate: defaultDateGetter(),
|
159
|
-
disable:
|
130
|
+
disable: disableWeekdays && disableWeekdays.length > 0 ? [
|
131
|
+
(date) => {
|
132
|
+
const weekdayObj: {
|
133
|
+
[day: string]: number
|
134
|
+
} = {
|
135
|
+
Sunday: 0,
|
136
|
+
Monday: 1,
|
137
|
+
Tuesday: 2,
|
138
|
+
Wednesday: 3,
|
139
|
+
Thursday: 4,
|
140
|
+
Friday: 5,
|
141
|
+
Saturday: 6,
|
142
|
+
}
|
143
|
+
return (
|
144
|
+
date.getDay() === weekdayObj[disableWeekdays[0]] ||
|
145
|
+
date.getDay() === weekdayObj[disableWeekdays[1]] ||
|
146
|
+
date.getDay() === weekdayObj[disableWeekdays[2]] ||
|
147
|
+
date.getDay() === weekdayObj[disableWeekdays[3]] ||
|
148
|
+
date.getDay() === weekdayObj[disableWeekdays[4]] ||
|
149
|
+
date.getDay() === weekdayObj[disableWeekdays[5]] ||
|
150
|
+
date.getDay() === weekdayObj[disableWeekdays[6]]
|
151
|
+
)
|
152
|
+
},
|
153
|
+
] : disabledParser(),
|
160
154
|
enableTime,
|
161
155
|
locale: {
|
162
156
|
rangeSeparator: ' to '
|
@@ -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
|
},
|