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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 654d556d34f5a4d85545aff221a0ad40d54b0f09c6f5a26d74dbd99b346ce57d
4
- data.tar.gz: 3ae3d76e2d79224c105d7b8c53c7f7c9033cda03505d55cc4222262926e9a580
3
+ metadata.gz: 254f8095f89f90a26b48bf1de3f6ebe8457f324bfaf89d2c0a44921b3dae9b0f
4
+ data.tar.gz: b1980a1c1d435f4b34c7e4ba81ae9eecdb2b7afea98b71e00f3cace1e2d0375d
5
5
  SHA512:
6
- metadata.gz: 1e0ed9fa251b5130bcdfc146ea0e1144b2273424c5f8171fc12b573ada98fbf2ca743d7467602d6d904b65c16fb8976ed51133461bb6497cff4dc038823100b4
7
- data.tar.gz: a8dcf56f0adeed47b1e403318feec0a711f9d45dbc6617e26bdb19533fe055552a61bfeb05663141b49d28810f12f3e62397f8177ffa07e6510533a5972f1b5b
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
- const disabledArray=[]
75
-
76
- disableDate && disableDate.length > 0 && disabledArray.push(...disableDate)
77
- disableRange && disableRange.length > 0 && disabledArray.push(...disableRange)
78
- disableWeekdays && disableWeekdays.length > 0 && disabledArray.push(...disabledWeekDays())
79
-
80
- return disabledArray
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: disabledParser(),
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>
@@ -3,6 +3,7 @@ examples:
3
3
  rails:
4
4
  - message_default: Default
5
5
  - message_timestamp: With Timestamp Hover
6
+ - message_hover: Hover
6
7
 
7
8
 
8
9
  react:
@@ -2,7 +2,7 @@
2
2
 
3
3
  @mixin hover-color-classes($colors-list) {
4
4
  @each $name, $color in $colors-list {
5
- .bg-hover-#{$name}:hover {
5
+ .hover_background_#{$name}:hover {
6
6
  background-color: $color !important;
7
7
  transition: background-color $transition-speed ease;
8
8
  }
@@ -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 ? `bg-hover-${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
  },