playbook_ui 12.31.0.pre.alpha.datepickerdisableddatefix931 → 12.31.0.pre.alpha.hoverrails951

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: 3126e0971e1092c47d8dfa988f36a2dca2ac152bd0ef7f5437d44ef25696931e
4
+ data.tar.gz: e25f1f5019db99a6b314df9c6eda14cdd4a63ac544b160c0d8d044418b25c6ff
5
5
  SHA512:
6
- metadata.gz: 1e0ed9fa251b5130bcdfc146ea0e1144b2273424c5f8171fc12b573ada98fbf2ca743d7467602d6d904b65c16fb8976ed51133461bb6497cff4dc038823100b4
7
- data.tar.gz: a8dcf56f0adeed47b1e403318feec0a711f9d45dbc6617e26bdb19533fe055552a61bfeb05663141b49d28810f12f3e62397f8177ffa07e6510533a5972f1b5b
6
+ metadata.gz: 8a3838e0866216c40824eb2fa6e314a4e80c5b3c189b1e15402f7e326dcfb5246580504684a09691e9ebdbdb7d91aaca1fe5824f6c69b95cd85d5e1241b2f10b
7
+ data.tar.gz: d69a65e9e3b64dcef3a777a63d20e2bded1768d791dd1b48117d026a7f1b7ce59d4ead07c4ce523644847bc39957f207fad0eb2470d5c13e10c34d01ad18323a
@@ -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" }) %>
@@ -10,6 +10,7 @@ examples:
10
10
  - button_options: Button Additional Options
11
11
  - button_size: Button Size
12
12
  - button_form: Button Form Attribute
13
+
13
14
  react:
14
15
  - button_default: Button Variants
15
16
  - button_full_width: Button Full Width
@@ -53,7 +53,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
53
53
  };
54
54
 
55
55
  @each $name, $shadow in $box_shadows {
56
- &[class*=_#{$name}] {
56
+ &[class^=_#{$name}] {
57
57
  box-shadow: $shadow;
58
58
  }
59
59
  }
@@ -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
  },